ih264_buf_mgr_size:
   93|   303k|{
   94|   303k|    WORD32 size;
   95|       |
   96|   303k|    size = sizeof(buf_mgr_t);
   97|   303k|    size += ithread_get_mutex_lock_size();
   98|       |
   99|   303k|    return size;
  100|   303k|}
ih264_buf_mgr_lock:
  120|  1.50M|{
  121|  1.50M|    WORD32 retval;
  122|       |
  123|  1.50M|    retval = ithread_mutex_lock(ps_buf_mgr->pv_mutex);
  124|  1.50M|    if(retval)
  ------------------
  |  Branch (124:8): [True: 0, False: 1.50M]
  ------------------
  125|      0|        return IH264_FAIL;
  126|  1.50M|    return IH264_SUCCESS;
  127|  1.50M|}
ih264_buf_mgr_unlock:
  147|  1.50M|{
  148|  1.50M|    WORD32 retval;
  149|       |
  150|  1.50M|    retval = ithread_mutex_unlock(ps_buf_mgr->pv_mutex);
  151|  1.50M|    if(retval)
  ------------------
  |  Branch (151:8): [True: 0, False: 1.50M]
  ------------------
  152|      0|        return IH264_FAIL;
  153|  1.50M|    return IH264_SUCCESS;
  154|  1.50M|}
ih264_buf_mgr_free:
  211|  48.4k|{
  212|  48.4k|    WORD32 ret;
  213|       |
  214|  48.4k|    ret = ithread_mutex_destroy(ps_buf_mgr->pv_mutex);
  215|  48.4k|    if(0 == ret)
  ------------------
  |  Branch (215:8): [True: 48.4k, False: 0]
  ------------------
  216|  48.4k|        return IH264_SUCCESS;
  217|      0|    return IH264_FAIL;
  218|  48.4k|}
ih264_buf_mgr_init:
  238|  49.0k|{
  239|  49.0k|    WORD32 id;
  240|  49.0k|    UWORD8 *pu1_buf = (UWORD8 *)pv_buf;
  241|  49.0k|    buf_mgr_t *ps_buf_mgr = (buf_mgr_t *)pu1_buf;
  242|       |
  243|  49.0k|    pu1_buf += sizeof(buf_mgr_t);
  244|  49.0k|    ps_buf_mgr->pv_mutex = pu1_buf;
  245|       |
  246|  49.0k|    pu1_buf += ithread_get_mutex_lock_size();
  247|  49.0k|    ithread_mutex_init(ps_buf_mgr->pv_mutex);
  248|       |
  249|  49.0k|    ps_buf_mgr->i4_max_buf_cnt = BUF_MGR_MAX_CNT;
  ------------------
  |  |   44|  49.0k|#define BUF_MGR_MAX_CNT 64
  ------------------
  250|  49.0k|    ps_buf_mgr->i4_active_buf_cnt = 0;
  251|  3.19M|    for(id = 0; id < BUF_MGR_MAX_CNT; id++)
  ------------------
  |  |   44|  3.19M|#define BUF_MGR_MAX_CNT 64
  ------------------
  |  Branch (251:17): [True: 3.14M, False: 49.0k]
  ------------------
  252|  3.14M|    {
  253|  3.14M|        ps_buf_mgr->au4_status[id] = 0;
  254|  3.14M|        ps_buf_mgr->apv_ptr[id] = NULL;
  255|  3.14M|    }
  256|       |
  257|  49.0k|    return ps_buf_mgr;
  258|  49.0k|}
ih264_buf_mgr_reset:
  278|   157k|{
  279|   157k|    WORD32 id;
  280|   157k|    buf_mgr_t *ps_buf_mgr;
  281|       |
  282|   157k|    ps_buf_mgr = (buf_mgr_t *) pv_buf_mgr;
  283|       |
  284|  10.2M|    for(id = 0; id < BUF_MGR_MAX_CNT; id++)
  ------------------
  |  |   44|  10.2M|#define BUF_MGR_MAX_CNT 64
  ------------------
  |  Branch (284:17): [True: 10.0M, False: 157k]
  ------------------
  285|  10.0M|    {
  286|  10.0M|        ps_buf_mgr->au4_status[id] = 0;
  287|  10.0M|    }
  288|       |
  289|   157k|    return;
  290|   157k|}
ih264_buf_mgr_add:
  320|   489k|{
  321|   489k|    IH264_ERROR_T ret = IH264_SUCCESS;
  322|       |
  323|   489k|    ret = ih264_buf_mgr_lock(ps_buf_mgr);
  324|   489k|    RETURN_IF((ret != IH264_SUCCESS), ret);
  ------------------
  |  |   44|   489k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 489k]
  |  |  ------------------
  ------------------
  325|       |
  326|       |    /* Check if buffer ID is within allowed range */
  327|   489k|    if(buf_id >= ps_buf_mgr->i4_max_buf_cnt)
  ------------------
  |  Branch (327:8): [True: 0, False: 489k]
  ------------------
  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|   489k|    if((ps_buf_mgr->apv_ptr[buf_id] != NULL) &&
  ------------------
  |  Branch (335:8): [True: 0, False: 489k]
  ------------------
  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|   489k|    ps_buf_mgr->apv_ptr[buf_id] = pv_ptr;
  343|   489k|    ps_buf_mgr->i4_active_buf_cnt++;
  344|       |
  345|   489k|    ret = ih264_buf_mgr_unlock(ps_buf_mgr);
  346|   489k|    RETURN_IF((ret != IH264_SUCCESS), ret);
  ------------------
  |  |   44|   489k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 489k]
  |  |  ------------------
  ------------------
  347|       |
  348|   489k|    return ret;
  349|   489k|}
ih264_buf_mgr_get_next_free:
  374|   268k|{
  375|   268k|    WORD32 id;
  376|   268k|    void *pv_ret_ptr = NULL;
  377|   268k|    IH264_ERROR_T ret = IH264_SUCCESS;
  378|       |
  379|   268k|    ret = ih264_buf_mgr_lock(ps_buf_mgr);
  380|   268k|    RETURN_IF((ret != IH264_SUCCESS), NULL);
  ------------------
  |  |   44|   268k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 268k]
  |  |  ------------------
  ------------------
  381|       |
  382|   589k|    for(id = 0; id < ps_buf_mgr->i4_active_buf_cnt; id++)
  ------------------
  |  Branch (382:17): [True: 587k, False: 1.62k]
  ------------------
  383|   587k|    {
  384|       |        /* Check if the buffer is non-null and status is zero */
  385|   587k|        if((ps_buf_mgr->au4_status[id] == 0) && (ps_buf_mgr->apv_ptr[id]))
  ------------------
  |  Branch (385:12): [True: 266k, False: 320k]
  |  Branch (385:49): [True: 266k, False: 0]
  ------------------
  386|   266k|        {
  387|   266k|            *pi4_buf_id = id;
  388|       |            /* mark buffer as busy before returning */
  389|   266k|            ps_buf_mgr->au4_status[id] = 1;
  390|   266k|            pv_ret_ptr = ps_buf_mgr->apv_ptr[id];
  391|   266k|            break;
  392|   266k|        }
  393|   587k|    }
  394|   268k|    ret = ih264_buf_mgr_unlock(ps_buf_mgr);
  395|   268k|    RETURN_IF((ret != IH264_SUCCESS), NULL);
  ------------------
  |  |   44|   268k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 268k]
  |  |  ------------------
  ------------------
  396|       |
  397|   268k|    return pv_ret_ptr;
  398|   268k|}
ih264_buf_mgr_release:
  470|   405k|{
  471|   405k|    IH264_ERROR_T ret = IH264_SUCCESS;
  472|       |
  473|   405k|    ret = ih264_buf_mgr_lock(ps_buf_mgr);
  474|   405k|    RETURN_IF((ret != IH264_SUCCESS), ret);
  ------------------
  |  |   44|   405k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 405k]
  |  |  ------------------
  ------------------
  475|       |
  476|       |    /* If the given id is pointing to an id which is not yet added */
  477|   405k|    if(buf_id >= ps_buf_mgr->i4_active_buf_cnt)
  ------------------
  |  Branch (477:8): [True: 95.4k, False: 310k]
  ------------------
  478|  95.4k|    {
  479|  95.4k|        ret = ih264_buf_mgr_unlock(ps_buf_mgr);
  480|  95.4k|        RETURN_IF((ret != IH264_SUCCESS), ret);
  ------------------
  |  |   44|  95.4k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 95.4k]
  |  |  ------------------
  ------------------
  481|  95.4k|        return IH264_FAIL;
  482|  95.4k|    }
  483|       |
  484|   310k|    ps_buf_mgr->au4_status[buf_id] &= ~mask;
  485|       |
  486|       |    /* If both the REF and DISP are zero, DEC is set to zero */
  487|   310k|    if(ps_buf_mgr->au4_status[buf_id] == 1)
  ------------------
  |  Branch (487:8): [True: 156k, False: 153k]
  ------------------
  488|   156k|    {
  489|   156k|        ps_buf_mgr->au4_status[buf_id] = 0;
  490|   156k|    }
  491|       |
  492|   310k|    ret = ih264_buf_mgr_unlock(ps_buf_mgr);
  493|   310k|    RETURN_IF((ret != IH264_SUCCESS), ret);
  ------------------
  |  |   44|   310k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 310k]
  |  |  ------------------
  ------------------
  494|       |
  495|   310k|    return ret;
  496|   310k|}
ih264_buf_mgr_set_status:
  525|   344k|{
  526|   344k|    IH264_ERROR_T ret = IH264_SUCCESS;
  527|       |
  528|   344k|    ret = ih264_buf_mgr_lock(ps_buf_mgr);
  529|   344k|    RETURN_IF((ret != IH264_SUCCESS), ret);
  ------------------
  |  |   44|   344k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 344k]
  |  |  ------------------
  ------------------
  530|       |
  531|   344k|    if(buf_id >= ps_buf_mgr->i4_active_buf_cnt)
  ------------------
  |  Branch (531:8): [True: 0, False: 344k]
  ------------------
  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|   344k|    if((ps_buf_mgr->au4_status[buf_id] & mask) != 0)
  ------------------
  |  Branch (538:8): [True: 0, False: 344k]
  ------------------
  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|   344k|    ps_buf_mgr->au4_status[buf_id] |= mask;
  546|   344k|    ret = ih264_buf_mgr_unlock(ps_buf_mgr);
  547|   344k|    RETURN_IF((ret != IH264_SUCCESS), ret);
  ------------------
  |  |   44|   344k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 344k]
  |  |  ------------------
  ------------------
  548|       |
  549|   344k|    return ret;
  550|   344k|}

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

ih264_deblk_luma_vert_bs4:
  108|  50.4k|{
  109|  50.4k|    UWORD8 p3, p2, p1, p0, q0, q1, q2, q3;
  110|  50.4k|    WORD32 pos_p3, pos_p2, pos_p1, pos_p0;
  111|  50.4k|    WORD32 pos_q0, pos_q1, pos_q2,pos_q3;
  112|  50.4k|    UWORD8 a_p, a_q; /* threshold variables */
  113|  50.4k|    WORD32 blk_strd = src_strd << 2; /* block_increment = src_strd * 4 */
  114|  50.4k|    UWORD8 *pu1_src_temp;
  115|  50.4k|    WORD8 i = 0, edge;
  116|       |
  117|  50.4k|    pos_q0 = 0;
  118|  50.4k|    pos_q1 = 1;
  119|  50.4k|    pos_q2 = 2;
  120|  50.4k|    pos_q3 = 3;
  121|  50.4k|    pos_p0 = -1;
  122|  50.4k|    pos_p1 = -2;
  123|  50.4k|    pos_p2 = -3;
  124|  50.4k|    pos_p3 = -4;
  125|       |
  126|   252k|    for(edge = 0; edge < 4; edge++, pu1_src += blk_strd)
  ------------------
  |  Branch (126:19): [True: 201k, False: 50.4k]
  ------------------
  127|   201k|    {
  128|   201k|        pu1_src_temp = pu1_src;
  129|  1.00M|        for(i = 0; i < 4; ++i, pu1_src_temp += src_strd)
  ------------------
  |  Branch (129:20): [True: 807k, False: 201k]
  ------------------
  130|   807k|        {
  131|   807k|            q0 = pu1_src_temp[pos_q0];
  132|   807k|            q1 = pu1_src_temp[pos_q1];
  133|   807k|            p0 = pu1_src_temp[pos_p0];
  134|   807k|            p1 = pu1_src_temp[pos_p1];
  135|       |
  136|       |            /* Filter Decision */
  137|   807k|            if((ABS(p0 - q0) >= alpha) ||
  ------------------
  |  |  100|   807k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 182k, False: 625k]
  |  |  ------------------
  ------------------
  |  Branch (137:16): [True: 180k, False: 626k]
  ------------------
  138|   626k|               (ABS(q1 - q0) >= beta)  ||
  ------------------
  |  |  100|   626k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 50.5k, False: 576k]
  |  |  ------------------
  ------------------
  |  Branch (138:16): [True: 23.0k, False: 603k]
  ------------------
  139|   603k|               (ABS(p1 - p0) >= beta))
  ------------------
  |  |  100|   603k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 39.9k, False: 563k]
  |  |  ------------------
  ------------------
  |  Branch (139:16): [True: 14.6k, False: 589k]
  ------------------
  140|   218k|                continue;
  141|       |
  142|   589k|            p2 = pu1_src_temp[pos_p2];
  143|   589k|            p3 = pu1_src_temp[pos_p3];
  144|   589k|            q2 = pu1_src_temp[pos_q2];
  145|   589k|            q3 = pu1_src_temp[pos_q3];
  146|       |
  147|   589k|            if(ABS(p0 - q0) < ((alpha >> 2) + 2))
  ------------------
  |  |  100|   589k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 126k, False: 462k]
  |  |  ------------------
  ------------------
  |  Branch (147:16): [True: 562k, False: 26.3k]
  ------------------
  148|   562k|            {
  149|       |                /* Threshold Variables */
  150|   562k|                a_p = (UWORD8)ABS(p2 - p0);
  ------------------
  |  |  100|   562k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 50.1k, False: 512k]
  |  |  ------------------
  ------------------
  151|   562k|                a_q = (UWORD8)ABS(q2 - q0);
  ------------------
  |  |  100|   562k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 37.7k, False: 524k]
  |  |  ------------------
  ------------------
  152|       |
  153|   562k|                if(a_p < beta)
  ------------------
  |  Branch (153:20): [True: 557k, False: 5.54k]
  ------------------
  154|   557k|                {
  155|       |                    /* p0', p1', p2' */
  156|   557k|                    pu1_src_temp[pos_p0] = ((p2 + X2(p1) + X2(p0) + X2(q0) + q1
  ------------------
  |  |   91|   557k|#define X2(a)   ((a) << 1)
  ------------------
                                  pu1_src_temp[pos_p0] = ((p2 + X2(p1) + X2(p0) + X2(q0) + q1
  ------------------
  |  |   91|   557k|#define X2(a)   ((a) << 1)
  ------------------
                                  pu1_src_temp[pos_p0] = ((p2 + X2(p1) + X2(p0) + X2(q0) + q1
  ------------------
  |  |   91|   557k|#define X2(a)   ((a) << 1)
  ------------------
  157|   557k|                                    + 4) >> 3);
  158|   557k|                    pu1_src_temp[pos_p1] = ((p2 + p1 + p0 + q0 + 2) >> 2);
  159|   557k|                    pu1_src_temp[pos_p2] =
  160|   557k|                                    ((X2(p3) + X3(p2) + p1 + p0 + q0
  ------------------
  |  |   91|   557k|#define X2(a)   ((a) << 1)
  ------------------
                                                  ((X2(p3) + X3(p2) + p1 + p0 + q0
  ------------------
  |  |   92|   557k|#define X3(a)   (((a) << 1) + (a))
  ------------------
  161|   557k|                                                    + 4) >> 3);
  162|   557k|                }
  163|  5.54k|                else
  164|  5.54k|                {
  165|       |                    /* p0'*/
  166|  5.54k|                    pu1_src_temp[pos_p0] = ((X2(p1) + p0 + q1 + 2) >> 2);
  ------------------
  |  |   91|  5.54k|#define X2(a)   ((a) << 1)
  ------------------
  167|  5.54k|                }
  168|       |
  169|   562k|                if(a_q < beta)
  ------------------
  |  Branch (169:20): [True: 556k, False: 6.12k]
  ------------------
  170|   556k|                {
  171|       |                    /* q0', q1', q2' */
  172|   556k|                    pu1_src_temp[pos_q0] = (p1 + X2(p0) + X2(q0) + X2(q1) + q2
  ------------------
  |  |   91|   556k|#define X2(a)   ((a) << 1)
  ------------------
                                  pu1_src_temp[pos_q0] = (p1 + X2(p0) + X2(q0) + X2(q1) + q2
  ------------------
  |  |   91|   556k|#define X2(a)   ((a) << 1)
  ------------------
                                  pu1_src_temp[pos_q0] = (p1 + X2(p0) + X2(q0) + X2(q1) + q2
  ------------------
  |  |   91|   556k|#define X2(a)   ((a) << 1)
  ------------------
  173|   556k|                                    + 4) >> 3;
  174|   556k|                    pu1_src_temp[pos_q1] = (p0 + q0 + q1 + q2 + 2) >> 2;
  175|   556k|                    pu1_src_temp[pos_q2] = (X2(q3) + X3(q2) + q1 + q0 + p0 + 4)
  ------------------
  |  |   91|   556k|#define X2(a)   ((a) << 1)
  ------------------
                                  pu1_src_temp[pos_q2] = (X2(q3) + X3(q2) + q1 + q0 + p0 + 4)
  ------------------
  |  |   92|   556k|#define X3(a)   (((a) << 1) + (a))
  ------------------
  176|   556k|                                    >> 3;
  177|   556k|                }
  178|  6.12k|                else
  179|  6.12k|                {
  180|       |                    /* q0'*/
  181|  6.12k|                    pu1_src_temp[pos_q0] = (X2(q1) + q0 + p1 + 2) >> 2;
  ------------------
  |  |   91|  6.12k|#define X2(a)   ((a) << 1)
  ------------------
  182|  6.12k|                }
  183|   562k|            }
  184|  26.3k|            else
  185|  26.3k|            {
  186|       |                /* p0', q0'*/
  187|  26.3k|                pu1_src_temp[pos_p0] = ((X2(p1) + p0 + q1 + 2) >> 2);
  ------------------
  |  |   91|  26.3k|#define X2(a)   ((a) << 1)
  ------------------
  188|  26.3k|                pu1_src_temp[pos_q0] = (X2(q1) + q0 + p1 + 2) >> 2;
  ------------------
  |  |   91|  26.3k|#define X2(a)   ((a) << 1)
  ------------------
  189|  26.3k|            }
  190|   589k|        }
  191|   201k|    }
  192|  50.4k|}
ih264_deblk_luma_horz_bs4:
  226|  62.8k|{
  227|  62.8k|    UWORD8 p3, p2, p1, p0, q0, q1, q2, q3;
  228|  62.8k|    WORD32 pos_p3, pos_p2, pos_p1, pos_p0, pos_q0, pos_q1,
  229|  62.8k|                    pos_q2, pos_q3;
  230|  62.8k|    UWORD8 a_p, a_q; /* threshold variables */
  231|  62.8k|    UWORD8 *pu1_p3; /* pointer to the src sample p3 */
  232|  62.8k|    UWORD8 *pu1_p3_temp;
  233|  62.8k|    UWORD8 *pu1_src_temp;
  234|  62.8k|    WORD8 i = 0, edge;
  235|       |
  236|  62.8k|    pu1_p3 = pu1_src - (src_strd << 2);
  237|  62.8k|    pos_q0 = 0;
  238|  62.8k|    pos_q1 = src_strd;
  239|  62.8k|    pos_q2 = X2(src_strd);
  ------------------
  |  |   91|  62.8k|#define X2(a)   ((a) << 1)
  ------------------
  240|  62.8k|    pos_q3 = X3(src_strd);
  ------------------
  |  |   92|  62.8k|#define X3(a)   (((a) << 1) + (a))
  ------------------
  241|  62.8k|    pos_p0 = X3(src_strd);
  ------------------
  |  |   92|  62.8k|#define X3(a)   (((a) << 1) + (a))
  ------------------
  242|  62.8k|    pos_p1 = X2(src_strd);
  ------------------
  |  |   91|  62.8k|#define X2(a)   ((a) << 1)
  ------------------
  243|  62.8k|    pos_p2 = src_strd;
  244|  62.8k|    pos_p3 = 0;
  245|       |
  246|   314k|    for(edge = 0; edge < 4; edge++, pu1_src += 4, pu1_p3 += 4)
  ------------------
  |  Branch (246:19): [True: 251k, False: 62.8k]
  ------------------
  247|   251k|    {
  248|   251k|        pu1_src_temp = pu1_src;
  249|   251k|        pu1_p3_temp = pu1_p3;
  250|  1.25M|        for(i = 0; i < 4; ++i, pu1_src_temp++, pu1_p3_temp++)
  ------------------
  |  Branch (250:20): [True: 1.00M, False: 251k]
  ------------------
  251|  1.00M|        {
  252|  1.00M|            q0 = pu1_src_temp[pos_q0];
  253|  1.00M|            q1 = pu1_src_temp[pos_q1];
  254|  1.00M|            p0 = pu1_p3_temp[pos_p0];
  255|  1.00M|            p1 = pu1_p3_temp[pos_p1];
  256|       |
  257|       |            /* Filter Decision */
  258|  1.00M|            if((ABS(p0 - q0) >= alpha) ||
  ------------------
  |  |  100|  1.00M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 208k, False: 797k]
  |  |  ------------------
  ------------------
  |  Branch (258:16): [True: 221k, False: 784k]
  ------------------
  259|   784k|               (ABS(q1 - q0) >= beta) ||
  ------------------
  |  |  100|   784k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 62.7k, False: 721k]
  |  |  ------------------
  ------------------
  |  Branch (259:16): [True: 23.8k, False: 760k]
  ------------------
  260|   760k|               (ABS(p1 - p0) >= beta))
  ------------------
  |  |  100|   760k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 50.3k, False: 710k]
  |  |  ------------------
  ------------------
  |  Branch (260:16): [True: 19.8k, False: 740k]
  ------------------
  261|   264k|                continue;
  262|       |
  263|   740k|            p2 = pu1_p3_temp[pos_p2];
  264|   740k|            p3 = pu1_p3_temp[pos_p3];
  265|   740k|            q2 = pu1_src_temp[pos_q2];
  266|   740k|            q3 = pu1_src_temp[pos_q3];
  267|       |
  268|   740k|            if(ABS(p0 - q0) < ((alpha >> 2) + 2))
  ------------------
  |  |  100|   740k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 135k, False: 604k]
  |  |  ------------------
  ------------------
  |  Branch (268:16): [True: 692k, False: 48.5k]
  ------------------
  269|   692k|            {
  270|       |                /* Threshold Variables */
  271|   692k|                a_p = ABS(p2 - p0);
  ------------------
  |  |  100|   692k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 55.5k, False: 636k]
  |  |  ------------------
  ------------------
  272|   692k|                a_q = ABS(q2 - q0);
  ------------------
  |  |  100|   692k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 58.0k, False: 633k]
  |  |  ------------------
  ------------------
  273|       |
  274|   692k|                if((a_p < beta))
  ------------------
  |  Branch (274:20): [True: 680k, False: 11.3k]
  ------------------
  275|   680k|                {
  276|       |                    /* p0', p1', p2' */
  277|   680k|                    pu1_p3_temp[pos_p0] = (p2 + X2(p1) + X2(p0) + X2(q0) + q1
  ------------------
  |  |   91|   680k|#define X2(a)   ((a) << 1)
  ------------------
                                  pu1_p3_temp[pos_p0] = (p2 + X2(p1) + X2(p0) + X2(q0) + q1
  ------------------
  |  |   91|   680k|#define X2(a)   ((a) << 1)
  ------------------
                                  pu1_p3_temp[pos_p0] = (p2 + X2(p1) + X2(p0) + X2(q0) + q1
  ------------------
  |  |   91|   680k|#define X2(a)   ((a) << 1)
  ------------------
  278|   680k|                                    + 4) >> 3;
  279|   680k|                    pu1_p3_temp[pos_p1] = (p2 + p1 + p0 + q0 + 2) >> 2;
  280|   680k|                    pu1_p3_temp[pos_p2] =
  281|   680k|                                    (X2(p3) + X3(p2) + p1 + p0 + q0
  ------------------
  |  |   91|   680k|#define X2(a)   ((a) << 1)
  ------------------
                                                  (X2(p3) + X3(p2) + p1 + p0 + q0
  ------------------
  |  |   92|   680k|#define X3(a)   (((a) << 1) + (a))
  ------------------
  282|   680k|                                                    + 4) >> 3;
  283|   680k|                }
  284|  11.3k|                else
  285|  11.3k|                {
  286|       |                    /* p0'*/
  287|  11.3k|                    pu1_p3_temp[pos_p0] = (X2(p1) + p0 + q1 + 2) >> 2;
  ------------------
  |  |   91|  11.3k|#define X2(a)   ((a) << 1)
  ------------------
  288|  11.3k|                }
  289|       |
  290|   692k|                if(a_q < beta)
  ------------------
  |  Branch (290:20): [True: 680k, False: 12.0k]
  ------------------
  291|   680k|                {
  292|       |                    /* q0', q1', q2' */
  293|   680k|                    pu1_src_temp[pos_q0] = (p1 + X2(p0) + X2(q0) + X2(q1)
  ------------------
  |  |   91|   680k|#define X2(a)   ((a) << 1)
  ------------------
                                  pu1_src_temp[pos_q0] = (p1 + X2(p0) + X2(q0) + X2(q1)
  ------------------
  |  |   91|   680k|#define X2(a)   ((a) << 1)
  ------------------
                                  pu1_src_temp[pos_q0] = (p1 + X2(p0) + X2(q0) + X2(q1)
  ------------------
  |  |   91|   680k|#define X2(a)   ((a) << 1)
  ------------------
  294|   680k|                                    + q2 + 4) >> 3;
  295|   680k|                    pu1_src_temp[pos_q1] = (p0 + q0 + q1 + q2 + 2) >> 2;
  296|   680k|                    pu1_src_temp[pos_q2] = (X2(q3) + X3(q2) + q1 + q0 + p0
  ------------------
  |  |   91|   680k|#define X2(a)   ((a) << 1)
  ------------------
                                  pu1_src_temp[pos_q2] = (X2(q3) + X3(q2) + q1 + q0 + p0
  ------------------
  |  |   92|   680k|#define X3(a)   (((a) << 1) + (a))
  ------------------
  297|   680k|                                    + 4) >> 3;
  298|   680k|                }
  299|  12.0k|                else
  300|  12.0k|                {
  301|       |                    /* q0'*/
  302|  12.0k|                    pu1_src_temp[pos_q0] = (X2(q1) + q0 + p1 + 2) >> 2;
  ------------------
  |  |   91|  12.0k|#define X2(a)   ((a) << 1)
  ------------------
  303|  12.0k|                }
  304|   692k|            }
  305|  48.5k|            else
  306|  48.5k|            {
  307|       |                /* p0', q0'*/
  308|  48.5k|                pu1_p3_temp[pos_p0] = (X2(p1) + p0 + q1 + 2) >> 2;
  ------------------
  |  |   91|  48.5k|#define X2(a)   ((a) << 1)
  ------------------
  309|  48.5k|                pu1_src_temp[pos_q0] = (X2(q1) + q0 + p1 + 2) >> 2;
  ------------------
  |  |   91|  48.5k|#define X2(a)   ((a) << 1)
  ------------------
  310|  48.5k|            }
  311|   740k|        }
  312|   251k|    }
  313|  62.8k|}
ih264_deblk_luma_vert_bslt4:
  538|   298k|{
  539|   298k|    WORD8 i = 0, edge;
  540|   298k|    UWORD8 p2, p1, p0, q0, q1, q2;
  541|   298k|    WORD32 pos_p2, pos_p1, pos_p0, pos_q0, pos_q1, pos_q2;
  542|   298k|    UWORD8 a_p, a_q; /* threshold variables */
  543|   298k|    WORD32 blk_strd = src_strd << 2; /* block_increment = src_strd * 4 */
  544|   298k|    UWORD8 *pu1_src_temp;
  545|   298k|    WORD8 delta;
  546|   298k|    WORD8 tc;
  547|   298k|    WORD16 val;
  548|   298k|    UWORD8 tc0, u1_bs;
  549|       |
  550|   298k|    pos_q0 = 0;
  551|   298k|    pos_q1 = 1;
  552|   298k|    pos_q2 = 2;
  553|   298k|    pos_p0 = -1;
  554|   298k|    pos_p1 = -2;
  555|   298k|    pos_p2 = -3;
  556|       |
  557|  1.49M|    for(edge = 0; edge < 4; edge++, pu1_src += blk_strd)
  ------------------
  |  Branch (557:19): [True: 1.19M, False: 298k]
  ------------------
  558|  1.19M|    {
  559|  1.19M|        pu1_src_temp = pu1_src;
  560|       |        /* Filter Decision */
  561|  1.19M|        u1_bs = (UWORD8)((u4_bs >> ((3 - edge) << 3)) & 0x0ff);
  562|  1.19M|        if(!u1_bs)
  ------------------
  |  Branch (562:12): [True: 100k, False: 1.09M]
  ------------------
  563|   100k|            continue;
  564|       |        /* tc0 */
  565|  1.09M|        tc0 = pu1_cliptab[u1_bs];
  566|  5.46M|        for(i = 0; i < 4; ++i, pu1_src_temp += src_strd)
  ------------------
  |  Branch (566:20): [True: 4.37M, False: 1.09M]
  ------------------
  567|  4.37M|        {
  568|  4.37M|            q0 = pu1_src_temp[pos_q0];
  569|  4.37M|            q1 = pu1_src_temp[pos_q1];
  570|  4.37M|            p0 = pu1_src_temp[pos_p0];
  571|  4.37M|            p1 = pu1_src_temp[pos_p1];
  572|       |
  573|       |            /* Filter Decision */
  574|  4.37M|            if((ABS(p0 - q0) >= alpha) ||
  ------------------
  |  |  100|  4.37M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 634k, False: 3.73M]
  |  |  ------------------
  ------------------
  |  Branch (574:16): [True: 756k, False: 3.61M]
  ------------------
  575|  3.61M|               (ABS(q1 - q0) >= beta) ||
  ------------------
  |  |  100|  3.61M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 252k, False: 3.36M]
  |  |  ------------------
  ------------------
  |  Branch (575:16): [True: 155k, False: 3.46M]
  ------------------
  576|  3.46M|               (ABS(p1 - p0) >= beta))
  ------------------
  |  |  100|  3.46M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 271k, False: 3.18M]
  |  |  ------------------
  ------------------
  |  Branch (576:16): [True: 99.0k, False: 3.36M]
  ------------------
  577|  1.01M|                continue;
  578|       |
  579|  3.36M|            q2 = pu1_src_temp[pos_q2];
  580|  3.36M|            p2 = pu1_src_temp[pos_p2];
  581|       |
  582|  3.36M|            a_p = ABS(p2 - p0);
  ------------------
  |  |  100|  3.36M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 318k, False: 3.04M]
  |  |  ------------------
  ------------------
  583|  3.36M|            a_q = ABS(q2 - q0);
  ------------------
  |  |  100|  3.36M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 206k, False: 3.15M]
  |  |  ------------------
  ------------------
  584|       |
  585|       |            /* tc */
  586|  3.36M|            tc = tc0 + (a_p < beta) + (a_q < beta);
  587|       |
  588|  3.36M|            val = ((((q0 - p0) << 2) + (p1 - q1) + 4) >> 3);
  589|  3.36M|            delta = CLIP3(-tc, tc, val);
  ------------------
  |  |   77|  3.36M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 38.8k, False: 3.32M]
  |  |  |  Branch (77:54): [True: 42.6k, False: 3.27M]
  |  |  ------------------
  ------------------
  590|       |
  591|       |            /* p0' */
  592|  3.36M|            val = p0 + delta;
  593|  3.36M|            pu1_src_temp[pos_p0] = CLIP_U8(val);
  ------------------
  |  |   58|  3.36M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  3.36M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 2.10k, False: 3.35M]
  |  |  |  |  |  Branch (77:54): [True: 382, False: 3.35M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  594|       |            /* q0' */
  595|  3.36M|            val = q0 - delta;
  596|  3.36M|            pu1_src_temp[pos_q0] = CLIP_U8(val);
  ------------------
  |  |   58|  3.36M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  3.36M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 2.78k, False: 3.35M]
  |  |  |  |  |  Branch (77:54): [True: 464, False: 3.35M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  597|       |
  598|       |            /* Luma only */
  599|  3.36M|            if(a_p < beta)
  ------------------
  |  Branch (599:16): [True: 3.26M, False: 92.6k]
  ------------------
  600|  3.26M|            {
  601|       |                /* p1' */
  602|  3.26M|                val = ((p2 + ((p0 + q0 + 1) >> 1) - (p1 << 1)) >> 1);
  603|  3.26M|                pu1_src_temp[pos_p1] += CLIP3(-tc0, tc0, val);
  ------------------
  |  |   77|  3.26M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 43.3k, False: 3.22M]
  |  |  |  Branch (77:54): [True: 46.9k, False: 3.17M]
  |  |  ------------------
  ------------------
  604|  3.26M|            }
  605|       |
  606|  3.36M|            if(a_q < beta)
  ------------------
  |  Branch (606:16): [True: 3.28M, False: 76.6k]
  ------------------
  607|  3.28M|            {
  608|       |                /* q1' */
  609|  3.28M|                val = ((q2 + ((p0 + q0 + 1) >> 1) - (q1 << 1)) >> 1);
  610|  3.28M|                pu1_src_temp[pos_q1] += CLIP3(-tc0, tc0, val);
  ------------------
  |  |   77|  3.28M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 49.9k, False: 3.23M]
  |  |  |  Branch (77:54): [True: 45.4k, False: 3.18M]
  |  |  ------------------
  ------------------
  611|  3.28M|            }
  612|  3.36M|        }
  613|  1.09M|    }
  614|   298k|}
ih264_deblk_luma_horz_bslt4:
  772|   321k|{
  773|   321k|    UWORD8 p2, p1, p0, q0, q1, q2;
  774|   321k|    WORD32 pos_p2, pos_p1, pos_p0, pos_q0, pos_q1, pos_q2;
  775|   321k|    UWORD8 a_p, a_q; /* Threshold variables */
  776|   321k|    UWORD8 *pu1_p2; /* Pointer to the src sample p2 */
  777|   321k|    UWORD8 *pu1_p2_temp;
  778|   321k|    UWORD8 *pu1_src_temp;
  779|   321k|    WORD8 i = 0, edge;
  780|   321k|    WORD8 delta;
  781|   321k|    WORD8 tc;
  782|   321k|    WORD16 val;
  783|   321k|    UWORD8 tc0, u1_bs;
  784|       |
  785|   321k|    pu1_p2 = pu1_src - (src_strd << 2);
  786|   321k|    pos_q0 = 0;
  787|   321k|    pos_q1 = src_strd;
  788|   321k|    pos_q2 = X2(src_strd);
  ------------------
  |  |   91|   321k|#define X2(a)   ((a) << 1)
  ------------------
  789|   321k|    pos_p0 = X3(src_strd);
  ------------------
  |  |   92|   321k|#define X3(a)   (((a) << 1) + (a))
  ------------------
  790|   321k|    pos_p1 = X2(src_strd);
  ------------------
  |  |   91|   321k|#define X2(a)   ((a) << 1)
  ------------------
  791|   321k|    pos_p2 = src_strd;
  792|       |
  793|  1.60M|    for(edge = 0; edge < 4; edge++, pu1_src += 4, pu1_p2 += 4)
  ------------------
  |  Branch (793:19): [True: 1.28M, False: 321k]
  ------------------
  794|  1.28M|    {
  795|  1.28M|        pu1_src_temp = pu1_src;
  796|  1.28M|        pu1_p2_temp = pu1_p2;
  797|       |
  798|       |        /* Filter Decision */
  799|  1.28M|        u1_bs = (UWORD8)((u4_bs >> ((3 - edge) << 3)) & 0x0ff);
  800|  1.28M|        if(!u1_bs)
  ------------------
  |  Branch (800:12): [True: 111k, False: 1.17M]
  ------------------
  801|   111k|            continue;
  802|       |        /* tc0 */
  803|  1.17M|        tc0 = pu1_cliptab[u1_bs];
  804|       |
  805|  5.87M|        for(i = 0; i < 4; ++i, pu1_src_temp++, pu1_p2_temp++)
  ------------------
  |  Branch (805:20): [True: 4.69M, False: 1.17M]
  ------------------
  806|  4.69M|        {
  807|  4.69M|            q0 = pu1_src_temp[pos_q0];
  808|  4.69M|            q1 = pu1_src_temp[pos_q1];
  809|  4.69M|            p0 = pu1_p2_temp[pos_p0];
  810|  4.69M|            p1 = pu1_p2_temp[pos_p1];
  811|       |
  812|       |            /* Filter Decision */
  813|  4.69M|            if((ABS(p0 - q0) >= alpha) ||
  ------------------
  |  |  100|  4.69M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 687k, False: 4.01M]
  |  |  ------------------
  ------------------
  |  Branch (813:16): [True: 818k, False: 3.87M]
  ------------------
  814|  3.87M|               (ABS(q1 - q0) >= beta) ||
  ------------------
  |  |  100|  3.87M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 283k, False: 3.59M]
  |  |  ------------------
  ------------------
  |  Branch (814:16): [True: 186k, False: 3.69M]
  ------------------
  815|  3.69M|               (ABS(p1 - p0) >= beta))
  ------------------
  |  |  100|  3.69M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 267k, False: 3.42M]
  |  |  ------------------
  ------------------
  |  Branch (815:16): [True: 121k, False: 3.57M]
  ------------------
  816|  1.12M|                continue;
  817|       |
  818|  3.57M|            q2 = pu1_src_temp[pos_q2];
  819|  3.57M|            p2 = pu1_p2_temp[pos_p2];
  820|       |
  821|  3.57M|            a_p = ABS(p2 - p0);
  ------------------
  |  |  100|  3.57M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 319k, False: 3.25M]
  |  |  ------------------
  ------------------
  822|  3.57M|            a_q = ABS(q2 - q0);
  ------------------
  |  |  100|  3.57M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 216k, False: 3.35M]
  |  |  ------------------
  ------------------
  823|       |
  824|       |            /* tc */
  825|  3.57M|            tc = tc0 + (a_p < beta) + (a_q < beta);
  826|  3.57M|            val = ((((q0 - p0) << 2) + (p1 - q1) + 4) >> 3);
  827|  3.57M|            delta = CLIP3(-tc, tc, val);
  ------------------
  |  |   77|  3.57M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 26.2k, False: 3.54M]
  |  |  |  Branch (77:54): [True: 29.9k, False: 3.51M]
  |  |  ------------------
  ------------------
  828|       |            /* p0' */
  829|  3.57M|            val = p0 + delta;
  830|  3.57M|            pu1_p2_temp[pos_p0] = CLIP_U8(val);
  ------------------
  |  |   58|  3.57M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  3.57M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 2.14k, False: 3.56M]
  |  |  |  |  |  Branch (77:54): [True: 480, False: 3.56M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  831|       |            /* q0' */
  832|  3.57M|            val = q0 - delta;
  833|  3.57M|            pu1_src_temp[pos_q0] = CLIP_U8(val);
  ------------------
  |  |   58|  3.57M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  3.57M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 3.71k, False: 3.56M]
  |  |  |  |  |  Branch (77:54): [True: 529, False: 3.56M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  834|       |
  835|       |            /* Luma */
  836|  3.57M|            if(a_p < beta)
  ------------------
  |  Branch (836:16): [True: 3.47M, False: 96.6k]
  ------------------
  837|  3.47M|            {
  838|       |                /* p1' */
  839|  3.47M|                val = ((p2 + ((p0 + q0 + 1) >> 1) - (p1 << 1)) >> 1);
  840|  3.47M|                pu1_p2_temp[pos_p1] += CLIP3(-tc0, tc0, val);
  ------------------
  |  |   77|  3.47M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 43.6k, False: 3.43M]
  |  |  |  Branch (77:54): [True: 34.1k, False: 3.39M]
  |  |  ------------------
  ------------------
  841|  3.47M|            }
  842|       |
  843|  3.57M|            if(a_q < beta)
  ------------------
  |  Branch (843:16): [True: 3.47M, False: 93.8k]
  ------------------
  844|  3.47M|            {
  845|       |                /* q1' */
  846|  3.47M|                val = ((q2 + ((p0 + q0 + 1) >> 1) - (q1 << 1)) >> 1);
  847|  3.47M|                pu1_src_temp[pos_q1] += CLIP3(-tc0, tc0, val);
  ------------------
  |  |   77|  3.47M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 37.5k, False: 3.44M]
  |  |  |  Branch (77:54): [True: 34.4k, False: 3.40M]
  |  |  ------------------
  ------------------
  848|  3.47M|            }
  849|  3.57M|        }
  850|  1.17M|    }
  851|   321k|}
ih264_deblk_chroma_vert_bs4:
 1456|  50.4k|{
 1457|  50.4k|    UWORD8 *pu1_src_u = pu1_src; /* Pointer to the src sample q0 of U */
 1458|  50.4k|    UWORD8 *pu1_src_v = pu1_src + 1; /* Pointer to the src sample q0 of V */
 1459|  50.4k|    UWORD8 p1_u, p0_u, q0_u, q1_u, p1_v, p0_v, q0_v, q1_v;
 1460|  50.4k|    WORD32 blk_strd = src_strd << 1; /* block_increment = src_strd * 2*/
 1461|  50.4k|    WORD32 pos_p1, pos_p0, pos_q0, pos_q1;
 1462|  50.4k|    UWORD8 *pu1_src_temp_u, *pu1_src_temp_v;
 1463|  50.4k|    WORD8 i = 0, edge;
 1464|       |
 1465|  50.4k|    pos_q0 = 0;
 1466|  50.4k|    pos_q1 = 2;
 1467|  50.4k|    pos_p0 = -2;
 1468|  50.4k|    pos_p1 = -4;
 1469|       |
 1470|   252k|    for(edge = 0; edge < 4;
  ------------------
  |  Branch (1470:19): [True: 201k, False: 50.4k]
  ------------------
 1471|   201k|                    edge++, pu1_src_u += blk_strd, pu1_src_v += blk_strd)
 1472|   201k|    {
 1473|   201k|        pu1_src_temp_u = pu1_src_u;
 1474|   201k|        pu1_src_temp_v = pu1_src_v;
 1475|   605k|        for(i = 0; i < 2; ++i, pu1_src_temp_u += src_strd, pu1_src_temp_v +=
  ------------------
  |  Branch (1475:20): [True: 403k, False: 201k]
  ------------------
 1476|   403k|                        src_strd)
 1477|   403k|        {
 1478|   403k|            q0_u = pu1_src_temp_u[pos_q0];
 1479|   403k|            q1_u = pu1_src_temp_u[pos_q1];
 1480|   403k|            p0_u = pu1_src_temp_u[pos_p0];
 1481|   403k|            p1_u = pu1_src_temp_u[pos_p1];
 1482|   403k|            q0_v = pu1_src_temp_v[pos_q0];
 1483|   403k|            q1_v = pu1_src_temp_v[pos_q1];
 1484|   403k|            p0_v = pu1_src_temp_v[pos_p0];
 1485|   403k|            p1_v = pu1_src_temp_v[pos_p1];
 1486|       |
 1487|       |            /* Filter Decision */
 1488|   403k|            if((ABS(p0_u - q0_u) < alpha_cb) &&
  ------------------
  |  |  100|   403k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 55.3k, False: 348k]
  |  |  ------------------
  ------------------
  |  Branch (1488:16): [True: 309k, False: 94.3k]
  ------------------
 1489|   309k|               (ABS(q1_u - q0_u) < beta_cb) &&
  ------------------
  |  |  100|   309k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 10.1k, False: 299k]
  |  |  ------------------
  ------------------
  |  Branch (1489:16): [True: 303k, False: 5.68k]
  ------------------
 1490|   303k|               (ABS(p1_u - p0_u) < beta_cb))
  ------------------
  |  |  100|   303k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 17.9k, False: 285k]
  |  |  ------------------
  ------------------
  |  Branch (1490:16): [True: 297k, False: 6.07k]
  ------------------
 1491|   297k|            {
 1492|       |                /* p0' */
 1493|   297k|                pu1_src_temp_u[pos_p0] = ((X2(p1_u) + p0_u + q1_u + 2) >> 2);
  ------------------
  |  |   91|   297k|#define X2(a)   ((a) << 1)
  ------------------
 1494|       |                /* q0' */
 1495|   297k|                pu1_src_temp_u[pos_q0] = (X2(q1_u) + q0_u + p1_u + 2) >> 2;
  ------------------
  |  |   91|   297k|#define X2(a)   ((a) << 1)
  ------------------
 1496|   297k|            }
 1497|       |
 1498|       |            /* Filter Decision */
 1499|   403k|            if((ABS(p0_v - q0_v) < alpha_cr) &&
  ------------------
  |  |  100|   403k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 46.1k, False: 357k]
  |  |  ------------------
  ------------------
  |  Branch (1499:16): [True: 308k, False: 94.7k]
  ------------------
 1500|   308k|               (ABS(q1_v - q0_v) < beta_cr) &&
  ------------------
  |  |  100|   308k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 8.06k, False: 300k]
  |  |  ------------------
  ------------------
  |  Branch (1500:16): [True: 303k, False: 5.04k]
  ------------------
 1501|   303k|               (ABS(p1_v - p0_v) < beta_cr))
  ------------------
  |  |  100|   303k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 12.8k, False: 291k]
  |  |  ------------------
  ------------------
  |  Branch (1501:16): [True: 297k, False: 5.94k]
  ------------------
 1502|   297k|            {
 1503|       |                /* p0' */
 1504|   297k|                pu1_src_temp_v[pos_p0] = ((X2(p1_v) + p0_v + q1_v + 2) >> 2);
  ------------------
  |  |   91|   297k|#define X2(a)   ((a) << 1)
  ------------------
 1505|       |                /* q0' */
 1506|   297k|                pu1_src_temp_v[pos_q0] = (X2(q1_v) + q0_v + p1_v + 2) >> 2;
  ------------------
  |  |   91|   297k|#define X2(a)   ((a) << 1)
  ------------------
 1507|   297k|            }
 1508|   403k|        }
 1509|   201k|    }
 1510|  50.4k|}
ih264_deblk_chroma_horz_bs4:
 1552|  62.8k|{
 1553|  62.8k|    UWORD8 *pu1_src_u = pu1_src; /* Pointer to the src sample q0 of U */
 1554|  62.8k|    UWORD8 *pu1_src_v = pu1_src + 1; /* Pointer to the src sample q0 of V */
 1555|  62.8k|    UWORD8 p1_u, p0_u, q0_u, q1_u, p1_v, p0_v, q0_v, q1_v;
 1556|  62.8k|    WORD32 pos_p1, pos_p0, pos_q0, pos_q1;
 1557|  62.8k|    UWORD8 *pu1_src_temp_u, *pu1_src_temp_v;
 1558|  62.8k|    UWORD8 *pu1_p1_u; /* Pointer to the src sample p1 of U */
 1559|  62.8k|    UWORD8 *pu1_p1_v; /* Pointer to the src sample p1 of U */
 1560|  62.8k|    UWORD8 *pu1_p1_temp_u, *pu1_p1_temp_v;
 1561|  62.8k|    WORD8 i = 0, edge;
 1562|       |
 1563|  62.8k|    pu1_p1_u = pu1_src_u - (src_strd << 1);
 1564|  62.8k|    pu1_p1_v = pu1_src_v - (src_strd << 1);
 1565|  62.8k|    pos_q0 = 0;
 1566|  62.8k|    pos_q1 = src_strd;
 1567|  62.8k|    pos_p0 = src_strd;
 1568|  62.8k|    pos_p1 = 0;
 1569|       |
 1570|   314k|    for(edge = 0; edge < 4; edge++, pu1_src_u += 4, pu1_p1_u += 4, pu1_src_v +=
  ------------------
  |  Branch (1570:19): [True: 251k, False: 62.8k]
  ------------------
 1571|   251k|                    4, pu1_p1_v += 4)
 1572|   251k|    {
 1573|   251k|        pu1_src_temp_u = pu1_src_u;
 1574|   251k|        pu1_p1_temp_u = pu1_p1_u;
 1575|   251k|        pu1_src_temp_v = pu1_src_v;
 1576|   251k|        pu1_p1_temp_v = pu1_p1_v;
 1577|   754k|        for(i = 0; i < 2; ++i, pu1_src_temp_u += 2, pu1_p1_temp_u += 2,
  ------------------
  |  Branch (1577:20): [True: 502k, False: 251k]
  ------------------
 1578|   502k|                       pu1_src_temp_v += 2, pu1_p1_temp_v += 2)
 1579|   502k|        {
 1580|   502k|            q0_u = pu1_src_temp_u[pos_q0];
 1581|   502k|            q1_u = pu1_src_temp_u[pos_q1];
 1582|   502k|            p0_u = pu1_p1_temp_u[pos_p0];
 1583|   502k|            p1_u = pu1_p1_temp_u[pos_p1];
 1584|       |
 1585|   502k|            q0_v = pu1_src_temp_v[pos_q0];
 1586|   502k|            q1_v = pu1_src_temp_v[pos_q1];
 1587|   502k|            p0_v = pu1_p1_temp_v[pos_p0];
 1588|   502k|            p1_v = pu1_p1_temp_v[pos_p1];
 1589|       |
 1590|       |            /* Filter Decision */
 1591|   502k|            if(ABS(p0_u - q0_u) < alpha_cb && ABS(q1_u - q0_u) < beta_cb
  ------------------
  |  |  100|   502k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 86.7k, False: 416k]
  |  |  ------------------
  ------------------
                          if(ABS(p0_u - q0_u) < alpha_cb && ABS(q1_u - q0_u) < beta_cb
  ------------------
  |  |  100|   362k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 12.6k, False: 350k]
  |  |  ------------------
  ------------------
  |  Branch (1591:16): [True: 362k, False: 140k]
  |  Branch (1591:47): [True: 352k, False: 10.0k]
  ------------------
 1592|   352k|                            && ABS(p1_u - p0_u) < beta_cb)
  ------------------
  |  |  100|   352k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 13.4k, False: 339k]
  |  |  ------------------
  ------------------
  |  Branch (1592:32): [True: 346k, False: 6.02k]
  ------------------
 1593|   346k|            {
 1594|       |                /* p0' */
 1595|   346k|                pu1_p1_temp_u[pos_p0] = (X2(p1_u) + p0_u + q1_u + 2) >> 2;
  ------------------
  |  |   91|   346k|#define X2(a)   ((a) << 1)
  ------------------
 1596|       |                /* q0' */
 1597|   346k|                pu1_src_temp_u[pos_q0] = (X2(q1_u) + q0_u + p1_u + 2) >> 2;
  ------------------
  |  |   91|   346k|#define X2(a)   ((a) << 1)
  ------------------
 1598|   346k|            }
 1599|       |
 1600|       |            /* Filter Decision */
 1601|   502k|            if(ABS(p0_v - q0_v) < alpha_cr && ABS(q1_v - q0_v) < beta_cr
  ------------------
  |  |  100|   502k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 84.9k, False: 417k]
  |  |  ------------------
  ------------------
                          if(ABS(p0_v - q0_v) < alpha_cr && ABS(q1_v - q0_v) < beta_cr
  ------------------
  |  |  100|   362k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 12.3k, False: 350k]
  |  |  ------------------
  ------------------
  |  Branch (1601:16): [True: 362k, False: 139k]
  |  Branch (1601:47): [True: 352k, False: 10.7k]
  ------------------
 1602|   352k|                            && ABS(p1_v - p0_v) < beta_cr)
  ------------------
  |  |  100|   352k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 9.68k, False: 342k]
  |  |  ------------------
  ------------------
  |  Branch (1602:32): [True: 345k, False: 6.37k]
  ------------------
 1603|   345k|            {
 1604|       |                /* p0' */
 1605|   345k|                pu1_p1_temp_v[pos_p0] = (X2(p1_v) + p0_v + q1_v + 2) >> 2;
  ------------------
  |  |   91|   345k|#define X2(a)   ((a) << 1)
  ------------------
 1606|       |                /* q0' */
 1607|   345k|                pu1_src_temp_v[pos_q0] = (X2(q1_v) + q0_v + p1_v + 2) >> 2;
  ------------------
  |  |   91|   345k|#define X2(a)   ((a) << 1)
  ------------------
 1608|   345k|            }
 1609|   502k|        }
 1610|   251k|    }
 1611|  62.8k|}
ih264_deblk_chroma_vert_bslt4:
 1665|   160k|{
 1666|   160k|    UWORD8 *pu1_src_u = pu1_src; /* Pointer to the src sample q0 of plane U*/
 1667|   160k|    UWORD8 *pu1_src_v = pu1_src + 1; /* Pointer to the src sample q0 of plane V*/
 1668|   160k|    UWORD8 p1_u, p0_u, q0_u, q1_u, p1_v, p0_v, q0_v, q1_v;
 1669|   160k|    WORD32 blk_strd = src_strd << 1; /* block_increment = src_strd * 2 */
 1670|   160k|    WORD32 pos_p1, pos_p0, pos_q0, pos_q1;
 1671|   160k|    UWORD8 *pu1_src_temp_u, *pu1_src_temp_v;
 1672|   160k|    WORD8 i = 0, edge;
 1673|   160k|    WORD8 delta;
 1674|   160k|    WORD8 tcb, tcr;
 1675|   160k|    WORD16 val;
 1676|   160k|    UWORD8 tcb0, tcr0, u1_bs;
 1677|       |
 1678|   160k|    pos_q0 = 0;
 1679|   160k|    pos_q1 = 2;
 1680|   160k|    pos_p0 = -2;
 1681|   160k|    pos_p1 = -4;
 1682|       |
 1683|   801k|    for(edge = 0; edge < 4;
  ------------------
  |  Branch (1683:19): [True: 641k, False: 160k]
  ------------------
 1684|   641k|                    edge++, pu1_src_u += blk_strd, pu1_src_v += blk_strd)
 1685|   641k|    {
 1686|   641k|        pu1_src_temp_u = pu1_src_u;
 1687|   641k|        pu1_src_temp_v = pu1_src_v;
 1688|       |        /* Filter Decision */
 1689|   641k|        u1_bs = (UWORD8)((u4_bs >> ((3 - edge) << 3)) & 0x0ff);
 1690|   641k|        if(!u1_bs)
  ------------------
  |  Branch (1690:12): [True: 53.3k, False: 587k]
  ------------------
 1691|  53.3k|            continue;
 1692|       |        /* tc0 */
 1693|   587k|        tcb0 = pu1_cliptab_cb[u1_bs];
 1694|   587k|        tcr0 = pu1_cliptab_cr[u1_bs];
 1695|   587k|        tcb = tcb0 + 1;
 1696|   587k|        tcr = tcr0 + 1;
 1697|  1.76M|        for(i = 0; i < 2; ++i, pu1_src_temp_u += src_strd, pu1_src_temp_v +=
  ------------------
  |  Branch (1697:20): [True: 1.17M, False: 587k]
  ------------------
 1698|  1.17M|                        src_strd)
 1699|  1.17M|        {
 1700|  1.17M|            q0_u = pu1_src_temp_u[pos_q0];
 1701|  1.17M|            q1_u = pu1_src_temp_u[pos_q1];
 1702|  1.17M|            p0_u = pu1_src_temp_u[pos_p0];
 1703|  1.17M|            p1_u = pu1_src_temp_u[pos_p1];
 1704|       |
 1705|  1.17M|            q0_v = pu1_src_temp_v[pos_q0];
 1706|  1.17M|            q1_v = pu1_src_temp_v[pos_q1];
 1707|  1.17M|            p0_v = pu1_src_temp_v[pos_p0];
 1708|  1.17M|            p1_v = pu1_src_temp_v[pos_p1];
 1709|       |
 1710|       |            /* Filter Decision */
 1711|  1.17M|            if(ABS(p0_u - q0_u) < alpha_cb && ABS(q1_u - q0_u) < beta_cb
  ------------------
  |  |  100|  1.17M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 134k, False: 1.04M]
  |  |  ------------------
  ------------------
                          if(ABS(p0_u - q0_u) < alpha_cb && ABS(q1_u - q0_u) < beta_cb
  ------------------
  |  |  100|  1.02M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 40.1k, False: 989k]
  |  |  ------------------
  ------------------
  |  Branch (1711:16): [True: 1.02M, False: 145k]
  |  Branch (1711:47): [True: 1.00M, False: 22.7k]
  ------------------
 1712|  1.00M|                            && ABS(p1_u - p0_u) < beta_cb)
  ------------------
  |  |  100|  1.00M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 32.5k, False: 974k]
  |  |  ------------------
  ------------------
  |  Branch (1712:32): [True: 998k, False: 9.24k]
  ------------------
 1713|   998k|            {
 1714|   998k|                val = ((((q0_u - p0_u) << 2) + (p1_u - q1_u) + 4) >> 3);
 1715|   998k|                delta = CLIP3(-tcb, tcb, val);
  ------------------
  |  |   77|   998k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 11.4k, False: 986k]
  |  |  |  Branch (77:54): [True: 11.4k, False: 975k]
  |  |  ------------------
  ------------------
 1716|       |                /* p0' */
 1717|   998k|                val = p0_u + delta;
 1718|   998k|                pu1_src_temp_u[pos_p0] = CLIP_U8(val);
  ------------------
  |  |   58|   998k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   998k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 889, False: 997k]
  |  |  |  |  |  Branch (77:54): [True: 648, False: 996k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1719|       |                /* q0' */
 1720|   998k|                val = q0_u - delta;
 1721|   998k|                pu1_src_temp_u[pos_q0] = CLIP_U8(val);
  ------------------
  |  |   58|   998k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   998k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 399, False: 997k]
  |  |  |  |  |  Branch (77:54): [True: 752, False: 996k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1722|   998k|            }
 1723|       |
 1724|       |            /* Filter Decision */
 1725|  1.17M|            if(ABS(p0_v - q0_v) < alpha_cr && ABS(q1_v - q0_v) < beta_cr
  ------------------
  |  |  100|  1.17M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 119k, False: 1.05M]
  |  |  ------------------
  ------------------
                          if(ABS(p0_v - q0_v) < alpha_cr && ABS(q1_v - q0_v) < beta_cr
  ------------------
  |  |  100|  1.02M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 39.0k, False: 990k]
  |  |  ------------------
  ------------------
  |  Branch (1725:16): [True: 1.02M, False: 146k]
  |  Branch (1725:47): [True: 1.00M, False: 19.5k]
  ------------------
 1726|  1.00M|                            && ABS(p1_v - p0_v) < beta_cr)
  ------------------
  |  |  100|  1.00M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 30.4k, False: 979k]
  |  |  ------------------
  ------------------
  |  Branch (1726:32): [True: 999k, False: 10.3k]
  ------------------
 1727|   999k|            {
 1728|   999k|                val = ((((q0_v - p0_v) << 2) + (p1_v - q1_v) + 4) >> 3);
 1729|   999k|                delta = CLIP3(-tcr, tcr, val);
  ------------------
  |  |   77|   999k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 7.35k, False: 991k]
  |  |  |  Branch (77:54): [True: 6.85k, False: 985k]
  |  |  ------------------
  ------------------
 1730|       |                /* p0' */
 1731|   999k|                val = p0_v + delta;
 1732|   999k|                pu1_src_temp_v[pos_p0] = CLIP_U8(val);
  ------------------
  |  |   58|   999k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   999k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 396, False: 998k]
  |  |  |  |  |  Branch (77:54): [True: 535, False: 998k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1733|       |                /* q0' */
 1734|   999k|                val = q0_v - delta;
 1735|   999k|                pu1_src_temp_v[pos_q0] = CLIP_U8(val);
  ------------------
  |  |   58|   999k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   999k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 782, False: 998k]
  |  |  |  |  |  Branch (77:54): [True: 460, False: 998k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1736|   999k|            }
 1737|  1.17M|        }
 1738|   587k|    }
 1739|   160k|}
ih264_deblk_chroma_horz_bslt4:
 1793|   183k|{
 1794|   183k|    UWORD8 *pu1_src_u = pu1_src; /* Pointer to the src sample q0 of plane U*/
 1795|   183k|    UWORD8 *pu1_src_v = pu1_src + 1; /* Pointer to the src sample q0 of plane V*/
 1796|   183k|    UWORD8 p1_u, p0_u, q0_u, q1_u, p1_v, p0_v, q0_v, q1_v;
 1797|   183k|    WORD32 pos_p1, pos_p0, pos_q0, pos_q1;
 1798|   183k|    UWORD8 *pu1_src_temp_u, *pu1_src_temp_v;
 1799|   183k|    UWORD8 *pu1_p1_u; /* Pointer to the src sample p1 of plane U*/
 1800|   183k|    UWORD8 *pu1_p1_v; /* Pointer to the src sample p1 of plane V*/
 1801|   183k|    UWORD8 *pu1_p1_temp_u, *pu1_p1_temp_v;
 1802|   183k|    WORD8 i = 0, edge;
 1803|   183k|    WORD8 delta;
 1804|   183k|    WORD8 tcb, tcr;
 1805|   183k|    WORD16 val;
 1806|   183k|    UWORD8 u1_bs;
 1807|   183k|    UWORD8 tcb0, tcr0;
 1808|       |
 1809|   183k|    pu1_p1_u = pu1_src_u - (src_strd << 1);
 1810|   183k|    pu1_p1_v = pu1_src_v - (src_strd << 1);
 1811|   183k|    pos_q0 = 0;
 1812|   183k|    pos_q1 = src_strd;
 1813|   183k|    pos_p0 = src_strd;
 1814|   183k|    pos_p1 = 0;
 1815|       |
 1816|   916k|    for(edge = 0; edge < 4; edge++, pu1_src_u += 4, pu1_p1_u += 4,
  ------------------
  |  Branch (1816:19): [True: 733k, False: 183k]
  ------------------
 1817|   733k|                    pu1_src_v += 4, pu1_p1_v += 4)
 1818|   733k|    {
 1819|   733k|        pu1_src_temp_u = pu1_src_u;
 1820|   733k|        pu1_p1_temp_u = pu1_p1_u;
 1821|   733k|        pu1_src_temp_v = pu1_src_v;
 1822|   733k|        pu1_p1_temp_v = pu1_p1_v;
 1823|       |
 1824|       |        /* Filter Decision */
 1825|   733k|        u1_bs = (UWORD8)((u4_bs >> ((3 - edge) << 3)) & 0x0ff);
 1826|   733k|        if(!u1_bs)
  ------------------
  |  Branch (1826:12): [True: 62.6k, False: 670k]
  ------------------
 1827|  62.6k|            continue;
 1828|       |        /* tc0 */
 1829|   670k|        tcb0 = pu1_cliptab_cb[u1_bs];
 1830|   670k|        tcr0 = pu1_cliptab_cr[u1_bs];
 1831|       |
 1832|  2.01M|        for(i = 0; i < 2; ++i, pu1_src_temp_u += 2, pu1_p1_temp_u += 2,
  ------------------
  |  Branch (1832:20): [True: 1.34M, False: 670k]
  ------------------
 1833|  1.34M|                       pu1_src_temp_v += 2, pu1_p1_temp_v += 2)
 1834|  1.34M|        {
 1835|  1.34M|            q0_u = pu1_src_temp_u[pos_q0];
 1836|  1.34M|            q1_u = pu1_src_temp_u[pos_q1];
 1837|  1.34M|            p0_u = pu1_p1_temp_u[pos_p0];
 1838|  1.34M|            p1_u = pu1_p1_temp_u[pos_p1];
 1839|       |
 1840|  1.34M|            q0_v = pu1_src_temp_v[pos_q0];
 1841|  1.34M|            q1_v = pu1_src_temp_v[pos_q1];
 1842|  1.34M|            p0_v = pu1_p1_temp_v[pos_p0];
 1843|  1.34M|            p1_v = pu1_p1_temp_v[pos_p1];
 1844|       |
 1845|       |            /* tc */
 1846|  1.34M|            tcb = tcb0 + 1;
 1847|  1.34M|            tcr = tcr0 + 1;
 1848|       |            /* Filter Decision */
 1849|  1.34M|            if(ABS(p0_u - q0_u) < alpha_cb && ABS(q1_u - q0_u) < beta_cb
  ------------------
  |  |  100|  1.34M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 137k, False: 1.20M]
  |  |  ------------------
  ------------------
                          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: 52.3k, False: 1.13M]
  |  |  ------------------
  ------------------
  |  Branch (1849:16): [True: 1.18M, False: 153k]
  |  Branch (1849:47): [True: 1.14M, False: 38.5k]
  ------------------
 1850|  1.14M|                            && ABS(p1_u - p0_u) < beta_cb)
  ------------------
  |  |  100|  1.14M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 42.0k, False: 1.10M]
  |  |  ------------------
  ------------------
  |  Branch (1850:32): [True: 1.12M, False: 20.4k]
  ------------------
 1851|  1.12M|            {
 1852|  1.12M|                val = ((((q0_u - p0_u) << 2) + (p1_u - q1_u) + 4) >> 3);
 1853|  1.12M|                delta = CLIP3(-tcb, tcb, val);
  ------------------
  |  |   77|  1.12M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 10.1k, False: 1.11M]
  |  |  |  Branch (77:54): [True: 7.60k, False: 1.11M]
  |  |  ------------------
  ------------------
 1854|       |                /* p0' */
 1855|  1.12M|                val = p0_u + delta;
 1856|  1.12M|                pu1_p1_temp_u[pos_p0] = CLIP_U8(val);
  ------------------
  |  |   58|  1.12M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  1.12M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 370, False: 1.12M]
  |  |  |  |  |  Branch (77:54): [True: 1.01k, False: 1.12M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1857|       |                /* q0' */
 1858|  1.12M|                val = q0_u - delta;
 1859|  1.12M|                pu1_src_temp_u[pos_q0] = CLIP_U8(val);
  ------------------
  |  |   58|  1.12M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  1.12M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 643, False: 1.12M]
  |  |  |  |  |  Branch (77:54): [True: 1.22k, False: 1.12M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1860|  1.12M|            }
 1861|       |            /* Filter Decision */
 1862|  1.34M|            if(ABS(p0_v - q0_v) < alpha_cr && ABS(q1_v - q0_v) < beta_cr
  ------------------
  |  |  100|  1.34M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 131k, False: 1.21M]
  |  |  ------------------
  ------------------
                          if(ABS(p0_v - q0_v) < alpha_cr && ABS(q1_v - q0_v) < beta_cr
  ------------------
  |  |  100|  1.19M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 51.2k, False: 1.14M]
  |  |  ------------------
  ------------------
  |  Branch (1862:16): [True: 1.19M, False: 149k]
  |  Branch (1862:47): [True: 1.15M, False: 33.3k]
  ------------------
 1863|  1.15M|                            && ABS(p1_v - p0_v) < beta_cr)
  ------------------
  |  |  100|  1.15M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 32.8k, False: 1.12M]
  |  |  ------------------
  ------------------
  |  Branch (1863:32): [True: 1.14M, False: 15.1k]
  ------------------
 1864|  1.14M|            {
 1865|  1.14M|                val = ((((q0_v - p0_v) << 2) + (p1_v - q1_v) + 4) >> 3);
 1866|  1.14M|                delta = CLIP3(-tcr, tcr, val);
  ------------------
  |  |   77|  1.14M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 7.53k, False: 1.13M]
  |  |  |  Branch (77:54): [True: 5.78k, False: 1.12M]
  |  |  ------------------
  ------------------
 1867|       |                /* p0' */
 1868|  1.14M|                val = p0_v + delta;
 1869|  1.14M|                pu1_p1_temp_v[pos_p0] = CLIP_U8(val);
  ------------------
  |  |   58|  1.14M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  1.14M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 618, False: 1.14M]
  |  |  |  |  |  Branch (77:54): [True: 846, False: 1.14M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1870|       |                /* q0' */
 1871|  1.14M|                val = q0_v - delta;
 1872|  1.14M|                pu1_src_temp_v[pos_q0] = CLIP_U8(val);
  ------------------
  |  |   58|  1.14M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  1.14M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 580, False: 1.14M]
  |  |  |  |  |  Branch (77:54): [True: 594, False: 1.14M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1873|  1.14M|            }
 1874|  1.34M|        }
 1875|   670k|    }
 1876|   183k|}

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

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

ih264_inter_pred_luma_copy:
  129|  2.47M|{
  130|  2.47M|    WORD32 row, col;
  131|       |
  132|  2.47M|    UNUSED(pu1_tmp);
  ------------------
  |  |   45|  2.47M|#define UNUSED(x) ((void)(x))
  ------------------
  133|  2.47M|    UNUSED(dydx);
  ------------------
  |  |   45|  2.47M|#define UNUSED(x) ((void)(x))
  ------------------
  134|  41.6M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (134:18): [True: 39.1M, False: 2.47M]
  ------------------
  135|  39.1M|    {
  136|   662M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (136:22): [True: 622M, False: 39.1M]
  ------------------
  137|   622M|        {
  138|   622M|            pu1_dst[col] = pu1_src[col];
  139|   622M|        }
  140|       |
  141|  39.1M|        pu1_src += src_strd;
  142|  39.1M|        pu1_dst += dst_strd;
  143|  39.1M|    }
  144|  2.47M|}
ih264_inter_pred_luma_horz:
  251|  39.0k|{
  252|  39.0k|    WORD32 row, col;
  253|  39.0k|    WORD16 i2_tmp;
  254|       |
  255|  39.0k|    UNUSED(pu1_tmp);
  ------------------
  |  |   45|  39.0k|#define UNUSED(x) ((void)(x))
  ------------------
  256|  39.0k|    UNUSED(dydx);
  ------------------
  |  |   45|  39.0k|#define UNUSED(x) ((void)(x))
  ------------------
  257|   544k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (257:18): [True: 505k, False: 39.0k]
  ------------------
  258|   505k|    {
  259|  7.67M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (259:22): [True: 7.16M, False: 505k]
  ------------------
  260|  7.16M|        {
  261|  7.16M|            i2_tmp = ih264_g_six_tap[0] * (pu1_src[col - 2] + pu1_src[col + 3])
  262|  7.16M|                     + ih264_g_six_tap[1] * (pu1_src[col - 1] + pu1_src[col + 2])
  263|  7.16M|                     + ih264_g_six_tap[2] * (pu1_src[col] + pu1_src[col + 1]);
  264|  7.16M|            i2_tmp = (i2_tmp + 16) >> 5;
  265|  7.16M|            pu1_dst[col] = CLIP_U8(i2_tmp);
  ------------------
  |  |   58|  7.16M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  7.16M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 12.9k, False: 7.15M]
  |  |  |  |  |  Branch (77:54): [True: 221k, False: 6.93M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  266|  7.16M|        }
  267|   505k|        pu1_src += src_strd;
  268|   505k|        pu1_dst += dst_strd;
  269|   505k|    }
  270|  39.0k|}
ih264_inter_pred_luma_vert:
  321|  22.7k|{
  322|  22.7k|    WORD32 row, col;
  323|  22.7k|    WORD16 i2_tmp;
  324|       |
  325|  22.7k|    UNUSED(pu1_tmp);
  ------------------
  |  |   45|  22.7k|#define UNUSED(x) ((void)(x))
  ------------------
  326|  22.7k|    UNUSED(dydx);
  ------------------
  |  |   45|  22.7k|#define UNUSED(x) ((void)(x))
  ------------------
  327|   339k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (327:18): [True: 316k, False: 22.7k]
  ------------------
  328|   316k|    {
  329|  4.96M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (329:22): [True: 4.64M, False: 316k]
  ------------------
  330|  4.64M|        {
  331|  4.64M|            i2_tmp = ih264_g_six_tap[0] * (pu1_src[col - 2 * src_strd] + pu1_src[col + 3 * src_strd])
  332|  4.64M|                     + ih264_g_six_tap[1] * (pu1_src[col - 1 * src_strd] + pu1_src[col + 2 * src_strd])
  333|  4.64M|                     + ih264_g_six_tap[2] * (pu1_src[col] + pu1_src[col + 1 * src_strd]);
  334|  4.64M|            i2_tmp = (i2_tmp + 16) >> 5;
  335|  4.64M|            pu1_dst[col] = CLIP_U8(i2_tmp);
  ------------------
  |  |   58|  4.64M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  4.64M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 58.2k, False: 4.58M]
  |  |  |  |  |  Branch (77:54): [True: 41.8k, False: 4.54M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  336|  4.64M|        }
  337|   316k|        pu1_src += src_strd;
  338|   316k|        pu1_dst += dst_strd;
  339|   316k|    }
  340|  22.7k|}
ih264_inter_pred_luma_horz_hpel_vert_hpel:
  400|  21.3k|{
  401|  21.3k|    WORD32 row, col;
  402|  21.3k|    WORD32 tmp;
  403|  21.3k|    WORD16 *pi2_pred1_temp;
  404|  21.3k|    WORD16 *pi2_pred1;
  405|       |
  406|  21.3k|    UNUSED(dydx);
  ------------------
  |  |   45|  21.3k|#define UNUSED(x) ((void)(x))
  ------------------
  407|  21.3k|    pi2_pred1_temp = (WORD16*)pu1_tmp;
  408|  21.3k|    pi2_pred1_temp += 2;
  409|  21.3k|    pi2_pred1 = pi2_pred1_temp;
  410|       |
  411|   249k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (411:18): [True: 228k, False: 21.3k]
  ------------------
  412|   228k|    {
  413|  4.07M|        for(col = -2; col < wd + 3; col++)
  ------------------
  |  Branch (413:23): [True: 3.85M, False: 228k]
  ------------------
  414|  3.85M|        {
  415|  3.85M|            tmp = ih264_g_six_tap[0] * (pu1_src[col - 2 * src_strd] + pu1_src[col + 3 * src_strd])
  416|  3.85M|                  + ih264_g_six_tap[1] * (pu1_src[col - 1 * src_strd] + pu1_src[col + 2 * src_strd])
  417|  3.85M|                  + ih264_g_six_tap[2] * (pu1_src[col] + pu1_src[col + 1 * src_strd]);
  418|  3.85M|            pi2_pred1_temp[col] = tmp;
  419|  3.85M|        }
  420|   228k|        pu1_src += src_strd;
  421|   228k|        pi2_pred1_temp = pi2_pred1_temp + wd + 5;
  422|   228k|    }
  423|       |
  424|   249k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (424:18): [True: 228k, False: 21.3k]
  ------------------
  425|   228k|    {
  426|  2.93M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (426:22): [True: 2.70M, False: 228k]
  ------------------
  427|  2.70M|        {
  428|  2.70M|            tmp = ih264_g_six_tap[0] * (pi2_pred1[col - 2] + pi2_pred1[col + 3])
  429|  2.70M|                  + ih264_g_six_tap[1] * (pi2_pred1[col - 1] + pi2_pred1[col + 2])
  430|  2.70M|                  + ih264_g_six_tap[2] * (pi2_pred1[col] + pi2_pred1[col + 1]);
  431|  2.70M|            tmp = (tmp + 512) >> 10;
  432|  2.70M|            pu1_dst[col] = CLIP_U8(tmp);
  ------------------
  |  |   58|  2.70M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  2.70M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 23.1k, False: 2.68M]
  |  |  |  |  |  Branch (77:54): [True: 6.29k, False: 2.67M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  433|  2.70M|        }
  434|   228k|        pi2_pred1 += (wd + 5);
  435|   228k|        pu1_dst += dst_strd;
  436|   228k|    }
  437|  21.3k|}
ih264_inter_pred_luma_horz_qpel:
  496|  62.4k|{
  497|  62.4k|    WORD32 row, col;
  498|  62.4k|    UWORD8 *pu1_pred1;
  499|  62.4k|    WORD32 x_offset = dydx & 0x3;
  500|  62.4k|    UNUSED(pu1_tmp);
  ------------------
  |  |   45|  62.4k|#define UNUSED(x) ((void)(x))
  ------------------
  501|  62.4k|    pu1_pred1 = pu1_src + (x_offset >> 1);
  502|       |
  503|   888k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (503:18): [True: 825k, False: 62.4k]
  ------------------
  504|   825k|    {
  505|  12.5M|        for(col = 0; col < wd; col++, pu1_src++, pu1_dst++)
  ------------------
  |  Branch (505:22): [True: 11.6M, False: 825k]
  ------------------
  506|  11.6M|        {
  507|  11.6M|            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|  11.6M|            i2_temp = pu1_src[-2] + pu1_src[3]
  512|  11.6M|                      - (pu1_src[-1] + pu1_src[2])
  513|  11.6M|                      + ((pu1_src[0] + pu1_src[1] - pu1_src[-1] - pu1_src[2]) << 2)
  514|  11.6M|                      + ((pu1_src[0] + pu1_src[1]) << 4);
  515|  11.6M|            i2_temp = (i2_temp + 16) >> 5;
  516|  11.6M|            i2_temp = CLIP_U8(i2_temp);
  ------------------
  |  |   58|  11.6M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  11.6M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 37.4k, False: 11.6M]
  |  |  |  |  |  Branch (77:54): [True: 81.0k, False: 11.5M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  517|  11.6M|            *pu1_dst = (i2_temp + *pu1_pred1 + 1) >> 1;
  518|       |
  519|  11.6M|            pu1_pred1++;
  520|  11.6M|        }
  521|   825k|        pu1_dst += dst_strd - wd;
  522|   825k|        pu1_src += src_strd - wd;
  523|   825k|        pu1_pred1 += src_strd - wd;
  524|   825k|    }
  525|  62.4k|}
ih264_inter_pred_luma_vert_qpel:
  584|  35.8k|{
  585|  35.8k|    WORD32 row, col;
  586|  35.8k|    WORD32 y_offset = dydx >> 2;
  587|  35.8k|    WORD32 off1, off2, off3;
  588|  35.8k|    UWORD8 *pu1_pred1;
  589|  35.8k|    UNUSED(pu1_tmp);
  ------------------
  |  |   45|  35.8k|#define UNUSED(x) ((void)(x))
  ------------------
  590|  35.8k|    y_offset = y_offset & 0x3;
  591|       |
  592|  35.8k|    off1 = src_strd;
  593|  35.8k|    off2 = src_strd << 1;
  594|  35.8k|    off3 = off1 + off2;
  595|       |
  596|  35.8k|    pu1_pred1 = pu1_src + (y_offset >> 1) * src_strd;
  597|       |
  598|   478k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (598:18): [True: 442k, False: 35.8k]
  ------------------
  599|   442k|    {
  600|  6.32M|        for(col = 0; col < wd; col++, pu1_dst++, pu1_src++, pu1_pred1++)
  ------------------
  |  Branch (600:22): [True: 5.87M, False: 442k]
  ------------------
  601|  5.87M|        {
  602|  5.87M|            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|  5.87M|            i2_temp = pu1_src[-off2] + pu1_src[off3]
  608|  5.87M|                       - (pu1_src[-off1] + pu1_src[off2])
  609|  5.87M|                       + ((pu1_src[0] + pu1_src[off1] - pu1_src[-off1] - pu1_src[off2]) << 2)
  610|  5.87M|                       + ((pu1_src[0] + pu1_src[off1]) << 4);
  611|  5.87M|            i2_temp = (i2_temp + 16) >> 5;
  612|  5.87M|            i2_temp = CLIP_U8(i2_temp);
  ------------------
  |  |   58|  5.87M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  5.87M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 28.6k, False: 5.85M]
  |  |  |  |  |  Branch (77:54): [True: 8.29k, False: 5.84M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  613|       |
  614|  5.87M|            *pu1_dst = (i2_temp + *pu1_pred1 + 1) >> 1;
  615|  5.87M|        }
  616|   442k|        pu1_src += src_strd - wd;
  617|   442k|        pu1_pred1 += src_strd - wd;
  618|   442k|        pu1_dst += dst_strd - wd;
  619|   442k|    }
  620|  35.8k|}
ih264_inter_pred_luma_horz_qpel_vert_qpel:
  679|  71.2k|{
  680|  71.2k|    WORD32 row, col;
  681|  71.2k|    WORD32 x_offset = dydx & 0x3;
  682|  71.2k|    WORD32 y_offset = dydx >> 2;
  683|       |
  684|  71.2k|    WORD32 off1, off2, off3;
  685|  71.2k|    UWORD8* pu1_pred_vert, *pu1_pred_horz;
  686|  71.2k|    UNUSED(pu1_tmp);
  ------------------
  |  |   45|  71.2k|#define UNUSED(x) ((void)(x))
  ------------------
  687|  71.2k|    y_offset = y_offset & 0x3;
  688|       |
  689|  71.2k|    off1 = src_strd;
  690|  71.2k|    off2 = src_strd << 1;
  691|  71.2k|    off3 = off1 + off2;
  692|       |
  693|  71.2k|    pu1_pred_horz = pu1_src + (y_offset >> 1) * src_strd;
  694|  71.2k|    pu1_pred_vert = pu1_src + (x_offset >> 1);
  695|       |
  696|  1.01M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (696:18): [True: 941k, False: 71.2k]
  ------------------
  697|   941k|    {
  698|  14.0M|        for(col = 0; col < wd;
  ------------------
  |  Branch (698:22): [True: 13.0M, False: 941k]
  ------------------
  699|  13.0M|                        col++, pu1_dst++, pu1_pred_vert++, pu1_pred_horz++)
  700|  13.0M|        {
  701|  13.0M|            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|  13.0M|            i2_temp_vert = pu1_pred_vert[-off2] + pu1_pred_vert[off3]
  707|  13.0M|                            - (pu1_pred_vert[-off1] + pu1_pred_vert[off2])
  708|  13.0M|                            + ((pu1_pred_vert[0] + pu1_pred_vert[off1]
  709|  13.0M|                                            - pu1_pred_vert[-off1]
  710|  13.0M|                                            - pu1_pred_vert[off2]) << 2)
  711|  13.0M|                            + ((pu1_pred_vert[0] + pu1_pred_vert[off1]) << 4);
  712|  13.0M|            i2_temp_vert = (i2_temp_vert + 16) >> 5;
  713|  13.0M|            i2_temp_vert = CLIP_U8(i2_temp_vert);
  ------------------
  |  |   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: 53.3k, False: 13.0M]
  |  |  |  |  |  Branch (77:54): [True: 537k, False: 12.5M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  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|  13.0M|            i2_temp_horz = pu1_pred_horz[-2] + pu1_pred_horz[3]
  719|  13.0M|                            - (pu1_pred_horz[-1] + pu1_pred_horz[2])
  720|  13.0M|                            + ((pu1_pred_horz[0] + pu1_pred_horz[1]
  721|  13.0M|                                            - pu1_pred_horz[-1]
  722|  13.0M|                                            - pu1_pred_horz[2]) << 2)
  723|  13.0M|                            + ((pu1_pred_horz[0] + pu1_pred_horz[1]) << 4);
  724|  13.0M|            i2_temp_horz = (i2_temp_horz + 16) >> 5;
  725|  13.0M|            i2_temp_horz = CLIP_U8(i2_temp_horz);
  ------------------
  |  |   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: 29.2k, False: 13.0M]
  |  |  |  |  |  Branch (77:54): [True: 262k, False: 12.7M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  726|  13.0M|            *pu1_dst = (i2_temp_vert + i2_temp_horz + 1) >> 1;
  727|  13.0M|        }
  728|   941k|        pu1_pred_vert += (src_strd - wd);
  729|   941k|        pu1_pred_horz += (src_strd - wd);
  730|   941k|        pu1_dst += (dst_strd - wd);
  731|   941k|    }
  732|  71.2k|}
ih264_inter_pred_luma_horz_qpel_vert_hpel:
  792|  28.0k|{
  793|  28.0k|    WORD32 row, col;
  794|  28.0k|    WORD32 tmp;
  795|  28.0k|    WORD16* pi2_pred1_temp, *pi2_pred1;
  796|  28.0k|    UWORD8* pu1_dst_tmp;
  797|  28.0k|    WORD32 x_offset = dydx & 0x3;
  798|  28.0k|    WORD16 i2_macro;
  799|       |
  800|  28.0k|    pi2_pred1_temp = (WORD16*)pu1_tmp;
  801|  28.0k|    pi2_pred1_temp += 2;
  802|  28.0k|    pi2_pred1 = pi2_pred1_temp;
  803|  28.0k|    pu1_dst_tmp = pu1_dst;
  804|       |
  805|   403k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (805:18): [True: 375k, False: 28.0k]
  ------------------
  806|   375k|    {
  807|  7.44M|        for(col = -2; col < wd + 3; col++)
  ------------------
  |  Branch (807:23): [True: 7.06M, False: 375k]
  ------------------
  808|  7.06M|        {
  809|  7.06M|            tmp = 0;/*ih264_g_six_tap[] is the array containing the filter coeffs*/
  810|  7.06M|            tmp = ih264_g_six_tap[0] *
  811|  7.06M|                            (pu1_src[col - 2 * src_strd] + pu1_src[col + 3 * src_strd])
  812|  7.06M|                  + ih264_g_six_tap[1] *
  813|  7.06M|                            (pu1_src[col - 1 * src_strd] + pu1_src[col + 2 * src_strd])
  814|  7.06M|                  + ih264_g_six_tap[2] *
  815|  7.06M|                            (pu1_src[col] + pu1_src[col + 1 * src_strd]);
  816|  7.06M|            pi2_pred1_temp[col] = tmp;
  817|  7.06M|        }
  818|       |
  819|   375k|        pu1_src += src_strd;
  820|   375k|        pi2_pred1_temp = pi2_pred1_temp + wd + 5;
  821|   375k|    }
  822|       |
  823|  28.0k|    pi2_pred1_temp = pi2_pred1;
  824|   403k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (824:18): [True: 375k, False: 28.0k]
  ------------------
  825|   375k|    {
  826|  5.56M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (826:22): [True: 5.19M, False: 375k]
  ------------------
  827|  5.19M|        {
  828|  5.19M|            tmp = 0;/*ih264_g_six_tap[] is the array containing the filter coeffs*/
  829|  5.19M|            tmp = ih264_g_six_tap[0] *
  830|  5.19M|                            (pi2_pred1[col - 2] + pi2_pred1[col + 3])
  831|  5.19M|                  + ih264_g_six_tap[1] *
  832|  5.19M|                            (pi2_pred1[col - 1] + pi2_pred1[col + 2])
  833|  5.19M|                  + ih264_g_six_tap[2] *
  834|  5.19M|                            (pi2_pred1[col] + pi2_pred1[col + 1]);
  835|  5.19M|            tmp = (tmp + 512) >> 10;
  836|  5.19M|            pu1_dst[col] = CLIP_U8(tmp);
  ------------------
  |  |   58|  5.19M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  5.19M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 46.5k, False: 5.14M]
  |  |  |  |  |  Branch (77:54): [True: 18.6k, False: 5.12M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  837|  5.19M|        }
  838|   375k|        pi2_pred1 += (wd + 5);
  839|   375k|        pu1_dst += dst_strd;
  840|   375k|    }
  841|       |
  842|  28.0k|    pu1_dst = pu1_dst_tmp;
  843|  28.0k|    pi2_pred1_temp += (x_offset >> 1);
  844|   403k|    for(row = ht; row != 0; row--)
  ------------------
  |  Branch (844:19): [True: 375k, False: 28.0k]
  ------------------
  845|   375k|    {
  846|  5.56M|        for(col = wd; col != 0; col--, pu1_dst++, pi2_pred1_temp++)
  ------------------
  |  Branch (846:23): [True: 5.19M, False: 375k]
  ------------------
  847|  5.19M|        {
  848|  5.19M|            UWORD8 uc_temp;
  849|       |            /* Clipping the output of the six tap filter obtained from the
  850|       |             first stage of the 2d filter stage */
  851|  5.19M|            *pi2_pred1_temp = (*pi2_pred1_temp + 16) >> 5;
  852|  5.19M|            i2_macro = (*pi2_pred1_temp);
  853|  5.19M|            uc_temp = CLIP_U8(i2_macro);
  ------------------
  |  |   58|  5.19M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  5.19M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 33.4k, False: 5.15M]
  |  |  |  |  |  Branch (77:54): [True: 19.4k, False: 5.13M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  854|  5.19M|            *pu1_dst = (*pu1_dst + uc_temp + 1) >> 1;
  855|  5.19M|        }
  856|   375k|        pi2_pred1_temp += 5;
  857|   375k|        pu1_dst += dst_strd - wd;
  858|   375k|    }
  859|  28.0k|}
ih264_inter_pred_luma_horz_hpel_vert_qpel:
  957|  48.6k|{
  958|       |
  959|  48.6k|    WORD32 row, col;
  960|  48.6k|    WORD32 tmp;
  961|  48.6k|    WORD32 y_offset = dydx >> 2;
  962|  48.6k|    WORD16* pi2_pred1_temp, *pi2_pred1;
  963|  48.6k|    UWORD8* pu1_dst_tmp;
  964|       |    //WORD32 x_offset = dydx & 0x3;
  965|  48.6k|    WORD16 i2_macro;
  966|       |
  967|  48.6k|    y_offset = y_offset & 0x3;
  968|       |
  969|  48.6k|    pi2_pred1_temp = (WORD16*)pu1_tmp;
  970|  48.6k|    pi2_pred1_temp += 2 * wd;
  971|  48.6k|    pi2_pred1 = pi2_pred1_temp;
  972|  48.6k|    pu1_dst_tmp = pu1_dst;
  973|  48.6k|    pu1_src -= 2 * src_strd;
  974|   973k|    for(row = -2; row < ht + 3; row++)
  ------------------
  |  Branch (974:19): [True: 924k, False: 48.6k]
  ------------------
  975|   924k|    {
  976|  14.1M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (976:22): [True: 13.2M, False: 924k]
  ------------------
  977|  13.2M|        {
  978|  13.2M|            tmp = 0;/*ih264_g_six_tap[] is the array containing the filter coeffs*/
  979|  13.2M|            tmp = ih264_g_six_tap[0] * (pu1_src[col - 2] + pu1_src[col + 3])
  980|  13.2M|                  + ih264_g_six_tap[1] * (pu1_src[col - 1] + pu1_src[col + 2])
  981|  13.2M|                  + ih264_g_six_tap[2] * (pu1_src[col] + pu1_src[col + 1]);
  982|  13.2M|            pi2_pred1_temp[col - 2 * wd] = tmp;
  983|  13.2M|        }
  984|       |
  985|   924k|        pu1_src += src_strd;
  986|   924k|        pi2_pred1_temp += wd;
  987|   924k|    }
  988|  48.6k|    pi2_pred1_temp = pi2_pred1;
  989|   730k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (989:18): [True: 681k, False: 48.6k]
  ------------------
  990|   681k|    {
  991|  10.6M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (991:22): [True: 9.93M, False: 681k]
  ------------------
  992|  9.93M|        {
  993|  9.93M|            tmp = 0;/*ih264_g_six_tap[] is the array containing the filter coeffs*/
  994|  9.93M|            tmp = ih264_g_six_tap[0] * (pi2_pred1[col - 2 * wd] + pi2_pred1[col + 3 * wd])
  995|  9.93M|                  + ih264_g_six_tap[1] * (pi2_pred1[col - 1 * wd] + pi2_pred1[col + 2 * wd])
  996|  9.93M|                  + ih264_g_six_tap[2] * (pi2_pred1[col] + pi2_pred1[col + 1 * wd]);
  997|  9.93M|            tmp = (tmp + 512) >> 10;
  998|  9.93M|            pu1_dst[col] = CLIP_U8(tmp);
  ------------------
  |  |   58|  9.93M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  9.93M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 31.4k, False: 9.90M]
  |  |  |  |  |  Branch (77:54): [True: 36.7k, False: 9.86M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  999|  9.93M|        }
 1000|   681k|        pi2_pred1 += wd;
 1001|   681k|        pu1_dst += dst_strd;
 1002|   681k|    }
 1003|  48.6k|    pu1_dst = pu1_dst_tmp;
 1004|  48.6k|    pi2_pred1_temp += (y_offset >> 1) * wd;
 1005|   730k|    for(row = ht; row != 0; row--)
  ------------------
  |  Branch (1005:19): [True: 681k, False: 48.6k]
  ------------------
 1006|       |
 1007|   681k|    {
 1008|  10.6M|        for(col = wd; col != 0; col--, pu1_dst++, pi2_pred1_temp++)
  ------------------
  |  Branch (1008:23): [True: 9.93M, False: 681k]
  ------------------
 1009|  9.93M|        {
 1010|  9.93M|            UWORD8 u1_temp;
 1011|       |            /* Clipping the output of the six tap filter obtained from the
 1012|       |             first stage of the 2d filter stage */
 1013|  9.93M|            *pi2_pred1_temp = (*pi2_pred1_temp + 16) >> 5;
 1014|  9.93M|            i2_macro = (*pi2_pred1_temp);
 1015|  9.93M|            u1_temp = CLIP_U8(i2_macro);
  ------------------
  |  |   58|  9.93M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  9.93M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 14.1k, False: 9.91M]
  |  |  |  |  |  Branch (77:54): [True: 27.8k, False: 9.89M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1016|  9.93M|            *pu1_dst = (*pu1_dst + u1_temp + 1) >> 1;
 1017|  9.93M|        }
 1018|       |        //pi16_pred1_temp += wd;
 1019|   681k|        pu1_dst += dst_strd - wd;
 1020|   681k|    }
 1021|  48.6k|}
ih264_inter_pred_chroma:
 1141|  2.80M|{
 1142|  2.80M|    WORD32 row, col;
 1143|  2.80M|    WORD16 i2_tmp;
 1144|       |
 1145|  24.5M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (1145:18): [True: 21.7M, False: 2.80M]
  ------------------
 1146|  21.7M|    {
 1147|   363M|        for(col = 0; col < 2 * wd; col++)
  ------------------
  |  Branch (1147:22): [True: 341M, False: 21.7M]
  ------------------
 1148|   341M|        {
 1149|   341M|            i2_tmp = 0; /* applies equation (8-266) in section 8.4.2.2.2 */
 1150|   341M|            i2_tmp = (8 - dx) * (8 - dy) * pu1_src[col]
 1151|   341M|                     + (dx) * (8 - dy) * pu1_src[col + 2]
 1152|   341M|                     + (8 - dx) * (dy) * (pu1_src + src_strd)[col]
 1153|   341M|                     + (dx) * (dy) * (pu1_src + src_strd)[col + 2];
 1154|   341M|            i2_tmp = (i2_tmp + 32) >> 6;
 1155|   341M|            pu1_dst[col] = CLIP_U8(i2_tmp);
  ------------------
  |  |   58|   341M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   341M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 0, False: 341M]
  |  |  |  |  |  Branch (77:54): [True: 0, False: 341M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1156|   341M|        }
 1157|  21.7M|        pu1_src += src_strd;
 1158|  21.7M|        pu1_dst += dst_strd;
 1159|  21.7M|    }
 1160|  2.80M|}

ih264_iquant_itrans_recon_4x4:
  126|  83.8k|{
  127|  83.8k|    WORD16 *pi2_src_ptr = pi2_src;
  128|  83.8k|    WORD16 *pi2_tmp_ptr = pi2_tmp;
  129|  83.8k|    UWORD8 *pu1_pred_ptr = pu1_pred;
  130|  83.8k|    UWORD8 *pu1_out_ptr = pu1_out;
  131|  83.8k|    WORD16 x0, x1, x2, x3, i;
  132|  83.8k|    WORD32 q0, q1, q2, q3;
  133|  83.8k|    WORD16 i_macro;
  134|  83.8k|    WORD16 rnd_fact = (u4_qp_div_6 < 4) ? 1 << (3 - u4_qp_div_6) : 0;
  ------------------
  |  Branch (134:23): [True: 7.91k, False: 75.8k]
  ------------------
  135|       |
  136|       |    /* inverse quant */
  137|       |    /* horizontal inverse transform */
  138|   419k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|   419k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (138:16): [True: 335k, False: 83.8k]
  ------------------
  139|   335k|    {
  140|   335k|        q0 = pi2_src_ptr[0];
  141|   335k|        INV_QUANT(q0, pu2_iscal_mat[0], pu2_weigh_mat[0], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|   335k|                {\
  |  |  104|   335k|                    i4_value *= quant_scale;\
  |  |  105|   335k|                    i4_value *= weight_scale;\
  |  |  106|   335k|                    i4_value += rndfactor;\
  |  |  107|   335k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|   335k|                    i4_value >>= qbits;\
  |  |  109|   335k|                }
  ------------------
  142|       |        /* Restoring dc value for intra case */
  143|   335k|        if (i==0 && iq_start_idx == 1)
  ------------------
  |  Branch (143:13): [True: 83.8k, False: 251k]
  |  Branch (143:21): [True: 13.1k, False: 70.7k]
  ------------------
  144|  13.1k|        {
  145|  13.1k|            q0 = pi2_dc_ld_addr[0];
  146|  13.1k|        }
  147|       |
  148|   335k|        q2 = pi2_src_ptr[2];
  149|   335k|        INV_QUANT(q2, pu2_iscal_mat[2], pu2_weigh_mat[2], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|   335k|                {\
  |  |  104|   335k|                    i4_value *= quant_scale;\
  |  |  105|   335k|                    i4_value *= weight_scale;\
  |  |  106|   335k|                    i4_value += rndfactor;\
  |  |  107|   335k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|   335k|                    i4_value >>= qbits;\
  |  |  109|   335k|                }
  ------------------
  150|       |
  151|   335k|        x0 = q0 + q2;
  152|   335k|        x1 = q0 - q2;
  153|       |
  154|   335k|        q1 = pi2_src_ptr[1];
  155|   335k|        INV_QUANT(q1, pu2_iscal_mat[1], pu2_weigh_mat[1], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|   335k|                {\
  |  |  104|   335k|                    i4_value *= quant_scale;\
  |  |  105|   335k|                    i4_value *= weight_scale;\
  |  |  106|   335k|                    i4_value += rndfactor;\
  |  |  107|   335k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|   335k|                    i4_value >>= qbits;\
  |  |  109|   335k|                }
  ------------------
  156|       |
  157|   335k|        q3 = pi2_src_ptr[3];
  158|   335k|        INV_QUANT(q3, pu2_iscal_mat[3], pu2_weigh_mat[3], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|   335k|                {\
  |  |  104|   335k|                    i4_value *= quant_scale;\
  |  |  105|   335k|                    i4_value *= weight_scale;\
  |  |  106|   335k|                    i4_value += rndfactor;\
  |  |  107|   335k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|   335k|                    i4_value >>= qbits;\
  |  |  109|   335k|                }
  ------------------
  159|       |
  160|   335k|        x2 = (q1 >> 1) - q3;
  161|   335k|        x3 = q1 + (q3 >> 1);
  162|       |
  163|   335k|        pi2_tmp_ptr[0] = x0 + x3;
  164|   335k|        pi2_tmp_ptr[1] = x1 + x2;
  165|   335k|        pi2_tmp_ptr[2] = x1 - x2;
  166|   335k|        pi2_tmp_ptr[3] = x0 - x3;
  167|       |
  168|   335k|        pi2_src_ptr += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|   335k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  169|   335k|        pi2_tmp_ptr += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|   335k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  170|   335k|        pu2_iscal_mat += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|   335k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  171|   335k|        pu2_weigh_mat += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|   335k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  172|   335k|    }
  173|       |
  174|       |    /* vertical inverse transform */
  175|  83.8k|    pi2_tmp_ptr = pi2_tmp;
  176|   419k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|   419k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (176:16): [True: 335k, False: 83.8k]
  ------------------
  177|   335k|    {
  178|   335k|        pu1_pred_ptr = pu1_pred;
  179|   335k|        pu1_out = pu1_out_ptr;
  180|       |
  181|   335k|        x0 = (pi2_tmp_ptr[0] + pi2_tmp_ptr[8]);
  182|   335k|        x1 = (pi2_tmp_ptr[0] - pi2_tmp_ptr[8]);
  183|   335k|        x2 = (pi2_tmp_ptr[4] >> 1) - pi2_tmp_ptr[12];
  184|   335k|        x3 = pi2_tmp_ptr[4] + (pi2_tmp_ptr[12] >> 1);
  185|       |
  186|       |        /* inverse prediction */
  187|   335k|        i_macro = x0 + x3;
  188|   335k|        i_macro = ((i_macro + 32) >> 6);
  189|   335k|        i_macro += *pu1_pred_ptr;
  190|   335k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   335k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   335k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 110k, False: 224k]
  |  |  |  |  |  Branch (77:54): [True: 37.4k, False: 186k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  191|   335k|        pu1_pred_ptr += pred_strd;
  192|   335k|        pu1_out += out_strd;
  193|       |
  194|   335k|        i_macro = x1 + x2;
  195|   335k|        i_macro = ((i_macro + 32) >> 6);
  196|   335k|        i_macro += *pu1_pred_ptr;
  197|   335k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   335k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   335k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 111k, False: 223k]
  |  |  |  |  |  Branch (77:54): [True: 38.9k, False: 185k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  198|   335k|        pu1_pred_ptr += pred_strd;
  199|   335k|        pu1_out += out_strd;
  200|       |
  201|   335k|        i_macro = x1 - x2;
  202|   335k|        i_macro = ((i_macro + 32) >> 6);
  203|   335k|        i_macro += *pu1_pred_ptr;
  204|   335k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   335k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   335k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 113k, False: 221k]
  |  |  |  |  |  Branch (77:54): [True: 33.6k, False: 187k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  205|   335k|        pu1_pred_ptr += pred_strd;
  206|   335k|        pu1_out += out_strd;
  207|       |
  208|   335k|        i_macro = x0 - x3;
  209|   335k|        i_macro = ((i_macro + 32) >> 6);
  210|   335k|        i_macro += *pu1_pred_ptr;
  211|   335k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   335k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   335k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 115k, False: 220k]
  |  |  |  |  |  Branch (77:54): [True: 45.9k, False: 174k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  212|       |
  213|   335k|        pi2_tmp_ptr++;
  214|   335k|        pu1_out_ptr++;
  215|   335k|        pu1_pred++;
  216|   335k|    }
  217|  83.8k|}
ih264_iquant_itrans_recon_4x4_dc:
  280|   364k|{
  281|   364k|    UWORD8 *pu1_pred_ptr = pu1_pred;
  282|   364k|    UWORD8 *pu1_out_ptr = pu1_out;
  283|   364k|    WORD32 q0;
  284|   364k|    WORD16 x, i_macro, i;
  285|   364k|    WORD16 rnd_fact = (u4_qp_div_6 < 4) ? 1 << (3 - u4_qp_div_6) : 0;
  ------------------
  |  Branch (285:23): [True: 70.0k, False: 294k]
  ------------------
  286|       |
  287|   364k|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|   364k|#define UNUSED(x) ((void)(x))
  ------------------
  288|   364k|    if(iq_start_idx == 0)
  ------------------
  |  Branch (288:8): [True: 27.0k, False: 337k]
  ------------------
  289|  27.0k|    {
  290|  27.0k|        q0 = pi2_src[0];
  291|  27.0k|        INV_QUANT(q0, pu2_iscal_mat[0], pu2_weigh_mat[0], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|  27.0k|                {\
  |  |  104|  27.0k|                    i4_value *= quant_scale;\
  |  |  105|  27.0k|                    i4_value *= weight_scale;\
  |  |  106|  27.0k|                    i4_value += rndfactor;\
  |  |  107|  27.0k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  27.0k|                    i4_value >>= qbits;\
  |  |  109|  27.0k|                }
  ------------------
  292|  27.0k|    }
  293|   337k|    else
  294|   337k|    {
  295|   337k|        q0 = pi2_dc_ld_addr[0]; // Restoring dc value for intra case3
  296|   337k|    }
  297|   364k|    i_macro = ((q0 + 32) >> 6);
  298|  1.82M|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|  1.82M|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (298:16): [True: 1.45M, False: 364k]
  ------------------
  299|  1.45M|    {
  300|  1.45M|        pu1_pred_ptr = pu1_pred;
  301|  1.45M|        pu1_out = pu1_out_ptr;
  302|       |
  303|       |        /* inverse prediction */
  304|  1.45M|        x = i_macro + *pu1_pred_ptr;
  305|  1.45M|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  1.45M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  1.45M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 217k, False: 1.24M]
  |  |  |  |  |  Branch (77:54): [True: 216k, False: 1.02M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  306|  1.45M|        pu1_pred_ptr += pred_strd;
  307|  1.45M|        pu1_out += out_strd;
  308|       |
  309|  1.45M|        x = i_macro + *pu1_pred_ptr;
  310|  1.45M|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  1.45M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  1.45M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 217k, False: 1.24M]
  |  |  |  |  |  Branch (77:54): [True: 216k, False: 1.02M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  311|  1.45M|        pu1_pred_ptr += pred_strd;
  312|  1.45M|        pu1_out += out_strd;
  313|       |
  314|  1.45M|        x = i_macro + *pu1_pred_ptr;
  315|  1.45M|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  1.45M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  1.45M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 217k, False: 1.24M]
  |  |  |  |  |  Branch (77:54): [True: 216k, False: 1.02M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  316|  1.45M|        pu1_pred_ptr += pred_strd;
  317|  1.45M|        pu1_out += out_strd;
  318|       |
  319|  1.45M|        x = i_macro + *pu1_pred_ptr;
  320|  1.45M|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  1.45M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  1.45M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 217k, False: 1.24M]
  |  |  |  |  |  Branch (77:54): [True: 217k, False: 1.02M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  321|       |
  322|  1.45M|        pu1_out_ptr++;
  323|  1.45M|        pu1_pred++;
  324|  1.45M|    }
  325|   364k|}
ih264_iquant_itrans_recon_8x8:
  389|  44.9k|{
  390|  44.9k|    WORD32 i;
  391|  44.9k|    WORD16 *pi2_tmp_ptr = pi2_tmp;
  392|  44.9k|    UWORD8 *pu1_pred_ptr = pu1_pred;
  393|  44.9k|    UWORD8 *pu1_out_ptr = pu1_out;
  394|  44.9k|    WORD16 i_z0, i_z1, i_z2, i_z3, i_z4, i_z5, i_z6, i_z7;
  395|  44.9k|    WORD16 i_y0, i_y1, i_y2, i_y3, i_y4, i_y5, i_y6, i_y7;
  396|  44.9k|    WORD16 i_macro;
  397|  44.9k|    WORD32 q;
  398|  44.9k|    WORD32 rnd_fact = (qp_div < 6) ? (1 << (5 - qp_div)) : 0;
  ------------------
  |  Branch (398:23): [True: 31.1k, False: 13.7k]
  ------------------
  399|       |
  400|  44.9k|    UNUSED(iq_start_idx);
  ------------------
  |  |   45|  44.9k|#define UNUSED(x) ((void)(x))
  ------------------
  401|  44.9k|    UNUSED(pi2_dc_ld_addr);
  ------------------
  |  |   45|  44.9k|#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.92M|    for(i = 0; i < (SUB_BLK_WIDTH_8x8 * SUB_BLK_WIDTH_8x8); i++)
  ------------------
  |  |   53|  2.92M|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
                  for(i = 0; i < (SUB_BLK_WIDTH_8x8 * SUB_BLK_WIDTH_8x8); i++)
  ------------------
  |  |   53|  2.92M|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
  |  Branch (406:16): [True: 2.87M, False: 44.9k]
  ------------------
  407|  2.87M|    {
  408|  2.87M|        q = pi2_src[i];
  409|  2.87M|        INV_QUANT(q, pu2_iscale_mat[i], pu2_weigh_mat[i], qp_div, rnd_fact, 6);
  ------------------
  |  |  103|  2.87M|                {\
  |  |  104|  2.87M|                    i4_value *= quant_scale;\
  |  |  105|  2.87M|                    i4_value *= weight_scale;\
  |  |  106|  2.87M|                    i4_value += rndfactor;\
  |  |  107|  2.87M|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  2.87M|                    i4_value >>= qbits;\
  |  |  109|  2.87M|                }
  ------------------
  410|  2.87M|        pi2_tmp_ptr[i] = q;
  411|  2.87M|    }
  412|       |    /* Perform Inverse transform */
  413|       |    /*--------------------------------------------------------------------*/
  414|       |    /* IDCT [ Horizontal transformation ]                                 */
  415|       |    /*--------------------------------------------------------------------*/
  416|   404k|    for(i = 0; i < SUB_BLK_WIDTH_8x8; i++)
  ------------------
  |  |   53|   404k|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
  |  Branch (416:16): [True: 359k, False: 44.9k]
  ------------------
  417|   359k|    {
  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|   359k|        i_y0 = (pi2_tmp_ptr[0] + pi2_tmp_ptr[4] );
  429|       |
  430|   359k|        i_y1 = ((WORD32)(-pi2_tmp_ptr[3]) + pi2_tmp_ptr[5] - pi2_tmp_ptr[7]
  431|   359k|                        - (pi2_tmp_ptr[7] >> 1));
  432|       |
  433|   359k|        i_y2 = (pi2_tmp_ptr[0] - pi2_tmp_ptr[4] );
  434|       |
  435|   359k|        i_y3 = ((WORD32)pi2_tmp_ptr[1] + pi2_tmp_ptr[7] - pi2_tmp_ptr[3]
  436|   359k|                        - (pi2_tmp_ptr[3] >> 1));
  437|       |
  438|   359k|        i_y4 = ((pi2_tmp_ptr[2] >> 1) - pi2_tmp_ptr[6] );
  439|       |
  440|   359k|        i_y5 = ((WORD32)(-pi2_tmp_ptr[1]) + pi2_tmp_ptr[7] + pi2_tmp_ptr[5]
  441|   359k|                        + (pi2_tmp_ptr[5] >> 1));
  442|       |
  443|   359k|        i_y6 = (pi2_tmp_ptr[2] + (pi2_tmp_ptr[6] >> 1));
  444|       |
  445|   359k|        i_y7 = ((WORD32)pi2_tmp_ptr[3] + pi2_tmp_ptr[5] + pi2_tmp_ptr[1]
  446|   359k|                        + (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|   359k|        i_z0 = i_y0 + i_y6;
  459|   359k|        i_z1 = i_y1 + (i_y7 >> 2);
  460|   359k|        i_z2 = i_y2 + i_y4;
  461|   359k|        i_z3 = i_y3 + (i_y5 >> 2);
  462|   359k|        i_z4 = i_y2 - i_y4;
  463|   359k|        i_z5 = (i_y3 >> 2) - i_y5;
  464|   359k|        i_z6 = i_y0 - i_y6;
  465|   359k|        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|   359k|        pi2_tmp_ptr[0] = i_z0 + i_z7;
  478|   359k|        pi2_tmp_ptr[1] = i_z2 + i_z5;
  479|   359k|        pi2_tmp_ptr[2] = i_z4 + i_z3;
  480|   359k|        pi2_tmp_ptr[3] = i_z6 + i_z1;
  481|   359k|        pi2_tmp_ptr[4] = i_z6 - i_z1;
  482|   359k|        pi2_tmp_ptr[5] = i_z4 - i_z3;
  483|   359k|        pi2_tmp_ptr[6] = i_z2 - i_z5;
  484|   359k|        pi2_tmp_ptr[7] = i_z0 - i_z7;
  485|       |
  486|       |        /* move to the next row */
  487|       |        //pi2_src_ptr += SUB_BLK_WIDTH_8x8;
  488|   359k|        pi2_tmp_ptr += SUB_BLK_WIDTH_8x8;
  ------------------
  |  |   53|   359k|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
  489|   359k|    }
  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|  44.9k|    pi2_tmp_ptr = pi2_tmp;
  498|   404k|    for(i = 0; i < SUB_BLK_WIDTH_8x8; i++)
  ------------------
  |  |   53|   404k|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
  |  Branch (498:16): [True: 359k, False: 44.9k]
  ------------------
  499|   359k|    {
  500|   359k|        pu1_pred_ptr = pu1_pred;
  501|   359k|        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|   359k|        i_y0 = pi2_tmp_ptr[0] + pi2_tmp_ptr[32];
  513|       |
  514|   359k|        i_y1 = (WORD32)(-pi2_tmp_ptr[24]) + pi2_tmp_ptr[40] - pi2_tmp_ptr[56]
  515|   359k|                        - (pi2_tmp_ptr[56] >> 1);
  516|       |
  517|   359k|        i_y2 = pi2_tmp_ptr[0] - pi2_tmp_ptr[32];
  518|       |
  519|   359k|        i_y3 = (WORD32)pi2_tmp_ptr[8] + pi2_tmp_ptr[56] - pi2_tmp_ptr[24]
  520|   359k|                        - (pi2_tmp_ptr[24] >> 1);
  521|       |
  522|   359k|        i_y4 = (pi2_tmp_ptr[16] >> 1) - pi2_tmp_ptr[48];
  523|       |
  524|   359k|        i_y5 = (WORD32)(-pi2_tmp_ptr[8]) + pi2_tmp_ptr[56] + pi2_tmp_ptr[40]
  525|   359k|                        + (pi2_tmp_ptr[40] >> 1);
  526|       |
  527|   359k|        i_y6 = pi2_tmp_ptr[16] + (pi2_tmp_ptr[48] >> 1);
  528|       |
  529|   359k|        i_y7 = (WORD32)pi2_tmp_ptr[24] + pi2_tmp_ptr[40] + pi2_tmp_ptr[8]
  530|   359k|                        + (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|   359k|        i_z0 = i_y0 + i_y6;
  543|   359k|        i_z1 = i_y1 + (i_y7 >> 2);
  544|   359k|        i_z2 = i_y2 + i_y4;
  545|   359k|        i_z3 = i_y3 + (i_y5 >> 2);
  546|   359k|        i_z4 = i_y2 - i_y4;
  547|   359k|        i_z5 = (i_y3 >> 2) - i_y5;
  548|   359k|        i_z6 = i_y0 - i_y6;
  549|   359k|        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|   359k|        i_macro = ((i_z0 + i_z7 + 32) >> 6) + *pu1_pred_ptr;
  562|   359k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   359k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   359k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 60.7k, False: 298k]
  |  |  |  |  |  Branch (77:54): [True: 20.0k, False: 278k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  563|       |        /* Change uc_recBuffer to Point to next element in the same column*/
  564|   359k|        pu1_pred_ptr += pred_strd;
  565|   359k|        pu1_out += out_strd;
  566|       |
  567|   359k|        i_macro = ((i_z2 + i_z5 + 32) >> 6) + *pu1_pred_ptr;
  568|   359k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   359k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   359k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 65.3k, False: 294k]
  |  |  |  |  |  Branch (77:54): [True: 18.3k, False: 275k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  569|   359k|        pu1_pred_ptr += pred_strd;
  570|   359k|        pu1_out += out_strd;
  571|       |
  572|   359k|        i_macro = ((i_z4 + i_z3 + 32) >> 6) + *pu1_pred_ptr;
  573|   359k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   359k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   359k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 66.2k, False: 293k]
  |  |  |  |  |  Branch (77:54): [True: 17.0k, False: 276k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  574|   359k|        pu1_pred_ptr += pred_strd;
  575|   359k|        pu1_out += out_strd;
  576|       |
  577|   359k|        i_macro = ((i_z6 + i_z1 + 32) >> 6) + *pu1_pred_ptr;
  578|   359k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   359k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   359k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 64.0k, False: 295k]
  |  |  |  |  |  Branch (77:54): [True: 15.5k, False: 280k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  579|   359k|        pu1_pred_ptr += pred_strd;
  580|   359k|        pu1_out += out_strd;
  581|       |
  582|   359k|        i_macro = ((i_z6 - i_z1 + 32) >> 6) + *pu1_pred_ptr;
  583|   359k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   359k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   359k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 65.8k, False: 293k]
  |  |  |  |  |  Branch (77:54): [True: 15.3k, False: 278k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  584|   359k|        pu1_pred_ptr += pred_strd;
  585|   359k|        pu1_out += out_strd;
  586|       |
  587|   359k|        i_macro = ((i_z4 - i_z3 + 32) >> 6) + *pu1_pred_ptr;
  588|   359k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   359k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   359k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 65.0k, False: 294k]
  |  |  |  |  |  Branch (77:54): [True: 15.5k, False: 278k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  589|   359k|        pu1_pred_ptr += pred_strd;
  590|   359k|        pu1_out += out_strd;
  591|       |
  592|   359k|        i_macro = ((i_z2 - i_z5 + 32) >> 6) + *pu1_pred_ptr;
  593|   359k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   359k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   359k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 62.7k, False: 296k]
  |  |  |  |  |  Branch (77:54): [True: 17.1k, False: 279k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  594|   359k|        pu1_pred_ptr += pred_strd;
  595|   359k|        pu1_out += out_strd;
  596|       |
  597|   359k|        i_macro = ((i_z0 - i_z7 + 32) >> 6) + *pu1_pred_ptr;
  598|   359k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   359k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   359k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 63.6k, False: 295k]
  |  |  |  |  |  Branch (77:54): [True: 19.9k, False: 276k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  599|       |
  600|   359k|        pi2_tmp_ptr++;
  601|   359k|        pu1_out_ptr++;
  602|   359k|        pu1_pred++;
  603|   359k|    }
  604|  44.9k|}
ih264_iquant_itrans_recon_8x8_dc:
  668|  11.4k|{
  669|  11.4k|    UWORD8 *pu1_pred_ptr = pu1_pred;
  670|  11.4k|    UWORD8 *pu1_out_ptr = pu1_out;
  671|  11.4k|    WORD16 x, i, i_macro;
  672|  11.4k|    WORD32 q;
  673|  11.4k|    WORD32 rnd_fact = (qp_div < 6) ? (1 << (5 - qp_div)) : 0;
  ------------------
  |  Branch (673:23): [True: 5.34k, False: 6.08k]
  ------------------
  674|       |
  675|  11.4k|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|  11.4k|#define UNUSED(x) ((void)(x))
  ------------------
  676|  11.4k|    UNUSED(iq_start_idx);
  ------------------
  |  |   45|  11.4k|#define UNUSED(x) ((void)(x))
  ------------------
  677|  11.4k|    UNUSED(pi2_dc_ld_addr);
  ------------------
  |  |   45|  11.4k|#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|  11.4k|    q = pi2_src[0];
  683|  11.4k|    INV_QUANT(q, pu2_iscale_mat[0], pu2_weigh_mat[0], qp_div, rnd_fact, 6);
  ------------------
  |  |  103|  11.4k|                {\
  |  |  104|  11.4k|                    i4_value *= quant_scale;\
  |  |  105|  11.4k|                    i4_value *= weight_scale;\
  |  |  106|  11.4k|                    i4_value += rndfactor;\
  |  |  107|  11.4k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  11.4k|                    i4_value >>= qbits;\
  |  |  109|  11.4k|                }
  ------------------
  684|  11.4k|    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|   102k|    for(i = 0; i < SUB_BLK_WIDTH_8x8; i++)
  ------------------
  |  |   53|   102k|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
  |  Branch (695:16): [True: 91.4k, False: 11.4k]
  ------------------
  696|  91.4k|    {
  697|  91.4k|        pu1_pred_ptr = pu1_pred;
  698|  91.4k|        pu1_out = pu1_out_ptr;
  699|       |
  700|  91.4k|        x = i_macro + *pu1_pred_ptr;
  701|  91.4k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  91.4k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  91.4k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 7.42k, False: 83.9k]
  |  |  |  |  |  Branch (77:54): [True: 20.7k, False: 63.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  702|       |        /* Change uc_recBuffer to Point to next element in the same column*/
  703|  91.4k|        pu1_pred_ptr += pred_strd;
  704|  91.4k|        pu1_out += out_strd;
  705|       |
  706|  91.4k|        x = i_macro + *pu1_pred_ptr;
  707|  91.4k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  91.4k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  91.4k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 7.42k, False: 83.9k]
  |  |  |  |  |  Branch (77:54): [True: 20.8k, False: 63.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  708|  91.4k|        pu1_pred_ptr += pred_strd;
  709|  91.4k|        pu1_out += out_strd;
  710|       |
  711|  91.4k|        x = i_macro + *pu1_pred_ptr;
  712|  91.4k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  91.4k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  91.4k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 7.42k, False: 83.9k]
  |  |  |  |  |  Branch (77:54): [True: 20.8k, False: 63.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  713|  91.4k|        pu1_pred_ptr += pred_strd;
  714|  91.4k|        pu1_out += out_strd;
  715|       |
  716|  91.4k|        x = i_macro + *pu1_pred_ptr;
  717|  91.4k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  91.4k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  91.4k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 7.43k, False: 83.9k]
  |  |  |  |  |  Branch (77:54): [True: 20.8k, False: 63.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  718|  91.4k|        pu1_pred_ptr += pred_strd;
  719|  91.4k|        pu1_out += out_strd;
  720|       |
  721|  91.4k|        x = i_macro + *pu1_pred_ptr;
  722|  91.4k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  91.4k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  91.4k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 7.45k, False: 83.9k]
  |  |  |  |  |  Branch (77:54): [True: 20.7k, False: 63.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  723|  91.4k|        pu1_pred_ptr += pred_strd;
  724|  91.4k|        pu1_out += out_strd;
  725|       |
  726|  91.4k|        x = i_macro + *pu1_pred_ptr;
  727|  91.4k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  91.4k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  91.4k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 7.47k, False: 83.9k]
  |  |  |  |  |  Branch (77:54): [True: 20.8k, False: 63.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  728|  91.4k|        pu1_pred_ptr += pred_strd;
  729|  91.4k|        pu1_out += out_strd;
  730|       |
  731|  91.4k|        x = i_macro + *pu1_pred_ptr;
  732|  91.4k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  91.4k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  91.4k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 7.49k, False: 83.9k]
  |  |  |  |  |  Branch (77:54): [True: 20.8k, False: 63.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  733|  91.4k|        pu1_pred_ptr += pred_strd;
  734|  91.4k|        pu1_out += out_strd;
  735|       |
  736|  91.4k|        x = i_macro + *pu1_pred_ptr;
  737|  91.4k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  91.4k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  91.4k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 7.51k, False: 83.9k]
  |  |  |  |  |  Branch (77:54): [True: 20.8k, False: 63.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  738|       |
  739|  91.4k|        pu1_out_ptr++;
  740|  91.4k|        pu1_pred++;
  741|  91.4k|    }
  742|  11.4k|}
ih264_iquant_itrans_recon_chroma_4x4:
  801|  25.9k|{
  802|  25.9k|    WORD16 *pi2_src_ptr = pi2_src;
  803|  25.9k|    WORD16 *pi2_tmp_ptr = pi2_tmp;
  804|  25.9k|    UWORD8 *pu1_pred_ptr = pu1_pred;
  805|  25.9k|    UWORD8 *pu1_out_ptr = pu1_out;
  806|  25.9k|    WORD16 x0, x1, x2, x3, i;
  807|  25.9k|    WORD32 q0, q1, q2, q3;
  808|  25.9k|    WORD16 i_macro;
  809|  25.9k|    WORD16 rnd_fact = (u4_qp_div_6 < 4) ? 1 << (3 - u4_qp_div_6) : 0;
  ------------------
  |  Branch (809:23): [True: 3.44k, False: 22.4k]
  ------------------
  810|       |
  811|       |    /* inverse quant */
  812|       |    /* horizontal inverse transform */
  813|   129k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|   129k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (813:16): [True: 103k, False: 25.9k]
  ------------------
  814|   103k|    {
  815|   103k|        if(i == 0)
  ------------------
  |  Branch (815:12): [True: 25.9k, False: 77.7k]
  ------------------
  816|  25.9k|        {
  817|  25.9k|            q0 = pi2_dc_src[0];
  818|  25.9k|        }
  819|  77.7k|        else
  820|  77.7k|        {
  821|  77.7k|            q0 = pi2_src_ptr[0];
  822|  77.7k|            INV_QUANT(q0, pu2_iscal_mat[0], pu2_weigh_mat[0], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|  77.7k|                {\
  |  |  104|  77.7k|                    i4_value *= quant_scale;\
  |  |  105|  77.7k|                    i4_value *= weight_scale;\
  |  |  106|  77.7k|                    i4_value += rndfactor;\
  |  |  107|  77.7k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  77.7k|                    i4_value >>= qbits;\
  |  |  109|  77.7k|                }
  ------------------
  823|  77.7k|        }
  824|       |
  825|   103k|        q2 = pi2_src_ptr[2];
  826|   103k|        INV_QUANT(q2, pu2_iscal_mat[2], pu2_weigh_mat[2], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|   103k|                {\
  |  |  104|   103k|                    i4_value *= quant_scale;\
  |  |  105|   103k|                    i4_value *= weight_scale;\
  |  |  106|   103k|                    i4_value += rndfactor;\
  |  |  107|   103k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|   103k|                    i4_value >>= qbits;\
  |  |  109|   103k|                }
  ------------------
  827|       |
  828|   103k|        x0 = q0 + q2;
  829|   103k|        x1 = q0 - q2;
  830|       |
  831|   103k|        q1 = pi2_src_ptr[1];
  832|   103k|        INV_QUANT(q1, pu2_iscal_mat[1], pu2_weigh_mat[1], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|   103k|                {\
  |  |  104|   103k|                    i4_value *= quant_scale;\
  |  |  105|   103k|                    i4_value *= weight_scale;\
  |  |  106|   103k|                    i4_value += rndfactor;\
  |  |  107|   103k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|   103k|                    i4_value >>= qbits;\
  |  |  109|   103k|                }
  ------------------
  833|       |
  834|   103k|        q3 = pi2_src_ptr[3];
  835|   103k|        INV_QUANT(q3, pu2_iscal_mat[3], pu2_weigh_mat[3], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|   103k|                {\
  |  |  104|   103k|                    i4_value *= quant_scale;\
  |  |  105|   103k|                    i4_value *= weight_scale;\
  |  |  106|   103k|                    i4_value += rndfactor;\
  |  |  107|   103k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|   103k|                    i4_value >>= qbits;\
  |  |  109|   103k|                }
  ------------------
  836|       |
  837|   103k|        x2 = (q1 >> 1) - q3;
  838|   103k|        x3 = q1 + (q3 >> 1);
  839|       |
  840|   103k|        pi2_tmp_ptr[0] = x0 + x3;
  841|   103k|        pi2_tmp_ptr[1] = x1 + x2;
  842|   103k|        pi2_tmp_ptr[2] = x1 - x2;
  843|   103k|        pi2_tmp_ptr[3] = x0 - x3;
  844|       |
  845|   103k|        pi2_src_ptr += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|   103k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  846|   103k|        pi2_tmp_ptr += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|   103k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  847|   103k|        pu2_iscal_mat += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|   103k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  848|   103k|        pu2_weigh_mat += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|   103k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  849|   103k|    }
  850|       |
  851|       |    /* vertical inverse transform */
  852|  25.9k|    pi2_tmp_ptr = pi2_tmp;
  853|   129k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|   129k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (853:16): [True: 103k, False: 25.9k]
  ------------------
  854|   103k|    {
  855|   103k|        pu1_pred_ptr = pu1_pred;
  856|   103k|        pu1_out = pu1_out_ptr;
  857|       |
  858|   103k|        x0 = (pi2_tmp_ptr[0] + pi2_tmp_ptr[8]);
  859|   103k|        x1 = (pi2_tmp_ptr[0] - pi2_tmp_ptr[8]);
  860|   103k|        x2 = (pi2_tmp_ptr[4] >> 1) - pi2_tmp_ptr[12];
  861|   103k|        x3 = pi2_tmp_ptr[4] + (pi2_tmp_ptr[12] >> 1);
  862|       |
  863|       |        /* inverse prediction */
  864|   103k|        i_macro = x0 + x3;
  865|   103k|        i_macro = ((i_macro + 32) >> 6);
  866|   103k|        i_macro += *pu1_pred_ptr;
  867|   103k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   103k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   103k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 18.8k, False: 84.8k]
  |  |  |  |  |  Branch (77:54): [True: 4.48k, False: 80.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  868|   103k|        pu1_pred_ptr += pred_strd;
  869|   103k|        pu1_out += out_strd;
  870|       |
  871|   103k|        i_macro = x1 + x2;
  872|   103k|        i_macro = ((i_macro + 32) >> 6);
  873|   103k|        i_macro += *pu1_pred_ptr;
  874|   103k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   103k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   103k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 18.6k, False: 84.9k]
  |  |  |  |  |  Branch (77:54): [True: 4.21k, False: 80.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  875|   103k|        pu1_pred_ptr += pred_strd;
  876|   103k|        pu1_out += out_strd;
  877|       |
  878|   103k|        i_macro = x1 - x2;
  879|   103k|        i_macro = ((i_macro + 32) >> 6);
  880|   103k|        i_macro += *pu1_pred_ptr;
  881|   103k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   103k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   103k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 18.6k, False: 85.0k]
  |  |  |  |  |  Branch (77:54): [True: 4.09k, False: 80.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  882|   103k|        pu1_pred_ptr += pred_strd;
  883|   103k|        pu1_out += out_strd;
  884|       |
  885|   103k|        i_macro = x0 - x3;
  886|   103k|        i_macro = ((i_macro + 32) >> 6);
  887|   103k|        i_macro += *pu1_pred_ptr;
  888|   103k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   103k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   103k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 19.6k, False: 83.9k]
  |  |  |  |  |  Branch (77:54): [True: 4.48k, False: 79.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  889|       |
  890|   103k|        pi2_tmp_ptr++;
  891|   103k|        pu1_out_ptr += 2; // Interleaved store for output
  892|   103k|        pu1_pred += 2; // Interleaved load for pred buffer
  893|   103k|    }
  894|  25.9k|}
ih264_iquant_itrans_recon_chroma_4x4_dc:
  950|   147k|{
  951|   147k|    UWORD8 *pu1_pred_ptr = pu1_pred;
  952|   147k|    UWORD8 *pu1_out_ptr = pu1_out;
  953|   147k|    WORD32 q0;
  954|   147k|    WORD16 x, i_macro, i;
  955|       |
  956|   147k|    UNUSED(pi2_src);
  ------------------
  |  |   45|   147k|#define UNUSED(x) ((void)(x))
  ------------------
  957|   147k|    UNUSED(pu2_iscal_mat);
  ------------------
  |  |   45|   147k|#define UNUSED(x) ((void)(x))
  ------------------
  958|   147k|    UNUSED(pu2_weigh_mat);
  ------------------
  |  |   45|   147k|#define UNUSED(x) ((void)(x))
  ------------------
  959|   147k|    UNUSED(u4_qp_div_6);
  ------------------
  |  |   45|   147k|#define UNUSED(x) ((void)(x))
  ------------------
  960|   147k|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|   147k|#define UNUSED(x) ((void)(x))
  ------------------
  961|       |
  962|   147k|    q0 = pi2_dc_src[0];    // Restoring dc value for intra case3
  963|   147k|    i_macro = ((q0 + 32) >> 6);
  964|       |
  965|   739k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|   739k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (965:16): [True: 591k, False: 147k]
  ------------------
  966|   591k|    {
  967|   591k|        pu1_pred_ptr = pu1_pred;
  968|   591k|        pu1_out = pu1_out_ptr;
  969|       |
  970|       |        /* inverse prediction */
  971|   591k|        x = i_macro + *pu1_pred_ptr;
  972|   591k|        *pu1_out =  CLIP_U8(x);
  ------------------
  |  |   58|   591k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   591k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 140k, False: 450k]
  |  |  |  |  |  Branch (77:54): [True: 6.25k, False: 444k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  973|   591k|        pu1_pred_ptr += pred_strd;
  974|   591k|        pu1_out += out_strd;
  975|       |
  976|   591k|        x = i_macro + *pu1_pred_ptr;
  977|   591k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|   591k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   591k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 141k, False: 450k]
  |  |  |  |  |  Branch (77:54): [True: 6.28k, False: 443k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  978|   591k|        pu1_pred_ptr += pred_strd;
  979|   591k|        pu1_out += out_strd;
  980|       |
  981|   591k|        x = i_macro + *pu1_pred_ptr;
  982|   591k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|   591k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   591k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 141k, False: 450k]
  |  |  |  |  |  Branch (77:54): [True: 6.20k, False: 443k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  983|   591k|        pu1_pred_ptr += pred_strd;
  984|   591k|        pu1_out += out_strd;
  985|       |
  986|   591k|        x = i_macro + *pu1_pred_ptr;
  987|   591k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|   591k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   591k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 140k, False: 450k]
  |  |  |  |  |  Branch (77:54): [True: 6.23k, False: 444k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  988|       |
  989|   591k|        pu1_out_ptr+=2;
  990|   591k|        pu1_pred+=2;
  991|   591k|    }
  992|   147k|}

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

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

ih264_default_weighted_pred_luma:
  110|  62.5k|{
  111|  62.5k|    WORD32 i, j;
  112|       |
  113|  62.5k|    src_strd1 -= wd;
  114|  62.5k|    src_strd2 -= wd;
  115|  62.5k|    dst_strd -= wd;
  116|       |
  117|  1.00M|    for(i = 0; i < ht; i++)
  ------------------
  |  Branch (117:16): [True: 939k, False: 62.5k]
  ------------------
  118|   939k|    {
  119|  15.4M|        for(j = 0; j < wd; j++, pu1_src1++, pu1_src2++, pu1_dst++)
  ------------------
  |  Branch (119:20): [True: 14.5M, False: 939k]
  ------------------
  120|  14.5M|            *pu1_dst = (*pu1_src1 + *pu1_src2 + 1) >> 1;
  121|       |
  122|   939k|        pu1_src1 += src_strd1;
  123|   939k|        pu1_src2 += src_strd2;
  124|   939k|        pu1_dst += dst_strd;
  125|   939k|    }
  126|  62.5k|}
ih264_default_weighted_pred_chroma:
  178|  62.5k|{
  179|  62.5k|    WORD32 i, j;
  180|       |
  181|  62.5k|    wd = wd << 1;
  182|       |
  183|  62.5k|    src_strd1 -= wd;
  184|  62.5k|    src_strd2 -= wd;
  185|  62.5k|    dst_strd -= wd;
  186|       |
  187|   532k|    for(i = 0; i < ht; i++)
  ------------------
  |  Branch (187:16): [True: 469k, False: 62.5k]
  ------------------
  188|   469k|    {
  189|  7.74M|        for(j = 0; j < wd; j++, pu1_src1++, pu1_src2++, pu1_dst++)
  ------------------
  |  Branch (189:20): [True: 7.27M, False: 469k]
  ------------------
  190|  7.27M|            *pu1_dst = (*pu1_src1 + *pu1_src2 + 1) >> 1;
  191|       |
  192|   469k|        pu1_src1 += src_strd1;
  193|   469k|        pu1_src2 += src_strd2;
  194|   469k|        pu1_dst += dst_strd;
  195|   469k|    }
  196|  62.5k|}
ih264_weighted_pred_luma:
  252|  1.25M|{
  253|  1.25M|    WORD32 i, j;
  254|       |
  255|  1.25M|    wt = (WORD16)(wt & 0xffff);
  256|  1.25M|    ofst = (WORD8)(ofst & 0xff);
  257|       |
  258|  1.25M|    src_strd -= wd;
  259|  1.25M|    dst_strd -= wd;
  260|       |
  261|  1.25M|    if(log_wd >= 1)
  ------------------
  |  Branch (261:8): [True: 418k, False: 839k]
  ------------------
  262|   418k|    {
  263|   418k|        WORD32 i_ofst = (1 << (log_wd - 1)) + (ofst << log_wd);
  264|  6.75M|        for(i = 0; i < ht; i++)
  ------------------
  |  Branch (264:20): [True: 6.33M, False: 418k]
  ------------------
  265|  6.33M|        {
  266|   104M|            for(j = 0; j < wd; j++, pu1_src++, pu1_dst++)
  ------------------
  |  Branch (266:24): [True: 98.2M, False: 6.33M]
  ------------------
  267|  98.2M|                *pu1_dst = CLIP_U8((wt * (*pu1_src) + i_ofst) >> log_wd);
  ------------------
  |  |   58|  98.2M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  98.2M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 24.0M, False: 74.1M]
  |  |  |  |  |  Branch (77:54): [True: 67.6k, False: 74.1M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  268|       |
  269|  6.33M|            pu1_src += src_strd;
  270|  6.33M|            pu1_dst += dst_strd;
  271|  6.33M|        }
  272|   418k|    }
  273|   839k|    else
  274|   839k|    {
  275|  13.8M|        for(i = 0; i < ht; i++)
  ------------------
  |  Branch (275:20): [True: 13.0M, False: 839k]
  ------------------
  276|  13.0M|        {
  277|   218M|            for(j = 0; j < wd; j++, pu1_src++, pu1_dst++)
  ------------------
  |  Branch (277:24): [True: 205M, False: 13.0M]
  ------------------
  278|   205M|                *pu1_dst = CLIP_U8(wt * (*pu1_src) + ofst);
  ------------------
  |  |   58|   205M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   205M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 17.1M, False: 187M]
  |  |  |  |  |  Branch (77:54): [True: 655k, False: 187M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  279|       |
  280|  13.0M|            pu1_src += src_strd;
  281|  13.0M|            pu1_dst += dst_strd;
  282|  13.0M|        }
  283|   839k|    }
  284|  1.25M|}
ih264_weighted_pred_chroma:
  340|  1.25M|{
  341|  1.25M|    WORD32 i, j;
  342|  1.25M|    WORD32 wt_u, wt_v;
  343|  1.25M|    WORD32 ofst_u, ofst_v;
  344|       |
  345|  1.25M|    wt_u = (WORD16)(wt & 0xffff);
  346|  1.25M|    wt_v = (WORD16)(wt >> 16);
  347|       |
  348|  1.25M|    ofst_u = (WORD8)(ofst & 0xff);
  349|  1.25M|    ofst_v = (WORD8)(ofst >> 8);
  350|       |
  351|  1.25M|    src_strd -= wd << 1;
  352|  1.25M|    dst_strd -= wd << 1;
  353|       |
  354|  1.25M|    if(log_wd >= 1)
  ------------------
  |  Branch (354:8): [True: 373k, False: 884k]
  ------------------
  355|   373k|    {
  356|   373k|        ofst_u = (1 << (log_wd - 1)) + (ofst_u << log_wd);
  357|   373k|        ofst_v = (1 << (log_wd - 1)) + (ofst_v << log_wd);
  358|       |
  359|  3.27M|        for(i = 0; i < ht; i++)
  ------------------
  |  Branch (359:20): [True: 2.90M, False: 373k]
  ------------------
  360|  2.90M|        {
  361|  25.7M|            for(j = 0; j < wd; j++, pu1_src++, pu1_dst++)
  ------------------
  |  Branch (361:24): [True: 22.8M, False: 2.90M]
  ------------------
  362|  22.8M|            {
  363|  22.8M|                *pu1_dst = CLIP_U8((wt_u * (*pu1_src) + ofst_u) >> log_wd);
  ------------------
  |  |   58|  22.8M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  22.8M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 1.00M, False: 21.8M]
  |  |  |  |  |  Branch (77:54): [True: 1.16M, False: 20.6M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  364|  22.8M|                pu1_src++;
  365|  22.8M|                pu1_dst++;
  366|  22.8M|                *pu1_dst = CLIP_U8((wt_v * (*pu1_src) + ofst_v) >> log_wd);
  ------------------
  |  |   58|  22.8M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  22.8M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 1.03M, False: 21.7M]
  |  |  |  |  |  Branch (77:54): [True: 810k, False: 20.9M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  367|  22.8M|            }
  368|  2.90M|            pu1_src += src_strd;
  369|  2.90M|            pu1_dst += dst_strd;
  370|  2.90M|        }
  371|   373k|    }
  372|   884k|    else
  373|   884k|    {
  374|  7.64M|        for(i = 0; i < ht; i++)
  ------------------
  |  Branch (374:20): [True: 6.76M, False: 884k]
  ------------------
  375|  6.76M|        {
  376|  59.7M|            for(j = 0; j < wd; j++, pu1_src++, pu1_dst++)
  ------------------
  |  Branch (376:24): [True: 53.0M, False: 6.76M]
  ------------------
  377|  53.0M|            {
  378|  53.0M|                *pu1_dst = CLIP_U8(wt_u * (*pu1_src) + ofst_u);
  ------------------
  |  |   58|  53.0M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  53.0M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 2.97M, False: 50.0M]
  |  |  |  |  |  Branch (77:54): [True: 179k, False: 49.8M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  379|  53.0M|                pu1_src++;
  380|  53.0M|                pu1_dst++;
  381|  53.0M|                *pu1_dst = CLIP_U8(wt_v * (*pu1_src) + ofst_v);
  ------------------
  |  |   58|  53.0M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  53.0M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 1.16M, False: 51.8M]
  |  |  |  |  |  Branch (77:54): [True: 371k, False: 51.4M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  382|  53.0M|            }
  383|  6.76M|            pu1_src += src_strd;
  384|  6.76M|            pu1_dst += dst_strd;
  385|  6.76M|        }
  386|   884k|    }
  387|  1.25M|}
ih264_weighted_bi_pred_luma:
  460|   198k|{
  461|   198k|    WORD32 i, j;
  462|   198k|    WORD32 shft, ofst;
  463|       |
  464|   198k|    ofst1 = (WORD8)(ofst1 & 0xff);
  465|   198k|    ofst2 = (WORD8)(ofst2 & 0xff);
  466|   198k|    wt1 = (WORD16)(wt1 & 0xffff);
  467|   198k|    wt2 = (WORD16)(wt2 & 0xffff);
  468|   198k|    ofst = (ofst1 + ofst2 + 1) >> 1;
  469|       |
  470|   198k|    shft = log_wd + 1;
  471|   198k|    ofst = (1 << log_wd) + (ofst << shft);
  472|       |
  473|   198k|    src_strd1 -= wd;
  474|   198k|    src_strd2 -= wd;
  475|   198k|    dst_strd -= wd;
  476|       |
  477|  3.30M|    for(i = 0; i < ht; i++)
  ------------------
  |  Branch (477:16): [True: 3.10M, False: 198k]
  ------------------
  478|  3.10M|    {
  479|  51.7M|        for(j = 0; j < wd; j++, pu1_src1++, pu1_src2++, pu1_dst++)
  ------------------
  |  Branch (479:20): [True: 48.6M, False: 3.10M]
  ------------------
  480|  48.6M|            *pu1_dst = CLIP_U8((wt1 * (*pu1_src1) + wt2 * (*pu1_src2) + ofst) >> shft);
  ------------------
  |  |   58|  48.6M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  48.6M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 11.3M, False: 37.3M]
  |  |  |  |  |  Branch (77:54): [True: 1.26M, False: 36.0M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  481|       |
  482|  3.10M|        pu1_src1 += src_strd1;
  483|  3.10M|        pu1_src2 += src_strd2;
  484|  3.10M|        pu1_dst += dst_strd;
  485|  3.10M|    }
  486|   198k|}
ih264_weighted_bi_pred_chroma:
  559|   198k|{
  560|   198k|    WORD32 i, j;
  561|   198k|    WORD32 wt1_u, wt1_v, wt2_u, wt2_v;
  562|   198k|    WORD32 ofst1_u, ofst1_v, ofst2_u, ofst2_v;
  563|   198k|    WORD32 ofst_u, ofst_v;
  564|   198k|    WORD32 shft;
  565|       |
  566|   198k|    ofst1_u = (WORD8)(ofst1 & 0xff);
  567|   198k|    ofst1_v = (WORD8)(ofst1 >> 8);
  568|   198k|    ofst2_u = (WORD8)(ofst2 & 0xff);
  569|   198k|    ofst2_v = (WORD8)(ofst2 >> 8);
  570|   198k|    wt1_u = (WORD16)(wt1 & 0xffff);
  571|   198k|    wt1_v = (WORD16)(wt1 >> 16);
  572|   198k|    wt2_u = (WORD16)(wt2 & 0xffff);
  573|   198k|    wt2_v = (WORD16)(wt2 >> 16);
  574|   198k|    ofst_u = (ofst1_u + ofst2_u + 1) >> 1;
  575|   198k|    ofst_v = (ofst1_v + ofst2_v + 1) >> 1;
  576|       |
  577|   198k|    src_strd1 -= wd << 1;
  578|   198k|    src_strd2 -= wd << 1;
  579|   198k|    dst_strd -= wd << 1;
  580|       |
  581|   198k|    shft = log_wd + 1;
  582|   198k|    ofst_u = (1 << log_wd) + (ofst_u << shft);
  583|   198k|    ofst_v = (1 << log_wd) + (ofst_v << shft);
  584|       |
  585|  1.74M|    for(i = 0; i < ht; i++)
  ------------------
  |  Branch (585:16): [True: 1.55M, False: 198k]
  ------------------
  586|  1.55M|    {
  587|  13.7M|        for(j = 0; j < wd; j++, pu1_src1++, pu1_src2++, pu1_dst++)
  ------------------
  |  Branch (587:20): [True: 12.1M, False: 1.55M]
  ------------------
  588|  12.1M|        {
  589|  12.1M|            *pu1_dst = CLIP_U8((wt1_u * (*pu1_src1) + wt2_u * (*pu1_src2) + ofst_u) >> shft);
  ------------------
  |  |   58|  12.1M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  12.1M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 650k, False: 11.5M]
  |  |  |  |  |  Branch (77:54): [True: 738k, False: 10.7M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  590|  12.1M|            pu1_src1++;
  591|  12.1M|            pu1_src2++;
  592|  12.1M|            pu1_dst++;
  593|  12.1M|            *pu1_dst = CLIP_U8((wt1_v * (*pu1_src1) + wt2_v * (*pu1_src2) + ofst_v) >> shft);
  ------------------
  |  |   58|  12.1M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  12.1M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 724k, False: 11.4M]
  |  |  |  |  |  Branch (77:54): [True: 223k, False: 11.2M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  594|  12.1M|        }
  595|  1.55M|        pu1_src1 += src_strd1;
  596|  1.55M|        pu1_src2 += src_strd2;
  597|  1.55M|        pu1_dst += dst_strd;
  598|  1.55M|    }
  599|   198k|}

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

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

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

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

ih264_ihadamard_scaling_4x4_sse42:
   95|  11.9k|{
   96|  11.9k|    __m128i src_r0_r1, src_r2_r3;
   97|  11.9k|    __m128i src_r0, src_r1, src_r2, src_r3;
   98|  11.9k|    __m128i temp0, temp1, temp2, temp3;
   99|  11.9k|    __m128i add_rshift = _mm_set1_epi32((u4_qp_div_6 < 6) ? (1 << (5 - u4_qp_div_6)) : 0);
  ------------------
  |  Branch (99:41): [True: 7.06k, False: 4.91k]
  ------------------
  100|  11.9k|    __m128i mult_val = _mm_set1_epi32(pu2_iscal_mat[0] * pu2_weigh_mat[0]);
  101|  11.9k|    UNUSED (pi4_tmp);
  ------------------
  |  |   45|  11.9k|#define UNUSED(x) ((void)(x))
  ------------------
  102|       |
  103|  11.9k|    src_r0_r1 = _mm_loadu_si128((__m128i *) (pi2_src)); //a00 a01 a02 a03 a10 a11 a12 a13 -- the source matrix 0th,1st row
  104|  11.9k|    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|  11.9k|    src_r0 = _mm_cvtepi16_epi32(src_r0_r1);
  107|  11.9k|    src_r0_r1 = _mm_srli_si128(src_r0_r1, 8);
  108|  11.9k|    src_r1 = _mm_cvtepi16_epi32(src_r0_r1);
  109|       |
  110|  11.9k|    src_r2 = _mm_cvtepi16_epi32(src_r2_r3);
  111|  11.9k|    src_r2_r3 = _mm_srli_si128(src_r2_r3, 8);
  112|  11.9k|    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|  11.9k|    temp0 = _mm_unpacklo_epi32(src_r0, src_r1);                  //a0 b0 a1 b1
  126|  11.9k|    temp2 = _mm_unpacklo_epi32(src_r2, src_r3);                  //c0 d0 c1 d1
  127|  11.9k|    temp1 = _mm_unpackhi_epi32(src_r0, src_r1);                  //a2 b2 a3 b3
  128|  11.9k|    temp3 = _mm_unpackhi_epi32(src_r2, src_r3);                  //c2 d2 c3 d3
  129|  11.9k|    src_r0 = _mm_unpacklo_epi64(temp0, temp2);                    //a0 b0 c0 d0
  130|  11.9k|    src_r1 = _mm_unpackhi_epi64(temp0, temp2);                    //a1 b1 c1 d1
  131|  11.9k|    src_r2 = _mm_unpacklo_epi64(temp1, temp3);                    //a2 b2 c2 d2
  132|  11.9k|    src_r3 = _mm_unpackhi_epi64(temp1, temp3);                    //a3 b3 c3 d3
  133|       |
  134|  11.9k|    temp0 = _mm_add_epi32(src_r0, src_r3);
  135|  11.9k|    temp1 = _mm_add_epi32(src_r1, src_r2);
  136|  11.9k|    temp2 = _mm_sub_epi32(src_r1, src_r2);
  137|  11.9k|    temp3 = _mm_sub_epi32(src_r0, src_r3);
  138|       |
  139|  11.9k|    src_r0 = _mm_add_epi32(temp0, temp1);
  140|  11.9k|    src_r1 = _mm_add_epi32(temp2, temp3);
  141|  11.9k|    src_r2 = _mm_sub_epi32(temp0, temp1);
  142|  11.9k|    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|  11.9k|    temp0 = _mm_unpacklo_epi32(src_r0, src_r1);                  //a0 a1 b0 b1
  155|  11.9k|    temp2 = _mm_unpacklo_epi32(src_r2, src_r3);                  //a2 a3 b2 b3
  156|  11.9k|    temp1 = _mm_unpackhi_epi32(src_r0, src_r1);                  //c0 c1 d0 d1
  157|  11.9k|    temp3 = _mm_unpackhi_epi32(src_r2, src_r3);                  //c2 c3 d2 d3
  158|  11.9k|    src_r0 = _mm_unpacklo_epi64(temp0, temp2);                   //a0 a1 a2 a3
  159|  11.9k|    src_r1 = _mm_unpackhi_epi64(temp0, temp2);                   //b0 b1 b2 b3
  160|  11.9k|    src_r2 = _mm_unpacklo_epi64(temp1, temp3);                   //c0 c1 c2 c3
  161|  11.9k|    src_r3 = _mm_unpackhi_epi64(temp1, temp3);                   //d0 d1 d2 d3
  162|       |
  163|  11.9k|    temp0 = _mm_add_epi32(src_r0, src_r3);
  164|  11.9k|    temp1 = _mm_add_epi32(src_r1, src_r2);
  165|  11.9k|    temp2 = _mm_sub_epi32(src_r1, src_r2);
  166|  11.9k|    temp3 = _mm_sub_epi32(src_r0, src_r3);
  167|       |
  168|  11.9k|    src_r0 = _mm_add_epi32(temp0, temp1);
  169|  11.9k|    src_r1 = _mm_add_epi32(temp2, temp3);
  170|  11.9k|    src_r2 = _mm_sub_epi32(temp0, temp1);
  171|  11.9k|    src_r3 = _mm_sub_epi32(temp3, temp2);
  172|       |
  173|  11.9k|    src_r0 = _mm_mullo_epi32(src_r0, mult_val);
  174|  11.9k|    src_r1 = _mm_mullo_epi32(src_r1, mult_val);
  175|  11.9k|    src_r2 = _mm_mullo_epi32(src_r2, mult_val);
  176|  11.9k|    src_r3 = _mm_mullo_epi32(src_r3, mult_val);
  177|       |
  178|       |    //Scaling
  179|  11.9k|    if(u4_qp_div_6 >= 6)
  ------------------
  |  Branch (179:8): [True: 4.91k, False: 7.06k]
  ------------------
  180|  4.91k|    {
  181|  4.91k|        src_r0 = _mm_slli_epi32(src_r0, u4_qp_div_6 - 6);
  182|  4.91k|        src_r1 = _mm_slli_epi32(src_r1, u4_qp_div_6 - 6);
  183|  4.91k|        src_r2 = _mm_slli_epi32(src_r2, u4_qp_div_6 - 6);
  184|  4.91k|        src_r3 = _mm_slli_epi32(src_r3, u4_qp_div_6 - 6);
  185|  4.91k|    }
  186|  7.06k|    else
  187|  7.06k|    {
  188|  7.06k|        temp0 = _mm_add_epi32(src_r0, add_rshift);
  189|  7.06k|        temp1 = _mm_add_epi32(src_r1, add_rshift);
  190|  7.06k|        temp2 = _mm_add_epi32(src_r2, add_rshift);
  191|  7.06k|        temp3 = _mm_add_epi32(src_r3, add_rshift);
  192|  7.06k|        src_r0 = _mm_srai_epi32(temp0, 6 - u4_qp_div_6);
  193|  7.06k|        src_r1 = _mm_srai_epi32(temp1, 6 - u4_qp_div_6);
  194|  7.06k|        src_r2 = _mm_srai_epi32(temp2, 6 - u4_qp_div_6);
  195|  7.06k|        src_r3 = _mm_srai_epi32(temp3, 6 - u4_qp_div_6);
  196|  7.06k|    }
  197|  11.9k|    src_r0_r1 = _mm_packs_epi32(src_r0, src_r1);
  198|  11.9k|    src_r2_r3 = _mm_packs_epi32(src_r2, src_r3);
  199|       |
  200|  11.9k|    _mm_storeu_si128((__m128i *) (&pi2_out[0]), src_r0_r1);
  201|  11.9k|    _mm_storeu_si128((__m128i *) (&pi2_out[8]), src_r2_r3);
  202|  11.9k|}

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

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: 62.2k, False: 147k]
  ------------------
  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: 182k, False: 26.5k]
  ------------------
  128|   182k|        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|  8.76k|{
  239|  8.76k|    WORD32 q0 = pi2_src[0];
  240|  8.76k|    WORD16 i_macro, rnd_fact = (qp_div < 6) ? 1 << (5 - qp_div) : 0;
  ------------------
  |  Branch (240:32): [True: 4.51k, False: 4.24k]
  ------------------
  241|       |
  242|  8.76k|    __m128i predload_r,pred_r0, pred_r1, pred_r2, pred_r3,pred_r4,pred_r5,pred_r6,pred_r7;
  243|  8.76k|    __m128i sign_reg;
  244|  8.76k|    __m128i zero_8x16b = _mm_setzero_si128();          // all bits reset to zero
  245|  8.76k|    __m128i temp1,temp2,temp3,temp4, temp5, temp6, temp7,temp8;
  246|  8.76k|    __m128i value_add;
  247|       |
  248|  8.76k|    UNUSED (pi2_tmp);
  ------------------
  |  |   45|  8.76k|#define UNUSED(x) ((void)(x))
  ------------------
  249|  8.76k|    UNUSED (iq_start_idx);
  ------------------
  |  |   45|  8.76k|#define UNUSED(x) ((void)(x))
  ------------------
  250|  8.76k|    UNUSED (pi2_dc_ld_addr);
  ------------------
  |  |   45|  8.76k|#define UNUSED(x) ((void)(x))
  ------------------
  251|       |
  252|  8.76k|    INV_QUANT(q0, pu2_iscale_mat[0], pu2_weigh_mat[0], qp_div, rnd_fact, 6);
  ------------------
  |  |  103|  8.76k|                {\
  |  |  104|  8.76k|                    i4_value *= quant_scale;\
  |  |  105|  8.76k|                    i4_value *= weight_scale;\
  |  |  106|  8.76k|                    i4_value += rndfactor;\
  |  |  107|  8.76k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  8.76k|                    i4_value >>= qbits;\
  |  |  109|  8.76k|                }
  ------------------
  253|  8.76k|    i_macro = ((q0 + 32) >> 6);
  254|       |
  255|  8.76k|    value_add = _mm_set1_epi16(i_macro);
  256|       |
  257|       |    //Load pred buffer row 0
  258|  8.76k|    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|  8.76k|    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|  8.76k|    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|  8.76k|    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|  8.76k|    predload_r = _mm_loadl_epi64(
  265|  8.76k|                    (__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|  8.76k|    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|  8.76k|    predload_r = _mm_loadl_epi64(
  269|  8.76k|                    (__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|  8.76k|    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|  8.76k|    predload_r = _mm_loadl_epi64(
  273|  8.76k|                    (__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|  8.76k|    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|  8.76k|    predload_r = _mm_loadl_epi64(
  277|  8.76k|                    (__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|  8.76k|    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|  8.76k|    predload_r = _mm_loadl_epi64(
  281|  8.76k|                    (__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|  8.76k|    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|  8.76k|    predload_r = _mm_loadl_epi64(
  285|  8.76k|                    (__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|  8.76k|    pred_r7 = _mm_unpacklo_epi8(predload_r, zero_8x16b); //p0 p1 p2 p3 p4 p5 p6 p7 -- all 16 bits
  287|       |
  288|  8.76k|    temp1 = _mm_add_epi16(value_add, pred_r0);
  289|       |
  290|  8.76k|    temp2 = _mm_add_epi16(value_add, pred_r1);
  291|       |
  292|  8.76k|    temp3 = _mm_add_epi16(value_add, pred_r2);
  293|       |
  294|  8.76k|    temp4 = _mm_add_epi16(value_add, pred_r3);
  295|       |
  296|  8.76k|    temp5 = _mm_add_epi16(value_add, pred_r4);
  297|       |
  298|  8.76k|    temp6 = _mm_add_epi16(value_add, pred_r5);
  299|       |
  300|  8.76k|    temp7 = _mm_add_epi16(value_add, pred_r6);
  301|       |
  302|  8.76k|    temp8 = _mm_add_epi16(value_add, pred_r7);
  303|       |    /*------------------------------------------------------------------*/
  304|       |    //Clipping the results to 8 bits
  305|  8.76k|    sign_reg = _mm_cmpgt_epi16(temp1, zero_8x16b); // sign check
  306|  8.76k|    temp1 = _mm_and_si128(temp1, sign_reg);
  307|  8.76k|    sign_reg = _mm_cmpgt_epi16(temp2, zero_8x16b); // sign check
  308|  8.76k|    temp2 = _mm_and_si128(temp2, sign_reg);
  309|  8.76k|    sign_reg = _mm_cmpgt_epi16(temp3, zero_8x16b); // sign check
  310|  8.76k|    temp3 = _mm_and_si128(temp3, sign_reg);
  311|  8.76k|    sign_reg = _mm_cmpgt_epi16(temp4, zero_8x16b); // sign check
  312|  8.76k|    temp4 = _mm_and_si128(temp4, sign_reg);
  313|  8.76k|    sign_reg = _mm_cmpgt_epi16(temp5, zero_8x16b); // sign check
  314|  8.76k|    temp5 = _mm_and_si128(temp5, sign_reg);
  315|  8.76k|    sign_reg = _mm_cmpgt_epi16(temp6, zero_8x16b); // sign check
  316|  8.76k|    temp6 = _mm_and_si128(temp6, sign_reg);
  317|  8.76k|    sign_reg = _mm_cmpgt_epi16(temp7, zero_8x16b); // sign check
  318|  8.76k|    temp7 = _mm_and_si128(temp7, sign_reg);
  319|  8.76k|    sign_reg = _mm_cmpgt_epi16(temp8, zero_8x16b); // sign check
  320|  8.76k|    temp8 = _mm_and_si128(temp8, sign_reg);
  321|       |
  322|  8.76k|    temp1 = _mm_packus_epi16(temp1, zero_8x16b);
  323|  8.76k|    temp2 = _mm_packus_epi16(temp2, zero_8x16b);
  324|  8.76k|    temp3 = _mm_packus_epi16(temp3, zero_8x16b);
  325|  8.76k|    temp4 = _mm_packus_epi16(temp4, zero_8x16b);
  326|  8.76k|    temp5 = _mm_packus_epi16(temp5, zero_8x16b);
  327|  8.76k|    temp6 = _mm_packus_epi16(temp6, zero_8x16b);
  328|  8.76k|    temp7 = _mm_packus_epi16(temp7, zero_8x16b);
  329|  8.76k|    temp8 = _mm_packus_epi16(temp8, zero_8x16b);
  330|       |
  331|  8.76k|    _mm_storel_epi64((__m128i *)(&pu1_out[0]), temp1);
  332|  8.76k|    _mm_storel_epi64((__m128i *)(&pu1_out[out_strd]), temp2);
  333|  8.76k|    _mm_storel_epi64((__m128i *)(&pu1_out[2 * out_strd]), temp3);
  334|  8.76k|    _mm_storel_epi64((__m128i *)(&pu1_out[3 * out_strd]), temp4);
  335|  8.76k|    _mm_storel_epi64((__m128i *)(&pu1_out[4 * out_strd]), temp5);
  336|  8.76k|    _mm_storel_epi64((__m128i *)(&pu1_out[5 * out_strd]), temp6);
  337|  8.76k|    _mm_storel_epi64((__m128i *)(&pu1_out[6 * out_strd]), temp7);
  338|  8.76k|    _mm_storel_epi64((__m128i *)(&pu1_out[7 * out_strd]), temp8);
  339|  8.76k|}
ih264_iquant_itrans_recon_chroma_4x4_dc_ssse3:
  398|   183k| {
  399|   183k|    WORD16 q0 = pi2_dc_src[0];      // DC value won't be dequantized for chroma inverse transform
  400|   183k|    WORD16 i_macro = ((q0 + 32) >> 6);
  401|       |
  402|   183k|    __m128i pred_r0, pred_r1, pred_r2, pred_r3, sign_reg;
  403|   183k|    __m128i zero_8x16b = _mm_setzero_si128();          // all bits reset to zero
  404|   183k|    __m128i chroma_mask = _mm_set1_epi16 (0xFF);
  405|   183k|    __m128i value_add = _mm_set1_epi16(i_macro);
  406|   183k|    __m128i out_r0, out_r1, out_r2, out_r3;
  407|       |
  408|   183k|    UNUSED (pi2_src);
  ------------------
  |  |   45|   183k|#define UNUSED(x) ((void)(x))
  ------------------
  409|   183k|    UNUSED (pu2_iscal_mat);
  ------------------
  |  |   45|   183k|#define UNUSED(x) ((void)(x))
  ------------------
  410|   183k|    UNUSED (pu2_weigh_mat);
  ------------------
  |  |   45|   183k|#define UNUSED(x) ((void)(x))
  ------------------
  411|   183k|    UNUSED (u4_qp_div_6);
  ------------------
  |  |   45|   183k|#define UNUSED(x) ((void)(x))
  ------------------
  412|   183k|    UNUSED (pi2_tmp);
  ------------------
  |  |   45|   183k|#define UNUSED(x) ((void)(x))
  ------------------
  413|       |
  414|       |    //Load pred buffer
  415|   183k|    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|   183k|    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|   183k|    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|   183k|    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|   183k|    pred_r0 = _mm_and_si128(pred_r0, chroma_mask);
  421|   183k|    pred_r1 = _mm_and_si128(pred_r1, chroma_mask);
  422|   183k|    pred_r2 = _mm_and_si128(pred_r2, chroma_mask);
  423|   183k|    pred_r3 = _mm_and_si128(pred_r3, chroma_mask);
  424|       |
  425|   183k|    pred_r0 = _mm_unpacklo_epi64(pred_r0, pred_r1); //p00 p01 p02 p03 p10 p11 p12 p13
  426|   183k|    pred_r2 = _mm_unpacklo_epi64(pred_r2, pred_r3); //p20 p21 p22p p23 p30 p31 p32 p33
  427|       |
  428|   183k|    pred_r0 = _mm_add_epi16(value_add, pred_r0);
  429|   183k|    pred_r2 = _mm_add_epi16(value_add, pred_r2);
  430|       |
  431|       |    /*------------------------------------------------------------------*/
  432|       |    //Clipping the results to 8 bits
  433|   183k|    sign_reg = _mm_cmpgt_epi16(pred_r0, zero_8x16b);        // sign check
  434|   183k|    pred_r0 = _mm_and_si128(pred_r0, sign_reg);
  435|   183k|    sign_reg = _mm_cmpgt_epi16(pred_r2, zero_8x16b);
  436|   183k|    pred_r2 = _mm_and_si128(pred_r2, sign_reg);
  437|       |
  438|   183k|    pred_r0 = _mm_packus_epi16(pred_r0, pred_r2);
  439|   183k|    pred_r1 = _mm_srli_si128(pred_r0, 4);
  440|   183k|    pred_r2 = _mm_srli_si128(pred_r1, 4);
  441|   183k|    pred_r3 = _mm_srli_si128(pred_r2, 4);
  442|       |
  443|   183k|    pred_r0 = _mm_unpacklo_epi8(pred_r0, zero_8x16b); //p00 p01 p02 p03 -- all 16 bits
  444|   183k|    pred_r1 = _mm_unpacklo_epi8(pred_r1, zero_8x16b); //p10 p11 p12 p13 -- all 16 bits
  445|   183k|    pred_r2 = _mm_unpacklo_epi8(pred_r2, zero_8x16b); //p20 p21 p22 p23 -- all 16 bits
  446|   183k|    pred_r3 = _mm_unpacklo_epi8(pred_r3, zero_8x16b); //p30 p31 p32 p33 -- all 16 bits
  447|       |
  448|   183k|    chroma_mask = _mm_set1_epi16 (0xFF00);
  449|   183k|    out_r0 = _mm_loadl_epi64((__m128i *) (&pu1_out[0]));
  450|   183k|    out_r1 = _mm_loadl_epi64((__m128i *) (&pu1_out[out_strd]));
  451|   183k|    out_r2 = _mm_loadl_epi64((__m128i *) (&pu1_out[2 * out_strd]));
  452|   183k|    out_r3 = _mm_loadl_epi64((__m128i *) (&pu1_out[3 * out_strd]));
  453|       |
  454|   183k|    out_r0 = _mm_and_si128(out_r0, chroma_mask);
  455|   183k|    out_r1 = _mm_and_si128(out_r1, chroma_mask);
  456|   183k|    out_r2 = _mm_and_si128(out_r2, chroma_mask);
  457|   183k|    out_r3 = _mm_and_si128(out_r3, chroma_mask);
  458|       |
  459|   183k|    out_r0 = _mm_add_epi8(out_r0, pred_r0);
  460|   183k|    out_r1 = _mm_add_epi8(out_r1, pred_r1);
  461|   183k|    out_r2 = _mm_add_epi8(out_r2, pred_r2);
  462|   183k|    out_r3 = _mm_add_epi8(out_r3, pred_r3);
  463|       |
  464|   183k|    _mm_storel_epi64((__m128i *)(&pu1_out[0]), out_r0);
  465|   183k|    _mm_storel_epi64((__m128i *)(&pu1_out[out_strd]), out_r1);
  466|   183k|    _mm_storel_epi64((__m128i *)(&pu1_out[2 * out_strd]), out_r2);
  467|   183k|    _mm_storel_epi64((__m128i *)(&pu1_out[3 * out_strd]), out_r3);
  468|   183k|}

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

ih264_iquant_itrans_recon_4x4_ssse3:
  111|  12.5k|{
  112|  12.5k|    UWORD32 *pu4_out = (UWORD32 *) pu1_out;
  113|  12.5k|    __m128i src_r0_r1, src_r2_r3;
  114|  12.5k|    __m128i src_r0, src_r1, src_r2, src_r3;
  115|  12.5k|    __m128i scalemat_r0_r1, scalemat_r2_r3, predload_r;
  116|  12.5k|    __m128i pred_r0, pred_r1, pred_r2, pred_r3;
  117|  12.5k|    __m128i sign_reg, dequant_r0_r1, dequant_r2_r3;
  118|  12.5k|    __m128i zero_8x16b = _mm_setzero_si128();          // all bits reset to zero
  119|  12.5k|    __m128i temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7;
  120|  12.5k|    __m128i resq_r0, resq_r1, resq_r2, resq_r3;
  121|  12.5k|    __m128i add_rshift = _mm_set1_epi32((u4_qp_div_6 < 4) ? (1 << (3 - u4_qp_div_6)) : 0);
  ------------------
  |  Branch (121:41): [True: 3.07k, False: 9.45k]
  ------------------
  122|  12.5k|    __m128i value_32 = _mm_set1_epi32(32);
  123|  12.5k|    UNUSED (pi2_tmp);
  ------------------
  |  |   45|  12.5k|#define UNUSED(x) ((void)(x))
  ------------------
  124|  12.5k|    UNUSED (pi2_dc_ld_addr);
  ------------------
  |  |   45|  12.5k|#define UNUSED(x) ((void)(x))
  ------------------
  125|       |
  126|       |    /*************************************************************/
  127|       |    /* Dequantization of coefficients. Will be replaced by SIMD  */
  128|       |    /* operations on platform                                    */
  129|       |    /*************************************************************/
  130|  12.5k|    src_r0_r1 = _mm_loadu_si128((__m128i *) (pi2_src)); //a00 a01 a02 a03 a10 a11 a12 a13 -- the source matrix 0th,1st row
  131|  12.5k|    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|  12.5k|    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|  12.5k|    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|  12.5k|    dequant_r0_r1 = _mm_loadu_si128((__m128i *) (pu2_weigh_mat)); //q00 q01 q02 q03 q10 q11 q12 q13 -- all 16 bits
  135|  12.5k|    dequant_r2_r3 = _mm_loadu_si128((__m128i *) (pu2_weigh_mat + 8)); //q20 q21 q22 q23 q30 q31 q32 q33 -- all 16 bits
  136|       |
  137|  12.5k|    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|  12.5k|    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|  12.5k|    temp4 = _mm_unpacklo_epi16(temp0, zero_8x16b); // b00*q00 0 b01*q01 0 b02*q02 0 b03*q03 0 -- 16 bit long
  141|  12.5k|    temp5 = _mm_unpackhi_epi16(temp0, zero_8x16b); // b10*q10 0 b11*q11 0 b12*q12 0 b13*q13 0 -- 16 bit long
  142|  12.5k|    temp6 = _mm_unpacklo_epi16(temp1, zero_8x16b); // b00*q00 0 b01*q01 0 b02*q02 0 b03*q03 0 -- 16 bit long
  143|  12.5k|    temp7 = _mm_unpackhi_epi16(temp1, zero_8x16b); // b10*q10 0 b11*q11 0 b12*q12 0 b13*q13 0 -- 16 bit long
  144|       |
  145|  12.5k|    src_r0 = _mm_unpacklo_epi16(src_r0_r1, zero_8x16b); // a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  146|  12.5k|    src_r1 = _mm_unpackhi_epi16(src_r0_r1, zero_8x16b); // a10 0 a11 0 a12 0 a13 0 -- 16 bit long
  147|  12.5k|    src_r2 = _mm_unpacklo_epi16(src_r2_r3, zero_8x16b); // a20 0 a21 0 a22 0 a23 0 -- 16 bit long
  148|  12.5k|    src_r3 = _mm_unpackhi_epi16(src_r2_r3, zero_8x16b); // a30 0 a31 0 a32 0 a33 0 -- 16 bit long
  149|       |
  150|  12.5k|    temp4 = _mm_madd_epi16(src_r0, temp4); //a00*b00*q00 a10*b10*q10 a20*b20*q20 a30*b30 q30 -- 32 bits long
  151|  12.5k|    temp5 = _mm_madd_epi16(src_r1, temp5);
  152|  12.5k|    temp6 = _mm_madd_epi16(src_r2, temp6);
  153|  12.5k|    temp7 = _mm_madd_epi16(src_r3, temp7);
  154|       |
  155|  12.5k|    if (u4_qp_div_6 >= 4) {
  ------------------
  |  Branch (155:9): [True: 9.45k, False: 3.07k]
  ------------------
  156|  9.45k|        resq_r0 = _mm_slli_epi32(temp4, u4_qp_div_6 - 4);
  157|  9.45k|        resq_r1 = _mm_slli_epi32(temp5, u4_qp_div_6 - 4);
  158|  9.45k|        resq_r2 = _mm_slli_epi32(temp6, u4_qp_div_6 - 4);
  159|  9.45k|        resq_r3 = _mm_slli_epi32(temp7, u4_qp_div_6 - 4);
  160|  9.45k|    } else {
  161|  3.07k|        temp4 = _mm_add_epi32(temp4, add_rshift);
  162|  3.07k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  163|  3.07k|        temp6 = _mm_add_epi32(temp6, add_rshift);
  164|  3.07k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  165|  3.07k|        resq_r0 = _mm_srai_epi32(temp4, 4 - u4_qp_div_6);
  166|  3.07k|        resq_r1 = _mm_srai_epi32(temp5, 4 - u4_qp_div_6);
  167|  3.07k|        resq_r2 = _mm_srai_epi32(temp6, 4 - u4_qp_div_6);
  168|  3.07k|        resq_r3 = _mm_srai_epi32(temp7, 4 - u4_qp_div_6);
  169|  3.07k|    }
  170|       |
  171|  12.5k|    if (iq_start_idx == 1)
  ------------------
  |  Branch (171:9): [True: 1.19k, False: 11.3k]
  ------------------
  172|  1.19k|    {
  173|  1.19k|        resq_r0 = _mm_insert_epi16(resq_r0,(WORD32)pi2_src[0],0);
  174|  1.19k|        if (pi2_src[0] >= 0)
  ------------------
  |  Branch (174:13): [True: 860, False: 338]
  ------------------
  175|    860|            resq_r0 = _mm_insert_epi16(resq_r0,0,1);
  176|    338|        else
  177|    338|            resq_r0 = _mm_insert_epi16(resq_r0,-1,1);
  178|  1.19k|    }
  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|  12.5k|    temp1 = _mm_unpacklo_epi32(resq_r0, resq_r1);                  //a0 b0 a1 b1
  191|  12.5k|    temp3 = _mm_unpacklo_epi32(resq_r2, resq_r3);                  //c0 d0 c1 d1
  192|  12.5k|    temp2 = _mm_unpackhi_epi32(resq_r0, resq_r1);                  //a2 b2 a3 b3
  193|  12.5k|    temp4 = _mm_unpackhi_epi32(resq_r2, resq_r3);                  //c2 d2 c3 d3
  194|  12.5k|    resq_r0 = _mm_unpacklo_epi64(temp1, temp3);                    //a0 b0 c0 d0
  195|  12.5k|    resq_r1 = _mm_unpackhi_epi64(temp1, temp3);                    //a1 b1 c1 d1
  196|  12.5k|    resq_r2 = _mm_unpacklo_epi64(temp2, temp4);                    //a2 b2 c2 d2
  197|  12.5k|    resq_r3 = _mm_unpackhi_epi64(temp2, temp4);                    //a3 b3 c3 d3
  198|       |    //Transform starts -- horizontal transform
  199|       |    /*------------------------------------------------------------------*/
  200|       |    /* z0 = w0 + w2                                             */
  201|  12.5k|    temp0 = _mm_add_epi32(resq_r0, resq_r2);
  202|       |    /* z1 = w0 - w2                                             */
  203|  12.5k|    temp1 = _mm_sub_epi32(resq_r0, resq_r2);
  204|       |    /* z2 = (w1 >> 1) - w3                                      */
  205|  12.5k|    temp2 = _mm_srai_epi32(resq_r1, 1);                         //(w1>>1)
  206|  12.5k|    temp2 = _mm_sub_epi32(temp2, resq_r3);                      //(w1>>1) - w3
  207|       |    /* z3 = w1 + (w3 >> 1)                                      */
  208|  12.5k|    temp3 = _mm_srai_epi32(resq_r3, 1);                         //(w3>>1) + w1
  209|  12.5k|    temp3 = _mm_add_epi32(temp3, resq_r1);
  210|       |    /*----------------------------------------------------------*/
  211|       |    /* x0 = z0 + z3                                             */
  212|  12.5k|    resq_r0 = _mm_add_epi32(temp0, temp3);
  213|       |    /* x1 = z1 + z2                                             */
  214|  12.5k|    resq_r1 = _mm_add_epi32(temp1, temp2);
  215|       |    /* x2 = z1 - z2                                             */
  216|  12.5k|    resq_r2 = _mm_sub_epi32(temp1, temp2);
  217|       |    /* x3 = z0 - z3                                             */
  218|  12.5k|    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|  12.5k|    temp1 = _mm_unpacklo_epi32(resq_r0, resq_r1);                  //a0 a1 b0 b1
  227|  12.5k|    temp3 = _mm_unpacklo_epi32(resq_r2, resq_r3);                  //a2 a3 b2 b3
  228|  12.5k|    temp2 = _mm_unpackhi_epi32(resq_r0, resq_r1);                  //c0 c1 d0 d1
  229|  12.5k|    temp4 = _mm_unpackhi_epi32(resq_r2, resq_r3);                  //c2 c3 d2 d3
  230|  12.5k|    resq_r0 = _mm_unpacklo_epi64(temp1, temp3);                    //a0 a1 a2 a3
  231|  12.5k|    resq_r1 = _mm_unpackhi_epi64(temp1, temp3);                    //b0 b1 b2 b3
  232|  12.5k|    resq_r2 = _mm_unpacklo_epi64(temp2, temp4);                    //c0 c1 c2 c3
  233|  12.5k|    resq_r3 = _mm_unpackhi_epi64(temp2, temp4);                    //d0 d1 d2 d3
  234|       |    //Transform ends -- horizontal transform
  235|       |
  236|  12.5k|    zero_8x16b = _mm_setzero_si128();                  // all bits reset to zero
  237|       |    //Load pred buffer
  238|  12.5k|    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|  12.5k|    pred_r0 = _mm_unpacklo_epi8(predload_r, zero_8x16b); //p00 p01 p02 p03 0 0 0 0 -- all 16 bits
  240|       |
  241|  12.5k|    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|  12.5k|    pred_r1 = _mm_unpacklo_epi8(predload_r, zero_8x16b); //p10 p11 p12 p13 0 0 0 0 -- all 16 bits
  243|       |
  244|  12.5k|    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|  12.5k|    pred_r2 = _mm_unpacklo_epi8(predload_r, zero_8x16b); //p20 p21 p22 p23 0 0 0 0 -- all 16 bits
  246|       |
  247|  12.5k|    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|  12.5k|    pred_r3 = _mm_unpacklo_epi8(predload_r, zero_8x16b); //p30 p31 p32 p33 0 0 0 0 -- all 16 bits
  249|  12.5k|    pred_r0 = _mm_unpacklo_epi16(pred_r0, zero_8x16b); //p00 p01 p02 p03 -- 32 bits sign extended
  250|  12.5k|    pred_r1 = _mm_unpacklo_epi16(pred_r1, zero_8x16b); //p10 p11 p12 p13 -- 32 bits sign extended
  251|  12.5k|    pred_r2 = _mm_unpacklo_epi16(pred_r2, zero_8x16b); //p20 p21 p22 p23 -- 32 bits sign extended
  252|  12.5k|    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|  12.5k|    temp0 = _mm_add_epi32(resq_r0, resq_r2);
  261|       |    /* z1j = y0j - y2j                                                        */
  262|  12.5k|    temp1 = _mm_sub_epi32(resq_r0, resq_r2);
  263|       |    /* z2j = (y1j>>1) - y3j                                                        */
  264|  12.5k|    temp2 = _mm_srai_epi32(resq_r1, 1);                             //(y1j>>1)
  265|  12.5k|    temp2 = _mm_sub_epi32(temp2, resq_r3);
  266|       |    /* z3j = y1j + (y3j>>1)                                                        */
  267|  12.5k|    temp3 = _mm_srai_epi32(resq_r3, 1);                             //(y3j>>1)
  268|  12.5k|    temp3 = _mm_add_epi32(temp3, resq_r1);
  269|       |
  270|       |    /* x0j = z0j + z3j                                                        */
  271|  12.5k|    temp4 = _mm_add_epi32(temp0, temp3);
  272|  12.5k|    temp4 = _mm_add_epi32(temp4, value_32);
  273|  12.5k|    temp4 = _mm_srai_epi32(temp4, 6);
  274|  12.5k|    temp4 = _mm_add_epi32(temp4, pred_r0);
  275|       |    /* x1j = z1j + z2j                                                        */
  276|  12.5k|    temp5 = _mm_add_epi32(temp1, temp2);
  277|  12.5k|    temp5 = _mm_add_epi32(temp5, value_32);
  278|  12.5k|    temp5 = _mm_srai_epi32(temp5, 6);
  279|  12.5k|    temp5 = _mm_add_epi32(temp5, pred_r1);
  280|       |    /* x2j = z1j - z2j                                                        */
  281|  12.5k|    temp6 = _mm_sub_epi32(temp1, temp2);
  282|  12.5k|    temp6 = _mm_add_epi32(temp6, value_32);
  283|  12.5k|    temp6 = _mm_srai_epi32(temp6, 6);
  284|  12.5k|    temp6 = _mm_add_epi32(temp6, pred_r2);
  285|       |    /* x3j = z0j - z3j                                                        */
  286|  12.5k|    temp7 = _mm_sub_epi32(temp0, temp3);
  287|  12.5k|    temp7 = _mm_add_epi32(temp7, value_32);
  288|  12.5k|    temp7 = _mm_srai_epi32(temp7, 6);
  289|  12.5k|    temp7 = _mm_add_epi32(temp7, pred_r3);
  290|       |
  291|       |    // 32-bit to 16-bit conversion
  292|  12.5k|    temp0 = _mm_packs_epi32(temp4, temp5);
  293|  12.5k|    temp1 = _mm_packs_epi32(temp6, temp7);
  294|       |    /*------------------------------------------------------------------*/
  295|       |    //Clipping the results to 8 bits
  296|  12.5k|    sign_reg = _mm_cmpgt_epi16(temp0, zero_8x16b);      // sign check
  297|  12.5k|    temp0 = _mm_and_si128(temp0, sign_reg);
  298|  12.5k|    sign_reg = _mm_cmpgt_epi16(temp1, zero_8x16b);
  299|  12.5k|    temp1 = _mm_and_si128(temp1, sign_reg);
  300|       |
  301|  12.5k|    resq_r0 = _mm_packus_epi16(temp0, temp1);
  302|  12.5k|    resq_r1 = _mm_srli_si128(resq_r0, 4);
  303|  12.5k|    resq_r2 = _mm_srli_si128(resq_r1, 4);
  304|  12.5k|    resq_r3 = _mm_srli_si128(resq_r2, 4);
  305|       |
  306|  12.5k|    *pu4_out = _mm_cvtsi128_si32(resq_r0);
  307|  12.5k|    pu1_out += out_strd;
  308|  12.5k|    pu4_out = (UWORD32 *) (pu1_out);
  309|  12.5k|    *(pu4_out) = _mm_cvtsi128_si32(resq_r1);
  310|  12.5k|    pu1_out += out_strd;
  311|  12.5k|    pu4_out = (UWORD32 *) (pu1_out);
  312|  12.5k|    *(pu4_out) = _mm_cvtsi128_si32(resq_r2);
  313|  12.5k|    pu1_out += out_strd;
  314|  12.5k|    pu4_out = (UWORD32 *) (pu1_out);
  315|  12.5k|    *(pu4_out) = _mm_cvtsi128_si32(resq_r3);
  316|  12.5k|}
ih264_iquant_itrans_recon_8x8_ssse3:
  380|  49.7k|{
  381|  49.7k|    __m128i src_r0;
  382|  49.7k|    __m128i scalemat_r0;
  383|  49.7k|    __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|  49.7k|    __m128i value_32 = _mm_set1_epi32(32);
  387|  49.7k|    __m128i add_rshift = _mm_set1_epi32((qp_div < 6) ? (1 << (5 - qp_div)) : 0);
  ------------------
  |  Branch (387:41): [True: 40.8k, False: 8.85k]
  ------------------
  388|  49.7k|    __m128i dequant_r0;
  389|  49.7k|    __m128i predload_r;
  390|  49.7k|    __m128i pred_r0_1, pred_r1_1, pred_r2_1, pred_r3_1, pred_r4_1, pred_r5_1,
  391|  49.7k|            pred_r6_1, pred_r7_1;
  392|  49.7k|    __m128i sign_reg;
  393|  49.7k|    __m128i src_r0_1, src_r0_2;
  394|  49.7k|    __m128i scalemat_r0_1, scalemat_r0_2;
  395|  49.7k|    __m128i temp1, temp2, temp3, temp4, temp5, temp6, temp7, temp8;
  396|  49.7k|    __m128i temp10, temp11, temp12, temp13, temp14, temp15, temp16, temp17,
  397|  49.7k|            temp18, temp19, temp20;
  398|       |    // To store dequantization results
  399|  49.7k|    __m128i resq_r0_1, resq_r0_2, resq_r1_1, resq_r1_2, resq_r2_1, resq_r2_2,
  400|  49.7k|            resq_r3_1, resq_r3_2, resq_r4_1, resq_r4_2, resq_r5_1, resq_r5_2,
  401|  49.7k|            resq_r6_1, resq_r6_2, resq_r7_1, resq_r7_2;
  402|  49.7k|    UNUSED (pi2_tmp);
  ------------------
  |  |   45|  49.7k|#define UNUSED(x) ((void)(x))
  ------------------
  403|  49.7k|    UNUSED (iq_start_idx);
  ------------------
  |  |   45|  49.7k|#define UNUSED(x) ((void)(x))
  ------------------
  404|  49.7k|    UNUSED (pi2_dc_ld_addr);
  ------------------
  |  |   45|  49.7k|#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|  49.7k|    src_r0 = _mm_loadu_si128((__m128i *) (pi2_src)); //a00 a01 a02 a03 a04 a05 a06 a07 -- the source matrix 0th row
  413|  49.7k|    scalemat_r0 = _mm_loadu_si128((__m128i *) (pu2_iscale_mat)); //b00 b01 b02 b03 b04 b05 b06 b07 -- the scaling matrix 0th row
  414|  49.7k|    dequant_r0 = _mm_loadu_si128((__m128i *) (&pu2_weigh_mat[0])); //q0 q1 q2 q3 q4 q5 q6 q7 -- all 16 bits
  415|  49.7k|    src_r0_1 = _mm_unpacklo_epi16(src_r0, zero_8x16b); //a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  416|  49.7k|    src_r0_2 = _mm_unpackhi_epi16(src_r0, zero_8x16b); // a04 0 a05 0 a06 0 a07 0 -- 16 bit long
  417|  49.7k|    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|  49.7k|    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|  49.7k|    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|  49.7k|    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|  49.7k|    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|  49.7k|    if (qp_div >= 6) {
  ------------------
  |  Branch (424:9): [True: 8.85k, False: 40.8k]
  ------------------
  425|  8.85k|        resq_r0_1 = _mm_slli_epi32(temp5, qp_div - 6);
  426|  8.85k|        resq_r0_2 = _mm_slli_epi32(temp7, qp_div - 6);
  427|  40.8k|    } else {
  428|  40.8k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  429|  40.8k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  430|  40.8k|        resq_r0_1 = _mm_srai_epi32(temp5, 6 - qp_div);
  431|  40.8k|        resq_r0_2 = _mm_srai_epi32(temp7, 6 - qp_div);
  432|  40.8k|    }
  433|  49.7k|    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|  49.7k|    src_r0 = _mm_loadu_si128((__m128i *) (pi2_src + 8)); //a00 a01 a02 a03 a04 a05 a06 a07 a08 -- the source matrix 1st row
  436|  49.7k|    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|  49.7k|    dequant_r0 = _mm_loadu_si128((__m128i *) (&pu2_weigh_mat[8])); //q0 q1 q2 q3 q4 q5 q6 q7 -- all 16 bits
  438|  49.7k|    src_r0_1 = _mm_unpacklo_epi16(src_r0, zero_8x16b); //a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  439|  49.7k|    src_r0_2 = _mm_unpackhi_epi16(src_r0, zero_8x16b); // a04 0 a05 0 a06 0 a07 0 -- 16 bit long
  440|  49.7k|    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|  49.7k|    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|  49.7k|    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|  49.7k|    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|  49.7k|    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|  49.7k|    if (qp_div >= 6) {
  ------------------
  |  Branch (445:9): [True: 8.85k, False: 40.8k]
  ------------------
  446|  8.85k|        resq_r1_1 = _mm_slli_epi32(temp5, qp_div - 6);
  447|  8.85k|        resq_r1_2 = _mm_slli_epi32(temp7, qp_div - 6);
  448|  40.8k|    } else {
  449|  40.8k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  450|  40.8k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  451|  40.8k|        resq_r1_1 = _mm_srai_epi32(temp5, 6 - qp_div);
  452|  40.8k|        resq_r1_2 = _mm_srai_epi32(temp7, 6 - qp_div);
  453|  40.8k|    }
  454|  49.7k|    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|  49.7k|    src_r0 = _mm_loadu_si128((__m128i *) (pi2_src + 16)); //a00 a01 a02 a03 a04 a05 a06 a07 a08 -- the source matrix 2nd row
  457|  49.7k|    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|  49.7k|    dequant_r0 = _mm_loadu_si128((__m128i *) (&pu2_weigh_mat[16])); //q0 q1 q2 q3 q4 q5 q6 q7 -- all 16 bits
  459|  49.7k|    src_r0_1 = _mm_unpacklo_epi16(src_r0, zero_8x16b); //a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  460|  49.7k|    src_r0_2 = _mm_unpackhi_epi16(src_r0, zero_8x16b); // a04 0 a05 0 a06 0 a07 0 -- 16 bit long
  461|  49.7k|    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|  49.7k|    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|  49.7k|    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|  49.7k|    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|  49.7k|    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|  49.7k|    if (qp_div >= 6) {
  ------------------
  |  Branch (466:9): [True: 8.85k, False: 40.8k]
  ------------------
  467|  8.85k|        resq_r2_1 = _mm_slli_epi32(temp5, qp_div - 6);
  468|  8.85k|        resq_r2_2 = _mm_slli_epi32(temp7, qp_div - 6);
  469|  40.8k|    } else {
  470|  40.8k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  471|  40.8k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  472|  40.8k|        resq_r2_1 = _mm_srai_epi32(temp5, 6 - qp_div);
  473|  40.8k|        resq_r2_2 = _mm_srai_epi32(temp7, 6 - qp_div);
  474|  40.8k|    }
  475|  49.7k|    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|  49.7k|    src_r0 = _mm_loadu_si128((__m128i *) (pi2_src + 24)); //a00 a01 a02 a03 a04 a05 a06 a07 a08 -- the source matrix 3rd row
  478|  49.7k|    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|  49.7k|    dequant_r0 = _mm_loadu_si128((__m128i *) (&pu2_weigh_mat[24])); //q0 q1 q2 q3 q4 q5 q6 q7 -- all 16 bits
  480|  49.7k|    src_r0_1 = _mm_unpacklo_epi16(src_r0, zero_8x16b); //a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  481|  49.7k|    src_r0_2 = _mm_unpackhi_epi16(src_r0, zero_8x16b); // a04 0 a05 0 a06 0 a07 0 -- 16 bit long
  482|  49.7k|    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|  49.7k|    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|  49.7k|    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|  49.7k|    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|  49.7k|    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|  49.7k|    if (qp_div >= 6) {
  ------------------
  |  Branch (487:9): [True: 8.85k, False: 40.8k]
  ------------------
  488|  8.85k|        resq_r3_1 = _mm_slli_epi32(temp5, qp_div - 6);
  489|  8.85k|        resq_r3_2 = _mm_slli_epi32(temp7, qp_div - 6);
  490|  40.8k|    } else {
  491|  40.8k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  492|  40.8k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  493|  40.8k|        resq_r3_1 = _mm_srai_epi32(temp5, 6 - qp_div);
  494|  40.8k|        resq_r3_2 = _mm_srai_epi32(temp7, 6 - qp_div);
  495|  40.8k|    }
  496|  49.7k|    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|  49.7k|    src_r0 = _mm_loadu_si128((__m128i *) (pi2_src + 32)); //a00 a01 a02 a03 a04 a05 a06 a07 a08 -- the source matrix 4th row
  499|  49.7k|    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|  49.7k|    dequant_r0 = _mm_loadu_si128((__m128i *) (&pu2_weigh_mat[32])); //q0 q1 q2 q3 q4 q5 q6 q7 -- all 16 bits
  501|  49.7k|    src_r0_1 = _mm_unpacklo_epi16(src_r0, zero_8x16b); //a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  502|  49.7k|    src_r0_2 = _mm_unpackhi_epi16(src_r0, zero_8x16b); // a04 0 a05 0 a06 0 a07 0 -- 16 bit long
  503|  49.7k|    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|  49.7k|    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|  49.7k|    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|  49.7k|    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|  49.7k|    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|  49.7k|    if (qp_div >= 6) {
  ------------------
  |  Branch (508:9): [True: 8.85k, False: 40.8k]
  ------------------
  509|  8.85k|        resq_r4_1 = _mm_slli_epi32(temp5, qp_div - 6);
  510|  8.85k|        resq_r4_2 = _mm_slli_epi32(temp7, qp_div - 6);
  511|       |
  512|  40.8k|    } else {
  513|  40.8k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  514|  40.8k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  515|  40.8k|        resq_r4_1 = _mm_srai_epi32(temp5, 6 - qp_div);
  516|  40.8k|        resq_r4_2 = _mm_srai_epi32(temp7, 6 - qp_div);
  517|  40.8k|    }
  518|  49.7k|    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|  49.7k|    src_r0 = _mm_loadu_si128((__m128i *) (pi2_src + 40)); //a00 a01 a02 a03 a04 a05 a06 a07 a08 -- the source matrix 5th row
  521|  49.7k|    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|  49.7k|    dequant_r0 = _mm_loadu_si128((__m128i *) (&pu2_weigh_mat[40])); //q0 q1 q2 q3 q4 q5 q6 q7 -- all 16 bits
  523|  49.7k|    src_r0_1 = _mm_unpacklo_epi16(src_r0, zero_8x16b); //a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  524|  49.7k|    src_r0_2 = _mm_unpackhi_epi16(src_r0, zero_8x16b); // a04 0 a05 0 a06 0 a07 0 -- 16 bit long
  525|  49.7k|    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|  49.7k|    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|  49.7k|    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|  49.7k|    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|  49.7k|    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|  49.7k|    if (qp_div >= 6) {
  ------------------
  |  Branch (530:9): [True: 8.85k, False: 40.8k]
  ------------------
  531|  8.85k|        resq_r5_1 = _mm_slli_epi32(temp5, qp_div - 6);
  532|  8.85k|        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|  40.8k|    } else {
  536|  40.8k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  537|  40.8k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  538|  40.8k|        resq_r5_1 = _mm_srai_epi32(temp5, 6 - qp_div);
  539|  40.8k|        resq_r5_2 = _mm_srai_epi32(temp7, 6 - qp_div);
  540|  40.8k|    }
  541|  49.7k|    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|  49.7k|    src_r0 = _mm_loadu_si128((__m128i *) (pi2_src + 48)); //a00 a01 a02 a03 a04 a05 a06 a07 a08 -- the source matrix 6th row
  544|  49.7k|    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|  49.7k|    dequant_r0 = _mm_loadu_si128((__m128i *) (&pu2_weigh_mat[48])); //q0 q1 q2 q3 q4 q5 q6 q7 -- all 16 bits
  546|  49.7k|    src_r0_1 = _mm_unpacklo_epi16(src_r0, zero_8x16b); //a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  547|  49.7k|    src_r0_2 = _mm_unpackhi_epi16(src_r0, zero_8x16b); // a04 0 a05 0 a06 0 a07 0 -- 16 bit long
  548|  49.7k|    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|  49.7k|    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|  49.7k|    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|  49.7k|    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|  49.7k|    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|  49.7k|    if (qp_div >= 6) {
  ------------------
  |  Branch (553:9): [True: 8.85k, False: 40.8k]
  ------------------
  554|  8.85k|        resq_r6_1 = _mm_slli_epi32(temp5, qp_div - 6);
  555|  8.85k|        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|  40.8k|    } else {
  559|  40.8k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  560|  40.8k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  561|  40.8k|        resq_r6_1 = _mm_srai_epi32(temp5, 6 - qp_div);
  562|  40.8k|        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|  40.8k|    }
  566|  49.7k|    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|  49.7k|    src_r0 = _mm_loadu_si128((__m128i *) (pi2_src + 56)); //a00 a01 a02 a03 a04 a05 a06 a07 a08 -- the source matrix 7th row
  569|  49.7k|    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|  49.7k|    dequant_r0 = _mm_loadu_si128((__m128i *) (&pu2_weigh_mat[56])); //q0 q1 q2 q3 q4 q5 q6 q7 -- all 16 bits
  571|  49.7k|    src_r0_1 = _mm_unpacklo_epi16(src_r0, zero_8x16b); //a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  572|  49.7k|    src_r0_2 = _mm_unpackhi_epi16(src_r0, zero_8x16b); // a04 0 a05 0 a06 0 a07 0 -- 16 bit long
  573|  49.7k|    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|  49.7k|    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|  49.7k|    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|  49.7k|    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|  49.7k|    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|  49.7k|    if (qp_div >= 6) {
  ------------------
  |  Branch (578:9): [True: 8.85k, False: 40.8k]
  ------------------
  579|  8.85k|        resq_r7_1 = _mm_slli_epi32(temp5, qp_div - 6);
  580|  8.85k|        resq_r7_2 = _mm_slli_epi32(temp7, qp_div - 6);
  581|  40.8k|    } else {
  582|  40.8k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  583|  40.8k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  584|  40.8k|        resq_r7_1 = _mm_srai_epi32(temp5, 6 - qp_div);
  585|  40.8k|        resq_r7_2 = _mm_srai_epi32(temp7, 6 - qp_div);
  586|  40.8k|    }
  587|  49.7k|    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|  49.7k|    temp1 = _mm_unpacklo_epi16(resq_r0_1, resq_r1_1); //a0 b0 a1 b1 a2 b2 a3 b3
  600|  49.7k|    temp3 = _mm_unpacklo_epi16(resq_r2_1, resq_r3_1); //c0 d0 c1 d1 c2 d2 c3 d3
  601|  49.7k|    temp2 = _mm_unpackhi_epi16(resq_r0_1, resq_r1_1); //a4 b4 a5 b5 a6 b6 a7 b7
  602|  49.7k|    temp4 = _mm_unpackhi_epi16(resq_r2_1, resq_r3_1); //c4 d4 c5 d5 c6 d6 c7 d7
  603|  49.7k|    resq_r0_1 = _mm_unpacklo_epi32(temp1, temp3); //a0 b0 c0 d0 a1 b1 c1 d1
  604|  49.7k|    resq_r1_1 = _mm_unpackhi_epi32(temp1, temp3); //a2 b2 c2 d2 a3 b3 c3 d3
  605|  49.7k|    resq_r2_1 = _mm_unpacklo_epi32(temp2, temp4); //a4 b4 c4 d4 a5 b5 c5 d5
  606|  49.7k|    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|  49.7k|    temp1 = _mm_unpacklo_epi16(resq_r4_1, resq_r5_1); //e0 f0 e1 f1 e2 f2 e2 f3
  614|  49.7k|    temp3 = _mm_unpacklo_epi16(resq_r6_1, resq_r7_1); //g0 h0 g1 h1 g2 h2 g3 h3
  615|  49.7k|    temp2 = _mm_unpackhi_epi16(resq_r4_1, resq_r5_1); //e4 f4 e5 f5 e6 f6 e7 f7
  616|  49.7k|    temp4 = _mm_unpackhi_epi16(resq_r6_1, resq_r7_1); //g4 h4 g5 h5 g6 h6 g7 h7
  617|  49.7k|    resq_r4_1 = _mm_unpacklo_epi32(temp1, temp3); //e0 f0 g0 h0 e1 f1 g1 h1
  618|  49.7k|    resq_r5_1 = _mm_unpackhi_epi32(temp1, temp3); //e2 f2 g2 h2 e3 f3 g3 h3
  619|  49.7k|    resq_r6_1 = _mm_unpacklo_epi32(temp2, temp4); //e4 f4 g4 h4 e5 f5 g5 h5
  620|  49.7k|    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|  49.7k|    resq_r0_2 = _mm_unpacklo_epi64(resq_r0_1, resq_r4_1); //a0 b0 c0 d0 e0 f0 g0 h0
  632|  49.7k|    resq_r1_2 = _mm_unpackhi_epi64(resq_r0_1, resq_r4_1); //a1 b1 c1 d1 e1 f1 g1 h1
  633|  49.7k|    resq_r2_2 = _mm_unpacklo_epi64(resq_r1_1, resq_r5_1); //a2 b2 c2 d2 e2 f2 g2 h2
  634|  49.7k|    resq_r3_2 = _mm_unpackhi_epi64(resq_r1_1, resq_r5_1); //a3 b3 c3 d3 e3 f3 g3 h3
  635|  49.7k|    resq_r4_2 = _mm_unpacklo_epi64(resq_r2_1, resq_r6_1); //a4 b4 c4 d4 e4 f4 g4 h4
  636|  49.7k|    resq_r5_2 = _mm_unpackhi_epi64(resq_r2_1, resq_r6_1); //a5 b5 c5 d5 e5 f5 g5 h5
  637|  49.7k|    resq_r6_2 = _mm_unpacklo_epi64(resq_r3_1, resq_r7_1); //a6 b6 c6 d6 e6 f6 g6 h6
  638|  49.7k|    resq_r7_2 = _mm_unpackhi_epi64(resq_r3_1, resq_r7_1); //a7 b7 c7 d7 e7 f7 g7 h7
  639|       |
  640|  49.7k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, resq_r1_2);
  641|  49.7k|    resq_r1_1 = _mm_unpacklo_epi16(resq_r1_2, sign_reg); //a1 b1 c1 d1 -- 32 bit
  642|  49.7k|    resq_r1_2 = _mm_unpackhi_epi16(resq_r1_2, sign_reg); //e1 f1 g1 h1 -- 32 bit
  643|  49.7k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, resq_r3_2);
  644|  49.7k|    resq_r3_1 = _mm_unpacklo_epi16(resq_r3_2, sign_reg); //a3 b3 c3 d3 -- 32 bit
  645|  49.7k|    resq_r3_2 = _mm_unpackhi_epi16(resq_r3_2, sign_reg); //e3 f3 g3 h3 -- 32 bit
  646|  49.7k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, resq_r5_2);
  647|  49.7k|    resq_r5_1 = _mm_unpacklo_epi16(resq_r5_2, sign_reg); //a5 b5 c5 d5 -- 32 bit
  648|  49.7k|    resq_r5_2 = _mm_unpackhi_epi16(resq_r5_2, sign_reg); //e5 f5 g5 h5 -- 32 bit
  649|  49.7k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, resq_r7_2);
  650|  49.7k|    resq_r7_1 = _mm_unpacklo_epi16(resq_r7_2, sign_reg); //a7 b7 c7 d7 -- 32 bit
  651|  49.7k|    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|  49.7k|    temp1 = _mm_add_epi16(resq_r0_2, resq_r4_2);
  656|       |    /* y2 = w0 - w4                                                      */
  657|  49.7k|    temp3 = _mm_sub_epi16(resq_r0_2, resq_r4_2);
  658|       |    /* y1 = -w3 + w5 - w7 - (w7 >> 1)                                   */
  659|  49.7k|    temp2 = _mm_sub_epi32(resq_r5_1, resq_r3_1); //-w3+w5
  660|  49.7k|    temp10 = _mm_sub_epi32(resq_r5_2, resq_r3_2);
  661|  49.7k|    temp4 = _mm_sub_epi32(temp2, resq_r7_1); //-w3+w5-w7
  662|  49.7k|    temp12 = _mm_sub_epi32(temp10, resq_r7_2);
  663|  49.7k|    temp5 = _mm_srai_epi32(resq_r7_1, 1); //w7>>1
  664|  49.7k|    temp13 = _mm_srai_epi32(resq_r7_2, 1);
  665|  49.7k|    temp2 = _mm_sub_epi32(temp4, temp5); //-w3+w5-w7 -(w7>>1)
  666|  49.7k|    temp10 = _mm_sub_epi32(temp12, temp13);
  667|  49.7k|    temp2 = _mm_packs_epi32(temp2, temp10);
  668|       |    /* y3 = w1 + w7 - w3 - (w3 >> 1)                                    */
  669|  49.7k|    temp4 = _mm_add_epi32(resq_r1_1, resq_r7_1); //w1+w7
  670|  49.7k|    temp12 = _mm_add_epi32(resq_r1_2, resq_r7_2);
  671|  49.7k|    temp4 = _mm_sub_epi32(temp4, resq_r3_1); //w1+w7-w3
  672|  49.7k|    temp12 = _mm_sub_epi32(temp12, resq_r3_2);
  673|  49.7k|    temp5 = _mm_srai_epi32(resq_r3_1, 1); //w3>>1
  674|  49.7k|    temp13 = _mm_srai_epi32(resq_r3_2, 1);
  675|  49.7k|    temp4 = _mm_sub_epi32(temp4, temp5); //w1+w7-w3-(w3>>1)
  676|  49.7k|    temp12 = _mm_sub_epi32(temp12, temp13);
  677|  49.7k|    temp4 = _mm_packs_epi32(temp4, temp12);
  678|       |    /* y4 = (w2 >> 1) - w6                                              */
  679|  49.7k|    temp5 = _mm_srai_epi16(resq_r2_2, 1); //w2>>1
  680|  49.7k|    temp5 = _mm_sub_epi16(temp5, resq_r6_2); //(w2>>1)-w6
  681|       |    /* y5 = -w1 + w7 + w5 + (w5 >> 1)                                   */
  682|  49.7k|    temp6 = _mm_sub_epi32(resq_r7_1, resq_r1_1); //w7-w1
  683|  49.7k|    temp14 = _mm_sub_epi32(resq_r7_2, resq_r1_2);
  684|  49.7k|    temp6 = _mm_add_epi32(temp6, resq_r5_1); //w7-w1+w5
  685|  49.7k|    temp14 = _mm_add_epi32(temp14, resq_r5_2);
  686|  49.7k|    temp7 = _mm_srai_epi32(resq_r5_1, 1); //w5>>1
  687|  49.7k|    temp15 = _mm_srai_epi32(resq_r5_2, 1);
  688|  49.7k|    temp6 = _mm_add_epi32(temp6, temp7); //w7-w1_w5+(w5>>1)
  689|  49.7k|    temp14 = _mm_add_epi32(temp14, temp15);
  690|  49.7k|    temp6 = _mm_packs_epi32(temp6, temp14);
  691|       |    /* y6 = w2 + (w6 >> 1)                                              */
  692|  49.7k|    temp7 = _mm_srai_epi16(resq_r6_2, 1); //w6>>1
  693|  49.7k|    temp7 = _mm_add_epi16(temp7, resq_r2_2); //(w6>>1)+w2
  694|       |    /* y7 = w3 + w5 + w1 + (w1 >> 1)                                    */
  695|  49.7k|    temp8 = _mm_add_epi32(resq_r3_1, resq_r5_1); //w3+w5
  696|  49.7k|    temp16 = _mm_add_epi32(resq_r3_2, resq_r5_2);
  697|  49.7k|    temp8 = _mm_add_epi32(temp8, resq_r1_1); //w3+w5+w1
  698|  49.7k|    temp16 = _mm_add_epi32(temp16, resq_r1_2);
  699|  49.7k|    temp17 = _mm_srai_epi32(resq_r1_1, 1); //w1>>1
  700|  49.7k|    temp18 = _mm_srai_epi32(resq_r1_2, 1);
  701|  49.7k|    temp8 = _mm_add_epi32(temp8, temp17); //w3+w5+w1+(w1>>1)
  702|  49.7k|    temp16 = _mm_add_epi32(temp16, temp18);
  703|  49.7k|    temp8 = _mm_packs_epi32(temp8, temp16);
  704|       |    /*------------------------------------------------------------------*/
  705|       |    /*------------------------------------------------------------------*/
  706|       |    /* z0 = y0 + y6                                                        */
  707|  49.7k|    resq_r0_1 = _mm_add_epi16(temp1, temp7);
  708|       |    /* z1 = y1 + (y7 >> 2)                                                */
  709|  49.7k|    resq_r1_1 = _mm_srai_epi16(temp8, 2);
  710|  49.7k|    resq_r1_1 = _mm_add_epi16(resq_r1_1, temp2);
  711|       |    /* z2 = y2 + y4                                                        */
  712|  49.7k|    resq_r2_1 = _mm_add_epi16(temp3, temp5);
  713|       |    /* z3 = y3 + (y5 >> 2)                                                */
  714|  49.7k|    resq_r3_1 = _mm_srai_epi16(temp6, 2);
  715|  49.7k|    resq_r3_1 = _mm_add_epi16(resq_r3_1, temp4);
  716|       |    /* z4 = y2 - y4                                                        */
  717|  49.7k|    resq_r4_1 = _mm_sub_epi16(temp3, temp5);
  718|       |    /* z5 = (y3 >> 2) - y5                                                 */
  719|  49.7k|    resq_r5_1 = _mm_srai_epi16(temp4, 2);
  720|  49.7k|    resq_r5_1 = _mm_sub_epi16(resq_r5_1, temp6);
  721|       |    /* z6 = y0 - y6                                                     */
  722|  49.7k|    resq_r6_1 = _mm_sub_epi16(temp1, temp7);
  723|       |    /* z7 = y7 - (y1 >> 2)                                                 */
  724|  49.7k|    resq_r7_1 = _mm_srai_epi16(temp2, 2);
  725|  49.7k|    resq_r7_1 = _mm_sub_epi16(temp8, resq_r7_1);
  726|       |    /*------------------------------------------------------------------*/
  727|       |    /*------------------------------------------------------------------*/
  728|       |    /* x0 = z0 + z7                                                        */
  729|  49.7k|    temp1 = _mm_add_epi16(resq_r0_1, resq_r7_1);
  730|       |    /* x1 = z2 + z5                                                        */
  731|  49.7k|    temp2 = _mm_add_epi16(resq_r2_1, resq_r5_1);
  732|       |    /* x2 = z4 + z3                                                        */
  733|  49.7k|    temp3 = _mm_add_epi16(resq_r4_1, resq_r3_1);
  734|       |    /* x3 = z6 + z1                                                        */
  735|  49.7k|    temp4 = _mm_add_epi16(resq_r6_1, resq_r1_1);
  736|       |    /* x4 = z6 - z1                                                        */
  737|  49.7k|    temp5 = _mm_sub_epi16(resq_r6_1, resq_r1_1);
  738|       |    /* x5 = z4 - z3                                                        */
  739|  49.7k|    temp6 = _mm_sub_epi16(resq_r4_1, resq_r3_1);
  740|       |    /* x6 = z2 - z5                                                        */
  741|  49.7k|    temp7 = _mm_sub_epi16(resq_r2_1, resq_r5_1);
  742|       |    /* x7 = z0 - z7                                                        */
  743|  49.7k|    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|  49.7k|    temp17 = _mm_unpacklo_epi16(temp1, temp2); //a0 a1 b0 b1 c0 c1 d0 d1
  753|  49.7k|    temp19 = _mm_unpacklo_epi16(temp3, temp4); //a2 a3 b2 b3 c2 c3 d2 d3
  754|  49.7k|    temp18 = _mm_unpackhi_epi16(temp1, temp2); //e0 e1 f0 f1 g0 g1 h0 h1
  755|  49.7k|    temp20 = _mm_unpackhi_epi16(temp3, temp4); //e2 e3 f2 f3 g2 g3 h2 h3
  756|       |
  757|  49.7k|    resq_r0_1 = _mm_unpacklo_epi32(temp17, temp19); //a0 a1 a2 a3 b0 b1 b2 b3
  758|  49.7k|    resq_r1_1 = _mm_unpackhi_epi32(temp17, temp19); //c0 c1 c2 c3 d0 d1 d2 d3
  759|  49.7k|    resq_r2_1 = _mm_unpacklo_epi32(temp18, temp20); //e0 e1 e2 e3 f0 f1 f2 f3
  760|  49.7k|    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|  49.7k|    temp17 = _mm_unpacklo_epi16(temp5, temp6); //a4 a5 b4 b5 c4 c5 d4 d5
  768|  49.7k|    temp19 = _mm_unpacklo_epi16(temp7, temp8); //a6 a7 b6 b7 c6 c7 d6 d7
  769|  49.7k|    temp18 = _mm_unpackhi_epi16(temp5, temp6); //e4 e5 f4 f5 g4 g5 h4 h5
  770|  49.7k|    temp20 = _mm_unpackhi_epi16(temp7, temp8); //e6 e7 f6 f7 g6 g7 h6 h7
  771|       |
  772|  49.7k|    resq_r4_1 = _mm_unpacklo_epi32(temp17, temp19); //a4 a5 a6 a7 b4 b5 b6 b7
  773|  49.7k|    resq_r5_1 = _mm_unpackhi_epi32(temp17, temp19); //c4 c5 c6 c7 d4 d5 d6 d7
  774|  49.7k|    resq_r6_1 = _mm_unpacklo_epi32(temp18, temp20); //e4 e5 e6 e7 f4 f5 f6 f7
  775|  49.7k|    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|  49.7k|    resq_r0_2 = _mm_unpacklo_epi64(resq_r0_1, resq_r4_1); //a0 a1 a2 a3 a4 a5 a6 a7
  786|  49.7k|    resq_r1_2 = _mm_unpackhi_epi64(resq_r0_1, resq_r4_1); //b0 b1 b2 b3 b4 b5 b6 b7
  787|  49.7k|    resq_r2_2 = _mm_unpacklo_epi64(resq_r1_1, resq_r5_1); //c0 c1 c2 c3 c4 c5 c6 c7
  788|  49.7k|    resq_r3_2 = _mm_unpackhi_epi64(resq_r1_1, resq_r5_1); //d0 d1 d2 d3 d4 d5 d6 d7
  789|  49.7k|    resq_r4_2 = _mm_unpacklo_epi64(resq_r2_1, resq_r6_1); //e0 e1 e2 e3 e4 e5 e6 e7
  790|  49.7k|    resq_r5_2 = _mm_unpackhi_epi64(resq_r2_1, resq_r6_1); //f0 f1 f2 f3 f4 f5 f6 f7
  791|  49.7k|    resq_r6_2 = _mm_unpacklo_epi64(resq_r3_1, resq_r7_1); //g0 g1 g2 g3 g4 g5 g6 g7
  792|  49.7k|    resq_r7_2 = _mm_unpackhi_epi64(resq_r3_1, resq_r7_1); //h0 h1 h2 h3 h4 h5 h6 h7
  793|       |
  794|  49.7k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, resq_r1_2);
  795|  49.7k|    resq_r1_1 = _mm_unpacklo_epi16(resq_r1_2, sign_reg); //a1 b1 c1 d1 -- 32 bit
  796|  49.7k|    resq_r1_2 = _mm_unpackhi_epi16(resq_r1_2, sign_reg); //e1 f1 g1 h1 -- 32 bit
  797|  49.7k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, resq_r3_2);
  798|  49.7k|    resq_r3_1 = _mm_unpacklo_epi16(resq_r3_2, sign_reg); //a3 b3 c3 d3 -- 32 bit
  799|  49.7k|    resq_r3_2 = _mm_unpackhi_epi16(resq_r3_2, sign_reg); //e3 f3 g3 h3 -- 32 bit
  800|  49.7k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, resq_r5_2);
  801|  49.7k|    resq_r5_1 = _mm_unpacklo_epi16(resq_r5_2, sign_reg); //a5 b5 c5 d5 -- 32 bit
  802|  49.7k|    resq_r5_2 = _mm_unpackhi_epi16(resq_r5_2, sign_reg); //e5 f5 g5 h5 -- 32 bit
  803|  49.7k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, resq_r7_2);
  804|  49.7k|    resq_r7_1 = _mm_unpacklo_epi16(resq_r7_2, sign_reg); //a7 b7 c7 d7 -- 32 bit
  805|  49.7k|    resq_r7_2 = _mm_unpackhi_epi16(resq_r7_2, sign_reg); //e7 f7 g7 h7 -- 32 bit
  806|       |
  807|  49.7k|    zero_8x16b = _mm_setzero_si128(); // all bits reset to zero
  808|       |    //Load pred buffer row 0
  809|  49.7k|    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|  49.7k|    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|  49.7k|    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|  49.7k|    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|  49.7k|    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|  49.7k|    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|  49.7k|    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|  49.7k|    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|  49.7k|    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|  49.7k|    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|  49.7k|    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|  49.7k|    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|  49.7k|    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|  49.7k|    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|  49.7k|    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|  49.7k|    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|  49.7k|    temp1 = _mm_add_epi16(resq_r0_2, resq_r4_2);
  842|       |    /* y2j = w0j - w4j                                                      */
  843|  49.7k|    temp3 = _mm_sub_epi16(resq_r0_2, resq_r4_2);
  844|       |    /* y1j = -w3j + w5j - w7j - (w7j >> 1)                                   */
  845|  49.7k|    temp2 = _mm_sub_epi32(resq_r5_1, resq_r3_1); //-w3+w5
  846|  49.7k|    temp10 = _mm_sub_epi32(resq_r5_2, resq_r3_2);
  847|  49.7k|    temp4 = _mm_sub_epi32(temp2, resq_r7_1); //-w3+w5-w7
  848|  49.7k|    temp12 = _mm_sub_epi32(temp10, resq_r7_2);
  849|  49.7k|    temp5 = _mm_srai_epi32(resq_r7_1, 1); //w7>>1
  850|  49.7k|    temp13 = _mm_srai_epi32(resq_r7_2, 1);
  851|  49.7k|    temp2 = _mm_sub_epi32(temp4, temp5); //-w3+w5-w7 -(w7>>1)
  852|  49.7k|    temp10 = _mm_sub_epi32(temp12, temp13);
  853|  49.7k|    temp2 = _mm_packs_epi32(temp2, temp10);
  854|       |    /* y3j = w1j + w7j - w3j - (w3j >> 1)                                    */
  855|  49.7k|    temp4 = _mm_add_epi32(resq_r1_1, resq_r7_1); //w1+w7
  856|  49.7k|    temp12 = _mm_add_epi32(resq_r1_2, resq_r7_2);
  857|  49.7k|    temp4 = _mm_sub_epi32(temp4, resq_r3_1); //w1+w7-w3
  858|  49.7k|    temp12 = _mm_sub_epi32(temp12, resq_r3_2);
  859|  49.7k|    temp5 = _mm_srai_epi32(resq_r3_1, 1); //w3>>1
  860|  49.7k|    temp13 = _mm_srai_epi32(resq_r3_2, 1);
  861|  49.7k|    temp4 = _mm_sub_epi32(temp4, temp5); //w1+w7-w3-(w3>>1)
  862|  49.7k|    temp12 = _mm_sub_epi32(temp12, temp13);
  863|  49.7k|    temp4 = _mm_packs_epi32(temp4, temp12);
  864|       |    /* y4j = (w2j >> 1) - w6j                                              */
  865|  49.7k|    temp5 = _mm_srai_epi16(resq_r2_2, 1); //w2>>1
  866|  49.7k|    temp5 = _mm_sub_epi16(temp5, resq_r6_2); //(w2>>1)-w6
  867|       |    /* y5j = -w1j + w7j + w5j + (w5j >> 1)                                   */
  868|  49.7k|    temp6 = _mm_sub_epi32(resq_r7_1, resq_r1_1); //w7-w1
  869|  49.7k|    temp14 = _mm_sub_epi32(resq_r7_2, resq_r1_2);
  870|  49.7k|    temp6 = _mm_add_epi32(temp6, resq_r5_1); //w7-w1+w5
  871|  49.7k|    temp14 = _mm_add_epi32(temp14, resq_r5_2);
  872|  49.7k|    temp7 = _mm_srai_epi32(resq_r5_1, 1); //w5>>1
  873|  49.7k|    temp15 = _mm_srai_epi32(resq_r5_2, 1);
  874|  49.7k|    temp6 = _mm_add_epi32(temp6, temp7); //w7-w1_w5+(w5>>1)
  875|  49.7k|    temp14 = _mm_add_epi32(temp14, temp15);
  876|  49.7k|    temp6 = _mm_packs_epi32(temp6, temp14);
  877|       |    /* y6j = w2j + (w6j >> 1)                                              */
  878|  49.7k|    temp7 = _mm_srai_epi16(resq_r6_2, 1); //w6>>1
  879|  49.7k|    temp7 = _mm_add_epi16(temp7, resq_r2_2); //(w6>>1)+w2
  880|       |    /* y7j = w3j + w5j + w1j + (w1j >> 1)                                    */
  881|  49.7k|    temp8 = _mm_add_epi32(resq_r3_1, resq_r5_1); //w3+w5
  882|  49.7k|    temp16 = _mm_add_epi32(resq_r3_2, resq_r5_2);
  883|  49.7k|    temp8 = _mm_add_epi32(temp8, resq_r1_1); //w3+w5+w1
  884|  49.7k|    temp16 = _mm_add_epi32(temp16, resq_r1_2);
  885|  49.7k|    temp17 = _mm_srai_epi32(resq_r1_1, 1); //w1>>1
  886|  49.7k|    temp18 = _mm_srai_epi32(resq_r1_2, 1);
  887|  49.7k|    temp8 = _mm_add_epi32(temp8, temp17); //w3+w5+w1+(w1>>1)
  888|  49.7k|    temp16 = _mm_add_epi32(temp16, temp18);
  889|  49.7k|    temp8 = _mm_packs_epi32(temp8, temp16);
  890|       |    /*------------------------------------------------------------------*/
  891|       |    /*------------------------------------------------------------------*/
  892|       |    /* z0j = y0j + y6j                                                        */
  893|  49.7k|    resq_r0_1 = _mm_add_epi16(temp1, temp7);
  894|       |    /* z1j = y1j + (y7j >> 2)                                                */
  895|  49.7k|    resq_r1_1 = _mm_srai_epi16(temp8, 2);
  896|  49.7k|    resq_r1_1 = _mm_add_epi16(resq_r1_1, temp2);
  897|       |    /* z2j = y2j + y4j                                                        */
  898|  49.7k|    resq_r2_1 = _mm_add_epi16(temp3, temp5);
  899|       |    /* z3j = y3j + (y5j >> 2)                                                */
  900|  49.7k|    resq_r3_1 = _mm_srai_epi16(temp6, 2);
  901|  49.7k|    resq_r3_1 = _mm_add_epi16(resq_r3_1, temp4);
  902|       |    /* z4j = y2j - y4j                                                        */
  903|  49.7k|    resq_r4_1 = _mm_sub_epi16(temp3, temp5);
  904|       |    /* z5j = (y3j >> 2) - y5j                                                 */
  905|  49.7k|    resq_r5_1 = _mm_srai_epi16(temp4, 2);
  906|  49.7k|    resq_r5_1 = _mm_sub_epi16(resq_r5_1, temp6);
  907|       |    /* z6j = y0j - y6j                                                     */
  908|  49.7k|    resq_r6_1 = _mm_sub_epi16(temp1, temp7);
  909|       |    /* z7j = y7j - (y1j >> 2)                                                 */
  910|  49.7k|    resq_r7_1 = _mm_srai_epi16(temp2, 2);
  911|  49.7k|    resq_r7_1 = _mm_sub_epi16(temp8, resq_r7_1);
  912|       |    /*------------------------------------------------------------------*/
  913|       |
  914|       |    /*------------------------------------------------------------------*/
  915|       |    /* x0j = z0j + z7j                                                        */
  916|  49.7k|    temp1 = _mm_add_epi16(resq_r0_1, resq_r7_1);
  917|  49.7k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, temp1);
  918|  49.7k|    temp10 = _mm_unpacklo_epi16(temp1, sign_reg);
  919|  49.7k|    temp11 = _mm_unpackhi_epi16(temp1, sign_reg);
  920|  49.7k|    temp10 = _mm_add_epi32(temp10, value_32);
  921|  49.7k|    temp11 = _mm_add_epi32(temp11, value_32);
  922|  49.7k|    temp10 = _mm_srai_epi32(temp10, 6);
  923|  49.7k|    temp11 = _mm_srai_epi32(temp11, 6);
  924|  49.7k|    temp10 = _mm_packs_epi32(temp10, temp11);
  925|  49.7k|    temp1 = _mm_add_epi16(temp10, pred_r0_1);
  926|       |    /* x1j = z2j + z5j                                                        */
  927|  49.7k|    temp2 = _mm_add_epi16(resq_r2_1, resq_r5_1);
  928|  49.7k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, temp2);
  929|  49.7k|    temp10 = _mm_unpacklo_epi16(temp2, sign_reg);
  930|  49.7k|    temp11 = _mm_unpackhi_epi16(temp2, sign_reg);
  931|  49.7k|    temp10 = _mm_add_epi32(temp10, value_32);
  932|  49.7k|    temp11 = _mm_add_epi32(temp11, value_32);
  933|  49.7k|    temp10 = _mm_srai_epi32(temp10, 6);
  934|  49.7k|    temp11 = _mm_srai_epi32(temp11, 6);
  935|  49.7k|    temp10 = _mm_packs_epi32(temp10, temp11);
  936|  49.7k|    temp2 = _mm_add_epi16(temp10, pred_r1_1);
  937|       |    /* x2j = z4j + z3j                                                        */
  938|  49.7k|    temp3 = _mm_add_epi16(resq_r4_1, resq_r3_1);
  939|  49.7k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, temp3);
  940|  49.7k|    temp10 = _mm_unpacklo_epi16(temp3, sign_reg);
  941|  49.7k|    temp11 = _mm_unpackhi_epi16(temp3, sign_reg);
  942|  49.7k|    temp10 = _mm_add_epi32(temp10, value_32);
  943|  49.7k|    temp11 = _mm_add_epi32(temp11, value_32);
  944|  49.7k|    temp10 = _mm_srai_epi32(temp10, 6);
  945|  49.7k|    temp11 = _mm_srai_epi32(temp11, 6);
  946|  49.7k|    temp10 = _mm_packs_epi32(temp10, temp11);
  947|  49.7k|    temp3 = _mm_add_epi16(temp10, pred_r2_1);
  948|       |    /* x3j = z6j + z1j                                                        */
  949|  49.7k|    temp4 = _mm_add_epi16(resq_r6_1, resq_r1_1);
  950|  49.7k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, temp4);
  951|  49.7k|    temp10 = _mm_unpacklo_epi16(temp4, sign_reg);
  952|  49.7k|    temp11 = _mm_unpackhi_epi16(temp4, sign_reg);
  953|  49.7k|    temp10 = _mm_add_epi32(temp10, value_32);
  954|  49.7k|    temp11 = _mm_add_epi32(temp11, value_32);
  955|  49.7k|    temp10 = _mm_srai_epi32(temp10, 6);
  956|  49.7k|    temp11 = _mm_srai_epi32(temp11, 6);
  957|  49.7k|    temp10 = _mm_packs_epi32(temp10, temp11);
  958|  49.7k|    temp4 = _mm_add_epi16(temp10, pred_r3_1);
  959|       |    /* x4j = z6j - z1j                                                        */
  960|  49.7k|    temp5 = _mm_sub_epi16(resq_r6_1, resq_r1_1);
  961|  49.7k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, temp5);
  962|  49.7k|    temp10 = _mm_unpacklo_epi16(temp5, sign_reg);
  963|  49.7k|    temp11 = _mm_unpackhi_epi16(temp5, sign_reg);
  964|  49.7k|    temp10 = _mm_add_epi32(temp10, value_32);
  965|  49.7k|    temp11 = _mm_add_epi32(temp11, value_32);
  966|  49.7k|    temp10 = _mm_srai_epi32(temp10, 6);
  967|  49.7k|    temp11 = _mm_srai_epi32(temp11, 6);
  968|  49.7k|    temp10 = _mm_packs_epi32(temp10, temp11);
  969|  49.7k|    temp5 = _mm_add_epi16(temp10, pred_r4_1);
  970|       |    /* x5j = z4j - z3j                                                        */
  971|  49.7k|    temp6 = _mm_sub_epi16(resq_r4_1, resq_r3_1);
  972|  49.7k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, temp6);
  973|  49.7k|    temp10 = _mm_unpacklo_epi16(temp6, sign_reg);
  974|  49.7k|    temp11 = _mm_unpackhi_epi16(temp6, sign_reg);
  975|  49.7k|    temp10 = _mm_add_epi32(temp10, value_32);
  976|  49.7k|    temp11 = _mm_add_epi32(temp11, value_32);
  977|  49.7k|    temp10 = _mm_srai_epi32(temp10, 6);
  978|  49.7k|    temp11 = _mm_srai_epi32(temp11, 6);
  979|  49.7k|    temp10 = _mm_packs_epi32(temp10, temp11);
  980|  49.7k|    temp6 = _mm_add_epi16(temp10, pred_r5_1);
  981|       |    /* x6j = z2j - z5j                                                        */
  982|  49.7k|    temp7 = _mm_sub_epi16(resq_r2_1, resq_r5_1);
  983|  49.7k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, temp7);
  984|  49.7k|    temp10 = _mm_unpacklo_epi16(temp7, sign_reg);
  985|  49.7k|    temp11 = _mm_unpackhi_epi16(temp7, sign_reg);
  986|  49.7k|    temp10 = _mm_add_epi32(temp10, value_32);
  987|  49.7k|    temp11 = _mm_add_epi32(temp11, value_32);
  988|  49.7k|    temp10 = _mm_srai_epi32(temp10, 6);
  989|  49.7k|    temp11 = _mm_srai_epi32(temp11, 6);
  990|  49.7k|    temp10 = _mm_packs_epi32(temp10, temp11);
  991|  49.7k|    temp7 = _mm_add_epi16(temp10, pred_r6_1);
  992|       |    /* x7j = z0j - z7j                                                        */
  993|  49.7k|    temp8 = _mm_sub_epi16(resq_r0_1, resq_r7_1);
  994|  49.7k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, temp8);
  995|  49.7k|    temp10 = _mm_unpacklo_epi16(temp8, sign_reg);
  996|  49.7k|    temp11 = _mm_unpackhi_epi16(temp8, sign_reg);
  997|  49.7k|    temp10 = _mm_add_epi32(temp10, value_32);
  998|  49.7k|    temp11 = _mm_add_epi32(temp11, value_32);
  999|  49.7k|    temp10 = _mm_srai_epi32(temp10, 6);
 1000|  49.7k|    temp11 = _mm_srai_epi32(temp11, 6);
 1001|  49.7k|    temp10 = _mm_packs_epi32(temp10, temp11);
 1002|  49.7k|    temp8 = _mm_add_epi16(temp10, pred_r7_1);
 1003|       |    /*------------------------------------------------------------------*/
 1004|       |    //Clipping the results to 8 bits
 1005|  49.7k|    sign_reg = _mm_cmpgt_epi16(temp1, zero_8x16b); // sign check
 1006|  49.7k|    temp1 = _mm_and_si128(temp1, sign_reg);
 1007|  49.7k|    sign_reg = _mm_cmpgt_epi16(temp2, zero_8x16b); // sign check
 1008|  49.7k|    temp2 = _mm_and_si128(temp2, sign_reg);
 1009|  49.7k|    sign_reg = _mm_cmpgt_epi16(temp3, zero_8x16b); // sign check
 1010|  49.7k|    temp3 = _mm_and_si128(temp3, sign_reg);
 1011|  49.7k|    sign_reg = _mm_cmpgt_epi16(temp4, zero_8x16b); // sign check
 1012|  49.7k|    temp4 = _mm_and_si128(temp4, sign_reg);
 1013|  49.7k|    sign_reg = _mm_cmpgt_epi16(temp5, zero_8x16b); // sign check
 1014|  49.7k|    temp5 = _mm_and_si128(temp5, sign_reg);
 1015|  49.7k|    sign_reg = _mm_cmpgt_epi16(temp6, zero_8x16b); // sign check
 1016|  49.7k|    temp6 = _mm_and_si128(temp6, sign_reg);
 1017|  49.7k|    sign_reg = _mm_cmpgt_epi16(temp7, zero_8x16b); // sign check
 1018|  49.7k|    temp7 = _mm_and_si128(temp7, sign_reg);
 1019|  49.7k|    sign_reg = _mm_cmpgt_epi16(temp8, zero_8x16b); // sign check
 1020|  49.7k|    temp8 = _mm_and_si128(temp8, sign_reg);
 1021|       |
 1022|  49.7k|    resq_r0_2 = _mm_packus_epi16(temp1, zero_8x16b);
 1023|  49.7k|    resq_r1_2 = _mm_packus_epi16(temp2, zero_8x16b);
 1024|  49.7k|    resq_r2_2 = _mm_packus_epi16(temp3, zero_8x16b);
 1025|  49.7k|    resq_r3_2 = _mm_packus_epi16(temp4, zero_8x16b);
 1026|  49.7k|    resq_r4_2 = _mm_packus_epi16(temp5, zero_8x16b);
 1027|  49.7k|    resq_r5_2 = _mm_packus_epi16(temp6, zero_8x16b);
 1028|  49.7k|    resq_r6_2 = _mm_packus_epi16(temp7, zero_8x16b);
 1029|  49.7k|    resq_r7_2 = _mm_packus_epi16(temp8, zero_8x16b);
 1030|       |
 1031|  49.7k|    _mm_storel_epi64((__m128i *) (&pu1_out[0]), resq_r0_2);
 1032|  49.7k|    _mm_storel_epi64((__m128i *) (&pu1_out[out_strd]), resq_r1_2);
 1033|  49.7k|    _mm_storel_epi64((__m128i *) (&pu1_out[2 * out_strd]), resq_r2_2);
 1034|  49.7k|    _mm_storel_epi64((__m128i *) (&pu1_out[3 * out_strd]), resq_r3_2);
 1035|  49.7k|    _mm_storel_epi64((__m128i *) (&pu1_out[4 * out_strd]), resq_r4_2);
 1036|  49.7k|    _mm_storel_epi64((__m128i *) (&pu1_out[5 * out_strd]), resq_r5_2);
 1037|  49.7k|    _mm_storel_epi64((__m128i *) (&pu1_out[6 * out_strd]), resq_r6_2);
 1038|  49.7k|    _mm_storel_epi64((__m128i *) (&pu1_out[7 * out_strd]), resq_r7_2);
 1039|  49.7k|}

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

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

isvcd_parse_epslice.c:CLZ:
   97|   615k|{
   98|   615k|    if(u4_word)
  ------------------
  |  Branch (98:8): [True: 605k, False: 10.5k]
  ------------------
   99|   605k|    return(__builtin_clz(u4_word));
  100|  10.5k|    else
  101|  10.5k|        return 31;
  102|   615k|}
ih264_iquant_itrans_recon_sse42.c:loadu_32:
   47|   340k|{
   48|   340k|  struct __loadu_si32 {
   49|   340k|    int __v;
   50|   340k|  } __attribute__((__packed__, __may_alias__));
   51|   340k|  int __u = ((struct __loadu_si32*)__a)->__v;
   52|   340k|  return __extension__ (__m128i)(__v4si){__u, 0, 0, 0};
   53|   340k|}
ih264d_cabac.c:CLZ:
   97|  6.38M|{
   98|  6.38M|    if(u4_word)
  ------------------
  |  Branch (98:8): [True: 6.38M, False: 0]
  ------------------
   99|  6.38M|    return(__builtin_clz(u4_word));
  100|      0|    else
  101|      0|        return 31;
  102|  6.38M|}
ih264d_parse_cabac.c:CLZ:
   97|  13.5M|{
   98|  13.5M|    if(u4_word)
  ------------------
  |  Branch (98:8): [True: 13.5M, False: 0]
  ------------------
   99|  13.5M|    return(__builtin_clz(u4_word));
  100|      0|    else
  101|      0|        return 31;
  102|  13.5M|}
ih264d_parse_cavlc.c:CLZ:
   97|  7.83M|{
   98|  7.83M|    if(u4_word)
  ------------------
  |  Branch (98:8): [True: 7.54M, False: 283k]
  ------------------
   99|  7.54M|    return(__builtin_clz(u4_word));
  100|   283k|    else
  101|   283k|        return 31;
  102|  7.83M|}
ih264d_parse_islice.c:CLZ:
   97|   113k|{
   98|   113k|    if(u4_word)
  ------------------
  |  Branch (98:8): [True: 111k, False: 1.33k]
  ------------------
   99|   111k|    return(__builtin_clz(u4_word));
  100|  1.33k|    else
  101|  1.33k|        return 31;
  102|   113k|}
ih264d_parse_mb_header.c:CLZ:
   97|  6.28M|{
   98|  6.28M|    if(u4_word)
  ------------------
  |  Branch (98:8): [True: 6.28M, False: 0]
  ------------------
   99|  6.28M|    return(__builtin_clz(u4_word));
  100|      0|    else
  101|      0|        return 31;
  102|  6.28M|}
ih264d_parse_pslice.c:CLZ:
   97|   157k|{
   98|   157k|    if(u4_word)
  ------------------
  |  Branch (98:8): [True: 150k, False: 6.79k]
  ------------------
   99|   150k|    return(__builtin_clz(u4_word));
  100|  6.79k|    else
  101|  6.79k|        return 31;
  102|   157k|}
ih264d_process_intra_mb.c:CLZ:
   97|  1.50M|{
   98|  1.50M|    if(u4_word)
  ------------------
  |  Branch (98:8): [True: 1.50M, False: 0]
  ------------------
   99|  1.50M|    return(__builtin_clz(u4_word));
  100|      0|    else
  101|      0|        return 31;
  102|  1.50M|}
ih264d_utils.c:CLZ:
   97|   280k|{
   98|   280k|    if(u4_word)
  ------------------
  |  Branch (98:8): [True: 280k, False: 0]
  ------------------
   99|   280k|    return(__builtin_clz(u4_word));
  100|      0|    else
  101|      0|        return 31;
  102|   280k|}
isvcd_parse_cavlc.c:CLZ:
   97|  13.9k|{
   98|  13.9k|    if(u4_word)
  ------------------
  |  Branch (98:8): [True: 13.7k, False: 263]
  ------------------
   99|  13.7k|    return(__builtin_clz(u4_word));
  100|    263|    else
  101|    263|        return 31;
  102|  13.9k|}
isvcd_parse_ebslice.c:CLZ:
   97|  82.4k|{
   98|  82.4k|    if(u4_word)
  ------------------
  |  Branch (98:8): [True: 80.3k, False: 2.04k]
  ------------------
   99|  80.3k|    return(__builtin_clz(u4_word));
  100|  2.04k|    else
  101|  2.04k|        return 31;
  102|  82.4k|}
isvcd_parse_eislice.c:CLZ:
   97|   283k|{
   98|   283k|    if(u4_word)
  ------------------
  |  Branch (98:8): [True: 281k, False: 1.85k]
  ------------------
   99|   281k|    return(__builtin_clz(u4_word));
  100|  1.85k|    else
  101|  1.85k|        return 31;
  102|   283k|}
ih264d_parse_bslice.c:CLZ:
   97|   156k|{
   98|   156k|    if(u4_word)
  ------------------
  |  Branch (98:8): [True: 150k, False: 5.97k]
  ------------------
   99|   150k|    return(__builtin_clz(u4_word));
  100|  5.97k|    else
  101|  5.97k|        return 31;
  102|   156k|}

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

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

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

ih264d_init_cabac_dec_envirnoment:
   64|  28.0k|{
   65|  28.0k|    UWORD32 u4_code_int_val_ofst;
   66|       |
   67|  28.0k|    ps_cab_env->u4_code_int_range = (HALF - 2) << 23;
  ------------------
  |  |   45|  28.0k|#define   HALF      (1 << (B_BITS-1))
  |  |  ------------------
  |  |  |  |   43|  28.0k|#define   B_BITS    10
  |  |  ------------------
  ------------------
   68|  28.0k|    NEXTBITS(u4_code_int_val_ofst, ps_bitstrm->u4_ofst, ps_bitstrm->pu4_buffer,
  ------------------
  |  |  137|  28.0k|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  138|  28.0k|{                                                                           \
  |  |  139|  28.0k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  140|  28.0k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  141|  28.0k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  142|  28.0k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  143|  28.0k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (143:8): [True: 19.1k, False: 8.97k]
  |  |  ------------------
  |  |  144|  28.0k|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  19.1k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  145|  28.0k|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  28.0k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  146|  28.0k|}
  ------------------
   69|  28.0k|             32);
   70|  28.0k|    FLUSHBITS(ps_bitstrm->u4_ofst, 9)
  ------------------
  |  |  193|  28.0k|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  194|  28.0k|{                                                                           \
  |  |  195|  28.0k|        (u4_offset) += (u4_no_bits);                                        \
  |  |  196|  28.0k|}
  ------------------
   71|       |
   72|  28.0k|    if(EXCEED_OFFSET(ps_bitstrm))
  ------------------
  |  |   93|  28.0k|  (ps_bitstrm->u4_ofst > ps_bitstrm->u4_max_ofst)
  |  |  ------------------
  |  |  |  Branch (93:3): [True: 2.28k, False: 25.7k]
  |  |  ------------------
  ------------------
   73|  2.28k|        return ERROR_EOB_FLUSHBITS_T;
   74|       |
   75|  25.7k|    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.7k|RESET_BIN_COUNTS(ps_cab_env)
   99|       |
  100|  25.7k|    return OK;
  ------------------
  |  |  114|  25.7k|#define OK        0
  ------------------
  101|  28.0k|}
ih264d_init_cabac_contexts:
  124|  20.2k|{
  125|       |
  126|  20.2k|    bin_ctxt_model_t *p_cabac_ctxt_table_t = ps_dec->p_cabac_ctxt_table_t;
  127|  20.2k|    UWORD8 u1_qp_y = ps_dec->ps_cur_slice->u1_slice_qp;
  128|  20.2k|    UWORD8 u1_cabac_init_Idc = 0;
  129|       |
  130|  20.2k|    if(I_SLICE != u1_slice_type)
  ------------------
  |  |  370|  20.2k|#define I_SLICE  2
  ------------------
  |  Branch (130:8): [True: 16.6k, False: 3.62k]
  ------------------
  131|  16.6k|    {
  132|  16.6k|        u1_cabac_init_Idc = ps_dec->ps_cur_slice->u1_cabac_init_idc;
  133|  16.6k|    }
  134|       |
  135|  20.2k|    {
  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.2k|        ctxt_inc_mb_info_t *p_DefCtxt = ps_dec->p_ctxt_inc_mb_map - 1;
  140|  20.2k|        UWORD8 *pu1_temp;
  141|  20.2k|        WORD8 i;
  142|  20.2k|        p_DefCtxt->u1_mb_type = CAB_SKIP;
  ------------------
  |  |  402|  20.2k|#define CAB_SKIP          0x10 /* 0001 0000 */
  ------------------
  143|       |
  144|  20.2k|        p_DefCtxt->u1_cbp = 0x0f;
  145|  20.2k|        p_DefCtxt->u1_intra_chroma_pred_mode = 0;
  146|       |
  147|  20.2k|        p_DefCtxt->u1_yuv_dc_csbp = 0x7;
  148|       |
  149|  20.2k|        p_DefCtxt->u1_transform8x8_ctxt = 0;
  150|       |
  151|  20.2k|        pu1_temp = (UWORD8*)p_DefCtxt->i1_ref_idx;
  152|   101k|        for(i = 0; i < 4; i++, pu1_temp++)
  ------------------
  |  Branch (152:20): [True: 81.1k, False: 20.2k]
  ------------------
  153|  81.1k|            (*pu1_temp) = 0;
  154|  20.2k|        pu1_temp = (UWORD8*)p_DefCtxt->u1_mv;
  155|   345k|        for(i = 0; i < 16; i++, pu1_temp++)
  ------------------
  |  Branch (155:20): [True: 324k, False: 20.2k]
  ------------------
  156|   324k|            (*pu1_temp) = 0;
  157|  20.2k|        ps_dec->ps_def_ctxt_mb_info = p_DefCtxt;
  158|  20.2k|    }
  159|       |
  160|  20.2k|    if(u1_slice_type == I_SLICE)
  ------------------
  |  |  370|  20.2k|#define I_SLICE  2
  ------------------
  |  Branch (160:8): [True: 3.62k, False: 16.6k]
  ------------------
  161|  3.62k|    {
  162|  3.62k|        u1_cabac_init_Idc = 3;
  163|  3.62k|        ps_dec->p_mb_type_t = p_cabac_ctxt_table_t + MB_TYPE_I_SLICE;
  164|  3.62k|    }
  165|  16.6k|    else if(u1_slice_type == P_SLICE)
  ------------------
  |  |  368|  16.6k|#define P_SLICE  0
  ------------------
  |  Branch (165:13): [True: 7.45k, False: 9.21k]
  ------------------
  166|  7.45k|    {
  167|  7.45k|        ps_dec->p_mb_type_t = p_cabac_ctxt_table_t + MB_TYPE_P_SLICE;
  168|  7.45k|        ps_dec->p_mb_skip_flag_t = p_cabac_ctxt_table_t + MB_SKIP_FLAG_P_SLICE;
  169|  7.45k|        ps_dec->p_sub_mb_type_t = p_cabac_ctxt_table_t + SUB_MB_TYPE_P_SLICE;
  170|  7.45k|    }
  171|  9.21k|    else if(u1_slice_type == B_SLICE)
  ------------------
  |  |  369|  9.21k|#define B_SLICE  1
  ------------------
  |  Branch (171:13): [True: 9.21k, False: 0]
  ------------------
  172|  9.21k|    {
  173|  9.21k|        ps_dec->p_mb_type_t = p_cabac_ctxt_table_t + MB_TYPE_B_SLICE;
  174|  9.21k|        ps_dec->p_mb_skip_flag_t = p_cabac_ctxt_table_t + MB_SKIP_FLAG_B_SLICE;
  175|  9.21k|        ps_dec->p_sub_mb_type_t = p_cabac_ctxt_table_t + SUB_MB_TYPE_B_SLICE;
  176|  9.21k|    }
  177|  20.2k|    {
  178|  20.2k|        bin_ctxt_model_t *p_cabac_ctxt_table_t_tmp = p_cabac_ctxt_table_t;
  179|  20.2k|        if(ps_dec->ps_cur_slice->u1_field_pic_flag)
  ------------------
  |  Branch (179:12): [True: 0, False: 20.2k]
  ------------------
  180|      0|        {
  181|      0|            p_cabac_ctxt_table_t_tmp += SIGNIFICANT_COEFF_FLAG_FLD;
  182|       |
  183|      0|        }
  184|  20.2k|        else
  185|  20.2k|        {
  186|  20.2k|            p_cabac_ctxt_table_t_tmp += SIGNIFICANT_COEFF_FLAG_FRAME;
  187|  20.2k|        }
  188|  20.2k|        {
  189|  20.2k|            bin_ctxt_model_t * * p_significant_coeff_flag_t =
  190|  20.2k|                            ps_dec->p_significant_coeff_flag_t;
  191|  20.2k|            p_significant_coeff_flag_t[0] = p_cabac_ctxt_table_t_tmp
  192|  20.2k|                            + SIG_COEFF_CTXT_CAT_0_OFFSET;
  193|  20.2k|            p_significant_coeff_flag_t[1] = p_cabac_ctxt_table_t_tmp
  194|  20.2k|                            + SIG_COEFF_CTXT_CAT_1_OFFSET;
  195|  20.2k|            p_significant_coeff_flag_t[2] = p_cabac_ctxt_table_t_tmp
  196|  20.2k|                            + SIG_COEFF_CTXT_CAT_2_OFFSET;
  197|  20.2k|            p_significant_coeff_flag_t[3] = p_cabac_ctxt_table_t_tmp
  198|  20.2k|                            + SIG_COEFF_CTXT_CAT_3_OFFSET;
  199|  20.2k|            p_significant_coeff_flag_t[4] = p_cabac_ctxt_table_t_tmp
  200|  20.2k|                            + SIG_COEFF_CTXT_CAT_4_OFFSET;
  201|       |
  202|  20.2k|            p_significant_coeff_flag_t[5] = p_cabac_ctxt_table_t_tmp
  203|  20.2k|                            + SIG_COEFF_CTXT_CAT_5_OFFSET;
  204|       |
  205|  20.2k|        }
  206|  20.2k|    }
  207|       |
  208|  20.2k|    memcpy(p_cabac_ctxt_table_t,
  209|  20.2k|           gau1_ih264d_cabac_ctxt_init_table[u1_cabac_init_Idc][u1_qp_y],
  210|  20.2k|           NUM_CABAC_CTXTS * sizeof(bin_ctxt_model_t));
  ------------------
  |  |   81|  20.2k|#define NUM_CABAC_CTXTS 460
  ------------------
  211|  20.2k|}
ih264d_decode_bin:
  237|  3.33M|{
  238|       |
  239|  3.33M|    UWORD32 u4_qnt_int_range, u4_code_int_range, u4_code_int_val_ofst,
  240|  3.33M|                    u4_int_range_lps;
  241|       |
  242|  3.33M|    UWORD32 u4_symbol, u4_mps_state;
  243|       |
  244|  3.33M|    bin_ctxt_model_t *ps_bin_ctxt;
  245|       |
  246|  3.33M|    UWORD32 table_lookup;
  247|  3.33M|    const UWORD32 *pu4_table = (const UWORD32 *)ps_cab_env->cabac_table;
  248|  3.33M|    UWORD32 u4_clz;
  249|       |
  250|  3.33M|    ps_bin_ctxt = ps_src_bin_ctxt + u4_ctx_inc;
  251|       |
  252|  3.33M|    u4_code_int_range = ps_cab_env->u4_code_int_range;
  253|  3.33M|    u4_code_int_val_ofst = ps_cab_env->u4_code_int_val_ofst;
  254|       |
  255|  3.33M|    u4_mps_state = (ps_bin_ctxt->u1_mps_state);
  256|  3.33M|    u4_clz = CLZ(u4_code_int_range);
  257|       |
  258|  3.33M|    u4_qnt_int_range = u4_code_int_range << u4_clz;
  259|  3.33M|    u4_qnt_int_range = (u4_qnt_int_range >> 29) & 0x3;
  260|       |
  261|  3.33M|    table_lookup = pu4_table[(u4_mps_state << 2) + u4_qnt_int_range];
  262|  3.33M|    u4_int_range_lps = table_lookup & 0xff;
  263|       |
  264|  3.33M|    u4_int_range_lps = u4_int_range_lps << (23 - u4_clz);
  265|  3.33M|    u4_code_int_range = u4_code_int_range - u4_int_range_lps;
  266|       |
  267|  3.33M|    u4_symbol = ((u4_mps_state >> 6) & 0x1);
  268|       |
  269|  3.33M|    u4_mps_state = (table_lookup >> 8) & 0x7F;
  270|       |
  271|  3.33M|    CHECK_IF_LPS(u4_code_int_range, u4_code_int_val_ofst, u4_symbol,
  ------------------
  |  |  184|  3.33M|                    u4_codeIntRangeLPS_m,u1_mps_state_m,table_lookup_m)                     \
  |  |  185|  3.33M|{                                                                                         \
  |  |  186|  3.33M|  if(u4_codeIntValOffset_m >= u4_codeIntRange_m)                                            \
  |  |  ------------------
  |  |  |  Branch (186:6): [True: 247k, False: 3.09M]
  |  |  ------------------
  |  |  187|  3.33M|  {                                                                                         \
  |  |  188|   247k|      u4_symbol_m = 1 - u4_symbol_m;                                                        \
  |  |  189|   247k|      u4_codeIntValOffset_m -= u4_codeIntRange_m;                                           \
  |  |  190|   247k|      u4_codeIntRange_m = u4_codeIntRangeLPS_m;                                             \
  |  |  191|   247k|      u1_mps_state_m = (table_lookup_m >> 15) & 0x7F;                                       \
  |  |  192|   247k|  }                                                                                         \
  |  |  193|  3.33M|}
  ------------------
  272|  3.33M|                 u4_int_range_lps, u4_mps_state, table_lookup)
  273|       |
  274|  3.33M|    if(u4_code_int_range < ONE_RIGHT_SHIFTED_BY_8)
  ------------------
  |  |  113|  3.33M|#define ONE_RIGHT_SHIFTED_BY_8 1<<8
  ------------------
  |  Branch (274:8): [True: 10.3k, False: 3.32M]
  ------------------
  275|  10.3k|    {
  276|  10.3k|        UWORD32 *pu4_buffer, u4_offset;
  277|       |
  278|  10.3k|        pu4_buffer = ps_bitstrm->pu4_buffer;
  279|  10.3k|        u4_offset = ps_bitstrm->u4_ofst;
  280|       |
  281|  10.3k|        RENORM_RANGE_OFFSET(u4_code_int_range, u4_code_int_val_ofst, u4_offset,
  ------------------
  |  |  170|  10.3k|  {                                                                                         \
  |  |  171|  10.3k|    UWORD32 read_bits_m,u4_clz_m  ;                                                         \
  |  |  172|  10.3k|    u4_clz_m = CLZ(u4_codeIntRange_m);                                                  \
  |  |  173|  10.3k|    NEXTBITS(read_bits_m,(u4_offset_m+23),pu4_buffer_m,u4_clz_m)                            \
  |  |  ------------------
  |  |  |  |  137|  10.3k|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  |  |  138|  10.3k|{                                                                           \
  |  |  |  |  139|  10.3k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  140|  10.3k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  141|  10.3k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  142|  10.3k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  143|  10.3k|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (143:8): [True: 9.66k, False: 732]
  |  |  |  |  ------------------
  |  |  |  |  144|  10.3k|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  9.66k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  145|  10.3k|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  10.3k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  146|  10.3k|}
  |  |  ------------------
  |  |  174|  10.3k|    FLUSHBITS(u4_offset_m,(u4_clz_m))                                                       \
  |  |  ------------------
  |  |  |  |  193|  10.3k|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  |  |  194|  10.3k|{                                                                           \
  |  |  |  |  195|  10.3k|        (u4_offset) += (u4_no_bits);                                        \
  |  |  |  |  196|  10.3k|}
  |  |  ------------------
  |  |  175|  10.3k|    u4_codeIntRange_m = u4_codeIntRange_m << u4_clz_m;                                      \
  |  |  176|  10.3k|    u4_codeIntValOffset_m = (u4_codeIntValOffset_m << u4_clz_m) | read_bits_m;              \
  |  |  177|  10.3k|  }
  ------------------
  282|  10.3k|                            pu4_buffer)
  283|       |
  284|  10.3k|        ps_bitstrm->u4_ofst = u4_offset;
  285|  10.3k|    }
  286|       |
  287|  3.33M|    INC_BIN_COUNT(ps_cab_env)
  288|       |
  289|  3.33M|    ps_cab_env->u4_code_int_val_ofst = u4_code_int_val_ofst;
  290|  3.33M|    ps_cab_env->u4_code_int_range = u4_code_int_range;
  291|  3.33M|    ps_bin_ctxt->u1_mps_state = u4_mps_state;
  292|       |
  293|  3.33M|    return (u4_symbol);
  294|  3.33M|}
ih264d_decode_terminate:
  315|  1.75M|{
  316|  1.75M|    UWORD32 u4_symbol;
  317|  1.75M|    UWORD32 u4_code_int_val_ofst, u4_code_int_range;
  318|  1.75M|    UWORD32 u4_clz;
  319|       |
  320|  1.75M|    u4_code_int_range = ps_cab_env->u4_code_int_range;
  321|  1.75M|    u4_code_int_val_ofst = ps_cab_env->u4_code_int_val_ofst;
  322|       |
  323|  1.75M|    u4_clz = CLZ(u4_code_int_range);
  324|  1.75M|    u4_code_int_range -= (2 << (23 - u4_clz));
  325|       |
  326|  1.75M|    if(u4_code_int_val_ofst >= u4_code_int_range)
  ------------------
  |  Branch (326:8): [True: 6.34k, False: 1.74M]
  ------------------
  327|  6.34k|    {
  328|       |        /* S=1 */
  329|  6.34k|        u4_symbol = 1;
  330|       |
  331|  6.34k|        {
  332|       |
  333|       |            /*the u4_ofst needs to be updated before termination*/
  334|  6.34k|            ps_stream->u4_ofst += u4_clz;
  335|       |
  336|  6.34k|        }
  337|       |
  338|  6.34k|    }
  339|  1.74M|    else
  340|  1.74M|    {
  341|       |        /* S=0 */
  342|  1.74M|        u4_symbol = 0;
  343|       |
  344|  1.74M|        if(u4_code_int_range < ONE_RIGHT_SHIFTED_BY_8)
  ------------------
  |  |  113|  1.74M|#define ONE_RIGHT_SHIFTED_BY_8 1<<8
  ------------------
  |  Branch (344:12): [True: 934, False: 1.74M]
  ------------------
  345|    934|        {
  346|    934|            UWORD32 *pu4_buffer, u4_offset;
  347|       |
  348|    934|            pu4_buffer = ps_stream->pu4_buffer;
  349|    934|            u4_offset = ps_stream->u4_ofst;
  350|       |
  351|    934|            RENORM_RANGE_OFFSET(u4_code_int_range, u4_code_int_val_ofst, u4_offset,
  ------------------
  |  |  170|    934|  {                                                                                         \
  |  |  171|    934|    UWORD32 read_bits_m,u4_clz_m  ;                                                         \
  |  |  172|    934|    u4_clz_m = CLZ(u4_codeIntRange_m);                                                  \
  |  |  173|    934|    NEXTBITS(read_bits_m,(u4_offset_m+23),pu4_buffer_m,u4_clz_m)                            \
  |  |  ------------------
  |  |  |  |  137|    934|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  |  |  138|    934|{                                                                           \
  |  |  |  |  139|    934|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  140|    934|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  141|    934|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  142|    934|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  143|    934|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (143:8): [True: 666, False: 268]
  |  |  |  |  ------------------
  |  |  |  |  144|    934|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|    666|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  145|    934|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|    934|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  146|    934|}
  |  |  ------------------
  |  |  174|    934|    FLUSHBITS(u4_offset_m,(u4_clz_m))                                                       \
  |  |  ------------------
  |  |  |  |  193|    934|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  |  |  194|    934|{                                                                           \
  |  |  |  |  195|    934|        (u4_offset) += (u4_no_bits);                                        \
  |  |  |  |  196|    934|}
  |  |  ------------------
  |  |  175|    934|    u4_codeIntRange_m = u4_codeIntRange_m << u4_clz_m;                                      \
  |  |  176|    934|    u4_codeIntValOffset_m = (u4_codeIntValOffset_m << u4_clz_m) | read_bits_m;              \
  |  |  177|    934|  }
  ------------------
  352|    934|                                pu4_buffer)
  353|    934|            ps_stream->u4_ofst = u4_offset;
  354|    934|        }
  355|  1.74M|    }
  356|       |
  357|  1.75M|    ps_cab_env->u4_code_int_range = u4_code_int_range;
  358|  1.75M|    ps_cab_env->u4_code_int_val_ofst = u4_code_int_val_ofst;
  359|       |
  360|  1.75M|    INC_BIN_COUNT(ps_cab_env)
  361|       |
  362|  1.75M|    return (u4_symbol);
  363|  1.75M|}
ih264d_decode_bins_tunary:
  394|  90.6k|{
  395|  90.6k|    UWORD32 u4_value;
  396|  90.6k|    UWORD32 u4_symbol;
  397|  90.6k|    UWORD8 u4_ctx_Inc;
  398|  90.6k|    bin_ctxt_model_t *ps_bin_ctxt;
  399|  90.6k|    UWORD32 u4_code_int_range, u4_code_int_val_ofst;
  400|  90.6k|    const UWORD32 *pu4_table = (const UWORD32 *)ps_cab_env->cabac_table;
  401|       |
  402|  90.6k|    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|  90.6k|    u4_code_int_range = ps_cab_env->u4_code_int_range;
  409|  90.6k|    u4_code_int_val_ofst = ps_cab_env->u4_code_int_val_ofst;
  410|       |
  411|  90.6k|    do
  412|   153k|    {
  413|   153k|        u4_ctx_Inc = u4_ctx_inc & 0xF;
  414|   153k|        u4_ctx_inc = u4_ctx_inc >> 4;
  415|       |
  416|   153k|        ps_bin_ctxt = ps_src_bin_ctxt + u4_ctx_Inc;
  417|       |
  418|   153k|        DECODE_ONE_BIN_MACRO(ps_bin_ctxt, u4_code_int_range, u4_code_int_val_ofst,
  ------------------
  |  |  217|   153k|                     p_DecBitStream_arg,u4_symbol)                                           \
  |  |  218|   153k|{                                                                                       \
  |  |  219|   153k|    bin_ctxt_model_t *p_binCtxt_m = (bin_ctxt_model_t *) p_binCtxt_arg;                           \
  |  |  220|   153k|    dec_bit_stream_t *p_DecBitStream_m = (dec_bit_stream_t *) p_DecBitStream_arg;                 \
  |  |  221|   153k|    const UWORD32 *pu4_table_m = (const UWORD32 *) pu4_table_arg;                         \
  |  |  222|   153k|                                                                                        \
  |  |  223|   153k|    UWORD32 u4_quantCodeIntRange_m,u4_codeIntRangeLPS_m;                                    \
  |  |  224|   153k|    UWORD32 u1_mps_state_m;                                                               \
  |  |  225|   153k|    UWORD32 table_lookup_m;                                                               \
  |  |  226|   153k|    UWORD32 u4_clz_m;                                                                     \
  |  |  227|   153k|                                                                                        \
  |  |  228|   153k|    u1_mps_state_m = (p_binCtxt_m->u1_mps_state);                                           \
  |  |  229|   153k|    u4_clz_m = CLZ(u4_code_int_range);                                                  \
  |  |  230|   153k|    u4_quantCodeIntRange_m = u4_code_int_range << u4_clz_m;                                   \
  |  |  231|   153k|    u4_quantCodeIntRange_m = (u4_quantCodeIntRange_m >> 29) & 0x3;                          \
  |  |  232|   153k|    table_lookup_m = pu4_table_m[(u1_mps_state_m << 2)+u4_quantCodeIntRange_m];                 \
  |  |  233|   153k|    u4_codeIntRangeLPS_m = table_lookup_m & 0xff;                                           \
  |  |  234|   153k|                                                                                        \
  |  |  235|   153k|    u4_codeIntRangeLPS_m = u4_codeIntRangeLPS_m << (23 - u4_clz_m);                           \
  |  |  236|   153k|    u4_code_int_range = u4_code_int_range - u4_codeIntRangeLPS_m;                             \
  |  |  237|   153k|    u4_symbol = ((u1_mps_state_m>> 6) & 0x1);                                             \
  |  |  238|   153k|    /*if mps*/                                                                          \
  |  |  239|   153k|    u1_mps_state_m = (table_lookup_m >> 8) & 0x7F;                                          \
  |  |  240|   153k|    if(u4_code_int_val_ofst >= u4_code_int_range)                                          \
  |  |  ------------------
  |  |  |  Branch (240:8): [True: 18.0k, False: 134k]
  |  |  ------------------
  |  |  241|   153k|  {                                                                                     \
  |  |  242|  18.0k|                                                                                        \
  |  |  243|  18.0k|    u4_symbol = 1 - u4_symbol;                                                          \
  |  |  244|  18.0k|    u4_code_int_val_ofst -= u4_code_int_range;                                             \
  |  |  245|  18.0k|    u4_code_int_range = u4_codeIntRangeLPS_m;                                               \
  |  |  246|  18.0k|    u1_mps_state_m = (table_lookup_m >> 15) & 0x7F;                                         \
  |  |  247|  18.0k|  }                                                                                     \
  |  |  248|   153k|    if(u4_code_int_range < ONE_RIGHT_SHIFTED_BY_8)                                        \
  |  |  ------------------
  |  |  |  |  113|   306k|#define ONE_RIGHT_SHIFTED_BY_8 1<<8
  |  |  ------------------
  |  |  |  Branch (248:8): [True: 2.22k, False: 150k]
  |  |  ------------------
  |  |  249|   153k|    {                                                                                   \
  |  |  250|  2.22k|        UWORD32 *pu4_buffer,u4_offset;                                                  \
  |  |  251|  2.22k|        UWORD32 read_bits,u4_clz_m  ;                                                     \
  |  |  252|  2.22k|                                                                                        \
  |  |  253|  2.22k|        pu4_buffer = p_DecBitStream_m->pu4_buffer;                                         \
  |  |  254|  2.22k|        u4_offset = p_DecBitStream_m->u4_ofst;                                          \
  |  |  255|  2.22k|        u4_clz_m = CLZ(u4_code_int_range);                                              \
  |  |  256|  2.22k|        NEXTBITS(read_bits,(u4_offset+23),pu4_buffer,u4_clz_m)                            \
  |  |  ------------------
  |  |  |  |  137|  2.22k|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  |  |  138|  2.22k|{                                                                           \
  |  |  |  |  139|  2.22k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  140|  2.22k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  141|  2.22k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  142|  2.22k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  143|  2.22k|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (143:8): [True: 1.86k, False: 355]
  |  |  |  |  ------------------
  |  |  |  |  144|  2.22k|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  1.86k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  145|  2.22k|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  2.22k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  146|  2.22k|}
  |  |  ------------------
  |  |  257|  2.22k|        FLUSHBITS(u4_offset,(u4_clz_m))                                                   \
  |  |  ------------------
  |  |  |  |  193|  2.22k|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  |  |  194|  2.22k|{                                                                           \
  |  |  |  |  195|  2.22k|        (u4_offset) += (u4_no_bits);                                        \
  |  |  |  |  196|  2.22k|}
  |  |  ------------------
  |  |  258|  2.22k|        u4_code_int_range = u4_code_int_range << u4_clz_m;                                    \
  |  |  259|  2.22k|        u4_code_int_val_ofst= (u4_code_int_val_ofst << u4_clz_m) | read_bits;               \
  |  |  260|  2.22k|                                                                                        \
  |  |  261|  2.22k|                                                                                        \
  |  |  262|  2.22k|        p_DecBitStream_m->u4_ofst = u4_offset;                                          \
  |  |  263|  2.22k|    }                                                                                   \
  |  |  264|   153k|    p_binCtxt_m->u1_mps_state = u1_mps_state_m;                                             \
  |  |  265|   153k|}
  ------------------
  419|   153k|                             pu4_table, ps_bitstrm, u4_symbol)
  420|       |
  421|   153k|        INC_BIN_COUNT(ps_cab_env);INC_DECISION_BINS(ps_cab_env);
  422|       |
  423|   153k|        u4_value++;
  424|   153k|    }
  425|   153k|    while((u4_value < u1_max_bins) & (u4_symbol));
  ------------------
  |  Branch (425:11): [True: 62.4k, False: 90.6k]
  ------------------
  426|       |
  427|  90.6k|    u4_value = u4_value - 1 + u4_symbol;
  428|       |
  429|  90.6k|    ps_cab_env->u4_code_int_range = u4_code_int_range;
  430|  90.6k|    ps_cab_env->u4_code_int_val_ofst = u4_code_int_val_ofst;
  431|       |
  432|  90.6k|    return (u4_value);
  433|       |
  434|  90.6k|}
ih264d_decode_bins:
  465|   172k|{
  466|   172k|    UWORD32 u4_value;
  467|   172k|    UWORD32 u4_symbol, i;
  468|   172k|    UWORD32 u4_ctxt_inc;
  469|   172k|    bin_ctxt_model_t *ps_bin_ctxt;
  470|   172k|    UWORD32 u4_code_int_range, u4_code_int_val_ofst;
  471|   172k|    const UWORD32 *pu4_table = (const UWORD32 *)ps_cab_env->cabac_table;
  472|       |
  473|   172k|    i = 0;
  474|       |
  475|   172k|    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|   172k|    u4_code_int_range = ps_cab_env->u4_code_int_range;
  479|   172k|    u4_code_int_val_ofst = ps_cab_env->u4_code_int_val_ofst;
  480|       |
  481|   172k|    do
  482|   400k|    {
  483|   400k|        u4_ctxt_inc = u4_ctx_inc & 0xf;
  484|   400k|        u4_ctx_inc = u4_ctx_inc >> 4;
  485|       |
  486|   400k|        ps_bin_ctxt = ps_src_bin_ctxt + u4_ctxt_inc;
  487|       |
  488|   400k|        DECODE_ONE_BIN_MACRO(ps_bin_ctxt, u4_code_int_range, u4_code_int_val_ofst,
  ------------------
  |  |  217|   400k|                     p_DecBitStream_arg,u4_symbol)                                           \
  |  |  218|   400k|{                                                                                       \
  |  |  219|   400k|    bin_ctxt_model_t *p_binCtxt_m = (bin_ctxt_model_t *) p_binCtxt_arg;                           \
  |  |  220|   400k|    dec_bit_stream_t *p_DecBitStream_m = (dec_bit_stream_t *) p_DecBitStream_arg;                 \
  |  |  221|   400k|    const UWORD32 *pu4_table_m = (const UWORD32 *) pu4_table_arg;                         \
  |  |  222|   400k|                                                                                        \
  |  |  223|   400k|    UWORD32 u4_quantCodeIntRange_m,u4_codeIntRangeLPS_m;                                    \
  |  |  224|   400k|    UWORD32 u1_mps_state_m;                                                               \
  |  |  225|   400k|    UWORD32 table_lookup_m;                                                               \
  |  |  226|   400k|    UWORD32 u4_clz_m;                                                                     \
  |  |  227|   400k|                                                                                        \
  |  |  228|   400k|    u1_mps_state_m = (p_binCtxt_m->u1_mps_state);                                           \
  |  |  229|   400k|    u4_clz_m = CLZ(u4_code_int_range);                                                  \
  |  |  230|   400k|    u4_quantCodeIntRange_m = u4_code_int_range << u4_clz_m;                                   \
  |  |  231|   400k|    u4_quantCodeIntRange_m = (u4_quantCodeIntRange_m >> 29) & 0x3;                          \
  |  |  232|   400k|    table_lookup_m = pu4_table_m[(u1_mps_state_m << 2)+u4_quantCodeIntRange_m];                 \
  |  |  233|   400k|    u4_codeIntRangeLPS_m = table_lookup_m & 0xff;                                           \
  |  |  234|   400k|                                                                                        \
  |  |  235|   400k|    u4_codeIntRangeLPS_m = u4_codeIntRangeLPS_m << (23 - u4_clz_m);                           \
  |  |  236|   400k|    u4_code_int_range = u4_code_int_range - u4_codeIntRangeLPS_m;                             \
  |  |  237|   400k|    u4_symbol = ((u1_mps_state_m>> 6) & 0x1);                                             \
  |  |  238|   400k|    /*if mps*/                                                                          \
  |  |  239|   400k|    u1_mps_state_m = (table_lookup_m >> 8) & 0x7F;                                          \
  |  |  240|   400k|    if(u4_code_int_val_ofst >= u4_code_int_range)                                          \
  |  |  ------------------
  |  |  |  Branch (240:8): [True: 68.6k, False: 331k]
  |  |  ------------------
  |  |  241|   400k|  {                                                                                     \
  |  |  242|  68.6k|                                                                                        \
  |  |  243|  68.6k|    u4_symbol = 1 - u4_symbol;                                                          \
  |  |  244|  68.6k|    u4_code_int_val_ofst -= u4_code_int_range;                                             \
  |  |  245|  68.6k|    u4_code_int_range = u4_codeIntRangeLPS_m;                                               \
  |  |  246|  68.6k|    u1_mps_state_m = (table_lookup_m >> 15) & 0x7F;                                         \
  |  |  247|  68.6k|  }                                                                                     \
  |  |  248|   400k|    if(u4_code_int_range < ONE_RIGHT_SHIFTED_BY_8)                                        \
  |  |  ------------------
  |  |  |  |  113|   800k|#define ONE_RIGHT_SHIFTED_BY_8 1<<8
  |  |  ------------------
  |  |  |  Branch (248:8): [True: 3.21k, False: 397k]
  |  |  ------------------
  |  |  249|   400k|    {                                                                                   \
  |  |  250|  3.21k|        UWORD32 *pu4_buffer,u4_offset;                                                  \
  |  |  251|  3.21k|        UWORD32 read_bits,u4_clz_m  ;                                                     \
  |  |  252|  3.21k|                                                                                        \
  |  |  253|  3.21k|        pu4_buffer = p_DecBitStream_m->pu4_buffer;                                         \
  |  |  254|  3.21k|        u4_offset = p_DecBitStream_m->u4_ofst;                                          \
  |  |  255|  3.21k|        u4_clz_m = CLZ(u4_code_int_range);                                              \
  |  |  256|  3.21k|        NEXTBITS(read_bits,(u4_offset+23),pu4_buffer,u4_clz_m)                            \
  |  |  ------------------
  |  |  |  |  137|  3.21k|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  |  |  138|  3.21k|{                                                                           \
  |  |  |  |  139|  3.21k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  140|  3.21k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  141|  3.21k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  142|  3.21k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  143|  3.21k|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (143:8): [True: 3.05k, False: 153]
  |  |  |  |  ------------------
  |  |  |  |  144|  3.21k|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  3.05k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  145|  3.21k|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  3.21k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  146|  3.21k|}
  |  |  ------------------
  |  |  257|  3.21k|        FLUSHBITS(u4_offset,(u4_clz_m))                                                   \
  |  |  ------------------
  |  |  |  |  193|  3.21k|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  |  |  194|  3.21k|{                                                                           \
  |  |  |  |  195|  3.21k|        (u4_offset) += (u4_no_bits);                                        \
  |  |  |  |  196|  3.21k|}
  |  |  ------------------
  |  |  258|  3.21k|        u4_code_int_range = u4_code_int_range << u4_clz_m;                                    \
  |  |  259|  3.21k|        u4_code_int_val_ofst= (u4_code_int_val_ofst << u4_clz_m) | read_bits;               \
  |  |  260|  3.21k|                                                                                        \
  |  |  261|  3.21k|                                                                                        \
  |  |  262|  3.21k|        p_DecBitStream_m->u4_ofst = u4_offset;                                          \
  |  |  263|  3.21k|    }                                                                                   \
  |  |  264|   400k|    p_binCtxt_m->u1_mps_state = u1_mps_state_m;                                             \
  |  |  265|   400k|}
  ------------------
  489|   400k|                             pu4_table, ps_bitstrm, u4_symbol)
  490|       |
  491|   400k|        INC_BIN_COUNT(ps_cab_env);INC_DECISION_BINS(ps_cab_env);
  492|       |
  493|   400k|        u4_value = (u4_value << 1) | (u4_symbol);
  494|       |
  495|   400k|        i++;
  496|   400k|    }
  497|   400k|    while(i < u1_max_bins);
  ------------------
  |  Branch (497:11): [True: 227k, False: 172k]
  ------------------
  498|       |
  499|   172k|    ps_cab_env->u4_code_int_range = u4_code_int_range;
  500|   172k|    ps_cab_env->u4_code_int_val_ofst = u4_code_int_val_ofst;
  501|       |
  502|   172k|    return (u4_value);
  503|       |
  504|   172k|}
ih264d_decode_bins_unary:
  533|   455k|{
  534|   455k|    UWORD32 u4_value;
  535|   455k|    UWORD32 u4_symbol;
  536|   455k|    bin_ctxt_model_t *ps_bin_ctxt;
  537|   455k|    UWORD32 u4_ctx_Inc;
  538|   455k|    UWORD32 u4_code_int_range, u4_code_int_val_ofst;
  539|   455k|    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|   455k|    u4_value = 0;
  546|   455k|    u4_code_int_range = ps_cab_env->u4_code_int_range;
  547|   455k|    u4_code_int_val_ofst = ps_cab_env->u4_code_int_val_ofst;
  548|       |
  549|   455k|    do
  550|   630k|    {
  551|   630k|        u4_ctx_Inc = u4_ctx_inc & 0xf;
  552|   630k|        u4_ctx_inc = u4_ctx_inc >> 4;
  553|       |
  554|   630k|        ps_bin_ctxt = ps_src_bin_ctxt + u4_ctx_Inc;
  555|       |
  556|   630k|        DECODE_ONE_BIN_MACRO(ps_bin_ctxt, u4_code_int_range, u4_code_int_val_ofst,
  ------------------
  |  |  217|   630k|                     p_DecBitStream_arg,u4_symbol)                                           \
  |  |  218|   630k|{                                                                                       \
  |  |  219|   630k|    bin_ctxt_model_t *p_binCtxt_m = (bin_ctxt_model_t *) p_binCtxt_arg;                           \
  |  |  220|   630k|    dec_bit_stream_t *p_DecBitStream_m = (dec_bit_stream_t *) p_DecBitStream_arg;                 \
  |  |  221|   630k|    const UWORD32 *pu4_table_m = (const UWORD32 *) pu4_table_arg;                         \
  |  |  222|   630k|                                                                                        \
  |  |  223|   630k|    UWORD32 u4_quantCodeIntRange_m,u4_codeIntRangeLPS_m;                                    \
  |  |  224|   630k|    UWORD32 u1_mps_state_m;                                                               \
  |  |  225|   630k|    UWORD32 table_lookup_m;                                                               \
  |  |  226|   630k|    UWORD32 u4_clz_m;                                                                     \
  |  |  227|   630k|                                                                                        \
  |  |  228|   630k|    u1_mps_state_m = (p_binCtxt_m->u1_mps_state);                                           \
  |  |  229|   630k|    u4_clz_m = CLZ(u4_code_int_range);                                                  \
  |  |  230|   630k|    u4_quantCodeIntRange_m = u4_code_int_range << u4_clz_m;                                   \
  |  |  231|   630k|    u4_quantCodeIntRange_m = (u4_quantCodeIntRange_m >> 29) & 0x3;                          \
  |  |  232|   630k|    table_lookup_m = pu4_table_m[(u1_mps_state_m << 2)+u4_quantCodeIntRange_m];                 \
  |  |  233|   630k|    u4_codeIntRangeLPS_m = table_lookup_m & 0xff;                                           \
  |  |  234|   630k|                                                                                        \
  |  |  235|   630k|    u4_codeIntRangeLPS_m = u4_codeIntRangeLPS_m << (23 - u4_clz_m);                           \
  |  |  236|   630k|    u4_code_int_range = u4_code_int_range - u4_codeIntRangeLPS_m;                             \
  |  |  237|   630k|    u4_symbol = ((u1_mps_state_m>> 6) & 0x1);                                             \
  |  |  238|   630k|    /*if mps*/                                                                          \
  |  |  239|   630k|    u1_mps_state_m = (table_lookup_m >> 8) & 0x7F;                                          \
  |  |  240|   630k|    if(u4_code_int_val_ofst >= u4_code_int_range)                                          \
  |  |  ------------------
  |  |  |  Branch (240:8): [True: 93.4k, False: 537k]
  |  |  ------------------
  |  |  241|   630k|  {                                                                                     \
  |  |  242|  93.4k|                                                                                        \
  |  |  243|  93.4k|    u4_symbol = 1 - u4_symbol;                                                          \
  |  |  244|  93.4k|    u4_code_int_val_ofst -= u4_code_int_range;                                             \
  |  |  245|  93.4k|    u4_code_int_range = u4_codeIntRangeLPS_m;                                               \
  |  |  246|  93.4k|    u1_mps_state_m = (table_lookup_m >> 15) & 0x7F;                                         \
  |  |  247|  93.4k|  }                                                                                     \
  |  |  248|   630k|    if(u4_code_int_range < ONE_RIGHT_SHIFTED_BY_8)                                        \
  |  |  ------------------
  |  |  |  |  113|  1.26M|#define ONE_RIGHT_SHIFTED_BY_8 1<<8
  |  |  ------------------
  |  |  |  Branch (248:8): [True: 4.18k, False: 626k]
  |  |  ------------------
  |  |  249|   630k|    {                                                                                   \
  |  |  250|  4.18k|        UWORD32 *pu4_buffer,u4_offset;                                                  \
  |  |  251|  4.18k|        UWORD32 read_bits,u4_clz_m  ;                                                     \
  |  |  252|  4.18k|                                                                                        \
  |  |  253|  4.18k|        pu4_buffer = p_DecBitStream_m->pu4_buffer;                                         \
  |  |  254|  4.18k|        u4_offset = p_DecBitStream_m->u4_ofst;                                          \
  |  |  255|  4.18k|        u4_clz_m = CLZ(u4_code_int_range);                                              \
  |  |  256|  4.18k|        NEXTBITS(read_bits,(u4_offset+23),pu4_buffer,u4_clz_m)                            \
  |  |  ------------------
  |  |  |  |  137|  4.18k|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  |  |  138|  4.18k|{                                                                           \
  |  |  |  |  139|  4.18k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  140|  4.18k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  141|  4.18k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  142|  4.18k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  143|  4.18k|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (143:8): [True: 3.99k, False: 193]
  |  |  |  |  ------------------
  |  |  |  |  144|  4.18k|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  3.99k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  145|  4.18k|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  4.18k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  146|  4.18k|}
  |  |  ------------------
  |  |  257|  4.18k|        FLUSHBITS(u4_offset,(u4_clz_m))                                                   \
  |  |  ------------------
  |  |  |  |  193|  4.18k|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  |  |  194|  4.18k|{                                                                           \
  |  |  |  |  195|  4.18k|        (u4_offset) += (u4_no_bits);                                        \
  |  |  |  |  196|  4.18k|}
  |  |  ------------------
  |  |  258|  4.18k|        u4_code_int_range = u4_code_int_range << u4_clz_m;                                    \
  |  |  259|  4.18k|        u4_code_int_val_ofst= (u4_code_int_val_ofst << u4_clz_m) | read_bits;               \
  |  |  260|  4.18k|                                                                                        \
  |  |  261|  4.18k|                                                                                        \
  |  |  262|  4.18k|        p_DecBitStream_m->u4_ofst = u4_offset;                                          \
  |  |  263|  4.18k|    }                                                                                   \
  |  |  264|   630k|    p_binCtxt_m->u1_mps_state = u1_mps_state_m;                                             \
  |  |  265|   630k|}
  ------------------
  557|   630k|                             pu4_table, ps_bitstrm, u4_symbol)
  558|       |
  559|   630k|        INC_BIN_COUNT(ps_cab_env);INC_DECISION_BINS(ps_cab_env);
  560|       |
  561|   630k|        u4_value++;
  562|       |
  563|   630k|    }
  564|   630k|    while(u4_symbol && u4_value < 4);
  ------------------
  |  Branch (564:11): [True: 182k, False: 448k]
  |  Branch (564:24): [True: 175k, False: 6.80k]
  ------------------
  565|       |
  566|   455k|    if(u4_symbol && (u4_value < u1_max_bins))
  ------------------
  |  Branch (566:8): [True: 6.80k, False: 448k]
  |  Branch (566:21): [True: 6.80k, False: 0]
  ------------------
  567|  6.80k|    {
  568|       |
  569|  6.80k|        u4_ctx_Inc = u4_ctx_inc & 0xf;
  570|       |
  571|  6.80k|        ps_bin_ctxt = ps_src_bin_ctxt + u4_ctx_Inc;
  572|       |
  573|  6.80k|        do
  574|  51.8k|        {
  575|       |
  576|  51.8k|            DECODE_ONE_BIN_MACRO(ps_bin_ctxt, u4_code_int_range, u4_code_int_val_ofst,
  ------------------
  |  |  217|  51.8k|                     p_DecBitStream_arg,u4_symbol)                                           \
  |  |  218|  51.8k|{                                                                                       \
  |  |  219|  51.8k|    bin_ctxt_model_t *p_binCtxt_m = (bin_ctxt_model_t *) p_binCtxt_arg;                           \
  |  |  220|  51.8k|    dec_bit_stream_t *p_DecBitStream_m = (dec_bit_stream_t *) p_DecBitStream_arg;                 \
  |  |  221|  51.8k|    const UWORD32 *pu4_table_m = (const UWORD32 *) pu4_table_arg;                         \
  |  |  222|  51.8k|                                                                                        \
  |  |  223|  51.8k|    UWORD32 u4_quantCodeIntRange_m,u4_codeIntRangeLPS_m;                                    \
  |  |  224|  51.8k|    UWORD32 u1_mps_state_m;                                                               \
  |  |  225|  51.8k|    UWORD32 table_lookup_m;                                                               \
  |  |  226|  51.8k|    UWORD32 u4_clz_m;                                                                     \
  |  |  227|  51.8k|                                                                                        \
  |  |  228|  51.8k|    u1_mps_state_m = (p_binCtxt_m->u1_mps_state);                                           \
  |  |  229|  51.8k|    u4_clz_m = CLZ(u4_code_int_range);                                                  \
  |  |  230|  51.8k|    u4_quantCodeIntRange_m = u4_code_int_range << u4_clz_m;                                   \
  |  |  231|  51.8k|    u4_quantCodeIntRange_m = (u4_quantCodeIntRange_m >> 29) & 0x3;                          \
  |  |  232|  51.8k|    table_lookup_m = pu4_table_m[(u1_mps_state_m << 2)+u4_quantCodeIntRange_m];                 \
  |  |  233|  51.8k|    u4_codeIntRangeLPS_m = table_lookup_m & 0xff;                                           \
  |  |  234|  51.8k|                                                                                        \
  |  |  235|  51.8k|    u4_codeIntRangeLPS_m = u4_codeIntRangeLPS_m << (23 - u4_clz_m);                           \
  |  |  236|  51.8k|    u4_code_int_range = u4_code_int_range - u4_codeIntRangeLPS_m;                             \
  |  |  237|  51.8k|    u4_symbol = ((u1_mps_state_m>> 6) & 0x1);                                             \
  |  |  238|  51.8k|    /*if mps*/                                                                          \
  |  |  239|  51.8k|    u1_mps_state_m = (table_lookup_m >> 8) & 0x7F;                                          \
  |  |  240|  51.8k|    if(u4_code_int_val_ofst >= u4_code_int_range)                                          \
  |  |  ------------------
  |  |  |  Branch (240:8): [True: 5.62k, False: 46.1k]
  |  |  ------------------
  |  |  241|  51.8k|  {                                                                                     \
  |  |  242|  5.62k|                                                                                        \
  |  |  243|  5.62k|    u4_symbol = 1 - u4_symbol;                                                          \
  |  |  244|  5.62k|    u4_code_int_val_ofst -= u4_code_int_range;                                             \
  |  |  245|  5.62k|    u4_code_int_range = u4_codeIntRangeLPS_m;                                               \
  |  |  246|  5.62k|    u1_mps_state_m = (table_lookup_m >> 15) & 0x7F;                                         \
  |  |  247|  5.62k|  }                                                                                     \
  |  |  248|  51.8k|    if(u4_code_int_range < ONE_RIGHT_SHIFTED_BY_8)                                        \
  |  |  ------------------
  |  |  |  |  113|   103k|#define ONE_RIGHT_SHIFTED_BY_8 1<<8
  |  |  ------------------
  |  |  |  Branch (248:8): [True: 898, False: 50.9k]
  |  |  ------------------
  |  |  249|  51.8k|    {                                                                                   \
  |  |  250|    898|        UWORD32 *pu4_buffer,u4_offset;                                                  \
  |  |  251|    898|        UWORD32 read_bits,u4_clz_m  ;                                                     \
  |  |  252|    898|                                                                                        \
  |  |  253|    898|        pu4_buffer = p_DecBitStream_m->pu4_buffer;                                         \
  |  |  254|    898|        u4_offset = p_DecBitStream_m->u4_ofst;                                          \
  |  |  255|    898|        u4_clz_m = CLZ(u4_code_int_range);                                              \
  |  |  256|    898|        NEXTBITS(read_bits,(u4_offset+23),pu4_buffer,u4_clz_m)                            \
  |  |  ------------------
  |  |  |  |  137|    898|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  |  |  138|    898|{                                                                           \
  |  |  |  |  139|    898|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  140|    898|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  141|    898|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  142|    898|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  143|    898|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (143:8): [True: 577, False: 321]
  |  |  |  |  ------------------
  |  |  |  |  144|    898|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|    577|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  145|    898|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|    898|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  146|    898|}
  |  |  ------------------
  |  |  257|    898|        FLUSHBITS(u4_offset,(u4_clz_m))                                                   \
  |  |  ------------------
  |  |  |  |  193|    898|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  |  |  194|    898|{                                                                           \
  |  |  |  |  195|    898|        (u4_offset) += (u4_no_bits);                                        \
  |  |  |  |  196|    898|}
  |  |  ------------------
  |  |  258|    898|        u4_code_int_range = u4_code_int_range << u4_clz_m;                                    \
  |  |  259|    898|        u4_code_int_val_ofst= (u4_code_int_val_ofst << u4_clz_m) | read_bits;               \
  |  |  260|    898|                                                                                        \
  |  |  261|    898|                                                                                        \
  |  |  262|    898|        p_DecBitStream_m->u4_ofst = u4_offset;                                          \
  |  |  263|    898|    }                                                                                   \
  |  |  264|  51.8k|    p_binCtxt_m->u1_mps_state = u1_mps_state_m;                                             \
  |  |  265|  51.8k|}
  ------------------
  577|  51.8k|                                 pu4_table, ps_bitstrm, u4_symbol)
  578|       |
  579|  51.8k|            INC_BIN_COUNT(ps_cab_env);INC_DECISION_BINS(ps_cab_env);
  580|       |
  581|  51.8k|            u4_value++;
  582|       |
  583|  51.8k|        }
  584|  51.8k|        while(u4_symbol && (u4_value < u1_max_bins));
  ------------------
  |  Branch (584:15): [True: 46.6k, False: 5.14k]
  |  Branch (584:28): [True: 44.9k, False: 1.65k]
  ------------------
  585|       |
  586|  6.80k|    }
  587|       |
  588|   455k|    ps_cab_env->u4_code_int_range = u4_code_int_range;
  589|   455k|    ps_cab_env->u4_code_int_val_ofst = u4_code_int_val_ofst;
  590|       |
  591|   455k|    u4_value = u4_value - 1 + u4_symbol;
  592|       |
  593|   455k|    return (u4_value);
  594|       |
  595|   455k|}
ih264d_decode_bypass_bins_unary:
  622|   183k|{
  623|   183k|    UWORD32 u4_value;
  624|   183k|    UWORD32 u4_bin;
  625|   183k|    UWORD32 u4_code_int_val_ofst, u4_code_int_range;
  626|       |
  627|   183k|    UWORD32 u1_max_bins;
  628|       |
  629|   183k|    u4_code_int_val_ofst = ps_cab_env->u4_code_int_val_ofst;
  630|   183k|    u4_code_int_range = ps_cab_env->u4_code_int_range;
  631|       |
  632|   183k|    if(u4_code_int_range < ONE_RIGHT_SHIFTED_BY_9)
  ------------------
  |  |  114|   183k|#define ONE_RIGHT_SHIFTED_BY_9    1<<9
  ------------------
  |  Branch (632:8): [True: 2.93k, False: 180k]
  ------------------
  633|  2.93k|    {
  634|  2.93k|        UWORD32 *pu4_buffer, u4_offset;
  635|       |
  636|  2.93k|        pu4_buffer = ps_bitstrm->pu4_buffer;
  637|  2.93k|        u4_offset = ps_bitstrm->u4_ofst;
  638|       |
  639|  2.93k|        RENORM_RANGE_OFFSET(u4_code_int_range, u4_code_int_val_ofst, u4_offset,
  ------------------
  |  |  170|  2.93k|  {                                                                                         \
  |  |  171|  2.93k|    UWORD32 read_bits_m,u4_clz_m  ;                                                         \
  |  |  172|  2.93k|    u4_clz_m = CLZ(u4_codeIntRange_m);                                                  \
  |  |  173|  2.93k|    NEXTBITS(read_bits_m,(u4_offset_m+23),pu4_buffer_m,u4_clz_m)                            \
  |  |  ------------------
  |  |  |  |  137|  2.93k|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  |  |  138|  2.93k|{                                                                           \
  |  |  |  |  139|  2.93k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  140|  2.93k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  141|  2.93k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  142|  2.93k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  143|  2.93k|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (143:8): [True: 2.79k, False: 140]
  |  |  |  |  ------------------
  |  |  |  |  144|  2.93k|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  2.79k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  145|  2.93k|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  2.93k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  146|  2.93k|}
  |  |  ------------------
  |  |  174|  2.93k|    FLUSHBITS(u4_offset_m,(u4_clz_m))                                                       \
  |  |  ------------------
  |  |  |  |  193|  2.93k|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  |  |  194|  2.93k|{                                                                           \
  |  |  |  |  195|  2.93k|        (u4_offset) += (u4_no_bits);                                        \
  |  |  |  |  196|  2.93k|}
  |  |  ------------------
  |  |  175|  2.93k|    u4_codeIntRange_m = u4_codeIntRange_m << u4_clz_m;                                      \
  |  |  176|  2.93k|    u4_codeIntValOffset_m = (u4_codeIntValOffset_m << u4_clz_m) | read_bits_m;              \
  |  |  177|  2.93k|  }
  ------------------
  640|  2.93k|                            pu4_buffer)
  641|  2.93k|        ps_bitstrm->u4_ofst = u4_offset;
  642|  2.93k|    }
  643|       |
  644|       |    /*as it is called only form mvd*/
  645|   183k|    u1_max_bins = 32;
  646|   183k|    u4_value = 0;
  647|       |
  648|   183k|    do
  649|   232k|    {
  650|   232k|        u4_value++;
  651|       |
  652|   232k|        u4_code_int_range = u4_code_int_range >> 1;
  653|   232k|        if(u4_code_int_val_ofst >= u4_code_int_range)
  ------------------
  |  Branch (653:12): [True: 48.6k, False: 183k]
  ------------------
  654|  48.6k|        {
  655|       |            /* S=1 */
  656|  48.6k|            u4_bin = 1;
  657|  48.6k|            u4_code_int_val_ofst -= u4_code_int_range;
  658|  48.6k|        }
  659|   183k|        else
  660|   183k|        {
  661|       |            /* S=0 */
  662|   183k|            u4_bin = 0;
  663|   183k|        }
  664|       |
  665|   232k|        INC_BIN_COUNT(ps_cab_env);INC_BYPASS_BINS(ps_cab_env);
  666|       |
  667|   232k|        if(u4_code_int_range < ONE_RIGHT_SHIFTED_BY_9)
  ------------------
  |  |  114|   232k|#define ONE_RIGHT_SHIFTED_BY_9    1<<9
  ------------------
  |  Branch (667:12): [True: 15.3k, False: 217k]
  ------------------
  668|  15.3k|        {
  669|  15.3k|            UWORD32 *pu4_buffer, u4_offset;
  670|       |
  671|  15.3k|            pu4_buffer = ps_bitstrm->pu4_buffer;
  672|  15.3k|            u4_offset = ps_bitstrm->u4_ofst;
  673|       |
  674|  15.3k|            RENORM_RANGE_OFFSET(u4_code_int_range, u4_code_int_val_ofst, u4_offset,
  ------------------
  |  |  170|  15.3k|  {                                                                                         \
  |  |  171|  15.3k|    UWORD32 read_bits_m,u4_clz_m  ;                                                         \
  |  |  172|  15.3k|    u4_clz_m = CLZ(u4_codeIntRange_m);                                                  \
  |  |  173|  15.3k|    NEXTBITS(read_bits_m,(u4_offset_m+23),pu4_buffer_m,u4_clz_m)                            \
  |  |  ------------------
  |  |  |  |  137|  15.3k|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  |  |  138|  15.3k|{                                                                           \
  |  |  |  |  139|  15.3k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  140|  15.3k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  141|  15.3k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  142|  15.3k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  143|  15.3k|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (143:8): [True: 14.4k, False: 877]
  |  |  |  |  ------------------
  |  |  |  |  144|  15.3k|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  14.4k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  145|  15.3k|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  15.3k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  146|  15.3k|}
  |  |  ------------------
  |  |  174|  15.3k|    FLUSHBITS(u4_offset_m,(u4_clz_m))                                                       \
  |  |  ------------------
  |  |  |  |  193|  15.3k|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  |  |  194|  15.3k|{                                                                           \
  |  |  |  |  195|  15.3k|        (u4_offset) += (u4_no_bits);                                        \
  |  |  |  |  196|  15.3k|}
  |  |  ------------------
  |  |  175|  15.3k|    u4_codeIntRange_m = u4_codeIntRange_m << u4_clz_m;                                      \
  |  |  176|  15.3k|    u4_codeIntValOffset_m = (u4_codeIntValOffset_m << u4_clz_m) | read_bits_m;              \
  |  |  177|  15.3k|  }
  ------------------
  675|  15.3k|                                pu4_buffer)
  676|       |
  677|  15.3k|            ps_bitstrm->u4_ofst = u4_offset;
  678|  15.3k|        }
  679|       |
  680|   232k|    }
  681|   232k|    while(u4_bin && (u4_value < u1_max_bins));
  ------------------
  |  Branch (681:11): [True: 48.6k, False: 183k]
  |  Branch (681:21): [True: 48.5k, False: 28]
  ------------------
  682|       |
  683|   183k|    ps_cab_env->u4_code_int_val_ofst = u4_code_int_val_ofst;
  684|   183k|    ps_cab_env->u4_code_int_range = u4_code_int_range;
  685|   183k|    u4_value = (u4_value - 1 + u4_bin);
  686|       |
  687|   183k|return (u4_value);
  688|   183k|}
ih264d_decode_bypass_bins:
  716|   183k|{
  717|   183k|    UWORD32 u4_bins;
  718|   183k|    UWORD32 u4_bin;
  719|   183k|    UWORD32 u4_code_int_val_ofst, u4_code_int_range;
  720|       |
  721|   183k|    u4_bins = 0;
  722|   183k|    u4_code_int_val_ofst = ps_cab_env->u4_code_int_val_ofst;
  723|   183k|    u4_code_int_range = ps_cab_env->u4_code_int_range;
  724|       |
  725|   183k|    if(u4_code_int_range < ONE_RIGHT_SHIFTED_BY_9)
  ------------------
  |  |  114|   183k|#define ONE_RIGHT_SHIFTED_BY_9    1<<9
  ------------------
  |  Branch (725:8): [True: 0, False: 183k]
  ------------------
  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|   183k|    do
  738|   600k|    {
  739|       |
  740|   600k|        u4_code_int_range = u4_code_int_range >> 1;
  741|       |
  742|   600k|        if(u4_code_int_val_ofst >= u4_code_int_range)
  ------------------
  |  Branch (742:12): [True: 99.4k, False: 500k]
  ------------------
  743|  99.4k|        {
  744|       |            /* S=1 */
  745|  99.4k|            u4_bin = 1;
  746|  99.4k|            u4_code_int_val_ofst -= u4_code_int_range;
  747|  99.4k|        }
  748|   500k|        else
  749|   500k|        {
  750|       |            /* S=0 */
  751|   500k|            u4_bin = 0;
  752|   500k|        }
  753|       |
  754|   600k|        INC_BIN_COUNT(ps_cab_env);INC_BYPASS_BINS(ps_cab_env);
  755|       |
  756|   600k|        u4_bins = ((u4_bins << 1) | u4_bin);
  757|   600k|        u1_max_bins--;
  758|       |
  759|   600k|        if(u4_code_int_range < ONE_RIGHT_SHIFTED_BY_9)
  ------------------
  |  |  114|   600k|#define ONE_RIGHT_SHIFTED_BY_9    1<<9
  ------------------
  |  Branch (759:12): [True: 17.9k, False: 582k]
  ------------------
  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.2k, False: 798]
  |  |  |  |  ------------------
  |  |  |  |  144|  17.9k|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  17.2k|#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|   600k|    }
  772|   600k|    while(u1_max_bins);
  ------------------
  |  Branch (772:11): [True: 416k, False: 183k]
  ------------------
  773|       |
  774|   183k|    ps_cab_env->u4_code_int_val_ofst = u4_code_int_val_ofst;
  775|   183k|    ps_cab_env->u4_code_int_range = u4_code_int_range;
  776|       |
  777|   183k|    return (u4_bins);
  778|   183k|}

ih264d_update_csbp_8x8:
   32|   419k|{
   33|   419k|    UWORD16 u2_mod_csbp;
   34|       |
   35|   419k|    u2_mod_csbp = u2_luma_csbp;
   36|       |
   37|   419k|    if(u2_mod_csbp & 0x0033)
  ------------------
  |  Branch (37:8): [True: 53.4k, False: 366k]
  ------------------
   38|  53.4k|    {
   39|  53.4k|        u2_mod_csbp |= 0x0033;
   40|  53.4k|    }
   41|       |
   42|   419k|    if(u2_mod_csbp & 0x00CC)
  ------------------
  |  Branch (42:8): [True: 50.4k, False: 369k]
  ------------------
   43|  50.4k|    {
   44|  50.4k|        u2_mod_csbp |= 0x00CC;
   45|  50.4k|    }
   46|       |
   47|   419k|    if(u2_mod_csbp & 0x3300)
  ------------------
  |  Branch (47:8): [True: 51.8k, False: 367k]
  ------------------
   48|  51.8k|    {
   49|  51.8k|        u2_mod_csbp |= 0x3300;
   50|  51.8k|    }
   51|       |
   52|   419k|    if(u2_mod_csbp & 0xCC00)
  ------------------
  |  Branch (52:8): [True: 50.6k, False: 369k]
  ------------------
   53|  50.6k|    {
   54|  50.6k|        u2_mod_csbp |= 0xCC00;
   55|  50.6k|    }
   56|       |
   57|   419k|    return u2_mod_csbp;
   58|   419k|}
ih264d_fill_bs2_horz_vert:
  115|  6.11M|{
  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.11M|    UWORD32 u4_nbr_horz_csbp = (u4_cur_mb_csbp << 4) | (u4_top_mb_csbp >> 12);
  120|  6.11M|    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.11M|    UWORD32 u4_left_mb_masked_csbp = u4_left_mb_csbp & CSBP_RIGHT_BLOCK_MASK;
  ------------------
  |  |  108|  6.11M|#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.11M|    UWORD32 u4_cur_mb_masked_csbp = (u4_cur_mb_csbp << 1)
  131|  6.11M|                    & (~CSBP_LEFT_BLOCK_MASK);
  ------------------
  |  |  107|  6.11M|#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.11M|    UWORD32 u4_nbr_vert_csbp = (u4_cur_mb_masked_csbp)
  137|  6.11M|                    | (u4_left_mb_masked_csbp >> 3);
  138|       |
  139|  6.11M|    UWORD32 u4_vert_bs2_dec = u4_cur_mb_csbp | u4_nbr_vert_csbp;
  140|       |
  141|  6.11M|    UWORD32 u4_reordered_vert_bs2_dec, u4_temp;
  142|       |
  143|  6.11M|    PROFILE_DISABLE_BOUNDARY_STRENGTH()
  ------------------
  |  |  125|  6.11M|#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.11M|    pu4_bs[0] = pu4_packed_bs2[u4_horz_bs2_dec & 0xF];
  149|  6.11M|    pu4_bs[1] = pu4_packed_bs2[(u4_horz_bs2_dec >> 4) & 0xF];
  150|  6.11M|    pu4_bs[2] = pu4_packed_bs2[(u4_horz_bs2_dec >> 8) & 0xF];
  151|  6.11M|    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.11M|    u4_reordered_vert_bs2_dec = pu2_4x4_v2h_reorder[u4_vert_bs2_dec & 0xF];
  157|  6.11M|    u4_temp = pu2_4x4_v2h_reorder[(u4_vert_bs2_dec >> 4) & 0xF];
  158|  6.11M|    u4_reordered_vert_bs2_dec |= (u4_temp << 1);
  159|  6.11M|    u4_temp = pu2_4x4_v2h_reorder[(u4_vert_bs2_dec >> 8) & 0xF];
  160|  6.11M|    u4_reordered_vert_bs2_dec |= (u4_temp << 2);
  161|  6.11M|    u4_temp = pu2_4x4_v2h_reorder[(u4_vert_bs2_dec >> 12) & 0xF];
  162|  6.11M|    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.11M|    pu4_bs[4] = pu4_packed_bs2[u4_reordered_vert_bs2_dec & 0xF];
  168|  6.11M|    pu4_bs[5] = pu4_packed_bs2[(u4_reordered_vert_bs2_dec >> 4) & 0xF];
  169|  6.11M|    pu4_bs[6] = pu4_packed_bs2[(u4_reordered_vert_bs2_dec >> 8) & 0xF];
  170|  6.11M|    pu4_bs[7] = pu4_packed_bs2[(u4_reordered_vert_bs2_dec >> 12) & 0xF];
  171|  6.11M|}
ih264d_fill_bs1_16x16mb_pslice:
  206|  2.85M|{
  207|  2.85M|    WORD16 i2_q_mv0, i2_q_mv1;
  208|  2.85M|    WORD16 i2_p_mv0, i2_p_mv1;
  209|  2.85M|    void *pv_cur_pic_addr0, *pv_cur_pic_addr1;
  210|  2.85M|    void *pv_nbr_pic_addr0, *pv_nbr_pic_addr1;
  211|  2.85M|    void **ppv_map_ref_idx_to_poc_l0; //,*ppv_map_ref_idx_to_poc_l1;
  212|  2.85M|    UWORD32 i;
  213|  2.85M|    UWORD32 u4_bs_horz = pu4_bs_table[0];
  214|  2.85M|    UWORD32 u4_bs_vert = pu4_bs_table[4];
  215|       |
  216|  2.85M|    PROFILE_DISABLE_BOUNDARY_STRENGTH()
  ------------------
  |  |  125|  2.85M|#define PROFILE_DISABLE_BOUNDARY_STRENGTH() ;
  ------------------
  217|       |
  218|  2.85M|    ppv_map_ref_idx_to_poc_l0 = ppv_map_ref_idx_to_poc;
  219|       |
  220|  2.85M|    i2_q_mv0 = ps_cur_mv_pred->i2_mv[0];
  221|  2.85M|    i2_q_mv1 = ps_cur_mv_pred->i2_mv[1];
  222|  2.85M|    pv_cur_pic_addr0 = ppv_map_ref_idx_to_poc_l0[ps_cur_mv_pred->i1_ref_frame[0]];
  223|  2.85M|    pv_cur_pic_addr1 = 0;
  224|       |
  225|       |    /*********************************/
  226|       |    /* Computing Bs for the top edge */
  227|       |    /*********************************/
  228|  14.2M|    for(i = 0; i < 4; i++, ps_top_mv_pred++)
  ------------------
  |  Branch (228:16): [True: 11.4M, False: 2.85M]
  ------------------
  229|  11.4M|    {
  230|  11.4M|        UWORD32 u4_idx = 24 - (i << 3);
  231|       |
  232|       |        /*********************************/
  233|       |        /* check if Bs is already set    */
  234|       |        /*********************************/
  235|  11.4M|        if(!((u4_bs_horz >> u4_idx) & 0xf))
  ------------------
  |  Branch (235:12): [True: 11.2M, False: 185k]
  ------------------
  236|  11.2M|        {
  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.2M|            UWORD32 u4_bs_temp1;
  242|  11.2M|            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.2M|            i2_p_mv0 = ps_top_mv_pred->i2_mv[0];
  251|  11.2M|            i2_p_mv1 = ps_top_mv_pred->i2_mv[1];
  252|  11.2M|            pv_nbr_pic_addr0 = u4_pic_addrress[i & 2];
  253|  11.2M|            pv_nbr_pic_addr1 = u4_pic_addrress[1 + (i & 2)];
  254|       |
  255|  11.2M|            u4_bs_temp1 = ((ABS((i2_p_mv0 - i2_q_mv0)) >= 4) ||
  ------------------
  |  |  100|  11.2M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 69.1k, False: 11.1M]
  |  |  ------------------
  ------------------
  |  Branch (255:28): [True: 58.0k, False: 11.1M]
  ------------------
  256|  11.1M|                           (ABS((i2_p_mv1 - i2_q_mv1)) >= i4_ver_mvlimit));
  ------------------
  |  |  100|  11.1M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 44.7k, False: 11.1M]
  |  |  ------------------
  ------------------
  |  Branch (256:28): [True: 32.8k, False: 11.1M]
  ------------------
  257|       |
  258|  11.2M|            u4_bs = ((pv_cur_pic_addr0 != pv_nbr_pic_addr0)
  ------------------
  |  Branch (258:22): [True: 460k, False: 10.7M]
  ------------------
  259|  10.7M|                            || (pv_cur_pic_addr1 != pv_nbr_pic_addr1)
  ------------------
  |  Branch (259:32): [True: 4.38k, False: 10.7M]
  ------------------
  260|  10.7M|                            || u4_bs_temp1);
  ------------------
  |  Branch (260:32): [True: 79.8k, False: 10.6M]
  ------------------
  261|       |
  262|  11.2M|            u4_bs_horz |= (u4_bs << u4_idx);
  263|  11.2M|        }
  264|  11.4M|    }
  265|  2.85M|    pu4_bs_table[0] = u4_bs_horz;
  266|       |
  267|       |    /***********************************/
  268|       |    /* Computing Bs for the left edge  */
  269|       |    /***********************************/
  270|  14.2M|    for(i = 0; i < 4; i++, ps_leftmost_mv_pred += 4)
  ------------------
  |  Branch (270:16): [True: 11.4M, False: 2.85M]
  ------------------
  271|  11.4M|    {
  272|  11.4M|        UWORD32 u4_idx = 24 - (i << 3);
  273|       |
  274|       |        /*********************************/
  275|       |        /* check if Bs is already set    */
  276|       |        /*********************************/
  277|  11.4M|        if(!((u4_bs_vert >> u4_idx) & 0xf))
  ------------------
  |  Branch (277:12): [True: 11.3M, False: 82.0k]
  ------------------
  278|  11.3M|        {
  279|       |            /****************************************************/
  280|       |            /* If Bs is not set, evalaute conditions for Bs=1   */
  281|       |            /****************************************************/
  282|  11.3M|            UWORD32 u4_bs_temp1;
  283|  11.3M|            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.3M|            i2_p_mv0 = ps_leftmost_mv_pred->i2_mv[0];
  292|  11.3M|            i2_p_mv1 = ps_leftmost_mv_pred->i2_mv[1];
  293|  11.3M|            pv_nbr_pic_addr0 = ps_left_addr->u4_add[i & 2];
  294|  11.3M|            pv_nbr_pic_addr1 = ps_left_addr->u4_add[1 + (i & 2)];
  295|       |
  296|  11.3M|            u4_bs_temp1 =
  297|  11.3M|                            ((ABS((i2_p_mv0 - i2_q_mv0))
  ------------------
  |  |  100|  11.3M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 41.4k, False: 11.3M]
  |  |  ------------------
  ------------------
  298|  11.3M|                                            >= 4)
  299|  11.3M|                                            | (ABS((i2_p_mv1 - i2_q_mv1))
  ------------------
  |  |  100|  11.3M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 36.4k, False: 11.3M]
  |  |  ------------------
  ------------------
  300|  11.3M|                                                            >= i4_ver_mvlimit));
  301|       |
  302|  11.3M|            u4_bs = ((pv_cur_pic_addr0 != pv_nbr_pic_addr0)
  ------------------
  |  Branch (302:22): [True: 47.3k, False: 11.2M]
  ------------------
  303|  11.2M|                            || (pv_cur_pic_addr1 != pv_nbr_pic_addr1)
  ------------------
  |  Branch (303:32): [True: 2.02k, False: 11.2M]
  ------------------
  304|  11.2M|                            || u4_bs_temp1);
  ------------------
  |  Branch (304:32): [True: 60.3k, False: 11.2M]
  ------------------
  305|       |
  306|  11.3M|            u4_bs_vert |= (u4_bs << u4_idx);
  307|  11.3M|        }
  308|  11.4M|    }
  309|  2.85M|    pu4_bs_table[4] = u4_bs_vert;
  310|       |
  311|  2.85M|    return;
  312|  2.85M|}
ih264d_fill_bs1_non16x16mb_pslice:
  347|  68.6k|{
  348|  68.6k|    UWORD32 edge;
  349|  68.6k|    void **ppv_map_ref_idx_to_poc_l0; //,*ppv_map_ref_idx_to_poc_l1;
  350|       |
  351|  68.6k|    PROFILE_DISABLE_BOUNDARY_STRENGTH()
  ------------------
  |  |  125|  68.6k|#define PROFILE_DISABLE_BOUNDARY_STRENGTH() ;
  ------------------
  352|       |
  353|  68.6k|    ppv_map_ref_idx_to_poc_l0 = ppv_map_ref_idx_to_poc;
  354|       |
  355|       |
  356|   343k|    for(edge = 0; edge < 4; edge++, ps_top_mv_pred = ps_cur_mv_pred - 4)
  ------------------
  |  Branch (356:19): [True: 274k, False: 68.6k]
  ------------------
  357|   274k|    {
  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|   274k|        WORD32 i;
  363|   274k|        UWORD32 u4_vert_idx = 24 - (edge << 3);
  364|   274k|        UWORD32 u4_bs_horz = pu4_bs_table[edge];
  365|   274k|        mv_pred_t *ps_left_mv_pred = ps_leftmost_mv_pred + (edge << 2);
  366|       |
  367|  1.37M|        for(i = 0; i < 4; i++, ps_top_mv_pred++, ps_cur_mv_pred++)
  ------------------
  |  Branch (367:20): [True: 1.09M, False: 274k]
  ------------------
  368|  1.09M|        {
  369|  1.09M|            WORD16 i2_cur_mv0, i2_cur_mv1;
  370|  1.09M|            WORD8 i1_cur_ref0;
  371|  1.09M|            void *pv_cur_pic_addr0, *pv_cur_pic_addr1 = 0;
  372|  1.09M|            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.09M|            UWORD32 u4_bs_vert = (pu4_bs_table[i + 4] >> u4_vert_idx) & 0xf;
  379|  1.09M|            UWORD32 u4_horz_idx = 24 - (i << 3);
  380|       |
  381|       |            /*****************************************************/
  382|       |            /* check if vert Bs for this block is already set    */
  383|       |            /*****************************************************/
  384|  1.09M|            if(!u4_bs_vert)
  ------------------
  |  Branch (384:16): [True: 960k, False: 137k]
  ------------------
  385|   960k|            {
  386|   960k|                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|   960k|                i2_left_mv0 = ps_left_mv_pred->i2_mv[0];
  392|   960k|                i2_left_mv1 = ps_left_mv_pred->i2_mv[1];
  393|       |
  394|   960k|                i2_cur_mv0 = ps_cur_mv_pred->i2_mv[0];
  395|   960k|                i2_cur_mv1 = ps_cur_mv_pred->i2_mv[1];
  396|       |
  397|   960k|                i1_cur_ref0 = ps_cur_mv_pred->i1_ref_frame[0];
  398|       |
  399|   960k|                pv_cur_pic_addr0 = ppv_map_ref_idx_to_poc_l0[i1_cur_ref0];
  400|   960k|                if(i)
  ------------------
  |  Branch (400:20): [True: 723k, False: 237k]
  ------------------
  401|   723k|                {
  402|   723k|                    WORD8 i1_left_ref0 = ps_left_mv_pred->i1_ref_frame[0];
  403|   723k|                    pv_nbr_pic_addr0 = ppv_map_ref_idx_to_poc_l0[i1_left_ref0];
  404|   723k|                    pv_nbr_pic_addr1 = 0;
  405|   723k|                }
  406|   237k|                else
  407|   237k|                {
  408|   237k|                    pv_nbr_pic_addr0 = ps_left_addr->u4_add[edge & 2];
  409|   237k|                    pv_nbr_pic_addr1 = ps_left_addr->u4_add[1 + (edge & 2)];
  410|   237k|                }
  411|       |
  412|   960k|                {
  413|   960k|                    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|   960k|                    u4_bs_temp1 =
  422|   960k|                                    ((ABS((i2_left_mv0 - i2_cur_mv0))
  ------------------
  |  |  100|   960k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 96.2k, False: 864k]
  |  |  ------------------
  ------------------
  423|   960k|                                                    >= 4)
  424|   960k|                                                    | (ABS((i2_left_mv1
  ------------------
  |  |  100|   960k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 99.0k, False: 861k]
  |  |  ------------------
  ------------------
  425|   960k|                                                                    - i2_cur_mv1))
  426|   960k|                                                                    >= i4_ver_mvlimit));
  427|       |
  428|   960k|                    u4_bs_vert = ((pv_nbr_pic_addr0 != pv_cur_pic_addr0)
  ------------------
  |  Branch (428:35): [True: 6.47k, False: 954k]
  ------------------
  429|   954k|                                    || (pv_nbr_pic_addr1 != pv_cur_pic_addr1)
  ------------------
  |  Branch (429:40): [True: 126, False: 954k]
  ------------------
  430|   954k|                                    || u4_bs_temp1);
  ------------------
  |  Branch (430:40): [True: 87.6k, False: 866k]
  ------------------
  431|       |
  432|   960k|                    pu4_bs_table[i + 4] |= (u4_bs_vert << u4_vert_idx);
  433|   960k|                }
  434|   960k|            }
  435|       |
  436|       |            /*****************************************************/
  437|       |            /* check if horz Bs for this block is already set    */
  438|       |            /*****************************************************/
  439|  1.09M|            if(!((u4_bs_horz >> u4_horz_idx) & 0xf))
  ------------------
  |  Branch (439:16): [True: 958k, False: 139k]
  ------------------
  440|   958k|            {
  441|   958k|                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|   958k|                i2_cur_mv0 = ps_cur_mv_pred->i2_mv[0];
  447|   958k|                i2_cur_mv1 = ps_cur_mv_pred->i2_mv[1];
  448|       |
  449|   958k|                i1_cur_ref0 = ps_cur_mv_pred->i1_ref_frame[0];
  450|       |
  451|   958k|                i2_top_mv0 = ps_top_mv_pred->i2_mv[0];
  452|   958k|                i2_top_mv1 = ps_top_mv_pred->i2_mv[1];
  453|       |
  454|   958k|                pv_cur_pic_addr0 = ppv_map_ref_idx_to_poc_l0[i1_cur_ref0];
  455|   958k|                if(edge)
  ------------------
  |  Branch (455:20): [True: 721k, False: 237k]
  ------------------
  456|   721k|                {
  457|   721k|                    WORD8 i1_top_ref0 = ps_top_mv_pred->i1_ref_frame[0];
  458|   721k|                    pv_nbr_pic_addr0 = ppv_map_ref_idx_to_poc_l0[i1_top_ref0];
  459|   721k|                    pv_nbr_pic_addr1 = 0;
  460|   721k|                }
  461|   237k|                else
  462|   237k|                {
  463|   237k|                    pv_nbr_pic_addr0 = u4_pic_addrress[i & 2];
  464|   237k|                    pv_nbr_pic_addr1 = u4_pic_addrress[1 + (i & 2)];
  465|   237k|                }
  466|       |
  467|   958k|                {
  468|   958k|                    UWORD32 u4_bs_temp1;
  469|   958k|                    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|   958k|                    u4_bs_temp1 =
  478|   958k|                                    ((ABS((i2_top_mv0 - i2_cur_mv0))
  ------------------
  |  |  100|   958k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 106k, False: 852k]
  |  |  ------------------
  ------------------
  479|   958k|                                                    >= 4)
  480|   958k|                                                    | (ABS((i2_top_mv1
  ------------------
  |  |  100|   958k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 106k, False: 851k]
  |  |  ------------------
  ------------------
  481|   958k|                                                                    - i2_cur_mv1))
  482|   958k|                                                                    >= i4_ver_mvlimit));
  483|       |
  484|   958k|                    u4_bs = ((pv_nbr_pic_addr0 != pv_cur_pic_addr0)
  ------------------
  |  Branch (484:30): [True: 12.0k, False: 946k]
  ------------------
  485|   946k|                                    || (pv_nbr_pic_addr1 != pv_cur_pic_addr1)
  ------------------
  |  Branch (485:40): [True: 472, False: 946k]
  ------------------
  486|   946k|                                    || u4_bs_temp1);
  ------------------
  |  Branch (486:40): [True: 76.1k, False: 870k]
  ------------------
  487|       |
  488|   958k|                    u4_bs_horz |= (u4_bs << u4_horz_idx);
  489|   958k|                }
  490|   958k|            }
  491|       |
  492|  1.09M|            ps_left_mv_pred = ps_cur_mv_pred;
  493|  1.09M|        }
  494|       |
  495|   274k|        pu4_bs_table[edge] = u4_bs_horz;
  496|   274k|    }
  497|  68.6k|}
ih264d_fill_bs1_16x16mb_bslice:
  532|  3.08M|{
  533|  3.08M|    WORD16 i2_q_mv0, i2_q_mv1, i2_q_mv2, i2_q_mv3;
  534|  3.08M|    WORD16 i2_p_mv0, i2_p_mv1, i2_p_mv2, i2_p_mv3;
  535|  3.08M|    void *pv_cur_pic_addr0, *pv_cur_pic_addr1;
  536|  3.08M|    void *pv_nbr_pic_addr0, *pv_nbr_pic_addr1;
  537|  3.08M|    void **ppv_map_ref_idx_to_poc_l0, **ppv_map_ref_idx_to_poc_l1;
  538|  3.08M|    UWORD32 i;
  539|  3.08M|    UWORD32 u4_bs_horz = pu4_bs_table[0];
  540|  3.08M|    UWORD32 u4_bs_vert = pu4_bs_table[4];
  541|       |
  542|  3.08M|    PROFILE_DISABLE_BOUNDARY_STRENGTH()
  ------------------
  |  |  125|  3.08M|#define PROFILE_DISABLE_BOUNDARY_STRENGTH() ;
  ------------------
  543|       |
  544|  3.08M|    ppv_map_ref_idx_to_poc_l0 = ppv_map_ref_idx_to_poc;
  545|  3.08M|    ppv_map_ref_idx_to_poc_l1 = ppv_map_ref_idx_to_poc + POC_LIST_L0_TO_L1_DIFF;
  ------------------
  |  |   86|  3.08M|#define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
  |  |  ------------------
  |  |  |  |  600|  3.08M|#define MAX_FRAMES              16
  |  |  ------------------
  ------------------
  546|  3.08M|    i2_q_mv0 = ps_cur_mv_pred->i2_mv[0];
  547|  3.08M|    i2_q_mv1 = ps_cur_mv_pred->i2_mv[1];
  548|  3.08M|    i2_q_mv2 = ps_cur_mv_pred->i2_mv[2];
  549|  3.08M|    i2_q_mv3 = ps_cur_mv_pred->i2_mv[3];
  550|  3.08M|    pv_cur_pic_addr0 = ppv_map_ref_idx_to_poc_l0[ps_cur_mv_pred->i1_ref_frame[0]];
  551|  3.08M|    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|  15.4M|    for(i = 0; i < 4; i++, ps_top_mv_pred++)
  ------------------
  |  Branch (556:16): [True: 12.3M, False: 3.08M]
  ------------------
  557|  12.3M|    {
  558|  12.3M|        UWORD32 u4_idx = 24 - (i << 3);
  559|       |
  560|       |        /*********************************/
  561|       |        /* check if Bs is already set    */
  562|       |        /*********************************/
  563|  12.3M|        if(!((u4_bs_horz >> u4_idx) & 0xf))
  ------------------
  |  Branch (563:12): [True: 12.2M, False: 47.6k]
  ------------------
  564|  12.2M|        {
  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|  12.2M|            UWORD32 u4_bs_temp1, u4_bs_temp2;
  570|  12.2M|            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|  12.2M|            i2_p_mv0 = ps_top_mv_pred->i2_mv[0];
  579|  12.2M|            i2_p_mv1 = ps_top_mv_pred->i2_mv[1];
  580|  12.2M|            i2_p_mv2 = ps_top_mv_pred->i2_mv[2];
  581|  12.2M|            i2_p_mv3 = ps_top_mv_pred->i2_mv[3];
  582|  12.2M|            pv_nbr_pic_addr0 = u4_pic_addrress[i & 2];
  583|  12.2M|            pv_nbr_pic_addr1 = u4_pic_addrress[1 + (i & 2)];
  584|       |
  585|  12.2M|            u4_bs_temp1 =
  586|  12.2M|                            ((ABS((i2_p_mv0 - i2_q_mv0))
  ------------------
  |  |  100|  12.2M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 53.9k, False: 12.2M]
  |  |  ------------------
  ------------------
  587|  12.2M|                                            >= 4)
  588|  12.2M|                                            | (ABS((i2_p_mv1 - i2_q_mv1))
  ------------------
  |  |  100|  12.2M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 61.9k, False: 12.2M]
  |  |  ------------------
  ------------------
  589|  12.2M|                                                            >= i4_ver_mvlimit)
  590|  12.2M|                                            | (ABS((i2_p_mv2 - i2_q_mv2))
  ------------------
  |  |  100|  12.2M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 68.6k, False: 12.2M]
  |  |  ------------------
  ------------------
  591|  12.2M|                                                            >= 4)
  592|  12.2M|                                            | (ABS((i2_p_mv3 - i2_q_mv3))
  ------------------
  |  |  100|  12.2M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 46.1k, False: 12.2M]
  |  |  ------------------
  ------------------
  593|  12.2M|                                                            >= i4_ver_mvlimit));
  594|       |
  595|  12.2M|            u4_bs_temp2 =
  596|  12.2M|                            ((ABS((i2_p_mv0 - i2_q_mv2))
  ------------------
  |  |  100|  12.2M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 343k, False: 11.9M]
  |  |  ------------------
  ------------------
  597|  12.2M|                                            >= 4)
  598|  12.2M|                                            | (ABS((i2_p_mv1 - i2_q_mv3))
  ------------------
  |  |  100|  12.2M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 401k, False: 11.8M]
  |  |  ------------------
  ------------------
  599|  12.2M|                                                            >= i4_ver_mvlimit)
  600|  12.2M|                                            | (ABS((i2_p_mv2 - i2_q_mv0))
  ------------------
  |  |  100|  12.2M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 8.31M, False: 3.98M]
  |  |  ------------------
  ------------------
  601|  12.2M|                                                            >= 4)
  602|  12.2M|                                            | (ABS((i2_p_mv3 - i2_q_mv1))
  ------------------
  |  |  100|  12.2M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 8.35M, False: 3.94M]
  |  |  ------------------
  ------------------
  603|  12.2M|                                                            >= i4_ver_mvlimit));
  604|       |
  605|  12.2M|            u4_bs = ((pv_cur_pic_addr0 != pv_nbr_pic_addr0)
  ------------------
  |  Branch (605:22): [True: 381k, False: 11.9M]
  ------------------
  606|  11.9M|                            || (pv_cur_pic_addr1 != pv_nbr_pic_addr1)
  ------------------
  |  Branch (606:32): [True: 259k, False: 11.6M]
  ------------------
  607|  11.6M|                            || u4_bs_temp1)
  ------------------
  |  Branch (607:32): [True: 29.3k, False: 11.6M]
  ------------------
  608|   670k|                            && ((pv_cur_pic_addr0 != pv_nbr_pic_addr1)
  ------------------
  |  Branch (608:33): [True: 423k, False: 246k]
  ------------------
  609|   246k|                                            || (pv_cur_pic_addr1
  ------------------
  |  Branch (609:48): [True: 194k, False: 52.5k]
  ------------------
  610|   246k|                                                            != pv_nbr_pic_addr0)
  611|  52.5k|                                            || u4_bs_temp2);
  ------------------
  |  Branch (611:48): [True: 29.1k, False: 23.4k]
  ------------------
  612|       |
  613|  12.2M|            u4_bs_horz |= (u4_bs << u4_idx);
  614|  12.2M|        }
  615|  12.3M|    }
  616|  3.08M|    pu4_bs_table[0] = u4_bs_horz;
  617|       |
  618|       |    /***********************************/
  619|       |    /* Computing Bs for the left edge  */
  620|       |    /***********************************/
  621|  15.4M|    for(i = 0; i < 4; i++, ps_leftmost_mv_pred += 4)
  ------------------
  |  Branch (621:16): [True: 12.3M, False: 3.08M]
  ------------------
  622|  12.3M|    {
  623|  12.3M|        UWORD32 u4_idx = 24 - (i << 3);
  624|       |
  625|       |        /*********************************/
  626|       |        /* check if Bs is already set    */
  627|       |        /*********************************/
  628|  12.3M|        if(!((u4_bs_vert >> u4_idx) & 0xf))
  ------------------
  |  Branch (628:12): [True: 12.3M, False: 44.8k]
  ------------------
  629|  12.3M|        {
  630|       |            /****************************************************/
  631|       |            /* If Bs is not set, evalaute conditions for Bs=1   */
  632|       |            /****************************************************/
  633|  12.3M|            UWORD32 u4_bs_temp1, u4_bs_temp2;
  634|  12.3M|            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|  12.3M|            i2_p_mv0 = ps_leftmost_mv_pred->i2_mv[0];
  643|  12.3M|            i2_p_mv1 = ps_leftmost_mv_pred->i2_mv[1];
  644|  12.3M|            i2_p_mv2 = ps_leftmost_mv_pred->i2_mv[2];
  645|  12.3M|            i2_p_mv3 = ps_leftmost_mv_pred->i2_mv[3];
  646|  12.3M|            pv_nbr_pic_addr0 = ps_left_addr->u4_add[i & 2];
  647|  12.3M|            pv_nbr_pic_addr1 = ps_left_addr->u4_add[1 + (i & 2)];
  648|       |
  649|  12.3M|            u4_bs_temp1 =
  650|  12.3M|                            ((ABS((i2_p_mv0 - i2_q_mv0))
  ------------------
  |  |  100|  12.3M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 38.9k, False: 12.2M]
  |  |  ------------------
  ------------------
  651|  12.3M|                                            >= 4)
  652|  12.3M|                                            | (ABS((i2_p_mv1 - i2_q_mv1))
  ------------------
  |  |  100|  12.3M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 43.8k, False: 12.2M]
  |  |  ------------------
  ------------------
  653|  12.3M|                                                            >= i4_ver_mvlimit)
  654|  12.3M|                                            | (ABS((i2_p_mv2 - i2_q_mv2))
  ------------------
  |  |  100|  12.3M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 50.0k, False: 12.2M]
  |  |  ------------------
  ------------------
  655|  12.3M|                                                            >= 4)
  656|  12.3M|                                            | (ABS((i2_p_mv3 - i2_q_mv3))
  ------------------
  |  |  100|  12.3M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 37.0k, False: 12.2M]
  |  |  ------------------
  ------------------
  657|  12.3M|                                                            >= i4_ver_mvlimit));
  658|       |
  659|  12.3M|            u4_bs_temp2 =
  660|  12.3M|                            ((ABS((i2_p_mv0 - i2_q_mv2))
  ------------------
  |  |  100|  12.3M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 341k, False: 11.9M]
  |  |  ------------------
  ------------------
  661|  12.3M|                                            >= 4)
  662|  12.3M|                                            | (ABS((i2_p_mv1 - i2_q_mv3))
  ------------------
  |  |  100|  12.3M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 400k, False: 11.9M]
  |  |  ------------------
  ------------------
  663|  12.3M|                                                            >= i4_ver_mvlimit)
  664|  12.3M|                                            | (ABS((i2_p_mv2 - i2_q_mv0))
  ------------------
  |  |  100|  12.3M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 8.58M, False: 3.71M]
  |  |  ------------------
  ------------------
  665|  12.3M|                                                            >= 4)
  666|  12.3M|                                            | (ABS((i2_p_mv3 - i2_q_mv1))
  ------------------
  |  |  100|  12.3M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 8.63M, False: 3.66M]
  |  |  ------------------
  ------------------
  667|  12.3M|                                                            >= i4_ver_mvlimit));
  668|       |
  669|  12.3M|            u4_bs = ((pv_cur_pic_addr0 != pv_nbr_pic_addr0)
  ------------------
  |  Branch (669:22): [True: 136k, False: 12.1M]
  ------------------
  670|  12.1M|                            || (pv_cur_pic_addr1 != pv_nbr_pic_addr1)
  ------------------
  |  Branch (670:32): [True: 110k, False: 12.0M]
  ------------------
  671|  12.0M|                            || u4_bs_temp1)
  ------------------
  |  Branch (671:32): [True: 42.9k, False: 12.0M]
  ------------------
  672|   289k|                            && ((pv_cur_pic_addr0 != pv_nbr_pic_addr1)
  ------------------
  |  Branch (672:33): [True: 161k, False: 128k]
  ------------------
  673|   128k|                                            || (pv_cur_pic_addr1
  ------------------
  |  Branch (673:48): [True: 82.0k, False: 46.3k]
  ------------------
  674|   128k|                                                            != pv_nbr_pic_addr0)
  675|  46.3k|                                            || u4_bs_temp2);
  ------------------
  |  Branch (675:48): [True: 38.2k, False: 8.07k]
  ------------------
  676|       |
  677|  12.3M|            u4_bs_vert |= (u4_bs << u4_idx);
  678|  12.3M|        }
  679|  12.3M|    }
  680|  3.08M|    pu4_bs_table[4] = u4_bs_vert;
  681|       |
  682|  3.08M|    return;
  683|  3.08M|}
ih264d_fill_bs1_non16x16mb_bslice:
  718|   105k|{
  719|   105k|    UWORD32 edge;
  720|   105k|    void **ppv_map_ref_idx_to_poc_l0, **ppv_map_ref_idx_to_poc_l1;
  721|   105k|    ppv_map_ref_idx_to_poc_l0 = ppv_map_ref_idx_to_poc;
  722|   105k|    ppv_map_ref_idx_to_poc_l1 = ppv_map_ref_idx_to_poc + POC_LIST_L0_TO_L1_DIFF;
  ------------------
  |  |   86|   105k|#define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
  |  |  ------------------
  |  |  |  |  600|   105k|#define MAX_FRAMES              16
  |  |  ------------------
  ------------------
  723|       |
  724|   105k|    PROFILE_DISABLE_BOUNDARY_STRENGTH()
  ------------------
  |  |  125|   105k|#define PROFILE_DISABLE_BOUNDARY_STRENGTH() ;
  ------------------
  725|       |
  726|   525k|    for(edge = 0; edge < 4; edge++, ps_top_mv_pred = ps_cur_mv_pred - 4)
  ------------------
  |  Branch (726:19): [True: 420k, False: 105k]
  ------------------
  727|   420k|    {
  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|   420k|        WORD32 i;
  733|   420k|        UWORD32 u4_vert_idx = 24 - (edge << 3);
  734|   420k|        UWORD32 u4_bs_horz = pu4_bs_table[edge];
  735|   420k|        mv_pred_t *ps_left_mv_pred = ps_leftmost_mv_pred + (edge << 2);
  736|       |
  737|  2.10M|        for(i = 0; i < 4; i++, ps_top_mv_pred++, ps_cur_mv_pred++)
  ------------------
  |  Branch (737:20): [True: 1.68M, False: 420k]
  ------------------
  738|  1.68M|        {
  739|  1.68M|            WORD16 i2_cur_mv0, i2_cur_mv1, i16_curMv2, i16_curMv3;
  740|  1.68M|            WORD8 i1_cur_ref0, i1_cur_ref1;
  741|  1.68M|            void *pv_cur_pic_addr0, *pv_cur_pic_addr1;
  742|  1.68M|            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.68M|            UWORD32 u4_bs_vert = (pu4_bs_table[i + 4] >> u4_vert_idx) & 0xf;
  749|  1.68M|            UWORD32 u4_horz_idx = 24 - (i << 3);
  750|       |
  751|       |            /*****************************************************/
  752|       |            /* check if vert Bs for this block is already set    */
  753|       |            /*****************************************************/
  754|  1.68M|            if(!u4_bs_vert)
  ------------------
  |  Branch (754:16): [True: 1.59M, False: 83.5k]
  ------------------
  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: 397k]
  ------------------
  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|   397k|                else
  784|   397k|                {
  785|   397k|                    pv_nbr_pic_addr0 = ps_left_addr->u4_add[edge & 2];
  786|   397k|                    pv_nbr_pic_addr1 = ps_left_addr->u4_add[1 + (edge & 2)];
  787|   397k|                }
  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: 198k, 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: 182k, 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: 69.2k, False: 1.52M]
  |  |  ------------------
  ------------------
  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: 48.1k, False: 1.54M]
  |  |  ------------------
  ------------------
  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: 238k, False: 1.35M]
  |  |  ------------------
  ------------------
  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: 249k, False: 1.34M]
  |  |  ------------------
  ------------------
  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: 829k, False: 767k]
  |  |  ------------------
  ------------------
  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: 745k, False: 851k]
  |  |  ------------------
  ------------------
  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: 98.5k, False: 1.49M]
  ------------------
  826|  1.49M|                                                    || (pv_nbr_pic_addr1
  ------------------
  |  Branch (826:56): [True: 68.6k, False: 1.42M]
  ------------------
  827|  1.49M|                                                                    != pv_cur_pic_addr1)
  828|  1.42M|                                                    || u4_bs_temp1)
  ------------------
  |  Branch (828:56): [True: 191k, False: 1.23M]
  ------------------
  829|   358k|                                                    && ((pv_nbr_pic_addr0
  ------------------
  |  Branch (829:57): [True: 209k, False: 149k]
  ------------------
  830|   358k|                                                                    != pv_cur_pic_addr1)
  831|   149k|                                                                    || (pv_nbr_pic_addr1
  ------------------
  |  Branch (831:72): [True: 59.0k, False: 90.3k]
  ------------------
  832|   149k|                                                                                    != pv_cur_pic_addr0)
  833|  90.3k|                                                                    || u4_bs_temp2);
  ------------------
  |  Branch (833:72): [True: 79.2k, False: 11.0k]
  ------------------
  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.68M|            if(!((u4_bs_horz >> u4_horz_idx) & 0xf))
  ------------------
  |  Branch (842:16): [True: 1.59M, False: 87.5k]
  ------------------
  843|  1.59M|            {
  844|  1.59M|                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.59M|                i2_cur_mv0 = ps_cur_mv_pred->i2_mv[0];
  850|  1.59M|                i2_cur_mv1 = ps_cur_mv_pred->i2_mv[1];
  851|  1.59M|                i16_curMv2 = ps_cur_mv_pred->i2_mv[2];
  852|  1.59M|                i16_curMv3 = ps_cur_mv_pred->i2_mv[3];
  853|  1.59M|                i1_cur_ref0 = ps_cur_mv_pred->i1_ref_frame[0];
  854|  1.59M|                i1_cur_ref1 = ps_cur_mv_pred->i1_ref_frame[1];
  855|       |
  856|  1.59M|                i2_top_mv0 = ps_top_mv_pred->i2_mv[0];
  857|  1.59M|                i2_top_mv1 = ps_top_mv_pred->i2_mv[1];
  858|  1.59M|                i16_topMv2 = ps_top_mv_pred->i2_mv[2];
  859|  1.59M|                i16_topMv3 = ps_top_mv_pred->i2_mv[3];
  860|  1.59M|                pv_cur_pic_addr0 = ppv_map_ref_idx_to_poc_l0[i1_cur_ref0];
  861|  1.59M|                pv_cur_pic_addr1 = ppv_map_ref_idx_to_poc_l1[i1_cur_ref1];
  862|  1.59M|                if(edge)
  ------------------
  |  Branch (862:20): [True: 1.19M, False: 395k]
  ------------------
  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|   395k|                else
  871|   395k|                {
  872|   395k|                    pv_nbr_pic_addr0 = u4_pic_addrress[i & 2];
  873|   395k|                    pv_nbr_pic_addr1 = u4_pic_addrress[1 + (i & 2)];
  874|   395k|                }
  875|       |
  876|  1.59M|                {
  877|  1.59M|                    UWORD32 u4_bs_temp1, u4_bs_temp2;
  878|  1.59M|                    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.59M|                    u4_bs_temp1 =
  887|  1.59M|                                    ((ABS((i2_top_mv0 - i2_cur_mv0))
  ------------------
  |  |  100|  1.59M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 316k, False: 1.27M]
  |  |  ------------------
  ------------------
  888|  1.59M|                                                    >= 4)
  889|  1.59M|                                                    | (ABS((i2_top_mv1
  ------------------
  |  |  100|  1.59M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 273k, False: 1.31M]
  |  |  ------------------
  ------------------
  890|  1.59M|                                                                    - i2_cur_mv1))
  891|  1.59M|                                                                    >= i4_ver_mvlimit)
  892|  1.59M|                                                    | (ABS((i16_topMv2
  ------------------
  |  |  100|  1.59M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 88.8k, False: 1.50M]
  |  |  ------------------
  ------------------
  893|  1.59M|                                                                    - i16_curMv2))
  894|  1.59M|                                                                    >= 4)
  895|  1.59M|                                                    | (ABS((i16_topMv3
  ------------------
  |  |  100|  1.59M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 58.0k, False: 1.53M]
  |  |  ------------------
  ------------------
  896|  1.59M|                                                                    - i16_curMv3))
  897|  1.59M|                                                                    >= i4_ver_mvlimit));
  898|       |
  899|  1.59M|                    u4_bs_temp2 =
  900|  1.59M|                                    ((ABS((i2_top_mv0 - i16_curMv2))
  ------------------
  |  |  100|  1.59M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 235k, False: 1.35M]
  |  |  ------------------
  ------------------
  901|  1.59M|                                                    >= 4)
  902|  1.59M|                                                    | (ABS((i2_top_mv1
  ------------------
  |  |  100|  1.59M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 245k, False: 1.34M]
  |  |  ------------------
  ------------------
  903|  1.59M|                                                                    - i16_curMv3))
  904|  1.59M|                                                                    >= i4_ver_mvlimit)
  905|  1.59M|                                                    | (ABS((i16_topMv2
  ------------------
  |  |  100|  1.59M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 820k, False: 772k]
  |  |  ------------------
  ------------------
  906|  1.59M|                                                                    - i2_cur_mv0))
  907|  1.59M|                                                                    >= 4)
  908|  1.59M|                                                    | (ABS((i16_topMv3
  ------------------
  |  |  100|  1.59M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 741k, False: 851k]
  |  |  ------------------
  ------------------
  909|  1.59M|                                                                    - i2_cur_mv1))
  910|  1.59M|                                                                    >= i4_ver_mvlimit));
  911|       |
  912|  1.59M|                    u4_bs =
  913|  1.59M|                                    ((pv_nbr_pic_addr0 != pv_cur_pic_addr0)
  ------------------
  |  Branch (913:38): [True: 103k, False: 1.48M]
  ------------------
  914|  1.48M|                                                    || (pv_nbr_pic_addr1
  ------------------
  |  Branch (914:56): [True: 118k, False: 1.37M]
  ------------------
  915|  1.48M|                                                                    != pv_cur_pic_addr1)
  916|  1.37M|                                                    || u4_bs_temp1)
  ------------------
  |  Branch (916:56): [True: 255k, False: 1.11M]
  ------------------
  917|   477k|                                                    && ((pv_nbr_pic_addr0
  ------------------
  |  Branch (917:57): [True: 271k, False: 206k]
  ------------------
  918|   477k|                                                                    != pv_cur_pic_addr1)
  919|   206k|                                                                    || (pv_nbr_pic_addr1
  ------------------
  |  Branch (919:72): [True: 94.6k, False: 111k]
  ------------------
  920|   206k|                                                                                    != pv_cur_pic_addr0)
  921|   111k|                                                                    || u4_bs_temp2);
  ------------------
  |  Branch (921:72): [True: 94.1k, False: 17.3k]
  ------------------
  922|       |
  923|  1.59M|                    u4_bs_horz |= (u4_bs << u4_horz_idx);
  924|  1.59M|                }
  925|  1.59M|            }
  926|       |
  927|  1.68M|            ps_left_mv_pred = ps_cur_mv_pred;
  928|  1.68M|        }
  929|       |
  930|   420k|        pu4_bs_table[edge] = u4_bs_horz;
  931|   420k|    }
  932|   105k|}
ih264d_compute_bs_non_mbaff:
 1146|  6.32M|{
 1147|       |    /* Mvpred and Nnz for top and Courrent */
 1148|  6.32M|    mv_pred_t *ps_cur_mv_pred, *ps_top_mv_pred = NULL, *ps_left_mv_pred;
 1149|       |    /* deblk_mb_t Params */
 1150|  6.32M|    deblk_mb_t *ps_cur_mb_params; /*< Parameters of current MacroBlock */
 1151|  6.32M|    deblkmb_neighbour_t *ps_deblk_top_mb;
 1152|       |
 1153|       |    /* Reference Index to POC mapping*/
 1154|  6.32M|    void ** apv_map_ref_idx_to_poc;
 1155|  6.32M|    UWORD32 u4_leftmbtype;
 1156|       |
 1157|  6.32M|    UWORD16 u2_left_csbp, u2_top_csbp, u2_cur_csbp;
 1158|       |
 1159|       |    /* Set of flags */
 1160|  6.32M|    UWORD32 u4_cur_mb_intra, u1_top_mb_typ, u4_cur_mb_fld;
 1161|  6.32M|    UWORD32 u1_cur_mb_type;
 1162|  6.32M|    UWORD32 * pu4_bs_table;
 1163|       |
 1164|       |    /* Neighbour availability */
 1165|       |    /* Initialization */
 1166|  6.32M|    const UWORD32 u2_mbx = ps_cur_mb_info->u2_mbx;
 1167|  6.32M|    const UWORD32 u2_mby = ps_cur_mb_info->u2_mby;
 1168|  6.32M|    const UWORD32 u1_pingpong = u2_mbx & 0x01;
 1169|       |
 1170|  6.32M|    PROFILE_DISABLE_BOUNDARY_STRENGTH()
  ------------------
  |  |  125|  6.32M|#define PROFILE_DISABLE_BOUNDARY_STRENGTH() ;
  ------------------
 1171|       |
 1172|  6.32M|    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.32M|    ps_cur_mb_params = ps_dec->ps_deblk_mbn + u2_mbxn_mb;
 1177|  6.32M|    ps_cur_mv_pred = ps_dec->ps_mv_cur + (u2_mbxn_mb << 4);
 1178|       |
 1179|  6.32M|    apv_map_ref_idx_to_poc = ps_dec->ppv_map_ref_idx_to_poc + 1;
 1180|  6.32M|    u1_cur_mb_type = ps_cur_mb_params->u1_mb_type;
 1181|  6.32M|    u1_top_mb_typ = ps_deblk_top_mb->u1_mb_type;
 1182|  6.32M|    ps_deblk_top_mb->u1_mb_type = u1_cur_mb_type;
 1183|       |
 1184|  6.32M|    {
 1185|  6.32M|        UWORD8 mb_qp_temp;
 1186|       |
 1187|  6.32M|        ps_cur_mb_params->u1_topmb_qp = ps_deblk_top_mb->u1_mb_qp;
 1188|  6.32M|        ps_deblk_top_mb->u1_mb_qp = ps_cur_mb_params->u1_mb_qp;
 1189|       |
 1190|  6.32M|        ps_cur_mb_params->u1_left_mb_qp = ps_dec->deblk_left_mb[1].u1_mb_qp;
 1191|  6.32M|        ps_dec->deblk_left_mb[1].u1_mb_qp = ps_cur_mb_params->u1_mb_qp;
 1192|       |
 1193|  6.32M|    }
 1194|       |
 1195|       |    /* if no deblocking required for current Mb then continue */
 1196|       |    /* Check next Mbs   in Mb group                           */
 1197|  6.32M|    if(ps_cur_mb_params->u1_deblocking_mode & MB_DISABLE_FILTERING)
  ------------------
  |  |   70|  6.32M|#define MB_DISABLE_FILTERING          0x01
  ------------------
  |  Branch (1197:8): [True: 1.19M, False: 5.12M]
  ------------------
 1198|  1.19M|    {
 1199|  1.19M|        void ** pu4_map_ref_idx_to_poc_l1 = apv_map_ref_idx_to_poc +
 1200|  1.19M|        POC_LIST_L0_TO_L1_DIFF;
  ------------------
  |  |   86|  1.19M|#define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
  |  |  ------------------
  |  |  |  |  600|  1.19M|#define MAX_FRAMES              16
  |  |  ------------------
  ------------------
 1201|  1.19M|        {
 1202|       |            /* Store Parameter for Top MvPred refernce frame Address */
 1203|       |
 1204|  1.19M|            void ** ppv_top_mv_pred_addr = ps_cur_mb_info->ps_curmb->u4_pic_addrress;
 1205|  1.19M|            WORD8 * p1_refTop0 = (ps_cur_mv_pred + 12)->i1_ref_frame;
 1206|  1.19M|            WORD8 * p1_refTop1 = (ps_cur_mv_pred + 14)->i1_ref_frame;
 1207|       |
 1208|       |            /* Store Left addresses for Next Mb   */
 1209|  1.19M|            void ** ppv_left_mv_pred_addr =
 1210|  1.19M|                            ps_dec->ps_left_mvpred_addr[!u1_pingpong][1].u4_add;
 1211|  1.19M|            WORD8 * p1_refleft0 = (ps_cur_mv_pred + 3)->i1_ref_frame;
 1212|       |
 1213|       |
 1214|  1.19M|            ppv_top_mv_pred_addr[0] = apv_map_ref_idx_to_poc[p1_refTop0[0]];
 1215|  1.19M|            ppv_top_mv_pred_addr[1] = pu4_map_ref_idx_to_poc_l1[p1_refTop0[1]];
 1216|       |
 1217|  1.19M|            ppv_left_mv_pred_addr[2] = apv_map_ref_idx_to_poc[p1_refTop1[0]];
 1218|  1.19M|            ppv_top_mv_pred_addr[2] = apv_map_ref_idx_to_poc[p1_refTop1[0]];
 1219|  1.19M|            ppv_left_mv_pred_addr[3] = pu4_map_ref_idx_to_poc_l1[p1_refTop1[1]];
 1220|  1.19M|            ppv_top_mv_pred_addr[3] = pu4_map_ref_idx_to_poc_l1[p1_refTop1[1]];
 1221|       |
 1222|  1.19M|            ppv_left_mv_pred_addr[0] = apv_map_ref_idx_to_poc[p1_refleft0[0]];
 1223|  1.19M|            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.19M|            ps_dec->deblk_left_mb[1].u1_mb_type = ps_cur_mb_params->u1_mb_type;
 1227|  1.19M|        }
 1228|       |
 1229|  1.19M|        return;
 1230|  1.19M|    }
 1231|       |
 1232|       |    /* Flag for extra left Edge */
 1233|  5.12M|    ps_cur_mb_params->u1_single_call = 1;
 1234|       |
 1235|       |    /* Update the Left deblk_mb_t and Left MvPred Parameters           */
 1236|  5.12M|    if(!u2_mbx)
  ------------------
  |  Branch (1236:8): [True: 684k, False: 4.44M]
  ------------------
 1237|   684k|    {
 1238|   684k|        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|   684k|        ps_left_mv_pred = ps_dec->ps_mv_cur + 3;
 1244|   684k|    }
 1245|  4.44M|    else
 1246|  4.44M|    {
 1247|  4.44M|        u4_leftmbtype = ps_dec->deblk_left_mb[1].u1_mb_type;
 1248|       |
 1249|       |        /* Come to Left Most Edge of the MB */
 1250|  4.44M|        ps_left_mv_pred = (u2_mbxn_mb) ?
  ------------------
  |  Branch (1250:27): [True: 4.41M, False: 22.0k]
  ------------------
 1251|  4.41M|                        ps_dec->ps_mv_cur + ((u2_mbxn_mb - 1) << 4) + 3 :
 1252|  4.44M|                        ps_dec->ps_mv_left + 3;
 1253|  4.44M|    }
 1254|       |
 1255|  5.12M|    if(!u2_mby)
  ------------------
  |  Branch (1255:8): [True: 181k, False: 4.94M]
  ------------------
 1256|   181k|        u1_top_mb_typ = 0;
 1257|       |
 1258|       |    /* MvPred Pointer Calculation */
 1259|       |    /* CHANGED CODE */
 1260|  5.12M|    ps_top_mv_pred = ps_cur_mv_pred - (ps_dec->u2_frm_wd_in_mbs << 4) + 12;
 1261|       |
 1262|  5.12M|    u4_cur_mb_intra = u1_cur_mb_type & D_INTRA_MB;
  ------------------
  |  |  382|  5.12M|#define D_INTRA_MB        1
  ------------------
 1263|  5.12M|    u4_cur_mb_fld = !!(u1_cur_mb_type & D_FLD_MB);
  ------------------
  |  |  386|  5.12M|#define D_FLD_MB          0x80
  ------------------
 1264|       |    /* Compute BS function */
 1265|  5.12M|    pu4_bs_table = ps_cur_mb_params->u4_bs_table;
 1266|       |
 1267|  5.12M|    u2_cur_csbp = ps_cur_mb_info->ps_curmb->u2_luma_csbp;
 1268|  5.12M|    u2_left_csbp = ps_cur_mb_info->ps_left_mb->u2_luma_csbp;
 1269|  5.12M|    u2_top_csbp = ps_cur_mb_info->ps_top_mb->u2_luma_csbp;
 1270|       |    /* Compute BS function */
 1271|  5.12M|    if(ps_dec->ps_cur_sps->u1_profile_idc == HIGH_PROFILE_IDC)
  ------------------
  |  |  278|  5.12M|#define HIGH_PROFILE_IDC   100
  ------------------
  |  Branch (1271:8): [True: 1.19M, False: 3.92M]
  ------------------
 1272|  1.19M|    {
 1273|  1.19M|        if(ps_cur_mb_info->u1_tran_form8x8 == 1)
  ------------------
  |  Branch (1273:12): [True: 137k, False: 1.05M]
  ------------------
 1274|   137k|        {
 1275|   137k|            u2_cur_csbp = ih264d_update_csbp_8x8(
 1276|   137k|                            ps_cur_mb_info->ps_curmb->u2_luma_csbp);
 1277|   137k|        }
 1278|       |
 1279|  1.19M|        if(ps_cur_mb_info->ps_left_mb->u1_tran_form8x8 == 1)
  ------------------
  |  Branch (1279:12): [True: 91.4k, False: 1.10M]
  ------------------
 1280|  91.4k|        {
 1281|  91.4k|            u2_left_csbp = ih264d_update_csbp_8x8(
 1282|  91.4k|                            ps_cur_mb_info->ps_left_mb->u2_luma_csbp);
 1283|  91.4k|        }
 1284|       |
 1285|  1.19M|        if(ps_cur_mb_info->ps_top_mb->u1_tran_form8x8 == 1)
  ------------------
  |  Branch (1285:12): [True: 120k, False: 1.07M]
  ------------------
 1286|   120k|        {
 1287|   120k|            u2_top_csbp = ih264d_update_csbp_8x8(
 1288|   120k|                            ps_cur_mb_info->ps_top_mb->u2_luma_csbp);
 1289|   120k|        }
 1290|  1.19M|    }
 1291|  5.12M|    if(u4_cur_mb_intra)
  ------------------
  |  Branch (1291:8): [True: 36.7k, False: 5.08M]
  ------------------
 1292|  36.7k|    {
 1293|       |
 1294|  36.7k|        pu4_bs_table[4] = 0x04040404;
 1295|  36.7k|        pu4_bs_table[0] = u4_cur_mb_fld ? 0x03030303 : 0x04040404;
  ------------------
  |  Branch (1295:27): [True: 0, False: 36.7k]
  ------------------
 1296|  36.7k|        pu4_bs_table[1] = 0x03030303;
 1297|  36.7k|        pu4_bs_table[2] = 0x03030303;
 1298|  36.7k|        pu4_bs_table[3] = 0x03030303;
 1299|  36.7k|        pu4_bs_table[5] = 0x03030303;
 1300|  36.7k|        pu4_bs_table[6] = 0x03030303;
 1301|  36.7k|        pu4_bs_table[7] = 0x03030303;
 1302|  36.7k|    }
 1303|  5.08M|    else
 1304|  5.08M|    {
 1305|  5.08M|        UWORD32 u4_is_non16x16 = !!(u1_cur_mb_type & D_PRED_NON_16x16);
  ------------------
  |  |  383|  5.08M|#define D_PRED_NON_16x16  2
  ------------------
 1306|  5.08M|        UWORD32 u4_is_b = ps_dec->u1_B;
 1307|       |
 1308|  5.08M|        ih264d_fill_bs2_horz_vert(
 1309|  5.08M|                        pu4_bs_table, u2_left_csbp, u2_top_csbp, u2_cur_csbp,
 1310|  5.08M|                        (const UWORD32 *)(gau4_ih264d_packed_bs2),
 1311|  5.08M|                        (const UWORD16 *)(gau2_ih264d_4x4_v2h_reorder));
 1312|       |
 1313|  5.08M|        if(u4_leftmbtype & D_INTRA_MB)
  ------------------
  |  |  382|  5.08M|#define D_INTRA_MB        1
  ------------------
  |  Branch (1313:12): [True: 5.22k, False: 5.08M]
  ------------------
 1314|  5.22k|            pu4_bs_table[4] = 0x04040404;
 1315|       |
 1316|  5.08M|        if(u1_top_mb_typ & D_INTRA_MB)
  ------------------
  |  |  382|  5.08M|#define D_INTRA_MB        1
  ------------------
  |  Branch (1316:12): [True: 25.8k, False: 5.06M]
  ------------------
 1317|  25.8k|            pu4_bs_table[0] = u4_cur_mb_fld ? 0x03030303 : 0x04040404;
  ------------------
  |  Branch (1317:31): [True: 0, False: 25.8k]
  ------------------
 1318|       |
 1319|  5.08M|        ps_dec->pf_fill_bs1[u4_is_b][u4_is_non16x16](
 1320|  5.08M|                        ps_cur_mv_pred, ps_top_mv_pred, apv_map_ref_idx_to_poc,
 1321|  5.08M|                        pu4_bs_table, ps_left_mv_pred,
 1322|  5.08M|                        &(ps_dec->ps_left_mvpred_addr[u1_pingpong][1]),
 1323|  5.08M|                        ps_cur_mb_info->ps_top_mb->u4_pic_addrress,
 1324|  5.08M|                        (4 >> u4_cur_mb_fld));
 1325|  5.08M|    }
 1326|       |
 1327|  5.12M|    {
 1328|  5.12M|        void ** pu4_map_ref_idx_to_poc_l1 = apv_map_ref_idx_to_poc +
 1329|  5.12M|        POC_LIST_L0_TO_L1_DIFF;
  ------------------
  |  |   86|  5.12M|#define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
  |  |  ------------------
  |  |  |  |  600|  5.12M|#define MAX_FRAMES              16
  |  |  ------------------
  ------------------
 1330|  5.12M|        {
 1331|       |            /* Store Parameter for Top MvPred refernce frame Address */
 1332|       |
 1333|  5.12M|            void ** ppv_top_mv_pred_addr = ps_cur_mb_info->ps_curmb->u4_pic_addrress;
 1334|  5.12M|            WORD8 * p1_refTop0 = (ps_cur_mv_pred + 12)->i1_ref_frame;
 1335|  5.12M|            WORD8 * p1_refTop1 = (ps_cur_mv_pred + 14)->i1_ref_frame;
 1336|       |
 1337|       |            /* Store Left addresses for Next Mb   */
 1338|  5.12M|            void ** ppv_left_mv_pred_addr =
 1339|  5.12M|                            ps_dec->ps_left_mvpred_addr[!u1_pingpong][1].u4_add;
 1340|  5.12M|            WORD8 * p1_refleft0 = (ps_cur_mv_pred + 3)->i1_ref_frame;
 1341|       |
 1342|  5.12M|            ppv_top_mv_pred_addr[0] = apv_map_ref_idx_to_poc[p1_refTop0[0]];
 1343|  5.12M|            ppv_top_mv_pred_addr[1] = pu4_map_ref_idx_to_poc_l1[p1_refTop0[1]];
 1344|       |
 1345|  5.12M|            ppv_left_mv_pred_addr[2] = apv_map_ref_idx_to_poc[p1_refTop1[0]];
 1346|  5.12M|            ppv_top_mv_pred_addr[2] = apv_map_ref_idx_to_poc[p1_refTop1[0]];
 1347|  5.12M|            ppv_left_mv_pred_addr[3] = pu4_map_ref_idx_to_poc_l1[p1_refTop1[1]];
 1348|  5.12M|            ppv_top_mv_pred_addr[3] = pu4_map_ref_idx_to_poc_l1[p1_refTop1[1]];
 1349|       |
 1350|  5.12M|            ppv_left_mv_pred_addr[0] = apv_map_ref_idx_to_poc[p1_refleft0[0]];
 1351|  5.12M|            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.12M|            ps_dec->deblk_left_mb[1].u1_mb_type = ps_cur_mb_params->u1_mb_type;
 1355|       |
 1356|  5.12M|        }
 1357|  5.12M|    }
 1358|       |
 1359|       |    /* For transform 8x8 disable deblocking of the intrernal edges of a 8x8 block */
 1360|  5.12M|    if(ps_cur_mb_info->u1_tran_form8x8)
  ------------------
  |  Branch (1360:8): [True: 146k, False: 4.97M]
  ------------------
 1361|   146k|    {
 1362|   146k|        pu4_bs_table[1] = 0;
 1363|   146k|        pu4_bs_table[3] = 0;
 1364|   146k|        pu4_bs_table[5] = 0;
 1365|   146k|        pu4_bs_table[7] = 0;
 1366|   146k|    }
 1367|  5.12M|}

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

ih264d_init_ref_bufs:
   81|   108k|{
   82|   108k|    UWORD32 i;
   83|   108k|    struct dpb_info_t *ps_dpb_info = ps_dpb_mgr->as_dpb_info;
   84|  3.58M|    for(i = 0; i < MAX_REF_BUFS; i++)
  ------------------
  |  |   75|  3.58M|#define MAX_REF_BUFS    32
  ------------------
  |  Branch (84:16): [True: 3.47M, False: 108k]
  ------------------
   85|  3.47M|    {
   86|  3.47M|        ps_dpb_info[i].u1_used_as_ref = UNUSED_FOR_REF;
  ------------------
  |  |  595|  3.47M|#define UNUSED_FOR_REF 0
  ------------------
   87|  3.47M|        ps_dpb_info[i].u1_lt_idx = MAX_REF_BUFS + 1;
  ------------------
  |  |   75|  3.47M|#define MAX_REF_BUFS    32
  ------------------
   88|  3.47M|        ps_dpb_info[i].ps_prev_short = NULL;
   89|  3.47M|        ps_dpb_info[i].ps_prev_long = NULL;
   90|  3.47M|        ps_dpb_info[i].ps_pic_buf = NULL;
   91|  3.47M|        ps_dpb_info[i].s_top_field.u1_reference_info = UNUSED_FOR_REF;
  ------------------
  |  |  595|  3.47M|#define UNUSED_FOR_REF 0
  ------------------
   92|  3.47M|        ps_dpb_info[i].s_bot_field.u1_reference_info = UNUSED_FOR_REF;
  ------------------
  |  |  595|  3.47M|#define UNUSED_FOR_REF 0
  ------------------
   93|  3.47M|        ps_dpb_info[i].s_top_field.u1_long_term_frame_idx = MAX_REF_BUFS + 1;
  ------------------
  |  |   75|  3.47M|#define MAX_REF_BUFS    32
  ------------------
   94|  3.47M|        ps_dpb_info[i].s_bot_field.u1_long_term_frame_idx = MAX_REF_BUFS + 1;
  ------------------
  |  |   75|  3.47M|#define MAX_REF_BUFS    32
  ------------------
   95|       |
   96|  3.47M|    }
   97|   108k|    ps_dpb_mgr->u1_num_st_ref_bufs = ps_dpb_mgr->u1_num_lt_ref_bufs = 0;
   98|   108k|    ps_dpb_mgr->ps_dpb_st_head = NULL;
   99|   108k|    ps_dpb_mgr->ps_dpb_ht_head = NULL;
  100|   108k|    ps_dpb_mgr->i1_gaps_deleted = 0;
  101|   108k|    ps_dpb_mgr->i1_poc_buf_id_entries = 0;
  102|   108k|    ps_dpb_mgr->u1_mmco_error_in_seq = 0;
  103|       |
  104|   108k|    ps_dpb_mgr->u1_num_gaps = 0;
  105|  1.84M|    for(i = 0; i < MAX_FRAMES; i++)
  ------------------
  |  |  600|  1.84M|#define MAX_FRAMES              16
  ------------------
  |  Branch (105:16): [True: 1.73M, False: 108k]
  ------------------
  106|  1.73M|    {
  107|  1.73M|        ps_dpb_mgr->ai4_gaps_start_frm_num[i] = INVALID_FRAME_NUM;
  ------------------
  |  |  601|  1.73M|#define INVALID_FRAME_NUM       0x0fffffff
  ------------------
  108|  1.73M|        ps_dpb_mgr->ai4_gaps_end_frm_num[i] = 0;
  109|  1.73M|        ps_dpb_mgr->ai1_gaps_per_seq[i] = 0;
  110|  1.73M|        ps_dpb_mgr->ai4_poc_buf_id_map[i][0] = -1;
  111|  1.73M|        ps_dpb_mgr->ai4_poc_buf_id_map[i][1] = 0x7fffffff;
  112|  1.73M|        ps_dpb_mgr->ai4_poc_buf_id_map[i][2] = 0;
  113|  1.73M|    }
  114|       |
  115|   108k|}
ih264d_free_ref_pic_mv_bufs:
  118|  84.0k|{
  119|  84.0k|    dec_struct_t *ps_dec = (dec_struct_t *)pv_dec;
  120|       |
  121|  84.0k|    if((pic_buf_id == ps_dec->u1_pic_buf_id) &&
  ------------------
  |  Branch (121:8): [True: 37.5k, False: 46.4k]
  ------------------
  122|  37.5k|                    ps_dec->ps_cur_slice->u1_field_pic_flag &&
  ------------------
  |  Branch (122:21): [True: 0, False: 37.5k]
  ------------------
  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|  84.0k|    ih264_buf_mgr_release((buf_mgr_t *)ps_dec->pv_pic_buf_mgr,
  129|  84.0k|                          pic_buf_id,
  130|  84.0k|                          BUF_MGR_REF);
  ------------------
  |  |   50|  84.0k|#define BUF_MGR_REF          (1 << 2)
  ------------------
  131|  84.0k|    ih264_buf_mgr_release((buf_mgr_t *)ps_dec->pv_mv_buf_mgr,
  132|  84.0k|                          ps_dec->as_buf_id_info_map[pic_buf_id].mv_buf_id,
  133|  84.0k|                          BUF_MGR_REF);
  ------------------
  |  |   50|  84.0k|#define BUF_MGR_REF          (1 << 2)
  ------------------
  134|  84.0k|}
ih264d_delete_lt_node:
  151|  19.3k|{
  152|  19.3k|    *pi4_status = 0;
  153|  19.3k|    if(ps_dpb_mgr->u1_num_lt_ref_bufs > 0)
  ------------------
  |  Branch (153:8): [True: 2.85k, False: 16.4k]
  ------------------
  154|  2.85k|    {
  155|  2.85k|        WORD32 i;
  156|  2.85k|        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.85k|        struct dpb_info_t *ps_unmark_node;
  160|       |        //Find the node with matching LTIndex
  161|  2.85k|        ps_next_dpb = ps_dpb_mgr->ps_dpb_ht_head;
  162|  2.85k|        if(ps_next_dpb->u1_lt_idx == u4_lt_idx)
  ------------------
  |  Branch (162:12): [True: 1.43k, False: 1.42k]
  ------------------
  163|  1.43k|        {
  164|  1.43k|            ps_unmark_node = ps_next_dpb;
  165|  1.43k|        }
  166|  1.42k|        else
  167|  1.42k|        {
  168|  1.86k|            for(i = 1; i < ps_dpb_mgr->u1_num_lt_ref_bufs; i++)
  ------------------
  |  Branch (168:24): [True: 815, False: 1.05k]
  ------------------
  169|    815|            {
  170|    815|                if(ps_next_dpb->ps_prev_long->u1_lt_idx == u4_lt_idx)
  ------------------
  |  Branch (170:20): [True: 373, False: 442]
  ------------------
  171|    373|                    break;
  172|    442|                ps_next_dpb = ps_next_dpb->ps_prev_long;
  173|    442|            }
  174|  1.42k|            if(i == ps_dpb_mgr->u1_num_lt_ref_bufs)
  ------------------
  |  Branch (174:16): [True: 1.05k, False: 373]
  ------------------
  175|  1.05k|                *pi4_status = 1;
  176|    373|            else
  177|    373|                ps_unmark_node = ps_next_dpb->ps_prev_long;
  178|  1.42k|        }
  179|       |
  180|  2.85k|        if(*pi4_status == 0)
  ------------------
  |  Branch (180:12): [True: 1.80k, False: 1.05k]
  ------------------
  181|  1.80k|        {
  182|  1.80k|            if(u1_fld_pic_flag)
  ------------------
  |  Branch (182:16): [True: 0, False: 1.80k]
  ------------------
  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.80k|            else
  224|  1.80k|                ps_unmark_node->u1_used_as_ref = UNUSED_FOR_REF;
  ------------------
  |  |  595|  1.80k|#define UNUSED_FOR_REF 0
  ------------------
  225|       |
  226|  1.80k|            if(UNUSED_FOR_REF == ps_unmark_node->u1_used_as_ref)
  ------------------
  |  |  595|  1.80k|#define UNUSED_FOR_REF 0
  ------------------
  |  Branch (226:16): [True: 1.80k, False: 0]
  ------------------
  227|  1.80k|            {
  228|  1.80k|                if(ps_unmark_node == ps_dpb_mgr->ps_dpb_ht_head)
  ------------------
  |  Branch (228:20): [True: 1.43k, False: 373]
  ------------------
  229|  1.43k|                    ps_dpb_mgr->ps_dpb_ht_head = ps_next_dpb->ps_prev_long;
  230|       |
  231|  1.80k|                ps_unmark_node->u1_lt_idx = MAX_REF_BUFS + 1;
  ------------------
  |  |   75|  1.80k|#define MAX_REF_BUFS    32
  ------------------
  232|  1.80k|                ps_unmark_node->s_top_field.u1_reference_info =
  233|  1.80k|                UNUSED_FOR_REF;
  ------------------
  |  |  595|  1.80k|#define UNUSED_FOR_REF 0
  ------------------
  234|  1.80k|                ps_unmark_node->s_bot_field.u1_reference_info =
  235|  1.80k|                UNUSED_FOR_REF;
  ------------------
  |  |  595|  1.80k|#define UNUSED_FOR_REF 0
  ------------------
  236|       |                // Release the physical buffer
  237|  1.80k|                ih264d_free_ref_pic_mv_bufs(ps_dpb_mgr->pv_codec_handle,
  238|  1.80k|                                            ps_unmark_node->u1_buf_id);
  239|  1.80k|                ps_next_dpb->ps_prev_long = ps_unmark_node->ps_prev_long; //update link
  240|  1.80k|                ps_unmark_node->ps_prev_long = NULL;
  241|  1.80k|                ps_dpb_mgr->u1_num_lt_ref_bufs--; //decrement LT buf count
  242|  1.80k|            }
  243|  1.80k|        }
  244|  2.85k|    }
  245|  19.3k|    return OK;
  ------------------
  |  |  114|  19.3k|#define OK        0
  ------------------
  246|  19.3k|}
ih264d_insert_lt_node:
  263|  17.0k|{
  264|  17.0k|    UWORD8 u1_mark_top_field_long_term = 0;
  265|  17.0k|    UWORD8 u1_mark_bot_field_long_term = 0;
  266|       |
  267|  17.0k|    {
  268|  17.0k|        if(u1_fld_pic_flag)
  ------------------
  |  Branch (268:12): [True: 0, False: 17.0k]
  ------------------
  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.0k|        else
  301|  17.0k|        {
  302|  17.0k|            ps_mov_node->s_top_field.u1_reference_info = IS_LONG_TERM;
  ------------------
  |  |  597|  17.0k|#define IS_LONG_TERM   2
  ------------------
  303|  17.0k|            ps_mov_node->s_bot_field.u1_reference_info = IS_LONG_TERM;
  ------------------
  |  |  597|  17.0k|#define IS_LONG_TERM   2
  ------------------
  304|  17.0k|            ps_mov_node->s_top_field.u1_long_term_frame_idx = u4_lt_idx;
  305|  17.0k|            ps_mov_node->s_bot_field.u1_long_term_frame_idx = u4_lt_idx;
  306|  17.0k|            u1_mark_bot_field_long_term = 1;
  307|  17.0k|            u1_mark_top_field_long_term = 1;
  308|  17.0k|        }
  309|       |
  310|  17.0k|        ps_mov_node->u1_lt_idx = u4_lt_idx; //Assign the LT index to the node
  311|  17.0k|        ps_mov_node->ps_pic_buf->u1_long_term_frm_idx = u4_lt_idx;
  312|  17.0k|        ps_mov_node->u1_used_as_ref = IS_LONG_TERM;
  ------------------
  |  |  597|  17.0k|#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.0k|        if(ps_dpb_mgr->u1_num_lt_ref_bufs > 0)
  ------------------
  |  Branch (316:12): [True: 1.52k, False: 15.5k]
  ------------------
  317|  1.52k|        {
  318|  1.52k|            struct dpb_info_t *ps_next_dpb = ps_dpb_mgr->ps_dpb_ht_head;
  319|  1.52k|            if(u4_lt_idx < ps_next_dpb->u1_lt_idx)
  ------------------
  |  Branch (319:16): [True: 423, False: 1.10k]
  ------------------
  320|    423|            {
  321|       |                //LTIndex to be inserted is the smallest LT index
  322|       |                //Update head and point prev to the next higher index
  323|    423|                ps_mov_node->ps_prev_long = ps_next_dpb;
  324|    423|                ps_dpb_mgr->ps_dpb_ht_head = ps_mov_node;
  325|    423|            }
  326|  1.10k|            else
  327|  1.10k|            {
  328|  1.10k|                WORD32 i;
  329|  1.10k|                struct dpb_info_t *ps_nxtDPB = ps_next_dpb;
  330|  1.10k|                ps_next_dpb = ps_next_dpb->ps_prev_long;
  331|  1.40k|                for(i = 1; i < ps_dpb_mgr->u1_num_lt_ref_bufs; i++)
  ------------------
  |  Branch (331:28): [True: 626, False: 783]
  ------------------
  332|    626|                {
  333|    626|                    if(ps_next_dpb->u1_lt_idx > u4_lt_idx)
  ------------------
  |  Branch (333:24): [True: 321, False: 305]
  ------------------
  334|    321|                        break;
  335|    305|                    ps_nxtDPB = ps_next_dpb;
  336|    305|                    ps_next_dpb = ps_next_dpb->ps_prev_long;
  337|    305|                }
  338|       |
  339|  1.10k|                ps_nxtDPB->ps_prev_long = ps_mov_node;
  340|  1.10k|                ps_mov_node->ps_prev_long = ps_next_dpb;
  341|  1.10k|            }
  342|  1.52k|        }
  343|  15.5k|        else
  344|  15.5k|        {
  345|  15.5k|            ps_dpb_mgr->ps_dpb_ht_head = ps_mov_node;
  346|  15.5k|            ps_mov_node->ps_prev_long = NULL;
  347|  15.5k|        }
  348|       |        /* Identify the picture buffer as a long term picture buffer */
  349|  17.0k|        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.0k|        if(u1_mark_bot_field_long_term)
  ------------------
  |  Branch (354:12): [True: 17.0k, False: 0]
  ------------------
  355|  17.0k|            ps_dpb_mgr->u1_num_lt_ref_bufs++;
  356|       |
  357|  17.0k|    }
  358|  17.0k|    return OK;
  ------------------
  |  |  114|  17.0k|#define OK        0
  ------------------
  359|  17.0k|}
ih264d_insert_st_node:
  379|   108k|{
  380|   108k|    WORD32 i;
  381|   108k|    struct dpb_info_t *ps_dpb_info = ps_dpb_mgr->as_dpb_info;
  382|   108k|    UWORD8 u1_picture_type = ps_pic_buf->u1_picturetype;
  383|       |    /* Find an unused dpb location */
  384|   123k|    for(i = 0; i < MAX_REF_BUFS; i++)
  ------------------
  |  |   75|   123k|#define MAX_REF_BUFS    32
  ------------------
  |  Branch (384:16): [True: 123k, False: 0]
  ------------------
  385|   123k|    {
  386|   123k|        if((ps_dpb_info[i].ps_pic_buf == ps_pic_buf)
  ------------------
  |  Branch (386:12): [True: 821, False: 122k]
  ------------------
  387|    821|                        && ps_dpb_info[i].u1_used_as_ref)
  ------------------
  |  Branch (387:28): [True: 169, False: 652]
  ------------------
  388|    169|        {
  389|       |            /*signal an error in the case of frame pic*/
  390|    169|            if(ps_dpb_info[i].ps_pic_buf->u1_pic_type == FRM_PIC)
  ------------------
  |  |  352|    169|#define FRM_PIC         0x00
  ------------------
  |  Branch (390:16): [True: 169, False: 0]
  ------------------
  391|    169|            {
  392|    169|                return ERROR_DBP_MANAGER_T;
  393|    169|            }
  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|    169|        }
  401|       |
  402|   123k|        if((ps_dpb_info[i].u1_used_as_ref == UNUSED_FOR_REF)
  ------------------
  |  |  595|   123k|#define UNUSED_FOR_REF 0
  ------------------
  |  Branch (402:12): [True: 108k, False: 14.6k]
  ------------------
  403|   108k|                        && (ps_dpb_info[i].s_top_field.u1_reference_info
  ------------------
  |  Branch (403:28): [True: 108k, False: 0]
  ------------------
  404|   108k|                                        == UNUSED_FOR_REF)
  ------------------
  |  |  595|   108k|#define UNUSED_FOR_REF 0
  ------------------
  405|   108k|                        && (ps_dpb_info[i].s_bot_field.u1_reference_info
  ------------------
  |  Branch (405:28): [True: 108k, False: 0]
  ------------------
  406|   108k|                                        == UNUSED_FOR_REF))
  ------------------
  |  |  595|   108k|#define UNUSED_FOR_REF 0
  ------------------
  407|   108k|            break;
  408|   123k|    }
  409|   108k|    if(i == MAX_REF_BUFS)
  ------------------
  |  |   75|   108k|#define MAX_REF_BUFS    32
  ------------------
  |  Branch (409:8): [True: 0, False: 108k]
  ------------------
  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|   108k|    ps_dpb_info[i].ps_pic_buf = ps_pic_buf;
  418|   108k|    ps_dpb_info[i].ps_prev_short = ps_dpb_mgr->ps_dpb_st_head;
  419|   108k|    ps_dpb_info[i].u1_buf_id = u1_buf_id;
  420|   108k|    ps_dpb_info[i].u1_used_as_ref = TRUE;
  ------------------
  |  |  591|   108k|#define TRUE    1
  ------------------
  421|   108k|    ps_dpb_info[i].u1_lt_idx = MAX_REF_BUFS + 1;
  ------------------
  |  |   75|   108k|#define MAX_REF_BUFS    32
  ------------------
  422|   108k|    ps_dpb_info[i].i4_frame_num = u4_cur_pic_num;
  423|   108k|    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|   108k|    ps_dpb_mgr->ps_dpb_st_head = ps_dpb_info + i;
  427|       |
  428|       |    // Increment Short term bufCount
  429|   108k|    ps_dpb_mgr->u1_num_st_ref_bufs++;
  430|       |    /* Identify the picture as a short term picture buffer */
  431|   108k|    ps_pic_buf->u1_is_short = IS_SHORT_TERM;
  ------------------
  |  |  596|   108k|#define IS_SHORT_TERM  1
  ------------------
  432|       |
  433|   108k|    if((u1_picture_type & 0x03) == FRM_PIC)
  ------------------
  |  |  352|   108k|#define FRM_PIC         0x00
  ------------------
  |  Branch (433:8): [True: 108k, False: 0]
  ------------------
  434|   108k|    {
  435|   108k|        ps_dpb_info[i].u1_used_as_ref = IS_SHORT_TERM;
  ------------------
  |  |  596|   108k|#define IS_SHORT_TERM  1
  ------------------
  436|   108k|        ps_dpb_info[i].s_top_field.u1_reference_info = IS_SHORT_TERM;
  ------------------
  |  |  596|   108k|#define IS_SHORT_TERM  1
  ------------------
  437|   108k|        ps_dpb_info[i].s_bot_field.u1_reference_info = IS_SHORT_TERM;
  ------------------
  |  |  596|   108k|#define IS_SHORT_TERM  1
  ------------------
  438|   108k|    }
  439|       |
  440|   108k|    if((u1_picture_type & 0x03) == TOP_FLD)
  ------------------
  |  |  353|   108k|#define TOP_FLD         0x01
  ------------------
  |  Branch (440:8): [True: 0, False: 108k]
  ------------------
  441|      0|        ps_dpb_info[i].s_top_field.u1_reference_info = IS_SHORT_TERM;
  ------------------
  |  |  596|      0|#define IS_SHORT_TERM  1
  ------------------
  442|       |
  443|   108k|    if((u1_picture_type & 0x03) == BOT_FLD)
  ------------------
  |  |  354|   108k|#define BOT_FLD         0x02
  ------------------
  |  Branch (443:8): [True: 0, False: 108k]
  ------------------
  444|      0|        ps_dpb_info[i].s_bot_field.u1_reference_info = IS_SHORT_TERM;
  ------------------
  |  |  596|      0|#define IS_SHORT_TERM  1
  ------------------
  445|       |
  446|   108k|    return OK;
  ------------------
  |  |  114|   108k|#define OK        0
  ------------------
  447|   108k|}
ih264d_delete_st_node_or_make_lt:
  468|  17.6k|{
  469|  17.6k|    WORD32 i;
  470|  17.6k|    struct dpb_info_t *ps_next_dpb;
  471|  17.6k|    WORD32 i4_frame_num = i4_pic_num;
  472|  17.6k|    struct dpb_info_t *ps_unmark_node = NULL;
  473|  17.6k|    UWORD8 u1_del_node = 0, u1_del_st = 0;
  474|  17.6k|    UWORD8 u1_reference_type = UNUSED_FOR_REF;
  ------------------
  |  |  595|  17.6k|#define UNUSED_FOR_REF 0
  ------------------
  475|  17.6k|    WORD32 ret;
  476|       |
  477|  17.6k|    if(u1_fld_pic_flag)
  ------------------
  |  Branch (477:8): [True: 0, False: 17.6k]
  ------------------
  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|  17.6k|    ps_next_dpb = ps_dpb_mgr->ps_dpb_st_head;
  489|  17.6k|    if((WORD32)ps_next_dpb->i4_frame_num == i4_frame_num)
  ------------------
  |  Branch (489:8): [True: 17.1k, False: 519]
  ------------------
  490|  17.1k|    {
  491|  17.1k|        ps_unmark_node = ps_next_dpb;
  492|  17.1k|    }
  493|    519|    else
  494|    519|    {
  495|    798|        for(i = 1; i < ps_dpb_mgr->u1_num_st_ref_bufs; i++)
  ------------------
  |  Branch (495:20): [True: 357, False: 441]
  ------------------
  496|    357|        {
  497|    357|            if((WORD32)ps_next_dpb->ps_prev_short->i4_frame_num == i4_frame_num)
  ------------------
  |  Branch (497:16): [True: 78, False: 279]
  ------------------
  498|     78|                break;
  499|    279|            ps_next_dpb = ps_next_dpb->ps_prev_short;
  500|    279|        }
  501|       |
  502|    519|        if(i == ps_dpb_mgr->u1_num_st_ref_bufs)
  ------------------
  |  Branch (502:12): [True: 441, False: 78]
  ------------------
  503|    441|        {
  504|    441|            if(ps_dpb_mgr->u1_num_gaps)
  ------------------
  |  Branch (504:16): [True: 0, False: 441]
  ------------------
  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|    441|            else
  511|    441|            {
  512|    441|                UWORD32 i4_error_code;
  513|    441|                i4_error_code = ERROR_DBP_MANAGER_T;
  514|       |
  515|    441|                return i4_error_code;
  516|    441|            }
  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|     78|        else
  530|     78|            ps_unmark_node = ps_next_dpb->ps_prev_short;
  531|    519|    }
  532|       |
  533|  17.2k|    if(u1_fld_pic_flag)
  ------------------
  |  Branch (533:8): [True: 0, False: 17.2k]
  ------------------
  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.2k|    else
  573|  17.2k|    {
  574|  17.2k|        ps_unmark_node->u1_used_as_ref = UNUSED_FOR_REF;
  ------------------
  |  |  595|  17.2k|#define UNUSED_FOR_REF 0
  ------------------
  575|  17.2k|        ps_unmark_node->s_top_field.u1_reference_info = UNUSED_FOR_REF;
  ------------------
  |  |  595|  17.2k|#define UNUSED_FOR_REF 0
  ------------------
  576|  17.2k|        ps_unmark_node->s_bot_field.u1_reference_info = UNUSED_FOR_REF;
  ------------------
  |  |  595|  17.2k|#define UNUSED_FOR_REF 0
  ------------------
  577|       |
  578|  17.2k|        {
  579|  17.2k|            UWORD8 *pu1_src = ps_unmark_node->ps_pic_buf->pu1_col_zero_flag;
  580|       |
  581|  17.2k|            WORD32 i4_size = ((ps_dpb_mgr->u2_pic_wd
  582|  17.2k|                            * ps_dpb_mgr->u2_pic_ht) >> 4);
  583|       |            /* memset the colocated zero u4_flag buffer */
  584|  17.2k|            memset(pu1_src, 0, i4_size);
  585|  17.2k|        }
  586|  17.2k|    }
  587|       |
  588|  17.2k|    if(!(ps_unmark_node->u1_used_as_ref & IS_SHORT_TERM))
  ------------------
  |  |  596|  17.2k|#define IS_SHORT_TERM  1
  ------------------
  |  Branch (588:8): [True: 17.2k, False: 0]
  ------------------
  589|  17.2k|    {
  590|  17.2k|        if(ps_unmark_node == ps_dpb_mgr->ps_dpb_st_head)
  ------------------
  |  Branch (590:12): [True: 17.1k, False: 78]
  ------------------
  591|  17.1k|            ps_dpb_mgr->ps_dpb_st_head = ps_next_dpb->ps_prev_short;
  592|     78|        else
  593|     78|            ps_next_dpb->ps_prev_short = ps_unmark_node->ps_prev_short; //update link
  594|  17.2k|        ps_dpb_mgr->u1_num_st_ref_bufs--; //decrement ST buf count
  595|  17.2k|        u1_del_node = 1;
  596|  17.2k|    }
  597|       |
  598|  17.2k|    if(u4_lt_idx == MAX_REF_BUFS + 1)
  ------------------
  |  |   75|  17.2k|#define MAX_REF_BUFS    32
  ------------------
  |  Branch (598:8): [True: 208, False: 17.0k]
  ------------------
  599|    208|    {
  600|    208|        if(u1_del_node)
  ------------------
  |  Branch (600:12): [True: 208, False: 0]
  ------------------
  601|    208|        {
  602|       |            // Release the physical buffer
  603|    208|            ih264d_free_ref_pic_mv_bufs(ps_dpb_mgr->pv_codec_handle,
  604|    208|                                        ps_unmark_node->u1_buf_id);
  605|    208|            ps_unmark_node->ps_prev_short = NULL;
  606|    208|        }
  607|    208|    }
  608|  17.0k|    else
  609|  17.0k|    {
  610|  17.0k|        WORD32 i4_status;
  611|       |        //If another node has the same LT index, delete that node
  612|  17.0k|        ret = ih264d_delete_lt_node(ps_dpb_mgr, u4_lt_idx,
  613|  17.0k|                              u1_fld_pic_flag, ps_unmark_node, &i4_status);
  614|  17.0k|        if(ret != OK)
  ------------------
  |  |  114|  17.0k|#define OK        0
  ------------------
  |  Branch (614:12): [True: 0, False: 17.0k]
  ------------------
  615|      0|            return ret;
  616|       |        // Now insert the short term node as a long term node
  617|  17.0k|        ret = ih264d_insert_lt_node(ps_dpb_mgr, ps_unmark_node, u4_lt_idx,
  618|  17.0k|                              u1_fld_pic_flag);
  619|  17.0k|        if(ret != OK)
  ------------------
  |  |  114|  17.0k|#define OK        0
  ------------------
  |  Branch (619:12): [True: 0, False: 17.0k]
  ------------------
  620|      0|            return ret;
  621|  17.0k|    }
  622|  17.2k|    return OK;
  ------------------
  |  |  114|  17.2k|#define OK        0
  ------------------
  623|  17.2k|}
ih264d_reset_ref_bufs:
  636|   193k|{
  637|   193k|    WORD32 i;
  638|   193k|    struct dpb_info_t *ps_dpb_info = ps_dpb_mgr->as_dpb_info;
  639|       |
  640|  6.39M|    for(i = 0; i < MAX_REF_BUFS; i++)
  ------------------
  |  |   75|  6.39M|#define MAX_REF_BUFS    32
  ------------------
  |  Branch (640:16): [True: 6.20M, False: 193k]
  ------------------
  641|  6.20M|    {
  642|  6.20M|        if(ps_dpb_info[i].u1_used_as_ref)
  ------------------
  |  Branch (642:12): [True: 78.1k, False: 6.12M]
  ------------------
  643|  78.1k|        {
  644|  78.1k|            ps_dpb_info[i].u1_used_as_ref = UNUSED_FOR_REF;
  ------------------
  |  |  595|  78.1k|#define UNUSED_FOR_REF 0
  ------------------
  645|  78.1k|            ps_dpb_info[i].u1_lt_idx = MAX_REF_BUFS + 1;
  ------------------
  |  |   75|  78.1k|#define MAX_REF_BUFS    32
  ------------------
  646|  78.1k|            ps_dpb_info[i].ps_prev_short = NULL;
  647|  78.1k|            ps_dpb_info[i].ps_prev_long = NULL;
  648|  78.1k|            ps_dpb_info[i].ps_pic_buf = NULL;
  649|  78.1k|            ps_dpb_info[i].s_top_field.u1_reference_info = UNUSED_FOR_REF;
  ------------------
  |  |  595|  78.1k|#define UNUSED_FOR_REF 0
  ------------------
  650|  78.1k|            ps_dpb_info[i].s_bot_field.u1_reference_info = UNUSED_FOR_REF;
  ------------------
  |  |  595|  78.1k|#define UNUSED_FOR_REF 0
  ------------------
  651|  78.1k|            ps_dpb_info[i].s_top_field.u1_long_term_frame_idx = MAX_REF_BUFS + 1;
  ------------------
  |  |   75|  78.1k|#define MAX_REF_BUFS    32
  ------------------
  652|  78.1k|            ps_dpb_info[i].s_bot_field.u1_long_term_frame_idx = MAX_REF_BUFS + 1;
  ------------------
  |  |   75|  78.1k|#define MAX_REF_BUFS    32
  ------------------
  653|       |
  654|       |            //Release physical buffer
  655|  78.1k|            ih264d_free_ref_pic_mv_bufs(ps_dpb_mgr->pv_codec_handle,
  656|  78.1k|                                        ps_dpb_info[i].u1_buf_id);
  657|  78.1k|        }
  658|  6.20M|    }
  659|   193k|    ps_dpb_mgr->u1_num_st_ref_bufs = ps_dpb_mgr->u1_num_lt_ref_bufs = 0;
  660|   193k|    ps_dpb_mgr->ps_dpb_st_head = NULL;
  661|   193k|    ps_dpb_mgr->ps_dpb_ht_head = NULL;
  662|   193k|    ps_dpb_mgr->u1_mmco_error_in_seq = 0;
  663|       |
  664|       |    /* release all gaps */
  665|   193k|    ps_dpb_mgr->u1_num_gaps = 0;
  666|  3.29M|    for(i = 0; i < MAX_FRAMES; i++)
  ------------------
  |  |  600|  3.29M|#define MAX_FRAMES              16
  ------------------
  |  Branch (666:16): [True: 3.10M, False: 193k]
  ------------------
  667|  3.10M|    {
  668|  3.10M|        ps_dpb_mgr->ai4_gaps_start_frm_num[i] = INVALID_FRAME_NUM;
  ------------------
  |  |  601|  3.10M|#define INVALID_FRAME_NUM       0x0fffffff
  ------------------
  669|  3.10M|        ps_dpb_mgr->ai4_gaps_end_frm_num[i] = 0;
  670|  3.10M|        ps_dpb_mgr->ai1_gaps_per_seq[i] = 0;
  671|  3.10M|    }
  672|   193k|}
ih264d_update_default_index_list:
  687|   109k|{
  688|   109k|    WORD32 i;
  689|   109k|    struct dpb_info_t *ps_next_dpb = ps_dpb_mgr->ps_dpb_st_head;
  690|       |
  691|   215k|    for(i = 0; i < ps_dpb_mgr->u1_num_st_ref_bufs; i++)
  ------------------
  |  Branch (691:16): [True: 105k, False: 109k]
  ------------------
  692|   105k|    {
  693|   105k|        ps_dpb_mgr->ps_def_dpb[i] = ps_next_dpb->ps_pic_buf;
  694|   105k|        ps_next_dpb = ps_next_dpb->ps_prev_short;
  695|   105k|    }
  696|       |
  697|   109k|    ps_next_dpb = ps_dpb_mgr->ps_dpb_ht_head;
  698|   126k|    for(;i< ps_dpb_mgr->u1_num_st_ref_bufs + ps_dpb_mgr->u1_num_lt_ref_bufs; i++)
  ------------------
  |  Branch (698:10): [True: 17.6k, False: 109k]
  ------------------
  699|  17.6k|    {
  700|  17.6k|        ps_dpb_mgr->ps_def_dpb[i] = ps_next_dpb->ps_pic_buf;
  701|  17.6k|        ps_next_dpb = ps_next_dpb->ps_prev_long;
  702|  17.6k|    }
  703|   109k|    return 0;
  704|   109k|}
ih264d_ref_idx_reordering:
  729|  67.0k|{
  730|  67.0k|    dpb_manager_t *ps_dpb_mgr = ps_dec->ps_dpb_mgr;
  731|  67.0k|    UWORD16 u4_cur_pic_num = ps_dec->ps_cur_slice->u2_frame_num;
  732|       |    /*< Maximum Picture Number Minus 1 */
  733|  67.0k|    UWORD32 ui_max_frame_num =
  734|  67.0k|                    ps_dec->ps_cur_sps->u2_u4_max_pic_num_minus1 + 1;
  735|       |
  736|  67.0k|    WORD32 i, count = 0;
  737|  67.0k|    UWORD32 ui_remapIdc, ui_nextUev;
  738|  67.0k|    WORD16 u2_pred_frame_num = u4_cur_pic_num;
  739|  67.0k|    WORD32 i_temp;
  740|  67.0k|    UWORD16 u2_def_mod_flag = 0; /* Flag to keep track of which indices have been remapped */
  741|  67.0k|    UWORD8 modCount = 0;
  742|  67.0k|    UWORD32 *pu4_bitstrm_buf = ps_dec->ps_bitstrm->pu4_buffer;
  743|  67.0k|    UWORD32 *pu4_bitstrm_ofst = &ps_dec->ps_bitstrm->u4_ofst;
  744|  67.0k|    dec_slice_params_t *ps_cur_slice = ps_dec->ps_cur_slice;
  745|  67.0k|    UWORD8 u1_field_pic_flag = ps_cur_slice->u1_field_pic_flag;
  746|       |
  747|  67.0k|    if(u1_field_pic_flag)
  ------------------
  |  Branch (747:8): [True: 0, False: 67.0k]
  ------------------
  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|  67.0k|    u2_pred_frame_num = u4_cur_pic_num;
  754|       |
  755|  67.0k|    ui_remapIdc = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  756|       |
  757|  68.9k|    while((ui_remapIdc != 3)
  ------------------
  |  Branch (757:11): [True: 67.9k, False: 1.04k]
  ------------------
  758|  67.9k|                    && (count < ps_cur_slice->u1_num_ref_idx_lx_active[uc_lx]))
  ------------------
  |  Branch (758:24): [True: 67.0k, False: 898]
  ------------------
  759|  67.0k|    {
  760|  67.0k|        ui_nextUev = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  761|  67.0k|        if(ui_remapIdc != 2)
  ------------------
  |  Branch (761:12): [True: 62.1k, False: 4.86k]
  ------------------
  762|  62.1k|        {
  763|  62.1k|            if(ui_nextUev > ui_max_frame_num)
  ------------------
  |  Branch (763:16): [True: 3.79k, False: 58.3k]
  ------------------
  764|  3.79k|                return ERROR_DBP_MANAGER_T;
  765|       |
  766|  58.3k|            ui_nextUev = ui_nextUev + 1;
  767|       |
  768|  58.3k|            if(ui_remapIdc == 0)
  ------------------
  |  Branch (768:16): [True: 42.7k, False: 15.5k]
  ------------------
  769|  42.7k|            {
  770|       |                // diffPicNum is -ve
  771|  42.7k|                i_temp = (WORD32)u2_pred_frame_num - (WORD32)ui_nextUev;
  772|  42.7k|                if(i_temp < 0)
  ------------------
  |  Branch (772:20): [True: 7.65k, False: 35.1k]
  ------------------
  773|  7.65k|                    i_temp += ui_max_frame_num;
  774|  42.7k|            }
  775|  15.5k|            else
  776|  15.5k|            {
  777|       |                // diffPicNum is +ve
  778|  15.5k|                i_temp = (WORD32)u2_pred_frame_num + (WORD32)ui_nextUev;
  779|  15.5k|                if(i_temp >= (WORD32)ui_max_frame_num)
  ------------------
  |  Branch (779:20): [True: 2.88k, False: 12.6k]
  ------------------
  780|  2.88k|                    i_temp -= ui_max_frame_num;
  781|  15.5k|            }
  782|       |            /* Find the dpb with the matching picNum (picNum==frameNum for framePic) */
  783|       |
  784|  58.3k|            if(i_temp > u4_cur_pic_num)
  ------------------
  |  Branch (784:16): [True: 19.9k, False: 38.4k]
  ------------------
  785|  19.9k|                i_temp = i_temp - ui_max_frame_num;
  786|       |
  787|   109k|            for(i = 0; i < (ps_cur_slice->u1_initial_list_size[uc_lx]); i++)
  ------------------
  |  Branch (787:24): [True: 52.0k, False: 57.1k]
  ------------------
  788|  52.0k|            {
  789|  52.0k|                if(ps_dpb_mgr->ps_init_dpb[uc_lx][i]->i4_pic_num == i_temp)
  ------------------
  |  Branch (789:20): [True: 1.14k, False: 50.8k]
  ------------------
  790|  1.14k|                    break;
  791|  52.0k|            }
  792|  58.3k|            if(i == (ps_cur_slice->u1_initial_list_size[uc_lx]))
  ------------------
  |  Branch (792:16): [True: 57.1k, False: 1.14k]
  ------------------
  793|  57.1k|            {
  794|  57.1k|                UWORD32 i4_error_code;
  795|  57.1k|                i4_error_code = ERROR_DBP_MANAGER_T;
  796|  57.1k|                return i4_error_code;
  797|  57.1k|            }
  798|       |
  799|  1.14k|            u2_def_mod_flag |= (1 << i);
  800|  1.14k|            ps_dpb_mgr->ps_mod_dpb[uc_lx][modCount++] =
  801|  1.14k|                            ps_dpb_mgr->ps_init_dpb[uc_lx][i];
  802|  1.14k|            u2_pred_frame_num = i_temp; //update predictor to be the picNum just obtained
  803|  1.14k|        }
  804|  4.86k|        else //2
  805|  4.86k|        {
  806|  4.86k|            UWORD8 u1_lt_idx;
  807|       |
  808|  4.86k|            if(ui_nextUev > (MAX_REF_BUFS + 1))
  ------------------
  |  |   75|  4.86k|#define MAX_REF_BUFS    32
  ------------------
  |  Branch (808:16): [True: 406, False: 4.46k]
  ------------------
  809|    406|                return ERROR_DBP_MANAGER_T;
  810|       |
  811|  4.46k|            u1_lt_idx = (UWORD8)ui_nextUev;
  812|       |
  813|  8.61k|            for(i = 0; i < (ps_cur_slice->u1_initial_list_size[uc_lx]); i++)
  ------------------
  |  Branch (813:24): [True: 4.88k, False: 3.73k]
  ------------------
  814|  4.88k|            {
  815|  4.88k|                if(!ps_dpb_mgr->ps_init_dpb[uc_lx][i]->u1_is_short)
  ------------------
  |  Branch (815:20): [True: 1.08k, False: 3.79k]
  ------------------
  816|  1.08k|                {
  817|  1.08k|                    if(ps_dpb_mgr->ps_init_dpb[uc_lx][i]->u1_long_term_pic_num
  ------------------
  |  Branch (817:24): [True: 731, False: 357]
  ------------------
  818|  1.08k|                                    == u1_lt_idx)
  819|    731|                        break;
  820|  1.08k|                }
  821|  4.88k|            }
  822|  4.46k|            if(i == (ps_cur_slice->u1_initial_list_size[uc_lx]))
  ------------------
  |  Branch (822:16): [True: 3.73k, False: 731]
  ------------------
  823|  3.73k|            {
  824|  3.73k|                UWORD32 i4_error_code;
  825|  3.73k|                i4_error_code = ERROR_DBP_MANAGER_T;
  826|  3.73k|                return i4_error_code;
  827|  3.73k|            }
  828|       |
  829|    731|            u2_def_mod_flag |= (1 << i);
  830|    731|            ps_dpb_mgr->ps_mod_dpb[uc_lx][modCount++] =
  831|    731|                            ps_dpb_mgr->ps_init_dpb[uc_lx][i];
  832|    731|        }
  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|  6.49k|    for(i = 0; i < (ps_cur_slice->u1_num_ref_idx_lx_active[uc_lx]); i++)
  ------------------
  |  Branch (840:16): [True: 4.55k, False: 1.94k]
  ------------------
  841|  4.55k|    {
  842|  4.55k|        if(!(u2_def_mod_flag & (1 << i)))
  ------------------
  |  Branch (842:12): [True: 3.64k, False: 902]
  ------------------
  843|  3.64k|            ps_dpb_mgr->ps_mod_dpb[uc_lx][modCount++] =
  844|  3.64k|                            ps_dpb_mgr->ps_init_dpb[uc_lx][i];
  845|  4.55k|    }
  846|  1.94k|    return OK;
  ------------------
  |  |  114|  1.94k|#define OK        0
  ------------------
  847|  67.0k|}
ih264d_read_mmco_commands:
  866|   134k|{
  867|   134k|    dec_pic_params_t *ps_pps = ps_dec->ps_cur_pps;
  868|   134k|    dec_seq_params_t *ps_sps = ps_pps->ps_sps;
  869|   134k|    dec_bit_stream_t *ps_bitstrm = ps_dec->ps_bitstrm;
  870|   134k|    dpb_commands_t *ps_dpb_cmds = &(ps_dec->s_dpb_cmds_scratch);
  871|   134k|    dec_slice_params_t * ps_slice = ps_dec->ps_cur_slice;
  872|   134k|    WORD32 j;
  873|   134k|    UWORD8 u1_buf_mode;
  874|   134k|    struct MMCParams *ps_mmc_params;
  875|   134k|    UWORD32 *pu4_bitstrm_buf = ps_dec->ps_bitstrm->pu4_buffer;
  876|   134k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
  877|   134k|    UWORD32 u4_bit_ofst = ps_dec->ps_bitstrm->u4_ofst;
  878|       |
  879|   134k|    ps_slice->u1_mmco_equalto5 = 0;
  880|   134k|    {
  881|   134k|        if(ps_dec->u1_nal_unit_type == IDR_SLICE_NAL)
  ------------------
  |  |  328|   134k|#define IDR_SLICE_NAL                   5
  ------------------
  |  Branch (881:12): [True: 118k, False: 16.2k]
  ------------------
  882|   118k|        {
  883|   118k|            ps_slice->u1_no_output_of_prior_pics_flag =
  884|   118k|                            ih264d_get_bit_h264(ps_bitstrm);
  885|   118k|            COPYTHECONTEXT("SH: no_output_of_prior_pics_flag",
  886|   118k|                            ps_slice->u1_no_output_of_prior_pics_flag);
  887|   118k|            ps_slice->u1_long_term_reference_flag = ih264d_get_bit_h264(
  888|   118k|                            ps_bitstrm);
  889|   118k|            COPYTHECONTEXT("SH: long_term_reference_flag",
  890|   118k|                            ps_slice->u1_long_term_reference_flag);
  891|   118k|            ps_dpb_cmds->u1_idr_pic = 1;
  892|   118k|            ps_dpb_cmds->u1_no_output_of_prior_pics_flag =
  893|   118k|                            ps_slice->u1_no_output_of_prior_pics_flag;
  894|   118k|            ps_dpb_cmds->u1_long_term_reference_flag =
  895|   118k|                            ps_slice->u1_long_term_reference_flag;
  896|   118k|        }
  897|  16.2k|        else
  898|  16.2k|        {
  899|  16.2k|            u1_buf_mode = ih264d_get_bit_h264(ps_bitstrm); //0 - sliding window; 1 - arbitrary
  900|  16.2k|            COPYTHECONTEXT("SH: adaptive_ref_pic_buffering_flag", u1_buf_mode);
  901|  16.2k|            ps_dpb_cmds->u1_buf_mode = u1_buf_mode;
  902|  16.2k|            j = 0;
  903|       |
  904|  16.2k|            if(u1_buf_mode == 1)
  ------------------
  |  Branch (904:16): [True: 8.25k, False: 7.99k]
  ------------------
  905|  8.25k|            {
  906|  8.25k|                UWORD32 u4_mmco;
  907|  8.25k|                UWORD32 u4_diff_pic_num;
  908|  8.25k|                UWORD32 u4_lt_idx, u4_max_lt_idx_plus1;
  909|       |
  910|  8.25k|                u4_mmco = ih264d_uev(pu4_bitstrm_ofst,
  911|  8.25k|                                     pu4_bitstrm_buf);
  912|  56.0k|                while(u4_mmco != END_OF_MMCO)
  ------------------
  |  |   43|  56.0k|#define END_OF_MMCO                 0
  ------------------
  |  Branch (912:23): [True: 48.7k, False: 7.31k]
  ------------------
  913|  48.7k|                {
  914|  48.7k|                    if (j >= MAX_REF_BUFS)
  ------------------
  |  |   75|  48.7k|#define MAX_REF_BUFS    32
  ------------------
  |  Branch (914:25): [True: 734, False: 48.0k]
  ------------------
  915|    734|                    {
  916|       |#ifdef __ANDROID__
  917|       |                        ALOGE("b/25818142");
  918|       |                        android_errorWriteLog(0x534e4554, "25818142");
  919|       |#endif
  920|    734|                        ps_dpb_cmds->u1_num_of_commands = 0;
  921|    734|                        return -1;
  922|    734|                    }
  923|  48.0k|                    ps_mmc_params = &ps_dpb_cmds->as_mmc_params[j];
  924|  48.0k|                    ps_mmc_params->u4_mmco = u4_mmco;
  925|  48.0k|                    switch(u4_mmco)
  926|  48.0k|                    {
  927|  3.61k|                        case MARK_ST_PICNUM_AS_NONREF:
  ------------------
  |  |   44|  3.61k|#define MARK_ST_PICNUM_AS_NONREF    1
  ------------------
  |  Branch (927:25): [True: 3.61k, False: 44.3k]
  ------------------
  928|  3.61k|                            u4_diff_pic_num = ih264d_uev(pu4_bitstrm_ofst,
  929|  3.61k|                                                         pu4_bitstrm_buf);
  930|       |                            //Get absDiffPicnumMinus1
  931|  3.61k|                            ps_mmc_params->u4_diff_pic_num = u4_diff_pic_num;
  932|  3.61k|                            break;
  933|       |
  934|  2.84k|                        case MARK_LT_INDEX_AS_NONREF:
  ------------------
  |  |   45|  2.84k|#define MARK_LT_INDEX_AS_NONREF     2
  ------------------
  |  Branch (934:25): [True: 2.84k, False: 45.1k]
  ------------------
  935|  2.84k|                            u4_lt_idx = ih264d_uev(pu4_bitstrm_ofst,
  936|  2.84k|                                                   pu4_bitstrm_buf);
  937|  2.84k|                            ps_mmc_params->u4_lt_idx = u4_lt_idx;
  938|  2.84k|                            break;
  939|       |
  940|  1.69k|                        case MARK_ST_PICNUM_AS_LT_INDEX:
  ------------------
  |  |   46|  1.69k|#define MARK_ST_PICNUM_AS_LT_INDEX  3
  ------------------
  |  Branch (940:25): [True: 1.69k, False: 46.3k]
  ------------------
  941|  1.69k|                            u4_diff_pic_num = ih264d_uev(pu4_bitstrm_ofst,
  942|  1.69k|                                                         pu4_bitstrm_buf);
  943|  1.69k|                            ps_mmc_params->u4_diff_pic_num = u4_diff_pic_num;
  944|  1.69k|                            u4_lt_idx = ih264d_uev(pu4_bitstrm_ofst,
  945|  1.69k|                                                   pu4_bitstrm_buf);
  946|  1.69k|                            ps_mmc_params->u4_lt_idx = u4_lt_idx;
  947|  1.69k|                            break;
  948|       |
  949|  3.87k|                        case SET_MAX_LT_INDEX:
  ------------------
  |  |   47|  3.87k|#define SET_MAX_LT_INDEX            4
  ------------------
  |  Branch (949:25): [True: 3.87k, False: 44.1k]
  ------------------
  950|  3.87k|                        {
  951|  3.87k|                            u4_max_lt_idx_plus1 = ih264d_uev(pu4_bitstrm_ofst,
  952|  3.87k|                                                             pu4_bitstrm_buf);
  953|  3.87k|                            if (u4_max_lt_idx_plus1 > ps_sps->u1_num_ref_frames)
  ------------------
  |  Branch (953:33): [True: 203, False: 3.67k]
  ------------------
  954|    203|                            {
  955|       |                                /* Invalid max LT ref index */
  956|    203|                                return -1;
  957|    203|                            }
  958|  3.67k|                            ps_mmc_params->u4_max_lt_idx_plus1 = u4_max_lt_idx_plus1;
  959|  3.67k|                            break;
  960|  3.87k|                        }
  961|  2.67k|                        case RESET_REF_PICTURES:
  ------------------
  |  |   48|  2.67k|#define RESET_REF_PICTURES          5
  ------------------
  |  Branch (961:25): [True: 2.67k, False: 45.3k]
  ------------------
  962|  2.67k|                        {
  963|  2.67k|                            ps_slice->u1_mmco_equalto5 = 1;
  964|  2.67k|                            break;
  965|  3.87k|                        }
  966|       |
  967|  1.86k|                        case SET_LT_INDEX:
  ------------------
  |  |   49|  1.86k|#define SET_LT_INDEX                6
  ------------------
  |  Branch (967:25): [True: 1.86k, False: 46.1k]
  ------------------
  968|  1.86k|                            u4_lt_idx = ih264d_uev(pu4_bitstrm_ofst,
  969|  1.86k|                                                   pu4_bitstrm_buf);
  970|  1.86k|                            ps_mmc_params->u4_lt_idx = u4_lt_idx;
  971|  1.86k|                            break;
  972|       |
  973|  31.4k|                        default:
  ------------------
  |  Branch (973:25): [True: 31.4k, False: 16.5k]
  ------------------
  974|  31.4k|                            break;
  975|  48.0k|                    }
  976|  47.7k|                    u4_mmco = ih264d_uev(pu4_bitstrm_ofst,
  977|  47.7k|                                         pu4_bitstrm_buf);
  978|       |
  979|  47.7k|                    j++;
  980|  47.7k|                }
  981|  7.31k|                ps_dpb_cmds->u1_num_of_commands = j;
  982|  7.31k|            }
  983|  16.2k|        }
  984|   133k|        ps_dpb_cmds->u1_dpb_commands_read = 1;
  985|   133k|        ps_dpb_cmds->u1_dpb_commands_read_slc = 1;
  986|       |
  987|   133k|    }
  988|      0|    u4_bit_ofst = ps_dec->ps_bitstrm->u4_ofst - u4_bit_ofst;
  989|   133k|    return u4_bit_ofst;
  990|   134k|}
ih264d_do_mmco_buffer:
 1017|  11.3k|{
 1018|  11.3k|    WORD32 i;
 1019|  11.3k|    UWORD8 u1_buf_mode, u1_marked_lt;
 1020|  11.3k|    struct dpb_info_t *ps_next_dpb;
 1021|  11.3k|    UWORD8 u1_num_gaps;
 1022|  11.3k|    UWORD8 u1_del_node = 1;
 1023|  11.3k|    UWORD8 u1_insert_st_pic = 1;
 1024|  11.3k|    WORD32 ret;
 1025|  11.3k|    UNUSED(u1_nal_unit_type);
  ------------------
  |  |   45|  11.3k|#define UNUSED(x) ((void)(x))
  ------------------
 1026|  11.3k|    UNUSED(u2_u4_max_pic_num_minus1);
  ------------------
  |  |   45|  11.3k|#define UNUSED(x) ((void)(x))
  ------------------
 1027|  11.3k|    u1_buf_mode = ps_dpb_cmds->u1_buf_mode; //0 - sliding window; 1 - Adaptive
 1028|  11.3k|    u1_marked_lt = 0;
 1029|  11.3k|    u1_num_gaps = ps_dpb_mgr->u1_num_gaps;
 1030|       |
 1031|  11.3k|    if(!u1_buf_mode)
  ------------------
  |  Branch (1031:8): [True: 6.79k, False: 4.53k]
  ------------------
 1032|  6.79k|    {
 1033|       |        //Sliding window - implements 8.2.5.3
 1034|  6.79k|        if((ps_dpb_mgr->u1_num_st_ref_bufs
  ------------------
  |  Branch (1034:12): [True: 2.96k, False: 3.83k]
  ------------------
 1035|  6.79k|                        + ps_dpb_mgr->u1_num_lt_ref_bufs + u1_num_gaps)
 1036|  6.79k|                        == u1_numRef_frames_for_seq)
 1037|  2.96k|        {
 1038|  2.96k|            UWORD8 u1_new_node_flag = 1;
 1039|  2.96k|            if((0 == ps_dpb_mgr->u1_num_st_ref_bufs) && (0 == u1_num_gaps))
  ------------------
  |  Branch (1039:16): [True: 274, False: 2.69k]
  |  Branch (1039:57): [True: 274, False: 0]
  ------------------
 1040|    274|            {
 1041|    274|                UWORD32 i4_error_code;
 1042|    274|                i4_error_code = ERROR_DBP_MANAGER_T;
 1043|    274|                return i4_error_code;
 1044|    274|            }
 1045|       |
 1046|       |            // Chase the links to reach the last but one picNum, if available
 1047|  2.69k|            ps_next_dpb = ps_dpb_mgr->ps_dpb_st_head;
 1048|       |
 1049|  2.69k|            if(ps_dpb_mgr->u1_num_st_ref_bufs > 1)
  ------------------
  |  Branch (1049:16): [True: 846, False: 1.84k]
  ------------------
 1050|    846|            {
 1051|    846|                if(ps_next_dpb->i4_frame_num == (WORD32)u4_cur_pic_num)
  ------------------
  |  Branch (1051:20): [True: 87, False: 759]
  ------------------
 1052|     87|                {
 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|     87|                    u1_new_node_flag = 0;
 1058|     87|                }
 1059|       |
 1060|  1.61k|                for(i = 1; i < (ps_dpb_mgr->u1_num_st_ref_bufs - 1); i++)
  ------------------
  |  Branch (1060:28): [True: 770, False: 846]
  ------------------
 1061|    770|                {
 1062|    770|                    if(ps_next_dpb == NULL)
  ------------------
  |  Branch (1062:24): [True: 0, False: 770]
  ------------------
 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|    770|                    if(ps_next_dpb->i4_frame_num == (WORD32)u4_cur_pic_num)
  ------------------
  |  Branch (1068:24): [True: 175, False: 595]
  ------------------
 1069|    175|                    {
 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|    175|                        u1_new_node_flag = 0;
 1075|    175|                    }
 1076|    770|                    ps_next_dpb = ps_next_dpb->ps_prev_short;
 1077|    770|                }
 1078|       |
 1079|    846|                if(ps_next_dpb->ps_prev_short->ps_prev_short != NULL)
  ------------------
  |  Branch (1079:20): [True: 34, False: 812]
  ------------------
 1080|     34|                {
 1081|     34|                    UWORD32 i4_error_code;
 1082|     34|                    i4_error_code = ERROR_DBP_MANAGER_T;
 1083|     34|                    return i4_error_code;
 1084|     34|                }
 1085|       |
 1086|    812|                if(u1_new_node_flag)
  ------------------
  |  Branch (1086:20): [True: 704, False: 108]
  ------------------
 1087|    704|                {
 1088|    704|                    if(u1_num_gaps)
  ------------------
  |  Branch (1088:24): [True: 0, False: 704]
  ------------------
 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|    704|                    if(u1_del_node)
  ------------------
  |  Branch (1097:24): [True: 704, False: 0]
  ------------------
 1098|    704|                    {
 1099|    704|                        ps_dpb_mgr->u1_num_st_ref_bufs--;
 1100|    704|                        ps_next_dpb->ps_prev_short->u1_used_as_ref =
 1101|    704|                                        UNUSED_FOR_REF;
  ------------------
  |  |  595|    704|#define UNUSED_FOR_REF 0
  ------------------
 1102|    704|                        ps_next_dpb->ps_prev_short->s_top_field.u1_reference_info =
 1103|    704|                                        UNUSED_FOR_REF;
  ------------------
  |  |  595|    704|#define UNUSED_FOR_REF 0
  ------------------
 1104|    704|                        ps_next_dpb->ps_prev_short->s_bot_field.u1_reference_info =
 1105|    704|                                        UNUSED_FOR_REF;
  ------------------
  |  |  595|    704|#define UNUSED_FOR_REF 0
  ------------------
 1106|    704|                        ih264d_free_ref_pic_mv_bufs(ps_dpb_mgr->pv_codec_handle,
 1107|    704|                                                    ps_next_dpb->ps_prev_short->u1_buf_id);
 1108|    704|                        ps_next_dpb->ps_prev_short->ps_pic_buf = NULL;
 1109|    704|                        ps_next_dpb->ps_prev_short = NULL;
 1110|    704|                    }
 1111|    704|                }
 1112|    812|            }
 1113|  1.84k|            else
 1114|  1.84k|            {
 1115|  1.84k|                if(ps_dpb_mgr->u1_num_st_ref_bufs)
  ------------------
  |  Branch (1115:20): [True: 1.84k, False: 0]
  ------------------
 1116|  1.84k|                {
 1117|  1.84k|                    ret = ih264d_delete_gap_frm_sliding(ps_dpb_mgr,
 1118|  1.84k|                                                       ps_next_dpb->i4_frame_num,
 1119|  1.84k|                                                       &u1_del_node);
 1120|  1.84k|                    if(ret != OK)
  ------------------
  |  |  114|  1.84k|#define OK        0
  ------------------
  |  Branch (1120:24): [True: 0, False: 1.84k]
  ------------------
 1121|      0|                        return ret;
 1122|  1.84k|                    if((ps_next_dpb->i4_frame_num != (WORD32)u4_cur_pic_num)
  ------------------
  |  Branch (1122:24): [True: 486, False: 1.35k]
  ------------------
 1123|    486|                                    && u1_del_node)
  ------------------
  |  Branch (1123:40): [True: 486, False: 0]
  ------------------
 1124|    486|                    {
 1125|    486|                        ps_dpb_mgr->u1_num_st_ref_bufs--;
 1126|    486|                        ps_next_dpb->u1_used_as_ref = FALSE;
  ------------------
  |  |  592|    486|#define FALSE   0
  ------------------
 1127|    486|                        ps_next_dpb->s_top_field.u1_reference_info =
 1128|    486|                                        UNUSED_FOR_REF;
  ------------------
  |  |  595|    486|#define UNUSED_FOR_REF 0
  ------------------
 1129|    486|                        ps_next_dpb->s_bot_field.u1_reference_info =
 1130|    486|                                        UNUSED_FOR_REF;
  ------------------
  |  |  595|    486|#define UNUSED_FOR_REF 0
  ------------------
 1131|    486|                        ih264d_free_ref_pic_mv_bufs(ps_dpb_mgr->pv_codec_handle,
 1132|    486|                                                    ps_next_dpb->u1_buf_id);
 1133|    486|                        ps_next_dpb->ps_pic_buf = NULL;
 1134|    486|                        ps_next_dpb->ps_prev_short = NULL;
 1135|    486|                        ps_dpb_mgr->ps_dpb_st_head = NULL;
 1136|    486|                        ps_next_dpb = NULL;
 1137|    486|                    }
 1138|  1.35k|                    else if(ps_next_dpb->i4_frame_num == (WORD32)u4_cur_pic_num)
  ------------------
  |  Branch (1138:29): [True: 1.35k, False: 0]
  ------------------
 1139|  1.35k|                    {
 1140|  1.35k|                        if(u1_curr_pic_in_err)
  ------------------
  |  Branch (1140:28): [True: 0, False: 1.35k]
  ------------------
 1141|      0|                        {
 1142|      0|                            u1_insert_st_pic = 0;
 1143|      0|                        }
 1144|  1.35k|                        else if(ps_dpb_mgr->u1_num_st_ref_bufs > 0)
  ------------------
  |  Branch (1144:33): [True: 1.35k, False: 0]
  ------------------
 1145|  1.35k|                        {
 1146|  1.35k|                            ps_dpb_mgr->u1_num_st_ref_bufs--;
 1147|  1.35k|                            ps_next_dpb->u1_used_as_ref = FALSE;
  ------------------
  |  |  592|  1.35k|#define FALSE   0
  ------------------
 1148|  1.35k|                            ps_next_dpb->s_top_field.u1_reference_info =
 1149|  1.35k|                                            UNUSED_FOR_REF;
  ------------------
  |  |  595|  1.35k|#define UNUSED_FOR_REF 0
  ------------------
 1150|  1.35k|                            ps_next_dpb->s_bot_field.u1_reference_info =
 1151|  1.35k|                                            UNUSED_FOR_REF;
  ------------------
  |  |  595|  1.35k|#define UNUSED_FOR_REF 0
  ------------------
 1152|  1.35k|                            ih264d_free_ref_pic_mv_bufs(ps_dpb_mgr->pv_codec_handle,
 1153|  1.35k|                                                        ps_next_dpb->u1_buf_id);
 1154|  1.35k|                            ps_next_dpb->ps_pic_buf = NULL;
 1155|  1.35k|                            ps_next_dpb = NULL;
 1156|  1.35k|                        }
 1157|  1.35k|                    }
 1158|  1.84k|                }
 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.84k|            }
 1174|  2.69k|        }
 1175|  6.79k|    }
 1176|  4.53k|    else
 1177|  4.53k|    {
 1178|       |        //Adaptive memory control - implements 8.2.5.4
 1179|  4.53k|        UWORD32 u4_mmco;
 1180|  4.53k|        UWORD32 u4_diff_pic_num;
 1181|  4.53k|        WORD32 i4_pic_num;
 1182|  4.53k|        UWORD32 u4_lt_idx;
 1183|  4.53k|        WORD32 j;
 1184|  4.53k|        struct MMCParams *ps_mmc_params;
 1185|       |
 1186|  33.0k|        for(j = 0; j < ps_dpb_cmds->u1_num_of_commands; j++)
  ------------------
  |  Branch (1186:20): [True: 29.9k, False: 3.14k]
  ------------------
 1187|  29.9k|        {
 1188|  29.9k|            ps_mmc_params = &ps_dpb_cmds->as_mmc_params[j];
 1189|  29.9k|            u4_mmco = ps_mmc_params->u4_mmco; //Get MMCO
 1190|       |
 1191|  29.9k|            switch(u4_mmco)
 1192|  29.9k|            {
 1193|  2.34k|                case MARK_ST_PICNUM_AS_NONREF:
  ------------------
  |  |   44|  2.34k|#define MARK_ST_PICNUM_AS_NONREF    1
  ------------------
  |  Branch (1193:17): [True: 2.34k, False: 27.5k]
  ------------------
 1194|  2.34k|                {
 1195|       |
 1196|  2.34k|                    {
 1197|  2.34k|                        UWORD32 i4_cur_pic_num = u4_cur_pic_num;
 1198|  2.34k|                        WORD64 i8_pic_num;
 1199|  2.34k|                        u4_diff_pic_num = ps_mmc_params->u4_diff_pic_num; //Get absDiffPicnumMinus1
 1200|  2.34k|                        if(u1_fld_pic_flag)
  ------------------
  |  Branch (1200:28): [True: 0, False: 2.34k]
  ------------------
 1201|      0|                            i4_cur_pic_num = i4_cur_pic_num * 2 + 1;
 1202|  2.34k|                        i8_pic_num = ((WORD64)i4_cur_pic_num - ((WORD64)u4_diff_pic_num + 1));
 1203|  2.34k|                        if(IS_OUT_OF_RANGE_S32(i8_pic_num))
  ------------------
  |  |   58|  2.34k|#define IS_OUT_OF_RANGE_S32(a) (((a) < INT32_MIN) || ((a) > INT32_MAX))
  |  |  ------------------
  |  |  |  Branch (58:33): [True: 159, False: 2.19k]
  |  |  |  Branch (58:54): [True: 0, False: 2.19k]
  |  |  ------------------
  ------------------
 1204|    159|                        {
 1205|    159|                            return ERROR_DBP_MANAGER_T;
 1206|    159|                        }
 1207|  2.19k|                        i4_pic_num = i8_pic_num;
 1208|  2.19k|                    }
 1209|       |
 1210|  2.19k|                    if(ps_dpb_mgr->u1_num_st_ref_bufs > 0)
  ------------------
  |  Branch (1210:24): [True: 563, False: 1.62k]
  ------------------
 1211|    563|                    {
 1212|    563|                        ret = ih264d_delete_st_node_or_make_lt(ps_dpb_mgr,
 1213|    563|                                                               i4_pic_num,
 1214|    563|                                                               MAX_REF_BUFS + 1,
  ------------------
  |  |   75|    563|#define MAX_REF_BUFS    32
  ------------------
 1215|    563|                                                               u1_fld_pic_flag);
 1216|    563|                        if(ret != OK)
  ------------------
  |  |  114|    563|#define OK        0
  ------------------
  |  Branch (1216:28): [True: 355, False: 208]
  ------------------
 1217|    355|                            return ret;
 1218|    563|                    }
 1219|  1.62k|                    else
 1220|  1.62k|                    {
 1221|  1.62k|                        UWORD8 u1_dummy;
 1222|  1.62k|                        ret = ih264d_delete_gap_frm_mmco(ps_dpb_mgr, i4_pic_num, &u1_dummy);
 1223|  1.62k|                        if(ret != OK)
  ------------------
  |  |  114|  1.62k|#define OK        0
  ------------------
  |  Branch (1223:28): [True: 0, False: 1.62k]
  ------------------
 1224|      0|                            return ret;
 1225|  1.62k|                    }
 1226|  1.83k|                    break;
 1227|  2.19k|                }
 1228|  2.30k|                case MARK_LT_INDEX_AS_NONREF:
  ------------------
  |  |   45|  2.30k|#define MARK_LT_INDEX_AS_NONREF     2
  ------------------
  |  Branch (1228:17): [True: 2.30k, False: 27.6k]
  ------------------
 1229|  2.30k|                {
 1230|  2.30k|                    WORD32 i4_status;
 1231|  2.30k|                    u4_lt_idx = ps_mmc_params->u4_lt_idx; //Get long term index
 1232|  2.30k|                    ret = ih264d_delete_lt_node(ps_dpb_mgr,
 1233|  2.30k|                                                u4_lt_idx,
 1234|  2.30k|                                                u1_fld_pic_flag,
 1235|  2.30k|                                                0, &i4_status);
 1236|  2.30k|                    if(ret != OK)
  ------------------
  |  |  114|  2.30k|#define OK        0
  ------------------
  |  Branch (1236:24): [True: 0, False: 2.30k]
  ------------------
 1237|      0|                        return ret;
 1238|  2.30k|                    if(i4_status)
  ------------------
  |  Branch (1238:24): [True: 118, False: 2.18k]
  ------------------
 1239|    118|                    {
 1240|    118|                        UWORD32 i4_error_code;
 1241|    118|                        i4_error_code = ERROR_DBP_MANAGER_T;
 1242|    118|                        return i4_error_code;
 1243|    118|                    }
 1244|  2.18k|                    break;
 1245|  2.30k|                }
 1246|       |
 1247|  2.18k|                case MARK_ST_PICNUM_AS_LT_INDEX:
  ------------------
  |  |   46|  1.40k|#define MARK_ST_PICNUM_AS_LT_INDEX  3
  ------------------
  |  Branch (1247:17): [True: 1.40k, False: 28.5k]
  ------------------
 1248|  1.40k|                {
 1249|  1.40k|                    {
 1250|  1.40k|                        UWORD32 i4_cur_pic_num = u4_cur_pic_num;
 1251|  1.40k|                        WORD64 i8_pic_num;
 1252|  1.40k|                        u4_diff_pic_num = ps_mmc_params->u4_diff_pic_num; //Get absDiffPicnumMinus1
 1253|  1.40k|                        if(u1_fld_pic_flag)
  ------------------
  |  Branch (1253:28): [True: 0, False: 1.40k]
  ------------------
 1254|      0|                            i4_cur_pic_num = i4_cur_pic_num * 2 + 1;
 1255|       |
 1256|  1.40k|                        i8_pic_num = (WORD64)i4_cur_pic_num - ((WORD64)u4_diff_pic_num + 1);
 1257|  1.40k|                        if(IS_OUT_OF_RANGE_S32(i8_pic_num))
  ------------------
  |  |   58|  1.40k|#define IS_OUT_OF_RANGE_S32(a) (((a) < INT32_MIN) || ((a) > INT32_MAX))
  |  |  ------------------
  |  |  |  Branch (58:33): [True: 85, False: 1.31k]
  |  |  |  Branch (58:54): [True: 0, False: 1.31k]
  |  |  ------------------
  ------------------
 1258|     85|                        {
 1259|     85|                            return ERROR_DBP_MANAGER_T;
 1260|     85|                        }
 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: 211, False: 1.10k]
  ------------------
 1267|  1.10k|                        (u4_lt_idx > ps_dpb_mgr->u1_max_lt_frame_idx))
  ------------------
  |  Branch (1267:25): [True: 82, False: 1.02k]
  ------------------
 1268|    293|                    {
 1269|    293|                        return ERROR_DBP_MANAGER_T;
 1270|    293|                    }
 1271|       |
 1272|  1.02k|                    if(ps_dpb_mgr->u1_num_st_ref_bufs > 0)
  ------------------
  |  Branch (1272:24): [True: 261, False: 763]
  ------------------
 1273|    261|                    {
 1274|    261|                        ret = ih264d_delete_st_node_or_make_lt(ps_dpb_mgr,
 1275|    261|                                                               i4_pic_num, u4_lt_idx,
 1276|    261|                                                               u1_fld_pic_flag);
 1277|    261|                        if(ret != OK)
  ------------------
  |  |  114|    261|#define OK        0
  ------------------
  |  Branch (1277:28): [True: 86, False: 175]
  ------------------
 1278|     86|                            return ret;
 1279|    261|                    }
 1280|    938|                    break;
 1281|  1.02k|                }
 1282|  10.0k|                case SET_MAX_LT_INDEX:
  ------------------
  |  |   47|  10.0k|#define SET_MAX_LT_INDEX            4
  ------------------
  |  Branch (1282:17): [True: 10.0k, False: 19.8k]
  ------------------
 1283|  10.0k|                {
 1284|  10.0k|                    UWORD8 uc_numLT = ps_dpb_mgr->u1_num_lt_ref_bufs;
 1285|  10.0k|                    u4_lt_idx = ps_mmc_params->u4_max_lt_idx_plus1; //Get Max_long_term_index_plus1
 1286|  10.0k|                    if(u4_lt_idx <= ps_dpb_mgr->u1_max_lt_frame_idx
  ------------------
  |  Branch (1286:24): [True: 5.10k, False: 4.92k]
  ------------------
 1287|  5.10k|                                    && uc_numLT > 0)
  ------------------
  |  Branch (1287:40): [True: 2.30k, False: 2.80k]
  ------------------
 1288|  2.30k|                    {
 1289|  2.30k|                        struct dpb_info_t *ps_nxtDPB;
 1290|       |                        //Set all LT buffers with index >= u4_lt_idx to nonreference
 1291|  2.30k|                        ps_nxtDPB = ps_dpb_mgr->ps_dpb_ht_head;
 1292|  2.30k|                        ps_next_dpb = ps_nxtDPB->ps_prev_long;
 1293|  2.30k|                        if(ps_nxtDPB->u1_lt_idx >= u4_lt_idx)
  ------------------
  |  Branch (1293:28): [True: 583, False: 1.71k]
  ------------------
 1294|    583|                        {
 1295|    583|                            i = 0;
 1296|    583|                            ps_dpb_mgr->ps_dpb_ht_head = NULL;
 1297|    583|                        }
 1298|  1.71k|                        else
 1299|  1.71k|                        {
 1300|  2.37k|                            for(i = 1; i < uc_numLT; i++)
  ------------------
  |  Branch (1300:40): [True: 1.26k, False: 1.10k]
  ------------------
 1301|  1.26k|                            {
 1302|  1.26k|                                if(ps_next_dpb->u1_lt_idx >= u4_lt_idx)
  ------------------
  |  Branch (1302:36): [True: 611, False: 654]
  ------------------
 1303|    611|                                    break;
 1304|    654|                                ps_nxtDPB = ps_next_dpb;
 1305|    654|                                ps_next_dpb = ps_next_dpb->ps_prev_long;
 1306|    654|                            }
 1307|  1.71k|                            ps_nxtDPB->ps_prev_long = NULL; //Terminate the link of the closest LTIndex that is <=Max
 1308|  1.71k|                        }
 1309|  2.30k|                        ps_dpb_mgr->u1_num_lt_ref_bufs = i;
 1310|  2.30k|                        if(i == 0)
  ------------------
  |  Branch (1310:28): [True: 583, False: 1.71k]
  ------------------
 1311|    583|                            ps_next_dpb = ps_nxtDPB;
 1312|       |
 1313|  3.56k|                        for(; i < uc_numLT; i++)
  ------------------
  |  Branch (1313:31): [True: 1.26k, False: 2.30k]
  ------------------
 1314|  1.26k|                        {
 1315|  1.26k|                            ps_nxtDPB = ps_next_dpb;
 1316|  1.26k|                            ps_nxtDPB->u1_lt_idx = MAX_REF_BUFS + 1;
  ------------------
  |  |   75|  1.26k|#define MAX_REF_BUFS    32
  ------------------
 1317|  1.26k|                            ps_nxtDPB->u1_used_as_ref = UNUSED_FOR_REF;
  ------------------
  |  |  595|  1.26k|#define UNUSED_FOR_REF 0
  ------------------
 1318|  1.26k|                            ps_nxtDPB->s_top_field.u1_reference_info =
 1319|  1.26k|                                            UNUSED_FOR_REF;
  ------------------
  |  |  595|  1.26k|#define UNUSED_FOR_REF 0
  ------------------
 1320|  1.26k|                            ps_nxtDPB->s_bot_field.u1_reference_info =
 1321|  1.26k|                                            UNUSED_FOR_REF;
  ------------------
  |  |  595|  1.26k|#define UNUSED_FOR_REF 0
  ------------------
 1322|       |
 1323|  1.26k|                            ps_nxtDPB->ps_pic_buf = NULL;
 1324|       |                            //Release buffer
 1325|  1.26k|                            ih264d_free_ref_pic_mv_bufs(ps_dpb_mgr->pv_codec_handle,
 1326|  1.26k|                                                        ps_nxtDPB->u1_buf_id);
 1327|  1.26k|                            ps_next_dpb = ps_nxtDPB->ps_prev_long;
 1328|  1.26k|                            ps_nxtDPB->ps_prev_long = NULL;
 1329|  1.26k|                        }
 1330|  2.30k|                    }
 1331|  10.0k|                    if(u4_lt_idx == 0)
  ------------------
  |  Branch (1331:24): [True: 1.21k, False: 8.81k]
  ------------------
 1332|  1.21k|                    {
 1333|  1.21k|                        ps_dpb_mgr->u1_max_lt_frame_idx = NO_LONG_TERM_INDICIES;
  ------------------
  |  |   53|  1.21k|#define NO_LONG_TERM_INDICIES      255
  ------------------
 1334|  1.21k|                    }
 1335|  8.81k|                    else
 1336|  8.81k|                    {
 1337|  8.81k|                        ps_dpb_mgr->u1_max_lt_frame_idx = u4_lt_idx - 1;
 1338|  8.81k|                    }
 1339|       |
 1340|  10.0k|                    break;
 1341|  1.02k|                }
 1342|  3.76k|                case SET_LT_INDEX:
  ------------------
  |  |   49|  3.76k|#define SET_LT_INDEX                6
  ------------------
  |  Branch (1342:17): [True: 3.76k, False: 26.1k]
  ------------------
 1343|  3.76k|                {
 1344|  3.76k|                    u4_lt_idx = ps_mmc_params->u4_lt_idx; //Get long term index
 1345|  3.76k|                    if((ps_dpb_mgr->u1_max_lt_frame_idx == NO_LONG_TERM_INDICIES) ||
  ------------------
  |  |   53|  3.76k|#define NO_LONG_TERM_INDICIES      255
  ------------------
  |  Branch (1345:24): [True: 107, False: 3.65k]
  ------------------
 1346|  3.65k|                        (u4_lt_idx > ps_dpb_mgr->u1_max_lt_frame_idx))
  ------------------
  |  Branch (1346:25): [True: 104, False: 3.55k]
  ------------------
 1347|    211|                    {
 1348|    211|                        return ERROR_DBP_MANAGER_T;
 1349|    211|                    }
 1350|  3.55k|                    ret = ih264d_insert_st_node(ps_dpb_mgr, ps_pic_buf, u1_buf_id,
 1351|  3.55k|                                          u4_cur_pic_num);
 1352|  3.55k|                    if(ret != OK)
  ------------------
  |  |  114|  3.55k|#define OK        0
  ------------------
  |  Branch (1352:24): [True: 77, False: 3.47k]
  ------------------
 1353|     77|                        return ret;
 1354|       |
 1355|  3.47k|                    if(ps_dpb_mgr->u1_num_st_ref_bufs > 0)
  ------------------
  |  Branch (1355:24): [True: 3.47k, False: 0]
  ------------------
 1356|       |
 1357|  3.47k|                    {
 1358|  3.47k|                        ret = ih264d_delete_st_node_or_make_lt(ps_dpb_mgr,
 1359|  3.47k|                                                               u4_cur_pic_num,
 1360|  3.47k|                                                               u4_lt_idx,
 1361|  3.47k|                                                               u1_fld_pic_flag);
 1362|  3.47k|                        if(ret != OK)
  ------------------
  |  |  114|  3.47k|#define OK        0
  ------------------
  |  Branch (1362:28): [True: 0, False: 3.47k]
  ------------------
 1363|      0|                            return ret;
 1364|  3.47k|                    }
 1365|      0|                    else
 1366|      0|                    {
 1367|      0|                        return ERROR_DBP_MANAGER_T;
 1368|      0|                    }
 1369|       |
 1370|  3.47k|                    u1_marked_lt = 1;
 1371|  3.47k|                    break;
 1372|  3.47k|                }
 1373|       |
 1374|  10.0k|                default:
  ------------------
  |  Branch (1374:17): [True: 10.0k, False: 19.8k]
  ------------------
 1375|  10.0k|                    break;
 1376|  29.9k|            }
 1377|  28.5k|            if(u4_mmco == RESET_REF_PICTURES || u4_mmco == RESET_ALL_PICTURES)
  ------------------
  |  |   48|  57.0k|#define RESET_REF_PICTURES          5
  ------------------
                          if(u4_mmco == RESET_REF_PICTURES || u4_mmco == RESET_ALL_PICTURES)
  ------------------
  |  |   51|  25.9k|#define RESET_ALL_PICTURES          8
  ------------------
  |  Branch (1377:16): [True: 2.56k, False: 25.9k]
  |  Branch (1377:49): [True: 248, False: 25.7k]
  ------------------
 1378|  2.81k|            {
 1379|  2.81k|                ih264d_reset_ref_bufs(ps_dpb_mgr);
 1380|  2.81k|                u4_cur_pic_num = 0;
 1381|  2.81k|            }
 1382|  28.5k|        }
 1383|  4.53k|    }
 1384|  9.63k|    if(!u1_marked_lt && u1_insert_st_pic)
  ------------------
  |  Branch (1384:8): [True: 8.00k, False: 1.63k]
  |  Branch (1384:25): [True: 8.00k, False: 0]
  ------------------
 1385|  8.00k|    {
 1386|  8.00k|        ret = ih264d_insert_st_node(ps_dpb_mgr, ps_pic_buf, u1_buf_id,
 1387|  8.00k|                              u4_cur_pic_num);
 1388|  8.00k|        if(ret != OK)
  ------------------
  |  |  114|  8.00k|#define OK        0
  ------------------
  |  Branch (1388:12): [True: 92, False: 7.91k]
  ------------------
 1389|     92|            return ret;
 1390|  8.00k|    }
 1391|  9.54k|    return OK;
  ------------------
  |  |  114|  9.54k|#define OK        0
  ------------------
 1392|  9.63k|}
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|     40|    for(i = 0; i < u1_disp_bufs; i++)
  ------------------
  |  Branch (1421:16): [True: 37, False: 3]
  ------------------
 1422|     37|    {
 1423|     37|        ih264_buf_mgr_release((buf_mgr_t *)ps_dec->pv_pic_buf_mgr,
 1424|     37|                              i,
 1425|     37|                              BUF_MGR_REF);
  ------------------
  |  |   50|     37|#define BUF_MGR_REF          (1 << 2)
  ------------------
 1426|     37|        ih264_buf_mgr_release((buf_mgr_t *)ps_dec->pv_mv_buf_mgr,
 1427|     37|                              ps_dec->as_buf_id_info_map[i].mv_buf_id,
 1428|     37|                              BUF_MGR_REF);
  ------------------
  |  |   50|     37|#define BUF_MGR_REF          (1 << 2)
  ------------------
 1429|     37|    }
 1430|      3|}
ih264d_delete_gap_frm_sliding:
 1460|  1.84k|{
 1461|  1.84k|    WORD8 i1_gap_idx, i, j, j_min;
 1462|  1.84k|    WORD32 *pi4_gaps_start_frm_num, *pi4_gaps_end_frm_num, i4_gap_frame_num;
 1463|  1.84k|    WORD32 i4_start_frm_num, i4_end_frm_num;
 1464|  1.84k|    WORD32 i4_max_frm_num;
 1465|  1.84k|    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.84k|    *pu1_del_node = 1;
 1470|  1.84k|    if(0 == ps_dpb_mgr->u1_num_gaps)
  ------------------
  |  Branch (1470:8): [True: 1.84k, False: 0]
  ------------------
 1471|  1.84k|        return OK;
  ------------------
  |  |  114|  1.84k|#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.62k|{
 1615|  1.62k|    WORD8 i, j;
 1616|  1.62k|    WORD32 *pi4_start, *pi4_end;
 1617|  1.62k|    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.62k|    *pu1_del_node = 1;
 1622|  1.62k|    pi4_start = ps_dpb_mgr->ai4_gaps_start_frm_num;
 1623|  1.62k|    pi4_end = ps_dpb_mgr->ai4_gaps_end_frm_num;
 1624|  1.62k|    i4_max_frm_num = ps_dpb_mgr->i4_max_frm_num;
 1625|       |
 1626|  1.62k|    if(0 == ps_dpb_mgr->u1_num_gaps)
  ------------------
  |  Branch (1626:8): [True: 1.62k, False: 0]
  ------------------
 1627|  1.62k|        return OK;
  ------------------
  |  |  114|  1.62k|#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|   232k|{
 2007|   232k|    WORD8 i;
 2008|   232k|    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|   232k|    for(i = 0; (i < MAX_FRAMES) && ps_dpb_mgr->i1_gaps_deleted; i++)
  ------------------
  |  |  600|   232k|#define MAX_FRAMES              16
  ------------------
  |  Branch (2011:16): [True: 232k, False: 0]
  |  Branch (2011:36): [True: 0, False: 232k]
  ------------------
 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|   232k|}
ih264d_insert_pic_in_display_list:
 2050|   125k|{
 2051|   125k|    WORD8 i;
 2052|   125k|    WORD32 (*i4_poc_buf_id_map)[3] = ps_dpb_mgr->ai4_poc_buf_id_map;
 2053|       |
 2054|   215k|    for(i = 0; i < MAX_FRAMES; i++)
  ------------------
  |  |  600|   215k|#define MAX_FRAMES              16
  ------------------
  |  Branch (2054:16): [True: 215k, False: 0]
  ------------------
 2055|   215k|    {
 2056|       |        /* Find an empty slot */
 2057|   215k|        if(i4_poc_buf_id_map[i][0] == -1)
  ------------------
  |  Branch (2057:12): [True: 125k, False: 89.4k]
  ------------------
 2058|   125k|        {
 2059|   125k|            if(GAP_FRAME_NUM == i4_poc_buf_id_map[i][2])
  ------------------
  |  |   80|   125k|#define GAP_FRAME_NUM           0x1fffffff
  ------------------
  |  Branch (2059:16): [True: 0, False: 125k]
  ------------------
 2060|      0|                ps_dpb_mgr->i1_gaps_deleted--;
 2061|   125k|            else
 2062|   125k|                ps_dpb_mgr->i1_poc_buf_id_entries++;
 2063|       |
 2064|   125k|            i4_poc_buf_id_map[i][0] = u1_buf_id;
 2065|   125k|            i4_poc_buf_id_map[i][1] = i4_display_poc;
 2066|   125k|            i4_poc_buf_id_map[i][2] = u4_frame_num;
 2067|       |
 2068|   125k|            break;
 2069|   125k|        }
 2070|   215k|    }
 2071|       |
 2072|   125k|    if(MAX_FRAMES == i)
  ------------------
  |  |  600|   125k|#define MAX_FRAMES              16
  ------------------
  |  Branch (2072:8): [True: 0, False: 125k]
  ------------------
 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|   125k|    return OK;
  ------------------
  |  |  114|   125k|#define OK        0
  ------------------
 2080|   125k|}

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

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

ih264d_fill_pred_info:
  113|  13.8M|{
  114|  13.8M|    WORD32 insert_bits;
  115|       |
  116|  13.8M|    ps_pred_pkd->i2_mv[0] = pi2_mv[0];
  117|  13.8M|    ps_pred_pkd->i2_mv[1] = pi2_mv[1];
  118|       |
  119|  13.8M|    insert_bits = sub_mb_num & 3; /*sub mb x*/
  120|  13.8M|    ps_pred_pkd->i1_size_pos_info = insert_bits;
  121|  13.8M|    insert_bits = sub_mb_num >> 2;/*sub mb y*/
  122|  13.8M|    ps_pred_pkd->i1_size_pos_info |= insert_bits << 2;
  123|  13.8M|    insert_bits = part_width >> 1;
  124|  13.8M|    ps_pred_pkd->i1_size_pos_info |= insert_bits << 4;
  125|  13.8M|    insert_bits = part_height >> 1;
  126|  13.8M|    ps_pred_pkd->i1_size_pos_info |= insert_bits << 6;
  127|       |
  128|  13.8M|    ps_pred_pkd->i1_ref_idx_info = i1_ref_idx;
  129|  13.8M|    ps_pred_pkd->i1_ref_idx_info |= (pred_dir << 6);
  130|  13.8M|    ps_pred_pkd->i1_buf_id = i1_buf_id;
  131|  13.8M|    ps_pred_pkd->pu4_wt_offst = pu4_wt_offset;
  132|  13.8M|    ps_pred_pkd->u1_pic_type = u1_pic_type;
  133|       |
  134|       |
  135|  13.8M|}
ih264d_form_mb_part_info_bp:
  178|  5.14M|{
  179|       |    /* The reference buffer pointer */
  180|  5.14M|    WORD32 i2_frm_x, i2_frm_y;
  181|  5.14M|    WORD32 i2_tmp_mv_x, i2_tmp_mv_y;
  182|  5.14M|    WORD32 i2_rec_x, i2_rec_y;
  183|       |
  184|  5.14M|    WORD32 u2_pic_ht;
  185|  5.14M|    WORD32 u2_frm_wd;
  186|  5.14M|    WORD32 u2_rec_wd;
  187|  5.14M|    UWORD8 u1_sub_x = 0,u1_sub_y=0 ;
  188|  5.14M|    UWORD8  u1_part_wd = 0,u1_part_ht = 0;
  189|  5.14M|    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.14M|    UWORD32 i1_mc_wd;
  199|       |
  200|  5.14M|    WORD32 u1_dma_ht;
  201|       |
  202|  5.14M|    UWORD32 u1_dma_wd;
  203|  5.14M|    UWORD32 u1_dx;
  204|  5.14M|    UWORD32 u1_dy;
  205|  5.14M|    pred_info_t * ps_pred = ps_dec->ps_pred + ps_dec->u4_pred_info_idx;
  206|  5.14M|    dec_slice_params_t * const ps_cur_slice = ps_dec->ps_cur_slice;
  207|  5.14M|    tfr_ctxt_t *ps_frame_buf;
  208|  5.14M|    struct pic_buffer_t *ps_ref_frm;
  209|  5.14M|    UWORD8 u1_scale_ref,u1_mbaff,u1_field;
  210|  5.14M|    pic_buffer_t  **pps_ref_frame;
  211|  5.14M|    WORD8 i1_size_pos_info,i1_buf_id;
  212|       |
  213|  5.14M|    PROFILE_DISABLE_MB_PART_INFO()
  ------------------
  |  |  131|  5.14M|#define PROFILE_DISABLE_MB_PART_INFO() ;
  ------------------
  214|       |
  215|  5.14M|     UNUSED(ps_cur_mb_info);
  ------------------
  |  |   45|  5.14M|#define UNUSED(x) ((void)(x))
  ------------------
  216|  5.14M|     i1_size_pos_info = ps_pred_pkd->i1_size_pos_info;
  217|  5.14M|     GET_XPOS_PRED(u1_sub_x,i1_size_pos_info);
  ------------------
  |  |  165|  5.14M|#define GET_XPOS_PRED(u1_out,pkd_info)                        \
  |  |  166|  5.14M|{                                                               \
  |  |  167|  5.14M|    WORD32 bit_field;                                           \
  |  |  168|  5.14M|    bit_field = pkd_info & 0x3;                                 \
  |  |  169|  5.14M|    u1_out = bit_field;                                       \
  |  |  170|  5.14M|}
  ------------------
  218|  5.14M|     GET_YPOS_PRED(u1_sub_y,i1_size_pos_info);
  ------------------
  |  |  173|  5.14M|#define GET_YPOS_PRED(u1_out,pkd_info)                        \
  |  |  174|  5.14M|{                                                               \
  |  |  175|  5.14M|    WORD32 bit_field;                                           \
  |  |  176|  5.14M|    bit_field = pkd_info >> 2;                                  \
  |  |  177|  5.14M|    u1_out = bit_field & 0x3;                                  \
  |  |  178|  5.14M|}
  ------------------
  219|  5.14M|     GET_WIDTH_PRED(u1_part_wd,i1_size_pos_info);
  ------------------
  |  |  182|  5.14M|#define GET_WIDTH_PRED(u1_out,pkd_info)                        \
  |  |  183|  5.14M|{                                                               \
  |  |  184|  5.14M|    WORD32 bit_field;                                           \
  |  |  185|  5.14M|    bit_field = pkd_info >> 4;                                  \
  |  |  186|  5.14M|    bit_field = (bit_field & 0x3) << 1 ;                        \
  |  |  187|  5.14M|    u1_out = (bit_field == 0)?1:bit_field;                       \
  |  |  ------------------
  |  |  |  Branch (187:14): [True: 26.5k, False: 5.11M]
  |  |  ------------------
  |  |  188|  5.14M|    }
  ------------------
  220|  5.14M|     GET_HEIGHT_PRED(u1_part_ht,i1_size_pos_info);
  ------------------
  |  |  190|  5.14M|#define GET_HEIGHT_PRED(u1_out,pkd_info)                        \
  |  |  191|  5.14M|{                                                               \
  |  |  192|  5.14M|    WORD32 bit_field;                                           \
  |  |  193|  5.14M|    bit_field = pkd_info >> 6;                                  \
  |  |  194|  5.14M|    bit_field = (bit_field & 0x3) << 1 ;                        \
  |  |  195|  5.14M|    u1_out = (bit_field == 0)?1:bit_field;                      \
  |  |  ------------------
  |  |  |  Branch (195:14): [True: 17.0k, False: 5.12M]
  |  |  ------------------
  |  |  196|  5.14M|}
  ------------------
  221|  5.14M|     i2_mv_x = ps_pred_pkd->i2_mv[0];
  222|  5.14M|     i2_mv_y = ps_pred_pkd->i2_mv[1];
  223|  5.14M|     i1_buf_id = ps_pred_pkd->i1_buf_id;
  224|       |
  225|       |
  226|  5.14M|     ps_ref_frm = ps_dec->apv_buf_id_pic_buf_map[i1_buf_id];
  227|       |
  228|       |
  229|  5.14M|    {
  230|  5.14M|        ps_frame_buf = &ps_dec->s_tran_addrecon;
  231|  5.14M|    }
  232|       |
  233|       |
  234|       |    /* Transfer Setup Y */
  235|  5.14M|    {
  236|  5.14M|        UWORD8 *pu1_pred, *pu1_rec;
  237|       |
  238|       |        /* calculating rounded motion vectors and fractional components */
  239|  5.14M|        i2_tmp_mv_x = i2_mv_x;
  240|  5.14M|        i2_tmp_mv_y = i2_mv_y;
  241|  5.14M|        u1_dx = i2_tmp_mv_x & 0x3;
  242|  5.14M|        u1_dy = i2_tmp_mv_y & 0x3;
  243|  5.14M|        i2_tmp_mv_x >>= 2;
  244|  5.14M|        i2_tmp_mv_y >>= 2;
  245|  5.14M|        i1_mc_wd = u1_part_wd << 2;
  246|  5.14M|        u1_dma_ht = u1_part_ht << 2;
  247|  5.14M|        if(u1_dx)
  ------------------
  |  Branch (247:12): [True: 121k, False: 5.02M]
  ------------------
  248|   121k|        {
  249|   121k|            i2_tmp_mv_x -= 2;
  250|   121k|            i1_mc_wd += 5;
  251|   121k|        }
  252|  5.14M|        if(u1_dy)
  ------------------
  |  Branch (252:12): [True: 109k, False: 5.03M]
  ------------------
  253|   109k|        {
  254|   109k|            i2_tmp_mv_y -= 2;
  255|   109k|            u1_dma_ht += 5;
  256|   109k|        }
  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.14M|        u2_pic_ht = ps_dec->u2_pic_ht;
  263|  5.14M|        u2_frm_wd = ps_dec->u2_frm_wd_y;
  264|  5.14M|        i2_rec_x = u1_sub_x << 2;
  265|  5.14M|        i2_rec_y = u1_sub_y << 2;
  266|       |
  267|  5.14M|        i2_frm_x = (u2_mb_x << 4) + i2_rec_x + i2_tmp_mv_x;
  268|  5.14M|        i2_frm_y = (u2_mb_y << 4) + i2_rec_y + i2_tmp_mv_y;
  269|       |
  270|  5.14M|        i2_frm_x = CLIP3(MAX_OFFSET_OUTSIDE_X_FRM, (ps_dec->u2_pic_wd - 1),
  ------------------
  |  |   77|  5.14M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 1.07k, False: 5.14M]
  |  |  |  Branch (77:54): [True: 5.91k, False: 5.13M]
  |  |  ------------------
  ------------------
  271|  5.14M|                         i2_frm_x);
  272|  5.14M|        i2_frm_y = CLIP3(((1 - u1_dma_ht)), (u2_pic_ht - (1)), i2_frm_y);
  ------------------
  |  |   77|  5.14M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 1.15k, False: 5.14M]
  |  |  |  Branch (77:54): [True: 875, False: 5.14M]
  |  |  ------------------
  ------------------
  273|       |
  274|  5.14M|        pu1_pred = ps_ref_frm->pu1_buf1 + i2_frm_y * u2_frm_wd + i2_frm_x;
  275|       |
  276|  5.14M|        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.14M|        u2_rec_wd = MB_SIZE;
  ------------------
  |  |  554|  5.14M|#define MB_SIZE             16
  ------------------
  283|  5.14M|        {
  284|  5.14M|            u2_rec_wd = ps_dec->u2_frm_wd_y;
  285|  5.14M|            i2_rec_x += (mb_index << 4);
  286|  5.14M|            pu1_rec = ps_frame_buf->pu1_dest_y + i2_rec_y * u2_rec_wd
  287|  5.14M|                            + i2_rec_x;
  288|  5.14M|        }
  289|       |
  290|       |        /* filling the pred and dma structures for Y */
  291|  5.14M|        u2_frm_wd = ps_dec->u2_frm_wd_y;
  292|       |
  293|  5.14M|        ps_pred->u2_u1_ref_buf_wd = u1_dma_wd;
  294|  5.14M|        ps_pred->i1_dma_ht = u1_dma_ht;
  295|  5.14M|        ps_pred->i1_mc_wd = i1_mc_wd;
  296|  5.14M|        ps_pred->u2_frm_wd = u2_frm_wd;
  297|  5.14M|        ps_pred->pu1_rec_y_u = pu1_rec;
  298|  5.14M|        ps_pred->u2_dst_stride = u2_rec_wd;
  299|       |
  300|  5.14M|        ps_pred->i1_mb_partwidth = u1_part_wd << 2;
  301|  5.14M|        ps_pred->i1_mb_partheight = u1_part_ht << 2;
  302|  5.14M|        ps_pred->u1_dydx = (u1_dy << 2) + u1_dx;
  303|       |
  304|  5.14M|        ps_pred->pu1_y_ref = pu1_pred;
  305|       |
  306|  5.14M|    }
  307|       |
  308|       |    /* Increment ps_pred index */
  309|  5.14M|    ps_pred++;
  310|       |
  311|       |    /* Transfer Setup U & V */
  312|  5.14M|    {
  313|  5.14M|        WORD32 i4_ref_offset, i4_rec_offset;
  314|  5.14M|        UWORD8 *pu1_pred_u, *pu1_pred_v;
  315|       |
  316|       |
  317|       |        /* calculating rounded motion vectors and fractional components */
  318|  5.14M|        i2_tmp_mv_x = i2_mv_x;
  319|  5.14M|        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.14M|        u1_dx = i2_tmp_mv_x & 0x7;
  328|  5.14M|        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.14M|        i2_mv_x = i2_tmp_mv_x;
  335|  5.14M|        i2_mv_y = i2_tmp_mv_y;
  336|  5.14M|        i2_tmp_mv_x = SIGN_POW2_DIV(i2_tmp_mv_x, 3);
  ------------------
  |  |   67|  5.14M|#define SIGN_POW2_DIV(x, y) (((x) < 0) ? (-((-(x)) >> (y))) : ((x) >> (y)))
  |  |  ------------------
  |  |  |  Branch (67:30): [True: 46.4k, False: 5.09M]
  |  |  ------------------
  ------------------
  337|  5.14M|        i2_tmp_mv_y = SIGN_POW2_DIV(i2_tmp_mv_y, 3);
  ------------------
  |  |   67|  5.14M|#define SIGN_POW2_DIV(x, y) (((x) < 0) ? (-((-(x)) >> (y))) : ((x) >> (y)))
  |  |  ------------------
  |  |  |  Branch (67:30): [True: 47.8k, False: 5.09M]
  |  |  ------------------
  ------------------
  338|  5.14M|        i1_mc_wd = u1_part_wd << 1;
  339|  5.14M|        u1_dma_ht = u1_part_ht << 1;
  340|  5.14M|        if(u1_dx)
  ------------------
  |  Branch (340:12): [True: 130k, False: 5.01M]
  ------------------
  341|   130k|        {
  342|   130k|            i2_tmp_mv_x -= (i2_mv_x < 0);
  343|   130k|            i1_mc_wd++;
  344|   130k|        }
  345|  5.14M|        if(u1_dy != 0)
  ------------------
  |  Branch (345:12): [True: 121k, False: 5.02M]
  ------------------
  346|   121k|        {
  347|   121k|            i2_tmp_mv_y -= (i2_mv_y < 0);
  348|   121k|            u1_dma_ht++;
  349|   121k|        }
  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.14M|        u2_pic_ht >>= 1;
  356|  5.14M|        u2_frm_wd = ps_dec->u2_frm_wd_uv;
  357|  5.14M|        i2_rec_x = u1_sub_x << 1;
  358|  5.14M|        i2_rec_y = u1_sub_y << 1;
  359|       |
  360|  5.14M|        i2_frm_x = (u2_mb_x << 3) + i2_rec_x + i2_tmp_mv_x;
  361|  5.14M|        i2_frm_y = (u2_mb_y << 3) + i2_rec_y + i2_tmp_mv_y;
  362|       |
  363|  5.14M|        i2_frm_x = CLIP3(MAX_OFFSET_OUTSIDE_UV_FRM,
  ------------------
  |  |   77|  5.14M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 1.09k, False: 5.14M]
  |  |  |  Branch (77:54): [True: 6.18k, False: 5.13M]
  |  |  ------------------
  ------------------
  364|  5.14M|                         ((ps_dec->u2_pic_wd >> 1) - 1), i2_frm_x);
  365|  5.14M|        i2_frm_y = CLIP3(((1 - u1_dma_ht)), (u2_pic_ht - (1)), i2_frm_y);
  ------------------
  |  |   77|  5.14M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 1.19k, False: 5.14M]
  |  |  |  Branch (77:54): [True: 875, False: 5.14M]
  |  |  ------------------
  ------------------
  366|       |
  367|  5.14M|        i4_ref_offset = i2_frm_y * u2_frm_wd + i2_frm_x * YUV420SP_FACTOR;
  ------------------
  |  |  119|  5.14M|#define YUV420SP_FACTOR 2
  ------------------
  368|  5.14M|        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.14M|        u2_rec_wd = BLK8x8SIZE * YUV420SP_FACTOR;
  ------------------
  |  |  555|  5.14M|#define BLK8x8SIZE          8
  ------------------
                      u2_rec_wd = BLK8x8SIZE * YUV420SP_FACTOR;
  ------------------
  |  |  119|  5.14M|#define YUV420SP_FACTOR 2
  ------------------
  376|  5.14M|        i4_rec_offset = i2_rec_y * u2_rec_wd + i2_rec_x * YUV420SP_FACTOR;
  ------------------
  |  |  119|  5.14M|#define YUV420SP_FACTOR 2
  ------------------
  377|       |
  378|  5.14M|        {
  379|  5.14M|            u2_rec_wd = ps_dec->u2_frm_wd_uv;
  380|  5.14M|            i2_rec_x += (mb_index << 3);
  381|  5.14M|            i4_rec_offset = i2_rec_y * u2_rec_wd + i2_rec_x * YUV420SP_FACTOR;
  ------------------
  |  |  119|  5.14M|#define YUV420SP_FACTOR 2
  ------------------
  382|  5.14M|            ps_pred->pu1_rec_y_u = ps_frame_buf->pu1_dest_u + i4_rec_offset;
  383|  5.14M|            ps_pred->u1_pi1_wt_ofst_rec_v = ps_frame_buf->pu1_dest_v
  384|  5.14M|                            + i4_rec_offset;
  385|  5.14M|        }
  386|       |
  387|       |        /* CHANGED CODE */
  388|       |
  389|       |        /* filling the common pred structures for U */
  390|  5.14M|        u2_frm_wd = ps_dec->u2_frm_wd_uv;
  391|       |
  392|  5.14M|        ps_pred->u2_u1_ref_buf_wd = u1_dma_wd;
  393|  5.14M|        ps_pred->i1_dma_ht = u1_dma_ht;
  394|  5.14M|        ps_pred->i1_mc_wd = i1_mc_wd;
  395|       |
  396|  5.14M|        ps_pred->u2_frm_wd = u2_frm_wd;
  397|  5.14M|        ps_pred->u2_dst_stride = u2_rec_wd;
  398|       |
  399|  5.14M|        ps_pred->i1_mb_partwidth = u1_part_wd << 1;
  400|  5.14M|        ps_pred->i1_mb_partheight = u1_part_ht << 1;
  401|  5.14M|        ps_pred->u1_dydx = (u1_dy << 3) + u1_dx;
  402|       |
  403|  5.14M|        pu1_pred_u = ps_ref_frm->pu1_buf2 + i4_ref_offset;
  404|  5.14M|        pu1_pred_v = ps_ref_frm->pu1_buf3 + i4_ref_offset;
  405|       |
  406|       |        /* Copy U & V partitions */
  407|  5.14M|        ps_pred->pu1_u_ref = pu1_pred_u;
  408|       |
  409|       |        /* Increment the reference buffer Index */
  410|  5.14M|        ps_pred->pu1_v_ref = pu1_pred_v;
  411|  5.14M|    }
  412|       |
  413|       |    /* Increment ps_pred index */
  414|  5.14M|    ps_dec->u4_pred_info_idx += 2;
  415|       |
  416|  5.14M|    return OK;
  ------------------
  |  |  114|  5.14M|#define OK        0
  ------------------
  417|       |
  418|  5.14M|}
ih264d_form_mb_part_info_mp:
  455|  7.41M|{
  456|       |    /* The reference buffer pointer */
  457|  7.41M|    UWORD8 *pu1_ref_buf;
  458|  7.41M|    WORD16 i2_frm_x, i2_frm_y, i2_tmp_mv_x, i2_tmp_mv_y, i2_pod_ht;
  459|  7.41M|    WORD16 i2_rec_x, i2_rec_y;
  460|  7.41M|    UWORD16 u2_pic_ht, u2_frm_wd, u2_rec_wd;
  461|  7.41M|    UWORD8 u1_wght_pred_type, u1_wted_bipred_idc;
  462|  7.41M|    UWORD16 u2_tot_ref_scratch_size;
  463|  7.41M|    UWORD8 u1_sub_x = 0;
  464|  7.41M|    UWORD8 u1_sub_y = 0;
  465|  7.41M|    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.41M|    UWORD8 i1_mc_wd, u1_dma_ht, u1_dma_wd, u1_dx, u1_dy;
  475|  7.41M|    pred_info_t * ps_pred ;
  476|  7.41M|    dec_slice_params_t * const ps_cur_slice = ps_dec->ps_cur_slice;
  477|  7.41M|    const UWORD8 u1_slice_type = ps_dec->ps_decode_cur_slice->slice_type;
  478|  7.41M|    UWORD8 u1_pod_bot, u1_pod_top;
  479|       |
  480|       |    /* load the pictype for pod u4_flag & chroma motion vector derivation */
  481|  7.41M|    UWORD8 u1_ref_pic_type ;
  482|       |
  483|       |    /* set default value to flags specifying field nature of picture & mb */
  484|  7.41M|    UWORD32 u1_mb_fld = 0, u1_mb_or_pic_fld;
  485|  7.41M|    UWORD32 u1_mb_bot = 0, u1_pic_bot = 0, u1_mb_or_pic_bot;
  486|  7.41M|    tfr_ctxt_t *ps_frame_buf;
  487|       |    /* calculate flags specifying field nature of picture & mb */
  488|  7.41M|    const UWORD32 u1_pic_fld = ps_cur_slice->u1_field_pic_flag;
  489|  7.41M|    WORD8 i1_pred;
  490|  7.41M|    WORD8 i1_size_pos_info,i1_buf_id,i1_ref_idx;
  491|  7.41M|    UWORD8 u1_part_wd,u1_part_ht;
  492|  7.41M|    WORD16 i2_mv_x,i2_mv_y;
  493|  7.41M|    struct pic_buffer_t *ps_ref_frm;
  494|  7.41M|    UWORD32 *pu4_wt_offset;
  495|  7.41M|    UWORD8 *pu1_buf1,*pu1_buf2,*pu1_buf3;
  496|       |
  497|       |
  498|  7.41M|    PROFILE_DISABLE_MB_PART_INFO()
  ------------------
  |  |  131|  7.41M|#define PROFILE_DISABLE_MB_PART_INFO() ;
  ------------------
  499|       |
  500|  7.41M|    ps_pred = ps_dec->ps_pred + ps_dec->u4_pred_info_idx;
  501|       |
  502|       |
  503|  7.41M|     i1_size_pos_info = ps_pred_pkd->i1_size_pos_info;
  504|  7.41M|     GET_XPOS_PRED(u1_sub_x,i1_size_pos_info);
  ------------------
  |  |  165|  7.41M|#define GET_XPOS_PRED(u1_out,pkd_info)                        \
  |  |  166|  7.41M|{                                                               \
  |  |  167|  7.41M|    WORD32 bit_field;                                           \
  |  |  168|  7.41M|    bit_field = pkd_info & 0x3;                                 \
  |  |  169|  7.41M|    u1_out = bit_field;                                       \
  |  |  170|  7.41M|}
  ------------------
  505|  7.41M|     GET_YPOS_PRED(u1_sub_y,i1_size_pos_info);
  ------------------
  |  |  173|  7.41M|#define GET_YPOS_PRED(u1_out,pkd_info)                        \
  |  |  174|  7.41M|{                                                               \
  |  |  175|  7.41M|    WORD32 bit_field;                                           \
  |  |  176|  7.41M|    bit_field = pkd_info >> 2;                                  \
  |  |  177|  7.41M|    u1_out = bit_field & 0x3;                                  \
  |  |  178|  7.41M|}
  ------------------
  506|  7.41M|     GET_WIDTH_PRED(u1_part_wd,i1_size_pos_info);
  ------------------
  |  |  182|  7.41M|#define GET_WIDTH_PRED(u1_out,pkd_info)                        \
  |  |  183|  7.41M|{                                                               \
  |  |  184|  7.41M|    WORD32 bit_field;                                           \
  |  |  185|  7.41M|    bit_field = pkd_info >> 4;                                  \
  |  |  186|  7.41M|    bit_field = (bit_field & 0x3) << 1 ;                        \
  |  |  187|  7.41M|    u1_out = (bit_field == 0)?1:bit_field;                       \
  |  |  ------------------
  |  |  |  Branch (187:14): [True: 92.7k, False: 7.32M]
  |  |  ------------------
  |  |  188|  7.41M|    }
  ------------------
  507|  7.41M|     GET_HEIGHT_PRED(u1_part_ht,i1_size_pos_info);
  ------------------
  |  |  190|  7.41M|#define GET_HEIGHT_PRED(u1_out,pkd_info)                        \
  |  |  191|  7.41M|{                                                               \
  |  |  192|  7.41M|    WORD32 bit_field;                                           \
  |  |  193|  7.41M|    bit_field = pkd_info >> 6;                                  \
  |  |  194|  7.41M|    bit_field = (bit_field & 0x3) << 1 ;                        \
  |  |  195|  7.41M|    u1_out = (bit_field == 0)?1:bit_field;                      \
  |  |  ------------------
  |  |  |  Branch (195:14): [True: 68.2k, False: 7.35M]
  |  |  ------------------
  |  |  196|  7.41M|}
  ------------------
  508|  7.41M|     i2_mv_x = ps_pred_pkd->i2_mv[0];
  509|  7.41M|     i2_mv_y = ps_pred_pkd->i2_mv[1];
  510|  7.41M|     i1_ref_idx = ps_pred_pkd->i1_ref_idx_info & 0x3f;
  511|  7.41M|     i1_buf_id = ps_pred_pkd->i1_buf_id;
  512|  7.41M|     ps_ref_frm = ps_dec->apv_buf_id_pic_buf_map[i1_buf_id];
  513|       |
  514|  7.41M|     i1_pred = (ps_pred_pkd->i1_ref_idx_info & 0xC0) >> 6;
  515|  7.41M|     u1_is_bi_dir = (i1_pred == BI_PRED);
  ------------------
  |  |  485|  7.41M|#define BI_PRED   3
  ------------------
  516|       |
  517|       |
  518|  7.41M|    u1_ref_pic_type = ps_pred_pkd->u1_pic_type & PIC_MASK;
  ------------------
  |  |  359|  7.41M|#define PIC_MASK        0x03
  ------------------
  519|       |
  520|  7.41M|    pu1_buf1  = ps_ref_frm->pu1_buf1;
  521|  7.41M|    pu1_buf2  = ps_ref_frm->pu1_buf2;
  522|  7.41M|    pu1_buf3  = ps_ref_frm->pu1_buf3;
  523|       |
  524|  7.41M|    if(u1_ref_pic_type == BOT_FLD)
  ------------------
  |  |  354|  7.41M|#define BOT_FLD         0x02
  ------------------
  |  Branch (524:8): [True: 0, False: 7.41M]
  ------------------
  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.41M|    if(ps_dec->ps_cur_pps->u1_wted_pred_flag)
  ------------------
  |  Branch (534:8): [True: 5.88M, False: 1.53M]
  ------------------
  535|  5.88M|    {
  536|  5.88M|            pu4_wt_offset = (UWORD32*)&ps_dec->pu4_wt_ofsts[2
  537|  5.88M|                            * X3(i1_ref_idx)];
  ------------------
  |  |   92|  5.88M|#define X3(a)   (((a) << 1) + (a))
  ------------------
  538|  5.88M|    }
  539|       |
  540|       |
  541|  7.41M|    pu4_wt_offset = ps_pred_pkd->pu4_wt_offst;
  542|       |
  543|       |
  544|       |    /* Pointer to the frame buffer */
  545|  7.41M|    {
  546|  7.41M|        ps_frame_buf = &ps_dec->s_tran_addrecon;
  547|       |        /* CHANGED CODE */
  548|  7.41M|    }
  549|       |
  550|  7.41M|    if(!u1_pic_fld)
  ------------------
  |  Branch (550:8): [True: 7.41M, False: 0]
  ------------------
  551|  7.41M|    {
  552|  7.41M|        u1_mb_fld = ps_cur_mb_info->u1_mb_field_decodingflag;
  553|  7.41M|        u1_mb_bot = 1 - ps_cur_mb_info->u1_topmb;
  554|  7.41M|    }
  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.41M|    u1_mb_or_pic_bot = u1_mb_bot | u1_pic_bot;
  563|  7.41M|    u1_mb_or_pic_fld = u1_mb_fld | u1_pic_fld;
  564|  7.41M|    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.41M]
  |  Branch (564:38): [True: 0, False: 0]
  ------------------
  565|  7.41M|    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.41M]
  |  Branch (565:38): [True: 0, False: 0]
  ------------------
  566|       |
  567|       |    /* Weighted Pred additions */
  568|  7.41M|    u1_wted_bipred_idc = ps_dec->ps_cur_pps->u1_wted_bipred_idc;
  569|       |
  570|  7.41M|    if((u1_slice_type == P_SLICE) || (u1_slice_type == SP_SLICE))
  ------------------
  |  |  368|  7.41M|#define P_SLICE  0
  ------------------
                  if((u1_slice_type == P_SLICE) || (u1_slice_type == SP_SLICE))
  ------------------
  |  |  371|  3.04M|#define SP_SLICE 3
  ------------------
  |  Branch (570:8): [True: 4.37M, False: 3.04M]
  |  Branch (570:38): [True: 0, False: 3.04M]
  ------------------
  571|  4.37M|    {
  572|       |        /* P Slice only */
  573|  4.37M|        u1_wght_pred_type = ps_dec->ps_cur_pps->u1_wted_pred_flag;
  574|       |
  575|  4.37M|    }
  576|  3.04M|    else
  577|  3.04M|    {
  578|       |        /* B Slice only */
  579|  3.04M|        u1_wght_pred_type = 1 + u1_is_bi_dir;
  580|  3.04M|        if(u1_wted_bipred_idc == 0)
  ------------------
  |  Branch (580:12): [True: 1.05M, False: 1.98M]
  ------------------
  581|  1.05M|            u1_wght_pred_type = 0;
  582|  3.04M|        if((u1_wted_bipred_idc == 2) && (!u1_is_bi_dir))
  ------------------
  |  Branch (582:12): [True: 1.19M, False: 1.84M]
  |  Branch (582:41): [True: 566k, False: 625k]
  ------------------
  583|   566k|            u1_wght_pred_type = 0;
  584|  3.04M|    }
  585|       |    /* load the scratch reference buffer index */
  586|  7.41M|    pu1_ref_buf = ps_dec->pu1_ref_buff + ps_dec->u4_dma_buf_idx;
  587|  7.41M|    u2_tot_ref_scratch_size = 0;
  588|       |
  589|       |
  590|       |    /* Transfer Setup Y */
  591|  7.41M|    {
  592|  7.41M|        UWORD8 *pu1_pred, *pu1_rec;
  593|       |        /* calculating rounded motion vectors and fractional components */
  594|  7.41M|        i2_tmp_mv_x = i2_mv_x;
  595|  7.41M|        i2_tmp_mv_y = i2_mv_y;
  596|       |
  597|  7.41M|        u1_dx = i2_tmp_mv_x & 0x3;
  598|  7.41M|        u1_dy = i2_tmp_mv_y & 0x3;
  599|  7.41M|        i2_tmp_mv_x >>= 2;
  600|  7.41M|        i2_tmp_mv_y >>= 2;
  601|  7.41M|        i1_mc_wd = u1_part_wd << 2;
  602|  7.41M|        u1_dma_ht = u1_part_ht << 2;
  603|  7.41M|        if(u1_dx)
  ------------------
  |  Branch (603:12): [True: 484k, False: 6.93M]
  ------------------
  604|   484k|        {
  605|   484k|            i2_tmp_mv_x -= 2;
  606|   484k|            i1_mc_wd += 5;
  607|   484k|        }
  608|  7.41M|        if(u1_dy)
  ------------------
  |  Branch (608:12): [True: 445k, False: 6.97M]
  ------------------
  609|   445k|        {
  610|   445k|            i2_tmp_mv_y -= 2;
  611|   445k|            u1_dma_ht += 5;
  612|   445k|        }
  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.41M|        u2_pic_ht = ps_dec->u2_pic_ht >> u1_pic_fld;
  619|  7.41M|        u2_frm_wd = ps_dec->u2_frm_wd_y << u1_pic_fld;
  620|  7.41M|        i2_frm_x = (u2_mb_x << 4) + (u1_sub_x << 2) + i2_tmp_mv_x;
  621|  7.41M|        i2_frm_y = ((u2_mb_y + (u1_mb_bot && !u1_mb_fld)) << 4)
  ------------------
  |  Branch (621:33): [True: 0, False: 7.41M]
  |  Branch (621:46): [True: 0, False: 0]
  ------------------
  622|  7.41M|                        + (((u1_sub_y << 2) + i2_tmp_mv_y) << u1_mb_fld);
  623|       |
  624|  7.41M|        i2_frm_x = CLIP3(MAX_OFFSET_OUTSIDE_X_FRM, (ps_dec->u2_pic_wd - 1),
  ------------------
  |  |   77|  7.41M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 4.63k, False: 7.41M]
  |  |  |  Branch (77:54): [True: 58.7k, False: 7.35M]
  |  |  ------------------
  ------------------
  625|  7.41M|                         i2_frm_x);
  626|  7.41M|        i2_frm_y = CLIP3(((1 - u1_dma_ht) << u1_mb_fld),
  ------------------
  |  |   77|  7.41M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 4.96k, False: 7.41M]
  |  |  |  Branch (77:54): [True: 13.0k, False: 7.40M]
  |  |  ------------------
  ------------------
  627|  7.41M|                         (u2_pic_ht - (1 << u1_mb_fld)), i2_frm_y);
  628|       |
  629|  7.41M|        pu1_pred = pu1_buf1 + i2_frm_y * u2_frm_wd + i2_frm_x;
  630|  7.41M|        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.41M|        u2_rec_wd = MB_SIZE;
  ------------------
  |  |  554|  7.41M|#define MB_SIZE             16
  ------------------
  637|  7.41M|        i2_rec_x = u1_sub_x << 2;
  638|  7.41M|        i2_rec_y = u1_sub_y << 2;
  639|  7.41M|        {
  640|  7.41M|            u2_rec_wd = ps_dec->u2_frm_wd_y << u1_mb_or_pic_fld;
  641|  7.41M|            i2_rec_x += (mb_index << 4);
  642|  7.41M|            pu1_rec = ps_frame_buf->pu1_dest_y + i2_rec_y * u2_rec_wd
  643|  7.41M|                            + i2_rec_x;
  644|  7.41M|            if(u1_mb_bot)
  ------------------
  |  Branch (644:16): [True: 0, False: 7.41M]
  ------------------
  645|      0|                pu1_rec += ps_dec->u2_frm_wd_y << ((u1_mb_fld) ? 0 : 4);
  ------------------
  |  Branch (645:52): [True: 0, False: 0]
  ------------------
  646|  7.41M|        }
  647|       |
  648|       |        /* CHANGED CODE */
  649|       |
  650|       |        /* filling the pred and dma structures for Y */
  651|  7.41M|        u2_frm_wd = ps_dec->u2_frm_wd_y << u1_mb_or_pic_fld;
  652|       |
  653|  7.41M|        ps_pred->pu1_dma_dest_addr = pu1_ref_buf;
  654|  7.41M|        ps_pred->u2_u1_ref_buf_wd = u1_dma_wd;
  655|  7.41M|        ps_pred->u2_frm_wd = u2_frm_wd;
  656|  7.41M|        ps_pred->i1_dma_ht = u1_dma_ht;
  657|  7.41M|        ps_pred->i1_mc_wd = i1_mc_wd;
  658|  7.41M|        ps_pred->pu1_rec_y_u = pu1_rec;
  659|  7.41M|        ps_pred->u2_dst_stride = u2_rec_wd;
  660|       |
  661|  7.41M|        ps_pred->i1_mb_partwidth = u1_part_wd << 2;
  662|  7.41M|        ps_pred->i1_mb_partheight = u1_part_ht << 2;
  663|  7.41M|        ps_pred->u1_dydx = (u1_dy << 2) + u1_dx;
  664|  7.41M|        ps_pred->u1_is_bi_direct = u1_is_bi_dir;
  665|  7.41M|        ps_pred->u1_pi1_wt_ofst_rec_v = (UWORD8 *)pu4_wt_offset;
  666|  7.41M|        ps_pred->u1_wght_pred_type = u1_wght_pred_type;
  667|  7.41M|        ps_pred->i1_pod_ht = 0;
  668|       |
  669|       |        /* Increment the Reference buffer Indices */
  670|  7.41M|        pu1_ref_buf += u1_dma_wd * u1_dma_ht;
  671|  7.41M|        u2_tot_ref_scratch_size += u1_dma_wd * u1_dma_ht;
  672|       |
  673|       |        /* unrestricted field motion comp for top region outside frame */
  674|  7.41M|        i2_pod_ht = (-i2_frm_y) >> u1_mb_fld;
  675|  7.41M|        if((i2_pod_ht > 0) && u1_pod_top)
  ------------------
  |  Branch (675:12): [True: 26.5k, False: 7.39M]
  |  Branch (675:31): [True: 0, False: 26.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.41M|        else if(u1_pod_bot)
  ------------------
  |  Branch (682:17): [True: 0, False: 7.41M]
  ------------------
  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.41M|        if(ps_pred->i1_pod_ht)
  ------------------
  |  Branch (698:12): [True: 0, False: 7.41M]
  ------------------
  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.41M|        ps_pred->pu1_y_ref = pu1_pred;
  705|  7.41M|    }
  706|       |
  707|       |
  708|       |
  709|       |    /* Increment ps_pred index */
  710|  7.41M|    ps_pred++;
  711|       |
  712|       |    /* Transfer Setup U & V */
  713|  7.41M|    {
  714|  7.41M|        WORD32 i4_ref_offset, i4_rec_offset;
  715|  7.41M|        UWORD8 *pu1_pred_u, *pu1_pred_v, u1_tmp_dma_ht;
  716|       |        /* CHANGED CODE */
  717|  7.41M|        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.41M|        i2_tmp_mv_x = i2_mv_x;
  722|  7.41M|        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.41M|        if(u1_pod_bot && u1_mb_or_pic_bot)
  ------------------
  |  Branch (728:12): [True: 0, False: 7.41M]
  |  Branch (728:26): [True: 0, False: 0]
  ------------------
  729|      0|            i2_tmp_mv_y += 2;
  730|  7.41M|        if(u1_pod_top && !u1_mb_or_pic_bot)
  ------------------
  |  Branch (730:12): [True: 0, False: 7.41M]
  |  Branch (730:26): [True: 0, False: 0]
  ------------------
  731|      0|            i2_tmp_mv_y -= 2;
  732|       |
  733|       |        /* Eighth sample of the chroma MV */
  734|  7.41M|        u1_dx = i2_tmp_mv_x & 0x7;
  735|  7.41M|        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.41M|        i2_mv_x = i2_tmp_mv_x;
  742|  7.41M|        i2_mv_y = i2_tmp_mv_y;
  743|  7.41M|        i2_tmp_mv_x = SIGN_POW2_DIV(i2_tmp_mv_x, 3);
  ------------------
  |  |   67|  7.41M|#define SIGN_POW2_DIV(x, y) (((x) < 0) ? (-((-(x)) >> (y))) : ((x) >> (y)))
  |  |  ------------------
  |  |  |  Branch (67:30): [True: 252k, False: 7.16M]
  |  |  ------------------
  ------------------
  744|  7.41M|        i2_tmp_mv_y = SIGN_POW2_DIV(i2_tmp_mv_y, 3);
  ------------------
  |  |   67|  7.41M|#define SIGN_POW2_DIV(x, y) (((x) < 0) ? (-((-(x)) >> (y))) : ((x) >> (y)))
  |  |  ------------------
  |  |  |  Branch (67:30): [True: 239k, False: 7.17M]
  |  |  ------------------
  ------------------
  745|  7.41M|        i1_mc_wd = u1_part_wd << 1;
  746|  7.41M|        u1_dma_ht = u1_part_ht << 1;
  747|  7.41M|        if(u1_dx)
  ------------------
  |  Branch (747:12): [True: 541k, False: 6.87M]
  ------------------
  748|   541k|        {
  749|   541k|            if(i2_mv_x < 0)
  ------------------
  |  Branch (749:16): [True: 243k, False: 298k]
  ------------------
  750|   243k|                i2_tmp_mv_x -= 1;
  751|   541k|            i1_mc_wd++;
  752|   541k|        }
  753|  7.41M|        if(u1_dy != 0)
  ------------------
  |  Branch (753:12): [True: 492k, False: 6.92M]
  ------------------
  754|   492k|        {
  755|   492k|            if(i2_mv_y < 0)
  ------------------
  |  Branch (755:16): [True: 225k, False: 266k]
  ------------------
  756|   225k|                i2_tmp_mv_y -= 1;
  757|   492k|            u1_dma_ht++;
  758|   492k|        }
  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.41M|        u2_pic_ht >>= 1;
  765|  7.41M|        u2_frm_wd = ps_dec->u2_frm_wd_uv << u1_pic_fld;
  766|  7.41M|        i2_frm_x = (u2_mb_x << 3) + (u1_sub_x << 1) + i2_tmp_mv_x;
  767|  7.41M|        i2_frm_y = ((u2_mb_y + (u1_mb_bot && !u1_mb_fld)) << 3)
  ------------------
  |  Branch (767:33): [True: 0, False: 7.41M]
  |  Branch (767:46): [True: 0, False: 0]
  ------------------
  768|  7.41M|                        + (((u1_sub_y << 1) + i2_tmp_mv_y) << u1_mb_fld);
  769|       |
  770|  7.41M|        i2_frm_x = CLIP3(MAX_OFFSET_OUTSIDE_UV_FRM,
  ------------------
  |  |   77|  7.41M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 4.93k, False: 7.41M]
  |  |  |  Branch (77:54): [True: 59.8k, False: 7.35M]
  |  |  ------------------
  ------------------
  771|  7.41M|                         ((ps_dec->u2_pic_wd >> 1) - 1), i2_frm_x);
  772|  7.41M|        i2_frm_y = CLIP3(((1 - u1_dma_ht) << u1_mb_fld),
  ------------------
  |  |   77|  7.41M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 5.03k, False: 7.41M]
  |  |  |  Branch (77:54): [True: 13.0k, False: 7.40M]
  |  |  ------------------
  ------------------
  773|  7.41M|                         (u2_pic_ht - (1 << u1_mb_fld)), i2_frm_y);
  774|       |
  775|  7.41M|        i4_ref_offset = i2_frm_y * u2_frm_wd + i2_frm_x * YUV420SP_FACTOR;
  ------------------
  |  |  119|  7.41M|#define YUV420SP_FACTOR 2
  ------------------
  776|  7.41M|        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.41M|        u2_rec_wd = BLK8x8SIZE * YUV420SP_FACTOR;
  ------------------
  |  |  555|  7.41M|#define BLK8x8SIZE          8
  ------------------
                      u2_rec_wd = BLK8x8SIZE * YUV420SP_FACTOR;
  ------------------
  |  |  119|  7.41M|#define YUV420SP_FACTOR 2
  ------------------
  784|  7.41M|        i2_rec_x = u1_sub_x << 1;
  785|  7.41M|        i2_rec_y = u1_sub_y << 1;
  786|  7.41M|        i4_rec_offset = i2_rec_y * u2_rec_wd + i2_rec_x * YUV420SP_FACTOR;
  ------------------
  |  |  119|  7.41M|#define YUV420SP_FACTOR 2
  ------------------
  787|  7.41M|        {
  788|  7.41M|            u2_rec_wd = ps_dec->u2_frm_wd_uv << u1_mb_or_pic_fld;
  789|       |
  790|  7.41M|            i2_rec_x += (mb_index << 3);
  791|  7.41M|            i4_rec_offset = i2_rec_y * u2_rec_wd + i2_rec_x * YUV420SP_FACTOR;
  ------------------
  |  |  119|  7.41M|#define YUV420SP_FACTOR 2
  ------------------
  792|  7.41M|            if(u1_mb_bot)
  ------------------
  |  Branch (792:16): [True: 0, False: 7.41M]
  ------------------
  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.41M|            ps_pred->pu1_rec_y_u = ps_frame_buf->pu1_dest_u + i4_rec_offset;
  795|  7.41M|            ps_pred->u1_pi1_wt_ofst_rec_v = ps_frame_buf->pu1_dest_v
  796|  7.41M|                            + i4_rec_offset;
  797|       |
  798|  7.41M|        }
  799|       |
  800|       |        /* CHANGED CODE */
  801|       |
  802|       |        /* filling the common pred structures for U */
  803|  7.41M|        u2_frm_wd = ps_dec->u2_frm_wd_uv << u1_mb_or_pic_fld;
  804|  7.41M|        u1_tmp_dma_ht = u1_dma_ht;
  805|  7.41M|        ps_pred->u2_u1_ref_buf_wd = u1_dma_wd;
  806|  7.41M|        ps_pred->u2_frm_wd = u2_frm_wd;
  807|  7.41M|        ps_pred->i1_dma_ht = u1_dma_ht;
  808|  7.41M|        ps_pred->i1_mc_wd = i1_mc_wd;
  809|  7.41M|        ps_pred->u2_dst_stride = u2_rec_wd;
  810|       |
  811|  7.41M|        ps_pred->i1_mb_partwidth = u1_part_wd << 1;
  812|  7.41M|        ps_pred->i1_mb_partheight = u1_part_ht << 1;
  813|  7.41M|        ps_pred->u1_dydx = (u1_dy << 3) + u1_dx;
  814|  7.41M|        ps_pred->u1_is_bi_direct = u1_is_bi_dir;
  815|  7.41M|        ps_pred->u1_wght_pred_type = u1_wght_pred_type;
  816|  7.41M|        ps_pred->i1_pod_ht = 0;
  817|       |
  818|  7.41M|        ps_pred->pu1_dma_dest_addr = pu1_ref_buf;
  819|       |
  820|       |        /* unrestricted field motion comp for top region outside frame */
  821|  7.41M|        i2_pod_ht = (-i2_frm_y) >> u1_mb_fld;
  822|  7.41M|        if((i2_pod_ht > 0) && u1_pod_top)
  ------------------
  |  Branch (822:12): [True: 17.0k, False: 7.40M]
  |  Branch (822:31): [True: 0, False: 17.0k]
  ------------------
  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.41M|        else if(u1_pod_bot)
  ------------------
  |  Branch (829:17): [True: 0, False: 7.41M]
  ------------------
  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.41M|        pu1_pred_u = pu1_buf2 + i4_ref_offset;
  840|  7.41M|        pu1_pred_v = pu1_buf3 + i4_ref_offset;
  841|       |
  842|       |        /* Copy U & V partitions */
  843|  7.41M|        if(ps_pred->i1_pod_ht)
  ------------------
  |  Branch (843:12): [True: 0, False: 7.41M]
  ------------------
  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.41M|        ps_pred->pu1_u_ref = pu1_pred_u;
  851|       |
  852|       |        /* Increment the reference buffer Index */
  853|  7.41M|        u2_tot_ref_scratch_size += (u1_dma_wd * u1_tmp_dma_ht) << 1;
  854|       |
  855|  7.41M|        if(ps_pred->i1_pod_ht)
  ------------------
  |  Branch (855:12): [True: 0, False: 7.41M]
  ------------------
  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.41M|        ps_pred->pu1_v_ref = pu1_pred_v;
  863|  7.41M|    }
  864|       |
  865|       |    /* Increment ps_pred index */
  866|  7.41M|    ps_dec->u4_pred_info_idx += 2;
  867|       |
  868|       |
  869|       |    /* Increment the reference buffer Index */
  870|  7.41M|    ps_dec->u4_dma_buf_idx += u2_tot_ref_scratch_size;
  871|       |
  872|  7.41M|    if(ps_dec->u4_dma_buf_idx > MAX_REF_BUF_SIZE)
  ------------------
  |  |   68|  7.41M|#define MAX_REF_BUF_SIZE       (3776*2*2)
  ------------------
  |  Branch (872:8): [True: 0, False: 7.41M]
  ------------------
  873|      0|        return ERROR_NUM_MV;
  874|       |
  875|  7.41M|    return OK;
  ------------------
  |  |  114|  7.41M|#define OK        0
  ------------------
  876|       |
  877|       |
  878|       |
  879|  7.41M|}
ih264d_motion_compensate_bp:
  904|  5.03M|{
  905|  5.03M|    pred_info_t *ps_pred ;
  906|  5.03M|    UWORD8 *puc_ref, *pu1_dest_y;
  907|  5.03M|    UWORD8 *pu1_dest_u;
  908|  5.03M|    UWORD32 u2_num_pels, u2_ref_wd_y, u2_ref_wd_uv, u2_dst_wd;
  909|       |
  910|  5.03M|    UWORD32 u4_wd_y, u4_ht_y, u4_wd_uv;
  911|  5.03M|    UWORD32 u4_ht_uv;
  912|  5.03M|    UWORD8 *puc_pred0 = (UWORD8 *)(ps_dec->pi2_pred1);
  913|       |
  914|       |
  915|  5.03M|    PROFILE_DISABLE_INTER_PRED()
  ------------------
  |  |  119|  5.03M|#define PROFILE_DISABLE_INTER_PRED() ;
  ------------------
  916|  5.03M|    UNUSED(ps_cur_mb_info);
  ------------------
  |  |   45|  5.03M|#define UNUSED(x) ((void)(x))
  ------------------
  917|  5.03M|    ps_pred = ps_dec->ps_pred ;
  918|       |
  919|  10.1M|    for(u2_num_pels = 0; u2_num_pels < 256;)
  ------------------
  |  Branch (919:26): [True: 5.14M, False: 5.03M]
  ------------------
  920|  5.14M|    {
  921|  5.14M|        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.14M|        u2_ref_wd_y = ps_pred->u2_frm_wd;
  931|  5.14M|        puc_ref = ps_pred->pu1_y_ref;
  932|  5.14M|        if(ps_pred->u1_dydx & 0x3)
  ------------------
  |  Branch (932:12): [True: 121k, False: 5.02M]
  ------------------
  933|   121k|            puc_ref += 2;
  934|  5.14M|        if(ps_pred->u1_dydx >> 2)
  ------------------
  |  Branch (934:12): [True: 109k, False: 5.03M]
  ------------------
  935|   109k|            puc_ref += 2 * u2_ref_wd_y;
  936|       |
  937|  5.14M|        u4_wd_y = ps_pred->i1_mb_partwidth;
  938|  5.14M|        u4_ht_y = ps_pred->i1_mb_partheight;
  939|  5.14M|        uc_dx = ps_pred->u1_dydx;
  940|  5.14M|        uc_dy = uc_dx >> 2;
  941|  5.14M|        uc_dx &= 0x3;
  942|       |
  943|  5.14M|        pu1_dest_y = ps_pred->pu1_rec_y_u;
  944|  5.14M|        u2_dst_wd = ps_pred->u2_dst_stride;
  945|       |
  946|  5.14M|        ps_dec->apf_inter_pred_luma[ps_pred->u1_dydx](puc_ref, pu1_dest_y,
  947|  5.14M|                                                      u2_ref_wd_y,
  948|  5.14M|                                                      u2_dst_wd,
  949|  5.14M|                                                      u4_ht_y,
  950|  5.14M|                                                      u4_wd_y, puc_pred0,
  951|  5.14M|                                                      ps_pred->u1_dydx);
  952|       |
  953|  5.14M|        ps_pred++;
  954|       |
  955|       |        /* Interpolate samples for the chroma components */
  956|  5.14M|        {
  957|  5.14M|            UWORD8 *pu1_ref_u;
  958|       |
  959|  5.14M|            u2_ref_wd_uv = ps_pred->u2_frm_wd;
  960|  5.14M|            pu1_ref_u = ps_pred->pu1_u_ref;
  961|       |
  962|  5.14M|            u4_wd_uv = ps_pred->i1_mb_partwidth;
  963|  5.14M|            u4_ht_uv = ps_pred->i1_mb_partheight;
  964|  5.14M|            uc_dx = ps_pred->u1_dydx; /* 8*dy + dx */
  965|  5.14M|            uc_dy = uc_dx >> 3;
  966|  5.14M|            uc_dx &= 0x7;
  967|       |
  968|  5.14M|            pu1_dest_u = ps_pred->pu1_rec_y_u;
  969|  5.14M|            u2_dst_wd = ps_pred->u2_dst_stride;
  970|       |
  971|  5.14M|            ps_pred++;
  972|  5.14M|            ps_dec->pf_inter_pred_chroma(pu1_ref_u, pu1_dest_u, u2_ref_wd_uv,
  973|  5.14M|                                         u2_dst_wd, uc_dx, uc_dy,
  974|  5.14M|                                         u4_ht_uv, u4_wd_uv);
  975|       |
  976|  5.14M|        }
  977|       |
  978|  5.14M|        u2_num_pels += (UWORD8)u4_wd_y * (UWORD8)u4_ht_y;
  979|       |
  980|  5.14M|    }
  981|  5.03M|}
ih264d_motion_compensate_mp:
 1006|  6.34M|{
 1007|  6.34M|    pred_info_t *ps_pred ;
 1008|  6.34M|    pred_info_t *ps_pred_y_forw, *ps_pred_y_back, *ps_pred_cr_forw;
 1009|  6.34M|    UWORD8 *puc_ref, *pu1_dest_y, *puc_pred0, *puc_pred1;
 1010|  6.34M|    UWORD8 *pu1_dest_u, *pu1_dest_v;
 1011|  6.34M|    WORD16 *pi16_intm;
 1012|  6.34M|    UWORD32 u2_num_pels, u2_ref_wd_y, u2_ref_wd_uv, u2_dst_wd;
 1013|  6.34M|    UWORD32 u2_dest_wd_y, u2_dest_wd_uv;
 1014|  6.34M|    UWORD32 u2_row_buf_wd_y = 0;
 1015|  6.34M|    UWORD32 u2_row_buf_wd_uv = 0;
 1016|  6.34M|    UWORD32 u2_log2Y_crwd;
 1017|  6.34M|    UWORD32 u4_wd_y, u4_ht_y, u1_dir, u4_wd_uv;
 1018|  6.34M|    UWORD32 u4_ht_uv;
 1019|  6.34M|    UWORD8 *pu1_temp_mc_buffer = ps_dec->pu1_temp_mc_buffer;
 1020|  6.34M|    WORD32 i2_pod_ht;
 1021|  6.34M|    UWORD32 u2_pic_ht, u2_frm_wd, u2_rec_wd;
 1022|  6.34M|    UWORD32 u1_pod_bot, u1_pod_top;
 1023|  6.34M|    UWORD8 *pu1_pred, *pu1_dma_dst;
 1024|  6.34M|    UWORD32 u1_dma_wd, u1_dma_ht;
 1025|       |
 1026|  6.34M|    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.34M|    UWORD32 u1_mb_fld = 0, u1_mb_or_pic_fld;
 1030|  6.34M|    UWORD32 u1_mb_or_pic_bot;
 1031|       |    /* calculate flags specifying field nature of picture & mb */
 1032|  6.34M|    const UWORD8 u1_pic_fld = ps_cur_slice->u1_field_pic_flag;
 1033|       |
 1034|  6.34M|    PROFILE_DISABLE_INTER_PRED()
  ------------------
  |  |  119|  6.34M|#define PROFILE_DISABLE_INTER_PRED() ;
  ------------------
 1035|  6.34M|    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.34M|    ps_pred_y_forw = ps_pred;
 1039|  6.34M|    ps_pred_y_back = ps_pred;
 1040|  6.34M|    ps_pred_cr_forw = ps_pred;
 1041|       |
 1042|  6.34M|    u2_log2Y_crwd = ps_dec->ps_decode_cur_slice->u2_log2Y_crwd;
 1043|       |
 1044|  6.34M|    if(!u1_pic_fld)
  ------------------
  |  Branch (1044:8): [True: 6.34M, False: 0]
  ------------------
 1045|  6.34M|    {
 1046|  6.34M|        u1_mb_fld = ps_cur_mb_info->u1_mb_field_decodingflag;
 1047|  6.34M|    }
 1048|       |
 1049|  6.34M|    u1_mb_or_pic_fld = u1_mb_fld | u1_pic_fld;
 1050|       |
 1051|  6.34M|    pi16_intm = ps_dec->pi2_pred1;
 1052|  6.34M|    puc_pred0 = (UWORD8 *)pi16_intm;
 1053|  6.34M|    puc_pred1 = puc_pred0 + PRED_BUFFER_WIDTH * PRED_BUFFER_HEIGHT * sizeof(WORD16);
  ------------------
  |  |   55|  6.34M|#define PRED_BUFFER_WIDTH   24*2
  ------------------
                  puc_pred1 = puc_pred0 + PRED_BUFFER_WIDTH * PRED_BUFFER_HEIGHT * sizeof(WORD16);
  ------------------
  |  |   56|  6.34M|#define PRED_BUFFER_HEIGHT  24*2
  ------------------
 1054|       |
 1055|  12.9M|    for(u2_num_pels = 0; u2_num_pels < 256;)
  ------------------
  |  Branch (1055:26): [True: 6.65M, False: 6.34M]
  ------------------
 1056|  6.65M|    {
 1057|  6.65M|        UWORD8 uc_dx, uc_dy;
 1058|  6.65M|        const UWORD8 u1_is_bi_direct = ps_pred->u1_is_bi_direct;
 1059|  14.0M|        for(u1_dir = 0; u1_dir <= u1_is_bi_direct; u1_dir++)
  ------------------
  |  Branch (1059:25): [True: 7.41M, False: 6.65M]
  ------------------
 1060|  7.41M|        {
 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.41M|            if(ps_pred->i1_pod_ht)
  ------------------
  |  Branch (1069:16): [True: 0, False: 7.41M]
  ------------------
 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.41M|            else
 1075|  7.41M|            {
 1076|  7.41M|                u2_ref_wd_y = ps_pred->u2_frm_wd;
 1077|  7.41M|                puc_ref = ps_pred->pu1_y_ref;
 1078|       |
 1079|  7.41M|            }
 1080|       |
 1081|  7.41M|            if(ps_pred->u1_dydx & 0x3)
  ------------------
  |  Branch (1081:16): [True: 484k, False: 6.92M]
  ------------------
 1082|   484k|                puc_ref += 2;
 1083|  7.41M|            if(ps_pred->u1_dydx >> 2)
  ------------------
  |  Branch (1083:16): [True: 445k, False: 6.96M]
  ------------------
 1084|   445k|                puc_ref += 2 * u2_ref_wd_y;
 1085|  7.41M|            u4_wd_y = ps_pred->i1_mb_partwidth;
 1086|  7.41M|            u4_ht_y = ps_pred->i1_mb_partheight;
 1087|       |
 1088|  7.41M|            uc_dx = ps_pred->u1_dydx;
 1089|  7.41M|            uc_dy = uc_dx >> 2;
 1090|  7.41M|            uc_dx &= 0x3;
 1091|  7.41M|            if(u1_dir == 0)
  ------------------
  |  Branch (1091:16): [True: 6.65M, False: 759k]
  ------------------
 1092|  6.65M|            {
 1093|  6.65M|                pu1_dest_y = ps_pred->pu1_rec_y_u;
 1094|  6.65M|                u2_row_buf_wd_y = ps_pred->u2_dst_stride;
 1095|  6.65M|                u2_dst_wd = ps_pred->u2_dst_stride;
 1096|  6.65M|                u2_dest_wd_y = u2_dst_wd;
 1097|  6.65M|                ps_pred_y_forw = ps_pred;
 1098|  6.65M|            }
 1099|   759k|            else
 1100|   759k|            {
 1101|   759k|                pu1_dest_y = pu1_temp_mc_buffer;
 1102|   759k|                u2_dst_wd = MB_SIZE;
  ------------------
  |  |  554|   759k|#define MB_SIZE             16
  ------------------
 1103|   759k|                u2_dest_wd_y = u2_dst_wd;
 1104|   759k|                ps_pred_y_back = ps_pred;
 1105|   759k|                ps_pred_y_back->pu1_rec_y_u = pu1_dest_y;
 1106|   759k|            }
 1107|       |
 1108|       |            /* padding on demand (POD) for y done here */
 1109|       |
 1110|  7.41M|            if(ps_pred->i1_pod_ht)
  ------------------
  |  Branch (1110:16): [True: 0, False: 7.41M]
  ------------------
 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.41M|            ps_dec->apf_inter_pred_luma[ps_pred->u1_dydx](puc_ref, pu1_dest_y,
 1126|  7.41M|                                                          u2_ref_wd_y,
 1127|  7.41M|                                                          u2_dst_wd,
 1128|  7.41M|                                                          u4_ht_y,
 1129|  7.41M|                                                          u4_wd_y,
 1130|  7.41M|                                                          puc_pred0,
 1131|  7.41M|                                                          ps_pred->u1_dydx);
 1132|  7.41M|            ps_pred++;
 1133|       |
 1134|       |            /* Interpolate samples for the chroma components */
 1135|  7.41M|            {
 1136|  7.41M|                UWORD8 *pu1_ref_u;
 1137|  7.41M|                UWORD32 u1_dma_ht;
 1138|       |
 1139|       |                /* padding on demand (POD) for U and V done here */
 1140|  7.41M|                u1_dma_ht = ps_pred->i1_dma_ht;
 1141|       |
 1142|  7.41M|                if(ps_pred->i1_pod_ht)
  ------------------
  |  Branch (1142:20): [True: 0, False: 7.41M]
  ------------------
 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.41M|                if(ps_pred->i1_pod_ht)
  ------------------
  |  Branch (1167:20): [True: 0, False: 7.41M]
  ------------------
 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.41M|                else
 1175|  7.41M|                {
 1176|  7.41M|                    u2_ref_wd_uv = ps_pred->u2_frm_wd;
 1177|  7.41M|                    pu1_ref_u = ps_pred->pu1_u_ref;
 1178|       |
 1179|  7.41M|                }
 1180|       |
 1181|  7.41M|                u4_wd_uv = ps_pred->i1_mb_partwidth;
 1182|  7.41M|                u4_ht_uv = ps_pred->i1_mb_partheight;
 1183|  7.41M|                uc_dx = ps_pred->u1_dydx; /* 8*dy + dx */
 1184|  7.41M|                uc_dy = uc_dx >> 3;
 1185|  7.41M|                uc_dx &= 0x7;
 1186|  7.41M|                if(u1_dir == 0)
  ------------------
  |  Branch (1186:20): [True: 6.65M, False: 759k]
  ------------------
 1187|  6.65M|                {
 1188|  6.65M|                    pu1_dest_u = ps_pred->pu1_rec_y_u;
 1189|       |
 1190|  6.65M|                    pu1_dest_v = ps_pred->u1_pi1_wt_ofst_rec_v;
 1191|  6.65M|                    u2_row_buf_wd_uv = ps_pred->u2_dst_stride;
 1192|  6.65M|                    u2_dst_wd = ps_pred->u2_dst_stride;
 1193|  6.65M|                    u2_dest_wd_uv = u2_dst_wd;
 1194|  6.65M|                    ps_pred_cr_forw = ps_pred;
 1195|  6.65M|                }
 1196|   759k|                else
 1197|   759k|                {
 1198|   759k|                    pu1_dest_u = puc_pred0;
 1199|       |
 1200|   759k|                    pu1_dest_v = puc_pred1;
 1201|   759k|                    u2_dest_wd_uv = BUFFER_WIDTH;
  ------------------
  |  |   42|   759k|#define BUFFER_WIDTH        16
  ------------------
 1202|   759k|                    u2_dst_wd = BUFFER_WIDTH;
  ------------------
  |  |   42|   759k|#define BUFFER_WIDTH        16
  ------------------
 1203|   759k|                    ps_pred->pu1_rec_y_u = pu1_dest_u;
 1204|   759k|                    ps_pred->u1_pi1_wt_ofst_rec_v = pu1_dest_v;
 1205|   759k|                }
 1206|       |
 1207|  7.41M|                ps_pred++;
 1208|  7.41M|                ps_dec->pf_inter_pred_chroma(pu1_ref_u, pu1_dest_u,
 1209|  7.41M|                                             u2_ref_wd_uv, u2_dst_wd,
 1210|  7.41M|                                             uc_dx, uc_dy, u4_ht_uv,
 1211|  7.41M|                                             u4_wd_uv);
 1212|       |
 1213|  7.41M|                if(ps_cur_mb_info->u1_Mux == 1)
  ------------------
  |  Branch (1213:20): [True: 5.57k, False: 7.40M]
  ------------------
 1214|  5.57k|                {
 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|  5.57k|                    if((ps_pred + 1)->i1_pod_ht)
  ------------------
  |  Branch (1223:24): [True: 0, False: 5.57k]
  ------------------
 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|  5.57k|                    ih264d_multiplex_ref_data(ps_dec, ps_pred, pu1_dest_y,
 1248|  5.57k|                                              pu1_dest_u, ps_cur_mb_info,
 1249|  5.57k|                                              u2_dest_wd_y, u2_dest_wd_uv,
 1250|  5.57k|                                              u1_dir);
 1251|  5.57k|                    ps_pred += 2;
 1252|  5.57k|                }
 1253|  7.41M|            }
 1254|  7.41M|        }
 1255|  6.65M|        if(u1_dir != 0)
  ------------------
  |  Branch (1255:12): [True: 6.65M, False: 0]
  ------------------
 1256|  6.65M|            u2_ref_wd_y = MB_SIZE;
  ------------------
  |  |  554|  6.65M|#define MB_SIZE             16
  ------------------
 1257|       |
 1258|  6.65M|        u2_num_pels += u4_wd_y * u4_ht_y;
 1259|       |        /* if BI_DIRECT, average the two pred's, and put in ..PredBuffer[0] */
 1260|  6.65M|        if((u1_is_bi_direct != 0) || (ps_pred_y_forw->u1_wght_pred_type != 0))
  ------------------
  |  Branch (1260:12): [True: 759k, False: 5.89M]
  |  Branch (1260:38): [True: 4.88M, False: 1.00M]
  ------------------
 1261|  5.64M|        {
 1262|       |
 1263|  5.64M|            switch(ps_pred_y_forw->u1_wght_pred_type)
  ------------------
  |  Branch (1263:20): [True: 5.64M, False: 0]
  ------------------
 1264|  5.64M|            {
 1265|   304k|                case 0:
  ------------------
  |  Branch (1265:17): [True: 304k, False: 5.34M]
  ------------------
 1266|   304k|                    ps_dec->pf_default_weighted_pred_luma(
 1267|   304k|                                    ps_pred_y_forw->pu1_rec_y_u, pu1_dest_y,
 1268|   304k|                                    ps_pred_y_forw->pu1_rec_y_u,
 1269|   304k|                                    u2_row_buf_wd_y, u2_ref_wd_y,
 1270|   304k|                                    u2_row_buf_wd_y, u4_ht_uv * 2,
 1271|   304k|                                    u4_wd_uv * 2);
 1272|       |
 1273|   304k|                    ps_dec->pf_default_weighted_pred_chroma(
 1274|   304k|                                    ps_pred_cr_forw->pu1_rec_y_u, pu1_dest_u,
 1275|   304k|                                    ps_pred_cr_forw->pu1_rec_y_u,
 1276|   304k|                                    u2_row_buf_wd_uv, u2_dst_wd,
 1277|   304k|                                    u2_row_buf_wd_uv, u4_ht_uv,
 1278|   304k|                                    u4_wd_uv);
 1279|       |
 1280|   304k|                    break;
 1281|  4.88M|                case 1:
  ------------------
  |  Branch (1281:17): [True: 4.88M, False: 759k]
  ------------------
 1282|  4.88M|                {
 1283|  4.88M|                    UWORD32 *pu4_weight_ofst =
 1284|  4.88M|                                    (UWORD32*)ps_pred_y_forw->u1_pi1_wt_ofst_rec_v;
 1285|  4.88M|                    UWORD32 u4_wt_ofst_u, u4_wt_ofst_v;
 1286|  4.88M|                    UWORD32 u4_wt_ofst_y =
 1287|  4.88M|                                    (UWORD32)(pu4_weight_ofst[0]);
 1288|  4.88M|                    WORD32 weight = (WORD16)(u4_wt_ofst_y & 0xffff);
 1289|  4.88M|                    WORD32 ofst = (WORD8)(u4_wt_ofst_y >> 16);
 1290|       |
 1291|  4.88M|                    ps_dec->pf_weighted_pred_luma(ps_pred_y_forw->pu1_rec_y_u,
 1292|  4.88M|                                                  ps_pred_y_forw->pu1_rec_y_u,
 1293|  4.88M|                                                  u2_row_buf_wd_y,
 1294|  4.88M|                                                  u2_row_buf_wd_y,
 1295|  4.88M|                                                  (u2_log2Y_crwd & 0x0ff),
 1296|  4.88M|                                                  weight, ofst, u4_ht_y,
 1297|  4.88M|                                                  u4_wd_y);
 1298|       |
 1299|  4.88M|                    u4_wt_ofst_u = (UWORD32)(pu4_weight_ofst[2]);
 1300|  4.88M|                    u4_wt_ofst_v = (UWORD32)(pu4_weight_ofst[4]);
 1301|  4.88M|                    weight = ((u4_wt_ofst_v & 0xffff) << 16)
 1302|  4.88M|                                    | (u4_wt_ofst_u & 0xffff);
 1303|  4.88M|                    ofst = ((u4_wt_ofst_v >> 16) << 8)
 1304|  4.88M|                                    | ((u4_wt_ofst_u >> 16) & 0xFF);
 1305|       |
 1306|  4.88M|                    ps_dec->pf_weighted_pred_chroma(
 1307|  4.88M|                                    ps_pred_cr_forw->pu1_rec_y_u,
 1308|  4.88M|                                    ps_pred_cr_forw->pu1_rec_y_u,
 1309|  4.88M|                                    u2_row_buf_wd_uv, u2_row_buf_wd_uv,
 1310|  4.88M|                                    (u2_log2Y_crwd >> 8), weight, ofst,
 1311|  4.88M|                                    u4_ht_y >> 1, u4_wd_y >> 1);
 1312|  4.88M|                }
 1313|       |
 1314|  4.88M|                    break;
 1315|   454k|                case 2:
  ------------------
  |  Branch (1315:17): [True: 454k, False: 5.19M]
  ------------------
 1316|   454k|                {
 1317|   454k|                    UWORD32 *pu4_weight_ofst =
 1318|   454k|                                    (UWORD32*)ps_pred_y_forw->u1_pi1_wt_ofst_rec_v;
 1319|   454k|                    UWORD32 u4_wt_ofst_u, u4_wt_ofst_v;
 1320|   454k|                    UWORD32 u4_wt_ofst_y;
 1321|   454k|                    WORD32 weight1, weight2;
 1322|   454k|                    WORD32 ofst1, ofst2;
 1323|       |
 1324|   454k|                    u4_wt_ofst_y = (UWORD32)(pu4_weight_ofst[0]);
 1325|       |
 1326|   454k|                    weight1 = (WORD16)(u4_wt_ofst_y & 0xffff);
 1327|   454k|                    ofst1 = (WORD8)(u4_wt_ofst_y >> 16);
 1328|       |
 1329|   454k|                    u4_wt_ofst_y = (UWORD32)(pu4_weight_ofst[1]);
 1330|   454k|                    weight2 = (WORD16)(u4_wt_ofst_y & 0xffff);
 1331|   454k|                    ofst2 = (WORD8)(u4_wt_ofst_y >> 16);
 1332|       |
 1333|   454k|                    ps_dec->pf_weighted_bi_pred_luma(ps_pred_y_forw->pu1_rec_y_u,
 1334|   454k|                                                     ps_pred_y_back->pu1_rec_y_u,
 1335|   454k|                                                     ps_pred_y_forw->pu1_rec_y_u,
 1336|   454k|                                                     u2_row_buf_wd_y,
 1337|   454k|                                                     u2_ref_wd_y,
 1338|   454k|                                                     u2_row_buf_wd_y,
 1339|   454k|                                                     (u2_log2Y_crwd & 0x0ff),
 1340|   454k|                                                     weight1, weight2, ofst1,
 1341|   454k|                                                     ofst2, u4_ht_y,
 1342|   454k|                                                     u4_wd_y);
 1343|       |
 1344|   454k|                    u4_wt_ofst_u = (UWORD32)(pu4_weight_ofst[2]);
 1345|   454k|                    u4_wt_ofst_v = (UWORD32)(pu4_weight_ofst[4]);
 1346|   454k|                    weight1 = ((u4_wt_ofst_v & 0xffff) << 16)
 1347|   454k|                                    | (u4_wt_ofst_u & 0xffff);
 1348|   454k|                    ofst1 = ((u4_wt_ofst_v >> 16) << 8)
 1349|   454k|                                    | ((u4_wt_ofst_u >> 16) & 0xFF);
 1350|       |
 1351|   454k|                    u4_wt_ofst_u = (UWORD32)(pu4_weight_ofst[3]);
 1352|   454k|                    u4_wt_ofst_v = (UWORD32)(pu4_weight_ofst[5]);
 1353|   454k|                    weight2 = ((u4_wt_ofst_v & 0xffff) << 16)
 1354|   454k|                                    | (u4_wt_ofst_u & 0xffff);
 1355|   454k|                    ofst2 = ((u4_wt_ofst_v >> 16) << 8)
 1356|   454k|                                    | ((u4_wt_ofst_u >> 16) & 0xFF);
 1357|       |
 1358|   454k|                    ps_dec->pf_weighted_bi_pred_chroma(
 1359|   454k|                                    (ps_pred_y_forw + 1)->pu1_rec_y_u,
 1360|   454k|                                    (ps_pred_y_back + 1)->pu1_rec_y_u,
 1361|   454k|                                    (ps_pred_y_forw + 1)->pu1_rec_y_u,
 1362|   454k|                                    u2_row_buf_wd_uv, u2_dst_wd,
 1363|   454k|                                    u2_row_buf_wd_uv, (u2_log2Y_crwd >> 8),
 1364|   454k|                                    weight1, weight2, ofst1, ofst2,
 1365|   454k|                                    u4_ht_y >> 1, u4_wd_y >> 1);
 1366|   454k|                }
 1367|       |
 1368|   454k|                    break;
 1369|  5.64M|            }
 1370|       |
 1371|  5.64M|        }
 1372|  6.65M|    }
 1373|  6.34M|}
ih264d_multiplex_ref_data:
 1397|  5.57k|{
 1398|  5.57k|    UWORD16 u2_mask = ps_cur_mb_info->u2_mask[u1_dir];
 1399|  5.57k|    UWORD8 *pu1_ref_y, *pu1_ref_u;
 1400|  5.57k|    UWORD8 uc_cond, i, j, u1_dydx;
 1401|  5.57k|    UWORD16 u2_ref_wd_y, u2_ref_wd_uv;
 1402|       |
 1403|  5.57k|    PROFILE_DISABLE_INTER_PRED()
  ------------------
  |  |  119|  5.57k|#define PROFILE_DISABLE_INTER_PRED() ;
  ------------------
 1404|       |
 1405|  5.57k|    if(ps_pred->i1_pod_ht)
  ------------------
  |  Branch (1405:8): [True: 0, False: 5.57k]
  ------------------
 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|  5.57k|    else
 1412|  5.57k|    {
 1413|  5.57k|        pu1_ref_y = ps_pred->pu1_y_ref;
 1414|  5.57k|        u2_ref_wd_y = ps_pred->u2_frm_wd;
 1415|  5.57k|    }
 1416|       |
 1417|  5.57k|    ps_pred++;
 1418|  5.57k|    if(ps_pred->i1_pod_ht)
  ------------------
  |  Branch (1418:8): [True: 0, False: 5.57k]
  ------------------
 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|  5.57k|    else
 1425|  5.57k|    {
 1426|  5.57k|        pu1_ref_u = ps_pred->pu1_u_ref;
 1427|  5.57k|        u2_ref_wd_uv = ps_pred->u2_frm_wd;
 1428|       |
 1429|  5.57k|    }
 1430|       |
 1431|  5.57k|    u1_dydx = ps_pred->u1_dydx;
 1432|       |
 1433|  5.57k|    {
 1434|  5.57k|        UWORD8 uc_dx, uc_dy;
 1435|  5.57k|        UWORD8 *pu1_scratch_u;
 1436|       |
 1437|  5.57k|        uc_dx = u1_dydx & 0x3;
 1438|  5.57k|        uc_dy = u1_dydx >> 3;
 1439|  5.57k|        if(u1_dydx != 0)
  ------------------
  |  Branch (1439:12): [True: 0, False: 5.57k]
  ------------------
 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|  5.57k|    }
 1454|  5.57k|    {
 1455|  27.8k|        for(i = 0; i < 4; i++)
  ------------------
  |  Branch (1455:20): [True: 22.3k, False: 5.57k]
  ------------------
 1456|  22.3k|        {
 1457|   111k|            for(j = 0; j < 4; j++)
  ------------------
  |  Branch (1457:24): [True: 89.2k, False: 22.3k]
  ------------------
 1458|  89.2k|            {
 1459|  89.2k|                uc_cond = u2_mask & 1;
 1460|  89.2k|                u2_mask >>= 1;
 1461|  89.2k|                if(uc_cond)
  ------------------
  |  Branch (1461:20): [True: 13.6k, False: 75.6k]
  ------------------
 1462|  13.6k|                {
 1463|  13.6k|                    *(UWORD32 *)(pu1_dest_y + u2_dest_wd_y) =
 1464|  13.6k|                                    *(UWORD32 *)(pu1_ref_y + u2_ref_wd_y);
 1465|  13.6k|                    *(UWORD32 *)(pu1_dest_y + 2 * u2_dest_wd_y) =
 1466|  13.6k|                                    *(UWORD32 *)(pu1_ref_y + 2 * u2_ref_wd_y);
 1467|  13.6k|                    *(UWORD32 *)(pu1_dest_y + 3 * u2_dest_wd_y) =
 1468|  13.6k|                                    *(UWORD32 *)(pu1_ref_y + 3 * u2_ref_wd_y);
 1469|  13.6k|                    {
 1470|  13.6k|                        UWORD32 *dst, *src;
 1471|  13.6k|                        dst = (UWORD32 *)pu1_dest_y;
 1472|  13.6k|                        src = (UWORD32 *)pu1_ref_y;
 1473|  13.6k|                        *dst = *src;
 1474|  13.6k|                        dst++;
 1475|  13.6k|                        src++;
 1476|  13.6k|                        pu1_dest_y = (UWORD8 *)dst;
 1477|  13.6k|                        pu1_ref_y = (UWORD8 *)src;
 1478|  13.6k|                    }
 1479|  13.6k|                    *(UWORD32 *)(pu1_dest_u + u2_dest_wd_uv) =
 1480|  13.6k|                                    *(UWORD32 *)(pu1_ref_u + u2_ref_wd_uv);
 1481|  13.6k|                    {
 1482|  13.6k|                        UWORD32 *dst, *src;
 1483|  13.6k|                        dst = (UWORD32 *)pu1_dest_u;
 1484|  13.6k|                        src = (UWORD32 *)pu1_ref_u;
 1485|  13.6k|                        *dst = *src;
 1486|  13.6k|                        dst++;
 1487|  13.6k|                        src++;
 1488|  13.6k|                        pu1_dest_u = (UWORD8 *)dst;
 1489|  13.6k|                        pu1_ref_u = (UWORD8 *)src;
 1490|  13.6k|                    }
 1491|       |
 1492|  13.6k|                }
 1493|  75.6k|                else
 1494|  75.6k|                {
 1495|  75.6k|                    pu1_dest_y += 4;
 1496|  75.6k|                    pu1_ref_y += 4;
 1497|  75.6k|                    pu1_dest_u += 2 * YUV420SP_FACTOR;
  ------------------
  |  |  119|  75.6k|#define YUV420SP_FACTOR 2
  ------------------
 1498|  75.6k|                    pu1_ref_u += 2 * YUV420SP_FACTOR;
  ------------------
  |  |  119|  75.6k|#define YUV420SP_FACTOR 2
  ------------------
 1499|  75.6k|                }
 1500|  89.2k|            }
 1501|  22.3k|            pu1_ref_y += 4 * (u2_ref_wd_y - 4);
 1502|  22.3k|            pu1_ref_u += 2 * (u2_ref_wd_uv - 4 * YUV420SP_FACTOR);
  ------------------
  |  |  119|  22.3k|#define YUV420SP_FACTOR 2
  ------------------
 1503|  22.3k|            pu1_dest_y += 4 * (u2_dest_wd_y - 4);
 1504|  22.3k|            pu1_dest_u += 2 * (u2_dest_wd_uv - 4 * YUV420SP_FACTOR);
  ------------------
  |  |  119|  22.3k|#define YUV420SP_FACTOR 2
  ------------------
 1505|  22.3k|        }
 1506|  5.57k|    }
 1507|  5.57k|}

ih264d_transfer_mb_group_data:
 1396|  2.26M|{
 1397|  2.26M|    dec_mb_info_t *ps_cur_mb_info = ps_dec->ps_nmb_info;
 1398|  2.26M|    tfr_ctxt_t *ps_trns_addr = &ps_dec->s_tran_addrecon;
 1399|  2.26M|    UWORD16 u2_mb_y;
 1400|  2.26M|    UWORD32 y_offset;
 1401|  2.26M|    UWORD32 u4_frame_stride;
 1402|  2.26M|    mb_neigbour_params_t *ps_temp;
 1403|  2.26M|    const UWORD8 u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
 1404|  2.26M|    UNUSED(u4_end_of_row_next);
  ------------------
  |  |   45|  2.26M|#define UNUSED(x) ((void)(x))
  ------------------
 1405|       |
 1406|  2.26M|    ps_trns_addr->pu1_dest_y += ps_trns_addr->u4_inc_y[u4_end_of_row];
 1407|  2.26M|    ps_trns_addr->pu1_dest_u += ps_trns_addr->u4_inc_uv[u4_end_of_row];
 1408|  2.26M|    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.26M|    if(u4_end_of_row)
  ------------------
  |  Branch (1411:8): [True: 2.21M, False: 41.8k]
  ------------------
 1412|  2.21M|    {
 1413|       |
 1414|  2.21M|        if(ps_dec->u1_separate_parse)
  ------------------
  |  Branch (1414:12): [True: 1.06M, False: 1.15M]
  ------------------
 1415|  1.06M|        {
 1416|  1.06M|            u2_mb_y = ps_dec->i2_dec_thread_mb_y;
 1417|  1.06M|        }
 1418|  1.15M|        else
 1419|  1.15M|        {
 1420|  1.15M|            ps_temp = ps_dec->ps_cur_mb_row;
 1421|  1.15M|            ps_dec->ps_cur_mb_row = ps_dec->ps_top_mb_row;
 1422|  1.15M|            ps_dec->ps_top_mb_row = ps_temp;
 1423|       |
 1424|  1.15M|            u2_mb_y = ps_dec->u2_mby + (1 + u1_mbaff);
 1425|  1.15M|        }
 1426|       |
 1427|  2.21M|        u4_frame_stride = ps_dec->u2_frm_wd_y
 1428|  2.21M|                        << ps_dec->ps_cur_slice->u1_field_pic_flag;
 1429|  2.21M|        y_offset = (u2_mb_y * u4_frame_stride) << 4;
 1430|  2.21M|        ps_trns_addr->pu1_dest_y = ps_dec->s_cur_pic.pu1_buf1 + y_offset;
 1431|       |
 1432|  2.21M|        u4_frame_stride = ps_dec->u2_frm_wd_uv
 1433|  2.21M|                        << ps_dec->ps_cur_slice->u1_field_pic_flag;
 1434|  2.21M|        y_offset = (u2_mb_y * u4_frame_stride) << 3;
 1435|  2.21M|        ps_trns_addr->pu1_dest_u = ps_dec->s_cur_pic.pu1_buf2 + y_offset;
 1436|  2.21M|        ps_trns_addr->pu1_dest_v = ps_dec->s_cur_pic.pu1_buf3 + y_offset;
 1437|       |
 1438|  2.21M|        ps_trns_addr->pu1_mb_y = ps_trns_addr->pu1_dest_y;
 1439|  2.21M|        ps_trns_addr->pu1_mb_u = ps_trns_addr->pu1_dest_u;
 1440|  2.21M|        ps_trns_addr->pu1_mb_v = ps_trns_addr->pu1_dest_v;
 1441|  2.21M|    }
 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.26M|    ps_dec->s_tran_addrecon.u2_mv_left_inc = ((WORD16)(u4_num_mbs >> u1_mbaff) - 1)
 1450|  2.26M|                    << (4 + u1_mbaff);
 1451|  2.26M|    ps_dec->s_tran_addrecon.u2_mv_top_left_inc = (WORD16)(u4_num_mbs << 2) - 1
 1452|  2.26M|                    - (u1_mbaff << 2);
 1453|       |
 1454|  2.26M|    if(ps_dec->u1_separate_parse == 0)
  ------------------
  |  Branch (1454:8): [True: 1.18M, False: 1.08M]
  ------------------
 1455|  1.18M|    {
 1456|       |        /* reassign left MV and cur MV pointers */
 1457|  1.18M|        ps_dec->ps_mv_left = ps_dec->ps_mv_cur
 1458|  1.18M|                        + ps_dec->s_tran_addrecon.u2_mv_left_inc;
 1459|       |
 1460|  1.18M|        ps_dec->ps_mv_cur += (u4_num_mbs << 4);
 1461|  1.18M|    }
 1462|       |
 1463|       |    /* Increment deblock parameters pointer in external memory */
 1464|       |
 1465|  2.26M|    if(ps_dec->u1_separate_parse == 0)
  ------------------
  |  Branch (1465:8): [True: 1.18M, False: 1.08M]
  ------------------
 1466|  1.18M|    {
 1467|  1.18M|        ps_dec->ps_deblk_mbn += u4_num_mbs;
 1468|  1.18M|    }
 1469|       |
 1470|  2.26M|}

ih264d_get_motion_vector_predictor:
   80|  1.76M|{
   81|  1.76M|    WORD8 c_temp;
   82|  1.76M|    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.76M|    c_temp =
   87|  1.76M|                    (ps_mv_pred[LEFT]->i1_ref_frame[u1_B] == u1_ref_idx)
  ------------------
  |  |  512|  1.76M|#define LEFT  0
  ------------------
   88|  1.76M|                                    | ((ps_mv_pred[TOP]->i1_ref_frame[u1_B]
  ------------------
  |  |  514|  1.76M|#define TOP   1
  ------------------
   89|  1.76M|                                                    == u1_ref_idx) << 1)
   90|  1.76M|                                    | ((ps_mv_pred[TOP_R]->i1_ref_frame[u1_B]
  ------------------
  |  |  516|  1.76M|#define TOP_R 2
  ------------------
   91|  1.76M|                                                    == u1_ref_idx) << 2);
   92|  1.76M|    c_temp = pu1_mv_pred_condition[c_temp];
   93|       |
   94|  1.76M|    if(c_temp != -1)
  ------------------
  |  Branch (94:8): [True: 84.6k, False: 1.68M]
  ------------------
   95|  84.6k|    {
   96|       |        /* Case when only when one of the cadidate block has the same
   97|       |         reference frame as the current block */
   98|  84.6k|        ps_result->i2_mv[uc_B2 + 0] = ps_mv_pred[c_temp]->i2_mv[uc_B2 + 0];
   99|  84.6k|        ps_result->i2_mv[uc_B2 + 1] = ps_mv_pred[c_temp]->i2_mv[uc_B2 + 1];
  100|  84.6k|    }
  101|  1.68M|    else
  102|  1.68M|    {
  103|  1.68M|        WORD32 D0, D1;
  104|  1.68M|        D0 = MIN(ps_mv_pred[0]->i2_mv[uc_B2 + 0],
  ------------------
  |  |   61|  1.68M|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 117k, False: 1.56M]
  |  |  ------------------
  ------------------
  105|  1.68M|                 ps_mv_pred[1]->i2_mv[uc_B2 + 0]);
  106|  1.68M|        D1 = MAX(ps_mv_pred[0]->i2_mv[uc_B2 + 0],
  ------------------
  |  |   60|  1.68M|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 148k, False: 1.53M]
  |  |  ------------------
  ------------------
  107|  1.68M|                 ps_mv_pred[1]->i2_mv[uc_B2 + 0]);
  108|  1.68M|        D1 = MIN(D1, ps_mv_pred[2]->i2_mv[uc_B2 + 0]);
  ------------------
  |  |   61|  1.68M|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 85.8k, False: 1.59M]
  |  |  ------------------
  ------------------
  109|  1.68M|        ps_result->i2_mv[uc_B2 + 0] = (WORD16)(MAX(D0, D1));
  ------------------
  |  |   60|  1.68M|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 65.6k, False: 1.61M]
  |  |  ------------------
  ------------------
  110|       |
  111|  1.68M|        D0 = MIN(ps_mv_pred[0]->i2_mv[uc_B2 + 1],
  ------------------
  |  |   61|  1.68M|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 91.9k, False: 1.59M]
  |  |  ------------------
  ------------------
  112|  1.68M|                 ps_mv_pred[1]->i2_mv[uc_B2 + 1]);
  113|  1.68M|        D1 = MAX(ps_mv_pred[0]->i2_mv[uc_B2 + 1],
  ------------------
  |  |   60|  1.68M|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 131k, False: 1.55M]
  |  |  ------------------
  ------------------
  114|  1.68M|                 ps_mv_pred[1]->i2_mv[uc_B2 + 1]);
  115|  1.68M|        D1 = MIN(D1, ps_mv_pred[2]->i2_mv[uc_B2 + 1]);
  ------------------
  |  |   61|  1.68M|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 63.7k, False: 1.62M]
  |  |  ------------------
  ------------------
  116|  1.68M|        ps_result->i2_mv[uc_B2 + 1] = (WORD16)(MAX(D0, D1));
  ------------------
  |  |   60|  1.68M|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 58.0k, False: 1.62M]
  |  |  ------------------
  ------------------
  117|       |
  118|  1.68M|    }
  119|  1.76M|}
ih264d_non_mbaff_mv_pred:
  342|  12.4M|{
  343|  12.4M|    UWORD16 u2_b_in = 0, u2_c_in = 0, u2_d_in = 0;
  344|  12.4M|    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|  12.4M|    ps_mv_pred[LEFT] = &ps_dec->s_default_mv_pred;
  ------------------
  |  |  512|  12.4M|#define LEFT  0
  ------------------
  350|  12.4M|    ps_mv_pred[TOP] = &(ps_dec->s_default_mv_pred);
  ------------------
  |  |  514|  12.4M|#define TOP   1
  ------------------
  351|  12.4M|    ps_mv_pred[TOP_R] = &(ps_dec->s_default_mv_pred);
  ------------------
  |  |  516|  12.4M|#define TOP_R 2
  ------------------
  352|       |    /* Check if the left subMb is available */
  353|       |
  354|  12.4M|    if(u4_sub_mb_x)
  ------------------
  |  Branch (354:8): [True: 226k, False: 12.2M]
  ------------------
  355|   226k|    {
  356|   226k|        ps_mv_pred[LEFT] = (ps_mv_nmb - 1);
  ------------------
  |  |  512|   226k|#define LEFT  0
  ------------------
  357|   226k|    }
  358|  12.2M|    else
  359|  12.2M|    {
  360|  12.2M|        if(ps_cur_mb_info->u1_mb_ngbr_availablity & LEFT_MB_AVAILABLE_MASK)
  ------------------
  |  |   53|  12.2M|#define LEFT_MB_AVAILABLE_MASK      0x01
  ------------------
  |  Branch (360:12): [True: 10.0M, False: 2.14M]
  ------------------
  361|  10.0M|        {
  362|  10.0M|            ps_mv_pred[LEFT] = (ps_mv_nmb - 13);
  ------------------
  |  |  512|  10.0M|#define LEFT  0
  ------------------
  363|  10.0M|        }
  364|  12.2M|    }
  365|       |
  366|       |    /* Check if the top subMB is available */
  367|  12.4M|    if(uc_sub_mb_y)
  ------------------
  |  Branch (367:8): [True: 243k, False: 12.1M]
  ------------------
  368|   243k|    {
  369|   243k|        u2_b_in = 1;
  370|   243k|        ps_mv_ntop = ps_mv_nmb - 4;
  371|   243k|        ps_mv_pred[TOP] = ps_mv_ntop;
  ------------------
  |  |  514|   243k|#define TOP   1
  ------------------
  372|       |
  373|   243k|    }
  374|  12.1M|    else
  375|  12.1M|    {
  376|  12.1M|        u2_b_in = (ps_cur_mb_info->u1_mb_ngbr_availablity & TOP_MB_AVAILABLE_MASK);
  ------------------
  |  |   55|  12.1M|#define TOP_MB_AVAILABLE_MASK       0x04
  ------------------
  377|  12.1M|        if(u2_b_in)
  ------------------
  |  Branch (377:12): [True: 11.3M, False: 822k]
  ------------------
  378|  11.3M|        {
  379|  11.3M|            ps_mv_pred[TOP] = ps_mv_ntop;
  ------------------
  |  |  514|  11.3M|#define TOP   1
  ------------------
  380|  11.3M|        }
  381|  12.1M|    }
  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|  12.4M|    u2_c_in = CHECKBIT(ps_cur_mb_info->u2_top_right_avail_mask,
  ------------------
  |  |   54|  12.4M|#define CHECKBIT(a,i) ((a) &  (1 << i))
  ------------------
  390|  12.4M|                        (u4_sub_mb_num + uc_mb_part_width - 1));
  391|  12.4M|    if(u2_c_in)
  ------------------
  |  Branch (391:8): [True: 9.53M, False: 2.90M]
  ------------------
  392|  9.53M|    {
  393|  9.53M|        ps_mv_pred[TOP_R] = (ps_mv_ntop + uc_mb_part_width);
  ------------------
  |  |  516|  9.53M|#define TOP_R 2
  ------------------
  394|       |
  395|  9.53M|        if(uc_sub_mb_y == 0)
  ------------------
  |  Branch (395:12): [True: 9.44M, False: 89.1k]
  ------------------
  396|  9.44M|        {
  397|       |            /* CHANGED CODE */
  398|  9.44M|            if((u4_sub_mb_x + uc_mb_part_width) > 3)
  ------------------
  |  Branch (398:16): [True: 9.33M, False: 107k]
  ------------------
  399|  9.33M|                ps_mv_pred[TOP_R] += 12;
  ------------------
  |  |  516|  9.33M|#define TOP_R 2
  ------------------
  400|  9.44M|        }
  401|  9.53M|    }
  402|  2.90M|    else
  403|  2.90M|    {
  404|  2.90M|        u2_d_in = CHECKBIT(ps_cur_mb_info->u2_top_left_avail_mask, u4_sub_mb_num);
  ------------------
  |  |   54|  2.90M|#define CHECKBIT(a,i) ((a) &  (1 << i))
  ------------------
  405|       |        /* Check if the the top left subMB is available */
  406|  2.90M|        if(u2_d_in)
  ------------------
  |  Branch (406:12): [True: 2.07M, False: 825k]
  ------------------
  407|  2.07M|        {
  408|       |            /* CHANGED CODE */
  409|  2.07M|            ps_mv_pred[TOP_R] = (ps_mv_ntop - 1);
  ------------------
  |  |  516|  2.07M|#define TOP_R 2
  ------------------
  410|  2.07M|            if(u4_sub_mb_x == 0)
  ------------------
  |  Branch (410:16): [True: 1.97M, False: 97.8k]
  ------------------
  411|  1.97M|            {
  412|  1.97M|                if(uc_sub_mb_y)
  ------------------
  |  Branch (412:20): [True: 60.6k, False: 1.91M]
  ------------------
  413|  60.6k|                {
  414|  60.6k|                    ps_mv_pred[TOP_R] = (ps_mv_nmb - 17);
  ------------------
  |  |  516|  60.6k|#define TOP_R 2
  ------------------
  415|  60.6k|                }
  416|  1.91M|                else
  417|  1.91M|                {
  418|       |                    /* CHANGED CODE */
  419|  1.91M|                    ps_mv_pred[TOP_R] -= 12;
  ------------------
  |  |  516|  1.91M|#define TOP_R 2
  ------------------
  420|  1.91M|                }
  421|  1.97M|            }
  422|  2.07M|        }
  423|   825k|        else if(u2_b_in == 0)
  ------------------
  |  Branch (423:17): [True: 787k, False: 37.4k]
  ------------------
  424|   787k|        {
  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|   787k|            ps_mv_pred[TOP] = ps_mv_pred[LEFT];
  ------------------
  |  |  514|   787k|#define TOP   1
  ------------------
                          ps_mv_pred[TOP] = ps_mv_pred[LEFT];
  ------------------
  |  |  512|   787k|#define LEFT  0
  ------------------
  428|   787k|            ps_mv_pred[TOP_R] = ps_mv_pred[LEFT];
  ------------------
  |  |  516|   787k|#define TOP_R 2
  ------------------
                          ps_mv_pred[TOP_R] = ps_mv_pred[LEFT];
  ------------------
  |  |  512|   787k|#define LEFT  0
  ------------------
  429|   787k|        }
  430|  2.90M|    }
  431|  12.4M|}
ih264d_mvpred_nonmbaffB:
  468|  3.07M|{
  469|  3.07M|    UWORD8 u1_a_in, u1_b_in, uc_temp1, uc_temp2, uc_temp3;
  470|  3.07M|    mv_pred_t *ps_mv_pred[3];
  471|  3.07M|    UWORD8 uc_B2, uc_lx, u1_ref_idx;
  472|  3.07M|    UWORD8 u1_direct_zero_pred_flag = 0;
  473|       |
  474|  3.07M|    ih264d_non_mbaff_mv_pred(ps_mv_pred, u4_sub_mb_num, ps_mv_nmb, ps_mv_ntop,
  475|  3.07M|                             ps_dec, uc_mb_part_width, ps_cur_mb_info);
  476|       |
  477|  6.20M|    for(uc_lx = u1_lx_start; uc_lx < u1_lxend; uc_lx++)
  ------------------
  |  Branch (477:30): [True: 3.13M, False: 3.07M]
  ------------------
  478|  3.13M|    {
  479|  3.13M|        u1_ref_idx = ps_mv_final_pred->i1_ref_frame[uc_lx];
  480|  3.13M|        uc_B2 = (uc_lx << 1);
  481|  3.13M|        switch(u1_mb_mc_mode)
  482|  3.13M|        {
  483|   107k|            case PRED_16x8:
  ------------------
  |  |  451|   107k|#define PRED_16x8   1
  ------------------
  |  Branch (483:13): [True: 107k, False: 3.02M]
  ------------------
  484|       |                /* Directional prediction for a 16x8 MB partition */
  485|   107k|                if(u4_sub_mb_num == 0)
  ------------------
  |  Branch (485:20): [True: 43.3k, False: 64.4k]
  ------------------
  486|  43.3k|                {
  487|       |                    /* Calculating the MV pred for the top 16x8 block */
  488|  43.3k|                    if(ps_mv_pred[TOP]->i1_ref_frame[uc_lx] == u1_ref_idx)
  ------------------
  |  |  514|  43.3k|#define TOP   1
  ------------------
  |  Branch (488:24): [True: 22.9k, False: 20.4k]
  ------------------
  489|  22.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|  22.9k|                        ps_mv_final_pred->i2_mv[uc_B2 + 0] =
  495|  22.9k|                                        ps_mv_pred[TOP]->i2_mv[uc_B2 + 0];
  ------------------
  |  |  514|  22.9k|#define TOP   1
  ------------------
  496|  22.9k|                        ps_mv_final_pred->i2_mv[uc_B2 + 1] =
  497|  22.9k|                                        ps_mv_pred[TOP]->i2_mv[uc_B2 + 1];
  ------------------
  |  |  514|  22.9k|#define TOP   1
  ------------------
  498|  22.9k|                    }
  499|  20.4k|                    else
  500|  20.4k|                    {
  501|       |                        /* The MV predictor is calculated according to the process
  502|       |                         defined in 8.4.1.2.1 */
  503|  20.4k|                        ih264d_get_motion_vector_predictor(
  504|  20.4k|                                        ps_mv_final_pred,
  505|  20.4k|                                        ps_mv_pred,
  506|  20.4k|                                        u1_ref_idx,
  507|  20.4k|                                        uc_lx,
  508|  20.4k|                                        (const UWORD8 *)gau1_ih264d_mv_pred_condition);
  509|  20.4k|                    }
  510|  43.3k|                }
  511|  64.4k|                else
  512|  64.4k|                {
  513|  64.4k|                    if(ps_mv_pred[LEFT]->i1_ref_frame[uc_lx] == u1_ref_idx)
  ------------------
  |  |  512|  64.4k|#define LEFT  0
  ------------------
  |  Branch (513:24): [True: 31.3k, False: 33.1k]
  ------------------
  514|  31.3k|                    {
  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|  31.3k|                        ps_mv_final_pred->i2_mv[uc_B2 + 0] =
  520|  31.3k|                                        ps_mv_pred[LEFT]->i2_mv[uc_B2 + 0];
  ------------------
  |  |  512|  31.3k|#define LEFT  0
  ------------------
  521|  31.3k|                        ps_mv_final_pred->i2_mv[uc_B2 + 1] =
  522|  31.3k|                                        ps_mv_pred[LEFT]->i2_mv[uc_B2 + 1];
  ------------------
  |  |  512|  31.3k|#define LEFT  0
  ------------------
  523|  31.3k|                    }
  524|  33.1k|                    else
  525|  33.1k|                    {
  526|       |                        /* The MV predictor is calculated according to the process
  527|       |                         defined in 8.4.1.2.1 */
  528|  33.1k|                        ih264d_get_motion_vector_predictor(
  529|  33.1k|                                        ps_mv_final_pred,
  530|  33.1k|                                        ps_mv_pred,
  531|  33.1k|                                        u1_ref_idx,
  532|  33.1k|                                        uc_lx,
  533|  33.1k|                                        (const UWORD8 *)gau1_ih264d_mv_pred_condition);
  534|  33.1k|                    }
  535|  64.4k|                }
  536|   107k|                break;
  537|  46.1k|            case PRED_8x16:
  ------------------
  |  |  452|  46.1k|#define PRED_8x16   2
  ------------------
  |  Branch (537:13): [True: 46.1k, False: 3.08M]
  ------------------
  538|       |                /* Directional prediction for a 8x16 MB partition */
  539|  46.1k|                if(u4_sub_mb_num == 0)
  ------------------
  |  Branch (539:20): [True: 23.0k, False: 23.1k]
  ------------------
  540|  23.0k|                {
  541|  23.0k|                    if(ps_mv_pred[LEFT]->i1_ref_frame[uc_lx] == u1_ref_idx)
  ------------------
  |  |  512|  23.0k|#define LEFT  0
  ------------------
  |  Branch (541:24): [True: 12.1k, False: 10.9k]
  ------------------
  542|  12.1k|                    {
  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|  12.1k|                        ps_mv_final_pred->i2_mv[uc_B2 + 0] =
  548|  12.1k|                                        ps_mv_pred[LEFT]->i2_mv[uc_B2 + 0];
  ------------------
  |  |  512|  12.1k|#define LEFT  0
  ------------------
  549|  12.1k|                        ps_mv_final_pred->i2_mv[uc_B2 + 1] =
  550|  12.1k|                                        ps_mv_pred[LEFT]->i2_mv[uc_B2 + 1];
  ------------------
  |  |  512|  12.1k|#define LEFT  0
  ------------------
  551|  12.1k|                    }
  552|  10.9k|                    else
  553|  10.9k|                    {
  554|       |                        /* The MV predictor is calculated according to the process
  555|       |                         defined in 8.4.1.2.1 */
  556|  10.9k|                        ih264d_get_motion_vector_predictor(
  557|  10.9k|                                        ps_mv_final_pred,
  558|  10.9k|                                        ps_mv_pred,
  559|  10.9k|                                        u1_ref_idx,
  560|  10.9k|                                        uc_lx,
  561|  10.9k|                                        (const UWORD8 *)gau1_ih264d_mv_pred_condition);
  562|  10.9k|                    }
  563|  23.0k|                }
  564|  23.1k|                else
  565|  23.1k|                {
  566|  23.1k|                    if(ps_mv_pred[TOP_R]->i1_ref_frame[uc_lx] == u1_ref_idx)
  ------------------
  |  |  516|  23.1k|#define TOP_R 2
  ------------------
  |  Branch (566:24): [True: 13.7k, False: 9.43k]
  ------------------
  567|  13.7k|                    {
  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|  13.7k|                        ps_mv_final_pred->i2_mv[uc_B2 + 0] =
  573|  13.7k|                                        ps_mv_pred[TOP_R]->i2_mv[uc_B2 + 0];
  ------------------
  |  |  516|  13.7k|#define TOP_R 2
  ------------------
  574|  13.7k|                        ps_mv_final_pred->i2_mv[uc_B2 + 1] =
  575|  13.7k|                                        ps_mv_pred[TOP_R]->i2_mv[uc_B2 + 1];
  ------------------
  |  |  516|  13.7k|#define TOP_R 2
  ------------------
  576|  13.7k|                    }
  577|  9.43k|                    else
  578|  9.43k|                    {
  579|       |                        /* The MV predictor is calculated according to the process
  580|       |                         defined in 8.4.1.2.1 */
  581|  9.43k|                        ih264d_get_motion_vector_predictor(
  582|  9.43k|                                        ps_mv_final_pred,
  583|  9.43k|                                        ps_mv_pred,
  584|  9.43k|                                        u1_ref_idx,
  585|  9.43k|                                        uc_lx,
  586|  9.43k|                                        (const UWORD8 *)gau1_ih264d_mv_pred_condition);
  587|  9.43k|                    }
  588|  23.1k|                }
  589|  46.1k|                break;
  590|   575k|            case B_DIRECT_SPATIAL:
  ------------------
  |  |  489|   575k|#define B_DIRECT_SPATIAL  26
  ------------------
  |  Branch (590:13): [True: 575k, False: 2.55M]
  ------------------
  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|   575k|                uc_temp1 = (UWORD8)ps_mv_pred[LEFT]->i1_ref_frame[0];
  ------------------
  |  |  512|   575k|#define LEFT  0
  ------------------
  599|   575k|                uc_temp2 = (UWORD8)ps_mv_pred[TOP]->i1_ref_frame[0];
  ------------------
  |  |  514|   575k|#define TOP   1
  ------------------
  600|   575k|                uc_temp3 = (UWORD8)ps_mv_pred[TOP_R]->i1_ref_frame[0];
  ------------------
  |  |  516|   575k|#define TOP_R 2
  ------------------
  601|       |
  602|   575k|                ps_mv_final_pred->i1_ref_frame[0] = MIN(uc_temp1,
  ------------------
  |  |   61|  1.15M|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 4.17k, False: 571k]
  |  |  |  Branch (61:24): [True: 6.97k, False: 568k]
  |  |  |  Branch (61:32): [True: 6.95k, False: 564k]
  |  |  ------------------
  ------------------
  603|   575k|                                                      MIN(uc_temp2, uc_temp3));
  604|       |
  605|   575k|                uc_temp1 = (UWORD8)ps_mv_pred[LEFT]->i1_ref_frame[1];
  ------------------
  |  |  512|   575k|#define LEFT  0
  ------------------
  606|   575k|                uc_temp2 = (UWORD8)ps_mv_pred[TOP]->i1_ref_frame[1];
  ------------------
  |  |  514|   575k|#define TOP   1
  ------------------
  607|   575k|                uc_temp3 = (UWORD8)ps_mv_pred[TOP_R]->i1_ref_frame[1];
  ------------------
  |  |  516|   575k|#define TOP_R 2
  ------------------
  608|       |
  609|   575k|                ps_mv_final_pred->i1_ref_frame[1] = MIN(uc_temp1,
  ------------------
  |  |   61|  1.15M|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 3.38k, False: 571k]
  |  |  |  Branch (61:24): [True: 6.48k, False: 568k]
  |  |  |  Branch (61:32): [True: 6.46k, False: 565k]
  |  |  ------------------
  ------------------
  610|   575k|                                                      MIN(uc_temp2, uc_temp3));
  611|       |
  612|   575k|                if((ps_mv_final_pred->i1_ref_frame[0] < 0)
  ------------------
  |  Branch (612:20): [True: 60.2k, False: 514k]
  ------------------
  613|  60.2k|                                && (ps_mv_final_pred->i1_ref_frame[1] < 0))
  ------------------
  |  Branch (613:36): [True: 13.7k, False: 46.5k]
  ------------------
  614|  13.7k|                {
  615|  13.7k|                    u1_direct_zero_pred_flag = 1;
  616|  13.7k|                    ps_mv_final_pred->i1_ref_frame[0] = 0;
  617|  13.7k|                    ps_mv_final_pred->i1_ref_frame[1] = 0;
  618|  13.7k|                }
  619|   575k|                ih264d_get_motion_vector_predictor(
  620|   575k|                                ps_mv_final_pred, ps_mv_pred,
  621|   575k|                                ps_mv_final_pred->i1_ref_frame[0], 0,
  622|   575k|                                (const UWORD8 *)gau1_ih264d_mv_pred_condition);
  623|       |
  624|   575k|                ih264d_get_motion_vector_predictor(
  625|   575k|                                ps_mv_final_pred, ps_mv_pred,
  626|   575k|                                ps_mv_final_pred->i1_ref_frame[1], 1,
  627|   575k|                                (const UWORD8 *)gau1_ih264d_mv_pred_condition);
  628|       |
  629|   575k|                break;
  630|  2.17M|            case MB_SKIP:
  ------------------
  |  |  456|  2.17M|#define MB_SKIP     255
  ------------------
  |  Branch (630:13): [True: 2.17M, False: 957k]
  ------------------
  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.17M|                u1_a_in = (ps_cur_mb_info->u1_mb_ngbr_availablity &
  639|  2.17M|                LEFT_MB_AVAILABLE_MASK);
  ------------------
  |  |   53|  2.17M|#define LEFT_MB_AVAILABLE_MASK      0x01
  ------------------
  640|  2.17M|                u1_b_in = (ps_cur_mb_info->u1_mb_ngbr_availablity &
  641|  2.17M|                TOP_MB_AVAILABLE_MASK);
  ------------------
  |  |   55|  2.17M|#define TOP_MB_AVAILABLE_MASK       0x04
  ------------------
  642|  2.17M|                if(((u1_a_in * u1_b_in) == 0)
  ------------------
  |  Branch (642:20): [True: 353k, False: 1.81M]
  ------------------
  643|  1.81M|                                || ((ps_mv_pred[LEFT]->i2_mv[0]
  ------------------
  |  |  512|  1.81M|#define LEFT  0
  ------------------
  |  Branch (643:36): [True: 1.81M, False: 669]
  ------------------
  644|  1.81M|                                                | ps_mv_pred[LEFT]->i2_mv[1]
  ------------------
  |  |  512|  1.81M|#define LEFT  0
  ------------------
  645|  1.81M|                                                | ps_mv_pred[LEFT]->i1_ref_frame[0])
  ------------------
  |  |  512|  1.81M|#define LEFT  0
  ------------------
  646|  1.81M|                                                == 0)
  647|    669|                                || ((ps_mv_pred[TOP]->i2_mv[0]
  ------------------
  |  |  514|    669|#define TOP   1
  ------------------
  |  Branch (647:36): [True: 9, False: 660]
  ------------------
  648|    669|                                                | ps_mv_pred[TOP]->i2_mv[1]
  ------------------
  |  |  514|    669|#define TOP   1
  ------------------
  649|    669|                                                | ps_mv_pred[TOP]->i1_ref_frame[0])
  ------------------
  |  |  514|    669|#define TOP   1
  ------------------
  650|    669|                                                == 0))
  651|  2.17M|                {
  652|  2.17M|                    ps_mv_final_pred->i2_mv[0] = 0;
  653|  2.17M|                    ps_mv_final_pred->i2_mv[1] = 0;
  654|  2.17M|                    break;
  655|  2.17M|                }
  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|   228k|            default:
  ------------------
  |  Branch (658:13): [True: 228k, False: 2.90M]
  ------------------
  659|   228k|                ih264d_get_motion_vector_predictor(
  660|   228k|                                ps_mv_final_pred, ps_mv_pred, u1_ref_idx, uc_lx,
  661|   228k|                                (const UWORD8 *)gau1_ih264d_mv_pred_condition);
  662|   228k|                break;
  663|  3.13M|        }
  664|  3.13M|    }
  665|  3.07M|    return (u1_direct_zero_pred_flag);
  666|  3.07M|}
ih264d_mvpred_nonmbaff:
  703|  9.35M|{
  704|  9.35M|    UWORD8 u1_a_in, u1_b_in, uc_temp1, uc_temp2, uc_temp3;
  705|  9.35M|    mv_pred_t *ps_mv_pred[3];
  706|  9.35M|    UWORD8 u1_ref_idx;
  707|  9.35M|    UWORD8 u1_direct_zero_pred_flag = 0;
  708|  9.35M|    UNUSED(u1_lx_start);
  ------------------
  |  |   45|  9.35M|#define UNUSED(x) ((void)(x))
  ------------------
  709|  9.35M|    UNUSED(u1_lxend);
  ------------------
  |  |   45|  9.35M|#define UNUSED(x) ((void)(x))
  ------------------
  710|  9.35M|    ih264d_non_mbaff_mv_pred(ps_mv_pred, u4_sub_mb_num, ps_mv_nmb, ps_mv_ntop,
  711|  9.35M|                             ps_dec, uc_mb_part_width, ps_cur_mb_info);
  712|       |
  713|  9.35M|    u1_ref_idx = ps_mv_final_pred->i1_ref_frame[0];
  714|       |
  715|  9.35M|    switch(u1_mb_mc_mode)
  716|  9.35M|    {
  717|  52.5k|        case PRED_16x8:
  ------------------
  |  |  451|  52.5k|#define PRED_16x8   1
  ------------------
  |  Branch (717:9): [True: 52.5k, False: 9.30M]
  ------------------
  718|       |            /* Directional prediction for a 16x8 MB partition */
  719|  52.5k|            if(u4_sub_mb_num == 0)
  ------------------
  |  Branch (719:16): [True: 26.2k, False: 26.2k]
  ------------------
  720|  26.2k|            {
  721|       |                /* Calculating the MV pred for the top 16x8 block */
  722|  26.2k|                if(ps_mv_pred[TOP]->i1_ref_frame[0] == u1_ref_idx)
  ------------------
  |  |  514|  26.2k|#define TOP   1
  ------------------
  |  Branch (722:20): [True: 14.1k, False: 12.1k]
  ------------------
  723|  14.1k|                {
  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|  14.1k|                    ps_mv_final_pred->i2_mv[0] = ps_mv_pred[TOP]->i2_mv[0];
  ------------------
  |  |  514|  14.1k|#define TOP   1
  ------------------
  730|  14.1k|                    ps_mv_final_pred->i2_mv[1] = ps_mv_pred[TOP]->i2_mv[1];
  ------------------
  |  |  514|  14.1k|#define TOP   1
  ------------------
  731|  14.1k|                }
  732|  12.1k|                else
  733|  12.1k|                {
  734|       |                    /* The MV predictor is calculated according to the process
  735|       |                     defined in 8.4.1.2.1 */
  736|  12.1k|                    ih264d_get_motion_vector_predictor(
  737|  12.1k|                                    ps_mv_final_pred,
  738|  12.1k|                                    ps_mv_pred,
  739|  12.1k|                                    u1_ref_idx,
  740|  12.1k|                                    0,
  741|  12.1k|                                    (const UWORD8 *)gau1_ih264d_mv_pred_condition);
  742|  12.1k|                }
  743|  26.2k|            }
  744|  26.2k|            else
  745|  26.2k|            {
  746|  26.2k|                if(ps_mv_pred[LEFT]->i1_ref_frame[0] == u1_ref_idx)
  ------------------
  |  |  512|  26.2k|#define LEFT  0
  ------------------
  |  Branch (746:20): [True: 9.80k, False: 16.4k]
  ------------------
  747|  9.80k|                {
  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|  9.80k|                    ps_mv_final_pred->i2_mv[0] = ps_mv_pred[LEFT]->i2_mv[0];
  ------------------
  |  |  512|  9.80k|#define LEFT  0
  ------------------
  754|  9.80k|                    ps_mv_final_pred->i2_mv[1] = ps_mv_pred[LEFT]->i2_mv[1];
  ------------------
  |  |  512|  9.80k|#define LEFT  0
  ------------------
  755|  9.80k|                }
  756|  16.4k|                else
  757|  16.4k|                {
  758|       |                    /* The MV predictor is calculated according to the process
  759|       |                     defined in 8.4.1.2.1 */
  760|  16.4k|                    ih264d_get_motion_vector_predictor(
  761|  16.4k|                                    ps_mv_final_pred,
  762|  16.4k|                                    ps_mv_pred,
  763|  16.4k|                                    u1_ref_idx,
  764|  16.4k|                                    0,
  765|  16.4k|                                    (const UWORD8 *)gau1_ih264d_mv_pred_condition);
  766|  16.4k|                }
  767|  26.2k|            }
  768|  52.5k|            break;
  769|  49.9k|        case PRED_8x16:
  ------------------
  |  |  452|  49.9k|#define PRED_8x16   2
  ------------------
  |  Branch (769:9): [True: 49.9k, False: 9.30M]
  ------------------
  770|       |            /* Directional prediction for a 8x16 MB partition */
  771|  49.9k|            if(u4_sub_mb_num == 0)
  ------------------
  |  Branch (771:16): [True: 26.1k, False: 23.8k]
  ------------------
  772|  26.1k|            {
  773|  26.1k|                if(ps_mv_pred[LEFT]->i1_ref_frame[0] == u1_ref_idx)
  ------------------
  |  |  512|  26.1k|#define LEFT  0
  ------------------
  |  Branch (773:20): [True: 8.25k, False: 17.8k]
  ------------------
  774|  8.25k|                {
  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|  8.25k|                    ps_mv_final_pred->i2_mv[0] = ps_mv_pred[LEFT]->i2_mv[0];
  ------------------
  |  |  512|  8.25k|#define LEFT  0
  ------------------
  781|  8.25k|                    ps_mv_final_pred->i2_mv[1] = ps_mv_pred[LEFT]->i2_mv[1];
  ------------------
  |  |  512|  8.25k|#define LEFT  0
  ------------------
  782|  8.25k|                }
  783|  17.8k|                else
  784|  17.8k|                {
  785|       |                    /* The MV predictor is calculated according to the process
  786|       |                     defined in 8.4.1.2.1 */
  787|  17.8k|                    ih264d_get_motion_vector_predictor(
  788|  17.8k|                                    ps_mv_final_pred,
  789|  17.8k|                                    ps_mv_pred,
  790|  17.8k|                                    u1_ref_idx,
  791|  17.8k|                                    0,
  792|  17.8k|                                    (const UWORD8 *)gau1_ih264d_mv_pred_condition);
  793|  17.8k|                }
  794|  26.1k|            }
  795|  23.8k|            else
  796|  23.8k|            {
  797|  23.8k|                if(ps_mv_pred[TOP_R]->i1_ref_frame[0] == u1_ref_idx)
  ------------------
  |  |  516|  23.8k|#define TOP_R 2
  ------------------
  |  Branch (797:20): [True: 16.3k, False: 7.48k]
  ------------------
  798|  16.3k|                {
  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.3k|                    ps_mv_final_pred->i2_mv[0] = ps_mv_pred[TOP_R]->i2_mv[0];
  ------------------
  |  |  516|  16.3k|#define TOP_R 2
  ------------------
  805|  16.3k|                    ps_mv_final_pred->i2_mv[1] = ps_mv_pred[TOP_R]->i2_mv[1];
  ------------------
  |  |  516|  16.3k|#define TOP_R 2
  ------------------
  806|  16.3k|                }
  807|  7.48k|                else
  808|  7.48k|                {
  809|       |                    /* The MV predictor is calculated according to the process
  810|       |                     defined in 8.4.1.2.1 */
  811|  7.48k|                    ih264d_get_motion_vector_predictor(
  812|  7.48k|                                    ps_mv_final_pred,
  813|  7.48k|                                    ps_mv_pred,
  814|  7.48k|                                    u1_ref_idx,
  815|  7.48k|                                    0,
  816|  7.48k|                                    (const UWORD8 *)gau1_ih264d_mv_pred_condition);
  817|  7.48k|                }
  818|  23.8k|            }
  819|  49.9k|            break;
  820|      0|        case B_DIRECT_SPATIAL:
  ------------------
  |  |  489|      0|#define B_DIRECT_SPATIAL  26
  ------------------
  |  Branch (820:9): [True: 0, False: 9.35M]
  ------------------
  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.02M|        case MB_SKIP:
  ------------------
  |  |  456|  9.02M|#define MB_SKIP     255
  ------------------
  |  Branch (860:9): [True: 9.02M, False: 337k]
  ------------------
  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.02M|            u1_a_in = (ps_cur_mb_info->u1_mb_ngbr_availablity &
  869|  9.02M|            LEFT_MB_AVAILABLE_MASK);
  ------------------
  |  |   53|  9.02M|#define LEFT_MB_AVAILABLE_MASK      0x01
  ------------------
  870|  9.02M|            u1_b_in = (ps_cur_mb_info->u1_mb_ngbr_availablity &
  871|  9.02M|            TOP_MB_AVAILABLE_MASK);
  ------------------
  |  |   55|  9.02M|#define TOP_MB_AVAILABLE_MASK       0x04
  ------------------
  872|  9.02M|            if(((u1_a_in * u1_b_in) == 0)
  ------------------
  |  Branch (872:16): [True: 2.13M, False: 6.88M]
  ------------------
  873|  6.88M|                            || ((ps_mv_pred[LEFT]->i2_mv[0]
  ------------------
  |  |  512|  6.88M|#define LEFT  0
  ------------------
  |  Branch (873:32): [True: 6.85M, False: 32.9k]
  ------------------
  874|  6.88M|                                            | ps_mv_pred[LEFT]->i2_mv[1]
  ------------------
  |  |  512|  6.88M|#define LEFT  0
  ------------------
  875|  6.88M|                                            | ps_mv_pred[LEFT]->i1_ref_frame[0])
  ------------------
  |  |  512|  6.88M|#define LEFT  0
  ------------------
  876|  6.88M|                                            == 0)
  877|  32.9k|                            || ((ps_mv_pred[TOP]->i2_mv[0]
  ------------------
  |  |  514|  32.9k|#define TOP   1
  ------------------
  |  Branch (877:32): [True: 5.95k, False: 26.9k]
  ------------------
  878|  32.9k|                                            | ps_mv_pred[TOP]->i2_mv[1]
  ------------------
  |  |  514|  32.9k|#define TOP   1
  ------------------
  879|  32.9k|                                            | ps_mv_pred[TOP]->i1_ref_frame[0])
  ------------------
  |  |  514|  32.9k|#define TOP   1
  ------------------
  880|  32.9k|                                            == 0))
  881|  8.99M|            {
  882|       |
  883|  8.99M|                ps_mv_final_pred->i2_mv[0] = 0;
  884|  8.99M|                ps_mv_final_pred->i2_mv[1] = 0;
  885|  8.99M|                break;
  886|  8.99M|            }
  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|   261k|        default:
  ------------------
  |  Branch (889:9): [True: 234k, False: 9.12M]
  ------------------
  890|   261k|            ih264d_get_motion_vector_predictor(
  891|   261k|                            ps_mv_final_pred, ps_mv_pred, u1_ref_idx, 0,
  892|   261k|                            (const UWORD8 *)gau1_ih264d_mv_pred_condition);
  893|   261k|            break;
  894|  9.35M|    }
  895|       |
  896|  9.35M|    return (u1_direct_zero_pred_flag);
  897|  9.35M|}
ih264d_rep_mv_colz:
 1175|  13.2M|{
 1176|       |
 1177|  13.2M|    UWORD8 k, m;
 1178|  13.2M|    UWORD8 *pu1_colz = ps_dec->pu1_col_zero_flag + ps_dec->i4_submb_ofst
 1179|  13.2M|                    + u4_sub_mb_num;
 1180|       |
 1181|  64.6M|    for(k = 0; k < u1_ht; k++)
  ------------------
  |  Branch (1181:16): [True: 51.4M, False: 13.2M]
  ------------------
 1182|  51.4M|    {
 1183|   254M|        for(m = 0; m < u1_wd; m++)
  ------------------
  |  Branch (1183:20): [True: 203M, False: 51.4M]
  ------------------
 1184|   203M|        {
 1185|   203M|            *(ps_mv_pred_dst + m) = *(ps_mv_pred_src);
 1186|   203M|            *(pu1_colz + m) = u1_colz;
 1187|       |
 1188|   203M|        }
 1189|  51.4M|        pu1_colz += SUB_BLK_WIDTH;
  ------------------
  |  |  560|  51.4M|#define SUB_BLK_WIDTH                 4
  ------------------
 1190|  51.4M|        ps_mv_pred_dst += SUB_BLK_WIDTH;
  ------------------
  |  |  560|  51.4M|#define SUB_BLK_WIDTH                 4
  ------------------
 1191|  51.4M|    }
 1192|  13.2M|}

ih264d_parse_bmb_non_direct_cavlc:
   79|  22.9k|{
   80|  22.9k|    dec_bit_stream_t * ps_bitstrm = ps_dec->ps_bitstrm;
   81|  22.9k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
   82|  22.9k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
   83|  22.9k|    UWORD8 * pu1_sub_mb_pred_modes = (UWORD8 *)(gau1_ih264d_submb_pred_modes) + 4;
   84|  22.9k|    const UWORD8 (*pu1_mb_pred_modes)[32] =
   85|  22.9k|                    (const UWORD8 (*)[32])gau1_ih264d_mb_pred_modes;
   86|  22.9k|    const UWORD8 * pu1_num_mb_part = (const UWORD8 *)gau1_ih264d_num_mb_part;
   87|  22.9k|    const UWORD8 * pu1_sub_mb_mc_mode = (const UWORD8 *)(gau1_ih264d_submb_mc_mode)
   88|  22.9k|                    + 4;
   89|       |
   90|  22.9k|    parse_pmbarams_t * ps_parse_mb_data = ps_dec->ps_parse_mb_data
   91|  22.9k|                    + u4_num_mbsNby2;
   92|  22.9k|    UWORD8 * pu1_col_info = ps_parse_mb_data->u1_col_info;
   93|  22.9k|    WORD8 (*pi1_ref_idx)[MAX_REFIDX_INFO_PER_MB] = ps_parse_mb_data->i1_ref_idx;
   94|  22.9k|    UWORD8 u1_mb_type = ps_cur_mb_info->u1_mb_type;
   95|  22.9k|    UWORD8 u1_mb_mc_mode, u1_num_mb_part, u1_sub_mb = !(u1_mb_type ^ B_8x8);
  ------------------
  |  |  480|  22.9k|#define B_8x8    22
  ------------------
   96|  22.9k|    UWORD32 u4_mb_mc_mode = 0, u4_mb_pred_mode = 0;
   97|  22.9k|    WORD32 ret;
   98|       |
   99|  22.9k|    if(u1_sub_mb)
  ------------------
  |  Branch (99:8): [True: 1.42k, False: 21.5k]
  ------------------
  100|  1.42k|    {
  101|  1.42k|        UWORD8 uc_i;
  102|  1.42k|        u1_mb_mc_mode = 0;
  103|  1.42k|        u1_num_mb_part = 4;
  104|       |        /* Reading the subMB type */
  105|  6.93k|        for(uc_i = 0; uc_i < 4; uc_i++)
  ------------------
  |  Branch (105:23): [True: 5.64k, False: 1.29k]
  ------------------
  106|  5.64k|        {
  107|       |
  108|  5.64k|            UWORD32 ui_sub_mb_mode;
  109|       |
  110|       |//Inlined ih264d_uev
  111|  5.64k|            UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
  112|  5.64k|            UWORD32 u4_word, u4_ldz;
  113|       |
  114|       |            /***************************************************************/
  115|       |            /* Find leading zeros in next 32 bits                          */
  116|       |            /***************************************************************/
  117|  5.64k|            NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  5.64k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  5.64k|{                                                                           \
  |  |  152|  5.64k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  5.64k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  5.64k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  5.64k|                                                                            \
  |  |  156|  5.64k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  5.64k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 5.39k, False: 249]
  |  |  ------------------
  |  |  158|  5.64k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  5.39k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  5.64k|}
  ------------------
  118|  5.64k|            u4_ldz = CLZ(u4_word);
  119|       |            /* Flush the ps_bitstrm */
  120|  5.64k|            u4_bitstream_offset += (u4_ldz + 1);
  121|       |            /* Read the suffix from the ps_bitstrm */
  122|  5.64k|            u4_word = 0;
  123|  5.64k|            if(u4_ldz)
  ------------------
  |  Branch (123:16): [True: 2.68k, False: 2.95k]
  ------------------
  124|  2.68k|                GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf,
  ------------------
  |  |  120|  2.68k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  2.68k|{                                                                           \
  |  |  122|  2.68k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  2.68k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  2.68k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  2.68k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  2.68k|                                                                            \
  |  |  127|  2.68k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 2.50k, False: 179]
  |  |  ------------------
  |  |  128|  2.68k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  2.50k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  2.68k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  2.68k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  2.68k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  2.68k|}                                                                           \
  ------------------
  125|  5.64k|                        u4_ldz);
  126|  5.64k|            *pu4_bitstrm_ofst = u4_bitstream_offset;
  127|  5.64k|            ui_sub_mb_mode = ((1 << u4_ldz) + u4_word - 1);
  128|       |//Inlined ih264d_uev
  129|       |
  130|  5.64k|            if(ui_sub_mb_mode > 12)
  ------------------
  |  Branch (130:16): [True: 131, False: 5.51k]
  ------------------
  131|    131|                return ERROR_SUB_MB_TYPE;
  132|  5.51k|            else
  133|  5.51k|            {
  134|  5.51k|                UWORD8 u1_subMbPredMode = pu1_sub_mb_pred_modes[ui_sub_mb_mode];
  135|  5.51k|                u4_mb_mc_mode = (u4_mb_mc_mode << 8)
  136|  5.51k|                                | pu1_sub_mb_mc_mode[ui_sub_mb_mode];
  137|  5.51k|                u4_mb_pred_mode = (u4_mb_pred_mode << 8) | u1_subMbPredMode;
  138|  5.51k|                pi1_ref_idx[0][uc_i] = ((u1_subMbPredMode & PRED_L0) - 1) >> 1;
  ------------------
  |  |  483|  5.51k|#define PRED_L0   1
  ------------------
  139|  5.51k|                pi1_ref_idx[1][uc_i] = ((u1_subMbPredMode & PRED_L1) - 1) >> 1;
  ------------------
  |  |  484|  5.51k|#define PRED_L1   2
  ------------------
  140|  5.51k|                COPYTHECONTEXT("sub_mb_type", u1_subMbPredMode);
  141|  5.51k|            }
  142|       |            /* Storing collocated Mb and SubMb mode information */
  143|  5.51k|            *pu1_col_info++ = ((PRED_8x8) << 6)
  ------------------
  |  |  453|  5.51k|#define PRED_8x8    3
  ------------------
  144|  5.51k|                            | ((pu1_sub_mb_mc_mode[ui_sub_mb_mode] << 4));
  145|  5.51k|            if(ui_sub_mb_mode != B_DIRECT_8x8)
  ------------------
  |  |  465|  5.51k|#define B_DIRECT_8x8    0
  ------------------
  |  Branch (145:16): [True: 2.55k, False: 2.95k]
  ------------------
  146|  2.55k|            {
  147|  2.55k|                if(ui_sub_mb_mode > B_BI_8x8)
  ------------------
  |  |  468|  2.55k|#define B_BI_8x8        3
  ------------------
  |  Branch (147:20): [True: 1.13k, False: 1.42k]
  ------------------
  148|  1.13k|                {
  149|  1.13k|                    ps_dec->s_high_profile.u1_no_submb_part_size_lt8x8_flag = 0;
  150|  1.13k|                }
  151|  2.55k|            }
  152|  2.95k|            else if(!ps_dec->s_high_profile.u1_direct_8x8_inference_flag)
  ------------------
  |  Branch (152:21): [True: 2.60k, False: 357]
  ------------------
  153|  2.60k|            {
  154|  2.60k|                ps_dec->s_high_profile.u1_no_submb_part_size_lt8x8_flag = 0;
  155|  2.60k|            }
  156|  5.51k|        }
  157|  1.42k|    }
  158|  21.5k|    else
  159|  21.5k|    {
  160|  21.5k|        UWORD8 u1_mb_pred_mode_idx = 5 + u1_mb_type;
  161|  21.5k|        UWORD8 u1_mb_pred_mode_part0 = pu1_mb_pred_modes[0][u1_mb_pred_mode_idx];
  162|  21.5k|        UWORD8 u1_mb_pred_mode_part1 = pu1_mb_pred_modes[1][u1_mb_pred_mode_idx];
  163|  21.5k|        u1_mb_mc_mode = ps_cur_mb_info->u1_mb_mc_mode;
  164|  21.5k|        u1_num_mb_part = pu1_num_mb_part[u1_mb_mc_mode];
  165|       |
  166|  21.5k|        pi1_ref_idx[0][0] = ((u1_mb_pred_mode_part0 & PRED_L0) - 1) >> 1;
  ------------------
  |  |  483|  21.5k|#define PRED_L0   1
  ------------------
  167|  21.5k|        pi1_ref_idx[1][0] = ((u1_mb_pred_mode_part0 & PRED_L1) - 1) >> 1;
  ------------------
  |  |  484|  21.5k|#define PRED_L1   2
  ------------------
  168|  21.5k|        pi1_ref_idx[0][1] = ((u1_mb_pred_mode_part1 & PRED_L0) - 1) >> 1;
  ------------------
  |  |  483|  21.5k|#define PRED_L0   1
  ------------------
  169|  21.5k|        pi1_ref_idx[1][1] = ((u1_mb_pred_mode_part1 & PRED_L1) - 1) >> 1;
  ------------------
  |  |  484|  21.5k|#define PRED_L1   2
  ------------------
  170|       |
  171|  21.5k|        u4_mb_pred_mode = (u1_mb_pred_mode_part0 << 8) | u1_mb_pred_mode_part1;
  172|  21.5k|        u4_mb_mc_mode = u1_mb_mc_mode | (u1_mb_mc_mode << 8);
  173|  21.5k|        u4_mb_mc_mode <<= 16;
  174|  21.5k|        u4_mb_pred_mode <<= 16;
  175|       |
  176|       |        /* Storing collocated Mb and SubMb mode information */
  177|  21.5k|        *pu1_col_info++ = (u1_mb_mc_mode << 6);
  178|  21.5k|        if(u1_mb_mc_mode)
  ------------------
  |  Branch (178:12): [True: 11.4k, False: 10.0k]
  ------------------
  179|  11.4k|            *pu1_col_info++ = (u1_mb_mc_mode << 6);
  180|  21.5k|    }
  181|       |
  182|  22.8k|    {
  183|  22.8k|        UWORD8 u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
  184|  22.8k|        UWORD8 uc_field = ps_cur_mb_info->u1_mb_field_decodingflag;
  185|  22.8k|        UWORD8 *pu1_num_ref_idx_lx_active =
  186|  22.8k|                        ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active;
  187|  22.8k|        const UWORD8 u1_mbaff_field = (u1_mbaff & uc_field);
  188|  22.8k|        UWORD8 u4_num_ref_idx_lx_active;
  189|       |
  190|  22.8k|        u4_num_ref_idx_lx_active = (pu1_num_ref_idx_lx_active[0]
  191|  22.8k|                        << u1_mbaff_field) - 1;
  192|       |
  193|  22.8k|        if(u4_num_ref_idx_lx_active)
  ------------------
  |  Branch (193:12): [True: 9.37k, False: 13.4k]
  ------------------
  194|  9.37k|        {
  195|  9.37k|            if(1 == u4_num_ref_idx_lx_active)
  ------------------
  |  Branch (195:16): [True: 2.15k, False: 7.22k]
  ------------------
  196|  2.15k|                ih264d_parse_bmb_ref_index_cavlc_range1(
  197|  2.15k|                                u1_num_mb_part, ps_bitstrm, pi1_ref_idx[0],
  198|  2.15k|                                u4_num_ref_idx_lx_active);
  199|  7.22k|            else
  200|  7.22k|            {
  201|  7.22k|                ret = ih264d_parse_bmb_ref_index_cavlc(u1_num_mb_part, ps_bitstrm,
  202|  7.22k|                                                 pi1_ref_idx[0],
  203|  7.22k|                                                 u4_num_ref_idx_lx_active);
  204|  7.22k|                if(ret != OK)
  ------------------
  |  |  114|  7.22k|#define OK        0
  ------------------
  |  Branch (204:20): [True: 285, False: 6.93k]
  ------------------
  205|    285|                    return ret;
  206|  7.22k|            }
  207|  9.37k|        }
  208|       |
  209|  22.5k|        u4_num_ref_idx_lx_active = (pu1_num_ref_idx_lx_active[1]
  210|  22.5k|                        << u1_mbaff_field) - 1;
  211|       |
  212|  22.5k|        if(u4_num_ref_idx_lx_active)
  ------------------
  |  Branch (212:12): [True: 10.6k, False: 11.9k]
  ------------------
  213|  10.6k|        {
  214|  10.6k|            if(1 == u4_num_ref_idx_lx_active)
  ------------------
  |  Branch (214:16): [True: 8.10k, False: 2.52k]
  ------------------
  215|  8.10k|                ih264d_parse_bmb_ref_index_cavlc_range1(
  216|  8.10k|                                u1_num_mb_part, ps_bitstrm, pi1_ref_idx[1],
  217|  8.10k|                                u4_num_ref_idx_lx_active);
  218|  2.52k|            else
  219|  2.52k|            {
  220|  2.52k|                ret = ih264d_parse_bmb_ref_index_cavlc(u1_num_mb_part, ps_bitstrm,
  221|  2.52k|                                                 pi1_ref_idx[1],
  222|  2.52k|                                                 u4_num_ref_idx_lx_active);
  223|  2.52k|                if(ret != OK)
  ------------------
  |  |  114|  2.52k|#define OK        0
  ------------------
  |  Branch (223:20): [True: 179, False: 2.35k]
  ------------------
  224|    179|                    return ret;
  225|  2.52k|            }
  226|  10.6k|        }
  227|  22.5k|    }
  228|       |
  229|       |    /* Read MotionVectors */
  230|  22.3k|    {
  231|  22.3k|        const UWORD8 * pu1_top_left_sub_mb_indx;
  232|       |
  233|  22.3k|        const UWORD8 * pu1_sub_mb_indx_mod =
  234|  22.3k|                        (const UWORD8 *)(gau1_ih264d_submb_indx_mod)
  235|  22.3k|                                        + (u1_sub_mb * 6);
  236|  22.3k|        const UWORD8 * pu1_sub_mb_partw = (const UWORD8 *)gau1_ih264d_submb_partw;
  237|  22.3k|        const UWORD8 * pu1_sub_mb_parth = (const UWORD8 *)gau1_ih264d_submb_parth;
  238|  22.3k|        const UWORD8 * pu1_num_sub_mb_part =
  239|  22.3k|                        (const UWORD8 *)gau1_ih264d_num_submb_part;
  240|  22.3k|        const UWORD8 * pu1_mb_partw = (const UWORD8 *)gau1_ih264d_mb_partw;
  241|  22.3k|        const UWORD8 * pu1_mb_parth = (const UWORD8 *)gau1_ih264d_mb_parth;
  242|  22.3k|        UWORD8 u1_p_idx = 0, u1_num_submb_part, uc_lx;
  243|  22.3k|        parse_part_params_t * ps_part;
  244|  22.3k|        mv_pred_t *ps_mv_start = ps_dec->ps_mv_cur + (u4_mb_num << 4);
  245|  22.3k|        UWORD8 u1_mb_part_wd, u1_mb_part_ht;
  246|       |
  247|       |        /* Initialisations */
  248|  22.3k|        ps_part = ps_dec->ps_part;
  249|       |        /* Default Initialization for Non subMb Case Mode */
  250|  22.3k|        u1_mb_part_wd = pu1_mb_partw[u1_mb_mc_mode];
  251|  22.3k|        u1_mb_part_ht = pu1_mb_parth[u1_mb_mc_mode];
  252|  22.3k|        u1_num_submb_part = 1;
  253|       |
  254|       |        /* Decoding the MV for the subMB */
  255|  67.1k|        for(uc_lx = 0; uc_lx < 2; uc_lx++)
  ------------------
  |  Branch (255:24): [True: 44.7k, False: 22.3k]
  ------------------
  256|  44.7k|        {
  257|  44.7k|            UWORD8 u1_sub_mb_num = 0, u1_pred_mode, uc_i;
  258|  44.7k|            UWORD32 u4_mb_mc_mode_tmp = u4_mb_mc_mode;
  259|  44.7k|            UWORD32 u4_mb_pred_mode_tmp = u4_mb_pred_mode;
  260|  44.7k|            UWORD16 u2_sub_mb_num = 0x028A; // for sub mb case
  261|  44.7k|            UWORD8 u1_b2 = uc_lx << 1;
  262|  44.7k|            u1_pred_mode = (uc_lx) ? PRED_L1 : PRED_L0;
  ------------------
  |  |  484|  22.3k|#define PRED_L1   2
  ------------------
                          u1_pred_mode = (uc_lx) ? PRED_L1 : PRED_L0;
  ------------------
  |  |  483|  67.1k|#define PRED_L0   1
  ------------------
  |  Branch (262:28): [True: 22.3k, False: 22.3k]
  ------------------
  263|  44.7k|            pu1_top_left_sub_mb_indx = pu1_sub_mb_indx_mod + (u1_mb_mc_mode << 1);
  264|       |
  265|   119k|            for(uc_i = 0; uc_i < u1_num_mb_part; uc_i++)
  ------------------
  |  Branch (265:27): [True: 74.6k, False: 44.7k]
  ------------------
  266|  74.6k|            {
  267|  74.6k|                UWORD8 u1_mb_mc_mode, uc_j;
  268|  74.6k|                UWORD8 i1_pred = u4_mb_pred_mode_tmp >> 24;
  269|  74.6k|                u1_mb_mc_mode = u4_mb_mc_mode_tmp >> 24;
  270|  74.6k|                u4_mb_pred_mode_tmp <<= 8;
  271|  74.6k|                u4_mb_mc_mode_tmp <<= 8;
  272|       |                /* subMb prediction mode */
  273|  74.6k|                if(u1_sub_mb)
  ------------------
  |  Branch (273:20): [True: 9.64k, False: 65.0k]
  ------------------
  274|  9.64k|                {
  275|       |
  276|  9.64k|                    u1_mb_part_wd = pu1_sub_mb_partw[u1_mb_mc_mode];
  277|  9.64k|                    u1_mb_part_ht = pu1_sub_mb_parth[u1_mb_mc_mode];
  278|  9.64k|                    u1_sub_mb_num = u2_sub_mb_num >> 12;
  279|  9.64k|                    u1_num_submb_part = pu1_num_sub_mb_part[u1_mb_mc_mode];
  280|  9.64k|                    pu1_top_left_sub_mb_indx = pu1_sub_mb_indx_mod
  281|  9.64k|                                    + (u1_mb_mc_mode << 1);
  282|  9.64k|                    u2_sub_mb_num <<= 4;
  283|  9.64k|                }
  284|   151k|                for(uc_j = 0; uc_j < u1_num_submb_part;
  ------------------
  |  Branch (284:31): [True: 76.7k, False: 74.6k]
  ------------------
  285|  76.7k|                                uc_j++, pu1_top_left_sub_mb_indx++)
  286|  76.7k|                {
  287|  76.7k|                    mv_pred_t * ps_mv;
  288|  76.7k|                    u1_sub_mb_num = u1_sub_mb_num + *pu1_top_left_sub_mb_indx;
  289|  76.7k|                    ps_mv = ps_mv_start + u1_sub_mb_num;
  290|       |
  291|       |                    /* Storing Info for partitions, writing only once */
  292|  76.7k|                    if(uc_lx)
  ------------------
  |  Branch (292:24): [True: 38.3k, False: 38.3k]
  ------------------
  293|  38.3k|                    {
  294|  38.3k|                        ps_part->u1_is_direct = (!i1_pred);
  295|  38.3k|                        ps_part->u1_pred_mode = i1_pred;
  296|  38.3k|                        ps_part->u1_sub_mb_num = u1_sub_mb_num;
  297|  38.3k|                        ps_part->u1_partheight = u1_mb_part_ht;
  298|  38.3k|                        ps_part->u1_partwidth = u1_mb_part_wd;
  299|       |                        /* Increment partition Index */
  300|  38.3k|                        u1_p_idx++;
  301|  38.3k|                        ps_part++;
  302|  38.3k|                    }
  303|       |
  304|  76.7k|                    if(i1_pred & u1_pred_mode)
  ------------------
  |  Branch (304:24): [True: 38.5k, False: 38.1k]
  ------------------
  305|  38.5k|                    {
  306|  38.5k|                        WORD16 i2_mvx, i2_mvy;
  307|       |
  308|       |//inlining ih264d_sev
  309|  38.5k|                        {
  310|  38.5k|                            UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
  311|  38.5k|                            UWORD32 u4_word, u4_ldz, u4_abs_val;
  312|       |
  313|       |                            /***************************************************************/
  314|       |                            /* Find leading zeros in next 32 bits                          */
  315|       |                            /***************************************************************/
  316|  38.5k|                            NEXTBITS_32(u4_word, u4_bitstream_offset,
  ------------------
  |  |  150|  38.5k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  38.5k|{                                                                           \
  |  |  152|  38.5k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  38.5k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  38.5k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  38.5k|                                                                            \
  |  |  156|  38.5k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  38.5k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 36.8k, False: 1.69k]
  |  |  ------------------
  |  |  158|  38.5k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  36.8k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  38.5k|}
  ------------------
  317|  38.5k|                                        pu4_bitstrm_buf);
  318|  38.5k|                            u4_ldz = CLZ(u4_word);
  319|       |
  320|       |                            /* Flush the ps_bitstrm */
  321|  38.5k|                            u4_bitstream_offset += (u4_ldz + 1);
  322|       |
  323|       |                            /* Read the suffix from the ps_bitstrm */
  324|  38.5k|                            u4_word = 0;
  325|  38.5k|                            if(u4_ldz)
  ------------------
  |  Branch (325:32): [True: 13.5k, False: 24.9k]
  ------------------
  326|  13.5k|                                GETBITS(u4_word, u4_bitstream_offset,
  ------------------
  |  |  120|  13.5k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  13.5k|{                                                                           \
  |  |  122|  13.5k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  13.5k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  13.5k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  13.5k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  13.5k|                                                                            \
  |  |  127|  13.5k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 12.8k, False: 712]
  |  |  ------------------
  |  |  128|  13.5k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  12.8k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  13.5k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  13.5k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  13.5k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  13.5k|}                                                                           \
  ------------------
  327|  38.5k|                                        pu4_bitstrm_buf, u4_ldz);
  328|       |
  329|  38.5k|                            *pu4_bitstrm_ofst = u4_bitstream_offset;
  330|  38.5k|                            u4_abs_val = ((1 << u4_ldz) + u4_word) >> 1;
  331|       |
  332|  38.5k|                            if(u4_word & 0x1)
  ------------------
  |  Branch (332:32): [True: 6.81k, False: 31.7k]
  ------------------
  333|  6.81k|                                i2_mvx = (-(WORD32)u4_abs_val);
  334|  31.7k|                            else
  335|  31.7k|                                i2_mvx = (u4_abs_val);
  336|  38.5k|                        }
  337|       |//inlinined ih264d_sev
  338|       |
  339|       |//inlining ih264d_sev
  340|  38.5k|                        {
  341|  38.5k|                            UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
  342|  38.5k|                            UWORD32 u4_word, u4_ldz, u4_abs_val;
  343|       |
  344|       |                            /***************************************************************/
  345|       |                            /* Find leading zeros in next 32 bits                          */
  346|       |                            /***************************************************************/
  347|  38.5k|                            NEXTBITS_32(u4_word, u4_bitstream_offset,
  ------------------
  |  |  150|  38.5k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  38.5k|{                                                                           \
  |  |  152|  38.5k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  38.5k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  38.5k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  38.5k|                                                                            \
  |  |  156|  38.5k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  38.5k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 37.2k, False: 1.32k]
  |  |  ------------------
  |  |  158|  38.5k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  37.2k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  38.5k|}
  ------------------
  348|  38.5k|                                        pu4_bitstrm_buf);
  349|  38.5k|                            u4_ldz = CLZ(u4_word);
  350|       |
  351|       |                            /* Flush the ps_bitstrm */
  352|  38.5k|                            u4_bitstream_offset += (u4_ldz + 1);
  353|       |
  354|       |                            /* Read the suffix from the ps_bitstrm */
  355|  38.5k|                            u4_word = 0;
  356|  38.5k|                            if(u4_ldz)
  ------------------
  |  Branch (356:32): [True: 17.3k, False: 21.2k]
  ------------------
  357|  17.3k|                                GETBITS(u4_word, u4_bitstream_offset,
  ------------------
  |  |  120|  17.3k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  17.3k|{                                                                           \
  |  |  122|  17.3k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  17.3k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  17.3k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  17.3k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  17.3k|                                                                            \
  |  |  127|  17.3k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 16.6k, False: 701]
  |  |  ------------------
  |  |  128|  17.3k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  16.6k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  17.3k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  17.3k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  17.3k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  17.3k|}                                                                           \
  ------------------
  358|  38.5k|                                        pu4_bitstrm_buf, u4_ldz);
  359|       |
  360|  38.5k|                            *pu4_bitstrm_ofst = u4_bitstream_offset;
  361|  38.5k|                            u4_abs_val = ((1 << u4_ldz) + u4_word) >> 1;
  362|       |
  363|  38.5k|                            if(u4_word & 0x1)
  ------------------
  |  Branch (363:32): [True: 6.71k, False: 31.8k]
  ------------------
  364|  6.71k|                                i2_mvy = (-(WORD32)u4_abs_val);
  365|  31.8k|                            else
  366|  31.8k|                                i2_mvy = (u4_abs_val);
  367|  38.5k|                        }
  368|       |//inlinined ih264d_sev
  369|       |
  370|       |                        /* Storing Mv residuals */
  371|  38.5k|                        ps_mv->i2_mv[u1_b2] = i2_mvx;
  372|  38.5k|                        ps_mv->i2_mv[u1_b2 + 1] = i2_mvy;
  373|  38.5k|                    }
  374|  76.7k|                }
  375|  74.6k|            }
  376|  44.7k|        }
  377|       |        /* write back to the scratch partition info */
  378|  22.3k|        ps_dec->ps_part = ps_part;
  379|  22.3k|        ps_parse_mb_data->u1_num_part = u1_sub_mb ? u1_p_idx : u1_num_mb_part;
  ------------------
  |  Branch (379:41): [True: 1.20k, False: 21.1k]
  ------------------
  380|       |
  381|  22.3k|    }
  382|  22.3k|    return OK;
  ------------------
  |  |  114|  22.3k|#define OK        0
  ------------------
  383|  22.5k|}
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: 33.7k, False: 71.2k]
  ------------------
  443|  33.7k|    {
  444|  33.7k|        const UWORD8 u1_colz = ((PRED_8x8) << 6);
  ------------------
  |  |  453|  33.7k|#define PRED_8x8    3
  ------------------
  445|  33.7k|        UWORD8 uc_i;
  446|  33.7k|        u1_mb_mc_mode = 0;
  447|  33.7k|        u1_num_mb_part = 4;
  448|       |        /* Reading the subMB type */
  449|   168k|        for(uc_i = 0; uc_i < 4; uc_i++)
  ------------------
  |  Branch (449:23): [True: 135k, False: 33.7k]
  ------------------
  450|   135k|        {
  451|   135k|            UWORD8 u1_sub_mb_mode, u1_subMbPredModes;
  452|   135k|            u1_sub_mb_mode = ih264d_parse_submb_type_cabac(
  453|   135k|                            1, ps_cab_env, ps_bitstrm,
  454|   135k|                            ps_dec->p_sub_mb_type_t);
  455|       |
  456|   135k|            if(u1_sub_mb_mode > 12)
  ------------------
  |  Branch (456:16): [True: 0, False: 135k]
  ------------------
  457|      0|                return ERROR_SUB_MB_TYPE;
  458|       |
  459|   135k|            u1_subMbPredModes = pu1_sub_mb_pred_modes[u1_sub_mb_mode];
  460|   135k|            u4_mb_mc_mode = (u4_mb_mc_mode << 8) | pu1_sub_mb_mc_mode[u1_sub_mb_mode];
  461|   135k|            u4_mb_pred_mode = (u4_mb_pred_mode << 8) | u1_subMbPredModes;
  462|   135k|            *pi1_ref_idx_l0++ =
  463|   135k|                            (u1_subMbPredModes & PRED_L0) ? u1_dec_ref_l0 : -1;
  ------------------
  |  |  483|   135k|#define PRED_L0   1
  ------------------
  |  Branch (463:29): [True: 113k, False: 21.1k]
  ------------------
  464|   135k|            *pi1_ref_idx_l1++ =
  465|   135k|                            (u1_subMbPredModes & PRED_L1) ? u1_dec_ref_l1 : -1;
  ------------------
  |  |  484|   135k|#define PRED_L1   2
  ------------------
  |  Branch (465:29): [True: 33.8k, False: 101k]
  ------------------
  466|   135k|            COPYTHECONTEXT("sub_mb_type", u1_sub_mb_mode);
  467|       |            /* Storing collocated Mb and SubMb mode information */
  468|   135k|            *pu1_col_info++ =
  469|   135k|                            (u1_colz | (pu1_sub_mb_mc_mode[u1_sub_mb_mode] << 4));
  470|   135k|            if(u1_sub_mb_mode != B_DIRECT_8x8)
  ------------------
  |  |  465|   135k|#define B_DIRECT_8x8    0
  ------------------
  |  Branch (470:16): [True: 124k, False: 10.4k]
  ------------------
  471|   124k|            {
  472|   124k|                if(u1_sub_mb_mode > B_BI_8x8)
  ------------------
  |  |  468|   124k|#define B_BI_8x8        3
  ------------------
  |  Branch (472:20): [True: 9.94k, False: 114k]
  ------------------
  473|  9.94k|                {
  474|  9.94k|                    ps_dec->s_high_profile.u1_no_submb_part_size_lt8x8_flag = 0;
  475|  9.94k|                }
  476|   124k|            }
  477|  10.4k|            else if(!ps_dec->s_high_profile.u1_direct_8x8_inference_flag)
  ------------------
  |  Branch (477:21): [True: 9.82k, False: 602]
  ------------------
  478|  9.82k|            {
  479|  9.82k|                ps_dec->s_high_profile.u1_no_submb_part_size_lt8x8_flag = 0;
  480|  9.82k|            }
  481|   135k|        }
  482|  33.7k|        pi1_ref_idx_l0 -= 4;
  483|  33.7k|        pi1_ref_idx_l1 -= 4;
  484|  33.7k|    }
  485|  71.2k|    else
  486|  71.2k|    {
  487|  71.2k|        UWORD8 u1_mb_pred_mode_part0 = pu1_mb_pred_modes[0][u1_mbpred_mode];
  488|  71.2k|        UWORD8 u1_mb_pred_mode_part1 = pu1_mb_pred_modes[1][u1_mbpred_mode];
  489|  71.2k|        u1_mb_mc_mode = ps_cur_mb_info->u1_mb_mc_mode;
  490|  71.2k|        u1_num_mb_part = pu1_num_mb_part[u1_mb_mc_mode];
  491|       |        /* Storing collocated Mb and SubMb mode information */
  492|  71.2k|        *pu1_col_info++ = (u1_mb_mc_mode << 6);
  493|  71.2k|        if(u1_mb_mc_mode)
  ------------------
  |  Branch (493:12): [True: 45.1k, False: 26.1k]
  ------------------
  494|  45.1k|            *pu1_col_info++ = (u1_mb_mc_mode << 6);
  495|  71.2k|        u4_mb_mc_mode = u1_mb_mc_mode | (u1_mb_mc_mode << 8);
  496|  71.2k|        u4_mb_mc_mode <<= 16;
  497|  71.2k|        u4_mb_pred_mode = ((u1_mb_pred_mode_part0 << 8) | u1_mb_pred_mode_part1) << 16;
  498|       |
  499|  71.2k|        *pi1_ref_idx_l0++ = (u1_mb_pred_mode_part0 & PRED_L0) ? u1_dec_ref_l0 : -1;
  ------------------
  |  |  483|  71.2k|#define PRED_L0   1
  ------------------
  |  Branch (499:29): [True: 43.0k, False: 28.1k]
  ------------------
  500|  71.2k|        *pi1_ref_idx_l0-- = (u1_mb_pred_mode_part1 & PRED_L0) ? u1_dec_ref_l0 : -1;
  ------------------
  |  |  483|  71.2k|#define PRED_L0   1
  ------------------
  |  Branch (500:29): [True: 62.8k, False: 8.32k]
  ------------------
  501|  71.2k|        *pi1_ref_idx_l1++ = (u1_mb_pred_mode_part0 & PRED_L1) ? u1_dec_ref_l1 : -1;
  ------------------
  |  |  484|  71.2k|#define PRED_L1   2
  ------------------
  |  Branch (501:29): [True: 38.3k, False: 32.8k]
  ------------------
  502|  71.2k|        *pi1_ref_idx_l1-- = (u1_mb_pred_mode_part1 & PRED_L1) ? u1_dec_ref_l1 : -1;
  ------------------
  |  |  484|  71.2k|#define PRED_L1   2
  ------------------
  |  Branch (502:29): [True: 63.4k, False: 7.72k]
  ------------------
  503|  71.2k|    }
  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: 197, False: 104k]
  ------------------
  513|    197|            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: 194, False: 104k]
  ------------------
  520|    194|            return ret;
  521|   104k|    }
  522|       |    /* Read MotionVectors */
  523|   104k|    {
  524|   104k|        const UWORD8 *pu1_top_left_sub_mb_indx;
  525|   104k|        UWORD8 uc_j, uc_lx;
  526|   104k|        UWORD8 u1_mb_part_wd, u1_mb_part_ht;
  527|       |
  528|   104k|        const UWORD8 *pu1_sub_mb_indx_mod =
  529|   104k|                        (const UWORD8 *)gau1_ih264d_submb_indx_mod
  530|   104k|                                        + (u1_sub_mb * 6);
  531|   104k|        const UWORD8 *pu1_sub_mb_partw = (const UWORD8 *)gau1_ih264d_submb_partw;
  532|   104k|        const UWORD8 *pu1_sub_mb_parth = (const UWORD8 *)gau1_ih264d_submb_parth;
  533|   104k|        const UWORD8 *pu1_num_sub_mb_part =
  534|   104k|                        (const UWORD8 *)gau1_ih264d_num_submb_part;
  535|   104k|        const UWORD8 *pu1_mb_partw = (const UWORD8 *)gau1_ih264d_mb_partw;
  536|   104k|        const UWORD8 *pu1_mb_parth = (const UWORD8 *)gau1_ih264d_mb_parth;
  537|       |
  538|   104k|        UWORD8 u1_p_idx = 0;
  539|   104k|        UWORD8 u1_num_submb_part;
  540|   104k|        parse_part_params_t *ps_part;
  541|       |        /* Initialisations */
  542|   104k|        mv_pred_t *ps_mv_start = ps_dec->ps_mv_cur + (u4_mb_num << 4);
  543|   104k|        ps_part = ps_dec->ps_part;
  544|       |
  545|       |        /* Default initialization for non subMb case */
  546|   104k|        u1_mb_part_wd = pu1_mb_partw[u1_mb_mc_mode];
  547|   104k|        u1_mb_part_ht = pu1_mb_parth[u1_mb_mc_mode];
  548|   104k|        u1_num_submb_part = 1;
  549|       |
  550|       |        /* Decoding the MV for the subMB */
  551|   313k|        for(uc_lx = 0; uc_lx < 2; uc_lx++)
  ------------------
  |  Branch (551:24): [True: 209k, False: 104k]
  ------------------
  552|   209k|        {
  553|   209k|            UWORD32 u4_sub_mb_num = 0;
  554|   209k|            UWORD32 u4_mb_pred_mode_tmp = u4_mb_pred_mode;
  555|   209k|            UWORD32 u4_mb_mc_mode_tmp = u4_mb_mc_mode;
  556|   209k|            UWORD8 u1_mb_mc_mode_1, u1_pred_mode, uc_i;
  557|   209k|            UWORD16 u2_sub_mb_num = 0x028A;
  558|   209k|            UWORD8 u1_b2 = uc_lx << 1;
  559|   209k|            u1_pred_mode = (uc_lx) ? PRED_L1 : PRED_L0;
  ------------------
  |  |  484|   104k|#define PRED_L1   2
  ------------------
                          u1_pred_mode = (uc_lx) ? PRED_L1 : PRED_L0;
  ------------------
  |  |  483|   313k|#define PRED_L0   1
  ------------------
  |  Branch (559:28): [True: 104k, False: 104k]
  ------------------
  560|       |            /* Default for Cabac */
  561|   209k|            pu1_top_left_sub_mb_indx = pu1_sub_mb_indx_mod + (u1_mb_mc_mode << 1);
  562|   710k|            for(uc_i = 0; uc_i < u1_num_mb_part; uc_i++)
  ------------------
  |  Branch (562:27): [True: 501k, False: 209k]
  ------------------
  563|   501k|            {
  564|       |
  565|   501k|                WORD8 i1_pred = (UWORD8)(u4_mb_pred_mode_tmp >> 24);
  566|   501k|                u1_mb_mc_mode_1 = (UWORD8)(u4_mb_mc_mode_tmp >> 24);
  567|   501k|                u4_mb_pred_mode_tmp <<= 8;
  568|   501k|                u4_mb_mc_mode_tmp <<= 8;
  569|       |
  570|       |                /* subMb prediction mode */
  571|   501k|                if(u1_sub_mb)
  ------------------
  |  Branch (571:20): [True: 269k, False: 231k]
  ------------------
  572|   269k|                {
  573|   269k|                    u1_mb_part_wd = pu1_sub_mb_partw[u1_mb_mc_mode_1];
  574|   269k|                    u1_mb_part_ht = pu1_sub_mb_parth[u1_mb_mc_mode_1];
  575|   269k|                    u4_sub_mb_num = u2_sub_mb_num >> 12;
  576|   269k|                    pu1_top_left_sub_mb_indx = pu1_sub_mb_indx_mod + (u1_mb_mc_mode_1 << 1);
  577|   269k|                    u1_num_submb_part = pu1_num_sub_mb_part[u1_mb_mc_mode_1];
  578|   269k|                    u2_sub_mb_num = u2_sub_mb_num << 4;
  579|   269k|                }
  580|       |
  581|  1.02M|                for(uc_j = 0; uc_j < u1_num_submb_part;
  ------------------
  |  Branch (581:31): [True: 527k, False: 501k]
  ------------------
  582|   527k|                                uc_j++, pu1_top_left_sub_mb_indx++)
  583|   527k|                {
  584|   527k|                    mv_pred_t *ps_mv;
  585|   527k|                    u4_sub_mb_num = u4_sub_mb_num + *pu1_top_left_sub_mb_indx;
  586|   527k|                    ps_mv = ps_mv_start + u4_sub_mb_num;
  587|       |
  588|       |                    /* Storing Info for partitions, writing only once */
  589|   527k|                    if(uc_lx)
  ------------------
  |  Branch (589:24): [True: 263k, False: 263k]
  ------------------
  590|   263k|                    {
  591|   263k|                        ps_part->u1_is_direct = (!i1_pred);
  592|   263k|                        ps_part->u1_pred_mode = i1_pred;
  593|   263k|                        ps_part->u1_sub_mb_num = u4_sub_mb_num;
  594|   263k|                        ps_part->u1_partheight = u1_mb_part_ht;
  595|   263k|                        ps_part->u1_partwidth = u1_mb_part_wd;
  596|       |
  597|       |                        /* Increment partition Index */
  598|   263k|                        u1_p_idx++;
  599|   263k|                        ps_part++;
  600|   263k|                    }
  601|       |
  602|   527k|                    ih264d_get_mvd_cabac(u4_sub_mb_num, u1_b2, u1_mb_part_wd,
  603|   527k|                                         u1_mb_part_ht,
  604|   527k|                                         (UWORD8)(i1_pred & u1_pred_mode), ps_dec,
  605|   527k|                                         ps_mv);
  606|   527k|                }
  607|   501k|            }
  608|   209k|        }
  609|       |        /* write back to the scratch partition info */
  610|       |
  611|   104k|        ps_dec->ps_part = ps_part;
  612|   104k|        ps_parse_mb_data->u1_num_part = u1_sub_mb ? u1_p_idx : u1_num_mb_part;
  ------------------
  |  Branch (612:41): [True: 33.7k, False: 70.8k]
  ------------------
  613|       |
  614|   104k|    }
  615|       |
  616|   104k|    return OK;
  ------------------
  |  |  114|   104k|#define OK        0
  ------------------
  617|   104k|}
ih264d_parse_bmb_cabac:
  634|   109k|{
  635|   109k|    UWORD8 u1_cbp;
  636|   109k|    deblk_mb_t * ps_cur_deblk_mb = ps_dec->ps_deblk_mbn + u4_mb_num;
  637|   109k|    const UWORD8 *puc_mb_mc_mode = (const UWORD8 *)gau1_ih264d_mb_mc_mode;
  638|   109k|    UWORD8 u1_mb_type = ps_cur_mb_info->u1_mb_type;
  639|   109k|    ctxt_inc_mb_info_t *p_curr_ctxt = ps_dec->ps_curr_ctxt_mb_info;
  640|       |
  641|   109k|    WORD32 ret;
  642|   109k|    UWORD8 u1_Bdirect_tranform_read = 1;
  643|   109k|    ps_dec->s_high_profile.u1_no_submb_part_size_lt8x8_flag = 1;
  644|       |
  645|   109k|    ps_cur_mb_info->u1_mb_mc_mode = puc_mb_mc_mode[5 + u1_mb_type];
  646|       |
  647|   109k|    ps_cur_mb_info->u1_yuv_dc_block_flag = 0;
  648|       |
  649|   109k|    ps_cur_deblk_mb->u1_mb_type |= D_B_SLICE;
  ------------------
  |  |  384|   109k|#define D_B_SLICE         4
  ------------------
  650|   109k|    if(u1_mb_type != B_DIRECT)
  ------------------
  |  |  482|   109k|#define B_DIRECT  0
  ------------------
  |  Branch (650:8): [True: 104k, False: 4.12k]
  ------------------
  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: 391, False: 104k]
  ------------------
  655|    391|            return ret;
  656|   104k|    }
  657|  4.12k|    else
  658|  4.12k|    {
  659|       |
  660|       |        /************ STORING PARTITION INFO ***********/
  661|  4.12k|        parse_part_params_t * ps_part_info;
  662|  4.12k|        ps_part_info = ps_dec->ps_part;
  663|  4.12k|        ps_part_info->u1_is_direct = PART_DIRECT_16x16;
  ------------------
  |  |  572|  4.12k|#define PART_DIRECT_16x16              2
  ------------------
  664|  4.12k|        ps_part_info->u1_sub_mb_num = 0;
  665|  4.12k|        ps_dec->ps_part++;
  666|  4.12k|        p_curr_ctxt->u1_mb_type = CAB_BD16x16;
  ------------------
  |  |  396|  4.12k|#define CAB_BD16x16       0x04 /* 0000 0100 */
  ------------------
  667|       |
  668|  4.12k|        MEMSET_16BYTES(&ps_dec->pu1_left_mv_ctxt_inc[0][0], 0);
  ------------------
  |  |  652|  4.12k|#define MEMSET_16BYTES(pu4_start,value)                         \
  |  |  653|  4.12k|{                                                               \
  |  |  654|  4.12k|    memset(pu4_start,value,16);                                 \
  |  |  655|  4.12k|}
  ------------------
  669|  4.12k|        memset(ps_dec->pi1_left_ref_idx_ctxt_inc, 0, 4);
  670|  4.12k|        MEMSET_16BYTES(p_curr_ctxt->u1_mv, 0);
  ------------------
  |  |  652|  4.12k|#define MEMSET_16BYTES(pu4_start,value)                         \
  |  |  653|  4.12k|{                                                               \
  |  |  654|  4.12k|    memset(pu4_start,value,16);                                 \
  |  |  655|  4.12k|}
  ------------------
  671|  4.12k|        memset(p_curr_ctxt->i1_ref_idx, 0, 4);
  672|       |
  673|       |        /* check whether transform8x8 u4_flag to be read or not */
  674|  4.12k|        u1_Bdirect_tranform_read =
  675|  4.12k|                        ps_dec->s_high_profile.u1_direct_8x8_inference_flag;
  676|  4.12k|    }
  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: 5.44k, False: 103k]
  |  Branch (691:60): [True: 2.32k, False: 3.12k]
  ------------------
  692|  2.32k|                    && (ps_dec->s_high_profile.u1_no_submb_part_size_lt8x8_flag)
  ------------------
  |  Branch (692:24): [True: 1.87k, False: 449]
  ------------------
  693|  1.87k|                    && (u1_Bdirect_tranform_read))
  ------------------
  |  Branch (693:24): [True: 1.77k, False: 100]
  ------------------
  694|  1.77k|    {
  695|  1.77k|        ps_cur_mb_info->u1_tran_form8x8 = ih264d_parse_transform8x8flag_cabac(
  696|  1.77k|                        ps_dec, ps_cur_mb_info);
  697|  1.77k|        COPYTHECONTEXT("transform_size_8x8_flag", ps_cur_mb_info->u1_tran_form8x8);
  698|       |
  699|  1.77k|        ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = ps_cur_mb_info->u1_tran_form8x8;
  700|  1.77k|        p_curr_ctxt->u1_transform8x8_ctxt = ps_cur_mb_info->u1_tran_form8x8;
  701|  1.77k|    }
  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: 23.3k, False: 85.3k]
  ------------------
  713|  23.3k|    {
  714|  23.3k|        WORD8 c_temp;
  715|  23.3k|        ret = ih264d_parse_mb_qp_delta_cabac(ps_dec, &c_temp);
  716|  23.3k|        if(ret != OK)
  ------------------
  |  |  114|  23.3k|#define OK        0
  ------------------
  |  Branch (716:12): [True: 135, False: 23.1k]
  ------------------
  717|    135|            return ret;
  718|  23.1k|        COPYTHECONTEXT("mb_qp_delta", c_temp);
  719|  23.1k|        if(c_temp)
  ------------------
  |  Branch (719:12): [True: 1.79k, False: 21.3k]
  ------------------
  720|  1.79k|        {
  721|  1.79k|            ret = ih264d_update_qp(ps_dec, c_temp);
  722|  1.79k|            if(ret != OK)
  ------------------
  |  |  114|  1.79k|#define OK        0
  ------------------
  |  Branch (722:16): [True: 0, False: 1.79k]
  ------------------
  723|      0|                return ret;
  724|  1.79k|        }
  725|  23.1k|    }
  726|  85.3k|    else
  727|  85.3k|        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.52k, False: 107k]
  |  |  ------------------
  ------------------
  731|  1.52k|        return ERROR_EOB_TERMINATE_T;
  732|   107k|    return OK;
  ------------------
  |  |  114|   107k|#define OK        0
  ------------------
  733|   108k|}
ih264d_parse_bmb_cavlc:
  749|  60.3k|{
  750|  60.3k|    UWORD32 u4_cbp;
  751|  60.3k|    deblk_mb_t * ps_cur_deblk_mb = ps_dec->ps_deblk_mbn + u4_mb_num;
  752|  60.3k|    dec_bit_stream_t * const ps_bitstrm = ps_dec->ps_bitstrm;
  753|  60.3k|    UWORD32 * pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
  754|  60.3k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
  755|  60.3k|    const UWORD8 *puc_mb_mc_mode = (const UWORD8 *)gau1_ih264d_mb_mc_mode;
  756|  60.3k|    UWORD8 u1_mb_type = ps_cur_mb_info->u1_mb_type;
  757|       |
  758|  60.3k|    WORD32 ret;
  759|  60.3k|    UWORD8 u1_Bdirect_tranform_read = 1;
  760|  60.3k|    ps_dec->s_high_profile.u1_no_submb_part_size_lt8x8_flag = 1;
  761|  60.3k|    ps_cur_mb_info->u1_tran_form8x8 = 0;
  762|  60.3k|    ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = 0;
  763|       |
  764|  60.3k|    ps_cur_mb_info->u1_yuv_dc_block_flag = 0;
  765|       |
  766|  60.3k|    ps_cur_mb_info->u1_mb_mc_mode = puc_mb_mc_mode[5 + u1_mb_type];
  767|       |
  768|  60.3k|    ps_cur_deblk_mb->u1_mb_type |= D_B_SLICE;
  ------------------
  |  |  384|  60.3k|#define D_B_SLICE         4
  ------------------
  769|  60.3k|    if(u1_mb_type != B_DIRECT)
  ------------------
  |  |  482|  60.3k|#define B_DIRECT  0
  ------------------
  |  Branch (769:8): [True: 22.9k, False: 37.3k]
  ------------------
  770|  22.9k|    {
  771|  22.9k|        ret = ih264d_parse_bmb_non_direct_cavlc(ps_dec, ps_cur_mb_info, u4_mb_num,
  772|  22.9k|                                          u4_num_mbsNby2);
  773|  22.9k|        if(ret != OK)
  ------------------
  |  |  114|  22.9k|#define OK        0
  ------------------
  |  Branch (773:12): [True: 595, False: 22.3k]
  ------------------
  774|    595|            return ret;
  775|  22.9k|    }
  776|  37.3k|    else
  777|  37.3k|    {
  778|       |        /************ STORING PARTITION INFO ***********/
  779|  37.3k|        parse_part_params_t * ps_part_info;
  780|  37.3k|        ps_part_info = ps_dec->ps_part;
  781|  37.3k|        ps_part_info->u1_is_direct = PART_DIRECT_16x16;
  ------------------
  |  |  572|  37.3k|#define PART_DIRECT_16x16              2
  ------------------
  782|  37.3k|        ps_part_info->u1_sub_mb_num = 0;
  783|  37.3k|        ps_dec->ps_part++;
  784|       |        /* check whether transform8x8 u4_flag to be read or not */
  785|  37.3k|        u1_Bdirect_tranform_read =
  786|  37.3k|                        ps_dec->s_high_profile.u1_direct_8x8_inference_flag;
  787|  37.3k|    }
  788|       |
  789|       |    /* Read the Coded block pattern */
  790|  59.7k|    {
  791|  59.7k|        const UWORD8 * puc_CbpInter = gau1_ih264d_cbp_inter;
  792|       |//Inlined ih264d_uev
  793|  59.7k|        UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
  794|  59.7k|        UWORD32 u4_word, u4_ldz;
  795|       |
  796|       |        /***************************************************************/
  797|       |        /* Find leading zeros in next 32 bits                          */
  798|       |        /***************************************************************/
  799|  59.7k|        NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  59.7k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  59.7k|{                                                                           \
  |  |  152|  59.7k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  59.7k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  59.7k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  59.7k|                                                                            \
  |  |  156|  59.7k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  59.7k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 58.1k, False: 1.58k]
  |  |  ------------------
  |  |  158|  59.7k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  58.1k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  59.7k|}
  ------------------
  800|  59.7k|        u4_ldz = CLZ(u4_word);
  801|       |        /* Flush the ps_bitstrm */
  802|  59.7k|        u4_bitstream_offset += (u4_ldz + 1);
  803|       |        /* Read the suffix from the ps_bitstrm */
  804|  59.7k|        u4_word = 0;
  805|  59.7k|        if(u4_ldz)
  ------------------
  |  Branch (805:12): [True: 15.2k, False: 44.5k]
  ------------------
  806|  15.2k|            GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  15.2k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  15.2k|{                                                                           \
  |  |  122|  15.2k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  15.2k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  15.2k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  15.2k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  15.2k|                                                                            \
  |  |  127|  15.2k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 14.5k, False: 692]
  |  |  ------------------
  |  |  128|  15.2k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  14.5k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  15.2k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  15.2k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  15.2k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  15.2k|}                                                                           \
  ------------------
  807|  59.7k|        *pu4_bitstrm_ofst = u4_bitstream_offset;
  808|  59.7k|        u4_cbp = ((1 << u4_ldz) + u4_word - 1);
  809|       |//Inlined ih264d_uev
  810|  59.7k|        if(u4_cbp > 47)
  ------------------
  |  Branch (810:12): [True: 1.15k, False: 58.6k]
  ------------------
  811|  1.15k|            return ERROR_CBP;
  812|  58.6k|        u4_cbp = puc_CbpInter[u4_cbp];
  813|       |
  814|  58.6k|        if((ps_dec->s_high_profile.u1_transform8x8_present) && (u4_cbp & (0xf))
  ------------------
  |  Branch (814:12): [True: 4.28k, False: 54.3k]
  |  Branch (814:64): [True: 1.58k, False: 2.70k]
  ------------------
  815|  1.58k|                        && (ps_dec->s_high_profile.u1_no_submb_part_size_lt8x8_flag)
  ------------------
  |  Branch (815:28): [True: 1.38k, False: 195]
  ------------------
  816|  1.38k|                        && (u1_Bdirect_tranform_read))
  ------------------
  |  Branch (816:28): [True: 1.16k, False: 219]
  ------------------
  817|  1.16k|        {
  818|  1.16k|            ps_cur_mb_info->u1_tran_form8x8 = ih264d_get_bit_h264(ps_bitstrm);
  819|  1.16k|            COPYTHECONTEXT("transform_size_8x8_flag", ps_cur_mb_info->u1_tran_form8x8);
  820|  1.16k|            ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = ps_cur_mb_info->u1_tran_form8x8;
  821|  1.16k|        }
  822|       |
  823|  58.6k|    }
  824|       |
  825|      0|    COPYTHECONTEXT("coded_block_pattern", u4_cbp);
  826|  58.6k|    ps_cur_mb_info->u1_cbp = u4_cbp;
  827|       |
  828|       |    /* Read mb_qp_delta */
  829|  58.6k|    if(u4_cbp)
  ------------------
  |  Branch (829:8): [True: 14.0k, False: 44.5k]
  ------------------
  830|  14.0k|    {
  831|  14.0k|        WORD32 i_temp;
  832|       |//inlining ih264d_sev
  833|       |
  834|  14.0k|        UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
  835|  14.0k|        UWORD32 u4_word, u4_ldz, u4_abs_val;
  836|       |
  837|       |        /***************************************************************/
  838|       |        /* Find leading zeros in next 32 bits                          */
  839|       |        /***************************************************************/
  840|  14.0k|        NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  14.0k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  14.0k|{                                                                           \
  |  |  152|  14.0k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  14.0k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  14.0k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  14.0k|                                                                            \
  |  |  156|  14.0k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  14.0k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 13.5k, False: 462]
  |  |  ------------------
  |  |  158|  14.0k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  13.5k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  14.0k|}
  ------------------
  841|  14.0k|        u4_ldz = CLZ(u4_word);
  842|       |
  843|       |        /* Flush the ps_bitstrm */
  844|  14.0k|        u4_bitstream_offset += (u4_ldz + 1);
  845|       |
  846|       |        /* Read the suffix from the ps_bitstrm */
  847|  14.0k|        u4_word = 0;
  848|  14.0k|        if(u4_ldz)
  ------------------
  |  Branch (848:12): [True: 6.55k, False: 7.50k]
  ------------------
  849|  6.55k|            GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  6.55k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  6.55k|{                                                                           \
  |  |  122|  6.55k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  6.55k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  6.55k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  6.55k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  6.55k|                                                                            \
  |  |  127|  6.55k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 6.02k, False: 538]
  |  |  ------------------
  |  |  128|  6.55k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  6.02k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  6.55k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  6.55k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  6.55k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  6.55k|}                                                                           \
  ------------------
  850|       |
  851|  14.0k|        *pu4_bitstrm_ofst = u4_bitstream_offset;
  852|  14.0k|        u4_abs_val = ((1 << u4_ldz) + u4_word) >> 1;
  853|       |
  854|  14.0k|        if(u4_word & 0x1)
  ------------------
  |  Branch (854:12): [True: 3.99k, False: 10.0k]
  ------------------
  855|  3.99k|            i_temp = (-(WORD32)u4_abs_val);
  856|  10.0k|        else
  857|  10.0k|            i_temp = (u4_abs_val);
  858|       |
  859|  14.0k|        if(i_temp < -26 || i_temp > 25)
  ------------------
  |  Branch (859:12): [True: 177, False: 13.8k]
  |  Branch (859:28): [True: 275, False: 13.6k]
  ------------------
  860|    452|            return ERROR_INV_RANGE_QP_T;
  861|       |//inlinined ih264d_sev
  862|  13.6k|        COPYTHECONTEXT("mb_qp_delta", i_temp);
  863|  13.6k|        if(i_temp)
  ------------------
  |  Branch (863:12): [True: 6.10k, False: 7.50k]
  ------------------
  864|  6.10k|        {
  865|  6.10k|            ret = ih264d_update_qp(ps_dec, (WORD8)i_temp);
  866|  6.10k|            if(ret != OK)
  ------------------
  |  |  114|  6.10k|#define OK        0
  ------------------
  |  Branch (866:16): [True: 0, False: 6.10k]
  ------------------
  867|      0|                return ret;
  868|  6.10k|        }
  869|       |
  870|  13.6k|        ret = ih264d_parse_residual4x4_cavlc(ps_dec, ps_cur_mb_info, 0);
  871|  13.6k|        if(ret != OK)
  ------------------
  |  |  114|  13.6k|#define OK        0
  ------------------
  |  Branch (871:12): [True: 1.17k, False: 12.4k]
  ------------------
  872|  1.17k|            return ret;
  873|  12.4k|        if(EXCEED_OFFSET(ps_bitstrm))
  ------------------
  |  |   93|  12.4k|  (ps_bitstrm->u4_ofst > ps_bitstrm->u4_max_ofst)
  |  |  ------------------
  |  |  |  Branch (93:3): [True: 586, False: 11.8k]
  |  |  ------------------
  ------------------
  874|    586|            return ERROR_EOB_TERMINATE_T;
  875|  12.4k|    }
  876|  44.5k|    else
  877|  44.5k|    {
  878|  44.5k|        ps_dec->i1_prev_mb_qp_delta = 0;
  879|  44.5k|        ih264d_update_nnz_for_skipmb(ps_dec, ps_cur_mb_info, CAVLC);
  ------------------
  |  |  338|  44.5k|#define CAVLC  0
  ------------------
  880|  44.5k|    }
  881|       |
  882|  56.4k|    return OK;
  ------------------
  |  |  114|  56.4k|#define OK        0
  ------------------
  883|  58.6k|}
ih264d_mv_pred_ref_tfr_nby2_bmb:
  888|   118k|{
  889|   118k|    parse_pmbarams_t * ps_mb_part_info;
  890|   118k|    parse_part_params_t * ps_part;
  891|   118k|    mv_pred_t *ps_mv_nmb, *ps_mv_nmb_start, *ps_mv_ntop, *ps_mv_ntop_start;
  892|   118k|    pic_buffer_t * ps_ref_frame;
  893|   118k|    UWORD8 u1_direct_mode_width;
  894|   118k|    UWORD32 i;
  895|   118k|    UWORD8 j;
  896|   118k|    dec_mb_info_t * ps_cur_mb_info;
  897|   118k|    const UWORD8 u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
  898|   118k|    UWORD8 u1_field;
  899|   118k|    WORD32 ret = 0;
  900|       |
  901|   118k|    ps_dec->i4_submb_ofst -= (WORD32)(u4_num_mbs - u4_mb_idx) << 4;
  902|   118k|    ps_mb_part_info = ps_dec->ps_parse_mb_data;
  903|   118k|    ps_part = ps_dec->ps_parse_part_params;
  904|       |
  905|       |    /* N/2 Mb MvPred and Transfer Setup Loop */
  906|   987k|    for(i = u4_mb_idx; i < u4_num_mbs; i++, ps_mb_part_info++)
  ------------------
  |  Branch (906:24): [True: 869k, False: 118k]
  ------------------
  907|   869k|    {
  908|   869k|        UWORD8 u1_colz = 0;
  909|   869k|        ps_dec->i4_submb_ofst += SUB_BLK_SIZE;
  ------------------
  |  |  562|   869k|#define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|   869k|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  |  |               #define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|   869k|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  ------------------
  910|       |        /* Restore the slice scratch MbX and MbY context */
  911|   869k|        ps_cur_mb_info = ps_dec->ps_nmb_info + i;
  912|       |
  913|       |
  914|   869k|        u1_field = ps_cur_mb_info->u1_mb_field_decodingflag;
  915|       |
  916|   869k|        ps_mv_nmb_start = ps_dec->ps_mv_cur + (i << 4);
  917|   869k|        ps_dec->u2_mbx = ps_cur_mb_info->u2_mbx;
  918|   869k|        ps_dec->u2_mby = ps_cur_mb_info->u2_mby;
  919|   869k|        ps_dec->u1_currB_type = 0;
  920|   869k|        ps_dec->u2_mv_2mb[i & 0x1] = 0;
  921|       |
  922|       |        /* Look for MV Prediction and Reference Transfer in Non-I Mbs */
  923|   869k|        if(!ps_mb_part_info->u4_isI_mb)
  ------------------
  |  Branch (923:12): [True: 868k, False: 653]
  ------------------
  924|   868k|        {
  925|   868k|            UWORD8 u1_blk_no;
  926|   868k|            WORD16 i1_ref_idx, i1_ref_idx1;
  927|   868k|            UWORD8 u1_pred_mode;
  928|   868k|            UWORD8 u1_sub_mb_x, u1_sub_mb_y, u1_sub_mb_num;
  929|   868k|            UWORD8 u1_lx, u1_lx_start, u1_lxend, u1_tmp_lx;
  930|   868k|            UWORD8 u1_num_part, u1_num_ref, u1_wd, u1_ht;
  931|   868k|            UWORD32 *pu4_wt_offst;
  932|   868k|            UWORD8 u1_scale_ref, u4_bot_mb;
  933|   868k|            deblk_mb_t * ps_cur_deblk_mb = ps_dec->ps_deblk_mbn + i;
  934|   868k|            WORD8 (*pi1_ref_idx)[MAX_REFIDX_INFO_PER_MB] =
  935|   868k|                            ps_mb_part_info->i1_ref_idx;
  936|   868k|            WORD8 *pi1_ref_idx0 = pi1_ref_idx[0],
  937|   868k|                            *pi1_ref_idx1 = pi1_ref_idx[1];
  938|   868k|            UWORD32 **ppu4_wt_ofst = ps_mb_part_info->pu4_wt_offst;
  939|       |
  940|       |            /* MB Level initialisations */
  941|   868k|            ps_dec->u4_num_pmbair = i >> u1_mbaff;
  942|   868k|            ps_dec->u4_mb_idx_mv = i;
  943|       |
  944|       |            /* CHANGED CODE */
  945|   868k|            ps_mv_ntop_start = ps_mv_nmb_start
  946|   868k|                            - (ps_dec->u2_frm_wd_in_mbs << (4 + u1_mbaff)) + 12;
  947|       |
  948|   868k|            u1_num_part = ps_mb_part_info->u1_num_part;
  949|   868k|            ps_cur_deblk_mb->u1_mb_type |= (u1_num_part > 1) << 1;
  950|   868k|            u1_direct_mode_width = (1 == ps_mb_part_info->u1_num_part) ? 16 : 8;
  ------------------
  |  Branch (950:36): [True: 780k, False: 88.4k]
  ------------------
  951|       |
  952|       |
  953|   868k|            ps_cur_mb_info->u4_pred_info_pkd_idx = ps_dec->u4_pred_info_pkd_idx;
  954|   868k|            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|   868k|            u1_scale_ref = u1_mbaff & ps_cur_mb_info->u1_mb_field_decodingflag;
  961|   868k|            u4_bot_mb = 1 - ps_cur_mb_info->u1_topmb;
  962|   868k|            if(ps_dec->ps_cur_pps->u1_wted_bipred_idc)
  ------------------
  |  Branch (962:16): [True: 519k, False: 349k]
  ------------------
  963|   519k|            {
  964|   519k|                u1_num_ref = MIN(u1_num_part, 4);
  ------------------
  |  |   61|   519k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 515k, False: 3.40k]
  |  |  ------------------
  ------------------
  965|   519k|                if(PART_DIRECT_16x16 != ps_part->u1_is_direct)
  ------------------
  |  |  572|   519k|#define PART_DIRECT_16x16              2
  ------------------
  |  Branch (965:20): [True: 29.7k, False: 489k]
  ------------------
  966|  29.7k|                {
  967|  79.3k|                    for(u1_blk_no = 0; u1_blk_no < u1_num_ref; u1_blk_no++)
  ------------------
  |  Branch (967:40): [True: 49.6k, False: 29.7k]
  ------------------
  968|  49.6k|                    {
  969|  49.6k|                        i1_ref_idx = MAX(pi1_ref_idx0[u1_blk_no], 0);
  ------------------
  |  |   60|  49.6k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 4.42k, False: 45.1k]
  |  |  ------------------
  ------------------
  970|  49.6k|                        if(u1_scale_ref)
  ------------------
  |  Branch (970:28): [True: 0, False: 49.6k]
  ------------------
  971|      0|                            i1_ref_idx >>= 1;
  972|  49.6k|                        i1_ref_idx *=
  973|  49.6k|                                        ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[1];
  974|  49.6k|                        if(u1_scale_ref)
  ------------------
  |  Branch (974:28): [True: 0, False: 49.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|  49.6k|                        else
  979|  49.6k|                            i1_ref_idx += MAX(pi1_ref_idx1[u1_blk_no], 0);
  ------------------
  |  |   60|  49.6k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 4.16k, False: 45.4k]
  |  |  ------------------
  ------------------
  980|  49.6k|                        pu4_wt_offst = (UWORD32*)&ps_dec->pu4_wt_ofsts[2
  981|  49.6k|                                        * X3(i1_ref_idx)];
  ------------------
  |  |   92|  49.6k|#define X3(a)   (((a) << 1) + (a))
  ------------------
  982|       |
  983|  49.6k|                        if(pi1_ref_idx0[u1_blk_no] < 0)
  ------------------
  |  Branch (983:28): [True: 21.7k, False: 27.8k]
  ------------------
  984|  21.7k|                            pu4_wt_offst += 1;
  985|       |
  986|  49.6k|                        ppu4_wt_ofst[u1_blk_no] = pu4_wt_offst;
  987|  49.6k|                        if(u1_scale_ref
  ------------------
  |  Branch (987:28): [True: 0, False: 49.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|  49.6k|                    }
 1009|  29.7k|                }
 1010|   519k|            }
 1011|       |
 1012|       |            /**************************************************/
 1013|       |            /* Loop on Partitions                             */
 1014|       |            /* direct mode is reflected as a single partition */
 1015|       |            /**************************************************/
 1016|  1.90M|            for(j = 0; j < u1_num_part; j++, ps_part++)
  ------------------
  |  Branch (1016:24): [True: 1.03M, False: 868k]
  ------------------
 1017|  1.03M|            {
 1018|  1.03M|                u1_sub_mb_num = ps_part->u1_sub_mb_num;
 1019|  1.03M|                ps_dec->u1_sub_mb_num = u1_sub_mb_num;
 1020|       |
 1021|  1.03M|                if(PART_NOT_DIRECT != ps_part->u1_is_direct)
  ------------------
  |  |  570|  1.03M|#define PART_NOT_DIRECT                0
  ------------------
  |  Branch (1021:20): [True: 758k, False: 279k]
  ------------------
 1022|   758k|                {
 1023|       |                    /**************************************************/
 1024|       |                    /* Direct Mode, Call DecodeSpatial/TemporalDirect */
 1025|       |                    /* only (those will in turn call FormMbPartInfo)  */
 1026|       |                    /**************************************************/
 1027|   758k|                    ret = ps_dec->ps_cur_slice->pf_decodeDirect(ps_dec,
 1028|   758k|                                                                u1_direct_mode_width,
 1029|   758k|                                                                ps_cur_mb_info, i);
 1030|   758k|                    if(ret != OK)
  ------------------
  |  |  114|   758k|#define OK        0
  ------------------
  |  Branch (1030:24): [True: 0, False: 758k]
  ------------------
 1031|      0|                        return ret;
 1032|   758k|                    ps_cur_deblk_mb->u1_mb_type |= (ps_dec->u1_currB_type << 1);
 1033|       |
 1034|   758k|                }
 1035|   279k|                else
 1036|   279k|                {
 1037|   279k|                    mv_pred_t s_mvPred;
 1038|       |                    /**************************************************/
 1039|       |                    /* Non Direct Mode, Call Motion Vector Predictor  */
 1040|       |                    /* and FormMbpartInfo                             */
 1041|       |                    /**************************************************/
 1042|   279k|                    u1_sub_mb_x = u1_sub_mb_num & 0x03;
 1043|   279k|                    u1_sub_mb_y = u1_sub_mb_num >> 2;
 1044|   279k|                    u1_blk_no =
 1045|   279k|                                    (u1_num_part < 4) ?
  ------------------
  |  Branch (1045:37): [True: 143k, False: 135k]
  ------------------
 1046|   143k|                                                    j :
 1047|   279k|                                                    (((u1_sub_mb_y >> 1) << 1)
 1048|   135k|                                                                    + (u1_sub_mb_x
 1049|   135k|                                                                                    >> 1));
 1050|       |
 1051|   279k|                    ps_mv_ntop = ps_mv_ntop_start + u1_sub_mb_x;
 1052|   279k|                    ps_mv_nmb = ps_mv_nmb_start + u1_sub_mb_num;
 1053|       |
 1054|   279k|                    u1_pred_mode = ps_part->u1_pred_mode;
 1055|   279k|                    u1_wd = ps_part->u1_partwidth;
 1056|   279k|                    u1_ht = ps_part->u1_partheight;
 1057|       |
 1058|   279k|                    u1_lx_start = 0;
 1059|   279k|                    u1_lxend = 2;
 1060|   279k|                    if( PRED_L0 == u1_pred_mode)
  ------------------
  |  |  483|   279k|#define PRED_L0   1
  ------------------
  |  Branch (1060:25): [True: 150k, False: 128k]
  ------------------
 1061|   150k|                    {
 1062|   150k|                        s_mvPred.i2_mv[2] = 0;
 1063|   150k|                        s_mvPred.i2_mv[3] = 0;
 1064|   150k|                        u1_lxend = 1;
 1065|   150k|                    }
 1066|   279k|                    if( PRED_L1 == u1_pred_mode)
  ------------------
  |  |  484|   279k|#define PRED_L1   2
  ------------------
  |  Branch (1066:25): [True: 63.3k, False: 215k]
  ------------------
 1067|  63.3k|                    {
 1068|  63.3k|                        s_mvPred.i2_mv[0] = 0;
 1069|  63.3k|                        s_mvPred.i2_mv[1] = 0;
 1070|  63.3k|                        u1_lx_start = 1;
 1071|  63.3k|                    }
 1072|       |
 1073|       |                    /* Populate the colpic info and reference frames */
 1074|   279k|                    s_mvPred.i1_ref_frame[0] = pi1_ref_idx0[u1_blk_no];
 1075|   279k|                    s_mvPred.i1_ref_frame[1] = pi1_ref_idx1[u1_blk_no];
 1076|       |
 1077|   279k|                    ps_dec->pf_mvpred(ps_dec, ps_cur_mb_info, ps_mv_nmb, ps_mv_ntop,
 1078|   279k|                                      &s_mvPred, u1_sub_mb_num, u1_wd,
 1079|   279k|                                      u1_lx_start, u1_lxend,
 1080|   279k|                                      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|   623k|                    for(u1_lx = u1_lx_start; u1_lx < u1_lxend; u1_lx++)
  ------------------
  |  Branch (1086:46): [True: 344k, False: 279k]
  ------------------
 1087|   344k|                    {
 1088|   344k|                        WORD16 i2_mv_x, i2_mv_y;
 1089|       |
 1090|       |                        /********************************************************/
 1091|       |                        /* Predict Mv                                           */
 1092|       |                        /* Add Mv Residuals and store back                      */
 1093|       |                        /********************************************************/
 1094|   344k|                        i1_ref_idx = s_mvPred.i1_ref_frame[u1_lx];
 1095|   344k|                        u1_tmp_lx = (u1_lx << 1);
 1096|       |
 1097|   344k|                        i2_mv_x = ps_mv_nmb->i2_mv[u1_tmp_lx];
 1098|   344k|                        i2_mv_y = ps_mv_nmb->i2_mv[u1_tmp_lx + 1];
 1099|       |
 1100|   344k|                        i2_mv_x += s_mvPred.i2_mv[u1_tmp_lx];
 1101|   344k|                        i2_mv_y += s_mvPred.i2_mv[u1_tmp_lx + 1];
 1102|   344k|                        s_mvPred.i2_mv[u1_tmp_lx] = i2_mv_x;
 1103|   344k|                        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|   344k|                        i1_ref_idx1 = i1_ref_idx >> u1_scale_ref;
 1111|   344k|                        if(u1_scale_ref && ((i1_ref_idx & 0x01) != u4_bot_mb))
  ------------------
  |  Branch (1111:28): [True: 0, False: 344k]
  |  Branch (1111:44): [True: 0, False: 0]
  ------------------
 1112|      0|                            i1_ref_idx1 += MAX_REF_BUFS;
  ------------------
  |  |   75|      0|#define MAX_REF_BUFS    32
  ------------------
 1113|   344k|                        ps_ref_frame =
 1114|   344k|                                        ps_dec->ps_ref_pic_buf_lx[u1_lx][i1_ref_idx1];
 1115|       |
 1116|       |                        /* Storing Colocated-Zero u4_flag */
 1117|   344k|                        if(u1_lx == u1_lx_start)
  ------------------
  |  Branch (1117:28): [True: 279k, False: 65.5k]
  ------------------
 1118|   279k|                        {
 1119|       |                            /* Fill colocated info in MvPred structure */
 1120|   279k|                            s_mvPred.u1_col_ref_pic_idx =
 1121|   279k|                                            ps_ref_frame->u1_mv_buf_id;
 1122|   279k|                            s_mvPred.u1_pic_type = ps_ref_frame->u1_pic_type;
 1123|       |
 1124|       |                            /* Calculating colocated zero information */
 1125|   279k|                            u1_colz =
 1126|   279k|                                            (u1_field << 1)
 1127|   279k|                                                            | ((i1_ref_idx == 0)
  ------------------
  |  Branch (1127:64): [True: 237k, False: 41.9k]
  ------------------
 1128|   237k|                                                                            && (ABS(i2_mv_x)
  ------------------
  |  |  100|   237k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 30.6k, False: 206k]
  |  |  ------------------
  ------------------
  |  Branch (1128:80): [True: 97.0k, False: 140k]
  ------------------
 1129|   237k|                                                                                            <= 1)
 1130|  97.0k|                                                                            && (ABS(i2_mv_y)
  ------------------
  |  |  100|  97.0k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 19.6k, False: 77.3k]
  |  |  ------------------
  ------------------
  |  Branch (1130:80): [True: 77.9k, False: 19.1k]
  ------------------
 1131|  97.0k|                                                                                            <= 1));
 1132|   279k|                            u1_colz |= ps_mb_part_info->u1_col_info[u1_blk_no];
 1133|   279k|                        }
 1134|       |
 1135|   344k|                        pu4_wt_offst = ppu4_wt_ofst[u1_blk_no];
 1136|   344k|                        {
 1137|   344k|                            pred_info_pkd_t *ps_pred_pkd;
 1138|   344k|                           WORD16 i2_mv[2];
 1139|       |
 1140|   344k|                           i2_mv[0] = i2_mv_x;
 1141|   344k|                           i2_mv[1] = i2_mv_y;
 1142|       |
 1143|   344k|                           ps_pred_pkd = ps_dec->ps_pred_pkd + ps_dec->u4_pred_info_pkd_idx;
 1144|   344k|                        ih264d_fill_pred_info(i2_mv,u1_wd,u1_ht,u1_sub_mb_num,u1_pred_mode,
 1145|   344k|                                        ps_pred_pkd,ps_ref_frame->u1_pic_buf_id,i1_ref_idx,pu4_wt_offst,
 1146|   344k|                                        ps_ref_frame->u1_pic_type);
 1147|   344k|                        ps_dec->u4_pred_info_pkd_idx++;
 1148|   344k|                        ps_cur_mb_info->u1_num_pred_parts++;
 1149|       |
 1150|       |
 1151|   344k|                        }
 1152|       |
 1153|   344k|                    }
 1154|   279k|                    ih264d_rep_mv_colz(ps_dec, &s_mvPred, ps_mv_nmb,
 1155|   279k|                                       u1_sub_mb_num, u1_colz, u1_ht,
 1156|   279k|                                       u1_wd);
 1157|   279k|                }
 1158|  1.03M|            }
 1159|       |
 1160|   868k|        }
 1161|    653|        else
 1162|    653|        {
 1163|       |            /* Set zero values in case of Intra Mbs */
 1164|    653|            mv_pred_t s_mvPred =
 1165|    653|                {
 1166|    653|                    { 0, 0, 0, 0 },
 1167|    653|                      { -1, -1 }, 0, 0};
 1168|       |            /* Storing colocated zero information */
 1169|    653|            ih264d_rep_mv_colz(ps_dec, &s_mvPred, ps_mv_nmb_start, 0,
 1170|    653|                               (UWORD8)(u1_field << 1), 4, 4);
 1171|    653|        }
 1172|       |
 1173|       |        /*if num _cores is set to 3 ,compute bs will be done in another thread*/
 1174|   869k|        if(ps_dec->u4_num_cores < 3)
  ------------------
  |  Branch (1174:12): [True: 869k, False: 0]
  ------------------
 1175|   869k|        {
 1176|   869k|            if(ps_dec->u4_app_disable_deblk_frm == 0)
  ------------------
  |  Branch (1176:16): [True: 869k, False: 0]
  ------------------
 1177|   869k|                ps_dec->pf_compute_bs(ps_dec, ps_cur_mb_info,
 1178|   869k|                                     (UWORD16)(i >> u1_mbaff));
 1179|   869k|        }
 1180|   869k|    }
 1181|   118k|    return OK;
  ------------------
  |  |  114|   118k|#define OK        0
  ------------------
 1182|   118k|}
ih264d_get_implicit_weights:
 1196|  16.4k|{
 1197|  16.4k|    UWORD32 *pu4_iwt_ofst;
 1198|  16.4k|    UWORD8 i, j;
 1199|  16.4k|    struct pic_buffer_t *ps_pic_buff0, *ps_pic_buff1;
 1200|  16.4k|    WORD16 i2_dist_scale_factor;
 1201|  16.4k|    WORD16 i2_tb, i2_td, i2_tx;
 1202|  16.4k|    WORD64 i8_tb, i8_td;
 1203|  16.4k|    WORD32 i4_poc0, i4_poc1;
 1204|  16.4k|    UWORD32 ui_temp0, ui_temp1;
 1205|  16.4k|    UWORD8 uc_num_ref_idx_l0_active, uc_num_ref_idx_l1_active;
 1206|       |
 1207|  16.4k|    pu4_iwt_ofst = ps_dec->pu4_wts_ofsts_mat;
 1208|  16.4k|    uc_num_ref_idx_l0_active =
 1209|  16.4k|                    ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[0];
 1210|  16.4k|    uc_num_ref_idx_l1_active =
 1211|  16.4k|                    ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[1];
 1212|       |
 1213|  54.6k|    for(i = 0; i < uc_num_ref_idx_l0_active; i++)
  ------------------
  |  Branch (1213:16): [True: 38.2k, False: 16.4k]
  ------------------
 1214|  38.2k|    {
 1215|  38.2k|        ps_pic_buff0 = ps_dec->ps_ref_pic_buf_lx[0][i];
 1216|  38.2k|        i4_poc0 = ps_pic_buff0->i4_avg_poc;
 1217|   131k|        for(j = 0; j < uc_num_ref_idx_l1_active; j++)
  ------------------
  |  Branch (1217:20): [True: 93.3k, False: 38.2k]
  ------------------
 1218|  93.3k|        {
 1219|  93.3k|            ps_pic_buff1 = ps_dec->ps_ref_pic_buf_lx[1][j];
 1220|  93.3k|            i4_poc1 = ps_pic_buff1->i4_avg_poc;
 1221|       |
 1222|  93.3k|            if(i4_poc1 != i4_poc0)
  ------------------
  |  Branch (1222:16): [True: 12.8k, False: 80.5k]
  ------------------
 1223|  12.8k|            {
 1224|  12.8k|                i8_tb = (WORD64)ps_dec->ps_cur_pic->i4_poc - i4_poc0;
 1225|  12.8k|                i2_tb = CLIP_S8(i8_tb);
  ------------------
  |  |   59|  12.8k|#define CLIP_S8(x) CLIP3(INT8_MIN, INT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  12.8k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 3.79k, False: 9.08k]
  |  |  |  |  |  Branch (77:54): [True: 4.14k, False: 4.94k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1226|  12.8k|                i8_td = (WORD64)i4_poc1 - i4_poc0;
 1227|  12.8k|                i2_td = CLIP_S8(i8_td);
  ------------------
  |  |   59|  12.8k|#define CLIP_S8(x) CLIP3(INT8_MIN, INT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  12.8k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 3.40k, False: 9.47k]
  |  |  |  |  |  Branch (77:54): [True: 4.53k, False: 4.94k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1228|  12.8k|                i2_tx = (16384 + ABS(SIGN_POW2_DIV(i2_td, 1))) / i2_td;
  ------------------
  |  |  100|  25.7k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 5.04k, False: 7.83k]
  |  |  |  Branch (100:27): [True: 5.76k, False: 7.11k]
  |  |  |  Branch (100:39): [True: 5.04k, False: 0]
  |  |  |  Branch (100:46): [True: 722, False: 7.11k]
  |  |  ------------------
  ------------------
 1229|  12.8k|                i2_dist_scale_factor = CLIP_S11(
  ------------------
  |  |   65|  12.8k|#define CLIP_S11(x) CLIP3(-1024, 1023, (x))
  |  |  ------------------
  |  |  |  |   77|  12.8k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 811, False: 12.0k]
  |  |  |  |  |  Branch (77:54): [True: 621, False: 11.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1230|  12.8k|                                            (((i2_tb * i2_tx) + 32) >> 6));
 1231|       |
 1232|  12.8k|                if(/*((u4_poc1 - u4_poc0) == 0) ||*/
 1233|  12.8k|                (!(ps_pic_buff1->u1_is_short && ps_pic_buff0->u1_is_short))
  ------------------
  |  Branch (1233:20): [True: 11.2k, False: 1.63k]
  |  Branch (1233:49): [True: 10.2k, False: 949]
  ------------------
 1234|  10.2k|                                || ((i2_dist_scale_factor >> 2) < -64)
  ------------------
  |  Branch (1234:36): [True: 1.87k, False: 8.41k]
  ------------------
 1235|  8.41k|                                || ((i2_dist_scale_factor >> 2) > 128))
  ------------------
  |  Branch (1235:36): [True: 693, False: 7.72k]
  ------------------
 1236|  5.15k|                {
 1237|       |                    /* same for forward and backward, wt=32 and Offset = 0 */
 1238|  5.15k|                    ui_temp0 = 0x00000020;
 1239|  5.15k|                    ui_temp1 = 0x00000020;
 1240|  5.15k|                }
 1241|  7.72k|                else
 1242|  7.72k|                {
 1243|  7.72k|                    ui_temp0 = 64 - (i2_dist_scale_factor >> 2);
 1244|  7.72k|                    ui_temp1 = (i2_dist_scale_factor >> 2);
 1245|  7.72k|                }
 1246|  12.8k|            }
 1247|  80.5k|            else
 1248|  80.5k|            {
 1249|  80.5k|                ui_temp0 = 0x00000020;
 1250|  80.5k|                ui_temp1 = 0x00000020;
 1251|  80.5k|            }
 1252|  93.3k|            pu4_iwt_ofst[0] = pu4_iwt_ofst[2] = pu4_iwt_ofst[4] = ui_temp0;
 1253|  93.3k|            pu4_iwt_ofst[1] = pu4_iwt_ofst[3] = pu4_iwt_ofst[5] = ui_temp1;
 1254|  93.3k|            pu4_iwt_ofst += 6;
 1255|  93.3k|        }
 1256|  38.2k|    }
 1257|  16.4k|    if(ps_dec->ps_cur_slice->u1_mbaff_frame_flag)
  ------------------
  |  Branch (1257:8): [True: 0, False: 16.4k]
  ------------------
 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.4k|}

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

ih264d_uev:
   78|  5.28M|{
   79|  5.28M|    UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
   80|  5.28M|    UWORD32 u4_word, u4_ldz;
   81|       |
   82|       |    /***************************************************************/
   83|       |    /* Find leading zeros in next 32 bits                          */
   84|       |    /***************************************************************/
   85|  5.28M|    NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  5.28M|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  5.28M|{                                                                           \
  |  |  152|  5.28M|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  5.28M|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  5.28M|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  5.28M|                                                                            \
  |  |  156|  5.28M|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  5.28M|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 4.29M, False: 990k]
  |  |  ------------------
  |  |  158|  5.28M|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  4.29M|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  5.28M|}
  ------------------
   86|  5.28M|    u4_ldz = CLZ(u4_word);
   87|       |    /* Flush the ps_bitstrm */
   88|  5.28M|    u4_bitstream_offset += (u4_ldz + 1);
   89|       |    /* Read the suffix from the ps_bitstrm */
   90|  5.28M|    u4_word = 0;
   91|  5.28M|    if(u4_ldz)
  ------------------
  |  Branch (91:8): [True: 1.99M, False: 3.29M]
  ------------------
   92|  1.99M|        GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  1.99M|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  1.99M|{                                                                           \
  |  |  122|  1.99M|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  1.99M|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  1.99M|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  1.99M|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  1.99M|                                                                            \
  |  |  127|  1.99M|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 1.90M, False: 86.7k]
  |  |  ------------------
  |  |  128|  1.99M|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  1.90M|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  1.99M|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  1.99M|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  1.99M|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  1.99M|}                                                                           \
  ------------------
   93|  5.28M|    *pu4_bitstrm_ofst = u4_bitstream_offset;
   94|  5.28M|    return ((1 << u4_ldz) + u4_word - 1);
   95|  5.28M|}
ih264d_sev:
  123|  1.44M|{
  124|  1.44M|    UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
  125|  1.44M|    UWORD32 u4_word, u4_ldz, u4_abs_val;
  126|       |
  127|       |    /***************************************************************/
  128|       |    /* Find leading zeros in next 32 bits                          */
  129|       |    /***************************************************************/
  130|  1.44M|    NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  1.44M|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  1.44M|{                                                                           \
  |  |  152|  1.44M|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  1.44M|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  1.44M|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  1.44M|                                                                            \
  |  |  156|  1.44M|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  1.44M|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 1.40M, False: 32.2k]
  |  |  ------------------
  |  |  158|  1.44M|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  1.40M|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  1.44M|}
  ------------------
  131|  1.44M|    u4_ldz = CLZ(u4_word);
  132|       |
  133|       |    /* Flush the ps_bitstrm */
  134|  1.44M|    u4_bitstream_offset += (u4_ldz + 1);
  135|       |
  136|       |    /* Read the suffix from the ps_bitstrm */
  137|  1.44M|    u4_word = 0;
  138|  1.44M|    if(u4_ldz)
  ------------------
  |  Branch (138:8): [True: 759k, False: 680k]
  ------------------
  139|   759k|        GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|   759k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|   759k|{                                                                           \
  |  |  122|   759k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|   759k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|   759k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|   759k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|   759k|                                                                            \
  |  |  127|   759k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 740k, False: 18.9k]
  |  |  ------------------
  |  |  128|   759k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|   740k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|   759k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|   759k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|   759k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|   759k|}                                                                           \
  ------------------
  140|       |
  141|  1.44M|    *pu4_bitstrm_ofst = u4_bitstream_offset;
  142|  1.44M|    u4_abs_val = ((1 << u4_ldz) + u4_word) >> 1;
  143|       |
  144|  1.44M|    if(u4_word & 0x1)
  ------------------
  |  Branch (144:8): [True: 347k, False: 1.09M]
  ------------------
  145|   347k|        return (-(WORD32)u4_abs_val);
  146|  1.09M|    else
  147|  1.09M|        return (u4_abs_val);
  148|  1.44M|}
ih264d_tev_range1:
  176|  17.1k|{
  177|  17.1k|    UWORD32 u4_code;
  178|  17.1k|    GETBIT(u4_code, *pu4_bitstrm_ofst, pu4_bitstrm_buf);
  ------------------
  |  |  105|  17.1k|#define   GETBIT(u4_code, u4_offset, pu4_bitstream)                         \
  |  |  106|  17.1k|{                                                                           \
  |  |  107|  17.1k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  108|  17.1k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  109|  17.1k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  110|  17.1k|    u4_code = pu4_buf[u4_word_off] << u4_bit_off;                           \
  |  |  111|  17.1k|    (u4_offset)++;                                                          \
  |  |  112|  17.1k|    u4_code = (u4_code >> 31);                                              \
  |  |  113|  17.1k|}
  ------------------
  179|  17.1k|    return (!u4_code);
  180|  17.1k|}
ih264d_cavlc_4x4res_block_totalcoeff_1:
  305|  95.1k|{
  306|       |
  307|  95.1k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
  308|  95.1k|    UWORD32 u4_bitstream_offset = ps_bitstrm->u4_ofst;
  309|  95.1k|    UWORD32 u4_trailing_ones = u4_total_coeff_trail_one & 0xFFFF;
  310|  95.1k|    WORD32 i2_level;
  311|  95.1k|    UWORD32 u4_tot_zero, u4_ldz, u4_scan_pos;
  312|       |
  313|  95.1k|    tu_sblk4x4_coeff_data_t *ps_tu_4x4;
  314|  95.1k|    WORD16 *pi2_coeff_data;
  315|  95.1k|    dec_struct_t *ps_dec = (dec_struct_t *)ps_bitstrm->pv_codec_handle;
  316|       |
  317|  95.1k|    ps_tu_4x4 = (tu_sblk4x4_coeff_data_t *)ps_dec->pv_parse_tu_coeff_data;
  318|  95.1k|    ps_tu_4x4->u2_sig_coeff_map = 0;
  319|  95.1k|    pi2_coeff_data = &ps_tu_4x4->ai2_level[0];
  320|       |
  321|       |
  322|  95.1k|    if(u4_trailing_ones)
  ------------------
  |  Branch (322:8): [True: 84.9k, False: 10.1k]
  ------------------
  323|  84.9k|    {
  324|  84.9k|        UWORD32 u4_sign;
  325|       |        /****************************************************************/
  326|       |        /* Decode Trailing One as in section 9.2.2                      */
  327|       |        /****************************************************************/
  328|  84.9k|        GETBIT(u4_sign, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  105|  84.9k|#define   GETBIT(u4_code, u4_offset, pu4_bitstream)                         \
  |  |  106|  84.9k|{                                                                           \
  |  |  107|  84.9k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  108|  84.9k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  109|  84.9k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  110|  84.9k|    u4_code = pu4_buf[u4_word_off] << u4_bit_off;                           \
  |  |  111|  84.9k|    (u4_offset)++;                                                          \
  |  |  112|  84.9k|    u4_code = (u4_code >> 31);                                              \
  |  |  113|  84.9k|}
  ------------------
  329|  84.9k|        i2_level = u4_sign ? -1 : 1;
  ------------------
  |  Branch (329:20): [True: 50.9k, False: 34.0k]
  ------------------
  330|  84.9k|    }
  331|  10.1k|    else
  332|  10.1k|    {
  333|       |        /****************************************************************/
  334|       |        /* Decoding Level based on prefix and suffix  as in 9.2.2       */
  335|       |        /****************************************************************/
  336|  10.1k|        UWORD32 u4_lev_suffix, u4_lev_suffix_size;
  337|  10.1k|        WORD32 u2_lev_code, u2_abs_value;
  338|  10.1k|        UWORD32 u4_lev_prefix;
  339|       |        /***************************************************************/
  340|       |        /* Find leading zeros in next 32 bits                          */
  341|       |        /***************************************************************/
  342|  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.69k, False: 439]
  |  |  |  |  ------------------
  |  |  |  |  158|  10.1k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  9.69k|#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|}
  ------------------
  343|  10.1k|                              pu4_bitstrm_buf);
  344|  10.1k|        u2_lev_code = (2 + MIN(u4_lev_prefix, 15));
  ------------------
  |  |   61|  10.1k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 5.08k, False: 5.05k]
  |  |  ------------------
  ------------------
  345|       |
  346|  10.1k|        if(14 == u4_lev_prefix)
  ------------------
  |  Branch (346:12): [True: 308, False: 9.82k]
  ------------------
  347|    308|            u4_lev_suffix_size = 4;
  348|  9.82k|        else if(15 <= u4_lev_prefix)
  ------------------
  |  Branch (348:17): [True: 5.05k, False: 4.77k]
  ------------------
  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|  4.77k|        else
  354|  4.77k|            u4_lev_suffix_size = 0;
  355|       |
  356|       |        //HP_LEVEL_PREFIX
  357|  10.1k|        if(16 <= u4_lev_prefix)
  ------------------
  |  Branch (357:12): [True: 4.97k, False: 5.16k]
  ------------------
  358|  4.97k|        {
  359|  4.97k|            u2_lev_code += ((1 << (u4_lev_prefix - 3)) - 4096);
  360|  4.97k|        }
  361|  10.1k|        if(u4_lev_suffix_size)
  ------------------
  |  Branch (361:12): [True: 5.36k, False: 4.77k]
  ------------------
  362|  5.36k|        {
  363|  5.36k|            GETBITS(u4_lev_suffix, u4_bitstream_offset, pu4_bitstrm_buf,
  ------------------
  |  |  120|  5.36k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  5.36k|{                                                                           \
  |  |  122|  5.36k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  5.36k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  5.36k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  5.36k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  5.36k|                                                                            \
  |  |  127|  5.36k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 5.16k, False: 193]
  |  |  ------------------
  |  |  128|  5.36k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  5.16k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  5.36k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  5.36k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  5.36k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  5.36k|}                                                                           \
  ------------------
  364|  5.36k|                    u4_lev_suffix_size);
  365|  5.36k|            u2_lev_code += u4_lev_suffix;
  366|  5.36k|        }
  367|       |
  368|  10.1k|        u2_abs_value = (u2_lev_code + 2) >> 1;
  369|       |        /*********************************************************/
  370|       |        /* If Level code is odd, level is negative else positive */
  371|       |        /*********************************************************/
  372|  10.1k|        i2_level = (u2_lev_code & 1) ? -u2_abs_value : u2_abs_value;
  ------------------
  |  Branch (372:20): [True: 1.49k, False: 8.64k]
  ------------------
  373|       |
  374|  10.1k|    }
  375|       |
  376|       |    /****************************************************************/
  377|       |    /* Decoding total zeros as in section 9.2.3, table 9.7          */
  378|       |    /****************************************************************/
  379|  95.1k|    FIND_ONE_IN_STREAM_LEN(u4_ldz, u4_bitstream_offset, pu4_bitstrm_buf, 8);
  ------------------
  |  |  176|  95.1k|#define   FIND_ONE_IN_STREAM_LEN(u4_ldz, u4_offset, pu4_bitstream, u4_len)  \
  |  |  177|  95.1k|{                                                                           \
  |  |  178|  95.1k|    UWORD32 u4_word;                                                        \
  |  |  179|  95.1k|    NEXTBITS_32(u4_word, u4_offset, pu4_bitstream);                         \
  |  |  ------------------
  |  |  |  |  150|  95.1k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  |  |  151|  95.1k|{                                                                           \
  |  |  |  |  152|  95.1k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  153|  95.1k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  154|  95.1k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  155|  95.1k|                                                                            \
  |  |  |  |  156|  95.1k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  157|  95.1k|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (157:8): [True: 92.8k, False: 2.24k]
  |  |  |  |  ------------------
  |  |  |  |  158|  95.1k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  92.8k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  159|  95.1k|}
  |  |  ------------------
  |  |  180|  95.1k|    u4_ldz = CLZ(u4_word);                                     \
  |  |  181|  95.1k|    if(u4_ldz < u4_len)                                                     \
  |  |  ------------------
  |  |  |  Branch (181:8): [True: 89.0k, False: 6.04k]
  |  |  ------------------
  |  |  182|  95.1k|    (u4_offset) += (u4_ldz + 1);                                            \
  |  |  183|  95.1k|    else                                                                    \
  |  |  184|  95.1k|    {                                                                       \
  |  |  185|  6.04k|        u4_ldz = u4_len;                                                    \
  |  |  186|  6.04k|        (u4_offset) += u4_ldz;                                              \
  |  |  187|  6.04k|    }                                                                       \
  |  |  188|  95.1k|}
  ------------------
  380|       |
  381|  95.1k|    if(u4_ldz)
  ------------------
  |  Branch (381:8): [True: 42.4k, False: 52.6k]
  ------------------
  382|  42.4k|    {
  383|  42.4k|        GETBIT(u4_tot_zero, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  105|  42.4k|#define   GETBIT(u4_code, u4_offset, pu4_bitstream)                         \
  |  |  106|  42.4k|{                                                                           \
  |  |  107|  42.4k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  108|  42.4k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  109|  42.4k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  110|  42.4k|    u4_code = pu4_buf[u4_word_off] << u4_bit_off;                           \
  |  |  111|  42.4k|    (u4_offset)++;                                                          \
  |  |  112|  42.4k|    u4_code = (u4_code >> 31);                                              \
  |  |  113|  42.4k|}
  ------------------
  384|  42.4k|        u4_tot_zero = (u4_ldz << 1) - u4_tot_zero;
  385|  42.4k|    }
  386|  52.6k|    else
  387|  52.6k|        u4_tot_zero = 0;
  388|       |
  389|       |    /***********************************************************************/
  390|       |    /* Inverse scan and store  residual coeff. Update the bitstream u4_ofst */
  391|       |    /***********************************************************************/
  392|  95.1k|    u4_scan_pos = u4_tot_zero + u4_isdc;
  393|  95.1k|    if(u4_scan_pos > 15)
  ------------------
  |  Branch (393:8): [True: 5.88k, False: 89.2k]
  ------------------
  394|  5.88k|        return -1;
  395|       |
  396|  89.2k|    SET_BIT(ps_tu_4x4->u2_sig_coeff_map, u4_scan_pos);
  ------------------
  |  |  106|  89.2k|#define SET_BIT(x, pos) (x) = (x) | (1 << pos);
  ------------------
  397|  89.2k|    *pi2_coeff_data++ = i2_level;
  398|       |
  399|       |
  400|  89.2k|    {
  401|  89.2k|        WORD32 offset;
  402|  89.2k|        offset = (UWORD8 *)pi2_coeff_data - (UWORD8 *)ps_tu_4x4;
  403|  89.2k|        offset = ALIGN4(offset);
  ------------------
  |  |   52|  89.2k|#define ALIGN4(x)   ((((x) + 3) >> 2) << 2)
  ------------------
  404|  89.2k|        ps_dec->pv_parse_tu_coeff_data = (void *)((UWORD8 *)ps_dec->pv_parse_tu_coeff_data + offset);
  405|  89.2k|    }
  406|       |
  407|  89.2k|    ps_bitstrm->u4_ofst = u4_bitstream_offset;
  408|  89.2k|    return 0;
  409|  95.1k|}
ih264d_cavlc_4x4res_block_totalcoeff_2to10:
  439|  66.9k|{
  440|  66.9k|    UWORD32 u4_total_zeroes;
  441|  66.9k|    WORD32 i;
  442|  66.9k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
  443|  66.9k|    UWORD32 u4_bitstream_offset = ps_bitstrm->u4_ofst;
  444|  66.9k|    UWORD32 u4_trailing_ones = u4_total_coeff_trail_one & 0xFFFF;
  445|  66.9k|    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|  66.9k|    WORD16 ai2_level_arr[19];
  450|  66.9k|    WORD16 *i2_level_arr = &ai2_level_arr[3];
  451|       |
  452|  66.9k|    tu_sblk4x4_coeff_data_t *ps_tu_4x4;
  453|  66.9k|    WORD16 *pi2_coeff_data;
  454|  66.9k|    dec_struct_t *ps_dec = (dec_struct_t *)ps_bitstrm->pv_codec_handle;
  455|       |
  456|  66.9k|    ps_tu_4x4 = (tu_sblk4x4_coeff_data_t *)ps_dec->pv_parse_tu_coeff_data;
  457|  66.9k|    ps_tu_4x4->u2_sig_coeff_map = 0;
  458|  66.9k|    pi2_coeff_data = &ps_tu_4x4->ai2_level[0];
  459|       |
  460|  66.9k|    i = u4_total_coeff - 1;
  461|       |
  462|  66.9k|    if(u4_trailing_ones)
  ------------------
  |  Branch (462:8): [True: 58.6k, False: 8.33k]
  ------------------
  463|  58.6k|    {
  464|       |        /*********************************************************************/
  465|       |        /* Decode Trailing Ones                                              */
  466|       |        /* read the sign of T1's and put them in level array                 */
  467|       |        /*********************************************************************/
  468|  58.6k|        UWORD32 u4_signs, u4_cnt = u4_trailing_ones;
  469|  58.6k|        WORD16 (*ppi2_trlone_lkup)[3] =
  470|  58.6k|                        (WORD16 (*)[3])gai2_ih264d_trailing_one_level;
  471|  58.6k|        WORD16 *pi2_trlone_lkup;
  472|       |
  473|  58.6k|        GETBITS(u4_signs, u4_bitstream_offset, pu4_bitstrm_buf, u4_cnt);
  ------------------
  |  |  120|  58.6k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  58.6k|{                                                                           \
  |  |  122|  58.6k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  58.6k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  58.6k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  58.6k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  58.6k|                                                                            \
  |  |  127|  58.6k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 55.0k, False: 3.55k]
  |  |  ------------------
  |  |  128|  58.6k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  55.0k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  58.6k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  58.6k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  58.6k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  58.6k|}                                                                           \
  ------------------
  474|       |
  475|  58.6k|        pi2_trlone_lkup = ppi2_trlone_lkup[(1 << u4_cnt) - 2 + u4_signs];
  476|       |
  477|   185k|        while(u4_cnt)
  ------------------
  |  Branch (477:15): [True: 126k, False: 58.6k]
  ------------------
  478|   126k|        {
  479|   126k|            i2_level_arr[i--] = *pi2_trlone_lkup++;
  480|   126k|            u4_cnt--;
  481|   126k|        }
  482|  58.6k|    }
  483|       |
  484|       |    /****************************************************************/
  485|       |    /* Decoding Levels Begins                                       */
  486|       |    /****************************************************************/
  487|  66.9k|    if(i >= 0)
  ------------------
  |  Branch (487:8): [True: 28.8k, False: 38.1k]
  ------------------
  488|  28.8k|    {
  489|       |        /****************************************************************/
  490|       |        /* First level is decoded outside the loop as it has lot of     */
  491|       |        /* special cases.                                               */
  492|       |        /****************************************************************/
  493|  28.8k|        UWORD32 u4_lev_suffix, u4_suffix_len, u4_lev_suffix_size;
  494|  28.8k|        WORD32 u2_lev_code, u2_abs_value;
  495|  28.8k|        UWORD32 u4_lev_prefix;
  496|       |
  497|       |        /***************************************************************/
  498|       |        /* u4_suffix_len = 0,  Find leading zeros in next 32 bits      */
  499|       |        /***************************************************************/
  500|  28.8k|        FIND_ONE_IN_STREAM_32(u4_lev_prefix, u4_bitstream_offset,
  ------------------
  |  |  165|  28.8k|#define   FIND_ONE_IN_STREAM_32(u4_ldz, u4_offset, pu4_bitstream)           \
  |  |  166|  28.8k|{                                                                           \
  |  |  167|  28.8k|    UWORD32 u4_word;                                                        \
  |  |  168|  28.8k|    NEXTBITS_32(u4_word, u4_offset, pu4_bitstream);                         \
  |  |  ------------------
  |  |  |  |  150|  28.8k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  |  |  151|  28.8k|{                                                                           \
  |  |  |  |  152|  28.8k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  153|  28.8k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  154|  28.8k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  155|  28.8k|                                                                            \
  |  |  |  |  156|  28.8k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  157|  28.8k|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (157:8): [True: 27.5k, False: 1.27k]
  |  |  |  |  ------------------
  |  |  |  |  158|  28.8k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  27.5k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  159|  28.8k|}
  |  |  ------------------
  |  |  169|  28.8k|    u4_ldz = CLZ(u4_word);                                     \
  |  |  170|  28.8k|    (u4_offset) += (u4_ldz + 1);                                            \
  |  |  171|  28.8k|}
  ------------------
  501|  28.8k|                              pu4_bitstrm_buf);
  502|       |
  503|       |        /*********************************************************/
  504|       |        /* Special decoding case when trailing ones are 3        */
  505|       |        /*********************************************************/
  506|  28.8k|        u2_lev_code = MIN(15, u4_lev_prefix);
  ------------------
  |  |   61|  28.8k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 6.20k, False: 22.6k]
  |  |  ------------------
  ------------------
  507|       |
  508|  28.8k|        u2_lev_code += (3 == u4_trailing_ones) ? 0 : 2;
  ------------------
  |  Branch (508:24): [True: 10.7k, False: 18.0k]
  ------------------
  509|       |
  510|  28.8k|        if(14 == u4_lev_prefix)
  ------------------
  |  Branch (510:12): [True: 635, False: 28.2k]
  ------------------
  511|    635|            u4_lev_suffix_size = 4;
  512|  28.2k|        else if(15 <= u4_lev_prefix)
  ------------------
  |  Branch (512:17): [True: 6.24k, False: 21.9k]
  ------------------
  513|  6.24k|        {
  514|  6.24k|            u2_lev_code += 15;
  515|  6.24k|            u4_lev_suffix_size = u4_lev_prefix - 3;
  516|  6.24k|        }
  517|  21.9k|        else
  518|  21.9k|            u4_lev_suffix_size = 0;
  519|       |
  520|       |        //HP_LEVEL_PREFIX
  521|  28.8k|        if(16 <= u4_lev_prefix)
  ------------------
  |  Branch (521:12): [True: 6.20k, False: 22.6k]
  ------------------
  522|  6.20k|        {
  523|  6.20k|            u2_lev_code += ((1 << (u4_lev_prefix - 3)) - 4096);
  524|  6.20k|        }
  525|  28.8k|        if(u4_lev_suffix_size)
  ------------------
  |  Branch (525:12): [True: 6.88k, False: 21.9k]
  ------------------
  526|  6.88k|        {
  527|  6.88k|            GETBITS(u4_lev_suffix, u4_bitstream_offset, pu4_bitstrm_buf,
  ------------------
  |  |  120|  6.88k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  6.88k|{                                                                           \
  |  |  122|  6.88k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  6.88k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  6.88k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  6.88k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  6.88k|                                                                            \
  |  |  127|  6.88k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 6.44k, False: 440]
  |  |  ------------------
  |  |  128|  6.88k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  6.44k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  6.88k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  6.88k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  6.88k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  6.88k|}                                                                           \
  ------------------
  528|  6.88k|                    u4_lev_suffix_size);
  529|  6.88k|            u2_lev_code += u4_lev_suffix;
  530|  6.88k|        }
  531|       |
  532|  28.8k|        u2_abs_value = (u2_lev_code + 2) >> 1;
  533|       |        /*********************************************************/
  534|       |        /* If Level code is odd, level is negative else positive */
  535|       |        /*********************************************************/
  536|  28.8k|        i2_level_arr[i--] = (u2_lev_code & 1) ? -u2_abs_value : u2_abs_value;
  ------------------
  |  Branch (536:29): [True: 7.70k, False: 21.1k]
  ------------------
  537|       |
  538|  28.8k|        u4_suffix_len = (u2_abs_value > 3) ? 2 : 1;
  ------------------
  |  Branch (538:25): [True: 9.11k, False: 19.7k]
  ------------------
  539|       |
  540|       |        /*********************************************************/
  541|       |        /* Now loop over the remaining levels                    */
  542|       |        /*********************************************************/
  543|   115k|        while(i >= 0)
  ------------------
  |  Branch (543:15): [True: 86.4k, False: 28.8k]
  ------------------
  544|  86.4k|        {
  545|       |
  546|       |            /***************************************************************/
  547|       |            /* Find leading zeros in next 32 bits                          */
  548|       |            /***************************************************************/
  549|  86.4k|            FIND_ONE_IN_STREAM_32(u4_lev_prefix, u4_bitstream_offset,
  ------------------
  |  |  165|  86.4k|#define   FIND_ONE_IN_STREAM_32(u4_ldz, u4_offset, pu4_bitstream)           \
  |  |  166|  86.4k|{                                                                           \
  |  |  167|  86.4k|    UWORD32 u4_word;                                                        \
  |  |  168|  86.4k|    NEXTBITS_32(u4_word, u4_offset, pu4_bitstream);                         \
  |  |  ------------------
  |  |  |  |  150|  86.4k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  |  |  151|  86.4k|{                                                                           \
  |  |  |  |  152|  86.4k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  153|  86.4k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  154|  86.4k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  155|  86.4k|                                                                            \
  |  |  |  |  156|  86.4k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  157|  86.4k|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (157:8): [True: 83.4k, False: 3.07k]
  |  |  |  |  ------------------
  |  |  |  |  158|  86.4k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  83.4k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  159|  86.4k|}
  |  |  ------------------
  |  |  169|  86.4k|    u4_ldz = CLZ(u4_word);                                     \
  |  |  170|  86.4k|    (u4_offset) += (u4_ldz + 1);                                            \
  |  |  171|  86.4k|}
  ------------------
  550|  86.4k|                                  pu4_bitstrm_buf);
  551|       |
  552|  86.4k|            u4_lev_suffix_size =
  553|  86.4k|                            (15 <= u4_lev_prefix) ?
  ------------------
  |  Branch (553:29): [True: 31.4k, False: 55.0k]
  ------------------
  554|  55.0k|                                            (u4_lev_prefix - 3) : u4_suffix_len;
  555|       |
  556|       |            /*********************************************************/
  557|       |            /* Compute level code using prefix and suffix            */
  558|       |            /*********************************************************/
  559|  86.4k|            GETBITS(u4_lev_suffix, u4_bitstream_offset, pu4_bitstrm_buf,
  ------------------
  |  |  120|  86.4k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  86.4k|{                                                                           \
  |  |  122|  86.4k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  86.4k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  86.4k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  86.4k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  86.4k|                                                                            \
  |  |  127|  86.4k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 83.2k, False: 3.25k]
  |  |  ------------------
  |  |  128|  86.4k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  83.2k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  86.4k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  86.4k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  86.4k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  86.4k|}                                                                           \
  ------------------
  560|  86.4k|                    u4_lev_suffix_size);
  561|  86.4k|            u2_lev_code = (MIN(15,u4_lev_prefix) << u4_suffix_len)
  ------------------
  |  |   61|  86.4k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 31.3k, False: 55.1k]
  |  |  ------------------
  ------------------
  562|  86.4k|                            + u4_lev_suffix;
  563|       |
  564|       |            //HP_LEVEL_PREFIX
  565|  86.4k|            if(16 <= u4_lev_prefix)
  ------------------
  |  Branch (565:16): [True: 31.3k, False: 55.1k]
  ------------------
  566|  31.3k|            {
  567|  31.3k|                u2_lev_code += ((1 << (u4_lev_prefix - 3)) - 4096);
  568|  31.3k|            }
  569|  86.4k|            u2_abs_value = (u2_lev_code + 2) >> 1;
  570|       |
  571|       |            /*********************************************************/
  572|       |            /* If Level code is odd, level is negative else positive */
  573|       |            /*********************************************************/
  574|  86.4k|            i2_level_arr[i--] =
  575|  86.4k|                            (u2_lev_code & 1) ? -u2_abs_value : u2_abs_value;
  ------------------
  |  Branch (575:29): [True: 25.8k, False: 60.6k]
  ------------------
  576|       |
  577|       |            /*********************************************************/
  578|       |            /* Increment suffix length if required                   */
  579|       |            /*********************************************************/
  580|  86.4k|            u4_suffix_len +=
  581|  86.4k|                            (u4_suffix_len < 6) ?
  ------------------
  |  Branch (581:29): [True: 76.0k, False: 10.4k]
  ------------------
  582|  76.0k|                                            (u2_abs_value
  583|  76.0k|                                                            > (3
  584|  76.0k|                                                                            << (u4_suffix_len
  585|  76.0k|                                                                                            - 1))) :
  586|  86.4k|                                            0;
  587|  86.4k|        }
  588|       |
  589|       |        /****************************************************************/
  590|       |        /* Decoding Levels Ends                                         */
  591|       |        /****************************************************************/
  592|  28.8k|    }
  593|       |
  594|       |    /****************************************************************/
  595|       |    /* Decoding total zeros as in section 9.2.3, table 9.7          */
  596|       |    /****************************************************************/
  597|  66.9k|    {
  598|  66.9k|        UWORD32 u4_index;
  599|  66.9k|        const UWORD8 (*ppu1_total_zero_lkup)[64] =
  600|  66.9k|                        (const UWORD8 (*)[64])gau1_ih264d_table_total_zero_2to10;
  601|       |
  602|  66.9k|        NEXTBITS(u4_index, u4_bitstream_offset, pu4_bitstrm_buf, 6);
  ------------------
  |  |  137|  66.9k|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  138|  66.9k|{                                                                           \
  |  |  139|  66.9k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  140|  66.9k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  141|  66.9k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  142|  66.9k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  143|  66.9k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (143:8): [True: 65.0k, False: 1.96k]
  |  |  ------------------
  |  |  144|  66.9k|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  65.0k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  145|  66.9k|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  66.9k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  146|  66.9k|}
  ------------------
  603|  66.9k|        u4_total_zeroes = ppu1_total_zero_lkup[u4_total_coeff - 2][u4_index];
  604|       |
  605|  66.9k|        FLUSHBITS(u4_bitstream_offset, (u4_total_zeroes >> 4));
  ------------------
  |  |  193|  66.9k|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  194|  66.9k|{                                                                           \
  |  |  195|  66.9k|        (u4_offset) += (u4_no_bits);                                        \
  |  |  196|  66.9k|}
  ------------------
  606|  66.9k|        u4_total_zeroes &= 0xf;
  607|  66.9k|    }
  608|       |
  609|       |    /**************************************************************/
  610|       |    /* Decode the runs and form the coefficient buffer            */
  611|       |    /**************************************************************/
  612|  66.9k|    {
  613|  66.9k|        const UWORD8 *pu1_table_runbefore;
  614|  66.9k|        UWORD32 u4_run;
  615|  66.9k|        WORD32 k;
  616|  66.9k|        WORD32 u4_scan_pos = u4_total_coeff + u4_total_zeroes - 1 + u4_isdc;
  617|  66.9k|        WORD32 u4_zeroes_left = u4_total_zeroes;
  618|  66.9k|        k = u4_total_coeff - 1;
  619|       |
  620|       |        /**************************************************************/
  621|       |        /* Decoding Runs Begin for zeros left > 6                     */
  622|       |        /**************************************************************/
  623|  91.4k|        while((u4_zeroes_left > 6) && k)
  ------------------
  |  Branch (623:15): [True: 27.0k, False: 64.4k]
  |  Branch (623:39): [True: 24.5k, False: 2.54k]
  ------------------
  624|  24.5k|        {
  625|  24.5k|            UWORD32 u4_code;
  626|       |
  627|  24.5k|            NEXTBITS(u4_code, u4_bitstream_offset, pu4_bitstrm_buf, 3);
  ------------------
  |  |  137|  24.5k|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  138|  24.5k|{                                                                           \
  |  |  139|  24.5k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  140|  24.5k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  141|  24.5k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  142|  24.5k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  143|  24.5k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (143:8): [True: 23.8k, False: 641]
  |  |  ------------------
  |  |  144|  24.5k|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  23.8k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  145|  24.5k|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  24.5k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  146|  24.5k|}
  ------------------
  628|       |
  629|  24.5k|            if(u4_code != 0)
  ------------------
  |  Branch (629:16): [True: 12.8k, False: 11.6k]
  ------------------
  630|  12.8k|            {
  631|  12.8k|                FLUSHBITS(u4_bitstream_offset, 3);
  ------------------
  |  |  193|  12.8k|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  194|  12.8k|{                                                                           \
  |  |  195|  12.8k|        (u4_offset) += (u4_no_bits);                                        \
  |  |  196|  12.8k|}
  ------------------
  632|  12.8k|                u4_run = (7 - u4_code);
  633|  12.8k|            }
  634|  11.6k|            else
  635|  11.6k|            {
  636|       |
  637|  11.6k|                FIND_ONE_IN_STREAM_LEN(u4_code, u4_bitstream_offset,
  ------------------
  |  |  176|  11.6k|#define   FIND_ONE_IN_STREAM_LEN(u4_ldz, u4_offset, pu4_bitstream, u4_len)  \
  |  |  177|  11.6k|{                                                                           \
  |  |  178|  11.6k|    UWORD32 u4_word;                                                        \
  |  |  179|  11.6k|    NEXTBITS_32(u4_word, u4_offset, pu4_bitstream);                         \
  |  |  ------------------
  |  |  |  |  150|  11.6k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  |  |  151|  11.6k|{                                                                           \
  |  |  |  |  152|  11.6k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  153|  11.6k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  154|  11.6k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  155|  11.6k|                                                                            \
  |  |  |  |  156|  11.6k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  157|  11.6k|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (157:8): [True: 11.4k, False: 183]
  |  |  |  |  ------------------
  |  |  |  |  158|  11.6k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  11.4k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  159|  11.6k|}
  |  |  ------------------
  |  |  180|  11.6k|    u4_ldz = CLZ(u4_word);                                     \
  |  |  181|  11.6k|    if(u4_ldz < u4_len)                                                     \
  |  |  ------------------
  |  |  |  Branch (181:8): [True: 5.44k, False: 6.19k]
  |  |  ------------------
  |  |  182|  11.6k|    (u4_offset) += (u4_ldz + 1);                                            \
  |  |  183|  11.6k|    else                                                                    \
  |  |  184|  11.6k|    {                                                                       \
  |  |  185|  6.19k|        u4_ldz = u4_len;                                                    \
  |  |  186|  6.19k|        (u4_offset) += u4_ldz;                                              \
  |  |  187|  6.19k|    }                                                                       \
  |  |  188|  11.6k|}
  ------------------
  638|  11.6k|                                       pu4_bitstrm_buf, 11);
  639|  11.6k|                u4_run = (4 + u4_code);
  640|  11.6k|            }
  641|       |
  642|  24.5k|            SET_BIT(ps_tu_4x4->u2_sig_coeff_map, u4_scan_pos);
  ------------------
  |  |  106|  24.5k|#define SET_BIT(x, pos) (x) = (x) | (1 << pos);
  ------------------
  643|  24.5k|            *pi2_coeff_data++ = i2_level_arr[k--];
  644|  24.5k|            u4_zeroes_left -= (WORD32)u4_run;
  645|  24.5k|            u4_scan_pos -= (WORD32)(u4_run + 1);
  646|  24.5k|        }
  647|       |
  648|  66.9k|        if (u4_zeroes_left < 0 || u4_scan_pos < 0)
  ------------------
  |  Branch (648:13): [True: 6.62k, False: 60.3k]
  |  Branch (648:35): [True: 0, False: 60.3k]
  ------------------
  649|  6.62k|            return -1;
  650|       |
  651|       |        /**************************************************************/
  652|       |        /* Decoding Runs for 0 < zeros left <=6                       */
  653|       |        /**************************************************************/
  654|  60.3k|        pu1_table_runbefore = (UWORD8 *)gau1_ih264d_table_run_before;
  655|   126k|        while((u4_zeroes_left > 0) && k)
  ------------------
  |  Branch (655:15): [True: 92.3k, False: 33.7k]
  |  Branch (655:39): [True: 65.7k, False: 26.6k]
  ------------------
  656|  65.7k|        {
  657|  65.7k|            UWORD32 u4_code;
  658|  65.7k|            NEXTBITS(u4_code, u4_bitstream_offset, pu4_bitstrm_buf, 3);
  ------------------
  |  |  137|  65.7k|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  138|  65.7k|{                                                                           \
  |  |  139|  65.7k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  140|  65.7k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  141|  65.7k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  142|  65.7k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  143|  65.7k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (143:8): [True: 63.6k, False: 2.12k]
  |  |  ------------------
  |  |  144|  65.7k|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  63.6k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  145|  65.7k|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  65.7k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  146|  65.7k|}
  ------------------
  659|       |
  660|  65.7k|            u4_code = pu1_table_runbefore[u4_code + (u4_zeroes_left << 3)];
  661|  65.7k|            u4_run = u4_code >> 2;
  662|       |
  663|  65.7k|            FLUSHBITS(u4_bitstream_offset, (u4_code & 0x03));
  ------------------
  |  |  193|  65.7k|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  194|  65.7k|{                                                                           \
  |  |  195|  65.7k|        (u4_offset) += (u4_no_bits);                                        \
  |  |  196|  65.7k|}
  ------------------
  664|       |
  665|  65.7k|            SET_BIT(ps_tu_4x4->u2_sig_coeff_map, u4_scan_pos);
  ------------------
  |  |  106|  65.7k|#define SET_BIT(x, pos) (x) = (x) | (1 << pos);
  ------------------
  666|  65.7k|            *pi2_coeff_data++ = i2_level_arr[k--];
  667|  65.7k|            u4_zeroes_left -= (WORD32)u4_run;
  668|  65.7k|            u4_scan_pos -= (WORD32)(u4_run + 1);
  669|  65.7k|        }
  670|  60.3k|        if (u4_zeroes_left < 0 || u4_scan_pos < 0)
  ------------------
  |  Branch (670:13): [True: 0, False: 60.3k]
  |  Branch (670:35): [True: 0, False: 60.3k]
  ------------------
  671|      0|            return -1;
  672|       |        /**************************************************************/
  673|       |        /* Decoding Runs End                                          */
  674|       |        /**************************************************************/
  675|       |
  676|       |        /**************************************************************/
  677|       |        /* Copy the remaining coefficients                            */
  678|       |        /**************************************************************/
  679|   178k|        while(k >= 0)
  ------------------
  |  Branch (679:15): [True: 118k, False: 60.3k]
  ------------------
  680|   118k|        {
  681|       |
  682|   118k|            SET_BIT(ps_tu_4x4->u2_sig_coeff_map, u4_scan_pos);
  ------------------
  |  |  106|   118k|#define SET_BIT(x, pos) (x) = (x) | (1 << pos);
  ------------------
  683|   118k|            *pi2_coeff_data++ = i2_level_arr[k--];
  684|   118k|            u4_scan_pos--;
  685|   118k|        }
  686|  60.3k|    }
  687|       |
  688|      0|    {
  689|  60.3k|        WORD32 offset;
  690|  60.3k|        offset = (UWORD8 *)pi2_coeff_data - (UWORD8 *)ps_tu_4x4;
  691|  60.3k|        offset = ALIGN4(offset);
  ------------------
  |  |   52|  60.3k|#define ALIGN4(x)   ((((x) + 3) >> 2) << 2)
  ------------------
  692|  60.3k|        ps_dec->pv_parse_tu_coeff_data = (void *)((UWORD8 *)ps_dec->pv_parse_tu_coeff_data + offset);
  693|  60.3k|    }
  694|       |
  695|  60.3k|    ps_bitstrm->u4_ofst = u4_bitstream_offset;
  696|  60.3k|    return 0;
  697|  60.3k|}
ih264d_cavlc_4x4res_block_totalcoeff_11to16:
  727|  15.2k|{
  728|  15.2k|    UWORD32 u4_total_zeroes;
  729|  15.2k|    WORD32 i;
  730|  15.2k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
  731|  15.2k|    UWORD32 u4_bitstream_offset = ps_bitstrm->u4_ofst;
  732|  15.2k|    UWORD32 u4_trailing_ones = u4_total_coeff_trail_one & 0xFFFF;
  733|  15.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|  15.2k|    WORD16 ai2_level_arr[19];//
  738|  15.2k|    WORD16 *i2_level_arr = &ai2_level_arr[3];
  739|       |
  740|  15.2k|    tu_sblk4x4_coeff_data_t *ps_tu_4x4;
  741|  15.2k|    WORD16 *pi2_coeff_data;
  742|  15.2k|    dec_struct_t *ps_dec = (dec_struct_t *)ps_bitstrm->pv_codec_handle;
  743|       |
  744|  15.2k|    ps_tu_4x4 = (tu_sblk4x4_coeff_data_t *)ps_dec->pv_parse_tu_coeff_data;
  745|  15.2k|    ps_tu_4x4->u2_sig_coeff_map = 0;
  746|  15.2k|    pi2_coeff_data = &ps_tu_4x4->ai2_level[0];
  747|       |
  748|  15.2k|    i = u4_total_coeff - 1;
  749|  15.2k|    if(u4_trailing_ones)
  ------------------
  |  Branch (749:8): [True: 10.4k, False: 4.84k]
  ------------------
  750|  10.4k|    {
  751|       |        /*********************************************************************/
  752|       |        /* Decode Trailing Ones                                              */
  753|       |        /* read the sign of T1's and put them in level array                 */
  754|       |        /*********************************************************************/
  755|  10.4k|        UWORD32 u4_signs, u4_cnt = u4_trailing_ones;
  756|  10.4k|        WORD16 (*ppi2_trlone_lkup)[3] =
  757|  10.4k|                        (WORD16 (*)[3])gai2_ih264d_trailing_one_level;
  758|  10.4k|        WORD16 *pi2_trlone_lkup;
  759|       |
  760|  10.4k|        GETBITS(u4_signs, u4_bitstream_offset, pu4_bitstrm_buf, u4_cnt);
  ------------------
  |  |  120|  10.4k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  10.4k|{                                                                           \
  |  |  122|  10.4k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  10.4k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  10.4k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  10.4k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  10.4k|                                                                            \
  |  |  127|  10.4k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 9.86k, False: 540]
  |  |  ------------------
  |  |  128|  10.4k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  9.86k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  10.4k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  10.4k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  10.4k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  10.4k|}                                                                           \
  ------------------
  761|       |
  762|  10.4k|        pi2_trlone_lkup = ppi2_trlone_lkup[(1 << u4_cnt) - 2 + u4_signs];
  763|       |
  764|  37.2k|        while(u4_cnt)
  ------------------
  |  Branch (764:15): [True: 26.8k, False: 10.4k]
  ------------------
  765|  26.8k|        {
  766|  26.8k|            i2_level_arr[i--] = *pi2_trlone_lkup++;
  767|  26.8k|            u4_cnt--;
  768|  26.8k|        }
  769|  10.4k|    }
  770|       |
  771|       |    /****************************************************************/
  772|       |    /* Decoding Levels Begins                                       */
  773|       |    /****************************************************************/
  774|  15.2k|    if(i >= 0)
  ------------------
  |  Branch (774:8): [True: 15.2k, False: 0]
  ------------------
  775|  15.2k|    {
  776|       |        /****************************************************************/
  777|       |        /* First level is decoded outside the loop as it has lot of     */
  778|       |        /* special cases.                                               */
  779|       |        /****************************************************************/
  780|  15.2k|        UWORD32 u4_lev_suffix, u4_suffix_len, u4_lev_suffix_size;
  781|  15.2k|        UWORD16 u2_lev_code, u2_abs_value;
  782|  15.2k|        UWORD32 u4_lev_prefix;
  783|       |
  784|  15.2k|        if(u4_trailing_ones < 3)
  ------------------
  |  Branch (784:12): [True: 7.90k, False: 7.34k]
  ------------------
  785|  7.90k|        {
  786|       |            /*********************************************************/
  787|       |            /* u4_suffix_len = 1                                     */
  788|       |            /*********************************************************/
  789|       |            /***************************************************************/
  790|       |            /* Find leading zeros in next 32 bits                          */
  791|       |            /***************************************************************/
  792|  7.90k|            FIND_ONE_IN_STREAM_32(u4_lev_prefix, u4_bitstream_offset,
  ------------------
  |  |  165|  7.90k|#define   FIND_ONE_IN_STREAM_32(u4_ldz, u4_offset, pu4_bitstream)           \
  |  |  166|  7.90k|{                                                                           \
  |  |  167|  7.90k|    UWORD32 u4_word;                                                        \
  |  |  168|  7.90k|    NEXTBITS_32(u4_word, u4_offset, pu4_bitstream);                         \
  |  |  ------------------
  |  |  |  |  150|  7.90k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  |  |  151|  7.90k|{                                                                           \
  |  |  |  |  152|  7.90k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  153|  7.90k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  154|  7.90k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  155|  7.90k|                                                                            \
  |  |  |  |  156|  7.90k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  157|  7.90k|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (157:8): [True: 7.10k, False: 807]
  |  |  |  |  ------------------
  |  |  |  |  158|  7.90k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  7.10k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  159|  7.90k|}
  |  |  ------------------
  |  |  169|  7.90k|    u4_ldz = CLZ(u4_word);                                     \
  |  |  170|  7.90k|    (u4_offset) += (u4_ldz + 1);                                            \
  |  |  171|  7.90k|}
  ------------------
  793|  7.90k|                                  pu4_bitstrm_buf);
  794|       |
  795|  7.90k|            u4_lev_suffix_size =
  796|  7.90k|                            (15 <= u4_lev_prefix) ? (u4_lev_prefix - 3) : 1;
  ------------------
  |  Branch (796:29): [True: 2.86k, False: 5.04k]
  ------------------
  797|       |
  798|  7.90k|            GETBITS(u4_lev_suffix, u4_bitstream_offset, pu4_bitstrm_buf,
  ------------------
  |  |  120|  7.90k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  7.90k|{                                                                           \
  |  |  122|  7.90k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  7.90k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  7.90k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  7.90k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  7.90k|                                                                            \
  |  |  127|  7.90k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 7.39k, False: 510]
  |  |  ------------------
  |  |  128|  7.90k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  7.39k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  7.90k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  7.90k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  7.90k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  7.90k|}                                                                           \
  ------------------
  799|  7.90k|                    u4_lev_suffix_size);
  800|  7.90k|            u2_lev_code = 2 + (MIN(u4_lev_prefix,15) << 1) + u4_lev_suffix;
  ------------------
  |  |   61|  7.90k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 5.04k, False: 2.86k]
  |  |  ------------------
  ------------------
  801|       |
  802|       |            //HP_LEVEL_PREFIX
  803|  7.90k|            if(16 <= u4_lev_prefix)
  ------------------
  |  Branch (803:16): [True: 2.83k, False: 5.07k]
  ------------------
  804|  2.83k|            {
  805|  2.83k|                u2_lev_code += ((1 << (u4_lev_prefix - 3)) - 4096);
  806|  2.83k|            }
  807|  7.90k|        }
  808|  7.34k|        else
  809|  7.34k|        {
  810|       |            /*********************************************************/
  811|       |            /*u4_suffix_len = 0                                      */
  812|       |            /*********************************************************/
  813|       |            /***************************************************************/
  814|       |            /* Find leading zeros in next 32 bits                          */
  815|       |            /***************************************************************/
  816|  7.34k|            FIND_ONE_IN_STREAM_32(u4_lev_prefix, u4_bitstream_offset,
  ------------------
  |  |  165|  7.34k|#define   FIND_ONE_IN_STREAM_32(u4_ldz, u4_offset, pu4_bitstream)           \
  |  |  166|  7.34k|{                                                                           \
  |  |  167|  7.34k|    UWORD32 u4_word;                                                        \
  |  |  168|  7.34k|    NEXTBITS_32(u4_word, u4_offset, pu4_bitstream);                         \
  |  |  ------------------
  |  |  |  |  150|  7.34k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  |  |  151|  7.34k|{                                                                           \
  |  |  |  |  152|  7.34k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  153|  7.34k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  154|  7.34k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  155|  7.34k|                                                                            \
  |  |  |  |  156|  7.34k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  157|  7.34k|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (157:8): [True: 6.93k, False: 409]
  |  |  |  |  ------------------
  |  |  |  |  158|  7.34k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  6.93k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  159|  7.34k|}
  |  |  ------------------
  |  |  169|  7.34k|    u4_ldz = CLZ(u4_word);                                     \
  |  |  170|  7.34k|    (u4_offset) += (u4_ldz + 1);                                            \
  |  |  171|  7.34k|}
  ------------------
  817|  7.34k|                                  pu4_bitstrm_buf);
  818|       |
  819|       |            /*********************************************************/
  820|       |            /* Special decoding case when trailing ones are 3        */
  821|       |            /*********************************************************/
  822|  7.34k|            u2_lev_code = MIN(15, u4_lev_prefix);
  ------------------
  |  |   61|  7.34k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 409, False: 6.93k]
  |  |  ------------------
  ------------------
  823|       |
  824|  7.34k|            u2_lev_code += (3 == u4_trailing_ones) ? 0 : (2);
  ------------------
  |  Branch (824:28): [True: 7.34k, False: 0]
  ------------------
  825|       |
  826|  7.34k|            if(14 == u4_lev_prefix)
  ------------------
  |  Branch (826:16): [True: 131, False: 7.21k]
  ------------------
  827|    131|                u4_lev_suffix_size = 4;
  828|  7.21k|            else if(15 <= u4_lev_prefix)
  ------------------
  |  Branch (828:21): [True: 670, False: 6.54k]
  ------------------
  829|    670|            {
  830|    670|                u2_lev_code += 15;
  831|    670|                u4_lev_suffix_size = (u4_lev_prefix - 3);
  832|    670|            }
  833|  6.54k|            else
  834|  6.54k|                u4_lev_suffix_size = 0;
  835|       |
  836|       |            //HP_LEVEL_PREFIX
  837|  7.34k|            if(16 <= u4_lev_prefix)
  ------------------
  |  Branch (837:16): [True: 409, False: 6.93k]
  ------------------
  838|    409|            {
  839|    409|                u2_lev_code += ((1 << (u4_lev_prefix - 3)) - 4096);
  840|    409|            }
  841|  7.34k|            if(u4_lev_suffix_size)
  ------------------
  |  Branch (841:16): [True: 801, False: 6.54k]
  ------------------
  842|    801|            {
  843|    801|                GETBITS(u4_lev_suffix, u4_bitstream_offset, pu4_bitstrm_buf,
  ------------------
  |  |  120|    801|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|    801|{                                                                           \
  |  |  122|    801|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|    801|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|    801|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|    801|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|    801|                                                                            \
  |  |  127|    801|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 645, False: 156]
  |  |  ------------------
  |  |  128|    801|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|    645|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|    801|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|    801|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|    801|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|    801|}                                                                           \
  ------------------
  844|    801|                        u4_lev_suffix_size);
  845|    801|                u2_lev_code += u4_lev_suffix;
  846|    801|            }
  847|  7.34k|        }
  848|       |
  849|  15.2k|        u2_abs_value = (u2_lev_code + 2) >> 1;
  850|       |        /*********************************************************/
  851|       |        /* If Level code is odd, level is negative else positive */
  852|       |        /*********************************************************/
  853|  15.2k|        i2_level_arr[i--] = (u2_lev_code & 1) ? -u2_abs_value : u2_abs_value;
  ------------------
  |  Branch (853:29): [True: 4.24k, False: 11.0k]
  ------------------
  854|       |
  855|  15.2k|        u4_suffix_len = (u2_abs_value > 3) ? 2 : 1;
  ------------------
  |  Branch (855:25): [True: 6.37k, False: 8.87k]
  ------------------
  856|       |
  857|       |        /*********************************************************/
  858|       |        /* Now loop over the remaining levels                    */
  859|       |        /*********************************************************/
  860|   196k|        while(i >= 0)
  ------------------
  |  Branch (860:15): [True: 181k, False: 15.2k]
  ------------------
  861|   181k|        {
  862|       |
  863|       |            /***************************************************************/
  864|       |            /* Find leading zeros in next 32 bits                          */
  865|       |            /***************************************************************/
  866|   181k|            FIND_ONE_IN_STREAM_32(u4_lev_prefix, u4_bitstream_offset,
  ------------------
  |  |  165|   181k|#define   FIND_ONE_IN_STREAM_32(u4_ldz, u4_offset, pu4_bitstream)           \
  |  |  166|   181k|{                                                                           \
  |  |  167|   181k|    UWORD32 u4_word;                                                        \
  |  |  168|   181k|    NEXTBITS_32(u4_word, u4_offset, pu4_bitstream);                         \
  |  |  ------------------
  |  |  |  |  150|   181k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  |  |  151|   181k|{                                                                           \
  |  |  |  |  152|   181k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  153|   181k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  154|   181k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  155|   181k|                                                                            \
  |  |  |  |  156|   181k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  157|   181k|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (157:8): [True: 175k, False: 6.06k]
  |  |  |  |  ------------------
  |  |  |  |  158|   181k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|   175k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  159|   181k|}
  |  |  ------------------
  |  |  169|   181k|    u4_ldz = CLZ(u4_word);                                     \
  |  |  170|   181k|    (u4_offset) += (u4_ldz + 1);                                            \
  |  |  171|   181k|}
  ------------------
  867|   181k|                                  pu4_bitstrm_buf);
  868|       |
  869|   181k|            u4_lev_suffix_size =
  870|   181k|                            (15 <= u4_lev_prefix) ?
  ------------------
  |  Branch (870:29): [True: 48.4k, False: 133k]
  ------------------
  871|   133k|                                            (u4_lev_prefix - 3) : u4_suffix_len;
  872|       |
  873|       |            /*********************************************************/
  874|       |            /* Compute level code using prefix and suffix            */
  875|       |            /*********************************************************/
  876|   181k|            GETBITS(u4_lev_suffix, u4_bitstream_offset, pu4_bitstrm_buf,
  ------------------
  |  |  120|   181k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|   181k|{                                                                           \
  |  |  122|   181k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|   181k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|   181k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|   181k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|   181k|                                                                            \
  |  |  127|   181k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 173k, False: 7.99k]
  |  |  ------------------
  |  |  128|   181k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|   173k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|   181k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|   181k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|   181k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|   181k|}                                                                           \
  ------------------
  877|   181k|                    u4_lev_suffix_size);
  878|   181k|            u2_lev_code = (MIN(15,u4_lev_prefix) << u4_suffix_len)
  ------------------
  |  |   61|   181k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 48.0k, False: 133k]
  |  |  ------------------
  ------------------
  879|   181k|                            + u4_lev_suffix;
  880|       |
  881|       |            //HP_LEVEL_PREFIX
  882|   181k|            if(16 <= u4_lev_prefix)
  ------------------
  |  Branch (882:16): [True: 48.0k, False: 133k]
  ------------------
  883|  48.0k|            {
  884|  48.0k|                u2_lev_code += ((1 << (u4_lev_prefix - 3)) - 4096);
  885|  48.0k|            }
  886|   181k|            u2_abs_value = (u2_lev_code + 2) >> 1;
  887|       |
  888|       |            /*********************************************************/
  889|       |            /* If Level code is odd, level is negative else positive */
  890|       |            /*********************************************************/
  891|   181k|            i2_level_arr[i--] =
  892|   181k|                            (u2_lev_code & 1) ? -u2_abs_value : u2_abs_value;
  ------------------
  |  Branch (892:29): [True: 83.2k, False: 98.3k]
  ------------------
  893|       |
  894|       |            /*********************************************************/
  895|       |            /* Increment suffix length if required                   */
  896|       |            /*********************************************************/
  897|   181k|            u4_suffix_len +=
  898|   181k|                            (u4_suffix_len < 6) ?
  ------------------
  |  Branch (898:29): [True: 143k, False: 37.8k]
  ------------------
  899|   143k|                                            (u2_abs_value
  900|   143k|                                                            > (3
  901|   143k|                                                                            << (u4_suffix_len
  902|   143k|                                                                                            - 1))) :
  903|   181k|                                            0;
  904|   181k|        }
  905|       |
  906|       |        /****************************************************************/
  907|       |        /* Decoding Levels Ends                                         */
  908|       |        /****************************************************************/
  909|  15.2k|    }
  910|       |
  911|  15.2k|    if(u4_total_coeff < (16 - u4_isdc))
  ------------------
  |  Branch (911:8): [True: 6.58k, False: 8.67k]
  ------------------
  912|  6.58k|    {
  913|  6.58k|        UWORD32 u4_index;
  914|  6.58k|        const UWORD8 (*ppu1_total_zero_lkup)[16] =
  915|  6.58k|                        (const UWORD8 (*)[16])gau1_ih264d_table_total_zero_11to15;
  916|       |
  917|  6.58k|        NEXTBITS(u4_index, u4_bitstream_offset, pu4_bitstrm_buf, 4);
  ------------------
  |  |  137|  6.58k|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  138|  6.58k|{                                                                           \
  |  |  139|  6.58k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  140|  6.58k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  141|  6.58k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  142|  6.58k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  143|  6.58k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (143:8): [True: 6.19k, False: 391]
  |  |  ------------------
  |  |  144|  6.58k|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  6.19k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  145|  6.58k|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  6.58k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  146|  6.58k|}
  ------------------
  918|  6.58k|        u4_total_zeroes = ppu1_total_zero_lkup[u4_total_coeff - 11][u4_index];
  919|       |
  920|  6.58k|        FLUSHBITS(u4_bitstream_offset, (u4_total_zeroes >> 4));
  ------------------
  |  |  193|  6.58k|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  194|  6.58k|{                                                                           \
  |  |  195|  6.58k|        (u4_offset) += (u4_no_bits);                                        \
  |  |  196|  6.58k|}
  ------------------
  921|  6.58k|        u4_total_zeroes &= 0xf;
  922|  6.58k|    }
  923|  8.67k|    else
  924|  8.67k|        u4_total_zeroes = 0;
  925|       |
  926|       |    /**************************************************************/
  927|       |    /* Decode the runs and form the coefficient buffer            */
  928|       |    /**************************************************************/
  929|  15.2k|    {
  930|  15.2k|        const UWORD8 *pu1_table_runbefore;
  931|  15.2k|        UWORD32 u4_run;
  932|  15.2k|        WORD32 k;
  933|  15.2k|        WORD32 u4_scan_pos = u4_total_coeff + u4_total_zeroes - 1 + u4_isdc;
  934|  15.2k|        WORD32 u4_zeroes_left = u4_total_zeroes;
  935|  15.2k|        k = u4_total_coeff - 1;
  936|       |
  937|       |        /**************************************************************/
  938|       |        /* Decoding Runs for 0 < zeros left <=6                       */
  939|       |        /**************************************************************/
  940|  15.2k|        pu1_table_runbefore = (UWORD8 *)gau1_ih264d_table_run_before;
  941|  33.7k|        while((u4_zeroes_left > 0) && k)
  ------------------
  |  Branch (941:15): [True: 19.2k, False: 14.4k]
  |  Branch (941:39): [True: 18.5k, False: 756]
  ------------------
  942|  18.5k|        {
  943|  18.5k|            UWORD32 u4_code;
  944|  18.5k|            NEXTBITS(u4_code, u4_bitstream_offset, pu4_bitstrm_buf, 3);
  ------------------
  |  |  137|  18.5k|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  138|  18.5k|{                                                                           \
  |  |  139|  18.5k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  140|  18.5k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  141|  18.5k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  142|  18.5k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  143|  18.5k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (143:8): [True: 17.6k, False: 863]
  |  |  ------------------
  |  |  144|  18.5k|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  17.6k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  145|  18.5k|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  18.5k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  146|  18.5k|}
  ------------------
  945|       |
  946|  18.5k|            u4_code = pu1_table_runbefore[u4_code + (u4_zeroes_left << 3)];
  947|  18.5k|            u4_run = u4_code >> 2;
  948|       |
  949|  18.5k|            FLUSHBITS(u4_bitstream_offset, (u4_code & 0x03));
  ------------------
  |  |  193|  18.5k|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  194|  18.5k|{                                                                           \
  |  |  195|  18.5k|        (u4_offset) += (u4_no_bits);                                        \
  |  |  196|  18.5k|}
  ------------------
  950|  18.5k|            SET_BIT(ps_tu_4x4->u2_sig_coeff_map, u4_scan_pos);
  ------------------
  |  |  106|  18.5k|#define SET_BIT(x, pos) (x) = (x) | (1 << pos);
  ------------------
  951|  18.5k|            *pi2_coeff_data++ = i2_level_arr[k--];
  952|  18.5k|            u4_zeroes_left -= (WORD32)u4_run;
  953|  18.5k|            u4_scan_pos -= (WORD32)(u4_run + 1);
  954|  18.5k|        }
  955|  15.2k|        if (u4_zeroes_left < 0 || u4_scan_pos < 0)
  ------------------
  |  Branch (955:13): [True: 0, False: 15.2k]
  |  Branch (955:35): [True: 0, False: 15.2k]
  ------------------
  956|      0|          return -1;
  957|       |
  958|       |        /**************************************************************/
  959|       |        /* Decoding Runs End                                          */
  960|       |        /**************************************************************/
  961|       |
  962|       |        /**************************************************************/
  963|       |        /* Copy the remaining coefficients                            */
  964|       |        /**************************************************************/
  965|   220k|        while(k >= 0)
  ------------------
  |  Branch (965:15): [True: 205k, False: 15.2k]
  ------------------
  966|   205k|        {
  967|   205k|            SET_BIT(ps_tu_4x4->u2_sig_coeff_map, u4_scan_pos);
  ------------------
  |  |  106|   205k|#define SET_BIT(x, pos) (x) = (x) | (1 << pos);
  ------------------
  968|   205k|            *pi2_coeff_data++ = i2_level_arr[k--];
  969|   205k|            u4_scan_pos--;
  970|   205k|        }
  971|  15.2k|    }
  972|       |
  973|      0|    {
  974|  15.2k|        WORD32 offset;
  975|  15.2k|        offset = (UWORD8 *)pi2_coeff_data - (UWORD8 *)ps_tu_4x4;
  976|  15.2k|        offset = ALIGN4(offset);
  ------------------
  |  |   52|  15.2k|#define ALIGN4(x)   ((((x) + 3) >> 2) << 2)
  ------------------
  977|  15.2k|        ps_dec->pv_parse_tu_coeff_data = (void *)((UWORD8 *)ps_dec->pv_parse_tu_coeff_data + offset);
  978|  15.2k|    }
  979|       |
  980|  15.2k|    ps_bitstrm->u4_ofst = u4_bitstream_offset;
  981|  15.2k|    return 0;
  982|  15.2k|}
ih264d_rest_of_residual_cav_chroma_dc_block:
 1007|  85.0k|{
 1008|  85.0k|    UWORD32 u4_total_zeroes;
 1009|  85.0k|    WORD16 i;
 1010|  85.0k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
 1011|  85.0k|    UWORD32 u4_bitstream_offset = ps_bitstrm->u4_ofst;
 1012|  85.0k|    UWORD32 u4_trailing_ones = u4_total_coeff_trail_one & 0xFFFF;
 1013|  85.0k|    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|  85.0k|    WORD16 ai2_level_arr[7];//
 1018|  85.0k|    WORD16 *i2_level_arr = &ai2_level_arr[3];
 1019|       |
 1020|  85.0k|    tu_sblk4x4_coeff_data_t *ps_tu_4x4;
 1021|  85.0k|    WORD16 *pi2_coeff_data;
 1022|  85.0k|    dec_struct_t *ps_dec = (dec_struct_t *)ps_bitstrm->pv_codec_handle;
 1023|       |
 1024|  85.0k|    ps_tu_4x4 = (tu_sblk4x4_coeff_data_t *)ps_dec->pv_parse_tu_coeff_data;
 1025|  85.0k|    ps_tu_4x4->u2_sig_coeff_map = 0;
 1026|  85.0k|    pi2_coeff_data = &ps_tu_4x4->ai2_level[0];
 1027|       |
 1028|  85.0k|    i = u4_total_coeff - 1;
 1029|  85.0k|    if(u4_trailing_ones)
  ------------------
  |  Branch (1029:8): [True: 80.6k, False: 4.40k]
  ------------------
 1030|  80.6k|    {
 1031|       |        /*********************************************************************/
 1032|       |        /* Decode Trailing Ones                                              */
 1033|       |        /* read the sign of T1's and put them in level array                 */
 1034|       |        /*********************************************************************/
 1035|  80.6k|        UWORD32 u4_signs, u4_cnt = u4_trailing_ones;
 1036|  80.6k|        WORD16 (*ppi2_trlone_lkup)[3] =
 1037|  80.6k|                        (WORD16 (*)[3])gai2_ih264d_trailing_one_level;
 1038|  80.6k|        WORD16 *pi2_trlone_lkup;
 1039|       |
 1040|  80.6k|        GETBITS(u4_signs, u4_bitstream_offset, pu4_bitstrm_buf, u4_cnt);
  ------------------
  |  |  120|  80.6k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  80.6k|{                                                                           \
  |  |  122|  80.6k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  80.6k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  80.6k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  80.6k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  80.6k|                                                                            \
  |  |  127|  80.6k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 77.3k, False: 3.30k]
  |  |  ------------------
  |  |  128|  80.6k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  77.3k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  80.6k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  80.6k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  80.6k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  80.6k|}                                                                           \
  ------------------
 1041|       |
 1042|  80.6k|        pi2_trlone_lkup = ppi2_trlone_lkup[(1 << u4_cnt) - 2 + u4_signs];
 1043|       |
 1044|   186k|        while(u4_cnt)
  ------------------
  |  Branch (1044:15): [True: 105k, False: 80.6k]
  ------------------
 1045|   105k|        {
 1046|   105k|            i2_level_arr[i--] = *pi2_trlone_lkup++;
 1047|   105k|            u4_cnt--;
 1048|   105k|        }
 1049|  80.6k|    }
 1050|       |
 1051|       |    /****************************************************************/
 1052|       |    /* Decoding Levels Begins                                       */
 1053|       |    /****************************************************************/
 1054|  85.0k|    if(i >= 0)
  ------------------
  |  Branch (1054:8): [True: 13.7k, False: 71.3k]
  ------------------
 1055|  13.7k|    {
 1056|       |        /****************************************************************/
 1057|       |        /* First level is decoded outside the loop as it has lot of     */
 1058|       |        /* special cases.                                               */
 1059|       |        /****************************************************************/
 1060|  13.7k|        UWORD32 u4_lev_suffix, u4_suffix_len, u4_lev_suffix_size;
 1061|  13.7k|        UWORD16 u2_lev_code, u2_abs_value;
 1062|  13.7k|        UWORD32 u4_lev_prefix;
 1063|       |
 1064|       |        /***************************************************************/
 1065|       |        /* u4_suffix_len = 0,  Find leading zeros in next 32 bits      */
 1066|       |        /***************************************************************/
 1067|  13.7k|        FIND_ONE_IN_STREAM_32(u4_lev_prefix, u4_bitstream_offset,
  ------------------
  |  |  165|  13.7k|#define   FIND_ONE_IN_STREAM_32(u4_ldz, u4_offset, pu4_bitstream)           \
  |  |  166|  13.7k|{                                                                           \
  |  |  167|  13.7k|    UWORD32 u4_word;                                                        \
  |  |  168|  13.7k|    NEXTBITS_32(u4_word, u4_offset, pu4_bitstream);                         \
  |  |  ------------------
  |  |  |  |  150|  13.7k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  |  |  151|  13.7k|{                                                                           \
  |  |  |  |  152|  13.7k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  153|  13.7k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  154|  13.7k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  155|  13.7k|                                                                            \
  |  |  |  |  156|  13.7k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  157|  13.7k|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (157:8): [True: 13.2k, False: 433]
  |  |  |  |  ------------------
  |  |  |  |  158|  13.7k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  13.2k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  159|  13.7k|}
  |  |  ------------------
  |  |  169|  13.7k|    u4_ldz = CLZ(u4_word);                                     \
  |  |  170|  13.7k|    (u4_offset) += (u4_ldz + 1);                                            \
  |  |  171|  13.7k|}
  ------------------
 1068|  13.7k|                              pu4_bitstrm_buf);
 1069|       |
 1070|       |        /*********************************************************/
 1071|       |        /* Special decoding case when trailing ones are 3        */
 1072|       |        /*********************************************************/
 1073|  13.7k|        u2_lev_code = MIN(15, u4_lev_prefix);
  ------------------
  |  |   61|  13.7k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 2.18k, False: 11.5k]
  |  |  ------------------
  ------------------
 1074|       |
 1075|  13.7k|        u2_lev_code += (3 == u4_trailing_ones) ? 0 : (2);
  ------------------
  |  Branch (1075:24): [True: 4.33k, False: 9.39k]
  ------------------
 1076|       |
 1077|  13.7k|        if(14 == u4_lev_prefix)
  ------------------
  |  Branch (1077:12): [True: 204, False: 13.5k]
  ------------------
 1078|    204|            u4_lev_suffix_size = 4;
 1079|  13.5k|        else if(15 <= u4_lev_prefix)
  ------------------
  |  Branch (1079:17): [True: 2.23k, False: 11.2k]
  ------------------
 1080|  2.23k|        {
 1081|  2.23k|            u2_lev_code += 15;
 1082|  2.23k|            u4_lev_suffix_size = u4_lev_prefix - 3;
 1083|  2.23k|        }
 1084|  11.2k|        else
 1085|  11.2k|            u4_lev_suffix_size = 0;
 1086|       |
 1087|       |        //HP_LEVEL_PREFIX
 1088|  13.7k|        if(16 <= u4_lev_prefix)
  ------------------
  |  Branch (1088:12): [True: 2.18k, False: 11.5k]
  ------------------
 1089|  2.18k|        {
 1090|  2.18k|            u2_lev_code += ((1 << (u4_lev_prefix - 3)) - 4096);
 1091|  2.18k|        }
 1092|  13.7k|        if(u4_lev_suffix_size)
  ------------------
  |  Branch (1092:12): [True: 2.44k, False: 11.2k]
  ------------------
 1093|  2.44k|        {
 1094|  2.44k|            GETBITS(u4_lev_suffix, u4_bitstream_offset, pu4_bitstrm_buf,
  ------------------
  |  |  120|  2.44k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  2.44k|{                                                                           \
  |  |  122|  2.44k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  2.44k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  2.44k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  2.44k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  2.44k|                                                                            \
  |  |  127|  2.44k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 2.03k, False: 408]
  |  |  ------------------
  |  |  128|  2.44k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  2.03k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  2.44k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  2.44k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  2.44k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  2.44k|}                                                                           \
  ------------------
 1095|  2.44k|                    u4_lev_suffix_size);
 1096|  2.44k|            u2_lev_code += u4_lev_suffix;
 1097|  2.44k|        }
 1098|       |
 1099|  13.7k|        u2_abs_value = (u2_lev_code + 2) >> 1;
 1100|       |        /*********************************************************/
 1101|       |        /* If Level code is odd, level is negative else positive */
 1102|       |        /*********************************************************/
 1103|  13.7k|        i2_level_arr[i--] = (u2_lev_code & 1) ? -u2_abs_value : u2_abs_value;
  ------------------
  |  Branch (1103:29): [True: 2.52k, False: 11.2k]
  ------------------
 1104|       |
 1105|  13.7k|        u4_suffix_len = (u2_abs_value > 3) ? 2 : 1;
  ------------------
  |  Branch (1105:25): [True: 2.85k, False: 10.8k]
  ------------------
 1106|       |
 1107|       |        /*********************************************************/
 1108|       |        /* Now loop over the remaining levels                    */
 1109|       |        /*********************************************************/
 1110|  21.0k|        while(i >= 0)
  ------------------
  |  Branch (1110:15): [True: 7.34k, False: 13.7k]
  ------------------
 1111|  7.34k|        {
 1112|       |
 1113|       |            /***************************************************************/
 1114|       |            /* Find leading zeros in next 32 bits                          */
 1115|       |            /***************************************************************/
 1116|  7.34k|            FIND_ONE_IN_STREAM_32(u4_lev_prefix, u4_bitstream_offset,
  ------------------
  |  |  165|  7.34k|#define   FIND_ONE_IN_STREAM_32(u4_ldz, u4_offset, pu4_bitstream)           \
  |  |  166|  7.34k|{                                                                           \
  |  |  167|  7.34k|    UWORD32 u4_word;                                                        \
  |  |  168|  7.34k|    NEXTBITS_32(u4_word, u4_offset, pu4_bitstream);                         \
  |  |  ------------------
  |  |  |  |  150|  7.34k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  |  |  151|  7.34k|{                                                                           \
  |  |  |  |  152|  7.34k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  153|  7.34k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  154|  7.34k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  155|  7.34k|                                                                            \
  |  |  |  |  156|  7.34k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  157|  7.34k|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (157:8): [True: 7.05k, False: 286]
  |  |  |  |  ------------------
  |  |  |  |  158|  7.34k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  7.05k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  159|  7.34k|}
  |  |  ------------------
  |  |  169|  7.34k|    u4_ldz = CLZ(u4_word);                                     \
  |  |  170|  7.34k|    (u4_offset) += (u4_ldz + 1);                                            \
  |  |  171|  7.34k|}
  ------------------
 1117|  7.34k|                                  pu4_bitstrm_buf);
 1118|       |
 1119|  7.34k|            u4_lev_suffix_size =
 1120|  7.34k|                            (15 <= u4_lev_prefix) ?
  ------------------
  |  Branch (1120:29): [True: 353, False: 6.99k]
  ------------------
 1121|  6.99k|                                            (u4_lev_prefix - 3) : u4_suffix_len;
 1122|       |
 1123|       |            /*********************************************************/
 1124|       |            /* Compute level code using prefix and suffix            */
 1125|       |            /*********************************************************/
 1126|  7.34k|            GETBITS(u4_lev_suffix, u4_bitstream_offset, pu4_bitstrm_buf,
  ------------------
  |  |  120|  7.34k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  7.34k|{                                                                           \
  |  |  122|  7.34k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  7.34k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  7.34k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  7.34k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  7.34k|                                                                            \
  |  |  127|  7.34k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 6.85k, False: 494]
  |  |  ------------------
  |  |  128|  7.34k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  6.85k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  7.34k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  7.34k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  7.34k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  7.34k|}                                                                           \
  ------------------
 1127|  7.34k|                    u4_lev_suffix_size);
 1128|  7.34k|            u2_lev_code = (MIN(u4_lev_prefix,15) << u4_suffix_len)
  ------------------
  |  |   61|  7.34k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 6.99k, False: 353]
  |  |  ------------------
  ------------------
 1129|  7.34k|                            + u4_lev_suffix;
 1130|       |
 1131|       |            //HP_LEVEL_PREFIX
 1132|  7.34k|            if(16 <= u4_lev_prefix)
  ------------------
  |  Branch (1132:16): [True: 348, False: 6.99k]
  ------------------
 1133|    348|            {
 1134|    348|                u2_lev_code += ((1 << (u4_lev_prefix - 3)) - 4096);
 1135|    348|            }
 1136|  7.34k|            u2_abs_value = (u2_lev_code + 2) >> 1;
 1137|       |
 1138|       |            /*********************************************************/
 1139|       |            /* If Level code is odd, level is negative else positive */
 1140|       |            /*********************************************************/
 1141|  7.34k|            i2_level_arr[i--] =
 1142|  7.34k|                            (u2_lev_code & 1) ? -u2_abs_value : u2_abs_value;
  ------------------
  |  Branch (1142:29): [True: 2.34k, False: 4.99k]
  ------------------
 1143|       |
 1144|       |            /*********************************************************/
 1145|       |            /* Increment suffix length if required                   */
 1146|       |            /*********************************************************/
 1147|  7.34k|            u4_suffix_len += (u2_abs_value > (3 << (u4_suffix_len - 1)));
 1148|  7.34k|        }
 1149|       |
 1150|       |        /****************************************************************/
 1151|       |        /* Decoding Levels Ends                                         */
 1152|       |        /****************************************************************/
 1153|  13.7k|    }
 1154|       |
 1155|  85.0k|    if(u4_total_coeff < 4)
  ------------------
  |  Branch (1155:8): [True: 79.0k, False: 5.94k]
  ------------------
 1156|  79.0k|    {
 1157|  79.0k|        UWORD32 u4_max_ldz = (4 - u4_total_coeff);
 1158|  79.0k|        FIND_ONE_IN_STREAM_LEN(u4_total_zeroes, u4_bitstream_offset,
  ------------------
  |  |  176|  79.0k|#define   FIND_ONE_IN_STREAM_LEN(u4_ldz, u4_offset, pu4_bitstream, u4_len)  \
  |  |  177|  79.0k|{                                                                           \
  |  |  178|  79.0k|    UWORD32 u4_word;                                                        \
  |  |  179|  79.0k|    NEXTBITS_32(u4_word, u4_offset, pu4_bitstream);                         \
  |  |  ------------------
  |  |  |  |  150|  79.0k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  |  |  151|  79.0k|{                                                                           \
  |  |  |  |  152|  79.0k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  153|  79.0k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  154|  79.0k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  155|  79.0k|                                                                            \
  |  |  |  |  156|  79.0k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  157|  79.0k|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (157:8): [True: 76.2k, False: 2.78k]
  |  |  |  |  ------------------
  |  |  |  |  158|  79.0k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  76.2k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  159|  79.0k|}
  |  |  ------------------
  |  |  180|  79.0k|    u4_ldz = CLZ(u4_word);                                     \
  |  |  181|  79.0k|    if(u4_ldz < u4_len)                                                     \
  |  |  ------------------
  |  |  |  Branch (181:8): [True: 66.0k, False: 13.0k]
  |  |  ------------------
  |  |  182|  79.0k|    (u4_offset) += (u4_ldz + 1);                                            \
  |  |  183|  79.0k|    else                                                                    \
  |  |  184|  79.0k|    {                                                                       \
  |  |  185|  13.0k|        u4_ldz = u4_len;                                                    \
  |  |  186|  13.0k|        (u4_offset) += u4_ldz;                                              \
  |  |  187|  13.0k|    }                                                                       \
  |  |  188|  79.0k|}
  ------------------
 1159|  79.0k|                               pu4_bitstrm_buf, u4_max_ldz);
 1160|  79.0k|    }
 1161|  5.94k|    else
 1162|  5.94k|        u4_total_zeroes = 0;
 1163|       |
 1164|       |    /**************************************************************/
 1165|       |    /* Decode the runs and form the coefficient buffer            */
 1166|       |    /**************************************************************/
 1167|  85.0k|    {
 1168|  85.0k|        const UWORD8 *pu1_table_runbefore;
 1169|  85.0k|        UWORD32 u4_run;
 1170|  85.0k|        WORD32 u4_scan_pos = (u4_total_coeff + u4_total_zeroes - 1);
 1171|  85.0k|        UWORD32 u4_zeroes_left = u4_total_zeroes;
 1172|  85.0k|        i = u4_total_coeff - 1;
 1173|       |
 1174|       |        /**************************************************************/
 1175|       |        /* Decoding Runs for 0 < zeros left <=6                       */
 1176|       |        /**************************************************************/
 1177|  85.0k|        pu1_table_runbefore = (UWORD8 *)gau1_ih264d_table_run_before;
 1178|  99.0k|        while(u4_zeroes_left && i)
  ------------------
  |  Branch (1178:15): [True: 36.9k, False: 62.0k]
  |  Branch (1178:33): [True: 14.0k, False: 22.9k]
  ------------------
 1179|  14.0k|        {
 1180|  14.0k|            UWORD32 u4_code;
 1181|  14.0k|            NEXTBITS(u4_code, u4_bitstream_offset, pu4_bitstrm_buf, 3);
  ------------------
  |  |  137|  14.0k|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  138|  14.0k|{                                                                           \
  |  |  139|  14.0k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  140|  14.0k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  141|  14.0k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  142|  14.0k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  143|  14.0k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (143:8): [True: 13.7k, False: 324]
  |  |  ------------------
  |  |  144|  14.0k|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  13.7k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  145|  14.0k|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  14.0k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  146|  14.0k|}
  ------------------
 1182|       |
 1183|  14.0k|            u4_code = pu1_table_runbefore[u4_code + (u4_zeroes_left << 3)];
 1184|  14.0k|            u4_run = u4_code >> 2;
 1185|       |
 1186|  14.0k|            FLUSHBITS(u4_bitstream_offset, (u4_code & 0x03));
  ------------------
  |  |  193|  14.0k|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  194|  14.0k|{                                                                           \
  |  |  195|  14.0k|        (u4_offset) += (u4_no_bits);                                        \
  |  |  196|  14.0k|}
  ------------------
 1187|  14.0k|            SET_BIT(ps_tu_4x4->u2_sig_coeff_map, u4_scan_pos);
  ------------------
  |  |  106|  14.0k|#define SET_BIT(x, pos) (x) = (x) | (1 << pos);
  ------------------
 1188|  14.0k|            *pi2_coeff_data++ = i2_level_arr[i--];
 1189|  14.0k|            u4_zeroes_left -= (WORD32)u4_run;
 1190|  14.0k|            u4_scan_pos -= (WORD32)(u4_run + 1);
 1191|  14.0k|        }
 1192|       |        /**************************************************************/
 1193|       |        /* Decoding Runs End                                          */
 1194|       |        /**************************************************************/
 1195|       |
 1196|       |        /**************************************************************/
 1197|       |        /* Copy the remaining coefficients                            */
 1198|       |        /**************************************************************/
 1199|   197k|        while(i >= 0)
  ------------------
  |  Branch (1199:15): [True: 112k, False: 85.0k]
  ------------------
 1200|   112k|        {
 1201|   112k|            SET_BIT(ps_tu_4x4->u2_sig_coeff_map, u4_scan_pos);
  ------------------
  |  |  106|   112k|#define SET_BIT(x, pos) (x) = (x) | (1 << pos);
  ------------------
 1202|   112k|            *pi2_coeff_data++ = i2_level_arr[i--];
 1203|   112k|            u4_scan_pos--;
 1204|   112k|        }
 1205|  85.0k|    }
 1206|       |
 1207|  85.0k|    {
 1208|  85.0k|        WORD32 offset;
 1209|  85.0k|        offset = (UWORD8 *)pi2_coeff_data - (UWORD8 *)ps_tu_4x4;
 1210|  85.0k|        offset = ALIGN4(offset);
  ------------------
  |  |   52|  85.0k|#define ALIGN4(x)   ((((x) + 3) >> 2) << 2)
  ------------------
 1211|  85.0k|        ps_dec->pv_parse_tu_coeff_data = (void *)((UWORD8 *)ps_dec->pv_parse_tu_coeff_data + offset);
 1212|  85.0k|    }
 1213|       |
 1214|  85.0k|    ps_bitstrm->u4_ofst = u4_bitstream_offset;
 1215|  85.0k|}
ih264d_cavlc_parse4x4coeff_n0to7:
 1238|   549k|{
 1239|   549k|    dec_bit_stream_t *ps_bitstrm = ps_dec->ps_bitstrm;
 1240|   549k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
 1241|   549k|    UWORD32 u4_bitstream_offset = ps_bitstrm->u4_ofst;
 1242|   549k|    UWORD32 u4_code, u4_index, u4_ldz;
 1243|   549k|    const UWORD16 *pu2_code = (const UWORD16*)gau2_ih264d_code_gx;
 1244|   549k|    const UWORD16 *pu2_offset_num_vlc =
 1245|   549k|                    (const UWORD16 *)gau2_ih264d_offset_num_vlc_tab;
 1246|   549k|    UWORD32 u4_offset_num_vlc = pu2_offset_num_vlc[u4_n];
 1247|       |
 1248|       |
 1249|   549k|    UNUSED(pi2_coeff_block);
  ------------------
  |  |   45|   549k|#define UNUSED(x) ((void)(x))
  ------------------
 1250|   549k|    *pu4_total_coeff = 0;
 1251|   549k|    FIND_ONE_IN_STREAM_32(u4_ldz, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  165|   549k|#define   FIND_ONE_IN_STREAM_32(u4_ldz, u4_offset, pu4_bitstream)           \
  |  |  166|   549k|{                                                                           \
  |  |  167|   549k|    UWORD32 u4_word;                                                        \
  |  |  168|   549k|    NEXTBITS_32(u4_word, u4_offset, pu4_bitstream);                         \
  |  |  ------------------
  |  |  |  |  150|   549k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  |  |  151|   549k|{                                                                           \
  |  |  |  |  152|   549k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  153|   549k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  154|   549k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  155|   549k|                                                                            \
  |  |  |  |  156|   549k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  157|   549k|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (157:8): [True: 533k, False: 16.0k]
  |  |  |  |  ------------------
  |  |  |  |  158|   549k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|   533k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  159|   549k|}
  |  |  ------------------
  |  |  169|   549k|    u4_ldz = CLZ(u4_word);                                     \
  |  |  170|   549k|    (u4_offset) += (u4_ldz + 1);                                            \
  |  |  171|   549k|}
  ------------------
 1252|   549k|    NEXTBITS(u4_index, u4_bitstream_offset, pu4_bitstrm_buf, 3);
  ------------------
  |  |  137|   549k|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  138|   549k|{                                                                           \
  |  |  139|   549k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  140|   549k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  141|   549k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  142|   549k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  143|   549k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (143:8): [True: 529k, False: 19.9k]
  |  |  ------------------
  |  |  144|   549k|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|   529k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  145|   549k|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|   549k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  146|   549k|}
  ------------------
 1253|   549k|    u4_index += (u4_ldz << 3);
 1254|   549k|    u4_index += u4_offset_num_vlc;
 1255|       |
 1256|   549k|    u4_index = MIN(u4_index, 303);
  ------------------
  |  |   61|   549k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 546k, False: 3.44k]
  |  |  ------------------
  ------------------
 1257|   549k|    u4_code = pu2_code[u4_index];
 1258|       |
 1259|   549k|    FLUSHBITS(u4_bitstream_offset, (u4_code & 0x03));
  ------------------
  |  |  193|   549k|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  194|   549k|{                                                                           \
  |  |  195|   549k|        (u4_offset) += (u4_no_bits);                                        \
  |  |  196|   549k|}
  ------------------
 1260|   549k|    ps_bitstrm->u4_ofst = u4_bitstream_offset;
 1261|   549k|    *pu4_total_coeff = (u4_code >> 4);
 1262|       |
 1263|   549k|    if(*pu4_total_coeff)
  ------------------
  |  Branch (1263:8): [True: 157k, False: 392k]
  ------------------
 1264|   157k|    {
 1265|   157k|        UWORD32 u4_trailing_ones, u4_offset, u4_total_coeff_tone;
 1266|   157k|        const UWORD8 *pu1_offset =
 1267|   157k|                        (UWORD8 *)gau1_ih264d_total_coeff_fn_ptr_offset;
 1268|   157k|        WORD32 ret;
 1269|   157k|        u4_trailing_ones = ((u4_code >> 2) & 0x03);
 1270|   157k|        u4_offset = pu1_offset[*pu4_total_coeff - 1];
 1271|   157k|        u4_total_coeff_tone = (*pu4_total_coeff << 16) | u4_trailing_ones;
 1272|       |
 1273|   157k|        ret = ps_dec->pf_cavlc_4x4res_block[u4_offset](u4_isdc,
 1274|   157k|                                                       u4_total_coeff_tone,
 1275|   157k|                                                       ps_bitstrm);
 1276|   157k|        if(ret != 0)
  ------------------
  |  Branch (1276:12): [True: 7.02k, False: 150k]
  ------------------
 1277|  7.02k|            return ERROR_CAVLC_NUM_COEFF_T;
 1278|   157k|    }
 1279|       |
 1280|   542k|    return OK;
  ------------------
  |  |  114|   542k|#define OK        0
  ------------------
 1281|   549k|}
ih264d_cavlc_parse4x4coeff_n8:
 1288|  20.5k|{
 1289|       |
 1290|  20.5k|    dec_bit_stream_t *ps_bitstrm = ps_dec->ps_bitstrm;
 1291|  20.5k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
 1292|  20.5k|    UWORD32 u4_bitstream_offset = ps_bitstrm->u4_ofst;
 1293|  20.5k|    UWORD32 u4_code;
 1294|  20.5k|    UNUSED(u4_n);
  ------------------
  |  |   45|  20.5k|#define UNUSED(x) ((void)(x))
  ------------------
 1295|  20.5k|    UNUSED(pi2_coeff_block);
  ------------------
  |  |   45|  20.5k|#define UNUSED(x) ((void)(x))
  ------------------
 1296|  20.5k|    GETBITS(u4_code, u4_bitstream_offset, pu4_bitstrm_buf, 6);
  ------------------
  |  |  120|  20.5k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  20.5k|{                                                                           \
  |  |  122|  20.5k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  20.5k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  20.5k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  20.5k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  20.5k|                                                                            \
  |  |  127|  20.5k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 19.6k, False: 922]
  |  |  ------------------
  |  |  128|  20.5k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  19.6k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  20.5k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  20.5k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  20.5k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  20.5k|}                                                                           \
  ------------------
 1297|  20.5k|    ps_bitstrm->u4_ofst = u4_bitstream_offset;
 1298|  20.5k|    *pu4_total_coeff = 0;
 1299|       |
 1300|  20.5k|    if(u4_code != 3)
  ------------------
  |  Branch (1300:8): [True: 20.0k, False: 507]
  ------------------
 1301|  20.0k|    {
 1302|  20.0k|        UWORD8 *pu1_offset = (UWORD8 *)gau1_ih264d_total_coeff_fn_ptr_offset;
 1303|  20.0k|        UWORD32 u4_trailing_ones, u4_offset, u4_total_coeff_tone;
 1304|       |
 1305|  20.0k|        *pu4_total_coeff = (u4_code >> 2) + 1;
 1306|  20.0k|        u4_trailing_ones = u4_code & 0x03;
 1307|  20.0k|        u4_offset = pu1_offset[*pu4_total_coeff - 1];
 1308|  20.0k|        u4_total_coeff_tone = (*pu4_total_coeff << 16) | u4_trailing_ones;
 1309|       |
 1310|  20.0k|        ps_dec->pf_cavlc_4x4res_block[u4_offset](u4_isdc,
 1311|  20.0k|                                                 u4_total_coeff_tone,
 1312|  20.0k|                                                 ps_bitstrm);
 1313|  20.0k|    }
 1314|       |
 1315|  20.5k|    return OK;
  ------------------
  |  |  114|  20.5k|#define OK        0
  ------------------
 1316|  20.5k|}
ih264d_cavlc_parse_chroma_dc:
 1339|  56.2k|{
 1340|  56.2k|    UWORD32 u4_total_coeff, u4_trailing_ones, u4_total_coeff_tone, u4_code;
 1341|  56.2k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
 1342|  56.2k|    UWORD32 u4_bitstream_offset = ps_bitstrm->u4_ofst;
 1343|  56.2k|    const UWORD8 *pu1_cav_chromdc = (const UWORD8*)gau1_ih264d_cav_chromdc_vld;
 1344|  56.2k|    UNUSED(i4_mb_inter_inc);
  ------------------
  |  |   45|  56.2k|#define UNUSED(x) ((void)(x))
  ------------------
 1345|       |    /******************************************************************/
 1346|       |    /*  Chroma DC Block for U component                               */
 1347|       |    /******************************************************************/
 1348|  56.2k|    NEXTBITS(u4_code, u4_bitstream_offset, pu4_bitstrm_buf, 8);
  ------------------
  |  |  137|  56.2k|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  138|  56.2k|{                                                                           \
  |  |  139|  56.2k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  140|  56.2k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  141|  56.2k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  142|  56.2k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  143|  56.2k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (143:8): [True: 55.0k, False: 1.26k]
  |  |  ------------------
  |  |  144|  56.2k|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  55.0k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  145|  56.2k|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  56.2k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  146|  56.2k|}
  ------------------
 1349|       |
 1350|  56.2k|    u4_code = pu1_cav_chromdc[u4_code];
 1351|       |
 1352|  56.2k|    FLUSHBITS(u4_bitstream_offset, ((u4_code & 0x7) + 1));
  ------------------
  |  |  193|  56.2k|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  194|  56.2k|{                                                                           \
  |  |  195|  56.2k|        (u4_offset) += (u4_no_bits);                                        \
  |  |  196|  56.2k|}
  ------------------
 1353|  56.2k|    ps_bitstrm->u4_ofst = u4_bitstream_offset;
 1354|       |
 1355|  56.2k|    u4_total_coeff = (u4_code >> 5);
 1356|       |
 1357|  56.2k|    if(u4_total_coeff)
  ------------------
  |  Branch (1357:8): [True: 41.9k, False: 14.2k]
  ------------------
 1358|  41.9k|    {
 1359|  41.9k|        WORD32 i_z0, i_z1, i_z2, i_z3;
 1360|  41.9k|        tu_sblk4x4_coeff_data_t *ps_tu_4x4;
 1361|  41.9k|        dec_struct_t *ps_dec = (dec_struct_t *)ps_bitstrm->pv_codec_handle;
 1362|  41.9k|        WORD16 ai2_dc_coef[4];
 1363|  41.9k|        UWORD8 pu1_inv_scan[4] =
 1364|  41.9k|                        { 0, 1, 2, 3 };
 1365|  41.9k|        WORD16 *pi2_coeff_data =
 1366|  41.9k|                                    (WORD16 *)ps_dec->pv_parse_tu_coeff_data;
 1367|       |
 1368|  41.9k|        ps_tu_4x4 = (tu_sblk4x4_coeff_data_t *)ps_dec->pv_parse_tu_coeff_data;
 1369|       |
 1370|  41.9k|        u4_trailing_ones = ((u4_code >> 3) & 0x3);
 1371|  41.9k|        u4_total_coeff_tone = (u4_total_coeff << 16) | u4_trailing_ones;
 1372|  41.9k|        ih264d_rest_of_residual_cav_chroma_dc_block(u4_total_coeff_tone,
 1373|  41.9k|                                                    ps_bitstrm);
 1374|       |
 1375|  41.9k|        ai2_dc_coef[0] = 0;
 1376|  41.9k|        ai2_dc_coef[1] = 0;
 1377|  41.9k|        ai2_dc_coef[2] = 0;
 1378|  41.9k|        ai2_dc_coef[3] = 0;
 1379|       |
 1380|  41.9k|        ih264d_unpack_coeff4x4_dc_4x4blk(ps_tu_4x4,
 1381|  41.9k|                                         ai2_dc_coef,
 1382|  41.9k|                                         pu1_inv_scan);
 1383|       |        /*-------------------------------------------------------------------*/
 1384|       |        /* Inverse 2x2 transform and scaling  of chroma DC                   */
 1385|       |        /*-------------------------------------------------------------------*/
 1386|  41.9k|        i_z0 = (ai2_dc_coef[0] + ai2_dc_coef[2]);
 1387|  41.9k|        i_z1 = (ai2_dc_coef[0] - ai2_dc_coef[2]);
 1388|  41.9k|        i_z2 = (ai2_dc_coef[1] - ai2_dc_coef[3]);
 1389|  41.9k|        i_z3 = (ai2_dc_coef[1] + ai2_dc_coef[3]);
 1390|       |
 1391|       |        /*-----------------------------------------------------------*/
 1392|       |        /* Scaling and storing the values back                       */
 1393|       |        /*-----------------------------------------------------------*/
 1394|  41.9k|        *pi2_coeff_data++ = (WORD16)(((i_z0 + i_z3) * (WORD32)u4_scale_u) >> 5);
 1395|  41.9k|        *pi2_coeff_data++ = (WORD16)(((i_z0 - i_z3) * (WORD32)u4_scale_u) >> 5);
 1396|  41.9k|        *pi2_coeff_data++ = (WORD16)(((i_z1 + i_z2) * (WORD32)u4_scale_u) >> 5);
 1397|  41.9k|        *pi2_coeff_data++ = (WORD16)(((i_z1 - i_z2) * (WORD32)u4_scale_u) >> 5);
 1398|       |
 1399|  41.9k|        ps_dec->pv_parse_tu_coeff_data = (void *)pi2_coeff_data;
 1400|       |
 1401|  41.9k|        SET_BIT(ps_cur_mb_info->u1_yuv_dc_block_flag,1);
  ------------------
  |  |  106|  41.9k|#define SET_BIT(x, pos) (x) = (x) | (1 << pos);
  ------------------
 1402|  41.9k|    }
 1403|       |
 1404|       |    /******************************************************************/
 1405|       |    /*  Chroma DC Block for V component                               */
 1406|       |    /******************************************************************/
 1407|  56.2k|    pi2_coeff_block += 64;
 1408|  56.2k|    u4_bitstream_offset = ps_bitstrm->u4_ofst;
 1409|       |
 1410|  56.2k|    NEXTBITS(u4_code, u4_bitstream_offset, pu4_bitstrm_buf, 8);
  ------------------
  |  |  137|  56.2k|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  138|  56.2k|{                                                                           \
  |  |  139|  56.2k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  140|  56.2k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  141|  56.2k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  142|  56.2k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  143|  56.2k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (143:8): [True: 53.8k, False: 2.42k]
  |  |  ------------------
  |  |  144|  56.2k|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  53.8k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  145|  56.2k|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  56.2k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  146|  56.2k|}
  ------------------
 1411|       |
 1412|  56.2k|    u4_code = pu1_cav_chromdc[u4_code];
 1413|       |
 1414|  56.2k|    FLUSHBITS(u4_bitstream_offset, ((u4_code & 0x7) + 1));
  ------------------
  |  |  193|  56.2k|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  194|  56.2k|{                                                                           \
  |  |  195|  56.2k|        (u4_offset) += (u4_no_bits);                                        \
  |  |  196|  56.2k|}
  ------------------
 1415|  56.2k|    ps_bitstrm->u4_ofst = u4_bitstream_offset;
 1416|       |
 1417|  56.2k|    u4_total_coeff = (u4_code >> 5);
 1418|       |
 1419|  56.2k|    if(u4_total_coeff)
  ------------------
  |  Branch (1419:8): [True: 43.0k, False: 13.2k]
  ------------------
 1420|  43.0k|    {
 1421|  43.0k|        WORD32 i_z0, i_z1, i_z2, i_z3;
 1422|  43.0k|        tu_sblk4x4_coeff_data_t *ps_tu_4x4;
 1423|  43.0k|        dec_struct_t *ps_dec = (dec_struct_t *)ps_bitstrm->pv_codec_handle;
 1424|  43.0k|        WORD16 ai2_dc_coef[4];
 1425|  43.0k|        UWORD8 pu1_inv_scan[4] =
 1426|  43.0k|                        { 0, 1, 2, 3 };
 1427|  43.0k|        WORD16 *pi2_coeff_data =
 1428|  43.0k|                                    (WORD16 *)ps_dec->pv_parse_tu_coeff_data;
 1429|       |
 1430|  43.0k|        ps_tu_4x4 = (tu_sblk4x4_coeff_data_t *)ps_dec->pv_parse_tu_coeff_data;
 1431|       |
 1432|  43.0k|        u4_trailing_ones = ((u4_code >> 3) & 0x3);
 1433|  43.0k|        u4_total_coeff_tone = (u4_total_coeff << 16) | u4_trailing_ones;
 1434|  43.0k|        ih264d_rest_of_residual_cav_chroma_dc_block(u4_total_coeff_tone,
 1435|  43.0k|                                                    ps_bitstrm);
 1436|       |
 1437|  43.0k|        ai2_dc_coef[0] = 0;
 1438|  43.0k|        ai2_dc_coef[1] = 0;
 1439|  43.0k|        ai2_dc_coef[2] = 0;
 1440|  43.0k|        ai2_dc_coef[3] = 0;
 1441|       |
 1442|  43.0k|        ih264d_unpack_coeff4x4_dc_4x4blk(ps_tu_4x4,
 1443|  43.0k|                                         ai2_dc_coef,
 1444|  43.0k|                                         pu1_inv_scan);
 1445|       |
 1446|       |        /*-------------------------------------------------------------------*/
 1447|       |        /* Inverse 2x2 transform and scaling  of chroma DC                   */
 1448|       |        /*-------------------------------------------------------------------*/
 1449|  43.0k|        i_z0 = (ai2_dc_coef[0] + ai2_dc_coef[2]);
 1450|  43.0k|        i_z1 = (ai2_dc_coef[0] - ai2_dc_coef[2]);
 1451|  43.0k|        i_z2 = (ai2_dc_coef[1] - ai2_dc_coef[3]);
 1452|  43.0k|        i_z3 = (ai2_dc_coef[1] + ai2_dc_coef[3]);
 1453|       |
 1454|       |        /*-----------------------------------------------------------*/
 1455|       |        /* Scaling and storing the values back                       */
 1456|       |        /*-----------------------------------------------------------*/
 1457|  43.0k|        *pi2_coeff_data++ = (WORD16)(((i_z0 + i_z3) * (WORD32)u4_scale_v) >> 5);
 1458|  43.0k|        *pi2_coeff_data++ = (WORD16)(((i_z0 - i_z3) * (WORD32)u4_scale_v) >> 5);
 1459|  43.0k|        *pi2_coeff_data++ = (WORD16)(((i_z1 + i_z2) * (WORD32)u4_scale_v) >> 5);
 1460|  43.0k|        *pi2_coeff_data++ = (WORD16)(((i_z1 - i_z2) * (WORD32)u4_scale_v) >> 5);
 1461|       |
 1462|  43.0k|        ps_dec->pv_parse_tu_coeff_data = (void *)pi2_coeff_data;
 1463|       |
 1464|  43.0k|        SET_BIT(ps_cur_mb_info->u1_yuv_dc_block_flag,2);
  ------------------
  |  |  106|  43.0k|#define SET_BIT(x, pos) (x) = (x) | (1 << pos);
  ------------------
 1465|  43.0k|    }
 1466|  56.2k|}
ih264d_parse_pmb_ref_index_cavlc_range1:
 1496|  4.43k|{
 1497|  4.43k|    UWORD32 u4_i;
 1498|  4.43k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
 1499|  4.43k|    UWORD32 *pu4_bitstream_off = &ps_bitstrm->u4_ofst;
 1500|  4.43k|    UNUSED(u4_num_ref_idx_active_minus1);
  ------------------
  |  |   45|  4.43k|#define UNUSED(x) ((void)(x))
  ------------------
 1501|  12.2k|    for(u4_i = 0; u4_i < u4_num_part; u4_i++)
  ------------------
  |  Branch (1501:19): [True: 7.77k, False: 4.43k]
  ------------------
 1502|  7.77k|    {
 1503|  7.77k|        UWORD32 u4_ref_idx;
 1504|  7.77k|        u4_ref_idx = ih264d_tev_range1(pu4_bitstream_off, pu4_bitstrm_buf);
 1505|       |
 1506|       |        /* Storing Reference Idx Information */
 1507|  7.77k|        pi1_ref_idx[u4_i] = (WORD8)u4_ref_idx;
 1508|  7.77k|    }
 1509|  4.43k|}
ih264d_parse_pmb_ref_index_cavlc:
 1540|  13.4k|{
 1541|  13.4k|    UWORD32 u4_i;
 1542|  13.4k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
 1543|  13.4k|    UWORD32 *pu4_bitstream_off = &ps_bitstrm->u4_ofst;
 1544|       |
 1545|  29.6k|    for(u4_i = 0; u4_i < u4_num_part; u4_i++)
  ------------------
  |  Branch (1545:19): [True: 16.6k, False: 12.9k]
  ------------------
 1546|  16.6k|    {
 1547|  16.6k|        UWORD32 u4_ref_idx;
 1548|       |//Inlined ih264d_uev
 1549|  16.6k|        UWORD32 u4_bitstream_offset = *pu4_bitstream_off;
 1550|  16.6k|        UWORD32 u4_word, u4_ldz;
 1551|       |
 1552|       |        /***************************************************************/
 1553|       |        /* Find leading zeros in next 32 bits                          */
 1554|       |        /***************************************************************/
 1555|  16.6k|        NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  16.6k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  16.6k|{                                                                           \
  |  |  152|  16.6k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  16.6k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  16.6k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  16.6k|                                                                            \
  |  |  156|  16.6k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  16.6k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 16.1k, False: 460]
  |  |  ------------------
  |  |  158|  16.6k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  16.1k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  16.6k|}
  ------------------
 1556|  16.6k|        u4_ldz = CLZ(u4_word);
 1557|       |        /* Flush the ps_bitstrm */
 1558|  16.6k|        u4_bitstream_offset += (u4_ldz + 1);
 1559|       |        /* Read the suffix from the ps_bitstrm */
 1560|  16.6k|        u4_word = 0;
 1561|  16.6k|        if(u4_ldz)
  ------------------
  |  Branch (1561:12): [True: 4.91k, False: 11.7k]
  ------------------
 1562|  4.91k|            GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  4.91k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  4.91k|{                                                                           \
  |  |  122|  4.91k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  4.91k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  4.91k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  4.91k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  4.91k|                                                                            \
  |  |  127|  4.91k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 4.63k, False: 278]
  |  |  ------------------
  |  |  128|  4.91k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  4.63k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  4.91k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  4.91k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  4.91k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  4.91k|}                                                                           \
  ------------------
 1563|  16.6k|        *pu4_bitstream_off = u4_bitstream_offset;
 1564|  16.6k|        u4_ref_idx = ((1 << u4_ldz) + u4_word - 1);
 1565|       |//Inlined ih264d_uev
 1566|       |
 1567|  16.6k|        if(u4_ref_idx > u4_num_ref_idx_active_minus1)
  ------------------
  |  Branch (1567:12): [True: 460, False: 16.1k]
  ------------------
 1568|    460|            return ERROR_REF_IDX;
 1569|       |
 1570|       |        /* Storing Reference Idx Information */
 1571|  16.1k|        pi1_ref_idx[u4_i] = (WORD8)u4_ref_idx;
 1572|  16.1k|    }
 1573|  12.9k|    return OK;
  ------------------
  |  |  114|  12.9k|#define OK        0
  ------------------
 1574|  13.4k|}
ih264d_parse_bmb_ref_index_cavlc_range1:
 1604|  10.2k|{
 1605|  10.2k|    UWORD32 u4_i;
 1606|  10.2k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
 1607|  10.2k|    UWORD32 *pu4_bitstream_off = &ps_bitstrm->u4_ofst;
 1608|  10.2k|    UNUSED(u4_num_ref_idx_active_minus1);
  ------------------
  |  |   45|  10.2k|#define UNUSED(x) ((void)(x))
  ------------------
 1609|  27.2k|    for(u4_i = 0; u4_i < u4_num_part; u4_i++)
  ------------------
  |  Branch (1609:19): [True: 17.0k, False: 10.2k]
  ------------------
 1610|  17.0k|    {
 1611|  17.0k|        if(pi1_ref_idx[u4_i] > -1)
  ------------------
  |  Branch (1611:12): [True: 6.26k, False: 10.7k]
  ------------------
 1612|  6.26k|        {
 1613|  6.26k|            UWORD32 u4_ref_idx;
 1614|       |
 1615|  6.26k|            u4_ref_idx = ih264d_tev_range1(pu4_bitstream_off, pu4_bitstrm_buf);
 1616|       |
 1617|       |            /* Storing Reference Idx Information */
 1618|  6.26k|            pi1_ref_idx[u4_i] = (WORD8)u4_ref_idx;
 1619|  6.26k|        }
 1620|  17.0k|    }
 1621|  10.2k|}
ih264d_parse_bmb_ref_index_cavlc:
 1651|  9.75k|{
 1652|  9.75k|    UWORD32 u4_i;
 1653|  9.75k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
 1654|  9.75k|    UWORD32 *pu4_bitstream_off = &ps_bitstrm->u4_ofst;
 1655|       |
 1656|  24.7k|    for(u4_i = 0; u4_i < u4_num_part; u4_i++)
  ------------------
  |  Branch (1656:19): [True: 15.4k, False: 9.28k]
  ------------------
 1657|  15.4k|    {
 1658|  15.4k|        if(pi1_ref_idx[u4_i] > -1)
  ------------------
  |  Branch (1658:12): [True: 11.0k, False: 4.46k]
  ------------------
 1659|  11.0k|        {
 1660|  11.0k|            UWORD32 u4_ref_idx;
 1661|       |//inlining ih264d_uev
 1662|  11.0k|            UWORD32 u4_bitstream_offset = *pu4_bitstream_off;
 1663|  11.0k|            UWORD32 u4_word, u4_ldz;
 1664|       |
 1665|       |            /***************************************************************/
 1666|       |            /* Find leading zeros in next 32 bits                          */
 1667|       |            /***************************************************************/
 1668|  11.0k|            NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  11.0k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  11.0k|{                                                                           \
  |  |  152|  11.0k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  11.0k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  11.0k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  11.0k|                                                                            \
  |  |  156|  11.0k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  11.0k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 9.87k, False: 1.13k]
  |  |  ------------------
  |  |  158|  11.0k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  9.87k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  11.0k|}
  ------------------
 1669|  11.0k|            u4_ldz = CLZ(u4_word);
 1670|       |            /* Flush the ps_bitstrm */
 1671|  11.0k|            u4_bitstream_offset += (u4_ldz + 1);
 1672|       |            /* Read the suffix from the ps_bitstrm */
 1673|  11.0k|            u4_word = 0;
 1674|  11.0k|            if(u4_ldz)
  ------------------
  |  Branch (1674:16): [True: 1.75k, False: 9.26k]
  ------------------
 1675|  1.75k|                GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  1.75k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  1.75k|{                                                                           \
  |  |  122|  1.75k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  1.75k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  1.75k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  1.75k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  1.75k|                                                                            \
  |  |  127|  1.75k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 1.64k, False: 105]
  |  |  ------------------
  |  |  128|  1.75k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  1.64k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  1.75k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  1.75k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  1.75k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  1.75k|}                                                                           \
  ------------------
 1676|  11.0k|            *pu4_bitstream_off = u4_bitstream_offset;
 1677|  11.0k|            u4_ref_idx = ((1 << u4_ldz) + u4_word - 1);
 1678|       |//inlining ih264d_uev
 1679|  11.0k|            if(u4_ref_idx > u4_num_ref_idx_active_minus1)
  ------------------
  |  Branch (1679:16): [True: 464, False: 10.5k]
  ------------------
 1680|    464|                return ERROR_REF_IDX;
 1681|       |
 1682|       |            /* Storing Reference Idx Information */
 1683|  10.5k|            pi1_ref_idx[u4_i] = (WORD8)u4_ref_idx;
 1684|  10.5k|        }
 1685|  15.4k|    }
 1686|  9.28k|    return OK;
  ------------------
  |  |  114|  9.28k|#define OK        0
  ------------------
 1687|  9.75k|}
ih264d_cavlc_parse_8x8block_both_available:
 1736|  76.8k|{
 1737|  76.8k|    UWORD32 u4_num_coeff, u4_n, u4_subblock_coded;
 1738|  76.8k|    UWORD32 u4_top0, u4_top1;
 1739|  76.8k|    UWORD32 *pu4_dummy;
 1740|  76.8k|    WORD32 (**pf_cavlc_parse4x4coeff)(WORD16 *pi2_coeff_block,
 1741|  76.8k|                                      UWORD32 u4_isdc,
 1742|  76.8k|                                      WORD32 u4_n,
 1743|  76.8k|                                      struct _DecStruct *ps_dec,
 1744|  76.8k|                                      UWORD32 *pu4_dummy) =
 1745|  76.8k|                                      ps_dec->pf_cavlc_parse4x4coeff;
 1746|  76.8k|    UWORD32 u4_idx = 0;
 1747|  76.8k|    UWORD8 *puc_temp;
 1748|  76.8k|    WORD32 ret;
 1749|       |
 1750|  76.8k|    *pu4_csbp = 0;
 1751|       |    /* need to change the inverse scan matrices here */
 1752|  76.8k|    puc_temp = ps_dec->pu1_inv_scan;
 1753|       |
 1754|       |    /*------------------------------------------------------*/
 1755|       |    /* Residual 4x4 decoding: SubBlock 0                    */
 1756|       |    /*------------------------------------------------------*/
 1757|  76.8k|    if(u1_tran_form8x8)
  ------------------
  |  Branch (1757:8): [True: 34.6k, False: 42.2k]
  ------------------
 1758|  34.6k|    {
 1759|  34.6k|        if(!u1_mb_field_decodingflag)
  ------------------
  |  Branch (1759:12): [True: 34.6k, False: 0]
  ------------------
 1760|  34.6k|        {
 1761|  34.6k|            ps_dec->pu1_inv_scan =
 1762|  34.6k|                            (UWORD8*)gau1_ih264d_inv_scan_prog8x8_cavlc[0];
 1763|  34.6k|        }
 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|  34.6k|    }
 1770|  76.8k|    u4_n = (pu1_top_nnz[0] + pu1_left_nnz[0] + 1) >> 1;
 1771|  76.8k|    ret = pf_cavlc_parse4x4coeff[(u4_n > 7)](pi2_coeff_block, u4_isdc,
 1772|  76.8k|                                             u4_n, ps_dec, &u4_num_coeff);
 1773|  76.8k|    if(ret != OK)
  ------------------
  |  |  114|  76.8k|#define OK        0
  ------------------
  |  Branch (1773:8): [True: 516, False: 76.3k]
  ------------------
 1774|    516|        return ret;
 1775|       |
 1776|  76.3k|    u4_top0 = u4_num_coeff;
 1777|  76.3k|    u4_subblock_coded = (u4_num_coeff != 0);
 1778|  76.3k|    INSERT_BIT(*pu4_csbp, u4_idx, u4_subblock_coded);
  ------------------
  |  |  109|  76.3k|#define INSERT_BIT(x, pos, bit) { RESET_BIT(x, pos); (x) = (x) | (bit << pos); }
  |  |  ------------------
  |  |  |  |  105|  76.3k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  |  |  ------------------
  ------------------
 1779|       |
 1780|       |    /*------------------------------------------------------*/
 1781|       |    /* Residual 4x4 decoding: SubBlock 1                    */
 1782|       |    /*------------------------------------------------------*/
 1783|  76.3k|    u4_idx++;
 1784|  76.3k|    if(u1_tran_form8x8)
  ------------------
  |  Branch (1784:8): [True: 34.6k, False: 41.7k]
  ------------------
 1785|  34.6k|    {
 1786|  34.6k|        if(!u1_mb_field_decodingflag)
  ------------------
  |  Branch (1786:12): [True: 34.6k, False: 0]
  ------------------
 1787|  34.6k|        {
 1788|  34.6k|            ps_dec->pu1_inv_scan =
 1789|  34.6k|                            (UWORD8*)gau1_ih264d_inv_scan_prog8x8_cavlc[1];
 1790|  34.6k|        }
 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|  34.6k|    }
 1797|  41.7k|    else
 1798|  41.7k|    {
 1799|  41.7k|        pi2_coeff_block += NUM_COEFFS_IN_4x4BLK;
  ------------------
  |  |  617|  41.7k|#define NUM_COEFFS_IN_4x4BLK 16
  ------------------
 1800|  41.7k|    }
 1801|  76.3k|    u4_n = (pu1_top_nnz[1] + u4_num_coeff + 1) >> 1;
 1802|  76.3k|    ret = pf_cavlc_parse4x4coeff[(u4_n > 7)](pi2_coeff_block, u4_isdc,
 1803|  76.3k|                                             u4_n, ps_dec, &u4_num_coeff);
 1804|  76.3k|    if(ret != OK)
  ------------------
  |  |  114|  76.3k|#define OK        0
  ------------------
  |  Branch (1804:8): [True: 389, False: 75.9k]
  ------------------
 1805|    389|        return ret;
 1806|       |
 1807|  75.9k|    u4_top1 = pu1_left_nnz[0] = u4_num_coeff;
 1808|  75.9k|    u4_subblock_coded = (u4_num_coeff != 0);
 1809|  75.9k|    INSERT_BIT(*pu4_csbp, u4_idx, u4_subblock_coded);
  ------------------
  |  |  109|  75.9k|#define INSERT_BIT(x, pos, bit) { RESET_BIT(x, pos); (x) = (x) | (bit << pos); }
  |  |  ------------------
  |  |  |  |  105|  75.9k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  |  |  ------------------
  ------------------
 1810|       |
 1811|       |    /*------------------------------------------------------*/
 1812|       |    /* Residual 4x4 decoding: SubBlock 2                    */
 1813|       |    /*------------------------------------------------------*/
 1814|  75.9k|    u4_idx += (u4_sub_block_strd - 1);
 1815|  75.9k|    if(u1_tran_form8x8)
  ------------------
  |  Branch (1815:8): [True: 34.5k, False: 41.3k]
  ------------------
 1816|  34.5k|    {
 1817|  34.5k|        if(!u1_mb_field_decodingflag)
  ------------------
  |  Branch (1817:12): [True: 34.5k, False: 0]
  ------------------
 1818|  34.5k|        {
 1819|  34.5k|            ps_dec->pu1_inv_scan =
 1820|  34.5k|                            (UWORD8*)gau1_ih264d_inv_scan_prog8x8_cavlc[2];
 1821|  34.5k|        }
 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|  34.5k|    }
 1828|  41.3k|    else
 1829|  41.3k|    {
 1830|  41.3k|        pi2_coeff_block += ((u4_sub_block_strd - 1) * NUM_COEFFS_IN_4x4BLK);
  ------------------
  |  |  617|  41.3k|#define NUM_COEFFS_IN_4x4BLK 16
  ------------------
 1831|  41.3k|    }
 1832|  75.9k|    u4_n = (u4_top0 + pu1_left_nnz[1] + 1) >> 1;
 1833|  75.9k|    ret = pf_cavlc_parse4x4coeff[(u4_n > 7)](pi2_coeff_block, u4_isdc,
 1834|  75.9k|                                             u4_n, ps_dec, &u4_num_coeff);
 1835|  75.9k|    if(ret != OK)
  ------------------
  |  |  114|  75.9k|#define OK        0
  ------------------
  |  Branch (1835:8): [True: 451, False: 75.4k]
  ------------------
 1836|    451|        return ret;
 1837|       |
 1838|  75.4k|    pu1_top_nnz[0] = u4_num_coeff;
 1839|  75.4k|    u4_subblock_coded = (u4_num_coeff != 0);
 1840|  75.4k|    INSERT_BIT(*pu4_csbp, u4_idx, u4_subblock_coded);
  ------------------
  |  |  109|  75.4k|#define INSERT_BIT(x, pos, bit) { RESET_BIT(x, pos); (x) = (x) | (bit << pos); }
  |  |  ------------------
  |  |  |  |  105|  75.4k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  |  |  ------------------
  ------------------
 1841|       |
 1842|       |    /*------------------------------------------------------*/
 1843|       |    /* Residual 4x4 decoding: SubBlock 3                    */
 1844|       |    /*------------------------------------------------------*/
 1845|  75.4k|    u4_idx++;
 1846|  75.4k|    if(u1_tran_form8x8)
  ------------------
  |  Branch (1846:8): [True: 34.5k, False: 40.9k]
  ------------------
 1847|  34.5k|    {
 1848|  34.5k|        if(!u1_mb_field_decodingflag)
  ------------------
  |  Branch (1848:12): [True: 34.5k, False: 0]
  ------------------
 1849|  34.5k|        {
 1850|  34.5k|            ps_dec->pu1_inv_scan =
 1851|  34.5k|                            (UWORD8*)gau1_ih264d_inv_scan_prog8x8_cavlc[3];
 1852|  34.5k|        }
 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|  34.5k|    }
 1859|  40.9k|    else
 1860|  40.9k|    {
 1861|  40.9k|        pi2_coeff_block += NUM_COEFFS_IN_4x4BLK;
  ------------------
  |  |  617|  40.9k|#define NUM_COEFFS_IN_4x4BLK 16
  ------------------
 1862|  40.9k|    }
 1863|  75.4k|    u4_n = (u4_top1 + u4_num_coeff + 1) >> 1;
 1864|  75.4k|    ret = pf_cavlc_parse4x4coeff[(u4_n > 7)](pi2_coeff_block, u4_isdc,
 1865|  75.4k|                                             u4_n, ps_dec, &u4_num_coeff);
 1866|  75.4k|    if(ret != OK)
  ------------------
  |  |  114|  75.4k|#define OK        0
  ------------------
  |  Branch (1866:8): [True: 523, False: 74.9k]
  ------------------
 1867|    523|        return ret;
 1868|       |
 1869|  74.9k|    pu1_top_nnz[1] = pu1_left_nnz[1] = u4_num_coeff;
 1870|  74.9k|    u4_subblock_coded = (u4_num_coeff != 0);
 1871|  74.9k|    INSERT_BIT(*pu4_csbp, u4_idx, u4_subblock_coded);
  ------------------
  |  |  109|  74.9k|#define INSERT_BIT(x, pos, bit) { RESET_BIT(x, pos); (x) = (x) | (bit << pos); }
  |  |  ------------------
  |  |  |  |  105|  74.9k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  |  |  ------------------
  ------------------
 1872|       |
 1873|  74.9k|    ps_dec->pu1_inv_scan = puc_temp;
 1874|       |
 1875|  74.9k|    return OK;
  ------------------
  |  |  114|  74.9k|#define OK        0
  ------------------
 1876|  75.4k|}
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: 6.43k, False: 14.2k]
  ------------------
 1947|  6.43k|    {
 1948|  6.43k|        if(!u1_mb_field_decodingflag)
  ------------------
  |  Branch (1948:12): [True: 6.43k, False: 0]
  ------------------
 1949|  6.43k|        {
 1950|  6.43k|            ps_dec->pu1_inv_scan =
 1951|  6.43k|                            (UWORD8*)gau1_ih264d_inv_scan_prog8x8_cavlc[0];
 1952|  6.43k|        }
 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|  6.43k|    }
 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: 194, False: 20.4k]
  ------------------
 1963|    194|        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: 6.42k, False: 14.0k]
  ------------------
 1974|  6.42k|    {
 1975|  6.42k|        if(!u1_mb_field_decodingflag)
  ------------------
  |  Branch (1975:12): [True: 6.42k, False: 0]
  ------------------
 1976|  6.42k|        {
 1977|  6.42k|            ps_dec->pu1_inv_scan =
 1978|  6.42k|                            (UWORD8*)gau1_ih264d_inv_scan_prog8x8_cavlc[1];
 1979|  6.42k|        }
 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|  6.42k|    }
 1986|  14.0k|    else
 1987|  14.0k|    {
 1988|  14.0k|        pi2_coeff_block += NUM_COEFFS_IN_4x4BLK;
  ------------------
  |  |  617|  14.0k|#define NUM_COEFFS_IN_4x4BLK 16
  ------------------
 1989|  14.0k|    }
 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: 278, False: 20.1k]
  ------------------
 1994|    278|        return ret;
 1995|       |
 1996|  20.1k|    u4_top1 = pu1_left_nnz[0] = u4_num_coeff;
 1997|  20.1k|    u4_subblock_coded = (u4_num_coeff != 0);
 1998|  20.1k|    INSERT_BIT(*pu4_csbp, u4_idx, u4_subblock_coded);
  ------------------
  |  |  109|  20.1k|#define INSERT_BIT(x, pos, bit) { RESET_BIT(x, pos); (x) = (x) | (bit << pos); }
  |  |  ------------------
  |  |  |  |  105|  20.1k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  |  |  ------------------
  ------------------
 1999|       |
 2000|       |    /*------------------------------------------------------*/
 2001|       |    /* Residual 4x4 decoding: SubBlock 2                    */
 2002|       |    /*------------------------------------------------------*/
 2003|  20.1k|    u4_idx += (u4_sub_block_strd - 1);
 2004|  20.1k|    if(u1_tran_form8x8)
  ------------------
  |  Branch (2004:8): [True: 6.41k, False: 13.7k]
  ------------------
 2005|  6.41k|    {
 2006|  6.41k|        if(!u1_mb_field_decodingflag)
  ------------------
  |  Branch (2006:12): [True: 6.41k, False: 0]
  ------------------
 2007|  6.41k|        {
 2008|  6.41k|            ps_dec->pu1_inv_scan =
 2009|  6.41k|                            (UWORD8*)gau1_ih264d_inv_scan_prog8x8_cavlc[2];
 2010|  6.41k|        }
 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|  6.41k|    }
 2017|  13.7k|    else
 2018|  13.7k|    {
 2019|  13.7k|        pi2_coeff_block += ((u4_sub_block_strd - 1) * NUM_COEFFS_IN_4x4BLK);
  ------------------
  |  |  617|  13.7k|#define NUM_COEFFS_IN_4x4BLK 16
  ------------------
 2020|  13.7k|    }
 2021|  20.1k|    u4_n = (u4_top0 + pu1_left_nnz[1] + 1) >> 1;
 2022|  20.1k|    ret = pf_cavlc_parse4x4coeff[(u4_n > 7)](pi2_coeff_block, u4_isdc,
 2023|  20.1k|                                             u4_n, ps_dec, &u4_num_coeff);
 2024|  20.1k|    if(ret != OK)
  ------------------
  |  |  114|  20.1k|#define OK        0
  ------------------
  |  Branch (2024:8): [True: 310, False: 19.8k]
  ------------------
 2025|    310|        return ret;
 2026|       |
 2027|  19.8k|    pu1_top_nnz[0] = u4_num_coeff;
 2028|  19.8k|    u4_subblock_coded = (u4_num_coeff != 0);
 2029|  19.8k|    INSERT_BIT(*pu4_csbp, u4_idx, u4_subblock_coded);
  ------------------
  |  |  109|  19.8k|#define INSERT_BIT(x, pos, bit) { RESET_BIT(x, pos); (x) = (x) | (bit << pos); }
  |  |  ------------------
  |  |  |  |  105|  19.8k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  |  |  ------------------
  ------------------
 2030|       |
 2031|       |    /*------------------------------------------------------*/
 2032|       |    /* Residual 4x4 decoding: SubBlock 3                    */
 2033|       |    /*------------------------------------------------------*/
 2034|  19.8k|    u4_idx++;
 2035|  19.8k|    if(u1_tran_form8x8)
  ------------------
  |  Branch (2035:8): [True: 6.39k, False: 13.4k]
  ------------------
 2036|  6.39k|    {
 2037|  6.39k|        if(!u1_mb_field_decodingflag)
  ------------------
  |  Branch (2037:12): [True: 6.39k, False: 0]
  ------------------
 2038|  6.39k|        {
 2039|  6.39k|            ps_dec->pu1_inv_scan =
 2040|  6.39k|                            (UWORD8*)gau1_ih264d_inv_scan_prog8x8_cavlc[3];
 2041|  6.39k|        }
 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|  6.39k|    }
 2048|  13.4k|    else
 2049|  13.4k|    {
 2050|  13.4k|        pi2_coeff_block += NUM_COEFFS_IN_4x4BLK;
  ------------------
  |  |  617|  13.4k|#define NUM_COEFFS_IN_4x4BLK 16
  ------------------
 2051|  13.4k|    }
 2052|  19.8k|    u4_n = (u4_top1 + u4_num_coeff + 1) >> 1;
 2053|  19.8k|    ret = pf_cavlc_parse4x4coeff[(u4_n > 7)](pi2_coeff_block, u4_isdc,
 2054|  19.8k|                                             u4_n, ps_dec, &u4_num_coeff);
 2055|  19.8k|    if(ret != OK)
  ------------------
  |  |  114|  19.8k|#define OK        0
  ------------------
  |  Branch (2055:8): [True: 273, False: 19.6k]
  ------------------
 2056|    273|        return ret;
 2057|       |
 2058|  19.6k|    pu1_top_nnz[1] = pu1_left_nnz[1] = u4_num_coeff;
 2059|  19.6k|    u4_subblock_coded = (u4_num_coeff != 0);
 2060|  19.6k|    INSERT_BIT(*pu4_csbp, u4_idx, u4_subblock_coded);
  ------------------
  |  |  109|  19.6k|#define INSERT_BIT(x, pos, bit) { RESET_BIT(x, pos); (x) = (x) | (bit << pos); }
  |  |  ------------------
  |  |  |  |  105|  19.6k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  |  |  ------------------
  ------------------
 2061|       |
 2062|  19.6k|    ps_dec->pu1_inv_scan = puc_temp;
 2063|       |
 2064|  19.6k|    return OK;
  ------------------
  |  |  114|  19.6k|#define OK        0
  ------------------
 2065|  19.8k|}
ih264d_cavlc_parse_8x8block_top_available:
 2115|  22.9k|{
 2116|  22.9k|    UWORD32 u4_num_coeff, u4_n, u4_subblock_coded;
 2117|  22.9k|    UWORD32 u4_top0, u4_top1;
 2118|  22.9k|    UWORD32 *pu4_dummy;
 2119|  22.9k|    WORD32 (**pf_cavlc_parse4x4coeff)(WORD16 *pi2_coeff_block,
 2120|  22.9k|                                      UWORD32 u4_isdc,
 2121|  22.9k|                                      WORD32 u4_n,
 2122|  22.9k|                                      struct _DecStruct *ps_dec,
 2123|  22.9k|                                      UWORD32 *pu4_dummy) =
 2124|  22.9k|                                      ps_dec->pf_cavlc_parse4x4coeff;
 2125|  22.9k|    UWORD32 u4_idx = 0;
 2126|  22.9k|    UWORD8 *puc_temp;
 2127|  22.9k|    WORD32 ret;
 2128|       |
 2129|  22.9k|    *pu4_csbp = 0;
 2130|  22.9k|    puc_temp = ps_dec->pu1_inv_scan;
 2131|       |
 2132|       |    /*------------------------------------------------------*/
 2133|       |    /* Residual 4x4 decoding: SubBlock 0                    */
 2134|       |    /*------------------------------------------------------*/
 2135|  22.9k|    if(u1_tran_form8x8)
  ------------------
  |  Branch (2135:8): [True: 5.07k, False: 17.9k]
  ------------------
 2136|  5.07k|    {
 2137|  5.07k|        if(!u1_mb_field_decodingflag)
  ------------------
  |  Branch (2137:12): [True: 5.07k, False: 0]
  ------------------
 2138|  5.07k|        {
 2139|  5.07k|            ps_dec->pu1_inv_scan =
 2140|  5.07k|                            (UWORD8*)gau1_ih264d_inv_scan_prog8x8_cavlc[0];
 2141|  5.07k|        }
 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|  5.07k|    }
 2148|  22.9k|    u4_n = pu1_top_nnz[0];
 2149|  22.9k|    ret = pf_cavlc_parse4x4coeff[(u4_n > 7)](pi2_coeff_block, u4_isdc,
 2150|  22.9k|                                             u4_n, ps_dec, &u4_num_coeff);
 2151|  22.9k|    if(ret != OK)
  ------------------
  |  |  114|  22.9k|#define OK        0
  ------------------
  |  Branch (2151:8): [True: 350, False: 22.6k]
  ------------------
 2152|    350|        return ret;
 2153|       |
 2154|  22.6k|    u4_top0 = u4_num_coeff;
 2155|  22.6k|    u4_subblock_coded = (u4_num_coeff != 0);
 2156|  22.6k|    INSERT_BIT(*pu4_csbp, u4_idx, u4_subblock_coded);
  ------------------
  |  |  109|  22.6k|#define INSERT_BIT(x, pos, bit) { RESET_BIT(x, pos); (x) = (x) | (bit << pos); }
  |  |  ------------------
  |  |  |  |  105|  22.6k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  |  |  ------------------
  ------------------
 2157|       |
 2158|       |    /*------------------------------------------------------*/
 2159|       |    /* Residual 4x4 decoding: SubBlock 1                    */
 2160|       |    /*------------------------------------------------------*/
 2161|  22.6k|    u4_idx++;
 2162|  22.6k|    if(u1_tran_form8x8)
  ------------------
  |  Branch (2162:8): [True: 5.05k, False: 17.5k]
  ------------------
 2163|  5.05k|    {
 2164|  5.05k|        if(!u1_mb_field_decodingflag)
  ------------------
  |  Branch (2164:12): [True: 5.05k, False: 0]
  ------------------
 2165|  5.05k|        {
 2166|  5.05k|            ps_dec->pu1_inv_scan =
 2167|  5.05k|                            (UWORD8*)gau1_ih264d_inv_scan_prog8x8_cavlc[1];
 2168|  5.05k|        }
 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|  5.05k|    }
 2175|  17.5k|    else
 2176|  17.5k|    {
 2177|  17.5k|        pi2_coeff_block += NUM_COEFFS_IN_4x4BLK;
  ------------------
  |  |  617|  17.5k|#define NUM_COEFFS_IN_4x4BLK 16
  ------------------
 2178|  17.5k|    }
 2179|  22.6k|    u4_n = (pu1_top_nnz[1] + u4_num_coeff + 1) >> 1;
 2180|  22.6k|    ret = pf_cavlc_parse4x4coeff[(u4_n > 7)](pi2_coeff_block, u4_isdc,
 2181|  22.6k|                                             u4_n, ps_dec, &u4_num_coeff);
 2182|  22.6k|    if(ret != OK)
  ------------------
  |  |  114|  22.6k|#define OK        0
  ------------------
  |  Branch (2182:8): [True: 341, False: 22.3k]
  ------------------
 2183|    341|        return ret;
 2184|       |
 2185|  22.3k|    u4_top1 = pu1_left_nnz[0] = u4_num_coeff;
 2186|  22.3k|    u4_subblock_coded = (u4_num_coeff != 0);
 2187|  22.3k|    INSERT_BIT(*pu4_csbp, u4_idx, u4_subblock_coded);
  ------------------
  |  |  109|  22.3k|#define INSERT_BIT(x, pos, bit) { RESET_BIT(x, pos); (x) = (x) | (bit << pos); }
  |  |  ------------------
  |  |  |  |  105|  22.3k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  |  |  ------------------
  ------------------
 2188|       |
 2189|       |    /*------------------------------------------------------*/
 2190|       |    /* Residual 4x4 decoding: SubBlock 2                    */
 2191|       |    /*------------------------------------------------------*/
 2192|  22.3k|    u4_idx += (u4_sub_block_strd - 1);
 2193|  22.3k|    if(u1_tran_form8x8)
  ------------------
  |  Branch (2193:8): [True: 5.03k, False: 17.2k]
  ------------------
 2194|  5.03k|    {
 2195|  5.03k|        if(!u1_mb_field_decodingflag)
  ------------------
  |  Branch (2195:12): [True: 5.03k, False: 0]
  ------------------
 2196|  5.03k|        {
 2197|  5.03k|            ps_dec->pu1_inv_scan =
 2198|  5.03k|                            (UWORD8*)gau1_ih264d_inv_scan_prog8x8_cavlc[2];
 2199|  5.03k|        }
 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|  5.03k|    }
 2206|  17.2k|    else
 2207|  17.2k|    {
 2208|  17.2k|        pi2_coeff_block += ((u4_sub_block_strd - 1) * NUM_COEFFS_IN_4x4BLK);
  ------------------
  |  |  617|  17.2k|#define NUM_COEFFS_IN_4x4BLK 16
  ------------------
 2209|  17.2k|    }
 2210|  22.3k|    u4_n = u4_top0;
 2211|  22.3k|    ret = pf_cavlc_parse4x4coeff[(u4_n > 7)](pi2_coeff_block, u4_isdc,
 2212|  22.3k|                                             u4_n, ps_dec, &u4_num_coeff);
 2213|  22.3k|    if(ret != OK)
  ------------------
  |  |  114|  22.3k|#define OK        0
  ------------------
  |  Branch (2213:8): [True: 421, False: 21.8k]
  ------------------
 2214|    421|        return ret;
 2215|       |
 2216|  21.8k|    pu1_top_nnz[0] = u4_num_coeff;
 2217|  21.8k|    u4_subblock_coded = (u4_num_coeff != 0);
 2218|  21.8k|    INSERT_BIT(*pu4_csbp, u4_idx, u4_subblock_coded);
  ------------------
  |  |  109|  21.8k|#define INSERT_BIT(x, pos, bit) { RESET_BIT(x, pos); (x) = (x) | (bit << pos); }
  |  |  ------------------
  |  |  |  |  105|  21.8k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  |  |  ------------------
  ------------------
 2219|       |
 2220|       |    /*------------------------------------------------------*/
 2221|       |    /* Residual 4x4 decoding: SubBlock 3                    */
 2222|       |    /*------------------------------------------------------*/
 2223|  21.8k|    u4_idx++;
 2224|  21.8k|    if(u1_tran_form8x8)
  ------------------
  |  Branch (2224:8): [True: 5.02k, False: 16.8k]
  ------------------
 2225|  5.02k|    {
 2226|  5.02k|        if(!u1_mb_field_decodingflag)
  ------------------
  |  Branch (2226:12): [True: 5.02k, False: 0]
  ------------------
 2227|  5.02k|        {
 2228|  5.02k|            ps_dec->pu1_inv_scan =
 2229|  5.02k|                            (UWORD8*)gau1_ih264d_inv_scan_prog8x8_cavlc[3];
 2230|  5.02k|        }
 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|  5.02k|    }
 2237|  16.8k|    else
 2238|  16.8k|    {
 2239|  16.8k|        pi2_coeff_block += NUM_COEFFS_IN_4x4BLK;
  ------------------
  |  |  617|  16.8k|#define NUM_COEFFS_IN_4x4BLK 16
  ------------------
 2240|  16.8k|    }
 2241|  21.8k|    u4_n = (u4_top1 + u4_num_coeff + 1) >> 1;
 2242|  21.8k|    ret = pf_cavlc_parse4x4coeff[(u4_n > 7)](pi2_coeff_block, u4_isdc,
 2243|  21.8k|                                             u4_n, ps_dec, &u4_num_coeff);
 2244|  21.8k|    if(ret != OK)
  ------------------
  |  |  114|  21.8k|#define OK        0
  ------------------
  |  Branch (2244:8): [True: 426, False: 21.4k]
  ------------------
 2245|    426|        return ret;
 2246|       |
 2247|  21.4k|    pu1_top_nnz[1] = pu1_left_nnz[1] = u4_num_coeff;
 2248|  21.4k|    u4_subblock_coded = (u4_num_coeff != 0);
 2249|  21.4k|    INSERT_BIT(*pu4_csbp, u4_idx, u4_subblock_coded);
  ------------------
  |  |  109|  21.4k|#define INSERT_BIT(x, pos, bit) { RESET_BIT(x, pos); (x) = (x) | (bit << pos); }
  |  |  ------------------
  |  |  |  |  105|  21.4k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  |  |  ------------------
  ------------------
 2250|       |
 2251|  21.4k|    ps_dec->pu1_inv_scan = puc_temp;
 2252|       |
 2253|  21.4k|    return OK;
  ------------------
  |  |  114|  21.4k|#define OK        0
  ------------------
 2254|  21.8k|}
ih264d_cavlc_parse_8x8block_none_available:
 2304|  12.8k|{
 2305|  12.8k|    UWORD32 u4_num_coeff, u4_n, u4_subblock_coded;
 2306|  12.8k|    UWORD32 u4_top0, u4_top1;
 2307|  12.8k|    UWORD32 *pu4_dummy;
 2308|  12.8k|    WORD32 (**pf_cavlc_parse4x4coeff)(WORD16 *pi2_coeff_block,
 2309|  12.8k|                                      UWORD32 u4_isdc,
 2310|  12.8k|                                      WORD32 u4_n,
 2311|  12.8k|                                      struct _DecStruct *ps_dec,
 2312|  12.8k|                                      UWORD32 *pu4_dummy) =
 2313|  12.8k|                                      ps_dec->pf_cavlc_parse4x4coeff;
 2314|  12.8k|    UWORD32 u4_idx = 0;
 2315|  12.8k|    UWORD8 *puc_temp;
 2316|  12.8k|    WORD32 ret;
 2317|       |
 2318|  12.8k|    *pu4_csbp = 0;
 2319|  12.8k|    puc_temp = ps_dec->pu1_inv_scan;
 2320|       |
 2321|       |    /*------------------------------------------------------*/
 2322|       |    /* Residual 4x4 decoding: SubBlock 0                    */
 2323|       |    /*------------------------------------------------------*/
 2324|  12.8k|    if(u1_tran_form8x8)
  ------------------
  |  Branch (2324:8): [True: 629, False: 12.2k]
  ------------------
 2325|    629|    {
 2326|    629|        if(!u1_mb_field_decodingflag)
  ------------------
  |  Branch (2326:12): [True: 629, False: 0]
  ------------------
 2327|    629|        {
 2328|    629|            ps_dec->pu1_inv_scan =
 2329|    629|                            (UWORD8*)gau1_ih264d_inv_scan_prog8x8_cavlc[0];
 2330|    629|        }
 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|    629|    }
 2337|  12.8k|    ret = pf_cavlc_parse4x4coeff[0](pi2_coeff_block, u4_isdc, 0,
 2338|  12.8k|                                    ps_dec, &u4_num_coeff);
 2339|  12.8k|    if(ret != OK)
  ------------------
  |  |  114|  12.8k|#define OK        0
  ------------------
  |  Branch (2339:8): [True: 1.21k, False: 11.6k]
  ------------------
 2340|  1.21k|        return ret;
 2341|       |
 2342|  11.6k|    u4_top0 = u4_num_coeff;
 2343|  11.6k|    u4_subblock_coded = (u4_num_coeff != 0);
 2344|  11.6k|    INSERT_BIT(*pu4_csbp, u4_idx, u4_subblock_coded);
  ------------------
  |  |  109|  11.6k|#define INSERT_BIT(x, pos, bit) { RESET_BIT(x, pos); (x) = (x) | (bit << pos); }
  |  |  ------------------
  |  |  |  |  105|  11.6k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  |  |  ------------------
  ------------------
 2345|       |
 2346|       |    /*------------------------------------------------------*/
 2347|       |    /* Residual 4x4 decoding: SubBlock 1                    */
 2348|       |    /*------------------------------------------------------*/
 2349|  11.6k|    u4_idx++;
 2350|  11.6k|    if(u1_tran_form8x8)
  ------------------
  |  Branch (2350:8): [True: 624, False: 11.0k]
  ------------------
 2351|    624|    {
 2352|    624|        if(!u1_mb_field_decodingflag)
  ------------------
  |  Branch (2352:12): [True: 624, False: 0]
  ------------------
 2353|    624|        {
 2354|    624|            ps_dec->pu1_inv_scan =
 2355|    624|                            (UWORD8*)gau1_ih264d_inv_scan_prog8x8_cavlc[1];
 2356|    624|        }
 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|    624|    }
 2363|  11.0k|    else
 2364|  11.0k|    {
 2365|  11.0k|        pi2_coeff_block += NUM_COEFFS_IN_4x4BLK;
  ------------------
  |  |  617|  11.0k|#define NUM_COEFFS_IN_4x4BLK 16
  ------------------
 2366|  11.0k|    }
 2367|  11.6k|    u4_n = u4_num_coeff;
 2368|  11.6k|    ret = pf_cavlc_parse4x4coeff[(u4_n > 7)](pi2_coeff_block, u4_isdc,
 2369|  11.6k|                                             u4_n, ps_dec, &u4_num_coeff);
 2370|  11.6k|    if(ret != OK)
  ------------------
  |  |  114|  11.6k|#define OK        0
  ------------------
  |  Branch (2370:8): [True: 395, False: 11.2k]
  ------------------
 2371|    395|        return ret;
 2372|       |
 2373|  11.2k|    u4_top1 = pu1_left_nnz[0] = u4_num_coeff;
 2374|  11.2k|    u4_subblock_coded = (u4_num_coeff != 0);
 2375|  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);
  |  |  ------------------
  ------------------
 2376|       |
 2377|       |    /*------------------------------------------------------*/
 2378|       |    /* Residual 4x4 decoding: SubBlock 2                    */
 2379|       |    /*------------------------------------------------------*/
 2380|  11.2k|    u4_idx += (u4_sub_block_strd - 1);
 2381|  11.2k|    if(u1_tran_form8x8)
  ------------------
  |  Branch (2381:8): [True: 622, False: 10.6k]
  ------------------
 2382|    622|    {
 2383|    622|        if(!u1_mb_field_decodingflag)
  ------------------
  |  Branch (2383:12): [True: 622, False: 0]
  ------------------
 2384|    622|        {
 2385|    622|            ps_dec->pu1_inv_scan =
 2386|    622|                            (UWORD8*)gau1_ih264d_inv_scan_prog8x8_cavlc[2];
 2387|    622|        }
 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|    622|    }
 2394|  10.6k|    else
 2395|  10.6k|    {
 2396|  10.6k|        pi2_coeff_block += ((u4_sub_block_strd - 1) * NUM_COEFFS_IN_4x4BLK);
  ------------------
  |  |  617|  10.6k|#define NUM_COEFFS_IN_4x4BLK 16
  ------------------
 2397|  10.6k|    }
 2398|  11.2k|    u4_n = u4_top0;
 2399|  11.2k|    ret = pf_cavlc_parse4x4coeff[(u4_n > 7)](pi2_coeff_block, u4_isdc,
 2400|  11.2k|                                             u4_n, ps_dec, &u4_num_coeff);
 2401|  11.2k|    if(ret != OK)
  ------------------
  |  |  114|  11.2k|#define OK        0
  ------------------
  |  Branch (2401:8): [True: 337, False: 10.9k]
  ------------------
 2402|    337|        return ret;
 2403|       |
 2404|  10.9k|    pu1_top_nnz[0] = u4_num_coeff;
 2405|  10.9k|    u4_subblock_coded = (u4_num_coeff != 0);
 2406|  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);
  |  |  ------------------
  ------------------
 2407|       |
 2408|       |    /*------------------------------------------------------*/
 2409|       |    /* Residual 4x4 decoding: SubBlock 3                    */
 2410|       |    /*------------------------------------------------------*/
 2411|  10.9k|    u4_idx++;
 2412|  10.9k|    if(u1_tran_form8x8)
  ------------------
  |  Branch (2412:8): [True: 611, False: 10.3k]
  ------------------
 2413|    611|    {
 2414|    611|        if(!u1_mb_field_decodingflag)
  ------------------
  |  Branch (2414:12): [True: 611, False: 0]
  ------------------
 2415|    611|        {
 2416|    611|            ps_dec->pu1_inv_scan =
 2417|    611|                            (UWORD8*)gau1_ih264d_inv_scan_prog8x8_cavlc[3];
 2418|    611|        }
 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|    611|    }
 2425|  10.3k|    else
 2426|  10.3k|    {
 2427|  10.3k|        pi2_coeff_block += NUM_COEFFS_IN_4x4BLK;
  ------------------
  |  |  617|  10.3k|#define NUM_COEFFS_IN_4x4BLK 16
  ------------------
 2428|  10.3k|    }
 2429|  10.9k|    u4_n = (u4_top1 + u4_num_coeff + 1) >> 1;
 2430|  10.9k|    ret = pf_cavlc_parse4x4coeff[(u4_n > 7)](pi2_coeff_block, u4_isdc,
 2431|  10.9k|                                             u4_n, ps_dec, &u4_num_coeff);
 2432|  10.9k|    if(ret != OK)
  ------------------
  |  |  114|  10.9k|#define OK        0
  ------------------
  |  Branch (2432:8): [True: 334, False: 10.6k]
  ------------------
 2433|    334|        return ret;
 2434|       |
 2435|  10.6k|    pu1_top_nnz[1] = pu1_left_nnz[1] = u4_num_coeff;
 2436|  10.6k|    u4_subblock_coded = (u4_num_coeff != 0);
 2437|  10.6k|    INSERT_BIT(*pu4_csbp, u4_idx, u4_subblock_coded);
  ------------------
  |  |  109|  10.6k|#define INSERT_BIT(x, pos, bit) { RESET_BIT(x, pos); (x) = (x) | (bit << pos); }
  |  |  ------------------
  |  |  |  |  105|  10.6k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  |  |  ------------------
  ------------------
 2438|       |
 2439|  10.6k|    ps_dec->pu1_inv_scan = puc_temp;
 2440|       |
 2441|  10.6k|    return OK;
  ------------------
  |  |  114|  10.6k|#define OK        0
  ------------------
 2442|  10.9k|}
ih264d_parse_residual4x4_cavlc:
 2459|  93.3k|{
 2460|  93.3k|    UWORD8 u1_cbp = ps_cur_mb_info->u1_cbp;
 2461|  93.3k|    UWORD16 ui16_csbp = 0;
 2462|  93.3k|    UWORD32 u4_nbr_avl;
 2463|  93.3k|    WORD16 *pi2_residual_buf;
 2464|       |
 2465|  93.3k|    UWORD8 u1_is_top_mb_avail;
 2466|  93.3k|    UWORD8 u1_is_left_mb_avail;
 2467|       |
 2468|  93.3k|    UWORD8 *pu1_top_nnz = ps_cur_mb_info->ps_curmb->pu1_nnz_y;
 2469|  93.3k|    UWORD8 *pu1_left_nnz = ps_dec->pu1_left_nnz_y;
 2470|  93.3k|    WORD16 *pi2_coeff_block = NULL;
 2471|  93.3k|    UWORD32 *pu4_dummy;
 2472|  93.3k|    WORD32 ret;
 2473|       |
 2474|  93.3k|    WORD32 (**pf_cavlc_parse_8x8block)(WORD16 *pi2_coeff_block,
 2475|  93.3k|                                       UWORD32 u4_sub_block_strd,
 2476|  93.3k|                                       UWORD32 u4_isdc,
 2477|  93.3k|                                       struct _DecStruct *ps_dec,
 2478|  93.3k|                                       UWORD8 *pu1_top_nnz,
 2479|  93.3k|                                       UWORD8 *pu1_left_nnz,
 2480|  93.3k|                                       UWORD8 u1_tran_form8x8,
 2481|  93.3k|                                       UWORD8 u1_mb_field_decodingflag,
 2482|  93.3k|                                       UWORD32 *pu4_dummy) = ps_dec->pf_cavlc_parse_8x8block;
 2483|       |
 2484|       |
 2485|  93.3k|    {
 2486|  93.3k|        UWORD8 uc_temp = ps_dec->u1_mb_ngbr_availablity;
 2487|  93.3k|        u1_is_top_mb_avail = BOOLEAN(uc_temp & TOP_MB_AVAILABLE_MASK);
  ------------------
  |  |   61|  93.3k|#define BOOLEAN(x) (!!(x))
  ------------------
 2488|  93.3k|        u1_is_left_mb_avail = BOOLEAN(uc_temp & LEFT_MB_AVAILABLE_MASK);
  ------------------
  |  |   61|  93.3k|#define BOOLEAN(x) (!!(x))
  ------------------
 2489|  93.3k|        u4_nbr_avl = (u1_is_top_mb_avail << 1) | u1_is_left_mb_avail;
 2490|  93.3k|    }
 2491|       |
 2492|  93.3k|    ps_cur_mb_info->u1_qp_div6 = ps_dec->u1_qp_y_div6;
 2493|  93.3k|    ps_cur_mb_info->u1_qp_rem6 = ps_dec->u1_qp_y_rem6;
 2494|  93.3k|    ps_cur_mb_info->u1_qpc_div6 = ps_dec->u1_qp_u_div6;
 2495|  93.3k|    ps_cur_mb_info->u1_qpc_rem6 = ps_dec->u1_qp_u_rem6;
 2496|  93.3k|    ps_cur_mb_info->u1_qpcr_div6 = ps_dec->u1_qp_v_div6;
 2497|  93.3k|    ps_cur_mb_info->u1_qpcr_rem6 = ps_dec->u1_qp_v_rem6;
 2498|       |
 2499|  93.3k|    if(u1_cbp & 0xf)
  ------------------
  |  Branch (2499:8): [True: 51.5k, False: 41.7k]
  ------------------
 2500|  51.5k|    {
 2501|  51.5k|        pu1_top_nnz[0] = ps_cur_mb_info->ps_top_mb->pu1_nnz_y[0];
 2502|  51.5k|        pu1_top_nnz[1] = ps_cur_mb_info->ps_top_mb->pu1_nnz_y[1];
 2503|  51.5k|        pu1_top_nnz[2] = ps_cur_mb_info->ps_top_mb->pu1_nnz_y[2];
 2504|  51.5k|        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|  51.5k|        if(!(u1_cbp & 0x1))
  ------------------
  |  Branch (2509:12): [True: 8.81k, False: 42.7k]
  ------------------
 2510|  8.81k|        {
 2511|  8.81k|            *(UWORD16 *)(pu1_top_nnz) = 0;
 2512|  8.81k|            *(UWORD16 *)(pu1_left_nnz) = 0;
 2513|       |
 2514|  8.81k|        }
 2515|  42.7k|        else
 2516|  42.7k|        {
 2517|  42.7k|            UWORD32 u4_temp;
 2518|  42.7k|            ret = pf_cavlc_parse_8x8block[u4_nbr_avl](
 2519|  42.7k|                        pi2_coeff_block, 4, u1_offset, ps_dec, pu1_top_nnz,
 2520|  42.7k|                        pu1_left_nnz, ps_cur_mb_info->u1_tran_form8x8,
 2521|  42.7k|                        ps_cur_mb_info->u1_mb_field_decodingflag, &u4_temp);
 2522|  42.7k|            if(ret != OK)
  ------------------
  |  |  114|  42.7k|#define OK        0
  ------------------
  |  Branch (2522:16): [True: 1.25k, False: 41.5k]
  ------------------
 2523|  1.25k|                return ret;
 2524|  41.5k|            ui16_csbp = u4_temp;
 2525|  41.5k|        }
 2526|       |
 2527|       |        /*******************************************************************/
 2528|       |        /* Block 1 residual decoding, check cbp and proceed (subblock = 2) */
 2529|       |        /*******************************************************************/
 2530|  50.3k|        if(ps_cur_mb_info->u1_tran_form8x8)
  ------------------
  |  Branch (2530:12): [True: 16.2k, False: 34.0k]
  ------------------
 2531|  16.2k|        {
 2532|  16.2k|            pi2_coeff_block += 64;
 2533|  16.2k|        }
 2534|  34.0k|        else
 2535|  34.0k|        {
 2536|  34.0k|            pi2_coeff_block += (2 * NUM_COEFFS_IN_4x4BLK);
  ------------------
  |  |  617|  34.0k|#define NUM_COEFFS_IN_4x4BLK 16
  ------------------
 2537|  34.0k|        }
 2538|       |
 2539|  50.3k|        if(!(u1_cbp & 0x2))
  ------------------
  |  Branch (2539:12): [True: 30.7k, False: 19.5k]
  ------------------
 2540|  30.7k|        {
 2541|  30.7k|            *(UWORD16 *)(pu1_top_nnz + 2) = 0;
 2542|  30.7k|            *(UWORD16 *)(pu1_left_nnz) = 0;
 2543|  30.7k|        }
 2544|  19.5k|        else
 2545|  19.5k|        {
 2546|  19.5k|            UWORD32 u4_temp = (u4_nbr_avl | 0x1);
 2547|  19.5k|            ret = pf_cavlc_parse_8x8block[u4_temp](
 2548|  19.5k|                        pi2_coeff_block, 4, u1_offset, ps_dec,
 2549|  19.5k|                        (pu1_top_nnz + 2), pu1_left_nnz,
 2550|  19.5k|                        ps_cur_mb_info->u1_tran_form8x8,
 2551|  19.5k|                        ps_cur_mb_info->u1_mb_field_decodingflag, &u4_temp);
 2552|  19.5k|            if(ret != OK)
  ------------------
  |  |  114|  19.5k|#define OK        0
  ------------------
  |  Branch (2552:16): [True: 1.06k, False: 18.5k]
  ------------------
 2553|  1.06k|                return ret;
 2554|  18.5k|            ui16_csbp |= (u4_temp << 2);
 2555|  18.5k|        }
 2556|       |
 2557|       |        /*******************************************************************/
 2558|       |        /* Block 2 residual decoding, check cbp and proceed (subblock = 8) */
 2559|       |        /*******************************************************************/
 2560|  49.2k|        if(ps_cur_mb_info->u1_tran_form8x8)
  ------------------
  |  Branch (2560:12): [True: 16.1k, False: 33.0k]
  ------------------
 2561|  16.1k|        {
 2562|  16.1k|            pi2_coeff_block += 64;
 2563|  16.1k|        }
 2564|  33.0k|        else
 2565|  33.0k|        {
 2566|  33.0k|            pi2_coeff_block += (6 * NUM_COEFFS_IN_4x4BLK);
  ------------------
  |  |  617|  33.0k|#define NUM_COEFFS_IN_4x4BLK 16
  ------------------
 2567|  33.0k|        }
 2568|       |
 2569|  49.2k|        if(!(u1_cbp & 0x4))
  ------------------
  |  Branch (2569:12): [True: 29.6k, False: 19.5k]
  ------------------
 2570|  29.6k|        {
 2571|  29.6k|            *(UWORD16 *)(pu1_top_nnz) = 0;
 2572|  29.6k|            *(UWORD16 *)(pu1_left_nnz + 2) = 0;
 2573|  29.6k|        }
 2574|  19.5k|        else
 2575|  19.5k|        {
 2576|  19.5k|            UWORD32 u4_temp = (u4_nbr_avl | 0x2);
 2577|  19.5k|            ret = pf_cavlc_parse_8x8block[u4_temp](
 2578|  19.5k|                        pi2_coeff_block, 4, u1_offset, ps_dec, pu1_top_nnz,
 2579|  19.5k|                        (pu1_left_nnz + 2), ps_cur_mb_info->u1_tran_form8x8,
 2580|  19.5k|                        ps_cur_mb_info->u1_mb_field_decodingflag, &u4_temp);
 2581|  19.5k|            if(ret != OK)
  ------------------
  |  |  114|  19.5k|#define OK        0
  ------------------
  |  Branch (2581:16): [True: 1.38k, False: 18.1k]
  ------------------
 2582|  1.38k|                return ret;
 2583|  18.1k|            ui16_csbp |= (u4_temp << 8);
 2584|  18.1k|        }
 2585|       |
 2586|       |        /*******************************************************************/
 2587|       |        /* Block 3 residual decoding, check cbp and proceed (subblock = 10)*/
 2588|       |        /*******************************************************************/
 2589|  47.8k|        if(ps_cur_mb_info->u1_tran_form8x8)
  ------------------
  |  Branch (2589:12): [True: 16.1k, False: 31.7k]
  ------------------
 2590|  16.1k|        {
 2591|  16.1k|            pi2_coeff_block += 64;
 2592|  16.1k|        }
 2593|  31.7k|        else
 2594|  31.7k|        {
 2595|  31.7k|            pi2_coeff_block += (2 * NUM_COEFFS_IN_4x4BLK);
  ------------------
  |  |  617|  31.7k|#define NUM_COEFFS_IN_4x4BLK 16
  ------------------
 2596|  31.7k|        }
 2597|       |
 2598|  47.8k|        if(!(u1_cbp & 0x8))
  ------------------
  |  Branch (2598:12): [True: 28.2k, False: 19.6k]
  ------------------
 2599|  28.2k|        {
 2600|  28.2k|            *(UWORD16 *)(pu1_top_nnz + 2) = 0;
 2601|  28.2k|            *(UWORD16 *)(pu1_left_nnz + 2) = 0;
 2602|  28.2k|        }
 2603|  19.6k|        else
 2604|  19.6k|        {
 2605|  19.6k|            UWORD32 u4_temp;
 2606|  19.6k|            ret = pf_cavlc_parse_8x8block[0x3](
 2607|  19.6k|                        pi2_coeff_block, 4, u1_offset, ps_dec,
 2608|  19.6k|                        (pu1_top_nnz + 2), (pu1_left_nnz + 2),
 2609|  19.6k|                        ps_cur_mb_info->u1_tran_form8x8,
 2610|  19.6k|                        ps_cur_mb_info->u1_mb_field_decodingflag, &u4_temp);
 2611|  19.6k|            if(ret != OK)
  ------------------
  |  |  114|  19.6k|#define OK        0
  ------------------
  |  Branch (2611:16): [True: 975, False: 18.6k]
  ------------------
 2612|    975|                return ret;
 2613|  18.6k|            ui16_csbp |= (u4_temp << 10);
 2614|  18.6k|        }
 2615|  47.8k|    }
 2616|  41.7k|    else
 2617|  41.7k|    {
 2618|  41.7k|        *(UWORD32 *)(pu1_top_nnz) = 0;
 2619|  41.7k|        *(UWORD32 *)(pu1_left_nnz) = 0;
 2620|  41.7k|    }
 2621|       |
 2622|  88.6k|    ps_cur_mb_info->u2_luma_csbp = ui16_csbp;
 2623|  88.6k|    ps_cur_mb_info->ps_curmb->u2_luma_csbp = ui16_csbp;
 2624|       |
 2625|  88.6k|    {
 2626|  88.6k|        UWORD16 u2_chroma_csbp = 0;
 2627|  88.6k|        ps_cur_mb_info->u2_chroma_csbp = 0;
 2628|  88.6k|        pu1_top_nnz = ps_cur_mb_info->ps_curmb->pu1_nnz_uv;
 2629|  88.6k|        pu1_left_nnz = ps_dec->pu1_left_nnz_uv;
 2630|       |
 2631|  88.6k|        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|  88.6k|        if(u1_cbp == CBPC_ALLZERO || u1_cbp == CBPC_ACZERO)
  ------------------
  |  |  507|   177k|#define CBPC_ALLZERO    0
  ------------------
                      if(u1_cbp == CBPC_ALLZERO || u1_cbp == CBPC_ACZERO)
  ------------------
  |  |  508|  56.2k|#define CBPC_ACZERO     1
  ------------------
  |  Branch (2636:12): [True: 32.4k, False: 56.2k]
  |  Branch (2636:38): [True: 39.6k, False: 16.6k]
  ------------------
 2637|  72.0k|        {
 2638|  72.0k|            *(UWORD32 *)(pu1_top_nnz) = 0;
 2639|  72.0k|            *(UWORD32 *)(pu1_left_nnz) = 0;
 2640|  72.0k|        }
 2641|       |
 2642|  88.6k|        if(u1_cbp == CBPC_ALLZERO)
  ------------------
  |  |  507|  88.6k|#define CBPC_ALLZERO    0
  ------------------
  |  Branch (2642:12): [True: 32.4k, False: 56.2k]
  ------------------
 2643|  32.4k|        {
 2644|  32.4k|            return (0);
 2645|  32.4k|        }
 2646|       |        /*--------------------------------------------------------------------*/
 2647|       |        /* Decode Chroma DC values                                            */
 2648|       |        /*--------------------------------------------------------------------*/
 2649|  56.2k|        {
 2650|  56.2k|            WORD32 u4_scale_u;
 2651|  56.2k|            WORD32 u4_scale_v;
 2652|  56.2k|            WORD32 i4_mb_inter_inc;
 2653|  56.2k|            u4_scale_u = ps_dec->pu2_quant_scale_u[0] << ps_dec->u1_qp_u_div6;
 2654|  56.2k|            u4_scale_v = ps_dec->pu2_quant_scale_v[0] << ps_dec->u1_qp_v_div6;
 2655|  56.2k|            i4_mb_inter_inc = (!((ps_cur_mb_info->ps_curmb->u1_mb_type == I_4x4_MB)
  ------------------
  |  |  417|  56.2k|#define I_4x4_MB    0
  ------------------
  |  Branch (2655:34): [True: 13.0k, False: 43.1k]
  ------------------
 2656|  43.1k|                            || (ps_cur_mb_info->ps_curmb->u1_mb_type == I_16x16_MB)))
  ------------------
  |  |  418|  43.1k|#define I_16x16_MB  1
  ------------------
  |  Branch (2656:32): [True: 18.8k, False: 24.3k]
  ------------------
 2657|  56.2k|                            * 3;
 2658|       |
 2659|  56.2k|            if(ps_dec->s_high_profile.u1_scaling_present)
  ------------------
  |  Branch (2659:16): [True: 9.88k, False: 46.3k]
  ------------------
 2660|  9.88k|            {
 2661|  9.88k|                u4_scale_u *=
 2662|  9.88k|                                ps_dec->s_high_profile.i2_scalinglist4x4[i4_mb_inter_inc
 2663|  9.88k|                                                + 1][0];
 2664|  9.88k|                u4_scale_v *=
 2665|  9.88k|                                ps_dec->s_high_profile.i2_scalinglist4x4[i4_mb_inter_inc
 2666|  9.88k|                                                + 2][0];
 2667|       |
 2668|  9.88k|            }
 2669|  46.3k|            else
 2670|  46.3k|            {
 2671|  46.3k|                u4_scale_u <<= 4;
 2672|  46.3k|                u4_scale_v <<= 4;
 2673|  46.3k|            }
 2674|       |
 2675|  56.2k|            ih264d_cavlc_parse_chroma_dc(ps_cur_mb_info,pi2_coeff_block, ps_dec->ps_bitstrm,
 2676|  56.2k|                                         u4_scale_u, u4_scale_v,
 2677|  56.2k|                                         i4_mb_inter_inc);
 2678|  56.2k|        }
 2679|       |
 2680|  56.2k|        if(u1_cbp == CBPC_ACZERO)
  ------------------
  |  |  508|  56.2k|#define CBPC_ACZERO     1
  ------------------
  |  Branch (2680:12): [True: 39.6k, False: 16.6k]
  ------------------
 2681|  39.6k|            return (0);
 2682|       |
 2683|  16.6k|        pu1_top_nnz[0] = ps_cur_mb_info->ps_top_mb->pu1_nnz_uv[0];
 2684|  16.6k|        pu1_top_nnz[1] = ps_cur_mb_info->ps_top_mb->pu1_nnz_uv[1];
 2685|  16.6k|        pu1_top_nnz[2] = ps_cur_mb_info->ps_top_mb->pu1_nnz_uv[2];
 2686|  16.6k|        pu1_top_nnz[3] = ps_cur_mb_info->ps_top_mb->pu1_nnz_uv[3];
 2687|       |        /*--------------------------------------------------------------------*/
 2688|       |        /* Decode Chroma AC values                                            */
 2689|       |        /*--------------------------------------------------------------------*/
 2690|  16.6k|        {
 2691|  16.6k|            UWORD32 u4_temp;
 2692|       |            /*****************************************************************/
 2693|       |            /* U Block  residual decoding, check cbp and proceed (subblock=0)*/
 2694|       |            /*****************************************************************/
 2695|  16.6k|            ret = pf_cavlc_parse_8x8block[u4_nbr_avl](
 2696|  16.6k|                        pi2_coeff_block, 2, 1, ps_dec, pu1_top_nnz,
 2697|  16.6k|                        pu1_left_nnz, 0, 0, &u4_temp);
 2698|  16.6k|            if(ret != OK)
  ------------------
  |  |  114|  16.6k|#define OK        0
  ------------------
  |  Branch (2698:16): [True: 1.45k, False: 15.1k]
  ------------------
 2699|  1.45k|                return ret;
 2700|  15.1k|            u2_chroma_csbp = u4_temp;
 2701|       |
 2702|  15.1k|            pi2_coeff_block += MB_CHROM_SIZE;
  ------------------
  |  |  564|  15.1k|#define MB_CHROM_SIZE                 64
  ------------------
 2703|       |            /*****************************************************************/
 2704|       |            /* V Block  residual decoding, check cbp and proceed (subblock=1)*/
 2705|       |            /*****************************************************************/
 2706|  15.1k|            ret = pf_cavlc_parse_8x8block[u4_nbr_avl](pi2_coeff_block, 2, 1,
 2707|  15.1k|                                                      ps_dec,
 2708|  15.1k|                                                      (pu1_top_nnz + 2),
 2709|  15.1k|                                                      (pu1_left_nnz + 2), 0,
 2710|  15.1k|                                                      0, &u4_temp);
 2711|  15.1k|            if(ret != OK)
  ------------------
  |  |  114|  15.1k|#define OK        0
  ------------------
  |  Branch (2711:16): [True: 618, False: 14.5k]
  ------------------
 2712|    618|                return ret;
 2713|  14.5k|            u2_chroma_csbp |= (u4_temp << 4);
 2714|  14.5k|        }
 2715|       |
 2716|      0|        ps_cur_mb_info->u2_chroma_csbp = u2_chroma_csbp;
 2717|  14.5k|    }
 2718|  14.5k|    return OK;
  ------------------
  |  |  114|  14.5k|#define OK        0
  ------------------
 2719|  15.1k|}

ih264d_get_pre_sei_params:
   86|   169k|{
   87|   169k|    if((NULL != ps_dec->ps_sei) &&
  ------------------
  |  Branch (87:8): [True: 169k, False: 0]
  ------------------
   88|   169k|        ((0 == ps_dec->ps_sei->s_sei_ccv_params.u1_ccv_cancel_flag) &&
  ------------------
  |  Branch (88:10): [True: 169k, False: 160]
  ------------------
   89|   169k|        (0 == ps_dec->ps_sei->s_sei_ccv_params.u1_ccv_persistence_flag)))
  ------------------
  |  Branch (89:9): [True: 169k, False: 102]
  ------------------
   90|   169k|    {
   91|   169k|        ps_dec->ps_sei->u1_sei_ccv_params_present_flag = 0;
   92|   169k|        memset(&ps_dec->ps_sei->s_sei_ccv_params, 0, sizeof(sei_ccv_params_t));
   93|   169k|    }
   94|       |
   95|   169k|    if((NULL != ps_dec->ps_cur_sps) &&
  ------------------
  |  Branch (95:8): [True: 139k, False: 30.1k]
  ------------------
   96|   139k|        ((1 == ps_dec->ps_cur_sps->u1_vui_parameters_present_flag) &&
  ------------------
  |  Branch (96:10): [True: 17.1k, False: 122k]
  ------------------
   97|  17.1k|        ((2 != ps_dec->ps_cur_sps->s_vui.u1_colour_primaries) &&
  ------------------
  |  Branch (97:10): [True: 2.20k, False: 14.9k]
  ------------------
   98|  2.20k|        (2 != ps_dec->ps_cur_sps->s_vui.u1_matrix_coeffs) &&
  ------------------
  |  Branch (98:9): [True: 2.11k, False: 90]
  ------------------
   99|  2.11k|        (2 != ps_dec->ps_cur_sps->s_vui.u1_tfr_chars) &&
  ------------------
  |  Branch (99:9): [True: 1.91k, False: 197]
  ------------------
  100|  1.91k|        (4 != ps_dec->ps_cur_sps->s_vui.u1_tfr_chars) &&
  ------------------
  |  Branch (100:9): [True: 1.84k, False: 67]
  ------------------
  101|  1.84k|        (5 != ps_dec->ps_cur_sps->s_vui.u1_tfr_chars))))
  ------------------
  |  Branch (101:9): [True: 1.64k, False: 197]
  ------------------
  102|  1.64k|    {
  103|  1.64k|        if((1 == ps_dec->ps_sei_parse->u1_sei_ccv_params_present_flag) ||
  ------------------
  |  Branch (103:12): [True: 90, False: 1.55k]
  ------------------
  104|  1.55k|            (IDR_SLICE_NAL == u1_nal_unit_type))
  ------------------
  |  |  328|  1.55k|#define IDR_SLICE_NAL                   5
  ------------------
  |  Branch (104:13): [True: 662, False: 897]
  ------------------
  105|    752|        {
  106|    752|            ps_dec->ps_sei->u1_sei_ccv_params_present_flag =
  107|    752|                        ps_dec->ps_sei_parse->u1_sei_ccv_params_present_flag;
  108|    752|            ps_dec->ps_sei->s_sei_ccv_params = ps_dec->ps_sei_parse->s_sei_ccv_params;
  109|    752|        }
  110|  1.64k|    }
  111|   167k|    else
  112|   167k|    {
  113|   167k|        ps_dec->ps_sei->u1_sei_ccv_params_present_flag = 0;
  114|   167k|        memset(&ps_dec->ps_sei->s_sei_ccv_params, 0, sizeof(sei_ccv_params_t));
  115|   167k|    }
  116|       |
  117|   169k|    if(IDR_SLICE_NAL == u1_nal_unit_type)
  ------------------
  |  |  328|   169k|#define IDR_SLICE_NAL                   5
  ------------------
  |  Branch (117:8): [True: 107k, False: 61.7k]
  ------------------
  118|   107k|    {
  119|   107k|        ps_dec->ps_sei->u1_sei_mdcv_params_present_flag =
  120|   107k|                        ps_dec->ps_sei_parse->u1_sei_mdcv_params_present_flag;
  121|   107k|        ps_dec->ps_sei->s_sei_mdcv_params = ps_dec->ps_sei_parse->s_sei_mdcv_params;
  122|   107k|        ps_dec->ps_sei->u1_sei_cll_params_present_flag =
  123|   107k|                        ps_dec->ps_sei_parse->u1_sei_cll_params_present_flag;
  124|   107k|        ps_dec->ps_sei->s_sei_cll_params = ps_dec->ps_sei_parse->s_sei_cll_params;
  125|   107k|        ps_dec->ps_sei->u1_sei_ave_params_present_flag =
  126|   107k|                        ps_dec->ps_sei_parse->u1_sei_ave_params_present_flag;
  127|   107k|        ps_dec->ps_sei->s_sei_ave_params = ps_dec->ps_sei_parse->s_sei_ave_params;
  128|   107k|        ps_dec->ps_sei->u1_sei_sii_params_present_flag =
  129|   107k|            ps_dec->ps_sei_parse->u1_sei_sii_params_present_flag;
  130|   107k|        ps_dec->ps_sei->s_sei_sii_params = ps_dec->ps_sei_parse->s_sei_sii_params;
  131|   107k|    }
  132|       |
  133|   169k|    if(NULL != ps_dec->ps_sei)
  ------------------
  |  Branch (133:8): [True: 169k, False: 0]
  ------------------
  134|   169k|    {
  135|   169k|        ps_dec->ps_sei->u1_sei_fgc_params_present_flag =
  136|   169k|            ps_dec->ps_sei_parse->u1_sei_fgc_params_present_flag;
  137|   169k|        ps_dec->ps_sei->s_sei_fgc_params = ps_dec->ps_sei_parse->s_sei_fgc_params;
  138|   169k|    }
  139|       |
  140|   169k|    ps_dec->ps_sei_parse->u1_sei_mdcv_params_present_flag = 0;
  141|   169k|    memset(&ps_dec->ps_sei_parse->s_sei_mdcv_params, 0, sizeof(sei_mdcv_params_t));
  142|   169k|    ps_dec->ps_sei_parse->u1_sei_cll_params_present_flag = 0;
  143|   169k|    memset(&ps_dec->ps_sei_parse->s_sei_cll_params, 0, sizeof(sei_cll_params_t));
  144|   169k|    ps_dec->ps_sei_parse->u1_sei_ave_params_present_flag = 0;
  145|   169k|    memset(&ps_dec->ps_sei_parse->s_sei_ave_params, 0, sizeof(sei_ave_params_t));
  146|   169k|    ps_dec->ps_sei_parse->u1_sei_ccv_params_present_flag = 0;
  147|   169k|    memset(&ps_dec->ps_sei_parse->s_sei_ccv_params, 0, sizeof(sei_ccv_params_t));
  148|   169k|    ps_dec->ps_sei_parse->u1_sei_sii_params_present_flag = 0;
  149|   169k|    memset(&ps_dec->ps_sei_parse->s_sei_sii_params, 0, sizeof(sei_sii_params_t));
  150|   169k|}
ih264d_parse_sei:
  207|  1.81k|{
  208|  1.81k|    UNUSED(ps_dec);
  ------------------
  |  |   45|  1.81k|#define UNUSED(x) ((void)(x))
  ------------------
  209|  1.81k|    UNUSED(ps_bitstrm);
  ------------------
  |  |   45|  1.81k|#define UNUSED(x) ((void)(x))
  ------------------
  210|  1.81k|    return (0);
  211|  1.81k|}
ih264d_correct_level_idc:
  500|   114k|{
  501|   114k|    UWORD32 u4_max_mbs_allowed;
  502|       |
  503|   114k|    switch(u4_level_idc)
  504|   114k|    {
  505|  1.67k|        case H264_LEVEL_1_0:
  ------------------
  |  |  291|  1.67k|#define H264_LEVEL_1_0     10
  ------------------
  |  Branch (505:9): [True: 1.67k, False: 112k]
  ------------------
  506|  1.67k|            u4_max_mbs_allowed = MAX_MBS_LEVEL_10;
  ------------------
  |  |  321|  1.67k|#define MAX_MBS_LEVEL_10 99
  ------------------
  507|  1.67k|            break;
  508|  15.3k|        case H264_LEVEL_1_1:
  ------------------
  |  |  292|  15.3k|#define H264_LEVEL_1_1     11
  ------------------
  |  Branch (508:9): [True: 15.3k, False: 98.7k]
  ------------------
  509|  15.3k|            u4_max_mbs_allowed = MAX_MBS_LEVEL_11;
  ------------------
  |  |  320|  15.3k|#define MAX_MBS_LEVEL_11 396
  ------------------
  510|  15.3k|            break;
  511|  1.81k|        case H264_LEVEL_1_2:
  ------------------
  |  |  293|  1.81k|#define H264_LEVEL_1_2     12
  ------------------
  |  Branch (511:9): [True: 1.81k, False: 112k]
  ------------------
  512|  1.81k|            u4_max_mbs_allowed = MAX_MBS_LEVEL_12;
  ------------------
  |  |  319|  1.81k|#define MAX_MBS_LEVEL_12 396
  ------------------
  513|  1.81k|            break;
  514|    810|        case H264_LEVEL_1_3:
  ------------------
  |  |  294|    810|#define H264_LEVEL_1_3     13
  ------------------
  |  Branch (514:9): [True: 810, False: 113k]
  ------------------
  515|    810|            u4_max_mbs_allowed = MAX_MBS_LEVEL_13;
  ------------------
  |  |  318|    810|#define MAX_MBS_LEVEL_13 396
  ------------------
  516|    810|            break;
  517|  23.2k|        case H264_LEVEL_2_0:
  ------------------
  |  |  295|  23.2k|#define H264_LEVEL_2_0     20
  ------------------
  |  Branch (517:9): [True: 23.2k, False: 90.8k]
  ------------------
  518|  23.2k|            u4_max_mbs_allowed = MAX_MBS_LEVEL_20;
  ------------------
  |  |  317|  23.2k|#define MAX_MBS_LEVEL_20 396
  ------------------
  519|  23.2k|            break;
  520|  2.81k|        case H264_LEVEL_2_1:
  ------------------
  |  |  296|  2.81k|#define H264_LEVEL_2_1     21
  ------------------
  |  Branch (520:9): [True: 2.81k, False: 111k]
  ------------------
  521|  2.81k|            u4_max_mbs_allowed = MAX_MBS_LEVEL_21;
  ------------------
  |  |  316|  2.81k|#define MAX_MBS_LEVEL_21 792
  ------------------
  522|  2.81k|            break;
  523|    669|        case H264_LEVEL_2_2:
  ------------------
  |  |  297|    669|#define H264_LEVEL_2_2     22
  ------------------
  |  Branch (523:9): [True: 669, False: 113k]
  ------------------
  524|    669|            u4_max_mbs_allowed = MAX_MBS_LEVEL_22;
  ------------------
  |  |  315|    669|#define MAX_MBS_LEVEL_22 1620
  ------------------
  525|    669|            break;
  526|  1.47k|        case H264_LEVEL_3_0:
  ------------------
  |  |  298|  1.47k|#define H264_LEVEL_3_0     30
  ------------------
  |  Branch (526:9): [True: 1.47k, False: 112k]
  ------------------
  527|  1.47k|            u4_max_mbs_allowed = MAX_MBS_LEVEL_30;
  ------------------
  |  |  314|  1.47k|#define MAX_MBS_LEVEL_30 1620
  ------------------
  528|  1.47k|            break;
  529|  6.62k|        case H264_LEVEL_3_1:
  ------------------
  |  |  299|  6.62k|#define H264_LEVEL_3_1     31
  ------------------
  |  Branch (529:9): [True: 6.62k, False: 107k]
  ------------------
  530|  6.62k|            u4_max_mbs_allowed = MAX_MBS_LEVEL_31;
  ------------------
  |  |  313|  6.62k|#define MAX_MBS_LEVEL_31 3600
  ------------------
  531|  6.62k|            break;
  532|  28.6k|        case H264_LEVEL_3_2:
  ------------------
  |  |  300|  28.6k|#define H264_LEVEL_3_2     32
  ------------------
  |  Branch (532:9): [True: 28.6k, False: 85.4k]
  ------------------
  533|  28.6k|            u4_max_mbs_allowed = MAX_MBS_LEVEL_32;
  ------------------
  |  |  312|  28.6k|#define MAX_MBS_LEVEL_32 5120
  ------------------
  534|  28.6k|            break;
  535|  5.47k|        case H264_LEVEL_4_0:
  ------------------
  |  |  301|  5.47k|#define H264_LEVEL_4_0     40
  ------------------
  |  Branch (535:9): [True: 5.47k, False: 108k]
  ------------------
  536|  5.47k|            u4_max_mbs_allowed = MAX_MBS_LEVEL_40;
  ------------------
  |  |  311|  5.47k|#define MAX_MBS_LEVEL_40 8192
  ------------------
  537|  5.47k|            break;
  538|  1.07k|        case H264_LEVEL_4_1:
  ------------------
  |  |  302|  1.07k|#define H264_LEVEL_4_1     41
  ------------------
  |  Branch (538:9): [True: 1.07k, False: 112k]
  ------------------
  539|  1.07k|            u4_max_mbs_allowed = MAX_MBS_LEVEL_41;
  ------------------
  |  |  310|  1.07k|#define MAX_MBS_LEVEL_41 8192
  ------------------
  540|  1.07k|            break;
  541|  3.49k|        case H264_LEVEL_4_2:
  ------------------
  |  |  303|  3.49k|#define H264_LEVEL_4_2     42
  ------------------
  |  Branch (541:9): [True: 3.49k, False: 110k]
  ------------------
  542|  3.49k|            u4_max_mbs_allowed = MAX_MBS_LEVEL_42;
  ------------------
  |  |  309|  3.49k|#define MAX_MBS_LEVEL_42 8704
  ------------------
  543|  3.49k|            break;
  544|    236|        case H264_LEVEL_5_0:
  ------------------
  |  |  304|    236|#define H264_LEVEL_5_0     50
  ------------------
  |  Branch (544:9): [True: 236, False: 113k]
  ------------------
  545|    236|            u4_max_mbs_allowed = MAX_MBS_LEVEL_50;
  ------------------
  |  |  308|    236|#define MAX_MBS_LEVEL_50 22080
  ------------------
  546|    236|            break;
  547|      1|        case H264_LEVEL_5_1:
  ------------------
  |  |  305|      1|#define H264_LEVEL_5_1     51
  ------------------
  |  Branch (547:9): [True: 1, False: 114k]
  ------------------
  548|  20.6k|        default:
  ------------------
  |  Branch (548:9): [True: 20.6k, False: 93.3k]
  ------------------
  549|  20.6k|            u4_max_mbs_allowed = MAX_MBS_LEVEL_51;
  ------------------
  |  |  307|  20.6k|#define MAX_MBS_LEVEL_51 36864
  ------------------
  550|  20.6k|            break;
  551|       |
  552|   114k|    }
  553|       |
  554|       |    /*correct of the level is incorrect*/
  555|   114k|    if(u4_total_mbs > u4_max_mbs_allowed)
  ------------------
  |  Branch (555:8): [True: 1.63k, False: 112k]
  ------------------
  556|  1.63k|    {
  557|  1.63k|        if(u4_total_mbs > MAX_MBS_LEVEL_50)
  ------------------
  |  |  308|  1.63k|#define MAX_MBS_LEVEL_50 22080
  ------------------
  |  Branch (557:12): [True: 81, False: 1.54k]
  ------------------
  558|     81|            u4_level_idc = H264_LEVEL_5_1;
  ------------------
  |  |  305|     81|#define H264_LEVEL_5_1     51
  ------------------
  559|  1.54k|        else if(u4_total_mbs > MAX_MBS_LEVEL_42)
  ------------------
  |  |  309|  1.54k|#define MAX_MBS_LEVEL_42 8704
  ------------------
  |  Branch (559:17): [True: 78, False: 1.47k]
  ------------------
  560|     78|            u4_level_idc = H264_LEVEL_5_0;
  ------------------
  |  |  304|     78|#define H264_LEVEL_5_0     50
  ------------------
  561|  1.47k|        else if(u4_total_mbs > MAX_MBS_LEVEL_41)
  ------------------
  |  |  310|  1.47k|#define MAX_MBS_LEVEL_41 8192
  ------------------
  |  Branch (561:17): [True: 163, False: 1.30k]
  ------------------
  562|    163|            u4_level_idc = H264_LEVEL_4_2;
  ------------------
  |  |  303|    163|#define H264_LEVEL_4_2     42
  ------------------
  563|  1.30k|        else if(u4_total_mbs > MAX_MBS_LEVEL_40)
  ------------------
  |  |  311|  1.30k|#define MAX_MBS_LEVEL_40 8192
  ------------------
  |  Branch (563:17): [True: 0, False: 1.30k]
  ------------------
  564|      0|            u4_level_idc = H264_LEVEL_4_1;
  ------------------
  |  |  302|      0|#define H264_LEVEL_4_1     41
  ------------------
  565|  1.30k|        else if(u4_total_mbs > MAX_MBS_LEVEL_32)
  ------------------
  |  |  312|  1.30k|#define MAX_MBS_LEVEL_32 5120
  ------------------
  |  Branch (565:17): [True: 114, False: 1.19k]
  ------------------
  566|    114|            u4_level_idc = H264_LEVEL_4_0;
  ------------------
  |  |  301|    114|#define H264_LEVEL_4_0     40
  ------------------
  567|  1.19k|        else if(u4_total_mbs > MAX_MBS_LEVEL_31)
  ------------------
  |  |  313|  1.19k|#define MAX_MBS_LEVEL_31 3600
  ------------------
  |  Branch (567:17): [True: 129, False: 1.06k]
  ------------------
  568|    129|            u4_level_idc = H264_LEVEL_3_2;
  ------------------
  |  |  300|    129|#define H264_LEVEL_3_2     32
  ------------------
  569|  1.06k|        else if(u4_total_mbs > MAX_MBS_LEVEL_30)
  ------------------
  |  |  314|  1.06k|#define MAX_MBS_LEVEL_30 1620
  ------------------
  |  Branch (569:17): [True: 144, False: 921]
  ------------------
  570|    144|            u4_level_idc = H264_LEVEL_3_1;
  ------------------
  |  |  299|    144|#define H264_LEVEL_3_1     31
  ------------------
  571|    921|        else if(u4_total_mbs > MAX_MBS_LEVEL_21)
  ------------------
  |  |  316|    921|#define MAX_MBS_LEVEL_21 792
  ------------------
  |  Branch (571:17): [True: 157, False: 764]
  ------------------
  572|    157|            u4_level_idc = H264_LEVEL_3_0;
  ------------------
  |  |  298|    157|#define H264_LEVEL_3_0     30
  ------------------
  573|    764|        else if(u4_total_mbs > MAX_MBS_LEVEL_20)
  ------------------
  |  |  317|    764|#define MAX_MBS_LEVEL_20 396
  ------------------
  |  Branch (573:17): [True: 551, False: 213]
  ------------------
  574|    551|            u4_level_idc = H264_LEVEL_2_1;
  ------------------
  |  |  296|    551|#define H264_LEVEL_2_1     21
  ------------------
  575|    213|        else if(u4_total_mbs > MAX_MBS_LEVEL_10)
  ------------------
  |  |  321|    213|#define MAX_MBS_LEVEL_10 99
  ------------------
  |  Branch (575:17): [True: 213, False: 0]
  ------------------
  576|    213|            u4_level_idc = H264_LEVEL_2_0;
  ------------------
  |  |  295|    213|#define H264_LEVEL_2_0     20
  ------------------
  577|  1.63k|    }
  578|       |
  579|   114k|    return (u4_level_idc);
  580|       |
  581|   114k|}

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

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

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

ih264d_form_pred_weight_matrix:
   90|  16.4k|{
   91|  16.4k|    dec_slice_params_t *ps_cur_slice;
   92|  16.4k|    UWORD8 uc_num_ref_idx_l0_active, uc_num_ref_idx_l1_active;
   93|  16.4k|    UWORD8 i, j;
   94|  16.4k|    UWORD32 *pu4_mat_iwt_ofst;
   95|  16.4k|    UWORD16 i2_idx;
   96|  16.4k|    UWORD32 *pui32_weight_offset_l0, *pui32_weight_offset_l1;
   97|  16.4k|    UWORD32 u4_temp;
   98|       |
   99|  16.4k|    ps_cur_slice = ps_dec->ps_cur_slice;
  100|  16.4k|    uc_num_ref_idx_l0_active = ps_cur_slice->u1_num_ref_idx_lx_active[0];
  101|  16.4k|    uc_num_ref_idx_l1_active = ps_cur_slice->u1_num_ref_idx_lx_active[1];
  102|       |
  103|  16.4k|    pu4_mat_iwt_ofst = ps_dec->pu4_wts_ofsts_mat;
  104|       |
  105|  16.4k|    if(ps_cur_slice->u1_slice_type == B_SLICE)
  ------------------
  |  |  369|  16.4k|#define B_SLICE  1
  ------------------
  |  Branch (105:8): [True: 3.86k, False: 12.6k]
  ------------------
  106|  3.86k|    {
  107|  12.2k|        for(i = 0; i < uc_num_ref_idx_l0_active; i++)
  ------------------
  |  Branch (107:20): [True: 8.40k, False: 3.86k]
  ------------------
  108|  8.40k|        {
  109|  8.40k|            pui32_weight_offset_l0 = ps_cur_slice->u4_wt_ofst_lx[0][i];
  110|  27.9k|            for(j = 0; j < uc_num_ref_idx_l1_active; j++)
  ------------------
  |  Branch (110:24): [True: 19.5k, False: 8.40k]
  ------------------
  111|  19.5k|            {
  112|  19.5k|                pui32_weight_offset_l1 = ps_cur_slice->u4_wt_ofst_lx[1][j];
  113|  19.5k|                i2_idx = i * uc_num_ref_idx_l0_active + j;
  114|  19.5k|                i2_idx = X3(i2_idx);
  ------------------
  |  |   92|  19.5k|#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.5k|                pu4_mat_iwt_ofst[0] = pui32_weight_offset_l0[0];
  123|  19.5k|                pu4_mat_iwt_ofst[1] = pui32_weight_offset_l1[0];
  124|  19.5k|                pu4_mat_iwt_ofst[2] = pui32_weight_offset_l0[1];
  125|  19.5k|                pu4_mat_iwt_ofst[3] = pui32_weight_offset_l1[1];
  126|  19.5k|                pu4_mat_iwt_ofst[4] = pui32_weight_offset_l0[2];
  127|  19.5k|                pu4_mat_iwt_ofst[5] = pui32_weight_offset_l1[2];
  128|  19.5k|                pu4_mat_iwt_ofst += 6;
  129|  19.5k|            }
  130|  8.40k|        }
  131|  3.86k|    }
  132|  12.6k|    else
  133|  12.6k|    {
  134|  33.0k|        for(i = 0; i < uc_num_ref_idx_l0_active; i++)
  ------------------
  |  Branch (134:20): [True: 20.3k, False: 12.6k]
  ------------------
  135|  20.3k|        {
  136|  20.3k|            pui32_weight_offset_l0 = ps_cur_slice->u4_wt_ofst_lx[0][i];
  137|  20.3k|            i2_idx = X3(i);
  ------------------
  |  |   92|  20.3k|#define X3(a)   (((a) << 1) + (a))
  ------------------
  138|  20.3k|            u4_temp = (UWORD32)pui32_weight_offset_l0[0];
  139|  20.3k|            pu4_mat_iwt_ofst[0] = u4_temp;
  140|  20.3k|            u4_temp = (UWORD32)pui32_weight_offset_l0[1];
  141|  20.3k|            pu4_mat_iwt_ofst[2] = u4_temp;
  142|  20.3k|            u4_temp = (UWORD32)pui32_weight_offset_l0[2];
  143|  20.3k|            pu4_mat_iwt_ofst[4] = u4_temp;
  144|  20.3k|            pu4_mat_iwt_ofst += 6;
  145|  20.3k|        }
  146|  12.6k|    }
  147|  16.4k|}
ih264d_end_of_pic_dispbuf_mgr:
  750|   125k|{
  751|   125k|    dec_slice_params_t *ps_cur_slice = ps_dec->ps_cur_slice;
  752|   125k|    UWORD8 u1_num_of_users = 0;
  753|   125k|    WORD32 ret;
  754|       |
  755|   125k|    H264_MUTEX_LOCK(&ps_dec->process_disp_mutex);
  756|   125k|    if(1)
  ------------------
  |  Branch (756:8): [True: 125k, Folded]
  ------------------
  757|   125k|    {
  758|       |
  759|   125k|        {
  760|   125k|            ih264d_delete_nonref_nondisplay_pics(ps_dec->ps_dpb_mgr);
  761|   125k|            if(ps_cur_slice->u1_mmco_equalto5
  ------------------
  |  Branch (761:16): [True: 2.55k, False: 123k]
  ------------------
  762|   123k|                            || (ps_cur_slice->u1_nal_unit_type == IDR_SLICE_NAL))
  ------------------
  |  |  328|   123k|#define IDR_SLICE_NAL                   5
  ------------------
  |  Branch (762:32): [True: 104k, False: 18.6k]
  ------------------
  763|   107k|            {
  764|   107k|                ps_dec->ps_cur_pic->i4_poc = 0;
  765|   107k|                if(ps_dec->u4_total_mbs_coded
  ------------------
  |  Branch (765:20): [True: 107k, False: 101]
  ------------------
  766|   107k|                                == (ps_dec->ps_cur_sps->u4_max_mb_addr + 1))
  767|   107k|                    ih264d_reset_ref_bufs(ps_dec->ps_dpb_mgr);
  768|   107k|                ih264d_release_display_bufs(ps_dec);
  769|   107k|            }
  770|   125k|            if(IVD_DECODE_FRAME_OUT != ps_dec->e_frm_out_mode)
  ------------------
  |  Branch (770:16): [True: 125k, False: 0]
  ------------------
  771|   125k|            {
  772|   125k|                ret = ih264d_assign_display_seq(ps_dec);
  773|   125k|                if(ret != OK)
  ------------------
  |  |  114|   125k|#define OK        0
  ------------------
  |  Branch (773:20): [True: 0, False: 125k]
  ------------------
  774|      0|                    return ret;
  775|   125k|            }
  776|   125k|        }
  777|       |
  778|   125k|        if(ps_cur_slice->u1_nal_ref_idc)
  ------------------
  |  Branch (778:12): [True: 109k, False: 16.5k]
  ------------------
  779|   109k|        {
  780|       |            /* Mark pic buf as needed for reference */
  781|   109k|            ih264_buf_mgr_set_status((buf_mgr_t *)ps_dec->pv_pic_buf_mgr,
  782|   109k|                                     ps_dec->u1_pic_buf_id,
  783|   109k|                                     BUF_MGR_REF);
  ------------------
  |  |   50|   109k|#define BUF_MGR_REF          (1 << 2)
  ------------------
  784|       |            /* Mark mv buf as needed for reference */
  785|   109k|            ih264_buf_mgr_set_status((buf_mgr_t *)ps_dec->pv_mv_buf_mgr,
  786|   109k|                                     ps_dec->as_buf_id_info_map[ps_dec->u1_pic_buf_id].mv_buf_id,
  787|   109k|                                     BUF_MGR_REF);
  ------------------
  |  |   50|   109k|#define BUF_MGR_REF          (1 << 2)
  ------------------
  788|   109k|            ps_dec->au1_pic_buf_ref_flag[ps_dec->u1_pic_buf_id] = 1;
  789|   109k|        }
  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|   125k|        if(((0 == ps_dec->u1_last_pic_not_decoded)
  ------------------
  |  Branch (794:13): [True: 125k, False: 0]
  ------------------
  795|   125k|                        && (0
  ------------------
  |  Branch (795:28): [True: 125k, False: 0]
  ------------------
  796|   125k|                                        == (ps_dec->ps_cur_pic->u4_pack_slc_typ
  797|   125k|                                                        & 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|   125k|        {
  800|       |            /* Mark pic buf as needed for display */
  801|   125k|            ih264_buf_mgr_set_status((buf_mgr_t *)ps_dec->pv_pic_buf_mgr,
  802|   125k|                                     ps_dec->u1_pic_buf_id,
  803|   125k|                                     BUF_MGR_IO);
  ------------------
  |  |   53|   125k|#define BUF_MGR_IO           (1 << 3)
  ------------------
  804|       |
  805|   125k|        }
  806|       |
  807|   125k|        if(!ps_cur_slice->u1_field_pic_flag
  ------------------
  |  Branch (807:12): [True: 125k, False: 0]
  ------------------
  808|      0|                        || ((TOP_FIELD_ONLY | BOT_FIELD_ONLY)
  ------------------
  |  |   65|      0|#define TOP_FIELD_ONLY      0x02
  ------------------
                                      || ((TOP_FIELD_ONLY | BOT_FIELD_ONLY)
  ------------------
  |  |   66|      0|#define BOT_FIELD_ONLY      0x01
  ------------------
  |  Branch (808:28): [True: 0, False: 0]
  ------------------
  809|      0|                                        != ps_dec->u1_top_bottom_decoded))
  810|   125k|        {
  811|   125k|            pic_buffer_t *ps_cur_pic = ps_dec->ps_cur_pic;
  812|   125k|            ps_cur_pic->u2_disp_width = ps_dec->u2_disp_width;
  813|   125k|            ps_cur_pic->u2_disp_height = ps_dec->u2_disp_height >> 1;
  814|       |
  815|   125k|            ps_cur_pic->u2_crop_offset_y = ps_dec->u2_crop_offset_y;
  816|   125k|            ps_cur_pic->u2_crop_offset_uv = ps_dec->u2_crop_offset_uv;
  817|   125k|            ps_cur_pic->u1_pic_type = 0;
  818|   125k|            {
  819|   125k|                WORD64 i8_display_poc;
  820|   125k|                i8_display_poc = (WORD64)ps_dec->i4_prev_max_display_seq +
  821|   125k|                            ps_dec->ps_cur_pic->i4_poc;
  822|   125k|                if(IS_OUT_OF_RANGE_S32(i8_display_poc))
  ------------------
  |  |   58|   125k|#define IS_OUT_OF_RANGE_S32(a) (((a) < INT32_MIN) || ((a) > INT32_MAX))
  |  |  ------------------
  |  |  |  Branch (58:33): [True: 0, False: 125k]
  |  |  |  Branch (58:54): [True: 277, False: 125k]
  |  |  ------------------
  ------------------
  823|    277|                {
  824|    277|                    ps_dec->i4_prev_max_display_seq = 0;
  825|    277|                }
  826|   125k|            }
  827|   125k|            ret = ih264d_insert_pic_in_display_list(
  828|   125k|                            ps_dec->ps_dpb_mgr,
  829|   125k|                            ps_dec->u1_pic_buf_id,
  830|   125k|                            ps_dec->i4_prev_max_display_seq
  831|   125k|                                            + ps_dec->ps_cur_pic->i4_poc,
  832|   125k|                            ps_dec->ps_cur_pic->i4_frame_num);
  833|   125k|            if(ret != OK)
  ------------------
  |  |  114|   125k|#define OK        0
  ------------------
  |  Branch (833:16): [True: 0, False: 125k]
  ------------------
  834|      0|                return ret;
  835|       |
  836|   125k|            {
  837|   125k|                ivd_video_decode_op_t * ps_dec_output =
  838|   125k|                                (ivd_video_decode_op_t *)ps_dec->pv_dec_out;
  839|       |
  840|   125k|                ps_dec_output->u4_frame_decoded_flag = 1;
  841|   125k|            }
  842|   125k|            if(ps_dec->au1_pic_buf_ref_flag[ps_dec->u1_pic_buf_id] == 0)
  ------------------
  |  Branch (842:16): [True: 16.5k, False: 109k]
  ------------------
  843|  16.5k|            {
  844|  16.5k|                ih264_buf_mgr_release((buf_mgr_t *)ps_dec->pv_mv_buf_mgr,
  845|  16.5k|                                      ps_dec->as_buf_id_info_map[ps_dec->u1_pic_buf_id].mv_buf_id,
  846|  16.5k|                                      BUF_MGR_REF);
  ------------------
  |  |   50|  16.5k|#define BUF_MGR_REF          (1 << 2)
  ------------------
  847|  16.5k|                ps_dec->au1_pic_buf_ref_flag[ps_dec->u1_pic_buf_id] = 0;
  848|       |
  849|  16.5k|            }
  850|   125k|        }
  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|   125k|        if(!ps_cur_slice->u1_field_pic_flag
  ------------------
  |  Branch (858:12): [True: 125k, False: 0]
  ------------------
  859|      0|                        || ((TOP_FIELD_ONLY | BOT_FIELD_ONLY)
  ------------------
  |  |   65|      0|#define TOP_FIELD_ONLY      0x02
  ------------------
                                      || ((TOP_FIELD_ONLY | BOT_FIELD_ONLY)
  ------------------
  |  |   66|      0|#define BOT_FIELD_ONLY      0x01
  ------------------
  |  Branch (859:28): [True: 0, False: 0]
  ------------------
  860|      0|                                        == ps_dec->u1_top_bottom_decoded))
  861|   125k|        {
  862|   125k|            if(IVD_DECODE_FRAME_OUT == ps_dec->e_frm_out_mode)
  ------------------
  |  Branch (862:16): [True: 0, False: 125k]
  ------------------
  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|   125k|        }
  869|   125k|    }
  870|       |
  871|   125k|    H264_MUTEX_UNLOCK(&ps_dec->process_disp_mutex);
  872|       |
  873|   125k|    return OK;
  ------------------
  |  |  114|   125k|#define OK        0
  ------------------
  874|   125k|}
ih264d_deblock_picture:
  894|   125k|{
  895|   125k|    dec_struct_t *ps_dec = (dec_struct_t *)ptr;
  896|       |
  897|   125k|    {
  898|       |        /*Deblock picture only if all the mb's in the frame have been decoded*/
  899|   125k|        if(ps_dec->u1_pic_decode_done == 1)
  ------------------
  |  Branch (899:12): [True: 125k, False: 101]
  ------------------
  900|   125k|        {
  901|   125k|            if(ps_dec->ps_cur_slice->u1_mbaff_frame_flag
  ------------------
  |  Branch (901:16): [True: 0, False: 125k]
  ------------------
  902|   125k|                            || ps_dec->ps_cur_slice->u1_field_pic_flag)
  ------------------
  |  Branch (902:32): [True: 0, False: 125k]
  ------------------
  903|      0|            {
  904|      0|                ps_dec->p_DeblockPicture[ps_dec->ps_cur_slice->u1_mbaff_frame_flag](
  905|      0|                                ps_dec);
  906|      0|            }
  907|   125k|            else
  908|       |
  909|   125k|            {
  910|       |
  911|   125k|                ih264d_deblock_picture_progressive(ps_dec);
  912|   125k|            }
  913|       |
  914|   125k|        }
  915|   125k|    }
  916|       |
  917|   125k|}
ih264d_deblock_display:
  930|   125k|{
  931|   125k|    WORD32 ret;
  932|       |    /* Call deblocking */
  933|   125k|    ih264d_deblock_picture(ps_dec);
  934|       |
  935|   125k|    ret = ih264d_end_of_pic_dispbuf_mgr(ps_dec);
  936|   125k|    if(ret != OK)
  ------------------
  |  |  114|   125k|#define OK        0
  ------------------
  |  Branch (936:8): [True: 0, False: 125k]
  ------------------
  937|      0|        return ret;
  938|       |
  939|   125k|    return OK;
  ------------------
  |  |  114|   125k|#define OK        0
  ------------------
  940|   125k|}
ih264d_end_of_pic:
  956|   125k|{
  957|   125k|    dec_slice_params_t *ps_cur_slice = ps_dec->ps_cur_slice;
  958|   125k|    WORD32 ret;
  959|       |
  960|   125k|    {
  961|   125k|        dec_err_status_t * ps_err = ps_dec->ps_dec_err_status;
  962|   125k|        if(ps_err->u1_err_flag & REJECT_CUR_PIC)
  ------------------
  |  |  602|   125k|#define REJECT_CUR_PIC    (0x01)
  ------------------
  |  Branch (962:12): [True: 0, False: 125k]
  ------------------
  963|      0|        {
  964|      0|            ih264d_err_pic_dispbuf_mgr(ps_dec);
  965|      0|            return ERROR_NEW_FRAME_EXPECTED;
  966|      0|        }
  967|   125k|    }
  968|       |
  969|   125k|    H264_MUTEX_LOCK(&ps_dec->process_disp_mutex);
  970|   125k|    ret = ih264d_end_of_pic_processing(ps_dec);
  971|   125k|    if(ret != OK)
  ------------------
  |  |  114|   125k|#define OK        0
  ------------------
  |  Branch (971:8): [True: 0, False: 125k]
  ------------------
  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|   125k|    H264_MUTEX_UNLOCK(&ps_dec->process_disp_mutex);
  979|       |
  980|   125k|    return OK;
  ------------------
  |  |  114|   125k|#define OK        0
  ------------------
  981|   125k|}
ih264d_fix_error_in_dpb:
  997|   135k|{
  998|       |    /*--------------------------------------------------------------------*/
  999|       |    /* If there is common node in lt_list and st_list then delete it from */
 1000|       |    /* st_list                                                            */
 1001|       |    /*--------------------------------------------------------------------*/
 1002|   135k|    UWORD8 no_of_nodes_deleted = 0;
 1003|   135k|    UWORD8 lt_ref_num = ps_dec->ps_dpb_mgr->u1_num_lt_ref_bufs;
 1004|   135k|    struct dpb_info_t *ps_lt_curr_dpb = ps_dec->ps_dpb_mgr->ps_dpb_ht_head;
 1005|   152k|    while(lt_ref_num && ps_lt_curr_dpb)
  ------------------
  |  Branch (1005:11): [True: 16.9k, False: 135k]
  |  Branch (1005:25): [True: 16.9k, False: 0]
  ------------------
 1006|  16.9k|    {
 1007|  16.9k|        if(ps_dec->ps_dpb_mgr->ps_dpb_st_head
  ------------------
  |  Branch (1007:12): [True: 2.01k, False: 14.8k]
  ------------------
 1008|  2.01k|                && ((ps_lt_curr_dpb->s_bot_field.u1_reference_info
  ------------------
  |  Branch (1008:20): [True: 0, False: 2.01k]
  ------------------
 1009|  2.01k|                        | ps_lt_curr_dpb->s_top_field.u1_reference_info)
 1010|  2.01k|                        == (IS_SHORT_TERM | IS_LONG_TERM)))
  ------------------
  |  |  596|  2.01k|#define IS_SHORT_TERM  1
  ------------------
                                      == (IS_SHORT_TERM | IS_LONG_TERM)))
  ------------------
  |  |  597|  2.01k|#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|  16.9k|        ps_lt_curr_dpb = ps_lt_curr_dpb->ps_prev_long;
 1039|  16.9k|        lt_ref_num--;
 1040|  16.9k|    }
 1041|   135k|    return no_of_nodes_deleted;
 1042|   135k|}

ih264d_decode_spatial_direct:
   75|   496k|{
   76|   496k|    mv_pred_t s_mv_pred, *ps_mv;
   77|   496k|    UWORD32 u4_sub_mb_num;
   78|   496k|    UWORD8 u1_col_zero_flag, u1_direct_zero_pred_flag = 0;
   79|   496k|    UWORD8 u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
   80|   496k|    mv_pred_t *ps_mv_ntop_start;
   81|   496k|    mv_pred_t *ps_mv_nmb_start = ps_dec->ps_mv_cur + (u4_mb_num << 4);
   82|   496k|    UWORD8 partition_size, sub_partition, u1_mb_partw, u1_mb_parth;
   83|   496k|    UWORD8 i;
   84|   496k|    WORD8 i1_pred, i1_ref_frame0, i1_ref_frame1;
   85|   496k|    struct pic_buffer_t *ps_ref_frame = NULL, *ps_col_pic, *ps_pic_buff0 = NULL,
   86|   496k|                    *ps_pic_buff1 = NULL;
   87|       |
   88|   496k|    UWORD8 u1_zero_pred_cond_f, u1_zero_pred_cond_b;
   89|   496k|    WORD16 i2_def_mv[2], i2_spat_pred_mv[4], *pi2_final_mv0, *pi2_final_mv1;
   90|   496k|    UWORD16 ui2_mask_fwd = 0, ui2_mask_bwd = 0, u2_mask = 0;
   91|   496k|    UWORD32 *pui32_weight_ofsts = NULL;
   92|   496k|    directmv_t s_mvdirect;
   93|   496k|    UWORD8 u1_colz;
   94|   496k|    UWORD8 u1_final_ref_idx = 0;
   95|   496k|    const UWORD8 *pu1_mb_parth = (const UWORD8 *)gau1_ih264d_mb_parth;
   96|   496k|    const UWORD8 *pu1_mb_partw = (const UWORD8 *)gau1_ih264d_mb_partw;
   97|   496k|    const UWORD16 sub_mask_table[] =
   98|   496k|        { 0x33, 0x3, 0x11, 0x1 };
   99|   496k|    const UWORD16 mask_table[] =
  100|   496k|        { 0xffff, /*16x16 NA */
  101|   496k|          0xff, /* 16x8*/
  102|   496k|          0x3333, /* 8x16*/
  103|   496k|          0x33 };/* 8x8*/
  104|   496k|    mv_pred_t s_temp_mv_pred;
  105|   496k|    WORD32 ret = 0;
  106|       |
  107|       |    /* CHANGED CODE */
  108|   496k|    ps_mv_ntop_start = ps_dec->ps_mv_cur + (u4_mb_num << 4)
  109|   496k|                    - (ps_dec->u2_frm_wd_in_mbs << (4 + u1_mbaff)) + 12;
  110|       |
  111|       |    /* assign default values for MotionVector as zero */
  112|   496k|    i2_def_mv[0] = 0;
  113|   496k|    i2_def_mv[1] = 0;
  114|       |
  115|   496k|    u1_direct_zero_pred_flag = ps_dec->pf_mvpred(ps_dec, ps_cur_mb_info, ps_mv_nmb_start,
  116|   496k|                                              ps_mv_ntop_start, &s_mv_pred, 0, 4,
  117|   496k|                                              0, 1, B_DIRECT_SPATIAL);
  ------------------
  |  |  489|   496k|#define B_DIRECT_SPATIAL  26
  ------------------
  118|       |
  119|   496k|    i2_spat_pred_mv[0] = s_mv_pred.i2_mv[0];
  120|   496k|    i2_spat_pred_mv[1] = s_mv_pred.i2_mv[1];
  121|   496k|    i2_spat_pred_mv[2] = s_mv_pred.i2_mv[2];
  122|   496k|    i2_spat_pred_mv[3] = s_mv_pred.i2_mv[3];
  123|       |
  124|   496k|    i1_ref_frame0 = s_mv_pred.i1_ref_frame[0];
  125|   496k|    i1_ref_frame1 = s_mv_pred.i1_ref_frame[1];
  126|       |
  127|   496k|    i1_ref_frame0 = (i1_ref_frame0 < 0) ? -1 : i1_ref_frame0;
  ------------------
  |  Branch (127:21): [True: 42.3k, False: 454k]
  ------------------
  128|   496k|    i1_ref_frame1 = (i1_ref_frame1 < 0) ? -1 : i1_ref_frame1;
  ------------------
  |  Branch (128:21): [True: 15.6k, False: 481k]
  ------------------
  129|       |
  130|   496k|    i1_pred = 0;
  131|       |
  132|   496k|    {
  133|   496k|        WORD8 u1_ref_idx, u1_ref_idx1;
  134|   496k|        UWORD32 uc_Idx, uc_Idx1;
  135|   496k|        UWORD8 u1_scale_ref = (ps_dec->ps_cur_slice->u1_mbaff_frame_flag
  ------------------
  |  Branch (135:32): [True: 0, False: 496k]
  ------------------
  136|      0|                        && ps_cur_mb_info->u1_mb_field_decodingflag);
  ------------------
  |  Branch (136:28): [True: 0, False: 0]
  ------------------
  137|   496k|        u1_final_ref_idx = i1_ref_frame0;
  138|   496k|        if(i1_ref_frame0 >= 0)
  ------------------
  |  Branch (138:12): [True: 454k, False: 42.3k]
  ------------------
  139|   454k|        {
  140|       |            /* convert RefIdx if it is MbAff */
  141|   454k|            u1_ref_idx = i1_ref_frame0;
  142|   454k|            u1_ref_idx1 = i1_ref_frame0;
  143|   454k|            if(u1_scale_ref)
  ------------------
  |  Branch (143:16): [True: 0, False: 454k]
  ------------------
  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|   454k|            ps_pic_buff0 = ps_dec->ps_ref_pic_buf_lx[0][u1_ref_idx1];
  151|   454k|            ps_ref_frame = ps_pic_buff0;
  152|   454k|            i1_pred = PRED_L0;
  ------------------
  |  |  483|   454k|#define PRED_L0   1
  ------------------
  153|   454k|        }
  154|       |
  155|   496k|        if(i1_ref_frame1 >= 0)
  ------------------
  |  Branch (155:12): [True: 481k, False: 15.6k]
  ------------------
  156|   481k|        {
  157|       |            /* convert RefIdx if it is MbAff */
  158|   481k|            u1_ref_idx = i1_ref_frame1;
  159|   481k|            u1_ref_idx1 = i1_ref_frame1;
  160|   481k|            if(u1_scale_ref)
  ------------------
  |  Branch (160:16): [True: 0, False: 481k]
  ------------------
  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|   481k|            ps_pic_buff1 = ps_dec->ps_ref_pic_buf_lx[1][u1_ref_idx1];
  167|   481k|            i1_pred = i1_pred | PRED_L1;
  ------------------
  |  |  484|   481k|#define PRED_L1   2
  ------------------
  168|   481k|        }
  169|   496k|        if(i1_ref_frame0 < 0)
  ------------------
  |  Branch (169:12): [True: 42.3k, False: 454k]
  ------------------
  170|  42.3k|        {
  171|  42.3k|            ps_ref_frame = ps_pic_buff1;
  172|  42.3k|            u1_final_ref_idx = i1_ref_frame1;
  173|  42.3k|        }
  174|       |
  175|   496k|        u1_zero_pred_cond_f = (u1_direct_zero_pred_flag) || (i1_ref_frame0 < 0);
  ------------------
  |  Branch (175:31): [True: 9.35k, False: 487k]
  |  Branch (175:61): [True: 42.3k, False: 445k]
  ------------------
  176|   496k|        u1_zero_pred_cond_b = (u1_direct_zero_pred_flag) || (i1_ref_frame1 < 0);
  ------------------
  |  Branch (176:31): [True: 9.35k, False: 487k]
  |  Branch (176:61): [True: 15.6k, False: 471k]
  ------------------
  177|       |
  178|   496k|        if(ps_dec->ps_cur_pps->u1_wted_bipred_idc)
  ------------------
  |  Branch (178:12): [True: 378k, False: 118k]
  ------------------
  179|   378k|        {
  180|   378k|            uc_Idx = ((i1_ref_frame0 < 1) ? 0 : i1_ref_frame0)
  ------------------
  |  Branch (180:23): [True: 375k, False: 3.05k]
  ------------------
  181|   378k|                            * ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[1];
  182|   378k|            if(u1_scale_ref)
  ------------------
  |  Branch (182:16): [True: 0, False: 378k]
  ------------------
  183|      0|                uc_Idx >>= 1;
  184|   378k|            uc_Idx1 = (i1_ref_frame1 < 0) ? 0 : i1_ref_frame1;
  ------------------
  |  Branch (184:23): [True: 9.56k, False: 368k]
  ------------------
  185|   378k|            uc_Idx += (u1_scale_ref) ? (uc_Idx1 >> 1) : uc_Idx1;
  ------------------
  |  Branch (185:23): [True: 0, False: 378k]
  ------------------
  186|   378k|            pui32_weight_ofsts =
  187|   378k|                            (UWORD32*)&ps_dec->pu4_wt_ofsts[2 * X3(uc_Idx)];
  ------------------
  |  |   92|   378k|#define X3(a)   (((a) << 1) + (a))
  ------------------
  188|       |
  189|   378k|            if(i1_ref_frame0 < 0)
  ------------------
  |  Branch (189:16): [True: 37.8k, False: 340k]
  ------------------
  190|  37.8k|                pui32_weight_ofsts += 1;
  191|       |
  192|   378k|            if(u1_scale_ref && (ps_dec->ps_cur_pps->u1_wted_bipred_idc == 2))
  ------------------
  |  Branch (192:16): [True: 0, False: 378k]
  |  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|   378k|        }
  209|   496k|    }
  210|       |
  211|   496k|    s_temp_mv_pred.i1_ref_frame[0] = i1_ref_frame0;
  212|   496k|    s_temp_mv_pred.i1_ref_frame[1] = i1_ref_frame1;
  213|   496k|    s_temp_mv_pred.u1_col_ref_pic_idx = ps_ref_frame->u1_mv_buf_id;
  214|   496k|    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|   496k|    ps_dec->pf_parse_mvdirect(ps_dec, ps_dec->ps_col_pic, &s_mvdirect, u1_wd_x,
  222|   496k|                           ps_dec->i4_submb_ofst, ps_cur_mb_info);
  223|   496k|    ps_col_pic = ps_dec->ps_col_pic;
  224|   496k|    if((s_mvdirect.u1_col_zeroflag_change == 0) || u1_direct_zero_pred_flag)
  ------------------
  |  Branch (224:8): [True: 494k, False: 2.65k]
  |  Branch (224:52): [True: 84, False: 2.57k]
  ------------------
  225|   494k|    {
  226|   494k|        WORD16 i2_mv_x, i2_mv_y, i2_mvX1, i2_mvY1;
  227|       |        /* Most probable case */
  228|   494k|        u1_col_zero_flag = *(ps_col_pic->pu1_col_zero_flag
  229|   494k|                        + s_mvdirect.i4_mv_indices[0]);
  230|   494k|        u1_col_zero_flag = u1_col_zero_flag & 0x01;
  231|       |
  232|   494k|        if(u1_zero_pred_cond_f || ((i1_ref_frame0 == 0) && (u1_col_zero_flag == 1)))
  ------------------
  |  Branch (232:12): [True: 50.9k, False: 443k]
  |  Branch (232:36): [True: 440k, False: 3.09k]
  |  Branch (232:60): [True: 188k, False: 251k]
  ------------------
  233|   239k|        {
  234|   239k|            i2_mv_x = 0;
  235|   239k|            i2_mv_y = 0;
  236|   239k|        }
  237|   255k|        else
  238|   255k|        {
  239|   255k|            i2_mv_x = i2_spat_pred_mv[0];
  240|   255k|            i2_mv_y = i2_spat_pred_mv[1];
  241|       |
  242|   255k|        }
  243|       |
  244|   494k|        if(u1_zero_pred_cond_b || ((i1_ref_frame1 == 0) && (u1_col_zero_flag == 1)))
  ------------------
  |  Branch (244:12): [True: 24.5k, False: 469k]
  |  Branch (244:36): [True: 465k, False: 3.80k]
  |  Branch (244:60): [True: 189k, False: 276k]
  ------------------
  245|   214k|        {
  246|   214k|            i2_mvX1 = 0;
  247|   214k|            i2_mvY1 = 0;
  248|   214k|        }
  249|   279k|        else
  250|   279k|        {
  251|   279k|            i2_mvX1 = i2_spat_pred_mv[2];
  252|   279k|            i2_mvY1 = i2_spat_pred_mv[3];
  253|   279k|        }
  254|       |
  255|   494k|        u4_sub_mb_num = ps_dec->u1_sub_mb_num;
  256|   494k|        u1_mb_partw = (u1_wd_x >> 2);
  257|       |
  258|       |
  259|   494k|        if(i1_ref_frame0 >= 0)
  ------------------
  |  Branch (259:12): [True: 452k, False: 41.6k]
  ------------------
  260|   452k|        {
  261|   452k|            {
  262|   452k|               pred_info_pkd_t *ps_pred_pkd;
  263|   452k|               WORD16 i2_mv[2];
  264|   452k|               WORD8 i1_ref_idx= 0;
  265|       |
  266|   452k|               i2_mv[0] = i2_mv_x;
  267|   452k|               i2_mv[1] = i2_mv_y;
  268|       |
  269|   452k|               ps_pred_pkd = ps_dec->ps_pred_pkd + ps_dec->u4_pred_info_pkd_idx;
  270|   452k|            ih264d_fill_pred_info(i2_mv,u1_mb_partw,u1_mb_partw,u4_sub_mb_num,i1_pred,
  271|   452k|                            ps_pred_pkd,ps_pic_buff0->u1_pic_buf_id,i1_ref_idx,pui32_weight_ofsts,
  272|   452k|                            ps_pic_buff0->u1_pic_type);
  273|   452k|            ps_dec->u4_pred_info_pkd_idx++;
  274|   452k|            ps_cur_mb_info->u1_num_pred_parts++;
  275|       |
  276|       |
  277|   452k|            }
  278|       |
  279|   452k|        }
  280|       |
  281|   494k|        if(i1_ref_frame1 >= 0)
  ------------------
  |  Branch (281:12): [True: 479k, False: 15.2k]
  ------------------
  282|   479k|        {
  283|   479k|            {
  284|   479k|                pred_info_pkd_t *ps_pred_pkd;
  285|   479k|               WORD16 i2_mv[2];
  286|   479k|               WORD8 i1_ref_idx= 0;
  287|       |
  288|   479k|               i2_mv[0] = i2_mvX1;
  289|   479k|               i2_mv[1] = i2_mvY1;
  290|       |
  291|   479k|               ps_pred_pkd = ps_dec->ps_pred_pkd + ps_dec->u4_pred_info_pkd_idx;
  292|   479k|            ih264d_fill_pred_info(i2_mv,u1_mb_partw,u1_mb_partw,u4_sub_mb_num,i1_pred,
  293|   479k|                            ps_pred_pkd,ps_pic_buff1->u1_pic_buf_id,i1_ref_idx,pui32_weight_ofsts,
  294|   479k|                            ps_pic_buff1->u1_pic_type);
  295|   479k|            ps_dec->u4_pred_info_pkd_idx++;
  296|   479k|            ps_cur_mb_info->u1_num_pred_parts++;
  297|       |
  298|       |
  299|   479k|            }
  300|   479k|        }
  301|       |
  302|       |
  303|       |        /* Replication optimisation */
  304|   494k|        s_temp_mv_pred.i2_mv[0] = i2_mv_x;
  305|   494k|        s_temp_mv_pred.i2_mv[1] = i2_mv_y;
  306|   494k|        s_temp_mv_pred.i2_mv[2] = i2_mvX1;
  307|   494k|        s_temp_mv_pred.i2_mv[3] = i2_mvY1;
  308|       |
  309|       |        /* Calculating colocated zero information */
  310|   494k|        {
  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|   494k|            UWORD8 u1_packed_mb_sub_mb_mode = (u1_mb_partw == 2) ? 0x03 : 0;
  ------------------
  |  Branch (321:47): [True: 3.04k, False: 491k]
  ------------------
  322|       |
  323|   494k|            if(i1_ref_frame0 < 0)
  ------------------
  |  Branch (323:16): [True: 41.6k, False: 452k]
  ------------------
  324|  41.6k|            {
  325|  41.6k|                i2_mv_x = i2_mvX1;
  326|  41.6k|                i2_mv_y = i2_mvY1;
  327|  41.6k|            }
  328|       |
  329|       |            /* Change from left shift 4 to 6 - Varun */
  330|   494k|            u1_colz = (ps_cur_mb_info->u1_mb_field_decodingflag << 1)
  331|   494k|                            | ((u1_final_ref_idx == 0) && (ABS(i2_mv_x) <= 1)
  ------------------
  |  |  100|   490k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 78.7k, False: 412k]
  |  |  ------------------
  ------------------
  |  Branch (331:32): [True: 490k, False: 3.50k]
  |  Branch (331:59): [True: 399k, False: 91.6k]
  ------------------
  332|   399k|                                            && (ABS(i2_mv_y) <= 1));
  ------------------
  |  |  100|   399k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 35.8k, False: 363k]
  |  |  ------------------
  ------------------
  |  Branch (332:48): [True: 357k, False: 41.9k]
  ------------------
  333|   494k|            u1_colz |= (u1_packed_mb_sub_mb_mode << 6);
  334|   494k|        }
  335|   494k|        ps_mv = ps_mv_nmb_start + u4_sub_mb_num;
  336|   494k|        ih264d_rep_mv_colz(ps_dec, &s_temp_mv_pred, ps_mv, u4_sub_mb_num, u1_colz,
  337|   494k|                           u1_mb_partw, u1_mb_partw);
  338|   494k|        if(u1_wd_x == MB_SIZE)
  ------------------
  |  |  554|   494k|#define MB_SIZE             16
  ------------------
  |  Branch (338:12): [True: 491k, False: 3.04k]
  ------------------
  339|   491k|            ps_dec->u1_currB_type = 0;
  340|       |
  341|       |
  342|       |
  343|   494k|        return OK;
  ------------------
  |  |  114|   494k|#define OK        0
  ------------------
  344|   494k|    }
  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.57k|    if((u1_wd_x == MB_SIZE) && (s_mvdirect.i1_num_partitions > 2))
  ------------------
  |  |  554|  2.57k|#define MB_SIZE             16
  ------------------
  |  Branch (353:8): [True: 2.48k, False: 89]
  |  Branch (353:32): [True: 1.50k, False: 978]
  ------------------
  354|  1.50k|    {
  355|  1.50k|        ps_cur_mb_info->u1_Mux = 1;
  356|  1.50k|        if(i1_ref_frame0 >= 0)
  ------------------
  |  Branch (356:12): [True: 1.22k, False: 284]
  ------------------
  357|  1.22k|        {
  358|       |
  359|  1.22k|            {
  360|  1.22k|                pred_info_pkd_t *ps_pred_pkd;
  361|  1.22k|               WORD8 i1_ref_idx= 0;
  362|       |
  363|  1.22k|               ps_pred_pkd = ps_dec->ps_pred_pkd + ps_dec->u4_pred_info_pkd_idx;
  364|  1.22k|            ih264d_fill_pred_info(&(i2_spat_pred_mv[0]),4,4,0,i1_pred,
  365|  1.22k|                            ps_pred_pkd,ps_pic_buff0->u1_pic_buf_id,i1_ref_idx,pui32_weight_ofsts,
  366|  1.22k|                            ps_pic_buff0->u1_pic_type);
  367|  1.22k|            ps_dec->u4_pred_info_pkd_idx++;
  368|  1.22k|            ps_cur_mb_info->u1_num_pred_parts++;
  369|       |
  370|       |
  371|  1.22k|            }
  372|       |
  373|       |            /******    (0,0) Motion vectors DMA     *****/
  374|  1.22k|            {
  375|  1.22k|                pred_info_pkd_t *ps_pred_pkd;
  376|  1.22k|               WORD16 i2_mv[2];
  377|  1.22k|               WORD8 i1_ref_idx= 0;
  378|       |
  379|  1.22k|               i2_mv[0] = 0;
  380|  1.22k|               i2_mv[1] = 0;
  381|       |
  382|  1.22k|               ps_pred_pkd = ps_dec->ps_pred_pkd + ps_dec->u4_pred_info_pkd_idx;
  383|  1.22k|            ih264d_fill_pred_info(i2_mv,4,4,0,i1_pred,
  384|  1.22k|                            ps_pred_pkd,ps_pic_buff0->u1_pic_buf_id,i1_ref_idx,pui32_weight_ofsts,
  385|  1.22k|                            ps_pic_buff0->u1_pic_type);
  386|  1.22k|            ps_dec->u4_pred_info_pkd_idx++;
  387|  1.22k|            ps_cur_mb_info->u1_num_pred_parts++;
  388|       |
  389|       |
  390|  1.22k|            }
  391|  1.22k|        }
  392|  1.50k|        if(i1_ref_frame1 >= 0)
  ------------------
  |  Branch (392:12): [True: 1.15k, False: 349]
  ------------------
  393|  1.15k|        {
  394|  1.15k|            {
  395|  1.15k|                pred_info_pkd_t *ps_pred_pkd;
  396|  1.15k|               WORD16 i2_mv[2];
  397|  1.15k|               WORD8 i1_ref_idx= 0;
  398|       |
  399|  1.15k|               ps_pred_pkd = ps_dec->ps_pred_pkd + ps_dec->u4_pred_info_pkd_idx;
  400|  1.15k|            ih264d_fill_pred_info(&(i2_spat_pred_mv[2]),4,4,0,i1_pred,
  401|  1.15k|                            ps_pred_pkd,ps_pic_buff1->u1_pic_buf_id,i1_ref_idx,pui32_weight_ofsts,
  402|  1.15k|                            ps_pic_buff1->u1_pic_type);
  403|  1.15k|            ps_dec->u4_pred_info_pkd_idx++;
  404|  1.15k|            ps_cur_mb_info->u1_num_pred_parts++;
  405|       |
  406|       |
  407|  1.15k|            }
  408|       |
  409|       |            /******    (0,0) Motion vectors DMA     *****/
  410|       |
  411|  1.15k|            {
  412|  1.15k|                pred_info_pkd_t *ps_pred_pkd;
  413|  1.15k|               WORD16 i2_mv[2];
  414|  1.15k|               WORD8 i1_ref_idx= 0;
  415|       |
  416|  1.15k|               i2_mv[0] = 0;
  417|  1.15k|               i2_mv[1] = 0;
  418|       |
  419|  1.15k|               ps_pred_pkd = ps_dec->ps_pred_pkd + ps_dec->u4_pred_info_pkd_idx;
  420|  1.15k|            ih264d_fill_pred_info(i2_mv,4,4,0,i1_pred,
  421|  1.15k|                            ps_pred_pkd,ps_pic_buff1->u1_pic_buf_id,i1_ref_idx,pui32_weight_ofsts,
  422|  1.15k|                            ps_pic_buff1->u1_pic_type);
  423|  1.15k|            ps_dec->u4_pred_info_pkd_idx++;
  424|  1.15k|            ps_cur_mb_info->u1_num_pred_parts++;
  425|       |
  426|       |
  427|  1.15k|            }
  428|  1.15k|        }
  429|  1.50k|    }
  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|  16.0k|    for(i = 0; i < s_mvdirect.i1_num_partitions; i++)
  ------------------
  |  Branch (435:16): [True: 13.4k, False: 2.57k]
  ------------------
  436|  13.4k|    {
  437|  13.4k|        partition_size = s_mvdirect.i1_partitionsize[i];
  438|  13.4k|        u4_sub_mb_num = s_mvdirect.i1_submb_num[i];
  439|       |
  440|  13.4k|        sub_partition = partition_size >> 2;
  441|  13.4k|        partition_size &= 0x3;
  442|  13.4k|        u1_mb_partw = pu1_mb_partw[partition_size];
  443|  13.4k|        u1_mb_parth = pu1_mb_parth[partition_size];
  444|  13.4k|        u2_mask = mask_table[partition_size];
  445|  13.4k|        if(sub_partition != 0)
  ------------------
  |  Branch (445:12): [True: 11.0k, False: 2.39k]
  ------------------
  446|  11.0k|        {
  447|  11.0k|            u1_mb_partw >>= 1;
  448|  11.0k|            u1_mb_parth >>= 1;
  449|  11.0k|            u2_mask = sub_mask_table[partition_size];
  450|  11.0k|        }
  451|       |
  452|  13.4k|        u1_col_zero_flag = *(ps_col_pic->pu1_col_zero_flag
  453|  13.4k|                        + s_mvdirect.i4_mv_indices[i]);
  454|  13.4k|        u1_col_zero_flag = u1_col_zero_flag & 0x01;
  455|       |
  456|       |        /*if(u1_col != u1_col_zero_flag)
  457|       |         u1_init = 1;*/
  458|       |
  459|  13.4k|        if(u1_zero_pred_cond_f || ((i1_ref_frame0 == 0) && (u1_col_zero_flag == 1)))
  ------------------
  |  Branch (459:12): [True: 3.19k, False: 10.2k]
  |  Branch (459:36): [True: 9.46k, False: 807]
  |  Branch (459:60): [True: 4.06k, False: 5.39k]
  ------------------
  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|  6.20k|        else
  465|  6.20k|            pi2_final_mv0 = &i2_spat_pred_mv[0];
  466|       |
  467|  13.4k|        if(u1_zero_pred_cond_b || ((i1_ref_frame1 == 0) && (u1_col_zero_flag == 1)))
  ------------------
  |  Branch (467:12): [True: 3.01k, False: 10.4k]
  |  Branch (467:36): [True: 9.58k, False: 863]
  |  Branch (467:60): [True: 4.00k, False: 5.58k]
  ------------------
  468|  7.02k|        {
  469|  7.02k|            pi2_final_mv1 = &i2_def_mv[0];
  470|  7.02k|            ui2_mask_bwd |= (u2_mask << u4_sub_mb_num);
  471|  7.02k|        }
  472|  6.44k|        else
  473|  6.44k|            pi2_final_mv1 = &i2_spat_pred_mv[2];
  474|       |
  475|  13.4k|        if(ps_cur_mb_info->u1_Mux != 1)
  ------------------
  |  Branch (475:12): [True: 2.12k, False: 11.3k]
  ------------------
  476|  2.12k|        {
  477|       |            /*u1_sub_mb_x = u4_sub_mb_num & 0x03;
  478|       |             uc_sub_mb_y = (u4_sub_mb_num >> 2);*/
  479|  2.12k|            if(i1_ref_frame0 >= 0)
  ------------------
  |  Branch (479:16): [True: 1.21k, False: 914]
  ------------------
  480|  1.21k|            {
  481|       |
  482|  1.21k|                {
  483|  1.21k|                    pred_info_pkd_t *ps_pred_pkd;
  484|  1.21k|                   WORD8 i1_ref_idx= 0;
  485|       |
  486|  1.21k|                   ps_pred_pkd = ps_dec->ps_pred_pkd + ps_dec->u4_pred_info_pkd_idx;
  487|  1.21k|                ih264d_fill_pred_info(pi2_final_mv0,u1_mb_partw,u1_mb_parth,u4_sub_mb_num,i1_pred,
  488|  1.21k|                                ps_pred_pkd,ps_pic_buff0->u1_pic_buf_id,i1_ref_idx,pui32_weight_ofsts,
  489|  1.21k|                                ps_pic_buff0->u1_pic_type);
  490|  1.21k|                ps_dec->u4_pred_info_pkd_idx++;
  491|  1.21k|                ps_cur_mb_info->u1_num_pred_parts++;
  492|       |
  493|       |
  494|  1.21k|                }
  495|       |
  496|  1.21k|            }
  497|       |
  498|  2.12k|            if(i1_ref_frame1 >= 0)
  ------------------
  |  Branch (498:16): [True: 1.90k, False: 228]
  ------------------
  499|  1.90k|            {
  500|  1.90k|                {
  501|  1.90k|                    pred_info_pkd_t *ps_pred_pkd;
  502|  1.90k|                   WORD8 i1_ref_idx= 0;
  503|       |
  504|  1.90k|                   ps_pred_pkd = ps_dec->ps_pred_pkd + ps_dec->u4_pred_info_pkd_idx;
  505|  1.90k|                ih264d_fill_pred_info(pi2_final_mv1,u1_mb_partw,u1_mb_parth,u4_sub_mb_num,i1_pred,
  506|  1.90k|                                ps_pred_pkd,ps_pic_buff1->u1_pic_buf_id,i1_ref_idx,pui32_weight_ofsts,
  507|  1.90k|                                ps_pic_buff1->u1_pic_type);
  508|  1.90k|                ps_dec->u4_pred_info_pkd_idx++;
  509|  1.90k|                ps_cur_mb_info->u1_num_pred_parts++;
  510|       |
  511|       |
  512|  1.90k|                }
  513|  1.90k|            }
  514|  2.12k|        }
  515|       |
  516|       |        /* Replication optimisation */
  517|  13.4k|        s_temp_mv_pred.i2_mv[0] = pi2_final_mv0[0];
  518|  13.4k|        s_temp_mv_pred.i2_mv[1] = pi2_final_mv0[1];
  519|  13.4k|        s_temp_mv_pred.i2_mv[2] = pi2_final_mv1[0];
  520|  13.4k|        s_temp_mv_pred.i2_mv[3] = pi2_final_mv1[1];
  521|       |
  522|       |        /* Calculating colocated zero information */
  523|  13.4k|        {
  524|  13.4k|            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|  13.4k|            UWORD8 u1_packed_mb_sub_mb_mode =
  534|  13.4k|                            sub_partition ? (s_mvdirect.i1_partitionsize[i]) : ((s_mvdirect.i1_partitionsize[i])
  ------------------
  |  Branch (534:29): [True: 11.0k, False: 2.39k]
  ------------------
  535|  2.39k|                                                            << 2);
  536|       |
  537|  13.4k|            if(i1_ref_frame0 >= 0)
  ------------------
  |  Branch (537:16): [True: 10.2k, False: 3.19k]
  ------------------
  538|  10.2k|            {
  539|  10.2k|                i2_mv_x = pi2_final_mv0[0];
  540|  10.2k|                i2_mv_y = pi2_final_mv0[1];
  541|  10.2k|            }
  542|  3.19k|            else
  543|  3.19k|            {
  544|  3.19k|                i2_mv_x = pi2_final_mv1[0];
  545|  3.19k|                i2_mv_y = pi2_final_mv1[1];
  546|  3.19k|            }
  547|       |
  548|  13.4k|            u1_colz = (ps_cur_mb_info->u1_mb_field_decodingflag << 1)
  549|  13.4k|                            | ((u1_final_ref_idx == 0) && (ABS(i2_mv_x) <= 1)
  ------------------
  |  |  100|  12.6k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 386, False: 12.2k]
  |  |  ------------------
  ------------------
  |  Branch (549:32): [True: 12.6k, False: 859]
  |  Branch (549:59): [True: 12.3k, False: 253]
  ------------------
  550|  12.3k|                                            && (ABS(i2_mv_y) <= 1));
  ------------------
  |  |  100|  12.3k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 240, False: 12.1k]
  |  |  ------------------
  ------------------
  |  Branch (550:48): [True: 12.1k, False: 183]
  ------------------
  551|  13.4k|            u1_colz |= (u1_packed_mb_sub_mb_mode << 4);
  552|  13.4k|        }
  553|  13.4k|        ps_mv = ps_mv_nmb_start + u4_sub_mb_num;
  554|  13.4k|        ih264d_rep_mv_colz(ps_dec, &s_temp_mv_pred, ps_mv, u4_sub_mb_num, u1_colz,
  555|  13.4k|                           u1_mb_parth, u1_mb_partw);
  556|  13.4k|    }
  557|  2.57k|    i = 0;
  558|  2.57k|    if(i1_ref_frame0 >= 0)
  ------------------
  |  Branch (558:8): [True: 1.83k, False: 742]
  ------------------
  559|  1.83k|        ps_cur_mb_info->u2_mask[i++] = ui2_mask_fwd;
  560|  2.57k|    if(i1_ref_frame1 >= 0)
  ------------------
  |  Branch (560:8): [True: 2.11k, False: 464]
  ------------------
  561|  2.11k|        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.57k|    return OK;
  ------------------
  |  |  114|  2.57k|#define OK        0
  ------------------
  569|   496k|}
ih264d_decode_temporal_direct:
  587|   261k|{
  588|   261k|    struct pic_buffer_t *ps_pic_buff0, *ps_pic_buff1, *ps_col_pic;
  589|   261k|    mv_pred_t *ps_mv, s_temp_mv_pred;
  590|   261k|    UWORD32 u4_sub_mb_num;
  591|   261k|    UWORD8 u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
  592|   261k|    WORD16 i2_mv_x0, i2_mv_y0, i2_mv_x1, i2_mv_y1;
  593|   261k|    UWORD8 u1_mb_partw, u1_mb_parth;
  594|   261k|    UWORD8 i, partition_size, sub_partition;
  595|   261k|    UWORD32 *pui32_weight_ofsts = NULL;
  596|   261k|    directmv_t s_mvdirect;
  597|   261k|    const UWORD8 *pu1_mb_parth = (const UWORD8 *)gau1_ih264d_mb_parth;
  598|   261k|    const UWORD8 *pu1_mb_partw = (const UWORD8 *)gau1_ih264d_mb_partw;
  599|   261k|    WORD8 c_refFrm0, c_refFrm1;
  600|   261k|    UWORD8 u1_ref_idx0, u1_is_cur_mb_fld;
  601|   261k|    WORD32 pic0_poc, pic1_poc, cur_poc;
  602|   261k|    WORD32 ret = 0;
  603|       |
  604|   261k|    u1_is_cur_mb_fld = ps_cur_mb_info->u1_mb_field_decodingflag;
  605|   261k|    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|   261k|    ps_dec->pf_parse_mvdirect(ps_dec, ps_dec->ps_col_pic, &s_mvdirect, u1_wd_x,
  612|   261k|                           ps_dec->i4_submb_ofst, ps_cur_mb_info);
  613|   261k|    ps_col_pic = ps_dec->ps_col_pic;
  614|       |
  615|   537k|    for(i = 0; i < s_mvdirect.i1_num_partitions; i++)
  ------------------
  |  Branch (615:16): [True: 276k, False: 261k]
  ------------------
  616|   276k|    {
  617|   276k|        UWORD8 u1_colz;
  618|   276k|        partition_size = s_mvdirect.i1_partitionsize[i];
  619|   276k|        u4_sub_mb_num = s_mvdirect.i1_submb_num[i];
  620|   276k|        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|   276k|        u1_ref_idx0 = 0;
  624|       |
  625|   276k|        sub_partition = partition_size >> 2;
  626|   276k|        partition_size &= 0x3;
  627|   276k|        u1_mb_partw = pu1_mb_partw[partition_size];
  628|   276k|        u1_mb_parth = pu1_mb_parth[partition_size];
  629|   276k|        if(sub_partition != 0)
  ------------------
  |  Branch (629:12): [True: 14.8k, False: 261k]
  ------------------
  630|  14.8k|        {
  631|  14.8k|            u1_mb_partw >>= 1;
  632|  14.8k|            u1_mb_parth >>= 1;
  633|  14.8k|        }
  634|   276k|        c_refFrm0 = ps_mv->i1_ref_frame[0];
  635|   276k|        c_refFrm1 = ps_mv->i1_ref_frame[1];
  636|       |
  637|   276k|        if((c_refFrm0 == -1) && (c_refFrm1 == -1))
  ------------------
  |  Branch (637:12): [True: 2.84k, False: 273k]
  |  Branch (637:33): [True: 332, False: 2.51k]
  ------------------
  638|    332|        {
  639|    332|            u1_ref_idx0 = 0;
  640|    332|            ps_pic_buff0 = ps_dec->ps_ref_pic_buf_lx[0][0];
  641|    332|            if(u1_mbaff && u1_is_cur_mb_fld)
  ------------------
  |  Branch (641:16): [True: 0, False: 332]
  |  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|    332|            else
  659|    332|            {
  660|    332|                pic0_poc = ps_pic_buff0->i4_avg_poc;
  661|    332|                pic1_poc = ps_pic_buff1->i4_avg_poc;
  662|    332|                cur_poc = ps_dec->ps_cur_pic->i4_poc;
  663|    332|            }
  664|    332|        }
  665|   275k|        else
  666|   275k|        {
  667|   275k|            UWORD8 uc_i, u1_num_frw_ref_pics;
  668|   275k|            UWORD8 buf_id, u1_pic_type;
  669|   275k|            buf_id = ps_mv->u1_col_ref_pic_idx;
  670|   275k|            u1_pic_type = ps_mv->u1_pic_type;
  671|   275k|            if(ps_dec->ps_cur_slice->u1_field_pic_flag)
  ------------------
  |  Branch (671:16): [True: 0, False: 275k]
  ------------------
  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|   275k|            u1_num_frw_ref_pics =
  681|   275k|                            ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[0];
  682|       |
  683|   378k|            for(uc_i = 0; uc_i < u1_num_frw_ref_pics; uc_i++)
  ------------------
  |  Branch (683:27): [True: 353k, False: 25.1k]
  ------------------
  684|   353k|            {
  685|   353k|                if(ps_dec->ps_cur_slice->u1_field_pic_flag)
  ------------------
  |  Branch (685:20): [True: 0, False: 353k]
  ------------------
  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|   353k|                else
  698|   353k|                {
  699|   353k|                    if(ps_dec->ps_ref_pic_buf_lx[0][uc_i]->u1_mv_buf_id == buf_id)
  ------------------
  |  Branch (699:24): [True: 250k, False: 102k]
  ------------------
  700|   250k|                    {
  701|   250k|                        u1_ref_idx0 = uc_i;
  702|   250k|                        break;
  703|   250k|                    }
  704|   353k|                }
  705|   353k|            }
  706|       |
  707|   275k|            ps_pic_buff0 = ps_dec->ps_ref_pic_buf_lx[0][u1_ref_idx0];
  708|   275k|            ps_pic_buff1 = ps_dec->ps_ref_pic_buf_lx[1][0];
  709|       |
  710|   275k|            if(u1_mbaff && u1_is_cur_mb_fld)
  ------------------
  |  Branch (710:16): [True: 0, False: 275k]
  |  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|   275k|            else
  752|   275k|            {
  753|   275k|                pic0_poc = ps_pic_buff0->i4_avg_poc;
  754|   275k|                pic1_poc = ps_pic_buff1->i4_avg_poc;
  755|   275k|                cur_poc = ps_dec->ps_cur_pic->i4_poc;
  756|   275k|            }
  757|   275k|        }
  758|   276k|        {
  759|   276k|            WORD16 i16_td;
  760|   276k|            WORD64 diff;
  761|   276k|            if(c_refFrm0 >= 0)
  ------------------
  |  Branch (761:16): [True: 273k, False: 2.84k]
  ------------------
  762|   273k|            {
  763|   273k|                i2_mv_x0 = ps_mv->i2_mv[0];
  764|   273k|                i2_mv_y0 = ps_mv->i2_mv[1];
  765|   273k|            }
  766|  2.84k|            else if(c_refFrm1 >= 0)
  ------------------
  |  Branch (766:21): [True: 2.51k, False: 332]
  ------------------
  767|  2.51k|            {
  768|  2.51k|                i2_mv_x0 = ps_mv->i2_mv[2];
  769|  2.51k|                i2_mv_y0 = ps_mv->i2_mv[3];
  770|  2.51k|            }
  771|    332|            else
  772|    332|            {
  773|    332|                i2_mv_x0 = 0;
  774|    332|                i2_mv_y0 = 0;
  775|    332|            }
  776|       |            /* If FRM_TO_FLD or FLD_TO_FRM scale the "y" component of the colocated Mv*/
  777|   276k|            if(s_mvdirect.u1_vert_mv_scale == FRM_TO_FLD)
  ------------------
  |  |   48|   276k|#define FRM_TO_FLD    1
  ------------------
  |  Branch (777:16): [True: 0, False: 276k]
  ------------------
  778|      0|            {
  779|      0|                i2_mv_y0 /= 2;
  780|      0|            }
  781|   276k|            else if(s_mvdirect.u1_vert_mv_scale == FLD_TO_FRM)
  ------------------
  |  |   49|   276k|#define FLD_TO_FRM    2
  ------------------
  |  Branch (781:21): [True: 0, False: 276k]
  ------------------
  782|      0|            {
  783|      0|                i2_mv_y0 *= 2;
  784|      0|            }
  785|       |
  786|   276k|            diff = (WORD64)pic1_poc - pic0_poc;
  787|   276k|            i16_td = CLIP_S8(diff);
  ------------------
  |  |   59|   276k|#define CLIP_S8(x) CLIP3(INT8_MIN, INT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   276k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 5.07k, False: 270k]
  |  |  |  |  |  Branch (77:54): [True: 11.6k, False: 259k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  788|   276k|            if((ps_pic_buff0->u1_is_short == 0) || (i16_td == 0))
  ------------------
  |  Branch (788:16): [True: 71.8k, False: 204k]
  |  Branch (788:52): [True: 171k, False: 32.5k]
  ------------------
  789|   243k|            {
  790|   243k|                i2_mv_x1 = 0;
  791|   243k|                i2_mv_y1 = 0;
  792|   243k|            }
  793|  32.5k|            else
  794|  32.5k|            {
  795|  32.5k|                WORD16 i2_tb, i2_tx, i2_dist_scale_factor, i2_temp;
  796|       |
  797|  32.5k|                diff = (WORD64)cur_poc - pic0_poc;
  798|  32.5k|                i2_tb = CLIP_S8(diff);
  ------------------
  |  |   59|  32.5k|#define CLIP_S8(x) CLIP3(INT8_MIN, INT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  32.5k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 5.58k, False: 26.9k]
  |  |  |  |  |  Branch (77:54): [True: 11.3k, False: 15.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  799|       |
  800|  32.5k|                i2_tx = (16384 + ABS(SIGN_POW2_DIV(i16_td, 1))) / i16_td;
  ------------------
  |  |  100|  65.1k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 8.25k, False: 24.3k]
  |  |  |  Branch (100:27): [True: 8.95k, False: 23.6k]
  |  |  |  Branch (100:39): [True: 8.25k, False: 0]
  |  |  |  Branch (100:46): [True: 694, False: 23.6k]
  |  |  ------------------
  ------------------
  801|  32.5k|                i2_dist_scale_factor = CLIP_S11(
  ------------------
  |  |   65|  32.5k|#define CLIP_S11(x) CLIP3(-1024, 1023, (x))
  |  |  ------------------
  |  |  |  |   77|  32.5k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 1.65k, False: 30.9k]
  |  |  |  |  |  Branch (77:54): [True: 1.37k, False: 29.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  802|  32.5k|                                            (((i2_tb * i2_tx) + 32) >> 6));
  803|  32.5k|                i2_temp = (i2_mv_x0 * i2_dist_scale_factor + 128) >> 8;
  804|  32.5k|                i2_mv_x1 = i2_temp - i2_mv_x0;
  805|  32.5k|                i2_mv_x0 = i2_temp;
  806|       |
  807|  32.5k|                i2_temp = (i2_mv_y0 * i2_dist_scale_factor + 128) >> 8;
  808|  32.5k|                i2_mv_y1 = i2_temp - i2_mv_y0;
  809|  32.5k|                i2_mv_y0 = i2_temp;
  810|  32.5k|            }
  811|   276k|            {
  812|   276k|                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|   276k|                if(ps_dec->ps_cur_pps->u1_wted_bipred_idc)
  ------------------
  |  Branch (816:20): [True: 117k, False: 158k]
  ------------------
  817|   117k|                {
  818|   117k|                    UWORD8 u1_idx =
  819|   117k|                                    u1_ref_idx0
  820|   117k|                                                    * ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[1];
  821|   117k|                    UWORD8 u1_scale_ref = u1_mbaff && u1_is_cur_mb_fld;
  ------------------
  |  Branch (821:43): [True: 0, False: 117k]
  |  Branch (821:55): [True: 0, False: 0]
  ------------------
  822|   117k|                    if(u1_scale_ref)
  ------------------
  |  Branch (822:24): [True: 0, False: 117k]
  ------------------
  823|      0|                        u1_idx >>= 1;
  824|   117k|                    pui32_weight_ofsts = (UWORD32*)&ps_dec->pu4_wt_ofsts[2
  825|   117k|                                    * X3(u1_idx)];
  ------------------
  |  |   92|   117k|#define X3(a)   (((a) << 1) + (a))
  ------------------
  826|   117k|                    if(u1_scale_ref
  ------------------
  |  Branch (826:24): [True: 0, False: 117k]
  ------------------
  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|   117k|                }
  846|   276k|                {
  847|   276k|                    pred_info_pkd_t *ps_pred_pkd;
  848|   276k|                   WORD16 i2_mv[2];
  849|   276k|                   WORD8 i1_ref_idx= 0;
  850|       |
  851|   276k|                   i2_mv[0] = i2_mv_x0;
  852|   276k|                   i2_mv[1] = i2_mv_y0;
  853|       |
  854|   276k|                   ps_pred_pkd = ps_dec->ps_pred_pkd + ps_dec->u4_pred_info_pkd_idx;
  855|   276k|                ih264d_fill_pred_info(i2_mv,u1_mb_partw,u1_mb_parth,u4_sub_mb_num,PRED_L0 | PRED_L1,
  ------------------
  |  |  483|   276k|#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|   276k|#define PRED_L1   2
  ------------------
  856|   276k|                                ps_pred_pkd,ps_pic_buff0->u1_pic_buf_id,i1_ref_idx,pui32_weight_ofsts,
  857|   276k|                                ps_pic_buff0->u1_pic_type);
  858|   276k|                ps_dec->u4_pred_info_pkd_idx++;
  859|   276k|                ps_cur_mb_info->u1_num_pred_parts++;
  860|       |
  861|       |
  862|   276k|                }
  863|   276k|                {
  864|   276k|                   pred_info_pkd_t *ps_pred_pkd;
  865|   276k|                   WORD16 i2_mv[2];
  866|   276k|                   WORD8 i1_ref_idx= 0;
  867|       |
  868|   276k|                   i2_mv[0] = i2_mv_x1;
  869|   276k|                   i2_mv[1] = i2_mv_y1;
  870|       |
  871|   276k|                   ps_pred_pkd = ps_dec->ps_pred_pkd + ps_dec->u4_pred_info_pkd_idx;
  872|   276k|                ih264d_fill_pred_info(i2_mv,u1_mb_partw,u1_mb_parth,u4_sub_mb_num,PRED_L0 | PRED_L1,
  ------------------
  |  |  483|   276k|#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|   276k|#define PRED_L1   2
  ------------------
  873|   276k|                                ps_pred_pkd,ps_pic_buff1->u1_pic_buf_id,i1_ref_idx,pui32_weight_ofsts,
  874|   276k|                                ps_pic_buff1->u1_pic_type);
  875|   276k|                ps_dec->u4_pred_info_pkd_idx++;
  876|   276k|                ps_cur_mb_info->u1_num_pred_parts++;
  877|       |
  878|       |
  879|   276k|                }
  880|       |
  881|       |                /* Replication optimisation */
  882|   276k|                s_temp_mv_pred.i2_mv[0] = i2_mv_x0;
  883|   276k|                s_temp_mv_pred.i2_mv[1] = i2_mv_y0;
  884|   276k|                s_temp_mv_pred.i2_mv[2] = i2_mv_x1;
  885|   276k|                s_temp_mv_pred.i2_mv[3] = i2_mv_y1;
  886|   276k|                s_temp_mv_pred.i1_ref_frame[0] = u1_ref_idx0;
  887|   276k|                s_temp_mv_pred.i1_ref_frame[1] = 0;
  888|   276k|                s_temp_mv_pred.u1_col_ref_pic_idx = ps_pic_buff0->u1_mv_buf_id;
  889|   276k|                s_temp_mv_pred.u1_pic_type = ps_pic_buff0->u1_pic_type;
  890|   276k|                ps_mv = ps_dec->ps_mv_cur + (u4_mb_num << 4) + u4_sub_mb_num;
  891|       |
  892|   276k|                {
  893|   276k|                    WORD16 i2_mv_x = 0, i2_mv_y = 0;
  894|   276k|                    UWORD8 u1_packed_mb_sub_mb_mode =
  895|   276k|                                    sub_partition ? (s_mvdirect.i1_partitionsize[i]) : ((s_mvdirect.i1_partitionsize[i])
  ------------------
  |  Branch (895:37): [True: 14.8k, False: 261k]
  ------------------
  896|   261k|                                                                    << 2);
  897|       |
  898|   276k|                    if(c_refFrm0 >= 0)
  ------------------
  |  Branch (898:24): [True: 273k, False: 2.84k]
  ------------------
  899|   273k|                    {
  900|   273k|                        i2_mv_x = i2_mv_x0;
  901|   273k|                        i2_mv_y = i2_mv_y0;
  902|   273k|                    }
  903|  2.84k|                    else
  904|  2.84k|                    {
  905|  2.84k|                        i2_mv_x = i2_mv_x1;
  906|  2.84k|                        i2_mv_y = i2_mv_y1;
  907|  2.84k|                    }
  908|       |
  909|   276k|                    u1_colz =
  910|   276k|                                    (ps_cur_mb_info->u1_mb_field_decodingflag << 1)
  911|   276k|                                                    | ((u1_ref_idx0 == 0)
  ------------------
  |  Branch (911:56): [True: 219k, False: 56.6k]
  ------------------
  912|   219k|                                                                    && (ABS(i2_mv_x)
  ------------------
  |  |  100|   219k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 4.99k, False: 214k]
  |  |  ------------------
  ------------------
  |  Branch (912:72): [True: 206k, False: 13.0k]
  ------------------
  913|   219k|                                                                                    <= 1)
  914|   206k|                                                                    && (ABS(i2_mv_y)
  ------------------
  |  |  100|   206k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 3.44k, False: 202k]
  |  |  ------------------
  ------------------
  |  Branch (914:72): [True: 201k, False: 5.04k]
  ------------------
  915|   206k|                                                                                    <= 1));
  916|   276k|                    u1_colz |= (u1_packed_mb_sub_mb_mode << 4);
  917|   276k|                }
  918|   276k|                ih264d_rep_mv_colz(ps_dec, &s_temp_mv_pred, ps_mv, u4_sub_mb_num,
  919|   276k|                                   u1_colz, u1_mb_parth, u1_mb_partw);
  920|   276k|            }
  921|   276k|        }
  922|   276k|    }
  923|       |    /* return value set to UWORD8 to make it homogeneous  */
  924|       |    /* with decodespatialdirect                           */
  925|   261k|    return OK;
  ------------------
  |  |  114|   261k|#define OK        0
  ------------------
  926|   261k|}
ih264d_init_ref_idx_lx_b:
 1227|  41.5k|{
 1228|  41.5k|    struct pic_buffer_t *ps_ref_pic_buf_lx;
 1229|  41.5k|    dpb_manager_t *ps_dpb_mgr;
 1230|  41.5k|    struct dpb_info_t *ps_next_dpb;
 1231|  41.5k|    WORD32 i_cur_poc, i_max_st_poc, i_min_st_poc, i_ref_poc, i_temp_poc;
 1232|  41.5k|    WORD8 i, j;
 1233|  41.5k|    UWORD8 u1_max_lt_index, u1_min_lt_index;
 1234|  41.5k|    UWORD32 u4_lt_index;
 1235|  41.5k|    WORD32 i_cur_idx;
 1236|  41.5k|    UWORD8 u1_field_pic_flag;
 1237|  41.5k|    dec_slice_params_t *ps_cur_slice;
 1238|  41.5k|    UWORD8 u1_L0, u1_L1;
 1239|  41.5k|    UWORD8 u1_num_short_term_bufs;
 1240|  41.5k|    UWORD8 u1_max_ref_idx_l0, u1_max_ref_idx_l1;
 1241|  41.5k|    struct pic_buffer_t *aps_st_pic_bufs[2 * MAX_REF_BUFS] = {NULL};
 1242|  41.5k|    ps_cur_slice = ps_dec->ps_cur_slice;
 1243|  41.5k|    u1_field_pic_flag = ps_cur_slice->u1_field_pic_flag;
 1244|  41.5k|    u1_max_ref_idx_l0 = ps_cur_slice->u1_num_ref_idx_lx_active[0]
 1245|  41.5k|                    << u1_field_pic_flag;
 1246|  41.5k|    u1_max_ref_idx_l1 = ps_cur_slice->u1_num_ref_idx_lx_active[1]
 1247|  41.5k|                    << u1_field_pic_flag;
 1248|       |
 1249|  41.5k|    ps_dpb_mgr = ps_dec->ps_dpb_mgr;
 1250|       |    /* Get the current POC */
 1251|  41.5k|    i_cur_poc = ps_dec->ps_cur_pic->i4_poc;
 1252|       |
 1253|       |    /* Get MaxStPOC,MinStPOC,MaxLt,MinLt */
 1254|  41.5k|    i_max_st_poc = i_cur_poc;
 1255|  41.5k|    i_min_st_poc = i_cur_poc;
 1256|  41.5k|    u1_max_lt_index = MAX_REF_BUFS + 1;
  ------------------
  |  |   75|  41.5k|#define MAX_REF_BUFS    32
  ------------------
 1257|  41.5k|    u1_min_lt_index = MAX_REF_BUFS + 1;
  ------------------
  |  |   75|  41.5k|#define MAX_REF_BUFS    32
  ------------------
 1258|       |    /* Start from ST head */
 1259|  41.5k|    ps_next_dpb = ps_dpb_mgr->ps_dpb_st_head;
 1260|  77.2k|    for(i = 0; i < ps_dpb_mgr->u1_num_st_ref_bufs; i++)
  ------------------
  |  Branch (1260:16): [True: 35.6k, False: 41.5k]
  ------------------
 1261|  35.6k|    {
 1262|  35.6k|        i_ref_poc = ps_next_dpb->ps_pic_buf->i4_poc;
 1263|  35.6k|        if(i_ref_poc < i_cur_poc)
  ------------------
  |  Branch (1263:12): [True: 11.3k, False: 24.3k]
  ------------------
 1264|  11.3k|        {
 1265|       |            /* RefPic Buf POC is before Current POC in display order */
 1266|  11.3k|            i_min_st_poc = MIN(i_min_st_poc, i_ref_poc);
  ------------------
  |  |   61|  11.3k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 1.81k, False: 9.54k]
  |  |  ------------------
  ------------------
 1267|  11.3k|        }
 1268|  24.3k|        else
 1269|  24.3k|        {
 1270|       |            /* RefPic Buf POC is after Current POC in display order */
 1271|  24.3k|            i_max_st_poc = MAX(i_max_st_poc, i_ref_poc);
  ------------------
  |  |   60|  24.3k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 1.92k, False: 22.3k]
  |  |  ------------------
  ------------------
 1272|  24.3k|        }
 1273|       |
 1274|       |        /* Chase the next link */
 1275|  35.6k|        ps_next_dpb = ps_next_dpb->ps_prev_short;
 1276|  35.6k|    }
 1277|       |
 1278|       |    /* Sort ST ref pocs in ascending order */
 1279|  41.5k|    ps_next_dpb = ps_dpb_mgr->ps_dpb_st_head;
 1280|  77.2k|    for (j = 0; j < ps_dpb_mgr->u1_num_st_ref_bufs; j++)
  ------------------
  |  Branch (1280:17): [True: 35.6k, False: 41.5k]
  ------------------
 1281|  35.6k|    {
 1282|  35.6k|        aps_st_pic_bufs[j] = ps_next_dpb->ps_pic_buf;
 1283|  35.6k|        ps_next_dpb = ps_next_dpb->ps_prev_short;
 1284|  35.6k|    }
 1285|  41.5k|    qsort(aps_st_pic_bufs, ps_dpb_mgr->u1_num_st_ref_bufs,
 1286|  41.5k|        sizeof(aps_st_pic_bufs[0]), poc_compare);
 1287|       |
 1288|       |    /* Start from LT head */
 1289|  41.5k|    ps_next_dpb = ps_dpb_mgr->ps_dpb_ht_head;
 1290|  41.5k|    if(ps_next_dpb)
  ------------------
  |  Branch (1290:8): [True: 4.29k, False: 37.2k]
  ------------------
 1291|  4.29k|    {
 1292|  4.29k|        u1_max_lt_index = ps_next_dpb->u1_lt_idx;
 1293|  4.29k|        u1_min_lt_index = ps_next_dpb->u1_lt_idx;
 1294|  4.29k|    }
 1295|  46.8k|    for(i = 0; i < ps_dpb_mgr->u1_num_lt_ref_bufs; i++)
  ------------------
  |  Branch (1295:16): [True: 5.28k, False: 41.5k]
  ------------------
 1296|  5.28k|    {
 1297|  5.28k|        u4_lt_index = ps_next_dpb->u1_lt_idx;
 1298|  5.28k|        u1_max_lt_index = (UWORD8)(MAX(u1_max_lt_index, u4_lt_index));
  ------------------
  |  |   60|  5.28k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 0, False: 5.28k]
  |  |  ------------------
  ------------------
 1299|  5.28k|        u1_min_lt_index = (UWORD8)(MIN(u1_min_lt_index, u4_lt_index));
  ------------------
  |  |   61|  5.28k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 994, False: 4.29k]
  |  |  ------------------
  ------------------
 1300|       |
 1301|       |        /* Chase the next link */
 1302|  5.28k|        ps_next_dpb = ps_next_dpb->ps_prev_long;
 1303|  5.28k|    }
 1304|       |
 1305|       |    /* 1. Initialize refIdxL0 */
 1306|  41.5k|    u1_L0 = 0;
 1307|  41.5k|    i_temp_poc = i_cur_poc;
 1308|  41.5k|    if(u1_field_pic_flag)
  ------------------
  |  Branch (1308:8): [True: 0, False: 41.5k]
  ------------------
 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|  41.5k|    else
 1314|  41.5k|    {
 1315|  41.5k|        ps_ref_pic_buf_lx = ps_dpb_mgr->ps_init_dpb[0][0];
 1316|       |        /* Avoid integer overflow while decrementing by one */
 1317|  41.5k|        if (i_temp_poc > INT32_MIN)
  ------------------
  |  Branch (1317:13): [True: 41.5k, False: 69]
  ------------------
 1318|  41.5k|            i_temp_poc--;
 1319|  41.5k|    }
 1320|       |
 1321|  41.5k|    i_cur_idx = -1;
 1322|  77.2k|    for(j = 0; j < ps_dpb_mgr->u1_num_st_ref_bufs; j++)
  ------------------
  |  Branch (1322:16): [True: 35.6k, False: 41.5k]
  ------------------
 1323|  35.6k|    {
 1324|  35.6k|        if (NULL == aps_st_pic_bufs[j])
  ------------------
  |  Branch (1324:13): [True: 0, False: 35.6k]
  ------------------
 1325|      0|        {
 1326|      0|            break;
 1327|      0|        }
 1328|  35.6k|        if (aps_st_pic_bufs[j]->i4_poc <= i_temp_poc)
  ------------------
  |  Branch (1328:13): [True: 11.3k, False: 24.3k]
  ------------------
 1329|  11.3k|        {
 1330|  11.3k|            i_cur_idx = j;
 1331|  11.3k|        }
 1332|  35.6k|    }
 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|  52.9k|    for(j = i_cur_idx; j >= 0; j--)
  ------------------
  |  Branch (1336:24): [True: 11.3k, False: 41.5k]
  ------------------
 1337|  11.3k|    {
 1338|  11.3k|        if(aps_st_pic_bufs[j])
  ------------------
  |  Branch (1338:12): [True: 11.3k, False: 0]
  ------------------
 1339|  11.3k|        {
 1340|       |            /* Copy info in pic buffer */
 1341|  11.3k|            ih264d_insert_pic_in_ref_pic_listx(ps_ref_pic_buf_lx,
 1342|  11.3k|                                               aps_st_pic_bufs[j]);
 1343|  11.3k|            ps_ref_pic_buf_lx++;
 1344|  11.3k|            u1_L0++;
 1345|  11.3k|        }
 1346|  11.3k|    }
 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: 24.3k, False: 41.5k]
  ------------------
 1351|  24.3k|    {
 1352|  24.3k|        if(aps_st_pic_bufs[j])
  ------------------
  |  Branch (1352:12): [True: 24.3k, False: 0]
  ------------------
 1353|  24.3k|        {
 1354|  24.3k|            ih264d_insert_pic_in_ref_pic_listx(ps_ref_pic_buf_lx,
 1355|  24.3k|                                               aps_st_pic_bufs[j]);
 1356|  24.3k|            ps_ref_pic_buf_lx++;
 1357|  24.3k|            u1_L0++;
 1358|  24.3k|        }
 1359|  24.3k|    }
 1360|       |
 1361|       |    /* 1.3 Arrange all Long term buffers in ascending order, in LongtermIndex */
 1362|       |    /* Start from ST head */
 1363|       |
 1364|  41.5k|    u1_num_short_term_bufs = u1_L0;
 1365|  84.8k|    for(u4_lt_index = u1_min_lt_index; u4_lt_index <= u1_max_lt_index; u4_lt_index++)
  ------------------
  |  Branch (1365:40): [True: 43.2k, False: 41.5k]
  ------------------
 1366|  43.2k|    {
 1367|  43.2k|        ps_next_dpb = ps_dpb_mgr->ps_dpb_ht_head;
 1368|  46.3k|        for(i = 0; i < ps_dpb_mgr->u1_num_lt_ref_bufs; i++)
  ------------------
  |  Branch (1368:20): [True: 8.40k, False: 37.9k]
  ------------------
 1369|  8.40k|        {
 1370|  8.40k|            if(ps_next_dpb->u1_lt_idx == u4_lt_index)
  ------------------
  |  Branch (1370:16): [True: 5.28k, False: 3.11k]
  ------------------
 1371|  5.28k|            {
 1372|  5.28k|                ih264d_insert_pic_in_ref_pic_listx(ps_ref_pic_buf_lx,
 1373|  5.28k|                                                   ps_next_dpb->ps_pic_buf);
 1374|  5.28k|                ps_ref_pic_buf_lx->u1_long_term_pic_num =
 1375|  5.28k|                                ps_ref_pic_buf_lx->u1_long_term_frm_idx;
 1376|       |
 1377|  5.28k|                ps_ref_pic_buf_lx++;
 1378|  5.28k|                u1_L0++;
 1379|  5.28k|                break;
 1380|  5.28k|            }
 1381|  3.11k|            ps_next_dpb = ps_next_dpb->ps_prev_long;
 1382|  3.11k|        }
 1383|  43.2k|    }
 1384|       |
 1385|  41.5k|    if(u1_field_pic_flag)
  ------------------
  |  Branch (1385:8): [True: 0, False: 41.5k]
  ------------------
 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|  41.5k|    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|  41.5k|    {
 1417|  41.5k|        UWORD8 u1_i;
 1418|  41.5k|        pic_buffer_t ref_pic;
 1419|       |
 1420|  41.5k|        ref_pic = *(ps_dpb_mgr->ps_init_dpb[0][0]);
 1421|       |
 1422|  41.5k|        if(NULL == ref_pic.pu1_buf1)
  ------------------
  |  Branch (1422:12): [True: 0, False: 41.5k]
  ------------------
 1423|      0|        {
 1424|      0|            ref_pic = *ps_dec->ps_cur_pic;
 1425|      0|        }
 1426|   101k|        for(u1_i = u1_L0; u1_i < u1_max_ref_idx_l0; u1_i++)
  ------------------
  |  Branch (1426:27): [True: 59.5k, False: 41.5k]
  ------------------
 1427|  59.5k|        {
 1428|  59.5k|            *ps_ref_pic_buf_lx = ref_pic;
 1429|  59.5k|            ps_ref_pic_buf_lx++;
 1430|  59.5k|        }
 1431|  41.5k|    }
 1432|  41.5k|    {
 1433|       |        /* 2. Initialize refIdxL1 */
 1434|  41.5k|        u1_L1 = 0;
 1435|  41.5k|        if(u1_field_pic_flag)
  ------------------
  |  Branch (1435:12): [True: 0, False: 41.5k]
  ------------------
 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|  41.5k|        else
 1440|  41.5k|        {
 1441|  41.5k|            ps_ref_pic_buf_lx = ps_dpb_mgr->ps_init_dpb[1][0];
 1442|  41.5k|        }
 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: 24.3k, False: 41.5k]
  ------------------
 1447|  24.3k|        {
 1448|  24.3k|            if(aps_st_pic_bufs[j])
  ------------------
  |  Branch (1448:16): [True: 24.3k, False: 0]
  ------------------
 1449|  24.3k|            {
 1450|       |                /* Start from ST head */
 1451|  24.3k|                ih264d_insert_pic_in_ref_pic_listx(ps_ref_pic_buf_lx,
 1452|  24.3k|                                                   aps_st_pic_bufs[j]);
 1453|  24.3k|                ps_ref_pic_buf_lx++;
 1454|  24.3k|                u1_L1++;
 1455|  24.3k|            }
 1456|  24.3k|        }
 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|  52.9k|        for(j = i_cur_idx; j >= 0; j--)
  ------------------
  |  Branch (1461:28): [True: 11.3k, False: 41.5k]
  ------------------
 1462|  11.3k|        {
 1463|  11.3k|            if(aps_st_pic_bufs[j])
  ------------------
  |  Branch (1463:16): [True: 11.3k, False: 0]
  ------------------
 1464|  11.3k|            {
 1465|  11.3k|                ih264d_insert_pic_in_ref_pic_listx(ps_ref_pic_buf_lx,
 1466|  11.3k|                                                   aps_st_pic_bufs[j]);
 1467|  11.3k|                ps_ref_pic_buf_lx++;
 1468|  11.3k|                u1_L1++;
 1469|  11.3k|            }
 1470|  11.3k|        }
 1471|       |
 1472|       |        /* 2.3 Arrange all Long term buffers in ascending order, in LongtermIndex */
 1473|       |        /* Start from ST head */
 1474|  41.5k|        u1_num_short_term_bufs = u1_L1;
 1475|       |
 1476|  84.8k|        for(u4_lt_index = u1_min_lt_index; u4_lt_index <= u1_max_lt_index;
  ------------------
  |  Branch (1476:44): [True: 43.2k, False: 41.5k]
  ------------------
 1477|  43.2k|                        u4_lt_index++)
 1478|  43.2k|        {
 1479|  43.2k|            ps_next_dpb = ps_dpb_mgr->ps_dpb_ht_head;
 1480|  46.3k|            for(i = 0; i < ps_dpb_mgr->u1_num_lt_ref_bufs; i++)
  ------------------
  |  Branch (1480:24): [True: 8.40k, False: 37.9k]
  ------------------
 1481|  8.40k|            {
 1482|  8.40k|                if(ps_next_dpb->u1_lt_idx == u4_lt_index)
  ------------------
  |  Branch (1482:20): [True: 5.28k, False: 3.11k]
  ------------------
 1483|  5.28k|                {
 1484|  5.28k|                    ih264d_insert_pic_in_ref_pic_listx(ps_ref_pic_buf_lx,
 1485|  5.28k|                                                       ps_next_dpb->ps_pic_buf);
 1486|  5.28k|                    ps_ref_pic_buf_lx->u1_long_term_pic_num =
 1487|  5.28k|                                    ps_ref_pic_buf_lx->u1_long_term_frm_idx;
 1488|  5.28k|                    ps_ref_pic_buf_lx++;
 1489|  5.28k|                    u1_L1++;
 1490|  5.28k|                    break;
 1491|  5.28k|                }
 1492|  3.11k|                ps_next_dpb = ps_next_dpb->ps_prev_long;
 1493|  3.11k|            }
 1494|  43.2k|        }
 1495|       |
 1496|  41.5k|        if(u1_field_pic_flag)
  ------------------
  |  Branch (1496:12): [True: 0, False: 41.5k]
  ------------------
 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|  41.5k|        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|  41.5k|        {
 1528|  41.5k|            UWORD8 u1_i;
 1529|  41.5k|            pic_buffer_t ref_pic;
 1530|       |
 1531|  41.5k|            ref_pic = *(ps_dpb_mgr->ps_init_dpb[0][0]);
 1532|       |
 1533|  41.5k|            if(NULL == ref_pic.pu1_buf1)
  ------------------
  |  Branch (1533:16): [True: 0, False: 41.5k]
  ------------------
 1534|      0|            {
 1535|      0|                ref_pic = *ps_dec->ps_cur_pic;
 1536|      0|            }
 1537|  98.3k|            for(u1_i = u1_L1; u1_i < u1_max_ref_idx_l1; u1_i++)
  ------------------
  |  Branch (1537:31): [True: 56.7k, False: 41.5k]
  ------------------
 1538|  56.7k|            {
 1539|  56.7k|                *ps_ref_pic_buf_lx = ref_pic;
 1540|  56.7k|                ps_ref_pic_buf_lx++;
 1541|  56.7k|            }
 1542|  41.5k|        }
 1543|       |
 1544|       |        /* If list0 and list 1 ebtries are same then swap the 0th and 1st entry */
 1545|       |        /* of list 1                                                            */
 1546|  41.5k|        {
 1547|  41.5k|            struct pic_buffer_t *ps_ref_pic1_buf_l0, *ps_ref_pic1_buf_l1;
 1548|  41.5k|            struct pic_buffer_t s_ref_pic1_buf_temp;
 1549|       |
 1550|  41.5k|            ps_ref_pic1_buf_l0 = ps_dpb_mgr->ps_init_dpb[0][0];
 1551|  41.5k|            ps_ref_pic1_buf_l1 = ps_dpb_mgr->ps_init_dpb[1][0];
 1552|       |
 1553|  41.5k|            if((u1_L0 == u1_L1) && (u1_L0 > 1))
  ------------------
  |  Branch (1553:16): [True: 41.5k, False: 0]
  |  Branch (1553:36): [True: 5.27k, False: 36.2k]
  ------------------
 1554|  5.27k|            {
 1555|  5.27k|                WORD32 i_index, i_swap;
 1556|       |
 1557|  5.27k|                i_swap = 1;
 1558|       |
 1559|  16.4k|                for(i_index = 0; i_index < u1_L0; i_index++)
  ------------------
  |  Branch (1559:34): [True: 12.8k, False: 3.64k]
  ------------------
 1560|  12.8k|                {
 1561|  12.8k|                    if((ps_ref_pic1_buf_l0[i_index]).pu1_buf1
  ------------------
  |  Branch (1561:24): [True: 1.62k, False: 11.1k]
  ------------------
 1562|  12.8k|                                    != (ps_ref_pic1_buf_l1[i_index]).pu1_buf1)
 1563|  1.62k|                    {
 1564|  1.62k|                        i_swap = 0;
 1565|  1.62k|                        break;
 1566|  1.62k|                    }
 1567|  12.8k|                }
 1568|  5.27k|                if(1 == i_swap)
  ------------------
  |  Branch (1568:20): [True: 3.64k, False: 1.62k]
  ------------------
 1569|  3.64k|                {
 1570|  3.64k|                    memcpy(&s_ref_pic1_buf_temp, &ps_ref_pic1_buf_l1[1],
 1571|  3.64k|                           sizeof(struct pic_buffer_t));
 1572|  3.64k|                    memcpy(&ps_ref_pic1_buf_l1[1], &ps_ref_pic1_buf_l1[0],
 1573|  3.64k|                           sizeof(struct pic_buffer_t));
 1574|  3.64k|                    memcpy(&ps_ref_pic1_buf_l1[0], &s_ref_pic1_buf_temp,
 1575|  3.64k|                           sizeof(struct pic_buffer_t));
 1576|  3.64k|                }
 1577|  5.27k|            }
 1578|  41.5k|        }
 1579|  41.5k|    }
 1580|  41.5k|}
ih264d_one_to_one:
 1604|   758k|{
 1605|   758k|    UWORD8 *pu1_col_zero_flag_start, u1_col_mb_pred_mode, u1_num_blks, u1_sub_mb_num;
 1606|   758k|    UWORD8 u1_init_colzero_flag;
 1607|   758k|    UNUSED(ps_cur_mb_info);
  ------------------
  |  |   45|   758k|#define UNUSED(x) ((void)(x))
  ------------------
 1608|   758k|    pu1_col_zero_flag_start = ps_col_pic->pu1_col_zero_flag + u2_sub_mb_ofst;
 1609|   758k|    u1_col_mb_pred_mode = pu1_col_zero_flag_start[ps_dec->u1_sub_mb_num];
 1610|   758k|    u1_init_colzero_flag = u1_col_mb_pred_mode & 1;
 1611|   758k|    u1_col_mb_pred_mode >>= 6;
 1612|   758k|    ps_direct->u1_vert_mv_scale = ONE_TO_ONE;
  ------------------
  |  |   47|   758k|#define ONE_TO_ONE    0
  ------------------
 1613|   758k|    ps_direct->u1_col_zeroflag_change = 0;
 1614|       |
 1615|   758k|    if(u1_wd_x == MB_SIZE)
  ------------------
  |  |  554|   758k|#define MB_SIZE             16
  ------------------
  |  Branch (1615:8): [True: 745k, False: 12.6k]
  ------------------
 1616|   745k|    {
 1617|   745k|        ps_dec->u1_currB_type = (!!u1_col_mb_pred_mode);
 1618|   745k|        if(u1_col_mb_pred_mode == PRED_16x16)
  ------------------
  |  |  450|   745k|#define PRED_16x16  0
  ------------------
  |  Branch (1618:12): [True: 730k, False: 15.1k]
  ------------------
 1619|   730k|        {
 1620|   730k|            ps_direct->i1_num_partitions = 1;
 1621|   730k|            ps_direct->i4_mv_indices[0] = u2_sub_mb_ofst;
 1622|   730k|            ps_direct->i1_submb_num[0] = 0;
 1623|   730k|            ps_direct->i1_partitionsize[0] = PRED_16x16;
  ------------------
  |  |  450|   730k|#define PRED_16x16  0
  ------------------
 1624|       |
 1625|   730k|            return;
 1626|   730k|        }
 1627|  15.1k|        else if(u1_col_mb_pred_mode < PRED_8x8)
  ------------------
  |  |  453|  15.1k|#define PRED_8x8    3
  ------------------
  |  Branch (1627:17): [True: 11.1k, False: 3.96k]
  ------------------
 1628|  11.1k|        {
 1629|  11.1k|            ps_direct->i1_num_partitions = 2;
 1630|  11.1k|            ps_direct->i4_mv_indices[0] = u2_sub_mb_ofst;
 1631|  11.1k|            ps_direct->i1_submb_num[0] = 0;
 1632|  11.1k|            ps_direct->i1_partitionsize[0] = u1_col_mb_pred_mode;
 1633|  11.1k|            u1_sub_mb_num = (u1_col_mb_pred_mode == PRED_16x8) ? 8 : 2;
  ------------------
  |  |  451|  11.1k|#define PRED_16x8   1
  ------------------
  |  Branch (1633:29): [True: 6.96k, False: 4.22k]
  ------------------
 1634|  11.1k|            ps_direct->i1_submb_num[1] = u1_sub_mb_num;
 1635|  11.1k|            ps_direct->i4_mv_indices[1] = u2_sub_mb_ofst
 1636|  11.1k|                            + ps_direct->i1_submb_num[1];
 1637|  11.1k|            ps_direct->i1_partitionsize[1] = u1_col_mb_pred_mode;
 1638|  11.1k|            if((pu1_col_zero_flag_start[u1_sub_mb_num] & 1) != u1_init_colzero_flag)
  ------------------
  |  Branch (1638:16): [True: 3.56k, False: 7.62k]
  ------------------
 1639|  3.56k|                ps_direct->u1_col_zeroflag_change = 1;
 1640|  11.1k|            return;
 1641|  11.1k|        }
 1642|  3.96k|        else
 1643|  3.96k|        {
 1644|  3.96k|            u1_num_blks = 4;
 1645|  3.96k|        }
 1646|   745k|    }
 1647|  12.6k|    else
 1648|  12.6k|    {
 1649|  12.6k|        u1_num_blks = 1;
 1650|  12.6k|    }
 1651|       |
 1652|  16.6k|    {
 1653|  16.6k|        const UWORD8 *pu1_top_lt_mb_part_idx;
 1654|  16.6k|        UWORD8 u1_col_sub_mb_pred_mode, uc_blk, u1_sub_blk, u1_submb_col = 0;
 1655|  16.6k|        UWORD8 u1_num_sub_blks, uc_direct8x8inf, *pu1_col_zero_flag, u1_sub_mb_num;
 1656|  16.6k|        const UWORD8 *pu1_num_sub_mb_part =
 1657|  16.6k|                        (const UWORD8 *)gau1_ih264d_num_submb_part;
 1658|  16.6k|        UWORD8 i1_num_partitions = 0, partition_size;
 1659|  16.6k|        WORD32 mv_index;
 1660|  16.6k|        const UWORD8 *pu1_top_lt_sub_mb_idx = gau1_ih264d_submb_indx_mod_sp_drct;
 1661|       |
 1662|  16.6k|        u1_sub_mb_num = ps_dec->u1_sub_mb_num;
 1663|  16.6k|        uc_direct8x8inf = ps_dec->ps_cur_slice->u1_direct_8x8_inference_flag;
 1664|  16.6k|        pu1_top_lt_mb_part_idx = gau1_ih264d_top_left_mb_part_indx_mod
 1665|  16.6k|                        + (PRED_8x8 << 1) + 1;
  ------------------
  |  |  453|  16.6k|#define PRED_8x8    3
  ------------------
 1666|       |
 1667|  45.1k|        for(uc_blk = 0; uc_blk < u1_num_blks; uc_blk++)
  ------------------
  |  Branch (1667:25): [True: 28.5k, False: 16.6k]
  ------------------
 1668|  28.5k|        {
 1669|  28.5k|            partition_size = PRED_8x8;
  ------------------
  |  |  453|  28.5k|#define PRED_8x8    3
  ------------------
 1670|  28.5k|            pu1_top_lt_sub_mb_idx = gau1_ih264d_submb_indx_mod_sp_drct;
 1671|  28.5k|            if(uc_direct8x8inf == 1)
  ------------------
  |  Branch (1671:16): [True: 4.55k, False: 23.9k]
  ------------------
 1672|  4.55k|            {
 1673|  4.55k|                u1_submb_col = u1_sub_mb_num | (u1_sub_mb_num >> 1);
 1674|  4.55k|                mv_index = u2_sub_mb_ofst + u1_submb_col;
 1675|  4.55k|                u1_num_sub_blks = 1;
 1676|  4.55k|            }
 1677|  23.9k|            else
 1678|  23.9k|            {
 1679|       |                /* colMbPart is either 8x8, 8x4, 4x8, 4x4 */
 1680|  23.9k|                pu1_col_zero_flag = pu1_col_zero_flag_start + u1_sub_mb_num;
 1681|  23.9k|                u1_col_sub_mb_pred_mode = *pu1_col_zero_flag;
 1682|  23.9k|                u1_col_sub_mb_pred_mode = (u1_col_sub_mb_pred_mode & 0x30) >> 4;
 1683|  23.9k|                partition_size = (UWORD8)((u1_col_sub_mb_pred_mode)
 1684|  23.9k|                                | (PRED_8x8 << 2));
  ------------------
  |  |  453|  23.9k|#define PRED_8x8    3
  ------------------
 1685|  23.9k|                mv_index = u2_sub_mb_ofst + u1_sub_mb_num;
 1686|  23.9k|                pu1_top_lt_sub_mb_idx += (u1_col_sub_mb_pred_mode << 1);
 1687|  23.9k|                u1_num_sub_blks = pu1_num_sub_mb_part[u1_col_sub_mb_pred_mode];
 1688|       |
 1689|  23.9k|            }
 1690|       |
 1691|  65.8k|            for(u1_sub_blk = 0; u1_sub_blk < u1_num_sub_blks;
  ------------------
  |  Branch (1691:33): [True: 37.3k, False: 28.5k]
  ------------------
 1692|  37.3k|                            u1_sub_blk++, pu1_top_lt_sub_mb_idx++)
 1693|  37.3k|            {
 1694|  37.3k|                u1_sub_mb_num += *pu1_top_lt_sub_mb_idx;
 1695|  37.3k|                mv_index += *pu1_top_lt_sub_mb_idx;
 1696|  37.3k|                ps_direct->i4_mv_indices[i1_num_partitions] = mv_index;
 1697|  37.3k|                ps_direct->i1_submb_num[i1_num_partitions] = u1_sub_mb_num;
 1698|  37.3k|                ps_direct->i1_partitionsize[i1_num_partitions] = partition_size;
 1699|  37.3k|                i1_num_partitions++;
 1700|  37.3k|                if(!uc_direct8x8inf)
  ------------------
  |  Branch (1700:20): [True: 32.7k, False: 4.55k]
  ------------------
 1701|  32.7k|                    u1_submb_col = u1_sub_mb_num;
 1702|  37.3k|                if((pu1_col_zero_flag_start[u1_submb_col] & 1)
  ------------------
  |  Branch (1702:20): [True: 7.41k, False: 29.9k]
  ------------------
 1703|  37.3k|                                != u1_init_colzero_flag)
 1704|  7.41k|                    ps_direct->u1_col_zeroflag_change = 1;
 1705|  37.3k|            }
 1706|  28.5k|            u1_sub_mb_num = *pu1_top_lt_mb_part_idx++;
 1707|  28.5k|        }
 1708|  16.6k|        ps_direct->i1_num_partitions = i1_num_partitions;
 1709|  16.6k|    }
 1710|  16.6k|}
ih264d_cal_col_pic:
 1939|  29.1k|{
 1940|  29.1k|    struct pic_buffer_t* ps_col_pic = ps_dec->ps_col_pic;
 1941|  29.1k|    UWORD8 uc_curpictype, uc_colpictype;
 1942|  29.1k|    ps_col_pic = ps_dec->ps_ref_pic_buf_lx[1][0];
 1943|  29.1k|    uc_curpictype = (ps_dec->ps_cur_pic->u1_picturetype & 0x7);
 1944|  29.1k|    uc_colpictype = (ps_col_pic->u1_picturetype & 0x7);
 1945|  29.1k|    if(uc_curpictype == FRM_PIC)
  ------------------
  |  |  352|  29.1k|#define FRM_PIC         0x00
  ------------------
  |  Branch (1945:8): [True: 29.1k, False: 0]
  ------------------
 1946|  29.1k|    {
 1947|  29.1k|        if(uc_colpictype == FRM_PIC)
  ------------------
  |  |  352|  29.1k|#define FRM_PIC         0x00
  ------------------
  |  Branch (1947:12): [True: 29.1k, False: 0]
  ------------------
 1948|  29.1k|            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.1k|    }
 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.1k|    ps_dec->ps_col_pic = ps_col_pic;
 2000|  29.1k|    return OK;
  ------------------
  |  |  114|  29.1k|#define OK        0
  ------------------
 2001|  29.1k|}
ih264d_process_bslice.c:poc_compare:
 1198|  16.6k|{
 1199|  16.6k|    struct pic_buffer_t *ps_pic1 = *(struct pic_buffer_t **) pv_pic1;
 1200|  16.6k|    struct pic_buffer_t *ps_pic2 = *(struct pic_buffer_t **) pv_pic2;
 1201|  16.6k|    if (ps_pic1->i4_poc < ps_pic2->i4_poc)
  ------------------
  |  Branch (1201:9): [True: 5.86k, False: 10.7k]
  ------------------
 1202|  5.86k|    {
 1203|  5.86k|        return -1;
 1204|  5.86k|    }
 1205|  10.7k|    else if (ps_pic1->i4_poc > ps_pic2->i4_poc)
  ------------------
  |  Branch (1205:14): [True: 9.39k, False: 1.40k]
  ------------------
 1206|  9.39k|    {
 1207|  9.39k|        return 1;
 1208|  9.39k|    }
 1209|  1.40k|    else
 1210|  1.40k|    {
 1211|  1.40k|        return 0;
 1212|  1.40k|    }
 1213|  16.6k|}

ih264d_read_intra_pred_modes:
  109|  18.6k|{
  110|  18.6k|    WORD32 i4x4_luma_blk_idx = 0, i8x8_luma_blk_idx = 0;
  111|       |
  112|  18.6k|    dec_bit_stream_t * ps_bitstrm = ps_dec->ps_bitstrm;
  113|       |
  114|  18.6k|    if(!u4_trans_form8x8)
  ------------------
  |  Branch (114:8): [True: 7.41k, False: 11.2k]
  ------------------
  115|  7.41k|    {
  116|   125k|        for(i4x4_luma_blk_idx = 0; i4x4_luma_blk_idx < 16; ++i4x4_luma_blk_idx)
  ------------------
  |  Branch (116:36): [True: 118k, False: 7.41k]
  ------------------
  117|   118k|        {
  118|   118k|            UWORD32 u4_temp;
  119|   118k|            SWITCHOFFTRACE;
  120|       |
  121|   118k|            GETBIT(u4_temp, ps_bitstrm->u4_ofst, ps_bitstrm->pu4_buffer);
  ------------------
  |  |  105|   118k|#define   GETBIT(u4_code, u4_offset, pu4_bitstream)                         \
  |  |  106|   118k|{                                                                           \
  |  |  107|   118k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  108|   118k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  109|   118k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  110|   118k|    u4_code = pu4_buf[u4_word_off] << u4_bit_off;                           \
  |  |  111|   118k|    (u4_offset)++;                                                          \
  |  |  112|   118k|    u4_code = (u4_code >> 31);                                              \
  |  |  113|   118k|}
  ------------------
  122|   118k|            *pu1_prev_intra4x4_pred_mode_flag = (UWORD8)u4_temp;
  123|   118k|            if(!(*pu1_prev_intra4x4_pred_mode_flag))
  ------------------
  |  Branch (123:16): [True: 65.7k, False: 52.8k]
  ------------------
  124|  65.7k|            {
  125|  65.7k|                GETBITS(u4_temp, ps_bitstrm->u4_ofst, ps_bitstrm->pu4_buffer, 3);
  ------------------
  |  |  120|  65.7k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  65.7k|{                                                                           \
  |  |  122|  65.7k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  65.7k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  65.7k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  65.7k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  65.7k|                                                                            \
  |  |  127|  65.7k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 64.7k, False: 959]
  |  |  ------------------
  |  |  128|  65.7k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  64.7k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  65.7k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  65.7k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  65.7k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  65.7k|}                                                                           \
  ------------------
  126|       |
  127|  65.7k|                *(pu1_rem_intra4x4_pred_mode) = (UWORD8)u4_temp;
  128|  65.7k|            }
  129|       |
  130|   118k|            pu1_prev_intra4x4_pred_mode_flag++;
  131|   118k|            pu1_rem_intra4x4_pred_mode++;
  132|   118k|        }
  133|  7.41k|    }
  134|  11.2k|    else
  135|  11.2k|    {
  136|       |        /**********************************************************************/
  137|       |        /* prev_intra4x4_pred_modes to be interpreted as                      */
  138|       |        /* prev_intra8x8_pred_modes in case of transform 8x8                  */
  139|       |        /**********************************************************************/
  140|  56.1k|        for(i8x8_luma_blk_idx = 0; i8x8_luma_blk_idx < 4; i8x8_luma_blk_idx++)
  ------------------
  |  Branch (140:36): [True: 44.8k, False: 11.2k]
  ------------------
  141|  44.8k|        {
  142|  44.8k|            UWORD32 u4_temp;
  143|  44.8k|            GETBIT(u4_temp, ps_bitstrm->u4_ofst, ps_bitstrm->pu4_buffer);
  ------------------
  |  |  105|  44.8k|#define   GETBIT(u4_code, u4_offset, pu4_bitstream)                         \
  |  |  106|  44.8k|{                                                                           \
  |  |  107|  44.8k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  108|  44.8k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  109|  44.8k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  110|  44.8k|    u4_code = pu4_buf[u4_word_off] << u4_bit_off;                           \
  |  |  111|  44.8k|    (u4_offset)++;                                                          \
  |  |  112|  44.8k|    u4_code = (u4_code >> 31);                                              \
  |  |  113|  44.8k|}
  ------------------
  144|  44.8k|            *pu1_prev_intra4x4_pred_mode_flag = (UWORD8)u4_temp;
  145|  44.8k|            if(!(*pu1_prev_intra4x4_pred_mode_flag))
  ------------------
  |  Branch (145:16): [True: 9.05k, False: 35.8k]
  ------------------
  146|  9.05k|            {
  147|  9.05k|                GETBITS(u4_temp, ps_bitstrm->u4_ofst, ps_bitstrm->pu4_buffer, 3);
  ------------------
  |  |  120|  9.05k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  9.05k|{                                                                           \
  |  |  122|  9.05k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  9.05k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  9.05k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  9.05k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  9.05k|                                                                            \
  |  |  127|  9.05k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 8.47k, False: 573]
  |  |  ------------------
  |  |  128|  9.05k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  8.47k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  9.05k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  9.05k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  9.05k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  9.05k|}                                                                           \
  ------------------
  148|       |
  149|  9.05k|                (*pu1_rem_intra4x4_pred_mode) = (UWORD8)u4_temp;
  150|  9.05k|            }
  151|  44.8k|            pu1_prev_intra4x4_pred_mode_flag++;
  152|  44.8k|            pu1_rem_intra4x4_pred_mode++;
  153|  44.8k|        }
  154|  11.2k|    }
  155|  18.6k|    return (0);
  156|  18.6k|}
ih264d_unpack_coeff4x4_4x4blk:
  160|   460k|{
  161|   460k|    tu_sblk4x4_coeff_data_t *ps_tu_4x4 = (tu_sblk4x4_coeff_data_t *)ps_dec->pv_proc_tu_coeff_data;
  162|   460k|    UWORD16 u2_sig_coeff_map = ps_tu_4x4->u2_sig_coeff_map;
  163|   460k|    WORD32 idx = 0;
  164|   460k|    WORD16 *pi2_coeff_data = &ps_tu_4x4->ai2_level[0];
  165|   460k|    WORD32 dc_only_flag = 0;
  166|   460k|    WORD32 num_coeff = 0;
  167|       |
  168|   460k|    PROFILE_DISABLE_UNPACK_LUMA()
  ------------------
  |  |  112|   460k|#define PROFILE_DISABLE_UNPACK_LUMA() ;
  ------------------
  169|  1.57M|    while(u2_sig_coeff_map)
  ------------------
  |  Branch (169:11): [True: 1.11M, False: 460k]
  ------------------
  170|  1.11M|    {
  171|  1.11M|        idx = CLZ(u2_sig_coeff_map);
  172|       |
  173|  1.11M|        idx = 31 - idx;
  174|  1.11M|        RESET_BIT(u2_sig_coeff_map,idx);
  ------------------
  |  |  105|  1.11M|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  ------------------
  175|       |
  176|  1.11M|        idx = pu1_inv_scan[idx];
  177|  1.11M|        pi2_out_coeff_data[idx] = *pi2_coeff_data++;
  178|  1.11M|        num_coeff++;
  179|  1.11M|    }
  180|       |
  181|   460k|    if((num_coeff == 1) && (idx == 0))
  ------------------
  |  Branch (181:8): [True: 215k, False: 244k]
  |  Branch (181:28): [True: 68.2k, False: 147k]
  ------------------
  182|  68.2k|    {
  183|  68.2k|        dc_only_flag = 1;
  184|  68.2k|    }
  185|       |
  186|   460k|    {
  187|   460k|        WORD32 offset;
  188|   460k|        offset = (UWORD8 *)pi2_coeff_data - (UWORD8 *)ps_tu_4x4;
  189|   460k|        offset = ALIGN4(offset);
  ------------------
  |  |   52|   460k|#define ALIGN4(x)   ((((x) + 3) >> 2) << 2)
  ------------------
  190|   460k|        ps_dec->pv_proc_tu_coeff_data = (void *)((UWORD8 *)ps_dec->pv_proc_tu_coeff_data + offset);
  191|   460k|    }
  192|       |
  193|   460k|    return dc_only_flag;
  194|   460k|}
ih264d_unpack_coeff4x4_8x8blk:
  200|   278k|{
  201|   278k|    UWORD8 *pu1_inv_scan;
  202|   278k|    UWORD8 u1_mb_field_decoding_flag = ps_cur_mb_info->u1_mb_field_decodingflag;
  203|   278k|    UWORD8 u1_field_coding_flag = ps_cur_mb_info->ps_curmb->u1_mb_fld;
  204|   278k|    UWORD32 u4_luma_dc_only_csbp = 0;
  205|   278k|    WORD32 dc_only_flag = 0;
  206|       |
  207|   278k|    PROFILE_DISABLE_UNPACK_LUMA()
  ------------------
  |  |  112|   278k|#define PROFILE_DISABLE_UNPACK_LUMA() ;
  ------------------
  208|   278k|    if(u1_field_coding_flag || u1_mb_field_decoding_flag)
  ------------------
  |  Branch (208:8): [True: 0, False: 278k]
  |  Branch (208:32): [True: 0, False: 278k]
  ------------------
  209|      0|    {
  210|      0|        pu1_inv_scan = (UWORD8 *)gau1_ih264d_inv_scan_fld;
  211|      0|    }
  212|   278k|    else
  213|   278k|    {
  214|   278k|        pu1_inv_scan = (UWORD8 *)gau1_ih264d_inv_scan;
  215|   278k|    }
  216|       |
  217|       |    // sub 0
  218|   278k|    if(ui2_luma_csbp & 0x1)
  ------------------
  |  Branch (218:8): [True: 87.0k, False: 191k]
  ------------------
  219|  87.0k|    {
  220|  87.0k|        memset(pi2_out_coeff_data,0,16*sizeof(WORD16));
  221|  87.0k|        dc_only_flag = ih264d_unpack_coeff4x4_4x4blk(ps_dec,
  222|  87.0k|                                      pi2_out_coeff_data,
  223|  87.0k|                                      pu1_inv_scan);
  224|       |
  225|  87.0k|        INSERT_BIT(u4_luma_dc_only_csbp, 0, dc_only_flag);
  ------------------
  |  |  109|  87.0k|#define INSERT_BIT(x, pos, bit) { RESET_BIT(x, pos); (x) = (x) | (bit << pos); }
  |  |  ------------------
  |  |  |  |  105|  87.0k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  |  |  ------------------
  ------------------
  226|  87.0k|    }
  227|       |
  228|   278k|    pi2_out_coeff_data += 16;
  229|       |    // sub 1
  230|   278k|    if(ui2_luma_csbp & 0x2)
  ------------------
  |  Branch (230:8): [True: 91.1k, False: 187k]
  ------------------
  231|  91.1k|    {
  232|  91.1k|        memset(pi2_out_coeff_data,0,16*sizeof(WORD16));
  233|  91.1k|        dc_only_flag = ih264d_unpack_coeff4x4_4x4blk(ps_dec,
  234|  91.1k|                                      pi2_out_coeff_data,
  235|  91.1k|                                      pu1_inv_scan);
  236|  91.1k|        INSERT_BIT(u4_luma_dc_only_csbp, 1, dc_only_flag);
  ------------------
  |  |  109|  91.1k|#define INSERT_BIT(x, pos, bit) { RESET_BIT(x, pos); (x) = (x) | (bit << pos); }
  |  |  ------------------
  |  |  |  |  105|  91.1k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  |  |  ------------------
  ------------------
  237|  91.1k|    }
  238|       |
  239|   278k|    pi2_out_coeff_data += 16 + 32;
  240|       |    // sub 2
  241|   278k|    if(ui2_luma_csbp & 0x10)
  ------------------
  |  Branch (241:8): [True: 93.8k, False: 184k]
  ------------------
  242|  93.8k|    {
  243|  93.8k|        memset(pi2_out_coeff_data,0,16*sizeof(WORD16));
  244|  93.8k|        dc_only_flag = ih264d_unpack_coeff4x4_4x4blk(ps_dec,
  245|  93.8k|                                      pi2_out_coeff_data,
  246|  93.8k|                                      pu1_inv_scan);
  247|  93.8k|        INSERT_BIT(u4_luma_dc_only_csbp, 4, dc_only_flag);
  ------------------
  |  |  109|  93.8k|#define INSERT_BIT(x, pos, bit) { RESET_BIT(x, pos); (x) = (x) | (bit << pos); }
  |  |  ------------------
  |  |  |  |  105|  93.8k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  |  |  ------------------
  ------------------
  248|  93.8k|    }
  249|       |
  250|   278k|    pi2_out_coeff_data += 16;
  251|       |    // sub 3
  252|   278k|    if(ui2_luma_csbp & 0x20)
  ------------------
  |  Branch (252:8): [True: 88.9k, False: 189k]
  ------------------
  253|  88.9k|    {
  254|  88.9k|        memset(pi2_out_coeff_data,0,16*sizeof(WORD16));
  255|  88.9k|        dc_only_flag = ih264d_unpack_coeff4x4_4x4blk(ps_dec,
  256|  88.9k|                                      pi2_out_coeff_data,
  257|  88.9k|                                      pu1_inv_scan);
  258|  88.9k|        INSERT_BIT(u4_luma_dc_only_csbp, 5, dc_only_flag);
  ------------------
  |  |  109|  88.9k|#define INSERT_BIT(x, pos, bit) { RESET_BIT(x, pos); (x) = (x) | (bit << pos); }
  |  |  ------------------
  |  |  |  |  105|  88.9k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  |  |  ------------------
  ------------------
  259|  88.9k|    }
  260|   278k|    return u4_luma_dc_only_csbp;
  261|   278k|}
ih264d_unpack_coeff8x8_8x8blk_cavlc:
  266|  42.0k|{
  267|  42.0k|    UWORD8 *pu1_inv_scan;
  268|  42.0k|    UWORD8 u1_mb_field_decoding_flag = ps_cur_mb_info->u1_mb_field_decodingflag;
  269|  42.0k|    UWORD8 u1_field_coding_flag = ps_cur_mb_info->ps_curmb->u1_mb_fld;
  270|  42.0k|    WORD32 dc_only_flag = 0;
  271|       |
  272|  42.0k|    PROFILE_DISABLE_UNPACK_LUMA()
  ------------------
  |  |  112|  42.0k|#define PROFILE_DISABLE_UNPACK_LUMA() ;
  ------------------
  273|  42.0k|    if(ui2_luma_csbp & 0x33)
  ------------------
  |  Branch (273:8): [True: 23.1k, False: 18.9k]
  ------------------
  274|  23.1k|    {
  275|  23.1k|        memset(pi2_out_coeff_data,0,64*sizeof(WORD16));
  276|  23.1k|    }
  277|       |
  278|  42.0k|    if(!u1_mb_field_decoding_flag)
  ------------------
  |  Branch (278:8): [True: 42.0k, False: 0]
  ------------------
  279|  42.0k|    {
  280|  42.0k|        pu1_inv_scan =
  281|  42.0k|                        (UWORD8*)gau1_ih264d_inv_scan_prog8x8_cavlc[0];
  282|  42.0k|    }
  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|  42.0k|    if(ui2_luma_csbp & 0x1)
  ------------------
  |  Branch (289:8): [True: 7.28k, False: 34.7k]
  ------------------
  290|  7.28k|    {
  291|  7.28k|        dc_only_flag = ih264d_unpack_coeff4x4_4x4blk(ps_dec,
  292|  7.28k|                                      pi2_out_coeff_data,
  293|  7.28k|                                      pu1_inv_scan);
  294|  7.28k|    }
  295|       |
  296|  42.0k|    if(!u1_mb_field_decoding_flag)
  ------------------
  |  Branch (296:8): [True: 42.0k, False: 0]
  ------------------
  297|  42.0k|    {
  298|  42.0k|        pu1_inv_scan =
  299|  42.0k|                        (UWORD8*)gau1_ih264d_inv_scan_prog8x8_cavlc[1];
  300|  42.0k|    }
  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|  42.0k|    if(ui2_luma_csbp & 0x2)
  ------------------
  |  Branch (307:8): [True: 8.58k, False: 33.4k]
  ------------------
  308|  8.58k|    {
  309|  8.58k|        dc_only_flag = 0;
  310|  8.58k|        ih264d_unpack_coeff4x4_4x4blk(ps_dec,
  311|  8.58k|                                      pi2_out_coeff_data,
  312|  8.58k|                                      pu1_inv_scan);
  313|  8.58k|    }
  314|       |
  315|  42.0k|    if(!u1_mb_field_decoding_flag)
  ------------------
  |  Branch (315:8): [True: 42.0k, False: 0]
  ------------------
  316|  42.0k|    {
  317|  42.0k|        pu1_inv_scan =
  318|  42.0k|                        (UWORD8*)gau1_ih264d_inv_scan_prog8x8_cavlc[2];
  319|  42.0k|    }
  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|  42.0k|    if(ui2_luma_csbp & 0x10)
  ------------------
  |  Branch (326:8): [True: 8.93k, False: 33.0k]
  ------------------
  327|  8.93k|    {
  328|  8.93k|        dc_only_flag = 0;
  329|  8.93k|        ih264d_unpack_coeff4x4_4x4blk(ps_dec,
  330|  8.93k|                                      pi2_out_coeff_data,
  331|  8.93k|                                      pu1_inv_scan);
  332|  8.93k|    }
  333|       |
  334|  42.0k|    if(!u1_mb_field_decoding_flag)
  ------------------
  |  Branch (334:8): [True: 42.0k, False: 0]
  ------------------
  335|  42.0k|    {
  336|  42.0k|        pu1_inv_scan =
  337|  42.0k|                        (UWORD8*)gau1_ih264d_inv_scan_prog8x8_cavlc[3];
  338|  42.0k|    }
  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|  42.0k|    if(ui2_luma_csbp & 0x20)
  ------------------
  |  Branch (345:8): [True: 8.66k, False: 33.3k]
  ------------------
  346|  8.66k|    {
  347|  8.66k|        dc_only_flag = 0;
  348|  8.66k|        ih264d_unpack_coeff4x4_4x4blk(ps_dec,
  349|  8.66k|                                      pi2_out_coeff_data,
  350|  8.66k|                                      pu1_inv_scan);
  351|  8.66k|    }
  352|  42.0k|    return dc_only_flag;
  353|  42.0k|}
ih264d_unpack_coeff4x4_8x8blk_chroma:
  358|  61.9k|{
  359|  61.9k|    UWORD8 *pu1_inv_scan;
  360|  61.9k|    UWORD8 u1_mb_field_decoding_flag = ps_cur_mb_info->u1_mb_field_decodingflag;
  361|  61.9k|    UWORD8 u1_field_coding_flag = ps_cur_mb_info->ps_curmb->u1_mb_fld;
  362|       |
  363|  61.9k|    PROFILE_DISABLE_UNPACK_CHROMA()
  ------------------
  |  |  113|  61.9k|#define PROFILE_DISABLE_UNPACK_CHROMA() ;
  ------------------
  364|  61.9k|    if(u1_field_coding_flag || u1_mb_field_decoding_flag)
  ------------------
  |  Branch (364:8): [True: 0, False: 61.9k]
  |  Branch (364:32): [True: 0, False: 61.9k]
  ------------------
  365|      0|    {
  366|      0|        pu1_inv_scan = (UWORD8 *)gau1_ih264d_inv_scan_fld;
  367|      0|    }
  368|  61.9k|    else
  369|  61.9k|    {
  370|  61.9k|        pu1_inv_scan = (UWORD8 *)gau1_ih264d_inv_scan;
  371|  61.9k|    }
  372|       |
  373|  61.9k|    if(ui2_chroma_csbp & 0x1)
  ------------------
  |  Branch (373:8): [True: 15.5k, False: 46.4k]
  ------------------
  374|  15.5k|    {
  375|  15.5k|        memset(pi2_out_coeff_data,0,16*sizeof(WORD16));
  376|  15.5k|        ih264d_unpack_coeff4x4_4x4blk(ps_dec,
  377|  15.5k|                                      pi2_out_coeff_data,
  378|  15.5k|                                      pu1_inv_scan);
  379|  15.5k|    }
  380|  61.9k|    pi2_out_coeff_data += 16;
  381|  61.9k|    if(ui2_chroma_csbp & 0x2)
  ------------------
  |  Branch (381:8): [True: 15.2k, False: 46.6k]
  ------------------
  382|  15.2k|    {
  383|  15.2k|        memset(pi2_out_coeff_data,0,16*sizeof(WORD16));
  384|  15.2k|        ih264d_unpack_coeff4x4_4x4blk(ps_dec,
  385|  15.2k|                                      pi2_out_coeff_data,
  386|  15.2k|                                      pu1_inv_scan);
  387|  15.2k|    }
  388|       |
  389|  61.9k|    pi2_out_coeff_data += 16;
  390|  61.9k|    if(ui2_chroma_csbp & 0x4)
  ------------------
  |  Branch (390:8): [True: 17.2k, False: 44.7k]
  ------------------
  391|  17.2k|    {
  392|  17.2k|        memset(pi2_out_coeff_data,0,16*sizeof(WORD16));
  393|  17.2k|        ih264d_unpack_coeff4x4_4x4blk(ps_dec,
  394|  17.2k|                                      pi2_out_coeff_data,
  395|  17.2k|                                      pu1_inv_scan);
  396|  17.2k|    }
  397|       |
  398|  61.9k|    pi2_out_coeff_data += 16;
  399|  61.9k|    if(ui2_chroma_csbp & 0x8)
  ------------------
  |  Branch (399:8): [True: 17.4k, False: 44.4k]
  ------------------
  400|  17.4k|    {
  401|  17.4k|        memset(pi2_out_coeff_data,0,16*sizeof(WORD16));
  402|  17.4k|        ih264d_unpack_coeff4x4_4x4blk(ps_dec,
  403|  17.4k|                                      pi2_out_coeff_data,
  404|  17.4k|                                      pu1_inv_scan);
  405|  17.4k|    }
  406|  61.9k|}
ih264d_unpack_luma_coeff4x4_mb:
  410|   671k|{
  411|   671k|    UWORD8 u1_mb_type = ps_cur_mb_info->u1_mb_type;
  412|   671k|    UWORD16 ui2_luma_csbp = ps_cur_mb_info->u2_luma_csbp;
  413|   671k|    UWORD8 *pu1_inv_scan = ps_dec->pu1_inv_scan;
  414|   671k|    WORD16 *pi2_coeff_data = ps_dec->pi2_coeff_data;
  415|       |
  416|   671k|    PROFILE_DISABLE_UNPACK_LUMA()
  ------------------
  |  |  112|   671k|#define PROFILE_DISABLE_UNPACK_LUMA() ;
  ------------------
  417|   671k|    if(!ps_cur_mb_info->u1_tran_form8x8)
  ------------------
  |  Branch (417:8): [True: 656k, False: 15.6k]
  ------------------
  418|   656k|    {
  419|   656k|        UWORD32 u4_luma_dc_only_csbp = 0;
  420|   656k|        UWORD32 u4_temp = 0;
  421|   656k|        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|   656k|        if(intra_flag && (u1_mb_type != I_4x4_MB))
  ------------------
  |  |  417|   107k|#define I_4x4_MB    0
  ------------------
  |  Branch (426:12): [True: 107k, False: 548k]
  |  Branch (426:26): [True: 88.2k, False: 19.3k]
  ------------------
  427|  88.2k|        {
  428|  88.2k|            if(CHECKBIT(ps_cur_mb_info->u1_yuv_dc_block_flag,0))
  ------------------
  |  |   54|  88.2k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  |  |  ------------------
  |  |  |  Branch (54:23): [True: 36.6k, False: 51.5k]
  |  |  ------------------
  ------------------
  429|  36.6k|            {
  430|  36.6k|                pi2_dc_val = (WORD16 *)ps_dec->pv_proc_tu_coeff_data;
  431|       |
  432|  36.6k|                ps_dec->pv_proc_tu_coeff_data = (void *)(pi2_dc_val + 16);
  433|  36.6k|            }
  434|  88.2k|        }
  435|       |
  436|   656k|        if(ui2_luma_csbp)
  ------------------
  |  Branch (436:12): [True: 69.6k, False: 586k]
  ------------------
  437|  69.6k|        {
  438|  69.6k|            pi2_coeff_data = ps_dec->pi2_coeff_data;
  439|  69.6k|            u4_temp = ih264d_unpack_coeff4x4_8x8blk(ps_dec,
  440|  69.6k|                                          ps_cur_mb_info,
  441|  69.6k|                                          ui2_luma_csbp,
  442|  69.6k|                                          pi2_coeff_data);
  443|  69.6k|            u4_luma_dc_only_csbp = u4_temp;
  444|       |
  445|  69.6k|            pi2_coeff_data += 32;
  446|       |
  447|  69.6k|            ui2_luma_csbp = ui2_luma_csbp >> 2;
  448|  69.6k|            u4_temp = ih264d_unpack_coeff4x4_8x8blk(ps_dec,
  449|  69.6k|                                          ps_cur_mb_info,
  450|  69.6k|                                          ui2_luma_csbp,
  451|  69.6k|                                          pi2_coeff_data);
  452|       |
  453|  69.6k|            u4_luma_dc_only_csbp |= (u4_temp << 2);
  454|       |
  455|  69.6k|            pi2_coeff_data += 32 + 64;
  456|       |
  457|  69.6k|            ui2_luma_csbp = ui2_luma_csbp >> 6;
  458|  69.6k|            u4_temp = ih264d_unpack_coeff4x4_8x8blk(ps_dec,
  459|  69.6k|                                          ps_cur_mb_info,
  460|  69.6k|                                          ui2_luma_csbp,
  461|  69.6k|                                          pi2_coeff_data);
  462|       |
  463|  69.6k|            u4_luma_dc_only_csbp |= (u4_temp << 8);
  464|       |
  465|  69.6k|            pi2_coeff_data += 32;
  466|       |
  467|  69.6k|            ui2_luma_csbp = ui2_luma_csbp >> 2;
  468|  69.6k|            u4_temp = ih264d_unpack_coeff4x4_8x8blk(ps_dec,
  469|  69.6k|                                          ps_cur_mb_info,
  470|  69.6k|                                          ui2_luma_csbp,
  471|  69.6k|                                          pi2_coeff_data);
  472|  69.6k|            u4_luma_dc_only_csbp |= (u4_temp << 10);
  473|  69.6k|        }
  474|       |
  475|   656k|        if(pi2_dc_val != NULL)
  ------------------
  |  Branch (475:12): [True: 36.6k, False: 619k]
  ------------------
  476|  36.6k|        {
  477|  36.6k|            WORD32 i;
  478|  36.6k|            pi2_coeff_data = ps_dec->pi2_coeff_data;
  479|   183k|            for(i = 0; i < 4; i++)
  ------------------
  |  Branch (479:24): [True: 146k, False: 36.6k]
  ------------------
  480|   146k|            {
  481|   146k|                pi2_coeff_data[0] = pi2_dc_val[0];
  482|   146k|                pi2_coeff_data[4 * 16] = pi2_dc_val[4];
  483|   146k|                pi2_coeff_data[8 * 16] = pi2_dc_val[8];
  484|   146k|                pi2_coeff_data[12 * 16] = pi2_dc_val[12];
  485|       |
  486|   146k|                pi2_dc_val++; /* Point to next column */
  487|   146k|                pi2_coeff_data += 16;
  488|   146k|            }
  489|  36.6k|            u4_luma_dc_only_csbp = ps_cur_mb_info->u2_luma_csbp ^ 0xFFFF;
  490|  36.6k|        }
  491|   656k|        return u4_luma_dc_only_csbp;
  492|   656k|    }
  493|  15.6k|    else
  494|  15.6k|    {
  495|  15.6k|        UWORD32 u4_luma_dc_only_cbp = 0;
  496|  15.6k|        WORD32 dc_only_flag;
  497|  15.6k|        if(ui2_luma_csbp)
  ------------------
  |  Branch (497:12): [True: 10.5k, False: 5.13k]
  ------------------
  498|  10.5k|        {
  499|  10.5k|            pi2_coeff_data = ps_dec->pi2_coeff_data;
  500|  10.5k|            dc_only_flag = ih264d_unpack_coeff8x8_8x8blk_cavlc(ps_dec,
  501|  10.5k|                                          ps_cur_mb_info,
  502|  10.5k|                                          ui2_luma_csbp,
  503|  10.5k|                                          pi2_coeff_data);
  504|  10.5k|            INSERT_BIT(u4_luma_dc_only_cbp, 0, dc_only_flag);
  ------------------
  |  |  109|  10.5k|#define INSERT_BIT(x, pos, bit) { RESET_BIT(x, pos); (x) = (x) | (bit << pos); }
  |  |  ------------------
  |  |  |  |  105|  10.5k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  |  |  ------------------
  ------------------
  505|       |
  506|  10.5k|            pi2_coeff_data += 64;
  507|       |
  508|  10.5k|            ui2_luma_csbp = ui2_luma_csbp >> 2;
  509|  10.5k|            dc_only_flag = ih264d_unpack_coeff8x8_8x8blk_cavlc(ps_dec,
  510|  10.5k|                                          ps_cur_mb_info,
  511|  10.5k|                                          ui2_luma_csbp,
  512|  10.5k|                                          pi2_coeff_data);
  513|       |
  514|  10.5k|            INSERT_BIT(u4_luma_dc_only_cbp, 1, dc_only_flag);
  ------------------
  |  |  109|  10.5k|#define INSERT_BIT(x, pos, bit) { RESET_BIT(x, pos); (x) = (x) | (bit << pos); }
  |  |  ------------------
  |  |  |  |  105|  10.5k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  |  |  ------------------
  ------------------
  515|       |
  516|  10.5k|            pi2_coeff_data += 64;
  517|       |
  518|  10.5k|            ui2_luma_csbp = ui2_luma_csbp >> 6;
  519|  10.5k|            dc_only_flag = ih264d_unpack_coeff8x8_8x8blk_cavlc(ps_dec,
  520|  10.5k|                                          ps_cur_mb_info,
  521|  10.5k|                                          ui2_luma_csbp,
  522|  10.5k|                                          pi2_coeff_data);
  523|       |
  524|  10.5k|            INSERT_BIT(u4_luma_dc_only_cbp, 2, dc_only_flag);
  ------------------
  |  |  109|  10.5k|#define INSERT_BIT(x, pos, bit) { RESET_BIT(x, pos); (x) = (x) | (bit << pos); }
  |  |  ------------------
  |  |  |  |  105|  10.5k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  |  |  ------------------
  ------------------
  525|       |
  526|  10.5k|            pi2_coeff_data += 64;
  527|  10.5k|            ui2_luma_csbp = ui2_luma_csbp >> 2;
  528|  10.5k|            dc_only_flag = ih264d_unpack_coeff8x8_8x8blk_cavlc(ps_dec,
  529|  10.5k|                                          ps_cur_mb_info,
  530|  10.5k|                                          ui2_luma_csbp,
  531|  10.5k|                                          pi2_coeff_data);
  532|  10.5k|            INSERT_BIT(u4_luma_dc_only_cbp, 3, dc_only_flag);
  ------------------
  |  |  109|  10.5k|#define INSERT_BIT(x, pos, bit) { RESET_BIT(x, pos); (x) = (x) | (bit << pos); }
  |  |  ------------------
  |  |  |  |  105|  10.5k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  |  |  ------------------
  ------------------
  533|  10.5k|        }
  534|  15.6k|        return u4_luma_dc_only_cbp;
  535|  15.6k|    }
  536|       |
  537|   671k|}
ih264d_unpack_chroma_coeff4x4_mb:
  541|   724k|{
  542|   724k|    UWORD8 u1_mb_type = ps_cur_mb_info->u1_mb_type;
  543|   724k|    UWORD16 ui2_chroma_csbp = ps_cur_mb_info->u2_chroma_csbp;
  544|   724k|    UWORD8 *pu1_inv_scan = ps_dec->pu1_inv_scan;
  545|   724k|    WORD16 *pi2_coeff_data = ps_dec->pi2_coeff_data;
  546|   724k|    WORD32 i;
  547|   724k|    WORD16 *pi2_dc_val_u = NULL;
  548|   724k|    WORD16 *pi2_dc_val_v = NULL;
  549|       |
  550|   724k|    PROFILE_DISABLE_UNPACK_CHROMA()
  ------------------
  |  |  113|   724k|#define PROFILE_DISABLE_UNPACK_CHROMA() ;
  ------------------
  551|   724k|    if((ps_cur_mb_info->u1_cbp >> 4) == CBPC_ALLZERO)
  ------------------
  |  |  507|   724k|#define CBPC_ALLZERO    0
  ------------------
  |  Branch (551:8): [True: 630k, False: 94.1k]
  ------------------
  552|   630k|        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|  94.1k|    if(CHECKBIT(ps_cur_mb_info->u1_yuv_dc_block_flag,1))
  ------------------
  |  |   54|  94.1k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  |  |  ------------------
  |  |  |  Branch (54:23): [True: 64.0k, False: 30.0k]
  |  |  ------------------
  ------------------
  559|  64.0k|    {
  560|  64.0k|        pi2_dc_val_u = (WORD16 *)ps_dec->pv_proc_tu_coeff_data;
  561|       |
  562|  64.0k|        ps_dec->pv_proc_tu_coeff_data = (void *)(pi2_dc_val_u + 4);
  563|  64.0k|    }
  564|  94.1k|    if(CHECKBIT(ps_cur_mb_info->u1_yuv_dc_block_flag,2))
  ------------------
  |  |   54|  94.1k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  |  |  ------------------
  |  |  |  Branch (54:23): [True: 62.5k, False: 31.5k]
  |  |  ------------------
  ------------------
  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|  94.1k|    if((ps_cur_mb_info->u1_cbp >> 4) == CBPC_NONZERO)
  ------------------
  |  |  509|  94.1k|#define CBPC_NONZERO    2
  ------------------
  |  Branch (571:8): [True: 30.9k, False: 63.1k]
  ------------------
  572|  30.9k|    {
  573|  30.9k|        pi2_coeff_data = ps_dec->pi2_coeff_data;
  574|  30.9k|        ih264d_unpack_coeff4x4_8x8blk_chroma(ps_dec,
  575|  30.9k|                                             ps_cur_mb_info,
  576|  30.9k|                                             ui2_chroma_csbp,
  577|  30.9k|                                             pi2_coeff_data);
  578|       |
  579|  30.9k|        pi2_coeff_data += 64;
  580|  30.9k|        ui2_chroma_csbp = ui2_chroma_csbp >> 4;
  581|  30.9k|        ih264d_unpack_coeff4x4_8x8blk_chroma(ps_dec,
  582|  30.9k|                                             ps_cur_mb_info,
  583|  30.9k|                                             ui2_chroma_csbp,
  584|  30.9k|                                             pi2_coeff_data);
  585|       |
  586|  30.9k|    }
  587|       |
  588|  94.1k|    pi2_coeff_data = ps_dec->pi2_coeff_data;
  589|  94.1k|    if(pi2_dc_val_u != NULL)
  ------------------
  |  Branch (589:8): [True: 64.0k, False: 30.0k]
  ------------------
  590|  64.0k|    {
  591|  64.0k|        pi2_coeff_data[0] = *pi2_dc_val_u++;
  592|  64.0k|        pi2_coeff_data[1 * 16] = *pi2_dc_val_u++;
  593|  64.0k|        pi2_coeff_data[2 * 16] = *pi2_dc_val_u++;
  594|  64.0k|        pi2_coeff_data[3 * 16] = *pi2_dc_val_u++;
  595|  64.0k|    }
  596|  30.0k|    else
  597|  30.0k|    {
  598|  30.0k|        pi2_coeff_data[0] = 0;
  599|  30.0k|        pi2_coeff_data[1 * 16] = 0;
  600|  30.0k|        pi2_coeff_data[2 * 16] = 0;
  601|  30.0k|        pi2_coeff_data[3 * 16] = 0;
  602|  30.0k|    }
  603|  94.1k|    pi2_coeff_data += 64;
  604|  94.1k|    if(pi2_dc_val_v != NULL)
  ------------------
  |  Branch (604:8): [True: 62.5k, False: 31.5k]
  ------------------
  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|  31.5k|    else
  612|  31.5k|    {
  613|  31.5k|        pi2_coeff_data[0] = 0;
  614|  31.5k|        pi2_coeff_data[1 * 16] = 0;
  615|  31.5k|        pi2_coeff_data[2 * 16] = 0;
  616|  31.5k|        pi2_coeff_data[3 * 16] = 0;
  617|  31.5k|    }
  618|  94.1k|}
ih264d_unpack_luma_coeff8x8_mb:
  621|  52.9k|{
  622|  52.9k|    WORD32 blk_8x8_cnt;
  623|  52.9k|    WORD16 *pi2_out_coeff_data = ps_dec->pi2_coeff_data;
  624|  52.9k|    UWORD8 u1_field_coding_flag = ps_cur_mb_info->ps_curmb->u1_mb_fld;
  625|  52.9k|    UWORD8 *pu1_inv_scan;
  626|  52.9k|    UWORD32 u4_luma_dc_only_cbp = 0;
  627|       |
  628|  52.9k|    PROFILE_DISABLE_UNPACK_LUMA()
  ------------------
  |  |  112|  52.9k|#define PROFILE_DISABLE_UNPACK_LUMA() ;
  ------------------
  629|  52.9k|    if(!u1_field_coding_flag)
  ------------------
  |  Branch (629:8): [True: 52.9k, False: 0]
  ------------------
  630|  52.9k|    {
  631|       |        /*******************************************************************/
  632|       |        /* initializing inverse scan  matrices                             */
  633|       |        /*******************************************************************/
  634|  52.9k|        pu1_inv_scan = (UWORD8 *)gau1_ih264d_inv_scan_prog8x8_cabac;
  635|  52.9k|    }
  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|   264k|    for(blk_8x8_cnt = 0; blk_8x8_cnt < 4; blk_8x8_cnt++)
  ------------------
  |  Branch (644:26): [True: 211k, False: 52.9k]
  ------------------
  645|   211k|    {
  646|   211k|        if(CHECKBIT(ps_cur_mb_info->u1_cbp, blk_8x8_cnt))
  ------------------
  |  |   54|   211k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  |  |  ------------------
  |  |  |  Branch (54:23): [True: 120k, False: 91.0k]
  |  |  ------------------
  ------------------
  647|   120k|        {
  648|   120k|            tu_blk8x8_coeff_data_t *ps_tu_8x8 = (tu_blk8x8_coeff_data_t *)ps_dec->pv_proc_tu_coeff_data;
  649|   120k|            UWORD32 u4_sig_coeff_map;
  650|   120k|            WORD32 idx = 0;
  651|   120k|            WORD16 *pi2_coeff_data = &ps_tu_8x8->ai2_level[0];
  652|   120k|            WORD32 num_coeff = 0;
  653|       |
  654|       |            /* memset 64 coefficient to zero */
  655|   120k|            memset(pi2_out_coeff_data,0,64*sizeof(WORD16));
  656|       |
  657|   120k|            u4_sig_coeff_map = ps_tu_8x8->au4_sig_coeff_map[1];
  658|       |
  659|   181k|            while(u4_sig_coeff_map)
  ------------------
  |  Branch (659:19): [True: 60.2k, False: 120k]
  ------------------
  660|  60.2k|            {
  661|  60.2k|                idx = CLZ(u4_sig_coeff_map);
  662|       |
  663|  60.2k|                idx = 31 - idx;
  664|  60.2k|                RESET_BIT(u4_sig_coeff_map,idx);
  ------------------
  |  |  105|  60.2k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  ------------------
  665|       |
  666|  60.2k|                idx = pu1_inv_scan[idx + 32];
  667|  60.2k|                pi2_out_coeff_data[idx] = *pi2_coeff_data++;
  668|  60.2k|                num_coeff++;
  669|  60.2k|            }
  670|       |
  671|   120k|            u4_sig_coeff_map = ps_tu_8x8->au4_sig_coeff_map[0];
  672|   453k|            while(u4_sig_coeff_map)
  ------------------
  |  Branch (672:19): [True: 332k, False: 120k]
  ------------------
  673|   332k|            {
  674|   332k|                idx = CLZ(u4_sig_coeff_map);
  675|       |
  676|   332k|                idx = 31 - idx;
  677|   332k|                RESET_BIT(u4_sig_coeff_map,idx);
  ------------------
  |  |  105|   332k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  ------------------
  678|       |
  679|   332k|                idx = pu1_inv_scan[idx];
  680|   332k|                pi2_out_coeff_data[idx] = *pi2_coeff_data++;
  681|   332k|                num_coeff++;
  682|   332k|            }
  683|       |
  684|   120k|            if((num_coeff == 1) && (idx == 0))
  ------------------
  |  Branch (684:16): [True: 40.5k, False: 80.2k]
  |  Branch (684:36): [True: 25.2k, False: 15.2k]
  ------------------
  685|  25.2k|            {
  686|  25.2k|                SET_BIT(u4_luma_dc_only_cbp,blk_8x8_cnt);
  ------------------
  |  |  106|  25.2k|#define SET_BIT(x, pos) (x) = (x) | (1 << pos);
  ------------------
  687|  25.2k|            }
  688|       |
  689|       |
  690|   120k|            {
  691|   120k|                WORD32 offset;
  692|   120k|                offset = (UWORD8 *)pi2_coeff_data - (UWORD8 *)ps_tu_8x8;
  693|   120k|                offset = ALIGN4(offset);
  ------------------
  |  |   52|   120k|#define ALIGN4(x)   ((((x) + 3) >> 2) << 2)
  ------------------
  694|   120k|                ps_dec->pv_proc_tu_coeff_data = (void *)((UWORD8 *)ps_dec->pv_proc_tu_coeff_data + offset);
  695|   120k|            }
  696|   120k|        }
  697|   211k|        pi2_out_coeff_data += 64;
  698|   211k|    }
  699|       |
  700|  52.9k|    return u4_luma_dc_only_cbp;
  701|  52.9k|}
ih264d_process_intra_mb:
  719|   145k|{
  720|   145k|    UWORD8 u1_mb_type = ps_cur_mb_info->u1_mb_type;
  721|   145k|    UWORD8 uc_temp = ps_cur_mb_info->u1_mb_ngbr_availablity;
  722|   145k|    UWORD8 u1_top_available = BOOLEAN(uc_temp & TOP_MB_AVAILABLE_MASK);
  ------------------
  |  |   61|   145k|#define BOOLEAN(x) (!!(x))
  ------------------
  723|   145k|    UWORD8 u1_left_available = BOOLEAN(uc_temp & LEFT_MB_AVAILABLE_MASK);
  ------------------
  |  |   61|   145k|#define BOOLEAN(x) (!!(x))
  ------------------
  724|   145k|    UWORD8 u1_use_top_right_mb = BOOLEAN(uc_temp & TOP_RIGHT_MB_AVAILABLE_MASK);
  ------------------
  |  |   61|   145k|#define BOOLEAN(x) (!!(x))
  ------------------
  725|   145k|    UWORD8 u1_use_top_left_mb = BOOLEAN(uc_temp & TOP_LEFT_MB_AVAILABLE_MASK);
  ------------------
  |  |   61|   145k|#define BOOLEAN(x) (!!(x))
  ------------------
  726|   145k|    UWORD8 uc_useTopMB = u1_top_available;
  727|   145k|    UWORD16 u2_use_left_mb = u1_left_available;
  728|   145k|    UWORD16 u2_use_left_mb_pack;
  729|   145k|    UWORD8 *pu1_luma_pred_buffer;
  730|       |    /* CHANGED CODE */
  731|   145k|    UWORD8 *pu1_luma_rec_buffer;
  732|   145k|    UWORD8 *puc_top;
  733|       |
  734|   145k|    mb_neigbour_params_t *ps_left_mb;
  735|   145k|    mb_neigbour_params_t *ps_top_mb;
  736|   145k|    mb_neigbour_params_t *ps_top_right_mb;
  737|   145k|    mb_neigbour_params_t *ps_curmb;
  738|       |
  739|   145k|    UWORD16 u2_mbx = ps_cur_mb_info->u2_mbx;
  740|   145k|    UWORD32 ui_pred_width, ui_rec_width;
  741|   145k|    WORD16 *pi2_y_coeff;
  742|   145k|    UWORD8 u1_mbaff, u1_topmb, u1_mb_field_decoding_flag;
  743|   145k|    UWORD32 u4_num_pmbair;
  744|   145k|    UWORD16 ui2_luma_csbp = ps_cur_mb_info->u2_luma_csbp;
  745|   145k|    UWORD8 *pu1_yleft, *pu1_ytop_left;
  746|       |    /* Chroma variables*/
  747|   145k|    UWORD8 *pu1_top_u;
  748|   145k|    UWORD8 *pu1_uleft;
  749|   145k|    UWORD8 *pu1_u_top_left;
  750|       |    /* CHANGED CODE */
  751|   145k|    UWORD8 *pu1_mb_cb_rei1_buffer, *pu1_mb_cr_rei1_buffer;
  752|   145k|    UWORD32 u4_recwidth_cr;
  753|       |    /* CHANGED CODE */
  754|   145k|    tfr_ctxt_t *ps_frame_buf = ps_dec->ps_frame_buf_ip_recon;
  755|   145k|    UWORD32 u4_luma_dc_only_csbp = 0;
  756|   145k|    UWORD32 u4_luma_dc_only_cbp = 0;
  757|       |
  758|   145k|    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|   145k|    u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
  760|   145k|    u1_topmb = ps_cur_mb_info->u1_topmb;
  761|   145k|    u4_num_pmbair = (u4_mb_num >> u1_mbaff);
  762|       |
  763|       |
  764|       |    /*--------------------------------------------------------------------*/
  765|       |    /* Find the current MB's mb params                                    */
  766|       |    /*--------------------------------------------------------------------*/
  767|   145k|    u1_mb_field_decoding_flag = ps_cur_mb_info->u1_mb_field_decodingflag;
  768|       |
  769|   145k|    ps_curmb = ps_cur_mb_info->ps_curmb;
  770|   145k|    ps_top_mb = ps_cur_mb_info->ps_top_mb;
  771|   145k|    ps_left_mb = ps_cur_mb_info->ps_left_mb;
  772|   145k|    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|   145k|    u2_use_left_mb_pack = (u2_use_left_mb << 8) + u2_use_left_mb;
  779|       |
  780|   145k|    if(ps_dec->ps_cur_pps->u1_constrained_intra_pred_flag)
  ------------------
  |  Branch (780:8): [True: 42.1k, False: 102k]
  ------------------
  781|  42.1k|    {
  782|  42.1k|        UWORD8 u1_left = (UWORD8)u2_use_left_mb;
  783|       |
  784|  42.1k|        uc_useTopMB = uc_useTopMB
  ------------------
  |  Branch (784:23): [True: 33.9k, False: 8.16k]
  ------------------
  785|  33.9k|                        && ((ps_top_mb->u1_mb_type != P_MB)
  ------------------
  |  |  419|  33.9k|#define P_MB        2
  ------------------
  |  Branch (785:29): [True: 25.0k, False: 8.90k]
  ------------------
  786|  25.0k|                                        && (ps_top_mb->u1_mb_type != B_MB));
  ------------------
  |  |  420|  25.0k|#define B_MB        3
  ------------------
  |  Branch (786:44): [True: 24.6k, False: 429]
  ------------------
  787|  42.1k|        u2_use_left_mb = u2_use_left_mb
  ------------------
  |  Branch (787:26): [True: 27.6k, False: 14.5k]
  ------------------
  788|  27.6k|                        && ((ps_left_mb->u1_mb_type != P_MB)
  ------------------
  |  |  419|  27.6k|#define P_MB        2
  ------------------
  |  Branch (788:29): [True: 21.5k, False: 6.08k]
  ------------------
  789|  21.5k|                                        && (ps_left_mb->u1_mb_type != B_MB));
  ------------------
  |  |  420|  21.5k|#define B_MB        3
  ------------------
  |  Branch (789:44): [True: 21.1k, False: 412]
  ------------------
  790|       |
  791|  42.1k|        u2_use_left_mb_pack = (u2_use_left_mb << 8) + u2_use_left_mb;
  792|  42.1k|        if(u1_mbaff)
  ------------------
  |  Branch (792:12): [True: 0, False: 42.1k]
  ------------------
  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.1k|        u1_use_top_right_mb =
  810|  42.1k|                        u1_use_top_right_mb
  ------------------
  |  Branch (810:25): [True: 23.9k, False: 18.1k]
  ------------------
  811|  23.9k|                                        && ((ps_top_right_mb->u1_mb_type != P_MB)
  ------------------
  |  |  419|  23.9k|#define P_MB        2
  ------------------
  |  Branch (811:45): [True: 20.0k, False: 3.93k]
  ------------------
  812|  20.0k|                                                        && (ps_top_right_mb->u1_mb_type
  ------------------
  |  Branch (812:60): [True: 19.7k, False: 314]
  ------------------
  813|  20.0k|                                                                        != B_MB));
  ------------------
  |  |  420|  20.0k|#define B_MB        3
  ------------------
  814|       |
  815|  42.1k|        u1_use_top_left_mb =
  816|  42.1k|                        u1_use_top_left_mb
  ------------------
  |  Branch (816:25): [True: 23.1k, False: 18.9k]
  ------------------
  817|  23.1k|                                        && ((ps_cur_mb_info->u1_topleft_mbtype != P_MB)
  ------------------
  |  |  419|  23.1k|#define P_MB        2
  ------------------
  |  Branch (817:45): [True: 19.2k, False: 3.88k]
  ------------------
  818|  19.2k|                                                        && (ps_cur_mb_info->u1_topleft_mbtype
  ------------------
  |  Branch (818:60): [True: 18.8k, False: 391]
  ------------------
  819|  19.2k|                                                                        != B_MB));
  ------------------
  |  |  420|  19.2k|#define B_MB        3
  ------------------
  820|  42.1k|    }
  821|       |
  822|       |    /*********************Common pointer calculations *************************/
  823|       |    /* CHANGED CODE */
  824|   145k|    pu1_luma_pred_buffer = ps_dec->pu1_y;
  825|   145k|    pu1_luma_rec_buffer = ps_frame_buf->pu1_dest_y + (u4_num_pmbair << 4);
  826|   145k|    pu1_mb_cb_rei1_buffer = ps_frame_buf->pu1_dest_u
  827|   145k|                    + (u4_num_pmbair << 3) * YUV420SP_FACTOR;
  ------------------
  |  |  119|   145k|#define YUV420SP_FACTOR 2
  ------------------
  828|   145k|    pu1_mb_cr_rei1_buffer = ps_frame_buf->pu1_dest_v + (u4_num_pmbair << 3);
  829|   145k|    ui_pred_width = MB_SIZE;
  ------------------
  |  |  554|   145k|#define MB_SIZE             16
  ------------------
  830|   145k|    ui_rec_width = ps_dec->u2_frm_wd_y << u1_mb_field_decoding_flag;
  831|   145k|    u4_recwidth_cr = ps_dec->u2_frm_wd_uv << u1_mb_field_decoding_flag;
  832|       |    /************* Current and top luma pointer *****************/
  833|       |
  834|   145k|    if(u1_mbaff)
  ------------------
  |  Branch (834:8): [True: 0, False: 145k]
  ------------------
  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|   145k|    if(ps_dec->u4_use_intrapred_line_copy == 1)
  ------------------
  |  Branch (854:8): [True: 145k, False: 0]
  ------------------
  855|   145k|    {
  856|   145k|        puc_top = ps_dec->pu1_prev_y_intra_pred_line + (ps_cur_mb_info->u2_mbx << 4);
  857|   145k|        pu1_top_u = ps_dec->pu1_prev_u_intra_pred_line
  858|   145k|                        + (ps_cur_mb_info->u2_mbx << 3) * YUV420SP_FACTOR;
  ------------------
  |  |  119|   145k|#define YUV420SP_FACTOR 2
  ------------------
  859|   145k|    }
  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|   145k|    pu1_yleft = pu1_luma_rec_buffer - 1;
  869|   145k|    pu1_uleft = pu1_mb_cb_rei1_buffer - 1 * YUV420SP_FACTOR;
  ------------------
  |  |  119|   145k|#define YUV420SP_FACTOR 2
  ------------------
  870|       |
  871|       |    /**************Top Left pointer calculation**********/
  872|   145k|    pu1_ytop_left = puc_top - 1;
  873|   145k|    pu1_u_top_left = pu1_top_u - 1 * YUV420SP_FACTOR;
  ------------------
  |  |  119|   145k|#define YUV420SP_FACTOR 2
  ------------------
  874|       |
  875|       |    /* CHANGED CODE */
  876|   145k|    PROFILE_DISABLE_INTRA_PRED()
  ------------------
  |  |  105|   145k|#define PROFILE_DISABLE_INTRA_PRED() ;
  ------------------
  877|   145k|    {
  878|   145k|        pu1_prev_intra4x4_pred_mode_data = (UWORD8 *)ps_dec->pv_proc_tu_coeff_data;
  879|   145k|        if(u1_mb_type == I_4x4_MB && ps_cur_mb_info->u1_tran_form8x8 == 0)
  ------------------
  |  |  417|   290k|#define I_4x4_MB    0
  ------------------
  |  Branch (879:12): [True: 56.7k, False: 88.3k]
  |  Branch (879:38): [True: 19.3k, False: 37.4k]
  ------------------
  880|  19.3k|        {
  881|  19.3k|            ps_dec->pv_proc_tu_coeff_data = (void *)((UWORD8 *)ps_dec->pv_proc_tu_coeff_data + 32);
  882|       |
  883|  19.3k|        }
  884|   125k|        else if (u1_mb_type == I_4x4_MB && ps_cur_mb_info->u1_tran_form8x8 == 1)
  ------------------
  |  |  417|   251k|#define I_4x4_MB    0
  ------------------
  |  Branch (884:18): [True: 37.4k, False: 88.3k]
  |  Branch (884:44): [True: 37.4k, False: 0]
  ------------------
  885|  37.4k|        {
  886|  37.4k|            ps_dec->pv_proc_tu_coeff_data = (void *)((UWORD8 *)ps_dec->pv_proc_tu_coeff_data + 8);
  887|  37.4k|        }
  888|   145k|    }
  889|   145k|    if(!ps_cur_mb_info->u1_tran_form8x8)
  ------------------
  |  Branch (889:8): [True: 107k, False: 37.5k]
  ------------------
  890|   107k|    {
  891|   107k|        u4_luma_dc_only_csbp = ih264d_unpack_luma_coeff4x4_mb(ps_dec,
  892|   107k|                                       ps_cur_mb_info,
  893|   107k|                                       1);
  894|   107k|    }
  895|  37.5k|    else
  896|  37.5k|    {
  897|  37.5k|        if(!ps_dec->ps_cur_pps->u1_entropy_coding_mode)
  ------------------
  |  Branch (897:12): [True: 9.84k, False: 27.6k]
  ------------------
  898|  9.84k|        {
  899|  9.84k|            u4_luma_dc_only_cbp = ih264d_unpack_luma_coeff4x4_mb(ps_dec,
  900|  9.84k|                                           ps_cur_mb_info,
  901|  9.84k|                                           1);
  902|  9.84k|        }
  903|  27.6k|        else
  904|  27.6k|        {
  905|  27.6k|            u4_luma_dc_only_cbp = ih264d_unpack_luma_coeff8x8_mb(ps_dec,
  906|  27.6k|                                           ps_cur_mb_info);
  907|  27.6k|        }
  908|  37.5k|    }
  909|       |
  910|   145k|    pi2_y_coeff = ps_dec->pi2_coeff_data;
  911|       |
  912|   145k|    if(u1_mb_type != I_4x4_MB)
  ------------------
  |  |  417|   145k|#define I_4x4_MB    0
  ------------------
  |  Branch (912:8): [True: 88.3k, False: 56.7k]
  ------------------
  913|  88.3k|    {
  914|  88.3k|        UWORD8 u1_intrapred_mode = MB_TYPE_TO_INTRA_16x16_MODE(u1_mb_type);
  ------------------
  |  |   45|  88.3k|#define MB_TYPE_TO_INTRA_16x16_MODE(x) ((x - 1) & 0x03)
  ------------------
  915|       |        /*--------------------------------------------------------------------*/
  916|       |        /* 16x16 IntraPrediction                                              */
  917|       |        /*--------------------------------------------------------------------*/
  918|  88.3k|        {
  919|  88.3k|            UWORD8 u1_packed_modes = (u1_top_available << 1)
  920|  88.3k|                            + u1_left_available;
  921|  88.3k|            UWORD8 u1_err_code =
  922|  88.3k|                            (u1_intrapred_mode & 1) ?
  ------------------
  |  Branch (922:29): [True: 32.4k, False: 55.9k]
  ------------------
  923|  32.4k|                                            u1_intrapred_mode :
  924|  88.3k|                                            (u1_intrapred_mode ^ 2);
  925|       |
  926|  88.3k|            if((u1_err_code & u1_packed_modes) ^ u1_err_code)
  ------------------
  |  Branch (926:16): [True: 12.5k, False: 75.8k]
  ------------------
  927|  12.5k|            {
  928|  12.5k|                u1_intrapred_mode = 0;
  929|  12.5k|                ps_dec->i4_error_code = ERROR_INTRAPRED;
  930|  12.5k|            }
  931|  88.3k|        }
  932|  88.3k|        {
  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|  88.3k|            UWORD8 au1_ngbr_pels[40];
  936|       |            /* Get neighbour pixels */
  937|       |            /* left pels */
  938|  88.3k|            if(u2_use_left_mb)
  ------------------
  |  Branch (938:16): [True: 63.1k, False: 25.2k]
  ------------------
  939|  63.1k|            {
  940|  63.1k|                WORD32 i;
  941|  1.07M|                for(i = 0; i < 16; i++)
  ------------------
  |  Branch (941:28): [True: 1.00M, False: 63.1k]
  ------------------
  942|  1.00M|                    au1_ngbr_pels[16 - 1 - i] = pu1_yleft[i * ui_rec_width];
  943|  63.1k|            }
  944|  25.2k|            else
  945|  25.2k|            {
  946|  25.2k|                memset(au1_ngbr_pels, 0, 16);
  947|  25.2k|            }
  948|       |
  949|       |            /* top left pels */
  950|  88.3k|            au1_ngbr_pels[16] = *pu1_ytop_left;
  951|       |
  952|       |            /* top pels */
  953|  88.3k|            if(uc_useTopMB)
  ------------------
  |  Branch (953:16): [True: 66.5k, False: 21.7k]
  ------------------
  954|  66.5k|            {
  955|  66.5k|                memcpy(au1_ngbr_pels + 16 + 1, puc_top, 16);
  956|  66.5k|            }
  957|  21.7k|            else
  958|  21.7k|            {
  959|  21.7k|                memset(au1_ngbr_pels + 16 + 1, 0, 16);
  960|  21.7k|            }
  961|  88.3k|            PROFILE_DISABLE_INTRA_PRED()
  ------------------
  |  |  105|  88.3k|#define PROFILE_DISABLE_INTRA_PRED() ;
  ------------------
  962|  88.3k|            ps_dec->apf_intra_pred_luma_16x16[u1_intrapred_mode](
  963|  88.3k|                            au1_ngbr_pels, pu1_luma_rec_buffer, 1, ui_rec_width,
  964|  88.3k|                            ((uc_useTopMB << 2) | u2_use_left_mb));
  965|  88.3k|        }
  966|  88.3k|        {
  967|  88.3k|            UWORD32 i;
  968|  88.3k|            WORD16 ai2_tmp[16];
  969|  1.50M|            for(i = 0; i < 16; i++)
  ------------------
  |  Branch (969:24): [True: 1.41M, False: 88.3k]
  ------------------
  970|  1.41M|            {
  971|  1.41M|                WORD16 *pi2_level = pi2_y_coeff + (i << 4);
  972|  1.41M|                UWORD8 *pu1_pred_sblk = pu1_luma_rec_buffer
  973|  1.41M|                                + ((i & 0x3) * BLK_SIZE)
  ------------------
  |  |  556|  1.41M|#define BLK_SIZE             4
  ------------------
  974|  1.41M|                                + (i >> 2) * (ui_rec_width << 2);
  975|  1.41M|                PROFILE_DISABLE_IQ_IT_RECON()
  ------------------
  |  |   98|  1.41M|#define PROFILE_DISABLE_IQ_IT_RECON() ;
  ------------------
  976|  1.41M|                {
  977|  1.41M|                    if(CHECKBIT(ps_cur_mb_info->u2_luma_csbp, i))
  ------------------
  |  |   54|  1.41M|#define CHECKBIT(a,i) ((a) &  (1 << i))
  |  |  ------------------
  |  |  |  Branch (54:23): [True: 18.4k, False: 1.39M]
  |  |  ------------------
  ------------------
  978|  18.4k|                    {
  979|  18.4k|                        ps_dec->pf_iquant_itrans_recon_luma_4x4(
  980|  18.4k|                                        pi2_level,
  981|  18.4k|                                        pu1_pred_sblk,
  982|  18.4k|                                        pu1_pred_sblk,
  983|  18.4k|                                        ui_rec_width,
  984|  18.4k|                                        ui_rec_width,
  985|  18.4k|                                        gau2_ih264_iquant_scale_4x4[ps_cur_mb_info->u1_qp_rem6],
  986|  18.4k|                                        (UWORD16 *)ps_dec->s_high_profile.i2_scalinglist4x4[0],
  987|  18.4k|                                        ps_cur_mb_info->u1_qp_div6, ai2_tmp, 1,
  988|  18.4k|                                        pi2_level);
  989|  18.4k|                    }
  990|  1.39M|                    else if((CHECKBIT(u4_luma_dc_only_csbp, i)) && pi2_level[0] != 0)
  ------------------
  |  |   54|  1.39M|#define CHECKBIT(a,i) ((a) &  (1 << i))
  ------------------
  |  Branch (990:29): [True: 571k, False: 822k]
  |  Branch (990:68): [True: 520k, False: 50.9k]
  ------------------
  991|   520k|                    {
  992|   520k|                        ps_dec->pf_iquant_itrans_recon_luma_4x4_dc(
  993|   520k|                                        pi2_level,
  994|   520k|                                        pu1_pred_sblk,
  995|   520k|                                        pu1_pred_sblk,
  996|   520k|                                        ui_rec_width,
  997|   520k|                                        ui_rec_width,
  998|   520k|                                        gau2_ih264_iquant_scale_4x4[ps_cur_mb_info->u1_qp_rem6],
  999|   520k|                                        (UWORD16 *)ps_dec->s_high_profile.i2_scalinglist4x4[0],
 1000|   520k|                                        ps_cur_mb_info->u1_qp_div6, ai2_tmp, 1,
 1001|   520k|                                        pi2_level);
 1002|   520k|                    }
 1003|  1.41M|                }
 1004|  1.41M|            }
 1005|  88.3k|        }
 1006|  88.3k|    }
 1007|  56.7k|    else if(!ps_cur_mb_info->u1_tran_form8x8)
  ------------------
  |  Branch (1007:13): [True: 19.3k, False: 37.4k]
  ------------------
 1008|  19.3k|    {
 1009|  19.3k|        UWORD8 u1_is_left_sub_block, u1_is_top_sub_block = uc_useTopMB;
 1010|  19.3k|        UWORD8 u1_sub_blk_x, u1_sub_blk_y, u1_sub_mb_num;
 1011|  19.3k|        WORD8 i1_top_pred_mode;
 1012|  19.3k|        WORD8 i1_left_pred_mode;
 1013|  19.3k|        UWORD8 *pu1_top, *pu1_left, *pu1_top_left, *pu1_top_right;
 1014|  19.3k|        WORD8 *pi1_cur_pred_mode, *pi1_left_pred_mode, *pc_topPredMode;
 1015|  19.3k|        UWORD16 ui2_left_pred_buf_width = 0xffff;
 1016|  19.3k|        WORD8 i1_intra_pred;
 1017|  19.3k|        UWORD8 *pu1_prev_intra4x4_pred_mode_flag = pu1_prev_intra4x4_pred_mode_data;
 1018|  19.3k|        UWORD8 *pu1_rem_intra4x4_pred_mode = pu1_prev_intra4x4_pred_mode_data + 16;
 1019|  19.3k|        WORD16 *pi2_y_coeff1;
 1020|  19.3k|        UWORD8 u1_cur_sub_block;
 1021|  19.3k|        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|  19.3k|        pu1_top = puc_top;
 1039|       |
 1040|  19.3k|        ui2_top_rt_mask = (u1_use_top_right_mb << 3) | (0x5750);
 1041|  19.3k|        if(uc_useTopMB)
  ------------------
  |  Branch (1041:12): [True: 13.4k, False: 5.88k]
  ------------------
 1042|  13.4k|            ui2_top_rt_mask |= 0x7;
 1043|       |
 1044|       |        /*Top Related initialisations*/
 1045|       |
 1046|       |
 1047|  19.3k|        pi1_cur_pred_mode = ps_cur_mb_info->ps_curmb->pi1_intrapredmodes;
 1048|  19.3k|        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|  19.3k|        if(u1_top_available)
  ------------------
  |  Branch (1058:12): [True: 14.4k, False: 4.87k]
  ------------------
 1059|  14.4k|        {
 1060|  14.4k|            if(ps_top_mb->u1_mb_type == I_4x4_MB)
  ------------------
  |  |  417|  14.4k|#define I_4x4_MB    0
  ------------------
  |  Branch (1060:16): [True: 11.3k, False: 3.09k]
  ------------------
 1061|  11.3k|                *(WORD32*)pi1_cur_pred_mode = *(WORD32*)pc_topPredMode;
 1062|  3.09k|            else
 1063|  3.09k|                *(WORD32*)pi1_cur_pred_mode =
 1064|  3.09k|                                (uc_useTopMB) ? DC_DC_DC_DC : NOT_VALID;
  ------------------
  |  |  434|  2.08k|#define DC_DC_DC_DC   0x02020202 /*packed 4 bytes used in Decode Intra Mb*/
  ------------------
                                              (uc_useTopMB) ? DC_DC_DC_DC : NOT_VALID;
  ------------------
  |  |  433|  1.00k|#define NOT_VALID -1
  ------------------
  |  Branch (1064:33): [True: 2.08k, False: 1.00k]
  ------------------
 1065|  14.4k|        }
 1066|  4.87k|        else
 1067|  4.87k|            *(WORD32*)pi1_cur_pred_mode = NOT_VALID;
  ------------------
  |  |  433|  4.87k|#define NOT_VALID -1
  ------------------
 1068|       |        /* CHANGED CODE */
 1069|       |
 1070|       |        /* CHANGED CODE */
 1071|       |
 1072|       |        /*Left Related initialisations*/
 1073|  19.3k|        pi1_left_pred_mode = ps_dec->pi1_left_pred_mode;
 1074|  19.3k|        if(!u1_mbaff)
  ------------------
  |  Branch (1074:12): [True: 19.3k, False: 0]
  ------------------
 1075|  19.3k|        {
 1076|       |
 1077|  19.3k|            if(u1_left_available)
  ------------------
  |  Branch (1077:16): [True: 12.0k, False: 7.30k]
  ------------------
 1078|  12.0k|            {
 1079|       |
 1080|  12.0k|                if(ps_left_mb->u1_mb_type != I_4x4_MB)
  ------------------
  |  |  417|  12.0k|#define I_4x4_MB    0
  ------------------
  |  Branch (1080:20): [True: 2.13k, False: 9.92k]
  ------------------
 1081|  2.13k|                    *(WORD32*)pi1_left_pred_mode =
 1082|  2.13k|                                    (u2_use_left_mb_pack) ?
  ------------------
  |  Branch (1082:37): [True: 1.41k, False: 713]
  ------------------
 1083|  1.41k|                                    DC_DC_DC_DC :
  ------------------
  |  |  434|  1.41k|#define DC_DC_DC_DC   0x02020202 /*packed 4 bytes used in Decode Intra Mb*/
  ------------------
 1084|  2.13k|                                                            NOT_VALID;
  ------------------
  |  |  433|    713|#define NOT_VALID -1
  ------------------
 1085|       |
 1086|  12.0k|            }
 1087|  7.30k|            else
 1088|  7.30k|            {
 1089|       |
 1090|  7.30k|                *(WORD32*)pi1_left_pred_mode = NOT_VALID;
  ------------------
  |  |  433|  7.30k|#define NOT_VALID -1
  ------------------
 1091|  7.30k|            }
 1092|       |
 1093|  19.3k|        }
 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|  19.3k|        pi2_y_coeff1 = pi2_y_coeff;
 1175|  19.3k|        pu1_top_left = pu1_ytop_left;
 1176|       |
 1177|       |        /* Scan the sub-blocks in Raster Scan Order */
 1178|   329k|        for(u1_sub_mb_num = 0; u1_sub_mb_num < 16; u1_sub_mb_num++)
  ------------------
  |  Branch (1178:32): [True: 309k, False: 19.3k]
  ------------------
 1179|   309k|        {
 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|   309k|            UWORD8 au1_ngbr_pels[16];
 1183|       |
 1184|   309k|            u1_sub_blk_x = u1_sub_mb_num & 0x3;
 1185|   309k|            u1_sub_blk_y = u1_sub_mb_num >> 2;
 1186|   309k|            i1_top_pred_mode = pi1_cur_pred_mode[u1_sub_blk_x];
 1187|   309k|            i1_left_pred_mode = pi1_left_pred_mode[u1_sub_blk_y];
 1188|   309k|            u1_use_top_right_mb = (!!CHECKBIT(ui2_top_rt_mask, u1_sub_mb_num));
  ------------------
  |  |   54|   309k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  ------------------
 1189|       |
 1190|       |            /*********** left subblock availability**********/
 1191|   309k|            if(u1_sub_blk_x)
  ------------------
  |  Branch (1191:16): [True: 232k, False: 77.4k]
  ------------------
 1192|   232k|                u1_is_left_sub_block = 1;
 1193|  77.4k|            else
 1194|  77.4k|                u1_is_left_sub_block =
 1195|  77.4k|                                (u1_sub_blk_y < 2) ?
  ------------------
  |  Branch (1195:33): [True: 38.7k, False: 38.7k]
  ------------------
 1196|  38.7k|                                                (CHECKBIT(u2_use_left_mb_pack,
  ------------------
  |  |   54|  38.7k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  ------------------
 1197|  38.7k|                                                          0)) :
 1198|  77.4k|                                                (u2_use_left_mb_pack >> 8);
 1199|       |
 1200|       |            /* CHANGED CODE */
 1201|   309k|            if(u1_sub_blk_y)
  ------------------
  |  Branch (1201:16): [True: 232k, False: 77.4k]
  ------------------
 1202|   232k|                u1_is_top_sub_block = 1;
 1203|       |
 1204|       |            /* CHANGED CODE */
 1205|       |            /***************** Top *********************/
 1206|   309k|            if(ps_dec->u4_use_intrapred_line_copy == 1)
  ------------------
  |  Branch (1206:16): [True: 309k, False: 0]
  ------------------
 1207|   309k|            {
 1208|       |
 1209|   309k|                if(u1_sub_blk_y)
  ------------------
  |  Branch (1209:20): [True: 232k, False: 77.4k]
  ------------------
 1210|   232k|                    pu1_top = pu1_luma_rec_buffer - ui_rec_width;
 1211|  77.4k|                else
 1212|  77.4k|                    pu1_top = puc_top + (u1_sub_blk_x << 2);
 1213|   309k|            }
 1214|      0|            else
 1215|      0|            {
 1216|      0|                pu1_top = pu1_luma_rec_buffer - ui_rec_width;
 1217|      0|            }
 1218|       |            /***************** Top Right *********************/
 1219|   309k|            pu1_top_right = pu1_top + 4;
 1220|       |            /***************** Top Left *********************/
 1221|   309k|            pu1_top_left = pu1_top - 1;
 1222|       |            /***************** Left *********************/
 1223|   309k|            pu1_left = pu1_luma_rec_buffer - 1;
 1224|       |            /* CHANGED CODE */
 1225|       |
 1226|       |            /*---------------------------------------------------------------*/
 1227|       |            /* Calculation of Intra prediction mode                          */
 1228|       |            /*---------------------------------------------------------------*/
 1229|   309k|            i1_intra_pred = ((i1_left_pred_mode < 0) | (i1_top_pred_mode < 0)) ?
  ------------------
  |  Branch (1229:29): [True: 52.2k, False: 257k]
  ------------------
 1230|   257k|                            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|   567k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 43.7k, False: 213k]
  |  |  ------------------
  ------------------
 1231|   309k|            {
 1232|   309k|                UWORD8 u1_packed_modes = (u1_is_top_sub_block << 1)
 1233|   309k|                                + u1_is_left_sub_block;
 1234|   309k|                UWORD8 *pu1_intra_err_codes =
 1235|   309k|                                (UWORD8 *)gau1_ih264d_intra_pred_err_code;
 1236|   309k|                UWORD8 uc_b2b0 = ((u1_sub_mb_num & 4) >> 1) | (u1_sub_mb_num & 1);
 1237|   309k|                UWORD8 uc_b3b1 = ((u1_sub_mb_num & 8) >> 2)
 1238|   309k|                                | ((u1_sub_mb_num & 2) >> 1);
 1239|       |
 1240|   309k|                u1_cur_sub_block = (uc_b3b1 << 2) + uc_b2b0;
 1241|   309k|                PROFILE_DISABLE_INTRA_PRED()
  ------------------
  |  |  105|   309k|#define PROFILE_DISABLE_INTRA_PRED() ;
  ------------------
 1242|   309k|                if(!pu1_prev_intra4x4_pred_mode_flag[u1_cur_sub_block])
  ------------------
  |  Branch (1242:20): [True: 90.1k, False: 219k]
  ------------------
 1243|  90.1k|                {
 1244|  90.1k|                    i1_intra_pred =
 1245|  90.1k|                                    pu1_rem_intra4x4_pred_mode[u1_cur_sub_block]
 1246|  90.1k|                                                    + (pu1_rem_intra4x4_pred_mode[u1_cur_sub_block]
 1247|  90.1k|                                                                    >= i1_intra_pred);
 1248|  90.1k|                }
 1249|   309k|                i1_intra_pred = CLIP3(0, 8, i1_intra_pred);
  ------------------
  |  |   77|   309k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 340, False: 309k]
  |  |  |  Branch (77:54): [True: 261, False: 309k]
  |  |  ------------------
  ------------------
 1250|   309k|                {
 1251|   309k|                    UWORD8 u1_err_code = pu1_intra_err_codes[i1_intra_pred];
 1252|       |
 1253|   309k|                    if((u1_err_code & u1_packed_modes) ^ u1_err_code)
  ------------------
  |  Branch (1253:24): [True: 9.43k, False: 300k]
  ------------------
 1254|  9.43k|                     {
 1255|  9.43k|                        i1_intra_pred = 0;
 1256|  9.43k|                        ps_dec->i4_error_code = ERROR_INTRAPRED;
 1257|  9.43k|                     }
 1258|       |
 1259|   309k|                }
 1260|   309k|            }
 1261|   309k|            {
 1262|       |                /* Get neighbour pixels */
 1263|       |                /* left pels */
 1264|   309k|                if(u1_is_left_sub_block)
  ------------------
  |  Branch (1264:20): [True: 277k, False: 32.0k]
  ------------------
 1265|   277k|                {
 1266|   277k|                    WORD32 i;
 1267|  1.38M|                    for(i = 0; i < 4; i++)
  ------------------
  |  Branch (1267:32): [True: 1.11M, False: 277k]
  ------------------
 1268|  1.11M|                        au1_ngbr_pels[4 - 1 - i] = pu1_left[i * ui_rec_width];
 1269|   277k|                }
 1270|  32.0k|                else
 1271|  32.0k|                {
 1272|  32.0k|                    memset(au1_ngbr_pels, 0, 4);
 1273|  32.0k|                }
 1274|       |
 1275|       |                /* top left pels */
 1276|   309k|                au1_ngbr_pels[4] = *pu1_top_left;
 1277|       |
 1278|       |                /* top pels */
 1279|   309k|                if(u1_is_top_sub_block)
  ------------------
  |  Branch (1279:20): [True: 286k, False: 23.5k]
  ------------------
 1280|   286k|                {
 1281|   286k|                    memcpy(au1_ngbr_pels + 4 + 1, pu1_top, 4);
 1282|   286k|                }
 1283|  23.5k|                else
 1284|  23.5k|                {
 1285|  23.5k|                    memset(au1_ngbr_pels + 4 + 1, 0, 4);
 1286|  23.5k|                }
 1287|       |
 1288|       |                /* top right pels */
 1289|   309k|                if(u1_use_top_right_mb)
  ------------------
  |  Branch (1289:20): [True: 185k, False: 124k]
  ------------------
 1290|   185k|                {
 1291|   185k|                    memcpy(au1_ngbr_pels + 4 * 2 + 1, pu1_top_right, 4);
 1292|   185k|                }
 1293|   124k|                else if(u1_is_top_sub_block)
  ------------------
  |  Branch (1293:25): [True: 101k, False: 22.8k]
  ------------------
 1294|   101k|                {
 1295|   101k|                    memset(au1_ngbr_pels + 4 * 2 + 1, au1_ngbr_pels[4 * 2], 4);
 1296|   101k|                }
 1297|   309k|            }
 1298|   309k|            PROFILE_DISABLE_INTRA_PRED()
  ------------------
  |  |  105|   309k|#define PROFILE_DISABLE_INTRA_PRED() ;
  ------------------
 1299|   309k|            ps_dec->apf_intra_pred_luma_4x4[i1_intra_pred](
 1300|   309k|                            au1_ngbr_pels, pu1_luma_rec_buffer, 1,
 1301|   309k|                            ui_rec_width,
 1302|   309k|                            ((u1_is_top_sub_block << 2) | u1_is_left_sub_block));
 1303|       |
 1304|       |            /* CHANGED CODE */
 1305|   309k|            if(CHECKBIT(ui2_luma_csbp, u1_sub_mb_num))
  ------------------
  |  |   54|   309k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  |  |  ------------------
  |  |  |  Branch (54:23): [True: 39.0k, False: 270k]
  |  |  ------------------
  ------------------
 1306|  39.0k|            {
 1307|  39.0k|                WORD16 ai2_tmp[16];
 1308|  39.0k|                PROFILE_DISABLE_IQ_IT_RECON()
  ------------------
  |  |   98|  39.0k|#define PROFILE_DISABLE_IQ_IT_RECON() ;
  ------------------
 1309|  39.0k|                {
 1310|  39.0k|                    if(CHECKBIT(u4_luma_dc_only_csbp, u1_sub_mb_num))
  ------------------
  |  |   54|  39.0k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  |  |  ------------------
  |  |  |  Branch (54:23): [True: 9.99k, False: 29.0k]
  |  |  ------------------
  ------------------
 1311|  9.99k|                    {
 1312|  9.99k|                        ps_dec->pf_iquant_itrans_recon_luma_4x4_dc(
 1313|  9.99k|                                        pi2_y_coeff1,
 1314|  9.99k|                                        pu1_luma_rec_buffer,
 1315|  9.99k|                                        pu1_luma_rec_buffer,
 1316|  9.99k|                                        ui_rec_width,
 1317|  9.99k|                                        ui_rec_width,
 1318|  9.99k|                                        gau2_ih264_iquant_scale_4x4[ps_cur_mb_info->u1_qp_rem6],
 1319|  9.99k|                                        (UWORD16 *)ps_dec->s_high_profile.i2_scalinglist4x4[0],
 1320|  9.99k|                                        ps_cur_mb_info->u1_qp_div6, ai2_tmp, 0,
 1321|  9.99k|                                        NULL);
 1322|  9.99k|                    }
 1323|  29.0k|                    else
 1324|  29.0k|                    {
 1325|  29.0k|                        ps_dec->pf_iquant_itrans_recon_luma_4x4(
 1326|  29.0k|                                        pi2_y_coeff1,
 1327|  29.0k|                                        pu1_luma_rec_buffer,
 1328|  29.0k|                                        pu1_luma_rec_buffer,
 1329|  29.0k|                                        ui_rec_width,
 1330|  29.0k|                                        ui_rec_width,
 1331|  29.0k|                                        gau2_ih264_iquant_scale_4x4[ps_cur_mb_info->u1_qp_rem6],
 1332|  29.0k|                                        (UWORD16 *)ps_dec->s_high_profile.i2_scalinglist4x4[0],
 1333|  29.0k|                                        ps_cur_mb_info->u1_qp_div6, ai2_tmp, 0,
 1334|  29.0k|                                        NULL);
 1335|  29.0k|                    }
 1336|  39.0k|                }
 1337|       |
 1338|  39.0k|            }
 1339|       |
 1340|       |            /*---------------------------------------------------------------*/
 1341|       |            /* Update sub block number                                       */
 1342|       |            /*---------------------------------------------------------------*/
 1343|   309k|            pi2_y_coeff1 += 16;
 1344|   309k|            pu1_luma_rec_buffer +=
 1345|   309k|                            (u1_sub_blk_x == 3) ? (ui_rec_width << 2) - 12 : 4;
  ------------------
  |  Branch (1345:29): [True: 77.4k, False: 232k]
  ------------------
 1346|   309k|            pu1_luma_pred_buffer +=
 1347|   309k|                            (u1_sub_blk_x == 3) ? (ui_pred_width << 2) - 12 : 4;
  ------------------
  |  Branch (1347:29): [True: 77.4k, False: 232k]
  ------------------
 1348|       |            /* CHANGED CODE */
 1349|   309k|            pi1_cur_pred_mode[u1_sub_blk_x] = i1_intra_pred;
 1350|   309k|            pi1_left_pred_mode[u1_sub_blk_y] = i1_intra_pred;
 1351|   309k|        }
 1352|  19.3k|    }
 1353|  37.4k|    else if((u1_mb_type == I_4x4_MB) && (ps_cur_mb_info->u1_tran_form8x8 == 1))
  ------------------
  |  |  417|  37.4k|#define I_4x4_MB    0
  ------------------
  |  Branch (1353:13): [True: 37.4k, False: 0]
  |  Branch (1353:41): [True: 37.4k, False: 0]
  ------------------
 1354|  37.4k|    {
 1355|  37.4k|        UWORD8 u1_is_left_sub_block, u1_is_top_sub_block = uc_useTopMB;
 1356|  37.4k|        UWORD8 u1_sub_blk_x, u1_sub_blk_y;
 1357|  37.4k|        UWORD32 u4_sub_mb_num;
 1358|  37.4k|        WORD8 i1_top_pred_mode;
 1359|  37.4k|        WORD8 i1_left_pred_mode;
 1360|  37.4k|        UWORD8 *pu1_top, *pu1_left, *pu1_top_left;
 1361|  37.4k|        WORD8 *pi1_cur_pred_mode, *pi1_left_pred_mode, *pc_topPredMode;
 1362|  37.4k|        UWORD16 ui2_left_pred_buf_width = 0xffff;
 1363|  37.4k|        WORD8 i1_intra_pred;
 1364|  37.4k|        UWORD8 *pu1_prev_intra4x4_pred_mode_flag = pu1_prev_intra4x4_pred_mode_data;
 1365|  37.4k|        UWORD8 *pu1_rem_intra4x4_pred_mode = pu1_prev_intra4x4_pred_mode_data + 4;
 1366|  37.4k|        WORD16 *pi2_y_coeff1;
 1367|  37.4k|        UWORD16 ui2_top_rt_mask;
 1368|  37.4k|        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.4k|        ui2_top_rt_mask = (u1_use_top_right_mb << 1) | (0x4);
 1398|       |
 1399|  37.4k|        if(uc_useTopMB)
  ------------------
  |  Branch (1399:12): [True: 24.4k, False: 12.9k]
  ------------------
 1400|  24.4k|        {
 1401|  24.4k|            ui2_top_rt_mask |= 0x1;
 1402|  24.4k|        }
 1403|       |
 1404|       |        /* Top Related initialisations */
 1405|  37.4k|        pi1_cur_pred_mode = ps_cur_mb_info->ps_curmb->pi1_intrapredmodes;
 1406|  37.4k|        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.4k|        if(u1_top_available)
  ------------------
  |  Branch (1415:12): [True: 26.7k, False: 10.6k]
  ------------------
 1416|  26.7k|        {
 1417|  26.7k|            if(ps_top_mb->u1_mb_type == I_4x4_MB)
  ------------------
  |  |  417|  26.7k|#define I_4x4_MB    0
  ------------------
  |  Branch (1417:16): [True: 20.9k, False: 5.78k]
  ------------------
 1418|  20.9k|            {
 1419|  20.9k|                *(WORD32*)pi1_cur_pred_mode = *(WORD32*)pc_topPredMode;
 1420|  20.9k|            }
 1421|  5.78k|            else
 1422|  5.78k|            {
 1423|  5.78k|                *(WORD32*)pi1_cur_pred_mode =
 1424|  5.78k|                                (uc_useTopMB) ? DC_DC_DC_DC : NOT_VALID;
  ------------------
  |  |  434|  3.52k|#define DC_DC_DC_DC   0x02020202 /*packed 4 bytes used in Decode Intra Mb*/
  ------------------
                                              (uc_useTopMB) ? DC_DC_DC_DC : NOT_VALID;
  ------------------
  |  |  433|  8.03k|#define NOT_VALID -1
  ------------------
  |  Branch (1424:33): [True: 3.52k, False: 2.25k]
  ------------------
 1425|  5.78k|            }
 1426|  26.7k|        }
 1427|  10.6k|        else
 1428|  10.6k|        {
 1429|  10.6k|            *(WORD32*)pi1_cur_pred_mode = NOT_VALID;
  ------------------
  |  |  433|  10.6k|#define NOT_VALID -1
  ------------------
 1430|  10.6k|        }
 1431|       |
 1432|  37.4k|        pu1_top = puc_top - 8;
 1433|       |
 1434|       |        /*Left Related initialisations*/
 1435|  37.4k|        pi1_left_pred_mode = ps_dec->pi1_left_pred_mode;
 1436|       |
 1437|  37.4k|        if(!u1_mbaff)
  ------------------
  |  Branch (1437:12): [True: 37.4k, False: 0]
  ------------------
 1438|  37.4k|        {
 1439|  37.4k|            if(u1_left_available)
  ------------------
  |  Branch (1439:16): [True: 28.0k, False: 9.32k]
  ------------------
 1440|  28.0k|            {
 1441|  28.0k|                if(ps_left_mb->u1_mb_type != I_4x4_MB)
  ------------------
  |  |  417|  28.0k|#define I_4x4_MB    0
  ------------------
  |  Branch (1441:20): [True: 5.18k, False: 22.8k]
  ------------------
 1442|  5.18k|                {
 1443|  5.18k|                    *(WORD32*)pi1_left_pred_mode =
 1444|  5.18k|                                    (u2_use_left_mb_pack) ?
  ------------------
  |  Branch (1444:37): [True: 3.63k, False: 1.55k]
  ------------------
 1445|  3.63k|                                    DC_DC_DC_DC :
  ------------------
  |  |  434|  3.63k|#define DC_DC_DC_DC   0x02020202 /*packed 4 bytes used in Decode Intra Mb*/
  ------------------
 1446|  5.18k|                                                            NOT_VALID;
  ------------------
  |  |  433|  6.73k|#define NOT_VALID -1
  ------------------
 1447|  5.18k|                }
 1448|  28.0k|            }
 1449|  9.32k|            else
 1450|  9.32k|            {
 1451|  9.32k|                *(WORD32*)pi1_left_pred_mode = NOT_VALID;
  ------------------
  |  |  433|  9.32k|#define NOT_VALID -1
  ------------------
 1452|  9.32k|            }
 1453|  37.4k|        }
 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.4k|        pi2_y_coeff1 = pi2_y_coeff;
 1558|       |
 1559|  37.4k|        if(u1_use_top_left_mb)
  ------------------
  |  Branch (1559:12): [True: 17.7k, False: 19.6k]
  ------------------
 1560|  17.7k|        {
 1561|  17.7k|            pu1_top_left = pu1_ytop_left;
 1562|  17.7k|        }
 1563|  19.6k|        else
 1564|  19.6k|        {
 1565|  19.6k|            pu1_top_left = NULL;
 1566|  19.6k|        }
 1567|       |
 1568|       |        /* Scan the sub-blocks in Raster Scan Order */
 1569|   187k|        for(u4_sub_mb_num = 0; u4_sub_mb_num < 4; u4_sub_mb_num++)
  ------------------
  |  Branch (1569:32): [True: 149k, False: 37.4k]
  ------------------
 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.4k, False: 112k]
  ------------------
 1577|  37.4k|            {
 1578|  37.4k|                i1_left_pred_mode = pi1_left_pred_mode[(u1_sub_blk_y << 1)
 1579|  37.4k|                                + u4_4x4_left_offset];
 1580|  37.4k|            }
 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.8k, False: 74.8k]
  ------------------
 1586|  74.8k|            {
 1587|  74.8k|                u1_is_left_sub_block = 1;
 1588|  74.8k|            }
 1589|  74.8k|            else
 1590|  74.8k|            {
 1591|  74.8k|                u1_is_left_sub_block =
 1592|  74.8k|                                (u1_sub_blk_y < 1) ?
  ------------------
  |  Branch (1592:33): [True: 37.4k, False: 37.4k]
  ------------------
 1593|  37.4k|                                                (CHECKBIT(u2_use_left_mb_pack,
  ------------------
  |  |   54|  37.4k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  ------------------
 1594|  37.4k|                                                          0)) :
 1595|  74.8k|                                                (u2_use_left_mb_pack >> 8);
 1596|  74.8k|            }
 1597|       |
 1598|       |            /***************** Top *********************/
 1599|   149k|            if(u1_sub_blk_y)
  ------------------
  |  Branch (1599:16): [True: 74.8k, False: 74.8k]
  ------------------
 1600|  74.8k|            {
 1601|  74.8k|                u1_is_top_sub_block = 1;
 1602|       |                // sushant
 1603|  74.8k|                pu1_top = /*pu1_luma_pred_buffer*/pu1_luma_rec_buffer - ui_rec_width;
 1604|  74.8k|            }
 1605|  74.8k|            else
 1606|  74.8k|            {
 1607|  74.8k|                pu1_top += 8;
 1608|  74.8k|            }
 1609|       |
 1610|       |            /***************** Left *********************/
 1611|   149k|            if((u1_sub_blk_x) | (u4_num_pmbair != 0))
  ------------------
  |  Branch (1611:16): [True: 130k, False: 18.6k]
  ------------------
 1612|   130k|            {
 1613|       |                // sushant
 1614|   130k|                pu1_left = /*pu1_luma_pred_buffer*/pu1_luma_rec_buffer - 1;
 1615|   130k|                ui2_left_pred_buf_width = ui_rec_width;
 1616|   130k|            }
 1617|  18.6k|            else
 1618|  18.6k|            {
 1619|  18.6k|                pu1_left = pu1_yleft;
 1620|  18.6k|                pu1_yleft += (ui_rec_width << 3);
 1621|  18.6k|                ui2_left_pred_buf_width = ui_rec_width;
 1622|  18.6k|            }
 1623|       |
 1624|       |            /***************** Top Left *********************/
 1625|   149k|            if(u4_sub_mb_num)
  ------------------
  |  Branch (1625:16): [True: 112k, False: 37.4k]
  ------------------
 1626|   112k|            {
 1627|   112k|                pu1_top_left = (u1_sub_blk_x) ?
  ------------------
  |  Branch (1627:32): [True: 74.8k, False: 37.4k]
  ------------------
 1628|  74.8k|                                pu1_top - 1 : pu1_left - ui_rec_width;
 1629|       |
 1630|   112k|                if((u1_sub_blk_x && (!u1_is_top_sub_block))
  ------------------
  |  Branch (1630:21): [True: 74.8k, False: 37.4k]
  |  Branch (1630:37): [True: 12.9k, False: 61.8k]
  ------------------
 1631|  99.2k|                                || ((!u1_sub_blk_x) && (!u1_is_left_sub_block)))
  ------------------
  |  Branch (1631:37): [True: 37.4k, False: 61.8k]
  |  Branch (1631:56): [True: 10.8k, False: 26.5k]
  ------------------
 1632|  23.8k|                {
 1633|  23.8k|                    pu1_top_left = NULL;
 1634|  23.8k|                }
 1635|   112k|            }
 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.0k, False: 104k]
  ------------------
 1641|   104k|                            DC : MIN(i1_left_pred_mode, i1_top_pred_mode);
  ------------------
  |  |  431|  45.0k|#define DC      2
  ------------------
                                          DC : MIN(i1_left_pred_mode, i1_top_pred_mode);
  ------------------
  |  |   61|   254k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 25.1k, False: 79.4k]
  |  |  ------------------
  ------------------
 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: 40.5k, False: 109k]
  ------------------
 1654|  40.5k|                {
 1655|  40.5k|                    i1_intra_pred = pu1_rem_intra4x4_pred_mode[u4_sub_mb_num]
 1656|  40.5k|                                    + (pu1_rem_intra4x4_pred_mode[u4_sub_mb_num]
 1657|  40.5k|                                                    >= i1_intra_pred);
 1658|  40.5k|                }
 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: 345, False: 149k]
  |  |  |  Branch (77:54): [True: 226, False: 149k]
  |  |  ------------------
  ------------------
 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.32k, False: 144k]
  ------------------
 1664|  5.32k|                    {
 1665|  5.32k|                        i1_intra_pred = 0;
 1666|  5.32k|                        ps_dec->i4_error_code = ERROR_INTRAPRED;
 1667|  5.32k|                    }
 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: 43.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: 88.7k, False: 60.9k]
  |  |  ------------------
  ------------------
 1699|  88.7k|            {
 1700|  88.7k|                WORD16 *pi2_scale_matrix_ptr;
 1701|  88.7k|                WORD16 ai2_tmp[64];
 1702|       |
 1703|  88.7k|                pi2_scale_matrix_ptr =
 1704|  88.7k|                                ps_dec->s_high_profile.i2_scalinglist8x8[0];
 1705|  88.7k|                PROFILE_DISABLE_IQ_IT_RECON()
  ------------------
  |  |   98|  88.7k|#define PROFILE_DISABLE_IQ_IT_RECON() ;
  ------------------
 1706|  88.7k|                {
 1707|  88.7k|                    if(CHECKBIT(u4_luma_dc_only_cbp, u4_sub_mb_num))
  ------------------
  |  |   54|  88.7k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  |  |  ------------------
  |  |  |  Branch (54:23): [True: 18.2k, False: 70.4k]
  |  |  ------------------
  ------------------
 1708|  18.2k|                    {
 1709|  18.2k|                        ps_dec->pf_iquant_itrans_recon_luma_8x8_dc(
 1710|  18.2k|                                        pi2_y_coeff1,
 1711|  18.2k|                                        pu1_luma_rec_buffer,
 1712|  18.2k|                                        pu1_luma_rec_buffer,
 1713|  18.2k|                                        ui_rec_width,
 1714|  18.2k|                                        ui_rec_width,
 1715|  18.2k|                                        gau1_ih264d_dequant8x8_cavlc[ps_cur_mb_info->u1_qp_rem6],
 1716|  18.2k|                                        (UWORD16 *)pi2_scale_matrix_ptr,
 1717|  18.2k|                                        ps_cur_mb_info->u1_qp_div6, ai2_tmp, 0,
 1718|  18.2k|                                        NULL);
 1719|  18.2k|                    }
 1720|  70.4k|                    else
 1721|  70.4k|                    {
 1722|  70.4k|                        ps_dec->pf_iquant_itrans_recon_luma_8x8(
 1723|  70.4k|                                        pi2_y_coeff1,
 1724|  70.4k|                                        pu1_luma_rec_buffer,
 1725|  70.4k|                                        pu1_luma_rec_buffer,
 1726|  70.4k|                                        ui_rec_width,
 1727|  70.4k|                                        ui_rec_width,
 1728|  70.4k|                                        gau1_ih264d_dequant8x8_cavlc[ps_cur_mb_info->u1_qp_rem6],
 1729|  70.4k|                                        (UWORD16 *)pi2_scale_matrix_ptr,
 1730|  70.4k|                                        ps_cur_mb_info->u1_qp_div6, ai2_tmp, 0,
 1731|  70.4k|                                        NULL);
 1732|  70.4k|                    }
 1733|  88.7k|                }
 1734|       |
 1735|  88.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.8k, False: 74.8k]
  ------------------
 1744|  74.8k|                                            (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.4k|    }
 1756|       |    /* Decode Chroma Block */
 1757|   145k|    ih264d_unpack_chroma_coeff4x4_mb(ps_dec,
 1758|   145k|                                     ps_cur_mb_info);
 1759|       |    /*--------------------------------------------------------------------*/
 1760|       |    /* Chroma Blocks decoding                                             */
 1761|       |    /*--------------------------------------------------------------------*/
 1762|   145k|    {
 1763|   145k|        UWORD8 u1_intra_chrom_pred_mode;
 1764|   145k|        UWORD8 u1_chroma_cbp = (UWORD8)(ps_cur_mb_info->u1_cbp >> 4);
 1765|       |
 1766|       |        /*--------------------------------------------------------------------*/
 1767|       |        /* Perform Chroma intra prediction                                    */
 1768|       |        /*--------------------------------------------------------------------*/
 1769|       |
 1770|   145k|        u1_intra_chrom_pred_mode = CHROMA_TO_LUMA_INTRA_MODE(
  ------------------
  |  |   44|   145k|#define CHROMA_TO_LUMA_INTRA_MODE(x)   (x ^ ( (!(x & 0x01)) << 1))
  ------------------
 1771|   145k|                        ps_cur_mb_info->u1_chroma_pred_mode);
 1772|       |
 1773|   145k|        {
 1774|   145k|            UWORD8 u1_packed_modes = (u1_top_available << 1)
 1775|   145k|                            + u1_left_available;
 1776|   145k|            UWORD8 u1_err_code =
 1777|   145k|                            (u1_intra_chrom_pred_mode & 1) ?
  ------------------
  |  Branch (1777:29): [True: 51.3k, False: 93.7k]
  ------------------
 1778|  51.3k|                                            u1_intra_chrom_pred_mode :
 1779|   145k|                                            (u1_intra_chrom_pred_mode ^ 2);
 1780|   145k|            if((u1_err_code & u1_packed_modes) ^ u1_err_code)
  ------------------
  |  Branch (1780:16): [True: 13.4k, False: 131k]
  ------------------
 1781|  13.4k|            {
 1782|  13.4k|                u1_intra_chrom_pred_mode = 0;
 1783|  13.4k|                ps_dec->i4_error_code = ERROR_INTRAPRED;
 1784|  13.4k|            }
 1785|   145k|        }
 1786|       |
 1787|       |        /* CHANGED CODE */
 1788|   145k|        if(u1_chroma_cbp != CBPC_ALLZERO)
  ------------------
  |  |  507|   145k|#define CBPC_ALLZERO    0
  ------------------
  |  Branch (1788:12): [True: 46.4k, False: 98.6k]
  ------------------
 1789|  46.4k|        {
 1790|  46.4k|            UWORD16 u2_chroma_csbp =
 1791|  46.4k|                            (u1_chroma_cbp == CBPC_ACZERO) ?
  ------------------
  |  |  508|  46.4k|#define CBPC_ACZERO     1
  ------------------
  |  Branch (1791:29): [True: 32.6k, False: 13.7k]
  ------------------
 1792|  32.6k|                                            0 : ps_cur_mb_info->u2_chroma_csbp;
 1793|  46.4k|            UWORD32 u4_scale_u;
 1794|  46.4k|            UWORD32 u4_scale_v;
 1795|       |
 1796|  46.4k|            {
 1797|  46.4k|                UWORD16 au2_ngbr_pels[33];
 1798|  46.4k|                UWORD8 *pu1_ngbr_pels = (UWORD8 *)au2_ngbr_pels;
 1799|  46.4k|                UWORD16 *pu2_left_uv;
 1800|  46.4k|                UWORD16 *pu2_topleft_uv;
 1801|  46.4k|                WORD32 use_left1 = (u2_use_left_mb_pack & 0x0ff);
 1802|  46.4k|                WORD32 use_left2 = (u2_use_left_mb_pack & 0xff00) >> 8;
 1803|       |
 1804|  46.4k|                pu2_left_uv = (UWORD16 *)pu1_uleft;
 1805|  46.4k|                pu2_topleft_uv = (UWORD16 *)pu1_u_top_left;
 1806|       |                /* Get neighbour pixels */
 1807|       |                /* left pels */
 1808|  46.4k|                if(u2_use_left_mb_pack)
  ------------------
  |  Branch (1808:20): [True: 28.5k, False: 17.8k]
  ------------------
 1809|  28.5k|                {
 1810|  28.5k|                    WORD32 i;
 1811|  28.5k|                    if(use_left1)
  ------------------
  |  Branch (1811:24): [True: 28.5k, False: 0]
  ------------------
 1812|  28.5k|                    {
 1813|   142k|                        for(i = 0; i < 4; i++)
  ------------------
  |  Branch (1813:36): [True: 114k, False: 28.5k]
  ------------------
 1814|   114k|                            au2_ngbr_pels[8 - 1 - i] = pu2_left_uv[i
 1815|   114k|                                            * u4_recwidth_cr / YUV420SP_FACTOR];
  ------------------
  |  |  119|   114k|#define YUV420SP_FACTOR 2
  ------------------
 1816|  28.5k|                    }
 1817|      0|                    else
 1818|      0|                    {
 1819|      0|                        memset(au2_ngbr_pels + 4, 0, 4 * sizeof(UWORD16));
 1820|      0|                    }
 1821|       |
 1822|  28.5k|                    if(use_left2)
  ------------------
  |  Branch (1822:24): [True: 28.5k, False: 0]
  ------------------
 1823|  28.5k|                    {
 1824|   142k|                        for(i = 4; i < 8; i++)
  ------------------
  |  Branch (1824:36): [True: 114k, False: 28.5k]
  ------------------
 1825|   114k|                            au2_ngbr_pels[8 - 1 - i] = pu2_left_uv[i
 1826|   114k|                                            * u4_recwidth_cr / YUV420SP_FACTOR];
  ------------------
  |  |  119|   114k|#define YUV420SP_FACTOR 2
  ------------------
 1827|  28.5k|                    }
 1828|      0|                    else
 1829|      0|                    {
 1830|      0|                        memset(au2_ngbr_pels, 0, 4 * sizeof(UWORD16));
 1831|      0|                    }
 1832|  28.5k|                }
 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|  46.4k|                au2_ngbr_pels[8] = *pu2_topleft_uv;
 1840|       |
 1841|       |                /* top pels */
 1842|  46.4k|                if(uc_useTopMB)
  ------------------
  |  Branch (1842:20): [True: 34.0k, False: 12.4k]
  ------------------
 1843|  34.0k|                {
 1844|  34.0k|                    memcpy(au2_ngbr_pels + 8 + 1, pu1_top_u,
 1845|  34.0k|                           8 * sizeof(UWORD16));
 1846|  34.0k|                }
 1847|  12.4k|                else
 1848|  12.4k|                {
 1849|  12.4k|                    memset(au2_ngbr_pels + 8 + 1, 0, 8 * sizeof(UWORD16));
 1850|  12.4k|                }
 1851|       |
 1852|  46.4k|                PROFILE_DISABLE_INTRA_PRED()
  ------------------
  |  |  105|  46.4k|#define PROFILE_DISABLE_INTRA_PRED() ;
  ------------------
 1853|  46.4k|                ps_dec->apf_intra_pred_chroma[u1_intra_chrom_pred_mode](
 1854|  46.4k|                                pu1_ngbr_pels,
 1855|  46.4k|                                pu1_mb_cb_rei1_buffer,
 1856|  46.4k|                                1,
 1857|  46.4k|                                u4_recwidth_cr,
 1858|  46.4k|                                ((uc_useTopMB << 2) | (use_left2 << 4)
 1859|  46.4k|                                                | use_left1));
 1860|  46.4k|            }
 1861|  46.4k|            u4_scale_u = ps_cur_mb_info->u1_qpc_div6;
 1862|  46.4k|            u4_scale_v = ps_cur_mb_info->u1_qpcr_div6;
 1863|  46.4k|            pi2_y_coeff = ps_dec->pi2_coeff_data;
 1864|       |
 1865|  46.4k|            {
 1866|  46.4k|                UWORD32 i;
 1867|  46.4k|                WORD16 ai2_tmp[16];
 1868|   232k|                for(i = 0; i < 4; i++)
  ------------------
  |  Branch (1868:28): [True: 185k, False: 46.4k]
  ------------------
 1869|   185k|                {
 1870|   185k|                    WORD16 *pi2_level = pi2_y_coeff + (i << 4);
 1871|   185k|                    UWORD8 *pu1_pred_sblk = pu1_mb_cb_rei1_buffer
 1872|   185k|                                    + ((i & 0x1) * BLK_SIZE * YUV420SP_FACTOR)
  ------------------
  |  |  556|   185k|#define BLK_SIZE             4
  ------------------
                                                  + ((i & 0x1) * BLK_SIZE * YUV420SP_FACTOR)
  ------------------
  |  |  119|   185k|#define YUV420SP_FACTOR 2
  ------------------
 1873|   185k|                                    + (i >> 1) * (u4_recwidth_cr << 2);
 1874|   185k|                    PROFILE_DISABLE_IQ_IT_RECON()
  ------------------
  |  |   98|   185k|#define PROFILE_DISABLE_IQ_IT_RECON() ;
  ------------------
 1875|   185k|                    {
 1876|   185k|                        if(CHECKBIT(u2_chroma_csbp, i))
  ------------------
  |  |   54|   185k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  |  |  ------------------
  |  |  |  Branch (54:23): [True: 13.0k, False: 172k]
  |  |  ------------------
  ------------------
 1877|  13.0k|                        {
 1878|  13.0k|                            ps_dec->pf_iquant_itrans_recon_chroma_4x4(
 1879|  13.0k|                                            pi2_level,
 1880|  13.0k|                                            pu1_pred_sblk,
 1881|  13.0k|                                            pu1_pred_sblk,
 1882|  13.0k|                                            u4_recwidth_cr,
 1883|  13.0k|                                            u4_recwidth_cr,
 1884|  13.0k|                                            gau2_ih264_iquant_scale_4x4[ps_cur_mb_info->u1_qpc_rem6],
 1885|  13.0k|                                            (UWORD16 *)ps_dec->s_high_profile.i2_scalinglist4x4[1],
 1886|  13.0k|                                            u4_scale_u, ai2_tmp, pi2_level);
 1887|  13.0k|                        }
 1888|   172k|                        else if(pi2_level[0] != 0)
  ------------------
  |  Branch (1888:33): [True: 113k, False: 58.9k]
  ------------------
 1889|   113k|                        {
 1890|   113k|                            ps_dec->pf_iquant_itrans_recon_chroma_4x4_dc(
 1891|   113k|                                            pi2_level,
 1892|   113k|                                            pu1_pred_sblk,
 1893|   113k|                                            pu1_pred_sblk,
 1894|   113k|                                            u4_recwidth_cr,
 1895|   113k|                                            u4_recwidth_cr,
 1896|   113k|                                            gau2_ih264_iquant_scale_4x4[ps_cur_mb_info->u1_qpc_rem6],
 1897|   113k|                                            (UWORD16 *)ps_dec->s_high_profile.i2_scalinglist4x4[1],
 1898|   113k|                                            u4_scale_u, ai2_tmp, pi2_level);
 1899|   113k|                        }
 1900|   185k|                    }
 1901|       |
 1902|   185k|                }
 1903|  46.4k|            }
 1904|       |
 1905|  46.4k|            pi2_y_coeff += MB_CHROM_SIZE;
  ------------------
  |  |  564|  46.4k|#define MB_CHROM_SIZE                 64
  ------------------
 1906|  46.4k|            u2_chroma_csbp = u2_chroma_csbp >> 4;
 1907|  46.4k|            {
 1908|  46.4k|                UWORD32 i;
 1909|  46.4k|                WORD16 ai2_tmp[16];
 1910|   232k|                for(i = 0; i < 4; i++)
  ------------------
  |  Branch (1910:28): [True: 185k, False: 46.4k]
  ------------------
 1911|   185k|                {
 1912|   185k|                    WORD16 *pi2_level = pi2_y_coeff + (i << 4);
 1913|   185k|                    UWORD8 *pu1_pred_sblk = pu1_mb_cb_rei1_buffer + 1
 1914|   185k|                                    + ((i & 0x1) * BLK_SIZE * YUV420SP_FACTOR)
  ------------------
  |  |  556|   185k|#define BLK_SIZE             4
  ------------------
                                                  + ((i & 0x1) * BLK_SIZE * YUV420SP_FACTOR)
  ------------------
  |  |  119|   185k|#define YUV420SP_FACTOR 2
  ------------------
 1915|   185k|                                    + (i >> 1) * (u4_recwidth_cr << 2);
 1916|   185k|                    PROFILE_DISABLE_IQ_IT_RECON()
  ------------------
  |  |   98|   185k|#define PROFILE_DISABLE_IQ_IT_RECON() ;
  ------------------
 1917|   185k|                    {
 1918|   185k|                        if(CHECKBIT(u2_chroma_csbp, i))
  ------------------
  |  |   54|   185k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  |  |  ------------------
  |  |  |  Branch (54:23): [True: 14.1k, False: 171k]
  |  |  ------------------
  ------------------
 1919|  14.1k|                        {
 1920|  14.1k|                            ps_dec->pf_iquant_itrans_recon_chroma_4x4(
 1921|  14.1k|                                            pi2_level,
 1922|  14.1k|                                            pu1_pred_sblk,
 1923|  14.1k|                                            pu1_pred_sblk,
 1924|  14.1k|                                            u4_recwidth_cr,
 1925|  14.1k|                                            u4_recwidth_cr,
 1926|  14.1k|                                            gau2_ih264_iquant_scale_4x4[ps_cur_mb_info->u1_qpcr_rem6],
 1927|  14.1k|                                            (UWORD16 *)ps_dec->s_high_profile.i2_scalinglist4x4[2],
 1928|  14.1k|                                            u4_scale_v, ai2_tmp, pi2_level);
 1929|  14.1k|                        }
 1930|   171k|                        else if(pi2_level[0] != 0)
  ------------------
  |  Branch (1930:33): [True: 102k, False: 69.0k]
  ------------------
 1931|   102k|                        {
 1932|   102k|                            ps_dec->pf_iquant_itrans_recon_chroma_4x4_dc(
 1933|   102k|                                            pi2_level,
 1934|   102k|                                            pu1_pred_sblk,
 1935|   102k|                                            pu1_pred_sblk,
 1936|   102k|                                            u4_recwidth_cr,
 1937|   102k|                                            u4_recwidth_cr,
 1938|   102k|                                            gau2_ih264_iquant_scale_4x4[ps_cur_mb_info->u1_qpcr_rem6],
 1939|   102k|                                            (UWORD16 *)ps_dec->s_high_profile.i2_scalinglist4x4[2],
 1940|   102k|                                            u4_scale_v, ai2_tmp, pi2_level);
 1941|   102k|                        }
 1942|   185k|                    }
 1943|   185k|                }
 1944|  46.4k|            }
 1945|       |
 1946|  46.4k|        }
 1947|  98.6k|        else
 1948|  98.6k|        {
 1949|       |            /* If no inverse transform is needed, pass recon buffer pointer */
 1950|       |            /* to Intraprediction module instead of pred buffer pointer     */
 1951|  98.6k|            {
 1952|  98.6k|                UWORD16 au2_ngbr_pels[33];
 1953|  98.6k|                UWORD8 *pu1_ngbr_pels = (UWORD8 *)au2_ngbr_pels;
 1954|  98.6k|                UWORD16 *pu2_left_uv;
 1955|  98.6k|                UWORD16 *pu2_topleft_uv;
 1956|  98.6k|                WORD32 use_left1 = (u2_use_left_mb_pack & 0x0ff);
 1957|  98.6k|                WORD32 use_left2 = (u2_use_left_mb_pack & 0xff00) >> 8;
 1958|       |
 1959|  98.6k|                pu2_topleft_uv = (UWORD16 *)pu1_u_top_left;
 1960|  98.6k|                pu2_left_uv = (UWORD16 *)pu1_uleft;
 1961|       |
 1962|       |                /* Get neighbour pixels */
 1963|       |                /* left pels */
 1964|  98.6k|                if(u2_use_left_mb_pack)
  ------------------
  |  Branch (1964:20): [True: 72.4k, False: 26.2k]
  ------------------
 1965|  72.4k|                {
 1966|  72.4k|                    WORD32 i;
 1967|  72.4k|                    if(use_left1)
  ------------------
  |  Branch (1967:24): [True: 72.4k, False: 0]
  ------------------
 1968|  72.4k|                    {
 1969|   362k|                        for(i = 0; i < 4; i++)
  ------------------
  |  Branch (1969:36): [True: 289k, False: 72.4k]
  ------------------
 1970|   289k|                            au2_ngbr_pels[8 - 1 - i] = pu2_left_uv[i
 1971|   289k|                                            * u4_recwidth_cr / YUV420SP_FACTOR];
  ------------------
  |  |  119|   289k|#define YUV420SP_FACTOR 2
  ------------------
 1972|  72.4k|                    }
 1973|      0|                    else
 1974|      0|                    {
 1975|      0|                        memset(au2_ngbr_pels + 4, 0, 4 * sizeof(UWORD16));
 1976|      0|                    }
 1977|       |
 1978|  72.4k|                    if(use_left2)
  ------------------
  |  Branch (1978:24): [True: 72.4k, False: 0]
  ------------------
 1979|  72.4k|                    {
 1980|   362k|                        for(i = 4; i < 8; i++)
  ------------------
  |  Branch (1980:36): [True: 289k, False: 72.4k]
  ------------------
 1981|   289k|                            au2_ngbr_pels[8 - 1 - i] = pu2_left_uv[i
 1982|   289k|                                            * u4_recwidth_cr / YUV420SP_FACTOR];
  ------------------
  |  |  119|   289k|#define YUV420SP_FACTOR 2
  ------------------
 1983|  72.4k|                    }
 1984|      0|                    else
 1985|      0|                    {
 1986|      0|                        memset(au2_ngbr_pels, 0, 4 * sizeof(UWORD16));
 1987|      0|                    }
 1988|       |
 1989|  72.4k|                }
 1990|  26.2k|                else
 1991|  26.2k|                {
 1992|  26.2k|                    memset(au2_ngbr_pels, 0, 8 * sizeof(UWORD16));
 1993|  26.2k|                }
 1994|       |
 1995|       |                /* top left pels */
 1996|  98.6k|                au2_ngbr_pels[8] = *pu2_topleft_uv;
 1997|       |
 1998|       |                /* top pels */
 1999|  98.6k|                if(uc_useTopMB)
  ------------------
  |  Branch (1999:20): [True: 70.5k, False: 28.1k]
  ------------------
 2000|  70.5k|                {
 2001|  70.5k|                    memcpy(au2_ngbr_pels + 8 + 1, pu1_top_u,
 2002|  70.5k|                           8 * sizeof(UWORD16));
 2003|  70.5k|                }
 2004|  28.1k|                else
 2005|  28.1k|                {
 2006|  28.1k|                    memset(au2_ngbr_pels + 8 + 1, 0, 8 * sizeof(UWORD16));
 2007|  28.1k|                }
 2008|       |
 2009|  98.6k|                PROFILE_DISABLE_INTRA_PRED()
  ------------------
  |  |  105|  98.6k|#define PROFILE_DISABLE_INTRA_PRED() ;
  ------------------
 2010|  98.6k|                ps_dec->apf_intra_pred_chroma[u1_intra_chrom_pred_mode](
 2011|  98.6k|                                pu1_ngbr_pels,
 2012|  98.6k|                                pu1_mb_cb_rei1_buffer,
 2013|  98.6k|                                1,
 2014|  98.6k|                                u4_recwidth_cr,
 2015|  98.6k|                                ((uc_useTopMB << 2) | (use_left2 << 4)
 2016|  98.6k|                                                | use_left1));
 2017|  98.6k|            }
 2018|       |
 2019|  98.6k|        }
 2020|       |
 2021|   145k|    }
 2022|   145k|    return OK;
  ------------------
  |  |  114|   145k|#define OK        0
  ------------------
 2023|   145k|}

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

ih264d_scaling_list:
   52|  20.1k|{
   53|  20.1k|    WORD32 i4_j, i4_delta_scale, i4_lastScale = 8, i4_nextScale = 8;
   54|  20.1k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
   55|  20.1k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
   56|       |
   57|  20.1k|    *pu1_use_default_scaling_matrix_flag = 0;
   58|       |
   59|   543k|    for(i4_j = 0; i4_j < i4_size_of_scalinglist; i4_j++)
  ------------------
  |  Branch (59:19): [True: 524k, False: 19.4k]
  ------------------
   60|   524k|    {
   61|   524k|        if(i4_nextScale != 0)
  ------------------
  |  Branch (61:12): [True: 222k, False: 301k]
  ------------------
   62|   222k|        {
   63|   222k|            i4_delta_scale = ih264d_sev(pu4_bitstrm_ofst,
   64|   222k|                                        pu4_bitstrm_buf);
   65|       |
   66|   222k|            if(i4_delta_scale < MIN_H264_DELTA_SCALE ||
  ------------------
  |  |  639|   444k|#define MIN_H264_DELTA_SCALE (-128)
  ------------------
  |  Branch (66:16): [True: 149, False: 222k]
  ------------------
   67|   222k|                        i4_delta_scale > MAX_H264_DELTA_SCALE)
  ------------------
  |  |  644|   222k|#define MAX_H264_DELTA_SCALE 127
  ------------------
  |  Branch (67:25): [True: 624, False: 221k]
  ------------------
   68|    773|            {
   69|    773|                return ERROR_INV_RANGE_QP_T;
   70|    773|            }
   71|   221k|            i4_nextScale = ((i4_lastScale + i4_delta_scale + 256) & 0xff);
   72|       |
   73|   221k|            *pu1_use_default_scaling_matrix_flag = ((i4_j == 0)
  ------------------
  |  Branch (73:53): [True: 20.1k, False: 201k]
  ------------------
   74|  20.1k|                            && (i4_nextScale == 0));
  ------------------
  |  Branch (74:32): [True: 256, False: 19.8k]
  ------------------
   75|       |
   76|   221k|        }
   77|   523k|        pi2_scaling_list[i4_j] =
   78|   523k|                        (i4_nextScale == 0) ? (i4_lastScale) : (i4_nextScale);
  ------------------
  |  Branch (78:25): [True: 316k, False: 206k]
  ------------------
   79|   523k|        i4_lastScale = pi2_scaling_list[i4_j];
   80|   523k|    }
   81|  19.4k|    return OK;
  ------------------
  |  |  114|  19.4k|#define OK        0
  ------------------
   82|  20.1k|}
ih264d_form_default_scaling_matrix:
   85|   123k|{
   86|       |
   87|       |    /*************************************************************************/
   88|       |    /* perform the inverse scanning for the frame and field scaling matrices */
   89|       |    /*************************************************************************/
   90|   123k|    {
   91|   123k|        UWORD8 *pu1_inv_scan;
   92|   123k|        WORD32 i4_i, i4_j;
   93|       |
   94|   123k|        pu1_inv_scan = (UWORD8 *)gau1_ih264d_inv_scan;
   95|       |
   96|       |        /* for all 4x4 matrices */
   97|   866k|        for(i4_i = 0; i4_i < 6; i4_i++)
  ------------------
  |  Branch (97:23): [True: 742k, False: 123k]
  ------------------
   98|   742k|        {
   99|  12.6M|            for(i4_j = 0; i4_j < 16; i4_j++)
  ------------------
  |  Branch (99:27): [True: 11.8M, False: 742k]
  ------------------
  100|  11.8M|            {
  101|  11.8M|                ps_dec->s_high_profile.i2_scalinglist4x4[i4_i][pu1_inv_scan[i4_j]] =
  102|  11.8M|                                16;
  103|       |
  104|  11.8M|            }
  105|   742k|        }
  106|       |
  107|       |        /* for all 8x8 matrices */
  108|   371k|        for(i4_i = 0; i4_i < 2; i4_i++)
  ------------------
  |  Branch (108:23): [True: 247k, False: 123k]
  ------------------
  109|   247k|        {
  110|  16.0M|            for(i4_j = 0; i4_j < 64; i4_j++)
  ------------------
  |  Branch (110:27): [True: 15.8M, False: 247k]
  ------------------
  111|  15.8M|            {
  112|  15.8M|                ps_dec->s_high_profile.i2_scalinglist8x8[i4_i][gau1_ih264d_inv_scan_prog8x8_cabac[i4_j]] =
  113|  15.8M|                                16;
  114|       |
  115|  15.8M|            }
  116|   247k|        }
  117|   123k|    }
  118|   123k|    return OK;
  ------------------
  |  |  114|   123k|#define OK        0
  ------------------
  119|   123k|}
ih264d_form_scaling_matrix_picture:
  124|  9.32k|{
  125|       |    /* default scaling matrices */
  126|  9.32k|    WORD32 i4_i;
  127|       |
  128|       |    /* check the SPS first */
  129|  9.32k|    if(ps_seq->i4_seq_scaling_matrix_present_flag)
  ------------------
  |  Branch (129:8): [True: 8.33k, False: 988]
  ------------------
  130|  8.33k|    {
  131|  75.0k|        for(i4_i = 0; i4_i < 8; i4_i++)
  ------------------
  |  Branch (131:23): [True: 66.6k, False: 8.33k]
  ------------------
  132|  66.6k|        {
  133|  66.6k|            if(i4_i < 6)
  ------------------
  |  Branch (133:16): [True: 50.0k, False: 16.6k]
  ------------------
  134|  50.0k|            {
  135|       |                /* fall-back rule A */
  136|  50.0k|                if(!ps_seq->u1_seq_scaling_list_present_flag[i4_i])
  ------------------
  |  Branch (136:20): [True: 27.0k, False: 22.9k]
  ------------------
  137|  27.0k|                {
  138|  27.0k|                    if((i4_i == 0) || (i4_i == 3))
  ------------------
  |  Branch (138:24): [True: 2.33k, False: 24.7k]
  |  Branch (138:39): [True: 7.05k, False: 17.6k]
  ------------------
  139|  9.39k|                    {
  140|  9.39k|                        ps_dec->s_high_profile.pi2_scale_mat[i4_i] =
  141|  9.39k|                                        (i4_i == 0) ? (WORD16 *)(gai2_ih264d_default_intra4x4) : (WORD16 *)(gai2_ih264d_default_inter4x4);
  ------------------
  |  Branch (141:41): [True: 2.33k, False: 7.05k]
  ------------------
  142|  9.39k|                    }
  143|  17.6k|                    else
  144|  17.6k|                    {
  145|  17.6k|                        ps_dec->s_high_profile.pi2_scale_mat[i4_i] =
  146|  17.6k|                                        ps_dec->s_high_profile.pi2_scale_mat[i4_i
  147|  17.6k|                                                        - 1];
  148|  17.6k|                    }
  149|  27.0k|                }
  150|  22.9k|                else
  151|  22.9k|                {
  152|  22.9k|                    if(ps_seq->u1_use_default_scaling_matrix_flag[i4_i])
  ------------------
  |  Branch (152:24): [True: 294, False: 22.6k]
  ------------------
  153|    294|                    {
  154|    294|                        ps_dec->s_high_profile.pi2_scale_mat[i4_i] =
  155|    294|                                        (i4_i < 3) ? (WORD16 *)(gai2_ih264d_default_intra4x4) : (WORD16 *)(gai2_ih264d_default_inter4x4);
  ------------------
  |  Branch (155:41): [True: 268, False: 26]
  ------------------
  156|    294|                    }
  157|  22.6k|                    else
  158|  22.6k|                    {
  159|  22.6k|                        ps_dec->s_high_profile.pi2_scale_mat[i4_i] =
  160|  22.6k|                                        ps_seq->i2_scalinglist4x4[i4_i];
  161|  22.6k|                    }
  162|  22.9k|                }
  163|       |
  164|  50.0k|            }
  165|  16.6k|            else
  166|  16.6k|            {
  167|       |                /* fall-back rule A */
  168|  16.6k|                if((!ps_seq->u1_seq_scaling_list_present_flag[i4_i])
  ------------------
  |  Branch (168:20): [True: 9.84k, False: 6.83k]
  ------------------
  169|  6.83k|                                || (ps_seq->u1_use_default_scaling_matrix_flag[i4_i]))
  ------------------
  |  Branch (169:36): [True: 196, False: 6.63k]
  ------------------
  170|  10.0k|                {
  171|  10.0k|                    ps_dec->s_high_profile.pi2_scale_mat[i4_i] =
  172|  10.0k|                                    (i4_i == 6) ? ((WORD16*)gai2_ih264d_default_intra8x8) : ((WORD16*)gai2_ih264d_default_inter8x8);
  ------------------
  |  Branch (172:37): [True: 2.19k, False: 7.83k]
  ------------------
  173|  10.0k|                }
  174|  6.63k|                else
  175|  6.63k|                {
  176|  6.63k|                    ps_dec->s_high_profile.pi2_scale_mat[i4_i] =
  177|  6.63k|                                    ps_seq->i2_scalinglist8x8[i4_i - 6];
  178|  6.63k|                }
  179|  16.6k|            }
  180|  66.6k|        }
  181|  8.33k|    }
  182|       |
  183|       |    /* checking for the PPS */
  184|       |
  185|  9.32k|    if(ps_pic->i4_pic_scaling_matrix_present_flag)
  ------------------
  |  Branch (185:8): [True: 2.33k, False: 6.99k]
  ------------------
  186|  2.33k|    {
  187|  20.9k|        for(i4_i = 0; i4_i < 8; i4_i++)
  ------------------
  |  Branch (187:23): [True: 18.6k, False: 2.33k]
  ------------------
  188|  18.6k|        {
  189|  18.6k|            if(i4_i < 6)
  ------------------
  |  Branch (189:16): [True: 13.9k, False: 4.66k]
  ------------------
  190|  13.9k|            {
  191|       |                /* fall back rule B */
  192|  13.9k|                if(!ps_pic->u1_pic_scaling_list_present_flag[i4_i])
  ------------------
  |  Branch (192:20): [True: 11.3k, False: 2.61k]
  ------------------
  193|  11.3k|                {
  194|  11.3k|                    if((i4_i == 0) || (i4_i == 3))
  ------------------
  |  Branch (194:24): [True: 1.84k, False: 9.52k]
  |  Branch (194:39): [True: 1.67k, False: 7.85k]
  ------------------
  195|  3.51k|                    {
  196|  3.51k|                        if(!ps_seq->i4_seq_scaling_matrix_present_flag)
  ------------------
  |  Branch (196:28): [True: 1.63k, False: 1.88k]
  ------------------
  197|  1.63k|                        {
  198|  1.63k|                            ps_dec->s_high_profile.pi2_scale_mat[i4_i] =
  199|  1.63k|                                            (i4_i == 0) ? (WORD16 *)(gai2_ih264d_default_intra4x4) : (WORD16 *)(gai2_ih264d_default_inter4x4);
  ------------------
  |  Branch (199:45): [True: 848, False: 785]
  ------------------
  200|  1.63k|                        }
  201|  3.51k|                    }
  202|  7.85k|                    else
  203|  7.85k|                    {
  204|  7.85k|                        ps_dec->s_high_profile.pi2_scale_mat[i4_i] =
  205|  7.85k|                                        ps_dec->s_high_profile.pi2_scale_mat[i4_i
  206|  7.85k|                                                        - 1];
  207|  7.85k|                    }
  208|  11.3k|                }
  209|  2.61k|                else
  210|  2.61k|                {
  211|  2.61k|                    if(ps_pic->u1_pic_use_default_scaling_matrix_flag[i4_i])
  ------------------
  |  Branch (211:24): [True: 372, False: 2.24k]
  ------------------
  212|    372|                    {
  213|    372|                        ps_dec->s_high_profile.pi2_scale_mat[i4_i] =
  214|    372|                                        (i4_i < 3) ? (WORD16 *)(gai2_ih264d_default_intra4x4) : (WORD16 *)(gai2_ih264d_default_inter4x4);
  ------------------
  |  Branch (214:41): [True: 132, False: 240]
  ------------------
  215|    372|                    }
  216|  2.24k|                    else
  217|  2.24k|                    {
  218|  2.24k|                        ps_dec->s_high_profile.pi2_scale_mat[i4_i] =
  219|  2.24k|                                        ps_pic->i2_pic_scalinglist4x4[i4_i];
  220|  2.24k|                    }
  221|  2.61k|                }
  222|  13.9k|            }
  223|  4.66k|            else
  224|  4.66k|            {
  225|  4.66k|                if(!ps_pic->u1_pic_scaling_list_present_flag[i4_i])
  ------------------
  |  Branch (225:20): [True: 3.74k, False: 913]
  ------------------
  226|  3.74k|                {
  227|  3.74k|                    if(!ps_seq->i4_seq_scaling_matrix_present_flag)
  ------------------
  |  Branch (227:24): [True: 1.92k, False: 1.82k]
  ------------------
  228|  1.92k|                    {
  229|  1.92k|                        ps_dec->s_high_profile.pi2_scale_mat[i4_i] =
  230|  1.92k|                                        (i4_i == 6) ? ((WORD16*)gai2_ih264d_default_intra8x8) : ((WORD16*)gai2_ih264d_default_inter8x8);
  ------------------
  |  Branch (230:41): [True: 969, False: 959]
  ------------------
  231|  1.92k|                    }
  232|  3.74k|                }
  233|    913|                else
  234|    913|                {
  235|    913|                    if(ps_pic->u1_pic_use_default_scaling_matrix_flag[i4_i])
  ------------------
  |  Branch (235:24): [True: 202, False: 711]
  ------------------
  236|    202|                    {
  237|    202|                        ps_dec->s_high_profile.pi2_scale_mat[i4_i] =
  238|    202|                                        (i4_i == 6) ? (WORD16 *)(gai2_ih264d_default_intra8x8) : (WORD16 *)(gai2_ih264d_default_inter8x8);
  ------------------
  |  Branch (238:41): [True: 75, False: 127]
  ------------------
  239|    202|                    }
  240|    711|                    else
  241|    711|                    {
  242|    711|                        ps_dec->s_high_profile.pi2_scale_mat[i4_i] =
  243|    711|                                        ps_pic->i2_pic_scalinglist8x8[i4_i - 6];
  244|    711|                    }
  245|    913|                }
  246|  4.66k|            }
  247|  18.6k|        }
  248|  2.33k|    }
  249|       |
  250|       |    /*************************************************************************/
  251|       |    /* perform the inverse scanning for the frame and field scaling matrices */
  252|       |    /*************************************************************************/
  253|  9.32k|    {
  254|  9.32k|        UWORD8 *pu1_inv_scan_4x4;
  255|  9.32k|        WORD32 i4_i, i4_j;
  256|       |
  257|  9.32k|        pu1_inv_scan_4x4 = (UWORD8 *)gau1_ih264d_inv_scan;
  258|       |
  259|       |        /* for all 4x4 matrices */
  260|  65.2k|        for(i4_i = 0; i4_i < 6; i4_i++)
  ------------------
  |  Branch (260:23): [True: 55.9k, False: 9.32k]
  ------------------
  261|  55.9k|        {
  262|  55.9k|            if(ps_dec->s_high_profile.pi2_scale_mat[i4_i] == NULL)
  ------------------
  |  Branch (262:16): [True: 0, False: 55.9k]
  ------------------
  263|      0|                return ERROR_CORRUPTED_SLICE;
  264|       |
  265|   951k|            for(i4_j = 0; i4_j < 16; i4_j++)
  ------------------
  |  Branch (265:27): [True: 895k, False: 55.9k]
  ------------------
  266|   895k|            {
  267|   895k|                ps_dec->s_high_profile.i2_scalinglist4x4[i4_i][pu1_inv_scan_4x4[i4_j]] =
  268|   895k|                                ps_dec->s_high_profile.pi2_scale_mat[i4_i][i4_j];
  269|       |
  270|   895k|            }
  271|  55.9k|        }
  272|       |
  273|       |        /* for all 8x8 matrices */
  274|  27.9k|        for(i4_i = 0; i4_i < 2; i4_i++)
  ------------------
  |  Branch (274:23): [True: 18.6k, False: 9.32k]
  ------------------
  275|  18.6k|        {
  276|  18.6k|            if(ps_dec->s_high_profile.pi2_scale_mat[i4_i + 6] == NULL)
  ------------------
  |  Branch (276:16): [True: 0, False: 18.6k]
  ------------------
  277|      0|                return ERROR_CORRUPTED_SLICE;
  278|       |
  279|  1.21M|            for(i4_j = 0; i4_j < 64; i4_j++)
  ------------------
  |  Branch (279:27): [True: 1.19M, False: 18.6k]
  ------------------
  280|  1.19M|            {
  281|  1.19M|                ps_dec->s_high_profile.i2_scalinglist8x8[i4_i][gau1_ih264d_inv_scan_prog8x8_cabac[i4_j]] =
  282|  1.19M|                                ps_dec->s_high_profile.pi2_scale_mat[i4_i + 6][i4_j];
  283|       |
  284|  1.19M|            }
  285|  18.6k|        }
  286|  9.32k|    }
  287|  9.32k|    return OK;
  ------------------
  |  |  114|  9.32k|#define OK        0
  ------------------
  288|  9.32k|}

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

ih264d_check_mb_map_deblk:
  322|   148M|{
  323|   148M|    UWORD32 i = 0;
  324|   148M|    UWORD32 u4_mb_num;
  325|   148M|    UWORD32 u4_cond;
  326|   148M|    volatile UWORD8 *mb_map = ps_dec->pu1_recon_mb_map;
  327|   148M|    const WORD32 i4_cb_qp_idx_ofst =
  328|   148M|                    ps_dec->ps_cur_pps->i1_chroma_qp_index_offset;
  329|   148M|    const WORD32 i4_cr_qp_idx_ofst =
  330|   148M|                    ps_dec->ps_cur_pps->i1_second_chroma_qp_index_offset;
  331|       |
  332|   148M|    UWORD32 u4_wd_y, u4_wd_uv;
  333|   148M|    UWORD8 u1_field_pic_flag = ps_dec->ps_cur_slice->u1_field_pic_flag;
  334|       |
  335|       |
  336|   148M|    u4_wd_y = ps_dec->u2_frm_wd_y << u1_field_pic_flag;
  337|   148M|    u4_wd_uv = ps_dec->u2_frm_wd_uv << u1_field_pic_flag;
  338|       |
  339|       |
  340|   149M|    for(i = 0; i < deblk_mb_grp; i++)
  ------------------
  |  Branch (340:16): [True: 976k, False: 148M]
  ------------------
  341|   976k|    {
  342|   976k|        WORD32 nop_cnt = 8*128;
  343|   976k|        while(u4_check_mb_map == 1)
  ------------------
  |  Branch (343:15): [True: 0, False: 976k]
  ------------------
  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|   976k|        ih264d_deblock_mb_nonmbaff(ps_dec, ps_tfr_cxt,
  370|   976k|                                   i4_cb_qp_idx_ofst, i4_cr_qp_idx_ofst,
  371|   976k|                                    u4_wd_y, u4_wd_uv);
  372|       |
  373|       |
  374|   976k|    }
  375|       |
  376|       |
  377|   148M|}

ih264d_parse_tfr_nmb:
   68|  1.08M|{
   69|  1.08M|    WORD32 i, u4_mb_num;
   70|       |
   71|  1.08M|    const UWORD32 u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
   72|  1.08M|    UWORD32 u4_n_mb_start;
   73|       |
   74|  1.08M|    UNUSED(u4_mb_idx);
  ------------------
  |  |   45|  1.08M|#define UNUSED(x) ((void)(x))
  ------------------
   75|  1.08M|    UNUSED(u4_num_mbs_next);
  ------------------
  |  |   45|  1.08M|#define UNUSED(x) ((void)(x))
  ------------------
   76|  1.08M|    if(u4_tfr_n_mb)
  ------------------
  |  Branch (76:8): [True: 1.08M, False: 0]
  ------------------
   77|  1.08M|    {
   78|       |
   79|       |
   80|  1.08M|        u4_n_mb_start = (ps_dec->u4_cur_mb_addr + 1) - u4_num_mbs;
   81|       |
   82|       |        // copy into s_frmMbInfo
   83|       |
   84|  1.08M|        u4_mb_num = u4_n_mb_start;
   85|  1.08M|        u4_mb_num = (ps_dec->u4_cur_mb_addr + 1) - u4_num_mbs;
   86|       |
   87|  8.09M|        for(i = 0; i < u4_num_mbs; i++)
  ------------------
  |  Branch (87:20): [True: 7.00M, False: 1.08M]
  ------------------
   88|  7.00M|        {
   89|  7.00M|            UPDATE_SLICE_NUM_MAP(ps_dec->pu2_slice_num_map, u4_mb_num,
  ------------------
  |  |  148|  7.00M|#define UPDATE_SLICE_NUM_MAP(slice_map, u4_mb_number,u2_slice_num)                                                  \
  |  |  149|  7.00M|{                                                                                                   \
  |  |  150|  7.00M|        volatile UWORD16 *pu2_slice_map;                                                               \
  |  |  151|  7.00M|                                                                                                    \
  |  |  152|  7.00M|        pu2_slice_map    = (UWORD16 *)slice_map + (u4_mb_number);                                         \
  |  |  153|  7.00M|        (*pu2_slice_map) = u2_slice_num;                                                              \
  |  |  154|  7.00M|}
  ------------------
   90|  7.00M|                                 ps_dec->u2_cur_slice_num);
   91|  7.00M|            DATA_SYNC();
  ------------------
  |  |  116|  7.00M|#define DATA_SYNC()  __sync_synchronize()
  ------------------
   92|  7.00M|            UPDATE_MB_MAP_MBNUM_BYTE(ps_dec->pu1_dec_mb_map, u4_mb_num);
  ------------------
  |  |  136|  7.00M|#define UPDATE_MB_MAP_MBNUM_BYTE(mb_map, u4_mb_number)                                                  \
  |  |  137|  7.00M|{                                                                                                   \
  |  |  138|  7.00M|        volatile UWORD8 *pu1_mb_flag;                                                                       \
  |  |  139|  7.00M|                                                                                                    \
  |  |  140|  7.00M|        pu1_mb_flag    = (UWORD8 *)mb_map + (u4_mb_number);                                                     \
  |  |  141|  7.00M|        /*                                                                                          \
  |  |  142|  7.00M|         * In case of MbAff, update the mb_map only if the entire MB is done. We can check that     \
  |  |  143|  7.00M|         * by checking if Y is odd, implying that this is the second row in the MbAff MB            \
  |  |  144|  7.00M|         */                                                                                         \
  |  |  145|  7.00M|        (*pu1_mb_flag) = 1;                                                             \
  |  |  146|  7.00M|}
  ------------------
   93|       |
   94|  7.00M|            u4_mb_num++;
   95|  7.00M|        }
   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.08M|        ps_dec->s_tran_addrecon_parse.pu1_dest_y +=
  113|  1.08M|                        ps_dec->s_tran_addrecon_parse.u4_inc_y[u4_end_of_row];
  114|  1.08M|        ps_dec->s_tran_addrecon_parse.pu1_dest_u +=
  115|  1.08M|                        ps_dec->s_tran_addrecon_parse.u4_inc_uv[u4_end_of_row];
  116|  1.08M|        ps_dec->s_tran_addrecon_parse.pu1_dest_v +=
  117|  1.08M|                        ps_dec->s_tran_addrecon_parse.u4_inc_uv[u4_end_of_row];
  118|       |
  119|  1.08M|        if(u4_end_of_row)
  ------------------
  |  Branch (119:12): [True: 1.07M, False: 12.4k]
  ------------------
  120|  1.07M|        {
  121|  1.07M|            UWORD16 u2_mb_y;
  122|  1.07M|            UWORD32 u4_frame_stride, y_offset;
  123|       |
  124|  1.07M|            ps_dec->ps_top_mb_row = ps_dec->ps_cur_mb_row;
  125|  1.07M|            ps_dec->ps_cur_mb_row += ((ps_dec->u2_frm_wd_in_mbs) << u1_mbaff);
  126|       |
  127|  1.07M|            u2_mb_y = ps_dec->u2_mby + (1 + u1_mbaff);
  128|  1.07M|            u4_frame_stride = ps_dec->u2_frm_wd_y
  129|  1.07M|                            << ps_dec->ps_cur_slice->u1_field_pic_flag;
  130|  1.07M|            y_offset = (u2_mb_y * u4_frame_stride) << 4;
  131|  1.07M|            ps_dec->s_tran_addrecon_parse.pu1_dest_y =
  132|  1.07M|                            ps_dec->s_cur_pic.pu1_buf1 + y_offset;
  133|       |
  134|  1.07M|            u4_frame_stride = ps_dec->u2_frm_wd_uv
  135|  1.07M|                            << ps_dec->ps_cur_slice->u1_field_pic_flag;
  136|  1.07M|            y_offset = (u2_mb_y * u4_frame_stride) << 3;
  137|  1.07M|            ps_dec->s_tran_addrecon_parse.pu1_dest_u =
  138|  1.07M|                            ps_dec->s_cur_pic.pu1_buf2 + y_offset;
  139|  1.07M|            ps_dec->s_tran_addrecon_parse.pu1_dest_v =
  140|  1.07M|                            ps_dec->s_cur_pic.pu1_buf3 + y_offset;
  141|       |
  142|  1.07M|        }
  143|       |
  144|  1.08M|        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.08M|        ps_dec->s_tran_addrecon.u2_mv_left_inc = ((u4_num_mbs >> u1_mbaff) - 1)
  153|  1.08M|                        << (4 + u1_mbaff);
  154|  1.08M|        ps_dec->s_tran_addrecon.u2_mv_top_left_inc = (u4_num_mbs << 2) - 1
  155|  1.08M|                        - (u1_mbaff << 2);
  156|       |
  157|       |        /* reassign left MV and cur MV pointers */
  158|  1.08M|        ps_dec->ps_mv_left = ps_dec->ps_mv_cur
  159|  1.08M|                        + ps_dec->s_tran_addrecon.u2_mv_left_inc;
  160|       |
  161|  1.08M|        ps_dec->ps_mv_cur += (u4_num_mbs << 4);
  162|  1.08M|        ps_dec->u4_num_mbs_prev_nmb = u4_num_mbs;
  163|       |
  164|  1.08M|    }
  165|  1.08M|}
ih264d_decode_tfr_nmb:
  171|  1.08M|{
  172|       |
  173|  1.08M|    UWORD32 u1_end_of_row_next;
  174|       |
  175|  1.08M|    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.08M|    u1_end_of_row_next = u4_num_mbs_next &&
  ------------------
  |  Branch (180:26): [True: 15.4k, False: 1.06M]
  ------------------
  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.08M|    if(u4_end_of_row)
  ------------------
  |  Branch (191:8): [True: 1.06M, False: 15.4k]
  ------------------
  192|  1.06M|    {
  193|  1.06M|        ps_dec->i2_dec_thread_mb_y += (1 << u1_mbaff);
  194|  1.06M|    }
  195|  1.08M|    ih264d_transfer_mb_group_data(ps_dec, u4_num_mbs, u4_end_of_row,
  196|  1.08M|                                  u1_end_of_row_next);
  197|       |
  198|  1.08M|}
ih264d_decode_recon_tfr_nmb_thread:
  204|   891k|{
  205|   891k|    WORD32 i,j;
  206|   891k|    dec_mb_info_t * ps_cur_mb_info;
  207|   891k|    UWORD32 u4_update_mbaff = 0;
  208|   891k|    const UWORD32 u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
  209|   891k|    UWORD32 u1_slice_type, u1_B;
  210|   891k|    WORD32 u1_skip_th;
  211|   891k|    UWORD32 u1_ipcm_th;
  212|   891k|    UWORD32 u4_cond;
  213|   891k|    UWORD16 u2_slice_num,u2_cur_dec_mb_num;
  214|   891k|    WORD32 ret;
  215|   891k|    UWORD32 u4_mb_num;
  216|   891k|    WORD32 nop_cnt = 8*128;
  217|   891k|    u1_slice_type = ps_dec->ps_decode_cur_slice->slice_type;
  218|       |
  219|   891k|    u1_B = (u1_slice_type == B_SLICE);
  ------------------
  |  |  369|   891k|#define B_SLICE  1
  ------------------
  220|       |
  221|   891k|    u1_skip_th = ((u1_slice_type != I_SLICE) ?
  ------------------
  |  |  370|   891k|#define I_SLICE  2
  ------------------
  |  Branch (221:19): [True: 884k, False: 6.93k]
  ------------------
  222|   884k|                                    (u1_B ? B_8x8 : PRED_8x8R0) : -1);
  ------------------
  |  |  480|  47.0k|#define B_8x8    22
  ------------------
                                                  (u1_B ? B_8x8 : PRED_8x8R0) : -1);
  ------------------
  |  |  454|   837k|#define PRED_8x8R0  4
  ------------------
  |  Branch (222:38): [True: 47.0k, False: 837k]
  ------------------
  223|       |
  224|   891k|    u1_ipcm_th = ((u1_slice_type != I_SLICE) ? (u1_B ? 23 : 5) : 0);
  ------------------
  |  |  370|   891k|#define I_SLICE  2
  ------------------
  |  Branch (224:19): [True: 884k, False: 6.93k]
  |  Branch (224:49): [True: 47.0k, False: 837k]
  ------------------
  225|       |
  226|   891k|    u2_cur_dec_mb_num = ps_dec->cur_dec_mb_num;
  227|       |
  228|  3.99M|    while(1)
  ------------------
  |  Branch (228:11): [True: 3.99M, Folded]
  ------------------
  229|  3.99M|    {
  230|       |
  231|  3.99M|        UWORD32 u4_max_mb = (UWORD32)(ps_dec->i2_dec_thread_mb_y + (1 << u1_mbaff)) * ps_dec->u2_frm_wd_in_mbs - 1;
  232|  3.99M|        u4_mb_num = u2_cur_dec_mb_num;
  233|       |        /*introducing 1 MB delay*/
  234|  3.99M|        u4_mb_num = MIN(u4_mb_num + u4_num_mbs + 1, u4_max_mb);
  ------------------
  |  |   61|  3.99M|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 0, False: 3.99M]
  |  |  ------------------
  ------------------
  235|       |
  236|  3.99M|        CHECK_MB_MAP_BYTE(u4_mb_num, ps_dec->pu1_dec_mb_map, u4_cond);
  ------------------
  |  |   80|  3.99M|#define CHECK_MB_MAP_BYTE(u4_mb_num, mb_map, u4_cond)                                               \
  |  |   81|  3.99M|{                                                                                                   \
  |  |   82|  3.99M|        volatile UWORD8 *pu1_mb_flag;                                                               \
  |  |   83|  3.99M|                                                                                                    \
  |  |   84|  3.99M|        pu1_mb_flag    = (UWORD8 *)mb_map + (u4_mb_num );                                           \
  |  |   85|  3.99M|                                                                                                    \
  |  |   86|  3.99M|        u4_cond = (*pu1_mb_flag);                                                                   \
  |  |   87|  3.99M|}
  ------------------
  237|  3.99M|        if(u4_cond)
  ------------------
  |  Branch (237:12): [True: 891k, False: 3.10M]
  ------------------
  238|   891k|        {
  239|   891k|            break;
  240|   891k|        }
  241|  3.10M|        else
  242|  3.10M|        {
  243|  3.10M|            if(nop_cnt > 0)
  ------------------
  |  Branch (243:16): [True: 2.74M, False: 357k]
  ------------------
  244|  2.74M|            {
  245|  2.74M|                nop_cnt -= 128;
  246|  2.74M|                NOP(128);
  ------------------
  |  |   87|   354M|#define NOP(nop_cnt) {UWORD32 nop_i; for (nop_i = 0; nop_i < nop_cnt; nop_i++) asm("nop");}
  |  |  ------------------
  |  |  |  Branch (87:54): [True: 351M, False: 2.74M]
  |  |  ------------------
  ------------------
  247|  2.74M|            }
  248|   357k|            else
  249|   357k|            {
  250|   357k|                if(ps_dec->u4_output_present && (2 == ps_dec->u4_num_cores) &&
  ------------------
  |  Branch (250:20): [True: 156k, False: 201k]
  |  Branch (250:49): [True: 156k, False: 0]
  ------------------
  251|   156k|                   (ps_dec->u4_fmt_conv_cur_row < ps_dec->s_disp_frame_info.u4_y_ht))
  ------------------
  |  Branch (251:20): [True: 63.8k, False: 92.2k]
  ------------------
  252|  63.8k|                {
  253|  63.8k|                    ps_dec->u4_fmt_conv_num_rows =
  254|  63.8k|                                MIN(FMT_CONV_NUM_ROWS,
  ------------------
  |  |   61|  63.8k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 61.9k, False: 1.96k]
  |  |  ------------------
  ------------------
  255|  63.8k|                                    (ps_dec->s_disp_frame_info.u4_y_ht
  256|  63.8k|                                                    - ps_dec->u4_fmt_conv_cur_row));
  257|  63.8k|                    ih264d_format_convert(ps_dec, &(ps_dec->s_disp_op),
  258|  63.8k|                                          ps_dec->u4_fmt_conv_cur_row,
  259|  63.8k|                                          ps_dec->u4_fmt_conv_num_rows);
  260|  63.8k|                    ps_dec->u4_fmt_conv_cur_row += ps_dec->u4_fmt_conv_num_rows;
  261|  63.8k|                }
  262|   293k|                else
  263|   293k|                {
  264|   293k|                    nop_cnt = 8*128;
  265|   293k|                    ithread_yield();
  266|   293k|                }
  267|   357k|            }
  268|  3.10M|        }
  269|  3.99M|    }
  270|       |    /* N Mb MC Loop */
  271|  7.25M|    for(i = 0; i < u4_num_mbs; i++)
  ------------------
  |  Branch (271:16): [True: 6.37M, False: 883k]
  ------------------
  272|  6.37M|    {
  273|  6.37M|        u4_mb_num = u2_cur_dec_mb_num;
  274|       |
  275|  6.37M|        GET_SLICE_NUM_MAP(ps_dec->pu2_slice_num_map, u2_cur_dec_mb_num,
  ------------------
  |  |  156|  6.37M|#define GET_SLICE_NUM_MAP(slice_map, mb_number,u2_slice_num)                                                  \
  |  |  157|  6.37M|{                                                                                                   \
  |  |  158|  6.37M|        volatile UWORD16 *pu2_slice_map;                                                               \
  |  |  159|  6.37M|                                                                                                    \
  |  |  160|  6.37M|        pu2_slice_map    = (UWORD16 *)slice_map + (mb_number);                                         \
  |  |  161|  6.37M|        u2_slice_num = (*pu2_slice_map) ;                                                               \
  |  |  162|  6.37M|}
  ------------------
  276|  6.37M|                          u2_slice_num);
  277|       |
  278|  6.37M|        if(u2_slice_num != ps_dec->u2_cur_slice_num_dec_thread)
  ------------------
  |  Branch (278:12): [True: 8.46k, False: 6.36M]
  ------------------
  279|  8.46k|        {
  280|  8.46k|            ps_dec->u4_cur_slice_decode_done = 1;
  281|  8.46k|            break;
  282|  8.46k|        }
  283|       |
  284|  6.36M|        ps_cur_mb_info = &ps_dec->ps_frm_mb_info[u2_cur_dec_mb_num];
  285|       |
  286|  6.36M|        ps_dec->u4_dma_buf_idx = 0;
  287|  6.36M|        ps_dec->u4_pred_info_idx = 0;
  288|       |
  289|  6.36M|        if(ps_cur_mb_info->u1_mb_type <= u1_skip_th)
  ------------------
  |  Branch (289:12): [True: 115k, False: 6.24M]
  ------------------
  290|   115k|        {
  291|   115k|            WORD32 pred_cnt = 0;
  292|   115k|            pred_info_pkd_t *ps_pred_pkd;
  293|   115k|            UWORD32 u4_pred_info_pkd_idx;
  294|   115k|            WORD8 i1_pred;
  295|       |
  296|   115k|            u4_pred_info_pkd_idx = ps_cur_mb_info->u4_pred_info_pkd_idx;
  297|       |
  298|   432k|            while(pred_cnt < ps_cur_mb_info->u1_num_pred_parts)
  ------------------
  |  Branch (298:19): [True: 316k, False: 115k]
  ------------------
  299|   316k|            {
  300|   316k|                ps_pred_pkd = ps_dec->ps_pred_pkd + u4_pred_info_pkd_idx;
  301|       |
  302|   316k|                ps_dec->p_form_mb_part_info_thread(ps_pred_pkd,ps_dec,
  303|   316k|                                                   ps_cur_mb_info->u2_mbx,
  304|   316k|                                                   ps_cur_mb_info->u2_mby,
  305|   316k|                                                   (i >> u1_mbaff),
  306|   316k|                                                   ps_cur_mb_info);
  307|       |
  308|   316k|                u4_pred_info_pkd_idx++;
  309|   316k|                pred_cnt++;
  310|   316k|            }
  311|   115k|            ps_dec->p_mc_dec_thread(ps_dec, ps_cur_mb_info);
  312|   115k|        }
  313|  6.24M|        else if(ps_cur_mb_info->u1_mb_type == MB_SKIP)
  ------------------
  |  |  456|  6.24M|#define MB_SKIP     255
  ------------------
  |  Branch (313:17): [True: 6.20M, False: 41.9k]
  ------------------
  314|  6.20M|        {
  315|  6.20M|            WORD32 pred_cnt = 0;
  316|  6.20M|            pred_info_pkd_t *ps_pred_pkd;
  317|  6.20M|            UWORD32 u4_pred_info_pkd_idx;
  318|  6.20M|            WORD8 i1_pred;
  319|       |
  320|  6.20M|            u4_pred_info_pkd_idx = ps_cur_mb_info->u4_pred_info_pkd_idx;
  321|       |
  322|  12.8M|            while(pred_cnt < ps_cur_mb_info->u1_num_pred_parts)
  ------------------
  |  Branch (322:19): [True: 6.59M, False: 6.20M]
  ------------------
  323|  6.59M|            {
  324|  6.59M|                ps_pred_pkd = ps_dec->ps_pred_pkd + u4_pred_info_pkd_idx;
  325|       |
  326|  6.59M|                ps_dec->p_form_mb_part_info_thread(ps_pred_pkd,ps_dec,
  327|  6.59M|                                                   ps_cur_mb_info->u2_mbx,
  328|  6.59M|                                                   ps_cur_mb_info->u2_mby,
  329|  6.59M|                                                   (i >> u1_mbaff),
  330|  6.59M|                                                   ps_cur_mb_info);
  331|       |
  332|  6.59M|                u4_pred_info_pkd_idx++;
  333|  6.59M|                pred_cnt++;
  334|  6.59M|            }
  335|       |            /* Decode MB skip */
  336|  6.20M|            ps_dec->p_mc_dec_thread(ps_dec, ps_cur_mb_info);
  337|  6.20M|        }
  338|       |
  339|  6.36M|        u2_cur_dec_mb_num++;
  340|  6.36M|    }
  341|       |
  342|       |    /* N Mb IQ IT RECON  Loop */
  343|  7.25M|    for(j = 0; j < i; j++)
  ------------------
  |  Branch (343:16): [True: 6.36M, False: 891k]
  ------------------
  344|  6.36M|    {
  345|  6.36M|        ps_cur_mb_info = &ps_dec->ps_frm_mb_info[ps_dec->cur_dec_mb_num];
  346|       |
  347|  6.36M|        if((ps_dec->u4_num_cores == 2) || !ps_dec->i1_recon_in_thread3_flag)
  ------------------
  |  Branch (347:12): [True: 6.36M, False: 0]
  |  Branch (347:43): [True: 0, False: 0]
  ------------------
  348|  6.36M|        {
  349|  6.36M|            if(ps_cur_mb_info->u1_mb_type <= u1_skip_th)
  ------------------
  |  Branch (349:16): [True: 115k, False: 6.24M]
  ------------------
  350|   115k|            {
  351|   115k|                ih264d_process_inter_mb(ps_dec, ps_cur_mb_info, j);
  352|   115k|            }
  353|  6.24M|            else if(ps_cur_mb_info->u1_mb_type != MB_SKIP)
  ------------------
  |  |  456|  6.24M|#define MB_SKIP     255
  ------------------
  |  Branch (353:21): [True: 41.9k, False: 6.20M]
  ------------------
  354|  41.9k|            {
  355|  41.9k|                if((u1_ipcm_th + 25) != ps_cur_mb_info->u1_mb_type)
  ------------------
  |  Branch (355:20): [True: 41.5k, False: 393]
  ------------------
  356|  41.5k|                {
  357|  41.5k|                    ps_cur_mb_info->u1_mb_type -= (u1_skip_th + 1);
  358|  41.5k|                    ih264d_process_intra_mb(ps_dec, ps_cur_mb_info, j);
  359|  41.5k|                }
  360|  41.9k|            }
  361|       |
  362|       |
  363|  6.36M|         if(ps_dec->u4_use_intrapred_line_copy == 1)
  ------------------
  |  Branch (363:13): [True: 6.36M, False: 0]
  ------------------
  364|  6.36M|                ih264d_copy_intra_pred_line(ps_dec, ps_cur_mb_info, j);
  365|  6.36M|        }
  366|       |
  367|  6.36M|        DATA_SYNC();
  ------------------
  |  |  116|  6.36M|#define DATA_SYNC()  __sync_synchronize()
  ------------------
  368|       |
  369|  6.36M|        if(u1_mbaff)
  ------------------
  |  Branch (369:12): [True: 0, False: 6.36M]
  ------------------
  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|  6.36M|        else
  385|  6.36M|        {
  386|  6.36M|            UWORD32 u4_mb_num = ps_cur_mb_info->u2_mbx
  387|  6.36M|                            + ps_dec->u2_frm_wd_in_mbs * ps_cur_mb_info->u2_mby;
  388|  6.36M|            UPDATE_MB_MAP_MBNUM_BYTE(ps_dec->pu1_recon_mb_map, u4_mb_num);
  ------------------
  |  |  136|  6.36M|#define UPDATE_MB_MAP_MBNUM_BYTE(mb_map, u4_mb_number)                                                  \
  |  |  137|  6.36M|{                                                                                                   \
  |  |  138|  6.36M|        volatile UWORD8 *pu1_mb_flag;                                                                       \
  |  |  139|  6.36M|                                                                                                    \
  |  |  140|  6.36M|        pu1_mb_flag    = (UWORD8 *)mb_map + (u4_mb_number);                                                     \
  |  |  141|  6.36M|        /*                                                                                          \
  |  |  142|  6.36M|         * In case of MbAff, update the mb_map only if the entire MB is done. We can check that     \
  |  |  143|  6.36M|         * by checking if Y is odd, implying that this is the second row in the MbAff MB            \
  |  |  144|  6.36M|         */                                                                                         \
  |  |  145|  6.36M|        (*pu1_mb_flag) = 1;                                                             \
  |  |  146|  6.36M|}
  ------------------
  389|  6.36M|        }
  390|  6.36M|        ps_dec->cur_dec_mb_num++;
  391|  6.36M|     }
  392|       |
  393|       |    /*N MB deblocking*/
  394|   891k|    if(ps_dec->u4_nmb_deblk == 1)
  ------------------
  |  Branch (394:8): [True: 0, False: 891k]
  ------------------
  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|   891k|    if(ps_dec->cur_dec_mb_num > ps_dec->ps_cur_sps->u4_max_mb_addr)
  ------------------
  |  Branch (423:8): [True: 29.0k, False: 862k]
  ------------------
  424|  29.0k|        ps_dec->u4_cur_slice_decode_done = 1;
  425|       |
  426|   891k|    if(i != u4_num_mbs)
  ------------------
  |  Branch (426:8): [True: 8.46k, False: 883k]
  ------------------
  427|  8.46k|    {
  428|  8.46k|        u4_end_of_row = 0;
  429|       |        /*Number of MB's left in row*/
  430|  8.46k|        u4_num_mbs_next = u4_num_mbs_next + ((u4_num_mbs - i) >> u1_mbaff);
  431|  8.46k|    }
  432|       |
  433|   891k|    ih264d_decode_tfr_nmb(ps_dec, (i), u4_num_mbs_next, u4_end_of_row);
  434|       |
  435|   891k|    return OK;
  ------------------
  |  |  114|   891k|#define OK        0
  ------------------
  436|   891k|}
ih264d_decode_slice_thread:
  439|  37.4k|{
  440|  37.4k|    UWORD32 u4_num_mbs_next, u4_num_mbsleft, u4_end_of_row = 0;
  441|  37.4k|    const UWORD32 i2_pic_wdin_mbs = ps_dec->u2_frm_wd_in_mbs;
  442|  37.4k|    UWORD32 u4_mbaff, u4_num_mbs;
  443|       |
  444|  37.4k|    UWORD16 u2_first_mb_in_slice;
  445|  37.4k|    UWORD16 i16_mb_x, i16_mb_y;
  446|  37.4k|    UWORD8 u1_field_pic;
  447|  37.4k|    UWORD32 u4_frame_stride, x_offset, y_offset;
  448|  37.4k|    WORD32 ret;
  449|       |
  450|  37.4k|    tfr_ctxt_t *ps_trns_addr;
  451|       |
  452|       |    /*check for mb map of first mb in slice to ensure slice header is parsed*/
  453|   566k|    while(1)
  ------------------
  |  Branch (453:11): [True: 566k, Folded]
  ------------------
  454|   566k|    {
  455|   566k|        UWORD32 u4_mb_num = ps_dec->cur_dec_mb_num;
  456|   566k|        UWORD32 u4_cond = 0;
  457|   566k|        WORD32 nop_cnt = 8 * 128;
  458|   566k|        CHECK_MB_MAP_BYTE(u4_mb_num, ps_dec->pu1_dec_mb_map, u4_cond);
  ------------------
  |  |   80|   566k|#define CHECK_MB_MAP_BYTE(u4_mb_num, mb_map, u4_cond)                                               \
  |  |   81|   566k|{                                                                                                   \
  |  |   82|   566k|        volatile UWORD8 *pu1_mb_flag;                                                               \
  |  |   83|   566k|                                                                                                    \
  |  |   84|   566k|        pu1_mb_flag    = (UWORD8 *)mb_map + (u4_mb_num );                                           \
  |  |   85|   566k|                                                                                                    \
  |  |   86|   566k|        u4_cond = (*pu1_mb_flag);                                                                   \
  |  |   87|   566k|}
  ------------------
  459|   566k|        if(u4_cond)
  ------------------
  |  Branch (459:12): [True: 37.4k, False: 529k]
  ------------------
  460|  37.4k|        {
  461|  37.4k|            break;
  462|  37.4k|        }
  463|   529k|        else
  464|   529k|        {
  465|   529k|            if(nop_cnt > 0)
  ------------------
  |  Branch (465:16): [True: 529k, False: 0]
  ------------------
  466|   529k|            {
  467|   529k|                nop_cnt -= 128;
  468|   529k|                NOP(128);
  ------------------
  |  |   87|  68.2M|#define NOP(nop_cnt) {UWORD32 nop_i; for (nop_i = 0; nop_i < nop_cnt; nop_i++) asm("nop");}
  |  |  ------------------
  |  |  |  Branch (87:54): [True: 67.7M, False: 529k]
  |  |  ------------------
  ------------------
  469|   529k|            }
  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|   529k|            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|   529k|                            ps_dec->u4_cur_mb_addr);
  489|       |
  490|   529k|        }
  491|   566k|    }
  492|       |
  493|       |
  494|       |
  495|  37.4k|    u4_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
  496|       |
  497|  37.4k|    u2_first_mb_in_slice = ps_dec->ps_decode_cur_slice->u4_first_mb_in_slice;
  498|       |
  499|  37.4k|    i16_mb_x = MOD(u2_first_mb_in_slice, i2_pic_wdin_mbs);
  ------------------
  |  |   64|  37.4k|#define MOD(x,y) ((x)%(y))
  ------------------
  500|  37.4k|    i16_mb_y = DIV(u2_first_mb_in_slice, i2_pic_wdin_mbs);
  ------------------
  |  |   65|  37.4k|#define DIV(x,y) ((x)/(y))
  ------------------
  501|  37.4k|    i16_mb_y <<= u4_mbaff;
  502|  37.4k|    ps_dec->i2_dec_thread_mb_y = i16_mb_y;
  503|       |
  504|       |
  505|  37.4k|    ps_dec->cur_dec_mb_num = u2_first_mb_in_slice << u4_mbaff;
  506|       |
  507|  37.4k|    if((ps_dec->u4_num_cores == 2) || !ps_dec->i1_recon_in_thread3_flag)
  ------------------
  |  Branch (507:8): [True: 37.4k, False: 0]
  |  Branch (507:39): [True: 0, False: 0]
  ------------------
  508|  37.4k|    {
  509|  37.4k|        ps_dec->pv_proc_tu_coeff_data =
  510|  37.4k|                (void *) ps_dec->ps_decode_cur_slice->pv_tu_coeff_data_start;
  511|  37.4k|    }
  512|       |
  513|       |    // recalculate recon pointers
  514|  37.4k|    u1_field_pic = ps_dec->ps_cur_slice->u1_field_pic_flag;
  515|  37.4k|    u4_frame_stride = ps_dec->u2_frm_wd_y << u1_field_pic;
  516|  37.4k|    x_offset = i16_mb_x << 4;
  517|  37.4k|    y_offset = (i16_mb_y * u4_frame_stride) << 4;
  518|       |
  519|  37.4k|    ps_trns_addr = &(ps_dec->s_tran_addrecon);
  520|       |
  521|  37.4k|    ps_trns_addr->pu1_dest_y = ps_dec->s_cur_pic.pu1_buf1 + x_offset + y_offset;
  522|       |
  523|  37.4k|    u4_frame_stride = ps_dec->u2_frm_wd_uv << u1_field_pic;
  524|  37.4k|    x_offset >>= 1;
  525|  37.4k|    y_offset = (i16_mb_y * u4_frame_stride) << 3;
  526|       |
  527|  37.4k|    x_offset *= YUV420SP_FACTOR;
  ------------------
  |  |  119|  37.4k|#define YUV420SP_FACTOR 2
  ------------------
  528|       |
  529|  37.4k|    ps_trns_addr->pu1_dest_u = ps_dec->s_cur_pic.pu1_buf2 + x_offset + y_offset;
  530|  37.4k|    ps_trns_addr->pu1_dest_v = ps_dec->s_cur_pic.pu1_buf3 + x_offset + y_offset;
  531|       |
  532|  37.4k|    ps_trns_addr->pu1_mb_y = ps_trns_addr->pu1_dest_y;
  533|  37.4k|    ps_trns_addr->pu1_mb_u = ps_trns_addr->pu1_dest_u;
  534|  37.4k|    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|  37.4k|    {
  539|  37.4k|        ps_dec->p_mc_dec_thread = ih264d_motion_compensate_bp;
  540|  37.4k|        ps_dec->p_form_mb_part_info_thread = ih264d_form_mb_part_info_bp;
  541|  37.4k|    }
  542|  37.4k|    {
  543|  37.4k|        UWORD8 uc_nofield_nombaff;
  544|  37.4k|        uc_nofield_nombaff = ((ps_dec->ps_cur_slice->u1_field_pic_flag == 0)
  ------------------
  |  Branch (544:31): [True: 37.4k, False: 0]
  ------------------
  545|  37.4k|                        && (ps_dec->ps_cur_slice->u1_mbaff_frame_flag == 0)
  ------------------
  |  Branch (545:28): [True: 37.4k, False: 0]
  ------------------
  546|  37.4k|                        && (ps_dec->ps_decode_cur_slice->slice_type != B_SLICE)
  ------------------
  |  |  369|  37.4k|#define B_SLICE  1
  ------------------
  |  Branch (546:28): [True: 31.0k, False: 6.44k]
  ------------------
  547|  31.0k|                        && (ps_dec->ps_cur_pps->u1_wted_pred_flag == 0));
  ------------------
  |  Branch (547:28): [True: 12.0k, False: 19.0k]
  ------------------
  548|       |
  549|  37.4k|        if(uc_nofield_nombaff == 0)
  ------------------
  |  Branch (549:12): [True: 25.4k, False: 12.0k]
  ------------------
  550|  25.4k|        {
  551|  25.4k|            ps_dec->p_mc_dec_thread = ih264d_motion_compensate_mp;
  552|  25.4k|            ps_dec->p_form_mb_part_info_thread = ih264d_form_mb_part_info_mp;
  553|  25.4k|        }
  554|       |
  555|  37.4k|    }
  556|       |
  557|  37.4k|    ps_dec->u4_cur_slice_decode_done = 0;
  558|       |
  559|       |
  560|   929k|    while(ps_dec->u4_cur_slice_decode_done != 1)
  ------------------
  |  Branch (560:11): [True: 891k, False: 37.4k]
  ------------------
  561|   891k|    {
  562|       |
  563|   891k|        u4_num_mbsleft = ((i2_pic_wdin_mbs - i16_mb_x) << u4_mbaff);
  564|       |
  565|   891k|        if(u4_num_mbsleft <= ps_dec->u4_recon_mb_grp)
  ------------------
  |  Branch (565:12): [True: 891k, False: 0]
  ------------------
  566|   891k|        {
  567|   891k|            u4_num_mbs = u4_num_mbsleft;
  568|       |
  569|       |            /*Indicate number of mb's left in a row*/
  570|   891k|            u4_num_mbs_next = 0;
  571|   891k|            u4_end_of_row = 1;
  572|   891k|            i16_mb_x = 0;
  573|   891k|        }
  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|   891k|        ret = ih264d_decode_recon_tfr_nmb_thread(ps_dec, u4_num_mbs, u4_num_mbs_next,
  586|   891k|                                           u4_end_of_row);
  587|   891k|        if(ret != OK)
  ------------------
  |  |  114|   891k|#define OK        0
  ------------------
  |  Branch (587:12): [True: 0, False: 891k]
  ------------------
  588|      0|            return ret;
  589|   891k|    }
  590|  37.4k|    return OK;
  ------------------
  |  |  114|  37.4k|#define OK        0
  ------------------
  591|  37.4k|}
ih264d_decode_picture_thread:
  594|  29.0k|{
  595|  29.0k|    ithread_set_name("ih264d_decode_picture_thread");
  596|       |
  597|  29.0k|    while(1)
  ------------------
  |  Branch (597:11): [True: 29.0k, Folded]
  ------------------
  598|  29.0k|    {
  599|  29.0k|        WORD32 ret;
  600|  29.0k|        if(ps_dec->i4_threads_active)
  ------------------
  |  Branch (600:12): [True: 0, False: 29.0k]
  ------------------
  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|  37.4k|        while(1)
  ------------------
  |  Branch (617:15): [True: 37.4k, Folded]
  ------------------
  618|  37.4k|        {
  619|       |            /*Complete all writes before processing next slice*/
  620|       |
  621|  37.4k|            DEBUG_THREADS_PRINTF(" Entering decode slice\n");
  622|       |
  623|  37.4k|            ih264d_decode_slice_thread(ps_dec);
  624|  37.4k|            DEBUG_THREADS_PRINTF(" Exit  ih264d_decode_slice_thread \n");
  625|       |
  626|       |
  627|  37.4k|            if(ps_dec->cur_dec_mb_num
  ------------------
  |  Branch (627:16): [True: 29.0k, False: 8.46k]
  ------------------
  628|  37.4k|                            > ps_dec->ps_cur_sps->u4_max_mb_addr)
  629|  29.0k|            {
  630|       |                /*Last slice in frame*/
  631|  29.0k|                break;
  632|  29.0k|            }
  633|  8.46k|            else
  634|  8.46k|            {
  635|  8.46k|                ps_dec->ps_decode_cur_slice++;
  636|  8.46k|                ps_dec->u2_cur_slice_num_dec_thread++;
  637|  8.46k|            }
  638|       |
  639|  37.4k|        }
  640|  29.0k|        if(ps_dec->u4_output_present && (2 == ps_dec->u4_num_cores) &&
  ------------------
  |  Branch (640:12): [True: 5.77k, False: 23.2k]
  |  Branch (640:41): [True: 5.77k, False: 0]
  ------------------
  641|  5.77k|            (ps_dec->u4_fmt_conv_cur_row < ps_dec->s_disp_frame_info.u4_y_ht))
  ------------------
  |  Branch (641:13): [True: 3.80k, False: 1.96k]
  ------------------
  642|  3.80k|        {
  643|  3.80k|            ps_dec->u4_fmt_conv_num_rows =
  644|  3.80k|                            (ps_dec->s_disp_frame_info.u4_y_ht
  645|  3.80k|                                            - ps_dec->u4_fmt_conv_cur_row);
  646|  3.80k|            ih264d_format_convert(ps_dec, &(ps_dec->s_disp_op),
  647|  3.80k|                                ps_dec->u4_fmt_conv_cur_row,
  648|  3.80k|                                ps_dec->u4_fmt_conv_num_rows);
  649|  3.80k|            ps_dec->u4_fmt_conv_cur_row += ps_dec->u4_fmt_conv_num_rows;
  650|  3.80k|        }
  651|       |
  652|  29.0k|        if(ps_dec->i4_threads_active)
  ------------------
  |  Branch (652:12): [True: 0, False: 29.0k]
  ------------------
  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|  29.0k|        else
  666|  29.0k|        {
  667|  29.0k|            break;
  668|  29.0k|        }
  669|  29.0k|    }
  670|  29.0k|}
ih264d_signal_decode_thread:
  673|  81.3k|{
  674|  81.3k|    if(ps_dec->u4_dec_thread_created == 1)
  ------------------
  |  Branch (674:8): [True: 49.8k, False: 31.5k]
  ------------------
  675|  49.8k|    {
  676|  49.8k|        if(ps_dec->i4_threads_active)
  ------------------
  |  Branch (676:12): [True: 0, False: 49.8k]
  ------------------
  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|  49.8k|        else
  698|  49.8k|        {
  699|       |            ithread_join(ps_dec->pv_dec_thread_handle, NULL);
  700|  49.8k|            ps_dec->u4_dec_thread_created = 0;
  701|  49.8k|        }
  702|  49.8k|    }
  703|  81.3k|}

ih264d_is_end_of_pic:
   88|  3.99k|{
   89|  3.99k|    WORD8 i1_is_end_of_pic;
   90|  3.99k|    WORD8 a, b, c, d, e, f, g, h;
   91|       |
   92|  3.99k|    a = b = c = d = e = f = g = h = 0;
   93|  3.99k|    a = (ps_prev_slice->u2_frame_num != u2_frame_num);
   94|  3.99k|    b = (ps_prev_slice->u1_field_pic_flag != u1_field_pic_flag);
   95|  3.99k|    if(u1_field_pic_flag && ps_prev_slice->u1_field_pic_flag)
  ------------------
  |  Branch (95:8): [True: 0, False: 3.99k]
  |  Branch (95:29): [True: 0, False: 0]
  ------------------
   96|      0|        c = (u1_bottom_field_flag != ps_prev_slice->u1_bottom_field_flag);
   97|  3.99k|    d =
   98|  3.99k|                    (u1_nal_ref_idc == 0 && ps_prev_slice->u1_nal_ref_idc != 0)
  ------------------
  |  Branch (98:22): [True: 1.55k, False: 2.43k]
  |  Branch (98:45): [True: 0, False: 1.55k]
  ------------------
   99|  3.99k|                                    || (u1_nal_ref_idc != 0
  ------------------
  |  Branch (99:41): [True: 2.43k, False: 1.55k]
  ------------------
  100|  2.43k|                                                    && ps_prev_slice->u1_nal_ref_idc
  ------------------
  |  Branch (100:56): [True: 0, False: 2.43k]
  ------------------
  101|  2.43k|                                                                    == 0);
  102|  3.99k|    if(!a)
  ------------------
  |  Branch (102:8): [True: 3.88k, False: 110]
  ------------------
  103|  3.88k|    {
  104|  3.88k|        if((u1_pic_order_cnt_type == 0)
  ------------------
  |  Branch (104:12): [True: 3.26k, False: 627]
  ------------------
  105|  3.26k|                        && (ps_prev_slice->u1_pic_order_cnt_type == 0))
  ------------------
  |  Branch (105:28): [True: 3.26k, False: 0]
  ------------------
  106|  3.26k|        {
  107|  3.26k|            e =
  108|  3.26k|                            ((ps_cur_poc->i4_pic_order_cnt_lsb
  ------------------
  |  Branch (108:30): [True: 68, False: 3.19k]
  ------------------
  109|  3.26k|                                            != ps_prev_poc->i4_pic_order_cnt_lsb)
  110|  3.19k|                                            || (ps_cur_poc->i4_delta_pic_order_cnt_bottom
  ------------------
  |  Branch (110:48): [True: 2, False: 3.19k]
  ------------------
  111|  3.19k|                                                            != ps_prev_poc->i4_delta_pic_order_cnt_bottom));
  112|  3.26k|        }
  113|       |
  114|  3.88k|        if((u1_pic_order_cnt_type == 1)
  ------------------
  |  Branch (114:12): [True: 328, False: 3.55k]
  ------------------
  115|    328|                        && (ps_prev_slice->u1_pic_order_cnt_type == 1))
  ------------------
  |  Branch (115:28): [True: 328, False: 0]
  ------------------
  116|    328|        {
  117|    328|            f =
  118|    328|                            ((ps_cur_poc->i4_delta_pic_order_cnt[0]
  ------------------
  |  Branch (118:30): [True: 81, False: 247]
  ------------------
  119|    328|                                            != ps_prev_poc->i4_delta_pic_order_cnt[0])
  120|    247|                                            || (ps_cur_poc->i4_delta_pic_order_cnt[1]
  ------------------
  |  Branch (120:48): [True: 70, False: 177]
  ------------------
  121|    247|                                                            != ps_prev_poc->i4_delta_pic_order_cnt[1]));
  122|    328|        }
  123|  3.88k|    }
  124|       |
  125|  3.99k|    if((u1_nal_unit_type == IDR_SLICE_NAL)
  ------------------
  |  |  328|  3.99k|#define IDR_SLICE_NAL                   5
  ------------------
  |  Branch (125:8): [True: 1.88k, False: 2.11k]
  ------------------
  126|  1.88k|                    && (ps_prev_slice->u1_nal_unit_type == IDR_SLICE_NAL))
  ------------------
  |  |  328|  1.88k|#define IDR_SLICE_NAL                   5
  ------------------
  |  Branch (126:24): [True: 1.88k, False: 0]
  ------------------
  127|  1.88k|    {
  128|  1.88k|        g = (u4_idr_pic_id != ps_prev_slice->u4_idr_pic_id);
  129|  1.88k|    }
  130|       |
  131|  3.99k|    if((u1_nal_unit_type == IDR_SLICE_NAL)
  ------------------
  |  |  328|  3.99k|#define IDR_SLICE_NAL                   5
  ------------------
  |  Branch (131:8): [True: 1.88k, False: 2.11k]
  ------------------
  132|  1.88k|                    && (ps_prev_slice->u1_nal_unit_type != IDR_SLICE_NAL))
  ------------------
  |  |  328|  1.88k|#define IDR_SLICE_NAL                   5
  ------------------
  |  Branch (132:24): [True: 0, False: 1.88k]
  ------------------
  133|      0|    {
  134|      0|        h = 1;
  135|      0|    }
  136|  3.99k|    i1_is_end_of_pic = a + b + c + d + e + f + g + h;
  137|  3.99k|    return (i1_is_end_of_pic);
  138|  3.99k|}
ih264d_end_of_pic_processing:
  531|   125k|{
  532|   125k|    UWORD8 u1_pic_type, u1_nal_ref_idc;
  533|   125k|    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|   125k|    u1_pic_type = 0;
  548|   125k|    u1_nal_ref_idc = ps_cur_slice->u1_nal_ref_idc;
  549|       |
  550|   125k|    if(u1_nal_ref_idc)
  ------------------
  |  Branch (550:8): [True: 109k, False: 16.5k]
  ------------------
  551|   109k|    {
  552|   109k|        if(ps_cur_slice->u1_nal_unit_type == IDR_SLICE_NAL)
  ------------------
  |  |  328|   109k|#define IDR_SLICE_NAL                   5
  ------------------
  |  Branch (552:12): [True: 97.2k, False: 12.0k]
  ------------------
  553|  97.2k|        {
  554|  97.2k|            ps_dec->ps_dpb_mgr->u1_mmco_error_in_seq = 0;
  555|  97.2k|            if(ps_dec->ps_dpb_cmds->u1_long_term_reference_flag == 0)
  ------------------
  |  Branch (555:16): [True: 83.8k, False: 13.3k]
  ------------------
  556|  83.8k|            {
  557|  83.8k|                ih264d_reset_ref_bufs(ps_dec->ps_dpb_mgr);
  558|       |                /* ignore DPB errors */
  559|  83.8k|                ih264d_insert_st_node(ps_dec->ps_dpb_mgr,
  560|  83.8k|                                      ps_dec->ps_cur_pic,
  561|  83.8k|                                      ps_dec->u1_pic_buf_id,
  562|  83.8k|                                      ps_cur_slice->u2_frame_num);
  563|  83.8k|                ps_dec->ps_dpb_mgr->u1_max_lt_frame_idx = NO_LONG_TERM_INDICIES;
  ------------------
  |  |   53|  83.8k|#define NO_LONG_TERM_INDICIES      255
  ------------------
  564|  83.8k|            }
  565|  13.3k|            else
  566|  13.3k|            {
  567|       |                /* Equivalent of inserting a pic directly as longterm Pic */
  568|       |
  569|  13.3k|                {
  570|       |                    /* ignore DPB errors */
  571|  13.3k|                    ih264d_insert_st_node(ps_dec->ps_dpb_mgr,
  572|  13.3k|                                          ps_dec->ps_cur_pic,
  573|  13.3k|                                          ps_dec->u1_pic_buf_id,
  574|  13.3k|                                          ps_cur_slice->u2_frame_num);
  575|       |
  576|       |                    /* Set longTermIdx = 0, MaxLongTermFrameIdx = 0 */
  577|  13.3k|                    ih264d_delete_st_node_or_make_lt(
  578|  13.3k|                                    ps_dec->ps_dpb_mgr,
  579|  13.3k|                                    ps_cur_slice->u2_frame_num, 0,
  580|  13.3k|                                    ps_cur_slice->u1_field_pic_flag);
  581|       |
  582|  13.3k|                    ps_dec->ps_dpb_mgr->u1_max_lt_frame_idx = 0;
  583|  13.3k|                }
  584|  13.3k|            }
  585|  97.2k|        }
  586|  12.0k|        else
  587|  12.0k|        {
  588|       |
  589|  12.0k|            {
  590|  12.0k|                UWORD16 u2_pic_num = ps_cur_slice->u2_frame_num;
  591|       |
  592|  12.0k|                if(!ps_dec->ps_dpb_mgr->u1_mmco_error_in_seq)
  ------------------
  |  Branch (592:20): [True: 11.3k, False: 677]
  ------------------
  593|  11.3k|                {
  594|  11.3k|                    WORD32 ret = ih264d_do_mmco_buffer(ps_dec->ps_dpb_cmds, ps_dec->ps_dpb_mgr,
  595|  11.3k|                                               ps_dec->ps_cur_sps->u1_num_ref_frames, u2_pic_num,
  596|  11.3k|                                               (ps_dec->ps_cur_sps->u2_u4_max_pic_num_minus1),
  597|  11.3k|                                               ps_dec->u1_nal_unit_type, ps_dec->ps_cur_pic,
  598|  11.3k|                                               ps_dec->u1_pic_buf_id,
  599|  11.3k|                                               ps_cur_slice->u1_field_pic_flag,
  600|  11.3k|                                               ps_dec->e_dec_status);
  601|  11.3k|                    ps_dec->ps_dpb_mgr->u1_mmco_error_in_seq = ret != OK;
  ------------------
  |  |  114|  11.3k|#define OK        0
  ------------------
  602|  11.3k|                }
  603|  12.0k|            }
  604|  12.0k|        }
  605|   109k|        ih264d_update_default_index_list(ps_dec->ps_dpb_mgr);
  606|   109k|    }
  607|       |
  608|   125k|    if(ps_cur_slice->u1_field_pic_flag)
  ------------------
  |  Branch (608:8): [True: 0, False: 125k]
  ------------------
  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|   125k|    else
  624|   125k|        u1_pic_type = TOP_REF | BOT_REF;
  ------------------
  |  |  357|   125k|#define TOP_REF         0x08
  ------------------
                      u1_pic_type = TOP_REF | BOT_REF;
  ------------------
  |  |  358|   125k|#define BOT_REF         0x10
  ------------------
  625|   125k|    ps_dec->ps_cur_pic->u1_pic_type |= u1_pic_type;
  626|       |
  627|       |
  628|   125k|    if(ps_cur_slice->u1_field_pic_flag)
  ------------------
  |  Branch (628:8): [True: 0, False: 125k]
  ------------------
  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|   125k|    return OK;
  ------------------
  |  |  114|   125k|#define OK        0
  ------------------
  635|   125k|}
ih264d_get_dpb_size:
  659|   128k|{
  660|   128k|    WORD32 i4_size;
  661|   128k|    UWORD8 u1_level_idc;
  662|       |
  663|   128k|    u1_level_idc = ps_seq->u1_level_idc;
  664|       |
  665|   128k|    switch(u1_level_idc)
  666|   128k|    {
  667|    914|        case 10:
  ------------------
  |  Branch (667:9): [True: 914, False: 127k]
  ------------------
  668|    914|            i4_size = 152064;
  669|    914|            break;
  670|  20.7k|        case 11:
  ------------------
  |  Branch (670:9): [True: 20.7k, False: 107k]
  ------------------
  671|  20.7k|            i4_size = 345600;
  672|  20.7k|            break;
  673|  2.74k|        case 12:
  ------------------
  |  Branch (673:9): [True: 2.74k, False: 125k]
  ------------------
  674|  2.74k|            i4_size = 912384;
  675|  2.74k|            break;
  676|    815|        case 13:
  ------------------
  |  Branch (676:9): [True: 815, False: 127k]
  ------------------
  677|    815|            i4_size = 912384;
  678|    815|            break;
  679|  31.0k|        case 20:
  ------------------
  |  Branch (679:9): [True: 31.0k, False: 97.6k]
  ------------------
  680|  31.0k|            i4_size = 912384;
  681|  31.0k|            break;
  682|  4.70k|        case 21:
  ------------------
  |  Branch (682:9): [True: 4.70k, False: 123k]
  ------------------
  683|  4.70k|            i4_size = 1824768;
  684|  4.70k|            break;
  685|    789|        case 22:
  ------------------
  |  Branch (685:9): [True: 789, False: 127k]
  ------------------
  686|    789|            i4_size = 3110400;
  687|    789|            break;
  688|  2.12k|        case 30:
  ------------------
  |  Branch (688:9): [True: 2.12k, False: 126k]
  ------------------
  689|  2.12k|            i4_size = 3110400;
  690|  2.12k|            break;
  691|  6.11k|        case 31:
  ------------------
  |  Branch (691:9): [True: 6.11k, False: 122k]
  ------------------
  692|  6.11k|            i4_size = 6912000;
  693|  6.11k|            break;
  694|  29.5k|        case 32:
  ------------------
  |  Branch (694:9): [True: 29.5k, False: 99.1k]
  ------------------
  695|  29.5k|            i4_size = 7864320;
  696|  29.5k|            break;
  697|  5.65k|        case 40:
  ------------------
  |  Branch (697:9): [True: 5.65k, False: 123k]
  ------------------
  698|  5.65k|            i4_size = 12582912;
  699|  5.65k|            break;
  700|  1.43k|        case 41:
  ------------------
  |  Branch (700:9): [True: 1.43k, False: 127k]
  ------------------
  701|  1.43k|            i4_size = 12582912;
  702|  1.43k|            break;
  703|  4.61k|        case 42:
  ------------------
  |  Branch (703:9): [True: 4.61k, False: 124k]
  ------------------
  704|  4.61k|            i4_size = 12582912;
  705|  4.61k|            break;
  706|    233|        case 50:
  ------------------
  |  Branch (706:9): [True: 233, False: 128k]
  ------------------
  707|    233|            i4_size = 42393600;
  708|    233|            break;
  709|     22|        case 51:
  ------------------
  |  Branch (709:9): [True: 22, False: 128k]
  ------------------
  710|     22|            i4_size = 70778880;
  711|     22|            break;
  712|      3|        case 52:
  ------------------
  |  Branch (712:9): [True: 3, False: 128k]
  ------------------
  713|      3|            i4_size = 70778880;
  714|      3|            break;
  715|  17.2k|        default:
  ------------------
  |  Branch (715:9): [True: 17.2k, False: 111k]
  ------------------
  716|  17.2k|            i4_size = 70778880;
  717|  17.2k|            break;
  718|   128k|    }
  719|       |
  720|   128k|    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|   128k|    i4_size /= 384;
  722|   128k|    i4_size = MIN(i4_size, 16);
  ------------------
  |  |   61|   128k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 15.4k, False: 113k]
  |  |  ------------------
  ------------------
  723|   128k|    i4_size = MAX(i4_size, 1);
  ------------------
  |  |   60|   128k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 128k, False: 134]
  |  |  ------------------
  ------------------
  724|   128k|    return (i4_size);
  725|   128k|}
ih264d_init_dec_mb_grp:
  737|  24.5k|{
  738|  24.5k|    dec_seq_params_t *ps_seq = ps_dec->ps_cur_sps;
  739|  24.5k|    UWORD8 u1_frm = ps_seq->u1_frame_mbs_only_flag;
  740|       |
  741|  24.5k|    ps_dec->u4_recon_mb_grp = ps_dec->u2_frm_wd_in_mbs << ps_seq->u1_mb_aff_flag;
  742|       |
  743|  24.5k|    ps_dec->u4_recon_mb_grp_pair = ps_dec->u4_recon_mb_grp >> 1;
  744|       |
  745|  24.5k|    if(!ps_dec->u4_recon_mb_grp)
  ------------------
  |  Branch (745:8): [True: 0, False: 24.5k]
  ------------------
  746|      0|    {
  747|      0|        return ERROR_MB_GROUP_ASSGN_T;
  748|      0|    }
  749|       |
  750|  24.5k|    ps_dec->u4_num_mbs_prev_nmb = ps_dec->u4_recon_mb_grp;
  751|       |
  752|  24.5k|    return OK;
  ------------------
  |  |  114|  24.5k|#define OK        0
  ------------------
  753|  24.5k|}
ih264d_get_next_display_field:
  979|   183k|{
  980|   183k|    pic_buffer_t *pic_buf;
  981|       |
  982|   183k|    UWORD8 i1_cur_fld;
  983|   183k|    WORD32 u4_api_ret = -1;
  984|   183k|    WORD32 i4_disp_buf_id;
  985|   183k|    iv_yuv_buf_t *ps_op_frm;
  986|       |
  987|       |
  988|       |
  989|   183k|    ps_op_frm = &(ps_dec->s_disp_frame_info);
  990|   183k|    H264_MUTEX_LOCK(&ps_dec->process_disp_mutex);
  991|   183k|    pic_buf = (pic_buffer_t *)ih264_disp_mgr_get(
  992|   183k|                    (disp_mgr_t *)ps_dec->pv_disp_buf_mgr, &i4_disp_buf_id);
  993|   183k|    ps_dec->u4_num_fld_in_frm = 0;
  994|   183k|    u4_api_ret = -1;
  995|   183k|    pv_disp_op->u4_ts = 0;
  996|   183k|    pv_disp_op->e_output_format = ps_dec->u1_chroma_format;
  997|       |
  998|   183k|    pv_disp_op->s_disp_frm_buf.pv_y_buf = ps_out_buffer->pu1_bufs[0];
  999|   183k|    pv_disp_op->s_disp_frm_buf.pv_u_buf = ps_out_buffer->pu1_bufs[1];
 1000|   183k|    pv_disp_op->s_disp_frm_buf.pv_v_buf = ps_out_buffer->pu1_bufs[2];
 1001|   183k|    ps_dec->i4_display_index  = DEFAULT_POC;
  ------------------
  |  |   45|   183k|#define DEFAULT_POC 0x7FFFFFFF
  ------------------
 1002|   183k|    if(pic_buf != NULL)
  ------------------
  |  Branch (1002:8): [True: 83.7k, False: 99.5k]
  ------------------
 1003|  83.7k|    {
 1004|  83.7k|        ps_dec->pv_disp_sei_params = &pic_buf->s_sei_pic;
 1005|  83.7k|        pv_disp_op->e4_fld_type = 0;
 1006|  83.7k|        pv_disp_op->u4_disp_buf_id = i4_disp_buf_id;
 1007|       |
 1008|  83.7k|        ps_op_frm->u4_y_ht = pic_buf->u2_disp_height << 1;
 1009|  83.7k|        ps_op_frm->u4_u_ht = ps_op_frm->u4_v_ht = ps_op_frm->u4_y_ht >> 1;
 1010|  83.7k|        ps_op_frm->u4_y_wd = pic_buf->u2_disp_width;
 1011|       |
 1012|  83.7k|        ps_op_frm->u4_u_wd = ps_op_frm->u4_v_wd = ps_op_frm->u4_y_wd >> 1;
 1013|       |
 1014|  83.7k|        ps_op_frm->u4_y_strd = pic_buf->u2_frm_wd_y;
 1015|  83.7k|        ps_op_frm->u4_u_strd = ps_op_frm->u4_v_strd = pic_buf->u2_frm_wd_uv;
 1016|       |
 1017|       |        /* ! */
 1018|  83.7k|        pv_disp_op->u4_ts = pic_buf->u4_ts;
 1019|  83.7k|        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|  83.7k|        ps_op_frm->pv_y_buf = pic_buf->pu1_buf1 + pic_buf->u2_crop_offset_y;
 1023|  83.7k|        ps_op_frm->pv_u_buf = pic_buf->pu1_buf2 + pic_buf->u2_crop_offset_uv;
 1024|  83.7k|        ps_op_frm->pv_v_buf = pic_buf->pu1_buf3 + pic_buf->u2_crop_offset_uv;
 1025|  83.7k|        ps_dec->u4_num_fld_in_frm++;
 1026|  83.7k|        ps_dec->u4_num_fld_in_frm++;
 1027|  83.7k|        u4_api_ret = 0;
 1028|       |
 1029|  83.7k|        if(pic_buf->u1_picturetype == 0)
  ------------------
  |  Branch (1029:12): [True: 83.7k, False: 0]
  ------------------
 1030|  83.7k|            pv_disp_op->u4_progressive_frame_flag = 1;
 1031|      0|        else
 1032|      0|            pv_disp_op->u4_progressive_frame_flag = 0;
 1033|       |
 1034|  83.7k|    } H264_MUTEX_UNLOCK(&ps_dec->process_disp_mutex);
 1035|   183k|    pv_disp_op->u4_error_code = u4_api_ret;
 1036|   183k|    pv_disp_op->e_pic_type = 0xFFFFFFFF; //Junk;
 1037|       |
 1038|   183k|    if(u4_api_ret)
  ------------------
  |  Branch (1038:8): [True: 99.5k, False: 83.7k]
  ------------------
 1039|  99.5k|    {
 1040|  99.5k|        pv_disp_op->u4_error_code = 1; //put a proper error code here
 1041|  99.5k|    }
 1042|  83.7k|    else
 1043|  83.7k|    {
 1044|       |
 1045|       |        //Release the buffer if being sent for display
 1046|  83.7k|        UWORD32 temp;
 1047|  83.7k|        UWORD32 dest_inc_Y = 0, dest_inc_UV = 0;
 1048|       |
 1049|  83.7k|        pv_disp_op->s_disp_frm_buf.u4_y_wd = temp = MIN(ps_op_frm->u4_y_wd,
  ------------------
  |  |   61|  83.7k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 83.7k, False: 0]
  |  |  ------------------
  ------------------
 1050|  83.7k|                                                        ps_op_frm->u4_y_strd);
 1051|  83.7k|        pv_disp_op->s_disp_frm_buf.u4_u_wd = pv_disp_op->s_disp_frm_buf.u4_y_wd
 1052|  83.7k|                        >> 1;
 1053|  83.7k|        pv_disp_op->s_disp_frm_buf.u4_v_wd = pv_disp_op->s_disp_frm_buf.u4_y_wd
 1054|  83.7k|                        >> 1;
 1055|       |
 1056|  83.7k|        pv_disp_op->s_disp_frm_buf.u4_y_ht = ps_op_frm->u4_y_ht;
 1057|  83.7k|        pv_disp_op->s_disp_frm_buf.u4_u_ht = pv_disp_op->s_disp_frm_buf.u4_y_ht
 1058|  83.7k|                        >> 1;
 1059|  83.7k|        pv_disp_op->s_disp_frm_buf.u4_v_ht = pv_disp_op->s_disp_frm_buf.u4_y_ht
 1060|  83.7k|                        >> 1;
 1061|  83.7k|        if(0 == ps_dec->u4_share_disp_buf)
  ------------------
  |  Branch (1061:12): [True: 83.7k, False: 0]
  ------------------
 1062|  83.7k|        {
 1063|  83.7k|            pv_disp_op->s_disp_frm_buf.u4_y_strd =
 1064|  83.7k|                            pv_disp_op->s_disp_frm_buf.u4_y_wd;
 1065|  83.7k|            pv_disp_op->s_disp_frm_buf.u4_u_strd =
 1066|  83.7k|                            pv_disp_op->s_disp_frm_buf.u4_y_wd >> 1;
 1067|  83.7k|            pv_disp_op->s_disp_frm_buf.u4_v_strd =
 1068|  83.7k|                            pv_disp_op->s_disp_frm_buf.u4_y_wd >> 1;
 1069|       |
 1070|  83.7k|        }
 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|  83.7k|        if(ps_dec->u4_app_disp_width)
  ------------------
  |  Branch (1076:12): [True: 0, False: 83.7k]
  ------------------
 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|  83.7k|        pv_disp_op->u4_error_code = 0;
 1084|  83.7k|        if(pv_disp_op->e_output_format == IV_YUV_420P)
  ------------------
  |  Branch (1084:12): [True: 45.9k, False: 37.8k]
  ------------------
 1085|  45.9k|        {
 1086|  45.9k|            UWORD32 i;
 1087|  45.9k|            pv_disp_op->s_disp_frm_buf.u4_u_strd =
 1088|  45.9k|                            pv_disp_op->s_disp_frm_buf.u4_y_strd >> 1;
 1089|  45.9k|            pv_disp_op->s_disp_frm_buf.u4_v_strd =
 1090|  45.9k|                            pv_disp_op->s_disp_frm_buf.u4_y_strd >> 1;
 1091|       |
 1092|  45.9k|            pv_disp_op->s_disp_frm_buf.u4_u_wd = ps_op_frm->u4_y_wd >> 1;
 1093|  45.9k|            pv_disp_op->s_disp_frm_buf.u4_v_wd = ps_op_frm->u4_y_wd >> 1;
 1094|       |
 1095|  45.9k|            if(1 == ps_dec->u4_share_disp_buf)
  ------------------
  |  Branch (1095:16): [True: 0, False: 45.9k]
  ------------------
 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|  45.9k|        }
 1123|  37.8k|        else if((pv_disp_op->e_output_format == IV_YUV_420SP_UV)
  ------------------
  |  Branch (1123:17): [True: 23.6k, False: 14.2k]
  ------------------
 1124|  14.2k|                        || (pv_disp_op->e_output_format == IV_YUV_420SP_VU))
  ------------------
  |  Branch (1124:28): [True: 14.2k, False: 0]
  ------------------
 1125|  37.8k|        {
 1126|  37.8k|            pv_disp_op->s_disp_frm_buf.u4_u_strd =
 1127|  37.8k|                            pv_disp_op->s_disp_frm_buf.u4_y_strd;
 1128|  37.8k|            pv_disp_op->s_disp_frm_buf.u4_v_strd = 0;
 1129|       |
 1130|  37.8k|            if(1 == ps_dec->u4_share_disp_buf)
  ------------------
  |  Branch (1130:16): [True: 0, False: 37.8k]
  ------------------
 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|  37.8k|            pv_disp_op->s_disp_frm_buf.u4_u_wd =
 1158|  37.8k|                            pv_disp_op->s_disp_frm_buf.u4_y_wd;
 1159|  37.8k|            pv_disp_op->s_disp_frm_buf.u4_v_wd = 0;
 1160|       |
 1161|  37.8k|        }
 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|  83.7k|    }
 1177|       |
 1178|   183k|    return u4_api_ret;
 1179|   183k|}
ih264d_release_display_field:
 1203|   125k|{
 1204|   125k|    if(1 == pv_disp_op->u4_error_code)
  ------------------
  |  Branch (1204:8): [True: 77.2k, False: 48.5k]
  ------------------
 1205|  77.2k|    {
 1206|  77.2k|        if(1 == ps_dec->u1_flushfrm)
  ------------------
  |  Branch (1206:12): [True: 0, False: 77.2k]
  ------------------
 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.2k|    }
 1233|  48.5k|    else
 1234|  48.5k|    {
 1235|  48.5k|        H264_MUTEX_LOCK(&ps_dec->process_disp_mutex);
 1236|       |
 1237|  48.5k|        if(0 == ps_dec->u4_share_disp_buf)
  ------------------
  |  Branch (1237:12): [True: 48.5k, False: 0]
  ------------------
 1238|  48.5k|        {
 1239|  48.5k|            ih264_buf_mgr_release((buf_mgr_t *)ps_dec->pv_pic_buf_mgr,
 1240|  48.5k|                                  pv_disp_op->u4_disp_buf_id,
 1241|  48.5k|                                  BUF_MGR_IO);
  ------------------
  |  |   53|  48.5k|#define BUF_MGR_IO           (1 << 3)
  ------------------
 1242|       |
 1243|  48.5k|        }
 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|  48.5k|    }
 1250|   125k|}
ih264d_assign_display_seq:
 1274|   125k|{
 1275|   125k|    WORD32 i;
 1276|   125k|    WORD32 i4_min_poc;
 1277|   125k|    WORD32 i4_min_poc_buf_id;
 1278|   125k|    WORD32 i4_min_index;
 1279|   125k|    dpb_manager_t *ps_dpb_mgr = ps_dec->ps_dpb_mgr;
 1280|   125k|    WORD32 (*i4_poc_buf_id_map)[3] = ps_dpb_mgr->ai4_poc_buf_id_map;
 1281|       |
 1282|   125k|    i4_min_poc = 0x7fffffff;
 1283|   125k|    i4_min_poc_buf_id = -1;
 1284|   125k|    i4_min_index = -1;
 1285|       |
 1286|   125k|    if(ps_dpb_mgr->i1_poc_buf_id_entries >= ps_dec->i4_display_delay)
  ------------------
  |  Branch (1286:8): [True: 2.89k, False: 122k]
  ------------------
 1287|  2.89k|    {
 1288|  49.1k|        for(i = 0; i < MAX_FRAMES; i++)
  ------------------
  |  |  600|  49.1k|#define MAX_FRAMES              16
  ------------------
  |  Branch (1288:20): [True: 46.2k, False: 2.89k]
  ------------------
 1289|  46.2k|        {
 1290|  46.2k|            if((i4_poc_buf_id_map[i][0] != -1)
  ------------------
  |  Branch (1290:16): [True: 41.1k, False: 5.12k]
  ------------------
 1291|  41.1k|                            && (DO_NOT_DISP
  ------------------
  |  |  602|  41.1k|#define DO_NOT_DISP             254
  ------------------
  |  Branch (1291:32): [True: 41.1k, False: 0]
  ------------------
 1292|  41.1k|                                            != ps_dpb_mgr->ai4_poc_buf_id_map[i][0]))
 1293|  41.1k|            {
 1294|       |                /* Checking for <= is necessary to handle cases where there is one
 1295|       |                   valid buffer with poc set to 0x7FFFFFFF. */
 1296|  41.1k|                if(i4_poc_buf_id_map[i][1] <= i4_min_poc)
  ------------------
  |  Branch (1296:20): [True: 18.4k, False: 22.6k]
  ------------------
 1297|  18.4k|                {
 1298|  18.4k|                    i4_min_poc = i4_poc_buf_id_map[i][1];
 1299|  18.4k|                    i4_min_poc_buf_id = i4_poc_buf_id_map[i][0];
 1300|  18.4k|                    i4_min_index = i;
 1301|  18.4k|                }
 1302|  41.1k|            }
 1303|  46.2k|        }
 1304|       |
 1305|  2.89k|        if((i4_min_index != -1) && (DO_NOT_DISP != i4_min_poc_buf_id))
  ------------------
  |  |  602|  2.89k|#define DO_NOT_DISP             254
  ------------------
  |  Branch (1305:12): [True: 2.89k, False: 0]
  |  Branch (1305:36): [True: 2.89k, False: 0]
  ------------------
 1306|  2.89k|        {
 1307|  2.89k|            ps_dec->i4_cur_display_seq++;
 1308|  2.89k|            ih264_disp_mgr_add(
 1309|  2.89k|                            (disp_mgr_t *)ps_dec->pv_disp_buf_mgr,
 1310|  2.89k|                            i4_min_poc_buf_id, ps_dec->i4_cur_display_seq,
 1311|  2.89k|                            ps_dec->apv_buf_id_pic_buf_map[i4_min_poc_buf_id]);
 1312|  2.89k|            i4_poc_buf_id_map[i4_min_index][0] = -1;
 1313|  2.89k|            i4_poc_buf_id_map[i4_min_index][1] = 0x7fffffff;
 1314|  2.89k|            ps_dpb_mgr->i1_poc_buf_id_entries--;
 1315|  2.89k|        }
 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.89k|    }
 1324|   125k|    return OK;
  ------------------
  |  |  114|   125k|#define OK        0
  ------------------
 1325|   125k|}
ih264d_release_display_bufs:
 1350|   107k|{
 1351|   107k|    WORD32 i, j;
 1352|   107k|    WORD32 i4_min_poc;
 1353|   107k|    WORD32 i4_min_poc_buf_id;
 1354|   107k|    WORD32 i4_min_index;
 1355|   107k|    WORD64 i8_temp;
 1356|   107k|    dpb_manager_t *ps_dpb_mgr = ps_dec->ps_dpb_mgr;
 1357|   107k|    WORD32 (*i4_poc_buf_id_map)[3] = ps_dpb_mgr->ai4_poc_buf_id_map;
 1358|       |
 1359|   107k|    i4_min_poc = 0x7fffffff;
 1360|   107k|    i4_min_poc_buf_id = 0;
 1361|   107k|    i4_min_index = 0;
 1362|       |
 1363|   107k|    ih264d_delete_nonref_nondisplay_pics(ps_dpb_mgr);
 1364|       |
 1365|   197k|    for(j = 0; j < ps_dpb_mgr->i1_poc_buf_id_entries; j++)
  ------------------
  |  Branch (1365:16): [True: 90.0k, False: 107k]
  ------------------
 1366|  90.0k|    {
 1367|  90.0k|        i4_min_poc = 0x7fffffff;
 1368|  1.53M|        for(i = 0; i < MAX_FRAMES; i++)
  ------------------
  |  |  600|  1.53M|#define MAX_FRAMES              16
  ------------------
  |  Branch (1368:20): [True: 1.44M, False: 90.0k]
  ------------------
 1369|  1.44M|        {
 1370|  1.44M|            if(i4_poc_buf_id_map[i][0] != -1)
  ------------------
  |  Branch (1370:16): [True: 112k, False: 1.32M]
  ------------------
 1371|   112k|            {
 1372|       |                /* Checking for <= is necessary to handle cases where there is one
 1373|       |                   valid buffer with poc set to 0x7FFFFFFF. */
 1374|   112k|                if(i4_poc_buf_id_map[i][1] <= i4_min_poc)
  ------------------
  |  Branch (1374:20): [True: 98.6k, False: 14.2k]
  ------------------
 1375|  98.6k|                {
 1376|  98.6k|                    i4_min_poc = i4_poc_buf_id_map[i][1];
 1377|  98.6k|                    i4_min_poc_buf_id = i4_poc_buf_id_map[i][0];
 1378|  98.6k|                    i4_min_index = i;
 1379|  98.6k|                }
 1380|   112k|            }
 1381|  1.44M|        }
 1382|       |
 1383|  90.0k|        if(DO_NOT_DISP != i4_min_poc_buf_id)
  ------------------
  |  |  602|  90.0k|#define DO_NOT_DISP             254
  ------------------
  |  Branch (1383:12): [True: 90.0k, False: 0]
  ------------------
 1384|  90.0k|        {
 1385|  90.0k|            ps_dec->i4_cur_display_seq++;
 1386|  90.0k|            ih264_disp_mgr_add(
 1387|  90.0k|                            (disp_mgr_t *)ps_dec->pv_disp_buf_mgr,
 1388|  90.0k|                            i4_min_poc_buf_id, ps_dec->i4_cur_display_seq,
 1389|  90.0k|                            ps_dec->apv_buf_id_pic_buf_map[i4_min_poc_buf_id]);
 1390|  90.0k|            i4_poc_buf_id_map[i4_min_index][0] = -1;
 1391|  90.0k|            i4_poc_buf_id_map[i4_min_index][1] = 0x7fffffff;
 1392|  90.0k|            ps_dpb_mgr->ai4_poc_buf_id_map[i4_min_index][2] = 0;
 1393|  90.0k|        }
 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|  90.0k|    }
 1401|   107k|    ps_dpb_mgr->i1_poc_buf_id_entries = 0;
 1402|   107k|    i8_temp = (WORD64)ps_dec->i4_prev_max_display_seq + ps_dec->i4_max_poc
 1403|   107k|              + ps_dec->u1_max_dec_frame_buffering + 1;
 1404|       |    /*If i4_prev_max_display_seq overflows integer range, reset it */
 1405|   107k|    ps_dec->i4_prev_max_display_seq = IS_OUT_OF_RANGE_S32(i8_temp)?
  ------------------
  |  |   58|   107k|#define IS_OUT_OF_RANGE_S32(a) (((a) < INT32_MIN) || ((a) > INT32_MAX))
  |  |  ------------------
  |  |  |  Branch (58:33): [True: 0, False: 107k]
  |  |  |  Branch (58:54): [True: 181, False: 106k]
  |  |  ------------------
  ------------------
 1406|   106k|                                      0 : i8_temp;
 1407|   107k|    ps_dec->i4_max_poc = 0;
 1408|   107k|}
ih264d_assign_pic_num:
 1440|   133k|{
 1441|   133k|    dpb_manager_t *ps_dpb_mgr;
 1442|   133k|    struct dpb_info_t *ps_next_dpb;
 1443|   133k|    WORD8 i;
 1444|   133k|    WORD32 i4_cur_frame_num, i4_max_frame_num;
 1445|   133k|    WORD32 i4_ref_frame_num;
 1446|   133k|    UWORD8 u1_fld_pic_flag = ps_dec->ps_cur_slice->u1_field_pic_flag;
 1447|       |
 1448|   133k|    i4_max_frame_num = ps_dec->ps_cur_sps->u2_u4_max_pic_num_minus1 + 1;
 1449|   133k|    i4_cur_frame_num = ps_dec->ps_cur_pic->i4_frame_num;
 1450|   133k|    ps_dpb_mgr = ps_dec->ps_dpb_mgr;
 1451|       |
 1452|       |    /* Start from ST head */
 1453|   133k|    ps_next_dpb = ps_dpb_mgr->ps_dpb_st_head;
 1454|   230k|    for(i = 0; i < ps_dpb_mgr->u1_num_st_ref_bufs; i++)
  ------------------
  |  Branch (1454:16): [True: 97.8k, False: 133k]
  ------------------
 1455|  97.8k|    {
 1456|  97.8k|        WORD32 i4_pic_num;
 1457|       |
 1458|  97.8k|        i4_ref_frame_num = ps_next_dpb->ps_pic_buf->i4_frame_num;
 1459|  97.8k|        if(i4_ref_frame_num > i4_cur_frame_num)
  ------------------
  |  Branch (1459:12): [True: 26.4k, False: 71.4k]
  ------------------
 1460|  26.4k|        {
 1461|       |            /* RefPic Buf frame_num is before Current frame_num in decode order */
 1462|  26.4k|            i4_pic_num = i4_ref_frame_num - i4_max_frame_num;
 1463|  26.4k|        }
 1464|  71.4k|        else
 1465|  71.4k|        {
 1466|       |            /* RefPic Buf frame_num is after Current frame_num in decode order */
 1467|  71.4k|            i4_pic_num = i4_ref_frame_num;
 1468|  71.4k|        }
 1469|       |
 1470|  97.8k|        ps_next_dpb->ps_pic_buf->i4_pic_num = i4_pic_num;
 1471|  97.8k|        ps_next_dpb->i4_frame_num = i4_pic_num;
 1472|  97.8k|        ps_next_dpb->ps_pic_buf->u1_long_term_frm_idx = MAX_REF_BUFS + 1;
  ------------------
  |  |   75|  97.8k|#define MAX_REF_BUFS    32
  ------------------
 1473|  97.8k|        if(u1_fld_pic_flag)
  ------------------
  |  Branch (1473:12): [True: 0, False: 97.8k]
  ------------------
 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|  97.8k|        ps_next_dpb = ps_next_dpb->ps_prev_short;
 1484|  97.8k|    }
 1485|       |
 1486|   133k|    if(ps_dec->ps_cur_sps->u1_gaps_in_frame_num_value_allowed_flag
  ------------------
  |  Branch (1486:8): [True: 0, False: 133k]
  ------------------
 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|   133k|}
ih264d_update_qp:
 1530|   272k|{
 1531|   272k|    WORD32 i_temp;
 1532|   272k|    i_temp = (ps_dec->u1_qp + i1_qp + 52) % 52;
 1533|       |
 1534|   272k|    if((i_temp < 0) || (i_temp > 51) || (i1_qp < -26) || (i1_qp > 25))
  ------------------
  |  Branch (1534:8): [True: 0, False: 272k]
  |  Branch (1534:24): [True: 0, False: 272k]
  |  Branch (1534:41): [True: 0, False: 272k]
  |  Branch (1534:58): [True: 0, False: 272k]
  ------------------
 1535|      0|        return ERROR_INV_RANGE_QP_T;
 1536|       |
 1537|   272k|    ps_dec->u1_qp = i_temp;
 1538|   272k|    ps_dec->u1_qp_y_rem6 = ps_dec->u1_qp % 6;
 1539|   272k|    ps_dec->u1_qp_y_div6 = ps_dec->u1_qp / 6;
 1540|   272k|    i_temp = CLIP3(0, 51, ps_dec->u1_qp + ps_dec->ps_cur_pps->i1_chroma_qp_index_offset);
  ------------------
  |  |   77|   272k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 3.70k, False: 269k]
  |  |  |  Branch (77:54): [True: 621, False: 268k]
  |  |  ------------------
  ------------------
 1541|   272k|    ps_dec->u1_qp_u_rem6 = MOD(gau1_ih264d_qp_scale_cr[12 + i_temp], 6);
  ------------------
  |  |   64|   272k|#define MOD(x,y) ((x)%(y))
  ------------------
 1542|   272k|    ps_dec->u1_qp_u_div6 = DIV(gau1_ih264d_qp_scale_cr[12 + i_temp], 6);
  ------------------
  |  |   65|   272k|#define DIV(x,y) ((x)/(y))
  ------------------
 1543|       |
 1544|   272k|    i_temp = CLIP3(0, 51, ps_dec->u1_qp + ps_dec->ps_cur_pps->i1_second_chroma_qp_index_offset);
  ------------------
  |  |   77|   272k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 1.58k, False: 271k]
  |  |  |  Branch (77:54): [True: 6.62k, False: 264k]
  |  |  ------------------
  ------------------
 1545|   272k|    ps_dec->u1_qp_v_rem6 = MOD(gau1_ih264d_qp_scale_cr[12 + i_temp], 6);
  ------------------
  |  |   64|   272k|#define MOD(x,y) ((x)%(y))
  ------------------
 1546|   272k|    ps_dec->u1_qp_v_div6 = DIV(gau1_ih264d_qp_scale_cr[12 + i_temp], 6);
  ------------------
  |  |   65|   272k|#define DIV(x,y) ((x)/(y))
  ------------------
 1547|       |
 1548|   272k|    ps_dec->pu2_quant_scale_y =
 1549|   272k|                    gau2_ih264_iquant_scale_4x4[ps_dec->u1_qp_y_rem6];
 1550|   272k|    ps_dec->pu2_quant_scale_u =
 1551|   272k|                    gau2_ih264_iquant_scale_4x4[ps_dec->u1_qp_u_rem6];
 1552|   272k|    ps_dec->pu2_quant_scale_v =
 1553|   272k|                    gau2_ih264_iquant_scale_4x4[ps_dec->u1_qp_v_rem6];
 1554|   272k|    return OK;
  ------------------
  |  |  114|   272k|#define OK        0
  ------------------
 1555|   272k|}
ih264d_create_pic_buffers:
 1750|  24.5k|{
 1751|  24.5k|    struct pic_buffer_t *ps_pic_buf;
 1752|  24.5k|    UWORD8 i;
 1753|  24.5k|    UWORD32 u4_luma_size, u4_chroma_size;
 1754|  24.5k|    UWORD8 u1_frm = ps_dec->ps_cur_sps->u1_frame_mbs_only_flag;
 1755|  24.5k|    WORD32 j;
 1756|  24.5k|    UWORD8 *pu1_buf;
 1757|       |
 1758|  24.5k|    ps_pic_buf = ps_dec->ps_pic_buf_base;
 1759|  24.5k|    ih264_disp_mgr_init((disp_mgr_t *)ps_dec->pv_disp_buf_mgr);
 1760|  24.5k|    ih264_buf_mgr_init((buf_mgr_t *)ps_dec->pv_pic_buf_mgr);
 1761|  24.5k|    u4_luma_size = ps_dec->u2_frm_wd_y * ps_dec->u2_frm_ht_y;
 1762|  24.5k|    u4_chroma_size = ps_dec->u2_frm_wd_uv * ps_dec->u2_frm_ht_uv;
 1763|       |
 1764|  24.5k|    {
 1765|  24.5k|        if(ps_dec->u4_share_disp_buf == 1)
  ------------------
  |  Branch (1765:12): [True: 0, False: 24.5k]
  ------------------
 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|  24.5k|    }
 1785|       |
 1786|  24.5k|    pu1_buf = ps_dec->pu1_pic_buf_base;
 1787|       |
 1788|       |    /* Allocate memory for refernce buffers */
 1789|   444k|    for(i = 0; i < u1_num_of_buf; i++)
  ------------------
  |  Branch (1789:16): [True: 420k, False: 24.5k]
  ------------------
 1790|   420k|    {
 1791|   420k|        UWORD32 u4_offset;
 1792|   420k|        WORD32 buf_ret;
 1793|   420k|        UWORD8 *pu1_luma, *pu1_chroma;
 1794|   420k|        void *pv_mem_ctxt = ps_dec->pv_mem_ctxt;
 1795|       |
 1796|   420k|        pu1_luma = pu1_buf;
 1797|   420k|        pu1_buf += ALIGN64(u4_luma_size);
  ------------------
  |  |   48|   420k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
 1798|   420k|        pu1_chroma = pu1_buf;
 1799|   420k|        pu1_buf += ALIGN64(u4_chroma_size);
  ------------------
  |  |   48|   420k|#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|   420k|        if((0 == ps_dec->u4_share_disp_buf)
  ------------------
  |  Branch (1804:12): [True: 420k, False: 0]
  ------------------
 1805|      0|                        || (NULL == ps_dec->disp_bufs[i].buf[0]))
  ------------------
  |  Branch (1805:28): [True: 0, False: 0]
  ------------------
 1806|   420k|        {
 1807|   420k|            UWORD32 pad_len_h, pad_len_v;
 1808|       |
 1809|   420k|            u4_offset = ps_dec->u2_frm_wd_y * (PAD_LEN_Y_V << 1) + PAD_LEN_Y_H;
  ------------------
  |  |  572|   420k|#define PAD_LEN_Y_V                   20
  ------------------
                          u4_offset = ps_dec->u2_frm_wd_y * (PAD_LEN_Y_V << 1) + PAD_LEN_Y_H;
  ------------------
  |  |  571|   420k|#define PAD_LEN_Y_H                   32
  ------------------
 1810|   420k|            ps_pic_buf->pu1_buf1 = (UWORD8 *)(pu1_luma) + u4_offset;
 1811|       |
 1812|   420k|            pad_len_h = MAX(PAD_LEN_UV_H, (PAD_LEN_Y_H >> 1));
  ------------------
  |  |   60|   420k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [Folded, False: 420k]
  |  |  ------------------
  ------------------
 1813|   420k|            pad_len_v = MAX(PAD_LEN_UV_V, PAD_LEN_Y_V);
  ------------------
  |  |   60|   420k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [Folded, False: 420k]
  |  |  ------------------
  ------------------
 1814|       |
 1815|   420k|            u4_offset = ps_dec->u2_frm_wd_uv * pad_len_v + pad_len_h;
 1816|       |
 1817|   420k|            ps_pic_buf->pu1_buf2 = (UWORD8 *)(pu1_chroma) + u4_offset;
 1818|   420k|            ps_pic_buf->pu1_buf3 = (UWORD8 *)(NULL) + u4_offset;
 1819|       |
 1820|   420k|        }
 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|   420k|        ps_pic_buf->u2_frm_ht_y = ps_dec->u2_frm_ht_y;
 1862|   420k|        ps_pic_buf->u2_frm_ht_uv = ps_dec->u2_frm_ht_uv;
 1863|   420k|        ps_pic_buf->u2_frm_wd_y = ps_dec->u2_frm_wd_y;
 1864|   420k|        ps_pic_buf->u2_frm_wd_uv = ps_dec->u2_frm_wd_uv;
 1865|       |
 1866|   420k|        ps_pic_buf->u1_pic_buf_id = i;
 1867|       |
 1868|   420k|        buf_ret = ih264_buf_mgr_add((buf_mgr_t *)ps_dec->pv_pic_buf_mgr,
 1869|   420k|                                    ps_pic_buf, i);
 1870|   420k|        if(0 != buf_ret)
  ------------------
  |  Branch (1870:12): [True: 0, False: 420k]
  ------------------
 1871|      0|        {
 1872|      0|            ps_dec->i4_error_code = ERROR_BUF_MGR;
 1873|      0|            return ERROR_BUF_MGR;
 1874|      0|        }
 1875|       |
 1876|   420k|        ps_dec->apv_buf_id_pic_buf_map[i] = (void *)ps_pic_buf;
 1877|   420k|        ps_pic_buf++;
 1878|   420k|    }
 1879|       |
 1880|  24.5k|    if(1 == ps_dec->u4_share_disp_buf)
  ------------------
  |  Branch (1880:8): [True: 0, False: 24.5k]
  ------------------
 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|  24.5k|    return OK;
  ------------------
  |  |  114|  24.5k|#define OK        0
  ------------------
 1886|  24.5k|}
ih264d_allocate_dynamic_bufs:
 1903|  24.5k|{
 1904|  24.5k|    struct MemReq s_MemReq;
 1905|  24.5k|    struct MemBlock *p_MemBlock;
 1906|       |
 1907|  24.5k|    pred_info_t *ps_pred_frame;
 1908|  24.5k|    dec_mb_info_t *ps_frm_mb_info;
 1909|  24.5k|    dec_slice_struct_t *ps_dec_slice_buf;
 1910|  24.5k|    UWORD8 *pu1_dec_mb_map, *pu1_recon_mb_map;
 1911|  24.5k|    UWORD16 *pu2_slice_num_map;
 1912|       |
 1913|  24.5k|    WORD16 *pi16_res_coeff;
 1914|  24.5k|    WORD16 i16_status = 0;
 1915|  24.5k|    UWORD8 uc_frmOrFld = (1 - ps_dec->ps_cur_sps->u1_frame_mbs_only_flag);
 1916|  24.5k|    UWORD16 u4_luma_wd = ps_dec->u2_frm_wd_y;
 1917|  24.5k|    UWORD16 u4_chroma_wd = ps_dec->u2_frm_wd_uv;
 1918|  24.5k|    WORD8 c_i = 0;
 1919|  24.5k|    dec_seq_params_t *ps_sps = ps_dec->ps_cur_sps;
 1920|  24.5k|    UWORD32 u4_total_mbs = ps_sps->u4_total_num_of_mbs << uc_frmOrFld;
 1921|  24.5k|    UWORD32 u4_wd_mbs = ps_dec->u2_frm_wd_in_mbs;
 1922|  24.5k|    UWORD32 u4_ht_mbs = ps_dec->u2_frm_ht_in_mbs;
 1923|  24.5k|    UWORD32 u4_blk_wd;
 1924|  24.5k|    UWORD32 ui_size = 0;
 1925|  24.5k|    UWORD32 u4_int_scratch_size = 0, u4_ref_pred_size = 0;
 1926|  24.5k|    UWORD8 *pu1_buf;
 1927|  24.5k|    WORD32 num_entries;
 1928|  24.5k|    WORD32 size;
 1929|  24.5k|    void *pv_buf;
 1930|  24.5k|    UWORD32 u4_num_bufs;
 1931|  24.5k|    UWORD32 u4_luma_size, u4_chroma_size;
 1932|  24.5k|    void *pv_mem_ctxt = ps_dec->pv_mem_ctxt;
 1933|       |
 1934|  24.5k|    size = u4_total_mbs;
 1935|  24.5k|    pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1936|  24.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  24.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 24.5k]
  |  |  ------------------
  ------------------
 1937|  24.5k|    memset(pv_buf, 0, size);
 1938|  24.5k|    ps_dec->pu1_dec_mb_map = pv_buf;
 1939|       |
 1940|  24.5k|    size = u4_total_mbs;
 1941|  24.5k|    pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1942|  24.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  24.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 24.5k]
  |  |  ------------------
  ------------------
 1943|  24.5k|    memset(pv_buf, 0, size);
 1944|  24.5k|    ps_dec->pu1_recon_mb_map = pv_buf;
 1945|       |
 1946|  24.5k|    size = u4_total_mbs * sizeof(UWORD16);
 1947|  24.5k|    pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1948|  24.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  24.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 24.5k]
  |  |  ------------------
  ------------------
 1949|  24.5k|    memset(pv_buf, 0, size);
 1950|  24.5k|    ps_dec->pu2_slice_num_map = pv_buf;
 1951|       |
 1952|       |    /************************************************************/
 1953|       |    /* Post allocation Initialisations                          */
 1954|       |    /************************************************************/
 1955|  24.5k|    ps_dec->ps_parse_cur_slice = &(ps_dec->ps_dec_slice_buf[0]);
 1956|  24.5k|    ps_dec->ps_decode_cur_slice = &(ps_dec->ps_dec_slice_buf[0]);
 1957|  24.5k|    ps_dec->ps_computebs_cur_slice = &(ps_dec->ps_dec_slice_buf[0]);
 1958|       |
 1959|  24.5k|    ps_dec->ps_pred_start = ps_dec->ps_pred;
 1960|       |
 1961|  24.5k|    size = sizeof(parse_pmbarams_t) * (ps_dec->u4_recon_mb_grp);
 1962|  24.5k|    pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1963|  24.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  24.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 24.5k]
  |  |  ------------------
  ------------------
 1964|  24.5k|    memset(pv_buf, 0, size);
 1965|  24.5k|    ps_dec->ps_parse_mb_data = pv_buf;
 1966|       |
 1967|  24.5k|    size = sizeof(parse_part_params_t)
 1968|  24.5k|                        * ((ps_dec->u4_recon_mb_grp) << 4);
 1969|  24.5k|    pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1970|  24.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  24.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 24.5k]
  |  |  ------------------
  ------------------
 1971|  24.5k|    memset(pv_buf, 0, size);
 1972|  24.5k|    ps_dec->ps_parse_part_params = pv_buf;
 1973|       |
 1974|  24.5k|    size = ((u4_wd_mbs * sizeof(deblkmb_neighbour_t)) << uc_frmOrFld);
 1975|  24.5k|    pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1976|  24.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  24.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 24.5k]
  |  |  ------------------
  ------------------
 1977|  24.5k|    memset(pv_buf, 0, size);
 1978|  24.5k|    ps_dec->ps_deblk_top_mb = pv_buf;
 1979|       |
 1980|  24.5k|    size = ((sizeof(ctxt_inc_mb_info_t))
 1981|  24.5k|                        * (((u4_wd_mbs + 1) << uc_frmOrFld) + 1));
 1982|  24.5k|    pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1983|  24.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  24.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 24.5k]
  |  |  ------------------
  ------------------
 1984|  24.5k|    memset(pv_buf, 0, size);
 1985|  24.5k|    ps_dec->p_ctxt_inc_mb_map = pv_buf;
 1986|       |
 1987|       |    /* 0th entry of CtxtIncMbMap will be always be containing default values
 1988|       |     for CABAC context representing MB not available */
 1989|  24.5k|    ps_dec->p_ctxt_inc_mb_map += 1;
 1990|       |
 1991|  24.5k|    size = (sizeof(mv_pred_t) * ps_dec->u4_recon_mb_grp
 1992|  24.5k|                        * 16);
 1993|  24.5k|    pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1994|  24.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  24.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 24.5k]
  |  |  ------------------
  ------------------
 1995|  24.5k|    memset(pv_buf, 0, size);
 1996|  24.5k|    ps_dec->ps_mv_p[0] = pv_buf;
 1997|       |
 1998|  24.5k|    size = (sizeof(mv_pred_t) * ps_dec->u4_recon_mb_grp
 1999|  24.5k|                        * 16);
 2000|  24.5k|    pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2001|  24.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  24.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 24.5k]
  |  |  ------------------
  ------------------
 2002|  24.5k|    memset(pv_buf, 0, size);
 2003|  24.5k|    ps_dec->ps_mv_p[1] = pv_buf;
 2004|       |
 2005|  24.5k|    {
 2006|  24.5k|        UWORD8 i;
 2007|   122k|        for(i = 0; i < MV_SCRATCH_BUFS; i++)
  ------------------
  |  |   63|   122k|#define MV_SCRATCH_BUFS             4
  ------------------
  |  Branch (2007:20): [True: 98.1k, False: 24.5k]
  ------------------
 2008|  98.1k|        {
 2009|  98.1k|            size = (sizeof(mv_pred_t)
 2010|  98.1k|                            * ps_dec->u4_recon_mb_grp * 4);
 2011|  98.1k|            pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2012|  98.1k|            RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  98.1k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 98.1k]
  |  |  ------------------
  ------------------
 2013|  98.1k|            memset(pv_buf, 0, size);
 2014|  98.1k|            ps_dec->ps_mv_top_p[i] = pv_buf;
 2015|  98.1k|        }
 2016|  24.5k|    }
 2017|       |
 2018|  24.5k|    size = sizeof(UWORD8) * ((u4_wd_mbs + 2) * MB_SIZE) * 2;
  ------------------
  |  |  554|  24.5k|#define MB_SIZE             16
  ------------------
 2019|  24.5k|    pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2020|  24.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  24.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 24.5k]
  |  |  ------------------
  ------------------
 2021|  24.5k|    ps_dec->pu1_y_intra_pred_line = pv_buf;
 2022|  24.5k|    memset(ps_dec->pu1_y_intra_pred_line, 0, size);
 2023|  24.5k|    ps_dec->pu1_y_intra_pred_line += MB_SIZE;
  ------------------
  |  |  554|  24.5k|#define MB_SIZE             16
  ------------------
 2024|       |
 2025|  24.5k|    size = sizeof(UWORD8) * ((u4_wd_mbs + 2) * MB_SIZE) * 2;
  ------------------
  |  |  554|  24.5k|#define MB_SIZE             16
  ------------------
 2026|  24.5k|    pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2027|  24.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  24.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 24.5k]
  |  |  ------------------
  ------------------
 2028|  24.5k|    ps_dec->pu1_u_intra_pred_line = pv_buf;
 2029|  24.5k|    memset(ps_dec->pu1_u_intra_pred_line, 0, size);
 2030|  24.5k|    ps_dec->pu1_u_intra_pred_line += MB_SIZE;
  ------------------
  |  |  554|  24.5k|#define MB_SIZE             16
  ------------------
 2031|       |
 2032|  24.5k|    size = sizeof(UWORD8) * ((u4_wd_mbs + 2) * MB_SIZE) * 2;
  ------------------
  |  |  554|  24.5k|#define MB_SIZE             16
  ------------------
 2033|  24.5k|    pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2034|  24.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  24.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 24.5k]
  |  |  ------------------
  ------------------
 2035|  24.5k|    ps_dec->pu1_v_intra_pred_line = pv_buf;
 2036|  24.5k|    memset(ps_dec->pu1_v_intra_pred_line, 0, size);
 2037|  24.5k|    ps_dec->pu1_v_intra_pred_line += MB_SIZE;
  ------------------
  |  |  554|  24.5k|#define MB_SIZE             16
  ------------------
 2038|       |
 2039|  24.5k|    if(ps_dec->u1_separate_parse)
  ------------------
  |  Branch (2039:8): [True: 8.04k, False: 16.4k]
  ------------------
 2040|  8.04k|    {
 2041|       |        /* Needs one extra row of info, to hold top row data */
 2042|  8.04k|        size = sizeof(mb_neigbour_params_t)
 2043|  8.04k|                        * 2 * ((u4_wd_mbs + 2) * (u4_ht_mbs + 1));
 2044|  8.04k|    }
 2045|  16.4k|    else
 2046|  16.4k|    {
 2047|  16.4k|        size = sizeof(mb_neigbour_params_t)
 2048|  16.4k|                        * 2 * ((u4_wd_mbs + 2) << uc_frmOrFld);
 2049|  16.4k|    }
 2050|  24.5k|    pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2051|  24.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  24.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 24.5k]
  |  |  ------------------
  ------------------
 2052|       |
 2053|  24.5k|    ps_dec->ps_nbr_mb_row = pv_buf;
 2054|  24.5k|    memset(ps_dec->ps_nbr_mb_row, 0, size);
 2055|       |
 2056|       |    /* Allocate deblock MB info */
 2057|  24.5k|    size = (u4_total_mbs + u4_wd_mbs) * sizeof(deblk_mb_t);
 2058|       |
 2059|  24.5k|    pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2060|  24.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  24.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 24.5k]
  |  |  ------------------
  ------------------
 2061|  24.5k|    ps_dec->ps_deblk_pic = pv_buf;
 2062|       |
 2063|  24.5k|    memset(ps_dec->ps_deblk_pic, 0, size);
 2064|       |
 2065|       |    /* Allocate frame level mb info */
 2066|  24.5k|    size = sizeof(dec_mb_info_t) * u4_total_mbs;
 2067|  24.5k|    pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2068|  24.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  24.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 24.5k]
  |  |  ------------------
  ------------------
 2069|  24.5k|    ps_dec->ps_frm_mb_info = pv_buf;
 2070|  24.5k|    memset(ps_dec->ps_frm_mb_info, 0, size);
 2071|       |
 2072|       |    /* Allocate memory for slice headers dec_slice_struct_t */
 2073|  24.5k|    num_entries = MAX_FRAMES;
  ------------------
  |  |  600|  24.5k|#define MAX_FRAMES              16
  ------------------
 2074|  24.5k|    if((1 >= ps_dec->ps_cur_sps->u1_num_ref_frames) &&
  ------------------
  |  Branch (2074:8): [True: 20.3k, False: 4.23k]
  ------------------
 2075|  20.3k|        (0 == ps_dec->i4_display_delay))
  ------------------
  |  Branch (2075:9): [True: 0, False: 20.3k]
  ------------------
 2076|      0|    {
 2077|      0|        num_entries = 1;
 2078|      0|    }
 2079|  24.5k|    num_entries = ((2 * num_entries) + 1);
 2080|  24.5k|    num_entries *= 2;
 2081|       |
 2082|  24.5k|    size = num_entries * sizeof(void *);
 2083|  24.5k|    size += PAD_MAP_IDX_POC * sizeof(void *);
  ------------------
  |  |  100|  24.5k|#define PAD_MAP_IDX_POC             (1)
  ------------------
 2084|  24.5k|    size *= u4_total_mbs;
 2085|  24.5k|    size += sizeof(dec_slice_struct_t) * u4_total_mbs;
 2086|  24.5k|    pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2087|  24.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  24.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 24.5k]
  |  |  ------------------
  ------------------
 2088|       |
 2089|  24.5k|    ps_dec->ps_dec_slice_buf = pv_buf;
 2090|  24.5k|    memset(ps_dec->ps_dec_slice_buf, 0, size);
 2091|  24.5k|    pu1_buf = (UWORD8 *)ps_dec->ps_dec_slice_buf;
 2092|  24.5k|    pu1_buf += sizeof(dec_slice_struct_t) * u4_total_mbs;
 2093|  24.5k|    ps_dec->pv_map_ref_idx_to_poc_buf = (void *)pu1_buf;
 2094|       |
 2095|       |    /* Allocate memory for packed pred info */
 2096|  24.5k|    num_entries = u4_total_mbs;
 2097|  24.5k|    num_entries *= 16 * 2;
 2098|       |
 2099|  24.5k|    size = sizeof(pred_info_pkd_t) * num_entries;
 2100|  24.5k|    pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2101|  24.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  24.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 24.5k]
  |  |  ------------------
  ------------------
 2102|  24.5k|    memset(pv_buf, 0, size);
 2103|  24.5k|    ps_dec->ps_pred_pkd = pv_buf;
 2104|       |
 2105|       |    /* Allocate memory for coeff data */
 2106|  24.5k|    size = MB_LUM_SIZE * sizeof(WORD16);
  ------------------
  |  |  563|  24.5k|#define MB_LUM_SIZE                   256
  ------------------
 2107|       |    /*For I16x16 MBs, 16 4x4 AC coeffs and 1 4x4 DC coeff TU blocks will be sent
 2108|       |    For all MBs along with 8 4x4 AC coeffs 2 2x2 DC coeff TU blocks will be sent
 2109|       |    So use 17 4x4 TU blocks for luma and 9 4x4 TU blocks for chroma */
 2110|  24.5k|    size += u4_total_mbs * (MAX(17 * sizeof(tu_sblk4x4_coeff_data_t),4 * sizeof(tu_blk8x8_coeff_data_t))
  ------------------
  |  |   60|  24.5k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 24.5k, Folded]
  |  |  ------------------
  ------------------
 2111|  24.5k|                                            + 9 * sizeof(tu_sblk4x4_coeff_data_t));
 2112|       |    //32 bytes for each mb to store u1_prev_intra4x4_pred_mode and u1_rem_intra4x4_pred_mode data
 2113|  24.5k|    size += u4_total_mbs * 32;
 2114|  24.5k|    pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2115|  24.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  24.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 24.5k]
  |  |  ------------------
  ------------------
 2116|  24.5k|    memset(pv_buf, 0, size);
 2117|       |
 2118|  24.5k|    ps_dec->pi2_coeff_data = pv_buf;
 2119|       |
 2120|  24.5k|    ps_dec->pv_pic_tu_coeff_data = (void *)(ps_dec->pi2_coeff_data + MB_LUM_SIZE);
  ------------------
  |  |  563|  24.5k|#define MB_LUM_SIZE                   256
  ------------------
 2121|       |
 2122|       |    /* Allocate MV bank buffer */
 2123|  24.5k|    {
 2124|  24.5k|        UWORD32 col_flag_buffer_size, mvpred_buffer_size;
 2125|       |
 2126|  24.5k|        col_flag_buffer_size = ((ps_dec->u2_pic_wd * ps_dec->u2_pic_ht) >> 4);
 2127|  24.5k|        mvpred_buffer_size = sizeof(mv_pred_t)
 2128|  24.5k|                        * ((ps_dec->u2_pic_wd * (ps_dec->u2_pic_ht + PAD_MV_BANK_ROW)) >> 4);
  ------------------
  |  |  576|  24.5k|#define PAD_MV_BANK_ROW             64
  ------------------
 2129|       |
 2130|  24.5k|        u4_num_bufs = ps_dec->ps_cur_sps->u1_num_ref_frames + 1;
 2131|       |
 2132|  24.5k|        u4_num_bufs = MIN(u4_num_bufs, ps_dec->u1_pic_bufs);
  ------------------
  |  |   61|  24.5k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 24.5k, False: 0]
  |  |  ------------------
  ------------------
 2133|  24.5k|        u4_num_bufs = MAX(u4_num_bufs, 2);
  ------------------
  |  |   60|  24.5k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 4.23k, False: 20.3k]
  |  |  ------------------
  ------------------
 2134|  24.5k|        size = ALIGN64(mvpred_buffer_size) + ALIGN64(col_flag_buffer_size);
  ------------------
  |  |   48|  24.5k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
                      size = ALIGN64(mvpred_buffer_size) + ALIGN64(col_flag_buffer_size);
  ------------------
  |  |   48|  24.5k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
 2135|  24.5k|        size *= u4_num_bufs;
 2136|  24.5k|        pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2137|  24.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  24.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 24.5k]
  |  |  ------------------
  ------------------
 2138|  24.5k|        memset(pv_buf, 0, size);
 2139|  24.5k|        ps_dec->pu1_mv_bank_buf_base = pv_buf;
 2140|  24.5k|    }
 2141|       |
 2142|       |    /* Allocate Pic buffer */
 2143|      0|    u4_luma_size = ps_dec->u2_frm_wd_y * ps_dec->u2_frm_ht_y;
 2144|  24.5k|    u4_chroma_size = ps_dec->u2_frm_wd_uv * ps_dec->u2_frm_ht_uv;
 2145|       |
 2146|  24.5k|    {
 2147|  24.5k|        if(ps_dec->u4_share_disp_buf == 1)
  ------------------
  |  Branch (2147:12): [True: 0, False: 24.5k]
  ------------------
 2148|      0|        {
 2149|       |            /* In case of buffers getting shared between application and library
 2150|       |             there is no need of reference memtabs. Instead of setting the i4_size
 2151|       |             to zero, it is reduced to a small i4_size to ensure that changes
 2152|       |             in the code are minimal */
 2153|      0|            if((ps_dec->u1_chroma_format == IV_YUV_420SP_UV)
  ------------------
  |  Branch (2153:16): [True: 0, False: 0]
  ------------------
 2154|      0|                            || (ps_dec->u1_chroma_format == IV_YUV_420SP_VU)
  ------------------
  |  Branch (2154:32): [True: 0, False: 0]
  ------------------
 2155|      0|                            || (ps_dec->u1_chroma_format == IV_YUV_420P))
  ------------------
  |  Branch (2155:32): [True: 0, False: 0]
  ------------------
 2156|      0|            {
 2157|      0|                u4_luma_size = 64;
 2158|      0|            }
 2159|       |
 2160|      0|            if(ps_dec->u1_chroma_format == IV_YUV_420SP_UV)
  ------------------
  |  Branch (2160:16): [True: 0, False: 0]
  ------------------
 2161|      0|            {
 2162|      0|                u4_chroma_size = 64;
 2163|      0|            }
 2164|       |
 2165|      0|        }
 2166|  24.5k|    }
 2167|       |
 2168|  24.5k|    size = ALIGN64(u4_luma_size) + ALIGN64(u4_chroma_size);
  ------------------
  |  |   48|  24.5k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
                  size = ALIGN64(u4_luma_size) + ALIGN64(u4_chroma_size);
  ------------------
  |  |   48|  24.5k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
 2169|  24.5k|    size *= ps_dec->u1_pic_bufs;
 2170|  24.5k|    pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2171|  24.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  24.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 24.5k]
  |  |  ------------------
  ------------------
 2172|  24.5k|    memset(pv_buf, 0, size);
 2173|  24.5k|    ps_dec->pu1_pic_buf_base = pv_buf;
 2174|       |
 2175|       |    /* Allocate memory for mb_info maps */
 2176|  24.5k|    if(ps_dec->u1_enable_mb_info)
  ------------------
  |  Branch (2176:8): [True: 0, False: 24.5k]
  ------------------
 2177|      0|    {
 2178|      0|        size = (u4_total_mbs << 2) * MAX_DISP_BUFS_NEW;
  ------------------
  |  |   76|      0|#define MAX_DISP_BUFS_NEW 64
  ------------------
 2179|       |
 2180|      0|        pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2181|      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]
  |  |  ------------------
  ------------------
 2182|      0|        memset(pv_buf, 0, size);
 2183|      0|        ps_dec->pu1_qp_map_base = pv_buf;
 2184|       |
 2185|      0|        pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2186|      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]
  |  |  ------------------
  ------------------
 2187|      0|        memset(pv_buf, 0, size);
 2188|      0|        ps_dec->pu1_mb_type_map_base = pv_buf;
 2189|      0|    }
 2190|       |
 2191|       |    /* Post allocation Increment Actions */
 2192|       |
 2193|       |    /***************************************************************************/
 2194|       |    /*Initialize cabac context pointers for every SE that has fixed contextIdx */
 2195|       |    /***************************************************************************/
 2196|  24.5k|    {
 2197|  24.5k|        bin_ctxt_model_t * const p_cabac_ctxt_table_t =
 2198|  24.5k|                        ps_dec->p_cabac_ctxt_table_t;
 2199|  24.5k|        bin_ctxt_model_t * * p_coeff_abs_level_minus1_t =
 2200|  24.5k|                        ps_dec->p_coeff_abs_level_minus1_t;
 2201|  24.5k|        bin_ctxt_model_t * * p_cbf_t = ps_dec->p_cbf_t;
 2202|       |
 2203|  24.5k|        ps_dec->p_mb_field_dec_flag_t = p_cabac_ctxt_table_t
 2204|  24.5k|                        + MB_FIELD_DECODING_FLAG;
 2205|  24.5k|        ps_dec->p_prev_intra4x4_pred_mode_flag_t = p_cabac_ctxt_table_t
 2206|  24.5k|                        + PREV_INTRA4X4_PRED_MODE_FLAG;
 2207|  24.5k|        ps_dec->p_rem_intra4x4_pred_mode_t = p_cabac_ctxt_table_t
 2208|  24.5k|                        + REM_INTRA4X4_PRED_MODE;
 2209|  24.5k|        ps_dec->p_intra_chroma_pred_mode_t = p_cabac_ctxt_table_t
 2210|  24.5k|                        + INTRA_CHROMA_PRED_MODE;
 2211|  24.5k|        ps_dec->p_mb_qp_delta_t = p_cabac_ctxt_table_t + MB_QP_DELTA;
 2212|  24.5k|        ps_dec->p_ref_idx_t = p_cabac_ctxt_table_t + REF_IDX;
 2213|  24.5k|        ps_dec->p_mvd_x_t = p_cabac_ctxt_table_t + MVD_X;
 2214|  24.5k|        ps_dec->p_mvd_y_t = p_cabac_ctxt_table_t + MVD_Y;
 2215|  24.5k|        p_cbf_t[0] = p_cabac_ctxt_table_t + CBF + 0;
 2216|  24.5k|        p_cbf_t[1] = p_cabac_ctxt_table_t + CBF + 4;
 2217|  24.5k|        p_cbf_t[2] = p_cabac_ctxt_table_t + CBF + 8;
 2218|  24.5k|        p_cbf_t[3] = p_cabac_ctxt_table_t + CBF + 12;
 2219|  24.5k|        p_cbf_t[4] = p_cabac_ctxt_table_t + CBF + 16;
 2220|  24.5k|        ps_dec->p_cbp_luma_t = p_cabac_ctxt_table_t + CBP_LUMA;
 2221|  24.5k|        ps_dec->p_cbp_chroma_t = p_cabac_ctxt_table_t + CBP_CHROMA;
 2222|       |
 2223|  24.5k|        p_coeff_abs_level_minus1_t[LUMA_DC_CTXCAT] = p_cabac_ctxt_table_t
  ------------------
  |  |   71|  24.5k|#define LUMA_DC_CTXCAT    0
  ------------------
 2224|  24.5k|                        + COEFF_ABS_LEVEL_MINUS1 + COEFF_ABS_LEVEL_CAT_0_OFFSET;
 2225|       |
 2226|  24.5k|        p_coeff_abs_level_minus1_t[LUMA_AC_CTXCAT] = p_cabac_ctxt_table_t
  ------------------
  |  |   72|  24.5k|#define LUMA_AC_CTXCAT    1
  ------------------
 2227|  24.5k|                        + COEFF_ABS_LEVEL_MINUS1 + COEFF_ABS_LEVEL_CAT_1_OFFSET;
 2228|       |
 2229|  24.5k|        p_coeff_abs_level_minus1_t[LUMA_4X4_CTXCAT] = p_cabac_ctxt_table_t
  ------------------
  |  |   73|  24.5k|#define LUMA_4X4_CTXCAT   2
  ------------------
 2230|  24.5k|                        + COEFF_ABS_LEVEL_MINUS1 + COEFF_ABS_LEVEL_CAT_2_OFFSET;
 2231|       |
 2232|  24.5k|        p_coeff_abs_level_minus1_t[CHROMA_DC_CTXCAT] = p_cabac_ctxt_table_t
  ------------------
  |  |   74|  24.5k|#define CHROMA_DC_CTXCAT  3
  ------------------
 2233|  24.5k|                        + COEFF_ABS_LEVEL_MINUS1 + COEFF_ABS_LEVEL_CAT_3_OFFSET;
 2234|       |
 2235|  24.5k|        p_coeff_abs_level_minus1_t[CHROMA_AC_CTXCAT] = p_cabac_ctxt_table_t
  ------------------
  |  |   75|  24.5k|#define CHROMA_AC_CTXCAT  4
  ------------------
 2236|  24.5k|                        + COEFF_ABS_LEVEL_MINUS1 + COEFF_ABS_LEVEL_CAT_4_OFFSET;
 2237|       |
 2238|  24.5k|        p_coeff_abs_level_minus1_t[LUMA_8X8_CTXCAT] = p_cabac_ctxt_table_t
  ------------------
  |  |   76|  24.5k|#define LUMA_8X8_CTXCAT   5
  ------------------
 2239|  24.5k|                        + COEFF_ABS_LEVEL_MINUS1_8X8
 2240|  24.5k|                        + COEFF_ABS_LEVEL_CAT_5_OFFSET;
 2241|       |
 2242|       |        /********************************************************/
 2243|       |        /* context for the high profile related syntax elements */
 2244|       |        /* This is maintained seperately in s_high_profile     */
 2245|       |        /********************************************************/
 2246|  24.5k|        {
 2247|       |
 2248|  24.5k|            ps_dec->s_high_profile.ps_transform8x8_flag = p_cabac_ctxt_table_t
 2249|  24.5k|                            + TRANSFORM_SIZE_8X8_FLAG;
 2250|       |
 2251|  24.5k|            ps_dec->s_high_profile.ps_sigcoeff_8x8_frame = p_cabac_ctxt_table_t
 2252|  24.5k|                            + SIGNIFICANT_COEFF_FLAG_8X8_FRAME;
 2253|       |
 2254|  24.5k|            ps_dec->s_high_profile.ps_last_sigcoeff_8x8_frame =
 2255|  24.5k|                            p_cabac_ctxt_table_t
 2256|  24.5k|                                            + LAST_SIGNIFICANT_COEFF_FLAG_8X8_FRAME;
 2257|       |
 2258|  24.5k|            ps_dec->s_high_profile.ps_coeff_abs_levelminus1 =
 2259|  24.5k|                            p_cabac_ctxt_table_t + COEFF_ABS_LEVEL_MINUS1_8X8;
 2260|       |
 2261|  24.5k|            ps_dec->s_high_profile.ps_sigcoeff_8x8_field = p_cabac_ctxt_table_t
 2262|  24.5k|                            + SIGNIFICANT_COEFF_FLAG_8X8_FIELD;
 2263|       |
 2264|  24.5k|            ps_dec->s_high_profile.ps_last_sigcoeff_8x8_field =
 2265|  24.5k|                            p_cabac_ctxt_table_t
 2266|  24.5k|                                            + LAST_SIGNIFICANT_COEFF_FLAG_8X8_FIELD;
 2267|  24.5k|        }
 2268|  24.5k|    }
 2269|  24.5k|    return (i16_status);
 2270|  24.5k|}
ih264d_free_dynamic_bufs:
 2287|   151k|{
 2288|   151k|    PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pu1_bits_buf_dynamic);
  ------------------
  |  |   43|   151k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   151k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 0, False: 151k]
  |  |  ------------------
  ------------------
 2289|       |
 2290|   151k|    PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_deblk_pic);
  ------------------
  |  |   43|   151k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   151k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 24.5k, False: 127k]
  |  |  ------------------
  ------------------
 2291|   151k|    PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pu1_dec_mb_map);
  ------------------
  |  |   43|   151k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   151k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 24.5k, False: 127k]
  |  |  ------------------
  ------------------
 2292|   151k|    PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pu1_recon_mb_map);
  ------------------
  |  |   43|   151k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   151k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 24.5k, False: 127k]
  |  |  ------------------
  ------------------
 2293|   151k|    PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pu2_slice_num_map);
  ------------------
  |  |   43|   151k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   151k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 24.5k, False: 127k]
  |  |  ------------------
  ------------------
 2294|   151k|    PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_dec_slice_buf);
  ------------------
  |  |   43|   151k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   151k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 24.5k, False: 127k]
  |  |  ------------------
  ------------------
 2295|   151k|    PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_frm_mb_info);
  ------------------
  |  |   43|   151k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   151k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 24.5k, False: 127k]
  |  |  ------------------
  ------------------
 2296|   151k|    PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pi2_coeff_data);
  ------------------
  |  |   43|   151k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   151k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 24.5k, False: 127k]
  |  |  ------------------
  ------------------
 2297|   151k|    PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_parse_mb_data);
  ------------------
  |  |   43|   151k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   151k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 24.5k, False: 127k]
  |  |  ------------------
  ------------------
 2298|   151k|    PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_parse_part_params);
  ------------------
  |  |   43|   151k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   151k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 24.5k, False: 127k]
  |  |  ------------------
  ------------------
 2299|   151k|    PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_deblk_top_mb);
  ------------------
  |  |   43|   151k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   151k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 24.5k, False: 127k]
  |  |  ------------------
  ------------------
 2300|       |
 2301|   151k|    if(ps_dec->p_ctxt_inc_mb_map)
  ------------------
  |  Branch (2301:8): [True: 24.5k, False: 127k]
  ------------------
 2302|  24.5k|    {
 2303|  24.5k|        ps_dec->p_ctxt_inc_mb_map -= 1;
 2304|  24.5k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->p_ctxt_inc_mb_map);
  ------------------
  |  |   43|  24.5k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  24.5k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 24.5k, False: 0]
  |  |  ------------------
  ------------------
 2305|  24.5k|    }
 2306|       |
 2307|   151k|    PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_mv_p[0]);
  ------------------
  |  |   43|   151k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   151k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 24.5k, False: 127k]
  |  |  ------------------
  ------------------
 2308|   151k|    PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_mv_p[1]);
  ------------------
  |  |   43|   151k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   151k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 24.5k, False: 127k]
  |  |  ------------------
  ------------------
 2309|   151k|    PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_pred_pkd);
  ------------------
  |  |   43|   151k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   151k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 24.5k, False: 127k]
  |  |  ------------------
  ------------------
 2310|   151k|    {
 2311|   151k|        UWORD8 i;
 2312|   758k|        for(i = 0; i < MV_SCRATCH_BUFS; i++)
  ------------------
  |  |   63|   758k|#define MV_SCRATCH_BUFS             4
  ------------------
  |  Branch (2312:20): [True: 606k, False: 151k]
  ------------------
 2313|   606k|        {
 2314|   606k|            PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_mv_top_p[i]);
  ------------------
  |  |   43|   606k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   606k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 98.1k, False: 508k]
  |  |  ------------------
  ------------------
 2315|   606k|        }
 2316|   151k|    }
 2317|       |
 2318|   151k|    if(ps_dec->pu1_y_intra_pred_line)
  ------------------
  |  Branch (2318:8): [True: 24.5k, False: 127k]
  ------------------
 2319|  24.5k|    {
 2320|  24.5k|        ps_dec->pu1_y_intra_pred_line -= MB_SIZE;
  ------------------
  |  |  554|  24.5k|#define MB_SIZE             16
  ------------------
 2321|  24.5k|    }
 2322|   151k|    PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pu1_y_intra_pred_line);
  ------------------
  |  |   43|   151k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   151k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 24.5k, False: 127k]
  |  |  ------------------
  ------------------
 2323|       |
 2324|   151k|    if(ps_dec->pu1_u_intra_pred_line)
  ------------------
  |  Branch (2324:8): [True: 24.5k, False: 127k]
  ------------------
 2325|  24.5k|    {
 2326|  24.5k|        ps_dec->pu1_u_intra_pred_line -= MB_SIZE;
  ------------------
  |  |  554|  24.5k|#define MB_SIZE             16
  ------------------
 2327|  24.5k|    }
 2328|   151k|    PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pu1_u_intra_pred_line);
  ------------------
  |  |   43|   151k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   151k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 24.5k, False: 127k]
  |  |  ------------------
  ------------------
 2329|       |
 2330|   151k|    if(ps_dec->pu1_v_intra_pred_line)
  ------------------
  |  Branch (2330:8): [True: 24.5k, False: 127k]
  ------------------
 2331|  24.5k|    {
 2332|  24.5k|        ps_dec->pu1_v_intra_pred_line -= MB_SIZE;
  ------------------
  |  |  554|  24.5k|#define MB_SIZE             16
  ------------------
 2333|  24.5k|    }
 2334|   151k|    PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pu1_v_intra_pred_line);
  ------------------
  |  |   43|   151k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   151k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 24.5k, False: 127k]
  |  |  ------------------
  ------------------
 2335|   151k|    PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_nbr_mb_row);
  ------------------
  |  |   43|   151k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   151k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 24.5k, False: 127k]
  |  |  ------------------
  ------------------
 2336|   151k|    PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pu1_mv_bank_buf_base);
  ------------------
  |  |   43|   151k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   151k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 24.5k, False: 127k]
  |  |  ------------------
  ------------------
 2337|   151k|    PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pu1_pic_buf_base);
  ------------------
  |  |   43|   151k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   151k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 24.5k, False: 127k]
  |  |  ------------------
  ------------------
 2338|       |
 2339|       |    /* Free memory for mb_info maps */
 2340|   151k|    if(ps_dec->u1_enable_mb_info)
  ------------------
  |  Branch (2340:8): [True: 0, False: 151k]
  ------------------
 2341|      0|    {
 2342|      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]
  |  |  ------------------
  ------------------
 2343|       |        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]
  |  |  ------------------
  ------------------
 2344|      0|    }
 2345|   151k|    return 0;
 2346|   151k|}
ih264d_create_mv_bank:
 2373|  24.5k|{
 2374|  24.5k|    UWORD8  i;
 2375|  24.5k|    UWORD32 col_flag_buffer_size, mvpred_buffer_size;
 2376|  24.5k|    UWORD8 *pu1_mv_buf_mgr_base, *pu1_mv_bank_base;
 2377|  24.5k|    col_mv_buf_t *ps_col_mv;
 2378|  24.5k|    mv_pred_t *ps_mv;
 2379|  24.5k|    UWORD8 *pu1_col_zero_flag_buf;
 2380|  24.5k|    dec_struct_t *ps_dec = (dec_struct_t *)pv_dec;
 2381|  24.5k|    WORD32 buf_ret;
 2382|  24.5k|    UWORD32 u4_num_bufs;
 2383|  24.5k|    UWORD8 *pu1_buf;
 2384|  24.5k|    WORD32 size;
 2385|  24.5k|    void *pv_mem_ctxt = ps_dec->pv_mem_ctxt;
 2386|       |
 2387|  24.5k|    col_flag_buffer_size = ((ui_width * ui_height) >> 4);
 2388|  24.5k|    mvpred_buffer_size = sizeof(mv_pred_t)
 2389|  24.5k|                    * ((ui_width * (ui_height + PAD_MV_BANK_ROW)) >> 4);
  ------------------
  |  |  576|  24.5k|#define PAD_MV_BANK_ROW             64
  ------------------
 2390|       |
 2391|  24.5k|    ih264_buf_mgr_init((buf_mgr_t *)ps_dec->pv_mv_buf_mgr);
 2392|       |
 2393|  24.5k|    ps_col_mv = ps_dec->ps_col_mv_base;
 2394|       |
 2395|  24.5k|    u4_num_bufs = ps_dec->ps_cur_sps->u1_num_ref_frames + 1;
 2396|       |
 2397|  24.5k|    u4_num_bufs = MIN(u4_num_bufs, ps_dec->u1_pic_bufs);
  ------------------
  |  |   61|  24.5k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 24.5k, False: 0]
  |  |  ------------------
  ------------------
 2398|  24.5k|    u4_num_bufs = MAX(u4_num_bufs, 2);
  ------------------
  |  |   60|  24.5k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 4.23k, False: 20.3k]
  |  |  ------------------
  ------------------
 2399|  24.5k|    pu1_buf = ps_dec->pu1_mv_bank_buf_base;
 2400|  93.3k|    for(i = 0 ; i < u4_num_bufs ; i++)
  ------------------
  |  Branch (2400:17): [True: 68.7k, False: 24.5k]
  ------------------
 2401|  68.7k|    {
 2402|  68.7k|        pu1_col_zero_flag_buf = pu1_buf;
 2403|  68.7k|        pu1_buf += ALIGN64(col_flag_buffer_size);
  ------------------
  |  |   48|  68.7k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
 2404|       |
 2405|  68.7k|        ps_mv = (mv_pred_t *)pu1_buf;
 2406|  68.7k|        pu1_buf += ALIGN64(mvpred_buffer_size);
  ------------------
  |  |   48|  68.7k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
 2407|       |
 2408|  68.7k|        memset(ps_mv, 0, ((ui_width * OFFSET_MV_BANK_ROW) >> 4) * sizeof(mv_pred_t));
  ------------------
  |  |   97|  68.7k|#define OFFSET_MV_BANK_ROW          ((PAD_MV_BANK_ROW)>>1)
  |  |  ------------------
  |  |  |  |  576|  68.7k|#define PAD_MV_BANK_ROW             64
  |  |  ------------------
  ------------------
 2409|  68.7k|        ps_mv += (ui_width*OFFSET_MV_BANK_ROW) >> 4;
  ------------------
  |  |   97|  68.7k|#define OFFSET_MV_BANK_ROW          ((PAD_MV_BANK_ROW)>>1)
  |  |  ------------------
  |  |  |  |  576|  68.7k|#define PAD_MV_BANK_ROW             64
  |  |  ------------------
  ------------------
 2410|       |
 2411|  68.7k|        ps_col_mv->pv_col_zero_flag = (void *)pu1_col_zero_flag_buf;
 2412|  68.7k|        ps_col_mv->pv_mv = (void *)ps_mv;
 2413|  68.7k|        buf_ret = ih264_buf_mgr_add((buf_mgr_t *)ps_dec->pv_mv_buf_mgr, ps_col_mv, i);
 2414|  68.7k|        if(0 != buf_ret)
  ------------------
  |  Branch (2414:12): [True: 0, False: 68.7k]
  ------------------
 2415|      0|        {
 2416|      0|            ps_dec->i4_error_code = ERROR_BUF_MGR;
 2417|      0|            return ERROR_BUF_MGR;
 2418|      0|        }
 2419|  68.7k|        ps_col_mv++;
 2420|  68.7k|    }
 2421|  24.5k|    return OK;
  ------------------
  |  |  114|  24.5k|#define OK        0
  ------------------
 2422|  24.5k|}
ih264d_unpack_coeff4x4_dc_4x4blk:
 2427|   177k|{
 2428|   177k|    UWORD16 u2_sig_coeff_map = ps_tu_4x4->u2_sig_coeff_map;
 2429|   177k|    WORD32 idx;
 2430|   177k|    WORD16 *pi2_coeff_data = &ps_tu_4x4->ai2_level[0];
 2431|       |
 2432|   458k|    while(u2_sig_coeff_map)
  ------------------
  |  Branch (2432:11): [True: 280k, False: 177k]
  ------------------
 2433|   280k|    {
 2434|   280k|        idx = CLZ(u2_sig_coeff_map);
 2435|       |
 2436|   280k|        idx = 31 - idx;
 2437|   280k|        RESET_BIT(u2_sig_coeff_map,idx);
  ------------------
  |  |  105|   280k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  ------------------
 2438|       |
 2439|   280k|        idx = pu1_inv_scan[idx];
 2440|   280k|        pi2_out_coeff_data[idx] = *pi2_coeff_data++;
 2441|       |
 2442|   280k|    }
 2443|   177k|}

ih264d_parse_hrd_parametres:
   70|  7.15k|{
   71|  7.15k|    UWORD8 u1_index;
   72|  7.15k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
   73|  7.15k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
   74|       |
   75|  7.15k|    ps_hrd->u4_cpb_cnt = 1
   76|  7.15k|                    + ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
   77|  7.15k|    if(ps_hrd->u4_cpb_cnt > 31)
  ------------------
  |  Branch (77:8): [True: 364, False: 6.79k]
  ------------------
   78|    364|        return ERROR_INV_SPS_PPS_T;
   79|  6.79k|    ps_hrd->u1_bit_rate_scale = ih264d_get_bits_h264(ps_bitstrm, 4);
   80|  6.79k|    ps_hrd->u1_cpb_size_scale = ih264d_get_bits_h264(ps_bitstrm, 4);
   81|       |
   82|  23.0k|    for(u1_index = 0; u1_index < (UWORD8)ps_hrd->u4_cpb_cnt; u1_index++)
  ------------------
  |  Branch (82:23): [True: 16.2k, False: 6.79k]
  ------------------
   83|  16.2k|    {
   84|  16.2k|        ps_hrd->u4_bit_rate[u1_index] = 1
   85|  16.2k|                        + ih264d_uev(pu4_bitstrm_ofst,
   86|  16.2k|                                     pu4_bitstrm_buf);
   87|  16.2k|        ps_hrd->u4_cpb_size[u1_index] = 1
   88|  16.2k|                        + ih264d_uev(pu4_bitstrm_ofst,
   89|  16.2k|                                     pu4_bitstrm_buf);
   90|  16.2k|        ps_hrd->u1_cbr_flag[u1_index] = ih264d_get_bits_h264(ps_bitstrm, 1);
   91|  16.2k|    }
   92|       |
   93|  6.79k|    ps_hrd->u1_initial_cpb_removal_delay = 1
   94|  6.79k|                    + ih264d_get_bits_h264(ps_bitstrm, 5);
   95|  6.79k|    ps_hrd->u1_cpb_removal_delay_length = 1
   96|  6.79k|                    + ih264d_get_bits_h264(ps_bitstrm, 5);
   97|  6.79k|    ps_hrd->u1_dpb_output_delay_length = 1
   98|  6.79k|                    + ih264d_get_bits_h264(ps_bitstrm, 5);
   99|  6.79k|    ps_hrd->u1_time_offset_length = ih264d_get_bits_h264(ps_bitstrm, 5);
  100|       |
  101|  6.79k|    return OK;
  ------------------
  |  |  114|  6.79k|#define OK        0
  ------------------
  102|  7.15k|}
ih264d_parse_vui_parametres:
  127|  9.12k|{
  128|  9.12k|    UWORD8 u4_bits;
  129|  9.12k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
  130|  9.12k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
  131|  9.12k|    WORD32 ret;
  132|       |
  133|  9.12k|    u4_bits = ih264d_get_bits_h264(ps_bitstrm, 1);
  134|  9.12k|    if(u4_bits)
  ------------------
  |  Branch (134:8): [True: 6.84k, False: 2.27k]
  ------------------
  135|  6.84k|    {
  136|  6.84k|        u4_bits = ih264d_get_bits_h264(ps_bitstrm, 8);
  137|  6.84k|        ps_vu4->u1_aspect_ratio_idc = (UWORD8)u4_bits;
  138|  6.84k|        if(VUI_EXTENDED_SAR == u4_bits)
  ------------------
  |  |   46|  6.84k|#define VUI_EXTENDED_SAR    255
  ------------------
  |  Branch (138:12): [True: 3.72k, False: 3.12k]
  ------------------
  139|  3.72k|        {
  140|  3.72k|            ps_vu4->u2_sar_width = ih264d_get_bits_h264(ps_bitstrm, 16);
  141|  3.72k|            ps_vu4->u2_sar_height = ih264d_get_bits_h264(ps_bitstrm, 16);
  142|  3.72k|        }
  143|  6.84k|    }
  144|       |
  145|  9.12k|    u4_bits = ih264d_get_bits_h264(ps_bitstrm, 1);
  146|  9.12k|    if(u4_bits)
  ------------------
  |  Branch (146:8): [True: 2.36k, False: 6.76k]
  ------------------
  147|  2.36k|    {
  148|  2.36k|        ps_vu4->u1_overscan_appropriate_flag = ih264d_get_bits_h264(
  149|  2.36k|                        ps_bitstrm, 1);
  150|  2.36k|    }
  151|  9.12k|    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|  9.12k|    ps_vu4->u1_video_format = 5;
  155|  9.12k|    ps_vu4->u1_video_full_range_flag = 0;
  156|  9.12k|    ps_vu4->u1_colour_primaries = 2;
  157|  9.12k|    ps_vu4->u1_tfr_chars = 2;
  158|  9.12k|    ps_vu4->u1_matrix_coeffs = 2;
  159|       |
  160|  9.12k|    if(u4_bits)
  ------------------
  |  Branch (160:8): [True: 2.72k, False: 6.39k]
  ------------------
  161|  2.72k|    {
  162|  2.72k|        ps_vu4->u1_video_format = ih264d_get_bits_h264(ps_bitstrm, 3);
  163|  2.72k|        ps_vu4->u1_video_full_range_flag = ih264d_get_bits_h264(ps_bitstrm,
  164|  2.72k|                                                                1);
  165|  2.72k|        u4_bits = ih264d_get_bits_h264(ps_bitstrm, 1);
  166|  2.72k|        if(u4_bits)
  ------------------
  |  Branch (166:12): [True: 1.41k, False: 1.31k]
  ------------------
  167|  1.41k|        {
  168|  1.41k|            ps_vu4->u1_colour_primaries = ih264d_get_bits_h264(ps_bitstrm,
  169|  1.41k|                                                               8);
  170|  1.41k|            ps_vu4->u1_tfr_chars = ih264d_get_bits_h264(ps_bitstrm, 8);
  171|  1.41k|            ps_vu4->u1_matrix_coeffs = ih264d_get_bits_h264(ps_bitstrm, 8);
  172|  1.41k|        }
  173|  2.72k|    }
  174|       |
  175|  9.12k|    u4_bits = ih264d_get_bits_h264(ps_bitstrm, 1);
  176|  9.12k|    if(u4_bits)
  ------------------
  |  Branch (176:8): [True: 1.79k, False: 7.32k]
  ------------------
  177|  1.79k|    {
  178|  1.79k|        ps_vu4->u1_cr_top_field = ih264d_uev(pu4_bitstrm_ofst,
  179|  1.79k|                                             pu4_bitstrm_buf);
  180|  1.79k|        ps_vu4->u1_cr_bottom_field = ih264d_uev(pu4_bitstrm_ofst,
  181|  1.79k|                                                pu4_bitstrm_buf);
  182|  1.79k|    }
  183|       |
  184|  9.12k|    u4_bits = ih264d_get_bits_h264(ps_bitstrm, 1);
  185|  9.12k|    if(u4_bits)
  ------------------
  |  Branch (185:8): [True: 1.20k, False: 7.91k]
  ------------------
  186|  1.20k|    {
  187|  1.20k|        ps_vu4->u4_num_units_in_tick = ih264d_get_bits_h264(ps_bitstrm, 32);
  188|  1.20k|        ps_vu4->u4_time_scale = ih264d_get_bits_h264(ps_bitstrm, 32);
  189|  1.20k|        ps_vu4->u1_fixed_frame_rate_flag = ih264d_get_bits_h264(ps_bitstrm,
  190|  1.20k|                                                                1);
  191|  1.20k|    }
  192|       |
  193|  9.12k|    u4_bits = ih264d_get_bits_h264(ps_bitstrm, 1);
  194|  9.12k|    ps_vu4->u1_nal_hrd_params_present = u4_bits;
  195|  9.12k|    if(u4_bits)
  ------------------
  |  Branch (195:8): [True: 1.40k, False: 7.71k]
  ------------------
  196|  1.40k|    {
  197|  1.40k|        ret = ih264d_parse_hrd_parametres(&ps_vu4->s_nal_hrd, ps_bitstrm);
  198|  1.40k|        if(ret != OK)
  ------------------
  |  |  114|  1.40k|#define OK        0
  ------------------
  |  Branch (198:12): [True: 105, False: 1.29k]
  ------------------
  199|    105|            return ret;
  200|  1.40k|    }
  201|  9.01k|    u4_bits = ih264d_get_bits_h264(ps_bitstrm, 1);
  202|  9.01k|    ps_vu4->u1_vcl_hrd_params_present = u4_bits;
  203|  9.01k|    if(u4_bits)
  ------------------
  |  Branch (203:8): [True: 1.53k, False: 7.48k]
  ------------------
  204|  1.53k|    {
  205|  1.53k|        ret = ih264d_parse_hrd_parametres(&ps_vu4->s_vcl_hrd, ps_bitstrm);
  206|  1.53k|        if(ret != OK)
  ------------------
  |  |  114|  1.53k|#define OK        0
  ------------------
  |  Branch (206:12): [True: 104, False: 1.42k]
  ------------------
  207|    104|            return ret;
  208|  1.53k|    }
  209|       |
  210|  8.91k|    if(ps_vu4->u1_nal_hrd_params_present || u4_bits)
  ------------------
  |  Branch (210:8): [True: 1.28k, False: 7.63k]
  |  Branch (210:45): [True: 759, False: 6.87k]
  ------------------
  211|  2.03k|    {
  212|  2.03k|        ps_vu4->u1_low_delay_hrd_flag = ih264d_get_bits_h264(ps_bitstrm, 1);
  213|  2.03k|    }
  214|  8.91k|    ps_vu4->u1_pic_struct_present_flag = ih264d_get_bits_h264(ps_bitstrm, 1);
  215|       |
  216|  8.91k|    ps_vu4->u1_bitstream_restriction_flag = ih264d_get_bits_h264(ps_bitstrm, 1);
  217|       |
  218|  8.91k|    if(ps_vu4->u1_bitstream_restriction_flag)
  ------------------
  |  Branch (218:8): [True: 1.59k, False: 7.31k]
  ------------------
  219|  1.59k|    {
  220|  1.59k|        ps_vu4->u1_mv_over_pic_boundaries_flag = ih264d_get_bits_h264(
  221|  1.59k|                        ps_bitstrm, 1);
  222|  1.59k|        ps_vu4->u4_max_bytes_per_pic_denom = ih264d_uev(pu4_bitstrm_ofst,
  223|  1.59k|                                                        pu4_bitstrm_buf);
  224|  1.59k|        ps_vu4->u4_max_bits_per_mb_denom = ih264d_uev(pu4_bitstrm_ofst,
  225|  1.59k|                                                      pu4_bitstrm_buf);
  226|  1.59k|        ps_vu4->u4_log2_max_mv_length_horz = ih264d_uev(pu4_bitstrm_ofst,
  227|  1.59k|                                                        pu4_bitstrm_buf);
  228|  1.59k|        ps_vu4->u4_log2_max_mv_length_vert = ih264d_uev(pu4_bitstrm_ofst,
  229|  1.59k|                                                        pu4_bitstrm_buf);
  230|  1.59k|        ps_vu4->u4_num_reorder_frames = ih264d_uev(pu4_bitstrm_ofst,
  231|  1.59k|                                                   pu4_bitstrm_buf);
  232|  1.59k|        ps_vu4->u4_max_dec_frame_buffering = ih264d_uev(pu4_bitstrm_ofst,
  233|  1.59k|                                                        pu4_bitstrm_buf);
  234|  1.59k|        if((ps_vu4->u4_max_dec_frame_buffering > (H264_MAX_REF_PICS * 2)) ||
  ------------------
  |  |  534|  1.59k|#define H264_MAX_REF_PICS         16
  ------------------
  |  Branch (234:12): [True: 136, False: 1.46k]
  ------------------
  235|  1.46k|           (ps_vu4->u4_num_reorder_frames > ps_vu4->u4_max_dec_frame_buffering))
  ------------------
  |  Branch (235:12): [True: 110, False: 1.35k]
  ------------------
  236|    246|        {
  237|    246|            return ERROR_INV_SPS_PPS_T;
  238|    246|        }
  239|  1.59k|    }
  240|  7.31k|    else
  241|  7.31k|    {
  242|       |        /* Setting this to a large value if not present */
  243|  7.31k|        ps_vu4->u4_num_reorder_frames = 64;
  244|  7.31k|        ps_vu4->u4_max_dec_frame_buffering = 64;
  245|  7.31k|    }
  246|       |
  247|  8.66k|    return OK;
  ------------------
  |  |  114|  8.66k|#define OK        0
  ------------------
  248|  8.91k|}

isvcd_set_processor:
  979|  22.5k|{
  980|  22.5k|    isvcd_ctl_set_processor_ip_t *ps_ip;
  981|  22.5k|    isvcd_ctl_set_processor_op_t *ps_op;
  982|  22.5k|    UWORD8 u1_layer_id;
  983|  22.5k|    svc_dec_lyr_struct_t *ps_codec;
  984|  22.5k|    svc_dec_ctxt_t *ps_svcd_ctxt;
  985|  22.5k|    ps_svcd_ctxt = (svc_dec_ctxt_t *) dec_hdl->pv_codec_handle;
  986|       |
  987|  22.5k|    ps_ip = (isvcd_ctl_set_processor_ip_t *) pv_api_ip;
  988|  22.5k|    ps_op = (isvcd_ctl_set_processor_op_t *) pv_api_op;
  989|       |
  990|  22.5k|    ps_svcd_ctxt->e_processor_arch = (IVD_ARCH_T) ps_ip->u4_arch;
  991|  22.5k|    ps_svcd_ctxt->e_processor_soc = (IVD_SOC_T) ps_ip->u4_soc;
  992|       |
  993|  90.1k|    for(u1_layer_id = 0; u1_layer_id < MAX_NUM_RES_LYRS; u1_layer_id++)
  ------------------
  |  |   94|  90.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (993:26): [True: 67.5k, False: 22.5k]
  ------------------
  994|  67.5k|    {
  995|  67.5k|        ps_codec = &ps_svcd_ctxt->ps_svc_dec_lyr[u1_layer_id];
  996|  67.5k|        ps_codec->s_dec.e_processor_arch = (IVD_ARCH_T) ps_ip->u4_arch;
  997|  67.5k|        ps_codec->s_dec.e_processor_soc = (IVD_SOC_T) ps_ip->u4_soc;
  998|       |
  999|  67.5k|        isvcd_init_function_ptr(ps_codec);
 1000|  67.5k|    }
 1001|       |
 1002|  22.5k|    ps_op->u4_error_code = 0;
 1003|  22.5k|    return IV_SUCCESS;
 1004|  22.5k|}
isvcd_init_decoder:
 1029|  84.0k|{
 1030|  84.0k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec = (svc_dec_lyr_struct_t *) ps_dec_svc_lyr_params;
 1031|  84.0k|    dec_struct_t *ps_dec;
 1032|  84.0k|    dec_slice_params_t *ps_cur_slice;
 1033|  84.0k|    pocstruct_t *ps_prev_poc, *ps_cur_poc;
 1034|  84.0k|    size_t size;
 1035|  84.0k|    ps_dec = &ps_svc_lyr_dec->s_dec;
 1036|       |
 1037|  84.0k|    size = sizeof(pred_info_t) * 2 * 32;
 1038|  84.0k|    memset(ps_dec->ps_pred, 0, size);
 1039|       |
 1040|  84.0k|    size = sizeof(disp_mgr_t);
 1041|  84.0k|    memset(ps_dec->pv_disp_buf_mgr, 0, size);
 1042|       |
 1043|  84.0k|    size = ih264_buf_mgr_size();
 1044|  84.0k|    memset(ps_dec->pv_pic_buf_mgr, 0, size);
 1045|       |
 1046|  84.0k|    size = sizeof(dec_err_status_t);
 1047|  84.0k|    memset(ps_dec->ps_dec_err_status, 0, size);
 1048|       |
 1049|  84.0k|    size = sizeof(sei);
 1050|  84.0k|    memset(ps_dec->ps_sei, 0, size);
 1051|       |
 1052|  84.0k|    size = sizeof(sei);
 1053|  84.0k|    memset(ps_dec->ps_sei_parse, 0, size);
 1054|       |
 1055|  84.0k|    size = sizeof(dpb_commands_t);
 1056|  84.0k|    memset(ps_dec->ps_dpb_cmds, 0, size);
 1057|       |
 1058|  84.0k|    size = sizeof(dec_bit_stream_t);
 1059|  84.0k|    memset(ps_dec->ps_bitstrm, 0, size);
 1060|       |
 1061|  84.0k|    size = sizeof(dec_slice_params_t);
 1062|  84.0k|    memset(ps_dec->ps_cur_slice, 0, size);
 1063|       |
 1064|  84.0k|    size = MAX(sizeof(dec_seq_params_t), sizeof(dec_pic_params_t));
  ------------------
  |  |   60|  84.0k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 84.0k, Folded]
  |  |  ------------------
  ------------------
 1065|  84.0k|    memset(ps_dec->pv_scratch_sps_pps, 0, size);
 1066|       |
 1067|  84.0k|    size = sizeof(dec_svc_seq_params_t);
 1068|  84.0k|    memset(ps_svc_lyr_dec->pv_scratch_subset_sps, 0, size);
 1069|       |
 1070|  84.0k|    size = sizeof(ctxt_inc_mb_info_t);
 1071|  84.0k|    memset(ps_dec->ps_left_mb_ctxt_info, 0, size);
 1072|       |
 1073|  84.0k|    size = (sizeof(neighbouradd_t) << 2);
 1074|  84.0k|    memset(ps_dec->ps_left_mvpred_addr, 0, size);
 1075|       |
 1076|  84.0k|    size = ih264_buf_mgr_size();
 1077|  84.0k|    memset(ps_dec->pv_mv_buf_mgr, 0, size);
 1078|       |
 1079|       |    /* Free any dynamic buffers that are allocated */
 1080|  84.0k|    isvcd_free_dynamic_bufs(ps_svc_lyr_dec);
 1081|       |
 1082|  84.0k|    isvcd_init_dpb_ref_bufs(ps_dec);
 1083|       |
 1084|  84.0k|    ps_cur_slice = ps_dec->ps_cur_slice;
 1085|  84.0k|    ps_dec->init_done = 0;
 1086|       |
 1087|  84.0k|    ps_dec->u4_num_cores = 1;
 1088|  84.0k|    ps_dec->u2_pic_ht = ps_dec->u2_pic_wd = 0;
 1089|       |
 1090|  84.0k|    ps_dec->u1_separate_parse = DEFAULT_SEPARATE_PARSE;
  ------------------
  |  |  540|  84.0k|#define DEFAULT_SEPARATE_PARSE (H264_DEFAULT_NUM_CORES == 2)? 1 :0
  |  |  ------------------
  |  |  |  |  539|  84.0k|#define H264_DEFAULT_NUM_CORES 1
  |  |  ------------------
  |  |  |  Branch (540:32): [Folded, False: 84.0k]
  |  |  ------------------
  ------------------
 1091|  84.0k|    ps_dec->u4_app_disable_deblk_frm = 0;
 1092|  84.0k|    ps_dec->i4_degrade_type = 0;
 1093|  84.0k|    ps_dec->i4_degrade_pics = 0;
 1094|       |
 1095|       |    /* Initialization of function pointers ih264d_deblock_picture function*/
 1096|  84.0k|    ps_dec->p_DeblockPicture[0] = ih264d_deblock_picture_non_mbaff;
 1097|  84.0k|    ps_dec->p_DeblockPicture[1] = ih264d_deblock_picture_mbaff;
 1098|       |
 1099|  84.0k|    ps_dec->s_cab_dec_env.pv_codec_handle = ps_dec;
 1100|  84.0k|    ps_dec->u4_num_fld_in_frm = 0;
 1101|  84.0k|    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|  84.0k|    ps_dec->ps_sei->u1_is_valid = 0;
 1105|       |
 1106|       |    /* decParams Initializations */
 1107|  84.0k|    ps_dec->ps_cur_pps = NULL;
 1108|  84.0k|    ps_dec->ps_cur_sps = NULL;
 1109|  84.0k|    ps_dec->u1_init_dec_flag = 0;
 1110|  84.0k|    ps_dec->u1_first_slice_in_stream = 1;
 1111|  84.0k|    ps_dec->u1_last_pic_not_decoded = 0;
 1112|  84.0k|    ps_dec->u4_app_disp_width = 0;
 1113|  84.0k|    ps_dec->i4_header_decoded = 0;
 1114|  84.0k|    ps_dec->u4_total_frames_decoded = 0;
 1115|       |
 1116|  84.0k|    ps_dec->i4_error_code = 0;
 1117|  84.0k|    ps_dec->i4_content_type = IV_CONTENTTYPE_NA;
 1118|  84.0k|    ps_dec->ps_cur_slice->u1_mbaff_frame_flag = 0;
 1119|       |
 1120|  84.0k|    ps_dec->ps_dec_err_status->u1_err_flag = ACCEPT_ALL_PICS;
  ------------------
  |  |  601|  84.0k|#define ACCEPT_ALL_PICS   (0x00)
  ------------------
 1121|  84.0k|    ps_dec->ps_dec_err_status->u1_cur_pic_type = PIC_TYPE_UNKNOWN;
  ------------------
  |  |  608|  84.0k|#define PIC_TYPE_UNKNOWN  (0xFF)
  ------------------
 1122|  84.0k|    ps_dec->ps_dec_err_status->u4_frm_sei_sync = SYNC_FRM_DEFAULT;
  ------------------
  |  |  610|  84.0k|#define SYNC_FRM_DEFAULT  (0xFFFFFFFF)
  ------------------
 1123|  84.0k|    ps_dec->ps_dec_err_status->u4_cur_frm = INIT_FRAME;
  ------------------
  |  |  611|  84.0k|#define INIT_FRAME        (0xFFFFFF)
  ------------------
 1124|  84.0k|    ps_dec->ps_dec_err_status->u1_pic_aud_i = PIC_TYPE_UNKNOWN;
  ------------------
  |  |  608|  84.0k|#define PIC_TYPE_UNKNOWN  (0xFF)
  ------------------
 1125|       |
 1126|  84.0k|    ps_dec->u1_pr_sl_type = 0xFF;
 1127|  84.0k|    ps_dec->u2_mbx = 0xffff;
 1128|  84.0k|    ps_dec->u2_mby = 0;
 1129|  84.0k|    ps_dec->u4_total_mbs_coded = 0;
 1130|       |
 1131|       |    /* POC initializations */
 1132|  84.0k|    ps_prev_poc = &ps_dec->s_prev_pic_poc;
 1133|  84.0k|    ps_cur_poc = &ps_dec->s_cur_pic_poc;
 1134|  84.0k|    ps_prev_poc->i4_pic_order_cnt_lsb = ps_cur_poc->i4_pic_order_cnt_lsb = 0;
 1135|  84.0k|    ps_prev_poc->i4_pic_order_cnt_msb = ps_cur_poc->i4_pic_order_cnt_msb = 0;
 1136|  84.0k|    ps_prev_poc->i4_delta_pic_order_cnt_bottom = ps_cur_poc->i4_delta_pic_order_cnt_bottom = 0;
 1137|  84.0k|    ps_prev_poc->i4_delta_pic_order_cnt[0] = ps_cur_poc->i4_delta_pic_order_cnt[0] = 0;
 1138|  84.0k|    ps_prev_poc->i4_delta_pic_order_cnt[1] = ps_cur_poc->i4_delta_pic_order_cnt[1] = 0;
 1139|  84.0k|    ps_prev_poc->u1_mmco_equalto5 = ps_cur_poc->u1_mmco_equalto5 = 0;
 1140|  84.0k|    ps_prev_poc->i4_top_field_order_count = ps_cur_poc->i4_top_field_order_count = 0;
 1141|  84.0k|    ps_prev_poc->i4_bottom_field_order_count = ps_cur_poc->i4_bottom_field_order_count = 0;
 1142|  84.0k|    ps_prev_poc->u1_bot_field = ps_cur_poc->u1_bot_field = 0;
 1143|  84.0k|    ps_prev_poc->u1_mmco_equalto5 = ps_cur_poc->u1_mmco_equalto5 = 0;
 1144|  84.0k|    ps_prev_poc->i4_prev_frame_num_ofst = ps_cur_poc->i4_prev_frame_num_ofst = 0;
 1145|  84.0k|    ps_cur_slice->u1_mmco_equalto5 = 0;
 1146|  84.0k|    ps_cur_slice->u2_frame_num = 0;
 1147|       |
 1148|  84.0k|    ps_dec->i4_max_poc = 0;
 1149|  84.0k|    ps_dec->i4_prev_max_display_seq = 0;
 1150|  84.0k|    ps_dec->u4_recon_mb_grp = 4;
 1151|  84.0k|    ps_dec->i4_reorder_depth = -1;
 1152|       |
 1153|       |    /* Field PIC initializations */
 1154|  84.0k|    ps_dec->u1_second_field = 0;
 1155|  84.0k|    ps_dec->s_prev_seq_params.u1_eoseq_pending = 0;
 1156|       |
 1157|       |    /* Set the cropping parameters as zero */
 1158|  84.0k|    ps_dec->u2_crop_offset_y = 0;
 1159|  84.0k|    ps_dec->u2_crop_offset_uv = 0;
 1160|       |
 1161|       |    /* The Initial Frame Rate Info is not Present */
 1162|  84.0k|    ps_dec->i4_vui_frame_rate = -1;
 1163|  84.0k|    ps_dec->i4_pic_type = NA_SLICE;
  ------------------
  |  |  367|  84.0k|#define NA_SLICE -1
  ------------------
 1164|  84.0k|    ps_dec->i4_frametype = IV_NA_FRAME;
 1165|  84.0k|    ps_dec->i4_content_type = IV_CONTENTTYPE_NA;
 1166|       |
 1167|  84.0k|    ps_dec->u1_res_changed = 0;
 1168|       |
 1169|  84.0k|    ps_dec->u1_frame_decoded_flag = 0;
 1170|       |
 1171|       |    /* Set the default frame seek mask mode */
 1172|  84.0k|    ps_dec->u4_skip_frm_mask = SKIP_NONE;
  ------------------
  |  |  375|  84.0k|#define SKIP_NONE  (0x0)
  ------------------
 1173|       |
 1174|       |    /********************************************************/
 1175|       |    /* Initialize CAVLC residual decoding function pointers */
 1176|       |    /********************************************************/
 1177|  84.0k|    ps_dec->pf_cavlc_4x4res_block[0] = ih264d_cavlc_4x4res_block_totalcoeff_1;
 1178|  84.0k|    ps_dec->pf_cavlc_4x4res_block[1] = ih264d_cavlc_4x4res_block_totalcoeff_2to10;
 1179|  84.0k|    ps_dec->pf_cavlc_4x4res_block[2] = ih264d_cavlc_4x4res_block_totalcoeff_11to16;
 1180|       |
 1181|  84.0k|    ps_dec->pf_cavlc_parse4x4coeff[0] = ih264d_cavlc_parse4x4coeff_n0to7;
 1182|  84.0k|    ps_dec->pf_cavlc_parse4x4coeff[1] = ih264d_cavlc_parse4x4coeff_n8;
 1183|       |
 1184|  84.0k|    ps_dec->pf_cavlc_parse_8x8block[0] = ih264d_cavlc_parse_8x8block_none_available;
 1185|  84.0k|    ps_dec->pf_cavlc_parse_8x8block[1] = ih264d_cavlc_parse_8x8block_left_available;
 1186|  84.0k|    ps_dec->pf_cavlc_parse_8x8block[2] = ih264d_cavlc_parse_8x8block_top_available;
 1187|  84.0k|    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|  84.0k|    ps_dec->pf_fill_bs1[0][0] = ih264d_fill_bs1_16x16mb_pslice;
 1193|  84.0k|    ps_dec->pf_fill_bs1[0][1] = ih264d_fill_bs1_non16x16mb_pslice;
 1194|       |
 1195|  84.0k|    ps_dec->pf_fill_bs1[1][0] = ih264d_fill_bs1_16x16mb_bslice;
 1196|  84.0k|    ps_dec->pf_fill_bs1[1][1] = ih264d_fill_bs1_non16x16mb_bslice;
 1197|       |
 1198|  84.0k|    ps_dec->pf_fill_bs_xtra_left_edge[0] = ih264d_fill_bs_xtra_left_edge_cur_frm;
 1199|  84.0k|    ps_dec->pf_fill_bs_xtra_left_edge[1] = ih264d_fill_bs_xtra_left_edge_cur_fld;
 1200|       |
 1201|       |    /* Initialize Reference Pic Buffers */
 1202|  84.0k|    ih264d_init_ref_bufs(ps_dec->ps_dpb_mgr);
 1203|       |
 1204|  84.0k|    ps_dec->u2_prv_frame_num = 0;
 1205|  84.0k|    ps_dec->u1_top_bottom_decoded = 0;
 1206|  84.0k|    ps_dec->u1_dangling_field = 0;
 1207|       |
 1208|  84.0k|    ps_dec->s_cab_dec_env.cabac_table = gau4_ih264d_cabac_table;
 1209|       |
 1210|  84.0k|    ps_dec->pu1_left_mv_ctxt_inc = ps_dec->u1_left_mv_ctxt_inc_arr[0];
 1211|  84.0k|    ps_dec->pi1_left_ref_idx_ctxt_inc = &ps_dec->i1_left_ref_idx_ctx_inc_arr[0][0];
 1212|  84.0k|    ps_dec->pu1_left_yuv_dc_csbp = &ps_dec->u1_yuv_dc_csbp_topmb;
 1213|       |
 1214|       |    /* ! */
 1215|       |    /* Initializing flush frame u4_flag */
 1216|  84.0k|    ps_dec->u1_flushfrm = 0;
 1217|       |
 1218|  84.0k|    ps_dec->s_cab_dec_env.pv_codec_handle = (void *) ps_dec;
 1219|  84.0k|    ps_dec->ps_bitstrm->pv_codec_handle = (void *) ps_dec;
 1220|  84.0k|    ps_dec->ps_cur_slice->pv_codec_handle = (void *) ps_dec;
 1221|  84.0k|    ps_dec->ps_dpb_mgr->pv_codec_handle = (void *) ps_dec;
 1222|       |
 1223|  84.0k|    memset(ps_dec->disp_bufs, 0, (MAX_DISP_BUFS_NEW) * sizeof(disp_buf_t));
  ------------------
  |  |   76|  84.0k|#define MAX_DISP_BUFS_NEW 64
  ------------------
 1224|  84.0k|    memset(ps_dec->u4_disp_buf_mapping, 0, (MAX_DISP_BUFS_NEW) * sizeof(UWORD32));
  ------------------
  |  |   76|  84.0k|#define MAX_DISP_BUFS_NEW 64
  ------------------
 1225|  84.0k|    memset(ps_dec->u4_disp_buf_to_be_freed, 0, (MAX_DISP_BUFS_NEW) * sizeof(UWORD32));
  ------------------
  |  |   76|  84.0k|#define MAX_DISP_BUFS_NEW 64
  ------------------
 1226|  84.0k|    memset(ps_dec->ps_cur_slice, 0, sizeof(dec_slice_params_t));
 1227|       |
 1228|  84.0k|    ih264d_init_arch(ps_dec);
 1229|  84.0k|    isvcd_init_function_ptr(ps_svc_lyr_dec);
 1230|  84.0k|    ps_dec->e_frm_out_mode = IVD_DISPLAY_FRAME_OUT;
 1231|  84.0k|    ps_dec->init_done = 1;
 1232|  84.0k|    ps_svc_lyr_dec->u1_layer_identifier = BASE_LAYER;
  ------------------
  |  |  108|  84.0k|#define BASE_LAYER 0
  ------------------
 1233|  84.0k|}
isvcd_nal_parse_ctxt_free:
 1257|  22.5k|{
 1258|  22.5k|    dec_struct_t *ps_dec;
 1259|  22.5k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 1260|  22.5k|    void (*pf_aligned_free)(void *pv_mem_ctxt, void *pv_buf);
 1261|  22.5k|    void *pv_mem_ctxt;
 1262|  22.5k|    nal_parse_ctxt_t *ps_ctxt;
 1263|  22.5k|    ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[0];
 1264|  22.5k|    ps_dec = &ps_svc_lyr_dec->s_dec;
 1265|  22.5k|    pf_aligned_free = ps_dec->pf_aligned_free;
 1266|       |
 1267|  22.5k|    pv_mem_ctxt = ps_dec->pv_mem_ctxt;
 1268|  22.5k|    ps_ctxt = (nal_parse_ctxt_t *) ps_svcd_ctxt->pv_nal_parse_ctxt;
 1269|       |
 1270|  22.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->s_dqid_ctxt.ps_dqid_node);
 1271|  22.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->pv_nal_header_buf);
 1272|  22.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->pv_nal_unit);
 1273|  22.5k|    pf_aligned_free(pv_mem_ctxt, ps_svcd_ctxt->pv_vcl_nal_buff);
 1274|  22.5k|    pf_aligned_free(pv_mem_ctxt, ps_svcd_ctxt->pv_non_vcl_nal_buff);
 1275|  22.5k|    pf_aligned_free(pv_mem_ctxt, ps_svcd_ctxt->pv_nal_parse_ctxt);
 1276|  22.5k|}
isvcd_residual_resample_ctxt_free:
 1299|  22.5k|{
 1300|  22.5k|    dec_struct_t *ps_dec;
 1301|  22.5k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 1302|  22.5k|    void (*pf_aligned_free)(void *pv_mem_ctxt, void *pv_buf);
 1303|  22.5k|    void *pv_mem_ctxt;
 1304|  22.5k|    residual_sampling_ctxt_t *ps_ctxt;
 1305|  22.5k|    ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[0];
 1306|  22.5k|    ps_dec = &ps_svc_lyr_dec->s_dec;
 1307|  22.5k|    pf_aligned_free = ps_dec->pf_aligned_free;
 1308|       |
 1309|  22.5k|    pv_mem_ctxt = ps_dec->pv_mem_ctxt;
 1310|  22.5k|    ps_ctxt = (residual_sampling_ctxt_t *) ps_svcd_ctxt->pv_residual_sample_ctxt;
 1311|       |
 1312|  22.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->pi2_refarray_buffer);
 1313|  22.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->pu1_ref_x_ptr_incr);
 1314|  22.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->as_res_lyrs[0].s_luma_map_ctxt.ps_x_offset_length);
 1315|  22.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->as_res_lyrs[0].s_luma_map_ctxt.ps_y_offset_length);
 1316|  22.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->as_res_lyrs[0].s_luma_map_ctxt.ps_x_pos_phase);
 1317|  22.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->as_res_lyrs[0].s_luma_map_ctxt.ps_y_pos_phase);
 1318|  22.5k|    pf_aligned_free(pv_mem_ctxt, ps_svcd_ctxt->pv_residual_sample_ctxt);
 1319|  22.5k|}
isvcd_intra_resample_ctxt_free:
 1342|  22.5k|{
 1343|  22.5k|    dec_struct_t *ps_dec;
 1344|  22.5k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 1345|  22.5k|    void (*pf_aligned_free)(void *pv_mem_ctxt, void *pv_buf);
 1346|  22.5k|    void *pv_mem_ctxt;
 1347|  22.5k|    intra_sampling_ctxt_t *ps_ctxt;
 1348|  22.5k|    ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[0];
 1349|  22.5k|    ps_dec = &ps_svc_lyr_dec->s_dec;
 1350|  22.5k|    pf_aligned_free = ps_dec->pf_aligned_free;
 1351|       |
 1352|  22.5k|    pv_mem_ctxt = ps_dec->pv_mem_ctxt;
 1353|  22.5k|    ps_ctxt = (intra_sampling_ctxt_t *) ps_svcd_ctxt->pv_intra_sample_ctxt;
 1354|       |
 1355|  22.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->pu1_refarray_buffer);
 1356|  22.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->pu1_refarray_cb);
 1357|  22.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->pu1_refarray_cr);
 1358|  22.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->pi4_temp_interpolation_buffer);
 1359|  22.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->as_res_lyrs[0].s_luma_map_ctxt.ps_x_offset_length);
 1360|  22.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->as_res_lyrs[0].s_luma_map_ctxt.ps_y_offset_length);
 1361|  22.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->as_res_lyrs[0].s_luma_map_ctxt.ps_x_min_max);
 1362|  22.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->as_res_lyrs[0].s_luma_map_ctxt.ps_y_min_max);
 1363|  22.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->as_res_lyrs[0].s_luma_map_ctxt.ps_x_pos_phase);
 1364|  22.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->as_res_lyrs[0].s_luma_map_ctxt.ps_y_pos_phase);
 1365|  22.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->as_res_lyrs[0].s_luma_map_ctxt.pi2_xd_index);
 1366|  22.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->as_res_lyrs[0].s_luma_map_ctxt.pi2_yd_index);
 1367|  22.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->as_res_lyrs[0].s_luma_map_ctxt.pi2_ya_index);
 1368|  22.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->as_res_lyrs[0].s_luma_map_ctxt.ps_seg_lookup_horz);
 1369|  22.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->as_res_lyrs[0].s_luma_map_ctxt.ps_seg_lookup_vert);
 1370|  22.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->as_res_lyrs[0].s_luma_map_ctxt.pu1_refarray_x_idx);
 1371|  22.5k|    pf_aligned_free(pv_mem_ctxt, ps_svcd_ctxt->pv_intra_sample_ctxt);
 1372|  22.5k|    pf_aligned_free(pv_mem_ctxt, ps_svcd_ctxt->pv_ii_pred_ctxt);
 1373|  22.5k|}
isvcd_mode_mv_resample_ctxt_free:
 1395|  22.5k|{
 1396|  22.5k|    dec_struct_t *ps_dec;
 1397|  22.5k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 1398|  22.5k|    void (*pf_aligned_free)(void *pv_mem_ctxt, void *pv_buf);
 1399|  22.5k|    void *pv_mem_ctxt;
 1400|  22.5k|    mode_motion_ctxt_t *ps_mode_motion;
 1401|       |
 1402|  22.5k|    ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[0];
 1403|  22.5k|    ps_dec = &ps_svc_lyr_dec->s_dec;
 1404|  22.5k|    pf_aligned_free = ps_dec->pf_aligned_free;
 1405|       |
 1406|  22.5k|    pv_mem_ctxt = ps_dec->pv_mem_ctxt;
 1407|  22.5k|    ps_mode_motion = (mode_motion_ctxt_t *) ps_svcd_ctxt->pv_mode_mv_sample_ctxt;
 1408|       |
 1409|  22.5k|    pf_aligned_free(pv_mem_ctxt, ps_mode_motion->ps_motion_pred_struct);
 1410|  22.5k|    pf_aligned_free(pv_mem_ctxt, ps_mode_motion->as_res_lyr_mem[0].pi2_ref_loc_x);
 1411|  22.5k|    pf_aligned_free(pv_mem_ctxt, ps_mode_motion->as_res_lyr_mem[0].pi2_ref_loc_y);
 1412|  22.5k|    pf_aligned_free(pv_mem_ctxt, ps_svcd_ctxt->pv_ref_lyr_offset);
 1413|  22.5k|    pf_aligned_free(pv_mem_ctxt, ps_svcd_ctxt->pv_mode_mv_sample_ctxt);
 1414|  22.5k|}
isvcd_free_static_bufs:
 1437|  22.5k|{
 1438|  22.5k|    dec_struct_t *ps_dec;
 1439|  22.5k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 1440|       |
 1441|  22.5k|    UWORD8 u1_layer_id;
 1442|  22.5k|    svc_dec_ctxt_t *ps_svcd_ctxt;
 1443|       |
 1444|  22.5k|    void (*pf_aligned_free)(void *pv_mem_ctxt, void *pv_buf);
 1445|  22.5k|    void *pv_mem_ctxt;
 1446|       |
 1447|  22.5k|    ps_svcd_ctxt = (svc_dec_ctxt_t *) dec_hdl->pv_codec_handle;
 1448|       |
 1449|  22.5k|    isvcd_intra_resample_ctxt_free(ps_svcd_ctxt);
 1450|  22.5k|    isvcd_residual_resample_ctxt_free(ps_svcd_ctxt);
 1451|  22.5k|    isvcd_mode_mv_resample_ctxt_free(ps_svcd_ctxt);
 1452|  22.5k|    isvcd_nal_parse_ctxt_free(ps_svcd_ctxt);
 1453|       |
 1454|  90.1k|    for(u1_layer_id = 0; u1_layer_id < MAX_NUM_RES_LYRS; u1_layer_id++)
  ------------------
  |  |   94|  90.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (1454:26): [True: 67.5k, False: 22.5k]
  ------------------
 1455|  67.5k|    {
 1456|  67.5k|        ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[u1_layer_id];
 1457|  67.5k|        ps_dec = &ps_svc_lyr_dec->s_dec;
 1458|  67.5k|        pf_aligned_free = ps_dec->pf_aligned_free;
 1459|  67.5k|        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|  67.5k|        if(0 == u1_layer_id)
  ------------------
  |  Branch (1511:12): [True: 22.5k, False: 45.0k]
  ------------------
 1512|  22.5k|        {
 1513|  22.5k|            UWORD8 u1_sps_ctr;
 1514|  22.5k|            PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_sps);
  ------------------
  |  |   43|  22.5k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  22.5k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 22.5k, False: 0]
  |  |  ------------------
  ------------------
 1515|  1.46M|            for(u1_sps_ctr = 0; u1_sps_ctr < (2 * MAX_NUM_SEQ_PARAMS); u1_sps_ctr++)
  ------------------
  |  |  521|  1.46M|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
  |  Branch (1515:33): [True: 1.44M, False: 22.5k]
  ------------------
 1516|  1.44M|            {
 1517|  1.44M|                if(NULL != ps_svcd_ctxt->ps_subset_sps[u1_sps_ctr].s_sps_svc_ext.ps_svc_vui_ext)
  ------------------
  |  Branch (1517:20): [True: 391, False: 1.44M]
  ------------------
 1518|    391|                {
 1519|    391|                    PS_DEC_ALIGNED_FREE(
  ------------------
  |  |   43|    391|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|    391|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 391, False: 0]
  |  |  ------------------
  ------------------
 1520|    391|                        ps_dec,
 1521|    391|                        ps_svcd_ctxt->ps_subset_sps[u1_sps_ctr].s_sps_svc_ext.ps_svc_vui_ext);
 1522|    391|                }
 1523|  1.44M|            }
 1524|  22.5k|            PS_DEC_ALIGNED_FREE(ps_dec, ps_svc_lyr_dec->ps_subset_sps);
  ------------------
  |  |   43|  22.5k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  22.5k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 22.5k, False: 0]
  |  |  ------------------
  ------------------
 1525|  22.5k|            PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_pps);
  ------------------
  |  |   43|  22.5k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  22.5k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 22.5k, False: 0]
  |  |  ------------------
  ------------------
 1526|  22.5k|            PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_sei);
  ------------------
  |  |   43|  22.5k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  22.5k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 22.5k, False: 0]
  |  |  ------------------
  ------------------
 1527|  22.5k|            PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_sei_parse);
  ------------------
  |  |   43|  22.5k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  22.5k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 22.5k, False: 0]
  |  |  ------------------
  ------------------
 1528|  22.5k|        }
 1529|       |
 1530|  67.5k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pv_dec_thread_handle);
  ------------------
  |  |   43|  67.5k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  67.5k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 67.5k, False: 0]
  |  |  ------------------
  ------------------
 1531|  67.5k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pv_bs_deblk_thread_handle);
  ------------------
  |  |   43|  67.5k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  67.5k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 67.5k, False: 0]
  |  |  ------------------
  ------------------
 1532|       |
 1533|  67.5k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_dpb_mgr);
  ------------------
  |  |   43|  67.5k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  67.5k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 67.5k, False: 0]
  |  |  ------------------
  ------------------
 1534|  67.5k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_pred);
  ------------------
  |  |   43|  67.5k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  67.5k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 67.5k, False: 0]
  |  |  ------------------
  ------------------
 1535|  67.5k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pv_disp_buf_mgr);
  ------------------
  |  |   43|  67.5k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  67.5k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 67.5k, False: 0]
  |  |  ------------------
  ------------------
 1536|  67.5k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_pic_buf_base);
  ------------------
  |  |   43|  67.5k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  67.5k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 67.5k, False: 0]
  |  |  ------------------
  ------------------
 1537|  67.5k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_dec_err_status);
  ------------------
  |  |   43|  67.5k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  67.5k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 67.5k, False: 0]
  |  |  ------------------
  ------------------
 1538|       |
 1539|  67.5k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_dpb_cmds);
  ------------------
  |  |   43|  67.5k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  67.5k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 67.5k, False: 0]
  |  |  ------------------
  ------------------
 1540|  67.5k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_bitstrm);
  ------------------
  |  |   43|  67.5k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  67.5k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 67.5k, False: 0]
  |  |  ------------------
  ------------------
 1541|  67.5k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_svc_lyr_dec->ps_nal_svc_ext);
  ------------------
  |  |   43|  67.5k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  67.5k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 67.5k, False: 0]
  |  |  ------------------
  ------------------
 1542|  67.5k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_cur_slice);
  ------------------
  |  |   43|  67.5k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  67.5k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 67.5k, False: 0]
  |  |  ------------------
  ------------------
 1543|  67.5k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pv_scratch_sps_pps);
  ------------------
  |  |   43|  67.5k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  67.5k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 67.5k, False: 0]
  |  |  ------------------
  ------------------
 1544|  67.5k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_svc_lyr_dec->pv_scratch_subset_sps);
  ------------------
  |  |   43|  67.5k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  67.5k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 67.5k, False: 0]
  |  |  ------------------
  ------------------
 1545|  67.5k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pu1_bits_buf_static);
  ------------------
  |  |   43|  67.5k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  67.5k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 67.5k, False: 0]
  |  |  ------------------
  ------------------
 1546|  67.5k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ppv_map_ref_idx_to_poc_base);
  ------------------
  |  |   43|  67.5k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  67.5k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 67.5k, False: 0]
  |  |  ------------------
  ------------------
 1547|  67.5k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->p_cabac_ctxt_table_t);
  ------------------
  |  |   43|  67.5k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  67.5k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 67.5k, False: 0]
  |  |  ------------------
  ------------------
 1548|  67.5k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_left_mb_ctxt_info);
  ------------------
  |  |   43|  67.5k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  67.5k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 67.5k, False: 0]
  |  |  ------------------
  ------------------
 1549|  67.5k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pu1_ref_buff_base);
  ------------------
  |  |   43|  67.5k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  67.5k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 67.5k, False: 0]
  |  |  ------------------
  ------------------
 1550|  67.5k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pi2_pred1);
  ------------------
  |  |   43|  67.5k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  67.5k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 67.5k, False: 0]
  |  |  ------------------
  ------------------
 1551|  67.5k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pu1_temp_mc_buffer);
  ------------------
  |  |   43|  67.5k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  67.5k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 67.5k, False: 0]
  |  |  ------------------
  ------------------
 1552|  67.5k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pu1_init_dpb_base);
  ------------------
  |  |   43|  67.5k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  67.5k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 67.5k, False: 0]
  |  |  ------------------
  ------------------
 1553|  67.5k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pu4_mbaff_wt_mat);
  ------------------
  |  |   43|  67.5k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  67.5k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 67.5k, False: 0]
  |  |  ------------------
  ------------------
 1554|  67.5k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pu4_wts_ofsts_mat);
  ------------------
  |  |   43|  67.5k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  67.5k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 67.5k, False: 0]
  |  |  ------------------
  ------------------
 1555|  67.5k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_left_mvpred_addr);
  ------------------
  |  |   43|  67.5k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  67.5k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 67.5k, False: 0]
  |  |  ------------------
  ------------------
 1556|  67.5k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_col_mv_base);
  ------------------
  |  |   43|  67.5k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  67.5k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 67.5k, False: 0]
  |  |  ------------------
  ------------------
 1557|  67.5k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_svc_lyr_dec->pu1_ii_resamp_buffer_luma);
  ------------------
  |  |   43|  67.5k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  67.5k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 67.5k, False: 0]
  |  |  ------------------
  ------------------
 1558|       |
 1559|  67.5k|        if(NULL != ps_dec->pv_pic_buf_mgr)
  ------------------
  |  Branch (1559:12): [True: 67.5k, False: 0]
  ------------------
 1560|  67.5k|        {
 1561|  67.5k|            if(u1_layer_id < ps_svcd_ctxt->u1_prev_num_res_layers)
  ------------------
  |  Branch (1561:16): [True: 37.1k, False: 30.4k]
  ------------------
 1562|  37.1k|            {
 1563|  37.1k|                if(((buf_mgr_t *) ps_dec->pv_pic_buf_mgr)->pv_mutex != NULL)
  ------------------
  |  Branch (1563:20): [True: 23.2k, False: 13.8k]
  ------------------
 1564|  23.2k|                    ih264_buf_mgr_free(ps_dec->pv_pic_buf_mgr);
 1565|  37.1k|            }
 1566|  67.5k|            PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pv_pic_buf_mgr);
  ------------------
  |  |   43|  67.5k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  67.5k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 67.5k, False: 0]
  |  |  ------------------
  ------------------
 1567|  67.5k|        }
 1568|  67.5k|        if(NULL != ps_dec->pv_mv_buf_mgr)
  ------------------
  |  Branch (1568:12): [True: 67.5k, False: 0]
  ------------------
 1569|  67.5k|        {
 1570|  67.5k|            if(u1_layer_id < ps_svcd_ctxt->u1_prev_num_res_layers)
  ------------------
  |  Branch (1570:16): [True: 37.1k, False: 30.4k]
  ------------------
 1571|  37.1k|            {
 1572|  37.1k|                if(((buf_mgr_t *) ps_dec->pv_mv_buf_mgr)->pv_mutex != NULL)
  ------------------
  |  Branch (1572:20): [True: 23.2k, False: 13.8k]
  ------------------
 1573|  23.2k|                    ih264_buf_mgr_free(ps_dec->pv_mv_buf_mgr);
 1574|  37.1k|            }
 1575|  67.5k|            PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pv_mv_buf_mgr);
  ------------------
  |  |   43|  67.5k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  67.5k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 67.5k, False: 0]
  |  |  ------------------
  ------------------
 1576|  67.5k|        }
 1577|  67.5k|    }
 1578|       |
 1579|  22.5k|    pf_aligned_free(pv_mem_ctxt, ps_svcd_ctxt->ps_svc_dec_lyr);
 1580|  22.5k|    pf_aligned_free(pv_mem_ctxt, dec_hdl->pv_codec_handle);
 1581|       |
 1582|  22.5k|    if(dec_hdl)
  ------------------
  |  Branch (1582:8): [True: 22.5k, False: 0]
  ------------------
 1583|  22.5k|    {
 1584|  22.5k|        pf_aligned_free(pv_mem_ctxt, dec_hdl);
 1585|  22.5k|    }
 1586|       |
 1587|  22.5k|    return IV_SUCCESS;
 1588|  22.5k|}
isvcd_nal_parse_ctxt_create:
 1614|  22.5k|{
 1615|  22.5k|    isvcd_create_ip_t *ps_create_ip;
 1616|  22.5k|    void *pv_buf;
 1617|  22.5k|    void *(*pf_aligned_alloc)(void *pv_mem_ctxt, WORD32 alignment, WORD32 size);
 1618|  22.5k|    void *pv_mem_ctxt;
 1619|  22.5k|    WORD32 size;
 1620|  22.5k|    nal_parse_ctxt_t *ps_nal_parse_ctxt;
 1621|  22.5k|    UWORD8 *pu1_ptr;
 1622|  22.5k|    UNUSED(pv_api_op);
  ------------------
  |  |   45|  22.5k|#define UNUSED(x) ((void)(x))
  ------------------
 1623|       |
 1624|  22.5k|    ps_create_ip = (isvcd_create_ip_t *) pv_api_ip;
 1625|       |
 1626|  22.5k|    pf_aligned_alloc = ps_create_ip->s_ivd_create_ip_t.pf_aligned_alloc;
 1627|  22.5k|    pv_mem_ctxt = ps_create_ip->s_ivd_create_ip_t.pv_mem_ctxt;
 1628|       |
 1629|       |    /*-----------------------------------------------------------------------*/
 1630|       |    /* Handle                                                                */
 1631|       |    /*-----------------------------------------------------------------------*/
 1632|  22.5k|    size = sizeof(nal_parse_ctxt_t);
 1633|  22.5k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1634|  22.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  22.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 22.5k]
  |  |  ------------------
  ------------------
 1635|  22.5k|    memset(pv_buf, 0, size);
 1636|  22.5k|    ps_nal_parse_ctxt = pv_buf;
 1637|       |
 1638|       |    /* set the lowest dqid to -1 */
 1639|  22.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|  22.5k|    {
 1645|  22.5k|        WORD32 i4_lyr_idx;
 1646|  22.5k|        WORD32 i4_max_num_lyrs;
 1647|  22.5k|        vcl_node_t *ps_vcl_node;
 1648|  22.5k|        dqid_node_t *ps_dqid_node;
 1649|  22.5k|        dqid_ctxt_t *ps_dqid_ctxt;
 1650|       |
 1651|  22.5k|        size = sizeof(vcl_node_t);
 1652|  22.5k|        size += sizeof(dqid_node_t);
 1653|  22.5k|        size *= MAX_NUM_RES_LYRS;
  ------------------
  |  |   94|  22.5k|#define MAX_NUM_RES_LYRS 3
  ------------------
 1654|       |
 1655|  22.5k|        ps_dqid_ctxt = &ps_nal_parse_ctxt->s_dqid_ctxt;
 1656|       |
 1657|  22.5k|        ps_dqid_ctxt->i4_max_num_lyrs = MAX_NUM_RES_LYRS;
  ------------------
  |  |   94|  22.5k|#define MAX_NUM_RES_LYRS 3
  ------------------
 1658|       |
 1659|  22.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1660|  22.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  22.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 22.5k]
  |  |  ------------------
  ------------------
 1661|  22.5k|        memset(pv_buf, 0, size);
 1662|       |
 1663|  22.5k|        ps_dqid_ctxt->ps_dqid_node = pv_buf;
 1664|  22.5k|        ps_dqid_node = ps_dqid_ctxt->ps_dqid_node;
 1665|       |
 1666|  22.5k|        i4_max_num_lyrs = ps_dqid_ctxt->i4_max_num_lyrs;
 1667|       |
 1668|  22.5k|        pu1_ptr = pv_buf;
 1669|  22.5k|        pu1_ptr += sizeof(dqid_node_t) * i4_max_num_lyrs;
 1670|  22.5k|        ps_vcl_node = (vcl_node_t *) pu1_ptr;
 1671|       |
 1672|  90.1k|        for(i4_lyr_idx = 0; i4_lyr_idx < i4_max_num_lyrs; i4_lyr_idx++)
  ------------------
  |  Branch (1672:29): [True: 67.5k, False: 22.5k]
  ------------------
 1673|  67.5k|        {
 1674|  67.5k|            ps_dqid_node->ps_vcl_node = ps_vcl_node;
 1675|       |
 1676|       |            /* Loop updates */
 1677|  67.5k|            ps_vcl_node += 1;
 1678|  67.5k|            ps_dqid_node += 1;
 1679|  67.5k|        } /* Loop over all the layers */
 1680|  22.5k|    }
 1681|       |
 1682|       |    /*-----------------------------------------------------------------------*/
 1683|       |    /* Common memory                                                         */
 1684|       |    /*-----------------------------------------------------------------------*/
 1685|  22.5k|    size = UP_ALIGN_8(HEADER_BUFFER_LEN_BEFORE_EP);
  ------------------
  |  |   51|  22.5k|#define UP_ALIGN_8(x) (((((UWORD64) x) + 7) >> 3) << 3)
  ------------------
 1686|  22.5k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1687|  22.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  22.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 22.5k]
  |  |  ------------------
  ------------------
 1688|  22.5k|    memset(pv_buf, 0, size);
 1689|  22.5k|    ps_nal_parse_ctxt->pv_nal_header_buf = (void *) pv_buf;
 1690|       |
 1691|       |    /*-----------------------------------------------------------------------*/
 1692|       |    /* Layer params memory                                                   */
 1693|       |    /*-----------------------------------------------------------------------*/
 1694|  22.5k|    size = sizeof(nal_unit_t);
 1695|  22.5k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1696|  22.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  22.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 22.5k]
  |  |  ------------------
  ------------------
 1697|  22.5k|    memset(pv_buf, 0, size);
 1698|  22.5k|    ps_nal_parse_ctxt->pv_nal_unit = pv_buf;
 1699|       |
 1700|  22.5k|    size = MAX_VCL_NAL_BUFF_SIZE * sizeof(UWORD8);
  ------------------
  |  |   69|  22.5k|#define MAX_VCL_NAL_BUFF_SIZE (1024 * 1024 * 2)
  ------------------
 1701|  22.5k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1702|  22.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  22.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 22.5k]
  |  |  ------------------
  ------------------
 1703|  22.5k|    memset(pv_buf, 0, size);
 1704|  22.5k|    ps_svcd_ctxt->pv_vcl_nal_buff = pv_buf;
 1705|       |
 1706|  22.5k|    size = MAX_NON_VCL_NAL_BUFF_SIZE * sizeof(UWORD8);
  ------------------
  |  |   70|  22.5k|#define MAX_NON_VCL_NAL_BUFF_SIZE (1024 * 1024 * 2)
  ------------------
 1707|  22.5k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1708|  22.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  22.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 22.5k]
  |  |  ------------------
  ------------------
 1709|  22.5k|    memset(pv_buf, 0, size);
 1710|  22.5k|    ps_svcd_ctxt->pv_non_vcl_nal_buff = pv_buf;
 1711|       |
 1712|       |    /*-----------------------------------------------------------------------*/
 1713|       |    /* Registering the seq and pic prms buffer pointers                      */
 1714|       |    /*-----------------------------------------------------------------------*/
 1715|  22.5k|    if(NULL == ps_svcd_ctxt->ps_sps || NULL == ps_svcd_ctxt->ps_pps)
  ------------------
  |  Branch (1715:8): [True: 0, False: 22.5k]
  |  Branch (1715:40): [True: 0, False: 22.5k]
  ------------------
 1716|      0|    {
 1717|      0|        return IV_FAIL;
 1718|      0|    }
 1719|       |
 1720|  22.5k|    ps_svcd_ctxt->pv_nal_parse_ctxt = ps_nal_parse_ctxt;
 1721|  22.5k|    ps_nal_parse_ctxt->pv_seq_prms = ps_svcd_ctxt->ps_sps;
 1722|  22.5k|    ps_nal_parse_ctxt->pv_pic_prms = ps_svcd_ctxt->ps_pps;
 1723|       |
 1724|       |    /* register VCL and NON VCL buffer pointers */
 1725|  22.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: 22.5k]
  |  Branch (1725:49): [True: 0, False: 22.5k]
  ------------------
 1726|      0|    {
 1727|      0|        return IV_FAIL;
 1728|      0|    }
 1729|       |
 1730|  22.5k|    ps_nal_parse_ctxt->pv_vcl_nal_buf = (UWORD8 *) ps_svcd_ctxt->pv_vcl_nal_buff;
 1731|  22.5k|    ps_nal_parse_ctxt->pv_non_vcl_nal_buf = (UWORD8 *) ps_svcd_ctxt->pv_non_vcl_nal_buff;
 1732|  22.5k|    isvcd_nal_parse_reset_ctxt(ANNEX_B, PARTIAL_INPUT_MODE, ps_nal_parse_ctxt);
  ------------------
  |  |   64|  22.5k|#define ANNEX_B 0     /*!< Annex B stream*/
  ------------------
 1733|       |
 1734|  22.5k|    return IV_SUCCESS;
 1735|  22.5k|}
isvcd_intra_resample_ctxt_create:
 1759|  22.5k|{
 1760|  22.5k|    isvcd_create_ip_t *ps_create_ip;
 1761|  22.5k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 1762|  22.5k|    void *pv_buf;
 1763|  22.5k|    UWORD8 u1_layer_id;
 1764|  22.5k|    void *(*pf_aligned_alloc)(void *pv_mem_ctxt, WORD32 alignment, WORD32 size);
 1765|  22.5k|    void *pv_mem_ctxt;
 1766|  22.5k|    WORD32 size;
 1767|  22.5k|    intra_inter_pred_ctxt_t *ps_ii_pred_ctxt;
 1768|       |
 1769|  22.5k|    intra_sampling_ctxt_t *ps_ctxt;
 1770|  22.5k|    UNUSED(pv_api_op);
  ------------------
  |  |   45|  22.5k|#define UNUSED(x) ((void)(x))
  ------------------
 1771|  22.5k|    ps_create_ip = (isvcd_create_ip_t *) pv_api_ip;
 1772|       |
 1773|  22.5k|    pf_aligned_alloc = ps_create_ip->s_ivd_create_ip_t.pf_aligned_alloc;
 1774|  22.5k|    pv_mem_ctxt = ps_create_ip->s_ivd_create_ip_t.pv_mem_ctxt;
 1775|       |
 1776|  22.5k|    {
 1777|  22.5k|        intra_samp_lyr_ctxt *ps_lyr_ctxt;
 1778|       |
 1779|       |        /* allocate context structure */
 1780|  22.5k|        size = ((sizeof(intra_sampling_ctxt_t) + 127) >> 7) << 7;
 1781|  22.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1782|  22.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  22.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 22.5k]
  |  |  ------------------
  ------------------
 1783|  22.5k|        memset(pv_buf, 0, size);
 1784|  22.5k|        ps_ctxt = pv_buf;
 1785|       |
 1786|       |        /* luma reference array buffer  */
 1787|  22.5k|        size = REF_ARRAY_WIDTH * REF_ARRAY_HEIGHT * sizeof(UWORD8);
  ------------------
  |  |   73|  22.5k|#define REF_ARRAY_WIDTH 48
  ------------------
                      size = REF_ARRAY_WIDTH * REF_ARRAY_HEIGHT * sizeof(UWORD8);
  ------------------
  |  |   74|  22.5k|#define REF_ARRAY_HEIGHT 48
  ------------------
 1788|  22.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1789|  22.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  22.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 22.5k]
  |  |  ------------------
  ------------------
 1790|  22.5k|        memset(pv_buf, 0, size);
 1791|  22.5k|        ps_ctxt->pu1_refarray_buffer = pv_buf;
 1792|       |
 1793|       |        /* cb reference array buffer */
 1794|  22.5k|        size = REF_ARRAY_WIDTH * REF_ARRAY_HEIGHT * sizeof(UWORD8);
  ------------------
  |  |   73|  22.5k|#define REF_ARRAY_WIDTH 48
  ------------------
                      size = REF_ARRAY_WIDTH * REF_ARRAY_HEIGHT * sizeof(UWORD8);
  ------------------
  |  |   74|  22.5k|#define REF_ARRAY_HEIGHT 48
  ------------------
 1795|  22.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1796|  22.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  22.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 22.5k]
  |  |  ------------------
  ------------------
 1797|  22.5k|        memset(pv_buf, 0, size);
 1798|  22.5k|        ps_ctxt->pu1_refarray_cb = pv_buf;
 1799|       |
 1800|       |        /* cr reference array buffer */
 1801|  22.5k|        size = ((DYADIC_REF_W_C + 2) * (DYADIC_REF_H_C + 2) * sizeof(UWORD8));
  ------------------
  |  |   58|  22.5k|#define DYADIC_REF_W_C 10
  ------------------
                      size = ((DYADIC_REF_W_C + 2) * (DYADIC_REF_H_C + 2) * sizeof(UWORD8));
  ------------------
  |  |   59|  22.5k|#define DYADIC_REF_H_C 10
  ------------------
 1802|  22.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1803|  22.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  22.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 22.5k]
  |  |  ------------------
  ------------------
 1804|  22.5k|        memset(pv_buf, 0, size);
 1805|  22.5k|        ps_ctxt->pu1_refarray_cr = pv_buf;
 1806|       |
 1807|       |        /* Temp Intermediate Buffer */
 1808|  22.5k|        size = INTERMEDIATE_BUFF_WIDTH * INTERMEDIATE_BUFF_HEIGHT * sizeof(WORD32);
  ------------------
  |  |   50|  22.5k|#define INTERMEDIATE_BUFF_WIDTH 48
  ------------------
                      size = INTERMEDIATE_BUFF_WIDTH * INTERMEDIATE_BUFF_HEIGHT * sizeof(WORD32);
  ------------------
  |  |   51|  22.5k|#define INTERMEDIATE_BUFF_HEIGHT (MB_HEIGHT + 4)
  |  |  ------------------
  |  |  |  |   68|  22.5k|#define MB_HEIGHT 16
  |  |  ------------------
  ------------------
 1809|  22.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1810|  22.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  22.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 22.5k]
  |  |  ------------------
  ------------------
 1811|  22.5k|        memset(pv_buf, 0, size);
 1812|  22.5k|        ps_ctxt->pi4_temp_interpolation_buffer = pv_buf;
 1813|       |
 1814|       |        /****************** projected locations buffers ******************/
 1815|  22.5k|        {
 1816|  22.5k|            intra_samp_map_ctxt_t *ps_luma_map;
 1817|  22.5k|            intra_samp_map_ctxt_t *ps_chroma_map;
 1818|  22.5k|            WORD32 i4_lyr_id;
 1819|  22.5k|            ref_mb_map_t *ps_off_len_map;
 1820|  22.5k|            ref_pixel_map_t *ps_pos_phase_map;
 1821|  22.5k|            ref_min_max_map_t *ps_min_max;
 1822|  22.5k|            WORD16 *pi2_mem;
 1823|  22.5k|            UWORD8 *pu1_mem;
 1824|  22.5k|            seg_lookup_desc_t *ps_seg_lookup;
 1825|       |
 1826|       |            /****************** Horz offset length ******************/
 1827|       |
 1828|  22.5k|            size = (H264_MAX_FRAME_WIDTH >> 4) * MAX_NUM_RES_LYRS * 2 * sizeof(ref_mb_map_t);
  ------------------
  |  |   39|  22.5k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
                          size = (H264_MAX_FRAME_WIDTH >> 4) * MAX_NUM_RES_LYRS * 2 * sizeof(ref_mb_map_t);
  ------------------
  |  |   94|  22.5k|#define MAX_NUM_RES_LYRS 3
  ------------------
 1829|  22.5k|            pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1830|  22.5k|            RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  22.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 22.5k]
  |  |  ------------------
  ------------------
 1831|  22.5k|            memset(pv_buf, 0, size);
 1832|  22.5k|            ps_off_len_map = pv_buf;
 1833|       |
 1834|       |            /* loop over num layers -1 */
 1835|  90.1k|            for(i4_lyr_id = 0; i4_lyr_id < MAX_NUM_RES_LYRS; i4_lyr_id++)
  ------------------
  |  |   94|  90.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (1835:32): [True: 67.5k, False: 22.5k]
  ------------------
 1836|  67.5k|            {
 1837|       |                /* derive the layer map ctxt */
 1838|  67.5k|                ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[i4_lyr_id];
 1839|  67.5k|                ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 1840|  67.5k|                ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 1841|       |
 1842|       |                /* initialise the pointers */
 1843|  67.5k|                ps_luma_map->ps_x_offset_length = ps_off_len_map;
 1844|  67.5k|                ps_off_len_map += (H264_MAX_FRAME_WIDTH >> 4);
  ------------------
  |  |   39|  67.5k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
 1845|  67.5k|                ps_chroma_map->ps_x_offset_length = ps_off_len_map;
 1846|  67.5k|                ps_off_len_map += (H264_MAX_FRAME_WIDTH >> 4);
  ------------------
  |  |   39|  67.5k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
 1847|       |
 1848|  67.5k|            } /* end of loop over resolution layers */
 1849|       |
 1850|       |            /****************** Vert offset length ******************/
 1851|  22.5k|            size = (H264_MAX_FRAME_HEIGHT >> 4) * MAX_NUM_RES_LYRS * 2 * sizeof(ref_mb_map_t);
  ------------------
  |  |   40|  22.5k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
                          size = (H264_MAX_FRAME_HEIGHT >> 4) * MAX_NUM_RES_LYRS * 2 * sizeof(ref_mb_map_t);
  ------------------
  |  |   94|  22.5k|#define MAX_NUM_RES_LYRS 3
  ------------------
 1852|  22.5k|            pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1853|  22.5k|            RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  22.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 22.5k]
  |  |  ------------------
  ------------------
 1854|  22.5k|            memset(pv_buf, 0, size);
 1855|  22.5k|            ps_off_len_map = pv_buf;
 1856|       |
 1857|       |            /* loop over num layers -1 */
 1858|  90.1k|            for(i4_lyr_id = 0; i4_lyr_id < MAX_NUM_RES_LYRS; i4_lyr_id++)
  ------------------
  |  |   94|  90.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (1858:32): [True: 67.5k, False: 22.5k]
  ------------------
 1859|  67.5k|            {
 1860|       |                /* derive the layer map ctxt */
 1861|  67.5k|                ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[i4_lyr_id];
 1862|  67.5k|                ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 1863|  67.5k|                ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 1864|       |
 1865|       |                /* initialise the pointers */
 1866|  67.5k|                ps_luma_map->ps_y_offset_length = ps_off_len_map;
 1867|  67.5k|                ps_off_len_map += (H264_MAX_FRAME_HEIGHT >> 4);
  ------------------
  |  |   40|  67.5k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
 1868|  67.5k|                ps_chroma_map->ps_y_offset_length = ps_off_len_map;
 1869|  67.5k|                ps_off_len_map += (H264_MAX_FRAME_HEIGHT >> 4);
  ------------------
  |  |   40|  67.5k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
 1870|       |
 1871|  67.5k|            } /* end of loop over resolution layers */
 1872|       |
 1873|       |            /****************** Horz Min Max Pos ******************/
 1874|       |
 1875|  22.5k|            size = (H264_MAX_FRAME_WIDTH >> 4) * MAX_NUM_RES_LYRS * 2 * sizeof(ref_mb_map_t);
  ------------------
  |  |   39|  22.5k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
                          size = (H264_MAX_FRAME_WIDTH >> 4) * MAX_NUM_RES_LYRS * 2 * sizeof(ref_mb_map_t);
  ------------------
  |  |   94|  22.5k|#define MAX_NUM_RES_LYRS 3
  ------------------
 1876|  22.5k|            pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1877|  22.5k|            RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  22.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 22.5k]
  |  |  ------------------
  ------------------
 1878|  22.5k|            memset(pv_buf, 0, size);
 1879|  22.5k|            ps_min_max = pv_buf;
 1880|       |
 1881|       |            /* loop over num layers -1 */
 1882|  90.1k|            for(i4_lyr_id = 0; i4_lyr_id < MAX_NUM_RES_LYRS; i4_lyr_id++)
  ------------------
  |  |   94|  90.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (1882:32): [True: 67.5k, False: 22.5k]
  ------------------
 1883|  67.5k|            {
 1884|       |                /* derive the layer map ctxt */
 1885|  67.5k|                ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[i4_lyr_id];
 1886|  67.5k|                ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 1887|  67.5k|                ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 1888|       |
 1889|       |                /* initialise the pointers */
 1890|  67.5k|                ps_luma_map->ps_x_min_max = ps_min_max;
 1891|  67.5k|                ps_min_max += (H264_MAX_FRAME_WIDTH >> 4);
  ------------------
  |  |   39|  67.5k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
 1892|  67.5k|                ps_chroma_map->ps_x_min_max = ps_min_max;
 1893|  67.5k|                ps_min_max += (H264_MAX_FRAME_WIDTH >> 4);
  ------------------
  |  |   39|  67.5k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
 1894|  67.5k|            } /* end of loop over resolution layers */
 1895|       |
 1896|       |            /****************** Vert Min Max Pos ******************/
 1897|  22.5k|            size = (H264_MAX_FRAME_HEIGHT >> 4) * MAX_NUM_RES_LYRS * 2 * sizeof(ref_mb_map_t);
  ------------------
  |  |   40|  22.5k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
                          size = (H264_MAX_FRAME_HEIGHT >> 4) * MAX_NUM_RES_LYRS * 2 * sizeof(ref_mb_map_t);
  ------------------
  |  |   94|  22.5k|#define MAX_NUM_RES_LYRS 3
  ------------------
 1898|       |
 1899|  22.5k|            pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1900|  22.5k|            RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  22.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 22.5k]
  |  |  ------------------
  ------------------
 1901|  22.5k|            memset(pv_buf, 0, size);
 1902|  22.5k|            ps_min_max = pv_buf;
 1903|       |
 1904|       |            /* loop over num layers -1 */
 1905|  90.1k|            for(i4_lyr_id = 0; i4_lyr_id < MAX_NUM_RES_LYRS; i4_lyr_id++)
  ------------------
  |  |   94|  90.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (1905:32): [True: 67.5k, False: 22.5k]
  ------------------
 1906|  67.5k|            {
 1907|       |                /* derive the layer map ctxt */
 1908|  67.5k|                ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[i4_lyr_id];
 1909|  67.5k|                ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 1910|  67.5k|                ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 1911|       |
 1912|       |                /* initialise the pointers */
 1913|  67.5k|                ps_luma_map->ps_y_min_max = ps_min_max;
 1914|  67.5k|                ps_min_max += (H264_MAX_FRAME_HEIGHT >> 4);
  ------------------
  |  |   40|  67.5k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
 1915|  67.5k|                ps_chroma_map->ps_y_min_max = ps_min_max;
 1916|  67.5k|                ps_min_max += (H264_MAX_FRAME_HEIGHT >> 4);
  ------------------
  |  |   40|  67.5k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
 1917|       |
 1918|  67.5k|            } /* end of loop over resolution layers */
 1919|       |
 1920|       |            /****************** Horz position phase ******************/
 1921|  22.5k|            size = (H264_MAX_FRAME_WIDTH) *MAX_NUM_RES_LYRS * 2 * sizeof(ref_pixel_map_t);
  ------------------
  |  |   39|  22.5k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
                          size = (H264_MAX_FRAME_WIDTH) *MAX_NUM_RES_LYRS * 2 * sizeof(ref_pixel_map_t);
  ------------------
  |  |   94|  22.5k|#define MAX_NUM_RES_LYRS 3
  ------------------
 1922|  22.5k|            pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1923|  22.5k|            RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  22.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 22.5k]
  |  |  ------------------
  ------------------
 1924|  22.5k|            memset(pv_buf, 0, size);
 1925|  22.5k|            ps_pos_phase_map = pv_buf;
 1926|       |
 1927|       |            /* loop over num layers -1 */
 1928|  90.1k|            for(i4_lyr_id = 0; i4_lyr_id < MAX_NUM_RES_LYRS; i4_lyr_id++)
  ------------------
  |  |   94|  90.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (1928:32): [True: 67.5k, False: 22.5k]
  ------------------
 1929|  67.5k|            {
 1930|       |                /* derive the layer map ctxt */
 1931|  67.5k|                ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[i4_lyr_id];
 1932|  67.5k|                ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 1933|  67.5k|                ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 1934|       |
 1935|       |                /* initialise the pointers */
 1936|  67.5k|                ps_luma_map->ps_x_pos_phase = ps_pos_phase_map;
 1937|  67.5k|                ps_pos_phase_map += (H264_MAX_FRAME_WIDTH);
  ------------------
  |  |   39|  67.5k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
 1938|  67.5k|                ps_chroma_map->ps_x_pos_phase = ps_pos_phase_map;
 1939|  67.5k|                ps_pos_phase_map += (H264_MAX_FRAME_WIDTH);
  ------------------
  |  |   39|  67.5k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
 1940|       |
 1941|  67.5k|            } /* end of loop over resolution layers */
 1942|       |
 1943|       |            /****************** Vert position phase ******************/
 1944|       |
 1945|  22.5k|            size = (H264_MAX_FRAME_HEIGHT) *MAX_NUM_RES_LYRS * 2 * sizeof(ref_pixel_map_t);
  ------------------
  |  |   40|  22.5k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
                          size = (H264_MAX_FRAME_HEIGHT) *MAX_NUM_RES_LYRS * 2 * sizeof(ref_pixel_map_t);
  ------------------
  |  |   94|  22.5k|#define MAX_NUM_RES_LYRS 3
  ------------------
 1946|  22.5k|            pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1947|  22.5k|            RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  22.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 22.5k]
  |  |  ------------------
  ------------------
 1948|  22.5k|            memset(pv_buf, 0, size);
 1949|  22.5k|            ps_pos_phase_map = pv_buf;
 1950|       |
 1951|       |            /* loop over num layers -1 */
 1952|  90.1k|            for(i4_lyr_id = 0; i4_lyr_id < MAX_NUM_RES_LYRS; i4_lyr_id++)
  ------------------
  |  |   94|  90.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (1952:32): [True: 67.5k, False: 22.5k]
  ------------------
 1953|  67.5k|            {
 1954|       |                /* derive the layer map ctxt */
 1955|  67.5k|                ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[i4_lyr_id];
 1956|  67.5k|                ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 1957|  67.5k|                ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 1958|       |
 1959|       |                /* initialise the pointers */
 1960|  67.5k|                ps_luma_map->ps_y_pos_phase = ps_pos_phase_map;
 1961|  67.5k|                ps_pos_phase_map += (H264_MAX_FRAME_HEIGHT);
  ------------------
  |  |   40|  67.5k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
 1962|  67.5k|                ps_chroma_map->ps_y_pos_phase = ps_pos_phase_map;
 1963|  67.5k|                ps_pos_phase_map += (H264_MAX_FRAME_HEIGHT);
  ------------------
  |  |   40|  67.5k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
 1964|       |
 1965|  67.5k|            } /* end of loop over resolution layers */
 1966|       |
 1967|       |            /**************** XD Index ******************************/
 1968|  22.5k|            size = (MB_WIDTH) *MAX_NUM_RES_LYRS * 2 * sizeof(WORD16);
  ------------------
  |  |   67|  22.5k|#define MB_WIDTH 16
  ------------------
                          size = (MB_WIDTH) *MAX_NUM_RES_LYRS * 2 * sizeof(WORD16);
  ------------------
  |  |   94|  22.5k|#define MAX_NUM_RES_LYRS 3
  ------------------
 1969|  22.5k|            pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1970|  22.5k|            RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  22.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 22.5k]
  |  |  ------------------
  ------------------
 1971|  22.5k|            memset(pv_buf, 0, size);
 1972|  22.5k|            pi2_mem = pv_buf;
 1973|       |
 1974|       |            /* loop over num layers -1 */
 1975|  90.1k|            for(i4_lyr_id = 0; i4_lyr_id < MAX_NUM_RES_LYRS; i4_lyr_id++)
  ------------------
  |  |   94|  90.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (1975:32): [True: 67.5k, False: 22.5k]
  ------------------
 1976|  67.5k|            {
 1977|       |                /* derive the layer map ctxt */
 1978|  67.5k|                ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[i4_lyr_id];
 1979|  67.5k|                ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 1980|  67.5k|                ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 1981|       |
 1982|       |                /* initialise the pointers */
 1983|  67.5k|                ps_luma_map->pi2_xd_index = pi2_mem;
 1984|  67.5k|                pi2_mem += MB_WIDTH;
  ------------------
  |  |   67|  67.5k|#define MB_WIDTH 16
  ------------------
 1985|  67.5k|                ps_chroma_map->pi2_xd_index = pi2_mem;
 1986|  67.5k|                pi2_mem += MB_WIDTH;
  ------------------
  |  |   67|  67.5k|#define MB_WIDTH 16
  ------------------
 1987|       |
 1988|  67.5k|            } /* end of loop over resolution layers */
 1989|       |
 1990|       |            /**************** YD Index ******************************/
 1991|  22.5k|            size = (MB_HEIGHT) *MAX_NUM_RES_LYRS * 2 * sizeof(WORD16);
  ------------------
  |  |   68|  22.5k|#define MB_HEIGHT 16
  ------------------
                          size = (MB_HEIGHT) *MAX_NUM_RES_LYRS * 2 * sizeof(WORD16);
  ------------------
  |  |   94|  22.5k|#define MAX_NUM_RES_LYRS 3
  ------------------
 1992|  22.5k|            pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1993|  22.5k|            RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  22.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 22.5k]
  |  |  ------------------
  ------------------
 1994|  22.5k|            memset(pv_buf, 0, size);
 1995|  22.5k|            pi2_mem = pv_buf;
 1996|       |
 1997|       |            /* loop over num layers -1 */
 1998|  90.1k|            for(i4_lyr_id = 0; i4_lyr_id < MAX_NUM_RES_LYRS; i4_lyr_id++)
  ------------------
  |  |   94|  90.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (1998:32): [True: 67.5k, False: 22.5k]
  ------------------
 1999|  67.5k|            {
 2000|       |                /* derive the layer map ctxt */
 2001|  67.5k|                ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[i4_lyr_id];
 2002|  67.5k|                ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 2003|  67.5k|                ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 2004|       |
 2005|       |                /* initialise the pointers */
 2006|  67.5k|                ps_luma_map->pi2_yd_index = pi2_mem;
 2007|  67.5k|                pi2_mem += MB_HEIGHT;
  ------------------
  |  |   68|  67.5k|#define MB_HEIGHT 16
  ------------------
 2008|  67.5k|                ps_chroma_map->pi2_yd_index = pi2_mem;
 2009|  67.5k|                pi2_mem += MB_HEIGHT;
  ------------------
  |  |   68|  67.5k|#define MB_HEIGHT 16
  ------------------
 2010|       |
 2011|  67.5k|            } /* end of loop over resolution layers */
 2012|       |
 2013|       |            /**************** YA Index ******************************/
 2014|  22.5k|            size = MB_HEIGHT * MAX_NUM_RES_LYRS * 2 * sizeof(WORD16);
  ------------------
  |  |   68|  22.5k|#define MB_HEIGHT 16
  ------------------
                          size = MB_HEIGHT * MAX_NUM_RES_LYRS * 2 * sizeof(WORD16);
  ------------------
  |  |   94|  22.5k|#define MAX_NUM_RES_LYRS 3
  ------------------
 2015|  22.5k|            pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2016|  22.5k|            RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  22.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 22.5k]
  |  |  ------------------
  ------------------
 2017|  22.5k|            memset(pv_buf, 0, size);
 2018|  22.5k|            pi2_mem = pv_buf;
 2019|       |
 2020|       |            /* loop over num layers -1 */
 2021|  90.1k|            for(i4_lyr_id = 0; i4_lyr_id < MAX_NUM_RES_LYRS; i4_lyr_id++)
  ------------------
  |  |   94|  90.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (2021:32): [True: 67.5k, False: 22.5k]
  ------------------
 2022|  67.5k|            {
 2023|       |                /* derive the layer map ctxt */
 2024|  67.5k|                ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[i4_lyr_id];
 2025|  67.5k|                ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 2026|  67.5k|                ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 2027|       |
 2028|       |                /* initialise the pointers */
 2029|  67.5k|                ps_luma_map->pi2_ya_index = pi2_mem;
 2030|  67.5k|                pi2_mem += MB_HEIGHT;
  ------------------
  |  |   68|  67.5k|#define MB_HEIGHT 16
  ------------------
 2031|  67.5k|                ps_chroma_map->pi2_ya_index = pi2_mem;
 2032|  67.5k|                pi2_mem += MB_HEIGHT;
  ------------------
  |  |   68|  67.5k|#define MB_HEIGHT 16
  ------------------
 2033|       |
 2034|  67.5k|            } /* 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|  22.5k|            size = (MB_WIDTH * sizeof(seg_lookup_desc_t)) * MAX_NUM_RES_LYRS;
  ------------------
  |  |   67|  22.5k|#define MB_WIDTH 16
  ------------------
                          size = (MB_WIDTH * sizeof(seg_lookup_desc_t)) * MAX_NUM_RES_LYRS;
  ------------------
  |  |   94|  22.5k|#define MAX_NUM_RES_LYRS 3
  ------------------
 2040|       |
 2041|  22.5k|            size += (BLOCK_WIDTH * sizeof(seg_lookup_desc_t)) * MAX_NUM_RES_LYRS;
  ------------------
  |  |   64|  22.5k|#define BLOCK_WIDTH 8
  ------------------
                          size += (BLOCK_WIDTH * sizeof(seg_lookup_desc_t)) * MAX_NUM_RES_LYRS;
  ------------------
  |  |   94|  22.5k|#define MAX_NUM_RES_LYRS 3
  ------------------
 2042|       |
 2043|  22.5k|            pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2044|  22.5k|            RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  22.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 22.5k]
  |  |  ------------------
  ------------------
 2045|  22.5k|            memset(pv_buf, 0, size);
 2046|  22.5k|            ps_seg_lookup = pv_buf;
 2047|       |
 2048|       |            /* loop over num layers -1 */
 2049|  90.1k|            for(i4_lyr_id = 0; i4_lyr_id < MAX_NUM_RES_LYRS; i4_lyr_id++)
  ------------------
  |  |   94|  90.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (2049:32): [True: 67.5k, False: 22.5k]
  ------------------
 2050|  67.5k|            {
 2051|       |                /* derive the layer map ctxt */
 2052|  67.5k|                ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[i4_lyr_id];
 2053|  67.5k|                ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 2054|  67.5k|                ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 2055|       |
 2056|       |                /* initialise the pointers */
 2057|  67.5k|                ps_luma_map->ps_seg_lookup_horz = ps_seg_lookup;
 2058|  67.5k|                ps_seg_lookup += MB_WIDTH;
  ------------------
  |  |   67|  67.5k|#define MB_WIDTH 16
  ------------------
 2059|  67.5k|                ps_chroma_map->ps_seg_lookup_horz = ps_seg_lookup;
 2060|  67.5k|                ps_seg_lookup += BLOCK_WIDTH;
  ------------------
  |  |   64|  67.5k|#define BLOCK_WIDTH 8
  ------------------
 2061|       |
 2062|  67.5k|            } /* 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|  22.5k|            size = (MB_HEIGHT * sizeof(seg_lookup_desc_t)) * MAX_NUM_RES_LYRS;
  ------------------
  |  |   68|  22.5k|#define MB_HEIGHT 16
  ------------------
                          size = (MB_HEIGHT * sizeof(seg_lookup_desc_t)) * MAX_NUM_RES_LYRS;
  ------------------
  |  |   94|  22.5k|#define MAX_NUM_RES_LYRS 3
  ------------------
 2068|       |
 2069|  22.5k|            size += (BLOCK_HEIGHT * sizeof(seg_lookup_desc_t)) * MAX_NUM_RES_LYRS;
  ------------------
  |  |   65|  22.5k|#define BLOCK_HEIGHT 8
  ------------------
                          size += (BLOCK_HEIGHT * sizeof(seg_lookup_desc_t)) * MAX_NUM_RES_LYRS;
  ------------------
  |  |   94|  22.5k|#define MAX_NUM_RES_LYRS 3
  ------------------
 2070|       |
 2071|  22.5k|            pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2072|  22.5k|            RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  22.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 22.5k]
  |  |  ------------------
  ------------------
 2073|  22.5k|            memset(pv_buf, 0, size);
 2074|  22.5k|            ps_seg_lookup = pv_buf;
 2075|       |
 2076|       |            /* loop over num layers -1 */
 2077|  90.1k|            for(i4_lyr_id = 0; i4_lyr_id < MAX_NUM_RES_LYRS; i4_lyr_id++)
  ------------------
  |  |   94|  90.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (2077:32): [True: 67.5k, False: 22.5k]
  ------------------
 2078|  67.5k|            {
 2079|       |                /* derive the layer map ctxt */
 2080|  67.5k|                ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[i4_lyr_id];
 2081|  67.5k|                ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 2082|  67.5k|                ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 2083|       |
 2084|       |                /* initialise the pointers */
 2085|  67.5k|                ps_luma_map->ps_seg_lookup_vert = ps_seg_lookup;
 2086|  67.5k|                ps_seg_lookup += MB_HEIGHT;
  ------------------
  |  |   68|  67.5k|#define MB_HEIGHT 16
  ------------------
 2087|  67.5k|                ps_chroma_map->ps_seg_lookup_vert = ps_seg_lookup;
 2088|  67.5k|                ps_seg_lookup += BLOCK_HEIGHT;
  ------------------
  |  |   65|  67.5k|#define BLOCK_HEIGHT 8
  ------------------
 2089|       |
 2090|  67.5k|            } /* 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|  22.5k|            size = (MAX_REF_IDX_ARRAY * MAX_NUM_RES_LYRS * 4);
  ------------------
  |  |   55|  22.5k|#define MAX_REF_IDX_ARRAY (MAX_REF_ARR_WD_HT + MB_WIDTH)
  |  |  ------------------
  |  |  |  |   53|  22.5k|#define MAX_REF_ARR_WD_HT 48
  |  |  ------------------
  |  |               #define MAX_REF_IDX_ARRAY (MAX_REF_ARR_WD_HT + MB_WIDTH)
  |  |  ------------------
  |  |  |  |   67|  22.5k|#define MB_WIDTH 16
  |  |  ------------------
  ------------------
                          size = (MAX_REF_IDX_ARRAY * MAX_NUM_RES_LYRS * 4);
  ------------------
  |  |   94|  22.5k|#define MAX_NUM_RES_LYRS 3
  ------------------
 2099|  22.5k|            pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2100|  22.5k|            RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  22.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 22.5k]
  |  |  ------------------
  ------------------
 2101|  22.5k|            memset(pv_buf, 0, size);
 2102|  22.5k|            pu1_mem = pv_buf;
 2103|       |
 2104|       |            /* loop over num layers -1 */
 2105|  90.1k|            for(i4_lyr_id = 0; i4_lyr_id < MAX_NUM_RES_LYRS; i4_lyr_id++)
  ------------------
  |  |   94|  90.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (2105:32): [True: 67.5k, False: 22.5k]
  ------------------
 2106|  67.5k|            {
 2107|       |                /* derive the layer map ctxt */
 2108|  67.5k|                ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[i4_lyr_id];
 2109|  67.5k|                ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 2110|  67.5k|                ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 2111|       |
 2112|       |                /* initialise the pointers */
 2113|  67.5k|                ps_luma_map->pu1_refarray_x_idx = pu1_mem;
 2114|  67.5k|                pu1_mem += MAX_REF_IDX_ARRAY;
  ------------------
  |  |   55|  67.5k|#define MAX_REF_IDX_ARRAY (MAX_REF_ARR_WD_HT + MB_WIDTH)
  |  |  ------------------
  |  |  |  |   53|  67.5k|#define MAX_REF_ARR_WD_HT 48
  |  |  ------------------
  |  |               #define MAX_REF_IDX_ARRAY (MAX_REF_ARR_WD_HT + MB_WIDTH)
  |  |  ------------------
  |  |  |  |   67|  67.5k|#define MB_WIDTH 16
  |  |  ------------------
  ------------------
 2115|       |
 2116|  67.5k|                ps_luma_map->pu1_refarray_y_idx = pu1_mem;
 2117|  67.5k|                pu1_mem += MAX_REF_IDX_ARRAY;
  ------------------
  |  |   55|  67.5k|#define MAX_REF_IDX_ARRAY (MAX_REF_ARR_WD_HT + MB_WIDTH)
  |  |  ------------------
  |  |  |  |   53|  67.5k|#define MAX_REF_ARR_WD_HT 48
  |  |  ------------------
  |  |               #define MAX_REF_IDX_ARRAY (MAX_REF_ARR_WD_HT + MB_WIDTH)
  |  |  ------------------
  |  |  |  |   67|  67.5k|#define MB_WIDTH 16
  |  |  ------------------
  ------------------
 2118|       |
 2119|  67.5k|                ps_chroma_map->pu1_refarray_x_idx = pu1_mem;
 2120|  67.5k|                pu1_mem += MAX_REF_IDX_ARRAY;
  ------------------
  |  |   55|  67.5k|#define MAX_REF_IDX_ARRAY (MAX_REF_ARR_WD_HT + MB_WIDTH)
  |  |  ------------------
  |  |  |  |   53|  67.5k|#define MAX_REF_ARR_WD_HT 48
  |  |  ------------------
  |  |               #define MAX_REF_IDX_ARRAY (MAX_REF_ARR_WD_HT + MB_WIDTH)
  |  |  ------------------
  |  |  |  |   67|  67.5k|#define MB_WIDTH 16
  |  |  ------------------
  ------------------
 2121|       |
 2122|  67.5k|                ps_chroma_map->pu1_refarray_y_idx = pu1_mem;
 2123|  67.5k|                pu1_mem += MAX_REF_IDX_ARRAY;
  ------------------
  |  |   55|  67.5k|#define MAX_REF_IDX_ARRAY (MAX_REF_ARR_WD_HT + MB_WIDTH)
  |  |  ------------------
  |  |  |  |   53|  67.5k|#define MAX_REF_ARR_WD_HT 48
  |  |  ------------------
  |  |               #define MAX_REF_IDX_ARRAY (MAX_REF_ARR_WD_HT + MB_WIDTH)
  |  |  ------------------
  |  |  |  |   67|  67.5k|#define MB_WIDTH 16
  |  |  ------------------
  ------------------
 2124|       |
 2125|  67.5k|            } /* end of loop over resolution layers */
 2126|  22.5k|        }
 2127|       |
 2128|      0|        size = ((sizeof(intra_inter_pred_ctxt_t) + 127) >> 7) << 7;
 2129|  22.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2130|  22.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  22.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 22.5k]
  |  |  ------------------
  ------------------
 2131|  22.5k|        memset(pv_buf, 0, size);
 2132|  22.5k|        ps_ii_pred_ctxt = pv_buf;
 2133|  22.5k|    }
 2134|       |
 2135|      0|    ps_svcd_ctxt->pv_intra_sample_ctxt = ps_ctxt;
 2136|  22.5k|    ps_svcd_ctxt->pv_ii_pred_ctxt = ps_ii_pred_ctxt;
 2137|       |
 2138|  90.1k|    for(u1_layer_id = 0; u1_layer_id < MAX_NUM_RES_LYRS; u1_layer_id++)
  ------------------
  |  |   94|  90.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (2138:26): [True: 67.5k, False: 22.5k]
  ------------------
 2139|  67.5k|    {
 2140|  67.5k|        ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[u1_layer_id];
 2141|  67.5k|        ps_svc_lyr_dec->pv_intra_sample_ctxt = ps_svcd_ctxt->pv_intra_sample_ctxt;
 2142|  67.5k|        ps_svc_lyr_dec->pv_ii_pred_ctxt = ps_svcd_ctxt->pv_ii_pred_ctxt;
 2143|  67.5k|    }
 2144|       |
 2145|  22.5k|    return IV_SUCCESS;
 2146|  22.5k|}
isvcd_residual_resample_ctxt_create:
 2170|  22.5k|{
 2171|  22.5k|    isvcd_create_ip_t *ps_create_ip;
 2172|  22.5k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 2173|  22.5k|    void *pv_buf;
 2174|  22.5k|    UWORD8 u1_layer_id;
 2175|  22.5k|    void *(*pf_aligned_alloc)(void *pv_mem_ctxt, WORD32 alignment, WORD32 size);
 2176|  22.5k|    void *pv_mem_ctxt;
 2177|  22.5k|    WORD32 size;
 2178|       |
 2179|  22.5k|    residual_sampling_ctxt_t *ps_ctxt;
 2180|  22.5k|    res_lyr_ctxt *ps_lyr_ctxt;
 2181|  22.5k|    UNUSED(pv_api_op);
  ------------------
  |  |   45|  22.5k|#define UNUSED(x) ((void)(x))
  ------------------
 2182|  22.5k|    ps_create_ip = (isvcd_create_ip_t *) pv_api_ip;
 2183|       |
 2184|  22.5k|    pf_aligned_alloc = ps_create_ip->s_ivd_create_ip_t.pf_aligned_alloc;
 2185|  22.5k|    pv_mem_ctxt = ps_create_ip->s_ivd_create_ip_t.pv_mem_ctxt;
 2186|       |
 2187|       |    /* allocate context structure */
 2188|  22.5k|    size = ((sizeof(residual_sampling_ctxt_t) + 127) >> 7) << 7;
 2189|  22.5k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2190|  22.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  22.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 22.5k]
  |  |  ------------------
  ------------------
 2191|  22.5k|    memset(pv_buf, 0, size);
 2192|  22.5k|    ps_ctxt = pv_buf;
 2193|       |
 2194|       |    /* reference array buffer  */
 2195|  22.5k|    size = REF_ARRAY_WIDTH_RES_SAMP * REF_ARRAY_HEIGHT_RES_SAMP * sizeof(WORD16);
  ------------------
  |  |   45|  22.5k|#define REF_ARRAY_WIDTH_RES_SAMP (MB_WIDTH + 6)
  |  |  ------------------
  |  |  |  |   67|  22.5k|#define MB_WIDTH 16
  |  |  ------------------
  ------------------
                  size = REF_ARRAY_WIDTH_RES_SAMP * REF_ARRAY_HEIGHT_RES_SAMP * sizeof(WORD16);
  ------------------
  |  |   46|  22.5k|#define REF_ARRAY_HEIGHT_RES_SAMP (MB_HEIGHT + 6)
  |  |  ------------------
  |  |  |  |   68|  22.5k|#define MB_HEIGHT 16
  |  |  ------------------
  ------------------
 2196|  22.5k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2197|  22.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  22.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 22.5k]
  |  |  ------------------
  ------------------
 2198|  22.5k|    memset(pv_buf, 0, size);
 2199|  22.5k|    ps_ctxt->pi2_refarray_buffer = pv_buf;
 2200|       |
 2201|       |    /* reference array pointer increment buffer */
 2202|  22.5k|    {
 2203|  22.5k|        WORD32 i4_size;
 2204|       |
 2205|  22.5k|        i4_size = REF_ARRAY_WIDTH_RES_SAMP * REF_ARRAY_HEIGHT_RES_SAMP * sizeof(UWORD8);
  ------------------
  |  |   45|  22.5k|#define REF_ARRAY_WIDTH_RES_SAMP (MB_WIDTH + 6)
  |  |  ------------------
  |  |  |  |   67|  22.5k|#define MB_WIDTH 16
  |  |  ------------------
  ------------------
                      i4_size = REF_ARRAY_WIDTH_RES_SAMP * REF_ARRAY_HEIGHT_RES_SAMP * sizeof(UWORD8);
  ------------------
  |  |   46|  22.5k|#define REF_ARRAY_HEIGHT_RES_SAMP (MB_HEIGHT + 6)
  |  |  ------------------
  |  |  |  |   68|  22.5k|#define MB_HEIGHT 16
  |  |  ------------------
  ------------------
 2206|  22.5k|        size = REF_ARRAY_WIDTH_RES_SAMP * REF_ARRAY_HEIGHT_RES_SAMP * 2 * sizeof(UWORD8);
  ------------------
  |  |   45|  22.5k|#define REF_ARRAY_WIDTH_RES_SAMP (MB_WIDTH + 6)
  |  |  ------------------
  |  |  |  |   67|  22.5k|#define MB_WIDTH 16
  |  |  ------------------
  ------------------
                      size = REF_ARRAY_WIDTH_RES_SAMP * REF_ARRAY_HEIGHT_RES_SAMP * 2 * sizeof(UWORD8);
  ------------------
  |  |   46|  22.5k|#define REF_ARRAY_HEIGHT_RES_SAMP (MB_HEIGHT + 6)
  |  |  ------------------
  |  |  |  |   68|  22.5k|#define MB_HEIGHT 16
  |  |  ------------------
  ------------------
 2207|  22.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2208|  22.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  22.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 22.5k]
  |  |  ------------------
  ------------------
 2209|  22.5k|        memset(pv_buf, 0, size);
 2210|  22.5k|        ps_ctxt->pu1_ref_x_ptr_incr = pv_buf;
 2211|  22.5k|        ps_ctxt->pu1_ref_y_ptr_incr = ps_ctxt->pu1_ref_x_ptr_incr + i4_size;
 2212|  22.5k|    }
 2213|       |
 2214|       |    /****************** projected locations buffers ******************/
 2215|      0|    {
 2216|  22.5k|        residual_samp_map_ctxt_t *ps_luma_map;
 2217|  22.5k|        residual_samp_map_ctxt_t *ps_chroma_map;
 2218|  22.5k|        WORD32 i4_lyr_id;
 2219|  22.5k|        ref_mb_map_t *ps_off_len_map;
 2220|  22.5k|        ref_pixel_map_t *ps_pos_phase_map;
 2221|       |
 2222|       |        /****************** Horz offset length ******************/
 2223|  22.5k|        size = (H264_MAX_FRAME_WIDTH >> 4) * MAX_NUM_RES_LYRS * 2 * sizeof(ref_mb_map_t);
  ------------------
  |  |   39|  22.5k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
                      size = (H264_MAX_FRAME_WIDTH >> 4) * MAX_NUM_RES_LYRS * 2 * sizeof(ref_mb_map_t);
  ------------------
  |  |   94|  22.5k|#define MAX_NUM_RES_LYRS 3
  ------------------
 2224|  22.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2225|  22.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  22.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 22.5k]
  |  |  ------------------
  ------------------
 2226|  22.5k|        memset(pv_buf, 0, size);
 2227|  22.5k|        ps_off_len_map = pv_buf;
 2228|       |
 2229|       |        /* loop over num layers -1 */
 2230|  90.1k|        for(i4_lyr_id = 0; i4_lyr_id < MAX_NUM_RES_LYRS; i4_lyr_id++)
  ------------------
  |  |   94|  90.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (2230:28): [True: 67.5k, False: 22.5k]
  ------------------
 2231|  67.5k|        {
 2232|       |            /* derive the layer map ctxt */
 2233|  67.5k|            ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[i4_lyr_id];
 2234|  67.5k|            ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 2235|  67.5k|            ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 2236|       |
 2237|       |            /* initialise the pointers */
 2238|  67.5k|            ps_luma_map->ps_x_offset_length = ps_off_len_map;
 2239|  67.5k|            ps_off_len_map += (H264_MAX_FRAME_WIDTH >> 4);
  ------------------
  |  |   39|  67.5k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
 2240|  67.5k|            ps_chroma_map->ps_x_offset_length = ps_off_len_map;
 2241|  67.5k|            ps_off_len_map += (H264_MAX_FRAME_WIDTH >> 4);
  ------------------
  |  |   39|  67.5k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
 2242|       |
 2243|  67.5k|        } /* end of loop over resolution layers */
 2244|       |
 2245|       |        /****************** Vert offset length ******************/
 2246|  22.5k|        size = (H264_MAX_FRAME_HEIGHT >> 4) * MAX_NUM_RES_LYRS * 2 * sizeof(ref_mb_map_t);
  ------------------
  |  |   40|  22.5k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
                      size = (H264_MAX_FRAME_HEIGHT >> 4) * MAX_NUM_RES_LYRS * 2 * sizeof(ref_mb_map_t);
  ------------------
  |  |   94|  22.5k|#define MAX_NUM_RES_LYRS 3
  ------------------
 2247|  22.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2248|  22.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  22.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 22.5k]
  |  |  ------------------
  ------------------
 2249|  22.5k|        memset(pv_buf, 0, size);
 2250|  22.5k|        ps_off_len_map = pv_buf;
 2251|       |
 2252|       |        /* loop over num layers -1 */
 2253|  90.1k|        for(i4_lyr_id = 0; i4_lyr_id < MAX_NUM_RES_LYRS; i4_lyr_id++)
  ------------------
  |  |   94|  90.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (2253:28): [True: 67.5k, False: 22.5k]
  ------------------
 2254|  67.5k|        {
 2255|       |            /* derive the layer map ctxt */
 2256|  67.5k|            ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[i4_lyr_id];
 2257|  67.5k|            ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 2258|  67.5k|            ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 2259|       |
 2260|       |            /* initialise the pointers */
 2261|  67.5k|            ps_luma_map->ps_y_offset_length = ps_off_len_map;
 2262|  67.5k|            ps_off_len_map += (H264_MAX_FRAME_HEIGHT >> 4);
  ------------------
  |  |   40|  67.5k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
 2263|  67.5k|            ps_chroma_map->ps_y_offset_length = ps_off_len_map;
 2264|  67.5k|            ps_off_len_map += (H264_MAX_FRAME_HEIGHT >> 4);
  ------------------
  |  |   40|  67.5k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
 2265|       |
 2266|  67.5k|        } /* end of loop over resolution layers */
 2267|       |
 2268|       |        /****************** Horz position phase ******************/
 2269|  22.5k|        size = H264_MAX_FRAME_WIDTH * MAX_NUM_RES_LYRS * 2 * sizeof(ref_pixel_map_t);
  ------------------
  |  |   39|  22.5k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
                      size = H264_MAX_FRAME_WIDTH * MAX_NUM_RES_LYRS * 2 * sizeof(ref_pixel_map_t);
  ------------------
  |  |   94|  22.5k|#define MAX_NUM_RES_LYRS 3
  ------------------
 2270|  22.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2271|  22.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  22.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 22.5k]
  |  |  ------------------
  ------------------
 2272|  22.5k|        memset(pv_buf, 0, size);
 2273|  22.5k|        ps_pos_phase_map = pv_buf;
 2274|       |
 2275|       |        /* loop over num layers -1 */
 2276|  90.1k|        for(i4_lyr_id = 0; i4_lyr_id < MAX_NUM_RES_LYRS; i4_lyr_id++)
  ------------------
  |  |   94|  90.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (2276:28): [True: 67.5k, False: 22.5k]
  ------------------
 2277|  67.5k|        {
 2278|       |            /* derive the layer map ctxt */
 2279|  67.5k|            ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[i4_lyr_id];
 2280|  67.5k|            ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 2281|  67.5k|            ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 2282|       |
 2283|       |            /* initialise the pointers */
 2284|  67.5k|            ps_luma_map->ps_x_pos_phase = ps_pos_phase_map;
 2285|  67.5k|            ps_pos_phase_map += H264_MAX_FRAME_WIDTH;
  ------------------
  |  |   39|  67.5k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
 2286|  67.5k|            ps_chroma_map->ps_x_pos_phase = ps_pos_phase_map;
 2287|  67.5k|            ps_pos_phase_map += H264_MAX_FRAME_WIDTH;
  ------------------
  |  |   39|  67.5k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
 2288|       |
 2289|  67.5k|        } /* end of loop over resolution layers */
 2290|       |
 2291|       |        /****************** Vert position phase ******************/
 2292|       |
 2293|  22.5k|        size = H264_MAX_FRAME_HEIGHT * MAX_NUM_RES_LYRS * 2 * sizeof(ref_pixel_map_t);
  ------------------
  |  |   40|  22.5k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
                      size = H264_MAX_FRAME_HEIGHT * MAX_NUM_RES_LYRS * 2 * sizeof(ref_pixel_map_t);
  ------------------
  |  |   94|  22.5k|#define MAX_NUM_RES_LYRS 3
  ------------------
 2294|  22.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2295|  22.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  22.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 22.5k]
  |  |  ------------------
  ------------------
 2296|  22.5k|        memset(pv_buf, 0, size);
 2297|  22.5k|        ps_pos_phase_map = pv_buf;
 2298|       |
 2299|       |        /* loop over num layers -1 */
 2300|  90.1k|        for(i4_lyr_id = 0; i4_lyr_id < MAX_NUM_RES_LYRS; i4_lyr_id++)
  ------------------
  |  |   94|  90.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (2300:28): [True: 67.5k, False: 22.5k]
  ------------------
 2301|  67.5k|        {
 2302|       |            /* derive the layer map ctxt */
 2303|  67.5k|            ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[i4_lyr_id];
 2304|  67.5k|            ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 2305|  67.5k|            ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 2306|       |
 2307|       |            /* initialise the pointers */
 2308|  67.5k|            ps_luma_map->ps_y_pos_phase = ps_pos_phase_map;
 2309|  67.5k|            ps_pos_phase_map += H264_MAX_FRAME_HEIGHT;
  ------------------
  |  |   40|  67.5k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
 2310|  67.5k|            ps_chroma_map->ps_y_pos_phase = ps_pos_phase_map;
 2311|  67.5k|            ps_pos_phase_map += H264_MAX_FRAME_HEIGHT;
  ------------------
  |  |   40|  67.5k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
 2312|       |
 2313|  67.5k|        } /* end of loop over resolution layers */
 2314|  22.5k|    }
 2315|       |
 2316|      0|    ps_svcd_ctxt->pv_residual_sample_ctxt = ps_ctxt;
 2317|       |
 2318|  90.1k|    for(u1_layer_id = 0; u1_layer_id < MAX_NUM_RES_LYRS; u1_layer_id++)
  ------------------
  |  |   94|  90.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (2318:26): [True: 67.5k, False: 22.5k]
  ------------------
 2319|  67.5k|    {
 2320|  67.5k|        ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[u1_layer_id];
 2321|  67.5k|        ps_svc_lyr_dec->pv_residual_sample_ctxt = ps_svcd_ctxt->pv_residual_sample_ctxt;
 2322|  67.5k|    }
 2323|  22.5k|    return IV_SUCCESS;
 2324|  22.5k|}
isvcd_mode_mv_resample_ctxt_create:
 2347|  22.5k|{
 2348|  22.5k|    isvcd_create_ip_t *ps_create_ip;
 2349|  22.5k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 2350|  22.5k|    void *pv_buf;
 2351|  22.5k|    WORD16 *pi2_mem;
 2352|  22.5k|    UWORD8 u1_layer_id;
 2353|  22.5k|    void *(*pf_aligned_alloc)(void *pv_mem_ctxt, WORD32 alignment, WORD32 size);
 2354|  22.5k|    void *pv_mem_ctxt;
 2355|  22.5k|    WORD32 size, i4_res_id;
 2356|  22.5k|    ref_lyr_scaled_offset_t *ps_ref_pic_offsets;
 2357|  22.5k|    mode_motion_ctxt_t *ps_mode_motion;
 2358|  22.5k|    mode_motion_lyr_ctxt *ps_lyr_mem;
 2359|  22.5k|    UNUSED(pv_api_op);
  ------------------
  |  |   45|  22.5k|#define UNUSED(x) ((void)(x))
  ------------------
 2360|  22.5k|    ps_create_ip = (isvcd_create_ip_t *) pv_api_ip;
 2361|       |
 2362|  22.5k|    pf_aligned_alloc = ps_create_ip->s_ivd_create_ip_t.pf_aligned_alloc;
 2363|  22.5k|    pv_mem_ctxt = ps_create_ip->s_ivd_create_ip_t.pv_mem_ctxt;
 2364|       |
 2365|  22.5k|    size = ((sizeof(mode_motion_ctxt_t) + 127) >> 7) << 7;
 2366|  22.5k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2367|  22.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  22.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 22.5k]
  |  |  ------------------
  ------------------
 2368|  22.5k|    memset(pv_buf, 0, size);
 2369|  22.5k|    ps_mode_motion = pv_buf;
 2370|       |
 2371|       |    /* motion pred structure */
 2372|  22.5k|    size = 2 * NUM_MB_PARTS * NUM_SUB_MB_PARTS * sizeof(mv_pred_t);
  ------------------
  |  |   59|  22.5k|#define NUM_MB_PARTS 4
  ------------------
                  size = 2 * NUM_MB_PARTS * NUM_SUB_MB_PARTS * sizeof(mv_pred_t);
  ------------------
  |  |   60|  22.5k|#define NUM_SUB_MB_PARTS 4
  ------------------
 2373|  22.5k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2374|  22.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  22.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 22.5k]
  |  |  ------------------
  ------------------
 2375|  22.5k|    memset(pv_buf, 0, size);
 2376|  22.5k|    ps_mode_motion->ps_motion_pred_struct = (mv_pred_t *) pv_buf;
 2377|       |
 2378|       |    /* projected locations X */
 2379|  22.5k|    size = H264_MAX_FRAME_WIDTH * MAX_NUM_RES_LYRS * sizeof(WORD16);
  ------------------
  |  |   39|  22.5k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
                  size = H264_MAX_FRAME_WIDTH * MAX_NUM_RES_LYRS * sizeof(WORD16);
  ------------------
  |  |   94|  22.5k|#define MAX_NUM_RES_LYRS 3
  ------------------
 2380|  22.5k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2381|  22.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  22.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 22.5k]
  |  |  ------------------
  ------------------
 2382|  22.5k|    memset(pv_buf, 0, size);
 2383|  22.5k|    pi2_mem = (WORD16 *) pv_buf;
 2384|       |
 2385|       |    /* loop over NUM resolution layers */
 2386|  90.1k|    for(i4_res_id = 0; i4_res_id < MAX_NUM_RES_LYRS; i4_res_id++)
  ------------------
  |  |   94|  90.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (2386:24): [True: 67.5k, False: 22.5k]
  ------------------
 2387|  67.5k|    {
 2388|  67.5k|        ps_lyr_mem = &ps_mode_motion->as_res_lyr_mem[i4_res_id];
 2389|       |
 2390|       |        /* initialise the pointers */
 2391|  67.5k|        ps_lyr_mem->pi2_ref_loc_x = pi2_mem;
 2392|       |
 2393|       |        /* increment the buffer pointer */
 2394|  67.5k|        pi2_mem += H264_MAX_FRAME_WIDTH;
  ------------------
  |  |   39|  67.5k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
 2395|       |
 2396|  67.5k|    } /* end of loop over num resolution layers */
 2397|       |
 2398|       |    /* projected locations Y */
 2399|  22.5k|    size = H264_MAX_FRAME_HEIGHT * MAX_NUM_RES_LYRS * sizeof(WORD16);
  ------------------
  |  |   40|  22.5k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
                  size = H264_MAX_FRAME_HEIGHT * MAX_NUM_RES_LYRS * sizeof(WORD16);
  ------------------
  |  |   94|  22.5k|#define MAX_NUM_RES_LYRS 3
  ------------------
 2400|  22.5k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2401|  22.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  22.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 22.5k]
  |  |  ------------------
  ------------------
 2402|  22.5k|    memset(pv_buf, 0, size);
 2403|  22.5k|    pi2_mem = (WORD16 *) pv_buf;
 2404|       |    /* loop over NUM resolution layers */
 2405|  90.1k|    for(i4_res_id = 0; i4_res_id < MAX_NUM_RES_LYRS; i4_res_id++)
  ------------------
  |  |   94|  90.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (2405:24): [True: 67.5k, False: 22.5k]
  ------------------
 2406|  67.5k|    {
 2407|  67.5k|        ps_lyr_mem = &ps_mode_motion->as_res_lyr_mem[i4_res_id];
 2408|       |
 2409|       |        /* initialise the pointers */
 2410|  67.5k|        ps_lyr_mem->pi2_ref_loc_y = pi2_mem;
 2411|       |        /* increment the buffer pointer */
 2412|  67.5k|        pi2_mem += H264_MAX_FRAME_HEIGHT;
  ------------------
  |  |   40|  67.5k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
 2413|       |
 2414|  67.5k|    } /* end of loop over num resolution layers */
 2415|       |
 2416|  22.5k|    size = sizeof(ref_lyr_scaled_offset_t) * MAX_NUM_RES_LYRS * MAX_NUM_PIC_BUFS;
  ------------------
  |  |   94|  22.5k|#define MAX_NUM_RES_LYRS 3
  ------------------
                  size = sizeof(ref_lyr_scaled_offset_t) * MAX_NUM_RES_LYRS * MAX_NUM_PIC_BUFS;
  ------------------
  |  |   99|  22.5k|#define MAX_NUM_PIC_BUFS (32 + 1)
  ------------------
 2417|  22.5k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2418|  22.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  22.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 22.5k]
  |  |  ------------------
  ------------------
 2419|  22.5k|    memset(pv_buf, 0, size);
 2420|  22.5k|    ps_svcd_ctxt->pv_ref_lyr_offset = pv_buf;
 2421|       |
 2422|       |    /* loop over NUM resolution layers */
 2423|  22.5k|    ps_ref_pic_offsets = (ref_lyr_scaled_offset_t *) ps_svcd_ctxt->pv_ref_lyr_offset;
 2424|       |
 2425|  90.1k|    for(i4_res_id = 0; i4_res_id < MAX_NUM_RES_LYRS; i4_res_id++)
  ------------------
  |  |   94|  90.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (2425:24): [True: 67.5k, False: 22.5k]
  ------------------
 2426|  67.5k|    {
 2427|  67.5k|        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|  67.5k|        ps_lyr_mem->ps_ref_pic_lyr_offsets = ps_ref_pic_offsets + (i4_res_id * MAX_NUM_PIC_BUFS);
  ------------------
  |  |   99|  67.5k|#define MAX_NUM_PIC_BUFS (32 + 1)
  ------------------
 2431|       |
 2432|  67.5k|    } /* end of loop over num resolution layers */
 2433|       |
 2434|  22.5k|    ps_svcd_ctxt->pv_mode_mv_sample_ctxt = ps_mode_motion;
 2435|       |
 2436|  90.1k|    for(u1_layer_id = 0; u1_layer_id < MAX_NUM_RES_LYRS; u1_layer_id++)
  ------------------
  |  |   94|  90.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (2436:26): [True: 67.5k, False: 22.5k]
  ------------------
 2437|  67.5k|    {
 2438|  67.5k|        ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[u1_layer_id];
 2439|  67.5k|        ps_svc_lyr_dec->pv_mode_mv_sample_ctxt = ps_svcd_ctxt->pv_mode_mv_sample_ctxt;
 2440|  67.5k|        ps_svc_lyr_dec->pv_ref_lyr_offset = ps_svcd_ctxt->pv_ref_lyr_offset;
 2441|  67.5k|    }
 2442|  22.5k|    return IV_SUCCESS;
 2443|  22.5k|}
isvcd_allocate_static_bufs:
 2465|  22.5k|{
 2466|  22.5k|    isvcd_create_ip_t *ps_create_ip;
 2467|  22.5k|    isvcd_create_op_t *ps_create_op;
 2468|  22.5k|    void *pv_buf;
 2469|  22.5k|    UWORD8 *pu1_buf;
 2470|  22.5k|    dec_struct_t *ps_dec;
 2471|  22.5k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 2472|  22.5k|    svc_dec_ctxt_t *ps_svcd_ctxt;
 2473|  22.5k|    void *(*pf_aligned_alloc)(void *pv_mem_ctxt, WORD32 alignment, WORD32 size);
 2474|  22.5k|    void (*pf_aligned_free)(void *pv_mem_ctxt, void *pv_buf);
 2475|  22.5k|    void *pv_mem_ctxt;
 2476|  22.5k|    WORD32 size;
 2477|  22.5k|    UWORD8 u1_layer_id, u1_sps_ctr;
 2478|  22.5k|    UWORD8 u1_chroma_format;
 2479|  22.5k|    WORD32 ret;
 2480|       |
 2481|  22.5k|    ps_create_ip = (isvcd_create_ip_t *) pv_api_ip;
 2482|  22.5k|    ps_create_op = (isvcd_create_op_t *) pv_api_op;
 2483|       |
 2484|  22.5k|    ps_create_op->s_ivd_create_op_t.u4_error_code = 0;
 2485|  22.5k|    pf_aligned_alloc = ps_create_ip->s_ivd_create_ip_t.pf_aligned_alloc;
 2486|  22.5k|    pf_aligned_free = ps_create_ip->s_ivd_create_ip_t.pf_aligned_free;
 2487|  22.5k|    pv_mem_ctxt = ps_create_ip->s_ivd_create_ip_t.pv_mem_ctxt;
 2488|  22.5k|    u1_chroma_format = (UWORD8) (ps_create_ip->s_ivd_create_ip_t.e_output_format);
 2489|       |
 2490|  22.5k|    if((u1_chroma_format != IV_YUV_420P) && (u1_chroma_format != IV_YUV_420SP_UV) &&
  ------------------
  |  Branch (2490:8): [True: 12.9k, False: 9.58k]
  |  Branch (2490:45): [True: 6.08k, False: 6.86k]
  ------------------
 2491|  6.08k|       (u1_chroma_format != IV_YUV_420SP_VU))
  ------------------
  |  Branch (2491:8): [True: 7, False: 6.07k]
  ------------------
 2492|      7|    {
 2493|      7|        ps_create_op->s_ivd_create_op_t.pv_handle = NULL;
 2494|       |
 2495|      7|        return IV_FAIL;
 2496|      7|    }
 2497|       |
 2498|       |    /* Initialize return handle to NULL */
 2499|  22.5k|    ps_create_op->s_ivd_create_op_t.pv_handle = NULL;
 2500|  22.5k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, sizeof(iv_obj_t));
 2501|  22.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  22.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 22.5k]
  |  |  ------------------
  ------------------
 2502|  22.5k|    memset(pv_buf, 0, sizeof(iv_obj_t));
 2503|  22.5k|    *dec_hdl = (iv_obj_t *) pv_buf;
 2504|  22.5k|    ps_create_op->s_ivd_create_op_t.pv_handle = *dec_hdl;
 2505|       |
 2506|  22.5k|    (*dec_hdl)->pv_codec_handle = NULL;
 2507|  22.5k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, sizeof(svc_dec_ctxt_t));
 2508|  22.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  22.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 22.5k]
  |  |  ------------------
  ------------------
 2509|  22.5k|    (*dec_hdl)->pv_codec_handle = (svc_dec_ctxt_t *) pv_buf;
 2510|  22.5k|    ps_svcd_ctxt = (svc_dec_ctxt_t *) pv_buf;
 2511|       |
 2512|  22.5k|    memset(ps_svcd_ctxt, 0, sizeof(svc_dec_ctxt_t));
 2513|       |
 2514|  22.5k|    ps_svcd_ctxt->u1_prev_num_res_layers = UINT8_MAX;
 2515|  22.5k|    ps_svcd_ctxt->u1_pre_parse_in_flush = 1;
 2516|       |    /* set default to maximum values supported */
 2517|  22.5k|    ps_svcd_ctxt->u1_tgt_dep_id = MAX_DEPENDENCY_ID;
  ------------------
  |  |  103|  22.5k|#define MAX_DEPENDENCY_ID 4
  ------------------
 2518|  22.5k|    ps_svcd_ctxt->u1_tgt_quality_id = MAX_QUALITY_ID;
  ------------------
  |  |  102|  22.5k|#define MAX_QUALITY_ID 0
  ------------------
 2519|  22.5k|    ps_svcd_ctxt->u1_tgt_temp_id = MAX_TEMPORAL_ID;
  ------------------
  |  |  104|  22.5k|#define MAX_TEMPORAL_ID 7
  ------------------
 2520|  22.5k|    ps_svcd_ctxt->u1_tgt_priority_id = MAX_PRIORITY_ID;
  ------------------
  |  |  105|  22.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|  22.5k|    size = ((sizeof(dec_seq_params_t)) * MAX_NUM_SEQ_PARAMS * 2);
  ------------------
  |  |  521|  22.5k|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
 2525|  22.5k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2526|  22.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  22.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 22.5k]
  |  |  ------------------
  ------------------
 2527|  22.5k|    memset(pv_buf, 0, size);
 2528|  22.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|  22.5k|    size = ((sizeof(dec_svc_seq_params_t)) * MAX_NUM_SEQ_PARAMS * 2);
  ------------------
  |  |  521|  22.5k|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
 2533|  22.5k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2534|  22.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  22.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 22.5k]
  |  |  ------------------
  ------------------
 2535|  22.5k|    memset(pv_buf, 0, size);
 2536|  22.5k|    ps_svcd_ctxt->ps_subset_sps = pv_buf;
 2537|       |
 2538|  1.46M|    for(u1_sps_ctr = 0; u1_sps_ctr < (2 * MAX_NUM_SEQ_PARAMS); u1_sps_ctr++)
  ------------------
  |  |  521|  1.46M|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
  |  Branch (2538:25): [True: 1.44M, False: 22.5k]
  ------------------
 2539|  1.44M|    {
 2540|  1.44M|        ps_svcd_ctxt->ps_subset_sps[u1_sps_ctr].ps_seq = &ps_svcd_ctxt->ps_sps[u1_sps_ctr];
 2541|  1.44M|    }
 2542|       |
 2543|  22.5k|    size = sizeof(sei);
 2544|  22.5k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2545|  22.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  22.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 22.5k]
  |  |  ------------------
  ------------------
 2546|  22.5k|    memset(pv_buf, 0, size);
 2547|  22.5k|    ps_svcd_ctxt->ps_sei = (sei *) pv_buf;
 2548|       |
 2549|  22.5k|    size = sizeof(sei);
 2550|  22.5k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2551|  22.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  22.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 22.5k]
  |  |  ------------------
  ------------------
 2552|  22.5k|    memset(pv_buf, 0, size);
 2553|  22.5k|    ps_svcd_ctxt->ps_sei_parse = (sei *) pv_buf;
 2554|       |
 2555|  22.5k|    size = (sizeof(dec_pic_params_t)) * MAX_NUM_PIC_PARAMS;
  ------------------
  |  |  524|  22.5k|#define MAX_NUM_PIC_PARAMS 256
  ------------------
 2556|  22.5k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2557|  22.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  22.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 22.5k]
  |  |  ------------------
  ------------------
 2558|  22.5k|    memset(pv_buf, 0, size);
 2559|  22.5k|    ps_svcd_ctxt->ps_pps = pv_buf;
 2560|       |
 2561|  22.5k|    size = (sizeof(svc_dec_lyr_struct_t)) * MAX_NUM_RES_LYRS;
  ------------------
  |  |   94|  22.5k|#define MAX_NUM_RES_LYRS 3
  ------------------
 2562|  22.5k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2563|  22.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  22.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 22.5k]
  |  |  ------------------
  ------------------
 2564|  22.5k|    memset(pv_buf, 0, size);
 2565|  22.5k|    ps_svcd_ctxt->ps_svc_dec_lyr = pv_buf;
 2566|  22.5k|    ps_svcd_ctxt->u1_target_layer_id = 0;
 2567|  22.5k|    ps_svcd_ctxt->u1_cur_layer_id = 0;
 2568|  22.5k|    ps_svcd_ctxt->i4_eos_flag = 0;
 2569|       |
 2570|  22.5k|    ret = isvcd_mode_mv_resample_ctxt_create(ps_svcd_ctxt, pv_api_ip, pv_api_op);
 2571|  22.5k|    if(ret != IV_SUCCESS)
  ------------------
  |  Branch (2571:8): [True: 0, False: 22.5k]
  ------------------
 2572|      0|    {
 2573|      0|        return ret;
 2574|      0|    }
 2575|  22.5k|    ret = isvcd_intra_resample_ctxt_create(ps_svcd_ctxt, pv_api_ip, pv_api_op);
 2576|  22.5k|    if(ret != IV_SUCCESS)
  ------------------
  |  Branch (2576:8): [True: 0, False: 22.5k]
  ------------------
 2577|      0|    {
 2578|      0|        return ret;
 2579|      0|    }
 2580|  22.5k|    ret = isvcd_residual_resample_ctxt_create(ps_svcd_ctxt, pv_api_ip, pv_api_op);
 2581|  22.5k|    if(ret != IV_SUCCESS)
  ------------------
  |  Branch (2581:8): [True: 0, False: 22.5k]
  ------------------
 2582|      0|    {
 2583|      0|        return ret;
 2584|      0|    }
 2585|  22.5k|    ret = isvcd_nal_parse_ctxt_create(ps_svcd_ctxt, pv_api_ip, pv_api_op);
 2586|  22.5k|    if(ret != IV_SUCCESS)
  ------------------
  |  Branch (2586:8): [True: 0, False: 22.5k]
  ------------------
 2587|      0|    {
 2588|      0|        return ret;
 2589|      0|    }
 2590|  90.1k|    for(u1_layer_id = 0; u1_layer_id < MAX_NUM_RES_LYRS; u1_layer_id++)
  ------------------
  |  |   94|  90.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (2590:26): [True: 67.5k, False: 22.5k]
  ------------------
 2591|  67.5k|    {
 2592|  67.5k|        ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[u1_layer_id];
 2593|  67.5k|        ps_dec = &ps_svc_lyr_dec->s_dec;
 2594|       |
 2595|  67.5k|        ps_svc_lyr_dec->ps_svcd_ctxt = ps_svcd_ctxt;
 2596|  67.5k|        ps_svc_lyr_dec->u1_layer_id = u1_layer_id;
 2597|  67.5k|        ps_svc_lyr_dec->u1_dyadic_flag = 1;
 2598|  67.5k|        ps_svc_lyr_dec->u1_restricted_res_change_flag = 1;
 2599|  67.5k|        ps_svc_lyr_dec->u1_base_res_flag = 1;
 2600|  67.5k|        ps_svc_lyr_dec->u1_ref_layer_id = u1_layer_id - 1;
 2601|  67.5k|        ps_svc_lyr_dec->ps_dec_svc_ref_layer =
 2602|  67.5k|            &ps_svcd_ctxt->ps_svc_dec_lyr[ps_svc_lyr_dec->u1_ref_layer_id];
 2603|  67.5k|        ps_svc_lyr_dec->u4_pps_id_for_layer = UINT32_MAX;
 2604|       |
 2605|  67.5k|#ifndef LOGO_EN
 2606|  67.5k|        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|  67.5k|        ps_dec->u1_chroma_format = (UWORD8) (ps_create_ip->s_ivd_create_ip_t.e_output_format);
 2612|       |
 2613|  67.5k|        if((ps_dec->u1_chroma_format != IV_YUV_420P) &&
  ------------------
  |  Branch (2613:12): [True: 38.8k, False: 28.7k]
  ------------------
 2614|  38.8k|           (ps_dec->u1_chroma_format != IV_YUV_420SP_UV) &&
  ------------------
  |  Branch (2614:12): [True: 18.2k, False: 20.5k]
  ------------------
 2615|  18.2k|           (ps_dec->u1_chroma_format != IV_YUV_420SP_VU))
  ------------------
  |  Branch (2615:12): [True: 0, False: 18.2k]
  ------------------
 2616|      0|        {
 2617|      0|            ps_dec->u4_share_disp_buf = 0;
 2618|      0|        }
 2619|       |
 2620|  67.5k|        ps_dec->u1_enable_mb_info = ps_create_ip->u4_enable_frame_info;
 2621|  67.5k|        ps_dec->pf_aligned_alloc = pf_aligned_alloc;
 2622|  67.5k|        ps_dec->pf_aligned_free = pf_aligned_free;
 2623|  67.5k|        ps_dec->pv_mem_ctxt = pv_mem_ctxt;
 2624|       |
 2625|  67.5k|        ps_dec->ps_sps = ps_svcd_ctxt->ps_sps;
 2626|  67.5k|        ps_svc_lyr_dec->ps_subset_sps = ps_svcd_ctxt->ps_subset_sps;
 2627|  67.5k|        ps_dec->ps_pps = ps_svcd_ctxt->ps_pps;
 2628|  67.5k|        ps_dec->ps_sei = ps_svcd_ctxt->ps_sei;
 2629|  67.5k|        ps_dec->ps_sei_parse = ps_svcd_ctxt->ps_sei_parse;
 2630|       |
 2631|  67.5k|        size = ithread_get_handle_size();
 2632|  67.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2633|  67.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  67.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 67.5k]
  |  |  ------------------
  ------------------
 2634|  67.5k|        memset(pv_buf, 0, size);
 2635|  67.5k|        ps_dec->pv_dec_thread_handle = pv_buf;
 2636|       |
 2637|  67.5k|        size = ithread_get_handle_size();
 2638|  67.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2639|  67.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  67.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 67.5k]
  |  |  ------------------
  ------------------
 2640|  67.5k|        memset(pv_buf, 0, size);
 2641|  67.5k|        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|  67.5k|        size = sizeof(dpb_manager_t);
 2692|  67.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2693|  67.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  67.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 67.5k]
  |  |  ------------------
  ------------------
 2694|  67.5k|        memset(pv_buf, 0, size);
 2695|  67.5k|        ps_dec->ps_dpb_mgr = pv_buf;
 2696|       |
 2697|  67.5k|        size = sizeof(pred_info_t) * 2 * 32;
 2698|  67.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2699|  67.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  67.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 67.5k]
  |  |  ------------------
  ------------------
 2700|  67.5k|        memset(pv_buf, 0, size);
 2701|  67.5k|        ps_dec->ps_pred = pv_buf;
 2702|       |
 2703|  67.5k|        size = sizeof(disp_mgr_t);
 2704|  67.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2705|  67.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  67.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 67.5k]
  |  |  ------------------
  ------------------
 2706|  67.5k|        memset(pv_buf, 0, size);
 2707|  67.5k|        ps_dec->pv_disp_buf_mgr = pv_buf;
 2708|       |
 2709|  67.5k|        size = ih264_buf_mgr_size();
 2710|  67.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2711|  67.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  67.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 67.5k]
  |  |  ------------------
  ------------------
 2712|  67.5k|        memset(pv_buf, 0, size);
 2713|  67.5k|        ps_dec->pv_pic_buf_mgr = pv_buf;
 2714|       |
 2715|  67.5k|        size = sizeof(struct pic_buffer_t) * (H264_MAX_REF_PICS * 2);
  ------------------
  |  |  534|  67.5k|#define H264_MAX_REF_PICS         16
  ------------------
 2716|  67.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2717|  67.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  67.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 67.5k]
  |  |  ------------------
  ------------------
 2718|  67.5k|        memset(pv_buf, 0, size);
 2719|  67.5k|        ps_dec->ps_pic_buf_base = pv_buf;
 2720|       |
 2721|  67.5k|        size = sizeof(dec_err_status_t);
 2722|  67.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2723|  67.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  67.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 67.5k]
  |  |  ------------------
  ------------------
 2724|  67.5k|        memset(pv_buf, 0, size);
 2725|  67.5k|        ps_dec->ps_dec_err_status = (dec_err_status_t *) pv_buf;
 2726|       |
 2727|  67.5k|        size = sizeof(dpb_commands_t);
 2728|  67.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2729|  67.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  67.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 67.5k]
  |  |  ------------------
  ------------------
 2730|  67.5k|        memset(pv_buf, 0, size);
 2731|  67.5k|        ps_dec->ps_dpb_cmds = (dpb_commands_t *) pv_buf;
 2732|       |
 2733|  67.5k|        size = sizeof(dec_bit_stream_t);
 2734|  67.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2735|  67.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  67.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 67.5k]
  |  |  ------------------
  ------------------
 2736|  67.5k|        memset(pv_buf, 0, size);
 2737|  67.5k|        ps_dec->ps_bitstrm = (dec_bit_stream_t *) pv_buf;
 2738|       |
 2739|  67.5k|        size = sizeof(dec_nal_unit_svc_ext_params_t);
 2740|  67.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2741|  67.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  67.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 67.5k]
  |  |  ------------------
  ------------------
 2742|  67.5k|        memset(pv_buf, 0, size);
 2743|  67.5k|        ps_svc_lyr_dec->ps_nal_svc_ext = (dec_nal_unit_svc_ext_params_t *) pv_buf;
 2744|       |
 2745|  67.5k|        size = sizeof(dec_slice_params_t);
 2746|  67.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2747|  67.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  67.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 67.5k]
  |  |  ------------------
  ------------------
 2748|  67.5k|        memset(pv_buf, 0, size);
 2749|  67.5k|        ps_dec->ps_cur_slice = (dec_slice_params_t *) pv_buf;
 2750|       |
 2751|  67.5k|        size = MAX(sizeof(dec_seq_params_t), sizeof(dec_pic_params_t));
  ------------------
  |  |   60|  67.5k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 67.5k, Folded]
  |  |  ------------------
  ------------------
 2752|  67.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2753|  67.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  67.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 67.5k]
  |  |  ------------------
  ------------------
 2754|  67.5k|        memset(pv_buf, 0, size);
 2755|  67.5k|        ps_dec->pv_scratch_sps_pps = pv_buf;
 2756|       |
 2757|  67.5k|        size = sizeof(dec_svc_seq_params_t);
 2758|  67.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2759|  67.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  67.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 67.5k]
  |  |  ------------------
  ------------------
 2760|  67.5k|        memset(pv_buf, 0, size);
 2761|  67.5k|        ps_svc_lyr_dec->pv_scratch_subset_sps = pv_buf;
 2762|       |
 2763|  67.5k|        ps_dec->u4_static_bits_buf_size = 256000;
 2764|  67.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, ps_dec->u4_static_bits_buf_size);
 2765|  67.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  67.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 67.5k]
  |  |  ------------------
  ------------------
 2766|  67.5k|        memset(pv_buf, 0, ps_dec->u4_static_bits_buf_size);
 2767|  67.5k|        ps_dec->pu1_bits_buf_static = pv_buf;
 2768|       |
 2769|  67.5k|        size = ((TOTAL_LIST_ENTRIES + PAD_MAP_IDX_POC) * sizeof(void *));
  ------------------
  |  |   95|  67.5k|#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|  67.5k|#define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  600|  67.5k|#define MAX_FRAMES              16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      size = ((TOTAL_LIST_ENTRIES + PAD_MAP_IDX_POC) * sizeof(void *));
  ------------------
  |  |  100|  67.5k|#define PAD_MAP_IDX_POC             (1)
  ------------------
 2770|  67.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2771|  67.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  67.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 67.5k]
  |  |  ------------------
  ------------------
 2772|  67.5k|        ps_dec->ppv_map_ref_idx_to_poc_base = pv_buf;
 2773|  67.5k|        memset(ps_dec->ppv_map_ref_idx_to_poc_base, 0, size);
 2774|       |
 2775|  67.5k|        ps_dec->ppv_map_ref_idx_to_poc = ps_dec->ppv_map_ref_idx_to_poc_base + OFFSET_MAP_IDX_POC;
  ------------------
  |  |  103|  67.5k|#define OFFSET_MAP_IDX_POC          (1)
  ------------------
 2776|       |
 2777|  67.5k|        size = (sizeof(bin_ctxt_model_t) * NUM_CABAC_CTXTS_SVC);
  ------------------
  |  |   46|  67.5k|#define NUM_CABAC_CTXTS_SVC 467
  ------------------
 2778|  67.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2779|  67.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  67.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 67.5k]
  |  |  ------------------
  ------------------
 2780|  67.5k|        memset(pv_buf, 0, size);
 2781|  67.5k|        ps_dec->p_cabac_ctxt_table_t = pv_buf;
 2782|       |
 2783|  67.5k|        size = sizeof(ctxt_inc_mb_info_t);
 2784|  67.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2785|  67.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  67.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 67.5k]
  |  |  ------------------
  ------------------
 2786|  67.5k|        memset(pv_buf, 0, size);
 2787|  67.5k|        ps_dec->ps_left_mb_ctxt_info = pv_buf;
 2788|       |
 2789|  67.5k|        size = MAX_REF_BUF_SIZE * 2;
  ------------------
  |  |   68|  67.5k|#define MAX_REF_BUF_SIZE       (3776*2*2)
  ------------------
 2790|  67.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2791|  67.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  67.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 67.5k]
  |  |  ------------------
  ------------------
 2792|  67.5k|        memset(pv_buf, 0, size);
 2793|  67.5k|        ps_dec->pu1_ref_buff_base = pv_buf;
 2794|  67.5k|        ps_dec->pu1_ref_buff = ps_dec->pu1_ref_buff_base + MAX_REF_BUF_SIZE;
  ------------------
  |  |   68|  67.5k|#define MAX_REF_BUF_SIZE       (3776*2*2)
  ------------------
 2795|       |
 2796|  67.5k|        size = ((sizeof(WORD16)) * PRED_BUFFER_WIDTH * PRED_BUFFER_HEIGHT * 2);
  ------------------
  |  |   55|  67.5k|#define PRED_BUFFER_WIDTH   24*2
  ------------------
                      size = ((sizeof(WORD16)) * PRED_BUFFER_WIDTH * PRED_BUFFER_HEIGHT * 2);
  ------------------
  |  |   56|  67.5k|#define PRED_BUFFER_HEIGHT  24*2
  ------------------
 2797|  67.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2798|  67.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  67.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 67.5k]
  |  |  ------------------
  ------------------
 2799|  67.5k|        memset(pv_buf, 0, size);
 2800|  67.5k|        ps_dec->pi2_pred1 = pv_buf;
 2801|       |
 2802|  67.5k|        size = sizeof(UWORD8) * (MB_LUM_SIZE);
  ------------------
  |  |  563|  67.5k|#define MB_LUM_SIZE                   256
  ------------------
 2803|  67.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2804|  67.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  67.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 67.5k]
  |  |  ------------------
  ------------------
 2805|  67.5k|        memset(pv_buf, 0, size);
 2806|  67.5k|        ps_dec->pu1_temp_mc_buffer = pv_buf;
 2807|       |
 2808|  67.5k|        size = 8 * MAX_REF_BUFS * sizeof(struct pic_buffer_t);
  ------------------
  |  |   75|  67.5k|#define MAX_REF_BUFS    32
  ------------------
 2809|  67.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2810|  67.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  67.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 67.5k]
  |  |  ------------------
  ------------------
 2811|  67.5k|        memset(pv_buf, 0, size);
 2812|       |
 2813|  67.5k|        ps_dec->pu1_init_dpb_base = pv_buf;
 2814|  67.5k|        pu1_buf = pv_buf;
 2815|  67.5k|        ps_dec->ps_dpb_mgr->ps_init_dpb[0][0] = (struct pic_buffer_t *) pu1_buf;
 2816|       |
 2817|  67.5k|        pu1_buf += size / 2;
 2818|  67.5k|        ps_dec->ps_dpb_mgr->ps_init_dpb[1][0] = (struct pic_buffer_t *) pu1_buf;
 2819|       |
 2820|  67.5k|        size = (sizeof(UWORD32) * 2 * 3 * ((MAX_FRAMES << 1) * (MAX_FRAMES << 1)) * 2);
  ------------------
  |  |  600|  67.5k|#define MAX_FRAMES              16
  ------------------
                      size = (sizeof(UWORD32) * 2 * 3 * ((MAX_FRAMES << 1) * (MAX_FRAMES << 1)) * 2);
  ------------------
  |  |  600|  67.5k|#define MAX_FRAMES              16
  ------------------
 2821|  67.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2822|  67.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  67.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 67.5k]
  |  |  ------------------
  ------------------
 2823|  67.5k|        memset(pv_buf, 0, size);
 2824|  67.5k|        ps_dec->pu4_mbaff_wt_mat = pv_buf;
 2825|       |
 2826|  67.5k|        size = sizeof(UWORD32) * 2 * 3 * ((MAX_FRAMES << 1) * (MAX_FRAMES << 1));
  ------------------
  |  |  600|  67.5k|#define MAX_FRAMES              16
  ------------------
                      size = sizeof(UWORD32) * 2 * 3 * ((MAX_FRAMES << 1) * (MAX_FRAMES << 1));
  ------------------
  |  |  600|  67.5k|#define MAX_FRAMES              16
  ------------------
 2827|  67.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2828|  67.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  67.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 67.5k]
  |  |  ------------------
  ------------------
 2829|  67.5k|        memset(pv_buf, 0, size);
 2830|  67.5k|        ps_dec->pu4_wts_ofsts_mat = pv_buf;
 2831|       |
 2832|  67.5k|        size = (sizeof(neighbouradd_t) << 2);
 2833|  67.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2834|  67.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  67.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 67.5k]
  |  |  ------------------
  ------------------
 2835|  67.5k|        memset(pv_buf, 0, size);
 2836|  67.5k|        ps_dec->ps_left_mvpred_addr = pv_buf;
 2837|       |
 2838|  67.5k|        size = ih264_buf_mgr_size();
 2839|  67.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2840|  67.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  67.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 67.5k]
  |  |  ------------------
  ------------------
 2841|  67.5k|        memset(pv_buf, 0, size);
 2842|  67.5k|        ps_dec->pv_mv_buf_mgr = pv_buf;
 2843|       |
 2844|  67.5k|        size = sizeof(col_mv_buf_t) * (H264_MAX_REF_PICS * 2);
  ------------------
  |  |  534|  67.5k|#define H264_MAX_REF_PICS         16
  ------------------
 2845|  67.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2846|  67.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  67.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 67.5k]
  |  |  ------------------
  ------------------
 2847|  67.5k|        ps_dec->ps_col_mv_base = pv_buf;
 2848|  67.5k|        memset(ps_dec->ps_col_mv_base, 0, size);
 2849|       |
 2850|  67.5k|        size = ((MB_SIZE * MB_SIZE * 3) >> 1) + MB_SIZE;
  ------------------
  |  |  554|  67.5k|#define MB_SIZE             16
  ------------------
                      size = ((MB_SIZE * MB_SIZE * 3) >> 1) + MB_SIZE;
  ------------------
  |  |  554|  67.5k|#define MB_SIZE             16
  ------------------
                      size = ((MB_SIZE * MB_SIZE * 3) >> 1) + MB_SIZE;
  ------------------
  |  |  554|  67.5k|#define MB_SIZE             16
  ------------------
 2851|  67.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2852|  67.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  67.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 67.5k]
  |  |  ------------------
  ------------------
 2853|  67.5k|        ps_svc_lyr_dec->pu1_ii_resamp_buffer_luma = pv_buf;
 2854|  67.5k|        ps_svc_lyr_dec->pu1_ii_resamp_buffer_chroma =
 2855|  67.5k|            ps_svc_lyr_dec->pu1_ii_resamp_buffer_luma + (MB_SIZE * MB_SIZE);
  ------------------
  |  |  554|  67.5k|#define MB_SIZE             16
  ------------------
                          ps_svc_lyr_dec->pu1_ii_resamp_buffer_luma + (MB_SIZE * MB_SIZE);
  ------------------
  |  |  554|  67.5k|#define MB_SIZE             16
  ------------------
 2856|  67.5k|        memset(ps_svc_lyr_dec->pu1_ii_resamp_buffer_luma, 0, size);
 2857|       |
 2858|  67.5k|        isvcd_init_decoder(ps_svc_lyr_dec);
 2859|  67.5k|    }
 2860|  22.5k|    return IV_SUCCESS;
 2861|  22.5k|}
isvcd_create:
 2884|  22.5k|{
 2885|  22.5k|    isvcd_create_ip_t *ps_create_ip;
 2886|  22.5k|    isvcd_create_op_t *ps_create_op;
 2887|  22.5k|    WORD32 ret;
 2888|       |
 2889|  22.5k|    ps_create_ip = (isvcd_create_ip_t *) pv_api_ip;
 2890|  22.5k|    ps_create_op = (isvcd_create_op_t *) pv_api_op;
 2891|       |
 2892|  22.5k|    ps_create_op->s_ivd_create_op_t.u4_error_code = 0;
 2893|  22.5k|    dec_hdl = NULL;
 2894|  22.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|  22.5k|    if(IV_FAIL == ret)
  ------------------
  |  Branch (2897:8): [True: 7, False: 22.5k]
  ------------------
 2898|      7|    {
 2899|      7|        if(dec_hdl)
  ------------------
  |  Branch (2899:12): [True: 0, False: 7]
  ------------------
 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|      7|        ps_create_op->s_ivd_create_op_t.u4_error_code = IVD_MEM_ALLOC_FAILED;
 2916|      7|        ps_create_op->s_ivd_create_op_t.u4_error_code |= 1 << IVD_FATALERROR;
 2917|      7|        return IV_FAIL;
 2918|      7|    }
 2919|       |
 2920|  22.5k|    return IV_SUCCESS;
 2921|  22.5k|}
isvcd_update_dqid:
 2951|   229k|{
 2952|   229k|    vcl_node_t *ps_vcl_node;
 2953|       |
 2954|       |    /* sanity checks */
 2955|   229k|    if((NULL == ps_cur_lyr_node) || (NULL == pps_bot_lyr_node))
  ------------------
  |  Branch (2955:8): [True: 0, False: 229k]
  |  Branch (2955:37): [True: 0, False: 229k]
  ------------------
 2956|      0|    {
 2957|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 2958|      0|    }
 2959|       |
 2960|   229k|    ps_vcl_node = ps_cur_lyr_node->ps_bot_node;
 2961|   229k|    while(NULL != ps_vcl_node)
  ------------------
  |  Branch (2961:11): [True: 73.4k, False: 156k]
  ------------------
 2962|  73.4k|    {
 2963|  73.4k|        WORD32 i4_dqid;
 2964|       |
 2965|  73.4k|        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|  73.4k|        if((i4_dqid == i4_ref_lyr_dqid) ||
  ------------------
  |  Branch (2969:12): [True: 63.7k, False: 9.71k]
  ------------------
 2970|  9.71k|           (ps_vcl_node->i4_quality_id < (i4_ref_lyr_dqid & 0x0F)) ||
  ------------------
  |  Branch (2970:12): [True: 9.52k, False: 190]
  ------------------
 2971|    190|           (ps_vcl_node->i4_dependency_id < (i4_ref_lyr_dqid >> 4)))
  ------------------
  |  Branch (2971:12): [True: 90, False: 100]
  ------------------
 2972|  73.3k|        {
 2973|  73.3k|            break;
 2974|  73.3k|        }
 2975|    100|        ps_vcl_node = ps_vcl_node->ps_bot_node;
 2976|    100|    }
 2977|       |
 2978|       |    /* Update the top and bottom node of ref layer and current layer nodes */
 2979|       |
 2980|   229k|    if(NULL != ps_vcl_node)
  ------------------
  |  Branch (2980:8): [True: 73.3k, False: 156k]
  ------------------
 2981|  73.3k|    {
 2982|  73.3k|        ps_cur_lyr_node->ps_bot_node = ps_vcl_node;
 2983|  73.3k|        ps_vcl_node->ps_top_node = ps_cur_lyr_node;
 2984|  73.3k|    }
 2985|       |
 2986|       |    /* Update pointer to bottom VCL node */
 2987|   229k|    *pps_bot_lyr_node = ps_vcl_node;
 2988|   229k|    return (OK);
  ------------------
  |  |  114|   229k|#define OK        0
  ------------------
 2989|   229k|}
isvcd_detect_res_change:
 3017|   229k|{
 3018|   229k|    UWORD16 u2_scaled_ref_width_sps;
 3019|   229k|    UWORD16 u2_scaled_ref_ht_sps;
 3020|   229k|    UNUSED(ps_prev_subset_sps);
  ------------------
  |  |   45|   229k|#define UNUSED(x) ((void)(x))
  ------------------
 3021|       |
 3022|   229k|    if(NULL == ps_prev_sps)
  ------------------
  |  Branch (3022:8): [True: 156k, False: 73.3k]
  ------------------
 3023|   156k|    {
 3024|       |        /* indicates bottom most layer in Access unit */
 3025|   156k|        return (SVCD_FALSE);
  ------------------
  |  |   45|   156k|#define SVCD_FALSE 0
  ------------------
 3026|   156k|    }
 3027|       |    /* Check for the ESS idc */
 3028|  73.3k|    if(2 == ps_curr_subset_sps->s_sps_svc_ext.u1_extended_spatial_scalability_idc)
  ------------------
  |  Branch (3028:8): [True: 353, False: 72.9k]
  ------------------
 3029|    353|    {
 3030|    353|        return (SVCD_TRUE);
  ------------------
  |  |   46|    353|#define SVCD_TRUE 1
  ------------------
 3031|    353|    }
 3032|       |
 3033|       |    /* Calculate the scaled reference width and height */
 3034|  72.9k|    u2_scaled_ref_width_sps = (ps_curr_sps->u2_frm_wd_in_mbs << 4);
 3035|  72.9k|    u2_scaled_ref_width_sps -=
 3036|  72.9k|        (ps_curr_subset_sps->s_sps_svc_ext.i4_seq_scaled_ref_layer_left_offset +
 3037|  72.9k|         ps_curr_subset_sps->s_sps_svc_ext.i4_seq_scaled_ref_layer_right_offset);
 3038|       |
 3039|  72.9k|    u2_scaled_ref_ht_sps = (ps_curr_sps->u2_frm_ht_in_mbs << 4);
 3040|  72.9k|    u2_scaled_ref_ht_sps -=
 3041|  72.9k|        (ps_curr_subset_sps->s_sps_svc_ext.i4_seq_scaled_ref_layer_top_offset +
 3042|  72.9k|         ps_curr_subset_sps->s_sps_svc_ext.i4_seq_scaled_ref_layer_bottom_offset);
 3043|       |
 3044|       |    /* Check for frame width being different */
 3045|  72.9k|    if(u2_scaled_ref_width_sps != (ps_prev_sps->u2_frm_wd_in_mbs << 4))
  ------------------
  |  Branch (3045:8): [True: 51.8k, False: 21.1k]
  ------------------
 3046|  51.8k|    {
 3047|  51.8k|        return (SVCD_TRUE);
  ------------------
  |  |   46|  51.8k|#define SVCD_TRUE 1
  ------------------
 3048|  51.8k|    }
 3049|       |
 3050|       |    /* Check for frame height being different */
 3051|  21.1k|    if(u2_scaled_ref_ht_sps != (ps_prev_sps->u2_frm_ht_in_mbs << 4))
  ------------------
  |  Branch (3051:8): [True: 1.08k, False: 20.0k]
  ------------------
 3052|  1.08k|    {
 3053|  1.08k|        return (SVCD_TRUE);
  ------------------
  |  |   46|  1.08k|#define SVCD_TRUE 1
  ------------------
 3054|  1.08k|    }
 3055|       |
 3056|       |    /* check for crop offset not MB aligned */
 3057|  20.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: 20.0k]
  ------------------
 3058|  20.0k|       (0 != (ps_curr_subset_sps->s_sps_svc_ext.i4_seq_scaled_ref_layer_top_offset & 15)))
  ------------------
  |  Branch (3058:8): [True: 0, False: 20.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|  20.0k|    if(ps_curr_subset_sps->s_sps_svc_ext.u1_chroma_phase_x_plus1_flag !=
  ------------------
  |  Branch (3064:8): [True: 949, False: 19.0k]
  ------------------
 3065|  20.0k|       ps_curr_subset_sps->s_sps_svc_ext.u1_seq_ref_layer_chroma_phase_x_plus1_flag)
 3066|    949|    {
 3067|    949|        return (SVCD_TRUE);
  ------------------
  |  |   46|    949|#define SVCD_TRUE 1
  ------------------
 3068|    949|    }
 3069|       |
 3070|       |    /* check for chroma Phase Y being different */
 3071|  19.0k|    if(ps_curr_subset_sps->s_sps_svc_ext.u1_chroma_phase_y_plus1 !=
  ------------------
  |  Branch (3071:8): [True: 154, False: 18.9k]
  ------------------
 3072|  19.0k|       ps_curr_subset_sps->s_sps_svc_ext.u1_seq_ref_layer_chroma_phase_y_plus1)
 3073|    154|    {
 3074|    154|        return (SVCD_TRUE);
  ------------------
  |  |   46|    154|#define SVCD_TRUE 1
  ------------------
 3075|    154|    }
 3076|       |
 3077|       |    /* If none of the above are true then there is no resolution change */
 3078|  18.9k|    return (SVCD_FALSE);
  ------------------
  |  |   45|  18.9k|#define SVCD_FALSE 0
  ------------------
 3079|  19.0k|}
isvcd_parse_ref_pic_list_modify:
 3107|  46.9k|{
 3108|  46.9k|    WORD32 i4_mod_flag;
 3109|  46.9k|    UWORD16 ui_nextUev;
 3110|  46.9k|    WORD32 i4_num_sets_ctr = 0;
 3111|  46.9k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
 3112|  46.9k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
 3113|       |
 3114|  46.9k|    if(I_SLICE != ps_slice_prms->u1_slice_type)
  ------------------
  |  |  370|  46.9k|#define I_SLICE  2
  ------------------
  |  Branch (3114:8): [True: 37.7k, False: 9.24k]
  ------------------
 3115|  37.7k|    {
 3116|       |        /* ref_pic_list_modification_flag_l0 */
 3117|  37.7k|        i4_mod_flag = ih264d_get_bit_h264(ps_bitstrm);
 3118|       |
 3119|  37.7k|        if(0 != i4_mod_flag)
  ------------------
  |  Branch (3119:12): [True: 14.9k, False: 22.7k]
  ------------------
 3120|  14.9k|        {
 3121|  14.9k|            WORD32 i4_mod_pic_num_idc;
 3122|       |
 3123|  14.9k|            i4_num_sets_ctr = 0;
 3124|  14.9k|            do
 3125|   103k|            {
 3126|       |                /* modification_of_pic_nums_idc */
 3127|   103k|                i4_mod_pic_num_idc = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3128|       |
 3129|   103k|                if((i4_mod_pic_num_idc > 3) || (i4_mod_pic_num_idc < 0))
  ------------------
  |  Branch (3129:20): [True: 7.54k, False: 96.1k]
  |  Branch (3129:48): [True: 300, False: 95.8k]
  ------------------
 3130|  7.84k|                {
 3131|  7.84k|                    return ERROR_INV_SLICE_HDR_T;
 3132|  7.84k|                }
 3133|  95.8k|                if(3 != i4_mod_pic_num_idc)
  ------------------
  |  Branch (3133:20): [True: 93.8k, False: 1.93k]
  ------------------
 3134|  93.8k|                {
 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|  93.8k|                    ui_nextUev = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3139|  93.8k|                    if(ui_nextUev > (ps_curr_sps->u2_u4_max_pic_num_minus1 + 1))
  ------------------
  |  Branch (3139:24): [True: 1.64k, False: 92.2k]
  ------------------
 3140|  1.64k|                        return ERROR_INV_SLICE_HDR_T;
 3141|  93.8k|                }
 3142|       |
 3143|  94.1k|                i4_num_sets_ctr++;
 3144|       |
 3145|       |                /* if the number of commands recieved exceeds max limit */
 3146|  94.1k|                if((H264_MAX_REF_PICS) == i4_num_sets_ctr) break;
  ------------------
  |  |  534|  94.1k|#define H264_MAX_REF_PICS         16
  ------------------
  |  Branch (3146:20): [True: 3.54k, False: 90.6k]
  ------------------
 3147|       |
 3148|  94.1k|            } while(3 != i4_mod_pic_num_idc);
  ------------------
  |  Branch (3148:21): [True: 88.7k, False: 1.91k]
  ------------------
 3149|  14.9k|        }
 3150|       |
 3151|       |        /*********** if (I_SLICE != u1_slice_type) ***************************/
 3152|  37.7k|    }
 3153|       |
 3154|  37.4k|    if(B_SLICE != ps_slice_prms->u1_slice_type)
  ------------------
  |  |  369|  37.4k|#define B_SLICE  1
  ------------------
  |  Branch (3154:8): [True: 25.2k, False: 12.2k]
  ------------------
 3155|  25.2k|    {
 3156|  25.2k|        return (OK);
  ------------------
  |  |  114|  25.2k|#define OK        0
  ------------------
 3157|  25.2k|    }
 3158|       |
 3159|       |    /* ref_pic_list_modification_flag_l1 */
 3160|  12.2k|    i4_mod_flag = ih264d_get_bit_h264(ps_bitstrm);
 3161|       |
 3162|  12.2k|    if(0 != i4_mod_flag)
  ------------------
  |  Branch (3162:8): [True: 3.88k, False: 8.36k]
  ------------------
 3163|  3.88k|    {
 3164|  3.88k|        WORD32 i4_mod_pic_num_idc;
 3165|       |
 3166|  3.88k|        do
 3167|   176k|        {
 3168|       |            /* modification_of_pic_nums_idc */
 3169|   176k|            i4_mod_pic_num_idc = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3170|       |
 3171|   176k|            if((i4_mod_pic_num_idc > 3) || (i4_mod_pic_num_idc < 0))
  ------------------
  |  Branch (3171:16): [True: 2.95k, False: 173k]
  |  Branch (3171:44): [True: 59, False: 173k]
  ------------------
 3172|  3.01k|            {
 3173|  3.01k|                return ERROR_INV_SLICE_HDR_T;
 3174|  3.01k|            }
 3175|   173k|            if(3 != i4_mod_pic_num_idc)
  ------------------
  |  Branch (3175:16): [True: 172k, False: 202]
  ------------------
 3176|   172k|            {
 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|   172k|                ui_nextUev = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3181|   172k|                if(ui_nextUev > (ps_curr_sps->u2_u4_max_pic_num_minus1 + 1))
  ------------------
  |  Branch (3181:20): [True: 574, False: 172k]
  ------------------
 3182|    574|                    return ERROR_INV_SLICE_HDR_T;
 3183|   172k|            }
 3184|       |
 3185|   172k|            i4_num_sets_ctr++;
 3186|       |
 3187|       |            /* if the number of commands recieved exceeds max limit */
 3188|   172k|            if((H264_MAX_REF_PICS) == i4_num_sets_ctr) break;
  ------------------
  |  |  534|   172k|#define H264_MAX_REF_PICS         16
  ------------------
  |  Branch (3188:16): [True: 98, False: 172k]
  ------------------
 3189|       |
 3190|   172k|        } while(3 != i4_mod_pic_num_idc);
  ------------------
  |  Branch (3190:17): [True: 172k, False: 201]
  ------------------
 3191|  3.88k|    }
 3192|       |
 3193|  8.66k|    return (OK);
  ------------------
  |  |  114|  8.66k|#define OK        0
  ------------------
 3194|  12.2k|}
isvcd_parse_slice_hdr_refdq_id:
 3228|  55.5k|{
 3229|  55.5k|    UWORD8 u1_pps_id;
 3230|  55.5k|    WORD32 i_temp;
 3231|  55.5k|    UWORD32 u4_temp;
 3232|  55.5k|    WORD32 i4_nal_unit_type;
 3233|  55.5k|    WORD32 i4_nal_ref_idc, i4_quality_id;
 3234|  55.5k|    WORD32 i4_use_ref_base, i4_idr_pic_flag;
 3235|  55.5k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
 3236|  55.5k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
 3237|  55.5k|    dec_svc_seq_params_t *ps_subset_sps = NULL;
 3238|  55.5k|    WORD32 ret = OK;
  ------------------
  |  |  114|  55.5k|#define OK        0
  ------------------
 3239|       |
 3240|  55.5k|    i4_nal_unit_type = ps_vcl_node->i4_nal_unit_type;
 3241|  55.5k|    i4_nal_ref_idc = ps_vcl_node->i4_nal_ref_idc;
 3242|  55.5k|    i4_quality_id = ps_vcl_node->i4_quality_id;
 3243|  55.5k|    i4_use_ref_base = ps_vcl_node->i4_use_ref_base;
 3244|  55.5k|    i4_idr_pic_flag = ps_vcl_node->i4_idr_pic_flag;
 3245|       |
 3246|       |    /*-----------------------------------------------------------------------*/
 3247|       |    /*--------------------- first mb in slice -------------------------------*/
 3248|       |    /*-----------------------------------------------------------------------*/
 3249|  55.5k|    ps_slice_prms->u2_first_mb_in_slice = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3250|       |
 3251|       |    /*-----------------------------------------------------------------------*/
 3252|       |    /*---------------------------- slice type -------------------------------*/
 3253|       |    /*-----------------------------------------------------------------------*/
 3254|  55.5k|    ps_slice_prms->u1_slice_type = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3255|  55.5k|    if(ps_slice_prms->u1_slice_type > 4)
  ------------------
  |  Branch (3255:8): [True: 2.12k, False: 53.3k]
  ------------------
 3256|  2.12k|    {
 3257|  2.12k|        ps_slice_prms->u1_slice_type -= 5;
 3258|  2.12k|    }
 3259|       |
 3260|       |    /*-----------------------------------------------------------------------*/
 3261|       |    /*----------------------------- PPS id ----------------------------------*/
 3262|       |    /*-----------------------------------------------------------------------*/
 3263|  55.5k|    u1_pps_id = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3264|       |
 3265|       |    /* set correspoding sps and pps id also */
 3266|  55.5k|    ps_pps += u1_pps_id;
 3267|  55.5k|    if(FALSE == ps_pps->u1_is_valid)
  ------------------
  |  |  592|  55.5k|#define FALSE   0
  ------------------
  |  Branch (3267:8): [True: 2.70k, False: 52.8k]
  ------------------
 3268|  2.70k|    {
 3269|  2.70k|        return ERROR_INV_SLICE_HDR_T;
 3270|  2.70k|    }
 3271|  52.8k|    ps_sps = ps_pps->ps_sps;
 3272|  52.8k|    ps_subset_sps = &ps_svcd_ctxt->ps_subset_sps[ps_sps->u1_seq_parameter_set_id];
 3273|  52.8k|    if(CODED_SLICE_EXTENSION_NAL == i4_nal_unit_type)
  ------------------
  |  |   66|  52.8k|#define CODED_SLICE_EXTENSION_NAL 20
  ------------------
  |  Branch (3273:8): [True: 51.8k, False: 903]
  ------------------
 3274|  51.8k|    {
 3275|  51.8k|        ps_sps += MAX_NUM_SEQ_PARAMS;
  ------------------
  |  |  521|  51.8k|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
 3276|  51.8k|        ps_subset_sps =
 3277|  51.8k|            &ps_svcd_ctxt->ps_subset_sps[MAX_NUM_SEQ_PARAMS + ps_sps->u1_seq_parameter_set_id];
  ------------------
  |  |  521|  51.8k|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
 3278|  51.8k|    }
 3279|       |    /*-----------------------------------------------------------------------*/
 3280|       |    /*--------------------------- frm num -----------------------------------*/
 3281|       |    /*-----------------------------------------------------------------------*/
 3282|  52.8k|    if(!ps_sps) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (3282:8): [True: 0, False: 52.8k]
  ------------------
 3283|  52.8k|    if(FALSE == ps_sps->u1_is_valid) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  |  592|  52.8k|#define FALSE   0
  ------------------
  |  Branch (3283:8): [True: 2.49k, False: 50.3k]
  ------------------
 3284|       |
 3285|  50.3k|    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|  50.3k|    if(SVCD_TRUE != ps_sps->u1_frame_mbs_only_flag)
  ------------------
  |  |   46|  50.3k|#define SVCD_TRUE 1
  ------------------
  |  Branch (3290:8): [True: 397, False: 49.9k]
  ------------------
 3291|    397|    {
 3292|    397|        return ERROR_INV_SLICE_HDR_T;
 3293|    397|    }
 3294|       |    /*-----------------------------------------------------------------------*/
 3295|       |    /*--------------------------- IDR pic id --------------------------------*/
 3296|       |    /*-----------------------------------------------------------------------*/
 3297|  49.9k|    if(SVCD_TRUE == i4_idr_pic_flag)
  ------------------
  |  |   46|  49.9k|#define SVCD_TRUE 1
  ------------------
  |  Branch (3297:8): [True: 41.8k, False: 8.04k]
  ------------------
 3298|  41.8k|    {
 3299|  41.8k|        UWORD32 u4_idr_pic_id = 0;
 3300|  41.8k|        u4_idr_pic_id = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3301|  41.8k|        if(u4_idr_pic_id > 65535) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (3301:12): [True: 1.18k, False: 40.6k]
  ------------------
 3302|  41.8k|    }
 3303|       |
 3304|       |    /*-----------------------------------------------------------------------*/
 3305|       |    /*----------------- poc lsb and delts_poc_bottom ------------------------*/
 3306|       |    /*-----------------------------------------------------------------------*/
 3307|  48.7k|    if(0 == ps_sps->u1_pic_order_cnt_type)
  ------------------
  |  Branch (3307:8): [True: 44.1k, False: 4.61k]
  ------------------
 3308|  44.1k|    {
 3309|  44.1k|        i_temp = ih264d_get_bits_h264(ps_bitstrm, ps_sps->u1_log2_max_pic_order_cnt_lsb_minus);
 3310|       |
 3311|  44.1k|        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: 44.1k]
  |  Branch (3311:26): [True: 0, False: 44.1k]
  ------------------
 3312|  44.1k|        if(SVCD_TRUE == ps_pps->u1_pic_order_present_flag)
  ------------------
  |  |   46|  44.1k|#define SVCD_TRUE 1
  ------------------
  |  Branch (3312:12): [True: 7.53k, False: 36.5k]
  ------------------
 3313|  7.53k|        {
 3314|  7.53k|            i_temp = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3315|  7.53k|        }
 3316|  44.1k|    }
 3317|       |
 3318|       |    /*-----------------------------------------------------------------------*/
 3319|       |    /*---------------- delta_poc_count[0] and [1] ---------------------------*/
 3320|       |    /*-----------------------------------------------------------------------*/
 3321|  48.7k|    if((1 == ps_sps->u1_pic_order_cnt_type) && (!ps_sps->u1_delta_pic_order_always_zero_flag))
  ------------------
  |  Branch (3321:8): [True: 3.91k, False: 44.8k]
  |  Branch (3321:48): [True: 3.04k, False: 868]
  ------------------
 3322|  3.04k|    {
 3323|  3.04k|        i_temp = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3324|       |
 3325|  3.04k|        if(ps_pps->u1_pic_order_present_flag)
  ------------------
  |  Branch (3325:12): [True: 1.62k, False: 1.41k]
  ------------------
 3326|  1.62k|        {
 3327|  1.62k|            i_temp = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3328|  1.62k|        }
 3329|  3.04k|    }
 3330|       |
 3331|       |    /*-----------------------------------------------------------------------*/
 3332|       |    /*---------------------- redundant pic cnt ------------------------------*/
 3333|       |    /*-----------------------------------------------------------------------*/
 3334|  48.7k|    if(ps_pps->u1_redundant_pic_cnt_present_flag)
  ------------------
  |  Branch (3334:8): [True: 18.7k, False: 29.9k]
  ------------------
 3335|  18.7k|    {
 3336|  18.7k|        u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3337|  18.7k|        if(u4_temp > MAX_REDUNDANT_PIC_CNT) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  |  611|  18.7k|#define MAX_REDUNDANT_PIC_CNT       127
  ------------------
  |  Branch (3337:12): [True: 916, False: 17.8k]
  ------------------
 3338|  18.7k|    }
 3339|       |    /*-----------------------------------------------------------------------*/
 3340|       |    /*-----------------Direct_spatial_mv_pred_flag --------------------------*/
 3341|       |    /*-----------------num ref active override flag -------------------------*/
 3342|       |    /*-----------------num_ref_idx_active_l0&1 ------------------------------*/
 3343|       |    /*-----------------------------------------------------------------------*/
 3344|  47.8k|    if(0 == i4_quality_id)
  ------------------
  |  Branch (3344:8): [True: 47.8k, False: 0]
  ------------------
 3345|  47.8k|    {
 3346|  47.8k|        if(B_SLICE == ps_slice_prms->u1_slice_type)
  ------------------
  |  |  369|  47.8k|#define B_SLICE  1
  ------------------
  |  Branch (3346:12): [True: 17.1k, False: 30.6k]
  ------------------
 3347|  17.1k|        {
 3348|  17.1k|            ps_slice_prms->u1_direct_spatial_mv_pred_flag = ih264d_get_bit_h264(ps_bitstrm);
 3349|  17.1k|        }
 3350|       |
 3351|  47.8k|        if((P_SLICE == ps_slice_prms->u1_slice_type) || (B_SLICE == ps_slice_prms->u1_slice_type))
  ------------------
  |  |  368|  47.8k|#define P_SLICE  0
  ------------------
                      if((P_SLICE == ps_slice_prms->u1_slice_type) || (B_SLICE == ps_slice_prms->u1_slice_type))
  ------------------
  |  |  369|  26.9k|#define B_SLICE  1
  ------------------
  |  Branch (3351:12): [True: 20.8k, False: 26.9k]
  |  Branch (3351:57): [True: 17.1k, False: 9.74k]
  ------------------
 3352|  38.0k|        {
 3353|  38.0k|            WORD8 i1_over_ride_flag;
 3354|  38.0k|            i1_over_ride_flag = ih264d_get_bit_h264(ps_bitstrm);
 3355|       |
 3356|  38.0k|            ps_slice_prms->u1_num_ref_idx_active_override_flag = i1_over_ride_flag;
 3357|       |
 3358|  38.0k|            if(SVCD_TRUE == i1_over_ride_flag)
  ------------------
  |  |   46|  38.0k|#define SVCD_TRUE 1
  ------------------
  |  Branch (3358:16): [True: 21.2k, False: 16.8k]
  ------------------
 3359|  21.2k|            {
 3360|  21.2k|                UWORD8 u8_ref_idx_l0;
 3361|  21.2k|                u8_ref_idx_l0 = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3362|  21.2k|                if(u8_ref_idx_l0 > H264_MAX_REF_PICS)
  ------------------
  |  |  534|  21.2k|#define H264_MAX_REF_PICS         16
  ------------------
  |  Branch (3362:20): [True: 523, False: 20.7k]
  ------------------
 3363|    523|                {
 3364|    523|                    return ERROR_NUM_REF;
 3365|    523|                }
 3366|  20.7k|                if(B_SLICE == ps_slice_prms->u1_slice_type)
  ------------------
  |  |  369|  20.7k|#define B_SLICE  1
  ------------------
  |  Branch (3366:20): [True: 8.61k, False: 12.0k]
  ------------------
 3367|  8.61k|                {
 3368|  8.61k|                    UWORD8 u8_ref_idx_l1;
 3369|  8.61k|                    u8_ref_idx_l1 = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3370|  8.61k|                    if(u8_ref_idx_l1 > H264_MAX_REF_PICS)
  ------------------
  |  |  534|  8.61k|#define H264_MAX_REF_PICS         16
  ------------------
  |  Branch (3370:24): [True: 308, False: 8.30k]
  ------------------
 3371|    308|                    {
 3372|    308|                        return ERROR_NUM_REF;
 3373|    308|                    }
 3374|  8.61k|                }
 3375|  20.7k|            }
 3376|  38.0k|        }
 3377|       |
 3378|       |        /*-----------------------------------------------------------------------*/
 3379|       |        /*---------------------- ref pic list modification ----------------------*/
 3380|       |        /*-----------------------------------------------------------------------*/
 3381|  46.9k|        {
 3382|  46.9k|            ret = isvcd_parse_ref_pic_list_modify(ps_bitstrm, ps_slice_prms, ps_sps);
 3383|  46.9k|            if(OK != ret) return ret;
  ------------------
  |  |  114|  46.9k|#define OK        0
  ------------------
  |  Branch (3383:16): [True: 13.0k, False: 33.8k]
  ------------------
 3384|  46.9k|        }
 3385|       |
 3386|  33.8k|        if(((1 == ps_pps->u1_wted_pred_flag) && (P_SLICE == ps_slice_prms->u1_slice_type)) ||
  ------------------
  |  |  368|  7.06k|#define P_SLICE  0
  ------------------
  |  Branch (3386:13): [True: 7.06k, False: 26.8k]
  |  Branch (3386:49): [True: 2.44k, False: 4.61k]
  ------------------
 3387|  31.4k|           ((B_SLICE == ps_slice_prms->u1_slice_type) && (1 == ps_pps->u1_wted_bipred_idc)))
  ------------------
  |  |  369|  31.4k|#define B_SLICE  1
  ------------------
  |  Branch (3387:13): [True: 8.66k, False: 22.7k]
  |  Branch (3387:58): [True: 4.03k, False: 4.62k]
  ------------------
 3388|  6.48k|        {
 3389|  6.48k|            if((ps_slice_prms->u1_num_ref_idx_lx_active[0] >= H264_MAX_REF_IDX) ||
  ------------------
  |  |  535|  6.48k|#define H264_MAX_REF_IDX          32
  ------------------
  |  Branch (3389:16): [True: 0, False: 6.48k]
  ------------------
 3390|  6.48k|               (ps_slice_prms->u1_num_ref_idx_lx_active[1] >= H264_MAX_REF_IDX))
  ------------------
  |  |  535|  6.48k|#define H264_MAX_REF_IDX          32
  ------------------
  |  Branch (3390:16): [True: 0, False: 6.48k]
  ------------------
 3391|      0|            {
 3392|      0|                return ERROR_NUM_REF;
 3393|      0|            }
 3394|       |            /*-------------------------------------------------------------------*/
 3395|       |            /*------------------------- Pred weight table -----------------------*/
 3396|       |            /*-------------------------------------------------------------------*/
 3397|  6.48k|            if(CODED_SLICE_EXTENSION_NAL == i4_nal_unit_type)
  ------------------
  |  |   66|  6.48k|#define CODED_SLICE_EXTENSION_NAL 20
  ------------------
  |  Branch (3397:16): [True: 6.28k, False: 195]
  ------------------
 3398|  6.28k|            {
 3399|  6.28k|                WORD32 i4_base_pred_wt_tbl_flag = 1;
 3400|       |
 3401|       |                /* base_pred_weight_table_flag */
 3402|  6.28k|                if(0 == i4_no_int_lyr_pred)
  ------------------
  |  Branch (3402:20): [True: 6.21k, False: 75]
  ------------------
 3403|  6.21k|                {
 3404|  6.21k|                    i4_base_pred_wt_tbl_flag = ih264d_get_bit_h264(ps_bitstrm);
 3405|  6.21k|                }
 3406|       |
 3407|  6.28k|                if((1 == i4_no_int_lyr_pred) || (0 == i4_base_pred_wt_tbl_flag))
  ------------------
  |  Branch (3407:20): [True: 75, False: 6.21k]
  |  Branch (3407:49): [True: 5.16k, False: 1.04k]
  ------------------
 3408|  5.24k|                {
 3409|  5.24k|                    ret = ih264d_parse_pred_weight_table(ps_slice_prms, ps_bitstrm);
 3410|  5.24k|                    if(ret != OK) return ret;
  ------------------
  |  |  114|  5.24k|#define OK        0
  ------------------
  |  Branch (3410:24): [True: 2.58k, False: 2.65k]
  ------------------
 3411|  5.24k|                }
 3412|  6.28k|            }
 3413|    195|            else
 3414|    195|            {
 3415|    195|                ret = ih264d_parse_pred_weight_table(ps_slice_prms, ps_bitstrm);
 3416|    195|                if(ret != OK) return ret;
  ------------------
  |  |  114|    195|#define OK        0
  ------------------
  |  Branch (3416:20): [True: 105, False: 90]
  ------------------
 3417|    195|            }
 3418|  6.48k|        }
 3419|       |
 3420|       |        /*-----------------------------------------------------------------------*/
 3421|       |        /*------------------------- ref pic marking -----------------------------*/
 3422|       |        /*-----------------------------------------------------------------------*/
 3423|  31.2k|        if(0 != i4_nal_ref_idc)
  ------------------
  |  Branch (3423:12): [True: 26.5k, False: 4.63k]
  ------------------
 3424|  26.5k|        {
 3425|  26.5k|            dec_struct_t *ps_dec;
 3426|  26.5k|            svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 3427|  26.5k|            UWORD8 u1_store_ref_base_pic;
 3428|  26.5k|            ps_svc_lyr_dec = ps_svcd_ctxt->ps_svc_dec_lyr;
 3429|  26.5k|            ps_dec = &ps_svc_lyr_dec->s_dec;
 3430|  26.5k|            {
 3431|  26.5k|                dec_seq_params_t *ps_sps_tmp = ps_pps->ps_sps;
 3432|       |
 3433|  26.5k|                ps_dec->u1_nal_unit_type = i4_nal_unit_type;
 3434|  26.5k|                ps_svc_lyr_dec->ps_nal_svc_ext->u1_idr_flag = i4_idr_pic_flag;
 3435|  26.5k|                ps_dec->ps_cur_sps = ps_sps;
 3436|  26.5k|                ps_dec->ps_cur_pps = ps_pps;
 3437|  26.5k|                ps_pps->ps_sps = ps_sps;
 3438|       |
 3439|  26.5k|                if(ps_svc_lyr_dec->ps_nal_svc_ext->u1_idr_flag)
  ------------------
  |  Branch (3439:20): [True: 20.8k, False: 5.69k]
  ------------------
 3440|  20.8k|                    ps_dec->u1_nal_unit_type = IDR_SLICE_NAL;
  ------------------
  |  |  328|  20.8k|#define IDR_SLICE_NAL                   5
  ------------------
 3441|       |
 3442|  26.5k|                i_temp = ih264d_read_mmco_commands(ps_dec);
 3443|  26.5k|                ps_pps->ps_sps = ps_sps_tmp;
 3444|  26.5k|                ps_dec->u1_nal_unit_type = i4_nal_unit_type;
 3445|  26.5k|                if(i_temp < 0)
  ------------------
  |  Branch (3445:20): [True: 218, False: 26.3k]
  ------------------
 3446|    218|                {
 3447|    218|                    return ERROR_DBP_MANAGER_T;
 3448|    218|                }
 3449|  26.3k|                ps_dec->u4_bitoffset = i_temp;
 3450|  26.3k|            }
 3451|       |
 3452|  26.3k|            if(0 == ps_subset_sps->s_sps_svc_ext.u1_slice_header_restriction_flag)
  ------------------
  |  Branch (3452:16): [True: 19.3k, False: 7.04k]
  ------------------
 3453|  19.3k|            {
 3454|       |                /* store_ref_base_pic_flag */
 3455|  19.3k|                u1_store_ref_base_pic = ih264d_get_bit_h264(ps_bitstrm);
 3456|  19.3k|                if(0 != u1_store_ref_base_pic)
  ------------------
  |  Branch (3456:20): [True: 4.42k, False: 14.8k]
  ------------------
 3457|  4.42k|                {
 3458|  4.42k|                    return ERROR_INV_SLICE_HDR_T;
 3459|  4.42k|                }
 3460|       |
 3461|  14.8k|                if(((1 == i4_use_ref_base) || (1 == u1_store_ref_base_pic)) &&
  ------------------
  |  Branch (3461:21): [True: 0, False: 14.8k]
  |  Branch (3461:47): [True: 0, False: 14.8k]
  ------------------
 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|  14.8k|            }
 3474|       |            /******** End of if(0 != i4_nal_ref_idc) *************************/
 3475|  26.3k|        }
 3476|       |        /************* End of if(0 == i4_quality_id) *************************/
 3477|  31.2k|    }
 3478|       |
 3479|       |    /*-----------------------------------------------------------------------*/
 3480|       |    /*--------------------------- cabac int idc -----------------------------*/
 3481|       |    /*-----------------------------------------------------------------------*/
 3482|  26.5k|    if((ps_pps->u1_entropy_coding_mode == CABAC) && (I_SLICE != ps_slice_prms->u1_slice_type))
  ------------------
  |  |  339|  26.5k|#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: 21.2k]
  |  Branch (3482:53): [True: 3.06k, False: 2.20k]
  ------------------
 3483|  3.06k|    {
 3484|  3.06k|        ps_slice_prms->u1_cabac_init_idc = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3485|  3.06k|        if(ps_slice_prms->u1_cabac_init_idc > MAX_CABAC_INIT_IDC)
  ------------------
  |  |  537|  3.06k|#define MAX_CABAC_INIT_IDC        2
  ------------------
  |  Branch (3485:12): [True: 2.13k, False: 930]
  ------------------
 3486|  2.13k|        {
 3487|  2.13k|            return ERROR_INV_SLICE_HDR_T;
 3488|  2.13k|        }
 3489|  3.06k|    }
 3490|       |
 3491|       |    /*-----------------------------------------------------------------------*/
 3492|       |    /*--------------------------- slice qp delta ----------------------------*/
 3493|       |    /*-----------------------------------------------------------------------*/
 3494|  24.4k|    {
 3495|  24.4k|        WORD8 i1_slice_qp_delta;
 3496|  24.4k|        i1_slice_qp_delta = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3497|  24.4k|        i1_slice_qp_delta += ps_pps->u1_pic_init_qp;
 3498|  24.4k|        if((i1_slice_qp_delta < MIN_H264_QP) || (i1_slice_qp_delta > MAX_H264_QP))
  ------------------
  |  |  629|  24.4k|#define MIN_H264_QP 0
  ------------------
                      if((i1_slice_qp_delta < MIN_H264_QP) || (i1_slice_qp_delta > MAX_H264_QP))
  ------------------
  |  |  634|  23.2k|#define MAX_H264_QP 51
  ------------------
  |  Branch (3498:12): [True: 1.18k, False: 23.2k]
  |  Branch (3498:49): [True: 623, False: 22.6k]
  ------------------
 3499|  1.81k|        {
 3500|  1.81k|            return ERROR_INV_RANGE_QP_T;
 3501|  1.81k|        }
 3502|  22.6k|        ps_slice_prms->u1_slice_qp = (UWORD8) i1_slice_qp_delta;
 3503|  22.6k|    }
 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|  22.6k|    if(SVCD_TRUE == ps_pps->u1_deblocking_filter_parameters_present_flag)
  ------------------
  |  |   46|  22.6k|#define SVCD_TRUE 1
  ------------------
  |  Branch (3511:8): [True: 11.9k, False: 10.6k]
  ------------------
 3512|  11.9k|    {
 3513|  11.9k|        ps_slice_prms->u1_disable_dblk_filter_idc = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3514|       |
 3515|  11.9k|        if(ps_slice_prms->u1_disable_dblk_filter_idc > SLICE_BOUNDARY_DBLK_DISABLED)
  ------------------
  |  |  547|  11.9k|#define SLICE_BOUNDARY_DBLK_DISABLED  2
  ------------------
  |  Branch (3515:12): [True: 2.98k, False: 8.96k]
  ------------------
 3516|  2.98k|        {
 3517|  2.98k|            return ERROR_INV_SLICE_HDR_T;
 3518|  2.98k|        }
 3519|       |        /*-------------------------------------------------------------------*/
 3520|       |        /*--------------------------- slice_alpha_c0_offset_div2 ------------*/
 3521|       |        /*--------------------------- slice_beta_offset_div2 ----------------*/
 3522|       |        /*-------------------------------------------------------------------*/
 3523|  8.96k|        if(1 != ps_slice_prms->u1_disable_dblk_filter_idc)
  ------------------
  |  Branch (3523:12): [True: 7.18k, False: 1.77k]
  ------------------
 3524|  7.18k|        {
 3525|       |            /* slice_alpha_c0_offset_div2 */
 3526|  7.18k|            ps_slice_prms->i1_slice_alpha_c0_offset = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3527|  7.18k|            if((MIN_DBLK_FIL_OFF > ps_slice_prms->i1_slice_alpha_c0_offset) ||
  ------------------
  |  |  550|  7.18k|#define MIN_DBLK_FIL_OFF              -12
  ------------------
  |  Branch (3527:16): [True: 224, False: 6.95k]
  ------------------
 3528|  6.95k|               (ps_slice_prms->i1_slice_alpha_c0_offset > MAX_DBLK_FIL_OFF))
  ------------------
  |  |  551|  6.95k|#define MAX_DBLK_FIL_OFF              12
  ------------------
  |  Branch (3528:16): [True: 164, False: 6.79k]
  ------------------
 3529|    388|            {
 3530|    388|                return ERROR_INV_SLICE_HDR_T;
 3531|    388|            }
 3532|  6.79k|            ps_slice_prms->i1_slice_beta_offset = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3533|  6.79k|            if((MIN_DBLK_FIL_OFF > ps_slice_prms->i1_slice_beta_offset) ||
  ------------------
  |  |  550|  6.79k|#define MIN_DBLK_FIL_OFF              -12
  ------------------
  |  Branch (3533:16): [True: 158, False: 6.63k]
  ------------------
 3534|  6.63k|               (ps_slice_prms->i1_slice_beta_offset > MAX_DBLK_FIL_OFF))
  ------------------
  |  |  551|  6.63k|#define MAX_DBLK_FIL_OFF              12
  ------------------
  |  Branch (3534:16): [True: 230, False: 6.40k]
  ------------------
 3535|    388|            {
 3536|    388|                return ERROR_INV_SLICE_HDR_T;
 3537|    388|            }
 3538|  6.79k|        }
 3539|  8.96k|    }
 3540|       |
 3541|  18.8k|    *pi4_ref_dq_id = -1;
 3542|       |
 3543|  18.8k|    if((0 == i4_no_int_lyr_pred) && (0 == i4_quality_id))
  ------------------
  |  Branch (3543:8): [True: 18.5k, False: 311]
  |  Branch (3543:37): [True: 18.5k, False: 0]
  ------------------
 3544|  18.5k|    {
 3545|  18.5k|        WORD32 i4_inter_lyr_dblk_idc;
 3546|  18.5k|        WORD32 i4_inter_lyr_alpha_c0_offset;
 3547|  18.5k|        WORD32 i4_inter_lyr_beta_offset;
 3548|       |
 3549|       |        /*-------------------------------------------------------------------*/
 3550|       |        /*--------------------------- ref_layer_dq_id -----------------------*/
 3551|       |        /*-------------------------------------------------------------------*/
 3552|  18.5k|        *pi4_ref_dq_id = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3553|       |
 3554|  18.5k|        if(*pi4_ref_dq_id > MAX_REF_DEP_ID)
  ------------------
  |  |  106|  18.5k|#define MAX_REF_DEP_ID ((MAX_DEPENDENCY_ID << 4) | MAX_QUALITY_ID)
  |  |  ------------------
  |  |  |  |  103|  18.5k|#define MAX_DEPENDENCY_ID 4
  |  |  ------------------
  |  |               #define MAX_REF_DEP_ID ((MAX_DEPENDENCY_ID << 4) | MAX_QUALITY_ID)
  |  |  ------------------
  |  |  |  |  102|  18.5k|#define MAX_QUALITY_ID 0
  |  |  ------------------
  ------------------
  |  Branch (3554:12): [True: 1.56k, False: 16.9k]
  ------------------
 3555|  1.56k|        {
 3556|  1.56k|            return ERROR_INV_SLICE_HDR_T;
 3557|  1.56k|        }
 3558|       |        /* ------------------------------------------- */
 3559|       |        /* ---- Inter layer de-blocking parameters ---- */
 3560|       |        /* ------------------------------------------- */
 3561|  16.9k|        i4_inter_lyr_dblk_idc = 0;
 3562|  16.9k|        i4_inter_lyr_alpha_c0_offset = 0;
 3563|  16.9k|        i4_inter_lyr_beta_offset = 0;
 3564|  16.9k|        if(SVCD_TRUE ==
  ------------------
  |  |   46|  16.9k|#define SVCD_TRUE 1
  ------------------
  |  Branch (3564:12): [True: 2.80k, False: 14.1k]
  ------------------
 3565|  16.9k|           ps_subset_sps->s_sps_svc_ext.u1_inter_layer_deblocking_filter_control_present_flag)
 3566|  2.80k|        {
 3567|  2.80k|            i4_inter_lyr_dblk_idc = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3568|       |
 3569|  2.80k|            if(i4_inter_lyr_dblk_idc > 6)
  ------------------
  |  Branch (3569:16): [True: 431, False: 2.37k]
  ------------------
 3570|    431|            {
 3571|    431|                return ERROR_INV_SLICE_HDR_T;
 3572|    431|            }
 3573|  2.37k|            if(1 != i4_inter_lyr_dblk_idc)
  ------------------
  |  Branch (3573:16): [True: 1.90k, False: 469]
  ------------------
 3574|  1.90k|            {
 3575|       |                /* Alpha Offset */
 3576|  1.90k|                i4_inter_lyr_alpha_c0_offset = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3577|  1.90k|                if(i4_inter_lyr_alpha_c0_offset > 6 || i4_inter_lyr_alpha_c0_offset < -6)
  ------------------
  |  Branch (3577:20): [True: 200, False: 1.70k]
  |  Branch (3577:56): [True: 185, False: 1.51k]
  ------------------
 3578|    385|                {
 3579|    385|                    return ERROR_INV_SLICE_HDR_T;
 3580|    385|                }
 3581|  1.51k|                i4_inter_lyr_alpha_c0_offset <<= 1;
 3582|       |
 3583|       |                /* Beta Offset */
 3584|  1.51k|                i4_inter_lyr_beta_offset = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3585|  1.51k|                if(i4_inter_lyr_beta_offset > 6 || i4_inter_lyr_beta_offset < -6)
  ------------------
  |  Branch (3585:20): [True: 375, False: 1.14k]
  |  Branch (3585:52): [True: 146, False: 995]
  ------------------
 3586|    521|                {
 3587|    521|                    return ERROR_INV_SLICE_HDR_T;
 3588|    521|                }
 3589|    995|                i4_inter_lyr_beta_offset <<= 1;
 3590|    995|            }
 3591|  2.37k|        }
 3592|  15.6k|        ps_vcl_node->i4_inter_lyr_dblk_idc = i4_inter_lyr_dblk_idc;
 3593|  15.6k|        ps_vcl_node->i4_inter_lyr_beta_offset = i4_inter_lyr_beta_offset;
 3594|  15.6k|        ps_vcl_node->i4_inter_lyr_alpha_c0_offset = i4_inter_lyr_alpha_c0_offset;
 3595|  15.6k|    }
 3596|       |
 3597|  15.9k|    return (0);
 3598|  18.8k|}
isvcd_get_ref_lyr_dqid:
 3631|  80.0k|{
 3632|  80.0k|    WORD32 i4_status;
 3633|  80.0k|    WORD32 ai4_ref_dq_id[2] = {0};
 3634|  80.0k|    WORD32 i4_num_slc_dec;
 3635|       |
 3636|       |    /* local structures */
 3637|  80.0k|    dec_slice_params_t s_slice_prms = {0};
 3638|       |
 3639|       |    /* vcl buffer */
 3640|  80.0k|    vcl_buf_hdr_t *ps_vcl_buf;
 3641|  80.0k|    dec_struct_t *ps_dec;
 3642|  80.0k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec = ps_svcd_ctxt->ps_svc_dec_lyr;
 3643|  80.0k|    UNUSED(i4_prev_au_dqid);
  ------------------
  |  |   45|  80.0k|#define UNUSED(x) ((void)(x))
  ------------------
 3644|  80.0k|    ps_dec = &ps_svc_lyr_dec->s_dec;
 3645|       |    /* Sanity checks */
 3646|  80.0k|    if((NULL == ps_vcl_node) || (NULL == ps_sps) || (NULL == ps_pps) || (NULL == pi4_ref_lyr_dqid))
  ------------------
  |  Branch (3646:8): [True: 0, False: 80.0k]
  |  Branch (3646:33): [True: 0, False: 80.0k]
  |  Branch (3646:53): [True: 0, False: 80.0k]
  |  Branch (3646:73): [True: 0, False: 80.0k]
  ------------------
 3647|      0|    {
 3648|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 3649|      0|    }
 3650|       |
 3651|  80.0k|    i4_num_slc_dec = 0;
 3652|  80.0k|    ps_vcl_buf = ps_vcl_node->ps_first_vcl_nal;
 3653|  80.0k|    i4_status = NOT_OK;
  ------------------
  |  |  116|  80.0k|#define NOT_OK    -1
  ------------------
 3654|       |
 3655|  80.0k|    while(NULL != ps_vcl_buf)
  ------------------
  |  Branch (3655:11): [True: 55.5k, False: 24.5k]
  ------------------
 3656|  55.5k|    {
 3657|  55.5k|        WORD32 i4_error;
 3658|       |
 3659|       |        /* Fill the stream context structure */
 3660|  55.5k|        ps_dec->ps_bitstrm->u4_ofst = 0;
 3661|  55.5k|        ps_dec->ps_bitstrm->pu4_buffer =
 3662|  55.5k|            (UWORD32 *) ((UWORD8 *) ps_vcl_buf + ps_vcl_buf->i4_buf_offset +
 3663|  55.5k|                         ps_vcl_buf->i4_slice_offset);
 3664|  55.5k|        ps_dec->ps_bitstrm->u4_max_ofst = ps_vcl_buf->u4_max_bits;
 3665|       |
 3666|       |        /* call the function which decodes the slice header */
 3667|  55.5k|        i4_error = isvcd_parse_slice_hdr_refdq_id(ps_vcl_node, &s_slice_prms, ps_dec->ps_bitstrm,
 3668|  55.5k|                                                  &ai4_ref_dq_id[i4_num_slc_dec], ps_sps, ps_pps,
 3669|  55.5k|                                                  ps_vcl_buf->i4_no_int_lyr_pred, ps_svcd_ctxt);
 3670|       |
 3671|       |        /* store the first error encountered */
 3672|  55.5k|        if(0 == *pi4_err_code)
  ------------------
  |  Branch (3672:12): [True: 13.9k, False: 41.5k]
  ------------------
 3673|  13.9k|        {
 3674|  13.9k|            *pi4_err_code = i4_error;
 3675|  13.9k|        }
 3676|  55.5k|        if(i4_error != 0)
  ------------------
  |  Branch (3676:12): [True: 39.5k, False: 15.9k]
  ------------------
 3677|  39.5k|        {
 3678|       |            /* check on the Error returned */
 3679|  39.5k|            return NOT_OK;
  ------------------
  |  |  116|  39.5k|#define NOT_OK    -1
  ------------------
 3680|  39.5k|        }
 3681|       |
 3682|       |        /* set the return status */
 3683|  15.9k|        i4_status = OK;
  ------------------
  |  |  114|  15.9k|#define OK        0
  ------------------
 3684|  15.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|  40.5k|    *pi4_ref_lyr_dqid = ai4_ref_dq_id[0];
 3692|       |
 3693|  40.5k|    return (i4_status);
 3694|  80.0k|}
isvcd_conceal_node_params:
 3719|  73.5k|{
 3720|  73.5k|    vcl_node_t *ps_node;
 3721|  73.5k|    WORD32 i4_conceal_lyrs;
 3722|  73.5k|    WORD32 i4_no_gaps_flag;
 3723|       |
 3724|       |    /* get the bottom node */
 3725|  73.5k|    ps_node = ps_vcl_nal->ps_bot_node;
 3726|  73.5k|    i4_conceal_lyrs = SVCD_FALSE;
  ------------------
  |  |   45|  73.5k|#define SVCD_FALSE 0
  ------------------
 3727|  73.5k|    i4_no_gaps_flag = SVCD_FALSE;
  ------------------
  |  |   45|  73.5k|#define SVCD_FALSE 0
  ------------------
 3728|       |
 3729|       |    /* loop over all nodes present in the current AU */
 3730|   220k|    while(NULL != ps_node)
  ------------------
  |  Branch (3730:11): [True: 147k, False: 73.5k]
  ------------------
 3731|   147k|    {
 3732|   147k|        WORD32 i4_dep_id = 0;
 3733|   147k|        WORD32 i4_qua_id = 0;
 3734|   147k|        UWORD16 u2_frm_num_dep = 0;
 3735|   147k|        WORD32 i4_idr_pic_flag = 0;
 3736|   147k|        WORD32 i4_idr_pic_num = 0;
 3737|   147k|        WORD32 i4_nal_ref_idc = 0;
 3738|   147k|        WORD32 i4_poc_syntax = 0;
 3739|   147k|        WORD32 i4_qua_zero_lyr_sts = 0;
 3740|       |
 3741|   147k|        i4_dep_id = ps_node->i4_dependency_id;
 3742|   147k|        i4_qua_id = ps_node->i4_quality_id;
 3743|       |
 3744|       |        /* reset the quality 0 layer updated status */
 3745|   147k|        if(0 == i4_qua_id)
  ------------------
  |  Branch (3745:12): [True: 147k, False: 0]
  ------------------
 3746|   147k|        {
 3747|   147k|            i4_qua_zero_lyr_sts = SVCD_FALSE;
  ------------------
  |  |   45|   147k|#define SVCD_FALSE 0
  ------------------
 3748|   147k|        }
 3749|       |
 3750|       |        /* process the quality id 0 layers */
 3751|   147k|        if((0 == i4_qua_id) && (NULL != ps_node->ps_first_vcl_nal))
  ------------------
  |  Branch (3751:12): [True: 147k, False: 0]
  |  Branch (3751:32): [True: 118k, False: 28.8k]
  ------------------
 3752|   118k|        {
 3753|       |            /* if current and previous are reference pictures */
 3754|   118k|            if((0 != ps_prev_au_prms[i4_dep_id].i4_nal_ref_id) && (0 != ps_node->i4_nal_ref_idc))
  ------------------
  |  Branch (3754:16): [True: 91.5k, False: 26.7k]
  |  Branch (3754:67): [True: 84.9k, False: 6.54k]
  ------------------
 3755|  84.9k|            {
 3756|  84.9k|                if(ps_prev_au_prms[i4_dep_id].u2_frm_num == ps_node->u2_frm_num)
  ------------------
  |  Branch (3756:20): [True: 25.1k, False: 59.7k]
  ------------------
 3757|  25.1k|                {
 3758|       |                    /* frame number is concealed */
 3759|  25.1k|                    ps_node->u2_frm_num++;
 3760|  25.1k|                    i4_conceal_lyrs = SVCD_TRUE;
  ------------------
  |  |   46|  25.1k|#define SVCD_TRUE 1
  ------------------
 3761|  25.1k|                }
 3762|  59.7k|                else if((SVCD_TRUE == i4_conceal_lyrs) || (SVCD_TRUE == i4_no_gaps_flag))
  ------------------
  |  |   46|  59.7k|#define SVCD_TRUE 1
  ------------------
                              else if((SVCD_TRUE == i4_conceal_lyrs) || (SVCD_TRUE == i4_no_gaps_flag))
  ------------------
  |  |   46|  50.5k|#define SVCD_TRUE 1
  ------------------
  |  Branch (3762:25): [True: 9.19k, False: 50.5k]
  |  Branch (3762:59): [True: 6.02k, False: 44.5k]
  ------------------
 3763|  15.2k|                {
 3764|       |                    /* if the current au frm_num is less than prev */
 3765|       |                    /* or the difference is greater than 1         */
 3766|  15.2k|                    if((ps_prev_au_prms[i4_dep_id].u2_frm_num > ps_node->u2_frm_num) ||
  ------------------
  |  Branch (3766:24): [True: 496, False: 14.7k]
  ------------------
 3767|  14.7k|                       ((ps_node->u2_frm_num - ps_prev_au_prms[i4_dep_id].u2_frm_num) > 1))
  ------------------
  |  Branch (3767:24): [True: 14.5k, False: 120]
  ------------------
 3768|  15.0k|                    {
 3769|       |                        /* frame number is concealed */
 3770|  15.0k|                        ps_node->u2_frm_num = ps_prev_au_prms[i4_dep_id].u2_frm_num + 1;
 3771|  15.0k|                    }
 3772|  15.2k|                }
 3773|       |
 3774|       |                /* set the no gaps flag */
 3775|  84.9k|                if(1 == (ps_node->u2_frm_num - ps_prev_au_prms[i4_dep_id].u2_frm_num))
  ------------------
  |  Branch (3775:20): [True: 55.3k, False: 29.5k]
  ------------------
 3776|  55.3k|                {
 3777|  55.3k|                    i4_no_gaps_flag = SVCD_TRUE;
  ------------------
  |  |   46|  55.3k|#define SVCD_TRUE 1
  ------------------
 3778|  55.3k|                }
 3779|  84.9k|            }
 3780|       |
 3781|       |            /* store the final frame number */
 3782|   118k|            u2_frm_num_dep = ps_node->u2_frm_num;
 3783|   118k|            i4_idr_pic_flag = ps_node->i4_idr_pic_flag;
 3784|   118k|            i4_idr_pic_num = ps_node->i4_idr_pic_num;
 3785|   118k|            i4_nal_ref_idc = ps_node->i4_nal_ref_idc;
 3786|   118k|            i4_poc_syntax = ps_node->i4_poc_syntax;
 3787|   118k|            i4_qua_zero_lyr_sts = SVCD_TRUE;
  ------------------
  |  |   46|   118k|#define SVCD_TRUE 1
  ------------------
 3788|   118k|        }
 3789|  28.8k|        else
 3790|  28.8k|        {
 3791|  28.8k|            if(SVCD_TRUE == i4_qua_zero_lyr_sts)
  ------------------
  |  |   46|  28.8k|#define SVCD_TRUE 1
  ------------------
  |  Branch (3791:16): [True: 0, False: 28.8k]
  ------------------
 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|  28.8k|        }
 3802|       |
 3803|       |        /* get the upper node pointer */
 3804|   147k|        ps_node = ps_node->ps_top_node;
 3805|   147k|    }
 3806|  73.5k|}
isvcd_refine_dep_list:
 3840|   158k|{
 3841|   158k|    vcl_nal_t *ps_vcl_nal;
 3842|   158k|    vcl_node_t *ps_vcl_node;
 3843|   158k|    WORD32 i4_idr_pic_flag;
 3844|   158k|    WORD32 i4_nal_ref_idc;
 3845|   158k|    WORD32 i4_idr_pic_num;
 3846|   158k|    WORD32 i4_num_res_lyrs_bup;
 3847|   158k|    WORD32 i4_restore_prms_flag;
 3848|   158k|    vcl_node_t *ps_node_bup;
 3849|   158k|    WORD32 ai4_dep_id[MAX_NUM_RES_LYRS] = {0};
 3850|       |
 3851|       |    /* used for checking the init prms */
 3852|   158k|    dec_seq_params_t *ps_sps_tgt_minus1_lyr = NULL;
 3853|   158k|    dec_seq_params_t *ps_sps_tgt_minus2_lyr = NULL;
 3854|   158k|    UNUSED(pi4_err_code);
  ------------------
  |  |   45|   158k|#define UNUSED(x) ((void)(x))
  ------------------
 3855|       |    /* sanity checks */
 3856|   158k|    if((NULL == pv_out_vcl_ctxt) || (NULL == ps_sps) || (NULL == ps_pps))
  ------------------
  |  Branch (3856:8): [True: 0, False: 158k]
  |  Branch (3856:37): [True: 0, False: 158k]
  |  Branch (3856:57): [True: 0, False: 158k]
  ------------------
 3857|      0|    {
 3858|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 3859|      0|    }
 3860|       |
 3861|   158k|    ps_vcl_nal = (vcl_nal_t *) pv_out_vcl_ctxt;
 3862|       |
 3863|       |    /*  no node is present */
 3864|   158k|    if(NULL == ps_vcl_nal->ps_bot_node)
  ------------------
  |  Branch (3864:8): [True: 1.55k, False: 156k]
  ------------------
 3865|  1.55k|    {
 3866|  1.55k|        return (NOT_OK);
  ------------------
  |  |  116|  1.55k|#define NOT_OK    -1
  ------------------
 3867|  1.55k|    }
 3868|       |
 3869|       |    /* set the single layer flag if top node and bottom node are same */
 3870|   156k|    if((ps_vcl_nal->ps_bot_node == ps_vcl_nal->ps_top_node) &&
  ------------------
  |  Branch (3870:8): [True: 83.2k, False: 73.5k]
  ------------------
 3871|  83.2k|       (0 == ps_vcl_nal->ps_bot_node->i4_dependency_id))
  ------------------
  |  Branch (3871:8): [True: 83.2k, False: 0]
  ------------------
 3872|  83.2k|    {
 3873|  83.2k|    }
 3874|  73.5k|    else
 3875|  73.5k|    {
 3876|       |        /* call the function which corrects the frame number of each node */
 3877|       |        /* based on previous access unit frame number                     */
 3878|  73.5k|        isvcd_conceal_node_params(ps_vcl_nal, ps_prev_au_prms);
 3879|  73.5k|    }
 3880|       |    /* get the top most node */
 3881|   156k|    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|   156k|    {
 3886|   156k|        vcl_node_t *ps_node;
 3887|   156k|        WORD32 i4_node_present_flag;
 3888|       |
 3889|   156k|        ps_node = ps_vcl_node;
 3890|   156k|        i4_node_present_flag = SVCD_FALSE;
  ------------------
  |  |   45|   156k|#define SVCD_FALSE 0
  ------------------
 3891|       |
 3892|       |        /* store default values */
 3893|   156k|        i4_idr_pic_flag = SVCD_FALSE;
  ------------------
  |  |   45|   156k|#define SVCD_FALSE 0
  ------------------
 3894|   156k|        i4_nal_ref_idc = 0;
 3895|   156k|        i4_idr_pic_num = 0;
 3896|       |
 3897|       |        /* loop until valid node */
 3898|   159k|        while(NULL != ps_node)
  ------------------
  |  Branch (3898:15): [True: 159k, False: 569]
  ------------------
 3899|   159k|        {
 3900|   159k|            if(NULL != ps_node->ps_first_vcl_nal)
  ------------------
  |  Branch (3900:16): [True: 131k, False: 27.8k]
  ------------------
 3901|   131k|            {
 3902|   131k|                i4_idr_pic_flag = ps_node->i4_idr_pic_flag;
 3903|   131k|                i4_nal_ref_idc = ps_node->i4_nal_ref_idc;
 3904|   131k|                i4_idr_pic_num = ps_node->i4_idr_pic_num;
 3905|   131k|                i4_node_present_flag = SVCD_TRUE;
  ------------------
  |  |   46|   131k|#define SVCD_TRUE 1
  ------------------
 3906|   131k|                break;
 3907|   131k|            }
 3908|  27.8k|            else if(SVCD_TRUE == ps_node->i4_idr_pic_flag)
  ------------------
  |  |   46|  27.8k|#define SVCD_TRUE 1
  ------------------
  |  Branch (3908:21): [True: 25.1k, False: 2.74k]
  ------------------
 3909|  25.1k|            {
 3910|  25.1k|                i4_idr_pic_flag = ps_node->i4_idr_pic_flag;
 3911|  25.1k|                i4_nal_ref_idc = ps_node->i4_nal_ref_idc;
 3912|  25.1k|                i4_idr_pic_num = ps_node->i4_idr_pic_num;
 3913|  25.1k|                i4_node_present_flag = SVCD_TRUE;
  ------------------
  |  |   46|  25.1k|#define SVCD_TRUE 1
  ------------------
 3914|  25.1k|                break;
 3915|  25.1k|            }
 3916|       |            /* point to next node */
 3917|  2.74k|            ps_node = ps_node->ps_bot_node;
 3918|  2.74k|        }
 3919|       |
 3920|       |        /* alteast one node should be present */
 3921|   156k|        if(SVCD_FALSE == i4_node_present_flag)
  ------------------
  |  |   45|   156k|#define SVCD_FALSE 0
  ------------------
  |  Branch (3921:12): [True: 569, False: 156k]
  ------------------
 3922|    569|        {
 3923|    569|            return (NOT_OK);
  ------------------
  |  |  116|    569|#define NOT_OK    -1
  ------------------
 3924|    569|        }
 3925|   156k|    }
 3926|       |
 3927|       |    /* initially the access unit is considered to have a single resolution */
 3928|   156k|    ai4_dep_id[0] = 0;
 3929|   156k|    ps_vcl_nal->i4_num_res_lyrs = 1;
 3930|   156k|    i4_restore_prms_flag = SVCD_FALSE;
  ------------------
  |  |   45|   156k|#define SVCD_FALSE 0
  ------------------
 3931|       |
 3932|       |    /*-----------------------------------------------------------------------*/
 3933|       |    /* loop until all the nodes are processed                                */
 3934|       |    /*-----------------------------------------------------------------------*/
 3935|   385k|    while(NULL != ps_vcl_node)
  ------------------
  |  Branch (3935:11): [True: 229k, False: 156k]
  ------------------
 3936|   229k|    {
 3937|   229k|        WORD32 i4_ref_lyr_dqid, i4_status;
 3938|   229k|        vcl_node_t *ps_bot_vcl_node;
 3939|   229k|        WORD32 i4_res_chnge_flag = SVCD_FALSE;
  ------------------
  |  |   45|   229k|#define SVCD_FALSE 0
  ------------------
 3940|   229k|        WORD32 i4_dep_id, i4_qua_id;
 3941|   229k|        WORD32 i4_prev_sps_pps_valid;
 3942|   229k|        WORD32 i4_prev_au_prms_valid;
 3943|       |
 3944|       |        /* set the reference layer DQID to -1 */
 3945|   229k|        i4_ref_lyr_dqid = -1;
 3946|       |
 3947|       |        /* get the current layer dependency and quality id */
 3948|   229k|        i4_dep_id = ps_vcl_node->i4_dependency_id;
 3949|   229k|        i4_qua_id = ps_vcl_node->i4_quality_id;
 3950|       |
 3951|       |        /* get the valid status of prev access unit params */
 3952|   229k|        i4_prev_au_prms_valid = ps_prev_au_prms[i4_dep_id].i4_updated_sts;
 3953|   229k|        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|   229k|        if(NULL == ps_vcl_node->ps_first_vcl_nal)
  ------------------
  |  Branch (3956:12): [True: 31.3k, False: 198k]
  ------------------
 3957|  31.3k|        {
 3958|       |            /* store the params appropriately */
 3959|  31.3k|            ps_vcl_node->i4_idr_pic_flag = i4_idr_pic_flag;
 3960|  31.3k|            ps_vcl_node->i4_nal_ref_idc = i4_nal_ref_idc;
 3961|  31.3k|            ps_vcl_node->i4_idr_pic_num = i4_idr_pic_num;
 3962|  31.3k|            ps_vcl_node->i4_num_slices = 0;
 3963|  31.3k|            ps_vcl_node->i4_use_ref_base = 0;
 3964|  31.3k|            ps_vcl_node->i4_temporal_id = 0;
 3965|       |
 3966|  31.3k|            if((0 != i4_dep_id) || (0 != i4_qua_id))
  ------------------
  |  Branch (3966:16): [True: 24.5k, False: 6.80k]
  |  Branch (3966:36): [True: 0, False: 6.80k]
  ------------------
 3967|  24.5k|            {
 3968|  24.5k|                ps_vcl_node->i4_nal_unit_type = CODED_SLICE_EXTENSION_NAL;
  ------------------
  |  |   66|  24.5k|#define CODED_SLICE_EXTENSION_NAL 20
  ------------------
 3969|  24.5k|                ps_vcl_node->u1_acc_no_int_pred = 0;
 3970|  24.5k|            }
 3971|  6.80k|            else if(SVCD_TRUE == i4_idr_pic_flag)
  ------------------
  |  |   46|  6.80k|#define SVCD_TRUE 1
  ------------------
  |  Branch (3971:21): [True: 5.69k, False: 1.10k]
  ------------------
 3972|  5.69k|            {
 3973|  5.69k|                ps_vcl_node->i4_nal_unit_type = IDR_SLICE_NAL;
  ------------------
  |  |  328|  5.69k|#define IDR_SLICE_NAL                   5
  ------------------
 3974|  5.69k|                ps_vcl_node->u1_acc_no_int_pred = 1;
 3975|  5.69k|            }
 3976|  1.10k|            else
 3977|  1.10k|            {
 3978|  1.10k|                ps_vcl_node->i4_nal_unit_type = SLICE_NAL;
  ------------------
  |  |  324|  1.10k|#define SLICE_NAL                       1
  ------------------
 3979|  1.10k|                ps_vcl_node->u1_acc_no_int_pred = 1;
 3980|  1.10k|            }
 3981|       |
 3982|  31.3k|            if(SVCD_FALSE == i4_idr_pic_flag)
  ------------------
  |  |   45|  31.3k|#define SVCD_FALSE 0
  ------------------
  |  Branch (3982:16): [True: 2.17k, False: 29.2k]
  ------------------
 3983|  2.17k|            {
 3984|       |                /* pick the other params form previous access unit */
 3985|  2.17k|                if(SVCD_TRUE == i4_prev_sps_pps_valid)
  ------------------
  |  |   46|  2.17k|#define SVCD_TRUE 1
  ------------------
  |  Branch (3985:20): [True: 2.17k, False: 0]
  ------------------
 3986|  2.17k|                {
 3987|  2.17k|                    ps_vcl_node->u1_pps_id =
 3988|  2.17k|                        ps_pps_sps_prev[(i4_dep_id << 4) + i4_qua_id].u1_pps_id;
 3989|       |
 3990|  2.17k|                    ps_vcl_node->u1_sps_id =
 3991|  2.17k|                        ps_pps_sps_prev[(i4_dep_id << 4) + i4_qua_id].u1_sps_id;
 3992|  2.17k|                }
 3993|       |
 3994|  2.17k|                if(SVCD_TRUE == i4_prev_au_prms_valid)
  ------------------
  |  |   46|  2.17k|#define SVCD_TRUE 1
  ------------------
  |  Branch (3994:20): [True: 2.16k, False: 7]
  ------------------
 3995|  2.16k|                {
 3996|  2.16k|                    if(0 == ps_vcl_node->i4_nal_ref_idc)
  ------------------
  |  Branch (3996:24): [True: 478, False: 1.69k]
  ------------------
 3997|    478|                    {
 3998|    478|                        ps_vcl_node->u2_frm_num = ps_prev_au_prms[i4_dep_id].u2_frm_num;
 3999|    478|                    }
 4000|  1.69k|                    else
 4001|  1.69k|                    {
 4002|  1.69k|                        ps_vcl_node->u2_frm_num = ps_prev_au_prms[i4_dep_id].u2_frm_num + 1;
 4003|  1.69k|                    }
 4004|  2.16k|                }
 4005|  2.17k|            }
 4006|  31.3k|        }
 4007|       |
 4008|       |        /* SPS id cannot change unless its an IDR pic */
 4009|   229k|        if(SVCD_FALSE == ps_vcl_node->i4_idr_pic_flag)
  ------------------
  |  |   45|   229k|#define SVCD_FALSE 0
  ------------------
  |  Branch (4009:12): [True: 41.1k, False: 188k]
  ------------------
 4010|  41.1k|        {
 4011|  41.1k|            if(SVCD_TRUE == i4_prev_sps_pps_valid)
  ------------------
  |  |   46|  41.1k|#define SVCD_TRUE 1
  ------------------
  |  Branch (4011:16): [True: 41.1k, False: 65]
  ------------------
 4012|  41.1k|            {
 4013|       |                /* store the SPS id of the current layer */
 4014|  41.1k|                ps_vcl_node->u1_sps_id = ps_pps_sps_prev[(i4_dep_id << 4) + i4_qua_id].u1_sps_id;
 4015|  41.1k|            }
 4016|  41.1k|        }
 4017|       |
 4018|       |        /* store the PPS id and SPS id of the current layer */
 4019|   229k|        ps_pps_sps_prev[(i4_dep_id << 4) + i4_qua_id].u1_pps_id = ps_vcl_node->u1_pps_id;
 4020|   229k|        ps_pps_sps_prev[(i4_dep_id << 4) + i4_qua_id].u1_sps_id = ps_vcl_node->u1_sps_id;
 4021|   229k|        ps_pps_sps_prev[(i4_dep_id << 4) + i4_qua_id].i4_updated_sts = SVCD_TRUE;
  ------------------
  |  |   46|   229k|#define SVCD_TRUE 1
  ------------------
 4022|       |
 4023|       |        /* handling of no_inter_layer_pred_flag 1 cases */
 4024|   229k|        if((1 == ps_vcl_node->u1_acc_no_int_pred) && (NULL != ps_vcl_node->ps_bot_node))
  ------------------
  |  Branch (4024:12): [True: 149k, False: 80.0k]
  |  Branch (4024:54): [True: 310, False: 149k]
  ------------------
 4025|    310|        {
 4026|    310|            if(SVCD_TRUE == i4_idr_pic_flag)
  ------------------
  |  |   46|    310|#define SVCD_TRUE 1
  ------------------
  |  Branch (4026:16): [True: 223, False: 87]
  ------------------
 4027|    223|            {
 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|    223|                if(SVCD_FALSE == i4_restore_prms_flag)
  ------------------
  |  |   45|    223|#define SVCD_FALSE 0
  ------------------
  |  Branch (4031:20): [True: 223, False: 0]
  ------------------
 4032|    223|                {
 4033|       |                    /* get the number of resolution detected so far */
 4034|    223|                    i4_num_res_lyrs_bup = ps_vcl_nal->i4_num_res_lyrs;
 4035|       |
 4036|    223|                    ps_node_bup = ps_vcl_node;
 4037|       |
 4038|       |                    /* set the restore params flag */
 4039|    223|                    i4_restore_prms_flag = SVCD_TRUE;
  ------------------
  |  |   46|    223|#define SVCD_TRUE 1
  ------------------
 4040|    223|                }
 4041|    223|            }
 4042|     87|            else
 4043|     87|            {
 4044|     87|                ps_vcl_node->i4_ref_dq_id = -1;
 4045|     87|                ps_vcl_node->i4_res_change_flag = i4_res_chnge_flag;
 4046|       |
 4047|       |                /* store the reference DQID for current dependency */
 4048|     87|                ps_prev_au_prms[i4_dep_id].i4_ref_dq_id = -1;
 4049|     87|                ps_prev_au_prms[i4_dep_id].u2_frm_num = ps_vcl_node->u2_frm_num;
 4050|     87|                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|     87|                ps_vcl_node->ps_bot_node = NULL;
 4054|     87|                break;
 4055|     87|            }
 4056|    310|        }
 4057|       |
 4058|       |        /* derive the reference layer DQID for quality id equal to 0 */
 4059|   229k|        if(0 == i4_qua_id)
  ------------------
  |  Branch (4059:12): [True: 229k, False: 0]
  ------------------
 4060|   229k|        {
 4061|   229k|            dec_seq_params_t *ps_curr_sps;
 4062|   229k|            dec_svc_seq_params_t *ps_curr_subset_sps;
 4063|       |
 4064|       |            /* derive current SPS */
 4065|   229k|            ps_curr_sps = ps_sps + ps_vcl_node->u1_sps_id;
 4066|   229k|            ps_curr_subset_sps = ps_subset_sps + ps_vcl_node->u1_sps_id;
 4067|       |
 4068|   229k|            {
 4069|   229k|                WORD32 i4_max_frm_num;
 4070|       |
 4071|       |                /* get the maximum value of frame number */
 4072|   229k|                i4_max_frm_num = (1 << (ps_curr_sps->u1_bits_in_frm_num + 1));
 4073|   229k|                ps_vcl_node->u2_frm_num = ps_vcl_node->u2_frm_num % i4_max_frm_num;
 4074|   229k|                if(SVCD_TRUE == ps_vcl_node->i4_idr_pic_flag)
  ------------------
  |  |   46|   229k|#define SVCD_TRUE 1
  ------------------
  |  Branch (4074:20): [True: 188k, False: 41.0k]
  ------------------
 4075|   188k|                {
 4076|       |                    /* if idr then frm num should be 0 */
 4077|   188k|                    ps_vcl_node->u2_frm_num = 0;
 4078|   188k|                }
 4079|   229k|            }
 4080|       |
 4081|       |            /* store default params to inter layer deblocking params */
 4082|   229k|            ps_vcl_node->i4_inter_lyr_dblk_idc = 0;
 4083|   229k|            ps_vcl_node->i4_inter_lyr_beta_offset = 0;
 4084|   229k|            ps_vcl_node->i4_inter_lyr_alpha_c0_offset = 0;
 4085|       |            /* No SEI support for scalability info*/
 4086|   229k|            i4_status = NOT_OK;
  ------------------
  |  |  116|   229k|#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|   229k|            if(1 == ps_vcl_node->u1_acc_no_int_pred)
  ------------------
  |  Branch (4091:16): [True: 149k, False: 80.0k]
  ------------------
 4092|   149k|            {
 4093|   149k|                i4_status = NOT_OK;
  ------------------
  |  |  116|   149k|#define NOT_OK    -1
  ------------------
 4094|   149k|            }
 4095|  80.0k|            else
 4096|  80.0k|            {
 4097|  80.0k|                WORD32 *pi4_ref_dq_id;
 4098|  80.0k|                WORD32 i4_ref_dq_id_temp;
 4099|       |
 4100|       |                /* check if the SEI message has given the ref_dq_id */
 4101|  80.0k|                if(NOT_OK == i4_status)
  ------------------
  |  |  116|  80.0k|#define NOT_OK    -1
  ------------------
  |  Branch (4101:20): [True: 80.0k, False: 0]
  ------------------
 4102|  80.0k|                {
 4103|  80.0k|                    pi4_ref_dq_id = &i4_ref_lyr_dqid;
 4104|  80.0k|                }
 4105|      0|                else
 4106|      0|                {
 4107|      0|                    pi4_ref_dq_id = &i4_ref_dq_id_temp;
 4108|      0|                }
 4109|       |
 4110|  80.0k|                i4_status = isvcd_get_ref_lyr_dqid(ps_vcl_node, ps_sps, ps_pps, pi4_ref_dq_id,
 4111|  80.0k|                                                   ps_prev_au_prms[i4_dep_id].i4_ref_dq_id,
 4112|  80.0k|                                                   &ps_svcd_ctxt->i4_error_code, ps_svcd_ctxt);
 4113|  80.0k|            }
 4114|       |
 4115|       |            /* no slice in the layer has been successfully decoded */
 4116|   229k|            if(NOT_OK == i4_status)
  ------------------
  |  |  116|   229k|#define NOT_OK    -1
  ------------------
  |  Branch (4116:16): [True: 213k, False: 15.9k]
  ------------------
 4117|   213k|            {
 4118|       |                /* check for IDR picture */
 4119|   213k|                if(SVCD_TRUE == i4_idr_pic_flag)
  ------------------
  |  |   46|   213k|#define SVCD_TRUE 1
  ------------------
  |  Branch (4119:20): [True: 174k, False: 38.9k]
  ------------------
 4120|   174k|                {
 4121|       |                    /* set the next lower layer as the reference layer */
 4122|   174k|                    if(NULL != ps_vcl_node->ps_bot_node)
  ------------------
  |  Branch (4122:24): [True: 51.6k, False: 123k]
  ------------------
 4123|  51.6k|                    {
 4124|  51.6k|                        i4_ref_lyr_dqid = ps_vcl_node->ps_bot_node->i4_dependency_id << 4;
 4125|       |
 4126|  51.6k|                        i4_ref_lyr_dqid += ps_vcl_node->ps_bot_node->i4_quality_id;
 4127|  51.6k|                    }
 4128|   123k|                    else
 4129|   123k|                    {
 4130|   123k|                        i4_ref_lyr_dqid = -1;
 4131|   123k|                    }
 4132|   174k|                }
 4133|  38.9k|                else
 4134|  38.9k|                {
 4135|       |                    /* take the reference dq id from previous access unit */
 4136|  38.9k|                    i4_ref_lyr_dqid = ps_prev_au_prms[i4_dep_id].i4_ref_dq_id;
 4137|  38.9k|                }
 4138|   213k|            }
 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|   229k|            i4_status = isvcd_update_dqid(i4_ref_lyr_dqid, ps_vcl_node, &ps_bot_vcl_node);
 4144|       |
 4145|   229k|            if(!(OK == i4_status))
  ------------------
  |  |  114|   229k|#define OK        0
  ------------------
  |  Branch (4145:16): [True: 0, False: 229k]
  ------------------
 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|   229k|            ps_prev_au_prms[i4_dep_id].i4_ref_dq_id = i4_ref_lyr_dqid;
 4153|   229k|            ps_prev_au_prms[i4_dep_id].i4_nal_ref_id = ps_vcl_node->i4_nal_ref_idc;
 4154|   229k|            ps_prev_au_prms[i4_dep_id].u2_frm_num = ps_vcl_node->u2_frm_num;
 4155|   229k|            ps_prev_au_prms[i4_dep_id].i4_updated_sts = SVCD_TRUE;
  ------------------
  |  |   46|   229k|#define SVCD_TRUE 1
  ------------------
 4156|       |
 4157|       |            /* ------- Detect Resolution Change ---------------- */
 4158|   229k|            {
 4159|   229k|                dec_seq_params_t *ps_lower_sps = NULL;
 4160|   229k|                dec_svc_seq_params_t *ps_lower_subset_sps = NULL;
 4161|       |
 4162|   229k|                if(NULL != ps_bot_vcl_node)
  ------------------
  |  Branch (4162:20): [True: 73.3k, False: 156k]
  ------------------
 4163|  73.3k|                {
 4164|  73.3k|                    if((NULL != ps_bot_vcl_node->ps_first_vcl_nal) ||
  ------------------
  |  Branch (4164:24): [True: 69.1k, False: 4.19k]
  ------------------
 4165|  4.19k|                       (SVCD_TRUE == i4_idr_pic_flag))
  ------------------
  |  |   46|  4.19k|#define SVCD_TRUE 1
  ------------------
  |  Branch (4165:24): [True: 3.02k, False: 1.17k]
  ------------------
 4166|  72.2k|                    {
 4167|       |                        /* get the SPS of layer */
 4168|  72.2k|                        ps_lower_sps = ps_sps + ps_bot_vcl_node->u1_sps_id;
 4169|  72.2k|                        ps_lower_subset_sps = ps_subset_sps + ps_bot_vcl_node->u1_sps_id;
 4170|  72.2k|                    }
 4171|  1.17k|                    else
 4172|  1.17k|                    {
 4173|       |                        /* if the bottom layer is completely missed */
 4174|  1.17k|                        WORD32 i4_bot_dep_id, i4_bot_qua_id;
 4175|  1.17k|                        UWORD8 u1_sps_id = 0;
 4176|       |
 4177|       |                        /* sps id is picked from previous access unit */
 4178|  1.17k|                        i4_bot_dep_id = ps_bot_vcl_node->i4_dependency_id;
 4179|  1.17k|                        i4_bot_qua_id = ps_bot_vcl_node->i4_quality_id;
 4180|       |
 4181|  1.17k|                        if(SVCD_TRUE ==
  ------------------
  |  |   46|  1.17k|#define SVCD_TRUE 1
  ------------------
  |  Branch (4181:28): [True: 1.10k, False: 66]
  ------------------
 4182|  1.17k|                           ps_pps_sps_prev[(i4_bot_dep_id << 4) + i4_bot_qua_id].i4_updated_sts)
 4183|  1.10k|                        {
 4184|  1.10k|                            u1_sps_id =
 4185|  1.10k|                                ps_pps_sps_prev[(i4_bot_dep_id << 4) + i4_bot_qua_id].u1_sps_id;
 4186|  1.10k|                        }
 4187|     66|                        else
 4188|     66|                        {
 4189|       |                            /* should not enter here */
 4190|     66|                            return NOT_OK;
  ------------------
  |  |  116|     66|#define NOT_OK    -1
  ------------------
 4191|     66|                        }
 4192|       |
 4193|       |                        /* get the SPS of lower layer */
 4194|  1.10k|                        ps_lower_sps = ps_sps + u1_sps_id;
 4195|  1.10k|                        ps_lower_subset_sps = ps_subset_sps + u1_sps_id;
 4196|  1.10k|                    }
 4197|  73.3k|                }
 4198|       |
 4199|       |                /* call the function which detects resolution change */
 4200|   229k|                i4_res_chnge_flag = isvcd_detect_res_change(
 4201|   229k|                    ps_curr_sps, ps_lower_sps, ps_curr_subset_sps, ps_lower_subset_sps);
 4202|       |
 4203|       |                /* if a resolution exists below current resolution */
 4204|   229k|                if(SVCD_TRUE == i4_res_chnge_flag)
  ------------------
  |  |   46|   229k|#define SVCD_TRUE 1
  ------------------
  |  Branch (4204:20): [True: 54.3k, False: 175k]
  ------------------
 4205|  54.3k|                {
 4206|       |                    /* if current picture id IDR */
 4207|  54.3k|                    if(SVCD_TRUE == i4_idr_pic_flag)
  ------------------
  |  |   46|  54.3k|#define SVCD_TRUE 1
  ------------------
  |  Branch (4207:24): [True: 48.0k, False: 6.30k]
  ------------------
 4208|  48.0k|                    {
 4209|       |                        /* store the depedency id of bottom most layer in current resolution */
 4210|  48.0k|                        ai4_dep_id[ps_vcl_nal->i4_num_res_lyrs - 1] = i4_dep_id;
 4211|  48.0k|                    }
 4212|       |
 4213|       |                    /* increment the num resolution layer counter */
 4214|  54.3k|                    ps_vcl_nal->i4_num_res_lyrs++;
 4215|       |
 4216|       |                    /* store the SPS of target -1 and -2 resolution layers */
 4217|  54.3k|                    if(2 == ps_vcl_nal->i4_num_res_lyrs)
  ------------------
  |  Branch (4217:24): [True: 54.3k, False: 0]
  ------------------
 4218|  54.3k|                    {
 4219|  54.3k|                        ps_sps_tgt_minus1_lyr = ps_curr_sps;
 4220|  54.3k|                    }
 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|  54.3k|                }
 4230|   229k|            }
 4231|       |
 4232|       |            /* -------- end of resolution change detection -------- */
 4233|   229k|        }
 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|   229k|        ps_vcl_node->i4_res_change_flag = i4_res_chnge_flag;
 4260|   229k|        ps_vcl_node->i4_ref_dq_id = i4_ref_lyr_dqid;
 4261|       |
 4262|       |        /* go to the next node */
 4263|   229k|        ps_vcl_node = ps_bot_vcl_node;
 4264|   229k|    }
 4265|       |
 4266|       |    /* update the Dependency array for each resolution */
 4267|   156k|    if(SVCD_TRUE == i4_idr_pic_flag)
  ------------------
  |  |   46|   156k|#define SVCD_TRUE 1
  ------------------
  |  Branch (4267:8): [True: 123k, False: 32.3k]
  ------------------
 4268|   123k|    {
 4269|   123k|        WORD32 i4_idx;
 4270|       |
 4271|   123k|        ai4_dep_id[ps_vcl_nal->i4_num_res_lyrs - 1] = 0;
 4272|       |
 4273|       |        /* loop over number of resolutions detected */
 4274|   295k|        for(i4_idx = 0; i4_idx < ps_vcl_nal->i4_num_res_lyrs; i4_idx++)
  ------------------
  |  Branch (4274:25): [True: 171k, False: 123k]
  ------------------
 4275|   171k|        {
 4276|   171k|            pi4_dep_id_map[i4_idx] = ai4_dep_id[ps_vcl_nal->i4_num_res_lyrs - 1 - i4_idx];
 4277|   171k|        }
 4278|   123k|    }
 4279|       |
 4280|   156k|    if(SVCD_TRUE == i4_restore_prms_flag)
  ------------------
  |  |   46|   156k|#define SVCD_TRUE 1
  ------------------
  |  Branch (4280:8): [True: 223, False: 156k]
  ------------------
 4281|    223|    {
 4282|       |        /* restore the number of resolutions */
 4283|    223|        ps_vcl_nal->i4_num_res_lyrs = i4_num_res_lyrs_bup;
 4284|       |
 4285|    223|        ps_vcl_node = ps_node_bup;
 4286|       |
 4287|       |        /* set the bottom node to NULL */
 4288|    223|        ps_vcl_node->ps_bot_node = NULL;
 4289|       |
 4290|    223|        ps_vcl_node->i4_ref_dq_id = -1;
 4291|    223|        ps_vcl_node->i4_res_change_flag = SVCD_FALSE;
  ------------------
  |  |   45|    223|#define SVCD_FALSE 0
  ------------------
 4292|       |
 4293|       |        /* store the reference DQID for current dependency */
 4294|    223|        ps_prev_au_prms[ps_vcl_node->i4_dependency_id].i4_ref_dq_id = -1;
 4295|       |
 4296|    223|        ps_prev_au_prms[ps_vcl_node->i4_dependency_id].u2_frm_num = ps_vcl_node->u2_frm_num;
 4297|       |
 4298|    223|        ps_prev_au_prms[ps_vcl_node->i4_dependency_id].i4_nal_ref_id = ps_vcl_node->i4_nal_ref_idc;
 4299|    223|    }
 4300|       |
 4301|       |    /* Finally update the bottom most node in the current access unit */
 4302|   156k|    ps_vcl_node = ps_vcl_nal->ps_top_node;
 4303|       |
 4304|   229k|    while(NULL != ps_vcl_node->ps_bot_node)
  ------------------
  |  Branch (4304:11): [True: 73.1k, False: 156k]
  ------------------
 4305|  73.1k|    {
 4306|  73.1k|        ps_vcl_node = ps_vcl_node->ps_bot_node;
 4307|  73.1k|    }
 4308|       |
 4309|   156k|    ps_vcl_nal->ps_bot_node = ps_vcl_node;
 4310|       |
 4311|       |    /* check on validity of Target Layer -1 and -2 dimensions */
 4312|   156k|    if((NULL != ps_sps_tgt_minus1_lyr) && (0 == ps_sps_tgt_minus1_lyr->u1_is_valid))
  ------------------
  |  Branch (4312:8): [True: 54.3k, False: 101k]
  |  Branch (4312:43): [True: 4.64k, False: 49.7k]
  ------------------
 4313|  4.64k|    {
 4314|  4.64k|        if((H264_MAX_FRAME_WIDTH < (WORD32) (ps_sps_tgt_minus1_lyr->u2_frm_wd_in_mbs << 4)) ||
  ------------------
  |  |   39|  4.64k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
  |  Branch (4314:12): [True: 0, False: 4.64k]
  ------------------
 4315|  4.64k|           (H264_MAX_FRAME_HEIGHT < (WORD32) (ps_sps_tgt_minus1_lyr->u2_frm_ht_in_mbs << 4)))
  ------------------
  |  |   40|  4.64k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
  |  Branch (4315:12): [True: 0, False: 4.64k]
  ------------------
 4316|      0|        {
 4317|      0|            return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 4318|      0|        }
 4319|  4.64k|    }
 4320|       |
 4321|   156k|    if((NULL != ps_sps_tgt_minus2_lyr) && (0 == ps_sps_tgt_minus2_lyr->u1_is_valid))
  ------------------
  |  Branch (4321:8): [True: 0, False: 156k]
  |  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|   156k|    return (OK);
  ------------------
  |  |  114|   156k|#define OK        0
  ------------------
 4331|   156k|}
isvcd_dec_non_vcl:
 4361|   145k|{
 4362|       |    /* local varibles */
 4363|   145k|    non_vcl_nal_t *ps_non_vcl;
 4364|   145k|    WORD32 i4_unit_indx;
 4365|   145k|    non_vcl_buf_hdr_t *ps_non_vcl_buf;
 4366|   145k|    WORD32 i_status = OK;
  ------------------
  |  |  114|   145k|#define OK        0
  ------------------
 4367|   145k|    dec_struct_t *ps_dec;
 4368|   145k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 4369|   145k|    dec_bit_stream_t *ps_bitstrm;
 4370|       |
 4371|   145k|    if((NULL == pv_out_non_vcl) || (NULL == pv_seq_params) || (NULL == pv_pic_params))
  ------------------
  |  Branch (4371:8): [True: 0, False: 145k]
  |  Branch (4371:36): [True: 0, False: 145k]
  |  Branch (4371:63): [True: 0, False: 145k]
  ------------------
 4372|      0|    {
 4373|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 4374|      0|    }
 4375|   145k|    UNUSED(pv_seq_params);
  ------------------
  |  |   45|   145k|#define UNUSED(x) ((void)(x))
  ------------------
 4376|   145k|    UNUSED(pv_pic_params);
  ------------------
  |  |   45|   145k|#define UNUSED(x) ((void)(x))
  ------------------
 4377|       |
 4378|       |    /* currently SEI decoding is not supported */
 4379|       |    /* derive the local variables */
 4380|   145k|    ps_non_vcl = (non_vcl_nal_t *) pv_out_non_vcl;
 4381|   145k|    ps_non_vcl_buf = ps_non_vcl->ps_first_non_vcl_nal;
 4382|   145k|    if(NULL == ps_non_vcl_buf) return (NOT_OK);
  ------------------
  |  |  116|  30.4k|#define NOT_OK    -1
  ------------------
  |  Branch (4382:8): [True: 30.4k, False: 114k]
  ------------------
 4383|       |
 4384|       |    /* loop until all NON VCL NAL are decoded */
 4385|   383k|    for(i4_unit_indx = 0; i4_unit_indx < ps_non_vcl->i4_num_non_vcl_nals; i4_unit_indx++)
  ------------------
  |  Branch (4385:27): [True: 297k, False: 85.6k]
  ------------------
 4386|   297k|    {
 4387|   297k|        UWORD32 u4_nal_unit_type;
 4388|   297k|        ps_svc_lyr_dec = ps_svcd_ctxt->ps_svc_dec_lyr;
 4389|   297k|        ps_dec = &ps_svc_lyr_dec->s_dec;
 4390|   297k|        if(NULL == ps_non_vcl_buf) return (NOT_OK);
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  |  Branch (4390:12): [True: 0, False: 297k]
  ------------------
 4391|       |        /* get the current NAL unit type */
 4392|   297k|        u4_nal_unit_type = (UWORD32) ps_non_vcl_buf->i4_nal_unit_type;
 4393|   297k|        if(u4_nal_unit_type > MAX_SVC_NAL_UNIT_TYPE) return (NOT_OK);
  ------------------
  |  |   73|   297k|#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: 297k]
  ------------------
 4394|   297k|        ps_dec->u1_nal_unit_type = u4_nal_unit_type;
 4395|       |
 4396|   297k|        ps_dec->ps_bitstrm->pu4_buffer =
 4397|   297k|            (UWORD32 *) ((UWORD8 *) ps_non_vcl_buf + ps_non_vcl_buf->i4_buf_offset);
 4398|   297k|        ps_dec->ps_bitstrm->u4_ofst = 0;
 4399|   297k|        ps_dec->ps_bitstrm->u4_max_ofst = isvcd_nal_rbsp_to_sodb(
 4400|   297k|            (UWORD8 *) ps_dec->ps_bitstrm->pu4_buffer, ps_non_vcl_buf->i4_buf_size, 0);
 4401|   297k|        if(ps_dec->ps_bitstrm->u4_max_ofst <= 0) return (NOT_OK);
  ------------------
  |  |  116|  1.86k|#define NOT_OK    -1
  ------------------
  |  Branch (4401:12): [True: 1.86k, False: 295k]
  ------------------
 4402|       |
 4403|   295k|        ps_bitstrm = ps_dec->ps_bitstrm;
 4404|       |
 4405|       |        /* call the processing module based on nal unit type */
 4406|   295k|        switch(u4_nal_unit_type)
 4407|   295k|        {
 4408|  97.9k|            case SEQ_PARAM_NAL:
  ------------------
  |  |  330|  97.9k|#define SEQ_PARAM_NAL                   7
  ------------------
  |  Branch (4408:13): [True: 97.9k, False: 197k]
  ------------------
 4409|       |
 4410|  97.9k|                i_status = isvcd_parse_sps(ps_svc_lyr_dec, ps_bitstrm);
 4411|       |
 4412|  97.9k|                if(!i_status)
  ------------------
  |  Branch (4412:20): [True: 86.4k, False: 11.5k]
  ------------------
 4413|  86.4k|                {
 4414|  86.4k|                    ps_dec->i4_header_decoded |= 0x1;
 4415|  86.4k|                    ps_svcd_ctxt->u4_num_sps_ctr++;
 4416|       |
 4417|  86.4k|                    if(ps_svcd_ctxt->pic_width < ps_svc_lyr_dec->pic_width)
  ------------------
  |  Branch (4417:24): [True: 13.0k, False: 73.3k]
  ------------------
 4418|  13.0k|                    {
 4419|  13.0k|                        ps_svcd_ctxt->pic_width = ps_svc_lyr_dec->pic_width;
 4420|  13.0k|                    }
 4421|  86.4k|                    if(ps_svcd_ctxt->pic_height < ps_svc_lyr_dec->pic_height)
  ------------------
  |  Branch (4421:24): [True: 13.1k, False: 73.3k]
  ------------------
 4422|  13.1k|                    {
 4423|  13.1k|                        ps_svcd_ctxt->pic_height = ps_svc_lyr_dec->pic_height;
 4424|  13.1k|                    }
 4425|  86.4k|                }
 4426|       |
 4427|  97.9k|                if(i_status) return i_status;
  ------------------
  |  Branch (4427:20): [True: 11.5k, False: 86.4k]
  ------------------
 4428|       |
 4429|  86.4k|                break;
 4430|  86.4k|            case SUBSET_SPS_NAL:
  ------------------
  |  |   65|  23.9k|#define SUBSET_SPS_NAL 15
  ------------------
  |  Branch (4430:13): [True: 23.9k, False: 271k]
  ------------------
 4431|       |
 4432|  23.9k|                i_status = isvcd_parse_subset_sps(ps_svc_lyr_dec, ps_bitstrm);
 4433|       |
 4434|  23.9k|                if(!i_status)
  ------------------
  |  Branch (4434:20): [True: 17.2k, False: 6.66k]
  ------------------
 4435|  17.2k|                {
 4436|  17.2k|                    ps_svcd_ctxt->u4_num_sps_ctr++;
 4437|  17.2k|                    ps_dec->i4_header_decoded |= 0x1;
 4438|       |
 4439|  17.2k|                    if(ps_svcd_ctxt->pic_width < ps_svc_lyr_dec->pic_width)
  ------------------
  |  Branch (4439:24): [True: 7.29k, False: 9.97k]
  ------------------
 4440|  7.29k|                    {
 4441|  7.29k|                        ps_svcd_ctxt->pic_width = ps_svc_lyr_dec->pic_width;
 4442|  7.29k|                    }
 4443|  17.2k|                    if(ps_svcd_ctxt->pic_height < ps_svc_lyr_dec->pic_height)
  ------------------
  |  Branch (4443:24): [True: 7.34k, False: 9.93k]
  ------------------
 4444|  7.34k|                    {
 4445|  7.34k|                        ps_svcd_ctxt->pic_height = ps_svc_lyr_dec->pic_height;
 4446|  7.34k|                    }
 4447|  17.2k|                }
 4448|  23.9k|                if(i_status) return i_status;
  ------------------
  |  Branch (4448:20): [True: 6.66k, False: 17.2k]
  ------------------
 4449|       |
 4450|  17.2k|                break;
 4451|       |
 4452|  71.1k|            case PIC_PARAM_NAL:
  ------------------
  |  |  331|  71.1k|#define PIC_PARAM_NAL                   8
  ------------------
  |  Branch (4452:13): [True: 71.1k, False: 224k]
  ------------------
 4453|       |
 4454|  71.1k|                i_status = isvcd_parse_pps(ps_svc_lyr_dec, ps_bitstrm);
 4455|  71.1k|                if(!i_status)
  ------------------
  |  Branch (4455:20): [True: 68.3k, False: 2.86k]
  ------------------
 4456|  68.3k|                {
 4457|  68.3k|                    ps_dec->i4_header_decoded |= 0x2;
 4458|  68.3k|                    ps_svcd_ctxt->u4_num_pps_ctr++;
 4459|  68.3k|                }
 4460|  71.1k|                if(i_status) return i_status;
  ------------------
  |  Branch (4460:20): [True: 2.86k, False: 68.3k]
  ------------------
 4461|  68.3k|                break;
 4462|  68.3k|            case SEI_NAL:
  ------------------
  |  |  329|  8.22k|#define SEI_NAL                         6
  ------------------
  |  Branch (4462:13): [True: 8.22k, False: 287k]
  ------------------
 4463|  8.22k|            {
 4464|  8.22k|                i_status = ih264d_parse_sei_message(ps_dec, ps_bitstrm);
 4465|  8.22k|                if(i_status) return i_status;
  ------------------
  |  Branch (4465:20): [True: 6.40k, False: 1.81k]
  ------------------
 4466|  1.81k|                ih264d_parse_sei(ps_dec, ps_bitstrm);
 4467|  1.81k|            }
 4468|      0|            break;
 4469|  94.3k|            default:
  ------------------
  |  Branch (4469:13): [True: 94.3k, False: 201k]
  ------------------
 4470|       |                /* no other NON VCL UNIT is supported */
 4471|  94.3k|                break;
 4472|   295k|        }
 4473|       |
 4474|       |        /* get the next non vcl bufffer */
 4475|   268k|        ps_non_vcl_buf = ps_non_vcl_buf->ps_next;
 4476|       |
 4477|   268k|    } /* end of loop over all NAL units */
 4478|       |
 4479|  85.6k|    return (OK);
  ------------------
  |  |  114|  85.6k|#define OK        0
  ------------------
 4480|   114k|}
isvcd_seq_hdr_dec:
 4505|   110k|{
 4506|   110k|    WORD32 i4_status;
 4507|       |
 4508|       |    /* Decode all non VCL NAL till first VCL NAL is encountered */
 4509|   110k|    ps_svcd_ctxt->s_non_vcl_nal.i4_num_non_vcl_nals = 0;
 4510|   110k|    i4_status = isvcd_nal_parse_non_vcl_nal(
 4511|   110k|        ps_svcd_ctxt->pv_nal_parse_ctxt, ps_in_bufs->pv_stream_buffer, &ps_svcd_ctxt->s_non_vcl_nal,
 4512|   110k|        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|   110k|    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|   110k|    i4_status = isvcd_dec_non_vcl(&ps_svcd_ctxt->s_non_vcl_nal, ps_svcd_ctxt->ps_sps, ps_svcd_ctxt->ps_pps,
 4528|   110k|                      ps_svcd_ctxt);
 4529|       |
 4530|   110k|    return (i4_status);
 4531|   110k|}
isvcd_pre_parse_refine_au:
 4560|   648k|{
 4561|   648k|    WORD32 i4_status = 0, i4_non_vcl_status;
 4562|   648k|    UWORD32 u4_bytes_consumed = 0;
 4563|   648k|    dec_struct_t *ps_dec;
 4564|   648k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 4565|   648k|    ps_svc_lyr_dec = ps_svcd_ctxt->ps_svc_dec_lyr;
 4566|   648k|    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|   648k|    if(SVCD_FALSE == ps_dec->i4_header_decoded)
  ------------------
  |  |   45|   648k|#define SVCD_FALSE 0
  ------------------
  |  Branch (4572:8): [True: 110k, False: 538k]
  ------------------
 4573|   110k|    {
 4574|   110k|        i4_status = isvcd_seq_hdr_dec(ps_svcd_ctxt, ps_in_bufs, &u4_bytes_consumed);
 4575|       |
 4576|   110k|        if((VCL_NAL_FOUND_TRUE == i4_status) && (ps_svcd_ctxt->u4_num_sps_ctr != 0) &&
  ------------------
  |  Branch (4576:12): [True: 0, False: 110k]
  |  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|   110k|    }
 4583|   648k|    *pu4_bytes_consumed = u4_bytes_consumed;
 4584|   648k|    if (i4_status)
  ------------------
  |  Branch (4584:9): [True: 48.9k, False: 599k]
  ------------------
 4585|  48.9k|    {
 4586|  48.9k|        return NOT_OK;
  ------------------
  |  |  116|  48.9k|#define NOT_OK    -1
  ------------------
 4587|  48.9k|    }
 4588|   599k|    if(1 == ps_dec->i4_decode_header)
  ------------------
  |  Branch (4588:8): [True: 419k, False: 180k]
  ------------------
 4589|   419k|    {
 4590|   419k|        return OK;
  ------------------
  |  |  114|   419k|#define OK        0
  ------------------
 4591|   419k|    }
 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|   180k|    if(SVCD_FALSE == ps_svcd_ctxt->i4_eos_flag)
  ------------------
  |  |   45|   180k|#define SVCD_FALSE 0
  ------------------
  |  Branch (4609:8): [True: 180k, False: 0]
  ------------------
 4610|   180k|    {
 4611|   180k|        if(ps_dec->i4_header_decoded == 3)
  ------------------
  |  Branch (4611:12): [True: 163k, False: 17.4k]
  ------------------
 4612|   163k|        {
 4613|   163k|            i4_status = isvcd_nal_parse_vcl_nal_partial(
 4614|   163k|                ps_svcd_ctxt->pv_nal_parse_ctxt, ps_in_bufs->pv_stream_buffer,
 4615|   163k|                &ps_svcd_ctxt->s_non_vcl_nal, &ps_svcd_ctxt->s_vcl_nal, &u4_bytes_consumed,
 4616|   163k|                &ps_in_bufs->u4_num_Bytes);
 4617|   163k|        }
 4618|  17.4k|        else
 4619|  17.4k|        {
 4620|  17.4k|            return NOT_OK;
  ------------------
  |  |  116|  17.4k|#define NOT_OK    -1
  ------------------
 4621|  17.4k|        }
 4622|   180k|    }
 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|   163k|    *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|   163k|    if(PIC_BOUNDARY_FALSE == i4_status)
  ------------------
  |  Branch (4641:8): [True: 4.64k, False: 158k]
  ------------------
 4642|  4.64k|    {
 4643|  4.64k|        return (NOT_OK);
  ------------------
  |  |  116|  4.64k|#define NOT_OK    -1
  ------------------
 4644|  4.64k|    }
 4645|       |
 4646|   158k|    else if(FLUSH_DECODED_PICTURE == i4_status)
  ------------------
  |  Branch (4646:13): [True: 15, False: 158k]
  ------------------
 4647|     15|    {
 4648|       |        /* No more data is expected to come. Pictures decoded   */
 4649|       |        /* so far needs to be sent for display                  */
 4650|     15|        return (FLUSH);
  ------------------
  |  |   50|     15|#define FLUSH 2
  ------------------
 4651|     15|    }
 4652|       |
 4653|   158k|    if(PIC_BOUNDARY_TRUE != i4_status)
  ------------------
  |  Branch (4653:8): [True: 0, False: 158k]
  ------------------
 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|   158k|    {
 4677|   158k|        i4_status = isvcd_refine_dep_list(
 4678|   158k|            &ps_svcd_ctxt->s_vcl_nal, ps_svcd_ctxt->ps_sps, ps_svcd_ctxt->ps_subset_sps,
 4679|   158k|            ps_svcd_ctxt->ps_pps, &ps_svcd_ctxt->ai4_dq_id_map[0], &ps_svcd_ctxt->as_au_prms_dep[0],
 4680|   158k|            &ps_svcd_ctxt->as_pps_sps_prev_au[0], &ps_svcd_ctxt->i4_error_code, ps_svcd_ctxt);
 4681|   158k|    }
 4682|       |
 4683|   158k|    if(0 != ps_svcd_ctxt->s_non_vcl_nal.i4_num_non_vcl_nals)
  ------------------
  |  Branch (4683:8): [True: 35.1k, False: 123k]
  ------------------
 4684|  35.1k|    {
 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|  35.1k|        i4_non_vcl_status = isvcd_dec_non_vcl(&ps_svcd_ctxt->s_non_vcl_nal, ps_svcd_ctxt->ps_sps,
 4691|  35.1k|                                              ps_svcd_ctxt->ps_pps, ps_svcd_ctxt);
 4692|       |
 4693|  35.1k|        if(OK != i4_non_vcl_status) return i4_non_vcl_status;
  ------------------
  |  |  114|  35.1k|#define OK        0
  ------------------
  |  Branch (4693:12): [True: 10.8k, False: 24.3k]
  ------------------
 4694|  35.1k|    }
 4695|   147k|    if(OK != i4_status) return (i4_status);
  ------------------
  |  |  114|   147k|#define OK        0
  ------------------
  |  Branch (4695:8): [True: 1.72k, False: 145k]
  ------------------
 4696|   145k|    return (OK);
  ------------------
  |  |  114|   145k|#define OK        0
  ------------------
 4697|   147k|}
isvcd_video_decode:
 4721|   719k|{
 4722|   719k|    dec_struct_t *ps_dec;
 4723|   719k|    dec_struct_t *ps_dec_zero_lyr;
 4724|   719k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 4725|   719k|    svc_dec_lyr_struct_t *ps_svc_lyr_zero_dec;
 4726|       |
 4727|   719k|    svc_dec_ctxt_t *ps_svcd_ctxt;
 4728|   719k|    WORD32 i4_err_status = 0;
 4729|       |
 4730|   719k|    UWORD32 bytes_consumed = 0;
 4731|   719k|    WORD32 ret = 0, api_ret_value = IV_SUCCESS;
 4732|   719k|    isvcd_video_decode_ip_t *ps_h264d_dec_ip;
 4733|   719k|    isvcd_video_decode_op_t *ps_h264d_dec_op;
 4734|   719k|    ivd_video_decode_ip_t *ps_dec_ip;
 4735|   719k|    ivd_video_decode_op_t *ps_dec_op;
 4736|   719k|    UWORD8 u1_res_id;
 4737|       |
 4738|   719k|    ithread_set_name((void *) "Parse_thread");
 4739|       |
 4740|   719k|    ps_svcd_ctxt = (svc_dec_ctxt_t *) (dec_hdl->pv_codec_handle);
 4741|   719k|    ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[0];
 4742|   719k|    ps_dec = &ps_svc_lyr_dec->s_dec;
 4743|       |
 4744|   719k|    ps_h264d_dec_ip = (isvcd_video_decode_ip_t *) pv_api_ip;
 4745|   719k|    ps_h264d_dec_op = (isvcd_video_decode_op_t *) pv_api_op;
 4746|   719k|    ps_dec_ip = &ps_h264d_dec_ip->s_ivd_video_decode_ip_t;
 4747|   719k|    ps_dec_op = &ps_h264d_dec_op->s_ivd_video_decode_op_t;
 4748|       |
 4749|   719k|    {
 4750|   719k|        UWORD32 u4_size;
 4751|   719k|        u4_size = ps_dec_op->u4_size;
 4752|   719k|        memset(ps_h264d_dec_op, 0, sizeof(isvcd_video_decode_op_t));
 4753|   719k|        ps_dec_op->u4_size = u4_size;
 4754|   719k|    }
 4755|       |
 4756|   719k|    ps_dec->pv_dec_out = ps_dec_op;
 4757|   719k|    if(ps_dec->init_done != 1)
  ------------------
  |  Branch (4757:8): [True: 0, False: 719k]
  ------------------
 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|   719k|    DATA_SYNC();
  ------------------
  |  |  116|   719k|#define DATA_SYNC()  __sync_synchronize()
  ------------------
 4765|       |
 4766|   719k|    if(0 == ps_dec->u1_flushfrm)
  ------------------
  |  Branch (4766:8): [True: 719k, False: 0]
  ------------------
 4767|   719k|    {
 4768|   719k|        if(ps_dec_ip->pv_stream_buffer == NULL)
  ------------------
  |  Branch (4768:12): [True: 0, False: 719k]
  ------------------
 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|   719k|        if(ps_dec_ip->u4_num_Bytes <= 16)
  ------------------
  |  Branch (4774:12): [True: 70.6k, False: 648k]
  ------------------
 4775|  70.6k|        {
 4776|  70.6k|            ps_dec_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
 4777|  70.6k|            ps_dec_op->u4_error_code |= IVD_DEC_NUMBYTES_INV;
 4778|  70.6k|            return IV_FAIL;
 4779|  70.6k|        }
 4780|   719k|    }
 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|   648k|    ps_dec->u4_dec_thread_created = 0;
 4798|   648k|    ps_dec->u4_bs_deblk_thread_created = 0;
 4799|   648k|#endif
 4800|   648k|    ps_dec_op->u4_num_bytes_consumed = 0;
 4801|   648k|    ps_dec_op->i4_reorder_depth = -1;
 4802|   648k|    ps_dec_op->i4_display_index = DEFAULT_POC;
  ------------------
  |  |   45|   648k|#define DEFAULT_POC 0x7FFFFFFF
  ------------------
 4803|       |
 4804|   648k|    ps_dec->ps_out_buffer = NULL;
 4805|   648k|    if(ps_dec_ip->u4_size >= offsetof(ivd_video_decode_ip_t, s_out_buffer))
  ------------------
  |  Branch (4805:8): [True: 648k, False: 0]
  ------------------
 4806|   648k|        ps_dec->ps_out_buffer = &ps_dec_ip->s_out_buffer;
 4807|       |
 4808|   648k|    if(0 == ps_dec->u4_share_disp_buf && ps_dec->i4_decode_header == 0)
  ------------------
  |  Branch (4808:8): [True: 648k, False: 0]
  |  Branch (4808:42): [True: 190k, False: 457k]
  ------------------
 4809|   190k|    {
 4810|   190k|        UWORD32 i;
 4811|   190k|        if((ps_dec->ps_out_buffer->u4_num_bufs == 0) ||
  ------------------
  |  Branch (4811:12): [True: 0, False: 190k]
  ------------------
 4812|   190k|           (ps_dec->ps_out_buffer->u4_num_bufs > IVD_VIDDEC_MAX_IO_BUFFERS))
  ------------------
  |  |   45|   190k|#define IVD_VIDDEC_MAX_IO_BUFFERS 64
  ------------------
  |  Branch (4812:12): [True: 0, False: 190k]
  ------------------
 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|   668k|        for(i = 0; i < ps_dec->ps_out_buffer->u4_num_bufs; i++)
  ------------------
  |  Branch (4819:20): [True: 477k, False: 190k]
  ------------------
 4820|   477k|        {
 4821|   477k|            if(ps_dec->ps_out_buffer->pu1_bufs[i] == NULL)
  ------------------
  |  Branch (4821:16): [True: 0, False: 477k]
  ------------------
 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|   477k|            if(ps_dec->ps_out_buffer->u4_min_out_buf_size[i] == 0)
  ------------------
  |  Branch (4828:16): [True: 0, False: 477k]
  ------------------
 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|   477k|        }
 4835|   190k|    }
 4836|       |
 4837|   648k|    if(ps_dec->u4_total_frames_decoded >= NUM_FRAMES_LIMIT)
  ------------------
  |  |  157|   648k|#define NUM_FRAMES_LIMIT 0x7FFFFFFF
  ------------------
  |  Branch (4837:8): [True: 0, False: 648k]
  ------------------
 4838|      0|    {
 4839|      0|        ps_dec_op->u4_error_code = ERROR_FRAME_LIMIT_OVER;
 4840|      0|        return IV_FAIL;
 4841|      0|    }
 4842|       |
 4843|   648k|    ps_dec_op->u4_error_code = 0;
 4844|   648k|    ps_dec_op->e_pic_type = IV_NA_FRAME;
 4845|   648k|    ps_dec_op->u4_output_present = 0;
 4846|   648k|    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|   648k|    if(ps_dec->u1_init_dec_flag == 1 && ps_dec->u4_share_disp_buf == 1 && ps_dec->u1_flushfrm == 0)
  ------------------
  |  Branch (4851:8): [True: 116k, False: 532k]
  |  Branch (4851:41): [True: 0, False: 116k]
  |  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|   648k|    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: 648k]
  |  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|   648k|    if(ps_dec->u1_flushfrm && (1 == ps_svcd_ctxt->u1_pre_parse_in_flush))
  ------------------
  |  Branch (4947:8): [True: 0, False: 648k]
  |  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|                    ih264_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|                    ih264_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|   648k|    if(ps_dec->u1_res_changed == 1)
  ------------------
  |  Branch (5034:8): [True: 3.43k, False: 645k]
  ------------------
 5035|  3.43k|    {
 5036|       |        /*if resolution has changed and all buffers have been flushed, reset
 5037|       |         * decoder*/
 5038|  3.43k|        if(((buf_mgr_t *) ps_dec->pv_pic_buf_mgr)->pv_mutex != NULL)
  ------------------
  |  Branch (5038:12): [True: 145, False: 3.28k]
  ------------------
 5039|    145|            ih264_buf_mgr_free(ps_dec->pv_pic_buf_mgr);
 5040|  3.43k|        if(((buf_mgr_t *) ps_dec->pv_mv_buf_mgr)->pv_mutex != NULL)
  ------------------
  |  Branch (5040:12): [True: 145, False: 3.28k]
  ------------------
 5041|    145|            ih264_buf_mgr_free(ps_dec->pv_mv_buf_mgr);
 5042|       |
 5043|  3.43k|        isvcd_init_decoder(ps_svc_lyr_dec);
 5044|  3.43k|    }
 5045|       |
 5046|   648k|    DEBUG_THREADS_PRINTF(" Starting process call\n");
 5047|       |
 5048|   648k|    {
 5049|   648k|        vcl_node_t *ps_cur_node;
 5050|   648k|        UWORD8 u1_num_res_lyrs;
 5051|   648k|        vcl_buf_hdr_t *ps_vcl_buf;
 5052|   648k|        UWORD8 flush_decode = 1;
 5053|   648k|        ps_svcd_ctxt->u1_pre_parse_in_flush = 0;
 5054|       |
 5055|   648k|        ret = isvcd_pre_parse_refine_au(ps_svcd_ctxt, ps_dec_ip, &ps_dec_op->u4_num_bytes_consumed);
 5056|   648k|        ps_svcd_ctxt->u1_pre_parse_in_flush = (ret == FLUSH);
  ------------------
  |  |   50|   648k|#define FLUSH 2
  ------------------
 5057|       |
 5058|   648k|        if(ret != OK)
  ------------------
  |  |  114|   648k|#define OK        0
  ------------------
  |  Branch (5058:12): [True: 83.5k, False: 564k]
  ------------------
 5059|  83.5k|        {
 5060|  83.5k|            UWORD32 error = ih264d_map_error((UWORD32) ret);
 5061|  83.5k|            if(ret != NOT_OK)
  ------------------
  |  |  116|  83.5k|#define NOT_OK    -1
  ------------------
  |  Branch (5061:16): [True: 10.0k, False: 73.4k]
  ------------------
 5062|  10.0k|            {
 5063|  10.0k|                ps_dec_op->u4_error_code = error | ret;
 5064|  10.0k|            }
 5065|  83.5k|            if((ps_dec_op->u4_error_code >> IVD_FATALERROR) & 1)
  ------------------
  |  Branch (5065:16): [True: 1.16k, False: 82.3k]
  ------------------
 5066|  1.16k|            {
 5067|  1.16k|                ps_svcd_ctxt->u1_exit_till_next_IDR = 1;
 5068|  1.16k|            }
 5069|  83.5k|            api_ret_value = IV_FAIL;
 5070|  83.5k|            if((ret == IVD_RES_CHANGED) || (ret == IVD_MEM_ALLOC_FAILED) ||
  ------------------
  |  Branch (5070:16): [True: 6.69k, False: 76.8k]
  |  Branch (5070:44): [True: 0, False: 76.8k]
  ------------------
 5071|  76.8k|               (ret == ERROR_UNAVAIL_PICBUF_T) || (ret == ERROR_UNAVAIL_MVBUF_T) ||
  ------------------
  |  Branch (5071:16): [True: 0, False: 76.8k]
  |  Branch (5071:51): [True: 0, False: 76.8k]
  ------------------
 5072|  76.8k|               (ret == ERROR_INV_SPS_PPS_T) || (ret == ERROR_FEATURE_UNAVAIL) ||
  ------------------
  |  Branch (5072:16): [True: 1.04k, False: 75.7k]
  |  Branch (5072:48): [True: 609, False: 75.1k]
  ------------------
 5073|  75.1k|               (ret == IVD_STREAM_WIDTH_HEIGHT_NOT_SUPPORTED) ||
  ------------------
  |  Branch (5073:16): [True: 560, False: 74.6k]
  ------------------
 5074|  74.6k|               (ret == IVD_DISP_FRM_ZERO_OP_BUF_SIZE))
  ------------------
  |  Branch (5074:16): [True: 0, False: 74.6k]
  ------------------
 5075|  8.91k|            {
 5076|  8.91k|                ps_dec->u4_slice_start_code_found = 0;
 5077|  8.91k|            }
 5078|  83.5k|            if((ret == ERROR_INCOMPLETE_FRAME) || (ret == ERROR_DANGLING_FIELD_IN_PIC))
  ------------------
  |  Branch (5078:16): [True: 0, False: 83.5k]
  |  Branch (5078:51): [True: 0, False: 83.5k]
  ------------------
 5079|      0|            {
 5080|      0|                api_ret_value = IV_FAIL;
 5081|      0|            }
 5082|       |
 5083|  83.5k|            if(ret == ERROR_IN_LAST_SLICE_OF_PIC)
  ------------------
  |  Branch (5083:16): [True: 0, False: 83.5k]
  ------------------
 5084|      0|            {
 5085|      0|                api_ret_value = IV_FAIL;
 5086|      0|            }
 5087|  83.5k|        }
 5088|       |
 5089|   648k|        if(NOT_OK == ret)
  ------------------
  |  |  116|   648k|#define NOT_OK    -1
  ------------------
  |  Branch (5089:12): [True: 73.4k, False: 574k]
  ------------------
 5090|  73.4k|        {
 5091|  73.4k|            if(ps_dec->u4_pic_buf_got == 0)
  ------------------
  |  Branch (5091:16): [True: 67.0k, False: 6.48k]
  ------------------
 5092|  67.0k|            {
 5093|  67.0k|                ps_dec->i4_error_code = ERROR_START_CODE_NOT_FOUND;
 5094|  67.0k|                ps_dec_op->u4_error_code |= 1 << IVD_INSUFFICIENTDATA;
 5095|       |
 5096|  67.0k|                isvcd_fill_output_struct_from_context(ps_svc_lyr_dec, ps_dec_op);
 5097|       |
 5098|  67.0k|                ps_dec_op->u4_error_code = ps_dec->i4_error_code;
 5099|  67.0k|                ps_dec_op->u4_frame_decoded_flag = 0;
 5100|  67.0k|                return (IV_FAIL);
 5101|  67.0k|            }
 5102|  6.48k|            return (IV_SUCCESS);
 5103|  73.4k|        }
 5104|       |
 5105|   574k|        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|   574k|        {
 5110|   574k|            ps_cur_node = ps_svcd_ctxt->s_vcl_nal.ps_bot_node;
 5111|       |
 5112|   574k|            if(NULL != ps_cur_node)
  ------------------
  |  Branch (5112:16): [True: 155k, False: 419k]
  ------------------
 5113|   155k|            {
 5114|   155k|                if(!ps_cur_node->i4_idr_pic_flag)
  ------------------
  |  Branch (5114:20): [True: 32.9k, False: 122k]
  ------------------
 5115|  32.9k|                {
 5116|  32.9k|                    if(u1_num_res_lyrs != ps_svcd_ctxt->u1_prev_num_res_layers)
  ------------------
  |  Branch (5116:24): [True: 5.28k, False: 27.6k]
  ------------------
 5117|  5.28k|                    {
 5118|  5.28k|                        ps_svcd_ctxt->u1_exit_till_next_IDR = 1;
 5119|  5.28k|                        ps_dec_op->u4_error_code = ERROR_UNKNOWN_NAL;
 5120|  5.28k|                        return IV_FAIL;
 5121|  5.28k|                    }
 5122|  32.9k|                }
 5123|   122k|                else
 5124|   122k|                {
 5125|   122k|                    if(u1_num_res_lyrs != ps_svcd_ctxt->u1_prev_num_res_layers)
  ------------------
  |  Branch (5125:24): [True: 43.7k, False: 78.7k]
  ------------------
 5126|  43.7k|                    {
 5127|  43.7k|                        ps_svcd_ctxt->u1_prev_num_res_layers = u1_num_res_lyrs;
 5128|  43.7k|                    }
 5129|   122k|                }
 5130|   155k|            }
 5131|   574k|        }
 5132|   569k|        if(ps_svcd_ctxt->u1_prev_num_res_layers != u1_num_res_lyrs && (u1_num_res_lyrs != 0))
  ------------------
  |  Branch (5132:12): [True: 419k, False: 150k]
  |  Branch (5132:71): [True: 82, False: 419k]
  ------------------
 5133|     82|        {
 5134|     82|            ps_svc_lyr_dec = ps_svcd_ctxt->ps_svc_dec_lyr + u1_num_res_lyrs - 1;
 5135|     82|            ps_dec = &ps_svc_lyr_dec->s_dec;
 5136|       |
 5137|     82|            if(ps_dec->u1_init_dec_flag == 1)
  ------------------
  |  Branch (5137:16): [True: 3, False: 79]
  ------------------
 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|     82|        }
 5150|   569k|        ps_svcd_ctxt->u1_parse_nal_unit_error = 0;
 5151|       |
 5152|   569k|        if((1 == ps_svcd_ctxt->u1_exit_till_next_IDR) &&
  ------------------
  |  Branch (5152:12): [True: 54.6k, False: 515k]
  ------------------
 5153|  54.6k|           (ps_svcd_ctxt->s_vcl_nal.ps_bot_node != NULL))
  ------------------
  |  Branch (5153:12): [True: 54.3k, False: 298]
  ------------------
 5154|  54.3k|        {
 5155|  54.3k|            if(1 == ps_svcd_ctxt->s_vcl_nal.ps_bot_node->i4_idr_pic_flag)
  ------------------
  |  Branch (5155:16): [True: 48.6k, False: 5.74k]
  ------------------
 5156|  48.6k|            {
 5157|  48.6k|                ps_svcd_ctxt->u1_exit_till_next_IDR = 0;
 5158|       |
 5159|   127k|                for(u1_res_id = 0; u1_res_id < u1_num_res_lyrs; u1_res_id++)
  ------------------
  |  Branch (5159:36): [True: 78.6k, False: 48.6k]
  ------------------
 5160|  78.6k|                {
 5161|  78.6k|                    ps_svc_lyr_dec = ps_svcd_ctxt->ps_svc_dec_lyr + u1_res_id;
 5162|  78.6k|                    ps_dec = &ps_svc_lyr_dec->s_dec;
 5163|  78.6k|                    ih264_buf_mgr_reset(ps_dec->pv_pic_buf_mgr);
 5164|  78.6k|                    ih264_buf_mgr_reset(ps_dec->pv_mv_buf_mgr);
 5165|  78.6k|                }
 5166|  48.6k|            }
 5167|  5.74k|            else
 5168|  5.74k|            {
 5169|  5.74k|                ps_dec_op->u4_error_code = ERROR_UNKNOWN_NAL;
 5170|  5.74k|                return IV_FAIL;
 5171|  5.74k|            }
 5172|  54.3k|        }
 5173|       |
 5174|   563k|        if((0 == ps_dec->i4_decode_header) && (OK == ret))
  ------------------
  |  |  114|   144k|#define OK        0
  ------------------
  |  Branch (5174:12): [True: 144k, False: 419k]
  |  Branch (5174:47): [True: 135k, False: 9.27k]
  ------------------
 5175|   135k|        {
 5176|   135k|            flush_decode = 0;
 5177|   135k|            ps_cur_node = ps_svcd_ctxt->s_vcl_nal.ps_bot_node;
 5178|   135k|            ps_svc_lyr_zero_dec = ps_svcd_ctxt->ps_svc_dec_lyr;
 5179|   135k|            ps_dec_zero_lyr = &ps_svc_lyr_zero_dec->s_dec;
 5180|       |            /* master loop */
 5181|       |
 5182|   261k|            for(u1_res_id = 0; u1_res_id < u1_num_res_lyrs; u1_res_id++)
  ------------------
  |  Branch (5182:32): [True: 173k, False: 87.4k]
  ------------------
 5183|   173k|            {
 5184|   173k|                UWORD8 u1_layer_nal_data_present = 0;
 5185|   173k|                ps_svcd_ctxt->u1_cur_layer_id = u1_res_id;
 5186|   173k|                ps_svc_lyr_dec = ps_svcd_ctxt->ps_svc_dec_lyr + u1_res_id;
 5187|   173k|                ps_svc_lyr_dec->u1_res_init_done = 0;
 5188|   173k|                ps_dec = &ps_svc_lyr_dec->s_dec;
 5189|       |
 5190|   173k|                ps_dec->i4_decode_header = ps_dec_zero_lyr->i4_decode_header;
 5191|   173k|                ps_dec->i4_header_decoded = ps_dec_zero_lyr->i4_header_decoded;
 5192|   173k|                ps_dec->u1_pic_decode_done = 0;
 5193|   173k|                ps_dec->u4_fmt_conv_cur_row = 0;
 5194|       |
 5195|   173k|                ps_dec->u4_output_present = 0;
 5196|   173k|                ps_dec->s_disp_op.u4_error_code = 1;
 5197|   173k|                ps_dec->u4_fmt_conv_num_rows = FMT_CONV_NUM_ROWS;
  ------------------
  |  |   46|   173k|#define FMT_CONV_NUM_ROWS       16
  ------------------
 5198|   173k|                ps_dec->u4_ts = ps_dec_ip->u4_ts;
 5199|   173k|                ps_dec->i4_frametype = IV_NA_FRAME;
 5200|   173k|                ps_dec->i4_content_type = IV_CONTENTTYPE_NA;
 5201|       |
 5202|   173k|                ps_dec->u4_slice_start_code_found = 0;
 5203|   173k|                ps_dec->u4_cur_mb_addr = 0;
 5204|   173k|                ps_dec->u4_total_mbs_coded = 0;
 5205|   173k|                ps_dec->u2_cur_slice_num = 0;
 5206|   173k|                ps_dec->cur_dec_mb_num = 0;
 5207|   173k|                ps_dec->cur_recon_mb_num = 0;
 5208|   173k|                ps_dec->u4_first_slice_in_pic = 1;
 5209|   173k|                ps_dec->u1_slice_header_done = 0;
 5210|   173k|                ps_dec->u1_dangling_field = 0;
 5211|       |
 5212|   173k|                ps_dec->u4_dec_thread_created = 0;
 5213|   173k|                ps_dec->u4_bs_deblk_thread_created = 0;
 5214|   173k|                ps_dec->u4_cur_bs_mb_num = 0;
 5215|   173k|                ps_dec->u4_cur_deblk_mb_num = 0;
 5216|   173k|                ps_dec->u4_start_recon_deblk = 0;
 5217|   173k|                ps_dec->u4_sps_cnt_in_process = 0;
 5218|   173k|                ps_dec->u4_pic_buf_got = 0;
 5219|   173k|                ps_dec->pv_dec_out = ps_dec_op;
 5220|       |
 5221|   173k|                if(ps_dec_ip->u4_size >= offsetof(ivd_video_decode_ip_t, s_out_buffer))
  ------------------
  |  Branch (5221:20): [True: 173k, False: 0]
  ------------------
 5222|   173k|                    ps_dec->ps_out_buffer = &ps_dec_ip->s_out_buffer;
 5223|       |
 5224|   173k|                ps_dec->u1_nal_unit_type = ps_cur_node->i4_nal_unit_type;
 5225|   173k|                ps_dec->u1_separate_parse = 0;
 5226|   173k|                if(u1_res_id == (u1_num_res_lyrs - 1))
  ------------------
  |  Branch (5226:20): [True: 125k, False: 48.8k]
  ------------------
 5227|   125k|                {
 5228|   125k|                    ps_svc_lyr_dec->u1_layer_identifier = TARGET_LAYER;
  ------------------
  |  |  110|   125k|#define TARGET_LAYER 2
  ------------------
 5229|   125k|                    if(ps_dec->u4_num_cores >= 2)
  ------------------
  |  Branch (5229:24): [True: 63.6k, False: 61.4k]
  ------------------
 5230|  63.6k|                    {
 5231|  63.6k|                        ps_dec->u4_num_cores = 2;
 5232|  63.6k|                        ps_dec->u1_separate_parse = 1;
 5233|  63.6k|                    }
 5234|   125k|                }
 5235|  48.8k|                else if(u1_res_id == 0)
  ------------------
  |  Branch (5235:25): [True: 48.8k, False: 0]
  ------------------
 5236|  48.8k|                {
 5237|  48.8k|                    ps_svc_lyr_dec->u1_layer_identifier = BASE_LAYER;
  ------------------
  |  |  108|  48.8k|#define BASE_LAYER 0
  ------------------
 5238|  48.8k|                    ps_dec->u1_separate_parse = 0;
 5239|  48.8k|                    ps_dec->u4_num_cores = 1;
 5240|  48.8k|                }
 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|   173k|                ps_svc_lyr_dec->u1_base_res_flag = (0 == u1_res_id);
 5253|   173k|                ps_svc_lyr_dec->ps_nal_svc_ext->u1_idr_flag = ps_cur_node->i4_idr_pic_flag;
 5254|   173k|                ps_svc_lyr_dec->ps_nal_svc_ext->u1_dependency_id = ps_cur_node->i4_dependency_id;
 5255|   173k|                ps_svc_lyr_dec->ps_nal_svc_ext->u1_priority_id = ps_cur_node->i4_priority_id;
 5256|   173k|                ps_svc_lyr_dec->ps_nal_svc_ext->u1_no_inter_layer_pred_flag =
 5257|   173k|                    ps_cur_node->u1_acc_no_int_pred;
 5258|       |
 5259|   173k|                ps_svc_lyr_dec->ps_nal_svc_ext->u1_quality_id = ps_cur_node->i4_quality_id;
 5260|   173k|                ps_svc_lyr_dec->ps_nal_svc_ext->u1_temporal_id = ps_cur_node->i4_temporal_id;
 5261|       |
 5262|   173k|                ps_svc_lyr_dec->ps_nal_svc_ext->u1_use_ref_base_pic_flag =
 5263|   173k|                    ps_cur_node->i4_use_ref_base;
 5264|   173k|                ps_svc_lyr_dec->ps_nal_svc_ext->u1_discardable_flag = 0;
 5265|   173k|                ps_svc_lyr_dec->ps_nal_svc_ext->u1_svc_ext_flag = (u1_res_id > 1);
 5266|   173k|                ps_svc_lyr_dec->u4_pps_id_for_layer = UINT32_MAX;
 5267|   173k|                ps_vcl_buf = ps_cur_node->ps_first_vcl_nal;
 5268|   173k|                ps_svc_lyr_dec->u1_error_in_cur_frame = 0;
 5269|       |
 5270|       |                /* Only for Non target Layers*/
 5271|   173k|                if(NULL != ps_cur_node->ps_top_node)
  ------------------
  |  Branch (5271:20): [True: 61.7k, False: 112k]
  ------------------
 5272|  61.7k|                {
 5273|  61.7k|                    ps_svc_lyr_dec->u1_inter_lyr_disable_dblk_filter_idc =
 5274|  61.7k|                        ps_cur_node->ps_top_node->i4_inter_lyr_dblk_idc;
 5275|  61.7k|                    ps_svc_lyr_dec->i1_inter_lyr_slice_alpha_c0_offset =
 5276|  61.7k|                        ps_cur_node->ps_top_node->i4_inter_lyr_alpha_c0_offset;
 5277|  61.7k|                    ps_svc_lyr_dec->i1_inter_lyr_slice_beta_offset =
 5278|  61.7k|                        ps_cur_node->ps_top_node->i4_inter_lyr_beta_offset;
 5279|  61.7k|                }
 5280|       |
 5281|   238k|                while(NULL != ps_vcl_buf)
  ------------------
  |  Branch (5281:23): [True: 172k, False: 66.3k]
  ------------------
 5282|   172k|                {
 5283|   172k|                    u1_layer_nal_data_present = 1;
 5284|   172k|                    ps_dec->ps_bitstrm->u4_ofst = 0;
 5285|   172k|                    ps_dec->ps_bitstrm->pu4_buffer =
 5286|   172k|                        (UWORD32 *) ((UWORD8 *) ps_vcl_buf + ps_vcl_buf->i4_buf_offset +
 5287|   172k|                                     ps_vcl_buf->i4_slice_offset);
 5288|       |
 5289|   172k|                    ps_dec->ps_bitstrm->u4_max_ofst = ps_vcl_buf->u4_max_bits;
 5290|       |
 5291|   172k|                    ps_dec_op->u4_frame_decoded_flag = 0;
 5292|   172k|                    ret = isvcd_parse_nal_unit(ps_svc_lyr_dec, ps_cur_node->i4_nal_ref_idc);
 5293|   172k|                    if(ret != OK)
  ------------------
  |  |  114|   172k|#define OK        0
  ------------------
  |  Branch (5293:24): [True: 107k, False: 64.8k]
  ------------------
 5294|   107k|                    {
 5295|   107k|                        ps_svcd_ctxt->u1_parse_nal_unit_error = 1;
 5296|   107k|                        break;
 5297|   107k|                    }
 5298|       |
 5299|       |                    /* go to the next slice */
 5300|  64.8k|                    ps_vcl_buf = ps_vcl_buf->ps_next;
 5301|  64.8k|                }
 5302|       |                /* error concelment: exit till next IDR if a Layer data is missing */
 5303|   173k|                if(0 == u1_layer_nal_data_present)
  ------------------
  |  Branch (5303:20): [True: 6.75k, False: 167k]
  ------------------
 5304|  6.75k|                {
 5305|  6.75k|                    ps_svcd_ctxt->u1_exit_till_next_IDR = 1;
 5306|  6.75k|                    ps_dec_op->u4_error_code = ERROR_UNKNOWN_NAL;
 5307|  6.75k|                    return IV_FAIL;
 5308|  6.75k|                }
 5309|       |                /* error concelment: exit till next IDR if any of Non Target layers are
 5310|       |                 * corrupted */
 5311|   167k|                if((ret != OK) && (u1_res_id != (u1_num_res_lyrs - 1)))
  ------------------
  |  |  114|   167k|#define OK        0
  ------------------
  |  Branch (5311:20): [True: 107k, False: 59.5k]
  |  Branch (5311:35): [True: 9.51k, False: 98.0k]
  ------------------
 5312|  9.51k|                {
 5313|  9.51k|                    ps_svcd_ctxt->u1_exit_till_next_IDR = 1;
 5314|  9.51k|                    ps_dec_op->u4_error_code = ERROR_UNKNOWN_NAL;
 5315|  9.51k|                    return IV_FAIL;
 5316|  9.51k|                }
 5317|       |
 5318|   157k|                if((ret != OK) && (u1_res_id == (u1_num_res_lyrs - 1)))
  ------------------
  |  |  114|   157k|#define OK        0
  ------------------
  |  Branch (5318:20): [True: 98.0k, False: 59.5k]
  |  Branch (5318:35): [True: 98.0k, False: 0]
  ------------------
 5319|  98.0k|                {
 5320|  98.0k|                    ps_svc_lyr_dec = ps_svcd_ctxt->ps_svc_dec_lyr + u1_num_res_lyrs - 1;
 5321|  98.0k|                    ps_dec = &ps_svc_lyr_dec->s_dec;
 5322|       |
 5323|  98.0k|                    if((0 == ps_svcd_ctxt->u4_num_sps_ctr) || (0 == ps_svcd_ctxt->u4_num_pps_ctr) ||
  ------------------
  |  Branch (5323:24): [True: 0, False: 98.0k]
  |  Branch (5323:63): [True: 0, False: 98.0k]
  ------------------
 5324|  98.0k|                       (NULL == ps_dec->ps_cur_pps) || (ps_svc_lyr_dec->u1_res_init_done == 0))
  ------------------
  |  Branch (5324:24): [True: 13.6k, False: 84.4k]
  |  Branch (5324:56): [True: 17.4k, False: 66.9k]
  ------------------
 5325|  31.0k|                    {
 5326|  31.0k|                        ps_svcd_ctxt->u1_exit_till_next_IDR = 1;
 5327|  31.0k|                        ps_dec_op->u4_error_code = ERROR_UNKNOWN_NAL;
 5328|  31.0k|                        ih264d_signal_decode_thread(ps_dec);
 5329|  31.0k|                        return IV_FAIL;
 5330|  31.0k|                    }
 5331|  98.0k|                }
 5332|   126k|                ps_cur_node = ps_cur_node->ps_top_node;
 5333|       |
 5334|   126k|                if((ps_dec->u4_pic_buf_got == 1) && (ret != IVD_MEM_ALLOC_FAILED) &&
  ------------------
  |  Branch (5334:20): [True: 126k, False: 0]
  |  Branch (5334:53): [True: 126k, False: 0]
  ------------------
 5335|   126k|                   ps_dec->u4_total_mbs_coded < ps_dec->u2_frm_ht_in_mbs * ps_dec->u2_frm_wd_in_mbs)
  ------------------
  |  Branch (5335:20): [True: 94.0k, False: 32.5k]
  ------------------
 5336|  94.0k|                {
 5337|       |                    // last slice - missing/corruption
 5338|  94.0k|                    WORD32 num_mb_skipped;
 5339|  94.0k|                    WORD32 prev_slice_err;
 5340|  94.0k|                    pocstruct_t temp_poc;
 5341|  94.0k|                    WORD32 ret1;
 5342|  94.0k|                    WORD32 ht_in_mbs;
 5343|  94.0k|                    ht_in_mbs = ps_dec->u2_pic_ht >> (4 + ps_dec->ps_cur_slice->u1_field_pic_flag);
 5344|  94.0k|                    num_mb_skipped =
 5345|  94.0k|                        (ht_in_mbs * ps_dec->u2_frm_wd_in_mbs) - ps_dec->u4_total_mbs_coded;
 5346|       |
 5347|  94.0k|                    if(ps_dec->u4_first_slice_in_pic && (ps_dec->u4_pic_buf_got == 0))
  ------------------
  |  Branch (5347:24): [True: 0, False: 94.0k]
  |  Branch (5347:57): [True: 0, False: 0]
  ------------------
 5348|      0|                        prev_slice_err = 1;
 5349|  94.0k|                    else
 5350|  94.0k|                        prev_slice_err = 2;
 5351|       |
 5352|  94.0k|                    if(ps_dec->u4_total_mbs_coded == 0)
  ------------------
  |  Branch (5352:24): [True: 50.2k, False: 43.7k]
  ------------------
 5353|  50.2k|                    {
 5354|  50.2k|                        prev_slice_err = 1;
 5355|  50.2k|                    }
 5356|  94.0k|                    ret1 = isvcd_mark_err_slice_skip(
 5357|  94.0k|                        ps_svc_lyr_dec, num_mb_skipped, ps_dec->u1_nal_unit_type == IDR_SLICE_NAL,
  ------------------
  |  |  328|  94.0k|#define IDR_SLICE_NAL                   5
  ------------------
 5358|  94.0k|                        ps_dec->ps_cur_slice->u2_frame_num, &temp_poc, prev_slice_err);
 5359|       |
 5360|  94.0k|                    if((ret1 == ERROR_UNAVAIL_PICBUF_T) || (ret1 == ERROR_UNAVAIL_MVBUF_T) ||
  ------------------
  |  Branch (5360:24): [True: 0, False: 94.0k]
  |  Branch (5360:60): [True: 0, False: 94.0k]
  ------------------
 5361|  94.0k|                       (ret1 == ERROR_INV_SPS_PPS_T) || (ret1 == ERROR_CORRUPTED_SLICE) ||
  ------------------
  |  Branch (5361:24): [True: 0, False: 94.0k]
  |  Branch (5361:57): [True: 0, False: 94.0k]
  ------------------
 5362|  94.0k|                       (ret == NOT_OK))
  ------------------
  |  |  116|  94.0k|#define NOT_OK    -1
  ------------------
  |  Branch (5362:24): [True: 1.73k, False: 92.3k]
  ------------------
 5363|  1.73k|                    {
 5364|  1.73k|                        ret = ret1;
 5365|  1.73k|                    }
 5366|  94.0k|                }
 5367|       |
 5368|   126k|                if((ret == IVD_RES_CHANGED) || (ret == IVD_MEM_ALLOC_FAILED) ||
  ------------------
  |  Branch (5368:20): [True: 0, False: 126k]
  |  Branch (5368:48): [True: 0, False: 126k]
  ------------------
 5369|   126k|                   (ret == ERROR_UNAVAIL_PICBUF_T) || (ret == ERROR_UNAVAIL_MVBUF_T) ||
  ------------------
  |  Branch (5369:20): [True: 0, False: 126k]
  |  Branch (5369:55): [True: 0, False: 126k]
  ------------------
 5370|   126k|                   (ret == ERROR_INV_SPS_PPS_T) || (ret == ERROR_CORRUPTED_SLICE) ||
  ------------------
  |  Branch (5370:20): [True: 0, False: 126k]
  |  Branch (5370:52): [True: 645, False: 125k]
  ------------------
 5371|   125k|                   (ret == IVD_DISP_FRM_ZERO_OP_BUF_SIZE) || (ret == NOT_OK))
  ------------------
  |  |  116|   125k|#define NOT_OK    -1
  ------------------
  |  Branch (5371:20): [True: 0, False: 125k]
  |  Branch (5371:62): [True: 117, False: 125k]
  ------------------
 5372|    762|                {
 5373|    762|                    ps_svcd_ctxt->u1_exit_till_next_IDR = 1;
 5374|       |                    /* signal the decode thread */
 5375|    762|                    ih264d_signal_decode_thread(ps_dec);
 5376|       |                    /* dont consume bitstream for change in resolution case */
 5377|    762|                    if(ret == IVD_RES_CHANGED)
  ------------------
  |  Branch (5377:24): [True: 0, False: 762]
  ------------------
 5378|      0|                    {
 5379|      0|                        ps_dec_op->u4_num_bytes_consumed -= bytes_consumed;
 5380|      0|                    }
 5381|    762|                    return IV_FAIL;
 5382|    762|                }
 5383|       |
 5384|       |                /* Multi thread - for target Layer decoding*/
 5385|   125k|                if((ps_dec->u1_separate_parse) &&
  ------------------
  |  Branch (5385:20): [True: 49.5k, False: 76.3k]
  ------------------
 5386|  49.5k|                   (ps_svc_lyr_dec->u1_layer_identifier == TARGET_LAYER) &&
  ------------------
  |  |  110|  49.5k|#define TARGET_LAYER 2
  ------------------
  |  Branch (5386:20): [True: 49.5k, False: 0]
  ------------------
 5387|  49.5k|                   (0 == ps_svc_lyr_dec->u1_error_in_cur_frame))
  ------------------
  |  Branch (5387:20): [True: 6.74k, False: 42.7k]
  ------------------
 5388|  6.74k|                {
 5389|       |                    /* If Format conversion is not complete,
 5390|       |                     complete it here */
 5391|  6.74k|                    if(ps_dec->u4_num_cores == 2)
  ------------------
  |  Branch (5391:24): [True: 6.74k, False: 0]
  ------------------
 5392|  6.74k|                    {
 5393|       |                        /*do deblocking of all mbs*/
 5394|  6.74k|                        if((ps_dec->u4_nmb_deblk == 0) && (ps_dec->u4_start_recon_deblk == 1) &&
  ------------------
  |  Branch (5394:28): [True: 6.74k, False: 0]
  |  Branch (5394:59): [True: 6.74k, False: 0]
  ------------------
 5395|  6.74k|                           (ps_dec->ps_cur_sps->u1_mb_aff_flag == 0))
  ------------------
  |  Branch (5395:28): [True: 6.74k, False: 0]
  ------------------
 5396|  6.74k|                        {
 5397|  6.74k|                            UWORD8 u1_end_of_row = 0;
 5398|  6.74k|                            UWORD32 u4_max_addr;
 5399|  6.74k|                            tfr_ctxt_t s_tfr_ctxt = {0};
 5400|  6.74k|                            tfr_ctxt_t *ps_tfr_cxt = &s_tfr_ctxt;
 5401|  6.74k|                            pad_mgr_t *ps_pad_mgr = &ps_dec->s_pad_mgr;
 5402|  6.74k|                            UWORD32 u4_slice_end = 0;
 5403|       |
 5404|       |                            /*BS is done for all mbs while parsing*/
 5405|  6.74k|                            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|  6.74k|                            ih264d_init_deblk_tfr_ctxt(ps_dec, ps_pad_mgr, ps_tfr_cxt,
 5409|  6.74k|                                                       ps_dec->u2_frm_wd_in_mbs, 0);
 5410|       |
 5411|  6.74k|                            {
 5412|   148M|                                while(u4_slice_end != 1)
  ------------------
  |  Branch (5412:39): [True: 148M, False: 6.74k]
  ------------------
 5413|   148M|                                {
 5414|   148M|                                    dec_mb_info_t *p_cur_mb;
 5415|   148M|                                    WORD32 i, bs_mb_grp;
 5416|   148M|                                    bs_mb_grp = ps_dec->cur_dec_mb_num - ps_dec->u4_cur_bs_mb_num;
 5417|       |
 5418|   149M|                                    for(i = 0; i < bs_mb_grp; i++)
  ------------------
  |  Branch (5418:48): [True: 976k, False: 148M]
  ------------------
 5419|   976k|                                    {
 5420|   976k|                                        p_cur_mb =
 5421|   976k|                                            &ps_dec->ps_frm_mb_info[ps_dec->u4_cur_bs_mb_num];
 5422|       |
 5423|   976k|                                        DEBUG_THREADS_PRINTF("ps_dec->u4_cur_bs_mb_num = %d\n",
 5424|   976k|                                                             ps_dec->u4_cur_bs_mb_num);
 5425|   976k|                                        isvcd_compute_bs_non_mbaff_thread(ps_svc_lyr_dec, p_cur_mb,
 5426|   976k|                                                                          ps_dec->u4_cur_bs_mb_num);
 5427|       |
 5428|   976k|                                        ps_dec->u4_cur_bs_mb_num++;
 5429|   976k|                                        ps_dec->u4_bs_cur_slice_num_mbs++;
 5430|   976k|                                    }
 5431|   148M|                                    if(ps_dec->u4_cur_bs_mb_num > u4_max_addr)
  ------------------
  |  Branch (5431:40): [True: 6.74k, False: 148M]
  ------------------
 5432|  6.74k|                                    {
 5433|  6.74k|                                        u4_slice_end = 1;
 5434|  6.74k|                                        u1_end_of_row = 1;
 5435|  6.74k|                                    }
 5436|       |                                    /*deblock MB group*/
 5437|   148M|                                    {
 5438|   148M|                                        UWORD32 u4_num_mbs;
 5439|       |
 5440|   148M|                                        if(ps_dec->u4_cur_bs_mb_num > ps_dec->u4_cur_deblk_mb_num)
  ------------------
  |  Branch (5440:44): [True: 125M, False: 22.6M]
  ------------------
 5441|   125M|                                        {
 5442|   125M|                                            if(u1_end_of_row)
  ------------------
  |  Branch (5442:48): [True: 6.74k, False: 125M]
  ------------------
 5443|  6.74k|                                            {
 5444|  6.74k|                                                u4_num_mbs = ps_dec->u4_cur_bs_mb_num -
 5445|  6.74k|                                                             ps_dec->u4_cur_deblk_mb_num;
 5446|  6.74k|                                            }
 5447|   125M|                                            else
 5448|   125M|                                            {
 5449|   125M|                                                u4_num_mbs = ps_dec->u4_cur_bs_mb_num -
 5450|   125M|                                                             ps_dec->u4_cur_deblk_mb_num - 1;
 5451|   125M|                                            }
 5452|   125M|                                        }
 5453|  22.6M|                                        else
 5454|  22.6M|                                            u4_num_mbs = 0;
 5455|       |
 5456|   148M|                                        ih264d_check_mb_map_deblk(ps_dec, u4_num_mbs, ps_tfr_cxt,
 5457|   148M|                                                                  0);
 5458|   148M|                                    }
 5459|   148M|                                }
 5460|  6.74k|                            }
 5461|  6.74k|                        }
 5462|  6.74k|                    }
 5463|       |
 5464|       |                    /*signal the decode thread*/
 5465|  6.74k|                    ih264d_signal_decode_thread(ps_dec);
 5466|  6.74k|                }
 5467|   119k|                else if((ps_dec->u1_separate_parse) &&
  ------------------
  |  Branch (5467:25): [True: 42.7k, False: 76.3k]
  ------------------
 5468|  42.7k|                        (ps_svc_lyr_dec->u1_layer_identifier == TARGET_LAYER))
  ------------------
  |  |  110|  42.7k|#define TARGET_LAYER 2
  ------------------
  |  Branch (5468:25): [True: 42.7k, False: 0]
  ------------------
 5469|  42.7k|                {
 5470|       |                    /*signal the decode thread*/
 5471|  42.7k|                    ih264d_signal_decode_thread(ps_dec);
 5472|  42.7k|                }
 5473|       |
 5474|   125k|                DATA_SYNC();
  ------------------
  |  |  116|   125k|#define DATA_SYNC()  __sync_synchronize()
  ------------------
 5475|       |
 5476|   125k|                if((ps_dec_op->u4_error_code & 0xff) != ERROR_DYNAMIC_RESOLUTION_NOT_SUPPORTED)
  ------------------
  |  Branch (5476:20): [True: 125k, False: 0]
  ------------------
 5477|   125k|                {
 5478|   125k|                    ps_dec_op->u4_pic_wd = (UWORD32) ps_dec->u2_disp_width;
 5479|   125k|                    ps_dec_op->u4_pic_ht = (UWORD32) ps_dec->u2_disp_height;
 5480|   125k|                    ps_dec_op->i4_reorder_depth = ps_dec->i4_reorder_depth;
 5481|   125k|                }
 5482|       |
 5483|       |                // Report if header (sps and pps) has not been decoded yet
 5484|   125k|                if(ps_dec->i4_decode_header == 1 && ps_dec->i4_header_decoded != 3)
  ------------------
  |  Branch (5484:20): [True: 0, False: 125k]
  |  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|   125k|                if((ps_dec->u4_pic_buf_got == 1) && (ERROR_DANGLING_FIELD_IN_PIC != i4_err_status))
  ------------------
  |  Branch (5490:20): [True: 125k, False: 0]
  |  Branch (5490:53): [True: 125k, False: 0]
  ------------------
 5491|   125k|                {
 5492|       |                    /* For field pictures, set bottom and top picture decoded u4_flag correctly */
 5493|       |
 5494|   125k|                    if(ps_dec->ps_cur_slice->u1_field_pic_flag)
  ------------------
  |  Branch (5494:24): [True: 0, False: 125k]
  ------------------
 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;
  ------------------
  |  |   66|      0|#define BOT_FIELD_ONLY      0x01
  ------------------
 5499|      0|                        }
 5500|      0|                        else
 5501|      0|                        {
 5502|      0|                            ps_dec->u1_top_bottom_decoded |= TOP_FIELD_ONLY;
  ------------------
  |  |   65|      0|#define TOP_FIELD_ONLY      0x02
  ------------------
 5503|      0|                        }
 5504|      0|                    }
 5505|   125k|                    else
 5506|   125k|                    {
 5507|   125k|                        ps_dec->u1_top_bottom_decoded = TOP_FIELD_ONLY | BOT_FIELD_ONLY;
  ------------------
  |  |   65|   125k|#define TOP_FIELD_ONLY      0x02
  ------------------
                                      ps_dec->u1_top_bottom_decoded = TOP_FIELD_ONLY | BOT_FIELD_ONLY;
  ------------------
  |  |   66|   125k|#define BOT_FIELD_ONLY      0x01
  ------------------
 5508|   125k|                    }
 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|   125k|                    if((ps_dec->ps_dec_err_status->u1_err_flag & REJECT_CUR_PIC) == 0)
  ------------------
  |  |  602|   125k|#define REJECT_CUR_PIC    (0x01)
  ------------------
  |  Branch (5514:24): [True: 125k, False: 0]
  ------------------
 5515|   125k|                    {
 5516|       |                        /* Calling Function to deblock Picture and Display */
 5517|   125k|                        ret = ih264d_deblock_display(ps_dec);
 5518|   125k|                    }
 5519|       |
 5520|       |                    /*set to complete ,as we dont support partial frame decode*/
 5521|   125k|                    if(ps_dec->i4_header_decoded == 3)
  ------------------
  |  Branch (5521:24): [True: 125k, False: 0]
  ------------------
 5522|   125k|                    {
 5523|   125k|                        ps_dec->u4_total_mbs_coded = ps_dec->ps_cur_sps->u4_max_mb_addr + 1;
 5524|   125k|                    }
 5525|       |
 5526|       |                    /*Update the i4_frametype at the end of picture*/
 5527|   125k|                    if(ps_dec->ps_cur_slice->u1_nal_unit_type == IDR_SLICE_NAL)
  ------------------
  |  |  328|   125k|#define IDR_SLICE_NAL                   5
  ------------------
  |  Branch (5527:24): [True: 104k, False: 20.8k]
  ------------------
 5528|   104k|                    {
 5529|   104k|                        ps_dec->i4_frametype = IV_IDR_FRAME;
 5530|   104k|                    }
 5531|  20.8k|                    else if(ps_dec->i4_pic_type == B_SLICE)
  ------------------
  |  |  369|  20.8k|#define B_SLICE  1
  ------------------
  |  Branch (5531:29): [True: 15.0k, False: 5.81k]
  ------------------
 5532|  15.0k|                    {
 5533|  15.0k|                        ps_dec->i4_frametype = IV_B_FRAME;
 5534|  15.0k|                    }
 5535|  5.81k|                    else if(ps_dec->i4_pic_type == P_SLICE)
  ------------------
  |  |  368|  5.81k|#define P_SLICE  0
  ------------------
  |  Branch (5535:29): [True: 3.39k, False: 2.42k]
  ------------------
 5536|  3.39k|                    {
 5537|  3.39k|                        ps_dec->i4_frametype = IV_P_FRAME;
 5538|  3.39k|                    }
 5539|  2.42k|                    else if(ps_dec->i4_pic_type == I_SLICE)
  ------------------
  |  |  370|  2.42k|#define I_SLICE  2
  ------------------
  |  Branch (5539:29): [True: 2.20k, False: 224]
  ------------------
 5540|  2.20k|                    {
 5541|  2.20k|                        ps_dec->i4_frametype = IV_I_FRAME;
 5542|  2.20k|                    }
 5543|    224|                    else
 5544|    224|                    {
 5545|    224|                        H264_DEC_DEBUG_PRINT("Shouldn't come here\n");
  ------------------
  |  |   39|    224|#define H264_DEC_DEBUG_PRINT(...) {}
  ------------------
 5546|    224|                    }
 5547|       |
 5548|       |                    // Update the content type
 5549|   125k|                    ps_dec->i4_content_type = ps_dec->ps_cur_slice->u1_field_pic_flag;
 5550|       |
 5551|   125k|                    ps_dec->u4_total_frames_decoded = ps_dec->u4_total_frames_decoded + 2;
 5552|   125k|                    ps_dec->u4_total_frames_decoded =
 5553|   125k|                        ps_dec->u4_total_frames_decoded - ps_dec->ps_cur_slice->u1_field_pic_flag;
 5554|   125k|                }
 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|   125k|                if((IVD_DECODE_FRAME_OUT == ps_dec->e_frm_out_mode) && ps_dec->u1_init_dec_flag)
  ------------------
  |  Branch (5561:20): [True: 0, False: 125k]
  |  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|   125k|                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|   125k|                if((ps_svc_lyr_dec->u1_layer_identifier == TARGET_LAYER) &&
  ------------------
  |  |  110|   125k|#define TARGET_LAYER 2
  ------------------
  |  Branch (5583:20): [True: 87.4k, False: 38.3k]
  ------------------
 5584|  87.4k|                   ps_dec->u4_output_present &&
  ------------------
  |  Branch (5584:20): [True: 22.8k, False: 64.6k]
  ------------------
 5585|  22.8k|                   (ps_dec->u4_fmt_conv_cur_row < ps_dec->s_disp_frame_info.u4_y_ht))
  ------------------
  |  Branch (5585:20): [True: 8.86k, False: 13.9k]
  ------------------
 5586|  8.86k|                {
 5587|  8.86k|                    ps_dec->u4_fmt_conv_num_rows =
 5588|  8.86k|                        ps_dec->s_disp_frame_info.u4_y_ht - ps_dec->u4_fmt_conv_cur_row;
 5589|  8.86k|                    ih264d_format_convert(ps_dec, &(ps_dec->s_disp_op), ps_dec->u4_fmt_conv_cur_row,
 5590|  8.86k|                                          ps_dec->u4_fmt_conv_num_rows);
 5591|  8.86k|                    ps_dec->u4_fmt_conv_cur_row += ps_dec->u4_fmt_conv_num_rows;
 5592|  8.86k|                }
 5593|       |
 5594|   125k|                ih264d_release_display_field(ps_dec, &(ps_dec->s_disp_op));
 5595|       |
 5596|   125k|                if(ps_dec->i4_decode_header == 1 && (ps_dec->i4_header_decoded & 1) == 1)
  ------------------
  |  Branch (5596:20): [True: 0, False: 125k]
  |  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|   125k|                if((TOP_FIELD_ONLY | BOT_FIELD_ONLY) == ps_dec->u1_top_bottom_decoded)
  ------------------
  |  |   65|   125k|#define TOP_FIELD_ONLY      0x02
  ------------------
                              if((TOP_FIELD_ONLY | BOT_FIELD_ONLY) == ps_dec->u1_top_bottom_decoded)
  ------------------
  |  |   66|   125k|#define BOT_FIELD_ONLY      0x01
  ------------------
  |  Branch (5607:20): [True: 125k, False: 0]
  ------------------
 5608|   125k|                {
 5609|   125k|                    ps_dec->u1_top_bottom_decoded = 0;
 5610|   125k|                }
 5611|       |                /*--------------------------------------------------------------------*/
 5612|       |                /* Do End of Pic processing.                                          */
 5613|       |                /* Should be called only if frame was decoded in previous process call*/
 5614|       |                /*--------------------------------------------------------------------*/
 5615|   125k|                if(ps_dec->u4_pic_buf_got == 1)
  ------------------
  |  Branch (5615:20): [True: 125k, False: 0]
  ------------------
 5616|   125k|                {
 5617|   125k|                    if(1 == ps_dec->u1_last_pic_not_decoded)
  ------------------
  |  Branch (5617:24): [True: 0, False: 125k]
  ------------------
 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|   125k|                    else
 5627|   125k|                    {
 5628|   125k|                        ret = ih264d_end_of_pic(ps_dec);
 5629|   125k|                        if(ret != OK) return ret;
  ------------------
  |  |  114|   125k|#define OK        0
  ------------------
  |  Branch (5629:28): [True: 0, False: 125k]
  ------------------
 5630|   125k|                    }
 5631|   125k|                }
 5632|       |
 5633|   125k|                if(ps_dec->u1_enable_mb_info && ps_dec->u4_output_present)
  ------------------
  |  Branch (5633:20): [True: 0, False: 125k]
  |  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|                        ih264_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|                        ih264_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|   125k|                DATA_SYNC();
  ------------------
  |  |  116|   125k|#define DATA_SYNC()  __sync_synchronize()
  ------------------
 5657|       |
 5658|   125k|                H264_DEC_DEBUG_PRINT("The num bytes consumed: %d\n",
  ------------------
  |  |   39|   125k|#define H264_DEC_DEBUG_PRINT(...) {}
  ------------------
 5659|   125k|                                     ps_dec_op->u4_num_bytes_consumed);
 5660|   125k|            }
 5661|   135k|        }
 5662|       |        /* highest layer for flush validation */
 5663|       |
 5664|   515k|        if((ps_dec->u1_flushfrm) && (1 == flush_decode))
  ------------------
  |  Branch (5664:12): [True: 0, False: 515k]
  |  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|   515k|    }
 5724|       |
 5725|   515k|    if((ps_dec_op->u4_error_code & 0xff) != ERROR_DYNAMIC_RESOLUTION_NOT_SUPPORTED)
  ------------------
  |  Branch (5725:8): [True: 515k, False: 0]
  ------------------
 5726|   515k|    {
 5727|   515k|        ps_dec_op->u4_pic_wd = (UWORD32) ps_dec->u2_disp_width;
 5728|   515k|        ps_dec_op->u4_pic_ht = (UWORD32) ps_dec->u2_disp_height;
 5729|   515k|        ps_dec_op->i4_reorder_depth = ps_dec->i4_reorder_depth;
 5730|   515k|    }
 5731|   515k|    return api_ret_value;
 5732|   515k|}
isvcd_set_params:
 6163|  45.0k|{
 6164|  45.0k|    dec_struct_t *ps_dec;
 6165|  45.0k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 6166|  45.0k|    WORD32 ret = IV_SUCCESS;
 6167|  45.0k|    svc_dec_ctxt_t *ps_svcd_ctxt;
 6168|  45.0k|    WORD32 u1_layer_id;
 6169|       |
 6170|  45.0k|    ps_svcd_ctxt = (svc_dec_ctxt_t *) dec_hdl->pv_codec_handle;
 6171|  45.0k|    ps_svcd_ctxt->i4_eos_flag = 0;
 6172|   180k|    for(u1_layer_id = 0; u1_layer_id < MAX_NUM_RES_LYRS; u1_layer_id++)
  ------------------
  |  |   94|   180k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (6172:26): [True: 135k, False: 45.0k]
  ------------------
 6173|   135k|    {
 6174|   135k|        isvcd_ctl_set_config_ip_t *ps_h264d_ctl_ip = (isvcd_ctl_set_config_ip_t *) pv_api_ip;
 6175|   135k|        isvcd_ctl_set_config_op_t *ps_h264d_ctl_op = (isvcd_ctl_set_config_op_t *) pv_api_op;
 6176|   135k|        ivd_ctl_set_config_ip_t *ps_ctl_ip = &ps_h264d_ctl_ip->s_ivd_ctl_set_config_ip_t;
 6177|   135k|        ivd_ctl_set_config_op_t *ps_ctl_op = &ps_h264d_ctl_op->s_ivd_ctl_set_config_op_t;
 6178|       |
 6179|   135k|        ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[u1_layer_id];
 6180|   135k|        ps_dec = &ps_svc_lyr_dec->s_dec;
 6181|       |
 6182|   135k|        ps_dec->u1_flushfrm = 0;
 6183|   135k|        ps_dec->u4_skip_frm_mask = 0;
 6184|   135k|        ps_ctl_op->u4_error_code = 0;
 6185|       |
 6186|   135k|        if(ps_ctl_ip->e_frm_skip_mode != IVD_SKIP_NONE)
  ------------------
  |  Branch (6186:12): [True: 0, False: 135k]
  ------------------
 6187|      0|        {
 6188|      0|            ps_ctl_op->u4_error_code = (1 << IVD_UNSUPPORTEDPARAM);
 6189|      0|            ret = IV_FAIL;
 6190|      0|        }
 6191|       |
 6192|   135k|        if(ps_ctl_ip->u4_disp_wd >= ps_dec->u2_disp_width)
  ------------------
  |  Branch (6192:12): [True: 135k, False: 0]
  ------------------
 6193|   135k|        {
 6194|   135k|            ps_dec->u4_app_disp_width = ps_ctl_ip->u4_disp_wd;
 6195|   135k|        }
 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|   135k|        if(ps_ctl_ip->e_vid_dec_mode == IVD_DECODE_FRAME)
  ------------------
  |  Branch (6216:12): [True: 67.5k, False: 67.5k]
  ------------------
 6217|  67.5k|            ps_dec->i4_decode_header = 0;
 6218|  67.5k|        else if(ps_ctl_ip->e_vid_dec_mode == IVD_DECODE_HEADER)
  ------------------
  |  Branch (6218:17): [True: 67.5k, False: 0]
  ------------------
 6219|  67.5k|            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|   135k|        ps_dec->e_frm_out_mode = IVD_DISPLAY_FRAME_OUT;
 6227|       |
 6228|   135k|        if((ps_ctl_ip->e_frm_out_mode != IVD_DECODE_FRAME_OUT) &&
  ------------------
  |  Branch (6228:12): [True: 135k, False: 0]
  ------------------
 6229|   135k|           (ps_ctl_ip->e_frm_out_mode != IVD_DISPLAY_FRAME_OUT))
  ------------------
  |  Branch (6229:12): [True: 0, False: 135k]
  ------------------
 6230|      0|        {
 6231|      0|            ps_ctl_op->u4_error_code = (1 << IVD_UNSUPPORTEDPARAM);
 6232|      0|            ret = IV_FAIL;
 6233|      0|        }
 6234|   135k|        ps_dec->e_frm_out_mode = ps_ctl_ip->e_frm_out_mode;
 6235|   135k|    }
 6236|  45.0k|    return ret;
 6237|  45.0k|}
isvcd_set_target_layer:
 6260|  22.5k|{
 6261|  22.5k|    WORD32 ret = IV_SUCCESS;
 6262|       |
 6263|  22.5k|    isvcd_set_target_layer_ip_t *ps_ip;
 6264|  22.5k|    isvcd_set_target_layer_op_t *ps_op;
 6265|  22.5k|    svc_dec_ctxt_t *ps_svcd_ctxt;
 6266|  22.5k|    ps_svcd_ctxt = (svc_dec_ctxt_t *) dec_hdl->pv_codec_handle;
 6267|       |
 6268|  22.5k|    ps_ip = (isvcd_set_target_layer_ip_t *) pv_api_ip;
 6269|  22.5k|    ps_op = (isvcd_set_target_layer_op_t *) pv_api_op;
 6270|       |
 6271|  22.5k|    ps_svcd_ctxt->u1_tgt_dep_id = ps_ip->u1_tgt_dep_id;
 6272|  22.5k|    ps_svcd_ctxt->u1_tgt_quality_id = ps_ip->u1_tgt_quality_id;
 6273|  22.5k|    ps_svcd_ctxt->u1_tgt_temp_id = ps_ip->u1_tgt_temp_id;
 6274|  22.5k|    ps_svcd_ctxt->u1_tgt_priority_id = ps_ip->u1_tgt_priority_id;
 6275|       |
 6276|  22.5k|    ret = isvcd_nal_parse_set_target_attr(ps_ip->u1_tgt_quality_id, ps_ip->u1_tgt_dep_id,
 6277|  22.5k|                                          ps_ip->u1_tgt_temp_id, ps_ip->u1_tgt_priority_id,
 6278|  22.5k|                                          ps_svcd_ctxt->pv_nal_parse_ctxt);
 6279|  22.5k|    ps_op->u4_error_code = 0;
 6280|       |
 6281|  22.5k|    return ret;
 6282|  22.5k|}
isvcd_delete:
 6351|  22.5k|{
 6352|  22.5k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 6353|  22.5k|    isvcd_delete_ip_t *ps_ip = (isvcd_delete_ip_t *) pv_api_ip;
 6354|  22.5k|    isvcd_delete_op_t *ps_op = (isvcd_delete_op_t *) pv_api_op;
 6355|       |
 6356|  22.5k|    UWORD8 u1_layer_id;
 6357|  22.5k|    svc_dec_ctxt_t *ps_svcd_ctxt;
 6358|  22.5k|    ps_svcd_ctxt = (svc_dec_ctxt_t *) dec_hdl->pv_codec_handle;
 6359|  22.5k|    UNUSED(ps_ip);
  ------------------
  |  |   45|  22.5k|#define UNUSED(x) ((void)(x))
  ------------------
 6360|       |
 6361|  90.1k|    for(u1_layer_id = 0; u1_layer_id < MAX_NUM_RES_LYRS; u1_layer_id++)
  ------------------
  |  |   94|  90.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (6361:26): [True: 67.5k, False: 22.5k]
  ------------------
 6362|  67.5k|    {
 6363|  67.5k|        ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[u1_layer_id];
 6364|  67.5k|        isvcd_free_dynamic_bufs(ps_svc_lyr_dec);
 6365|  67.5k|    }
 6366|  22.5k|    isvcd_free_static_bufs(dec_hdl);
 6367|  22.5k|    ps_op->s_ivd_delete_op_t.u4_error_code = 0;
 6368|       |
 6369|  22.5k|    return IV_SUCCESS;
 6370|  22.5k|}
isvcd_reset:
 6393|  4.34k|{
 6394|  4.34k|    dec_struct_t *ps_dec;
 6395|  4.34k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 6396|  4.34k|    ivd_ctl_reset_op_t *ps_ctl_op = (ivd_ctl_reset_op_t *) pv_api_op;
 6397|  4.34k|    UWORD8 u1_layer_id;
 6398|  4.34k|    svc_dec_ctxt_t *ps_svcd_ctxt;
 6399|  4.34k|    ps_svcd_ctxt = (svc_dec_ctxt_t *) dec_hdl->pv_codec_handle;
 6400|  4.34k|    UNUSED(pv_api_ip);
  ------------------
  |  |   45|  4.34k|#define UNUSED(x) ((void)(x))
  ------------------
 6401|  4.34k|    ps_ctl_op->u4_error_code = 0;
 6402|       |
 6403|  4.34k|    ps_svcd_ctxt->i4_eos_flag = 0;
 6404|  4.34k|    ps_svcd_ctxt->u4_num_sps_ctr = 0;
 6405|  4.34k|    ps_svcd_ctxt->u4_num_pps_ctr = 0;
 6406|  4.34k|    ps_svcd_ctxt->u1_pre_parse_in_flush = 1;
 6407|  17.3k|    for(u1_layer_id = 0; u1_layer_id < MAX_NUM_RES_LYRS; u1_layer_id++)
  ------------------
  |  |   94|  17.3k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (6407:26): [True: 13.0k, False: 4.34k]
  ------------------
 6408|  13.0k|    {
 6409|  13.0k|        ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[u1_layer_id];
 6410|  13.0k|        ps_dec = &ps_svc_lyr_dec->s_dec;
 6411|  13.0k|        if(ps_dec != NULL)
  ------------------
  |  Branch (6411:12): [True: 13.0k, False: 0]
  ------------------
 6412|  13.0k|        {
 6413|  13.0k|            if(((buf_mgr_t *) ps_dec->pv_pic_buf_mgr)->pv_mutex != NULL)
  ------------------
  |  Branch (6413:16): [True: 801, False: 12.2k]
  ------------------
 6414|    801|                ih264_buf_mgr_free(ps_dec->pv_pic_buf_mgr);
 6415|  13.0k|            if(((buf_mgr_t *) ps_dec->pv_mv_buf_mgr)->pv_mutex != NULL)
  ------------------
  |  Branch (6415:16): [True: 801, False: 12.2k]
  ------------------
 6416|    801|                ih264_buf_mgr_free(ps_dec->pv_mv_buf_mgr);
 6417|       |
 6418|  13.0k|            isvcd_init_decoder(ps_svc_lyr_dec);
 6419|  13.0k|            ps_dec->u1_flushfrm = 0;
 6420|  13.0k|        }
 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|  13.0k|    }
 6427|  4.34k|    return IV_SUCCESS;
 6428|  4.34k|}
isvcd_ctl:
 6451|   116k|{
 6452|   116k|    ivd_ctl_set_config_ip_t *ps_ctl_ip;
 6453|   116k|    ivd_ctl_set_config_op_t *ps_ctl_op;
 6454|   116k|    WORD32 ret = IV_SUCCESS;
 6455|   116k|    UWORD32 subcommand;
 6456|   116k|    dec_struct_t *ps_dec;
 6457|   116k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 6458|   116k|    svc_dec_ctxt_t *ps_svcd_ctxt;
 6459|   116k|    ps_svcd_ctxt = (svc_dec_ctxt_t *) dec_hdl->pv_codec_handle;
 6460|   116k|    ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[ps_svcd_ctxt->u1_target_layer_id];
 6461|   116k|    ps_dec = &ps_svc_lyr_dec->s_dec;
 6462|   116k|    if(ps_dec->init_done != 1)
  ------------------
  |  Branch (6462:8): [True: 0, False: 116k]
  ------------------
 6463|      0|    {
 6464|      0|        return IV_FAIL;
 6465|      0|    }
 6466|   116k|    ps_ctl_ip = (ivd_ctl_set_config_ip_t *) pv_api_ip;
 6467|   116k|    ps_ctl_op = (ivd_ctl_set_config_op_t *) pv_api_op;
 6468|   116k|    ps_ctl_op->u4_error_code = 0;
 6469|   116k|    subcommand = ps_ctl_ip->e_sub_cmd;
 6470|       |
 6471|   116k|    switch(subcommand)
 6472|   116k|    {
 6473|      0|        case IVD_CMD_CTL_GETPARAMS:
  ------------------
  |  Branch (6473:9): [True: 0, False: 116k]
  ------------------
 6474|      0|            ret = isvcd_get_status(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 6475|      0|            break;
 6476|  45.0k|        case IVD_CMD_CTL_SETPARAMS:
  ------------------
  |  Branch (6476:9): [True: 45.0k, False: 71.9k]
  ------------------
 6477|  45.0k|            ret = isvcd_set_params(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 6478|  45.0k|            break;
 6479|  4.34k|        case IVD_CMD_CTL_RESET:
  ------------------
  |  Branch (6479:9): [True: 4.34k, False: 112k]
  ------------------
 6480|  4.34k|            ret = isvcd_reset(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 6481|  4.34k|            break;
 6482|      0|        case IVD_CMD_CTL_SETDEFAULT:
  ------------------
  |  Branch (6482:9): [True: 0, False: 116k]
  ------------------
 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: 116k]
  ------------------
 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: 116k]
  ------------------
 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: 116k]
  ------------------
 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: 116k]
  ------------------
 6495|      0|            ret = isvcd_set_degrade(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 6496|      0|            break;
 6497|       |
 6498|  22.5k|        case IH264D_CMD_CTL_SET_NUM_CORES:
  ------------------
  |  Branch (6498:9): [True: 22.5k, False: 94.4k]
  ------------------
 6499|  22.5k|            ret = isvcd_set_num_cores(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 6500|  22.5k|            break;
 6501|      0|        case IH264D_CMD_CTL_GET_BUFFER_DIMENSIONS:
  ------------------
  |  Branch (6501:9): [True: 0, False: 116k]
  ------------------
 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: 116k]
  ------------------
 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: 116k]
  ------------------
 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: 116k]
  ------------------
 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: 116k]
  ------------------
 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: 116k]
  ------------------
 6517|      0|            ret = isvcd_get_sei_ccv_params(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 6518|      0|            break;
 6519|  22.5k|        case IH264D_CMD_CTL_SET_PROCESSOR:
  ------------------
  |  Branch (6519:9): [True: 22.5k, False: 94.4k]
  ------------------
 6520|  22.5k|            ret = isvcd_set_processor(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 6521|  22.5k|            break;
 6522|  22.5k|        case ISVCD_CMD_CTL_SET_TGT_LAYER:
  ------------------
  |  Branch (6522:9): [True: 22.5k, False: 94.4k]
  ------------------
 6523|  22.5k|            ret = isvcd_set_target_layer(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 6524|  22.5k|            break;
 6525|      0|        default:
  ------------------
  |  Branch (6525:9): [True: 0, False: 116k]
  ------------------
 6526|      0|            H264_DEC_DEBUG_PRINT("\ndo nothing\n");
  ------------------
  |  |   39|      0|#define H264_DEC_DEBUG_PRINT(...) {}
  ------------------
 6527|      0|            break;
 6528|   116k|    }
 6529|       |
 6530|   116k|    return ret;
 6531|   116k|}
isvcd_set_num_cores:
 7120|  22.5k|{
 7121|  22.5k|    UWORD8 u1_layer_id;
 7122|  22.5k|    isvcd_ctl_set_num_cores_ip_t *ps_ip;
 7123|  22.5k|    isvcd_ctl_set_num_cores_op_t *ps_op;
 7124|  22.5k|    dec_struct_t *ps_dec;
 7125|  22.5k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 7126|  22.5k|    svc_dec_ctxt_t *ps_svcd_ctxt;
 7127|  22.5k|    ps_svcd_ctxt = (svc_dec_ctxt_t *) dec_hdl->pv_codec_handle;
 7128|       |
 7129|  22.5k|    ps_ip = (isvcd_ctl_set_num_cores_ip_t *) pv_api_ip;
 7130|  22.5k|    ps_op = (isvcd_ctl_set_num_cores_op_t *) pv_api_op;
 7131|  22.5k|    ps_op->u4_error_code = 0;
 7132|  90.1k|    for(u1_layer_id = 0; u1_layer_id < MAX_NUM_RES_LYRS; u1_layer_id++)
  ------------------
  |  |   94|  90.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (7132:26): [True: 67.5k, False: 22.5k]
  ------------------
 7133|  67.5k|    {
 7134|  67.5k|        ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[u1_layer_id];
 7135|  67.5k|        ps_dec = &ps_svc_lyr_dec->s_dec;
 7136|  67.5k|        ps_dec->u4_num_cores = ps_ip->u4_num_cores;
 7137|       |
 7138|  67.5k|        if(ps_dec->u4_num_cores == 1)
  ------------------
  |  Branch (7138:12): [True: 33.4k, False: 34.1k]
  ------------------
 7139|  33.4k|        {
 7140|  33.4k|            ps_dec->u1_separate_parse = 0;
 7141|  33.4k|        }
 7142|  34.1k|        else
 7143|  34.1k|        {
 7144|  34.1k|            ps_dec->u1_separate_parse = 1;
 7145|  34.1k|        }
 7146|       |
 7147|       |        /*using only upto three threads currently*/
 7148|  67.5k|        if(ps_dec->u4_num_cores > 3) ps_dec->u4_num_cores = 3;
  ------------------
  |  Branch (7148:12): [True: 17.4k, False: 50.0k]
  ------------------
 7149|  67.5k|    }
 7150|  22.5k|    return IV_SUCCESS;
 7151|  22.5k|}
isvcd_fill_output_struct_from_context:
 7175|   192k|{
 7176|   192k|    dec_struct_t *ps_dec;
 7177|   192k|    ps_dec = &ps_svc_lyr_dec->s_dec;
 7178|   192k|    if((ps_dec_op->u4_error_code & 0xff) != ERROR_DYNAMIC_RESOLUTION_NOT_SUPPORTED)
  ------------------
  |  Branch (7178:8): [True: 192k, False: 0]
  ------------------
 7179|   192k|    {
 7180|   192k|        ps_dec_op->u4_pic_wd = (UWORD32) ps_dec->u2_disp_width;
 7181|   192k|        ps_dec_op->u4_pic_ht = (UWORD32) ps_dec->u2_disp_height;
 7182|   192k|    }
 7183|   192k|    ps_dec_op->i4_reorder_depth = ps_dec->i4_reorder_depth;
 7184|   192k|    ps_dec_op->i4_display_index = ps_dec->i4_display_index;
 7185|   192k|    ps_dec_op->e_pic_type = ps_dec->i4_frametype;
 7186|       |
 7187|   192k|    ps_dec_op->u4_new_seq = 0;
 7188|   192k|    ps_dec_op->u4_output_present =
 7189|   192k|        (ps_svc_lyr_dec->u1_layer_identifier == TARGET_LAYER) ? ps_dec->u4_output_present : 0;
  ------------------
  |  |  110|   192k|#define TARGET_LAYER 2
  ------------------
  |  Branch (7189:9): [True: 88.6k, False: 104k]
  ------------------
 7190|   192k|    ps_dec_op->u4_progressive_frame_flag = ps_dec->s_disp_op.u4_progressive_frame_flag;
 7191|       |
 7192|   192k|    ps_dec_op->u4_is_ref_flag = 1;
 7193|   192k|    if(ps_dec_op->u4_frame_decoded_flag)
  ------------------
  |  Branch (7193:8): [True: 125k, False: 67.0k]
  ------------------
 7194|   125k|    {
 7195|   125k|        if(ps_dec->ps_cur_slice->u1_nal_ref_idc == 0) ps_dec_op->u4_is_ref_flag = 0;
  ------------------
  |  Branch (7195:12): [True: 16.5k, False: 109k]
  ------------------
 7196|   125k|    }
 7197|       |
 7198|   192k|    ps_dec_op->e_output_format = ps_dec->s_disp_op.e_output_format;
 7199|   192k|    ps_dec_op->s_disp_frm_buf = ps_dec->s_disp_op.s_disp_frm_buf;
 7200|   192k|    ps_dec_op->e4_fld_type = ps_dec->s_disp_op.e4_fld_type;
 7201|   192k|    ps_dec_op->u4_ts = ps_dec->s_disp_op.u4_ts;
 7202|   192k|    ps_dec_op->u4_disp_buf_id = ps_dec->s_disp_op.u4_disp_buf_id;
 7203|       |
 7204|   192k|    ih264d_export_sei_params(&ps_dec_op->s_sei_decode_op, ps_dec);
 7205|   192k|}
isvcd_api_function:
 7228|   881k|{
 7229|   881k|    UWORD32 command;
 7230|   881k|    UWORD32 *pu2_ptr_cmd;
 7231|   881k|    UWORD32 u4_api_ret;
 7232|   881k|    IV_API_CALL_STATUS_T e_status;
 7233|   881k|    e_status = api_check_struct_sanity(dec_hdl, pv_api_ip, pv_api_op);
 7234|       |
 7235|   881k|    if(e_status != IV_SUCCESS)
  ------------------
  |  Branch (7235:8): [True: 592, False: 881k]
  ------------------
 7236|    592|    {
 7237|    592|        UWORD32 *ptr_err;
 7238|       |
 7239|    592|        ptr_err = (UWORD32 *) pv_api_op;
 7240|    592|        UNUSED(ptr_err);
  ------------------
  |  |   45|    592|#define UNUSED(x) ((void)(x))
  ------------------
 7241|    592|        H264_DEC_DEBUG_PRINT("error code = %d\n", *(ptr_err + 1));
  ------------------
  |  |   39|    592|#define H264_DEC_DEBUG_PRINT(...) {}
  ------------------
 7242|    592|        return IV_FAIL;
 7243|    592|    }
 7244|       |
 7245|   881k|    pu2_ptr_cmd = (UWORD32 *) pv_api_ip;
 7246|   881k|    pu2_ptr_cmd++;
 7247|       |
 7248|   881k|    command = *pu2_ptr_cmd;
 7249|   881k|    switch(command)
 7250|   881k|    {
 7251|  22.5k|        case IVD_CMD_CREATE:
  ------------------
  |  Branch (7251:9): [True: 22.5k, False: 858k]
  ------------------
 7252|  22.5k|            u4_api_ret = isvcd_create(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 7253|  22.5k|            break;
 7254|  22.5k|        case IVD_CMD_DELETE:
  ------------------
  |  Branch (7254:9): [True: 22.5k, False: 858k]
  ------------------
 7255|  22.5k|            u4_api_ret = isvcd_delete(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 7256|  22.5k|            break;
 7257|       |
 7258|   719k|        case IVD_CMD_VIDEO_DECODE:
  ------------------
  |  Branch (7258:9): [True: 719k, False: 162k]
  ------------------
 7259|   719k|            u4_api_ret = isvcd_video_decode(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 7260|   719k|            break;
 7261|       |
 7262|      0|        case IVD_CMD_GET_DISPLAY_FRAME:
  ------------------
  |  Branch (7262:9): [True: 0, False: 881k]
  ------------------
 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: 881k]
  ------------------
 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: 881k]
  ------------------
 7273|      0|            u4_api_ret = isvcd_rel_display_frame(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 7274|      0|            break;
 7275|       |
 7276|   116k|        case IVD_CMD_VIDEO_CTL:
  ------------------
  |  Branch (7276:9): [True: 116k, False: 764k]
  ------------------
 7277|   116k|            u4_api_ret = isvcd_ctl(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 7278|   116k|            break;
 7279|      0|        default:
  ------------------
  |  Branch (7279:9): [True: 0, False: 881k]
  ------------------
 7280|      0|            u4_api_ret = IV_FAIL;
 7281|      0|            break;
 7282|   881k|    }
 7283|       |
 7284|   881k|    return u4_api_ret;
 7285|   881k|}
isvcd_api.c:api_check_struct_sanity:
  188|   881k|{
  189|   881k|    IVD_API_COMMAND_TYPE_T e_cmd;
  190|   881k|    UWORD32 *pu4_api_ip;
  191|   881k|    UWORD32 *pu4_api_op;
  192|   881k|    UWORD32 i;
  193|       |
  194|   881k|    if(NULL == pv_api_op) return (IV_FAIL);
  ------------------
  |  Branch (194:8): [True: 0, False: 881k]
  ------------------
  195|       |
  196|   881k|    if(NULL == pv_api_ip) return (IV_FAIL);
  ------------------
  |  Branch (196:8): [True: 0, False: 881k]
  ------------------
  197|       |
  198|   881k|    pu4_api_ip = (UWORD32 *) pv_api_ip;
  199|   881k|    pu4_api_op = (UWORD32 *) pv_api_op;
  200|   881k|    e_cmd = *(pu4_api_ip + 1);
  201|       |
  202|       |    /* error checks on handle */
  203|   881k|    switch((WORD32) e_cmd)
  204|   881k|    {
  205|  22.5k|        case IVD_CMD_CREATE:
  ------------------
  |  Branch (205:9): [True: 22.5k, False: 859k]
  ------------------
  206|  22.5k|            break;
  207|       |
  208|      0|        case IVD_CMD_REL_DISPLAY_FRAME:
  ------------------
  |  Branch (208:9): [True: 0, False: 881k]
  ------------------
  209|      0|        case IVD_CMD_SET_DISPLAY_FRAME:
  ------------------
  |  Branch (209:9): [True: 0, False: 881k]
  ------------------
  210|      0|        case IVD_CMD_GET_DISPLAY_FRAME:
  ------------------
  |  Branch (210:9): [True: 0, False: 881k]
  ------------------
  211|   719k|        case IVD_CMD_VIDEO_DECODE:
  ------------------
  |  Branch (211:9): [True: 719k, False: 162k]
  ------------------
  212|   742k|        case IVD_CMD_DELETE:
  ------------------
  |  Branch (212:9): [True: 22.5k, False: 859k]
  ------------------
  213|   859k|        case IVD_CMD_VIDEO_CTL:
  ------------------
  |  Branch (213:9): [True: 117k, False: 764k]
  ------------------
  214|   859k|            if(ps_handle == NULL)
  ------------------
  |  Branch (214:16): [True: 584, False: 858k]
  ------------------
  215|    584|            {
  216|    584|                *(pu4_api_op + 1) |= 1 << IVD_UNSUPPORTEDPARAM;
  217|    584|                *(pu4_api_op + 1) |= IVD_HANDLE_NULL;
  218|    584|                return IV_FAIL;
  219|    584|            }
  220|       |
  221|   858k|            if(ps_handle->u4_size != sizeof(iv_obj_t))
  ------------------
  |  Branch (221:16): [True: 0, False: 858k]
  ------------------
  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|   858k|            if(ps_handle->pv_fxns != isvcd_api_function)
  ------------------
  |  Branch (228:16): [True: 0, False: 858k]
  ------------------
  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|   858k|            if(ps_handle->pv_codec_handle == NULL)
  ------------------
  |  Branch (235:16): [True: 0, False: 858k]
  ------------------
  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|   858k|            break;
  242|   858k|        default:
  ------------------
  |  Branch (242:9): [True: 0, False: 881k]
  ------------------
  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|   881k|    }
  247|       |
  248|   881k|    switch((WORD32) e_cmd)
  ------------------
  |  Branch (248:12): [True: 881k, False: 0]
  ------------------
  249|   881k|    {
  250|  22.5k|        case IVD_CMD_CREATE:
  ------------------
  |  Branch (250:9): [True: 22.5k, False: 858k]
  ------------------
  251|  22.5k|        {
  252|  22.5k|            isvcd_create_ip_t *ps_ip = (isvcd_create_ip_t *) pv_api_ip;
  253|  22.5k|            isvcd_create_op_t *ps_op = (isvcd_create_op_t *) pv_api_op;
  254|       |
  255|  22.5k|            ps_op->s_ivd_create_op_t.u4_error_code = 0;
  256|       |
  257|  22.5k|            if((ps_ip->s_ivd_create_ip_t.u4_size > sizeof(isvcd_create_ip_t)) ||
  ------------------
  |  Branch (257:16): [True: 0, False: 22.5k]
  ------------------
  258|  22.5k|               (ps_ip->s_ivd_create_ip_t.u4_size < sizeof(ivd_create_ip_t)))
  ------------------
  |  Branch (258:16): [True: 0, False: 22.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|  22.5k|            if((ps_op->s_ivd_create_op_t.u4_size != sizeof(isvcd_create_op_t)) &&
  ------------------
  |  Branch (266:16): [True: 0, False: 22.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|  22.5k|            if((ps_ip->s_ivd_create_ip_t.e_output_format != IV_YUV_420P) &&
  ------------------
  |  Branch (275:16): [True: 12.9k, False: 9.58k]
  ------------------
  276|  12.9k|               (ps_ip->s_ivd_create_ip_t.e_output_format != IV_YUV_422ILE) &&
  ------------------
  |  Branch (276:16): [True: 12.9k, False: 3]
  ------------------
  277|  12.9k|               (ps_ip->s_ivd_create_ip_t.e_output_format != IV_RGB_565) &&
  ------------------
  |  Branch (277:16): [True: 12.9k, False: 4]
  ------------------
  278|  12.9k|               (ps_ip->s_ivd_create_ip_t.e_output_format != IV_YUV_420SP_UV) &&
  ------------------
  |  Branch (278:16): [True: 6.08k, False: 6.86k]
  ------------------
  279|  6.08k|               (ps_ip->s_ivd_create_ip_t.e_output_format != IV_YUV_420SP_VU))
  ------------------
  |  Branch (279:16): [True: 8, False: 6.07k]
  ------------------
  280|      8|            {
  281|      8|                ps_op->s_ivd_create_op_t.u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  282|      8|                ps_op->s_ivd_create_op_t.u4_error_code |= IVD_INIT_DEC_COL_FMT_NOT_SUPPORTED;
  283|      8|                H264_DEC_DEBUG_PRINT("\n");
  ------------------
  |  |   39|      8|#define H264_DEC_DEBUG_PRINT(...) {}
  ------------------
  284|      8|                return (IV_FAIL);
  285|      8|            }
  286|  22.5k|        }
  287|  22.5k|        break;
  288|       |
  289|  22.5k|        case IVD_CMD_GET_DISPLAY_FRAME:
  ------------------
  |  Branch (289:9): [True: 0, False: 881k]
  ------------------
  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: 881k]
  ------------------
  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: 881k]
  ------------------
  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|   719k|        case IVD_CMD_VIDEO_DECODE:
  ------------------
  |  Branch (417:9): [True: 719k, False: 162k]
  ------------------
  418|   719k|        {
  419|   719k|            isvcd_video_decode_ip_t *ps_ip = (isvcd_video_decode_ip_t *) pv_api_ip;
  420|   719k|            isvcd_video_decode_op_t *ps_op = (isvcd_video_decode_op_t *) pv_api_op;
  421|       |
  422|   719k|            H264_DEC_DEBUG_PRINT("The input bytes is: %d",
  ------------------
  |  |   39|   719k|#define H264_DEC_DEBUG_PRINT(...) {}
  ------------------
  423|   719k|                                 ps_ip->s_ivd_video_decode_ip_t.u4_num_Bytes);
  424|   719k|            ps_op->s_ivd_video_decode_op_t.u4_error_code = 0;
  425|       |
  426|   719k|            if(ps_ip->s_ivd_video_decode_ip_t.u4_size != sizeof(isvcd_video_decode_ip_t) &&
  ------------------
  |  Branch (426:16): [True: 0, False: 719k]
  ------------------
  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|   719k|            if(ps_op->s_ivd_video_decode_op_t.u4_size != sizeof(isvcd_video_decode_op_t) &&
  ------------------
  |  Branch (435:16): [True: 0, False: 719k]
  ------------------
  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|   719k|            {
  444|   719k|                svc_dec_ctxt_t *ps_svcd_ctxt;
  445|   719k|                svc_dec_lyr_struct_t *ps_svc_lyr_dec;
  446|   719k|                dec_struct_t *ps_dec;
  447|   719k|                ps_svcd_ctxt = (svc_dec_ctxt_t *) (ps_handle->pv_codec_handle);
  448|   719k|                ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[0];
  449|   719k|                ps_dec = &ps_svc_lyr_dec->s_dec;
  450|   719k|                if(ps_dec->u1_enable_mb_info)
  ------------------
  |  Branch (450:20): [True: 0, False: 719k]
  ------------------
  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|   719k|            }
  461|   719k|        }
  462|   719k|        break;
  463|       |
  464|   719k|        case IVD_CMD_DELETE:
  ------------------
  |  Branch (464:9): [True: 22.5k, False: 858k]
  ------------------
  465|  22.5k|        {
  466|  22.5k|            isvcd_delete_ip_t *ps_ip = (isvcd_delete_ip_t *) pv_api_ip;
  467|  22.5k|            isvcd_delete_op_t *ps_op = (isvcd_delete_op_t *) pv_api_op;
  468|       |
  469|  22.5k|            ps_op->s_ivd_delete_op_t.u4_error_code = 0;
  470|       |
  471|  22.5k|            if(ps_ip->s_ivd_delete_ip_t.u4_size != sizeof(isvcd_delete_ip_t))
  ------------------
  |  Branch (471:16): [True: 0, False: 22.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|  22.5k|            if(ps_op->s_ivd_delete_op_t.u4_size != sizeof(isvcd_delete_op_t))
  ------------------
  |  Branch (478:16): [True: 0, False: 22.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|  22.5k|        }
  485|  22.5k|        break;
  486|       |
  487|   116k|        case IVD_CMD_VIDEO_CTL:
  ------------------
  |  Branch (487:9): [True: 116k, False: 764k]
  ------------------
  488|   116k|        {
  489|   116k|            UWORD32 *pu4_ptr_cmd;
  490|   116k|            UWORD32 sub_command;
  491|       |
  492|   116k|            pu4_ptr_cmd = (UWORD32 *) pv_api_ip;
  493|   116k|            pu4_ptr_cmd += 2;
  494|   116k|            sub_command = *pu4_ptr_cmd;
  495|       |
  496|   116k|            switch(sub_command)
  497|   116k|            {
  498|  45.0k|                case IVD_CMD_CTL_SETPARAMS:
  ------------------
  |  Branch (498:17): [True: 45.0k, False: 71.9k]
  ------------------
  499|  45.0k|                {
  500|  45.0k|                    isvcd_ctl_set_config_ip_t *ps_ip;
  501|  45.0k|                    isvcd_ctl_set_config_op_t *ps_op;
  502|  45.0k|                    ps_ip = (isvcd_ctl_set_config_ip_t *) pv_api_ip;
  503|  45.0k|                    ps_op = (isvcd_ctl_set_config_op_t *) pv_api_op;
  504|       |
  505|  45.0k|                    if(ps_ip->s_ivd_ctl_set_config_ip_t.u4_size !=
  ------------------
  |  Branch (505:24): [True: 0, False: 45.0k]
  ------------------
  506|  45.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|  45.0k|                }
  514|  45.0k|                break;
  515|       |
  516|  45.0k|                case IVD_CMD_CTL_SETDEFAULT:
  ------------------
  |  Branch (516:17): [True: 0, False: 116k]
  ------------------
  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: 116k]
  ------------------
  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: 116k]
  ------------------
  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: 116k]
  ------------------
  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: 116k]
  ------------------
  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.34k|                case IVD_CMD_CTL_RESET:
  ------------------
  |  Branch (631:17): [True: 4.34k, False: 112k]
  ------------------
  632|  4.34k|                {
  633|  4.34k|                    isvcd_ctl_reset_ip_t *ps_ip;
  634|  4.34k|                    isvcd_ctl_reset_op_t *ps_op;
  635|  4.34k|                    ps_ip = (isvcd_ctl_reset_ip_t *) pv_api_ip;
  636|  4.34k|                    ps_op = (isvcd_ctl_reset_op_t *) pv_api_op;
  637|  4.34k|                    if(ps_ip->s_ivd_ctl_reset_ip_t.u4_size != sizeof(isvcd_ctl_reset_ip_t))
  ------------------
  |  Branch (637:24): [True: 0, False: 4.34k]
  ------------------
  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.34k|                    if(ps_op->s_ivd_ctl_reset_op_t.u4_size != sizeof(isvcd_ctl_reset_op_t))
  ------------------
  |  Branch (644:24): [True: 0, False: 4.34k]
  ------------------
  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.34k|                }
  652|  4.34k|                break;
  653|       |
  654|  4.34k|                case IH264D_CMD_CTL_DEGRADE:
  ------------------
  |  Branch (654:17): [True: 0, False: 116k]
  ------------------
  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: 116k]
  ------------------
  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: 116k]
  ------------------
  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: 116k]
  ------------------
  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: 116k]
  ------------------
  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: 116k]
  ------------------
  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: 116k]
  ------------------
  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|  22.5k|                case IH264D_CMD_CTL_SET_NUM_CORES:
  ------------------
  |  Branch (835:17): [True: 22.5k, False: 94.4k]
  ------------------
  836|  22.5k|                {
  837|  22.5k|                    isvcd_ctl_set_num_cores_ip_t *ps_ip;
  838|  22.5k|                    isvcd_ctl_set_num_cores_op_t *ps_op;
  839|       |
  840|  22.5k|                    ps_ip = (isvcd_ctl_set_num_cores_ip_t *) pv_api_ip;
  841|  22.5k|                    ps_op = (isvcd_ctl_set_num_cores_op_t *) pv_api_op;
  842|       |
  843|  22.5k|                    if(ps_ip->u4_size != sizeof(isvcd_ctl_set_num_cores_ip_t))
  ------------------
  |  Branch (843:24): [True: 0, False: 22.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|  22.5k|                    if(ps_op->u4_size != sizeof(isvcd_ctl_set_num_cores_op_t))
  ------------------
  |  Branch (850:24): [True: 0, False: 22.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|  22.5k|                    if((ps_ip->u4_num_cores != 1) && (ps_ip->u4_num_cores != 2) &&
  ------------------
  |  Branch (857:24): [True: 11.3k, False: 11.1k]
  |  Branch (857:54): [True: 7.59k, False: 3.77k]
  ------------------
  858|  7.59k|                       (ps_ip->u4_num_cores != 3) && (ps_ip->u4_num_cores != 4))
  ------------------
  |  Branch (858:24): [True: 5.82k, False: 1.76k]
  |  Branch (858:54): [True: 0, False: 5.82k]
  ------------------
  859|      0|                    {
  860|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  861|      0|                        return IV_FAIL;
  862|      0|                    }
  863|  22.5k|                    break;
  864|  22.5k|                }
  865|  22.5k|                case IH264D_CMD_CTL_SET_PROCESSOR:
  ------------------
  |  Branch (865:17): [True: 22.5k, False: 94.4k]
  ------------------
  866|  22.5k|                {
  867|  22.5k|                    isvcd_ctl_set_processor_ip_t *ps_ip;
  868|  22.5k|                    isvcd_ctl_set_processor_op_t *ps_op;
  869|       |
  870|  22.5k|                    ps_ip = (isvcd_ctl_set_processor_ip_t *) pv_api_ip;
  871|  22.5k|                    ps_op = (isvcd_ctl_set_processor_op_t *) pv_api_op;
  872|       |
  873|  22.5k|                    if(ps_ip->u4_size != sizeof(isvcd_ctl_set_processor_ip_t))
  ------------------
  |  Branch (873:24): [True: 0, False: 22.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|  22.5k|                    if(ps_op->u4_size != sizeof(isvcd_ctl_set_processor_op_t))
  ------------------
  |  Branch (880:24): [True: 0, False: 22.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|  22.5k|                    break;
  888|  22.5k|                }
  889|       |
  890|  22.5k|                case ISVCD_CMD_CTL_SET_TGT_LAYER:
  ------------------
  |  Branch (890:17): [True: 22.5k, False: 94.4k]
  ------------------
  891|  22.5k|                {
  892|  22.5k|                    isvcd_set_target_layer_ip_t *ps_ip;
  893|  22.5k|                    isvcd_set_target_layer_op_t *ps_op;
  894|       |
  895|  22.5k|                    ps_ip = (isvcd_set_target_layer_ip_t *) pv_api_ip;
  896|  22.5k|                    ps_op = (isvcd_set_target_layer_op_t *) pv_api_op;
  897|       |
  898|  22.5k|                    if(ps_ip->u4_size != sizeof(isvcd_set_target_layer_ip_t))
  ------------------
  |  Branch (898:24): [True: 0, False: 22.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|  22.5k|                    if(ps_ip->u1_tgt_dep_id > MAX_DEPENDENCY_ID)
  ------------------
  |  |  103|  22.5k|#define MAX_DEPENDENCY_ID 4
  ------------------
  |  Branch (905:24): [True: 0, False: 22.5k]
  ------------------
  906|      0|                    {
  907|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  908|      0|                        return IV_FAIL;
  909|      0|                    }
  910|       |
  911|  22.5k|                    if(ps_ip->u1_tgt_temp_id > MAX_TEMPORAL_ID)
  ------------------
  |  |  104|  22.5k|#define MAX_TEMPORAL_ID 7
  ------------------
  |  Branch (911:24): [True: 0, False: 22.5k]
  ------------------
  912|      0|                    {
  913|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  914|      0|                        return IV_FAIL;
  915|      0|                    }
  916|       |
  917|  22.5k|                    if(ps_ip->u1_tgt_quality_id > MAX_QUALITY_ID)
  ------------------
  |  |  102|  22.5k|#define MAX_QUALITY_ID 0
  ------------------
  |  Branch (917:24): [True: 0, False: 22.5k]
  ------------------
  918|      0|                    {
  919|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  920|      0|                        return IV_FAIL;
  921|      0|                    }
  922|       |
  923|  22.5k|                    if(ps_ip->u1_tgt_priority_id > MAX_PRIORITY_ID)
  ------------------
  |  |  105|  22.5k|#define MAX_PRIORITY_ID 63
  ------------------
  |  Branch (923:24): [True: 0, False: 22.5k]
  ------------------
  924|      0|                    {
  925|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  926|      0|                        return IV_FAIL;
  927|      0|                    }
  928|       |
  929|  22.5k|                    if(ps_op->u4_size != sizeof(isvcd_set_target_layer_op_t))
  ------------------
  |  Branch (929:24): [True: 0, False: 22.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|  22.5k|                    break;
  937|  22.5k|                }
  938|       |
  939|  22.5k|                default:
  ------------------
  |  Branch (939:17): [True: 0, False: 116k]
  ------------------
  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|   116k|            }
  945|   116k|        }
  946|   116k|        break;
  947|   881k|    }
  948|       |
  949|   881k|    return IV_SUCCESS;
  950|   881k|}

isvcd_init_cabac_contexts:
   77|  5.85k|{
   78|  5.85k|    bin_ctxt_model_t *p_cabac_ctxt_table_t = ps_dec->p_cabac_ctxt_table_t;
   79|  5.85k|    UWORD8 u1_qp_y = ps_dec->ps_cur_slice->u1_slice_qp;
   80|  5.85k|    UWORD8 u1_cabac_init_Idc = 0;
   81|       |
   82|  5.85k|    if(I_SLICE != u1_slice_type)
  ------------------
  |  |  370|  5.85k|#define I_SLICE  2
  ------------------
  |  Branch (82:8): [True: 4.71k, False: 1.13k]
  ------------------
   83|  4.71k|    {
   84|  4.71k|        u1_cabac_init_Idc = ps_dec->ps_cur_slice->u1_cabac_init_idc;
   85|  4.71k|    }
   86|       |
   87|  5.85k|    {
   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.85k|        ctxt_inc_mb_info_t *p_DefCtxt = ps_dec->p_ctxt_inc_mb_map - 1;
   92|  5.85k|        UWORD8 *pu1_temp;
   93|  5.85k|        WORD8 i;
   94|  5.85k|        p_DefCtxt->u1_mb_type = CAB_SKIP;
  ------------------
  |  |  402|  5.85k|#define CAB_SKIP          0x10 /* 0001 0000 */
  ------------------
   95|  5.85k|        p_DefCtxt->u1_cbp = 0x0f;
   96|  5.85k|        p_DefCtxt->u1_intra_chroma_pred_mode = 0;
   97|  5.85k|        p_DefCtxt->u1_yuv_dc_csbp = 0x7;
   98|  5.85k|        p_DefCtxt->u1_transform8x8_ctxt = 0;
   99|       |
  100|  5.85k|        pu1_temp = (UWORD8 *) p_DefCtxt->i1_ref_idx;
  101|  29.2k|        for(i = 0; i < 4; i++, pu1_temp++) (*pu1_temp) = 0;
  ------------------
  |  Branch (101:20): [True: 23.4k, False: 5.85k]
  ------------------
  102|  5.85k|        pu1_temp = (UWORD8 *) p_DefCtxt->u1_mv;
  103|  99.5k|        for(i = 0; i < 16; i++, pu1_temp++) (*pu1_temp) = 0;
  ------------------
  |  Branch (103:20): [True: 93.6k, False: 5.85k]
  ------------------
  104|  5.85k|        ps_dec->ps_def_ctxt_mb_info = p_DefCtxt;
  105|  5.85k|    }
  106|       |
  107|  5.85k|    if(u1_slice_type == I_SLICE)
  ------------------
  |  |  370|  5.85k|#define I_SLICE  2
  ------------------
  |  Branch (107:8): [True: 1.13k, False: 4.71k]
  ------------------
  108|  1.13k|    {
  109|  1.13k|        u1_cabac_init_Idc = 3;
  110|  1.13k|        ps_dec->p_mb_type_t = p_cabac_ctxt_table_t + MB_TYPE_I_SLICE;
  111|  1.13k|    }
  112|  4.71k|    else if(u1_slice_type == P_SLICE)
  ------------------
  |  |  368|  4.71k|#define P_SLICE  0
  ------------------
  |  Branch (112:13): [True: 2.42k, False: 2.29k]
  ------------------
  113|  2.42k|    {
  114|  2.42k|        ps_dec->p_mb_type_t = p_cabac_ctxt_table_t + MB_TYPE_P_SLICE;
  115|  2.42k|        ps_dec->p_mb_skip_flag_t = p_cabac_ctxt_table_t + MB_SKIP_FLAG_P_SLICE;
  116|  2.42k|        ps_dec->p_sub_mb_type_t = p_cabac_ctxt_table_t + SUB_MB_TYPE_P_SLICE;
  117|  2.42k|    }
  118|  2.29k|    else if(u1_slice_type == B_SLICE)
  ------------------
  |  |  369|  2.29k|#define B_SLICE  1
  ------------------
  |  Branch (118:13): [True: 2.29k, False: 0]
  ------------------
  119|  2.29k|    {
  120|  2.29k|        ps_dec->p_mb_type_t = p_cabac_ctxt_table_t + MB_TYPE_B_SLICE;
  121|  2.29k|        ps_dec->p_mb_skip_flag_t = p_cabac_ctxt_table_t + MB_SKIP_FLAG_B_SLICE;
  122|  2.29k|        ps_dec->p_sub_mb_type_t = p_cabac_ctxt_table_t + SUB_MB_TYPE_B_SLICE;
  123|  2.29k|    }
  124|  5.85k|    {
  125|  5.85k|        bin_ctxt_model_t *p_cabac_ctxt_table_t_tmp = p_cabac_ctxt_table_t;
  126|  5.85k|        if(ps_dec->ps_cur_slice->u1_field_pic_flag)
  ------------------
  |  Branch (126:12): [True: 0, False: 5.85k]
  ------------------
  127|      0|        {
  128|      0|            p_cabac_ctxt_table_t_tmp += SIGNIFICANT_COEFF_FLAG_FLD;
  129|      0|        }
  130|  5.85k|        else
  131|  5.85k|        {
  132|  5.85k|            p_cabac_ctxt_table_t_tmp += SIGNIFICANT_COEFF_FLAG_FRAME;
  133|  5.85k|        }
  134|  5.85k|        {
  135|  5.85k|            bin_ctxt_model_t **p_significant_coeff_flag_t = ps_dec->p_significant_coeff_flag_t;
  136|  5.85k|            p_significant_coeff_flag_t[0] = p_cabac_ctxt_table_t_tmp + SIG_COEFF_CTXT_CAT_0_OFFSET;
  137|  5.85k|            p_significant_coeff_flag_t[1] = p_cabac_ctxt_table_t_tmp + SIG_COEFF_CTXT_CAT_1_OFFSET;
  138|  5.85k|            p_significant_coeff_flag_t[2] = p_cabac_ctxt_table_t_tmp + SIG_COEFF_CTXT_CAT_2_OFFSET;
  139|  5.85k|            p_significant_coeff_flag_t[3] = p_cabac_ctxt_table_t_tmp + SIG_COEFF_CTXT_CAT_3_OFFSET;
  140|  5.85k|            p_significant_coeff_flag_t[4] = p_cabac_ctxt_table_t_tmp + SIG_COEFF_CTXT_CAT_4_OFFSET;
  141|       |
  142|  5.85k|            p_significant_coeff_flag_t[5] = p_cabac_ctxt_table_t_tmp + SIG_COEFF_CTXT_CAT_5_OFFSET;
  143|  5.85k|        }
  144|  5.85k|    }
  145|       |
  146|  5.85k|    memcpy(p_cabac_ctxt_table_t, gau1_isvcd_cabac_ctxt_init_table[u1_cabac_init_Idc][u1_qp_y],
  147|  5.85k|           NUM_CABAC_CTXTS_SVC * sizeof(bin_ctxt_model_t));
  ------------------
  |  |   46|  5.85k|#define NUM_CABAC_CTXTS_SVC 467
  ------------------
  148|  5.85k|}

isvcd_deblk_extract_bit_flags:
   65|  57.3k|{
   66|  57.3k|    WORD32 i4_i;
   67|  57.3k|    WORD32 i4_bit_mask;
   68|  57.3k|    UWORD16 u2_result = 0;
   69|       |
   70|  57.3k|    i4_bit_mask = i4_initial_bit_mask;
   71|       |
   72|   286k|    for(i4_i = 0; i4_i < NUM_SUB_MB_PARTS; i4_i++)
  ------------------
  |  |   60|   286k|#define NUM_SUB_MB_PARTS 4
  ------------------
  |  Branch (72:19): [True: 229k, False: 57.3k]
  ------------------
   73|   229k|    {
   74|   229k|        WORD32 i4_bit;
   75|       |        /* extract the bits of the last column 4x4 blocks */
   76|   229k|        if(0 == (i4_bit_mask & u2_bit_field))
  ------------------
  |  Branch (76:12): [True: 221k, False: 8.44k]
  ------------------
   77|   221k|        {
   78|   221k|            i4_bit = 0;
   79|   221k|        }
   80|  8.44k|        else
   81|  8.44k|        {
   82|  8.44k|            i4_bit = 1;
   83|  8.44k|        }
   84|       |        /* store the result */
   85|   229k|        u2_result |= i4_bit << i4_i;
   86|   229k|        i4_bit_mask <<= 4;
   87|       |
   88|   229k|    } /* end of loop over num sub Mb parts */
   89|  57.3k|    return (u2_result);
   90|  57.3k|}
isvcd_fill_bs_ibl:
   96|  1.07M|{
   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.07M|    UWORD16 u2_top_horz_nnz;
  107|  1.07M|    UWORD8 u1_top_mb_ibl, u1_left_mb_ibl;
  108|  1.07M|    UWORD32 i4_i, i4_edge;
  109|  1.07M|    UWORD8 u1_bs;
  110|  1.07M|    UWORD8 u1_cnd;
  111|  1.07M|    UWORD8 u1_top_intra;
  112|  1.07M|    UWORD8 u1_left_intra;
  113|  1.07M|    UWORD8 u1_p_nnz, u1_q_nnz;
  114|  1.07M|    UWORD8 u1_curr_mb_ibl;
  115|  1.07M|    UWORD32 *pu4_bs_table;
  116|  1.07M|    UWORD16 u2_curr_nnz;
  117|  1.07M|    UWORD8 u1_left_mb_nnz = 0, u1_left_nnz;
  118|  1.07M|    WORD32 i4_horz_start = 0;
  119|  1.07M|    WORD32 i4_vertical_start = 0;
  120|       |
  121|  1.07M|    pu4_bs_table = &(ps_deblk_mb->u4_bs_table[0]);
  122|       |
  123|  1.07M|    u1_top_mb_ibl = u1_top_mb_type & D_INTRA_IBL;
  ------------------
  |  |   72|  1.07M|#define D_INTRA_IBL 16
  ------------------
  124|  1.07M|    u1_left_mb_ibl = u1_left_mb_type & D_INTRA_IBL;
  ------------------
  |  |   72|  1.07M|#define D_INTRA_IBL 16
  ------------------
  125|       |
  126|  1.07M|    u1_curr_mb_ibl = ps_deblk_mb->u1_mb_type & D_INTRA_IBL;
  ------------------
  |  |   72|  1.07M|#define D_INTRA_IBL 16
  ------------------
  127|       |
  128|  1.07M|    u1_top_intra = u1_top_mb_type & D_INTRA_MB;
  ------------------
  |  |  382|  1.07M|#define D_INTRA_MB        1
  ------------------
  129|  1.07M|    u1_left_intra = u1_left_mb_type & D_INTRA_MB;
  ------------------
  |  |  382|  1.07M|#define D_INTRA_MB        1
  ------------------
  130|       |
  131|       |    /* return if none of the current top and left is IBL */
  132|  1.07M|    if((0 == u1_curr_mb_ibl) && (0 == u1_top_mb_ibl) && (0 == u1_left_mb_ibl))
  ------------------
  |  Branch (132:8): [True: 1.02M, False: 45.0k]
  |  Branch (132:33): [True: 1.01M, False: 8.48k]
  |  Branch (132:57): [True: 1.01M, False: 3.84k]
  ------------------
  133|  1.01M|    {
  134|  1.01M|        return;
  135|  1.01M|    }
  136|       |
  137|       |    /* set up the vertical and horz MB edge skip flags */
  138|  57.3k|    if(0 != u1_curr_mb_ibl)
  ------------------
  |  Branch (138:8): [True: 45.0k, False: 12.3k]
  ------------------
  139|  45.0k|    {
  140|       |        /* if top is not IBL */
  141|  45.0k|        if(0 == u1_top_mb_ibl)
  ------------------
  |  Branch (141:12): [True: 16.8k, False: 28.2k]
  ------------------
  142|  16.8k|        {
  143|  16.8k|            i4_horz_start = 1;
  144|  16.8k|        }
  145|       |
  146|       |        /* if left in not IBL */
  147|  45.0k|        if(0 == u1_left_mb_ibl)
  ------------------
  |  Branch (147:12): [True: 20.3k, False: 24.6k]
  ------------------
  148|  20.3k|        {
  149|  20.3k|            i4_vertical_start = 1;
  150|  20.3k|        }
  151|  45.0k|    }
  152|       |
  153|       |    /*******************************************************/
  154|       |    /* Fill BS for mb egdex assuming non IBL case          */
  155|       |    /*******************************************************/
  156|       |
  157|       |    /* only the  MB edges fall across IBL boundary */
  158|  57.3k|    if((0 != u1_curr_mb_ibl) || (0 != u1_top_mb_ibl) || (0 != u1_left_mb_ibl))
  ------------------
  |  Branch (158:8): [True: 45.0k, False: 12.3k]
  |  Branch (158:33): [True: 8.48k, False: 3.84k]
  |  Branch (158:57): [True: 3.84k, False: 0]
  ------------------
  159|  57.3k|    {
  160|  57.3k|        UWORD16 u2_temp, u2_i;
  161|  57.3k|        u2_temp = *pu2_left_res_luma_csbp;
  162|   286k|        for(u2_i = 0; u2_i < 4; u2_i++)
  ------------------
  |  Branch (162:23): [True: 229k, False: 57.3k]
  ------------------
  163|   229k|        {
  164|   229k|            u1_left_mb_nnz |= ((u2_temp & 0x08) >> (3 - u2_i));
  165|   229k|            u2_temp >>= 4;
  166|   229k|        }
  167|  57.3k|        u2_curr_nnz = *pu2_curr_res_luma_csbp;
  168|  57.3k|        u2_top_horz_nnz = *pu2_top_res_luma_csbp >> 12;
  169|       |
  170|       |        /* top is intra and not ibl */
  171|  57.3k|        if(0 != u1_top_intra)
  ------------------
  |  Branch (171:12): [True: 2.65k, False: 54.7k]
  ------------------
  172|  2.65k|        {
  173|  2.65k|            pu4_bs_table[0] = 0x04040404;
  174|  2.65k|        }
  175|       |        /* left is intra and not ibl */
  176|  57.3k|        if(0 != u1_left_intra)
  ------------------
  |  Branch (176:12): [True: 2.14k, False: 55.2k]
  ------------------
  177|  2.14k|        {
  178|  2.14k|            pu4_bs_table[4] = 0x04040404;
  179|  2.14k|        }
  180|       |
  181|       |        /* assume neighbours are inter and update bs */
  182|       |
  183|       |        /* Edge = 0 means Vert Edges and Edge = 1 means Horz edges */
  184|   172k|        for(i4_edge = 0; i4_edge < 2; i4_edge++)
  ------------------
  |  Branch (184:26): [True: 114k, False: 57.3k]
  ------------------
  185|   114k|        {
  186|   114k|            UWORD8 u1_p_nnz, u1_q_nnz;
  187|   114k|            UWORD32 u4_bs_edge = 0;
  188|   114k|            WORD32 i4_bit_mask;
  189|   114k|            WORD32 i4_curr_intra_flag;
  190|   114k|            WORD32 i4_neibor_intra_flag;
  191|       |
  192|   114k|            i4_curr_intra_flag = (0 != u1_curr_mb_ibl);
  193|       |
  194|   114k|            if(0 != i4_edge)
  ------------------
  |  Branch (194:16): [True: 57.3k, False: 57.3k]
  ------------------
  195|  57.3k|            {
  196|       |                /* Initialize for the TOP edge */
  197|  57.3k|                u1_p_nnz = (UWORD8) u2_top_horz_nnz;
  198|  57.3k|                u1_q_nnz = (UWORD8) (u2_curr_nnz & g_au4_extract_set[0]);
  199|  57.3k|                i4_neibor_intra_flag = (u1_top_mb_ibl || u1_top_intra);
  ------------------
  |  Branch (199:41): [True: 36.6k, False: 20.7k]
  |  Branch (199:58): [True: 2.65k, False: 18.0k]
  ------------------
  200|  57.3k|            }
  201|  57.3k|            else
  202|  57.3k|            {
  203|  57.3k|                u1_p_nnz = u1_left_mb_nnz;
  204|  57.3k|                u1_q_nnz = (UWORD8) isvcd_deblk_extract_bit_flags(u2_curr_nnz, 0x01);
  205|  57.3k|                i4_neibor_intra_flag = (u1_left_mb_ibl || u1_left_intra);
  ------------------
  |  Branch (205:41): [True: 29.5k, False: 27.8k]
  |  Branch (205:59): [True: 2.14k, False: 25.7k]
  ------------------
  206|  57.3k|            }
  207|       |
  208|   114k|            i4_bit_mask = 1;
  209|       |            /* find bs of 4 edges */
  210|   573k|            for(i4_i = 0; i4_i < 4; i4_i++)
  ------------------
  |  Branch (210:27): [True: 459k, False: 114k]
  ------------------
  211|   459k|            {
  212|   459k|                UWORD8 u1_p_nnz_temp, u1_q_nnz_temp;
  213|       |
  214|   459k|                u1_p_nnz_temp = (u1_p_nnz & i4_bit_mask);
  215|   459k|                u1_q_nnz_temp = (u1_q_nnz & i4_bit_mask);
  216|       |
  217|   459k|                u1_cnd = ((u1_p_nnz_temp && (!i4_neibor_intra_flag)) ||
  ------------------
  |  Branch (217:28): [True: 8.56k, False: 450k]
  |  Branch (217:45): [True: 3.83k, False: 4.72k]
  ------------------
  218|   455k|                          (u1_q_nnz_temp && (!i4_curr_intra_flag)));
  ------------------
  |  Branch (218:28): [True: 13.4k, False: 441k]
  |  Branch (218:45): [True: 1.69k, False: 11.7k]
  ------------------
  219|       |
  220|   459k|                u1_bs = u1_cnd ? 2 : 1;
  ------------------
  |  Branch (220:25): [True: 5.52k, False: 453k]
  ------------------
  221|       |
  222|       |                /* update the bs of the edge */
  223|   459k|                u4_bs_edge = (u4_bs_edge << 8) + u1_bs;
  224|   459k|                i4_bit_mask <<= 1;
  225|       |
  226|   459k|            } /* end of loop over blk edges */
  227|       |
  228|       |            /* update the bs of edges */
  229|   114k|            if(i4_edge && !u1_top_intra)
  ------------------
  |  Branch (229:16): [True: 57.3k, False: 57.3k]
  |  Branch (229:27): [True: 54.7k, False: 2.65k]
  ------------------
  230|  54.7k|            {
  231|  54.7k|                pu4_bs_table[0] = u4_bs_edge;
  232|  54.7k|            }
  233|  60.0k|            else if(!i4_edge && !u1_left_intra)
  ------------------
  |  Branch (233:21): [True: 57.3k, False: 2.65k]
  |  Branch (233:33): [True: 55.2k, False: 2.14k]
  ------------------
  234|  55.2k|            {
  235|  55.2k|                pu4_bs_table[4] = u4_bs_edge;
  236|  55.2k|            }
  237|   114k|        } /* end of loop over v1 vetical and horizontal edge */
  238|  57.3k|    }
  239|       |    /* current MB is IBL */
  240|  57.3k|    if(0 != u1_curr_mb_ibl)
  ------------------
  |  Branch (240:8): [True: 45.0k, False: 12.3k]
  ------------------
  241|  45.0k|    {
  242|  45.0k|        UWORD16 u2_temp, u2_i;
  243|  45.0k|        WORD32 i4_bit_mask_edge = 1;
  244|       |
  245|  45.0k|        u1_left_mb_nnz = 0;
  246|  45.0k|        u2_temp = ps_cur_mb_info->ps_left_mb->u2_luma_csbp;
  247|   225k|        for(u2_i = 0; u2_i < 4; u2_i++)
  ------------------
  |  Branch (247:23): [True: 180k, False: 45.0k]
  ------------------
  248|   180k|        {
  249|   180k|            u1_left_mb_nnz |= ((u2_temp & 0x08) >> (3 - u2_i));
  250|   180k|            u2_temp >>= 4;
  251|   180k|        }
  252|  45.0k|        u2_curr_nnz = ps_cur_mb_info->ps_curmb->u2_luma_csbp;
  253|  45.0k|        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|   225k|        for(i4_edge = 0; i4_edge < 4; i4_edge++)
  ------------------
  |  Branch (256:26): [True: 180k, False: 45.0k]
  ------------------
  257|   180k|        {
  258|   180k|            UWORD16 u2_curr_horz_nnz = 0;
  259|   180k|            WORD32 i4_bit_mask = 1;
  260|       |
  261|   180k|            u2_curr_horz_nnz = u2_curr_nnz & g_au4_extract_set[i4_edge];
  262|       |
  263|   180k|            u2_curr_horz_nnz = (u2_curr_horz_nnz >> (i4_edge * 4));
  264|       |
  265|   180k|            u1_left_nnz = (u1_left_mb_nnz & i4_bit_mask_edge);
  266|       |
  267|   901k|            for(i4_i = 0; i4_i < 4; i4_i++)
  ------------------
  |  Branch (267:27): [True: 721k, False: 180k]
  ------------------
  268|   721k|            {
  269|   721k|                UWORD8 u1_curr_nnz, u1_top_nnz;
  270|       |
  271|   721k|                u1_curr_nnz = (u2_curr_horz_nnz & i4_bit_mask);
  272|   721k|                u1_top_nnz = (u2_top_horz_nnz & i4_bit_mask);
  273|       |                /* update bs horizontal */
  274|       |
  275|   721k|                if(!((1 == i4_horz_start) && (0 == i4_edge)))
  ------------------
  |  Branch (275:22): [True: 269k, False: 451k]
  |  Branch (275:46): [True: 67.4k, False: 202k]
  ------------------
  276|   653k|                {
  277|   653k|                    u1_p_nnz = u1_top_nnz;
  278|   653k|                    u1_q_nnz = u1_curr_nnz;
  279|   653k|                    u1_cnd = !(u1_p_nnz || u1_q_nnz);
  ------------------
  |  Branch (279:32): [True: 21.1k, False: 632k]
  |  Branch (279:44): [True: 3.78k, False: 628k]
  ------------------
  280|   653k|                    u1_bs = u1_cnd ? 0 : 1;
  ------------------
  |  Branch (280:29): [True: 628k, False: 24.9k]
  ------------------
  281|   653k|                    pu4_bs_table[i4_edge] = (pu4_bs_table[i4_edge] << 8) + u1_bs;
  282|   653k|                }
  283|       |
  284|       |                /* update bs vertical */
  285|   721k|                if(!((1 == i4_vertical_start) && (0 == i4_i)))
  ------------------
  |  Branch (285:22): [True: 325k, False: 395k]
  |  Branch (285:50): [True: 81.4k, False: 244k]
  ------------------
  286|   639k|                {
  287|   639k|                    u1_p_nnz = u1_left_nnz;
  288|   639k|                    u1_q_nnz = u1_curr_nnz;
  289|   639k|                    u1_cnd = !(u1_p_nnz || u1_q_nnz);
  ------------------
  |  Branch (289:32): [True: 21.3k, False: 618k]
  |  Branch (289:44): [True: 2.95k, False: 615k]
  ------------------
  290|   639k|                    u1_bs = u1_cnd ? 0 : 1;
  ------------------
  |  Branch (290:29): [True: 615k, False: 24.3k]
  ------------------
  291|   639k|                    pu4_bs_table[i4_i + 4] = (pu4_bs_table[i4_i + 4] << 8) + u1_bs;
  292|   639k|                }
  293|       |                /* store the current nnz to left nnz */
  294|   721k|                u1_left_nnz = u1_curr_nnz;
  295|   721k|                i4_bit_mask <<= 1;
  296|   721k|            }
  297|       |            /* store the current row nnz to top row nnz */
  298|   180k|            u2_top_horz_nnz = u2_curr_horz_nnz;
  299|   180k|            i4_bit_mask_edge <<= 1;
  300|   180k|        }
  301|  45.0k|    }
  302|  57.3k|    return;
  303|  1.07M|}
isvcd_compute_bs_non_mbaff_target_lyr_no_inter_layer:
  327|  90.4k|{
  328|  90.4k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
  329|       |    /* Mvpred and Nnz for top and Courrent */
  330|  90.4k|    mv_pred_t *ps_cur_mv_pred, *ps_top_mv_pred = NULL, *ps_left_mv_pred;
  331|       |    /* deblk_mb_t Params */
  332|  90.4k|    deblk_mb_t *ps_cur_mb_params; /*< Parameters of current MacroBlock */
  333|  90.4k|    deblkmb_neighbour_t *ps_deblk_top_mb;
  334|       |
  335|       |    /* Reference Index to POC mapping*/
  336|  90.4k|    void **apv_map_ref_idx_to_poc;
  337|  90.4k|    UWORD32 u4_leftmbtype;
  338|       |
  339|  90.4k|    UWORD16 u2_left_csbp, u2_top_csbp, u2_cur_csbp;
  340|       |
  341|       |    /* Set of flags */
  342|  90.4k|    UWORD32 u4_cur_mb_intra, u1_top_mb_typ, u4_cur_mb_fld;
  343|  90.4k|    UWORD32 u1_cur_mb_type;
  344|  90.4k|    UWORD32 *pu4_bs_table;
  345|       |
  346|       |    /* Neighbour availability */
  347|       |    /* Initialization */
  348|  90.4k|    const UWORD32 u2_mbx = ps_cur_mb_info->u2_mbx;
  349|  90.4k|    const UWORD32 u2_mby = ps_cur_mb_info->u2_mby;
  350|  90.4k|    const UWORD32 u1_pingpong = u2_mbx & 0x01;
  351|       |
  352|  90.4k|    PROFILE_DISABLE_BOUNDARY_STRENGTH()
  ------------------
  |  |  125|  90.4k|#define PROFILE_DISABLE_BOUNDARY_STRENGTH() ;
  ------------------
  353|       |
  354|  90.4k|    ps_deblk_top_mb = ps_dec->ps_deblk_top_mb + u2_mbx;
  355|       |
  356|       |    /* Pointer assignment for Current DeblkMB, Current Mv Pred  */
  357|  90.4k|    ps_cur_mb_params = ps_dec->ps_deblk_mbn + u2_mbxn_mb;
  358|  90.4k|    ps_cur_mv_pred = ps_dec->ps_mv_cur + (u2_mbxn_mb << 4);
  359|       |
  360|  90.4k|    apv_map_ref_idx_to_poc = ps_dec->ppv_map_ref_idx_to_poc + 1;
  361|  90.4k|    u1_cur_mb_type = ps_cur_mb_params->u1_mb_type;
  362|  90.4k|    u1_top_mb_typ = ps_deblk_top_mb->u1_mb_type;
  363|  90.4k|    ps_deblk_top_mb->u1_mb_type = u1_cur_mb_type;
  364|       |
  365|  90.4k|    ps_cur_mb_params->u1_topmb_qp = ps_deblk_top_mb->u1_mb_qp;
  366|  90.4k|    ps_deblk_top_mb->u1_mb_qp = ps_cur_mb_params->u1_mb_qp;
  367|  90.4k|    ps_cur_mb_params->u1_left_mb_qp = ps_dec->deblk_left_mb[1].u1_mb_qp;
  368|  90.4k|    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|  90.4k|    if(ps_cur_mb_params->u1_deblocking_mode & MB_DISABLE_FILTERING)
  ------------------
  |  |   70|  90.4k|#define MB_DISABLE_FILTERING          0x01
  ------------------
  |  Branch (372:8): [True: 1.77k, False: 88.6k]
  ------------------
  373|  1.77k|    {
  374|  1.77k|        void **pu4_map_ref_idx_to_poc_l1 = apv_map_ref_idx_to_poc + POC_LIST_L0_TO_L1_DIFF;
  ------------------
  |  |   86|  1.77k|#define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
  |  |  ------------------
  |  |  |  |  600|  1.77k|#define MAX_FRAMES              16
  |  |  ------------------
  ------------------
  375|  1.77k|        {
  376|       |            /* Store Parameter for Top MvPred refernce frame Address */
  377|       |
  378|  1.77k|            void **ppv_top_mv_pred_addr = ps_cur_mb_info->ps_curmb->u4_pic_addrress;
  379|  1.77k|            WORD8 *p1_refTop0 = (ps_cur_mv_pred + 12)->i1_ref_frame;
  380|  1.77k|            WORD8 *p1_refTop1 = (ps_cur_mv_pred + 14)->i1_ref_frame;
  381|       |
  382|       |            /* Store Left addresses for Next Mb   */
  383|  1.77k|            void **ppv_left_mv_pred_addr = ps_dec->ps_left_mvpred_addr[!u1_pingpong][1].u4_add;
  384|  1.77k|            WORD8 *p1_refleft0 = (ps_cur_mv_pred + 3)->i1_ref_frame;
  385|       |
  386|  1.77k|            ppv_top_mv_pred_addr[0] = apv_map_ref_idx_to_poc[p1_refTop0[0]];
  387|  1.77k|            ppv_top_mv_pred_addr[1] = pu4_map_ref_idx_to_poc_l1[p1_refTop0[1]];
  388|       |
  389|  1.77k|            ppv_left_mv_pred_addr[2] = apv_map_ref_idx_to_poc[p1_refTop1[0]];
  390|  1.77k|            ppv_top_mv_pred_addr[2] = apv_map_ref_idx_to_poc[p1_refTop1[0]];
  391|  1.77k|            ppv_left_mv_pred_addr[3] = pu4_map_ref_idx_to_poc_l1[p1_refTop1[1]];
  392|  1.77k|            ppv_top_mv_pred_addr[3] = pu4_map_ref_idx_to_poc_l1[p1_refTop1[1]];
  393|       |
  394|  1.77k|            ppv_left_mv_pred_addr[0] = apv_map_ref_idx_to_poc[p1_refleft0[0]];
  395|  1.77k|            ppv_left_mv_pred_addr[1] = pu4_map_ref_idx_to_poc_l1[p1_refleft0[1]];
  396|       |            /* Storing the leftMbtype for next Mb */
  397|  1.77k|            ps_dec->deblk_left_mb[1].u1_mb_type = ps_cur_mb_params->u1_mb_type;
  398|  1.77k|        }
  399|       |
  400|  1.77k|        return;
  401|  1.77k|    }
  402|       |
  403|       |    /* Flag for extra left Edge */
  404|  88.6k|    ps_cur_mb_params->u1_single_call = 1;
  405|       |
  406|       |    /* Update the Left deblk_mb_t and Left MvPred Parameters           */
  407|  88.6k|    if(!u2_mbx)
  ------------------
  |  Branch (407:8): [True: 14.2k, False: 74.4k]
  ------------------
  408|  14.2k|    {
  409|  14.2k|        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.2k|        ps_left_mv_pred = ps_dec->ps_mv_cur + 3;
  415|  14.2k|    }
  416|  74.4k|    else
  417|  74.4k|    {
  418|  74.4k|        u4_leftmbtype = ps_dec->deblk_left_mb[1].u1_mb_type;
  419|       |
  420|       |        /* Come to Left Most Edge of the MB */
  421|  74.4k|        ps_left_mv_pred =
  422|  74.4k|            (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.1k, False: 217]
  ------------------
  423|  74.4k|    }
  424|       |
  425|  88.6k|    if(!u2_mby) u1_top_mb_typ = 0;
  ------------------
  |  Branch (425:8): [True: 23.1k, False: 65.5k]
  ------------------
  426|       |
  427|       |    /* MvPred Pointer Calculation */
  428|  88.6k|    ps_top_mv_pred = ps_cur_mv_pred - (ps_dec->u2_frm_wd_in_mbs << 4) + 12;
  429|       |
  430|  88.6k|    u4_cur_mb_intra = u1_cur_mb_type & D_INTRA_MB;
  ------------------
  |  |  382|  88.6k|#define D_INTRA_MB        1
  ------------------
  431|  88.6k|    u4_cur_mb_fld = !!(u1_cur_mb_type & D_FLD_MB);
  ------------------
  |  |  386|  88.6k|#define D_FLD_MB          0x80
  ------------------
  432|       |    /* Compute BS function */
  433|  88.6k|    pu4_bs_table = ps_cur_mb_params->u4_bs_table;
  434|       |
  435|  88.6k|    u2_cur_csbp = ps_cur_mb_info->ps_curmb->u2_luma_csbp;
  436|  88.6k|    u2_left_csbp = ps_cur_mb_info->ps_left_mb->u2_luma_csbp;
  437|  88.6k|    u2_top_csbp = ps_cur_mb_info->ps_top_mb->u2_luma_csbp;
  438|       |    /* Compute BS function */
  439|  88.6k|    if((ps_dec->ps_cur_sps->u1_profile_idc == HIGH_PROFILE_IDC) ||
  ------------------
  |  |  278|  88.6k|#define HIGH_PROFILE_IDC   100
  ------------------
  |  Branch (439:8): [True: 41.4k, False: 47.1k]
  ------------------
  440|  47.1k|       (ps_dec->ps_cur_sps->u1_profile_idc == SCALABLE_HIGH_PROFILE_IDC) ||
  ------------------
  |  |   60|  47.1k|#define SCALABLE_HIGH_PROFILE_IDC 86
  ------------------
  |  Branch (440:8): [True: 0, False: 47.1k]
  ------------------
  441|  47.1k|       (ps_dec->ps_cur_sps->u1_profile_idc == SCALABLE_BASELINE_PROFILE_IDC))
  ------------------
  |  |   59|  47.1k|#define SCALABLE_BASELINE_PROFILE_IDC 83
  ------------------
  |  Branch (441:8): [True: 0, False: 47.1k]
  ------------------
  442|  41.4k|    {
  443|  41.4k|        if(ps_cur_mb_info->u1_tran_form8x8 == 1)
  ------------------
  |  Branch (443:12): [True: 24.9k, False: 16.5k]
  ------------------
  444|  24.9k|        {
  445|  24.9k|            u2_cur_csbp = ih264d_update_csbp_8x8(ps_cur_mb_info->ps_curmb->u2_luma_csbp);
  446|  24.9k|        }
  447|       |
  448|  41.4k|        if(ps_cur_mb_info->ps_left_mb->u1_tran_form8x8 == 1)
  ------------------
  |  Branch (448:12): [True: 22.5k, False: 18.9k]
  ------------------
  449|  22.5k|        {
  450|  22.5k|            u2_left_csbp = ih264d_update_csbp_8x8(ps_cur_mb_info->ps_left_mb->u2_luma_csbp);
  451|  22.5k|        }
  452|       |
  453|  41.4k|        if(ps_cur_mb_info->ps_top_mb->u1_tran_form8x8 == 1)
  ------------------
  |  Branch (453:12): [True: 14.4k, False: 27.0k]
  ------------------
  454|  14.4k|        {
  455|  14.4k|            u2_top_csbp = ih264d_update_csbp_8x8(ps_cur_mb_info->ps_top_mb->u2_luma_csbp);
  456|  14.4k|        }
  457|  41.4k|    }
  458|  88.6k|    if(u4_cur_mb_intra)
  ------------------
  |  Branch (458:8): [True: 88.6k, False: 0]
  ------------------
  459|  88.6k|    {
  460|  88.6k|        pu4_bs_table[4] = 0x04040404;
  461|  88.6k|        pu4_bs_table[0] = u4_cur_mb_fld ? 0x03030303 : 0x04040404;
  ------------------
  |  Branch (461:27): [True: 0, False: 88.6k]
  ------------------
  462|  88.6k|        pu4_bs_table[1] = 0x03030303;
  463|  88.6k|        pu4_bs_table[2] = 0x03030303;
  464|  88.6k|        pu4_bs_table[3] = 0x03030303;
  465|  88.6k|        pu4_bs_table[5] = 0x03030303;
  466|  88.6k|        pu4_bs_table[6] = 0x03030303;
  467|  88.6k|        pu4_bs_table[7] = 0x03030303;
  468|  88.6k|    }
  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|  88.6k|    {
  489|  88.6k|        void **pu4_map_ref_idx_to_poc_l1 = apv_map_ref_idx_to_poc + POC_LIST_L0_TO_L1_DIFF;
  ------------------
  |  |   86|  88.6k|#define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
  |  |  ------------------
  |  |  |  |  600|  88.6k|#define MAX_FRAMES              16
  |  |  ------------------
  ------------------
  490|  88.6k|        {
  491|       |            /* Store Parameter for Top MvPred refernce frame Address */
  492|       |
  493|  88.6k|            void **ppv_top_mv_pred_addr = ps_cur_mb_info->ps_curmb->u4_pic_addrress;
  494|  88.6k|            WORD8 *p1_refTop0 = (ps_cur_mv_pred + 12)->i1_ref_frame;
  495|  88.6k|            WORD8 *p1_refTop1 = (ps_cur_mv_pred + 14)->i1_ref_frame;
  496|       |
  497|       |            /* Store Left addresses for Next Mb   */
  498|  88.6k|            void **ppv_left_mv_pred_addr = ps_dec->ps_left_mvpred_addr[!u1_pingpong][1].u4_add;
  499|  88.6k|            WORD8 *p1_refleft0 = (ps_cur_mv_pred + 3)->i1_ref_frame;
  500|       |
  501|  88.6k|            ppv_top_mv_pred_addr[0] = apv_map_ref_idx_to_poc[p1_refTop0[0]];
  502|  88.6k|            ppv_top_mv_pred_addr[1] = pu4_map_ref_idx_to_poc_l1[p1_refTop0[1]];
  503|       |
  504|  88.6k|            ppv_left_mv_pred_addr[2] = apv_map_ref_idx_to_poc[p1_refTop1[0]];
  505|  88.6k|            ppv_top_mv_pred_addr[2] = apv_map_ref_idx_to_poc[p1_refTop1[0]];
  506|  88.6k|            ppv_left_mv_pred_addr[3] = pu4_map_ref_idx_to_poc_l1[p1_refTop1[1]];
  507|  88.6k|            ppv_top_mv_pred_addr[3] = pu4_map_ref_idx_to_poc_l1[p1_refTop1[1]];
  508|       |
  509|  88.6k|            ppv_left_mv_pred_addr[0] = apv_map_ref_idx_to_poc[p1_refleft0[0]];
  510|  88.6k|            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|  88.6k|            ps_dec->deblk_left_mb[1].u1_mb_type = ps_cur_mb_params->u1_mb_type;
  514|  88.6k|        }
  515|  88.6k|    }
  516|       |
  517|       |    /* For transform 8x8 disable deblocking of the intrernal edges of a 8x8 block */
  518|  88.6k|    if(ps_cur_mb_info->u1_tran_form8x8)
  ------------------
  |  Branch (518:8): [True: 24.9k, False: 63.7k]
  ------------------
  519|  24.9k|    {
  520|  24.9k|        pu4_bs_table[1] = 0;
  521|  24.9k|        pu4_bs_table[3] = 0;
  522|  24.9k|        pu4_bs_table[5] = 0;
  523|  24.9k|        pu4_bs_table[7] = 0;
  524|  24.9k|    }
  525|  88.6k|}
isvcd_compute_bs_non_mbaff:
  547|  9.30k|{
  548|  9.30k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
  549|  9.30k|    ps_dec->pf_compute_bs(ps_dec, ps_cur_mb_info, u2_mbxn_mb);
  550|  9.30k|}
isvcd_compute_bs_non_mbaff_target_lyr:
  572|   137k|{
  573|   137k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
  574|       |    /* Mvpred and Nnz for top and Courrent */
  575|   137k|    mv_pred_t *ps_cur_mv_pred, *ps_top_mv_pred = NULL, *ps_left_mv_pred;
  576|       |    /* deblk_mb_t Params */
  577|   137k|    deblk_mb_t *ps_cur_mb_params; /*< Parameters of current MacroBlock */
  578|   137k|    deblkmb_neighbour_t *ps_deblk_top_mb;
  579|       |
  580|       |    /* Reference Index to POC mapping*/
  581|   137k|    void **apv_map_ref_idx_to_poc;
  582|   137k|    UWORD32 u4_leftmbtype;
  583|   137k|    UWORD16 u2_left_csbp, u2_top_csbp, u2_cur_csbp;
  584|       |
  585|       |    /* Set of flags */
  586|   137k|    UWORD32 u4_cur_mb_intra, u1_top_mb_typ, u4_cur_mb_fld;
  587|   137k|    UWORD32 u4_cur_mb_ibl;
  588|   137k|    UWORD32 u1_cur_mb_type;
  589|   137k|    UWORD32 *pu4_bs_table;
  590|       |
  591|   137k|    UWORD16 *pu2_curr_res_luma_csbp;
  592|   137k|    UWORD16 *pu2_left_res_luma_csbp;
  593|   137k|    UWORD16 *pu2_top_res_luma_csbp;
  594|       |
  595|       |    /* Neighbour availability */
  596|       |    /* Initialization */
  597|   137k|    const UWORD32 u2_mbx = ps_cur_mb_info->u2_mbx;
  598|   137k|    const UWORD32 u2_mby = ps_cur_mb_info->u2_mby;
  599|   137k|    const UWORD32 u1_pingpong = u2_mbx & 0x01;
  600|       |
  601|   137k|    PROFILE_DISABLE_BOUNDARY_STRENGTH()
  ------------------
  |  |  125|   137k|#define PROFILE_DISABLE_BOUNDARY_STRENGTH() ;
  ------------------
  602|       |
  603|   137k|    ps_deblk_top_mb = ps_dec->ps_deblk_top_mb + u2_mbx;
  604|       |
  605|       |    /* Pointer assignment for Current DeblkMB, Current Mv Pred  */
  606|   137k|    ps_cur_mb_params = ps_dec->ps_deblk_mbn + u2_mbxn_mb;
  607|   137k|    ps_cur_mv_pred = ps_dec->ps_mv_cur + (u2_mbxn_mb << 4);
  608|       |
  609|       |    /*Pointer assignment for Residual NNZ */
  610|   137k|    pu2_curr_res_luma_csbp = ps_svc_lyr_dec->pu2_frm_res_luma_csbp + ps_cur_mb_info->u2_mbx;
  611|   137k|    pu2_curr_res_luma_csbp += ps_cur_mb_info->u2_mby * ps_svc_lyr_dec->i4_frm_res_luma_csbp_stride;
  612|       |
  613|   137k|    pu2_left_res_luma_csbp = pu2_curr_res_luma_csbp - (ps_cur_mb_info->u2_mbx != 0);
  614|   137k|    pu2_top_res_luma_csbp = pu2_curr_res_luma_csbp - ((ps_cur_mb_info->u2_mby != 0) *
  615|   137k|                                                      ps_svc_lyr_dec->i4_frm_res_luma_csbp_stride);
  616|       |
  617|   137k|    apv_map_ref_idx_to_poc = ps_dec->ppv_map_ref_idx_to_poc + 1;
  618|   137k|    u1_cur_mb_type = ps_cur_mb_params->u1_mb_type;
  619|   137k|    u1_top_mb_typ = ps_deblk_top_mb->u1_mb_type;
  620|   137k|    ps_deblk_top_mb->u1_mb_type = u1_cur_mb_type;
  621|       |
  622|   137k|    ps_cur_mb_params->u1_topmb_qp = ps_deblk_top_mb->u1_mb_qp;
  623|   137k|    ps_deblk_top_mb->u1_mb_qp = ps_cur_mb_params->u1_mb_qp;
  624|   137k|    ps_cur_mb_params->u1_left_mb_qp = ps_dec->deblk_left_mb[1].u1_mb_qp;
  625|   137k|    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|   137k|    if(ps_cur_mb_params->u1_deblocking_mode & MB_DISABLE_FILTERING)
  ------------------
  |  |   70|   137k|#define MB_DISABLE_FILTERING          0x01
  ------------------
  |  Branch (629:8): [True: 8.43k, False: 128k]
  ------------------
  630|  8.43k|    {
  631|  8.43k|        void **pu4_map_ref_idx_to_poc_l1 = apv_map_ref_idx_to_poc + POC_LIST_L0_TO_L1_DIFF;
  ------------------
  |  |   86|  8.43k|#define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
  |  |  ------------------
  |  |  |  |  600|  8.43k|#define MAX_FRAMES              16
  |  |  ------------------
  ------------------
  632|       |
  633|       |        /* Store Parameter for Top MvPred refernce frame Address */
  634|  8.43k|        void **ppv_top_mv_pred_addr = ps_cur_mb_info->ps_curmb->u4_pic_addrress;
  635|  8.43k|        WORD8 *p1_refTop0 = (ps_cur_mv_pred + 12)->i1_ref_frame;
  636|  8.43k|        WORD8 *p1_refTop1 = (ps_cur_mv_pred + 14)->i1_ref_frame;
  637|       |
  638|       |        /* Store Left addresses for Next Mb   */
  639|  8.43k|        void **ppv_left_mv_pred_addr = ps_dec->ps_left_mvpred_addr[!u1_pingpong][1].u4_add;
  640|  8.43k|        WORD8 *p1_refleft0 = (ps_cur_mv_pred + 3)->i1_ref_frame;
  641|       |
  642|  8.43k|        ppv_top_mv_pred_addr[0] = apv_map_ref_idx_to_poc[p1_refTop0[0]];
  643|  8.43k|        ppv_top_mv_pred_addr[1] = pu4_map_ref_idx_to_poc_l1[p1_refTop0[1]];
  644|       |
  645|  8.43k|        ppv_left_mv_pred_addr[2] = apv_map_ref_idx_to_poc[p1_refTop1[0]];
  646|  8.43k|        ppv_top_mv_pred_addr[2] = apv_map_ref_idx_to_poc[p1_refTop1[0]];
  647|  8.43k|        ppv_left_mv_pred_addr[3] = pu4_map_ref_idx_to_poc_l1[p1_refTop1[1]];
  648|  8.43k|        ppv_top_mv_pred_addr[3] = pu4_map_ref_idx_to_poc_l1[p1_refTop1[1]];
  649|       |
  650|  8.43k|        ppv_left_mv_pred_addr[0] = apv_map_ref_idx_to_poc[p1_refleft0[0]];
  651|  8.43k|        ppv_left_mv_pred_addr[1] = pu4_map_ref_idx_to_poc_l1[p1_refleft0[1]];
  652|       |        /* Storing the leftMbtype for next Mb */
  653|  8.43k|        ps_dec->deblk_left_mb[1].u1_mb_type = ps_cur_mb_params->u1_mb_type;
  654|       |
  655|  8.43k|        return;
  656|  8.43k|    }
  657|       |
  658|       |    /* Flag for extra left Edge */
  659|   128k|    ps_cur_mb_params->u1_single_call = 1;
  660|       |
  661|       |    /* Update the Left deblk_mb_t and Left MvPred Parameters           */
  662|   128k|    if(!u2_mbx)
  ------------------
  |  Branch (662:8): [True: 37.1k, False: 91.4k]
  ------------------
  663|  37.1k|    {
  664|  37.1k|        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|  37.1k|        ps_left_mv_pred = ps_dec->ps_mv_cur + 3;
  670|  37.1k|    }
  671|  91.4k|    else
  672|  91.4k|    {
  673|  91.4k|        u4_leftmbtype = ps_dec->deblk_left_mb[1].u1_mb_type;
  674|       |
  675|       |        /* Come to Left Most Edge of the MB */
  676|  91.4k|        ps_left_mv_pred =
  677|  91.4k|            (u2_mbxn_mb) ? ps_dec->ps_mv_cur + ((u2_mbxn_mb - 1) << 4) + 3 : ps_dec->ps_mv_left + 3;
  ------------------
  |  Branch (677:13): [True: 91.1k, False: 310]
  ------------------
  678|  91.4k|    }
  679|       |
  680|   128k|    if(!u2_mby) u1_top_mb_typ = 0;
  ------------------
  |  Branch (680:8): [True: 20.1k, False: 108k]
  ------------------
  681|       |
  682|       |    /* MvPred Pointer Calculation */
  683|   128k|    ps_top_mv_pred = ps_cur_mv_pred - (ps_dec->u2_frm_wd_in_mbs << 4) + 12;
  684|   128k|    u4_cur_mb_intra = u1_cur_mb_type & D_INTRA_MB;
  ------------------
  |  |  382|   128k|#define D_INTRA_MB        1
  ------------------
  685|   128k|    u4_cur_mb_ibl = u1_cur_mb_type & D_INTRA_IBL;
  ------------------
  |  |   72|   128k|#define D_INTRA_IBL 16
  ------------------
  686|   128k|    u4_cur_mb_fld = !!(u1_cur_mb_type & D_FLD_MB);
  ------------------
  |  |  386|   128k|#define D_FLD_MB          0x80
  ------------------
  687|       |    /* Compute BS function */
  688|   128k|    pu4_bs_table = ps_cur_mb_params->u4_bs_table;
  689|       |
  690|   128k|    u2_cur_csbp = ps_cur_mb_info->ps_curmb->u2_luma_csbp;
  691|   128k|    u2_left_csbp = ps_cur_mb_info->ps_left_mb->u2_luma_csbp;
  692|   128k|    u2_top_csbp = ps_cur_mb_info->ps_top_mb->u2_luma_csbp;
  693|       |    /* Compute BS function */
  694|   128k|    if((ps_dec->ps_cur_sps->u1_profile_idc == HIGH_PROFILE_IDC) ||
  ------------------
  |  |  278|   128k|#define HIGH_PROFILE_IDC   100
  ------------------
  |  Branch (694:8): [True: 2.93k, False: 125k]
  ------------------
  695|   125k|       (ps_dec->ps_cur_sps->u1_profile_idc == SCALABLE_HIGH_PROFILE_IDC) ||
  ------------------
  |  |   60|   125k|#define SCALABLE_HIGH_PROFILE_IDC 86
  ------------------
  |  Branch (695:8): [True: 15.9k, False: 109k]
  ------------------
  696|   109k|       (ps_dec->ps_cur_sps->u1_profile_idc == SCALABLE_BASELINE_PROFILE_IDC))
  ------------------
  |  |   59|   109k|#define SCALABLE_BASELINE_PROFILE_IDC 83
  ------------------
  |  Branch (696:8): [True: 26.6k, False: 83.1k]
  ------------------
  697|  45.5k|    {
  698|  45.5k|        if(ps_cur_mb_info->u1_tran_form8x8 == 1)
  ------------------
  |  Branch (698:12): [True: 4.49k, False: 41.0k]
  ------------------
  699|  4.49k|        {
  700|  4.49k|            u2_cur_csbp = ih264d_update_csbp_8x8(ps_cur_mb_info->ps_curmb->u2_luma_csbp);
  701|  4.49k|            ps_cur_mb_info->ps_curmb->u2_luma_csbp = u2_cur_csbp;
  702|  4.49k|        }
  703|  45.5k|    }
  704|   128k|    u2_cur_csbp |= *pu2_curr_res_luma_csbp;
  705|   128k|    u2_left_csbp |= *pu2_left_res_luma_csbp;
  706|   128k|    u2_top_csbp |= *pu2_top_res_luma_csbp;
  707|       |
  708|   128k|    if(u4_cur_mb_intra)
  ------------------
  |  Branch (708:8): [True: 8.67k, False: 119k]
  ------------------
  709|  8.67k|    {
  710|  8.67k|        pu4_bs_table[4] = 0x04040404;
  711|  8.67k|        pu4_bs_table[0] = u4_cur_mb_fld ? 0x03030303 : 0x04040404;
  ------------------
  |  Branch (711:27): [True: 0, False: 8.67k]
  ------------------
  712|  8.67k|        pu4_bs_table[1] = 0x03030303;
  713|  8.67k|        pu4_bs_table[2] = 0x03030303;
  714|  8.67k|        pu4_bs_table[3] = 0x03030303;
  715|  8.67k|        pu4_bs_table[5] = 0x03030303;
  716|  8.67k|        pu4_bs_table[6] = 0x03030303;
  717|  8.67k|        pu4_bs_table[7] = 0x03030303;
  718|  8.67k|    }
  719|   119k|    else
  720|   119k|    {
  721|   119k|        isvcd_fill_bs_ibl(ps_cur_mb_params, u1_top_mb_typ, u4_leftmbtype, ps_cur_mb_info,
  722|   119k|                          pu2_curr_res_luma_csbp, pu2_left_res_luma_csbp, pu2_top_res_luma_csbp);
  723|       |
  724|   119k|        if(!u4_cur_mb_ibl)
  ------------------
  |  Branch (724:12): [True: 93.2k, False: 26.7k]
  ------------------
  725|  93.2k|        {
  726|  93.2k|            UWORD32 u4_is_non16x16 = !!(u1_cur_mb_type & D_PRED_NON_16x16);
  ------------------
  |  |  383|  93.2k|#define D_PRED_NON_16x16  2
  ------------------
  727|  93.2k|            UWORD32 u4_is_b = ps_dec->u1_B;
  728|  93.2k|            UWORD32 u4_bs_0, u4_bs_4;
  729|       |
  730|  93.2k|            u4_bs_0 = pu4_bs_table[0];
  731|  93.2k|            u4_bs_4 = pu4_bs_table[4];
  732|       |
  733|  93.2k|            ih264d_fill_bs2_horz_vert(pu4_bs_table, u2_left_csbp, u2_top_csbp, u2_cur_csbp,
  734|  93.2k|                                      (const UWORD32 *) (gau4_ih264d_packed_bs2),
  735|  93.2k|                                      (const UWORD16 *) (gau2_ih264d_4x4_v2h_reorder));
  736|       |
  737|  93.2k|            if(u4_leftmbtype & D_INTRA_MB)
  ------------------
  |  |  382|  93.2k|#define D_INTRA_MB        1
  ------------------
  |  Branch (737:16): [True: 811, False: 92.4k]
  ------------------
  738|    811|            {
  739|    811|                pu4_bs_table[4] = 0x04040404;
  740|    811|            }
  741|  92.4k|            else if(u4_leftmbtype & D_INTRA_IBL)
  ------------------
  |  |   72|  92.4k|#define D_INTRA_IBL 16
  ------------------
  |  Branch (741:21): [True: 2.28k, False: 90.1k]
  ------------------
  742|  2.28k|            {
  743|  2.28k|                pu4_bs_table[4] = u4_bs_4;
  744|  2.28k|            }
  745|       |
  746|  93.2k|            if(u1_top_mb_typ & D_INTRA_MB)
  ------------------
  |  |  382|  93.2k|#define D_INTRA_MB        1
  ------------------
  |  Branch (746:16): [True: 1.19k, False: 92.0k]
  ------------------
  747|  1.19k|            {
  748|  1.19k|                pu4_bs_table[0] = u4_cur_mb_fld ? 0x03030303 : 0x04040404;
  ------------------
  |  Branch (748:35): [True: 0, False: 1.19k]
  ------------------
  749|  1.19k|            }
  750|  92.0k|            else if(u1_top_mb_typ & D_INTRA_IBL)
  ------------------
  |  |   72|  92.0k|#define D_INTRA_IBL 16
  ------------------
  |  Branch (750:21): [True: 3.38k, False: 88.6k]
  ------------------
  751|  3.38k|            {
  752|  3.38k|                pu4_bs_table[0] = u4_bs_0;
  753|  3.38k|            }
  754|       |
  755|  93.2k|            ps_dec->pf_fill_bs1[u4_is_b][u4_is_non16x16](
  756|  93.2k|                ps_cur_mv_pred, ps_top_mv_pred, apv_map_ref_idx_to_poc, pu4_bs_table,
  757|  93.2k|                ps_left_mv_pred, &(ps_dec->ps_left_mvpred_addr[u1_pingpong][1]),
  758|  93.2k|                ps_cur_mb_info->ps_top_mb->u4_pic_addrress, (4 >> u4_cur_mb_fld));
  759|  93.2k|        }
  760|   119k|    }
  761|       |
  762|   128k|    {
  763|   128k|        void **pu4_map_ref_idx_to_poc_l1 = apv_map_ref_idx_to_poc + POC_LIST_L0_TO_L1_DIFF;
  ------------------
  |  |   86|   128k|#define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
  |  |  ------------------
  |  |  |  |  600|   128k|#define MAX_FRAMES              16
  |  |  ------------------
  ------------------
  764|       |        /* Store Parameter for Top MvPred refernce frame Address */
  765|   128k|        void **ppv_top_mv_pred_addr = ps_cur_mb_info->ps_curmb->u4_pic_addrress;
  766|   128k|        WORD8 *p1_refTop0 = (ps_cur_mv_pred + 12)->i1_ref_frame;
  767|   128k|        WORD8 *p1_refTop1 = (ps_cur_mv_pred + 14)->i1_ref_frame;
  768|       |
  769|       |        /* Store Left addresses for Next Mb   */
  770|   128k|        void **ppv_left_mv_pred_addr = ps_dec->ps_left_mvpred_addr[!u1_pingpong][1].u4_add;
  771|   128k|        WORD8 *p1_refleft0 = (ps_cur_mv_pred + 3)->i1_ref_frame;
  772|       |
  773|   128k|        ppv_top_mv_pred_addr[0] = apv_map_ref_idx_to_poc[p1_refTop0[0]];
  774|   128k|        ppv_top_mv_pred_addr[1] = pu4_map_ref_idx_to_poc_l1[p1_refTop0[1]];
  775|       |
  776|   128k|        ppv_left_mv_pred_addr[2] = apv_map_ref_idx_to_poc[p1_refTop1[0]];
  777|   128k|        ppv_top_mv_pred_addr[2] = apv_map_ref_idx_to_poc[p1_refTop1[0]];
  778|   128k|        ppv_left_mv_pred_addr[3] = pu4_map_ref_idx_to_poc_l1[p1_refTop1[1]];
  779|   128k|        ppv_top_mv_pred_addr[3] = pu4_map_ref_idx_to_poc_l1[p1_refTop1[1]];
  780|       |
  781|   128k|        ppv_left_mv_pred_addr[0] = apv_map_ref_idx_to_poc[p1_refleft0[0]];
  782|   128k|        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|   128k|        ps_dec->deblk_left_mb[1].u1_mb_type = ps_cur_mb_params->u1_mb_type;
  786|   128k|    }
  787|       |
  788|       |    /* For transform 8x8 disable deblocking of the intrernal edges of a 8x8 block */
  789|   128k|    if(ps_cur_mb_info->u1_tran_form8x8)
  ------------------
  |  Branch (789:8): [True: 12.1k, False: 116k]
  ------------------
  790|  12.1k|    {
  791|  12.1k|        pu4_bs_table[1] = 0;
  792|  12.1k|        pu4_bs_table[3] = 0;
  793|  12.1k|        pu4_bs_table[5] = 0;
  794|  12.1k|        pu4_bs_table[7] = 0;
  795|  12.1k|    }
  796|   128k|}

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

isvcd_ii_pred_res_init:
  100|   132k|{
  101|       |    /* local vaiables */
  102|   132k|    intra_inter_pred_ctxt_t *ps_ii_pred_ctxt;
  103|   132k|    mode_motion_ctxt_t *ps_ctxt;
  104|   132k|    mode_motion_lyr_ctxt *ps_lyr_mem;
  105|   132k|    WORD32 i4_base_res_flag;
  106|   132k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec = (svc_dec_lyr_struct_t *) pv_svc_dec;
  107|       |
  108|   132k|    res_prms_t *ps_res_prms = &ps_svc_lyr_dec->s_res_prms;
  109|   132k|    ps_ii_pred_ctxt = (intra_inter_pred_ctxt_t *) ps_svc_lyr_dec->pv_ii_pred_ctxt;
  110|   132k|    ps_ctxt = (mode_motion_ctxt_t *) ps_svc_lyr_dec->pv_mode_mv_sample_ctxt;
  111|   132k|    i4_base_res_flag = ps_svc_lyr_dec->u1_base_res_flag;
  112|       |
  113|   132k|    if((0 != ps_svc_lyr_dec->u1_layer_id) && (SVCD_FALSE == i4_base_res_flag))
  ------------------
  |  |   45|  33.3k|#define SVCD_FALSE 0
  ------------------
  |  Branch (113:8): [True: 33.3k, False: 99.2k]
  |  Branch (113:46): [True: 33.3k, False: 0]
  ------------------
  114|  33.3k|    {
  115|       |        /* if not first resolution layer */
  116|  33.3k|        ps_ii_pred_ctxt->i4_ref_res_lyr_wd = ps_ii_pred_ctxt->i4_cur_res_lyr_wd;
  117|  33.3k|        ps_ii_pred_ctxt->i4_ref_res_lyr_ht = ps_ii_pred_ctxt->i4_cur_res_lyr_ht;
  118|  33.3k|    }
  119|       |
  120|   132k|    if ((ps_ctxt->i4_res_id >= 0) && (ps_ctxt->i4_res_id <= 2))
  ------------------
  |  Branch (120:9): [True: 33.3k, False: 99.2k]
  |  Branch (120:38): [True: 33.3k, False: 0]
  ------------------
  121|  33.3k|    {
  122|  33.3k|        ps_lyr_mem = &ps_ctxt->as_res_lyr_mem[ps_ctxt->i4_res_id];
  123|       |
  124|  33.3k|        ps_ii_pred_ctxt->pi2_ref_loc_x = ps_lyr_mem->pi2_ref_loc_x;
  125|  33.3k|        ps_ii_pred_ctxt->pi2_ref_loc_y = ps_lyr_mem->pi2_ref_loc_y;
  126|  33.3k|    }
  127|       |    /* Store the dimensions */
  128|   132k|    ps_ii_pred_ctxt->i4_cur_res_lyr_wd = ps_res_prms->i4_res_width;
  129|   132k|    ps_ii_pred_ctxt->i4_cur_res_lyr_ht = ps_res_prms->i4_res_height;
  130|       |
  131|   132k|    return (OK);
  ------------------
  |  |  114|   132k|#define OK        0
  ------------------
  132|   132k|}
isvcd_ii_get_ref_mb_mode:
  161|   446k|{
  162|   446k|    WORD32 i4_mb_x, i4_mb_y;
  163|   446k|    inter_lyr_mb_prms_t *ps_inter_lyr_mb_prms;
  164|   446k|    WORD8 i1_mb_mode;
  165|       |
  166|   446k|    i4_mb_x = (i4_x_ref >> MB_WIDTH_SHIFT);
  ------------------
  |  |   70|   446k|#define MB_WIDTH_SHIFT 4
  ------------------
  167|   446k|    i4_mb_y = (i4_y_ref >> MB_HEIGHT_SHIFT);
  ------------------
  |  |   71|   446k|#define MB_HEIGHT_SHIFT 4
  ------------------
  168|       |
  169|       |    /* get the location of the byte which has the current mb mode */
  170|   446k|    pi1_ref_mb_modes += (i4_mb_y * i4_ref_mode_stride * i4_ref_mode_size);
  171|   446k|    pi1_ref_mb_modes += (i4_mb_x * i4_ref_mode_size);
  172|   446k|    ps_inter_lyr_mb_prms = (inter_lyr_mb_prms_t *) pi1_ref_mb_modes;
  173|   446k|    i1_mb_mode = ps_inter_lyr_mb_prms->i1_mb_mode;
  174|       |
  175|   446k|    if(i1_mb_mode <= SVC_INTER_MB)
  ------------------
  |  |  114|   446k|#define SVC_INTER_MB (1 << 0)       /*!< Intra MBs other than IPCM and I_BL */
  ------------------
  |  Branch (175:8): [True: 414k, False: 31.7k]
  ------------------
  176|   414k|    {
  177|       |        /* INTER */
  178|   414k|        return (SVCD_FALSE);
  ------------------
  |  |   45|   414k|#define SVCD_FALSE 0
  ------------------
  179|   414k|    }
  180|  31.7k|    else
  181|  31.7k|    {
  182|       |        /* INTRA */
  183|  31.7k|        return (SVCD_TRUE);
  ------------------
  |  |   46|  31.7k|#define SVCD_TRUE 1
  ------------------
  184|  31.7k|    }
  185|   446k|}
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: 7.12k, 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: 5.24k, False: 99.1k]
  ------------------
  300|  99.1k|       (SVCD_TRUE == ps_ii_mb_ctxt->u1_bot_left_intra_flag) ||
  ------------------
  |  |   46|  99.1k|#define SVCD_TRUE 1
  ------------------
  |  Branch (300:8): [True: 3.21k, False: 95.9k]
  ------------------
  301|  95.9k|       (SVCD_TRUE == ps_ii_mb_ctxt->u1_bot_rt_intra_flag))
  ------------------
  |  |   46|  95.9k|#define SVCD_TRUE 1
  ------------------
  |  Branch (301:8): [True: 502, False: 95.4k]
  ------------------
  302|  16.0k|    {
  303|  16.0k|        i4_flag = SVCD_TRUE;
  ------------------
  |  |   46|  16.0k|#define SVCD_TRUE 1
  ------------------
  304|  16.0k|    }
  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: 16.0k, False: 95.4k]
  ------------------
  308|  16.0k|    {
  309|  16.0k|        WORD32 i4_intr_x, i4_intr_y;
  310|  16.0k|        WORD32 i4_ref_mb_init_x, i4_ref_mb_init_y;
  311|  16.0k|        WORD32 i4_ctr;
  312|       |
  313|       |        /* set the variables to initial values */
  314|  16.0k|        i4_intr_x = 0;
  315|  16.0k|        i4_intr_y = 0;
  316|  16.0k|        i4_ref_mb_init_x = pi2_ref_loc_x[i4_frame_x] >> MB_WIDTH_SHIFT;
  ------------------
  |  |   70|  16.0k|#define MB_WIDTH_SHIFT 4
  ------------------
  317|  16.0k|        i4_ref_mb_init_y = pi2_ref_loc_y[i4_frame_y] >> MB_HEIGHT_SHIFT;
  ------------------
  |  |   71|  16.0k|#define MB_HEIGHT_SHIFT 4
  ------------------
  318|       |
  319|       |        /* loop until an Mb boundary is found in horizontal direction */
  320|   191k|        for(i4_ctr = 0; i4_ctr < MB_WIDTH; i4_ctr++)
  ------------------
  |  |   67|   191k|#define MB_WIDTH 16
  ------------------
  |  Branch (320:25): [True: 186k, False: 5.90k]
  ------------------
  321|   186k|        {
  322|   186k|            i4_ref_x = pi2_ref_loc_x[i4_frame_x + i4_ctr];
  323|   186k|            i4_ref_x >>= MB_WIDTH_SHIFT;
  ------------------
  |  |   70|   186k|#define MB_WIDTH_SHIFT 4
  ------------------
  324|       |
  325|       |            /* check if the locations are falling into same MB */
  326|   186k|            if(i4_ref_x != i4_ref_mb_init_x)
  ------------------
  |  Branch (326:16): [True: 10.1k, False: 175k]
  ------------------
  327|  10.1k|            {
  328|  10.1k|                break;
  329|  10.1k|            }
  330|       |            /* increment the position */
  331|   175k|            i4_intr_x++;
  332|   175k|        }
  333|       |
  334|       |        /* loop until an Mb boundary is found in vertical direction */
  335|   190k|        for(i4_ctr = 0; i4_ctr < MB_HEIGHT; i4_ctr++)
  ------------------
  |  |   68|   190k|#define MB_HEIGHT 16
  ------------------
  |  Branch (335:25): [True: 184k, False: 5.72k]
  ------------------
  336|   184k|        {
  337|   184k|            i4_ref_y = pi2_ref_loc_y[i4_frame_y + i4_ctr];
  338|   184k|            i4_ref_y >>= MB_HEIGHT_SHIFT;
  ------------------
  |  |   71|   184k|#define MB_HEIGHT_SHIFT 4
  ------------------
  339|       |
  340|       |            /* check if the locations are falling into same MB */
  341|   184k|            if(i4_ref_y != i4_ref_mb_init_y)
  ------------------
  |  Branch (341:16): [True: 10.3k, False: 174k]
  ------------------
  342|  10.3k|            {
  343|  10.3k|                break;
  344|  10.3k|            }
  345|       |            /* increment the position */
  346|   174k|            i4_intr_y++;
  347|   174k|        }
  348|       |        /* store the intersection points */
  349|  16.0k|        ps_ii_mb_ctxt->u1_intersection_x = i4_intr_x;
  350|  16.0k|        ps_ii_mb_ctxt->u1_intersection_y = i4_intr_y;
  351|  16.0k|    }
  352|  95.4k|    else
  353|  95.4k|    {
  354|       |        /* set to default value */
  355|  95.4k|        ps_ii_mb_ctxt->u1_intersection_x = 0;
  356|  95.4k|        ps_ii_mb_ctxt->u1_intersection_y = 0;
  357|  95.4k|    }
  358|       |
  359|   111k|    return (i4_flag);
  360|   111k|}
isvcd_ii_pred_compute_flags_mb:
  386|   130k|{
  387|   130k|    intra_inter_pred_ctxt_t *ps_ctxt;
  388|   130k|    WORD32 i4_mb_x, i4_mb_y;
  389|   130k|    dec_svc_mb_info_t *ps_svc_mb_prms;
  390|   130k|    UNUSED(pv_mb_prms);
  ------------------
  |  |   45|   130k|#define UNUSED(x) ((void)(x))
  ------------------
  391|       |
  392|   130k|    if((NULL == pv_ii_pred_ctxt) || (NULL == ps_ref_mb_mode) || (NULL == ps_coord) ||
  ------------------
  |  Branch (392:8): [True: 0, False: 130k]
  |  Branch (392:37): [True: 0, False: 130k]
  |  Branch (392:65): [True: 0, False: 130k]
  ------------------
  393|   130k|       (NULL == pu1_ii_mb_mode))
  ------------------
  |  Branch (393:8): [True: 0, False: 130k]
  ------------------
  394|      0|    {
  395|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  396|      0|    }
  397|       |
  398|   130k|    ps_ctxt = (intra_inter_pred_ctxt_t *) pv_ii_pred_ctxt;
  399|   130k|    ps_svc_mb_prms = (dec_svc_mb_info_t *) pv_svc_mb_prms;
  400|       |
  401|       |    /* get mb co-ordinates */
  402|   130k|    i4_mb_x = ps_coord->u2_mb_x;
  403|   130k|    i4_mb_y = ps_coord->u2_mb_y;
  404|       |
  405|   130k|    {
  406|   130k|        intra_inter_mb_t *ps_ii_mb_ctxt;
  407|   130k|        WORD32 i4_ii_flag;
  408|       |
  409|       |        /* get the current MB strcuture pointer */
  410|   130k|        ps_ii_mb_ctxt = &ps_ctxt->s_intra_inter_mb_prms;
  411|       |
  412|       |        /* reset the Intra Inter qualified flag for current MB */
  413|   130k|        i4_ii_flag = SVCD_FALSE;
  ------------------
  |  |   45|   130k|#define SVCD_FALSE 0
  ------------------
  414|       |
  415|       |        /* check for base mode flag and Inter MB status */
  416|   130k|        if(1 == ps_svc_mb_prms->u1_base_mode_flag)
  ------------------
  |  Branch (416:12): [True: 111k, False: 19.0k]
  ------------------
  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|   130k|        if(SVCD_TRUE == i4_ii_flag)
  ------------------
  |  |   46|   130k|#define SVCD_TRUE 1
  ------------------
  |  Branch (426:12): [True: 16.0k, False: 114k]
  ------------------
  427|  16.0k|        {
  428|       |            /* set the mb mode */
  429|  16.0k|            *pu1_ii_mb_mode = SVC_INTRA_INTER_MB;
  ------------------
  |  |  118|  16.0k|#define SVC_INTRA_INTER_MB (1 << 4) /*!< Intra Inter MB */
  ------------------
  430|  16.0k|        }
  431|   114k|        else
  432|   114k|        {
  433|       |            /* set all MB params to default values */
  434|   114k|            ps_ii_mb_ctxt->u1_bot_left_intra_flag = SVCD_FALSE;
  ------------------
  |  |   45|   114k|#define SVCD_FALSE 0
  ------------------
  435|   114k|            ps_ii_mb_ctxt->u1_bot_rt_intra_flag = SVCD_FALSE;
  ------------------
  |  |   45|   114k|#define SVCD_FALSE 0
  ------------------
  436|   114k|            ps_ii_mb_ctxt->u1_top_left_intra_flag = SVCD_FALSE;
  ------------------
  |  |   45|   114k|#define SVCD_FALSE 0
  ------------------
  437|   114k|            ps_ii_mb_ctxt->u1_top_rt_intra_flag = SVCD_FALSE;
  ------------------
  |  |   45|   114k|#define SVCD_FALSE 0
  ------------------
  438|   114k|            ps_ii_mb_ctxt->u1_intersection_x = 0;
  439|   114k|            ps_ii_mb_ctxt->u1_intersection_y = 0;
  440|       |
  441|       |            /* set the mb mode to 0 (which has no interpretation) */
  442|   114k|            *pu1_ii_mb_mode = 0;
  443|   114k|        }
  444|   130k|    }
  445|   130k|    return (OK);
  ------------------
  |  |  114|   130k|#define OK        0
  ------------------
  446|   130k|}
isvcd_ii_pred_mb:
  472|  16.0k|{
  473|  16.0k|    intra_inter_mb_t *ps_mb_ctxt;
  474|  16.0k|    UWORD8 *pu1_rec_y, *pu1_rec_uv;
  475|  16.0k|    UWORD8 *pu1_recon_luma;
  476|  16.0k|    WORD32 i4_recon_luma_stride;
  477|  16.0k|    UWORD8 *pu1_recon_chroma;
  478|  16.0k|    WORD32 i4_recon_chroma_stride;
  479|  16.0k|    UWORD8 *pu1_pred_luma;
  480|  16.0k|    UWORD8 *pu1_pred_chroma;
  481|  16.0k|    WORD32 i4_pred_luma_stride;
  482|  16.0k|    WORD32 i4_pred_chroma_stride;
  483|  16.0k|    WORD32 i4_intr_x, i4_intr_y;
  484|  16.0k|    intra_inter_pred_ctxt_t *ps_ctxt;
  485|  16.0k|    pic_buffer_t *ps_frame_buf;
  486|  16.0k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec = (svc_dec_lyr_struct_t *) pv_svc_dec;
  487|  16.0k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
  488|       |
  489|  16.0k|    ps_ctxt = (intra_inter_pred_ctxt_t *) ps_svc_lyr_dec->pv_ii_pred_ctxt;
  490|  16.0k|    ps_mb_ctxt = &ps_ctxt->s_intra_inter_mb_prms;
  491|  16.0k|    ps_frame_buf = ps_dec->ps_cur_pic;
  492|  16.0k|    i4_recon_luma_stride = ps_dec->u2_frm_wd_y;
  493|  16.0k|    i4_recon_chroma_stride = ps_dec->u2_frm_wd_uv;
  494|       |
  495|       |    /* derive the intersection point */
  496|  16.0k|    i4_intr_x = ps_mb_ctxt->u1_intersection_x;
  497|  16.0k|    i4_intr_y = ps_mb_ctxt->u1_intersection_y;
  498|       |
  499|  16.0k|    pu1_rec_y = ps_frame_buf->pu1_buf1 + (ps_cur_mb_info->u2_mbx << 4) +
  500|  16.0k|                (i4_recon_luma_stride * (ps_cur_mb_info->u2_mby << 4));
  501|       |
  502|  16.0k|    pu1_rec_uv = ps_frame_buf->pu1_buf2 + (ps_cur_mb_info->u2_mbx << 3) * YUV420SP_FACTOR +
  ------------------
  |  |  119|  16.0k|#define YUV420SP_FACTOR 2
  ------------------
  503|  16.0k|                 (i4_recon_chroma_stride * (ps_cur_mb_info->u2_mby << 3));
  504|       |
  505|  16.0k|    pu1_pred_luma = ps_svc_lyr_dec->pu1_ii_resamp_buffer_luma;
  506|  16.0k|    pu1_pred_chroma = ps_svc_lyr_dec->pu1_ii_resamp_buffer_chroma;
  507|  16.0k|    i4_pred_luma_stride = MB_SIZE;
  ------------------
  |  |  554|  16.0k|#define MB_SIZE             16
  ------------------
  508|  16.0k|    i4_pred_chroma_stride = MB_SIZE;
  ------------------
  |  |  554|  16.0k|#define MB_SIZE             16
  ------------------
  509|       |
  510|       |    /* get the recon and residual buffer pointer */
  511|  16.0k|    pu1_recon_luma = pu1_rec_y;
  512|  16.0k|    pu1_recon_chroma = pu1_rec_uv;
  513|       |
  514|       |    /*-----------------------------------------------------------------------*/
  515|       |    /* Reconstruct TOP_LEFT Partition                                        */
  516|       |    /*-----------------------------------------------------------------------*/
  517|  16.0k|    {
  518|  16.0k|        WORD32 i4_width, i4_height;
  519|       |
  520|       |        /* assign the appropriate buffer params based on Intra status */
  521|  16.0k|        if(SVCD_TRUE == ps_mb_ctxt->u1_top_left_intra_flag)
  ------------------
  |  |   46|  16.0k|#define SVCD_TRUE 1
  ------------------
  |  Branch (521:12): [True: 7.12k, False: 8.95k]
  ------------------
  522|  7.12k|        {
  523|       |            /* Luma Processing */
  524|  7.12k|            isvcd_copy_data(pu1_pred_luma, i4_pred_luma_stride, pu1_recon_luma,
  525|  7.12k|                            i4_recon_luma_stride, i4_intr_x, i4_intr_y);
  526|       |
  527|       |            /* assign appropriate width and height for chroma */
  528|  7.12k|            i4_width = (((i4_intr_x + 1) >> 1) << 1);
  529|  7.12k|            i4_height = ((i4_intr_y + 1) & ~1);
  530|  7.12k|            i4_height >>= 1;
  531|       |            /* Chroma Processing (cb and cr interleaved) */
  532|  7.12k|            isvcd_copy_data(pu1_pred_chroma, i4_pred_chroma_stride, pu1_recon_chroma,
  533|  7.12k|                            i4_recon_chroma_stride, i4_width, i4_height);
  534|  7.12k|        }
  535|  16.0k|    }
  536|       |
  537|       |    /*-----------------------------------------------------------------------*/
  538|       |    /* Reconstruct TOP_RIGHT Partition                                       */
  539|       |    /*-----------------------------------------------------------------------*/
  540|  16.0k|    {
  541|  16.0k|        WORD32 i4_width, i4_height;
  542|       |
  543|       |        /* assign the appropriate buffer params based on Intra status */
  544|  16.0k|        if(SVCD_TRUE == ps_mb_ctxt->u1_top_rt_intra_flag)
  ------------------
  |  |   46|  16.0k|#define SVCD_TRUE 1
  ------------------
  |  Branch (544:12): [True: 8.72k, False: 7.36k]
  ------------------
  545|  8.72k|        {
  546|  8.72k|            pu1_pred_luma += i4_intr_x;
  547|  8.72k|            pu1_pred_chroma += (((i4_intr_x + 1) >> 1) << 1);
  548|       |
  549|       |            /* ----------------------- Luma ------------------------ */
  550|       |            /* get the recon and residual buffer pointer */
  551|  8.72k|            pu1_recon_luma = pu1_rec_y + i4_intr_x;
  552|       |
  553|       |            /* assign appropriate width and height for luma */
  554|  8.72k|            i4_width = MB_WIDTH - i4_intr_x;
  ------------------
  |  |   67|  8.72k|#define MB_WIDTH 16
  ------------------
  555|  8.72k|            i4_height = i4_intr_y;
  556|       |
  557|       |            /* Luma Processing */
  558|       |            /* Luma Processing */
  559|  8.72k|            isvcd_copy_data(pu1_pred_luma, i4_pred_luma_stride, pu1_recon_luma,
  560|  8.72k|                            i4_recon_luma_stride, i4_width, i4_height);
  561|       |
  562|       |            /* ----------------------- Chroma ----------------------- */
  563|       |            /* assign appropriate width and height for luma */
  564|  8.72k|            i4_width = (BLOCK_WIDTH - ((i4_intr_x + 1) >> 1)) << 1;
  ------------------
  |  |   64|  8.72k|#define BLOCK_WIDTH 8
  ------------------
  565|       |
  566|       |            /* Height includes for both Cb & Cr */
  567|  8.72k|            i4_height = ((i4_intr_y + 1) & ~1);
  568|  8.72k|            i4_height >>= 1;
  569|       |            /* get the recon and residual buffer pointer */
  570|  8.72k|            pu1_recon_chroma = pu1_rec_uv;
  571|  8.72k|            {
  572|  8.72k|                WORD32 i4_temp;
  573|  8.72k|                i4_temp = (((i4_intr_x + 1) >> 1) << 1);
  574|  8.72k|                pu1_recon_chroma += i4_temp;
  575|  8.72k|            }
  576|       |
  577|       |            /* Chroma Processing (cb and cr  interleaved) */
  578|  8.72k|            isvcd_copy_data(pu1_pred_chroma, i4_pred_chroma_stride, pu1_recon_chroma,
  579|  8.72k|                            i4_recon_chroma_stride, i4_width, i4_height);
  580|  8.72k|        }
  581|  16.0k|    }
  582|       |
  583|       |    /*-----------------------------------------------------------------------*/
  584|       |    /* Reconstruct BOTTOM_LEFT Partition                                     */
  585|       |    /*-----------------------------------------------------------------------*/
  586|  16.0k|    {
  587|  16.0k|        WORD32 i4_width, i4_height;
  588|       |
  589|       |        /* assign the appropriate buffer params based on Intra status */
  590|  16.0k|        if(SVCD_TRUE == ps_mb_ctxt->u1_bot_left_intra_flag)
  ------------------
  |  |   46|  16.0k|#define SVCD_TRUE 1
  ------------------
  |  Branch (590:12): [True: 7.30k, False: 8.78k]
  ------------------
  591|  7.30k|        {
  592|  7.30k|            pu1_pred_luma = ps_svc_lyr_dec->pu1_ii_resamp_buffer_luma;
  593|  7.30k|            pu1_pred_chroma = ps_svc_lyr_dec->pu1_ii_resamp_buffer_chroma;
  594|       |
  595|       |            /* increment to current vertical offset */
  596|  7.30k|            pu1_pred_luma += i4_intr_y * i4_pred_luma_stride;
  597|  7.30k|            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|  7.30k|            pu1_recon_luma = pu1_rec_y;
  602|  7.30k|            pu1_recon_luma += i4_intr_y * i4_recon_luma_stride;
  603|       |
  604|       |            /* assign appropriate width and height */
  605|  7.30k|            i4_width = i4_intr_x;
  606|  7.30k|            i4_height = MB_HEIGHT - i4_intr_y;
  ------------------
  |  |   68|  7.30k|#define MB_HEIGHT 16
  ------------------
  607|       |
  608|       |            /* Luma Processing */
  609|  7.30k|            isvcd_copy_data(pu1_pred_luma, i4_pred_luma_stride, pu1_recon_luma,
  610|  7.30k|                            i4_recon_luma_stride, i4_width, i4_height);
  611|       |
  612|       |            /* ----------------------- Chroma ----------------------- */
  613|  7.30k|            pu1_recon_chroma = pu1_rec_uv;
  614|  7.30k|            {
  615|  7.30k|                WORD32 i4_temp;
  616|  7.30k|                i4_temp = ((i4_intr_y + 1) & ~1) >> 1;
  617|  7.30k|                pu1_recon_chroma += (i4_temp * i4_recon_chroma_stride);
  618|  7.30k|            }
  619|       |            /* assign appropriate width and height */
  620|  7.30k|            i4_width = ((i4_intr_x + 1) >> 1) << 1;
  621|  7.30k|            i4_height = MB_HEIGHT - (i4_intr_y & ~1);
  ------------------
  |  |   68|  7.30k|#define MB_HEIGHT 16
  ------------------
  622|  7.30k|            i4_height >>= 1;
  623|       |            /* Chroma Processing (cb and cr interleaved) */
  624|  7.30k|            isvcd_copy_data(pu1_pred_chroma, i4_pred_chroma_stride, pu1_recon_chroma,
  625|  7.30k|                            i4_recon_chroma_stride, i4_width, i4_height);
  626|  7.30k|        }
  627|  16.0k|    }
  628|       |
  629|       |    /*-----------------------------------------------------------------------*/
  630|       |    /* Reconstruct BOTTOM_RIGHT Partition                                    */
  631|       |    /*-----------------------------------------------------------------------*/
  632|  16.0k|    {
  633|  16.0k|        WORD32 i4_width, i4_height;
  634|       |
  635|       |        /* assign the appropriate buffer params based on Intra status */
  636|  16.0k|        if(SVCD_TRUE == ps_mb_ctxt->u1_bot_rt_intra_flag)
  ------------------
  |  |   46|  16.0k|#define SVCD_TRUE 1
  ------------------
  |  Branch (636:12): [True: 8.58k, False: 7.50k]
  ------------------
  637|  8.58k|        {
  638|  8.58k|            pu1_pred_luma = ps_svc_lyr_dec->pu1_ii_resamp_buffer_luma;
  639|  8.58k|            pu1_pred_chroma = ps_svc_lyr_dec->pu1_ii_resamp_buffer_chroma;
  640|       |
  641|       |            /* increment to current vertical offset */
  642|  8.58k|            pu1_pred_luma += i4_intr_x;
  643|  8.58k|            pu1_pred_luma += i4_intr_y * i4_pred_luma_stride;
  644|  8.58k|            pu1_pred_chroma += (((i4_intr_y + 1) & ~1) >> 1) * i4_pred_chroma_stride;
  645|  8.58k|            pu1_pred_chroma += ((i4_intr_x + 1) >> 1) << 1;
  646|       |
  647|       |            /* ----------------------- Luma ----------------------- */
  648|       |            /* get the recon and residual buffer pointer horz */
  649|  8.58k|            pu1_recon_luma = pu1_rec_y + i4_intr_x;
  650|       |
  651|       |            /* get the recon and residual buffer pointer vertical */
  652|  8.58k|            pu1_recon_luma += (i4_intr_y * i4_recon_luma_stride);
  653|       |
  654|       |            /* assign appropriate width and height */
  655|  8.58k|            i4_width = MB_WIDTH - i4_intr_x;
  ------------------
  |  |   67|  8.58k|#define MB_WIDTH 16
  ------------------
  656|  8.58k|            i4_height = MB_HEIGHT - i4_intr_y;
  ------------------
  |  |   68|  8.58k|#define MB_HEIGHT 16
  ------------------
  657|       |
  658|       |            /* Luma Processing */
  659|  8.58k|            isvcd_copy_data(pu1_pred_luma, i4_pred_luma_stride, pu1_recon_luma,
  660|  8.58k|                            i4_recon_luma_stride, i4_width, i4_height);
  661|       |
  662|       |            /* ----------------------- Chroma ----------------------- */
  663|       |            /* get the recon and residual buffer pointer horz */
  664|  8.58k|            pu1_recon_chroma = pu1_rec_uv;
  665|  8.58k|            {
  666|  8.58k|                WORD32 i4_temp;
  667|  8.58k|                i4_temp = ((i4_intr_y + 1) & ~1) >> 1;
  668|  8.58k|                i4_temp *= i4_recon_chroma_stride;
  669|  8.58k|                i4_temp += (((i4_intr_x + 1) >> 1) << 1);
  670|  8.58k|                pu1_recon_chroma += i4_temp;
  671|  8.58k|            }
  672|       |
  673|       |            /* assign appropriate width and height */
  674|  8.58k|            i4_width = (BLOCK_WIDTH - ((i4_intr_x + 1) >> 1)) << 1;
  ------------------
  |  |   64|  8.58k|#define BLOCK_WIDTH 8
  ------------------
  675|  8.58k|            i4_height = MB_HEIGHT - (i4_intr_y & ~1);
  ------------------
  |  |   68|  8.58k|#define MB_HEIGHT 16
  ------------------
  676|  8.58k|            i4_height >>= 1;
  677|       |            /* Chroma Processing (cb and cr interleaved) */
  678|  8.58k|            isvcd_copy_data(pu1_pred_chroma, i4_pred_chroma_stride, pu1_recon_chroma,
  679|  8.58k|                            i4_recon_chroma_stride, i4_width, i4_height);
  680|  8.58k|        }
  681|  16.0k|    }
  682|  16.0k|    return;
  683|  16.0k|}

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

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

isvcd_iquant_itrans_4x4:
   87|  42.4k|{
   88|  42.4k|    WORD16 *pi2_src_ptr = pi2_src;
   89|  42.4k|    WORD16 *pi2_tmp_ptr = pi2_tmp;
   90|  42.4k|    WORD16 *pi2_out_ptr = pi2_out;
   91|  42.4k|    WORD16 x0, x1, x2, x3, i;
   92|  42.4k|    WORD32 q0, q1, q2, q3;
   93|  42.4k|    WORD16 i_macro;
   94|  42.4k|    WORD16 rnd_fact = (u4_qp_div_6 < 4) ? 1 << (3 - u4_qp_div_6) : 0;
  ------------------
  |  Branch (94:23): [True: 21.8k, False: 20.5k]
  ------------------
   95|       |
   96|       |    /* inverse quant */
   97|       |    /*horizontal inverse transform */
   98|   212k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|   212k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (98:16): [True: 169k, False: 42.4k]
  ------------------
   99|   169k|    {
  100|   169k|        q0 = pi2_src_ptr[0];
  101|   169k|        INV_QUANT(q0, pu2_iscal_mat[0], pu2_weigh_mat[0], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|   169k|                {\
  |  |  104|   169k|                    i4_value *= quant_scale;\
  |  |  105|   169k|                    i4_value *= weight_scale;\
  |  |  106|   169k|                    i4_value += rndfactor;\
  |  |  107|   169k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|   169k|                    i4_value >>= qbits;\
  |  |  109|   169k|                }
  ------------------
  102|   169k|        if(i == 0 && iq_start_idx == 1)
  ------------------
  |  Branch (102:12): [True: 42.4k, False: 127k]
  |  Branch (102:22): [True: 0, False: 42.4k]
  ------------------
  103|      0|            q0 = pi2_dc_ld_addr[0];  // Restoring dc value for intra case
  104|       |
  105|   169k|        q2 = pi2_src_ptr[2];
  106|   169k|        INV_QUANT(q2, pu2_iscal_mat[2], pu2_weigh_mat[2], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|   169k|                {\
  |  |  104|   169k|                    i4_value *= quant_scale;\
  |  |  105|   169k|                    i4_value *= weight_scale;\
  |  |  106|   169k|                    i4_value += rndfactor;\
  |  |  107|   169k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|   169k|                    i4_value >>= qbits;\
  |  |  109|   169k|                }
  ------------------
  107|       |
  108|   169k|        x0 = q0 + q2;
  109|   169k|        x1 = q0 - q2;
  110|       |
  111|   169k|        q1 = pi2_src_ptr[1];
  112|   169k|        INV_QUANT(q1, pu2_iscal_mat[1], pu2_weigh_mat[1], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|   169k|                {\
  |  |  104|   169k|                    i4_value *= quant_scale;\
  |  |  105|   169k|                    i4_value *= weight_scale;\
  |  |  106|   169k|                    i4_value += rndfactor;\
  |  |  107|   169k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|   169k|                    i4_value >>= qbits;\
  |  |  109|   169k|                }
  ------------------
  113|       |
  114|   169k|        q3 = pi2_src_ptr[3];
  115|   169k|        INV_QUANT(q3, pu2_iscal_mat[3], pu2_weigh_mat[3], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|   169k|                {\
  |  |  104|   169k|                    i4_value *= quant_scale;\
  |  |  105|   169k|                    i4_value *= weight_scale;\
  |  |  106|   169k|                    i4_value += rndfactor;\
  |  |  107|   169k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|   169k|                    i4_value >>= qbits;\
  |  |  109|   169k|                }
  ------------------
  116|       |
  117|   169k|        x2 = (q1 >> 1) - q3;
  118|   169k|        x3 = q1 + (q3 >> 1);
  119|       |
  120|   169k|        pi2_tmp_ptr[0] = x0 + x3;
  121|   169k|        pi2_tmp_ptr[1] = x1 + x2;
  122|   169k|        pi2_tmp_ptr[2] = x1 - x2;
  123|   169k|        pi2_tmp_ptr[3] = x0 - x3;
  124|       |
  125|   169k|        pi2_src_ptr += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|   169k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  126|   169k|        pi2_tmp_ptr += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|   169k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  127|   169k|        pu2_iscal_mat += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|   169k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  128|   169k|        pu2_weigh_mat += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|   169k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  129|   169k|    }
  130|       |
  131|       |    /* vertical inverse transform */
  132|  42.4k|    pi2_tmp_ptr = pi2_tmp;
  133|   212k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|   212k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (133:16): [True: 169k, False: 42.4k]
  ------------------
  134|   169k|    {
  135|   169k|        pi2_out = pi2_out_ptr;
  136|       |
  137|   169k|        x0 = (pi2_tmp_ptr[0] + pi2_tmp_ptr[8]);
  138|   169k|        x1 = (pi2_tmp_ptr[0] - pi2_tmp_ptr[8]);
  139|   169k|        x2 = (pi2_tmp_ptr[4] >> 1) - pi2_tmp_ptr[12];
  140|   169k|        x3 = pi2_tmp_ptr[4] + (pi2_tmp_ptr[12] >> 1);
  141|       |
  142|       |        /* inverse prediction */
  143|   169k|        i_macro = x0 + x3;
  144|   169k|        *pi2_out = CLIP_RSD((i_macro + 32) >> 6);
  ------------------
  |  |  774|   169k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   169k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 9.49k, False: 160k]
  |  |  |  |  |  Branch (77:54): [True: 11.5k, False: 148k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  145|   169k|        pi2_out += out_strd;
  146|       |
  147|   169k|        i_macro = x1 + x2;
  148|   169k|        *pi2_out = CLIP_RSD((i_macro + 32) >> 6);
  ------------------
  |  |  774|   169k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   169k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 9.49k, False: 160k]
  |  |  |  |  |  Branch (77:54): [True: 10.0k, False: 150k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  149|   169k|        pi2_out += out_strd;
  150|       |
  151|   169k|        i_macro = x1 - x2;
  152|   169k|        *pi2_out = CLIP_RSD((i_macro + 32) >> 6);
  ------------------
  |  |  774|   169k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   169k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 9.85k, False: 159k]
  |  |  |  |  |  Branch (77:54): [True: 9.71k, False: 150k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  153|   169k|        pi2_out += out_strd;
  154|       |
  155|   169k|        i_macro = x0 - x3;
  156|   169k|        *pi2_out = CLIP_RSD((i_macro + 32) >> 6);
  ------------------
  |  |  774|   169k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   169k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 9.57k, False: 160k]
  |  |  |  |  |  Branch (77:54): [True: 9.93k, False: 150k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  157|   169k|        pi2_tmp_ptr++;
  158|   169k|        pi2_out_ptr++;
  159|   169k|    }
  160|  42.4k|}
isvcd_iquant_itrans_4x4_dc:
  188|  4.31k|{
  189|  4.31k|    WORD16 *pi2_out_ptr = pi2_out;
  190|  4.31k|    WORD32 q0;
  191|  4.31k|    WORD16 i_macro, i;
  192|  4.31k|    WORD16 rnd_fact = (u4_qp_div_6 < 4) ? 1 << (3 - u4_qp_div_6) : 0;
  ------------------
  |  Branch (192:23): [True: 464, False: 3.85k]
  ------------------
  193|  4.31k|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|  4.31k|#define UNUSED(x) ((void)(x))
  ------------------
  194|       |
  195|  4.31k|    if(iq_start_idx == 0)
  ------------------
  |  Branch (195:8): [True: 4.31k, False: 0]
  ------------------
  196|  4.31k|    {
  197|  4.31k|        q0 = pi2_src[0];
  198|  4.31k|        INV_QUANT(q0, pu2_iscal_mat[0], pu2_weigh_mat[0], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|  4.31k|                {\
  |  |  104|  4.31k|                    i4_value *= quant_scale;\
  |  |  105|  4.31k|                    i4_value *= weight_scale;\
  |  |  106|  4.31k|                    i4_value += rndfactor;\
  |  |  107|  4.31k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  4.31k|                    i4_value >>= qbits;\
  |  |  109|  4.31k|                }
  ------------------
  199|  4.31k|    }
  200|      0|    else
  201|      0|    {
  202|      0|        q0 = pi2_dc_ld_addr[0];  // Restoring dc value for intra case3
  203|      0|    }
  204|  4.31k|    i_macro = CLIP_RSD((q0 + 32) >> 6);
  ------------------
  |  |  774|  4.31k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  4.31k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 442, False: 3.87k]
  |  |  |  |  |  Branch (77:54): [True: 799, False: 3.07k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  205|  21.5k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|  21.5k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (205:16): [True: 17.2k, False: 4.31k]
  ------------------
  206|  17.2k|    {
  207|  17.2k|        pi2_out = pi2_out_ptr;
  208|       |
  209|       |        /* inverse prediction */
  210|  17.2k|        *pi2_out = i_macro;
  211|  17.2k|        pi2_out += out_strd;
  212|  17.2k|        *pi2_out = i_macro;
  213|  17.2k|        pi2_out += out_strd;
  214|  17.2k|        *pi2_out = i_macro;
  215|  17.2k|        pi2_out += out_strd;
  216|  17.2k|        *pi2_out = i_macro;
  217|  17.2k|        pi2_out_ptr++;
  218|  17.2k|    }
  219|  4.31k|}
isvcd_iquant_itrans_chroma_4x4:
  246|  9.16k|{
  247|  9.16k|    WORD16 *pi2_src_ptr = pi2_src;
  248|  9.16k|    WORD16 *pi2_tmp_ptr = pi2_tmp;
  249|  9.16k|    WORD16 *pi2_out_ptr = pi2_out;
  250|  9.16k|    WORD16 x0, x1, x2, x3, i;
  251|  9.16k|    WORD32 q0, q1, q2, q3;
  252|  9.16k|    WORD16 i_macro;
  253|  9.16k|    WORD16 rnd_fact = (u4_qp_div_6 < 4) ? 1 << (3 - u4_qp_div_6) : 0;
  ------------------
  |  Branch (253:23): [True: 5.50k, False: 3.66k]
  ------------------
  254|       |
  255|       |    /* inverse quant */
  256|       |    /*horizontal inverse transform */
  257|  45.8k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|  45.8k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (257:16): [True: 36.6k, False: 9.16k]
  ------------------
  258|  36.6k|    {
  259|  36.6k|        if(i == 0)
  ------------------
  |  Branch (259:12): [True: 9.16k, False: 27.4k]
  ------------------
  260|  9.16k|        {
  261|  9.16k|            q0 = pi2_dc_src[0];
  262|  9.16k|        }
  263|  27.4k|        else
  264|  27.4k|        {
  265|  27.4k|            q0 = pi2_src_ptr[0];
  266|  27.4k|            INV_QUANT(q0, pu2_iscal_mat[0], pu2_weigh_mat[0], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|  27.4k|                {\
  |  |  104|  27.4k|                    i4_value *= quant_scale;\
  |  |  105|  27.4k|                    i4_value *= weight_scale;\
  |  |  106|  27.4k|                    i4_value += rndfactor;\
  |  |  107|  27.4k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  27.4k|                    i4_value >>= qbits;\
  |  |  109|  27.4k|                }
  ------------------
  267|  27.4k|        }
  268|       |
  269|  36.6k|        q2 = pi2_src_ptr[2];
  270|  36.6k|        INV_QUANT(q2, pu2_iscal_mat[2], pu2_weigh_mat[2], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|  36.6k|                {\
  |  |  104|  36.6k|                    i4_value *= quant_scale;\
  |  |  105|  36.6k|                    i4_value *= weight_scale;\
  |  |  106|  36.6k|                    i4_value += rndfactor;\
  |  |  107|  36.6k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  36.6k|                    i4_value >>= qbits;\
  |  |  109|  36.6k|                }
  ------------------
  271|       |
  272|  36.6k|        x0 = q0 + q2;
  273|  36.6k|        x1 = q0 - q2;
  274|       |
  275|  36.6k|        q1 = pi2_src_ptr[1];
  276|  36.6k|        INV_QUANT(q1, pu2_iscal_mat[1], pu2_weigh_mat[1], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|  36.6k|                {\
  |  |  104|  36.6k|                    i4_value *= quant_scale;\
  |  |  105|  36.6k|                    i4_value *= weight_scale;\
  |  |  106|  36.6k|                    i4_value += rndfactor;\
  |  |  107|  36.6k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  36.6k|                    i4_value >>= qbits;\
  |  |  109|  36.6k|                }
  ------------------
  277|       |
  278|  36.6k|        q3 = pi2_src_ptr[3];
  279|  36.6k|        INV_QUANT(q3, pu2_iscal_mat[3], pu2_weigh_mat[3], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|  36.6k|                {\
  |  |  104|  36.6k|                    i4_value *= quant_scale;\
  |  |  105|  36.6k|                    i4_value *= weight_scale;\
  |  |  106|  36.6k|                    i4_value += rndfactor;\
  |  |  107|  36.6k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  36.6k|                    i4_value >>= qbits;\
  |  |  109|  36.6k|                }
  ------------------
  280|       |
  281|  36.6k|        x2 = (q1 >> 1) - q3;
  282|  36.6k|        x3 = q1 + (q3 >> 1);
  283|       |
  284|  36.6k|        pi2_tmp_ptr[0] = x0 + x3;
  285|  36.6k|        pi2_tmp_ptr[1] = x1 + x2;
  286|  36.6k|        pi2_tmp_ptr[2] = x1 - x2;
  287|  36.6k|        pi2_tmp_ptr[3] = x0 - x3;
  288|       |
  289|  36.6k|        pi2_src_ptr += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|  36.6k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  290|  36.6k|        pi2_tmp_ptr += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|  36.6k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  291|  36.6k|        pu2_iscal_mat += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|  36.6k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  292|  36.6k|        pu2_weigh_mat += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|  36.6k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  293|  36.6k|    }
  294|       |
  295|       |    /* vertical inverse transform */
  296|  9.16k|    pi2_tmp_ptr = pi2_tmp;
  297|  45.8k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|  45.8k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (297:16): [True: 36.6k, False: 9.16k]
  ------------------
  298|  36.6k|    {
  299|  36.6k|        pi2_out = pi2_out_ptr;
  300|       |
  301|  36.6k|        x0 = (pi2_tmp_ptr[0] + pi2_tmp_ptr[8]);
  302|  36.6k|        x1 = (pi2_tmp_ptr[0] - pi2_tmp_ptr[8]);
  303|  36.6k|        x2 = (pi2_tmp_ptr[4] >> 1) - pi2_tmp_ptr[12];
  304|  36.6k|        x3 = pi2_tmp_ptr[4] + (pi2_tmp_ptr[12] >> 1);
  305|       |
  306|       |        /* inverse prediction */
  307|  36.6k|        i_macro = x0 + x3;
  308|  36.6k|        *pi2_out = CLIP_RSD((i_macro + 32) >> 6);
  ------------------
  |  |  774|  36.6k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  36.6k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 1.45k, False: 35.2k]
  |  |  |  |  |  Branch (77:54): [True: 1.38k, False: 33.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  309|  36.6k|        pi2_out += out_strd;
  310|       |
  311|  36.6k|        i_macro = x1 + x2;
  312|  36.6k|        *pi2_out = CLIP_RSD((i_macro + 32) >> 6);
  ------------------
  |  |  774|  36.6k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  36.6k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 1.06k, False: 35.5k]
  |  |  |  |  |  Branch (77:54): [True: 1.30k, False: 34.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  313|  36.6k|        pi2_out += out_strd;
  314|       |
  315|  36.6k|        i_macro = x1 - x2;
  316|  36.6k|        *pi2_out = CLIP_RSD((i_macro + 32) >> 6);
  ------------------
  |  |  774|  36.6k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  36.6k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 1.26k, False: 35.3k]
  |  |  |  |  |  Branch (77:54): [True: 1.17k, False: 34.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  317|  36.6k|        pi2_out += out_strd;
  318|       |
  319|  36.6k|        i_macro = x0 - x3;
  320|  36.6k|        *pi2_out = CLIP_RSD((i_macro + 32) >> 6);
  ------------------
  |  |  774|  36.6k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  36.6k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 1.38k, False: 35.2k]
  |  |  |  |  |  Branch (77:54): [True: 1.39k, False: 33.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  321|  36.6k|        pi2_tmp_ptr++;
  322|  36.6k|        pi2_out_ptr += 2;  // Interleaved store for output
  323|  36.6k|    }
  324|  9.16k|}
isvcd_iquant_itrans_chroma_4x4_dc:
  351|  24.6k|{
  352|  24.6k|    WORD16 *pi2_out_ptr = pi2_out;
  353|  24.6k|    WORD32 q0;
  354|  24.6k|    WORD16 i_macro, i;
  355|  24.6k|    UNUSED(pi2_src);
  ------------------
  |  |   45|  24.6k|#define UNUSED(x) ((void)(x))
  ------------------
  356|  24.6k|    UNUSED(pu2_iscal_mat);
  ------------------
  |  |   45|  24.6k|#define UNUSED(x) ((void)(x))
  ------------------
  357|  24.6k|    UNUSED(pu2_weigh_mat);
  ------------------
  |  |   45|  24.6k|#define UNUSED(x) ((void)(x))
  ------------------
  358|  24.6k|    UNUSED(u4_qp_div_6);
  ------------------
  |  |   45|  24.6k|#define UNUSED(x) ((void)(x))
  ------------------
  359|  24.6k|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|  24.6k|#define UNUSED(x) ((void)(x))
  ------------------
  360|       |
  361|  24.6k|    q0 = pi2_dc_src[0];  // Restoring dc value for intra case3
  362|  24.6k|    i_macro = CLIP_RSD((q0 + 32) >> 6);
  ------------------
  |  |  774|  24.6k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  24.6k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 465, False: 24.2k]
  |  |  |  |  |  Branch (77:54): [True: 331, False: 23.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  363|       |
  364|   123k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|   123k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (364:16): [True: 98.7k, False: 24.6k]
  ------------------
  365|  98.7k|    {
  366|  98.7k|        pi2_out = pi2_out_ptr;
  367|       |
  368|       |        /* inverse prediction */
  369|  98.7k|        *pi2_out = i_macro;
  370|  98.7k|        pi2_out += out_strd;
  371|       |
  372|  98.7k|        *pi2_out = i_macro;
  373|  98.7k|        pi2_out += out_strd;
  374|       |
  375|  98.7k|        *pi2_out = i_macro;
  376|  98.7k|        pi2_out += out_strd;
  377|       |
  378|  98.7k|        *pi2_out = i_macro;
  379|       |
  380|  98.7k|        pi2_out_ptr += 2;
  381|  98.7k|    }
  382|  24.6k|}
isvcd_iquant_itrans_8x8_dc:
  440|  2.77k|{
  441|  2.77k|    WORD16 *pi2_out_ptr = pi2_out;
  442|  2.77k|    WORD16 i, i_macro;
  443|  2.77k|    WORD32 q;
  444|  2.77k|    WORD32 rnd_fact = (qp_div < 6) ? (1 << (5 - qp_div)) : 0;
  ------------------
  |  Branch (444:23): [True: 912, False: 1.86k]
  ------------------
  445|  2.77k|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|  2.77k|#define UNUSED(x) ((void)(x))
  ------------------
  446|  2.77k|    UNUSED(iq_start_idx);
  ------------------
  |  |   45|  2.77k|#define UNUSED(x) ((void)(x))
  ------------------
  447|  2.77k|    UNUSED(pi2_dc_ld_addr);
  ------------------
  |  |   45|  2.77k|#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|  2.77k|    q = pi2_src[0];
  453|  2.77k|    INV_QUANT(q, pu2_iscale_mat[0], pu2_weigh_mat[0], qp_div, rnd_fact, 6);
  ------------------
  |  |  103|  2.77k|                {\
  |  |  104|  2.77k|                    i4_value *= quant_scale;\
  |  |  105|  2.77k|                    i4_value *= weight_scale;\
  |  |  106|  2.77k|                    i4_value += rndfactor;\
  |  |  107|  2.77k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  2.77k|                    i4_value >>= qbits;\
  |  |  109|  2.77k|                }
  ------------------
  454|  2.77k|    i_macro = CLIP_RSD((q + 32) >> 6);
  ------------------
  |  |  774|  2.77k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  2.77k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 267, False: 2.50k]
  |  |  |  |  |  Branch (77:54): [True: 810, False: 1.69k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  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|  24.9k|    for(i = 0; i < SUB_BLK_WIDTH_8x8; i++)
  ------------------
  |  |   53|  24.9k|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
  |  Branch (465:16): [True: 22.2k, False: 2.77k]
  ------------------
  466|  22.2k|    {
  467|  22.2k|        pi2_out = pi2_out_ptr;
  468|       |
  469|  22.2k|        *pi2_out = i_macro;
  470|       |        /* Change uc_recBuffer to Point to next element in the same column*/
  471|  22.2k|        pi2_out += out_strd;
  472|       |
  473|  22.2k|        *pi2_out = i_macro;
  474|  22.2k|        pi2_out += out_strd;
  475|       |
  476|  22.2k|        *pi2_out = i_macro;
  477|  22.2k|        pi2_out += out_strd;
  478|       |
  479|  22.2k|        *pi2_out = i_macro;
  480|  22.2k|        pi2_out += out_strd;
  481|       |
  482|  22.2k|        *pi2_out = i_macro;
  483|  22.2k|        pi2_out += out_strd;
  484|       |
  485|  22.2k|        *pi2_out = i_macro;
  486|  22.2k|        pi2_out += out_strd;
  487|       |
  488|  22.2k|        *pi2_out = i_macro;
  489|  22.2k|        pi2_out += out_strd;
  490|       |
  491|  22.2k|        *pi2_out = i_macro;
  492|       |
  493|  22.2k|        pi2_out_ptr++;
  494|  22.2k|    }
  495|  2.77k|}
isvcd_iquant_itrans_8x8:
  523|  12.4k|{
  524|  12.4k|    WORD32 i;
  525|  12.4k|    WORD16 *pi2_tmp_ptr = pi2_tmp;
  526|  12.4k|    WORD16 *pi2_out_ptr = pi2_out;
  527|  12.4k|    WORD16 i_z0, i_z1, i_z2, i_z3, i_z4, i_z5, i_z6, i_z7;
  528|  12.4k|    WORD16 i_y0, i_y1, i_y2, i_y3, i_y4, i_y5, i_y6, i_y7;
  529|  12.4k|    WORD32 q;
  530|  12.4k|    WORD32 rnd_fact = (qp_div < 6) ? (1 << (5 - qp_div)) : 0;
  ------------------
  |  Branch (530:23): [True: 6.43k, False: 6.02k]
  ------------------
  531|  12.4k|    UNUSED(iq_start_idx);
  ------------------
  |  |   45|  12.4k|#define UNUSED(x) ((void)(x))
  ------------------
  532|  12.4k|    UNUSED(pi2_dc_ld_addr);
  ------------------
  |  |   45|  12.4k|#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|   809k|    for(i = 0; i < (SUB_BLK_WIDTH_8x8 * SUB_BLK_WIDTH_8x8); i++)
  ------------------
  |  |   53|   809k|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
                  for(i = 0; i < (SUB_BLK_WIDTH_8x8 * SUB_BLK_WIDTH_8x8); i++)
  ------------------
  |  |   53|   809k|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
  |  Branch (537:16): [True: 797k, False: 12.4k]
  ------------------
  538|   797k|    {
  539|   797k|        q = pi2_src[i];
  540|   797k|        INV_QUANT(q, pu2_iscale_mat[i], pu2_weigh_mat[i], qp_div, rnd_fact, 6);
  ------------------
  |  |  103|   797k|                {\
  |  |  104|   797k|                    i4_value *= quant_scale;\
  |  |  105|   797k|                    i4_value *= weight_scale;\
  |  |  106|   797k|                    i4_value += rndfactor;\
  |  |  107|   797k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|   797k|                    i4_value >>= qbits;\
  |  |  109|   797k|                }
  ------------------
  541|   797k|        pi2_tmp_ptr[i] = q;
  542|   797k|    }
  543|       |    /* Perform Inverse transform */
  544|       |    /*--------------------------------------------------------------------*/
  545|       |    /* IDCT [ Horizontal transformation ]                                 */
  546|       |    /*--------------------------------------------------------------------*/
  547|   112k|    for(i = 0; i < SUB_BLK_WIDTH_8x8; i++)
  ------------------
  |  |   53|   112k|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
  |  Branch (547:16): [True: 99.6k, False: 12.4k]
  ------------------
  548|  99.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|  99.6k|        i_y0 = (pi2_tmp_ptr[0] + pi2_tmp_ptr[4]);
  560|       |
  561|  99.6k|        i_y1 =
  562|  99.6k|            ((WORD32) (-pi2_tmp_ptr[3]) + pi2_tmp_ptr[5] - pi2_tmp_ptr[7] - (pi2_tmp_ptr[7] >> 1));
  563|       |
  564|  99.6k|        i_y2 = (pi2_tmp_ptr[0] - pi2_tmp_ptr[4]);
  565|       |
  566|  99.6k|        i_y3 = ((WORD32) pi2_tmp_ptr[1] + pi2_tmp_ptr[7] - pi2_tmp_ptr[3] - (pi2_tmp_ptr[3] >> 1));
  567|       |
  568|  99.6k|        i_y4 = ((pi2_tmp_ptr[2] >> 1) - pi2_tmp_ptr[6]);
  569|       |
  570|  99.6k|        i_y5 =
  571|  99.6k|            ((WORD32) (-pi2_tmp_ptr[1]) + pi2_tmp_ptr[7] + pi2_tmp_ptr[5] + (pi2_tmp_ptr[5] >> 1));
  572|       |
  573|  99.6k|        i_y6 = (pi2_tmp_ptr[2] + (pi2_tmp_ptr[6] >> 1));
  574|       |
  575|  99.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|  99.6k|        i_z0 = i_y0 + i_y6;
  588|  99.6k|        i_z1 = i_y1 + (i_y7 >> 2);
  589|  99.6k|        i_z2 = i_y2 + i_y4;
  590|  99.6k|        i_z3 = i_y3 + (i_y5 >> 2);
  591|  99.6k|        i_z4 = i_y2 - i_y4;
  592|  99.6k|        i_z5 = (i_y3 >> 2) - i_y5;
  593|  99.6k|        i_z6 = i_y0 - i_y6;
  594|  99.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|  99.6k|        pi2_tmp_ptr[0] = i_z0 + i_z7;
  607|  99.6k|        pi2_tmp_ptr[1] = i_z2 + i_z5;
  608|  99.6k|        pi2_tmp_ptr[2] = i_z4 + i_z3;
  609|  99.6k|        pi2_tmp_ptr[3] = i_z6 + i_z1;
  610|  99.6k|        pi2_tmp_ptr[4] = i_z6 - i_z1;
  611|  99.6k|        pi2_tmp_ptr[5] = i_z4 - i_z3;
  612|  99.6k|        pi2_tmp_ptr[6] = i_z2 - i_z5;
  613|  99.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|  99.6k|        pi2_tmp_ptr += SUB_BLK_WIDTH_8x8;
  ------------------
  |  |   53|  99.6k|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
  618|  99.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|  12.4k|    pi2_tmp_ptr = pi2_tmp;
  627|   112k|    for(i = 0; i < SUB_BLK_WIDTH_8x8; i++)
  ------------------
  |  |   53|   112k|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
  |  Branch (627:16): [True: 99.6k, False: 12.4k]
  ------------------
  628|  99.6k|    {
  629|  99.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|  99.6k|        i_y0 = pi2_tmp_ptr[0] + pi2_tmp_ptr[32];
  641|       |
  642|  99.6k|        i_y1 = (WORD32) (-pi2_tmp_ptr[24]) + pi2_tmp_ptr[40] - pi2_tmp_ptr[56] -
  643|  99.6k|               (pi2_tmp_ptr[56] >> 1);
  644|       |
  645|  99.6k|        i_y2 = pi2_tmp_ptr[0] - pi2_tmp_ptr[32];
  646|       |
  647|  99.6k|        i_y3 = (WORD32) pi2_tmp_ptr[8] + pi2_tmp_ptr[56] - pi2_tmp_ptr[24] - (pi2_tmp_ptr[24] >> 1);
  648|       |
  649|  99.6k|        i_y4 = (pi2_tmp_ptr[16] >> 1) - pi2_tmp_ptr[48];
  650|       |
  651|  99.6k|        i_y5 =
  652|  99.6k|            (WORD32) (-pi2_tmp_ptr[8]) + pi2_tmp_ptr[56] + pi2_tmp_ptr[40] + (pi2_tmp_ptr[40] >> 1);
  653|       |
  654|  99.6k|        i_y6 = pi2_tmp_ptr[16] + (pi2_tmp_ptr[48] >> 1);
  655|       |
  656|  99.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|  99.6k|        i_z0 = i_y0 + i_y6;
  669|  99.6k|        i_z1 = i_y1 + (i_y7 >> 2);
  670|  99.6k|        i_z2 = i_y2 + i_y4;
  671|  99.6k|        i_z3 = i_y3 + (i_y5 >> 2);
  672|  99.6k|        i_z4 = i_y2 - i_y4;
  673|  99.6k|        i_z5 = (i_y3 >> 2) - i_y5;
  674|  99.6k|        i_z6 = i_y0 - i_y6;
  675|  99.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|  99.6k|        *pi2_out = CLIP_RSD((i_z0 + i_z7 + 32) >> 6);
  ------------------
  |  |  774|  99.6k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  99.6k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 7.20k, False: 92.4k]
  |  |  |  |  |  Branch (77:54): [True: 8.99k, False: 83.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  688|       |        /* Change uc_recBuffer to Point to next element in the same column*/
  689|  99.6k|        pi2_out += out_strd;
  690|       |
  691|  99.6k|        *pi2_out = CLIP_RSD((i_z2 + i_z5 + 32) >> 6);
  ------------------
  |  |  774|  99.6k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  99.6k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 5.60k, False: 94.0k]
  |  |  |  |  |  Branch (77:54): [True: 7.92k, False: 86.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  692|  99.6k|        pi2_out += out_strd;
  693|       |
  694|  99.6k|        *pi2_out = CLIP_RSD((i_z4 + i_z3 + 32) >> 6);
  ------------------
  |  |  774|  99.6k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  99.6k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 5.80k, False: 93.8k]
  |  |  |  |  |  Branch (77:54): [True: 8.00k, False: 85.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  695|  99.6k|        pi2_out += out_strd;
  696|       |
  697|  99.6k|        *pi2_out = CLIP_RSD((i_z6 + i_z1 + 32) >> 6);
  ------------------
  |  |  774|  99.6k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  99.6k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 5.78k, False: 93.8k]
  |  |  |  |  |  Branch (77:54): [True: 7.70k, False: 86.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  698|  99.6k|        pi2_out += out_strd;
  699|       |
  700|  99.6k|        *pi2_out = CLIP_RSD((i_z6 - i_z1 + 32) >> 6);
  ------------------
  |  |  774|  99.6k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  99.6k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 5.65k, False: 93.9k]
  |  |  |  |  |  Branch (77:54): [True: 7.99k, False: 85.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  701|  99.6k|        pi2_out += out_strd;
  702|       |
  703|  99.6k|        *pi2_out = CLIP_RSD((i_z4 - i_z3 + 32) >> 6);
  ------------------
  |  |  774|  99.6k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  99.6k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 5.50k, False: 94.1k]
  |  |  |  |  |  Branch (77:54): [True: 8.21k, False: 85.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  704|  99.6k|        pi2_out += out_strd;
  705|       |
  706|  99.6k|        *pi2_out = CLIP_RSD((i_z2 - i_z5 + 32) >> 6);
  ------------------
  |  |  774|  99.6k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  99.6k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 5.46k, False: 94.1k]
  |  |  |  |  |  Branch (77:54): [True: 8.52k, False: 85.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  707|  99.6k|        pi2_out += out_strd;
  708|       |
  709|  99.6k|        *pi2_out = CLIP_RSD((i_z0 - i_z7 + 32) >> 6);
  ------------------
  |  |  774|  99.6k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  99.6k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 6.32k, False: 93.3k]
  |  |  |  |  |  Branch (77:54): [True: 8.59k, False: 84.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  710|       |
  711|  99.6k|        pi2_tmp_ptr++;
  712|  99.6k|        pi2_out_ptr++;
  713|  99.6k|    }
  714|  12.4k|}

isvcd_iquant_itrans_residual_recon_4x4:
   86|  36.5k|{
   87|  36.5k|    WORD32 i4_nnz = 0;
   88|  36.5k|    WORD16 *pi2_src_ptr = pi2_src;
   89|  36.5k|    WORD16 *pi2_tmp_ptr = pi2_tmp;
   90|  36.5k|    UWORD8 *pu1_pred_ptr = pu1_pred;
   91|  36.5k|    WORD16 *pi2_rsd_ptr = pi2_rsd;
   92|  36.5k|    UWORD8 *pu1_out_ptr = pu1_out;
   93|  36.5k|    WORD16 x0, x1, x2, x3, i;
   94|  36.5k|    WORD32 q0, q1, q2, q3;
   95|  36.5k|    WORD16 i_macro;
   96|  36.5k|    WORD16 rnd_fact = (u4_qp_div_6 < 4) ? 1 << (3 - u4_qp_div_6) : 0;
  ------------------
  |  Branch (96:23): [True: 24.5k, False: 12.0k]
  ------------------
   97|       |
   98|       |    /* inverse quant */
   99|       |    /*horizontal inverse transform */
  100|   182k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|   182k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (100:16): [True: 146k, False: 36.5k]
  ------------------
  101|   146k|    {
  102|   146k|        q0 = pi2_src_ptr[0];
  103|   146k|        INV_QUANT(q0, pu2_iscal_mat[0], pu2_weigh_mat[0], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|   146k|                {\
  |  |  104|   146k|                    i4_value *= quant_scale;\
  |  |  105|   146k|                    i4_value *= weight_scale;\
  |  |  106|   146k|                    i4_value += rndfactor;\
  |  |  107|   146k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|   146k|                    i4_value >>= qbits;\
  |  |  109|   146k|                }
  ------------------
  104|   146k|        if(i == 0 && iq_start_idx == 1)
  ------------------
  |  Branch (104:12): [True: 36.5k, False: 109k]
  |  Branch (104:22): [True: 0, False: 36.5k]
  ------------------
  105|      0|            q0 = pi2_dc_ld_addr[0];  // Restoring dc value for intra case
  106|       |
  107|   146k|        q2 = pi2_src_ptr[2];
  108|   146k|        INV_QUANT(q2, pu2_iscal_mat[2], pu2_weigh_mat[2], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|   146k|                {\
  |  |  104|   146k|                    i4_value *= quant_scale;\
  |  |  105|   146k|                    i4_value *= weight_scale;\
  |  |  106|   146k|                    i4_value += rndfactor;\
  |  |  107|   146k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|   146k|                    i4_value >>= qbits;\
  |  |  109|   146k|                }
  ------------------
  109|       |
  110|   146k|        x0 = q0 + q2;
  111|   146k|        x1 = q0 - q2;
  112|       |
  113|   146k|        q1 = pi2_src_ptr[1];
  114|   146k|        INV_QUANT(q1, pu2_iscal_mat[1], pu2_weigh_mat[1], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|   146k|                {\
  |  |  104|   146k|                    i4_value *= quant_scale;\
  |  |  105|   146k|                    i4_value *= weight_scale;\
  |  |  106|   146k|                    i4_value += rndfactor;\
  |  |  107|   146k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|   146k|                    i4_value >>= qbits;\
  |  |  109|   146k|                }
  ------------------
  115|       |
  116|   146k|        q3 = pi2_src_ptr[3];
  117|   146k|        INV_QUANT(q3, pu2_iscal_mat[3], pu2_weigh_mat[3], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|   146k|                {\
  |  |  104|   146k|                    i4_value *= quant_scale;\
  |  |  105|   146k|                    i4_value *= weight_scale;\
  |  |  106|   146k|                    i4_value += rndfactor;\
  |  |  107|   146k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|   146k|                    i4_value >>= qbits;\
  |  |  109|   146k|                }
  ------------------
  118|       |
  119|   146k|        x2 = (q1 >> 1) - q3;
  120|   146k|        x3 = q1 + (q3 >> 1);
  121|       |
  122|   146k|        pi2_tmp_ptr[0] = x0 + x3;
  123|   146k|        pi2_tmp_ptr[1] = x1 + x2;
  124|   146k|        pi2_tmp_ptr[2] = x1 - x2;
  125|   146k|        pi2_tmp_ptr[3] = x0 - x3;
  126|       |
  127|   146k|        pi2_src_ptr += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|   146k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  128|   146k|        pi2_tmp_ptr += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|   146k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  129|   146k|        pu2_iscal_mat += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|   146k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  130|   146k|        pu2_weigh_mat += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|   146k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  131|   146k|    }
  132|       |
  133|       |    /* vertical inverse transform */
  134|  36.5k|    pi2_tmp_ptr = pi2_tmp;
  135|   182k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|   182k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (135:16): [True: 146k, False: 36.5k]
  ------------------
  136|   146k|    {
  137|   146k|        pu1_pred_ptr = pu1_pred;
  138|   146k|        pi2_rsd_ptr = pi2_rsd;
  139|   146k|        pu1_out = pu1_out_ptr;
  140|       |
  141|   146k|        x0 = (pi2_tmp_ptr[0] + pi2_tmp_ptr[8]);
  142|   146k|        x1 = (pi2_tmp_ptr[0] - pi2_tmp_ptr[8]);
  143|   146k|        x2 = (pi2_tmp_ptr[4] >> 1) - pi2_tmp_ptr[12];
  144|   146k|        x3 = pi2_tmp_ptr[4] + (pi2_tmp_ptr[12] >> 1);
  145|       |
  146|       |        /* inverse prediction */
  147|   146k|        i_macro = x0 + x3;
  148|   146k|        i_macro = ((i_macro + 32) >> 6);
  149|   146k|        i_macro = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|   146k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   146k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 770, False: 145k]
  |  |  |  |  |  Branch (77:54): [True: 614, False: 144k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  150|   146k|        i4_nnz |= !!i_macro;
  151|   146k|        i_macro += *pu1_pred_ptr;
  152|   146k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   146k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   146k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 57.1k, False: 89.0k]
  |  |  |  |  |  Branch (77:54): [True: 1.79k, False: 87.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  153|   146k|        pu1_pred_ptr += pred_strd;
  154|   146k|        pi2_rsd_ptr += rsd_strd;
  155|   146k|        pu1_out += out_strd;
  156|       |
  157|   146k|        i_macro = x1 + x2;
  158|   146k|        i_macro = ((i_macro + 32) >> 6);
  159|   146k|        i_macro = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|   146k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   146k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 634, False: 145k]
  |  |  |  |  |  Branch (77:54): [True: 680, False: 144k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  160|   146k|        i4_nnz |= !!i_macro;
  161|   146k|        i_macro += *pu1_pred_ptr;
  162|   146k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   146k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   146k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 62.3k, False: 83.8k]
  |  |  |  |  |  Branch (77:54): [True: 1.80k, False: 82.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  163|   146k|        pu1_pred_ptr += pred_strd;
  164|   146k|        pi2_rsd_ptr += rsd_strd;
  165|   146k|        pu1_out += out_strd;
  166|       |
  167|   146k|        i_macro = x1 - x2;
  168|   146k|        i_macro = ((i_macro + 32) >> 6);
  169|   146k|        i_macro = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|   146k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   146k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 595, False: 145k]
  |  |  |  |  |  Branch (77:54): [True: 783, False: 144k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  170|   146k|        i4_nnz |= !!i_macro;
  171|   146k|        i_macro += *pu1_pred_ptr;
  172|   146k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   146k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   146k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 52.8k, False: 93.3k]
  |  |  |  |  |  Branch (77:54): [True: 2.40k, False: 90.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  173|   146k|        pu1_pred_ptr += pred_strd;
  174|   146k|        pi2_rsd_ptr += rsd_strd;
  175|   146k|        pu1_out += out_strd;
  176|       |
  177|   146k|        i_macro = x0 - x3;
  178|   146k|        i_macro = ((i_macro + 32) >> 6);
  179|   146k|        i4_nnz |= !!i_macro;
  180|   146k|        i_macro = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|   146k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   146k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 534, False: 145k]
  |  |  |  |  |  Branch (77:54): [True: 624, False: 145k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  181|   146k|        i_macro += *pu1_pred_ptr;
  182|   146k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   146k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   146k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 56.3k, False: 89.8k]
  |  |  |  |  |  Branch (77:54): [True: 2.54k, False: 87.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  183|       |
  184|   146k|        pi2_tmp_ptr++;
  185|   146k|        pu1_out_ptr++;
  186|   146k|        pi2_rsd++;
  187|   146k|        pu1_pred++;
  188|   146k|    }
  189|  36.5k|    return i4_nnz;
  190|  36.5k|}
isvcd_iquant_itrans_residual_recon_4x4_dc:
  221|  3.74k|{
  222|  3.74k|    WORD32 i4_nnz = 0;
  223|  3.74k|    UWORD8 *pu1_pred_ptr = pu1_pred;
  224|  3.74k|    WORD16 *pi2_rsd_ptr = pi2_rsd;
  225|  3.74k|    UWORD8 *pu1_out_ptr = pu1_out;
  226|  3.74k|    WORD32 q0;
  227|  3.74k|    WORD16 x, i_macro, i;
  228|  3.74k|    WORD16 rnd_fact = (u4_qp_div_6 < 4) ? 1 << (3 - u4_qp_div_6) : 0;
  ------------------
  |  Branch (228:23): [True: 877, False: 2.87k]
  ------------------
  229|  3.74k|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|  3.74k|#define UNUSED(x) ((void)(x))
  ------------------
  230|       |
  231|  3.74k|    if(iq_start_idx == 0)
  ------------------
  |  Branch (231:8): [True: 3.74k, False: 0]
  ------------------
  232|  3.74k|    {
  233|  3.74k|        q0 = pi2_src[0];
  234|  3.74k|        INV_QUANT(q0, pu2_iscal_mat[0], pu2_weigh_mat[0], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|  3.74k|                {\
  |  |  104|  3.74k|                    i4_value *= quant_scale;\
  |  |  105|  3.74k|                    i4_value *= weight_scale;\
  |  |  106|  3.74k|                    i4_value += rndfactor;\
  |  |  107|  3.74k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  3.74k|                    i4_value >>= qbits;\
  |  |  109|  3.74k|                }
  ------------------
  235|  3.74k|    }
  236|      0|    else
  237|      0|    {
  238|      0|        q0 = pi2_dc_ld_addr[0];  // Restoring dc value for intra case3
  239|      0|    }
  240|  3.74k|    i_macro = ((q0 + 32) >> 6);
  241|  18.7k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|  18.7k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (241:16): [True: 14.9k, False: 3.74k]
  ------------------
  242|  14.9k|    {
  243|  14.9k|        pu1_pred_ptr = pu1_pred;
  244|  14.9k|        pi2_rsd_ptr = pi2_rsd;
  245|  14.9k|        pu1_out = pu1_out_ptr;
  246|       |
  247|       |        /* inverse prediction */
  248|  14.9k|        x = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  14.9k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  14.9k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 303, False: 14.6k]
  |  |  |  |  |  Branch (77:54): [True: 1.97k, False: 12.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  249|  14.9k|        i4_nnz |= !!x;
  250|  14.9k|        x += *pu1_pred_ptr;
  251|  14.9k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  14.9k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  14.9k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 5.34k, False: 9.64k]
  |  |  |  |  |  Branch (77:54): [True: 1.14k, False: 8.50k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  252|  14.9k|        pu1_pred_ptr += pred_strd;
  253|  14.9k|        pi2_rsd_ptr += rsd_strd;
  254|  14.9k|        pu1_out += out_strd;
  255|       |
  256|  14.9k|        x = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  14.9k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  14.9k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 303, False: 14.6k]
  |  |  |  |  |  Branch (77:54): [True: 1.97k, False: 12.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  257|  14.9k|        i4_nnz |= !!x;
  258|  14.9k|        x += *pu1_pred_ptr;
  259|  14.9k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  14.9k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  14.9k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 5.36k, False: 9.63k]
  |  |  |  |  |  Branch (77:54): [True: 1.15k, False: 8.47k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  260|  14.9k|        pu1_pred_ptr += pred_strd;
  261|  14.9k|        pi2_rsd_ptr += rsd_strd;
  262|  14.9k|        pu1_out += out_strd;
  263|       |
  264|  14.9k|        x = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  14.9k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  14.9k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 299, False: 14.6k]
  |  |  |  |  |  Branch (77:54): [True: 1.97k, False: 12.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  265|  14.9k|        i4_nnz |= !!x;
  266|  14.9k|        x += *pu1_pred_ptr;
  267|  14.9k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  14.9k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  14.9k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 5.29k, False: 9.70k]
  |  |  |  |  |  Branch (77:54): [True: 1.11k, False: 8.58k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  268|  14.9k|        pu1_pred_ptr += pred_strd;
  269|  14.9k|        pi2_rsd_ptr += rsd_strd;
  270|  14.9k|        pu1_out += out_strd;
  271|       |
  272|  14.9k|        x = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  14.9k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  14.9k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 301, False: 14.6k]
  |  |  |  |  |  Branch (77:54): [True: 1.97k, False: 12.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  273|  14.9k|        i4_nnz |= !!x;
  274|  14.9k|        x += *pu1_pred_ptr;
  275|  14.9k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  14.9k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  14.9k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 5.13k, False: 9.85k]
  |  |  |  |  |  Branch (77:54): [True: 1.07k, False: 8.77k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  276|       |
  277|  14.9k|        pu1_out_ptr++;
  278|  14.9k|        pu1_pred++;
  279|  14.9k|        pi2_rsd++;
  280|  14.9k|    }
  281|  3.74k|    return i4_nnz;
  282|  3.74k|}
isvcd_iquant_itrans_residual_recon_chroma_4x4:
  311|  8.13k|{
  312|  8.13k|    WORD16 *pi2_src_ptr = pi2_src;
  313|  8.13k|    WORD16 *pi2_tmp_ptr = pi2_tmp;
  314|  8.13k|    UWORD8 *pu1_pred_ptr = pu1_pred;
  315|  8.13k|    WORD16 *pi2_rsd_ptr = pi2_rsd;
  316|  8.13k|    UWORD8 *pu1_out_ptr = pu1_out;
  317|  8.13k|    WORD16 x0, x1, x2, x3, i;
  318|  8.13k|    WORD32 q0, q1, q2, q3;
  319|  8.13k|    WORD16 i_macro;
  320|  8.13k|    WORD16 rnd_fact = (u4_qp_div_6 < 4) ? 1 << (3 - u4_qp_div_6) : 0;
  ------------------
  |  Branch (320:23): [True: 2.66k, False: 5.47k]
  ------------------
  321|       |
  322|       |    /* inverse quant */
  323|       |    /*horizontal inverse transform */
  324|  40.6k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|  40.6k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (324:16): [True: 32.5k, False: 8.13k]
  ------------------
  325|  32.5k|    {
  326|  32.5k|        if(i == 0)
  ------------------
  |  Branch (326:12): [True: 8.13k, False: 24.4k]
  ------------------
  327|  8.13k|        {
  328|  8.13k|            q0 = pi2_dc_src[0];
  329|  8.13k|        }
  330|  24.4k|        else
  331|  24.4k|        {
  332|  24.4k|            q0 = pi2_src_ptr[0];
  333|  24.4k|            INV_QUANT(q0, pu2_iscal_mat[0], pu2_weigh_mat[0], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|  24.4k|                {\
  |  |  104|  24.4k|                    i4_value *= quant_scale;\
  |  |  105|  24.4k|                    i4_value *= weight_scale;\
  |  |  106|  24.4k|                    i4_value += rndfactor;\
  |  |  107|  24.4k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  24.4k|                    i4_value >>= qbits;\
  |  |  109|  24.4k|                }
  ------------------
  334|  24.4k|        }
  335|       |
  336|  32.5k|        q2 = pi2_src_ptr[2];
  337|  32.5k|        INV_QUANT(q2, pu2_iscal_mat[2], pu2_weigh_mat[2], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|  32.5k|                {\
  |  |  104|  32.5k|                    i4_value *= quant_scale;\
  |  |  105|  32.5k|                    i4_value *= weight_scale;\
  |  |  106|  32.5k|                    i4_value += rndfactor;\
  |  |  107|  32.5k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  32.5k|                    i4_value >>= qbits;\
  |  |  109|  32.5k|                }
  ------------------
  338|       |
  339|  32.5k|        x0 = q0 + q2;
  340|  32.5k|        x1 = q0 - q2;
  341|       |
  342|  32.5k|        q1 = pi2_src_ptr[1];
  343|  32.5k|        INV_QUANT(q1, pu2_iscal_mat[1], pu2_weigh_mat[1], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|  32.5k|                {\
  |  |  104|  32.5k|                    i4_value *= quant_scale;\
  |  |  105|  32.5k|                    i4_value *= weight_scale;\
  |  |  106|  32.5k|                    i4_value += rndfactor;\
  |  |  107|  32.5k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  32.5k|                    i4_value >>= qbits;\
  |  |  109|  32.5k|                }
  ------------------
  344|       |
  345|  32.5k|        q3 = pi2_src_ptr[3];
  346|  32.5k|        INV_QUANT(q3, pu2_iscal_mat[3], pu2_weigh_mat[3], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|  32.5k|                {\
  |  |  104|  32.5k|                    i4_value *= quant_scale;\
  |  |  105|  32.5k|                    i4_value *= weight_scale;\
  |  |  106|  32.5k|                    i4_value += rndfactor;\
  |  |  107|  32.5k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  32.5k|                    i4_value >>= qbits;\
  |  |  109|  32.5k|                }
  ------------------
  347|       |
  348|  32.5k|        x2 = (q1 >> 1) - q3;
  349|  32.5k|        x3 = q1 + (q3 >> 1);
  350|       |
  351|  32.5k|        pi2_tmp_ptr[0] = x0 + x3;
  352|  32.5k|        pi2_tmp_ptr[1] = x1 + x2;
  353|  32.5k|        pi2_tmp_ptr[2] = x1 - x2;
  354|  32.5k|        pi2_tmp_ptr[3] = x0 - x3;
  355|       |
  356|  32.5k|        pi2_src_ptr += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|  32.5k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  357|  32.5k|        pi2_tmp_ptr += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|  32.5k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  358|  32.5k|        pu2_iscal_mat += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|  32.5k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  359|  32.5k|        pu2_weigh_mat += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|  32.5k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  360|  32.5k|    }
  361|       |
  362|       |    /* vertical inverse transform */
  363|  8.13k|    pi2_tmp_ptr = pi2_tmp;
  364|  40.6k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|  40.6k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (364:16): [True: 32.5k, False: 8.13k]
  ------------------
  365|  32.5k|    {
  366|  32.5k|        pu1_pred_ptr = pu1_pred;
  367|  32.5k|        pi2_rsd_ptr = pi2_rsd;
  368|  32.5k|        pu1_out = pu1_out_ptr;
  369|       |
  370|  32.5k|        x0 = (pi2_tmp_ptr[0] + pi2_tmp_ptr[8]);
  371|  32.5k|        x1 = (pi2_tmp_ptr[0] - pi2_tmp_ptr[8]);
  372|  32.5k|        x2 = (pi2_tmp_ptr[4] >> 1) - pi2_tmp_ptr[12];
  373|  32.5k|        x3 = pi2_tmp_ptr[4] + (pi2_tmp_ptr[12] >> 1);
  374|       |
  375|       |        /* inverse prediction */
  376|  32.5k|        i_macro = x0 + x3;
  377|  32.5k|        i_macro = ((i_macro + 32) >> 6);
  378|  32.5k|        i_macro = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  32.5k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  32.5k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 1.53k, False: 31.0k]
  |  |  |  |  |  Branch (77:54): [True: 1.89k, False: 29.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  379|  32.5k|        i_macro += *pu1_pred_ptr;
  380|  32.5k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|  32.5k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  32.5k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 9.11k, False: 23.4k]
  |  |  |  |  |  Branch (77:54): [True: 2.37k, False: 21.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  381|  32.5k|        pu1_pred_ptr += pred_strd;
  382|  32.5k|        pi2_rsd_ptr += rsd_strd;
  383|  32.5k|        pu1_out += out_strd;
  384|       |
  385|  32.5k|        i_macro = x1 + x2;
  386|  32.5k|        i_macro = ((i_macro + 32) >> 6);
  387|  32.5k|        i_macro = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  32.5k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  32.5k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 1.88k, False: 30.6k]
  |  |  |  |  |  Branch (77:54): [True: 1.63k, False: 29.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  388|  32.5k|        i_macro += *pu1_pred_ptr;
  389|  32.5k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|  32.5k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  32.5k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 9.74k, False: 22.8k]
  |  |  |  |  |  Branch (77:54): [True: 2.17k, False: 20.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  390|  32.5k|        pu1_pred_ptr += pred_strd;
  391|  32.5k|        pi2_rsd_ptr += rsd_strd;
  392|  32.5k|        pu1_out += out_strd;
  393|       |
  394|  32.5k|        i_macro = x1 - x2;
  395|  32.5k|        i_macro = ((i_macro + 32) >> 6);
  396|  32.5k|        i_macro = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  32.5k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  32.5k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 1.45k, False: 31.0k]
  |  |  |  |  |  Branch (77:54): [True: 1.76k, False: 29.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  397|  32.5k|        i_macro += *pu1_pred_ptr;
  398|  32.5k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|  32.5k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  32.5k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 8.26k, False: 24.2k]
  |  |  |  |  |  Branch (77:54): [True: 2.94k, False: 21.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  399|  32.5k|        pu1_pred_ptr += pred_strd;
  400|  32.5k|        pi2_rsd_ptr += rsd_strd;
  401|  32.5k|        pu1_out += out_strd;
  402|       |
  403|  32.5k|        i_macro = x0 - x3;
  404|  32.5k|        i_macro = ((i_macro + 32) >> 6);
  405|  32.5k|        i_macro = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  32.5k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  32.5k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 1.50k, False: 31.0k]
  |  |  |  |  |  Branch (77:54): [True: 2.11k, False: 28.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  406|  32.5k|        i_macro += *pu1_pred_ptr;
  407|  32.5k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|  32.5k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  32.5k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 7.63k, False: 24.9k]
  |  |  |  |  |  Branch (77:54): [True: 3.26k, False: 21.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  408|       |
  409|  32.5k|        pi2_tmp_ptr++;
  410|  32.5k|        pu1_out_ptr += 2;  // Interleaved store for output
  411|  32.5k|        pu1_pred += 2;     // Interleaved load for pred buffer
  412|  32.5k|        pi2_rsd += 2;
  413|  32.5k|    }
  414|  8.13k|}
isvcd_iquant_itrans_residual_recon_chroma_4x4_dc:
  443|  25.7k|{
  444|  25.7k|    UWORD8 *pu1_pred_ptr = pu1_pred;
  445|  25.7k|    WORD16 *pi2_rsd_ptr = pi2_rsd;
  446|  25.7k|    UWORD8 *pu1_out_ptr = pu1_out;
  447|  25.7k|    WORD32 q0;
  448|  25.7k|    WORD16 x, i_macro, i;
  449|  25.7k|    UNUSED(pi2_src);
  ------------------
  |  |   45|  25.7k|#define UNUSED(x) ((void)(x))
  ------------------
  450|  25.7k|    UNUSED(pu2_iscal_mat);
  ------------------
  |  |   45|  25.7k|#define UNUSED(x) ((void)(x))
  ------------------
  451|  25.7k|    UNUSED(pu2_weigh_mat);
  ------------------
  |  |   45|  25.7k|#define UNUSED(x) ((void)(x))
  ------------------
  452|  25.7k|    UNUSED(u4_qp_div_6);
  ------------------
  |  |   45|  25.7k|#define UNUSED(x) ((void)(x))
  ------------------
  453|  25.7k|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|  25.7k|#define UNUSED(x) ((void)(x))
  ------------------
  454|       |
  455|  25.7k|    q0 = pi2_dc_src[0];  // Restoring dc value for intra case3
  456|  25.7k|    i_macro = ((q0 + 32) >> 6);
  457|       |
  458|   128k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|   128k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (458:16): [True: 102k, False: 25.7k]
  ------------------
  459|   102k|    {
  460|   102k|        pu1_pred_ptr = pu1_pred;
  461|   102k|        pi2_rsd_ptr = pi2_rsd;
  462|   102k|        pu1_out = pu1_out_ptr;
  463|       |
  464|       |        /* inverse prediction */
  465|   102k|        x = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|   102k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   102k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 649, False: 102k]
  |  |  |  |  |  Branch (77:54): [True: 1.89k, False: 100k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  466|   102k|        x += *pu1_pred_ptr;
  467|   102k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|   102k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   102k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 26.7k, False: 76.2k]
  |  |  |  |  |  Branch (77:54): [True: 3.76k, False: 72.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  468|   102k|        pu1_pred_ptr += pred_strd;
  469|   102k|        pi2_rsd_ptr += rsd_strd;
  470|   102k|        pu1_out += out_strd;
  471|       |
  472|   102k|        x = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|   102k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   102k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 637, False: 102k]
  |  |  |  |  |  Branch (77:54): [True: 1.89k, False: 100k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  473|   102k|        x += *pu1_pred_ptr;
  474|   102k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|   102k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   102k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 26.7k, False: 76.2k]
  |  |  |  |  |  Branch (77:54): [True: 3.75k, False: 72.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  475|   102k|        pu1_pred_ptr += pred_strd;
  476|   102k|        pi2_rsd_ptr += rsd_strd;
  477|   102k|        pu1_out += out_strd;
  478|       |
  479|   102k|        x = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|   102k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   102k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 639, False: 102k]
  |  |  |  |  |  Branch (77:54): [True: 1.87k, False: 100k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  480|   102k|        x += *pu1_pred_ptr;
  481|   102k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|   102k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   102k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 26.8k, False: 76.1k]
  |  |  |  |  |  Branch (77:54): [True: 3.77k, False: 72.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  482|   102k|        pu1_pred_ptr += pred_strd;
  483|   102k|        pi2_rsd_ptr += rsd_strd;
  484|   102k|        pu1_out += out_strd;
  485|       |
  486|   102k|        x = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|   102k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   102k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 637, False: 102k]
  |  |  |  |  |  Branch (77:54): [True: 1.88k, False: 100k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  487|   102k|        x += *pu1_pred_ptr;
  488|   102k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|   102k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   102k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 26.7k, False: 76.2k]
  |  |  |  |  |  Branch (77:54): [True: 3.71k, False: 72.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  489|       |
  490|   102k|        pu1_out_ptr += 2;
  491|   102k|        pu1_pred += 2;
  492|   102k|        pi2_rsd += 2;
  493|   102k|    }
  494|  25.7k|}
isvcd_iquant_itrans_residual_recon_8x8:
  525|  8.43k|{
  526|  8.43k|    WORD32 i4_nnz = 0, i4_nnz_H = 0, i4_nnz_L = 0;
  527|  8.43k|    WORD32 i;
  528|  8.43k|    WORD16 *pi2_tmp_ptr = pi2_tmp;
  529|  8.43k|    UWORD8 *pu1_pred_ptr = pu1_pred;
  530|  8.43k|    WORD16 *pi2_rsd_ptr = pi2_rsd;
  531|  8.43k|    UWORD8 *pu1_out_ptr = pu1_out;
  532|  8.43k|    WORD16 i_z0, i_z1, i_z2, i_z3, i_z4, i_z5, i_z6, i_z7;
  533|  8.43k|    WORD16 i_y0, i_y1, i_y2, i_y3, i_y4, i_y5, i_y6, i_y7;
  534|  8.43k|    WORD16 i_macro;
  535|  8.43k|    WORD32 q;
  536|  8.43k|    WORD32 rnd_fact = (qp_div < 6) ? (1 << (5 - qp_div)) : 0;
  ------------------
  |  Branch (536:23): [True: 7.38k, False: 1.04k]
  ------------------
  537|  8.43k|    UNUSED(iq_start_idx);
  ------------------
  |  |   45|  8.43k|#define UNUSED(x) ((void)(x))
  ------------------
  538|  8.43k|    UNUSED(pi2_dc_ld_addr);
  ------------------
  |  |   45|  8.43k|#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|   548k|    for(i = 0; i < (SUB_BLK_WIDTH_8x8 * SUB_BLK_WIDTH_8x8); i++)
  ------------------
  |  |   53|   548k|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
                  for(i = 0; i < (SUB_BLK_WIDTH_8x8 * SUB_BLK_WIDTH_8x8); i++)
  ------------------
  |  |   53|   548k|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
  |  Branch (543:16): [True: 539k, False: 8.43k]
  ------------------
  544|   539k|    {
  545|   539k|        q = pi2_src[i];
  546|   539k|        INV_QUANT(q, pu2_iscale_mat[i], pu2_weigh_mat[i], qp_div, rnd_fact, 6);
  ------------------
  |  |  103|   539k|                {\
  |  |  104|   539k|                    i4_value *= quant_scale;\
  |  |  105|   539k|                    i4_value *= weight_scale;\
  |  |  106|   539k|                    i4_value += rndfactor;\
  |  |  107|   539k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|   539k|                    i4_value >>= qbits;\
  |  |  109|   539k|                }
  ------------------
  547|   539k|        pi2_tmp_ptr[i] = q;
  548|   539k|    }
  549|       |    /* Perform Inverse transform */
  550|       |    /*--------------------------------------------------------------------*/
  551|       |    /* IDCT [ Horizontal transformation ]                                 */
  552|       |    /*--------------------------------------------------------------------*/
  553|  75.8k|    for(i = 0; i < SUB_BLK_WIDTH_8x8; i++)
  ------------------
  |  |   53|  75.8k|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
  |  Branch (553:16): [True: 67.4k, False: 8.43k]
  ------------------
  554|  67.4k|    {
  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|  67.4k|        i_y0 = (pi2_tmp_ptr[0] + pi2_tmp_ptr[4]);
  566|       |
  567|  67.4k|        i_y1 =
  568|  67.4k|            ((WORD32) (-pi2_tmp_ptr[3]) + pi2_tmp_ptr[5] - pi2_tmp_ptr[7] - (pi2_tmp_ptr[7] >> 1));
  569|       |
  570|  67.4k|        i_y2 = (pi2_tmp_ptr[0] - pi2_tmp_ptr[4]);
  571|       |
  572|  67.4k|        i_y3 = ((WORD32) pi2_tmp_ptr[1] + pi2_tmp_ptr[7] - pi2_tmp_ptr[3] - (pi2_tmp_ptr[3] >> 1));
  573|       |
  574|  67.4k|        i_y4 = ((pi2_tmp_ptr[2] >> 1) - pi2_tmp_ptr[6]);
  575|       |
  576|  67.4k|        i_y5 =
  577|  67.4k|            ((WORD32) (-pi2_tmp_ptr[1]) + pi2_tmp_ptr[7] + pi2_tmp_ptr[5] + (pi2_tmp_ptr[5] >> 1));
  578|       |
  579|  67.4k|        i_y6 = (pi2_tmp_ptr[2] + (pi2_tmp_ptr[6] >> 1));
  580|       |
  581|  67.4k|        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|  67.4k|        i_z0 = i_y0 + i_y6;
  594|  67.4k|        i_z1 = i_y1 + (i_y7 >> 2);
  595|  67.4k|        i_z2 = i_y2 + i_y4;
  596|  67.4k|        i_z3 = i_y3 + (i_y5 >> 2);
  597|  67.4k|        i_z4 = i_y2 - i_y4;
  598|  67.4k|        i_z5 = (i_y3 >> 2) - i_y5;
  599|  67.4k|        i_z6 = i_y0 - i_y6;
  600|  67.4k|        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|  67.4k|        pi2_tmp_ptr[0] = i_z0 + i_z7;
  613|  67.4k|        pi2_tmp_ptr[1] = i_z2 + i_z5;
  614|  67.4k|        pi2_tmp_ptr[2] = i_z4 + i_z3;
  615|  67.4k|        pi2_tmp_ptr[3] = i_z6 + i_z1;
  616|  67.4k|        pi2_tmp_ptr[4] = i_z6 - i_z1;
  617|  67.4k|        pi2_tmp_ptr[5] = i_z4 - i_z3;
  618|  67.4k|        pi2_tmp_ptr[6] = i_z2 - i_z5;
  619|  67.4k|        pi2_tmp_ptr[7] = i_z0 - i_z7;
  620|       |
  621|       |        /* move to the next row */
  622|  67.4k|        pi2_tmp_ptr += SUB_BLK_WIDTH_8x8;
  ------------------
  |  |   53|  67.4k|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
  623|  67.4k|    }
  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|  8.43k|    pi2_tmp_ptr = pi2_tmp;
  632|  75.8k|    for(i = 0; i < SUB_BLK_WIDTH_8x8; i++)
  ------------------
  |  |   53|  75.8k|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
  |  Branch (632:16): [True: 67.4k, False: 8.43k]
  ------------------
  633|  67.4k|    {
  634|  67.4k|        pu1_pred_ptr = pu1_pred;
  635|  67.4k|        pi2_rsd_ptr = pi2_rsd;
  636|  67.4k|        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|  67.4k|        i_y0 = pi2_tmp_ptr[0] + pi2_tmp_ptr[32];
  648|       |
  649|  67.4k|        i_y1 = (WORD32) (-pi2_tmp_ptr[24]) + pi2_tmp_ptr[40] - pi2_tmp_ptr[56] -
  650|  67.4k|               (pi2_tmp_ptr[56] >> 1);
  651|       |
  652|  67.4k|        i_y2 = pi2_tmp_ptr[0] - pi2_tmp_ptr[32];
  653|       |
  654|  67.4k|        i_y3 = (WORD32) pi2_tmp_ptr[8] + pi2_tmp_ptr[56] - pi2_tmp_ptr[24] - (pi2_tmp_ptr[24] >> 1);
  655|       |
  656|  67.4k|        i_y4 = (pi2_tmp_ptr[16] >> 1) - pi2_tmp_ptr[48];
  657|       |
  658|  67.4k|        i_y5 =
  659|  67.4k|            (WORD32) (-pi2_tmp_ptr[8]) + pi2_tmp_ptr[56] + pi2_tmp_ptr[40] + (pi2_tmp_ptr[40] >> 1);
  660|       |
  661|  67.4k|        i_y6 = pi2_tmp_ptr[16] + (pi2_tmp_ptr[48] >> 1);
  662|       |
  663|  67.4k|        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|  67.4k|        i_z0 = i_y0 + i_y6;
  676|  67.4k|        i_z1 = i_y1 + (i_y7 >> 2);
  677|  67.4k|        i_z2 = i_y2 + i_y4;
  678|  67.4k|        i_z3 = i_y3 + (i_y5 >> 2);
  679|  67.4k|        i_z4 = i_y2 - i_y4;
  680|  67.4k|        i_z5 = (i_y3 >> 2) - i_y5;
  681|  67.4k|        i_z6 = i_y0 - i_y6;
  682|  67.4k|        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|  67.4k|        i_macro = CLIP_RSD(((i_z0 + i_z7 + 32) >> 6) + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  67.4k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  67.4k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 867, False: 66.5k]
  |  |  |  |  |  Branch (77:54): [True: 986, False: 65.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  695|  67.4k|        i4_nnz_H |= !!i_macro;
  696|  67.4k|        i_macro += *pu1_pred_ptr;
  697|  67.4k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|  67.4k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  67.4k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 17.0k, False: 50.4k]
  |  |  |  |  |  Branch (77:54): [True: 1.82k, False: 48.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  698|       |        /* Change uc_recBuffer to Point to next element in the same column*/
  699|  67.4k|        pu1_pred_ptr += pred_strd;
  700|  67.4k|        pi2_rsd_ptr += rsd_strd;
  701|  67.4k|        pu1_out += out_strd;
  702|       |
  703|  67.4k|        i_macro = CLIP_RSD(((i_z2 + i_z5 + 32) >> 6) + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  67.4k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  67.4k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 652, False: 66.8k]
  |  |  |  |  |  Branch (77:54): [True: 510, False: 66.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  704|  67.4k|        i4_nnz_H |= !!i_macro;
  705|  67.4k|        i_macro += *pu1_pred_ptr;
  706|  67.4k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|  67.4k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  67.4k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 19.0k, False: 48.4k]
  |  |  |  |  |  Branch (77:54): [True: 1.70k, False: 46.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  707|  67.4k|        pu1_pred_ptr += pred_strd;
  708|  67.4k|        pi2_rsd_ptr += rsd_strd;
  709|  67.4k|        pu1_out += out_strd;
  710|       |
  711|  67.4k|        i_macro = CLIP_RSD(((i_z4 + i_z3 + 32) >> 6) + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  67.4k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  67.4k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 566, False: 66.8k]
  |  |  |  |  |  Branch (77:54): [True: 578, False: 66.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  712|  67.4k|        i4_nnz_H |= !!i_macro;
  713|  67.4k|        i_macro += *pu1_pred_ptr;
  714|  67.4k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|  67.4k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  67.4k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 19.2k, False: 48.2k]
  |  |  |  |  |  Branch (77:54): [True: 2.39k, False: 45.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  715|  67.4k|        pu1_pred_ptr += pred_strd;
  716|  67.4k|        pi2_rsd_ptr += rsd_strd;
  717|  67.4k|        pu1_out += out_strd;
  718|       |
  719|  67.4k|        i_macro = CLIP_RSD(((i_z6 + i_z1 + 32) >> 6) + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  67.4k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  67.4k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 550, False: 66.9k]
  |  |  |  |  |  Branch (77:54): [True: 778, False: 66.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  720|  67.4k|        i4_nnz_H |= !!i_macro;
  721|  67.4k|        i_macro += *pu1_pred_ptr;
  722|  67.4k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|  67.4k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  67.4k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 24.0k, False: 43.4k]
  |  |  |  |  |  Branch (77:54): [True: 1.15k, False: 42.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  723|  67.4k|        pu1_pred_ptr += pred_strd;
  724|  67.4k|        pi2_rsd_ptr += rsd_strd;
  725|  67.4k|        pu1_out += out_strd;
  726|       |
  727|  67.4k|        i_macro = CLIP_RSD(((i_z6 - i_z1 + 32) >> 6) + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  67.4k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  67.4k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 546, False: 66.9k]
  |  |  |  |  |  Branch (77:54): [True: 792, False: 66.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  728|  67.4k|        i4_nnz_L |= !!i_macro;
  729|  67.4k|        i_macro += *pu1_pred_ptr;
  730|  67.4k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|  67.4k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  67.4k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 24.2k, False: 43.2k]
  |  |  |  |  |  Branch (77:54): [True: 1.25k, False: 41.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  731|  67.4k|        pu1_pred_ptr += pred_strd;
  732|  67.4k|        pi2_rsd_ptr += rsd_strd;
  733|  67.4k|        pu1_out += out_strd;
  734|       |
  735|  67.4k|        i_macro = CLIP_RSD(((i_z4 - i_z3 + 32) >> 6) + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  67.4k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  67.4k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 551, False: 66.9k]
  |  |  |  |  |  Branch (77:54): [True: 664, False: 66.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  736|  67.4k|        i4_nnz_L |= !!i_macro;
  737|  67.4k|        i_macro += *pu1_pred_ptr;
  738|  67.4k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|  67.4k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  67.4k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 18.7k, False: 48.6k]
  |  |  |  |  |  Branch (77:54): [True: 2.66k, False: 46.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  739|  67.4k|        pu1_pred_ptr += pred_strd;
  740|  67.4k|        pi2_rsd_ptr += rsd_strd;
  741|  67.4k|        pu1_out += out_strd;
  742|       |
  743|  67.4k|        i_macro = CLIP_RSD(((i_z2 - i_z5 + 32) >> 6) + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  67.4k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  67.4k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 535, False: 66.9k]
  |  |  |  |  |  Branch (77:54): [True: 644, False: 66.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  744|  67.4k|        i4_nnz_L |= !!i_macro;
  745|  67.4k|        i_macro += *pu1_pred_ptr;
  746|  67.4k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|  67.4k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  67.4k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 18.4k, False: 49.0k]
  |  |  |  |  |  Branch (77:54): [True: 2.29k, False: 46.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  747|  67.4k|        pu1_pred_ptr += pred_strd;
  748|  67.4k|        pi2_rsd_ptr += rsd_strd;
  749|  67.4k|        pu1_out += out_strd;
  750|       |
  751|  67.4k|        i_macro = CLIP_RSD(((i_z0 - i_z7 + 32) >> 6) + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  67.4k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  67.4k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 760, False: 66.6k]
  |  |  |  |  |  Branch (77:54): [True: 944, False: 65.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  752|  67.4k|        i4_nnz_L |= !!i_macro;
  753|  67.4k|        i_macro += *pu1_pred_ptr;
  754|  67.4k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|  67.4k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  67.4k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 16.7k, False: 50.7k]
  |  |  |  |  |  Branch (77:54): [True: 2.25k, False: 48.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  755|       |
  756|  67.4k|        pi2_tmp_ptr++;
  757|  67.4k|        pu1_out_ptr++;
  758|  67.4k|        pi2_rsd++;
  759|  67.4k|        pu1_pred++;
  760|  67.4k|        if(i == 3)
  ------------------
  |  Branch (760:12): [True: 8.43k, False: 59.0k]
  ------------------
  761|  8.43k|        {
  762|  8.43k|            i4_nnz = i4_nnz_H | (i4_nnz_L << 4);
  763|  8.43k|            i4_nnz_L = 0;
  764|  8.43k|            i4_nnz_H = 0;
  765|  8.43k|        }
  766|  67.4k|    }
  767|  8.43k|    i4_nnz |= (i4_nnz_H << 1) | (i4_nnz_L << 5);
  768|  8.43k|    return i4_nnz;
  769|  8.43k|}
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: 964, False: 662]
  ------------------
  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: 293, False: 12.7k]
  |  |  |  |  |  Branch (77:54): [True: 319, False: 12.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  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: 3.51k, False: 9.49k]
  |  |  |  |  |  Branch (77:54): [True: 808, False: 8.69k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  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: 283, False: 12.7k]
  |  |  |  |  |  Branch (77:54): [True: 296, False: 12.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  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: 3.45k, False: 9.55k]
  |  |  |  |  |  Branch (77:54): [True: 950, False: 8.60k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  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: 285, False: 12.7k]
  |  |  |  |  |  Branch (77:54): [True: 312, False: 12.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  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: 3.42k, False: 9.58k]
  |  |  |  |  |  Branch (77:54): [True: 1.06k, False: 8.51k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  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: 281, False: 12.7k]
  |  |  |  |  |  Branch (77:54): [True: 363, False: 12.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  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: 3.47k, False: 9.53k]
  |  |  |  |  |  Branch (77:54): [True: 1.06k, False: 8.47k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  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: 284, False: 12.7k]
  |  |  |  |  |  Branch (77:54): [True: 318, False: 12.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  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: 3.46k, False: 9.54k]
  |  |  |  |  |  Branch (77:54): [True: 897, False: 8.65k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  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: 293, False: 12.7k]
  |  |  |  |  |  Branch (77:54): [True: 331, False: 12.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  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: 3.53k, False: 9.47k]
  |  |  |  |  |  Branch (77:54): [True: 738, False: 8.73k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  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: 280, False: 12.7k]
  |  |  |  |  |  Branch (77:54): [True: 362, False: 12.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  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: 3.47k, False: 9.53k]
  |  |  |  |  |  Branch (77:54): [True: 797, False: 8.73k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  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: 269, False: 12.7k]
  |  |  |  |  |  Branch (77:54): [True: 256, False: 12.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  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: 3.46k, False: 9.54k]
  |  |  |  |  |  Branch (77:54): [True: 795, False: 8.74k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  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.71M|{
   92|  1.71M|    WORD32 mb_x;
   93|  1.71M|    WORD32 mb_y;
   94|  1.71M|    UWORD32 u1_mb_ngbr_avail = 0;
   95|  1.71M|    UWORD32 u2_frm_width_in_mb = ps_dec->u2_frm_wd_in_mbs;
   96|  1.71M|    UWORD32 u1_top_mb = 1;
   97|  1.71M|    WORD32 i2_prev_slice_mbx = ps_dec->i2_prev_slice_mbx;
   98|  1.71M|    UWORD32 u2_top_right_mask = TOP_RIGHT_DEFAULT_AVAILABLE;
  ------------------
  |  |   60|  1.71M|#define TOP_RIGHT_DEFAULT_AVAILABLE            0x5750
  ------------------
   99|  1.71M|    UWORD32 u2_top_left_mask = TOP_LEFT_DEFAULT_AVAILABLE;
  ------------------
  |  |   64|  1.71M|#define TOP_LEFT_DEFAULT_AVAILABLE            0xEEE0
  ------------------
  100|  1.71M|    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.71M|    mb_x = (WORD16) ps_dec->u2_mbx;
  106|  1.71M|    mb_y = (WORD16) ps_dec->u2_mby;
  107|  1.71M|    ps_dec->u4_cur_mb_addr = u2_cur_mb_address;
  108|       |
  109|  1.71M|    mb_x++;
  110|  1.71M|    if((UWORD32) mb_x == u2_frm_width_in_mb)
  ------------------
  |  Branch (110:8): [True: 139k, False: 1.57M]
  ------------------
  111|   139k|    {
  112|   139k|        mb_x = 0;
  113|   139k|        mb_y++;
  114|   139k|        if(mb_y >= ps_dec->u2_frm_ht_in_mbs)
  ------------------
  |  Branch (114:12): [True: 0, False: 139k]
  ------------------
  115|      0|        {
  116|      0|            mb_y = ps_dec->u2_frm_ht_in_mbs - 1;
  117|      0|        }
  118|   139k|    }
  119|       |    /*********************************************************************/
  120|       |    /* Cabac Context Initialisations                                     */
  121|       |    /*********************************************************************/
  122|  1.71M|    ps_dec->ps_curr_ctxt_mb_info = p_ctx_inc_mb_map + mb_x;
  123|  1.71M|    ps_dec->p_left_ctxt_mb_info = p_ctx_inc_mb_map - 1;
  124|  1.71M|    ps_dec->p_top_ctxt_mb_info = p_ctx_inc_mb_map - 1;
  125|       |
  126|       |    /********************************************************************/
  127|       |    /* neighbour availablility                                          */
  128|       |    /********************************************************************/
  129|  1.71M|    if(mb_y > ps_dec->i2_prev_slice_mby)
  ------------------
  |  Branch (129:8): [True: 1.54M, False: 173k]
  ------------------
  130|  1.54M|    {
  131|       |        /* if not in the immemdiate row of prev slice end then top will be available */
  132|  1.54M|        if(mb_y > (ps_dec->i2_prev_slice_mby + 1)) i2_prev_slice_mbx = -1;
  ------------------
  |  Branch (132:12): [True: 1.38M, False: 158k]
  ------------------
  133|       |
  134|  1.54M|        if(mb_x > i2_prev_slice_mbx)
  ------------------
  |  Branch (134:12): [True: 1.53M, False: 9.17k]
  ------------------
  135|  1.53M|        {
  136|  1.53M|            u1_mb_ngbr_avail |= TOP_MB_AVAILABLE_MASK;
  ------------------
  |  |   55|  1.53M|#define TOP_MB_AVAILABLE_MASK       0x04
  ------------------
  137|  1.53M|            u2_top_right_mask |= TOP_RIGHT_TOP_AVAILABLE;
  ------------------
  |  |   62|  1.53M|#define TOP_RIGHT_TOP_AVAILABLE                0x0007
  ------------------
  138|  1.53M|            u2_top_left_mask |= TOP_LEFT_TOP_AVAILABLE;
  ------------------
  |  |   66|  1.53M|#define TOP_LEFT_TOP_AVAILABLE                0x000E
  ------------------
  139|  1.53M|            ps_dec->p_top_ctxt_mb_info = ps_dec->ps_curr_ctxt_mb_info;
  140|  1.53M|        }
  141|  1.54M|        if((mb_x > (i2_prev_slice_mbx - 1)) && ((UWORD32) mb_x != (u2_frm_width_in_mb - 1)))
  ------------------
  |  Branch (141:12): [True: 1.53M, False: 7.04k]
  |  Branch (141:48): [True: 1.40M, False: 131k]
  ------------------
  142|  1.40M|        {
  143|  1.40M|            u1_mb_ngbr_avail |= TOP_RIGHT_MB_AVAILABLE_MASK;
  ------------------
  |  |   56|  1.40M|#define TOP_RIGHT_MB_AVAILABLE_MASK 0x08
  ------------------
  144|  1.40M|            u2_top_right_mask |= TOP_RIGHT_TOPR_AVAILABLE;
  ------------------
  |  |   61|  1.40M|#define TOP_RIGHT_TOPR_AVAILABLE               0x0008
  ------------------
  145|  1.40M|        }
  146|       |
  147|  1.54M|        if(mb_x > (i2_prev_slice_mbx + 1))
  ------------------
  |  Branch (147:12): [True: 1.39M, False: 148k]
  ------------------
  148|  1.39M|        {
  149|  1.39M|            u1_mb_ngbr_avail |= TOP_LEFT_MB_AVAILABLE_MASK;
  ------------------
  |  |   54|  1.39M|#define TOP_LEFT_MB_AVAILABLE_MASK  0x02
  ------------------
  150|  1.39M|            u2_top_left_mask |= TOP_LEFT_TOPL_AVAILABLE;
  ------------------
  |  |   65|  1.39M|#define TOP_LEFT_TOPL_AVAILABLE               0x0001
  ------------------
  151|  1.39M|        }
  152|       |        /* Next row */
  153|  1.54M|        i2_prev_slice_mbx = -1;
  154|  1.54M|    }
  155|       |    /* Same row */
  156|  1.71M|    if(mb_x > (i2_prev_slice_mbx + 1))
  ------------------
  |  Branch (156:8): [True: 1.55M, False: 164k]
  ------------------
  157|  1.55M|    {
  158|  1.55M|        u1_mb_ngbr_avail |= LEFT_MB_AVAILABLE_MASK;
  ------------------
  |  |   53|  1.55M|#define LEFT_MB_AVAILABLE_MASK      0x01
  ------------------
  159|  1.55M|        u2_top_left_mask |= TOP_LEFT_LEFT_AVAILABLE;
  ------------------
  |  |   67|  1.55M|#define TOP_LEFT_LEFT_AVAILABLE               0x1110
  ------------------
  160|  1.55M|        ps_dec->p_left_ctxt_mb_info = ps_dec->ps_curr_ctxt_mb_info - 1;
  161|  1.55M|    }
  162|  1.71M|    {
  163|  1.71M|        mb_neigbour_params_t *ps_cur_mb_row = ps_dec->ps_cur_mb_row;
  164|  1.71M|        mb_neigbour_params_t *ps_top_mb_row = ps_dec->ps_top_mb_row;
  165|       |        /* copy the parameters of topleft Mb */
  166|  1.71M|        ps_cur_mb_info->u1_topleft_mbtype = ps_dec->u1_topleft_mbtype;
  167|       |        /* Neighbour pointer assignments*/
  168|  1.71M|        ps_cur_mb_info->ps_curmb = ps_cur_mb_row + mb_x;
  169|  1.71M|        ps_cur_mb_info->ps_left_mb = ps_cur_mb_row + mb_x - 1;
  170|  1.71M|        ps_cur_mb_info->ps_top_mb = ps_top_mb_row + mb_x;
  171|  1.71M|        ps_cur_mb_info->ps_top_right_mb = ps_top_mb_row + mb_x + 1;
  172|       |
  173|       |        /* Update the parameters of topleftmb*/
  174|  1.71M|        ps_dec->u1_topleft_mbtype = ps_cur_mb_info->ps_top_mb->u1_mb_type;
  175|  1.71M|    }
  176|       |
  177|  1.71M|    ps_dec->u2_mby = mb_y;
  178|  1.71M|    ps_dec->u2_mbx = mb_x;
  179|  1.71M|    ps_cur_mb_info->u2_mbx = mb_x;
  180|  1.71M|    ps_cur_mb_info->u2_mby = mb_y;
  181|  1.71M|    ps_cur_mb_info->u1_topmb = u1_top_mb;
  182|  1.71M|    ps_dec->i4_submb_ofst += SUB_BLK_SIZE;
  ------------------
  |  |  562|  1.71M|#define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|  1.71M|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  |  |               #define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|  1.71M|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  ------------------
  183|  1.71M|    ps_dec->u1_mb_ngbr_availablity = u1_mb_ngbr_avail;
  184|  1.71M|    ps_cur_mb_info->u1_mb_ngbr_availablity = u1_mb_ngbr_avail;
  185|  1.71M|    ps_cur_mb_info->ps_curmb->u1_mb_fld = ps_dec->u1_cur_mb_fld_dec_flag;
  186|  1.71M|    ps_cur_mb_info->u1_mb_field_decodingflag = ps_dec->u1_cur_mb_fld_dec_flag;
  187|  1.71M|    ps_cur_mb_info->u2_top_left_avail_mask = u2_top_left_mask;
  188|  1.71M|    ps_cur_mb_info->u2_top_right_avail_mask = u2_top_right_mask;
  189|       |
  190|       |    /*********************************************************************/
  191|       |    /*                  Assign the neigbours                             */
  192|       |    /*********************************************************************/
  193|  1.71M|    if(u4_mbskip)
  ------------------
  |  Branch (193:8): [True: 1.62M, False: 94.9k]
  ------------------
  194|  1.62M|    {
  195|  1.62M|        UWORD8 u1_a, u1_b;
  196|  1.62M|        UWORD32 u4_ctx_inc;
  197|       |
  198|  1.62M|        u1_a = (ps_dec->p_top_ctxt_mb_info->u1_mb_type != CAB_INFERRED)
  ------------------
  |  |   74|  1.62M|#define CAB_INFERRED 0xFF
  ------------------
  |  Branch (198:16): [True: 1.60M, False: 16.4k]
  ------------------
  199|  1.62M|                   ? (!!(ps_dec->p_top_ctxt_mb_info->u1_mb_type & CAB_SKIP_MASK))
  ------------------
  |  |  401|  1.60M|#define CAB_SKIP_MASK     0x10 /* 0001 0000 */
  ------------------
  200|  1.62M|                   : 0;
  201|  1.62M|        u1_b = (ps_dec->p_left_ctxt_mb_info->u1_mb_type != CAB_INFERRED)
  ------------------
  |  |   74|  1.62M|#define CAB_INFERRED 0xFF
  ------------------
  |  Branch (201:16): [True: 1.60M, False: 14.3k]
  ------------------
  202|  1.62M|                   ? (!!(ps_dec->p_left_ctxt_mb_info->u1_mb_type & CAB_SKIP_MASK))
  ------------------
  |  |  401|  1.60M|#define CAB_SKIP_MASK     0x10 /* 0001 0000 */
  ------------------
  203|  1.62M|                   : 0;
  204|  1.62M|        u4_ctx_inc = 2 - (u1_a + u1_b);
  205|       |
  206|  1.62M|        u4_mbskip = ih264d_decode_bin(u4_ctx_inc, ps_dec->p_mb_skip_flag_t, ps_dec->ps_bitstrm,
  207|  1.62M|                                      &ps_dec->s_cab_dec_env);
  208|       |
  209|  1.62M|        if(!u4_mbskip)
  ------------------
  |  Branch (209:12): [True: 262k, False: 1.36M]
  ------------------
  210|   262k|        {
  211|   262k|            if(!(u1_mb_ngbr_avail & LEFT_MB_AVAILABLE_MASK))
  ------------------
  |  |   53|   262k|#define LEFT_MB_AVAILABLE_MASK      0x01
  ------------------
  |  Branch (211:16): [True: 59.6k, False: 202k]
  ------------------
  212|  59.6k|            {
  213|  59.6k|                UWORD32 *pu4_buf;
  214|  59.6k|                UWORD8 *pu1_buf;
  215|       |
  216|  59.6k|                pu1_buf = ps_dec->pu1_left_nnz_y;
  217|  59.6k|                pu4_buf = (UWORD32 *) pu1_buf;
  218|  59.6k|                *pu4_buf = 0;
  219|  59.6k|                pu1_buf = ps_dec->pu1_left_nnz_uv;
  220|  59.6k|                pu4_buf = (UWORD32 *) pu1_buf;
  221|  59.6k|                *pu4_buf = 0;
  222|       |
  223|  59.6k|                *(ps_dec->pu1_left_yuv_dc_csbp) = 0;
  224|  59.6k|                MEMSET_16BYTES(&ps_dec->pu1_left_mv_ctxt_inc[0][0], 0);
  ------------------
  |  |  652|  59.6k|#define MEMSET_16BYTES(pu4_start,value)                         \
  |  |  653|  59.6k|{                                                               \
  |  |  654|  59.6k|    memset(pu4_start,value,16);                                 \
  |  |  655|  59.6k|}
  ------------------
  225|  59.6k|                *(UWORD32 *) ps_dec->pi1_left_ref_idx_ctxt_inc = 0;
  226|  59.6k|            }
  227|   262k|            if(!(u1_mb_ngbr_avail & TOP_MB_AVAILABLE_MASK))
  ------------------
  |  |   55|   262k|#define TOP_MB_AVAILABLE_MASK       0x04
  ------------------
  |  Branch (227:16): [True: 34.1k, False: 227k]
  ------------------
  228|  34.1k|            {
  229|  34.1k|                MEMSET_16BYTES(ps_dec->ps_curr_ctxt_mb_info->u1_mv, 0);
  ------------------
  |  |  652|  34.1k|#define MEMSET_16BYTES(pu4_start,value)                         \
  |  |  653|  34.1k|{                                                               \
  |  |  654|  34.1k|    memset(pu4_start,value,16);                                 \
  |  |  655|  34.1k|}
  ------------------
  230|  34.1k|                memset(ps_dec->ps_curr_ctxt_mb_info->i1_ref_idx, 0, 4);
  231|  34.1k|            }
  232|   262k|        }
  233|  1.62M|    }
  234|  1.71M|    return (u4_mbskip);
  235|  1.71M|}
isvcd_get_mb_info_cavlc_nonmbaff:
  271|  11.0M|{
  272|  11.0M|    WORD32 mb_x;
  273|  11.0M|    WORD32 mb_y;
  274|  11.0M|    UWORD8 u1_mb_ngbr_avail = 0;
  275|  11.0M|    UWORD16 u2_frm_width_in_mb = ps_dec->u2_frm_wd_in_mbs;
  276|  11.0M|    WORD16 i2_prev_slice_mbx = ps_dec->i2_prev_slice_mbx;
  277|  11.0M|    UWORD16 u2_top_right_mask = TOP_RIGHT_DEFAULT_AVAILABLE;
  ------------------
  |  |   60|  11.0M|#define TOP_RIGHT_DEFAULT_AVAILABLE            0x5750
  ------------------
  278|  11.0M|    UWORD16 u2_top_left_mask = TOP_LEFT_DEFAULT_AVAILABLE;
  ------------------
  |  |   64|  11.0M|#define TOP_LEFT_DEFAULT_AVAILABLE            0xEEE0
  ------------------
  279|  11.0M|    UNUSED(u4_mbskip_run);
  ------------------
  |  |   45|  11.0M|#define UNUSED(x) ((void)(x))
  ------------------
  280|       |    /*--------------------------------------------------------------------*/
  281|       |    /* Calculate values of mb_x and mb_y                                  */
  282|       |    /*--------------------------------------------------------------------*/
  283|  11.0M|    mb_x = (WORD16) ps_dec->u2_mbx;
  284|  11.0M|    mb_y = (WORD16) ps_dec->u2_mby;
  285|       |
  286|  11.0M|    ps_dec->u4_cur_mb_addr = u2_cur_mb_address;
  287|       |
  288|  11.0M|    mb_x++;
  289|       |
  290|  11.0M|    if(mb_x == u2_frm_width_in_mb)
  ------------------
  |  Branch (290:8): [True: 1.96M, False: 9.05M]
  ------------------
  291|  1.96M|    {
  292|  1.96M|        mb_x = 0;
  293|  1.96M|        mb_y++;
  294|  1.96M|        if(mb_y >= ps_dec->u2_frm_ht_in_mbs)
  ------------------
  |  Branch (294:12): [True: 0, False: 1.96M]
  ------------------
  295|      0|        {
  296|      0|            mb_y = ps_dec->u2_frm_ht_in_mbs - 1;
  297|      0|        }
  298|  1.96M|    }
  299|  11.0M|    if(mb_y > ps_dec->i2_prev_slice_mby)
  ------------------
  |  Branch (299:8): [True: 10.3M, False: 647k]
  ------------------
  300|  10.3M|    {
  301|       |        /* if not in the immemdiate row of prev slice end then top
  302|       |         will be available */
  303|  10.3M|        if(mb_y > (ps_dec->i2_prev_slice_mby + 1)) i2_prev_slice_mbx = -1;
  ------------------
  |  Branch (303:12): [True: 9.70M, False: 675k]
  ------------------
  304|       |
  305|  10.3M|        if(mb_x > i2_prev_slice_mbx)
  ------------------
  |  Branch (305:12): [True: 10.2M, False: 101k]
  ------------------
  306|  10.2M|        {
  307|  10.2M|            u1_mb_ngbr_avail |= TOP_MB_AVAILABLE_MASK;
  ------------------
  |  |   55|  10.2M|#define TOP_MB_AVAILABLE_MASK       0x04
  ------------------
  308|  10.2M|            u2_top_right_mask |= TOP_RIGHT_TOP_AVAILABLE;
  ------------------
  |  |   62|  10.2M|#define TOP_RIGHT_TOP_AVAILABLE                0x0007
  ------------------
  309|  10.2M|            u2_top_left_mask |= TOP_LEFT_TOP_AVAILABLE;
  ------------------
  |  |   66|  10.2M|#define TOP_LEFT_TOP_AVAILABLE                0x000E
  ------------------
  310|  10.2M|        }
  311|       |
  312|  10.3M|        if((mb_x > (i2_prev_slice_mbx - 1)) && (mb_x != (u2_frm_width_in_mb - 1)))
  ------------------
  |  Branch (312:12): [True: 10.3M, False: 61.8k]
  |  Branch (312:48): [True: 8.36M, False: 1.95M]
  ------------------
  313|  8.36M|        {
  314|  8.36M|            u1_mb_ngbr_avail |= TOP_RIGHT_MB_AVAILABLE_MASK;
  ------------------
  |  |   56|  8.36M|#define TOP_RIGHT_MB_AVAILABLE_MASK 0x08
  ------------------
  315|  8.36M|            u2_top_right_mask |= TOP_RIGHT_TOPR_AVAILABLE;
  ------------------
  |  |   61|  8.36M|#define TOP_RIGHT_TOPR_AVAILABLE               0x0008
  ------------------
  316|  8.36M|        }
  317|       |
  318|  10.3M|        if(mb_x > (i2_prev_slice_mbx + 1))
  ------------------
  |  Branch (318:12): [True: 8.31M, False: 2.05M]
  ------------------
  319|  8.31M|        {
  320|  8.31M|            u1_mb_ngbr_avail |= TOP_LEFT_MB_AVAILABLE_MASK;
  ------------------
  |  |   54|  8.31M|#define TOP_LEFT_MB_AVAILABLE_MASK  0x02
  ------------------
  321|  8.31M|            u2_top_left_mask |= TOP_LEFT_TOPL_AVAILABLE;
  ------------------
  |  |   65|  8.31M|#define TOP_LEFT_TOPL_AVAILABLE               0x0001
  ------------------
  322|  8.31M|        }
  323|       |
  324|       |        /* Next row  Left will be available*/
  325|  10.3M|        i2_prev_slice_mbx = -1;
  326|  10.3M|    }
  327|       |
  328|       |    /* Same row */
  329|  11.0M|    if(mb_x > (i2_prev_slice_mbx + 1))
  ------------------
  |  Branch (329:8): [True: 8.88M, False: 2.13M]
  ------------------
  330|  8.88M|    {
  331|  8.88M|        u1_mb_ngbr_avail |= LEFT_MB_AVAILABLE_MASK;
  ------------------
  |  |   53|  8.88M|#define LEFT_MB_AVAILABLE_MASK      0x01
  ------------------
  332|  8.88M|        u2_top_left_mask |= TOP_LEFT_LEFT_AVAILABLE;
  ------------------
  |  |   67|  8.88M|#define TOP_LEFT_LEFT_AVAILABLE               0x1110
  ------------------
  333|  8.88M|    }
  334|       |
  335|  11.0M|    {
  336|  11.0M|        mb_neigbour_params_t *ps_cur_mb_row = ps_dec->ps_cur_mb_row;
  337|  11.0M|        mb_neigbour_params_t *ps_top_mb_row = ps_dec->ps_top_mb_row;
  338|       |
  339|       |        /* copy the parameters of topleft Mb */
  340|  11.0M|        ps_cur_mb_info->u1_topleft_mbtype = ps_dec->u1_topleft_mbtype;
  341|       |        /* Neighbour pointer assignments*/
  342|  11.0M|        ps_cur_mb_info->ps_curmb = ps_cur_mb_row + mb_x;
  343|  11.0M|        ps_cur_mb_info->ps_left_mb = ps_cur_mb_row + mb_x - 1;
  344|  11.0M|        ps_cur_mb_info->ps_top_mb = ps_top_mb_row + mb_x;
  345|  11.0M|        ps_cur_mb_info->ps_top_right_mb = ps_top_mb_row + mb_x + 1;
  346|       |
  347|       |        /* Update the parameters of topleftmb*/
  348|  11.0M|        ps_dec->u1_topleft_mbtype = ps_cur_mb_info->ps_top_mb->u1_mb_type;
  349|  11.0M|    }
  350|       |
  351|  11.0M|    ps_dec->u2_mby = mb_y;
  352|  11.0M|    ps_dec->u2_mbx = mb_x;
  353|  11.0M|    ps_cur_mb_info->u2_mbx = mb_x;
  354|  11.0M|    ps_cur_mb_info->u2_mby = mb_y;
  355|  11.0M|    ps_cur_mb_info->u1_topmb = 1;
  356|  11.0M|    ps_dec->i4_submb_ofst += SUB_BLK_SIZE;
  ------------------
  |  |  562|  11.0M|#define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|  11.0M|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  |  |               #define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|  11.0M|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  ------------------
  357|  11.0M|    ps_dec->u1_mb_ngbr_availablity = u1_mb_ngbr_avail;
  358|  11.0M|    ps_cur_mb_info->u1_mb_ngbr_availablity = u1_mb_ngbr_avail;
  359|  11.0M|    ps_cur_mb_info->ps_curmb->u1_mb_fld = ps_dec->u1_cur_mb_fld_dec_flag;
  360|  11.0M|    ps_cur_mb_info->u1_mb_field_decodingflag = ps_dec->u1_cur_mb_fld_dec_flag;
  361|  11.0M|    ps_cur_mb_info->u2_top_left_avail_mask = u2_top_left_mask;
  362|  11.0M|    ps_cur_mb_info->u2_top_right_avail_mask = u2_top_right_mask;
  363|  11.0M|    return (OK);
  ------------------
  |  |  114|  11.0M|#define OK        0
  ------------------
  364|  11.0M|}

isvcd_ref_lyr_part_idc:
  783|   130k|{
  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|   130k|    mode_motion_ctxt_t *ps_ctxt;
  799|   130k|    mode_motion_lyr_ctxt *ps_lyr_mem;
  800|   130k|    inter_lyr_mb_prms_t *ps_inter_lyr_mb_prms;
  801|   130k|    WORD32 i4_blk_y, i4_blk_x;
  802|   130k|    WORD32 i4_mb_x, i4_mb_y;
  803|   130k|    WORD32 i4_intra_mb_flag;
  804|   130k|    WORD32 i4_inter_lyr_mb_prms_stride;
  805|   130k|    dec_mb_info_t *ps_mb_params;
  806|       |
  807|   130k|    ps_mb_params = (dec_mb_info_t *) pv_mb_params;
  808|   130k|    ps_ctxt = (mode_motion_ctxt_t *) pv_comp_mode_mv_ctxt;
  809|       |
  810|       |    /* get the current layer ctxt */
  811|   130k|    ps_lyr_mem = &ps_ctxt->as_res_lyr_mem[ps_ctxt->i4_res_id];
  812|       |
  813|       |    /* ref layer mb mode */
  814|   130k|    ps_inter_lyr_mb_prms = (inter_lyr_mb_prms_t *) ps_lyr_mem->s_ref_mb_mode.pv_buffer;
  815|   130k|    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|   130k|    i4_mb_x = ps_mb_params->u2_mbx;
  819|   130k|    i4_mb_y = ps_mb_params->u2_mby;
  820|       |
  821|       |    /* set the intra MB flag to default TRUE */
  822|   130k|    i4_intra_mb_flag = SVCD_TRUE;
  ------------------
  |  |   46|   130k|#define SVCD_TRUE 1
  ------------------
  823|       |
  824|       |    /*-----------------------------------------------------------------------*/
  825|       |    /* derive the reference layer part idc for all 16 partitions             */
  826|       |    /*-----------------------------------------------------------------------*/
  827|   654k|    for(i4_blk_y = 0; i4_blk_y < NUM_SUB_MB_PARTS; i4_blk_y++)
  ------------------
  |  |   60|   654k|#define NUM_SUB_MB_PARTS 4
  ------------------
  |  Branch (827:23): [True: 523k, False: 130k]
  ------------------
  828|   523k|    {
  829|  2.61M|        for(i4_blk_x = 0; i4_blk_x < NUM_SUB_MB_PARTS; i4_blk_x++)
  ------------------
  |  |   60|  2.61M|#define NUM_SUB_MB_PARTS 4
  ------------------
  |  Branch (829:27): [True: 2.09M, False: 523k]
  ------------------
  830|  2.09M|        {
  831|  2.09M|            WORD32 i4_curr_x, i4_curr_y;
  832|  2.09M|            WORD32 i4_ref_x, i4_ref_y;
  833|  2.09M|            WORD32 i4_ref_mb_x, i4_ref_mb_y;
  834|  2.09M|            WORD8 i1_ref_mb_mode;
  835|  2.09M|            inter_lyr_mb_prms_t *ps_inter_lyr_mb_prms_temp;
  836|       |
  837|  2.09M|            i4_curr_x = (i4_mb_x << 4) + (i4_blk_x << 2) + 1;
  838|  2.09M|            i4_curr_y = (i4_mb_y << 4) + (i4_blk_y << 2) + 1;
  839|       |
  840|       |            /* get the colocated position in the refernce layer */
  841|  2.09M|            i4_ref_x = ps_lyr_mem->pi2_ref_loc_x[i4_curr_x];
  842|  2.09M|            i4_ref_y = ps_lyr_mem->pi2_ref_loc_y[i4_curr_y];
  843|       |
  844|  2.09M|            i4_ref_x = CLIP3(0, ((ps_lyr_mem->i4_ref_width) - 1), i4_ref_x);
  ------------------
  |  |   77|  2.09M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 0, False: 2.09M]
  |  |  |  Branch (77:54): [True: 0, False: 2.09M]
  |  |  ------------------
  ------------------
  845|       |
  846|  2.09M|            i4_ref_y = CLIP3(0, ((ps_lyr_mem->i4_ref_height) - 1), i4_ref_y);
  ------------------
  |  |   77|  2.09M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 0, False: 2.09M]
  |  |  |  Branch (77:54): [True: 0, False: 2.09M]
  |  |  ------------------
  ------------------
  847|       |
  848|       |            /* get the reference mb x and y */
  849|  2.09M|            i4_ref_mb_x = (i4_ref_x >> 4);
  850|  2.09M|            i4_ref_mb_y = (i4_ref_y >> 4);
  851|       |
  852|       |            /* get the appropriate mb params in reference layer */
  853|  2.09M|            ps_inter_lyr_mb_prms_temp = ps_inter_lyr_mb_prms + i4_ref_mb_x;
  854|  2.09M|            ps_inter_lyr_mb_prms_temp += i4_ref_mb_y * i4_inter_lyr_mb_prms_stride;
  855|       |
  856|  2.09M|            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.09M|            if(i1_ref_mb_mode > SVC_INTER_MB)
  ------------------
  |  |  114|  2.09M|#define SVC_INTER_MB (1 << 0)       /*!< Intra MBs other than IPCM and I_BL */
  ------------------
  |  Branch (859:16): [True: 289k, False: 1.80M]
  ------------------
  860|   289k|            {
  861|       |                /* store the -1 value */
  862|   289k|                ai4_ref_part_idc[i4_blk_y][i4_blk_x] = -1;
  863|   289k|            }
  864|  1.80M|            else
  865|  1.80M|            {
  866|       |                /* pack and store the reference x and y */
  867|  1.80M|                ai4_ref_part_idc[i4_blk_y][i4_blk_x] = (i4_ref_y << 16) + i4_ref_x;
  868|  1.80M|                i4_intra_mb_flag = SVCD_FALSE;
  ------------------
  |  |   45|  1.80M|#define SVCD_FALSE 0
  ------------------
  869|  1.80M|            }
  870|       |
  871|  2.09M|        } /* end of block x loop */
  872|       |
  873|   523k|    }     /* 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|   130k|    if(SVCD_FALSE == (ps_lyr_mem->ps_curr_lyr_res_prms->u1_rstrct_res_change_flag) &&
  ------------------
  |  |   45|   130k|#define SVCD_FALSE 0
  ------------------
  |  Branch (879:8): [True: 130k, False: 0]
  ------------------
  880|   130k|       (SVCD_FALSE == i4_intra_mb_flag))
  ------------------
  |  |   45|   130k|#define SVCD_FALSE 0
  ------------------
  |  Branch (880:8): [True: 121k, False: 9.85k]
  ------------------
  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|   363k|        for(i4_yp = 0; i4_yp < 2; i4_yp++)
  ------------------
  |  Branch (888:24): [True: 242k, False: 121k]
  ------------------
  889|   242k|        {
  890|   726k|            for(i4_xp = 0; i4_xp < 2; i4_xp++)
  ------------------
  |  Branch (890:28): [True: 484k, False: 242k]
  ------------------
  891|   484k|            {
  892|   484k|                WORD32 i4_xs, i4_ys;
  893|   484k|                WORD32 ai4_flag_4x4[2][2] = {SVCD_FALSE};
  ------------------
  |  |   45|   484k|#define SVCD_FALSE 0
  ------------------
  894|       |
  895|       |                /* loop over (4) 4x4 partitions */
  896|  1.45M|                for(i4_ys = 0; i4_ys < 2; i4_ys++)
  ------------------
  |  Branch (896:32): [True: 968k, False: 484k]
  ------------------
  897|   968k|                {
  898|  2.90M|                    for(i4_xs = 0; i4_xs < 2; i4_xs++)
  ------------------
  |  Branch (898:36): [True: 1.93M, False: 968k]
  ------------------
  899|  1.93M|                    {
  900|       |                        /* index to the exact 4x4 block */
  901|  1.93M|                        i4_indx_y = (i4_yp << 1) + i4_ys;
  902|  1.93M|                        i4_indx_x = (i4_xp << 1) + i4_xs;
  903|       |
  904|       |                        /* check if the current part idc is -1*/
  905|  1.93M|                        if(ai4_ref_part_idc[i4_indx_y][i4_indx_x] == -1)
  ------------------
  |  Branch (905:28): [True: 131k, False: 1.80M]
  ------------------
  906|   131k|                        {
  907|   131k|                            WORD32 i4_temp_x = 1 - i4_xs;
  908|   131k|                            WORD32 i4_temp_y = 1 - i4_ys;
  909|   131k|                            WORD32 i4_temp_part_y = (i4_yp << 1) + i4_temp_y;
  910|       |
  911|   131k|                            WORD32 i4_temp_part_x = (i4_xp << 1) + i4_temp_x;
  912|       |
  913|   131k|                            ai4_flag_4x4[i4_ys][i4_xs] = SVCD_TRUE;
  ------------------
  |  |   46|   131k|#define SVCD_TRUE 1
  ------------------
  914|       |
  915|       |                            /* replace with appropriate values */
  916|   131k|                            if((SVCD_FALSE == ai4_flag_4x4[i4_ys][i4_temp_x]) &&
  ------------------
  |  |   45|   131k|#define SVCD_FALSE 0
  ------------------
  |  Branch (916:32): [True: 65.6k, False: 65.6k]
  ------------------
  917|  65.6k|                               (ai4_ref_part_idc[i4_indx_y][i4_temp_part_x] != -1))
  ------------------
  |  Branch (917:32): [True: 0, False: 65.6k]
  ------------------
  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|   131k|                            else if((SVCD_FALSE == ai4_flag_4x4[i4_temp_y][i4_xs]) &&
  ------------------
  |  |   45|   131k|#define SVCD_FALSE 0
  ------------------
  |  Branch (922:37): [True: 65.6k, False: 65.6k]
  ------------------
  923|  65.6k|                                    (ai4_ref_part_idc[i4_temp_part_y][i4_indx_x] != -1))
  ------------------
  |  Branch (923:37): [True: 0, False: 65.6k]
  ------------------
  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|   131k|                            else if((SVCD_FALSE == ai4_flag_4x4[i4_temp_y][i4_temp_x]) &&
  ------------------
  |  |   45|   131k|#define SVCD_FALSE 0
  ------------------
  |  Branch (928:37): [True: 65.6k, False: 65.6k]
  ------------------
  929|  65.6k|                                    (ai4_ref_part_idc[i4_temp_part_y][i4_temp_part_x] != -1))
  ------------------
  |  Branch (929:37): [True: 0, False: 65.6k]
  ------------------
  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|   131k|                        } /* end of part idc equal to -1 check */
  935|       |
  936|  1.93M|                    }     /* end of sub partition xs loop */
  937|       |
  938|   968k|                }         /* end of sub partition ys loop */
  939|       |
  940|   484k|            }             /* end of partition xp loop */
  941|       |
  942|   242k|        }                 /* end of partition yp loop */
  943|       |
  944|       |        /* replace values of "-1" on an 8x8 block basis */
  945|       |
  946|       |        /* loop over (4) 8x8 partitions */
  947|   363k|        for(i4_yp = 0; i4_yp < 2; i4_yp++)
  ------------------
  |  Branch (947:24): [True: 242k, False: 121k]
  ------------------
  948|   242k|        {
  949|   726k|            for(i4_xp = 0; i4_xp < 2; i4_xp++)
  ------------------
  |  Branch (949:28): [True: 484k, False: 242k]
  ------------------
  950|   484k|            {
  951|   484k|                WORD32 i4_yp_inv = 1 - i4_yp;
  952|   484k|                WORD32 i4_xp_inv = 1 - i4_xp;
  953|   484k|                WORD32 i4_xo_inv = (2 - i4_xp);
  954|   484k|                WORD32 i4_yo_inv = (2 - i4_yp);
  955|   484k|                i4_indx_x = (i4_xp << 1);
  956|   484k|                i4_indx_y = (i4_yp << 1);
  957|       |
  958|       |                /* check if the current part idc is -1*/
  959|   484k|                if(ai4_ref_part_idc[i4_indx_y][i4_indx_x] == -1)
  ------------------
  |  Branch (959:20): [True: 32.8k, False: 451k]
  ------------------
  960|  32.8k|                {
  961|  32.8k|                    ai4_flag_8x8[i4_yp][i4_xp] = SVCD_TRUE;
  ------------------
  |  |   46|  32.8k|#define SVCD_TRUE 1
  ------------------
  962|       |
  963|       |                    /* replace the -1 with appropriate values */
  964|  32.8k|                    if(SVCD_FALSE == ai4_flag_8x8[i4_yp][i4_xp_inv] &&
  ------------------
  |  |   45|  32.8k|#define SVCD_FALSE 0
  ------------------
  |  Branch (964:24): [True: 25.2k, False: 7.54k]
  ------------------
  965|  25.2k|                       ai4_ref_part_idc[i4_indx_y][i4_xo_inv] != -1)
  ------------------
  |  Branch (965:24): [True: 17.7k, False: 7.54k]
  ------------------
  966|  17.7k|                    {
  967|  17.7k|                        ai4_ref_part_idc[i4_indx_y][i4_indx_x] =
  968|  17.7k|                            ai4_ref_part_idc[i4_indx_y][i4_xo_inv];
  969|       |
  970|  17.7k|                        ai4_ref_part_idc[i4_indx_y + 1][i4_indx_x] =
  971|  17.7k|                            ai4_ref_part_idc[i4_indx_y + 1][i4_xo_inv];
  972|       |
  973|  17.7k|                        ai4_ref_part_idc[i4_indx_y][i4_indx_x + 1] =
  974|  17.7k|                            ai4_ref_part_idc[i4_indx_y][i4_xo_inv];
  975|       |
  976|  17.7k|                        ai4_ref_part_idc[i4_indx_y + 1][i4_indx_x + 1] =
  977|  17.7k|                            ai4_ref_part_idc[i4_indx_y + 1][i4_xo_inv];
  978|  17.7k|                    }
  979|  15.0k|                    else if(SVCD_FALSE == ai4_flag_8x8[i4_yp_inv][i4_xp] &&
  ------------------
  |  |   45|  15.0k|#define SVCD_FALSE 0
  ------------------
  |  Branch (979:29): [True: 14.6k, False: 402]
  ------------------
  980|  14.6k|                            ai4_ref_part_idc[i4_yo_inv][i4_indx_x] != -1)
  ------------------
  |  Branch (980:29): [True: 14.3k, False: 375]
  ------------------
  981|  14.3k|                    {
  982|  14.3k|                        ai4_ref_part_idc[i4_indx_y][i4_indx_x] =
  983|  14.3k|                            ai4_ref_part_idc[i4_yo_inv][i4_indx_x];
  984|       |
  985|  14.3k|                        ai4_ref_part_idc[i4_indx_y + 1][i4_indx_x] =
  986|  14.3k|                            ai4_ref_part_idc[i4_yo_inv][i4_indx_x];
  987|       |
  988|  14.3k|                        ai4_ref_part_idc[i4_indx_y][i4_indx_x + 1] =
  989|  14.3k|                            ai4_ref_part_idc[i4_yo_inv][i4_indx_x + 1];
  990|       |
  991|  14.3k|                        ai4_ref_part_idc[i4_indx_y + 1][i4_indx_x + 1] =
  992|  14.3k|                            ai4_ref_part_idc[i4_yo_inv][i4_indx_x + 1];
  993|  14.3k|                    }
  994|    777|                    else if(SVCD_FALSE == ai4_flag_8x8[i4_yp_inv][i4_xp_inv] &&
  ------------------
  |  |   45|    777|#define SVCD_FALSE 0
  ------------------
  |  Branch (994:29): [True: 777, False: 0]
  ------------------
  995|    777|                            ai4_ref_part_idc[i4_yo_inv][i4_xo_inv] != -1)
  ------------------
  |  Branch (995:29): [True: 777, False: 0]
  ------------------
  996|    777|                    {
  997|    777|                        ai4_ref_part_idc[i4_indx_y][i4_indx_x] =
  998|    777|                            ai4_ref_part_idc[i4_yo_inv][i4_xo_inv];
  999|       |
 1000|    777|                        ai4_ref_part_idc[i4_indx_y + 1][i4_indx_x] =
 1001|    777|                            ai4_ref_part_idc[i4_yo_inv][i4_xo_inv];
 1002|       |
 1003|    777|                        ai4_ref_part_idc[i4_indx_y][i4_indx_x + 1] =
 1004|    777|                            ai4_ref_part_idc[i4_yo_inv][i4_xo_inv];
 1005|       |
 1006|    777|                        ai4_ref_part_idc[i4_indx_y + 1][i4_indx_x + 1] =
 1007|    777|                            ai4_ref_part_idc[i4_yo_inv][i4_xo_inv];
 1008|    777|                    }
 1009|  32.8k|                } /* end of part idc equal to -1 check */
 1010|       |
 1011|   484k|            }     /* end of partition xp loop */
 1012|       |
 1013|   242k|        }         /* 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|   130k|    *pi4_intra_flag = i4_intra_mb_flag;
 1019|       |
 1020|   130k|    return;
 1021|   130k|}
isvcd_check_motion:
 1049|   531k|{
 1050|   531k|    mv_pred_t *ps_part_a;
 1051|   531k|    mv_pred_t *ps_part_b;
 1052|   531k|    WORD32 i4_cntr;
 1053|   531k|    WORD32 i4_mv_treshold;
 1054|   531k|    WORD32 i4_flag = 0;
 1055|       |
 1056|   531k|    ps_part_a = (mv_pred_t *) pv_motion_prm_mb_part_a;
 1057|   531k|    ps_part_b = (mv_pred_t *) pv_motion_prm_mb_part_b;
 1058|       |
 1059|  1.11M|    for(i4_cntr = 0; i4_cntr < i4_listx; i4_cntr++)
  ------------------
  |  Branch (1059:22): [True: 633k, False: 484k]
  ------------------
 1060|   633k|    {
 1061|       |        /* calculate the absolute diff of both components */
 1062|   633k|        i4_mv_treshold = ABS((ps_part_a->i2_mv[2 * i4_cntr]) - (ps_part_b->i2_mv[2 * i4_cntr]));
  ------------------
  |  |  100|   633k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 18.4k, False: 615k]
  |  |  ------------------
  ------------------
 1063|   633k|        i4_mv_treshold +=
 1064|   633k|            ABS((ps_part_a->i2_mv[1 + 2 * i4_cntr]) - (ps_part_b->i2_mv[1 + 2 * i4_cntr]));
  ------------------
  |  |  100|   633k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 17.6k, False: 615k]
  |  |  ------------------
  ------------------
 1065|       |
 1066|   633k|        if((0 == i4_mv_treshold) &&
  ------------------
  |  Branch (1066:12): [True: 593k, False: 39.7k]
  ------------------
 1067|   593k|           (ps_part_a->i1_ref_frame[i4_cntr] == ps_part_b->i1_ref_frame[i4_cntr]))
  ------------------
  |  Branch (1067:12): [True: 587k, False: 6.70k]
  ------------------
 1068|   587k|        {
 1069|   587k|            i4_flag = 1;
 1070|   587k|        }
 1071|  46.4k|        else
 1072|  46.4k|        {
 1073|  46.4k|            i4_flag = 0;
 1074|  46.4k|            return (i4_flag);
 1075|  46.4k|        }
 1076|       |
 1077|   633k|    } /* end of loop over lists */
 1078|       |
 1079|   484k|    return (i4_flag);
 1080|   531k|}
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: 3.62k, False: 2.28M]
  |  Branch (1127:25): [True: 3.62k, False: 0]
  ------------------
 1128|  3.62k|    {
 1129|  3.62k|        i4_min_positive = i4_input_2;
 1130|  3.62k|    }
 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.12M|{
 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.12M|    mode_motion_ctxt_t *ps_ctxt;
 1294|  2.12M|    mode_motion_lyr_ctxt *ps_lyr_mem;
 1295|  2.12M|    mv_pred_t *ps_motion_pred;
 1296|  2.12M|    mv_pred_t *ps_ref_mv;
 1297|  2.12M|    WORD32 i4_lists;
 1298|  2.12M|    WORD32 i4_ref_16x16_flag = 0;
 1299|  2.12M|    WORD32 i4_scale_x, i4_scale_y;
 1300|  2.12M|    WORD16 i2_max_mv_x, i2_max_mv_y;
 1301|       |
 1302|  2.12M|    ps_ctxt = (mode_motion_ctxt_t *) pv_comp_mode_mv_ctxt;
 1303|       |
 1304|       |    /* get the current layer ctxt */
 1305|  2.12M|    ps_lyr_mem = &ps_ctxt->as_res_lyr_mem[ps_ctxt->i4_res_id];
 1306|       |
 1307|       |    /* ----------- Get the reference layer MV structure ---------- */
 1308|  2.12M|    {
 1309|  2.12M|        mv_pred_t *ps_ref_lyr_motion_prms;
 1310|  2.12M|        WORD32 i4_ref_x, i4_ref_y;
 1311|  2.12M|        WORD32 i4_ref_mb_x, i4_ref_mb_y;
 1312|  2.12M|        WORD32 i4_ref_width;
 1313|       |
 1314|  2.12M|        ps_ref_lyr_motion_prms = (mv_pred_t *) ps_lyr_mem->pv_ref_mv_bank_l0;
 1315|  2.12M|        i4_ref_width = ps_lyr_mem->i4_ref_width;
 1316|  2.12M|        i2_max_mv_x = i4_ref_width << 2;
 1317|  2.12M|        i2_max_mv_y = ps_lyr_mem->i4_ref_height << 2;
 1318|       |
 1319|       |        /* extract the reference x and y positions */
 1320|  2.12M|        i4_ref_x = (*pi4_ref_part_idc) & 0xFFFF;
 1321|  2.12M|        i4_ref_y = (*pi4_ref_part_idc) >> 16;
 1322|       |
 1323|       |        /* get the reference mb x and y */
 1324|  2.12M|        i4_ref_mb_x = (i4_ref_x >> 4);
 1325|  2.12M|        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.12M|        ps_ref_mv = ps_ref_lyr_motion_prms + (i4_ref_mb_x << 4);
 1330|  2.12M|        ps_ref_mv += (i4_ref_mb_y * i4_ref_width);
 1331|       |
 1332|       |        /* if reference layer mb type is non 16x16 */
 1333|  2.12M|        if(0 == i4_ref_16x16_flag)
  ------------------
  |  Branch (1333:12): [True: 2.12M, False: 0]
  ------------------
 1334|  2.12M|        {
 1335|       |            /* increment the pointer to appropaite 4x4 */
 1336|  2.12M|            ps_ref_mv += ((i4_ref_x >> 2) & 0x03);
 1337|  2.12M|            ps_ref_mv += (((i4_ref_y >> 2) & 0x03) << 2);
 1338|  2.12M|        }
 1339|  2.12M|    }
 1340|       |
 1341|       |    /* motion pred structure */
 1342|  2.12M|    ps_motion_pred = pv_motion_pred;
 1343|       |
 1344|       |    /* retrive the scale factors */
 1345|  2.12M|    i4_scale_x = ps_lyr_mem->i4_scale_mv_x;
 1346|  2.12M|    i4_scale_y = ps_lyr_mem->i4_scale_mv_y;
 1347|       |
 1348|       |    /* loop on the lists given as input */
 1349|  4.69M|    for(i4_lists = 0; i4_lists < i4_listx; i4_lists++)
  ------------------
  |  Branch (1349:23): [True: 2.57M, False: 2.12M]
  ------------------
 1350|  2.57M|    {
 1351|  2.57M|        WORD32 i4_mv_x, i4_mv_y;
 1352|  2.57M|        WORD16 i2_mv_x, i2_mv_y;
 1353|       |
 1354|       |        /* if the refernce index is -1 set the default values */
 1355|  2.57M|        if(-1 == ps_ref_mv->i1_ref_frame[i4_lists])
  ------------------
  |  Branch (1355:12): [True: 285k, False: 2.28M]
  ------------------
 1356|   285k|        {
 1357|   285k|            ps_motion_pred->i1_ref_frame[i4_lists] = -1;
 1358|   285k|            ps_motion_pred->i2_mv[2 * i4_lists] = 0;
 1359|   285k|            ps_motion_pred->i2_mv[1 + 2 * i4_lists] = 0;
 1360|   285k|        }
 1361|  2.28M|        else
 1362|  2.28M|        {
 1363|       |            /* field MB and field pictures modification are present */
 1364|       |            /* currently not implemented */
 1365|  2.28M|            ps_motion_pred->i1_ref_frame[i4_lists] = ps_ref_mv->i1_ref_frame[i4_lists];
 1366|       |
 1367|  2.28M|            i2_mv_x = ps_ref_mv->i2_mv[2 * i4_lists];
 1368|  2.28M|            i2_mv_y = ps_ref_mv->i2_mv[1 + 2 * i4_lists];
 1369|  2.28M|            i2_mv_x = CLIP3(-i2_max_mv_x, i2_max_mv_x, i2_mv_x);
  ------------------
  |  |   77|  2.28M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 1.68k, False: 2.28M]
  |  |  |  Branch (77:54): [True: 1.47k, False: 2.28M]
  |  |  ------------------
  ------------------
 1370|  2.28M|            i2_mv_y = CLIP3(-i2_max_mv_y, i2_max_mv_y, i2_mv_y);
  ------------------
  |  |   77|  2.28M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 1.48k, False: 2.28M]
  |  |  |  Branch (77:54): [True: 833, False: 2.28M]
  |  |  ------------------
  ------------------
 1371|       |            /* scale the motion vectors */
 1372|  2.28M|            i4_mv_x = (i2_mv_x * i4_scale_x + 32768) >> 16;
 1373|  2.28M|            i4_mv_y = (i2_mv_y * i4_scale_y + 32768) >> 16;
 1374|       |
 1375|       |            /* store the final motion vectors */
 1376|  2.28M|            ps_motion_pred->i2_mv[2 * i4_lists] = i4_mv_x;
 1377|  2.28M|            ps_motion_pred->i2_mv[1 + 2 * i4_lists] = i4_mv_y;
 1378|       |
 1379|       |            /* if cropping change flag is present */
 1380|  2.28M|            if(SVCD_TRUE == ps_lyr_mem->ps_curr_lyr_res_prms->u1_cropping_change_flag)
  ------------------
  |  |   46|  2.28M|#define SVCD_TRUE 1
  ------------------
  |  Branch (1380:16): [True: 0, False: 2.28M]
  ------------------
 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.28M|        }
 1388|  2.57M|    } /* end of lists loop */
 1389|       |
 1390|  2.12M|    return (i4_ref_16x16_flag);
 1391|  2.12M|}
isvcd_store_motion_map:
 1425|   190k|{
 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|   190k|    WORD32 i4_i, i4_j;
 1432|   190k|    mv_pred_t *ps_mv_pred_src;
 1433|   190k|    mv_pred_t *ps_mv_map_dst;
 1434|       |
 1435|   190k|    ps_mv_pred_src = (mv_pred_t *) pv_motion_pred;
 1436|   190k|    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|   571k|    for(i4_i = 0; i4_i < i4_part_height; i4_i++)
  ------------------
  |  Branch (1439:19): [True: 381k, False: 190k]
  ------------------
 1440|   381k|    {
 1441|  1.14M|        for(i4_j = 0; i4_j < i4_part_width; i4_j++)
  ------------------
  |  Branch (1441:23): [True: 762k, False: 381k]
  ------------------
 1442|   762k|        {
 1443|       |            /* copy form source to destination */
 1444|   762k|            *(ps_mv_map_dst + i4_j) = *(ps_mv_pred_src + (i4_src_update_flag * i4_j));
 1445|       |
 1446|   762k|        } /* end of loop over partition width */
 1447|       |
 1448|   381k|        ps_mv_map_dst += i4_dst_stride;
 1449|   381k|        ps_mv_pred_src += (i4_src_stride * i4_src_update_flag);
 1450|       |
 1451|   381k|    } /* end of loop over partition height */
 1452|   190k|    return;
 1453|   190k|}
isvcd_check_mv_diff:
 1482|  2.42M|{
 1483|  2.42M|    mv_pred_t *ps_part_a;
 1484|  2.42M|    mv_pred_t *ps_part_b;
 1485|  2.42M|    WORD32 i4_cntr;
 1486|  2.42M|    WORD32 i4_mv_treshold;
 1487|  2.42M|    WORD32 i4_flag;
 1488|       |
 1489|  2.42M|    ps_part_a = (mv_pred_t *) pv_motion_prm_a;
 1490|  2.42M|    ps_part_b = (mv_pred_t *) pv_motion_prm_b;
 1491|       |
 1492|  2.42M|    i4_flag = 1;
 1493|  5.23M|    for(i4_cntr = 0; i4_cntr < i4_listx; i4_cntr++)
  ------------------
  |  Branch (1493:22): [True: 2.86M, False: 2.37M]
  ------------------
 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: 22.8k, False: 2.83M]
  |  |  ------------------
  ------------------
 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: 28.6k, False: 2.83M]
  |  |  ------------------
  ------------------
 1499|       |
 1500|  2.86M|        if(i4_actual_threshold < i4_mv_treshold)
  ------------------
  |  Branch (1500:12): [True: 47.2k, False: 2.81M]
  ------------------
 1501|  47.2k|        {
 1502|  47.2k|            i4_flag = 0;
 1503|  47.2k|            break;
 1504|  47.2k|        }
 1505|       |
 1506|  2.86M|    } /* end of loop over lists */
 1507|  2.42M|    return (i4_flag);
 1508|  2.42M|}
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|   605k|    for(i4_blk_y = 0; i4_blk_y < NUM_SUB_MB_PARTS; i4_blk_y++)
  ------------------
  |  |   60|   605k|#define NUM_SUB_MB_PARTS 4
  ------------------
  |  Branch (1592:23): [True: 484k, False: 121k]
  ------------------
 1593|   484k|    {
 1594|  2.42M|        for(i4_blk_x = 0; i4_blk_x < NUM_SUB_MB_PARTS; i4_blk_x++)
  ------------------
  |  |   60|  2.42M|#define NUM_SUB_MB_PARTS 4
  ------------------
  |  Branch (1594:27): [True: 1.93M, False: 484k]
  ------------------
 1595|  1.93M|        {
 1596|  1.93M|            isvcd_interlyr_motion_scale(pv_comp_mode_mv_ctxt, &ai4_ref_part_idc[i4_blk_y][i4_blk_x],
 1597|  1.93M|                                        ps_mb_params, (ps_motion_pred + (4 * i4_blk_y) + i4_blk_x),
 1598|  1.93M|                                        i4_listx, (i4_mb_pic_x + (i4_blk_x << 2) + 1),
 1599|  1.93M|                                        (i4_mb_pic_y + (i4_blk_y << 2) + 1),
 1600|  1.93M|                                        ps_dec->ppv_map_ref_idx_to_poc);
 1601|       |
 1602|  1.93M|        } /* end of blk x loop */
 1603|   484k|    }     /* end of blk y loop */
 1604|       |
 1605|       |    /********************************************************/
 1606|       |    /* get the final reference index into a temparory array */
 1607|       |    /********************************************************/
 1608|       |
 1609|       |    /* set reference indices */
 1610|   264k|    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|   264k|        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: 572k, False: 286k]
  ------------------
 1631|   572k|                {
 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: 572k]
  ------------------
 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: 572k]
  ------------------
 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: 9.80k, False: 2.28M]
  ------------------
 1660|  2.29M|                               ps_temp->i1_ref_frame[i4_i])
 1661|  9.80k|                            {
 1662|  9.80k|                                mv_pred_t *ps_temp_1;
 1663|  9.80k|                                WORD32 i4_updated_flag = SVCD_FALSE;
  ------------------
  |  |   45|  9.80k|#define SVCD_FALSE 0
  ------------------
 1664|       |
 1665|  9.80k|                                ps_temp_1 = ps_motion_pred + (i4_xp << 1) + (1 - i4_xs);
 1666|  9.80k|                                ps_temp_1 += 4 * ((i4_yp << 1) + i4_ys);
 1667|       |
 1668|       |                                /* store the appropriate neighbours */
 1669|  9.80k|                                if(ai4_temp_ref_indx[i4_i][2 * i4_yp + i4_xp] ==
  ------------------
  |  Branch (1669:36): [True: 4.03k, False: 5.77k]
  ------------------
 1670|  9.80k|                                   ps_temp_1->i1_ref_frame[i4_i])
 1671|  4.03k|                                {
 1672|  4.03k|                                    ps_temp->i2_mv[2 * i4_i] = ps_temp_1->i2_mv[2 * i4_i];
 1673|       |
 1674|  4.03k|                                    ps_temp->i2_mv[1 + (2 * i4_i)] =
 1675|  4.03k|                                        ps_temp_1->i2_mv[1 + (2 * i4_i)];
 1676|  4.03k|                                    i4_updated_flag = SVCD_TRUE;
  ------------------
  |  |   46|  4.03k|#define SVCD_TRUE 1
  ------------------
 1677|  4.03k|                                }
 1678|       |
 1679|  9.80k|                                if(SVCD_FALSE == i4_updated_flag)
  ------------------
  |  |   45|  9.80k|#define SVCD_FALSE 0
  ------------------
  |  Branch (1679:36): [True: 5.77k, False: 4.03k]
  ------------------
 1680|  5.77k|                                {
 1681|  5.77k|                                    ps_temp_1 = ps_motion_pred + (i4_xp << 1) + i4_xs;
 1682|       |
 1683|  5.77k|                                    ps_temp_1 += 4 * ((i4_yp << 1) + 1 - i4_ys);
 1684|       |
 1685|  5.77k|                                    if(ai4_temp_ref_indx[i4_i][2 * i4_yp + i4_xp] ==
  ------------------
  |  Branch (1685:40): [True: 5.50k, False: 267]
  ------------------
 1686|  5.77k|                                       ps_temp_1->i1_ref_frame[i4_i])
 1687|  5.50k|                                    {
 1688|  5.50k|                                        ps_temp->i2_mv[2 * i4_i] = ps_temp_1->i2_mv[2 * i4_i];
 1689|       |
 1690|  5.50k|                                        ps_temp->i2_mv[1 + (2 * i4_i)] =
 1691|  5.50k|                                            ps_temp_1->i2_mv[1 + (2 * i4_i)];
 1692|  5.50k|                                        i4_updated_flag = SVCD_TRUE;
  ------------------
  |  |   46|  5.50k|#define SVCD_TRUE 1
  ------------------
 1693|  5.50k|                                    }
 1694|  5.77k|                                }
 1695|  9.80k|                                if(SVCD_FALSE == i4_updated_flag)
  ------------------
  |  |   45|  9.80k|#define SVCD_FALSE 0
  ------------------
  |  Branch (1695:36): [True: 267, False: 9.53k]
  ------------------
 1696|    267|                                {
 1697|    267|                                    ps_temp_1 = ps_motion_pred + (i4_xp << 1) + (1 - i4_xs);
 1698|    267|                                    ps_temp_1 += 4 * ((i4_yp << 1) + 1 - i4_ys);
 1699|       |
 1700|    267|                                    ps_temp->i2_mv[2 * i4_i] = ps_temp_1->i2_mv[2 * i4_i];
 1701|       |
 1702|    267|                                    ps_temp->i2_mv[1 + (2 * i4_i)] =
 1703|    267|                                        ps_temp_1->i2_mv[1 + (2 * i4_i)];
 1704|       |
 1705|    267|                                    i4_updated_flag = SVCD_TRUE;
  ------------------
  |  |   46|    267|#define SVCD_TRUE 1
  ------------------
 1706|    267|                                }
 1707|  9.80k|                            } /* 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|   572k|                }             /* 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|  22.1k|#define SVCD_TRUE 1
  ------------------
  |  Branch (1720:8): [True: 22.1k, False: 98.9k]
  |  Branch (1720:27): [True: 6.98k, False: 15.1k]
  ------------------
 1721|  6.98k|    {
 1722|       |        /* only applicable for EB Slice */
 1723|       |        /* store the corner 4x4 motion vectors to the whole block */
 1724|       |        /* 2 lists and 4 partitions */
 1725|  6.98k|        mot_vec_t s_temp_mv[2][4];
 1726|  6.98k|        WORD32 i4_xp, i4_yp;
 1727|  6.98k|        memset(&s_temp_mv[0][0], 0, sizeof(s_temp_mv));
 1728|       |
 1729|  20.9k|        for(i4_i = 0; i4_i < i4_listx; i4_i++)
  ------------------
  |  Branch (1729:23): [True: 13.9k, False: 6.98k]
  ------------------
 1730|  13.9k|        {
 1731|  13.9k|            s_temp_mv[i4_i][0].i2_mv_x = ps_motion_pred[0].i2_mv[2 * i4_i];
 1732|  13.9k|            s_temp_mv[i4_i][0].i2_mv_y = ps_motion_pred[0].i2_mv[1 + (2 * i4_i)];
 1733|       |
 1734|  13.9k|            s_temp_mv[i4_i][1].i2_mv_x = ps_motion_pred[3].i2_mv[2 * i4_i];
 1735|  13.9k|            s_temp_mv[i4_i][1].i2_mv_y = ps_motion_pred[3].i2_mv[1 + (2 * i4_i)];
 1736|       |
 1737|  13.9k|            s_temp_mv[i4_i][2].i2_mv_x = ps_motion_pred[12].i2_mv[2 * i4_i];
 1738|  13.9k|            s_temp_mv[i4_i][2].i2_mv_y = ps_motion_pred[12].i2_mv[1 + (2 * i4_i)];
 1739|       |
 1740|  13.9k|            s_temp_mv[i4_i][3].i2_mv_x = ps_motion_pred[15].i2_mv[2 * i4_i];
 1741|  13.9k|            s_temp_mv[i4_i][3].i2_mv_y = ps_motion_pred[15].i2_mv[1 + (2 * i4_i)];
 1742|       |
 1743|  13.9k|        } /* end of loop over lists */
 1744|       |
 1745|       |        /* replace the motion vectors */
 1746|  20.9k|        for(i4_i = 0; i4_i < i4_listx; i4_i++)
  ------------------
  |  Branch (1746:23): [True: 13.9k, False: 6.98k]
  ------------------
 1747|  13.9k|        {
 1748|  69.8k|            for(i4_yp = 0; i4_yp < 4; i4_yp++)
  ------------------
  |  Branch (1748:28): [True: 55.8k, False: 13.9k]
  ------------------
 1749|  55.8k|            {
 1750|   279k|                for(i4_xp = 0; i4_xp < 4; i4_xp++)
  ------------------
  |  Branch (1750:32): [True: 223k, False: 55.8k]
  ------------------
 1751|   223k|                {
 1752|   223k|                    mv_pred_t *ps_temp;
 1753|   223k|                    ps_temp = ps_motion_pred + i4_xp;
 1754|   223k|                    ps_temp += 4 * i4_yp;
 1755|       |
 1756|   223k|                    ps_temp->i2_mv[2 * i4_i] =
 1757|   223k|                        s_temp_mv[i4_i][2 * (i4_yp >> 1) + (i4_xp >> 1)].i2_mv_x;
 1758|       |
 1759|   223k|                    ps_temp->i2_mv[1 + (2 * i4_i)] =
 1760|   223k|                        s_temp_mv[i4_i][2 * (i4_yp >> 1) + (i4_xp >> 1)].i2_mv_y;
 1761|       |
 1762|   223k|                } /* end of loop over sub partitions xp */
 1763|  55.8k|            }     /* end of loop over sub partitions yp */
 1764|  13.9k|        }         /* end of loop over lists */
 1765|  6.98k|    }
 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|   264k|        for(i4_i = 0; i4_i < i4_listx; i4_i++)
  ------------------
  |  Branch (1772:23): [True: 143k, False: 121k]
  ------------------
 1773|   143k|        {
 1774|   715k|            for(i4_yp = 0; i4_yp < 4; i4_yp++)
  ------------------
  |  Branch (1774:28): [True: 572k, False: 143k]
  ------------------
 1775|   572k|            {
 1776|  2.86M|                for(i4_xp = 0; i4_xp < 4; i4_xp++)
  ------------------
  |  Branch (1776:32): [True: 2.29M, False: 572k]
  ------------------
 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|   572k|            }     /* 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|   363k|        for(i4_yp = 0; i4_yp < 2; i4_yp++)
  ------------------
  |  Branch (1810:24): [True: 242k, False: 121k]
  ------------------
 1811|   242k|        {
 1812|   726k|            for(i4_xp = 0; i4_xp < 2; i4_xp++)
  ------------------
  |  Branch (1812:28): [True: 484k, False: 242k]
  ------------------
 1813|   484k|            {
 1814|   484k|                mv_pred_t *ps_temp;
 1815|   484k|                WORD32 i4_part_size = 0;
 1816|   484k|                WORD32 i4_horz1_match, i4_vert1_match;
 1817|   484k|                WORD32 i4_horz2_match, i4_vert2_match;
 1818|   484k|                WORD32 i4_diag_match;
 1819|       |
 1820|   484k|                WORD32 i4_8x8_match, i4_horz_match, i4_vert_match;
 1821|   484k|                WORD32 i4_mv_x, i4_mv_y;
 1822|       |
 1823|   484k|                ps_temp = ps_motion_pred + (i4_xp << 1);
 1824|   484k|                ps_temp += 4 * ((i4_yp << 1));
 1825|       |
 1826|       |                /* default init */
 1827|   484k|                i4_8x8_match = i4_horz_match = i4_vert_match = SVCD_TRUE;
  ------------------
  |  |   46|   484k|#define SVCD_TRUE 1
  ------------------
 1828|       |
 1829|       |                /* check if the mv diff in horz direction is under threshold*/
 1830|   484k|                i4_horz1_match =
 1831|   484k|                    isvcd_check_mv_diff(ps_temp, (ps_temp + 1), i4_listx, i4_mv_treshold);
 1832|       |
 1833|   484k|                i4_horz2_match =
 1834|   484k|                    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|   484k|                i4_vert1_match =
 1838|   484k|                    isvcd_check_mv_diff(ps_temp, (ps_temp + 4), i4_listx, i4_mv_treshold);
 1839|       |
 1840|   484k|                i4_vert2_match =
 1841|   484k|                    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|   484k|                i4_diag_match =
 1845|   484k|                    isvcd_check_mv_diff(ps_temp, (ps_temp + 4 + 1), i4_listx, i4_mv_treshold);
 1846|       |
 1847|       |                /* calculate the excat matching points*/
 1848|   484k|                i4_8x8_match = i4_8x8_match && i4_horz1_match && i4_vert1_match && i4_diag_match;
  ------------------
  |  Branch (1848:32): [True: 484k, False: 0]
  |  Branch (1848:48): [True: 475k, False: 8.92k]
  |  Branch (1848:66): [True: 468k, False: 6.48k]
  |  Branch (1848:84): [True: 468k, False: 222]
  ------------------
 1849|   484k|                i4_horz_match = i4_horz_match && i4_horz1_match && i4_horz2_match;
  ------------------
  |  Branch (1849:33): [True: 484k, False: 0]
  |  Branch (1849:50): [True: 475k, False: 8.92k]
  |  Branch (1849:68): [True: 474k, False: 324]
  ------------------
 1850|   484k|                i4_vert_match = i4_vert_match && i4_vert1_match && i4_vert2_match;
  ------------------
  |  Branch (1850:33): [True: 484k, False: 0]
  |  Branch (1850:50): [True: 477k, False: 6.96k]
  |  Branch (1850:68): [True: 476k, False: 347]
  ------------------
 1851|       |
 1852|       |                /* modify the motion vectors appropriately */
 1853|       |
 1854|  1.05M|                for(i4_i = 0; i4_i < i4_listx; i4_i++)
  ------------------
  |  Branch (1854:31): [True: 572k, False: 484k]
  ------------------
 1855|   572k|                {
 1856|       |                    /* 8x8 mode all the 4 blocks are under threshold */
 1857|   572k|                    if(SVCD_TRUE == i4_8x8_match)
  ------------------
  |  |   46|   572k|#define SVCD_TRUE 1
  ------------------
  |  Branch (1857:24): [True: 555k, False: 17.2k]
  ------------------
 1858|   555k|                    {
 1859|       |                        /* calculate the avarage */
 1860|   555k|                        i4_mv_x =
 1861|   555k|                            ((ps_temp[0].i2_mv[2 * i4_i]) + (ps_temp[1].i2_mv[2 * i4_i]) +
 1862|   555k|                             (ps_temp[4].i2_mv[2 * i4_i]) + (ps_temp[5].i2_mv[2 * i4_i] + 2)) >>
 1863|   555k|                            2;
 1864|       |
 1865|   555k|                        i4_mv_y = ((ps_temp[0].i2_mv[1 + (2 * i4_i)]) +
 1866|   555k|                                   (ps_temp[1].i2_mv[1 + (2 * i4_i)]) +
 1867|   555k|                                   (ps_temp[4].i2_mv[1 + (2 * i4_i)]) +
 1868|   555k|                                   (ps_temp[5].i2_mv[1 + (2 * i4_i)] + 2)) >>
 1869|   555k|                                  2;
 1870|       |
 1871|       |                        /* store the modified motion vectors */
 1872|   555k|                        ps_temp[0].i2_mv[2 * i4_i] = (WORD16) i4_mv_x;
 1873|   555k|                        ps_temp[1].i2_mv[2 * i4_i] = (WORD16) i4_mv_x;
 1874|   555k|                        ps_temp[4].i2_mv[2 * i4_i] = (WORD16) i4_mv_x;
 1875|   555k|                        ps_temp[5].i2_mv[2 * i4_i] = (WORD16) i4_mv_x;
 1876|       |
 1877|   555k|                        ps_temp[0].i2_mv[1 + (2 * i4_i)] = (WORD16) i4_mv_y;
 1878|   555k|                        ps_temp[1].i2_mv[1 + (2 * i4_i)] = (WORD16) i4_mv_y;
 1879|   555k|                        ps_temp[4].i2_mv[1 + (2 * i4_i)] = (WORD16) i4_mv_y;
 1880|   555k|                        ps_temp[5].i2_mv[1 + (2 * i4_i)] = (WORD16) i4_mv_y;
 1881|       |
 1882|       |                        /* store the sub mb partition size */
 1883|   555k|                        i4_part_size = SUBMB_8x8;
  ------------------
  |  |  501|   555k|#define SUBMB_8x8    0
  ------------------
 1884|   555k|                    }
 1885|       |                    /* 8x4 mode  */
 1886|  17.2k|                    else if(SVCD_TRUE == i4_horz_match)
  ------------------
  |  |   46|  17.2k|#define SVCD_TRUE 1
  ------------------
  |  Branch (1886:29): [True: 7.91k, False: 9.37k]
  ------------------
 1887|  7.91k|                    {
 1888|       |                        /* horizontal directional merging */
 1889|       |                        /* calculate the average of first two and store back*/
 1890|  7.91k|                        i4_mv_x =
 1891|  7.91k|                            ((ps_temp[0].i2_mv[2 * i4_i]) + (ps_temp[1].i2_mv[2 * i4_i] + 1)) >> 1;
 1892|       |
 1893|  7.91k|                        i4_mv_y = ((ps_temp[0].i2_mv[1 + (2 * i4_i)]) +
 1894|  7.91k|                                   (ps_temp[1].i2_mv[1 + (2 * i4_i)] + 1)) >>
 1895|  7.91k|                                  1;
 1896|       |
 1897|  7.91k|                        ps_temp[0].i2_mv[2 * i4_i] = (WORD16) i4_mv_x;
 1898|  7.91k|                        ps_temp[1].i2_mv[2 * i4_i] = (WORD16) i4_mv_x;
 1899|       |
 1900|  7.91k|                        ps_temp[0].i2_mv[1 + (2 * i4_i)] = (WORD16) i4_mv_y;
 1901|  7.91k|                        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|  7.91k|                        i4_mv_x =
 1905|  7.91k|                            ((ps_temp[4].i2_mv[2 * i4_i]) + (ps_temp[5].i2_mv[2 * i4_i] + 1)) >> 1;
 1906|       |
 1907|  7.91k|                        i4_mv_y = ((ps_temp[4].i2_mv[1 + (2 * i4_i)]) +
 1908|  7.91k|                                   (ps_temp[5].i2_mv[1 + (2 * i4_i)] + 1)) >>
 1909|  7.91k|                                  1;
 1910|       |
 1911|  7.91k|                        ps_temp[4].i2_mv[2 * i4_i] = (WORD16) i4_mv_x;
 1912|  7.91k|                        ps_temp[5].i2_mv[2 * i4_i] = (WORD16) i4_mv_x;
 1913|       |
 1914|  7.91k|                        ps_temp[4].i2_mv[1 + (2 * i4_i)] = (WORD16) i4_mv_y;
 1915|  7.91k|                        ps_temp[5].i2_mv[1 + (2 * i4_i)] = (WORD16) i4_mv_y;
 1916|       |                        /* store the sub mb partition size */
 1917|  7.91k|                        i4_part_size = SUBMB_8x4;
  ------------------
  |  |  502|  7.91k|#define SUBMB_8x4    1
  ------------------
 1918|  7.91k|                    }
 1919|       |                    /* 4x8 mode all the 4 blocks are under threshold */
 1920|  9.37k|                    else if(SVCD_TRUE == i4_vert_match)
  ------------------
  |  |   46|  9.37k|#define SVCD_TRUE 1
  ------------------
  |  Branch (1920:29): [True: 8.42k, False: 950]
  ------------------
 1921|  8.42k|                    {
 1922|       |                        /* vertical directional merging */
 1923|  8.42k|                        i4_mv_x =
 1924|  8.42k|                            ((ps_temp[0].i2_mv[2 * i4_i]) + (ps_temp[4].i2_mv[2 * i4_i] + 1)) >> 1;
 1925|       |
 1926|  8.42k|                        i4_mv_y = ((ps_temp[0].i2_mv[1 + (2 * i4_i)]) +
 1927|  8.42k|                                   (ps_temp[4].i2_mv[1 + (2 * i4_i)] + 1)) >>
 1928|  8.42k|                                  1;
 1929|       |
 1930|  8.42k|                        ps_temp[0].i2_mv[2 * i4_i] = (WORD16) i4_mv_x;
 1931|  8.42k|                        ps_temp[4].i2_mv[2 * i4_i] = (WORD16) i4_mv_x;
 1932|       |
 1933|  8.42k|                        ps_temp[0].i2_mv[1 + (2 * i4_i)] = (WORD16) i4_mv_y;
 1934|  8.42k|                        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|  8.42k|                        i4_mv_x =
 1938|  8.42k|                            ((ps_temp[1].i2_mv[2 * i4_i]) + (ps_temp[5].i2_mv[2 * i4_i] + 1)) >> 1;
 1939|       |
 1940|  8.42k|                        i4_mv_y = ((ps_temp[1].i2_mv[1 + (2 * i4_i)]) +
 1941|  8.42k|                                   (ps_temp[5].i2_mv[1 + (2 * i4_i)] + 1)) >>
 1942|  8.42k|                                  1;
 1943|       |
 1944|  8.42k|                        ps_temp[1].i2_mv[2 * i4_i] = (WORD16) i4_mv_x;
 1945|  8.42k|                        ps_temp[5].i2_mv[2 * i4_i] = (WORD16) i4_mv_x;
 1946|       |
 1947|  8.42k|                        ps_temp[1].i2_mv[1 + (2 * i4_i)] = (WORD16) i4_mv_y;
 1948|  8.42k|                        ps_temp[5].i2_mv[1 + (2 * i4_i)] = (WORD16) i4_mv_y;
 1949|       |                        /* store the sub mb partition size */
 1950|  8.42k|                        i4_part_size = SUBMB_4x8;
  ------------------
  |  |  503|  8.42k|#define SUBMB_4x8    2
  ------------------
 1951|  8.42k|                    }
 1952|    950|                    else
 1953|    950|                    {
 1954|       |                        /* store the sub mb partition size */
 1955|    950|                        i4_part_size = SUBMB_4x4;
  ------------------
  |  |  504|    950|#define SUBMB_4x4    3
  ------------------
 1956|    950|                    }
 1957|       |
 1958|   572k|                } /* end of loop over lists */
 1959|       |
 1960|       |                /* store the sub MB type B slice */
 1961|   484k|                if(2 == i4_listx)
  ------------------
  |  Branch (1961:20): [True: 88.5k, False: 395k]
  ------------------
 1962|  88.5k|                {
 1963|  88.5k|                    WORD32 i4_part_mode_a;
 1964|  88.5k|                    WORD32 i4_indx;
 1965|       |
 1966|  88.5k|                    i4_part_mode_a = 0;
 1967|       |                    /* check the 0th partiton reference indices */
 1968|  88.5k|                    if(0 <= ps_temp[0].i1_ref_frame[0])
  ------------------
  |  Branch (1968:24): [True: 73.1k, False: 15.3k]
  ------------------
 1969|  73.1k|                    {
 1970|  73.1k|                        i4_part_mode_a += 1;
 1971|  73.1k|                    }
 1972|  88.5k|                    if(0 <= ps_temp[0].i1_ref_frame[1])
  ------------------
  |  Branch (1972:24): [True: 48.3k, False: 40.2k]
  ------------------
 1973|  48.3k|                    {
 1974|  48.3k|                        i4_part_mode_a += 2;
 1975|  48.3k|                    }
 1976|  88.5k|                    i4_indx = 3 * i4_part_size + (i4_part_mode_a - 1);
 1977|       |
 1978|  88.5k|                    pi4_sub_mb_mode[2 * i4_yp + i4_xp] = g_au1_eb_submb_type[i4_indx];
 1979|  88.5k|                }
 1980|       |                /* P slice */
 1981|   395k|                else
 1982|   395k|                {
 1983|   395k|                    pi4_sub_mb_mode[2 * i4_yp + i4_xp] = g_au1_ep_submb_type[i4_part_size];
 1984|   395k|                }
 1985|   484k|            } /* end of loop over partition xp */
 1986|       |
 1987|   242k|        }     /* end of loop over partition yp */
 1988|   121k|    }
 1989|       |
 1990|   121k|    return;
 1991|   121k|}
isvcd_interlyr_mbmode_pred_bmb:
 2020|  31.4k|{
 2021|  31.4k|    WORD32 i4_part_mode_a, i4_part_mode_b;
 2022|  31.4k|    WORD32 i4_idx;
 2023|  31.4k|    dec_mb_info_t *ps_mb_params = (dec_mb_info_t *) pv_mb_params;
 2024|  31.4k|    parse_part_params_t *ps_part = (parse_part_params_t *) pv_part;
 2025|       |
 2026|  31.4k|    UNUSED(ps_ctxt);
  ------------------
  |  |   45|  31.4k|#define UNUSED(x) ((void)(x))
  ------------------
 2027|       |
 2028|  31.4k|    i4_part_mode_a = 0;
 2029|       |
 2030|       |    /* check the 0th partiton reference indices */
 2031|  31.4k|    if(PRED_8x8 != i4_part_size)
  ------------------
  |  |  453|  31.4k|#define PRED_8x8    3
  ------------------
  |  Branch (2031:8): [True: 26.8k, False: 4.64k]
  ------------------
 2032|  26.8k|    {
 2033|  26.8k|        if(0 <= ps_motion_pred[0].i1_ref_frame[0])
  ------------------
  |  Branch (2033:12): [True: 23.4k, False: 3.38k]
  ------------------
 2034|  23.4k|        {
 2035|  23.4k|            i4_part_mode_a += 1;
 2036|  23.4k|        }
 2037|  26.8k|        if(0 <= ps_motion_pred[0].i1_ref_frame[1])
  ------------------
  |  Branch (2037:12): [True: 12.2k, False: 14.6k]
  ------------------
 2038|  12.2k|        {
 2039|  12.2k|            i4_part_mode_a += 2;
 2040|  12.2k|        }
 2041|  26.8k|    }
 2042|       |
 2043|       |    /* check the 15th partiton reference indices */
 2044|       |    /* this done since all the reference indices will be replicated */
 2045|  31.4k|    i4_part_mode_b = 0;
 2046|       |
 2047|  31.4k|    if((PRED_16x8 == i4_part_size) || (PRED_8x16 == i4_part_size))
  ------------------
  |  |  451|  31.4k|#define PRED_16x8   1
  ------------------
                  if((PRED_16x8 == i4_part_size) || (PRED_8x16 == i4_part_size))
  ------------------
  |  |  452|  28.0k|#define PRED_8x16   2
  ------------------
  |  Branch (2047:8): [True: 3.44k, False: 28.0k]
  |  Branch (2047:39): [True: 1.65k, False: 26.3k]
  ------------------
 2048|  5.10k|    {
 2049|  5.10k|        ps_motion_pred += (3 * i4_cur_mot_stride) + 3;
 2050|       |
 2051|  5.10k|        if(0 <= ps_motion_pred[0].i1_ref_frame[0])
  ------------------
  |  Branch (2051:12): [True: 3.72k, False: 1.37k]
  ------------------
 2052|  3.72k|        {
 2053|  3.72k|            i4_part_mode_b += 1;
 2054|  3.72k|        }
 2055|  5.10k|        if(0 <= ps_motion_pred[0].i1_ref_frame[1])
  ------------------
  |  Branch (2055:12): [True: 2.13k, False: 2.96k]
  ------------------
 2056|  2.13k|        {
 2057|  2.13k|            i4_part_mode_b += 2;
 2058|  2.13k|        }
 2059|  5.10k|    }
 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|  31.4k|    if(PRED_8x8 != i4_part_size)
  ------------------
  |  |  453|  31.4k|#define PRED_8x8    3
  ------------------
  |  Branch (2064:8): [True: 26.8k, False: 4.64k]
  ------------------
 2065|  26.8k|    {
 2066|  26.8k|        UWORD8 u1_pred_mode_part0;
 2067|  26.8k|        UWORD8 u1_pred_mode_part1;
 2068|       |
 2069|  26.8k|        i4_idx = 3 * i4_part_size;
 2070|  26.8k|        i4_idx += 3 * (i4_part_mode_a - 1);
 2071|  26.8k|        i4_part_mode_b = (i4_part_mode_b > 0) ? i4_part_mode_b : 1;
  ------------------
  |  Branch (2071:26): [True: 5.10k, False: 21.7k]
  ------------------
 2072|  26.8k|        i4_idx += (i4_part_mode_b - 1);
 2073|  26.8k|        i4_idx = (i4_idx < 0) ? 0 : i4_idx;
  ------------------
  |  Branch (2073:18): [True: 0, False: 26.8k]
  ------------------
 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.8k|        ps_mb_params->u1_mb_type = g_au1_eb_mb_type[i4_idx + (6 * i4_part_size)];
 2081|  26.8k|        u1_pred_mode_part0 = g_au1_mb_pred_mode[0][5 + ps_mb_params->u1_mb_type];
 2082|  26.8k|        u1_pred_mode_part1 = g_au1_mb_pred_mode[1][5 + ps_mb_params->u1_mb_type];
 2083|  26.8k|        ps_part[0].u1_pred_mode = u1_pred_mode_part0;
 2084|  26.8k|        ps_part[1].u1_pred_mode = u1_pred_mode_part1;
 2085|  26.8k|    }
 2086|  4.64k|    else
 2087|  4.64k|    {
 2088|  4.64k|        WORD32 i4_i, i4_ctr, i4_num_submb_part;
 2089|  4.64k|        UWORD8 u1_sub_mb_type, u1_sub_mb_mc_mode;
 2090|  4.64k|        UWORD8 u1_pred_mode;
 2091|       |
 2092|  4.64k|        ps_mb_params->u1_mb_type = B_8x8;
  ------------------
  |  |  480|  4.64k|#define B_8x8    22
  ------------------
 2093|       |
 2094|  23.2k|        for(i4_i = 0; i4_i < NUM_MB_PARTS; i4_i++)
  ------------------
  |  |   59|  23.2k|#define NUM_MB_PARTS 4
  ------------------
  |  Branch (2094:23): [True: 18.5k, False: 4.64k]
  ------------------
 2095|  18.5k|        {
 2096|  18.5k|            u1_sub_mb_type = (UWORD8) pi4_sub_mb_mode[i4_i];
 2097|       |
 2098|  18.5k|            u1_sub_mb_mc_mode = gau1_ih264d_submb_mc_mode[4 + u1_sub_mb_type];
 2099|  18.5k|            i4_num_submb_part = g_au1_num_sub_mb_part[u1_sub_mb_mc_mode];
 2100|  18.5k|            *pu1_col_info |= (u1_sub_mb_mc_mode << 4);
 2101|  18.5k|            pu1_col_info++;
 2102|  18.5k|            u1_pred_mode = g_au1_sub_mb_pred_mode[4 + u1_sub_mb_type];
 2103|  54.5k|            for(i4_ctr = 0; i4_ctr < i4_num_submb_part; i4_ctr++)
  ------------------
  |  Branch (2103:29): [True: 35.9k, False: 18.5k]
  ------------------
 2104|  35.9k|            {
 2105|  35.9k|                ps_part->u1_pred_mode = u1_pred_mode;
 2106|  35.9k|                ps_part++;
 2107|  35.9k|            }
 2108|  18.5k|        }
 2109|  4.64k|    }
 2110|       |
 2111|  31.4k|    return;
 2112|  31.4k|}
isvcd_populate_ref_idx:
 2139|  26.6k|{
 2140|  26.6k|    UWORD8 u1_mot_pred_flag;
 2141|  26.6k|    WORD32 i4_lx;
 2142|       |
 2143|  66.3k|    for(i4_lx = 0; i4_lx < i4_listx; i4_lx++)
  ------------------
  |  Branch (2143:20): [True: 39.6k, False: 26.6k]
  ------------------
 2144|  39.6k|    {
 2145|  39.6k|        u1_mot_pred_flag = ps_svc_mb_params->au1_motion_pred_flag[i4_lx];
 2146|       |
 2147|  39.6k|        if((PRED_16x16 == ps_mb_params->u1_mb_mc_mode) && (u1_mot_pred_flag & 0x1))
  ------------------
  |  |  450|  39.6k|#define PRED_16x16  0
  ------------------
  |  Branch (2147:12): [True: 15.3k, False: 24.3k]
  |  Branch (2147:59): [True: 10.5k, False: 4.81k]
  ------------------
 2148|  10.5k|        {
 2149|  10.5k|            ps_mb_part_info->i1_ref_idx[i4_lx][0] = ps_motion_pred[0].i1_ref_frame[i4_lx];
 2150|  10.5k|        }
 2151|  29.1k|        else if((PRED_8x16 == ps_mb_params->u1_mb_mc_mode))
  ------------------
  |  |  452|  29.1k|#define PRED_8x16   2
  ------------------
  |  Branch (2151:17): [True: 9.34k, False: 19.7k]
  ------------------
 2152|  9.34k|        {
 2153|  9.34k|            if(u1_mot_pred_flag & 0x01)
  ------------------
  |  Branch (2153:16): [True: 2.95k, False: 6.39k]
  ------------------
 2154|  2.95k|            {
 2155|  2.95k|                ps_mb_part_info->i1_ref_idx[i4_lx][0] = ps_motion_pred[0].i1_ref_frame[i4_lx];
 2156|  2.95k|            }
 2157|  9.34k|            if(u1_mot_pred_flag & 0x02)
  ------------------
  |  Branch (2157:16): [True: 5.32k, False: 4.02k]
  ------------------
 2158|  5.32k|            {
 2159|  5.32k|                ps_mb_part_info->i1_ref_idx[i4_lx][1] = ps_motion_pred[2].i1_ref_frame[i4_lx];
 2160|  5.32k|            }
 2161|  9.34k|        }
 2162|  19.7k|        else if((PRED_16x8 == ps_mb_params->u1_mb_mc_mode))
  ------------------
  |  |  451|  19.7k|#define PRED_16x8   1
  ------------------
  |  Branch (2162:17): [True: 5.59k, False: 14.1k]
  ------------------
 2163|  5.59k|        {
 2164|  5.59k|            if(u1_mot_pred_flag & 0x01)
  ------------------
  |  Branch (2164:16): [True: 3.33k, False: 2.26k]
  ------------------
 2165|  3.33k|            {
 2166|  3.33k|                ps_mb_part_info->i1_ref_idx[i4_lx][0] = ps_motion_pred[0].i1_ref_frame[i4_lx];
 2167|  3.33k|            }
 2168|  5.59k|            if(u1_mot_pred_flag & 0x02)
  ------------------
  |  Branch (2168:16): [True: 3.92k, False: 1.67k]
  ------------------
 2169|  3.92k|            {
 2170|  3.92k|                ps_mb_part_info->i1_ref_idx[i4_lx][1] = ps_motion_pred[8].i1_ref_frame[i4_lx];
 2171|  3.92k|            }
 2172|  5.59k|        }
 2173|  14.1k|        else if((PRED_8x8 == ps_mb_params->u1_mb_mc_mode))
  ------------------
  |  |  453|  14.1k|#define PRED_8x8    3
  ------------------
  |  Branch (2173:17): [True: 9.32k, False: 4.85k]
  ------------------
 2174|  9.32k|        {
 2175|  9.32k|            if(u1_mot_pred_flag & 0x01)
  ------------------
  |  Branch (2175:16): [True: 4.05k, False: 5.27k]
  ------------------
 2176|  4.05k|            {
 2177|  4.05k|                ps_mb_part_info->i1_ref_idx[i4_lx][0] = ps_motion_pred[0].i1_ref_frame[i4_lx];
 2178|  4.05k|            }
 2179|  9.32k|            if(u1_mot_pred_flag & 0x02)
  ------------------
  |  Branch (2179:16): [True: 3.85k, False: 5.47k]
  ------------------
 2180|  3.85k|            {
 2181|  3.85k|                ps_mb_part_info->i1_ref_idx[i4_lx][1] = ps_motion_pred[2].i1_ref_frame[i4_lx];
 2182|  3.85k|            }
 2183|  9.32k|            if(u1_mot_pred_flag & 0x04)
  ------------------
  |  Branch (2183:16): [True: 4.79k, False: 4.52k]
  ------------------
 2184|  4.79k|            {
 2185|  4.79k|                ps_mb_part_info->i1_ref_idx[i4_lx][2] = ps_motion_pred[8].i1_ref_frame[i4_lx];
 2186|  4.79k|            }
 2187|  9.32k|            if(u1_mot_pred_flag & 0x08)
  ------------------
  |  Branch (2187:16): [True: 4.04k, False: 5.28k]
  ------------------
 2188|  4.04k|            {
 2189|  4.04k|                ps_mb_part_info->i1_ref_idx[i4_lx][3] = ps_motion_pred[10].i1_ref_frame[i4_lx];
 2190|  4.04k|            }
 2191|  9.32k|        }
 2192|  39.6k|    }
 2193|  26.6k|}
isvcd_interlyr_mbmode_pred:
 2223|   111k|{
 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|   111k|    mode_motion_ctxt_t *ps_ctxt;
 2231|   111k|    mv_pred_t *ps_motion_pred;
 2232|   111k|    dec_mb_info_t *ps_mb_params;
 2233|   111k|    WORD32 i4_listx;
 2234|   111k|    WORD32 i4_part_size;
 2235|   111k|    WORD32 i4_mb_mode_flag;
 2236|   111k|    WORD32 i4_i;
 2237|   111k|    WORD32 i4_blk_mode;
 2238|   111k|    parse_part_params_t *ps_part = (parse_part_params_t *) pv_part;
 2239|   111k|    parse_pmbarams_t *ps_mb_part_info = (parse_pmbarams_t *) pv_mb_part_info;
 2240|   111k|    UWORD8 *pu1_col_info = ps_mb_part_info->u1_col_info;
 2241|   111k|    UNUSED(pv_dec);
  ------------------
  |  |   45|   111k|#define UNUSED(x) ((void)(x))
  ------------------
 2242|       |
 2243|   111k|    ps_ctxt = (mode_motion_ctxt_t *) pv_comp_mode_mv_ctxt;
 2244|   111k|    ps_motion_pred = ps_ctxt->ps_motion_pred_struct;
 2245|   111k|    ps_mb_params = (dec_mb_info_t *) pv_mb_params;
 2246|       |
 2247|       |    /*********** store the MB mode as inter *************************/
 2248|   111k|    *pi4_mb_mode = SVC_INTER_MB;
  ------------------
  |  |  114|   111k|#define SVC_INTER_MB (1 << 0)       /*!< Intra MBs other than IPCM and I_BL */
  ------------------
 2249|       |
 2250|       |    /***********************************************************************/
 2251|       |    /* derivation of part type                                             */
 2252|       |    /***********************************************************************/
 2253|   111k|    i4_listx = ps_ctxt->i4_listx;
 2254|       |
 2255|       |    /* set the mb mode derivation flag to false */
 2256|   111k|    i4_mb_mode_flag = SVCD_FALSE;
  ------------------
  |  |   45|   111k|#define SVCD_FALSE 0
  ------------------
 2257|       |
 2258|       |    /* for B and P slice different blk mod treshold */
 2259|   111k|    if(2 == i4_listx)
  ------------------
  |  Branch (2259:8): [True: 18.7k, False: 93.1k]
  ------------------
 2260|  18.7k|    {
 2261|  18.7k|        i4_blk_mode = B_BI_8x8;
  ------------------
  |  |  468|  18.7k|#define B_BI_8x8        3
  ------------------
 2262|  18.7k|    }
 2263|  93.1k|    else
 2264|  93.1k|    {
 2265|  93.1k|        i4_blk_mode = P_L0_8x8;
  ------------------
  |  |  459|  93.1k|#define P_L0_8x8    0
  ------------------
 2266|  93.1k|    }
 2267|       |
 2268|       |    /* set the mode derivation flag to true base on conditions */
 2269|   111k|    if((i4_blk_mode >= pi4_sub_mb_mode[0]) && (i4_blk_mode >= pi4_sub_mb_mode[1]) &&
  ------------------
  |  Branch (2269:8): [True: 109k, False: 2.38k]
  |  Branch (2269:47): [True: 105k, False: 3.75k]
  ------------------
 2270|   105k|       (i4_blk_mode >= pi4_sub_mb_mode[2]) && (i4_blk_mode >= pi4_sub_mb_mode[3]))
  ------------------
  |  Branch (2270:8): [True: 103k, False: 2.15k]
  |  Branch (2270:47): [True: 102k, False: 866]
  ------------------
 2271|   102k|    {
 2272|   102k|        i4_mb_mode_flag = SVCD_TRUE;
  ------------------
  |  |   46|   102k|#define SVCD_TRUE 1
  ------------------
 2273|   102k|    }
 2274|       |
 2275|       |    /* store the default 8x8 mode */
 2276|   111k|    ps_mb_part_info->u1_num_part = 4;
 2277|   111k|    i4_part_size = PRED_8x8;
  ------------------
  |  |  453|   111k|#define PRED_8x8    3
  ------------------
 2278|       |
 2279|       |    /* further check is present if all are 8x8 mode */
 2280|   111k|    if(SVCD_TRUE == i4_mb_mode_flag)
  ------------------
  |  |   46|   111k|#define SVCD_TRUE 1
  ------------------
  |  Branch (2280:8): [True: 102k, False: 9.16k]
  ------------------
 2281|   102k|    {
 2282|   102k|        WORD32 i4_horz_match, i4_vert_match;
 2283|       |
 2284|       |        /* check if the motion in horz direction are same*/
 2285|   102k|        i4_horz_match = isvcd_check_motion(ps_motion_pred, (ps_motion_pred + 2), i4_listx);
 2286|   102k|        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|   102k|        i4_vert_match = isvcd_check_motion(ps_motion_pred, (ps_motion_pred + 8), i4_listx);
 2290|   102k|        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|   102k|        if((2 == i4_horz_match) && (2 == i4_vert_match))
  ------------------
  |  Branch (2293:12): [True: 92.6k, False: 10.1k]
  |  Branch (2293:36): [True: 86.4k, False: 6.22k]
  ------------------
 2294|  86.4k|        {
 2295|  86.4k|            ps_mb_params->u1_mb_type = P_L0_16x16;
 2296|  86.4k|            i4_part_size = PRED_16x16;
  ------------------
  |  |  450|  86.4k|#define PRED_16x16  0
  ------------------
 2297|  86.4k|            ps_mb_part_info->u1_num_part = 1;
 2298|  86.4k|            *pu1_col_info++ = (PRED_16x16 << 6);
  ------------------
  |  |  450|  86.4k|#define PRED_16x16  0
  ------------------
 2299|  86.4k|            ps_mb_part_info->i1_ref_idx[0][0] = ps_motion_pred->i1_ref_frame[0];
 2300|  86.4k|            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.8k, False: 75.6k]
  ------------------
 2301|       |
 2302|  86.4k|            ps_part->u1_partwidth = 4;  // interms of 4x4
 2303|  86.4k|            ps_part->u1_partheight = 4;
 2304|  86.4k|            ps_part->u1_pred_mode = PRED_L0;
  ------------------
  |  |  483|  86.4k|#define PRED_L0   1
  ------------------
 2305|  86.4k|            ps_part->u1_is_direct = 0;
 2306|  86.4k|            ps_part->u1_sub_mb_num = 0;
 2307|  86.4k|        }
 2308|  16.3k|        else if(2 == i4_horz_match)
  ------------------
  |  Branch (2308:17): [True: 6.22k, False: 10.1k]
  ------------------
 2309|  6.22k|        {
 2310|  6.22k|            i4_part_size = PRED_16x8;
  ------------------
  |  |  451|  6.22k|#define PRED_16x8   1
  ------------------
 2311|  6.22k|            ps_mb_params->u1_mb_type = P_L0_L0_16x8;
 2312|  6.22k|            ps_mb_part_info->u1_num_part = 2;
 2313|  6.22k|            *pu1_col_info++ = (PRED_16x8 << 6);
  ------------------
  |  |  451|  6.22k|#define PRED_16x8   1
  ------------------
 2314|  6.22k|            *pu1_col_info++ = (PRED_16x8 << 6);
  ------------------
  |  |  451|  6.22k|#define PRED_16x8   1
  ------------------
 2315|       |
 2316|  6.22k|            ps_mb_part_info->i1_ref_idx[0][0] = ps_motion_pred->i1_ref_frame[0];
 2317|  6.22k|            ps_mb_part_info->i1_ref_idx[0][1] = ps_motion_pred[8].i1_ref_frame[0];
 2318|  6.22k|            if(2 == i4_listx)
  ------------------
  |  Branch (2318:16): [True: 3.30k, False: 2.92k]
  ------------------
 2319|  3.30k|            {
 2320|  3.30k|                ps_mb_part_info->i1_ref_idx[1][0] = ps_motion_pred->i1_ref_frame[1];
 2321|  3.30k|                ps_mb_part_info->i1_ref_idx[1][1] = ps_motion_pred[8].i1_ref_frame[1];
 2322|  3.30k|            }
 2323|  6.22k|            ps_part->u1_partwidth = 4;  // interms of 4x4
 2324|  6.22k|            ps_part->u1_partheight = 2;
 2325|  6.22k|            ps_part->u1_pred_mode = PRED_L0;
  ------------------
  |  |  483|  6.22k|#define PRED_L0   1
  ------------------
 2326|  6.22k|            ps_part->u1_is_direct = 0;
 2327|  6.22k|            ps_part->u1_sub_mb_num = 0;
 2328|       |
 2329|  6.22k|            ps_part++;
 2330|  6.22k|            ps_part->u1_partwidth = 4;
 2331|  6.22k|            ps_part->u1_partheight = 2;
 2332|  6.22k|            ps_part->u1_pred_mode = PRED_L0;
  ------------------
  |  |  483|  6.22k|#define PRED_L0   1
  ------------------
 2333|  6.22k|            ps_part->u1_is_direct = 0;
 2334|  6.22k|            ps_part->u1_sub_mb_num = 8;
 2335|  6.22k|        }
 2336|  10.1k|        else if(2 == i4_vert_match)
  ------------------
  |  Branch (2336:17): [True: 4.00k, False: 6.09k]
  ------------------
 2337|  4.00k|        {
 2338|  4.00k|            ps_mb_params->u1_mb_type = P_L0_L0_8x16;
 2339|  4.00k|            i4_part_size = PRED_8x16;
  ------------------
  |  |  452|  4.00k|#define PRED_8x16   2
  ------------------
 2340|  4.00k|            ps_mb_part_info->u1_num_part = 2;
 2341|  4.00k|            *pu1_col_info++ = (PRED_8x16 << 6);
  ------------------
  |  |  452|  4.00k|#define PRED_8x16   2
  ------------------
 2342|  4.00k|            *pu1_col_info++ = (PRED_8x16 << 6);
  ------------------
  |  |  452|  4.00k|#define PRED_8x16   2
  ------------------
 2343|       |
 2344|  4.00k|            ps_mb_part_info->i1_ref_idx[0][0] = ps_motion_pred->i1_ref_frame[0];
 2345|  4.00k|            ps_mb_part_info->i1_ref_idx[0][1] = ps_motion_pred[2].i1_ref_frame[0];
 2346|  4.00k|            if(2 == i4_listx)
  ------------------
  |  Branch (2346:16): [True: 1.28k, False: 2.72k]
  ------------------
 2347|  1.28k|            {
 2348|  1.28k|                ps_mb_part_info->i1_ref_idx[1][0] = ps_motion_pred->i1_ref_frame[1];
 2349|  1.28k|                ps_mb_part_info->i1_ref_idx[1][1] = ps_motion_pred[2].i1_ref_frame[1];
 2350|  1.28k|            }
 2351|  4.00k|            ps_part->u1_partwidth = 2;  // interms of 4x4
 2352|  4.00k|            ps_part->u1_partheight = 4;
 2353|  4.00k|            ps_part->u1_pred_mode = PRED_L0;
  ------------------
  |  |  483|  4.00k|#define PRED_L0   1
  ------------------
 2354|  4.00k|            ps_part->u1_is_direct = 0;
 2355|  4.00k|            ps_part->u1_sub_mb_num = 0;
 2356|       |
 2357|  4.00k|            ps_part++;
 2358|  4.00k|            ps_part->u1_partwidth = 2;
 2359|  4.00k|            ps_part->u1_partheight = 4;
 2360|  4.00k|            ps_part->u1_pred_mode = PRED_L0;
  ------------------
  |  |  483|  4.00k|#define PRED_L0   1
  ------------------
 2361|  4.00k|            ps_part->u1_is_direct = 0;
 2362|  4.00k|            ps_part->u1_sub_mb_num = 2;
 2363|  4.00k|        }
 2364|   102k|    }
 2365|       |
 2366|       |    /* store the part size to the mb params */
 2367|   111k|    ps_mb_params->u1_mb_mc_mode = i4_part_size;
 2368|       |
 2369|       |    /* in case of slice derive the partition modes */
 2370|       |
 2371|   111k|    {
 2372|       |        /* store the sub MB modes if 8x8 mode is choosen */
 2373|   111k|        if(PRED_8x8 == i4_part_size)
  ------------------
  |  |  453|   111k|#define PRED_8x8    3
  ------------------
  |  Branch (2373:12): [True: 15.2k, False: 96.6k]
  ------------------
 2374|  15.2k|        {
 2375|  15.2k|            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|  15.2k|            ps_mb_params->u1_mb_type = P_8x8;
 2379|  15.2k|            ps_mb_part_info->i1_ref_idx[0][0] = ps_motion_pred[0].i1_ref_frame[0];
 2380|  15.2k|            ps_mb_part_info->i1_ref_idx[0][1] = ps_motion_pred[2].i1_ref_frame[0];
 2381|  15.2k|            ps_mb_part_info->i1_ref_idx[0][2] = ps_motion_pred[8].i1_ref_frame[0];
 2382|  15.2k|            ps_mb_part_info->i1_ref_idx[0][3] = ps_motion_pred[10].i1_ref_frame[0];
 2383|  15.2k|            if(2 == i4_listx)
  ------------------
  |  Branch (2383:16): [True: 3.33k, False: 11.9k]
  ------------------
 2384|  3.33k|            {
 2385|  3.33k|                ps_mb_part_info->i1_ref_idx[1][0] = ps_motion_pred[0].i1_ref_frame[1];
 2386|  3.33k|                ps_mb_part_info->i1_ref_idx[1][1] = ps_motion_pred[2].i1_ref_frame[1];
 2387|  3.33k|                ps_mb_part_info->i1_ref_idx[1][2] = ps_motion_pred[8].i1_ref_frame[1];
 2388|  3.33k|                ps_mb_part_info->i1_ref_idx[1][3] = ps_motion_pred[10].i1_ref_frame[1];
 2389|  3.33k|            }
 2390|       |
 2391|  15.2k|            ps_mb_part_info->u1_num_part = 0;
 2392|  76.2k|            for(i4_i = 0; i4_i < NUM_MB_PARTS; i4_i++)
  ------------------
  |  |   59|  76.2k|#define NUM_MB_PARTS 4
  ------------------
  |  Branch (2392:27): [True: 61.0k, False: 15.2k]
  ------------------
 2393|  61.0k|            {
 2394|  61.0k|                WORD32 i4_num_submb_part, i4_part_width, i4_part_height, i4_ctr;
 2395|  61.0k|                u1_sub_mb_type = (UWORD8) pi4_sub_mb_mode[i4_i];
 2396|       |
 2397|  61.0k|                if(1 == i4_listx)
  ------------------
  |  Branch (2397:20): [True: 47.6k, False: 13.3k]
  ------------------
 2398|  47.6k|                {
 2399|  47.6k|                    u1_sub_mb_mc_mode = gau1_ih264d_submb_mc_mode[u1_sub_mb_type];
 2400|  47.6k|                }
 2401|  13.3k|                else if(2 == i4_listx)
  ------------------
  |  Branch (2401:25): [True: 13.3k, False: 0]
  ------------------
 2402|  13.3k|                {
 2403|  13.3k|                    u1_sub_mb_mc_mode = gau1_ih264d_submb_mc_mode[4 + u1_sub_mb_type];
 2404|  13.3k|                }
 2405|  61.0k|                i4_num_submb_part = g_au1_num_sub_mb_part[u1_sub_mb_mc_mode];
 2406|       |
 2407|  61.0k|                ps_mb_part_info->u1_num_part += i4_num_submb_part;
 2408|       |
 2409|  61.0k|                i4_part_width = g_au1_sub_mb_part_wd[u1_sub_mb_mc_mode];
 2410|  61.0k|                i4_part_height = g_au1_sub_mb_part_ht[u1_sub_mb_mc_mode];
 2411|  61.0k|                *pu1_col_info++ = (PRED_8x8 << 6) | (u1_sub_mb_mc_mode << 4);
  ------------------
  |  |  453|  61.0k|#define PRED_8x8    3
  ------------------
 2412|   139k|                for(i4_ctr = 0; i4_ctr < i4_num_submb_part; i4_ctr++)
  ------------------
  |  Branch (2412:33): [True: 78.1k, False: 61.0k]
  ------------------
 2413|  78.1k|                {
 2414|  78.1k|                    ps_part->u1_partwidth = i4_part_width;  // interms of 4x4
 2415|  78.1k|                    ps_part->u1_partheight = i4_part_height;
 2416|  78.1k|                    ps_part->u1_pred_mode = PRED_L0;
  ------------------
  |  |  483|  78.1k|#define PRED_L0   1
  ------------------
 2417|  78.1k|                    ps_part->u1_is_direct = 0;
 2418|  78.1k|                    ps_part->u1_sub_mb_num = (i4_i & 0x01) * 2 + (i4_i >> 1) * 8;
 2419|  78.1k|                    if(i4_num_submb_part == 2)
  ------------------
  |  Branch (2419:24): [True: 28.8k, False: 49.3k]
  ------------------
 2420|  28.8k|                    {
 2421|  28.8k|                        ps_part->u1_sub_mb_num +=
 2422|  28.8k|                            i4_ctr ? (((i4_part_width - 1) << 2) + (i4_part_height - 1)) : 0;
  ------------------
  |  Branch (2422:29): [True: 14.4k, False: 14.4k]
  ------------------
 2423|  28.8k|                    }
 2424|  49.3k|                    else if(i4_num_submb_part == 4)
  ------------------
  |  Branch (2424:29): [True: 3.62k, False: 45.7k]
  ------------------
 2425|  3.62k|                    {
 2426|  3.62k|                        ps_part->u1_sub_mb_num += ((i4_ctr >> 1) << 2) + (i4_ctr & 0x01);
 2427|  3.62k|                    }
 2428|       |
 2429|  78.1k|                    ps_part++;
 2430|  78.1k|                }
 2431|  61.0k|            }
 2432|  15.2k|        }
 2433|   111k|        if(2 == i4_listx)
  ------------------
  |  Branch (2433:12): [True: 18.7k, False: 93.1k]
  ------------------
 2434|  18.7k|        {
 2435|  18.7k|            ps_part = (parse_part_params_t *) pv_part;
 2436|  18.7k|            pu1_col_info = ps_mb_part_info->u1_col_info;
 2437|       |            /* B_MBs */
 2438|  18.7k|            isvcd_interlyr_mbmode_pred_bmb(ps_ctxt, ps_motion_pred, 4, i4_part_size,
 2439|  18.7k|                                           pi4_sub_mb_mode, ps_mb_params, ps_part, pu1_col_info);
 2440|  18.7k|        }
 2441|   111k|    }
 2442|       |
 2443|   111k|    return;
 2444|   111k|}
isvcd_compute_interlyr_motion_mode:
 2474|   130k|{
 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|   130k|    mode_motion_ctxt_t *ps_ctxt;
 2483|   130k|    WORD32 i4_intra_flag;
 2484|   130k|    WORD32 ai4_sub_mb_mode[NUM_MB_PARTS] = {0};
 2485|   130k|    dec_mb_info_t *ps_mb_params;
 2486|   130k|    dec_svc_mb_info_t *ps_svc_mb_params;
 2487|   130k|    dec_struct_t *ps_dec = (dec_struct_t *) pv_dec;
 2488|   130k|    WORD32 i4_mb_mode = -1;
 2489|   130k|    parse_pmbarams_t *ps_mb_part_info = (parse_pmbarams_t *) pv_mb_part_info;
 2490|   130k|    parse_part_params_t *ps_part = (parse_part_params_t *) pv_part;
 2491|       |
 2492|   130k|    ps_ctxt = (mode_motion_ctxt_t *) pv_comp_mode_mv_ctxt;
 2493|   130k|    ps_mb_params = (dec_mb_info_t *) pv_mb_params;
 2494|   130k|    ps_svc_mb_params = (dec_svc_mb_info_t *) pv_svc_mb_params;
 2495|       |
 2496|   130k|    i4_intra_flag = SVCD_FALSE;
  ------------------
  |  |   45|   130k|#define SVCD_FALSE 0
  ------------------
 2497|       |
 2498|   130k|    isvcd_ref_lyr_part_idc(pv_comp_mode_mv_ctxt, ps_ctxt->ai4_ref_part_idc, &i4_intra_flag,
 2499|   130k|                           pv_mb_params);
 2500|       |
 2501|       |    /* If base is Intra */
 2502|   130k|    if(SVCD_TRUE == i4_intra_flag)
  ------------------
  |  |   46|   130k|#define SVCD_TRUE 1
  ------------------
  |  Branch (2502:8): [True: 9.85k, False: 121k]
  ------------------
 2503|  9.85k|    {
 2504|  9.85k|        if(1 == ps_svc_mb_params->u1_base_mode_flag)
  ------------------
  |  Branch (2504:12): [True: 9.48k, False: 377]
  ------------------
 2505|  9.48k|        {
 2506|  9.48k|            i4_mb_mode = SVC_IBL_MB;
  ------------------
  |  |  117|  9.48k|#define SVC_IBL_MB (1 << 3)         /*!< I_BL MB always inferred */
  ------------------
 2507|  9.48k|            ps_svc_mb_params->u1_residual_prediction_flag = 0;
 2508|  9.48k|        }
 2509|  9.85k|    }
 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: 111k, False: 9.13k]
  ------------------
 2518|   111k|        {
 2519|   111k|            isvcd_interlyr_mbmode_pred(pv_comp_mode_mv_ctxt, pv_mb_params, ai4_sub_mb_mode,
 2520|   111k|                                       &i4_mb_mode, ps_dec, ps_mb_part_info, ps_part);
 2521|   111k|        }
 2522|  9.13k|        else
 2523|  9.13k|        {
 2524|  9.13k|            isvcd_populate_ref_idx(ps_mb_params, ps_svc_mb_params, ps_ctxt->ps_motion_pred_struct,
 2525|  9.13k|                                   ps_mb_part_info, ps_ctxt->i4_listx);
 2526|  9.13k|        }
 2527|   121k|    }
 2528|       |
 2529|   130k|    return i4_mb_mode;
 2530|   130k|}
isvcd_interlyr_motion_mode_pred_dyadic:
 2564|  60.9k|{
 2565|  60.9k|    mode_motion_ctxt_t *ps_ctxt;
 2566|  60.9k|    mode_motion_lyr_ctxt *ps_lyr_mem;
 2567|  60.9k|    dec_mb_info_t *ps_mb_params;
 2568|  60.9k|    dec_svc_mb_info_t *ps_svc_mb_params;
 2569|  60.9k|    WORD32 i4_listx;
 2570|  60.9k|    WORD32 i4_mb_pic_x, i4_mb_pic_y;
 2571|  60.9k|    WORD32 i4_ref_x, i4_ref_y;
 2572|  60.9k|    UWORD8 u1_base_mode_flag;
 2573|  60.9k|    dec_struct_t *ps_dec = (dec_struct_t *) pv_dec;
 2574|  60.9k|    WORD32 i4_mb_mode = -1;
 2575|  60.9k|    parse_pmbarams_t *ps_mb_part_info = (parse_pmbarams_t *) pv_mb_part_info;
 2576|  60.9k|    UWORD8 *pu1_col_info = ps_mb_part_info->u1_col_info;
 2577|  60.9k|    parse_part_params_t *ps_part = (parse_part_params_t *) pv_part;
 2578|       |
 2579|  60.9k|    ps_ctxt = (mode_motion_ctxt_t *) pv_comp_mode_mv_ctxt;
 2580|       |
 2581|       |    /* get the current layer ctxt */
 2582|  60.9k|    ps_lyr_mem = &ps_ctxt->as_res_lyr_mem[ps_ctxt->i4_res_id];
 2583|       |
 2584|  60.9k|    ps_mb_params = (dec_mb_info_t *) pv_mb_params;
 2585|  60.9k|    ps_svc_mb_params = (dec_svc_mb_info_t *) pv_svc_mb_params;
 2586|  60.9k|    i4_listx = ps_ctxt->i4_listx;
 2587|       |
 2588|  60.9k|    {
 2589|  60.9k|        WORD32 i4_mb_x, i4_mb_y;
 2590|       |        /* derive the MB_X and MB_Y for the current MB */
 2591|  60.9k|        i4_mb_x = ps_mb_params->u2_mbx;
 2592|  60.9k|        i4_mb_y = ps_mb_params->u2_mby;
 2593|       |
 2594|       |        /* get the colocated position in the refernce layer */
 2595|  60.9k|        i4_ref_x = ps_lyr_mem->pi2_ref_loc_x[i4_mb_x << 4];
 2596|  60.9k|        i4_ref_y = ps_lyr_mem->pi2_ref_loc_y[i4_mb_y << 4];
 2597|  60.9k|        i4_ref_x = CLIP3(0, ((ps_lyr_mem->i4_ref_width) - 1), i4_ref_x);
  ------------------
  |  |   77|  60.9k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 0, False: 60.9k]
  |  |  |  Branch (77:54): [True: 0, False: 60.9k]
  |  |  ------------------
  ------------------
 2598|  60.9k|        i4_ref_y = CLIP3(0, ((ps_lyr_mem->i4_ref_height) - 1), i4_ref_y);
  ------------------
  |  |   77|  60.9k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 0, False: 60.9k]
  |  |  |  Branch (77:54): [True: 374, False: 60.5k]
  |  |  ------------------
  ------------------
 2599|       |
 2600|       |        /* convert into picture units */
 2601|  60.9k|        i4_mb_pic_x = i4_mb_x << 4;
 2602|  60.9k|        i4_mb_pic_y = i4_mb_y << 4;
 2603|  60.9k|    }
 2604|       |
 2605|       |    /* ref layer mb mode */
 2606|  60.9k|    {
 2607|  60.9k|        inter_lyr_mb_prms_t *ps_inter_lyr_mb_prms;
 2608|  60.9k|        WORD32 i4_inter_lyr_mb_prms_stride;
 2609|  60.9k|        WORD32 i4_ref_mb_x, i4_ref_mb_y;
 2610|  60.9k|        WORD8 i1_ref_mb_mode;
 2611|       |
 2612|  60.9k|        ps_inter_lyr_mb_prms = (inter_lyr_mb_prms_t *) ps_lyr_mem->s_ref_mb_mode.pv_buffer;
 2613|  60.9k|        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|  60.9k|        i4_ref_mb_x = (i4_ref_x >> 4);
 2617|  60.9k|        i4_ref_mb_y = (i4_ref_y >> 4);
 2618|       |
 2619|       |        /* get the appropriate mb params in reference layer */
 2620|  60.9k|        ps_inter_lyr_mb_prms += i4_ref_mb_x;
 2621|  60.9k|        ps_inter_lyr_mb_prms += i4_ref_mb_y * i4_inter_lyr_mb_prms_stride;
 2622|  60.9k|        i1_ref_mb_mode = ps_inter_lyr_mb_prms->i1_mb_mode;
 2623|  60.9k|        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|  60.9k|        if(i1_ref_mb_mode > SVC_INTER_MB)
  ------------------
  |  |  114|  60.9k|#define SVC_INTER_MB (1 << 0)       /*!< Intra MBs other than IPCM and I_BL */
  ------------------
  |  Branch (2626:12): [True: 13.3k, False: 47.6k]
  ------------------
 2627|  13.3k|        {
 2628|  13.3k|            if(1 == u1_base_mode_flag)
  ------------------
  |  Branch (2628:16): [True: 12.8k, False: 428]
  ------------------
 2629|  12.8k|            {
 2630|  12.8k|                i4_mb_mode = SVC_IBL_MB;
  ------------------
  |  |  117|  12.8k|#define SVC_IBL_MB (1 << 3)         /*!< I_BL MB always inferred */
  ------------------
 2631|  12.8k|                ps_svc_mb_params->u1_residual_prediction_flag = 0;
 2632|  12.8k|            }
 2633|  13.3k|            return i4_mb_mode;
 2634|  13.3k|        }
 2635|  60.9k|    }
 2636|       |
 2637|       |    /*-----------------------------------------------------------------------*/
 2638|       |    /* Inter MB upsampling process                                           */
 2639|       |    /*-----------------------------------------------------------------------*/
 2640|  47.6k|    {
 2641|  47.6k|        mv_pred_t *ps_motion_pred;
 2642|  47.6k|        WORD32 i4_16x16_flag;
 2643|  47.6k|        WORD32 i4_part_idc;
 2644|  47.6k|        WORD32 i4_blk_idx;
 2645|  47.6k|        WORD32 i4_curr_mot_stride;
 2646|       |
 2647|       |        /* choose the appropriate mv bank pointer and stride */
 2648|  47.6k|        if(1 == u1_base_mode_flag)
  ------------------
  |  Branch (2648:12): [True: 30.0k, False: 17.5k]
  ------------------
 2649|  30.0k|        {
 2650|  30.0k|            i4_mb_mode = SVC_INTER_MB;
  ------------------
  |  |  114|  30.0k|#define SVC_INTER_MB (1 << 0)       /*!< Intra MBs other than IPCM and I_BL */
  ------------------
 2651|  30.0k|        }
 2652|       |
 2653|  47.6k|        ps_motion_pred = ps_ctxt->ps_motion_pred_struct;
 2654|  47.6k|        i4_curr_mot_stride = 4;
 2655|       |
 2656|       |        /* call the motion upsampling for 1st 4x4 */
 2657|  47.6k|        i4_part_idc = (i4_ref_y << 16) + i4_ref_x;
 2658|  47.6k|        i4_16x16_flag = isvcd_interlyr_motion_scale(
 2659|  47.6k|            pv_comp_mode_mv_ctxt, &i4_part_idc, ps_mb_params, ps_motion_pred, i4_listx,
 2660|  47.6k|            (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|  47.6k|        if(i4_16x16_flag)
  ------------------
  |  Branch (2663:12): [True: 0, False: 47.6k]
  ------------------
 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|  47.6k|        else
 2715|  47.6k|        {
 2716|  47.6k|            WORD32 ai4_sub_mb_mode[NUM_MB_PARTS] = {0};
 2717|       |
 2718|       |            /* replicate the motion vectors for 8x8 */
 2719|  47.6k|            isvcd_store_motion_map(ps_motion_pred, ps_motion_pred, 0, i4_curr_mot_stride, 2, 2,
 2720|  47.6k|                                   SVCD_FALSE);
  ------------------
  |  |   45|  47.6k|#define SVCD_FALSE 0
  ------------------
 2721|       |
 2722|  47.6k|            if(2 == i4_listx)
  ------------------
  |  Branch (2722:16): [True: 22.3k, False: 25.3k]
  ------------------
 2723|  22.3k|            {
 2724|  22.3k|                WORD32 i4_indx = 0;
 2725|       |
 2726|       |                /* replicate the motion vectors for 8x8 */
 2727|       |                /* check the 0th partiton reference indices */
 2728|  22.3k|                if(0 <= ps_motion_pred[0].i1_ref_frame[0])
  ------------------
  |  Branch (2728:20): [True: 21.8k, False: 473]
  ------------------
 2729|  21.8k|                {
 2730|  21.8k|                    i4_indx += 1;
 2731|  21.8k|                }
 2732|  22.3k|                if(0 <= ps_motion_pred[0].i1_ref_frame[1])
  ------------------
  |  Branch (2732:20): [True: 7.64k, False: 14.6k]
  ------------------
 2733|  7.64k|                {
 2734|  7.64k|                    i4_indx += 2;
 2735|  7.64k|                }
 2736|       |
 2737|  22.3k|                i4_indx = 3 * PRED_8x8 + (i4_indx - 1);
  ------------------
  |  |  453|  22.3k|#define PRED_8x8    3
  ------------------
 2738|  22.3k|                ai4_sub_mb_mode[0] = g_au1_eb_submb_type[i4_indx];
 2739|  22.3k|            }
 2740|       |
 2741|       |            /* derive the motion vectors and reference indices of 3 rem partitions */
 2742|   190k|            for(i4_blk_idx = 1; i4_blk_idx < NUM_MB_PARTS; i4_blk_idx++)
  ------------------
  |  |   59|   190k|#define NUM_MB_PARTS 4
  ------------------
  |  Branch (2742:33): [True: 142k, False: 47.6k]
  ------------------
 2743|   142k|            {
 2744|   142k|                WORD32 i4_blk_y, i4_blk_x;
 2745|   142k|                mv_pred_t *ps_temp;
 2746|       |
 2747|   142k|                i4_blk_x = i4_blk_idx & 1;
 2748|   142k|                i4_blk_y = i4_blk_idx >> 1;
 2749|       |
 2750|   142k|                ps_temp = ps_motion_pred + (i4_blk_x << 1);
 2751|   142k|                ps_temp += (i4_blk_y * i4_curr_mot_stride << 1);
 2752|       |
 2753|       |                /* store the reference layer positions */
 2754|   142k|                i4_part_idc = ((i4_ref_y + (i4_blk_y << 2)) << 16) + (i4_ref_x + (i4_blk_x << 2));
 2755|   142k|                isvcd_interlyr_motion_scale(pv_comp_mode_mv_ctxt, &i4_part_idc, ps_mb_params,
 2756|   142k|                                            ps_temp, i4_listx, (i4_mb_pic_x + (i4_blk_x << 2) + 1),
 2757|   142k|                                            (i4_mb_pic_y + (i4_blk_y << 2) + 1),
 2758|   142k|                                            ps_dec->ppv_map_ref_idx_to_poc);
 2759|       |
 2760|       |                /* replicate the motion vectors for 8x8 */
 2761|   142k|                isvcd_store_motion_map(ps_temp, ps_temp, 0, i4_curr_mot_stride, 2, 2, SVCD_FALSE);
  ------------------
  |  |   45|   142k|#define SVCD_FALSE 0
  ------------------
 2762|       |
 2763|   142k|                if(2 == i4_listx)
  ------------------
  |  Branch (2763:20): [True: 66.9k, False: 75.9k]
  ------------------
 2764|  66.9k|                {
 2765|  66.9k|                    WORD32 i4_indx = 0;
 2766|       |
 2767|       |                    /* check the 0th partiton reference indices */
 2768|  66.9k|                    if(0 <= ps_temp[0].i1_ref_frame[0])
  ------------------
  |  Branch (2768:24): [True: 65.5k, False: 1.41k]
  ------------------
 2769|  65.5k|                    {
 2770|  65.5k|                        i4_indx += 1;
 2771|  65.5k|                    }
 2772|  66.9k|                    if(0 <= ps_temp[0].i1_ref_frame[1])
  ------------------
  |  Branch (2772:24): [True: 23.6k, False: 43.2k]
  ------------------
 2773|  23.6k|                    {
 2774|  23.6k|                        i4_indx += 2;
 2775|  23.6k|                    }
 2776|       |
 2777|  66.9k|                    i4_indx = 3 * PRED_8x8 + (i4_indx - 1);
  ------------------
  |  |  453|  66.9k|#define PRED_8x8    3
  ------------------
 2778|       |
 2779|  66.9k|                    ai4_sub_mb_mode[i4_blk_idx] = g_au1_eb_submb_type[i4_indx];
 2780|  66.9k|                }
 2781|   142k|            }
 2782|       |
 2783|       |            /* if MB mode has to derivied */
 2784|  47.6k|            if(1 == u1_base_mode_flag)
  ------------------
  |  Branch (2784:16): [True: 30.0k, False: 17.5k]
  ------------------
 2785|  30.0k|            {
 2786|  30.0k|                WORD32 i4_horz_match, i4_vert_match;
 2787|  30.0k|                WORD32 i4_part_size = PRED_8x8;
  ------------------
  |  |  453|  30.0k|#define PRED_8x8    3
  ------------------
 2788|       |
 2789|  30.0k|                mv_pred_t *ps_motion_1;
 2790|  30.0k|                mv_pred_t *ps_motion_2;
 2791|  30.0k|                mv_pred_t *ps_motion_3;
 2792|       |
 2793|  30.0k|                ps_motion_1 = ps_motion_pred + 2;
 2794|  30.0k|                ps_motion_2 = ps_motion_pred + (i4_curr_mot_stride << 1);
 2795|  30.0k|                ps_motion_3 = ps_motion_2 + 2;
 2796|       |
 2797|       |                /* check if the motion in horz direction are same*/
 2798|  30.0k|                i4_horz_match = isvcd_check_motion(ps_motion_pred, ps_motion_1, i4_listx);
 2799|  30.0k|                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|  30.0k|                i4_vert_match = isvcd_check_motion(ps_motion_pred, ps_motion_2, i4_listx);
 2803|  30.0k|                i4_vert_match += isvcd_check_motion(ps_motion_1, ps_motion_3, i4_listx);
 2804|       |
 2805|  30.0k|                ps_mb_part_info->u1_num_part = 4;
 2806|       |
 2807|       |                /* decide the partition size based on the results of matching */
 2808|  30.0k|                if((2 == i4_horz_match) && (2 == i4_vert_match))
  ------------------
  |  Branch (2808:20): [True: 27.5k, False: 2.57k]
  |  Branch (2808:44): [True: 27.0k, False: 410]
  ------------------
 2809|  27.0k|                {
 2810|  27.0k|                    ps_mb_params->u1_mb_type = P_L0_16x16;
 2811|  27.0k|                    i4_part_size = PRED_16x16;
  ------------------
  |  |  450|  27.0k|#define PRED_16x16  0
  ------------------
 2812|  27.0k|                    ps_mb_part_info->u1_num_part = 1;
 2813|  27.0k|                    *pu1_col_info++ = (PRED_16x16 << 6);
  ------------------
  |  |  450|  27.0k|#define PRED_16x16  0
  ------------------
 2814|       |
 2815|  27.0k|                    ps_mb_part_info->i1_ref_idx[0][0] = ps_motion_pred->i1_ref_frame[0];
 2816|  27.0k|                    if(2 == i4_listx)
  ------------------
  |  Branch (2816:24): [True: 10.8k, False: 16.2k]
  ------------------
 2817|  10.8k|                        ps_mb_part_info->i1_ref_idx[1][0] = ps_motion_pred->i1_ref_frame[1];
 2818|       |
 2819|  27.0k|                    ps_part->u1_partwidth = 4;  // interms of 4x4
 2820|  27.0k|                    ps_part->u1_partheight = 4;
 2821|  27.0k|                    ps_part->u1_pred_mode = PRED_L0;
  ------------------
  |  |  483|  27.0k|#define PRED_L0   1
  ------------------
 2822|  27.0k|                    ps_part->u1_is_direct = 0;
 2823|  27.0k|                    ps_part->u1_sub_mb_num = 0;
 2824|  27.0k|                }
 2825|  2.98k|                else if(2 == i4_horz_match)
  ------------------
  |  Branch (2825:25): [True: 410, False: 2.57k]
  ------------------
 2826|    410|                {
 2827|    410|                    ps_mb_params->u1_mb_type = P_L0_L0_16x8;
 2828|    410|                    i4_part_size = PRED_16x8;
  ------------------
  |  |  451|    410|#define PRED_16x8   1
  ------------------
 2829|    410|                    ps_mb_part_info->u1_num_part = 2;
 2830|    410|                    *pu1_col_info++ = (PRED_16x8 << 6);
  ------------------
  |  |  451|    410|#define PRED_16x8   1
  ------------------
 2831|    410|                    *pu1_col_info++ = (PRED_16x8 << 6);
  ------------------
  |  |  451|    410|#define PRED_16x8   1
  ------------------
 2832|       |
 2833|    410|                    ps_mb_part_info->i1_ref_idx[0][0] = ps_motion_pred->i1_ref_frame[0];
 2834|    410|                    ps_mb_part_info->i1_ref_idx[0][1] = ps_motion_pred[8].i1_ref_frame[0];
 2835|    410|                    if(2 == i4_listx)
  ------------------
  |  Branch (2835:24): [True: 146, False: 264]
  ------------------
 2836|    146|                    {
 2837|    146|                        ps_mb_part_info->i1_ref_idx[1][0] = ps_motion_pred->i1_ref_frame[1];
 2838|    146|                        ps_mb_part_info->i1_ref_idx[1][1] = ps_motion_pred[8].i1_ref_frame[1];
 2839|    146|                    }
 2840|    410|                    ps_part->u1_partwidth = 4;  // interms of 4x4
 2841|    410|                    ps_part->u1_partheight = 2;
 2842|    410|                    ps_part->u1_pred_mode = PRED_L0;
  ------------------
  |  |  483|    410|#define PRED_L0   1
  ------------------
 2843|    410|                    ps_part->u1_is_direct = 0;
 2844|    410|                    ps_part->u1_sub_mb_num = 0;
 2845|       |
 2846|    410|                    ps_part++;
 2847|    410|                    ps_part->u1_partwidth = 4;
 2848|    410|                    ps_part->u1_partheight = 2;
 2849|    410|                    ps_part->u1_pred_mode = PRED_L0;
  ------------------
  |  |  483|    410|#define PRED_L0   1
  ------------------
 2850|    410|                    ps_part->u1_is_direct = 0;
 2851|    410|                    ps_part->u1_sub_mb_num = 8;
 2852|    410|                }
 2853|  2.57k|                else if(2 == i4_vert_match)
  ------------------
  |  Branch (2853:25): [True: 531, False: 2.04k]
  ------------------
 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: 376, False: 155]
  ------------------
 2864|    376|                    {
 2865|    376|                        ps_mb_part_info->i1_ref_idx[1][0] = ps_motion_pred->i1_ref_frame[1];
 2866|    376|                        ps_mb_part_info->i1_ref_idx[1][1] = ps_motion_pred[2].i1_ref_frame[1];
 2867|    376|                    }
 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|  30.0k|                ps_mb_params->u1_mb_mc_mode = i4_part_size;
 2884|       |
 2885|       |                /* store the sub partition size */
 2886|  30.0k|                if(PRED_8x8 == i4_part_size)
  ------------------
  |  |  453|  30.0k|#define PRED_8x8    3
  ------------------
  |  Branch (2886:20): [True: 2.04k, False: 28.0k]
  ------------------
 2887|  2.04k|                {
 2888|  2.04k|                    UWORD8 u1_ctr;
 2889|       |                    /* for P_MB sub part type is P_L0_8x8*/
 2890|       |
 2891|  2.04k|                    ps_mb_params->u1_mb_type = P_8x8;
 2892|  2.04k|                    ps_mb_part_info->i1_ref_idx[0][0] = ps_motion_pred[0].i1_ref_frame[0];
 2893|  2.04k|                    ps_mb_part_info->i1_ref_idx[0][1] = ps_motion_pred[2].i1_ref_frame[0];
 2894|  2.04k|                    ps_mb_part_info->i1_ref_idx[0][2] = ps_motion_pred[8].i1_ref_frame[0];
 2895|  2.04k|                    ps_mb_part_info->i1_ref_idx[0][3] = ps_motion_pred[10].i1_ref_frame[0];
 2896|  2.04k|                    if(2 == i4_listx)
  ------------------
  |  Branch (2896:24): [True: 1.31k, False: 726]
  ------------------
 2897|  1.31k|                    {
 2898|  1.31k|                        ps_mb_part_info->i1_ref_idx[1][0] = ps_motion_pred[0].i1_ref_frame[1];
 2899|  1.31k|                        ps_mb_part_info->i1_ref_idx[1][1] = ps_motion_pred[2].i1_ref_frame[1];
 2900|  1.31k|                        ps_mb_part_info->i1_ref_idx[1][2] = ps_motion_pred[8].i1_ref_frame[1];
 2901|  1.31k|                        ps_mb_part_info->i1_ref_idx[1][3] = ps_motion_pred[10].i1_ref_frame[1];
 2902|  1.31k|                    }
 2903|       |
 2904|  10.2k|                    for(u1_ctr = 0; u1_ctr < 4; u1_ctr++)
  ------------------
  |  Branch (2904:37): [True: 8.16k, False: 2.04k]
  ------------------
 2905|  8.16k|                    {
 2906|  8.16k|                        *pu1_col_info++ = (PRED_8x8 << 6);
  ------------------
  |  |  453|  8.16k|#define PRED_8x8    3
  ------------------
 2907|       |
 2908|  8.16k|                        ps_part->u1_partwidth = 2;  // interms of 4x4
 2909|  8.16k|                        ps_part->u1_partheight = 2;
 2910|  8.16k|                        ps_part->u1_pred_mode = PRED_L0;
  ------------------
  |  |  483|  8.16k|#define PRED_L0   1
  ------------------
 2911|  8.16k|                        ps_part->u1_is_direct = 0;
 2912|  8.16k|                        ps_part->u1_sub_mb_num = (u1_ctr & 0x01) * 2 + (u1_ctr >> 1) * 8;
 2913|  8.16k|                        ps_part++;
 2914|  8.16k|                    }
 2915|  2.04k|                }
 2916|       |
 2917|  30.0k|                if(2 == i4_listx)
  ------------------
  |  Branch (2917:20): [True: 12.7k, False: 17.3k]
  ------------------
 2918|  12.7k|                {
 2919|  12.7k|                    ps_part = (parse_part_params_t *) pv_part;
 2920|  12.7k|                    pu1_col_info = ps_mb_part_info->u1_col_info;
 2921|  12.7k|                    isvcd_interlyr_mbmode_pred_bmb(ps_ctxt, ps_motion_pred, i4_curr_mot_stride,
 2922|  12.7k|                                                   i4_part_size, &ai4_sub_mb_mode[0], ps_mb_params,
 2923|  12.7k|                                                   ps_part, pu1_col_info);
 2924|  12.7k|                }
 2925|  30.0k|            } /* end of mode derivation */
 2926|  17.5k|            else
 2927|  17.5k|            {
 2928|  17.5k|                isvcd_populate_ref_idx(ps_mb_params, ps_svc_mb_params, ps_motion_pred,
 2929|  17.5k|                                       ps_mb_part_info, i4_listx);
 2930|       |
 2931|  17.5k|            } /* non 16x16 mv mode derivation */
 2932|  47.6k|        }
 2933|  47.6k|    }
 2934|  47.6k|    return i4_mb_mode;
 2935|  47.6k|}
isvcd_compute_scaled_offsets:
 2968|  33.3k|{
 2969|  33.3k|    WORD32 i4_offset_x, i4_offset_y;
 2970|  33.3k|    UWORD32 i4_scaled_ref_lyr_width;
 2971|  33.3k|    UWORD32 i4_scaled_ref_lyr_height;
 2972|  33.3k|    UWORD32 i4_ref_lyr_width;
 2973|  33.3k|    UWORD32 i4_ref_lyr_height;
 2974|  33.3k|    UWORD32 i4_shift_x, i4_shift_y;
 2975|  33.3k|    UWORD32 i4_scale_x, i4_scale_y;
 2976|  33.3k|    WORD32 i4_cntr;
 2977|  33.3k|    WORD32 i4_scale_add_x, i4_scale_add_y;
 2978|  33.3k|    WORD32 i4_curr_lyr_width, i4_curr_lyr_height;
 2979|       |
 2980|  33.3k|    if((NULL == ps_curr_res_prms) || (NULL == ps_ref_res_prms) || (NULL == pi2_offset_x) ||
  ------------------
  |  Branch (2980:8): [True: 0, False: 33.3k]
  |  Branch (2980:38): [True: 0, False: 33.3k]
  |  Branch (2980:67): [True: 0, False: 33.3k]
  ------------------
 2981|  33.3k|       (NULL == pi2_offset_y))
  ------------------
  |  Branch (2981:8): [True: 0, False: 33.3k]
  ------------------
 2982|      0|    {
 2983|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 2984|      0|    }
 2985|       |    /* initial calculation */
 2986|  33.3k|    i4_offset_x = ps_curr_res_prms->s_ref_lyr_scaled_offset.i2_left;
 2987|  33.3k|    i4_offset_y = ps_curr_res_prms->s_ref_lyr_scaled_offset.i2_top;
 2988|       |
 2989|       |    /* get the width and height */
 2990|  33.3k|    i4_scaled_ref_lyr_width = ps_curr_res_prms->u2_scaled_ref_width;
 2991|  33.3k|    i4_scaled_ref_lyr_height = ps_curr_res_prms->u2_scaled_ref_height;
 2992|  33.3k|    i4_ref_lyr_width = ps_ref_res_prms->i4_res_width;
 2993|  33.3k|    i4_ref_lyr_height = ps_ref_res_prms->i4_res_height;
 2994|  33.3k|    i4_curr_lyr_width = ps_curr_res_prms->i4_res_width;
 2995|  33.3k|    i4_curr_lyr_height = ps_curr_res_prms->i4_res_height;
 2996|       |
 2997|       |    /* derive shift x and y based on level idd */
 2998|  33.3k|    if(u1_level_idc <= 30)
  ------------------
  |  Branch (2998:8): [True: 30.9k, False: 2.37k]
  ------------------
 2999|  30.9k|    {
 3000|  30.9k|        i4_shift_x = 16;
 3001|  30.9k|        i4_shift_y = 16;
 3002|  30.9k|    }
 3003|  2.37k|    else
 3004|  2.37k|    {
 3005|  2.37k|        i4_shift_x = 31 - isvcd_get_ceil_log2(i4_ref_lyr_width);
 3006|  2.37k|        i4_shift_y = 31 - isvcd_get_ceil_log2(i4_ref_lyr_height);
 3007|  2.37k|    }
 3008|       |
 3009|       |    /* assert on max ranges of width and shift values */
 3010|  33.3k|    if((i4_ref_lyr_width > H264_MAX_FRAME_WIDTH) ||
  ------------------
  |  |   39|  33.3k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
  |  Branch (3010:8): [True: 0, False: 33.3k]
  ------------------
 3011|  33.3k|       (i4_scaled_ref_lyr_width > H264_MAX_FRAME_WIDTH) ||
  ------------------
  |  |   39|  33.3k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
  |  Branch (3011:8): [True: 0, False: 33.3k]
  ------------------
 3012|  33.3k|       (i4_ref_lyr_height > H264_MAX_FRAME_HEIGHT) ||
  ------------------
  |  |   40|  33.3k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
  |  Branch (3012:8): [True: 0, False: 33.3k]
  ------------------
 3013|  33.3k|       (i4_scaled_ref_lyr_height > H264_MAX_FRAME_HEIGHT) ||
  ------------------
  |  |   40|  33.3k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
  |  Branch (3013:8): [True: 0, False: 33.3k]
  ------------------
 3014|  33.3k|       (i4_curr_lyr_width > H264_MAX_FRAME_WIDTH) || (i4_curr_lyr_height > H264_MAX_FRAME_HEIGHT))
  ------------------
  |  |   39|  33.3k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
                     (i4_curr_lyr_width > H264_MAX_FRAME_WIDTH) || (i4_curr_lyr_height > H264_MAX_FRAME_HEIGHT))
  ------------------
  |  |   40|  33.3k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
  |  Branch (3014:8): [True: 0, False: 33.3k]
  |  Branch (3014:54): [True: 0, False: 33.3k]
  ------------------
 3015|      0|    {
 3016|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 3017|      0|    }
 3018|       |
 3019|       |    /* calculate scale factor x and y */
 3020|  33.3k|    i4_scale_x = (((UWORD32) i4_ref_lyr_width << i4_shift_x) + (i4_scaled_ref_lyr_width >> 1)) /
 3021|  33.3k|                 i4_scaled_ref_lyr_width;
 3022|       |
 3023|  33.3k|    i4_scale_y = (((UWORD32) i4_ref_lyr_height << i4_shift_y) + (i4_scaled_ref_lyr_height >> 1)) /
 3024|  33.3k|                 i4_scaled_ref_lyr_height;
 3025|       |
 3026|       |    /* calcualte the values to be added based on left and top offset */
 3027|  33.3k|    i4_scale_add_x = (1 << (i4_shift_x - 1)) - (i4_offset_x * (WORD32) i4_scale_x);
 3028|  33.3k|    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.89M|    for(i4_cntr = 0; i4_cntr < i4_curr_lyr_width; i4_cntr++)
  ------------------
  |  Branch (3031:22): [True: 1.86M, False: 33.3k]
  ------------------
 3032|  1.86M|    {
 3033|  1.86M|        WORD32 i4_ref_x;
 3034|  1.86M|        i4_ref_x = (i4_cntr * i4_scale_x + i4_scale_add_x) >> i4_shift_x;
 3035|  1.86M|        *pi2_offset_x++ = (WORD16) i4_ref_x;
 3036|  1.86M|    }
 3037|       |
 3038|       |    /* derive the projected locations in the reference layer */
 3039|  4.93M|    for(i4_cntr = 0; i4_cntr < i4_curr_lyr_height; i4_cntr++)
  ------------------
  |  Branch (3039:22): [True: 4.90M, False: 33.3k]
  ------------------
 3040|  4.90M|    {
 3041|  4.90M|        WORD32 i4_ref_y;
 3042|  4.90M|        i4_ref_y = (i4_cntr * i4_scale_y + i4_scale_add_y) >> i4_shift_y;
 3043|  4.90M|        *pi2_offset_y++ = (WORD16) i4_ref_y;
 3044|  4.90M|    }
 3045|  33.3k|    return OK;
  ------------------
  |  |  114|  33.3k|#define OK        0
  ------------------
 3046|  33.3k|}
isvcd_comp_mode_mv_res_init:
 3077|   132k|{
 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|   132k|    mode_motion_ctxt_t *ps_ctxt;
 3086|   132k|    mode_motion_lyr_ctxt *ps_lyr_mem;
 3087|   132k|    dec_seq_params_t *ps_sps;
 3088|   132k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec = (svc_dec_lyr_struct_t *) pv_svc_dec;
 3089|   132k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
 3090|   132k|    svc_dec_lyr_struct_t *ps_svc_dec_ref_layer;
 3091|   132k|    WORD32 ret;
 3092|   132k|    WORD32 i4_scaled_ref_lyr_width;
 3093|   132k|    WORD32 i4_scaled_ref_lyr_height;
 3094|   132k|    WORD32 i4_ref_lyr_width;
 3095|   132k|    WORD32 i4_ref_lyr_height;
 3096|   132k|    res_prms_t *ps_curr_lyr_res_prms = &ps_svc_lyr_dec->s_res_prms;
 3097|       |
 3098|   132k|    ps_svc_dec_ref_layer = ps_svc_lyr_dec->ps_dec_svc_ref_layer;
 3099|   132k|    if(NULL == ps_curr_lyr_res_prms)
  ------------------
  |  Branch (3099:8): [True: 0, False: 132k]
  ------------------
 3100|      0|    {
 3101|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 3102|      0|    }
 3103|       |
 3104|   132k|    ps_ctxt = (mode_motion_ctxt_t *) ps_svc_lyr_dec->pv_mode_mv_sample_ctxt;
 3105|   132k|    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|   132k|    if(SVCD_TRUE == ps_svc_lyr_dec->u1_base_res_flag)
  ------------------
  |  |   46|   132k|#define SVCD_TRUE 1
  ------------------
  |  Branch (3108:8): [True: 99.2k, False: 33.3k]
  ------------------
 3109|  99.2k|    {
 3110|  99.2k|        ps_ctxt->i4_res_id = -1;
 3111|  99.2k|        ps_ctxt->i4_ref_width = ps_curr_lyr_res_prms->i4_res_width;
 3112|  99.2k|        ps_ctxt->i4_ref_height = ps_curr_lyr_res_prms->i4_res_height;
 3113|  99.2k|        return OK;
  ------------------
  |  |  114|  99.2k|#define OK        0
  ------------------
 3114|  99.2k|    }
 3115|       |
 3116|       |    /* call the function which populates the projected ref locations */
 3117|  33.3k|    ps_sps = ps_dec->ps_cur_sps;
 3118|       |
 3119|       |    /* store the res id appropriately */
 3120|  33.3k|    ps_ctxt->i4_res_id = ps_svc_lyr_dec->u1_layer_id - 1;
 3121|       |
 3122|       |    /* get the current layer ctxt */
 3123|  33.3k|    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|  33.3k|    ps_lyr_mem->ps_curr_lyr_res_prms = ps_curr_lyr_res_prms;
 3127|       |
 3128|       |    /* store the reference layer mv bank pointer */
 3129|  33.3k|    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|  33.3k|    ps_lyr_mem->s_ref_mb_mode.pv_buffer = ps_svc_dec_ref_layer->ps_inter_lyr_mb_prms_frm_start;
 3133|  33.3k|    ps_lyr_mem->s_ref_mb_mode.i4_num_element_stride =
 3134|  33.3k|        ps_svc_dec_ref_layer->u2_inter_lyr_mb_prms_stride;
 3135|  33.3k|    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|  33.3k|    if(SVCD_TRUE == ps_curr_lyr_res_prms->u1_remap_req_flag)
  ------------------
  |  |   46|  33.3k|#define SVCD_TRUE 1
  ------------------
  |  Branch (3138:8): [True: 33.3k, False: 0]
  ------------------
 3139|  33.3k|    {
 3140|  33.3k|        res_prms_t s_ref_res_prms = {0};
 3141|       |
 3142|       |        /* store the reference layer resolution width and height */
 3143|  33.3k|        s_ref_res_prms.i4_res_width = ps_ctxt->i4_ref_width;
 3144|  33.3k|        s_ref_res_prms.i4_res_height = ps_ctxt->i4_ref_height;
 3145|       |
 3146|       |        /* call projection map calculation function */
 3147|  33.3k|        ret = isvcd_compute_scaled_offsets(ps_curr_lyr_res_prms, &s_ref_res_prms,
 3148|  33.3k|                                           ps_lyr_mem->pi2_ref_loc_x, ps_lyr_mem->pi2_ref_loc_y,
 3149|  33.3k|                                           ps_sps->u1_level_idc);
 3150|  33.3k|        if(OK != ret)
  ------------------
  |  |  114|  33.3k|#define OK        0
  ------------------
  |  Branch (3150:12): [True: 0, False: 33.3k]
  ------------------
 3151|      0|        {
 3152|      0|            return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 3153|      0|        }
 3154|       |
 3155|       |        /* derive the scaling variables */
 3156|  33.3k|        ps_lyr_mem->i4_offset_x = ps_curr_lyr_res_prms->s_ref_lyr_scaled_offset.i2_left;
 3157|       |
 3158|  33.3k|        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|  33.3k|        i4_scaled_ref_lyr_width = ps_curr_lyr_res_prms->u2_scaled_ref_width;
 3162|  33.3k|        i4_scaled_ref_lyr_height = ps_curr_lyr_res_prms->u2_scaled_ref_height;
 3163|  33.3k|        i4_ref_lyr_width = ps_ctxt->i4_ref_width;
 3164|  33.3k|        i4_ref_lyr_height = ps_ctxt->i4_ref_height;
 3165|       |
 3166|       |        /*store the reference layer width adn height */
 3167|  33.3k|        ps_lyr_mem->i4_ref_width = ps_ctxt->i4_ref_width;
 3168|  33.3k|        ps_lyr_mem->i4_ref_height = ps_ctxt->i4_ref_height;
 3169|       |
 3170|  33.3k|        if((i4_ref_lyr_width > H264_MAX_FRAME_WIDTH) || (i4_ref_lyr_width <= 0)) return NOT_OK;
  ------------------
  |  |   39|  33.3k|#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: 33.3k]
  |  Branch (3170:57): [True: 0, False: 33.3k]
  ------------------
 3171|  33.3k|        if((i4_scaled_ref_lyr_width > H264_MAX_FRAME_WIDTH) || (i4_scaled_ref_lyr_width <= 0))
  ------------------
  |  |   39|  33.3k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
  |  Branch (3171:12): [True: 0, False: 33.3k]
  |  Branch (3171:64): [True: 0, False: 33.3k]
  ------------------
 3172|      0|            return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 3173|  33.3k|        if((i4_ref_lyr_height > H264_MAX_FRAME_HEIGHT) || (i4_ref_lyr_height <= 0)) return NOT_OK;
  ------------------
  |  |   40|  33.3k|#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: 33.3k]
  |  Branch (3173:59): [True: 0, False: 33.3k]
  ------------------
 3174|  33.3k|        if((i4_scaled_ref_lyr_height > H264_MAX_FRAME_HEIGHT) || (i4_scaled_ref_lyr_height <= 0))
  ------------------
  |  |   40|  33.3k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
  |  Branch (3174:12): [True: 0, False: 33.3k]
  |  Branch (3174:66): [True: 0, False: 33.3k]
  ------------------
 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|  33.3k|        ps_lyr_mem->pf_inter_lyr_pred = &isvcd_compute_interlyr_motion_mode;
 3180|       |
 3181|  33.3k|        if(SVCD_TRUE == ps_curr_lyr_res_prms->u1_dyadic_flag)
  ------------------
  |  |   46|  33.3k|#define SVCD_TRUE 1
  ------------------
  |  Branch (3181:12): [True: 16.2k, False: 17.1k]
  ------------------
 3182|  16.2k|        {
 3183|  16.2k|            ps_lyr_mem->pf_inter_lyr_pred = &isvcd_interlyr_motion_mode_pred_dyadic;
 3184|  16.2k|        }
 3185|       |
 3186|       |        /* Store the Dyadic flag */
 3187|  33.3k|        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|  33.3k|        ps_lyr_mem->i4_scale_mv_x =
 3192|  33.3k|            ((i4_scaled_ref_lyr_width << 16) + (i4_ref_lyr_width >> 1)) / i4_ref_lyr_width;
 3193|       |
 3194|  33.3k|        ps_lyr_mem->i4_scale_mv_y =
 3195|  33.3k|            ((i4_scaled_ref_lyr_height << 16) + (i4_ref_lyr_height >> 1)) / i4_ref_lyr_height;
 3196|  33.3k|    }
 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|  33.3k|    ps_ctxt->i4_ref_width = ps_curr_lyr_res_prms->i4_res_width;
 3208|  33.3k|    ps_ctxt->i4_ref_height = ps_curr_lyr_res_prms->i4_res_height;
 3209|       |
 3210|  33.3k|    return OK;
  ------------------
  |  |  114|  33.3k|#define OK        0
  ------------------
 3211|  33.3k|}

isvcd_nal_buf_reset:
  146|  4.20M|{
  147|  4.20M|    nal_buf_t *ps_nal_buf = pv_nal_buf;
  148|       |
  149|  4.20M|    ps_nal_buf->i4_valid_flag = SVCD_FALSE;
  ------------------
  |  |   45|  4.20M|#define SVCD_FALSE 0
  ------------------
  150|  4.20M|    ps_nal_buf->i4_buf_size = 0;
  151|  4.20M|    ps_nal_buf->u4_max_bits = 0;
  152|       |    ps_nal_buf->pu1_buf = NULL;
  153|  4.20M|}
isvcd_nal_find_start_code:
  184|  2.17M|{
  185|  2.17M|    UWORD8 *pu1_buf = pu1_buf_start + i4_cur_pos;
  186|  2.17M|    WORD32 i4_i;
  187|       |
  188|   130M|    for(i4_i = 0; i4_i < (i4_max_num_bytes - i4_cur_pos); i4_i++)
  ------------------
  |  Branch (188:19): [True: 130M, False: 34.3k]
  ------------------
  189|   130M|    {
  190|       |        /*-------------------------------------------------------------------*/
  191|       |        /* If zero increment the zero byte counter                           */
  192|       |        /*-------------------------------------------------------------------*/
  193|   130M|        if(0 == *pu1_buf)
  ------------------
  |  Branch (193:12): [True: 31.6M, False: 99.0M]
  ------------------
  194|  31.6M|        {
  195|  31.6M|            (*pi4_zero_cnt)++;
  196|  31.6M|        }
  197|       |
  198|       |        /*-------------------------------------------------------------------*/
  199|       |        /* If start code found then increment the byte consumed and return   */
  200|       |        /*-------------------------------------------------------------------*/
  201|  99.0M|        else if(0x01 == *pu1_buf && *pi4_zero_cnt >= NUM_OF_ZERO_BYTES_BEFORE_START_CODE)
  ------------------
  |  |   54|  37.0M|#define NUM_OF_ZERO_BYTES_BEFORE_START_CODE (2)
  ------------------
  |  Branch (201:17): [True: 37.0M, False: 62.0M]
  |  Branch (201:37): [True: 2.14M, False: 34.9M]
  ------------------
  202|  2.14M|        {
  203|  2.14M|            (*pu4_bytes_consumed)++;
  204|  2.14M|            return (SC_FOUND);
  ------------------
  |  |   52|  2.14M|#define SC_FOUND 1
  ------------------
  205|  2.14M|        }
  206|       |        /*-------------------------------------------------------------------*/
  207|       |        /* If non zero byte and value is not equal to 1 a then reset zero    */
  208|       |        /* byte counter                                                      */
  209|       |        /*-------------------------------------------------------------------*/
  210|  96.9M|        else
  211|  96.9M|        {
  212|  96.9M|            *pi4_zero_cnt = 0;
  213|  96.9M|        }
  214|       |
  215|   128M|        (*pu4_bytes_consumed)++;
  216|   128M|        pu1_buf++;
  217|   128M|    }
  218|       |
  219|  34.3k|    return (SC_NOT_FOUND);
  ------------------
  |  |   51|  34.3k|#define SC_NOT_FOUND (-1)
  ------------------
  220|  2.17M|}
isvcd_get_first_start_code:
  248|  22.5k|{
  249|  22.5k|    WORD32 i4_zero_cnt = 0, i4_status;
  250|  22.5k|    UWORD32 u4_bytes_consumed_temp = 0;
  251|       |
  252|  22.5k|    i4_status = isvcd_nal_find_start_code(pu1_stream_buffer, 0, *pu4_num_bytes, &i4_zero_cnt,
  253|  22.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|  22.5k|    if(SC_NOT_FOUND == i4_status)
  ------------------
  |  |   51|  22.5k|#define SC_NOT_FOUND (-1)
  ------------------
  |  Branch (260:8): [True: 24, False: 22.4k]
  ------------------
  261|     24|    {
  262|     24|        *pu4_bytes_consumed += u4_bytes_consumed_temp;
  263|     24|        return (i4_status);
  264|     24|    }
  265|  22.4k|    else
  266|  22.4k|    {
  267|       |        /*-------------------------------------------------------------------*/
  268|       |        /* If start code found then proceed with bitstream extraction        */
  269|       |        /*-------------------------------------------------------------------*/
  270|  22.4k|        *pu4_bytes_consumed += u4_bytes_consumed_temp;
  271|  22.4k|        return (i4_status);
  272|  22.4k|    }
  273|  22.5k|}
isvcd_get_annex_b_nal_unit:
  312|  2.14M|{
  313|  2.14M|    nal_unit_t *ps_nal_unit = (nal_unit_t *) pv_nal_unit;
  314|  2.14M|    WORD32 i4_status, i4_nal_start_flag = SVCD_FALSE;
  ------------------
  |  |   45|  2.14M|#define SVCD_FALSE 0
  ------------------
  315|       |
  316|       |    /*-----------------------------------------------------------------------*/
  317|       |    /* Initialization                                                        */
  318|       |    /*-----------------------------------------------------------------------*/
  319|  2.14M|    *pu4_bytes_consumed = 0;
  320|  2.14M|    *pi4_more_data_flag = SVCD_TRUE;
  ------------------
  |  |   46|  2.14M|#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.14M|    if(NAL_END == *pi4_state)
  ------------------
  |  Branch (327:8): [True: 453, False: 2.14M]
  ------------------
  328|    453|    {
  329|    453|        return i4_nal_start_flag;
  330|    453|    }
  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.14M|    ps_nal_unit->pu1_bufs = pu1_buf_start + i4_cur_pos;
  342|       |
  343|  2.14M|    if(NAL_START == *pi4_state)
  ------------------
  |  Branch (343:8): [True: 2.14M, False: 24]
  ------------------
  344|  2.14M|    {
  345|  2.14M|        if(0 != *pi4_zero_byte_cnt)
  ------------------
  |  Branch (345:12): [True: 0, False: 2.14M]
  ------------------
  346|      0|        {
  347|      0|            return i4_nal_start_flag;
  348|      0|        }
  349|  2.14M|        i4_nal_start_flag = SVCD_TRUE;
  ------------------
  |  |   46|  2.14M|#define SVCD_TRUE 1
  ------------------
  350|  2.14M|        ps_nal_unit->i4_num_bufs = 1;
  351|  2.14M|        ps_nal_unit->i4_buf_sizes = 0;
  352|  2.14M|        *pi4_state = FIND_NAL_END;
  353|  2.14M|    }
  354|       |
  355|  2.14M|    i4_status = isvcd_nal_find_start_code(pu1_buf_start, i4_cur_pos, i4_max_num_bytes,
  356|  2.14M|                                          pi4_zero_byte_cnt, pu4_bytes_consumed);
  357|       |
  358|  2.14M|    if(SC_NOT_FOUND == i4_status)
  ------------------
  |  |   51|  2.14M|#define SC_NOT_FOUND (-1)
  ------------------
  |  Branch (358:8): [True: 34.0k, False: 2.11M]
  ------------------
  359|  34.0k|    {
  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|  34.0k|        ps_nal_unit->i4_buf_sizes = *pu4_bytes_consumed;
  370|  34.0k|        *pi4_more_data_flag = SVCD_FALSE;
  ------------------
  |  |   45|  34.0k|#define SVCD_FALSE 0
  ------------------
  371|       |
  372|  34.0k|        return (i4_nal_start_flag);
  373|  34.0k|    }
  374|  2.11M|    else
  375|  2.11M|    {
  376|       |        /*-------------------------------------------------------------------*/
  377|       |        /* If NAL END is found then increment the bytes consumed appropriatly*/
  378|       |        /* reset the zero byte counter                                       */
  379|       |        /*-------------------------------------------------------------------*/
  380|  2.11M|        *pi4_state = NAL_END;
  381|  2.11M|        ps_nal_unit->i4_buf_sizes = *pu4_bytes_consumed - 1;
  382|  2.11M|        *pi4_zero_byte_cnt = 0;
  383|  2.11M|        return (i4_nal_start_flag);
  384|  2.11M|    }
  385|  2.14M|}
isvcd_nal_rbsp_to_sodb:
  413|   562k|{
  414|   562k|    UWORD32 u4_last_word_pos;
  415|   562k|    UWORD32 u4_word, u4_max_bit_offset;
  416|   562k|    UWORD8 i4_num_bits;
  417|   562k|    WORD32 i4_i;
  418|   562k|    WORD64 i8_nal_len;
  419|   562k|    UWORD32 *pu4_buf;
  420|       |
  421|   562k|    if(0 >= i4_nal_len_in_bytes)
  ------------------
  |  Branch (421:8): [True: 15.4k, False: 547k]
  ------------------
  422|  15.4k|    {
  423|  15.4k|        return (0);
  424|  15.4k|    }
  425|       |
  426|       |    /* Get offset in bits */
  427|   547k|    i8_nal_len = (WORD64) i4_nal_len_in_bytes << 3;
  428|   547k|    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|   547k|    if(1 == u1_ecd_mode)
  ------------------
  |  Branch (433:8): [True: 73.8k, False: 473k]
  ------------------
  434|  73.8k|    {
  435|  73.8k|        return (u4_max_bit_offset);
  436|  73.8k|    }
  437|       |
  438|       |    /* Calculate the position of last word */
  439|   473k|    u4_last_word_pos = i4_nal_len_in_bytes >> 2;
  440|       |
  441|       |    /* Load the last word                 */
  442|   473k|    i4_i = i4_nal_len_in_bytes & 0x03;
  443|   473k|    if(0 != i4_i)
  ------------------
  |  Branch (443:8): [True: 344k, False: 129k]
  ------------------
  444|   344k|    {
  445|   344k|        pu4_buf = (UWORD32 *) pu1_buf;
  446|   344k|        pu4_buf += u4_last_word_pos;
  447|   344k|        u4_word = *pu4_buf;
  448|   344k|        i4_num_bits = i4_i << 3;
  449|   344k|        u4_word >>= (32 - i4_num_bits);
  450|   344k|    }
  451|   129k|    else
  452|   129k|    {
  453|   129k|        pu4_buf = (UWORD32 *) pu1_buf;
  454|   129k|        pu4_buf += (u4_last_word_pos - 1);
  455|   129k|        u4_word = *pu4_buf;
  456|   129k|        i4_num_bits = 32;
  457|   129k|    }
  458|       |
  459|       |    /* Search for RBSP stop bit          */
  460|   473k|    do
  461|   500k|    {
  462|  2.43M|        for(i4_i = 0; (i4_i < i4_num_bits) && !CHECKBIT(u4_word, i4_i); i4_i++)
  ------------------
  |  |   54|  2.40M|#define CHECKBIT(a,i) ((a) &  (1 << i))
  ------------------
  |  Branch (462:23): [True: 2.40M, False: 28.8k]
  |  Branch (462:47): [True: 1.93M, False: 471k]
  ------------------
  463|  1.93M|            ;
  464|       |
  465|   500k|        u4_max_bit_offset -= i4_i;
  466|       |
  467|       |        /* RBSP stop bit is found then   */
  468|       |        /* come out of the loop          */
  469|   500k|        if(0 != CHECKBIT(u4_word, i4_i))
  ------------------
  |  |   54|   500k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  ------------------
  |  Branch (469:12): [True: 471k, False: 28.8k]
  ------------------
  470|   471k|        {
  471|       |            /* Remove RBSP stop bit */
  472|   471k|            u4_max_bit_offset -= 1;
  473|   471k|            break;
  474|   471k|        }
  475|       |
  476|  28.8k|        pu4_buf -= 1;
  477|  28.8k|        u4_word = *pu4_buf;
  478|  28.8k|        i4_num_bits = 32;
  479|  28.8k|    } while(u4_max_bit_offset > 0);
  ------------------
  |  Branch (479:13): [True: 26.5k, False: 2.28k]
  ------------------
  480|       |
  481|   473k|    return (u4_max_bit_offset);
  482|   547k|}
isvcd_reset_emulation_ctxt:
  510|  2.75M|{
  511|  2.75M|    emulation_prevent_ctxt_t *ps_emulation_ctxt = (emulation_prevent_ctxt_t *) pv_emulation_ctxt;
  512|       |
  513|       |    /*! Reset the emulation prevention context */
  514|  2.75M|    ps_emulation_ctxt->i4_state = NOT_STUFFED_BYTE;
  515|  2.75M|    ps_emulation_ctxt->i4_zeroes_cnt = 0;
  516|  2.75M|    ps_emulation_ctxt->u4_bytes_in_word = 0;
  517|  2.75M|    ps_emulation_ctxt->u4_word = 0;
  518|  2.75M|}
isvcd_nal_byte_swap_emulation:
  564|  2.41M|{
  565|  2.41M|    UWORD32 u4_i, u4_num_bytes, u4_offset;
  566|  2.41M|    UWORD8 u1_cur_byte;
  567|  2.41M|    emulation_prevent_ctxt_t *ps_emulation_ctxt = (emulation_prevent_ctxt_t *) pv_emulation_ctxt;
  568|       |
  569|  2.41M|    u4_offset = ps_emulation_ctxt->u4_bytes_in_word;
  570|  2.41M|    u4_num_bytes = ps_emulation_ctxt->u4_bytes_in_word;
  571|       |
  572|  67.9M|    for(u4_i = 0; u4_i < u4_in_len; u4_i++)
  ------------------
  |  Branch (572:19): [True: 65.6M, False: 2.27M]
  ------------------
  573|  65.6M|    {
  574|  65.6M|        UWORD8 u1_cur_byte_emu, u1_cur_byte_sc;
  575|  65.6M|        UWORD64 u8_sft_word;
  576|       |
  577|  65.6M|        u1_cur_byte = *pu1_in_stream++;
  578|  65.6M|        u1_cur_byte_emu = (EMULATION_PREVENTION_BYTE == u1_cur_byte);
  ------------------
  |  |   57|  65.6M|#define EMULATION_PREVENTION_BYTE (0x03)
  ------------------
  579|  65.6M|        u1_cur_byte_sc = (START_CODE_BYTE == u1_cur_byte);
  ------------------
  |  |   55|  65.6M|#define START_CODE_BYTE (0x01)
  ------------------
  580|       |
  581|  65.6M|        if((ps_emulation_ctxt->i4_zeroes_cnt >= i4_0s_bfr_sc) & (u1_cur_byte_emu | u1_cur_byte_sc) &
  ------------------
  |  Branch (581:12): [True: 144k, False: 65.5M]
  ------------------
  582|  65.6M|           (NOT_STUFFED_BYTE == ps_emulation_ctxt->i4_state))
  583|   144k|        {
  584|   144k|            if(u1_cur_byte_sc)
  ------------------
  |  Branch (584:16): [True: 139k, False: 5.30k]
  ------------------
  585|   139k|            {
  586|   139k|                break;
  587|   139k|            }
  588|  5.30k|            ps_emulation_ctxt->i4_zeroes_cnt = 0;
  589|  5.30k|            ps_emulation_ctxt->i4_state = STUFFED_BYTE;
  590|  5.30k|            continue;
  591|   144k|        }
  592|       |
  593|  65.5M|        u8_sft_word = (UWORD64) ps_emulation_ctxt->u4_word << 8;
  594|  65.5M|        ps_emulation_ctxt->u4_word = (UWORD32) (u8_sft_word | u1_cur_byte);
  595|  65.5M|        ps_emulation_ctxt->u4_bytes_in_word++;
  596|  65.5M|        u4_num_bytes++;
  597|  65.5M|        ps_emulation_ctxt->i4_zeroes_cnt++;
  598|  65.5M|        if(u1_cur_byte != 0x00)
  ------------------
  |  Branch (598:12): [True: 38.8M, False: 26.6M]
  ------------------
  599|  38.8M|        {
  600|  38.8M|            ps_emulation_ctxt->i4_zeroes_cnt = 0;
  601|  38.8M|        }
  602|       |
  603|  65.5M|        if((u4_num_bytes & 0x03) == 0x00)
  ------------------
  |  Branch (603:12): [True: 15.6M, False: 49.9M]
  ------------------
  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|  65.5M|        ps_emulation_ctxt->i4_state = NOT_STUFFED_BYTE;
  611|  65.5M|    }
  612|       |
  613|  2.41M|    if(ps_emulation_ctxt->u4_bytes_in_word)
  ------------------
  |  Branch (613:8): [True: 2.09M, False: 319k]
  ------------------
  614|  2.09M|    {
  615|  2.09M|        UWORD64 temp_out_stream = (UWORD64) ps_emulation_ctxt->u4_word
  616|  2.09M|                                  << ((4 - ps_emulation_ctxt->u4_bytes_in_word) << 3);
  617|  2.09M|        *pu4_out_stream = (UWORD32) temp_out_stream;
  618|  2.09M|    }
  619|       |
  620|  2.41M|    *pu4_out_len = (u4_num_bytes - u4_offset);
  621|  2.41M|    return ((u4_num_bytes & 0xFFFFFFFC));
  622|  2.41M|}
isvcd_set_default_nal_prms:
  650|  2.37M|{
  651|  2.37M|    nal_prms_t *ps_nal_prms;
  652|  2.37M|    ps_nal_prms = (nal_prms_t *) pv_nal_prms;
  653|       |
  654|       |    /* Set default values */
  655|  2.37M|    ps_nal_prms->i4_dependency_id = 0;
  656|  2.37M|    ps_nal_prms->i4_derived_nal_type = 0xFF;
  657|  2.37M|    ps_nal_prms->i4_idr_pic_flag = SVCD_FALSE;
  ------------------
  |  |   45|  2.37M|#define SVCD_FALSE 0
  ------------------
  658|  2.37M|    ps_nal_prms->i4_nal_header_len = 0;
  659|  2.37M|    ps_nal_prms->i4_nal_ref_idc = 0xFF;
  660|  2.37M|    ps_nal_prms->i4_nal_unit_type = 0xFF;
  661|  2.37M|    ps_nal_prms->i4_no_int_lyr_pred = 1;
  662|  2.37M|    ps_nal_prms->i4_priority_id = 0;
  663|  2.37M|    ps_nal_prms->i4_quality_id = 0;
  664|  2.37M|    ps_nal_prms->i4_discard_flag = 0;
  665|  2.37M|    ps_nal_prms->i4_dqid = 0;
  666|  2.37M|    ps_nal_prms->i4_use_ref_base_pic_flag = 0;
  667|  2.37M|    ps_nal_prms->i4_temporal_id = 0;
  668|  2.37M|    ps_nal_prms->i4_idr_pic_num = 0;
  669|  2.37M|    ps_nal_prms->u2_frm_num = 0;
  670|  2.37M|    ps_nal_prms->i4_poc_lsb = 0;
  671|  2.37M|    ps_nal_prms->i4_delta_poc_bot = 0;
  672|  2.37M|    ps_nal_prms->ai4_delta_poc[0] = 0;
  673|  2.37M|    ps_nal_prms->ai4_delta_poc[1] = 0;
  674|  2.37M|    ps_nal_prms->u1_pps_id = 0;
  675|  2.37M|}
isvcd_dec_nal_hdr:
  705|  2.34M|{
  706|  2.34M|    nal_prms_t *ps_nal_prms;
  707|  2.34M|    nal_prms_t *ps_prefix_nal_prms;
  708|  2.34M|    nal_buf_t *ps_prefix_nal_buf;
  709|  2.34M|    dec_bit_stream_t s_stream_ctxt = {0};
  710|  2.34M|    WORD32 i4_forbidden_zero_bit;
  711|       |
  712|       |    /* byte swapping */
  713|  2.34M|    UWORD8 *pu1_buf = (UWORD8 *) pv_nal_header_buf;
  714|  2.34M|    UWORD8 *pu1_src = (UWORD8 *) pv_buf_ptr;
  715|       |
  716|  2.34M|    ps_nal_prms = (nal_prms_t *) pv_nal_prms;
  717|  2.34M|    ps_prefix_nal_prms = (nal_prms_t *) pv_prefix_nal_prms;
  718|  2.34M|    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|  2.34M|    s_stream_ctxt.u4_ofst = 0;
  726|  2.34M|    s_stream_ctxt.pu4_buffer = pv_nal_header_buf;
  727|  2.34M|    s_stream_ctxt.u4_max_ofst = (i4_buf_size << 3);
  728|       |
  729|  2.34M|    *pu4_err_code = 0;
  730|       |
  731|       |    /* Check the size of bitstream buffer */
  732|  2.34M|    if(s_stream_ctxt.u4_max_ofst < 8)
  ------------------
  |  Branch (732:8): [True: 7.69k, False: 2.33M]
  ------------------
  733|  7.69k|    {
  734|  7.69k|        *pu4_err_code = (UWORD32) NAL_INSUFFICIENT_DATA;
  735|  7.69k|        return;
  736|  7.69k|    }
  737|       |
  738|  2.33M|    if(s_stream_ctxt.u4_max_ofst >= 32)
  ------------------
  |  Branch (738:8): [True: 1.10M, False: 1.22M]
  ------------------
  739|  1.10M|    {
  740|  1.10M|        *pu1_buf++ = *(pu1_src + 3);
  741|  1.10M|        *pu1_buf++ = *(pu1_src + 2);
  742|  1.10M|        *pu1_buf++ = *(pu1_src + 1);
  743|  1.10M|        *pu1_buf++ = *pu1_src;
  744|  1.10M|    }
  745|  1.22M|    else
  746|  1.22M|    {
  747|  1.22M|        *pu1_buf++ = *pu1_src;
  748|  1.22M|    }
  749|       |
  750|       |    /*-----------------------------------------------------------------------*/
  751|       |    /*! Parse the NAL header and update the NAL header structure members     */
  752|       |    /*-----------------------------------------------------------------------*/
  753|       |    /* Read forbidden 0 bit */
  754|  2.33M|    i4_forbidden_zero_bit = ih264d_get_bit_h264(&s_stream_ctxt);
  755|       |
  756|  2.33M|    if(0 != i4_forbidden_zero_bit)
  ------------------
  |  Branch (756:8): [True: 28.3k, False: 2.31M]
  ------------------
  757|  28.3k|    {
  758|  28.3k|        *pu4_err_code = (UWORD32) NAL_CORRUPT_DATA;
  759|  28.3k|        return;
  760|  28.3k|    }
  761|       |
  762|       |    /*---------------- Read NAL ref idc -----------------------------*/
  763|  2.31M|    ps_nal_prms->i4_nal_ref_idc = ih264d_get_bits_h264(&s_stream_ctxt, 2);
  764|       |
  765|       |    /*----------------- Read NAL type -------------------------------*/
  766|  2.31M|    ps_nal_prms->i4_nal_unit_type = ih264d_get_bits_h264(&s_stream_ctxt, 5);
  767|  2.31M|    if(ps_nal_prms->i4_nal_unit_type > CODED_SLICE_EXTENSION_NAL)
  ------------------
  |  |   66|  2.31M|#define CODED_SLICE_EXTENSION_NAL 20
  ------------------
  |  Branch (767:8): [True: 4.64k, False: 2.30M]
  ------------------
  768|  4.64k|    {
  769|  4.64k|        *pu4_err_code = (UWORD32) NAL_CORRUPT_DATA;
  770|  4.64k|        return;
  771|  4.64k|    }
  772|  2.30M|    if(ACCESS_UNIT_DELIMITER_RBSP == ps_nal_prms->i4_nal_unit_type)
  ------------------
  |  |  332|  2.30M|#define ACCESS_UNIT_DELIMITER_RBSP      9
  ------------------
  |  Branch (772:8): [True: 11.6k, False: 2.29M]
  ------------------
  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.29M|    if(IDR_SLICE_NAL == ps_nal_prms->i4_nal_unit_type)
  ------------------
  |  |  328|  2.29M|#define IDR_SLICE_NAL                   5
  ------------------
  |  Branch (779:8): [True: 413k, False: 1.88M]
  ------------------
  780|   413k|    {
  781|   413k|        ps_nal_prms->i4_idr_pic_flag = SVCD_TRUE;
  ------------------
  |  |   46|   413k|#define SVCD_TRUE 1
  ------------------
  782|   413k|    }
  783|  1.88M|    else
  784|  1.88M|    {
  785|  1.88M|        ps_nal_prms->i4_idr_pic_flag = SVCD_FALSE;
  ------------------
  |  |   45|  1.88M|#define SVCD_FALSE 0
  ------------------
  786|  1.88M|    }
  787|       |
  788|       |    /*----------------- Read SVC extension NAL header ---------------*/
  789|  2.29M|    if(CODED_SLICE_EXTENSION_NAL == ps_nal_prms->i4_nal_unit_type ||
  ------------------
  |  |   66|  2.29M|#define CODED_SLICE_EXTENSION_NAL 20
  ------------------
  |  Branch (789:8): [True: 137k, False: 2.15M]
  ------------------
  790|  2.15M|       PREFIX_UNIT_NAL == ps_nal_prms->i4_nal_unit_type)
  ------------------
  |  |   64|  2.15M|#define PREFIX_UNIT_NAL 14
  ------------------
  |  Branch (790:8): [True: 8.90k, False: 2.14M]
  ------------------
  791|   146k|    {
  792|   146k|        WORD32 i4_svc_extension_flag, i4_idr_flag;
  793|       |
  794|       |        /* check the size of the buffer */
  795|   146k|        if(s_stream_ctxt.u4_max_ofst < 32)
  ------------------
  |  Branch (795:12): [True: 2.93k, False: 143k]
  ------------------
  796|  2.93k|        {
  797|  2.93k|            *pu4_err_code = (UWORD32) NAL_INSUFFICIENT_DATA;
  798|  2.93k|            return;
  799|  2.93k|        }
  800|       |
  801|   143k|        i4_svc_extension_flag = ih264d_get_bit_h264(&s_stream_ctxt);
  802|   143k|        UNUSED(i4_svc_extension_flag);
  ------------------
  |  |   45|   143k|#define UNUSED(x) ((void)(x))
  ------------------
  803|       |
  804|   143k|        i4_idr_flag = ih264d_get_bit_h264(&s_stream_ctxt);
  805|       |
  806|       |        /* Set idr pic flag based on idr flag */
  807|   143k|        if(1 == i4_idr_flag)
  ------------------
  |  Branch (807:12): [True: 103k, False: 40.5k]
  ------------------
  808|   103k|        {
  809|   103k|            ps_nal_prms->i4_idr_pic_flag = SVCD_TRUE;
  ------------------
  |  |   46|   103k|#define SVCD_TRUE 1
  ------------------
  810|   103k|        }
  811|  40.5k|        else
  812|  40.5k|        {
  813|  40.5k|            ps_nal_prms->i4_idr_pic_flag = SVCD_FALSE;
  ------------------
  |  |   45|  40.5k|#define SVCD_FALSE 0
  ------------------
  814|  40.5k|        }
  815|       |
  816|       |        /* parse priorit id */
  817|   143k|        ps_nal_prms->i4_priority_id = ih264d_get_bits_h264(&s_stream_ctxt, 6);
  818|       |
  819|       |        /* parse the no inter layer prediction flag */
  820|   143k|        ps_nal_prms->i4_no_int_lyr_pred = ih264d_get_bit_h264(&s_stream_ctxt);
  821|       |
  822|       |        /* parse dependency id */
  823|   143k|        ps_nal_prms->i4_dependency_id = ih264d_get_bits_h264(&s_stream_ctxt, 3);
  824|       |
  825|       |        /* parse quality id */
  826|   143k|        ps_nal_prms->i4_quality_id = ih264d_get_bits_h264(&s_stream_ctxt, 4);
  827|       |
  828|   143k|        if((ps_nal_prms->i4_quality_id > 0) || (ps_nal_prms->i4_dependency_id > 2))
  ------------------
  |  Branch (828:12): [True: 6.97k, False: 136k]
  |  Branch (828:48): [True: 428, False: 136k]
  ------------------
  829|  7.40k|        {
  830|  7.40k|            *pu4_err_code = (UWORD32) NAL_CORRUPT_DATA;
  831|  7.40k|            return;
  832|  7.40k|        }
  833|       |        /* parse temporal id */
  834|   136k|        ps_nal_prms->i4_temporal_id = ih264d_get_bits_h264(&s_stream_ctxt, 3);
  835|       |
  836|       |        /* parse use ref base pic flag */
  837|   136k|        ps_nal_prms->i4_use_ref_base_pic_flag = ih264d_get_bit_h264(&s_stream_ctxt);
  838|       |
  839|   136k|        if(0 != ps_nal_prms->i4_use_ref_base_pic_flag)
  ------------------
  |  Branch (839:12): [True: 2.25k, False: 133k]
  ------------------
  840|  2.25k|        {
  841|  2.25k|            *pu4_err_code = (UWORD32) NAL_CORRUPT_DATA;
  842|  2.25k|            return;
  843|  2.25k|        }
  844|       |        /* parse discrad flag */
  845|   133k|        ps_nal_prms->i4_discard_flag = ih264d_get_bit_h264(&s_stream_ctxt);
  846|       |
  847|       |        /* parse the reserved bits */
  848|   133k|        ih264d_get_bits_h264(&s_stream_ctxt, 3);
  849|   133k|    }
  850|       |
  851|       |    /* update NAL hedaer length in bytes */
  852|  2.28M|    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.28M|    if(CODED_SLICE_EXTENSION_NAL == ps_nal_prms->i4_nal_unit_type)
  ------------------
  |  |   66|  2.28M|#define CODED_SLICE_EXTENSION_NAL 20
  ------------------
  |  Branch (860:8): [True: 126k, False: 2.15M]
  ------------------
  861|   126k|    {
  862|   126k|        isvcd_nal_buf_reset(ps_prefix_nal_buf);
  863|   126k|    }
  864|       |
  865|  2.28M|    if(SVCD_TRUE == ps_prefix_nal_buf->i4_valid_flag)
  ------------------
  |  |   46|  2.28M|#define SVCD_TRUE 1
  ------------------
  |  Branch (865:8): [True: 4.34k, False: 2.27M]
  ------------------
  866|  4.34k|    {
  867|       |        /* Copy the required parameters from the prefix NAL unit */
  868|  4.34k|        ps_nal_prms->i4_dependency_id = ps_prefix_nal_prms->i4_dependency_id;
  869|  4.34k|        ps_nal_prms->i4_quality_id = ps_prefix_nal_prms->i4_quality_id;
  870|  4.34k|        ps_nal_prms->i4_priority_id = ps_prefix_nal_prms->i4_priority_id;
  871|  4.34k|        ps_nal_prms->i4_temporal_id = ps_prefix_nal_prms->i4_temporal_id;
  872|  4.34k|        ps_nal_prms->i4_no_int_lyr_pred = ps_prefix_nal_prms->i4_no_int_lyr_pred;
  873|  4.34k|        ps_nal_prms->i4_use_ref_base_pic_flag = ps_prefix_nal_prms->i4_use_ref_base_pic_flag;
  874|  4.34k|        ps_nal_prms->i4_discard_flag = ps_prefix_nal_prms->i4_discard_flag;
  875|  4.34k|    }
  876|       |
  877|       |    /*-----------------------------------------------------------------------*/
  878|       |    /* Set the derived NAL unit type and also update the DQID for VCL NAL    */
  879|       |    /*  units                                                                */
  880|       |    /*-----------------------------------------------------------------------*/
  881|  2.28M|    if(CODED_SLICE_EXTENSION_NAL == ps_nal_prms->i4_nal_unit_type ||
  ------------------
  |  |   66|  2.28M|#define CODED_SLICE_EXTENSION_NAL 20
  ------------------
  |  Branch (881:8): [True: 126k, False: 2.15M]
  ------------------
  882|  2.15M|       SLICE_NAL == ps_nal_prms->i4_nal_unit_type ||
  ------------------
  |  |  324|  2.15M|#define SLICE_NAL                       1
  ------------------
  |  Branch (882:8): [True: 139k, False: 2.01M]
  ------------------
  883|  2.01M|       IDR_SLICE_NAL == ps_nal_prms->i4_nal_unit_type ||
  ------------------
  |  |  328|  2.01M|#define IDR_SLICE_NAL                   5
  ------------------
  |  Branch (883:8): [True: 413k, False: 1.60M]
  ------------------
  884|  1.60M|       PREFIX_UNIT_NAL == ps_nal_prms->i4_nal_unit_type)
  ------------------
  |  |   64|  1.60M|#define PREFIX_UNIT_NAL 14
  ------------------
  |  Branch (884:8): [True: 7.32k, False: 1.59M]
  ------------------
  885|   687k|    {
  886|   687k|        ps_nal_prms->i4_derived_nal_type = VCL_NAL;
  887|       |
  888|       |        /* calculate the DQID and modified DQID */
  889|   687k|        ps_nal_prms->i4_dqid = (ps_nal_prms->i4_dependency_id << 4) + ps_nal_prms->i4_quality_id;
  890|   687k|    }
  891|  1.59M|    else
  892|  1.59M|    {
  893|  1.59M|        ps_nal_prms->i4_derived_nal_type = NON_VCL_NAL;
  894|  1.59M|    }
  895|  2.28M|}
isvcd_parse_part_slice_hdr:
  928|   581k|{
  929|   581k|    UWORD32 u4_slice_type;
  930|   581k|    dec_seq_params_t *ps_sps = (dec_seq_params_t *) pv_sps;
  931|   581k|    dec_pic_params_t *ps_pps = (dec_pic_params_t *) pv_pps;
  932|   581k|    dec_bit_stream_t s_stream_ctxt = {0};
  933|   581k|    dec_bit_stream_t *ps_stream_ctxt;
  934|   581k|    UWORD32 *pu4_bitstrm_buf;
  935|   581k|    UWORD32 *pu4_bitstrm_ofst;
  936|       |
  937|   581k|    *pi4_sps_pps_status = NAL_CORRUPT_DATA;
  938|       |    /* Perform the emulation prevention and byte swap */
  939|   581k|    {
  940|   581k|        emulation_prevent_ctxt_t s_emulation_ctxt = {0};
  941|   581k|        WORD32 i4_size, i4_temp;
  942|       |
  943|   581k|        isvcd_reset_emulation_ctxt((void *) &s_emulation_ctxt);
  944|   581k|        i4_size = MIN(i4_input_buf_size, HEADER_BUFFER_LEN_BEFORE_EP);
  ------------------
  |  |   61|   581k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 415k, False: 166k]
  |  |  ------------------
  ------------------
  945|       |
  946|   581k|        isvcd_nal_byte_swap_emulation((UWORD32 *) pu1_temp_buf, (UWORD32 *) &i4_temp, pu1_input_buf,
  947|   581k|                                      (UWORD32) i4_size, NUM_OF_ZERO_BYTES_BEFORE_START_CODE,
  ------------------
  |  |   54|   581k|#define NUM_OF_ZERO_BYTES_BEFORE_START_CODE (2)
  ------------------
  948|   581k|                                      &s_emulation_ctxt);
  949|       |
  950|       |        /* Initialize the stream context structure */
  951|   581k|        s_stream_ctxt.pu4_buffer = (UWORD32 *) pu1_temp_buf;
  952|   581k|        s_stream_ctxt.u4_ofst = 0;
  953|   581k|        s_stream_ctxt.u4_max_ofst = (i4_size << 3);
  954|   581k|    }
  955|       |
  956|   581k|    ps_stream_ctxt = &s_stream_ctxt;
  957|       |
  958|       |    /* Parse the first mb address in slice */
  959|   581k|    pu4_bitstrm_buf = ps_stream_ctxt->pu4_buffer;
  960|   581k|    pu4_bitstrm_ofst = &ps_stream_ctxt->u4_ofst;
  961|   581k|    ps_nal_prms->u4_first_mb_addr = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  962|   581k|    if(ps_nal_prms->u4_first_mb_addr >= (MAX_MBS_LEVEL_51))
  ------------------
  |  |  307|   581k|#define MAX_MBS_LEVEL_51 36864
  ------------------
  |  Branch (962:8): [True: 19.3k, False: 561k]
  ------------------
  963|  19.3k|    {
  964|  19.3k|        return ERROR_CORRUPTED_SLICE;
  965|  19.3k|    }
  966|       |    /* Parse slice type */
  967|   561k|    u4_slice_type = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  968|       |
  969|   561k|    if(u4_slice_type > 9) return ERROR_INV_SLC_TYPE_T;
  ------------------
  |  Branch (969:8): [True: 29.3k, False: 532k]
  ------------------
  970|       |
  971|       |    /* Check the validity of slice prms */
  972|   532k|    switch(u4_slice_type)
  973|   532k|    {
  974|   305k|        case 0:
  ------------------
  |  Branch (974:9): [True: 305k, False: 226k]
  ------------------
  975|   327k|        case 5:
  ------------------
  |  Branch (975:9): [True: 21.1k, False: 511k]
  ------------------
  976|   327k|            u4_slice_type = P_SLICE;
  ------------------
  |  |  368|   327k|#define P_SLICE  0
  ------------------
  977|       |            /* P slice */
  978|   327k|            break;
  979|   132k|        case 1:
  ------------------
  |  Branch (979:9): [True: 132k, False: 399k]
  ------------------
  980|   140k|        case 6:
  ------------------
  |  Branch (980:9): [True: 7.66k, False: 524k]
  ------------------
  981|   140k|            u4_slice_type = B_SLICE;
  ------------------
  |  |  369|   140k|#define B_SLICE  1
  ------------------
  982|       |            /* B slice */
  983|   140k|            break;
  984|  40.8k|        case 2:
  ------------------
  |  Branch (984:9): [True: 40.8k, False: 491k]
  ------------------
  985|  48.5k|        case 7:
  ------------------
  |  Branch (985:9): [True: 7.69k, False: 524k]
  ------------------
  986|       |            /* I slice */
  987|  48.5k|            u4_slice_type = I_SLICE;
  ------------------
  |  |  370|  48.5k|#define I_SLICE  2
  ------------------
  988|  48.5k|            break;
  989|  16.3k|        default:
  ------------------
  |  Branch (989:9): [True: 16.3k, False: 516k]
  ------------------
  990|  16.3k|            break;
  991|   532k|    }
  992|       |
  993|       |    /* Parse the pps id */
  994|   532k|    ps_nal_prms->u1_pps_id = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  995|   532k|    if(ps_nal_prms->u1_pps_id & MASK_ERR_PIC_SET_ID) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  |  527|   532k|#define MASK_ERR_PIC_SET_ID   (0xFFFFFF00)
  ------------------
  |  Branch (995:8): [True: 0, False: 532k]
  ------------------
  996|       |
  997|       |    /* validate pps id */
  998|   532k|    ps_pps += ps_nal_prms->u1_pps_id;
  999|   532k|    if(0 == ps_pps->u1_is_valid)
  ------------------
  |  Branch (999:8): [True: 65.3k, False: 467k]
  ------------------
 1000|  65.3k|    {
 1001|  65.3k|        return NOT_OK;
  ------------------
  |  |  116|  65.3k|#define NOT_OK    -1
  ------------------
 1002|  65.3k|    }
 1003|       |    /* Derive sps id */
 1004|   467k|    ps_sps = ps_pps->ps_sps;
 1005|       |
 1006|   467k|    ps_nal_prms->u1_sps_id = ps_sps->u1_seq_parameter_set_id;
 1007|   467k|    if(CODED_SLICE_EXTENSION_NAL == ps_nal_prms->i4_nal_unit_type)
  ------------------
  |  |   66|   467k|#define CODED_SLICE_EXTENSION_NAL 20
  ------------------
  |  Branch (1007:8): [True: 93.3k, False: 373k]
  ------------------
 1008|  93.3k|    {
 1009|  93.3k|        ps_sps += MAX_NUM_SEQ_PARAMS;
  ------------------
  |  |  521|  93.3k|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
 1010|  93.3k|        ps_nal_prms->u1_sps_id = ps_sps->u1_seq_parameter_set_id;
 1011|  93.3k|        ps_nal_prms->u1_sps_id += MAX_NUM_SEQ_PARAMS;
  ------------------
  |  |  521|  93.3k|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
 1012|  93.3k|    }
 1013|       |
 1014|   467k|    if(NULL == ps_sps)
  ------------------
  |  Branch (1014:8): [True: 0, False: 467k]
  ------------------
 1015|      0|    {
 1016|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 1017|      0|    }
 1018|   467k|    if(FALSE == ps_sps->u1_is_valid)
  ------------------
  |  |  592|   467k|#define FALSE   0
  ------------------
  |  Branch (1018:8): [True: 7.70k, False: 459k]
  ------------------
 1019|  7.70k|    {
 1020|  7.70k|        return ERROR_INV_SLICE_HDR_T;
 1021|  7.70k|    }
 1022|   459k|    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: 29.5k, False: 429k]
  ------------------
 1023|  29.5k|    {
 1024|  29.5k|        return ERROR_CORRUPTED_SLICE;
 1025|  29.5k|    }
 1026|   429k|    *pi4_sps_pps_status = 0;
 1027|       |
 1028|       |    /* Parse frame number */
 1029|   429k|    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|   429k|    if(SVCD_TRUE == ps_nal_prms->i4_idr_pic_flag)
  ------------------
  |  |   46|   429k|#define SVCD_TRUE 1
  ------------------
  |  Branch (1032:8): [True: 340k, False: 89.4k]
  ------------------
 1033|   340k|    {
 1034|   340k|        ps_nal_prms->i4_idr_pic_num = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1035|       |
 1036|   340k|        if(ps_nal_prms->i4_idr_pic_num > 65535) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (1036:12): [True: 8.24k, False: 332k]
  ------------------
 1037|   340k|    }
 1038|       |
 1039|       |    /* Poc lsb */
 1040|   421k|    if(0 == ps_sps->u1_pic_order_cnt_type)
  ------------------
  |  Branch (1040:8): [True: 327k, False: 94.2k]
  ------------------
 1041|   327k|    {
 1042|   327k|        ps_nal_prms->i4_poc_lsb =
 1043|   327k|            ih264d_get_bits_h264(ps_stream_ctxt, ps_sps->u1_log2_max_pic_order_cnt_lsb_minus);
 1044|       |
 1045|   327k|        if(ps_nal_prms->i4_poc_lsb < 0 ||
  ------------------
  |  Branch (1045:12): [True: 0, False: 327k]
  ------------------
 1046|   327k|           ps_nal_prms->i4_poc_lsb >= ps_sps->i4_max_pic_order_cntLsb)
  ------------------
  |  Branch (1046:12): [True: 0, False: 327k]
  ------------------
 1047|      0|            return ERROR_INV_SLICE_HDR_T;
 1048|   327k|        if(SVCD_TRUE == ps_pps->u1_pic_order_present_flag)
  ------------------
  |  |   46|   327k|#define SVCD_TRUE 1
  ------------------
  |  Branch (1048:12): [True: 127k, False: 200k]
  ------------------
 1049|   127k|        {
 1050|   127k|            ps_nal_prms->i4_delta_poc_bot = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1051|   127k|        }
 1052|   327k|    }
 1053|  94.2k|    else if((1 == ps_sps->u1_pic_order_cnt_type) && (!ps_sps->u1_delta_pic_order_always_zero_flag))
  ------------------
  |  Branch (1053:13): [True: 83.1k, False: 11.1k]
  |  Branch (1053:53): [True: 75.3k, False: 7.73k]
  ------------------
 1054|  75.3k|    {
 1055|  75.3k|        ps_nal_prms->ai4_delta_poc[0] = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1056|       |
 1057|  75.3k|        if(SVCD_TRUE == ps_pps->u1_pic_order_present_flag)
  ------------------
  |  |   46|  75.3k|#define SVCD_TRUE 1
  ------------------
  |  Branch (1057:12): [True: 65.9k, False: 9.38k]
  ------------------
 1058|  65.9k|        {
 1059|  65.9k|            ps_nal_prms->ai4_delta_poc[1] = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1060|  65.9k|        }
 1061|  75.3k|    }
 1062|       |
 1063|   421k|    *pu4_err_code = 0;
 1064|   421k|    return (OK);
  ------------------
  |  |  114|   421k|#define OK        0
  ------------------
 1065|   421k|}
isvcd_get_int_tgt_lyr_attr:
 1093|  1.40M|{
 1094|  1.40M|    WORD32 i4_dep_id;
 1095|  1.40M|    WORD32 i4_quality_id;
 1096|  1.40M|    WORD32 i4_temp_id;
 1097|  1.40M|    WORD32 i4_prior_id;
 1098|       |
 1099|       |    /* sanity checks */
 1100|  1.40M|    if((NULL == ps_app_attr) || (NULL == ps_int_attr) || (NULL == ps_nal_prms))
  ------------------
  |  Branch (1100:8): [True: 0, False: 1.40M]
  |  Branch (1100:33): [True: 0, False: 1.40M]
  |  Branch (1100:58): [True: 0, False: 1.40M]
  ------------------
 1101|      0|    {
 1102|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 1103|      0|    }
 1104|       |
 1105|  1.40M|    i4_dep_id = ps_int_attr->i4_dependency_id;
 1106|  1.40M|    i4_quality_id = ps_int_attr->i4_quality_id;
 1107|  1.40M|    i4_temp_id = ps_int_attr->i4_temporal_id;
 1108|  1.40M|    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.40M|    if(SVCD_TRUE == ps_nal_prms->i4_idr_pic_flag)
  ------------------
  |  |   46|  1.40M|#define SVCD_TRUE 1
  ------------------
  |  Branch (1112:8): [True: 326k, False: 1.07M]
  ------------------
 1113|   326k|    {
 1114|   326k|        if(ps_int_attr->i4_dependency_id < ps_app_attr->i4_dependency_id)
  ------------------
  |  Branch (1114:12): [True: 95.9k, False: 230k]
  ------------------
 1115|  95.9k|        {
 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|  95.9k|            if((ps_nal_prms->i4_dependency_id - 1 == ps_int_attr->i4_dependency_id) &&
  ------------------
  |  Branch (1119:16): [True: 26.6k, False: 69.3k]
  ------------------
 1120|  26.6k|               (0 == ps_nal_prms->i4_quality_id))
  ------------------
  |  Branch (1120:16): [True: 26.6k, False: 0]
  ------------------
 1121|  26.6k|            {
 1122|       |                /* Set revised target dependency id */
 1123|  26.6k|                i4_dep_id = ps_nal_prms->i4_dependency_id;
 1124|  26.6k|                i4_temp_id = ps_app_attr->i4_temporal_id;
 1125|  26.6k|                i4_prior_id = ps_app_attr->i4_priority_id;
 1126|  26.6k|            }
 1127|  95.9k|        }
 1128|   230k|        else
 1129|   230k|        {
 1130|       |            /* cases when the curr dep is greater than or equal to app dep */
 1131|   230k|            i4_dep_id = ps_app_attr->i4_dependency_id;
 1132|   230k|            i4_temp_id = ps_app_attr->i4_temporal_id;
 1133|   230k|            i4_prior_id = ps_app_attr->i4_priority_id;
 1134|   230k|        }
 1135|   326k|    }
 1136|       |
 1137|       |    /* Set quality id */
 1138|  1.40M|    if(i4_dep_id == ps_app_attr->i4_dependency_id)
  ------------------
  |  Branch (1138:8): [True: 1.20M, False: 196k]
  ------------------
 1139|  1.20M|    {
 1140|  1.20M|        i4_quality_id = ps_app_attr->i4_quality_id;
 1141|  1.20M|    }
 1142|   196k|    else
 1143|   196k|    {
 1144|   196k|        i4_quality_id = MAX_QUALITY_ID;
  ------------------
  |  |  102|   196k|#define MAX_QUALITY_ID 0
  ------------------
 1145|   196k|    }
 1146|       |
 1147|       |    /* Update the internal attributes */
 1148|  1.40M|    ps_int_attr->i4_dependency_id = i4_dep_id;
 1149|  1.40M|    ps_int_attr->i4_quality_id = i4_quality_id;
 1150|  1.40M|    ps_int_attr->i4_temporal_id = i4_temp_id;
 1151|  1.40M|    ps_int_attr->i4_priority_id = i4_prior_id;
 1152|       |
 1153|  1.40M|    return (OK);
  ------------------
  |  |  114|  1.40M|#define OK        0
  ------------------
 1154|  1.40M|}
isvcd_discard_nal:
 1188|  2.28M|{
 1189|  2.28M|    WORD32 i4_discard_nal_flag;
 1190|  2.28M|    nal_prms_t *ps_nal_prms;
 1191|  2.28M|    target_lyr_attr_t *ps_app_attr;
 1192|  2.28M|    target_lyr_attr_t *ps_int_attr;
 1193|  2.28M|    WORD32 i4_status;
 1194|       |
 1195|  2.28M|    ps_nal_prms = (nal_prms_t *) pv_nal_prms;
 1196|  2.28M|    ps_app_attr = (target_lyr_attr_t *) pv_app_attr;
 1197|  2.28M|    ps_int_attr = (target_lyr_attr_t *) pv_int_attr;
 1198|       |
 1199|       |    /* Get the updated target layer attributes */
 1200|  2.28M|    if(SVCD_TRUE == i4_update_flag)
  ------------------
  |  |   46|  2.28M|#define SVCD_TRUE 1
  ------------------
  |  Branch (1200:8): [True: 1.40M, False: 879k]
  ------------------
 1201|  1.40M|    {
 1202|  1.40M|        i4_status = isvcd_get_int_tgt_lyr_attr(ps_app_attr, ps_int_attr, ps_nal_prms);
 1203|  1.40M|        if(OK != i4_status)
  ------------------
  |  |  114|  1.40M|#define OK        0
  ------------------
  |  Branch (1203:12): [True: 0, False: 1.40M]
  ------------------
 1204|      0|        {
 1205|      0|            return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 1206|      0|        }
 1207|  1.40M|    }
 1208|       |
 1209|  2.28M|    i4_discard_nal_flag = SVCD_FALSE;
  ------------------
  |  |   45|  2.28M|#define SVCD_FALSE 0
  ------------------
 1210|       |
 1211|  2.28M|    if(VCL_NAL == ps_nal_prms->i4_derived_nal_type)
  ------------------
  |  Branch (1211:8): [True: 687k, False: 1.59M]
  ------------------
 1212|   687k|    {
 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|   687k|        if(PREFIX_UNIT_NAL != ps_nal_prms->i4_nal_unit_type)
  ------------------
  |  |   64|   687k|#define PREFIX_UNIT_NAL 14
  ------------------
  |  Branch (1223:12): [True: 680k, False: 7.32k]
  ------------------
 1224|   680k|        {
 1225|   680k|            if(ps_nal_prms->i4_dependency_id > ps_int_attr->i4_dependency_id)
  ------------------
  |  Branch (1225:16): [True: 98.8k, False: 581k]
  ------------------
 1226|  98.8k|            {
 1227|  98.8k|                i4_discard_nal_flag = SVCD_TRUE;
  ------------------
  |  |   46|  98.8k|#define SVCD_TRUE 1
  ------------------
 1228|  98.8k|            }
 1229|       |
 1230|   680k|            if(ps_nal_prms->i4_dependency_id == ps_int_attr->i4_dependency_id &&
  ------------------
  |  Branch (1230:16): [True: 375k, False: 304k]
  ------------------
 1231|   375k|               ps_nal_prms->i4_quality_id > ps_int_attr->i4_quality_id)
  ------------------
  |  Branch (1231:16): [True: 0, False: 375k]
  ------------------
 1232|      0|            {
 1233|      0|                i4_discard_nal_flag = SVCD_TRUE;
  ------------------
  |  |   46|      0|#define SVCD_TRUE 1
  ------------------
 1234|      0|            }
 1235|       |
 1236|   680k|            if(ps_nal_prms->i4_temporal_id > ps_int_attr->i4_temporal_id)
  ------------------
  |  Branch (1236:16): [True: 2.25k, False: 677k]
  ------------------
 1237|  2.25k|            {
 1238|  2.25k|                i4_discard_nal_flag = SVCD_TRUE;
  ------------------
  |  |   46|  2.25k|#define SVCD_TRUE 1
  ------------------
 1239|  2.25k|            }
 1240|       |
 1241|   680k|            if(ps_nal_prms->i4_priority_id > ps_int_attr->i4_priority_id)
  ------------------
  |  Branch (1241:16): [True: 0, False: 680k]
  ------------------
 1242|      0|            {
 1243|      0|                i4_discard_nal_flag = SVCD_TRUE;
  ------------------
  |  |   46|      0|#define SVCD_TRUE 1
  ------------------
 1244|      0|            }
 1245|   680k|        }
 1246|  7.32k|        else
 1247|  7.32k|        {
 1248|  7.32k|            if(0 == ps_int_attr->i4_quality_id && 0 == ps_int_attr->i4_dependency_id)
  ------------------
  |  Branch (1248:16): [True: 7.32k, False: 0]
  |  Branch (1248:51): [True: 2.12k, False: 5.19k]
  ------------------
 1249|  2.12k|            {
 1250|  2.12k|                i4_discard_nal_flag = SVCD_TRUE;
  ------------------
  |  |   46|  2.12k|#define SVCD_TRUE 1
  ------------------
 1251|  2.12k|            }
 1252|  7.32k|        }
 1253|   687k|    }
 1254|       |
 1255|  2.28M|    return (i4_discard_nal_flag);
 1256|  2.28M|}

isvcd_get_nal_buf:
  108|  1.85M|{
  109|  1.85M|    nal_prms_t *ps_nal_prms;
  110|  1.85M|    nal_buf_t *ps_nal_buf;
  111|       |
  112|  1.85M|    ps_nal_prms = &ps_nal_parse_ctxt->s_nal_prms;
  113|       |
  114|       |    /* Get the NAL buffer structure */
  115|  1.85M|    if(PREFIX_UNIT_NAL == ps_nal_prms->i4_nal_unit_type)
  ------------------
  |  |   64|  1.85M|#define PREFIX_UNIT_NAL 14
  ------------------
  |  Branch (115:8): [True: 4.65k, False: 1.84M]
  ------------------
  116|  4.65k|    {
  117|  4.65k|        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|  4.65k|        isvcd_nal_buf_reset(ps_nal_buf);
  124|  4.65k|    }
  125|  1.84M|    else
  126|  1.84M|    {
  127|  1.84M|        ps_nal_buf = &ps_nal_parse_ctxt->s_nal_buf;
  128|  1.84M|    }
  129|       |
  130|       |    /* Initialize the buffer structure */
  131|  1.85M|    ps_nal_buf->i4_valid_flag = SVCD_TRUE;
  ------------------
  |  |   46|  1.85M|#define SVCD_TRUE 1
  ------------------
  132|  1.85M|    if(VCL_NAL == ps_nal_prms->i4_derived_nal_type)
  ------------------
  |  Branch (132:8): [True: 266k, False: 1.58M]
  ------------------
  133|   266k|    {
  134|   266k|        ps_nal_buf->pu1_buf = ps_nal_parse_ctxt->pu1_vcl_nal_buf;
  135|   266k|    }
  136|  1.58M|    else if(NON_VCL_NAL == ps_nal_prms->i4_derived_nal_type)
  ------------------
  |  Branch (136:13): [True: 1.57M, False: 13.4k]
  ------------------
  137|  1.57M|    {
  138|  1.57M|        ps_nal_buf->pu1_buf = ps_nal_parse_ctxt->pu1_non_vcl_nal_buf;
  139|  1.57M|    }
  140|  13.4k|    else
  141|  13.4k|    {
  142|  13.4k|        ps_nal_buf->pu1_buf = NULL;
  143|  13.4k|        return;
  144|  13.4k|    }
  145|       |
  146|  1.83M|    *pps_nal_buf = ps_nal_buf;
  147|  1.83M|}
isvcd_dqid_ctxt_reset:
  172|   290k|{
  173|   290k|    WORD32 i4_lyr_idx;
  174|   290k|    WORD32 i4_max_num_lyrs;
  175|   290k|    dqid_node_t *ps_dqid_node;
  176|       |
  177|       |    /* sanity checks */
  178|   290k|    if(NULL == ps_dqid_ctxt)
  ------------------
  |  Branch (178:8): [True: 0, False: 290k]
  ------------------
  179|      0|    {
  180|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  181|      0|    }
  182|       |
  183|   290k|    i4_max_num_lyrs = ps_dqid_ctxt->i4_max_num_lyrs;
  184|   290k|    ps_dqid_node = ps_dqid_ctxt->ps_dqid_node;
  185|       |
  186|       |    /* Loop over all the layers */
  187|  1.16M|    for(i4_lyr_idx = 0; i4_lyr_idx < i4_max_num_lyrs; i4_lyr_idx++)
  ------------------
  |  Branch (187:25): [True: 872k, False: 290k]
  ------------------
  188|   872k|    {
  189|       |        /* Reset the valid flag */
  190|   872k|        ps_dqid_node->u1_valid_flag = SVCD_FALSE;
  ------------------
  |  |   45|   872k|#define SVCD_FALSE 0
  ------------------
  191|       |
  192|       |        /* Loop updates */
  193|   872k|        ps_dqid_node += 1;
  194|   872k|    } /* loop over all the layers */
  195|       |
  196|   290k|    return (OK);
  ------------------
  |  |  114|   290k|#define OK        0
  ------------------
  197|   290k|}
isvcd_get_dqid_node:
  226|   945k|{
  227|   945k|    WORD32 i4_lyr_idx;
  228|   945k|    WORD32 i4_max_num_lyrs;
  229|   945k|    dqid_node_t *ps_dqid_node;
  230|   945k|    dqid_node_t *ps_rqrd_dqid_node;
  231|       |
  232|       |    /* sanity checks */
  233|   945k|    if((NULL == ps_dqid_ctxt) || (NULL == pps_dqid_node))
  ------------------
  |  Branch (233:8): [True: 0, False: 945k]
  |  Branch (233:34): [True: 0, False: 945k]
  ------------------
  234|      0|    {
  235|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  236|      0|    }
  237|       |
  238|   945k|    i4_max_num_lyrs = ps_dqid_ctxt->i4_max_num_lyrs;
  239|   945k|    ps_dqid_node = ps_dqid_ctxt->ps_dqid_node;
  240|       |
  241|       |    /*Initialization */
  242|   945k|    ps_rqrd_dqid_node = NULL;
  243|       |
  244|       |    /* Loop over all the buffer nodes */
  245|  2.19M|    for(i4_lyr_idx = 0; i4_lyr_idx < i4_max_num_lyrs; i4_lyr_idx++)
  ------------------
  |  Branch (245:25): [True: 1.79M, False: 392k]
  ------------------
  246|  1.79M|    {
  247|  1.79M|        if((SVCD_TRUE == ps_dqid_node->u1_valid_flag) && (u1_dqid == ps_dqid_node->u1_dqid))
  ------------------
  |  |   46|  1.79M|#define SVCD_TRUE 1
  ------------------
  |  Branch (247:12): [True: 697k, False: 1.10M]
  |  Branch (247:58): [True: 553k, False: 143k]
  ------------------
  248|   553k|        {
  249|   553k|            ps_rqrd_dqid_node = ps_dqid_node;
  250|   553k|            break;
  251|   553k|        }
  252|       |        /* Loop updates */
  253|  1.24M|        ps_dqid_node += 1;
  254|  1.24M|    } /* Loop over all the buffer nodes */
  255|       |
  256|   945k|    if(NULL == ps_rqrd_dqid_node)
  ------------------
  |  Branch (256:8): [True: 392k, False: 553k]
  ------------------
  257|   392k|    {
  258|       |        /* If vcl node is not allocated for the requested DQID then allocate buffer */
  259|   392k|        ps_dqid_node = ps_dqid_ctxt->ps_dqid_node;
  260|   465k|        for(i4_lyr_idx = 0; i4_lyr_idx < i4_max_num_lyrs; i4_lyr_idx++)
  ------------------
  |  Branch (260:29): [True: 465k, False: 0]
  ------------------
  261|   465k|        {
  262|   465k|            if(SVCD_FALSE == ps_dqid_node->u1_valid_flag)
  ------------------
  |  |   45|   465k|#define SVCD_FALSE 0
  ------------------
  |  Branch (262:16): [True: 392k, False: 73.9k]
  ------------------
  263|   392k|            {
  264|   392k|                break;
  265|   392k|            }
  266|       |            /* Loop updates */
  267|  73.9k|            ps_dqid_node += 1;
  268|  73.9k|        } /* Loop over all the nodes */
  269|       |        /* Update the node structure */
  270|   392k|        ps_rqrd_dqid_node = ps_dqid_node;
  271|   392k|    }
  272|       |
  273|       |    /* sanity checks */
  274|   945k|    if(NULL == ps_rqrd_dqid_node)
  ------------------
  |  Branch (274:8): [True: 0, False: 945k]
  ------------------
  275|      0|    {
  276|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  277|      0|    }
  278|   945k|    *pps_dqid_node = ps_rqrd_dqid_node;
  279|       |
  280|   945k|    return (OK);
  ------------------
  |  |  114|   945k|#define OK        0
  ------------------
  281|   945k|}
isvcd_nal_reset_ctxt:
  307|  2.17M|{
  308|  2.17M|    nal_unit_t *ps_nal_unit;
  309|       |
  310|  2.17M|    if(NULL == ps_nal_parse_ctxt)
  ------------------
  |  Branch (310:8): [True: 0, False: 2.17M]
  ------------------
  311|      0|    {
  312|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  313|      0|    }
  314|       |
  315|       |    /* Reset the NAL boundary detetction */
  316|  2.17M|    ps_nal_parse_ctxt->i4_find_nal_state = NAL_START;
  317|  2.17M|    ps_nal_parse_ctxt->i4_zero_byte_cnt = 0;
  318|  2.17M|    ps_nal_unit = ps_nal_parse_ctxt->pv_nal_unit;
  319|  2.17M|    ps_nal_unit->i4_num_bufs = 0;
  320|       |
  321|       |    /*Reset emulation prevention */
  322|  2.17M|    isvcd_reset_emulation_ctxt(&ps_nal_parse_ctxt->s_emulation_ctxt);
  323|       |
  324|       |    /*Reset the NAL header prms */
  325|  2.17M|    isvcd_set_default_nal_prms(&ps_nal_parse_ctxt->s_nal_prms);
  326|       |
  327|       |    /* Reset other NAL level tracking variables */
  328|  2.17M|    ps_nal_parse_ctxt->i4_discard_nal_flag = SVCD_FALSE;
  ------------------
  |  |   45|  2.17M|#define SVCD_FALSE 0
  ------------------
  329|       |
  330|       |    /*Reset NAL buffer structure*/
  331|  2.17M|    isvcd_nal_buf_reset(&ps_nal_parse_ctxt->s_nal_buf);
  332|       |
  333|  2.17M|    return (OK);
  ------------------
  |  |  114|  2.17M|#define OK        0
  ------------------
  334|  2.17M|}
isvcd_pic_reset_ctxt:
  361|   290k|{
  362|   290k|    WORD32 i4_status;
  363|       |
  364|       |    /*-----------------------------------------------------------------------*/
  365|       |    /*! Reset NAL boundary detetction logic                                  */
  366|       |    /*-----------------------------------------------------------------------*/
  367|   290k|    i4_status = isvcd_nal_reset_ctxt(ps_nal_parse_ctxt);
  368|       |
  369|   290k|    UNUSED(i4_status);
  ------------------
  |  |   45|   290k|#define UNUSED(x) ((void)(x))
  ------------------
  370|       |
  371|       |    /*-----------------------------------------------------------------------*/
  372|       |    /*! Reset picture boundary detctetion logic                              */
  373|       |    /*-----------------------------------------------------------------------*/
  374|   290k|    ps_nal_parse_ctxt->i4_is_frst_vcl_nal_in_au = SVCD_TRUE;
  ------------------
  |  |   46|   290k|#define SVCD_TRUE 1
  ------------------
  375|       |
  376|       |    /*-----------------------------------------------------------------------*/
  377|       |    /*! Reset VCL and non VCL NAL buffer tracking variables                  */
  378|       |    /*-----------------------------------------------------------------------*/
  379|   290k|    ps_nal_parse_ctxt->pu1_non_vcl_nal_buf = ps_nal_parse_ctxt->pv_non_vcl_nal_buf;
  380|   290k|    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|   290k|    ps_nal_parse_ctxt->u4_bytes_left_vcl = MAX_VCL_NAL_BUFF_SIZE;
  ------------------
  |  |   69|   290k|#define MAX_VCL_NAL_BUFF_SIZE (1024 * 1024 * 2)
  ------------------
  384|       |
  385|   290k|    ps_nal_parse_ctxt->u4_bytes_left_non_vcl = MAX_NON_VCL_NAL_BUFF_SIZE;
  ------------------
  |  |   70|   290k|#define MAX_NON_VCL_NAL_BUFF_SIZE (1024 * 1024 * 2)
  ------------------
  386|       |
  387|       |    /* Offset the buffer to start of vcl data */
  388|   290k|    UPDATE_NAL_BUF_PTR(&ps_nal_parse_ctxt->pu1_non_vcl_nal_buf, NON_VCL_NAL,
  389|   290k|                       &ps_nal_parse_ctxt->u4_bytes_left_non_vcl);
  390|       |
  391|   290k|    UPDATE_NAL_BUF_PTR(&ps_nal_parse_ctxt->pu1_vcl_nal_buf, VCL_NAL,
  392|   290k|                       &ps_nal_parse_ctxt->u4_bytes_left_vcl);
  393|       |
  394|       |    /* Reset previous field */
  395|   290k|    ps_nal_parse_ctxt->ps_prev_non_vcl_buf = NULL;
  396|   290k|    ps_nal_parse_ctxt->i4_idr_pic_err_flag = 0;
  397|       |
  398|       |    /*-----------------------------------------------------------------------*/
  399|       |    /*! Reset other NAL related tracking variables                           */
  400|       |    /*-----------------------------------------------------------------------*/
  401|   290k|    ps_nal_parse_ctxt->i4_num_non_vcl_nals = 0;
  402|       |
  403|       |    /* Reset the vcl nal node buffer context */
  404|   290k|    i4_status = isvcd_dqid_ctxt_reset(&ps_nal_parse_ctxt->s_dqid_ctxt);
  405|       |
  406|       |    /* Reset target layer update flag */
  407|   290k|    ps_nal_parse_ctxt->i4_tgt_lyr_update = SVCD_TRUE;
  ------------------
  |  |   46|   290k|#define SVCD_TRUE 1
  ------------------
  408|   290k|}
isvcd_get_nal_prms:
  443|  2.34M|{
  444|  2.34M|    UWORD8 *pu1_input_buf;
  445|  2.34M|    WORD32 i4_status;
  446|  2.34M|    dec_seq_params_t *ps_sps;
  447|  2.34M|    dec_pic_params_t *ps_pps;
  448|       |
  449|  2.34M|    ps_sps = ps_nal_parse_ctxt->pv_seq_prms;
  450|  2.34M|    ps_pps = ps_nal_parse_ctxt->pv_pic_prms;
  451|       |
  452|  2.34M|    *pu4_err_code = 0;
  453|  2.34M|    *pi4_sps_pps_status = NAL_CORRUPT_DATA;
  454|       |
  455|       |    /* Decode the NAL header */
  456|  2.34M|    isvcd_dec_nal_hdr(pu1_buf, i4_buf_size, ps_nal_parse_ctxt->pv_nal_header_buf, ps_nal_prms,
  457|  2.34M|                      ps_prefix_nal_buf, ps_prefix_nal_prms, pu4_err_code);
  458|       |
  459|       |    /* If encountered with error return fail */
  460|  2.34M|    if(0 != *pu4_err_code)
  ------------------
  |  Branch (460:8): [True: 53.2k, False: 2.29M]
  ------------------
  461|  53.2k|    {
  462|  53.2k|        return (NOT_OK);
  ------------------
  |  |  116|  53.2k|#define NOT_OK    -1
  ------------------
  463|  53.2k|    }
  464|       |
  465|  2.29M|    if(ACCESS_UNIT_DELIMITER_RBSP == ps_nal_prms->i4_nal_unit_type)
  ------------------
  |  |  332|  2.29M|#define ACCESS_UNIT_DELIMITER_RBSP      9
  ------------------
  |  Branch (465:8): [True: 11.6k, False: 2.28M]
  ------------------
  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.28M|    *pi4_nal_discard_flag = isvcd_discard_nal(
  473|  2.28M|        (void *) ps_nal_prms, (void *) &ps_nal_parse_ctxt->s_app_attr,
  474|  2.28M|        (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.28M|    if((NON_VCL_NAL == ps_nal_prms->i4_derived_nal_type) ||
  ------------------
  |  Branch (481:8): [True: 1.59M, False: 687k]
  ------------------
  482|   687k|       (PREFIX_UNIT_NAL == ps_nal_prms->i4_nal_unit_type) || (SVCD_TRUE == *pi4_nal_discard_flag))
  ------------------
  |  |   64|   687k|#define PREFIX_UNIT_NAL 14
  ------------------
                     (PREFIX_UNIT_NAL == ps_nal_prms->i4_nal_unit_type) || (SVCD_TRUE == *pi4_nal_discard_flag))
  ------------------
  |  |   46|   680k|#define SVCD_TRUE 1
  ------------------
  |  Branch (482:8): [True: 7.32k, False: 680k]
  |  Branch (482:62): [True: 98.8k, False: 581k]
  ------------------
  483|  1.70M|    {
  484|  1.70M|        return (OK);
  ------------------
  |  |  114|  1.70M|#define OK        0
  ------------------
  485|  1.70M|    }
  486|       |
  487|   581k|    pu1_input_buf = pu1_buf;
  488|   581k|    pu1_input_buf += ps_nal_prms->i4_nal_header_len;
  489|   581k|    i4_buf_size -= ps_nal_prms->i4_nal_header_len;
  490|       |
  491|   581k|    i4_status =
  492|   581k|        isvcd_parse_part_slice_hdr(pu1_input_buf, i4_buf_size, ps_nal_parse_ctxt->pv_nal_header_buf,
  493|   581k|                                   ps_sps, ps_pps, ps_nal_prms, pu4_err_code, pi4_sps_pps_status);
  494|       |
  495|   581k|    return (i4_status);
  496|  2.28M|}
isvcd_compare_nal_prms:
  534|   501k|{
  535|   501k|    dqid_node_t *ps_dqid_node;
  536|   501k|    vcl_node_t *ps_vcl_node;
  537|   501k|    WORD32 i4_status;
  538|       |
  539|       |    /* If DQID is lesser than the DQID of the previous */
  540|       |    /* NAL then declare the picture boundary           */
  541|   501k|    *pi4_pic_bound_type = PIC_BOUND_DQID;
  542|   501k|    if(i4_prev_dqid > ps_nal_prms->i4_dqid)
  ------------------
  |  Branch (542:8): [True: 48.7k, False: 452k]
  ------------------
  543|  48.7k|    {
  544|  48.7k|        *pi4_pic_bound_status = PIC_BOUNDARY_TRUE;
  545|  48.7k|        return (OK);
  ------------------
  |  |  114|  48.7k|#define OK        0
  ------------------
  546|  48.7k|    }
  547|       |
  548|       |    /* Perform the picture boundary detection only for */
  549|       |    /* the layers with quality id equal to 0           */
  550|   452k|    if((FIRST_PASS == i4_pass) && (0 != (ps_nal_prms->i4_dqid & 0x0F)))
  ------------------
  |  |   61|   452k|#define FIRST_PASS 0
  ------------------
  |  Branch (550:8): [True: 320k, False: 132k]
  |  Branch (550:35): [True: 0, False: 320k]
  ------------------
  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|   452k|    i4_status =
  558|   452k|        isvcd_get_dqid_node(&ps_nal_parse_ctxt->s_dqid_ctxt, (UWORD8) i4_prev_dqid, &ps_dqid_node);
  559|   452k|    if((OK != i4_status) || (NULL == ps_dqid_node))
  ------------------
  |  |  114|   452k|#define OK        0
  ------------------
  |  Branch (559:8): [True: 0, False: 452k]
  |  Branch (559:29): [True: 0, False: 452k]
  ------------------
  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|   452k|    if(SVCD_FALSE == ps_dqid_node->u1_valid_flag)
  ------------------
  |  |   45|   452k|#define SVCD_FALSE 0
  ------------------
  |  Branch (565:8): [True: 157k, False: 295k]
  ------------------
  566|   157k|    {
  567|   157k|        *pi4_pic_bound_status = PIC_BOUNDARY_FALSE;
  568|   157k|        return (OK);
  ------------------
  |  |  114|   157k|#define OK        0
  ------------------
  569|   157k|    }
  570|       |
  571|   295k|    *pi4_pic_bound_type = PIC_BOUND_SLICE_PRMS;
  572|   295k|    *pi4_pic_bound_status = PIC_BOUNDARY_TRUE;
  573|   295k|    ps_vcl_node = ps_dqid_node->ps_vcl_node;
  574|       |
  575|       |    /* Compare NAL ref idc */
  576|   295k|    {
  577|   295k|        WORD32 i4_prev_ref_pic_flag;
  578|   295k|        WORD32 i4_cur_ref_pic_flag;
  579|       |
  580|   295k|        i4_prev_ref_pic_flag = (0 != ps_vcl_node->i4_nal_ref_idc);
  581|   295k|        i4_cur_ref_pic_flag = (0 != ps_nal_prms->i4_nal_ref_idc);
  582|       |
  583|   295k|        if(i4_prev_ref_pic_flag != i4_cur_ref_pic_flag)
  ------------------
  |  Branch (583:12): [True: 40.8k, False: 254k]
  ------------------
  584|  40.8k|        {
  585|  40.8k|            return (OK);
  ------------------
  |  |  114|  40.8k|#define OK        0
  ------------------
  586|  40.8k|        }
  587|   295k|    }
  588|       |
  589|       |    /* Compare IDR picture flag */
  590|   254k|    if(ps_vcl_node->i4_idr_pic_flag != ps_nal_prms->i4_idr_pic_flag)
  ------------------
  |  Branch (590:8): [True: 24.8k, False: 229k]
  ------------------
  591|  24.8k|    {
  592|  24.8k|        return (OK);
  ------------------
  |  |  114|  24.8k|#define OK        0
  ------------------
  593|  24.8k|    }
  594|       |
  595|       |    /* Compare PPS id */
  596|   229k|    if(ps_vcl_node->u1_pps_id != ps_nal_prms->u1_pps_id)
  ------------------
  |  Branch (596:8): [True: 51.8k, False: 178k]
  ------------------
  597|  51.8k|    {
  598|  51.8k|        return (OK);
  ------------------
  |  |  114|  51.8k|#define OK        0
  ------------------
  599|  51.8k|    }
  600|       |
  601|       |    /* Compare idr pic num */
  602|   178k|    if((SVCD_TRUE == ps_nal_prms->i4_idr_pic_flag) &&
  ------------------
  |  |   46|   178k|#define SVCD_TRUE 1
  ------------------
  |  Branch (602:8): [True: 140k, False: 37.2k]
  ------------------
  603|   140k|       (ps_vcl_node->i4_idr_pic_num != ps_nal_prms->i4_idr_pic_num))
  ------------------
  |  Branch (603:8): [True: 33.0k, False: 107k]
  ------------------
  604|  33.0k|    {
  605|  33.0k|        return (OK);
  ------------------
  |  |  114|  33.0k|#define OK        0
  ------------------
  606|  33.0k|    }
  607|       |
  608|       |    /* Compare frame number */
  609|   145k|    if(ps_vcl_node->u2_frm_num != ps_nal_prms->u2_frm_num)
  ------------------
  |  Branch (609:8): [True: 71.3k, False: 73.6k]
  ------------------
  610|  71.3k|    {
  611|  71.3k|        return (OK);
  ------------------
  |  |  114|  71.3k|#define OK        0
  ------------------
  612|  71.3k|    }
  613|       |
  614|       |    /* Compare poc lsb */
  615|  73.6k|    if(ps_dqid_node->i4_poc_lsb != ps_nal_prms->i4_poc_lsb)
  ------------------
  |  Branch (615:8): [True: 3.75k, False: 69.9k]
  ------------------
  616|  3.75k|    {
  617|  3.75k|        return (OK);
  ------------------
  |  |  114|  3.75k|#define OK        0
  ------------------
  618|  3.75k|    }
  619|       |
  620|       |    /* Compare delta poc bottom */
  621|  69.9k|    if(ps_dqid_node->i4_delta_poc_bot != ps_nal_prms->i4_delta_poc_bot)
  ------------------
  |  Branch (621:8): [True: 6.39k, False: 63.5k]
  ------------------
  622|  6.39k|    {
  623|  6.39k|        return (OK);
  ------------------
  |  |  114|  6.39k|#define OK        0
  ------------------
  624|  6.39k|    }
  625|       |
  626|       |    /* Compare delta poc [0] */
  627|  63.5k|    if(ps_dqid_node->ai4_delta_poc[0] != ps_nal_prms->ai4_delta_poc[0])
  ------------------
  |  Branch (627:8): [True: 3.23k, False: 60.2k]
  ------------------
  628|  3.23k|    {
  629|  3.23k|        return (OK);
  ------------------
  |  |  114|  3.23k|#define OK        0
  ------------------
  630|  3.23k|    }
  631|       |
  632|       |    /* Compare delta poc [0] */
  633|  60.2k|    if(ps_dqid_node->ai4_delta_poc[1] != ps_nal_prms->ai4_delta_poc[1])
  ------------------
  |  Branch (633:8): [True: 763, False: 59.5k]
  ------------------
  634|    763|    {
  635|    763|        return (OK);
  ------------------
  |  |  114|    763|#define OK        0
  ------------------
  636|    763|    }
  637|       |
  638|  59.5k|    *pi4_pic_bound_status = PIC_BOUNDARY_FALSE;
  639|  59.5k|    return (OK);
  ------------------
  |  |  114|  59.5k|#define OK        0
  ------------------
  640|  60.2k|}
isvcd_detect_pic_boundary_annex_b:
  696|   413k|{
  697|   413k|    UWORD32 u4_err_code;
  698|   413k|    WORD32 i4_zero_cnt;
  699|   413k|    WORD32 i4_status;
  700|   413k|    nal_prms_t s_nal_prms = {0};
  701|   413k|    nal_prms_t s_prefix_nal_prms = {0};
  702|   413k|    nal_buf_t s_prefix_nal_buf = {0};
  703|   413k|    WORD32 i4_pic_bound_type;
  704|   413k|    WORD32 i4_pic_bound_status;
  705|   413k|    UWORD8 *pu1_buf;
  706|   413k|    WORD32 i4_buf_size;
  707|   413k|    WORD32 i4_more_data_flag;
  708|   413k|    WORD32 i4_new_lyr_flag;
  709|   413k|    WORD32 i4_prev_dqid;
  710|   413k|    WORD32 i4_nal_discard_flag;
  711|       |
  712|       |    /* Initializations */
  713|   413k|    i4_zero_cnt = 0;
  714|   413k|    s_prefix_nal_buf.i4_valid_flag = SVCD_FALSE;
  ------------------
  |  |   45|   413k|#define SVCD_FALSE 0
  ------------------
  715|   413k|    *pi4_pic_bound_status = PIC_BOUNDARY_FALSE;
  716|   413k|    i4_new_lyr_flag = SVCD_TRUE;
  ------------------
  |  |   46|   413k|#define SVCD_TRUE 1
  ------------------
  717|       |
  718|       |    /* Get the previous layer's DQID                    */
  719|   413k|    if(SVCD_TRUE == ps_nal_parse_ctxt->i4_is_frst_vcl_nal_in_au)
  ------------------
  |  |   46|   413k|#define SVCD_TRUE 1
  ------------------
  |  Branch (719:8): [True: 157k, False: 256k]
  ------------------
  720|   157k|    {
  721|   157k|        ps_nal_parse_ctxt->i4_prev_dq_id = ps_nal_prms->i4_dqid;
  722|   157k|        ps_nal_parse_ctxt->i4_is_frst_vcl_nal_in_au = SVCD_FALSE;
  ------------------
  |  |   45|   157k|#define SVCD_FALSE 0
  ------------------
  723|   157k|    }
  724|   413k|    i4_prev_dqid = ps_nal_parse_ctxt->i4_prev_dq_id;
  725|   413k|    ps_nal_parse_ctxt->i4_prev_dq_id = ps_nal_prms->i4_dqid;
  726|       |
  727|       |    /* Detect the picture boundary */
  728|   413k|    if(ps_nal_prms->i4_dqid <= i4_prev_dqid)
  ------------------
  |  Branch (728:8): [True: 366k, False: 47.0k]
  ------------------
  729|   366k|    {
  730|   366k|        i4_status =
  731|   366k|            isvcd_compare_nal_prms(ps_nal_prms, FIRST_PASS, i4_prev_dqid, &i4_pic_bound_type,
  ------------------
  |  |   61|   366k|#define FIRST_PASS 0
  ------------------
  732|   366k|                                   &i4_pic_bound_status, ps_nal_parse_ctxt);
  733|   366k|        if(OK != i4_status)
  ------------------
  |  |  114|   366k|#define OK        0
  ------------------
  |  Branch (733:12): [True: 0, False: 366k]
  ------------------
  734|      0|        {
  735|      0|            return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  736|      0|        }
  737|   366k|        i4_new_lyr_flag = SVCD_FALSE;
  ------------------
  |  |   45|   366k|#define SVCD_FALSE 0
  ------------------
  738|       |
  739|       |        /* Check whether the picture boundary is detected */
  740|       |        /* or not */
  741|   366k|        if(PIC_BOUNDARY_FALSE == i4_pic_bound_status)
  ------------------
  |  Branch (741:12): [True: 204k, False: 162k]
  ------------------
  742|   204k|        {
  743|   204k|            return (OK);
  ------------------
  |  |  114|   204k|#define OK        0
  ------------------
  744|   204k|        }
  745|       |
  746|       |        /* Otherwise look for next nal and compare again */
  747|   162k|        *pi4_pic_bound_status = PIC_BOUNDARY_TRUE;
  748|   162k|    }
  749|       |
  750|   209k|    do
  751|   212k|    {
  752|   212k|        WORD32 i4_sps_pps_corrupt_status;
  753|   212k|        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|   212k|        if((NAL_END != ps_nal_parse_ctxt->i4_find_nal_state) ||
  ------------------
  |  Branch (757:12): [True: 13.4k, False: 198k]
  ------------------
  758|   198k|           ((WORD64) i4_cur_pos >= (WORD64) *pu4_num_bytes))
  ------------------
  |  Branch (758:12): [True: 357, False: 198k]
  ------------------
  759|  13.7k|        {
  760|  13.7k|            return (OK);
  ------------------
  |  |  114|  13.7k|#define OK        0
  ------------------
  761|  13.7k|        }
  762|       |
  763|       |        /* Otherwise fill the parameters */
  764|   198k|        pu1_buf = pu1_stream_buffer;
  765|   198k|        pu1_buf += i4_cur_pos;
  766|   198k|        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|   198k|        isvcd_set_default_nal_prms(&s_nal_prms);
  773|       |
  774|       |        /* take a back up of tgt lyr update flag */
  775|   198k|        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|   198k|        ps_nal_parse_ctxt->i4_tgt_lyr_update = SVCD_FALSE;
  ------------------
  |  |   45|   198k|#define SVCD_FALSE 0
  ------------------
  779|       |
  780|   198k|        i4_status = isvcd_get_nal_prms(pu1_buf, i4_buf_size, &s_nal_prms, &s_prefix_nal_prms,
  781|   198k|                                       &s_prefix_nal_buf, &u4_err_code, &i4_sps_pps_corrupt_status,
  782|   198k|                                       &i4_nal_discard_flag, ps_nal_parse_ctxt);
  783|       |        /* restore back the tgt lyr update flag */
  784|   198k|        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|   198k|        if(0 != u4_err_code)
  ------------------
  |  Branch (787:12): [True: 7.76k, False: 190k]
  ------------------
  788|  7.76k|        {
  789|  7.76k|            return (OK);
  ------------------
  |  |  114|  7.76k|#define OK        0
  ------------------
  790|  7.76k|        }
  791|       |
  792|   190k|        i4_more_data_flag = SVCD_FALSE;
  ------------------
  |  |   45|   190k|#define SVCD_FALSE 0
  ------------------
  793|       |
  794|       |        /* If prefix NAL unit comes then save the nal prms*/
  795|   190k|        if(PREFIX_UNIT_NAL == s_nal_prms.i4_nal_unit_type)
  ------------------
  |  |   64|   190k|#define PREFIX_UNIT_NAL 14
  ------------------
  |  Branch (795:12): [True: 3.07k, False: 187k]
  ------------------
  796|  3.07k|        {
  797|  3.07k|            UWORD32 u4_bytes_consumed;
  798|  3.07k|            WORD32 i4_status;
  799|       |
  800|       |            /* If prefix NAL is not discarded then set the varaibles */
  801|       |            /* appropriatly */
  802|  3.07k|            if(SVCD_FALSE == i4_nal_discard_flag)
  ------------------
  |  |   45|  3.07k|#define SVCD_FALSE 0
  ------------------
  |  Branch (802:16): [True: 1.47k, False: 1.59k]
  ------------------
  803|  1.47k|            {
  804|  1.47k|                s_prefix_nal_buf.i4_valid_flag = SVCD_TRUE;
  ------------------
  |  |   46|  1.47k|#define SVCD_TRUE 1
  ------------------
  805|  1.47k|                memcpy(&s_prefix_nal_prms, &s_nal_prms, sizeof(nal_prms_t));
  806|  1.47k|            }
  807|       |
  808|       |            /* Go to next start code */
  809|  3.07k|            i4_zero_cnt = 0;
  810|  3.07k|            u4_bytes_consumed = 0;
  811|  3.07k|            i4_status = isvcd_nal_find_start_code(pu1_stream_buffer, i4_cur_pos, *pu4_num_bytes,
  812|  3.07k|                                                  &i4_zero_cnt, &u4_bytes_consumed);
  813|       |            /* If associated NAL unit is  not present then */
  814|  3.07k|            if(SC_FOUND != i4_status)
  ------------------
  |  |   52|  3.07k|#define SC_FOUND 1
  ------------------
  |  Branch (814:16): [True: 185, False: 2.88k]
  ------------------
  815|    185|            {
  816|    185|                return (OK);
  ------------------
  |  |  114|    185|#define OK        0
  ------------------
  817|    185|            }
  818|  2.88k|            i4_cur_pos += u4_bytes_consumed;
  819|  2.88k|            i4_more_data_flag = SVCD_TRUE;
  ------------------
  |  |   46|  2.88k|#define SVCD_TRUE 1
  ------------------
  820|  2.88k|        }
  821|   190k|    } while(SVCD_TRUE == i4_more_data_flag);
  ------------------
  |  |   46|   190k|#define SVCD_TRUE 1
  ------------------
  |  Branch (821:13): [True: 2.88k, False: 187k]
  ------------------
  822|       |
  823|       |    /* Do further picture boundary detection only for */
  824|       |    /* VCL NAL unit (excliding prefix NAL unit)       */
  825|   187k|    if((NON_VCL_NAL == s_nal_prms.i4_derived_nal_type) ||
  ------------------
  |  Branch (825:8): [True: 26.7k, False: 160k]
  ------------------
  826|   160k|       (PREFIX_UNIT_NAL == s_nal_prms.i4_nal_unit_type) || (SVCD_TRUE == i4_nal_discard_flag))
  ------------------
  |  |   64|   160k|#define PREFIX_UNIT_NAL 14
  ------------------
                     (PREFIX_UNIT_NAL == s_nal_prms.i4_nal_unit_type) || (SVCD_TRUE == i4_nal_discard_flag))
  ------------------
  |  |   46|   160k|#define SVCD_TRUE 1
  ------------------
  |  Branch (826:8): [True: 0, False: 160k]
  |  Branch (826:60): [True: 3.90k, False: 156k]
  ------------------
  827|  30.6k|    {
  828|  30.6k|        return (OK);
  ------------------
  |  |  114|  30.6k|#define OK        0
  ------------------
  829|  30.6k|    }
  830|       |
  831|   156k|    if(SVCD_FALSE == i4_new_lyr_flag)
  ------------------
  |  |   45|   156k|#define SVCD_FALSE 0
  ------------------
  |  Branch (831:8): [True: 118k, False: 38.5k]
  ------------------
  832|   118k|    {
  833|   118k|        if(PIC_BOUND_DQID == i4_pic_bound_type)
  ------------------
  |  Branch (833:12): [True: 34.3k, False: 83.8k]
  ------------------
  834|  34.3k|        {
  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|  34.3k|            if(i4_prev_dqid != s_nal_prms.i4_dqid)
  ------------------
  |  Branch (837:16): [True: 17.8k, False: 16.4k]
  ------------------
  838|  17.8k|            {
  839|  17.8k|                return (OK);
  ------------------
  |  |  114|  17.8k|#define OK        0
  ------------------
  840|  17.8k|            }
  841|  34.3k|        }
  842|  83.8k|        else
  843|  83.8k|        {
  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|  83.8k|            if(PIC_BOUND_SLICE_PRMS != i4_pic_bound_type)
  ------------------
  |  Branch (846:16): [True: 0, False: 83.8k]
  ------------------
  847|      0|            {
  848|      0|                return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  849|      0|            }
  850|       |
  851|  83.8k|            if((i4_prev_dqid & 0xF) != (s_nal_prms.i4_dqid & 0xF))
  ------------------
  |  Branch (851:16): [True: 0, False: 83.8k]
  ------------------
  852|      0|            {
  853|      0|                return (OK);
  ------------------
  |  |  114|      0|#define OK        0
  ------------------
  854|      0|            }
  855|  83.8k|        }
  856|       |
  857|   100k|        isvcd_compare_nal_prms(&s_nal_prms, SECOND_PASS, i4_prev_dqid, &i4_pic_bound_type,
  ------------------
  |  |   62|   100k|#define SECOND_PASS 1
  ------------------
  858|   100k|                               &i4_pic_bound_status, ps_nal_parse_ctxt);
  859|   100k|        *pi4_pic_bound_status = i4_pic_bound_status;
  860|       |
  861|   100k|        if(PIC_BOUNDARY_FALSE == i4_pic_bound_status)
  ------------------
  |  Branch (861:12): [True: 11.2k, False: 89.0k]
  ------------------
  862|  11.2k|        {
  863|  11.2k|            ps_nal_parse_ctxt->i4_prev_dq_id = i4_prev_dqid;
  864|  11.2k|        }
  865|   100k|    }
  866|  38.5k|    else
  867|  38.5k|    {
  868|  38.5k|        if(SVCD_TRUE != i4_new_lyr_flag)
  ------------------
  |  |   46|  38.5k|#define SVCD_TRUE 1
  ------------------
  |  Branch (868:12): [True: 0, False: 38.5k]
  ------------------
  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|  38.5k|        if(i4_prev_dqid == s_nal_prms.i4_dqid)
  ------------------
  |  Branch (875:12): [True: 34.7k, False: 3.80k]
  ------------------
  876|  34.7k|        {
  877|  34.7k|            isvcd_compare_nal_prms(&s_nal_prms, SECOND_PASS, i4_prev_dqid, &i4_pic_bound_type,
  ------------------
  |  |   62|  34.7k|#define SECOND_PASS 1
  ------------------
  878|  34.7k|                                   &i4_pic_bound_status, ps_nal_parse_ctxt);
  879|       |            /* NAL header is corrupted and hence correct it  */
  880|  34.7k|            if(PIC_BOUNDARY_FALSE == i4_pic_bound_status)
  ------------------
  |  Branch (880:16): [True: 1.16k, False: 33.6k]
  ------------------
  881|  1.16k|            {
  882|  1.16k|                ps_nal_prms->i4_dqid = s_nal_prms.i4_dqid;
  883|  1.16k|                ps_nal_prms->i4_dependency_id = s_nal_prms.i4_dependency_id;
  884|  1.16k|                ps_nal_prms->i4_quality_id = s_nal_prms.i4_quality_id;
  885|  1.16k|                ps_nal_parse_ctxt->i4_prev_dq_id = ps_nal_prms->i4_dqid;
  886|  1.16k|            }
  887|  34.7k|        }
  888|  38.5k|        *pi4_pic_bound_status = PIC_BOUNDARY_FALSE;
  889|  38.5k|    }
  890|   138k|    return (OK);
  ------------------
  |  |  114|   138k|#define OK        0
  ------------------
  891|   156k|}
isvcd_insert_vcl_node:
  917|   234k|{
  918|   234k|    vcl_node_t *ps_bot_node;
  919|   234k|    vcl_node_t *ps_top_node;
  920|   234k|    vcl_node_t *ps_node;
  921|   234k|    WORD32 i4_rqrd_dqid;
  922|       |
  923|       |    /* sanity checks */
  924|   234k|    if((NULL == ps_vcl_nal) || (NULL == ps_vcl_node))
  ------------------
  |  Branch (924:8): [True: 0, False: 234k]
  |  Branch (924:32): [True: 0, False: 234k]
  ------------------
  925|      0|    {
  926|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  927|      0|    }
  928|       |
  929|   234k|    i4_rqrd_dqid = (ps_vcl_node->i4_dependency_id << 4);
  930|   234k|    i4_rqrd_dqid += ps_vcl_node->i4_quality_id;
  931|   234k|    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|   304k|    while(NULL != ps_node)
  ------------------
  |  Branch (935:11): [True: 73.6k, False: 231k]
  ------------------
  936|  73.6k|    {
  937|  73.6k|        WORD32 i4_dqid;
  938|       |
  939|  73.6k|        i4_dqid = (ps_node->i4_dependency_id << 4);
  940|  73.6k|        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|  73.6k|        if(i4_dqid > i4_rqrd_dqid)
  ------------------
  |  Branch (945:12): [True: 3.39k, False: 70.2k]
  ------------------
  946|  3.39k|        {
  947|  3.39k|            ps_bot_node = ps_node->ps_bot_node;
  948|  3.39k|            break;
  949|  3.39k|        }
  950|       |
  951|  70.2k|        ps_node = ps_node->ps_top_node;
  952|  70.2k|    }
  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|   234k|    if(NULL == ps_node)
  ------------------
  |  Branch (957:8): [True: 231k, False: 3.39k]
  ------------------
  958|   231k|    {
  959|   231k|        ps_bot_node = ps_vcl_nal->ps_top_node;
  960|   231k|    }
  961|       |
  962|       |    /* Insert the node into DQID list */
  963|   234k|    if(NULL != ps_bot_node)
  ------------------
  |  Branch (963:8): [True: 70.2k, False: 164k]
  ------------------
  964|  70.2k|    {
  965|  70.2k|        ps_top_node = ps_bot_node->ps_top_node;
  966|  70.2k|    }
  967|   164k|    else
  968|   164k|    {
  969|   164k|        ps_top_node = ps_vcl_nal->ps_bot_node;
  970|   164k|    }
  971|       |
  972|       |    /* Join previous node and specified node */
  973|   234k|    if(NULL != ps_bot_node)
  ------------------
  |  Branch (973:8): [True: 70.2k, False: 164k]
  ------------------
  974|  70.2k|    {
  975|  70.2k|        ps_bot_node->ps_top_node = ps_vcl_node;
  976|  70.2k|    }
  977|   164k|    else
  978|   164k|    {
  979|   164k|        ps_vcl_nal->ps_bot_node = ps_vcl_node;
  980|   164k|    }
  981|   234k|    ps_vcl_node->ps_bot_node = ps_bot_node;
  982|       |
  983|       |    /* Join next node and specified node */
  984|   234k|    if(NULL != ps_top_node)
  ------------------
  |  Branch (984:8): [True: 3.39k, False: 231k]
  ------------------
  985|  3.39k|    {
  986|  3.39k|        ps_top_node->ps_bot_node = ps_vcl_node;
  987|  3.39k|    }
  988|   231k|    else
  989|   231k|    {
  990|   231k|        ps_vcl_nal->ps_top_node = ps_vcl_node;
  991|   231k|    }
  992|   234k|    ps_vcl_node->ps_top_node = ps_top_node;
  993|       |
  994|   234k|    return (OK);
  ------------------
  |  |  114|   234k|#define OK        0
  ------------------
  995|   234k|}
isvcd_update_nal_ctxt:
 1024|  1.83M|{
 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|  1.83M|    nal_prms_t *ps_nal_prms;
 1031|  1.83M|    nal_buf_t *ps_nal_buf, *ps_prefix_nal_buf;
 1032|       |
 1033|  1.83M|    ps_nal_prms = &ps_nal_parse_ctxt->s_nal_prms;
 1034|  1.83M|    ps_nal_prms = &ps_nal_parse_ctxt->s_nal_prms;
 1035|  1.83M|    ps_nal_buf = &ps_nal_parse_ctxt->s_nal_buf;
 1036|  1.83M|    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|  1.83M|    if(PREFIX_UNIT_NAL == ps_nal_prms->i4_nal_unit_type)
  ------------------
  |  |   64|  1.83M|#define PREFIX_UNIT_NAL 14
  ------------------
  |  Branch (1040:8): [True: 3.68k, False: 1.82M]
  ------------------
 1041|  3.68k|    {
 1042|       |        /* Since we consume the zeroes in start code also */
 1043|       |        /* size has to reduced                            */
 1044|  3.68k|        if(NAL_END == ps_nal_parse_ctxt->i4_find_nal_state)
  ------------------
  |  Branch (1044:12): [True: 3.68k, False: 0]
  ------------------
 1045|  3.68k|        {
 1046|  3.68k|            ps_prefix_nal_buf->i4_buf_size -= 2;
 1047|  3.68k|        }
 1048|       |
 1049|  3.68k|        ps_prefix_nal_buf->u4_max_bits =
 1050|  3.68k|            isvcd_nal_rbsp_to_sodb(ps_prefix_nal_buf->pu1_buf, ps_prefix_nal_buf->i4_buf_size, 0);
 1051|  3.68k|        memcpy(&ps_nal_parse_ctxt->s_prefix_nal_prms, &ps_nal_parse_ctxt->s_nal_prms,
 1052|  3.68k|               sizeof(nal_prms_t));
 1053|  3.68k|        return;
 1054|  3.68k|    }
 1055|       |
 1056|  1.82M|    if(ANNEX_B == ps_nal_parse_ctxt->i4_input_bitstream_mode)
  ------------------
  |  |   64|  1.82M|#define ANNEX_B 0     /*!< Annex B stream*/
  ------------------
  |  Branch (1056:8): [True: 1.82M, False: 0]
  ------------------
 1057|  1.82M|    {
 1058|       |        /* Since we consume the zeroes in start code also */
 1059|       |        /* size has to reduced                            */
 1060|  1.82M|        if(NAL_END == ps_nal_parse_ctxt->i4_find_nal_state)
  ------------------
  |  Branch (1060:12): [True: 1.82M, False: 0]
  ------------------
 1061|  1.82M|        {
 1062|  1.82M|            ps_nal_buf->i4_buf_size -= 2;
 1063|  1.82M|        }
 1064|  1.82M|    }
 1065|       |
 1066|  1.82M|    if(VCL_NAL == ps_nal_prms->i4_derived_nal_type)
  ------------------
  |  Branch (1066:8): [True: 261k, False: 1.56M]
  ------------------
 1067|   261k|    {
 1068|   261k|        dqid_node_t *ps_dqid_node;
 1069|   261k|        vcl_node_t *ps_node;
 1070|   261k|        WORD32 i4_status;
 1071|   261k|        dec_pic_params_t *ps_pps;
 1072|   261k|        dec_seq_params_t *ps_sps;
 1073|   261k|        vcl_buf_hdr_t *ps_vcl_hdr;
 1074|   261k|        vcl_buf_hdr_t *ps_prev_vcl_hdr;
 1075|   261k|        WORD32 i4_slice_offset;
 1076|       |
 1077|   261k|        ps_sps = ps_nal_parse_ctxt->pv_seq_prms;
 1078|   261k|        ps_sps += ps_nal_prms->u1_sps_id;
 1079|   261k|        ps_pps = ps_nal_parse_ctxt->pv_pic_prms;
 1080|   261k|        ps_pps += ps_nal_prms->u1_pps_id;
 1081|       |
 1082|       |        /* Get the VCL NAL node */
 1083|   261k|        i4_status = isvcd_get_dqid_node(&ps_nal_parse_ctxt->s_dqid_ctxt,
 1084|   261k|                                        (UWORD8) ps_nal_parse_ctxt->i4_prev_dq_id, &ps_dqid_node);
 1085|       |
 1086|   261k|        ps_node = ps_dqid_node->ps_vcl_node;
 1087|       |
 1088|   261k|        if(NULL == ps_node)
  ------------------
  |  Branch (1088:12): [True: 0, False: 261k]
  ------------------
 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|   261k|        if(SVCD_FALSE == ps_dqid_node->u1_valid_flag)
  ------------------
  |  |   45|   261k|#define SVCD_FALSE 0
  ------------------
  |  Branch (1099:12): [True: 202k, False: 59.3k]
  ------------------
 1100|   202k|        {
 1101|       |            /* Update the DQID node */
 1102|   202k|            ps_dqid_node->u1_valid_flag = SVCD_TRUE;
  ------------------
  |  |   46|   202k|#define SVCD_TRUE 1
  ------------------
 1103|   202k|            ps_dqid_node->u1_dqid = (ps_nal_prms->i4_dependency_id << 4);
 1104|   202k|            ps_dqid_node->u1_dqid += ps_nal_prms->i4_quality_id;
 1105|   202k|            ps_dqid_node->i4_poc_lsb = ps_nal_prms->i4_poc_lsb;
 1106|   202k|            ps_dqid_node->i4_delta_poc_bot = ps_nal_prms->i4_delta_poc_bot;
 1107|   202k|            ps_dqid_node->ai4_delta_poc[0] = ps_nal_prms->ai4_delta_poc[0];
 1108|   202k|            ps_dqid_node->ai4_delta_poc[1] = ps_nal_prms->ai4_delta_poc[1];
 1109|       |
 1110|       |            /* Update the VCL node */
 1111|   202k|            ps_node->i4_quality_id = ps_nal_prms->i4_quality_id;
 1112|   202k|            ps_node->i4_dependency_id = ps_nal_prms->i4_dependency_id;
 1113|   202k|            ps_node->i4_temporal_id = ps_nal_prms->i4_temporal_id;
 1114|   202k|            ps_node->i4_priority_id = ps_nal_prms->i4_priority_id;
 1115|   202k|            ps_node->i4_idr_pic_flag = ps_nal_prms->i4_idr_pic_flag;
 1116|   202k|            ps_node->i4_nal_ref_idc = ps_nal_prms->i4_nal_ref_idc;
 1117|   202k|            ps_node->i4_nal_unit_type = ps_nal_prms->i4_nal_unit_type;
 1118|   202k|            ps_node->i4_use_ref_base = ps_nal_prms->i4_use_ref_base_pic_flag;
 1119|   202k|            ps_node->i4_nal_ref_idc = ps_nal_prms->i4_nal_ref_idc;
 1120|   202k|            ps_node->u1_sps_id = ps_nal_prms->u1_sps_id;
 1121|   202k|            ps_node->u1_pps_id = ps_nal_prms->u1_pps_id;
 1122|   202k|            ps_node->u2_frm_num = ps_nal_prms->u2_frm_num;
 1123|   202k|            ps_node->i4_idr_pic_num = ps_nal_prms->i4_idr_pic_num;
 1124|   202k|            ps_node->i4_num_slices = 0;
 1125|   202k|            ps_node->u1_acc_no_int_pred = 1;
 1126|   202k|            if(0 == ps_sps->u1_pic_order_cnt_type)
  ------------------
  |  Branch (1126:16): [True: 163k, False: 38.3k]
  ------------------
 1127|   163k|            {
 1128|   163k|                ps_node->i4_poc_syntax = ps_nal_prms->i4_poc_lsb;
 1129|   163k|            }
 1130|  38.3k|            else
 1131|  38.3k|            {
 1132|  38.3k|                ps_node->i4_poc_syntax = ps_nal_prms->ai4_delta_poc[0];
 1133|  38.3k|            }
 1134|       |
 1135|       |            /* Insert the node into DQID list */
 1136|   202k|            i4_status = isvcd_insert_vcl_node(ps_vcl_nal, ps_node);
 1137|   202k|            if(OK != i4_status)
  ------------------
  |  |  114|   202k|#define OK        0
  ------------------
  |  Branch (1137:16): [True: 0, False: 202k]
  ------------------
 1138|      0|            {
 1139|      0|                return;
 1140|      0|            }
 1141|       |
 1142|       |            /* Reset the previous field */
 1143|   202k|            ps_nal_parse_ctxt->ps_prev_vcl_buf = NULL;
 1144|   202k|            ps_node->ps_first_vcl_nal = NULL;
 1145|   202k|        }
 1146|       |
 1147|       |        /* Update accumulated no inter layer prediction */
 1148|   261k|        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|   261k|        if(NULL == ps_nal_buf->pu1_buf)
  ------------------
  |  Branch (1161:12): [True: 0, False: 261k]
  ------------------
 1162|      0|        {
 1163|       |            /* no nal needs to be added into the list hence return */
 1164|      0|            return;
 1165|      0|        }
 1166|   261k|        else
 1167|   261k|        {
 1168|   261k|            ps_vcl_hdr = (vcl_buf_hdr_t *) (ps_nal_buf->pu1_buf - GET_NAL_BUF_INC(VCL_NAL));
 1169|   261k|        }
 1170|       |
 1171|   261k|        i4_slice_offset = 0;
 1172|   261k|        if(SVCD_TRUE == ps_prefix_nal_buf->i4_valid_flag)
  ------------------
  |  |   46|   261k|#define SVCD_TRUE 1
  ------------------
  |  Branch (1172:12): [True: 667, False: 261k]
  ------------------
 1173|    667|        {
 1174|    667|            ps_vcl_hdr = (vcl_buf_hdr_t *) (ps_prefix_nal_buf->pu1_buf - GET_NAL_BUF_INC(VCL_NAL));
 1175|    667|            i4_slice_offset = ps_nal_buf->pu1_buf - ps_prefix_nal_buf->pu1_buf;
 1176|    667|        }
 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|   261k|        ps_prev_vcl_hdr = ps_nal_parse_ctxt->ps_prev_vcl_buf;
 1182|   261k|        if(NULL != ps_prev_vcl_hdr)
  ------------------
  |  Branch (1182:12): [True: 59.3k, False: 202k]
  ------------------
 1183|  59.3k|        {
 1184|  59.3k|            ps_prev_vcl_hdr->ps_next = ps_vcl_hdr;
 1185|  59.3k|        }
 1186|   202k|        else
 1187|   202k|        {
 1188|   202k|            ps_node->ps_first_vcl_nal = ps_vcl_hdr;
 1189|   202k|        }
 1190|       |
 1191|       |        /* Fill the VCL buffer header */
 1192|   261k|        ps_vcl_hdr->ps_next = NULL;
 1193|   261k|        ps_vcl_hdr->i4_no_int_lyr_pred = ps_nal_prms->i4_no_int_lyr_pred;
 1194|   261k|        ps_vcl_hdr->i4_first_mb_addr = ps_nal_prms->u4_first_mb_addr;
 1195|   261k|        ps_vcl_hdr->u4_prefix_nal_bits = ps_prefix_nal_buf->u4_max_bits;
 1196|   261k|        ps_vcl_hdr->i4_slice_offset = 0;
 1197|   261k|        ps_vcl_hdr->i4_buf_offset = GET_NAL_BUF_INC(VCL_NAL);
 1198|   261k|        ps_vcl_hdr->i4_slice_offset = i4_slice_offset;
 1199|       |
 1200|       |        /* Determine max num bits */
 1201|   261k|        ps_nal_buf->u4_max_bits = isvcd_nal_rbsp_to_sodb(
 1202|   261k|            ps_nal_buf->pu1_buf, ps_nal_buf->i4_buf_size, ps_pps->u1_entropy_coding_mode);
 1203|   261k|        ps_vcl_hdr->u4_max_bits = ps_nal_buf->u4_max_bits;
 1204|       |
 1205|       |        /* Updates */
 1206|   261k|        ps_nal_parse_ctxt->ps_prev_vcl_buf = ps_vcl_hdr;
 1207|   261k|        ps_node->i4_num_slices += 1;
 1208|   261k|    }
 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|  1.56M|    else
 1214|  1.56M|    {
 1215|  1.56M|        non_vcl_buf_hdr_t *ps_non_vcl_buf_hdr;
 1216|  1.56M|        non_vcl_buf_hdr_t *ps_prev_non_vcl_buf_hdr;
 1217|       |
 1218|  1.56M|        ps_non_vcl_buf_hdr =
 1219|  1.56M|            (non_vcl_buf_hdr_t *) (ps_nal_buf->pu1_buf - GET_NAL_BUF_INC(NON_VCL_NAL));
 1220|       |
 1221|       |        /* Update NON VCL structure */
 1222|  1.56M|        ps_non_vcl_buf_hdr->i4_nal_unit_type = ps_nal_prms->i4_nal_unit_type;
 1223|  1.56M|        ps_non_vcl_buf_hdr->ps_next = NULL;
 1224|  1.56M|        ps_non_vcl_buf_hdr->i4_buf_offset = GET_NAL_BUF_INC(NON_VCL_NAL);
 1225|  1.56M|        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|  1.56M|        ps_prev_non_vcl_buf_hdr = ps_nal_parse_ctxt->ps_prev_non_vcl_buf;
 1231|  1.56M|        if(NULL != ps_prev_non_vcl_buf_hdr)
  ------------------
  |  Branch (1231:12): [True: 1.47M, False: 86.7k]
  ------------------
 1232|  1.47M|        {
 1233|  1.47M|            ps_prev_non_vcl_buf_hdr->ps_next = ps_non_vcl_buf_hdr;
 1234|  1.47M|        }
 1235|  86.7k|        else
 1236|  86.7k|        {
 1237|  86.7k|            ps_non_vcl_nal->ps_first_non_vcl_nal = ps_non_vcl_buf_hdr;
 1238|  86.7k|        }
 1239|       |
 1240|       |        /* Updates */
 1241|  1.56M|        ps_nal_parse_ctxt->i4_num_non_vcl_nals += 1;
 1242|  1.56M|        ps_non_vcl_nal->i4_num_non_vcl_nals = ps_nal_parse_ctxt->i4_num_non_vcl_nals;
 1243|  1.56M|        ps_nal_parse_ctxt->ps_prev_non_vcl_buf = ps_non_vcl_buf_hdr;
 1244|  1.56M|    }
 1245|  1.82M|}
isvcd_refine_dqid_list:
 1340|   158k|{
 1341|   158k|    vcl_node_t *ps_node;
 1342|   158k|    target_lyr_attr_t *ps_int_attr;
 1343|   158k|    dqid_ctxt_t *ps_dqid_ctxt;
 1344|   158k|    UWORD8 u1_dep_id;
 1345|   158k|    WORD32 i4_status;
 1346|   158k|    WORD32 i4_dep_id;
 1347|       |
 1348|   158k|    ps_int_attr = &ps_nal_parse_ctxt->s_int_attr;
 1349|   158k|    ps_dqid_ctxt = &ps_nal_parse_ctxt->s_dqid_ctxt;
 1350|   158k|    i4_dep_id = -1;
 1351|       |
 1352|   388k|    for(u1_dep_id = 0; u1_dep_id <= ps_int_attr->i4_dependency_id; u1_dep_id++)
  ------------------
  |  Branch (1352:24): [True: 230k, False: 158k]
  ------------------
 1353|   230k|    {
 1354|   230k|        dqid_node_t *ps_dqid_node;
 1355|       |
 1356|       |        /* Get a DQID node */
 1357|   230k|        i4_status = isvcd_get_dqid_node(ps_dqid_ctxt, (UWORD8) (u1_dep_id << 4), &ps_dqid_node);
 1358|   230k|        if(OK != i4_status)
  ------------------
  |  |  114|   230k|#define OK        0
  ------------------
  |  Branch (1358:12): [True: 0, False: 230k]
  ------------------
 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|   230k|        if(SVCD_FALSE == ps_dqid_node->u1_valid_flag)
  ------------------
  |  |   45|   230k|#define SVCD_FALSE 0
  ------------------
  |  Branch (1364:12): [True: 32.4k, False: 198k]
  ------------------
 1365|  32.4k|        {
 1366|  32.4k|            if(1 == ps_nal_parse_ctxt->i4_idr_pic_err_flag)
  ------------------
  |  Branch (1366:16): [True: 298, False: 32.1k]
  ------------------
 1367|    298|            {
 1368|    298|                ps_int_attr->i4_dependency_id = i4_dep_id;
 1369|    298|                ps_int_attr->i4_quality_id = MAX_QUALITY_ID;
  ------------------
  |  |  102|    298|#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|    442|                while(NULL != ps_vcl_nal->ps_top_node)
  ------------------
  |  Branch (1374:23): [True: 229, False: 213]
  ------------------
 1375|    229|                {
 1376|       |                    /* if higher dependency */
 1377|    229|                    if(ps_vcl_nal->ps_top_node->i4_dependency_id > i4_dep_id)
  ------------------
  |  Branch (1377:24): [True: 144, False: 85]
  ------------------
 1378|    144|                    {
 1379|    144|                        ps_vcl_nal->ps_top_node = ps_vcl_nal->ps_top_node->ps_bot_node;
 1380|    144|                    }
 1381|     85|                    else
 1382|     85|                    {
 1383|     85|                        break;
 1384|     85|                    }
 1385|    229|                }
 1386|       |
 1387|       |                /* if no node exists in the dependency list */
 1388|    298|                if(NULL == ps_vcl_nal->ps_top_node)
  ------------------
  |  Branch (1388:20): [True: 213, False: 85]
  ------------------
 1389|    213|                {
 1390|    213|                    ps_vcl_nal->ps_bot_node = NULL;
 1391|    213|                }
 1392|     85|                else if(ps_vcl_nal->ps_top_node == ps_vcl_nal->ps_bot_node)
  ------------------
  |  Branch (1392:25): [True: 85, False: 0]
  ------------------
 1393|     85|                {
 1394|       |                    /* if a single node exists */
 1395|     85|                    ps_vcl_nal->ps_top_node->ps_bot_node = NULL;
 1396|     85|                    ps_vcl_nal->ps_bot_node->ps_top_node = NULL;
 1397|     85|                }
 1398|       |
 1399|    298|                return (NOT_OK);
  ------------------
  |  |  116|    298|#define NOT_OK    -1
  ------------------
 1400|    298|            }
 1401|  32.1k|            else
 1402|  32.1k|            {
 1403|  32.1k|                ps_dqid_node->u1_valid_flag = SVCD_TRUE;
  ------------------
  |  |   46|  32.1k|#define SVCD_TRUE 1
  ------------------
 1404|  32.1k|                ps_dqid_node->u1_dqid = (u1_dep_id << 4);
 1405|       |
 1406|       |                /* Fill VCL node information */
 1407|  32.1k|                ps_node = ps_dqid_node->ps_vcl_node;
 1408|  32.1k|                ps_node->i4_dependency_id = u1_dep_id;
 1409|  32.1k|                ps_node->i4_quality_id = 0;
 1410|  32.1k|                ps_node->ps_first_vcl_nal = NULL;
 1411|  32.1k|            }
 1412|       |
 1413|       |            /* Insert node into DQID list */
 1414|  32.1k|            i4_status = isvcd_insert_vcl_node(ps_vcl_nal, ps_node);
 1415|  32.1k|            if(OK != i4_status)
  ------------------
  |  |  114|  32.1k|#define OK        0
  ------------------
  |  Branch (1415:16): [True: 0, False: 32.1k]
  ------------------
 1416|      0|            {
 1417|      0|                return (NOT_OK);
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 1418|      0|            }
 1419|  32.1k|        }
 1420|       |
 1421|   230k|        i4_dep_id++;
 1422|   230k|    } /* End of loop over all the dependency id */
 1423|   158k|    return (OK);
  ------------------
  |  |  114|   158k|#define OK        0
  ------------------
 1424|   158k|}
isvcd_nal_parse_set_target_attr:
 1457|  22.5k|{
 1458|  22.5k|    nal_parse_ctxt_t *ps_nal_parse_ctxt;
 1459|  22.5k|    target_lyr_attr_t *ps_app_attr;
 1460|       |
 1461|  22.5k|    if((i4_target_quality_id > MAX_QUALITY_ID) || (i4_target_dependency_id > MAX_DEPENDENCY_ID))
  ------------------
  |  |  102|  22.5k|#define MAX_QUALITY_ID 0
  ------------------
                  if((i4_target_quality_id > MAX_QUALITY_ID) || (i4_target_dependency_id > MAX_DEPENDENCY_ID))
  ------------------
  |  |  103|  22.5k|#define MAX_DEPENDENCY_ID 4
  ------------------
  |  Branch (1461:8): [True: 0, False: 22.5k]
  |  Branch (1461:51): [True: 0, False: 22.5k]
  ------------------
 1462|      0|    {
 1463|      0|        return IV_FAIL;
 1464|      0|    }
 1465|       |
 1466|  22.5k|    ps_nal_parse_ctxt = (nal_parse_ctxt_t *) pv_nal_parse_ctxt;
 1467|  22.5k|    ps_app_attr = &ps_nal_parse_ctxt->s_app_attr;
 1468|       |
 1469|       |    /*-----------------------------------------------------------------------*/
 1470|       |    /*! Register the target information into context structure               */
 1471|       |    /*-----------------------------------------------------------------------*/
 1472|  22.5k|    ps_app_attr->i4_quality_id = i4_target_quality_id;
 1473|  22.5k|    ps_app_attr->i4_dependency_id = i4_target_dependency_id;
 1474|  22.5k|    ps_app_attr->i4_temporal_id = i4_target_temporal_id;
 1475|  22.5k|    ps_app_attr->i4_priority_id = i4_target_priority_id;
 1476|  22.5k|    return IV_SUCCESS;
 1477|  22.5k|}
isvcd_nal_parse_reset_ctxt:
 1510|  22.5k|{
 1511|  22.5k|    nal_parse_ctxt_t *ps_nal_parse_ctxt = (nal_parse_ctxt_t *) pv_nal_parse_ctxt;
 1512|  22.5k|    UNUSED(i4_input_mode);
  ------------------
  |  |   45|  22.5k|#define UNUSED(x) ((void)(x))
  ------------------
 1513|       |
 1514|       |    /*-----------------------------------------------------------------------*/
 1515|       |    /*! Set the input bitstream mode of context structure                    */
 1516|       |    /*-----------------------------------------------------------------------*/
 1517|  22.5k|    switch(i4_input_bitstream_mode)
 1518|  22.5k|    {
 1519|  22.5k|        case ANNEX_B:
  ------------------
  |  |   64|  22.5k|#define ANNEX_B 0     /*!< Annex B stream*/
  ------------------
  |  Branch (1519:9): [True: 22.5k, False: 0]
  ------------------
 1520|  22.5k|        case NON_ANNEX_B:
  ------------------
  |  |   65|  22.5k|#define NON_ANNEX_B 1 /*!< Non Annex B RFC stream */
  ------------------
  |  Branch (1520:9): [True: 0, False: 22.5k]
  ------------------
 1521|  22.5k|            break;
 1522|      0|        default:
  ------------------
  |  Branch (1522:9): [True: 0, False: 22.5k]
  ------------------
 1523|      0|            break;
 1524|  22.5k|    }
 1525|       |
 1526|  22.5k|    ps_nal_parse_ctxt->i4_input_bitstream_mode = i4_input_bitstream_mode;
 1527|       |
 1528|       |    /*-----------------------------------------------------------------------*/
 1529|       |    /*! Perform the picture level initialization                             */
 1530|       |    /*-----------------------------------------------------------------------*/
 1531|  22.5k|    isvcd_pic_reset_ctxt(pv_nal_parse_ctxt);
 1532|       |
 1533|       |    /* Reset the prefix nal unit buffer structure */
 1534|  22.5k|    isvcd_nal_buf_reset(&ps_nal_parse_ctxt->s_prefix_nal_buf);
 1535|       |
 1536|       |    /*-----------------------------------------------------------------------*/
 1537|       |    /*! Reset other varaibles                                                */
 1538|       |    /*-----------------------------------------------------------------------*/
 1539|  22.5k|    ps_nal_parse_ctxt->i4_dec_frst_sc_flag = SVCD_TRUE;
  ------------------
  |  |   46|  22.5k|#define SVCD_TRUE 1
  ------------------
 1540|  22.5k|    ps_nal_parse_ctxt->i4_eos_flag = SVCD_FALSE;
  ------------------
  |  |   45|  22.5k|#define SVCD_FALSE 0
  ------------------
 1541|  22.5k|    ps_nal_parse_ctxt->u1_pic_boundary_aud_flag = 0;
 1542|  22.5k|    ps_nal_parse_ctxt->u4_bytes_left = 0;
 1543|       |
 1544|       |    /* Reset target layer attributes */
 1545|  22.5k|    {
 1546|  22.5k|        target_lyr_attr_t *ps_app_attr;
 1547|  22.5k|        target_lyr_attr_t *ps_int_attr;
 1548|       |
 1549|  22.5k|        ps_app_attr = &ps_nal_parse_ctxt->s_app_attr;
 1550|  22.5k|        ps_int_attr = &ps_nal_parse_ctxt->s_int_attr;
 1551|       |
 1552|  22.5k|        ps_app_attr->i4_dependency_id = MAX_DEPENDENCY_ID;
  ------------------
  |  |  103|  22.5k|#define MAX_DEPENDENCY_ID 4
  ------------------
 1553|  22.5k|        ps_app_attr->i4_quality_id = MAX_QUALITY_ID;
  ------------------
  |  |  102|  22.5k|#define MAX_QUALITY_ID 0
  ------------------
 1554|  22.5k|        ps_app_attr->i4_temporal_id = MAX_TEMPORAL_ID;
  ------------------
  |  |  104|  22.5k|#define MAX_TEMPORAL_ID 7
  ------------------
 1555|  22.5k|        ps_app_attr->i4_priority_id = MAX_PRIORITY_ID;
  ------------------
  |  |  105|  22.5k|#define MAX_PRIORITY_ID 63
  ------------------
 1556|       |
 1557|  22.5k|        ps_int_attr->i4_dependency_id = -1;
 1558|  22.5k|        ps_int_attr->i4_quality_id = MAX_QUALITY_ID;
  ------------------
  |  |  102|  22.5k|#define MAX_QUALITY_ID 0
  ------------------
 1559|  22.5k|        ps_int_attr->i4_temporal_id = 0;
 1560|  22.5k|        ps_int_attr->i4_priority_id = MAX_PRIORITY_ID;
  ------------------
  |  |  105|  22.5k|#define MAX_PRIORITY_ID 63
  ------------------
 1561|  22.5k|    }
 1562|  22.5k|}
isvcd_nal_parse_partial_signal_eos:
 1593|     18|{
 1594|     18|    nal_parse_ctxt_t *ps_nal_parse_ctxt;
 1595|     18|    vcl_nal_t *ps_vcl_nal;
 1596|       |
 1597|     18|    ps_nal_parse_ctxt = (nal_parse_ctxt_t *) pv_nal_parse_ctxt;
 1598|     18|    ps_vcl_nal = (vcl_nal_t *) pv_out_vcl_nal;
 1599|       |
 1600|       |    /* for RFC mode */
 1601|     18|    if(NON_ANNEX_B == ps_nal_parse_ctxt->i4_input_bitstream_mode)
  ------------------
  |  |   65|     18|#define NON_ANNEX_B 1 /*!< Non Annex B RFC stream */
  ------------------
  |  Branch (1601:8): [True: 0, False: 18]
  ------------------
 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|     18|    if(1 == ps_nal_parse_ctxt->u1_pic_boundary_aud_flag)
  ------------------
  |  Branch (1607:8): [True: 15, False: 3]
  ------------------
 1608|     15|    {
 1609|     15|        ps_nal_parse_ctxt->i4_eos_flag = SVCD_TRUE;
  ------------------
  |  |   46|     15|#define SVCD_TRUE 1
  ------------------
 1610|     15|    }
 1611|       |    /* Update VCL node if it is first call in the */
 1612|       |    /* flush mode                                 */
 1613|     18|    if(SVCD_FALSE == ps_nal_parse_ctxt->i4_eos_flag)
  ------------------
  |  |   45|     18|#define SVCD_FALSE 0
  ------------------
  |  Branch (1613:8): [True: 3, False: 15]
  ------------------
 1614|      3|    {
 1615|      3|        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|      3|        if((FIND_NAL_END == ps_nal_parse_ctxt->i4_find_nal_state) &&
  ------------------
  |  Branch (1622:12): [True: 0, False: 3]
  ------------------
 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|      3|        ps_nal_parse_ctxt->i4_idr_pic_err_flag = 0;
 1629|       |        /* Refine based on the no inter layer pred flag*/
 1630|      3|        i4_status = isvcd_refine_dqid_list(ps_vcl_nal, ps_nal_parse_ctxt);
 1631|       |
 1632|      3|        if(!(OK == i4_status))
  ------------------
  |  |  114|      3|#define OK        0
  ------------------
  |  Branch (1632:12): [True: 0, False: 3]
  ------------------
 1633|      0|        {
 1634|      0|            return i4_status;
 1635|      0|        }
 1636|      3|        UNUSED(i4_status);
  ------------------
  |  |   45|      3|#define UNUSED(x) ((void)(x))
  ------------------
 1637|       |
 1638|       |        /* Reset the context structure variables */
 1639|      3|        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|      3|        ps_nal_parse_ctxt->i4_eos_flag = SVCD_TRUE;
  ------------------
  |  |   46|      3|#define SVCD_TRUE 1
  ------------------
 1645|       |
 1646|      3|        return (PIC_BOUNDARY_TRUE);
 1647|      3|    }
 1648|     15|    else
 1649|     15|    {
 1650|     15|        return (FLUSH_DECODED_PICTURE);
 1651|     15|    }
 1652|     18|}
isvcd_nal_parse_pic_bound_proc:
 1677|   158k|{
 1678|   158k|    WORD32 i4_status;
 1679|       |
 1680|   158k|    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|   158k|    if(NOT_OK == i4_status)
  ------------------
  |  |  116|   158k|#define NOT_OK    -1
  ------------------
  |  Branch (1687:8): [True: 298, False: 158k]
  ------------------
 1688|    298|    {
 1689|    298|        ps_nal_parse_ctxt->i4_discard_nal_flag = SVCD_TRUE;
  ------------------
  |  |   46|    298|#define SVCD_TRUE 1
  ------------------
 1690|    298|        ps_vcl_nal->i1_nal_ref_id_next = -1;
 1691|    298|    }
 1692|   158k|    else
 1693|   158k|    {
 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|   158k|        ps_vcl_nal->i1_nal_ref_id_next = ps_nal_prms->i4_nal_ref_idc;
 1699|       |
 1700|   158k|        ps_vcl_nal->u2_frm_num_next = ps_nal_prms->u2_frm_num;
 1701|   158k|    }
 1702|       |
 1703|       |    /* -------- reset few variables in context structure ----*/
 1704|   158k|    isvcd_pic_reset_ctxt(ps_nal_parse_ctxt);
 1705|   158k|}
isvcd_nal_parse_vcl_nal_partial:
 1741|   163k|{
 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|   163k|    nal_parse_ctxt_t *ps_nal_parse_ctxt;
 1755|   163k|    vcl_nal_t *ps_vcl_nal;
 1756|   163k|    non_vcl_nal_t *ps_non_vcl_nal;
 1757|   163k|    nal_unit_t *ps_nal_unit;
 1758|   163k|    WORD32 i4_nal_start_flag, i4_cur_pos, i4_status;
 1759|   163k|    WORD32 i4_nal_header_len, i4_more_data_flag;
 1760|   163k|    UWORD32 u4_bytes_consumed_temp = 0;
 1761|   163k|    UWORD8 **ppu1_out_buf;
 1762|   163k|    nal_prms_t *ps_nal_prms;
 1763|   163k|    WORD32 i4_pic_bound_status;
 1764|       |
 1765|   163k|    ps_nal_parse_ctxt = (nal_parse_ctxt_t *) pv_nal_parse_ctxt;
 1766|   163k|    ps_vcl_nal = (vcl_nal_t *) pv_out_vcl_nal;
 1767|   163k|    ps_non_vcl_nal = (non_vcl_nal_t *) pv_out_non_vcl_nal;
 1768|   163k|    ps_nal_unit = (nal_unit_t *) ps_nal_parse_ctxt->pv_nal_unit;
 1769|   163k|    ps_nal_prms = &ps_nal_parse_ctxt->s_nal_prms;
 1770|       |
 1771|       |    /* Initialization */
 1772|   163k|    i4_cur_pos = 0;
 1773|   163k|    *pu4_bytes_consumed = 0;
 1774|   163k|    i4_nal_header_len = 0;
 1775|   163k|    i4_nal_start_flag = SVCD_FALSE;
  ------------------
  |  |   45|   163k|#define SVCD_FALSE 0
  ------------------
 1776|   163k|    i4_more_data_flag = SVCD_TRUE;
  ------------------
  |  |   46|   163k|#define SVCD_TRUE 1
  ------------------
 1777|   163k|    i4_pic_bound_status = PIC_BOUNDARY_FALSE;
 1778|       |
 1779|   163k|    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|   163k|    if(SVCD_TRUE == ps_nal_parse_ctxt->i4_is_frst_vcl_nal_in_au)
  ------------------
  |  |   46|   163k|#define SVCD_TRUE 1
  ------------------
  |  Branch (1785:8): [True: 162k, False: 140]
  ------------------
 1786|   162k|    {
 1787|   162k|        nal_buf_t *ps_prefix_nal_buf;
 1788|       |
 1789|   162k|        ps_prefix_nal_buf = &ps_nal_parse_ctxt->s_prefix_nal_buf;
 1790|   162k|        if(SVCD_TRUE == ps_prefix_nal_buf->i4_valid_flag)
  ------------------
  |  |   46|   162k|#define SVCD_TRUE 1
  ------------------
  |  Branch (1790:12): [True: 585, False: 162k]
  ------------------
 1791|    585|        {
 1792|    585|            WORD32 i4_buf_size;
 1793|    585|            UWORD8 *pu1_vcl_nal;
 1794|       |
 1795|    585|            if(ps_prefix_nal_buf->i4_buf_size > 0)
  ------------------
  |  Branch (1795:16): [True: 96, False: 489]
  ------------------
 1796|     96|            {
 1797|     96|                i4_buf_size = ps_prefix_nal_buf->i4_buf_size;
 1798|     96|                i4_buf_size = UP_ALIGN_8(i4_buf_size + BUFFER_ALIGN_4);
  ------------------
  |  |   51|     96|#define UP_ALIGN_8(x) (((((UWORD64) x) + 7) >> 3) << 3)
  ------------------
 1799|     96|            }
 1800|    489|            else
 1801|    489|            {
 1802|    489|                i4_buf_size = 0;
 1803|    489|            }
 1804|       |
 1805|    585|            pu1_vcl_nal = ps_nal_parse_ctxt->pu1_vcl_nal_buf + i4_buf_size;
 1806|       |
 1807|    585|            memmove(ps_nal_parse_ctxt->pu1_vcl_nal_buf, ps_prefix_nal_buf->pu1_buf, i4_buf_size);
 1808|    585|            ps_prefix_nal_buf->pu1_buf = ps_nal_parse_ctxt->pu1_vcl_nal_buf;
 1809|    585|            ps_nal_parse_ctxt->pu1_vcl_nal_buf = pu1_vcl_nal;
 1810|       |
 1811|       |            /* subtract the buffer size left */
 1812|    585|            ps_nal_parse_ctxt->u4_bytes_left_vcl -= i4_buf_size;
 1813|    585|        }
 1814|       |        /* Reset the top and bottom node */
 1815|   162k|        ps_vcl_nal->ps_top_node = NULL;
 1816|   162k|        ps_vcl_nal->ps_bot_node = NULL;
 1817|   162k|        ps_vcl_nal->i1_nal_ref_id_next = -1;
 1818|   162k|        ps_vcl_nal->u2_frm_num_next = 0;
 1819|   162k|    }
 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|   163k|    if(ps_nal_parse_ctxt->u4_bytes_left >= (UWORD32) *pu4_num_bytes)
  ------------------
  |  Branch (1826:8): [True: 18, False: 163k]
  ------------------
 1827|     18|    {
 1828|     18|        ps_nal_parse_ctxt->i4_discard_nal_flag = SVCD_TRUE;
  ------------------
  |  |   46|     18|#define SVCD_TRUE 1
  ------------------
 1829|     18|        *pu4_bytes_consumed = *pu4_num_bytes;
 1830|       |
 1831|     18|        i4_status =
 1832|     18|            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|     18|        ps_vcl_nal->i1_nal_ref_id_next = -1;
 1835|     18|        ps_vcl_nal->u2_frm_num_next = 0;
 1836|       |
 1837|     18|        return (i4_status);
 1838|     18|    }
 1839|   163k|    ps_nal_parse_ctxt->u4_bytes_left = 0;
 1840|       |
 1841|       |    /*************************************************************************/
 1842|       |    /*                      LOOP OVER NALs                                   */
 1843|       |    /*************************************************************************/
 1844|   163k|    do
 1845|  1.43M|    {
 1846|  1.43M|        nal_buf_t *ps_nal_buf;
 1847|  1.43M|        UWORD32 *pu4_bytes_left;
 1848|       |
 1849|       |        /* Find NAL boundary                */
 1850|  1.43M|        if(ANNEX_B == ps_nal_parse_ctxt->i4_input_bitstream_mode)
  ------------------
  |  |   64|  1.43M|#define ANNEX_B 0     /*!< Annex B stream*/
  ------------------
  |  Branch (1850:12): [True: 1.43M, False: 0]
  ------------------
 1851|  1.43M|        {
 1852|  1.43M|            i4_nal_start_flag = isvcd_get_annex_b_nal_unit(
 1853|  1.43M|                pu1_stream_buffer, i4_cur_pos, *pu4_num_bytes,
 1854|  1.43M|                &ps_nal_parse_ctxt->i4_find_nal_state, &ps_nal_parse_ctxt->i4_zero_byte_cnt,
 1855|  1.43M|                &u4_bytes_consumed_temp, ps_nal_parse_ctxt->pv_nal_unit, &i4_more_data_flag);
 1856|       |
 1857|  1.43M|            i4_cur_pos += u4_bytes_consumed_temp;
 1858|  1.43M|        }
 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.43M|        if(SVCD_TRUE == i4_nal_start_flag)
  ------------------
  |  |   46|  1.43M|#define SVCD_TRUE 1
  ------------------
  |  Branch (1868:12): [True: 1.43M, False: 150]
  ------------------
 1869|  1.43M|        {
 1870|  1.43M|            UWORD32 u4_err_code;
 1871|  1.43M|            WORD32 i4_sps_pps_corrupt_status;
 1872|  1.43M|            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.43M|            i4_internal_dep_id_prev = ps_nal_parse_ctxt->s_int_attr.i4_dependency_id;
 1882|       |
 1883|  1.43M|            i4_status = isvcd_get_nal_prms(
 1884|  1.43M|                ps_nal_unit->pu1_bufs, ps_nal_unit->i4_buf_sizes, ps_nal_prms,
 1885|  1.43M|                &ps_nal_parse_ctxt->s_prefix_nal_prms, &ps_nal_parse_ctxt->s_prefix_nal_buf,
 1886|  1.43M|                &u4_err_code, &i4_sps_pps_corrupt_status, &ps_nal_parse_ctxt->i4_discard_nal_flag,
 1887|  1.43M|                ps_nal_parse_ctxt);
 1888|       |
 1889|  1.43M|            if(NON_ANNEX_B == ps_nal_parse_ctxt->i4_input_bitstream_mode)
  ------------------
  |  |   65|  1.43M|#define NON_ANNEX_B 1 /*!< Non Annex B RFC stream */
  ------------------
  |  Branch (1889:16): [True: 0, False: 1.43M]
  ------------------
 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.43M|            if((NAL_INSUFFICIENT_DATA == (WORD32) u4_err_code) &&
  ------------------
  |  Branch (1899:16): [True: 3.27k, False: 1.43M]
  ------------------
 1900|  3.27k|               (NAL_END != ps_nal_parse_ctxt->i4_find_nal_state))
  ------------------
  |  Branch (1900:16): [True: 2.38k, False: 890]
  ------------------
 1901|  2.38k|            {
 1902|  2.38k|                ps_nal_parse_ctxt->u4_bytes_left = *pu4_num_bytes - *pu4_bytes_consumed;
 1903|       |
 1904|       |                /* Reset the NAL level tracking variables */
 1905|  2.38k|                isvcd_nal_reset_ctxt(ps_nal_parse_ctxt);
 1906|  2.38k|                break;
 1907|  2.38k|            }
 1908|  1.43M|            else if(0 != u4_err_code)
  ------------------
  |  Branch (1908:21): [True: 24.2k, False: 1.40M]
  ------------------
 1909|  24.2k|            {
 1910|  24.2k|                ps_nal_parse_ctxt->i4_discard_nal_flag = SVCD_TRUE;
  ------------------
  |  |   46|  24.2k|#define SVCD_TRUE 1
  ------------------
 1911|       |
 1912|  24.2k|                if(SVCD_TRUE == ps_nal_prms->i4_idr_pic_flag)
  ------------------
  |  |   46|  24.2k|#define SVCD_TRUE 1
  ------------------
  |  Branch (1912:20): [True: 1.21k, False: 23.0k]
  ------------------
 1913|  1.21k|                {
 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.21k|                    if(i4_internal_dep_id_prev != ps_nal_parse_ctxt->s_int_attr.i4_dependency_id)
  ------------------
  |  Branch (1920:24): [True: 0, False: 1.21k]
  ------------------
 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.21k|                }
 1960|  24.2k|            }
 1961|       |
 1962|       |            /* Populate the derived nal type into bitstream extract*/
 1963|       |            /* context structure                                   */
 1964|  1.43M|            i4_nal_header_len = ps_nal_prms->i4_nal_header_len;
 1965|  1.43M|            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.43M|            ps_nal_parse_ctxt->i4_idr_pic_err_flag |=
 1969|  1.43M|                ((SVCD_TRUE == ps_nal_prms->i4_idr_pic_flag) &&
  ------------------
  |  |   46|  1.43M|#define SVCD_TRUE 1
  ------------------
  |  Branch (1969:18): [True: 327k, False: 1.10M]
  ------------------
 1970|   327k|                 (SVCD_FALSE == ps_nal_parse_ctxt->i4_discard_nal_flag) &&
  ------------------
  |  |   45|   327k|#define SVCD_FALSE 0
  ------------------
  |  Branch (1970:18): [True: 325k, False: 2.22k]
  ------------------
 1971|   325k|                 (i4_internal_dep_id_prev != ps_nal_parse_ctxt->s_int_attr.i4_dependency_id));
  ------------------
  |  Branch (1971:18): [True: 26.3k, False: 299k]
  ------------------
 1972|       |
 1973|  1.43M|            if(ACCESS_UNIT_DELIMITER_RBSP == ps_nal_prms->i4_nal_unit_type)
  ------------------
  |  |  332|  1.43M|#define ACCESS_UNIT_DELIMITER_RBSP      9
  ------------------
  |  Branch (1973:16): [True: 7.58k, False: 1.42M]
  ------------------
 1974|  7.58k|            {
 1975|  7.58k|                i4_pic_bound_status = PIC_BOUNDARY_TRUE;
 1976|  7.58k|                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.58k|                if(PIC_BOUNDARY_TRUE == i4_pic_bound_status)
  ------------------
  |  Branch (1979:20): [True: 7.58k, False: 0]
  ------------------
 1980|  7.58k|                {
 1981|  7.58k|                    isvcd_nal_parse_pic_bound_proc(ps_nal_parse_ctxt, ps_vcl_nal, ps_nal_prms);
 1982|  7.58k|                    break;
 1983|  7.58k|                }
 1984|  7.58k|            }
 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.42M|            if((VCL_NAL == ps_nal_prms->i4_derived_nal_type) &&
  ------------------
  |  Branch (1990:16): [True: 420k, False: 1.00M]
  ------------------
 1991|   420k|               (PREFIX_UNIT_NAL != ps_nal_prms->i4_nal_unit_type) &&
  ------------------
  |  |   64|   420k|#define PREFIX_UNIT_NAL 14
  ------------------
  |  Branch (1991:16): [True: 418k, False: 1.74k]
  ------------------
 1992|   418k|               (SVCD_FALSE == ps_nal_parse_ctxt->i4_discard_nal_flag))
  ------------------
  |  |   45|   418k|#define SVCD_FALSE 0
  ------------------
  |  Branch (1992:16): [True: 413k, False: 5.16k]
  ------------------
 1993|   413k|            {
 1994|   413k|                if(ANNEX_B == ps_nal_parse_ctxt->i4_input_bitstream_mode)
  ------------------
  |  |   64|   413k|#define ANNEX_B 0     /*!< Annex B stream*/
  ------------------
  |  Branch (1994:20): [True: 413k, False: 0]
  ------------------
 1995|   413k|                {
 1996|   413k|                    ps_nal_parse_ctxt->u1_pic_boundary_aud_flag = 0;
 1997|       |
 1998|   413k|                    i4_status = isvcd_detect_pic_boundary_annex_b(ps_nal_prms, pu1_stream_buffer,
 1999|   413k|                                                                  i4_cur_pos, &i4_pic_bound_status,
 2000|   413k|                                                                  ps_nal_parse_ctxt, pu4_num_bytes);
 2001|   413k|                }
 2002|       |
 2003|       |                /* If picture boundary is detected then come out of  */
 2004|       |                /* the loop                                          */
 2005|   413k|                if(PIC_BOUNDARY_TRUE == i4_pic_bound_status)
  ------------------
  |  Branch (2005:20): [True: 150k, False: 262k]
  ------------------
 2006|   150k|                {
 2007|   150k|                    isvcd_nal_parse_pic_bound_proc(ps_nal_parse_ctxt, ps_vcl_nal, ps_nal_prms);
 2008|   150k|                    break;
 2009|   150k|                }
 2010|   413k|            }
 2011|       |
 2012|  1.27M|            if(SVCD_FALSE == ps_nal_parse_ctxt->i4_discard_nal_flag)
  ------------------
  |  |   45|  1.27M|#define SVCD_FALSE 0
  ------------------
  |  Branch (2012:16): [True: 1.24M, False: 29.9k]
  ------------------
 2013|  1.24M|            {
 2014|       |                /* Set the active NAL buffer structure and initialize */
 2015|       |                /* the nal buffer structure                           */
 2016|  1.24M|                isvcd_get_nal_buf(ps_nal_parse_ctxt, &ps_nal_buf);
 2017|  1.24M|                ps_nal_parse_ctxt->ps_nal_buf = ps_nal_buf;
 2018|  1.24M|            }
 2019|  29.9k|            else
 2020|  29.9k|            {
 2021|  29.9k|                ps_nal_parse_ctxt->ps_nal_buf = NULL;
 2022|  29.9k|            }
 2023|  1.27M|        }
 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.27M|        *pu4_bytes_consumed += u4_bytes_consumed_temp;
 2031|       |
 2032|       |        /*********************************************************************/
 2033|       |        /*          EMULATION PREVENTION AND BYTE SWAPPING                   */
 2034|       |        /*********************************************************************/
 2035|       |
 2036|       |        /* Determine output buffer */
 2037|  1.27M|        ps_nal_buf = ps_nal_parse_ctxt->ps_nal_buf;
 2038|       |
 2039|  1.27M|        if(VCL_NAL == ps_nal_parse_ctxt->i4_nal_type)
  ------------------
  |  Branch (2039:12): [True: 269k, False: 1.00M]
  ------------------
 2040|   269k|        {
 2041|   269k|            ppu1_out_buf = &ps_nal_parse_ctxt->pu1_vcl_nal_buf;
 2042|   269k|            pu4_bytes_left = &ps_nal_parse_ctxt->u4_bytes_left_vcl;
 2043|   269k|            if(*pu4_bytes_left < (MAX_VCL_NAL_BUFF_SIZE * 0.05))
  ------------------
  |  |   69|   269k|#define MAX_VCL_NAL_BUFF_SIZE (1024 * 1024 * 2)
  ------------------
  |  Branch (2043:16): [True: 0, False: 269k]
  ------------------
 2044|      0|            {
 2045|      0|                return (VCL_NAL_FOUND_FALSE);
 2046|      0|            }
 2047|   269k|        }
 2048|  1.00M|        else
 2049|  1.00M|        {
 2050|  1.00M|            ppu1_out_buf = &ps_nal_parse_ctxt->pu1_non_vcl_nal_buf;
 2051|  1.00M|            pu4_bytes_left = &ps_nal_parse_ctxt->u4_bytes_left_non_vcl;
 2052|  1.00M|            if(*pu4_bytes_left < (MAX_NON_VCL_NAL_BUFF_SIZE * 0.05))
  ------------------
  |  |   70|  1.00M|#define MAX_NON_VCL_NAL_BUFF_SIZE (1024 * 1024 * 2)
  ------------------
  |  Branch (2052:16): [True: 134, False: 1.00M]
  ------------------
 2053|    134|            {
 2054|    134|                return (VCL_NAL_FOUND_FALSE);
 2055|    134|            }
 2056|  1.00M|        }
 2057|       |
 2058|       |        /* if 0 bytes left then discard the current NAL */
 2059|  1.27M|        if(0 >= (WORD32) *pu4_bytes_left)
  ------------------
  |  Branch (2059:12): [True: 0, False: 1.27M]
  ------------------
 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.27M|        if(SVCD_FALSE == ps_nal_parse_ctxt->i4_discard_nal_flag)
  ------------------
  |  |   45|  1.27M|#define SVCD_FALSE 0
  ------------------
  |  Branch (2065:12): [True: 1.24M, False: 29.9k]
  ------------------
 2066|  1.24M|        {
 2067|  1.24M|            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.24M|            {
 2072|  1.24M|                UWORD32 u4_buf_size;
 2073|       |
 2074|       |                /* clip the size before emulation prevention */
 2075|  1.24M|                u4_buf_size = (UWORD32) CLIP3(0, (WORD32) *pu4_bytes_left,
  ------------------
  |  |   77|  1.24M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 0, False: 1.24M]
  |  |  |  Branch (77:54): [True: 0, False: 1.24M]
  |  |  ------------------
  ------------------
 2076|  1.24M|                                              (ps_nal_unit->i4_buf_sizes - i4_nal_header_len));
 2077|       |
 2078|  1.24M|                u4_buf_inc = isvcd_nal_byte_swap_emulation(
 2079|  1.24M|                    (UWORD32 *) *ppu1_out_buf, &u4_output_bytes,
 2080|  1.24M|                    ps_nal_unit->pu1_bufs + i4_nal_header_len, u4_buf_size,
 2081|  1.24M|                    NUM_OF_ZERO_BYTES_BEFORE_START_CODE, &ps_nal_parse_ctxt->s_emulation_ctxt);
  ------------------
  |  |   54|  1.24M|#define NUM_OF_ZERO_BYTES_BEFORE_START_CODE (2)
  ------------------
 2082|       |
 2083|  1.24M|                i4_nal_header_len = 0;
 2084|  1.24M|                u4_buf_inc = UP_ALIGN_8(u4_buf_inc);
  ------------------
  |  |   51|  1.24M|#define UP_ALIGN_8(x) (((((UWORD64) x) + 7) >> 3) << 3)
  ------------------
 2085|  1.24M|                *ppu1_out_buf += u4_buf_inc;
 2086|  1.24M|                *pu4_bytes_left -= u4_buf_inc;
 2087|  1.24M|                ps_nal_buf->i4_buf_size += u4_output_bytes;
 2088|  1.24M|            }
 2089|  1.24M|        }
 2090|       |
 2091|       |        /*********************************************************************/
 2092|       |        /*                UPDATE VARIABLES                                   */
 2093|       |        /*********************************************************************/
 2094|  1.27M|        if(NAL_END == ps_nal_parse_ctxt->i4_find_nal_state)
  ------------------
  |  Branch (2094:12): [True: 1.27M, False: 2.12k]
  ------------------
 2095|  1.27M|        {
 2096|  1.27M|            if(SVCD_FALSE == ps_nal_parse_ctxt->i4_discard_nal_flag)
  ------------------
  |  |   45|  1.27M|#define SVCD_FALSE 0
  ------------------
  |  Branch (2096:16): [True: 1.24M, False: 29.6k]
  ------------------
 2097|  1.24M|            {
 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.24M|                isvcd_update_nal_ctxt(ps_nal_parse_ctxt, ps_vcl_nal, ps_non_vcl_nal);
 2104|       |
 2105|  1.24M|                UPDATE_NAL_BUF_PTR(ppu1_out_buf, ps_nal_prms->i4_derived_nal_type, pu4_bytes_left);
 2106|  1.24M|            }
 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.27M|            if((PREFIX_UNIT_NAL != ps_nal_prms->i4_nal_unit_type) ||
  ------------------
  |  |   64|  1.27M|#define PREFIX_UNIT_NAL 14
  ------------------
  |  Branch (2114:16): [True: 1.27M, False: 2.25k]
  ------------------
 2115|  2.25k|               (SVCD_TRUE == ps_nal_parse_ctxt->i4_discard_nal_flag))
  ------------------
  |  |   46|  2.25k|#define SVCD_TRUE 1
  ------------------
  |  Branch (2115:16): [True: 1.04k, False: 1.20k]
  ------------------
 2116|  1.27M|            {
 2117|  1.27M|                isvcd_nal_buf_reset(&ps_nal_parse_ctxt->s_prefix_nal_buf);
 2118|  1.27M|            }
 2119|       |
 2120|       |            /* Reset the nal level tracking variables */
 2121|  1.27M|            isvcd_nal_reset_ctxt(ps_nal_parse_ctxt);
 2122|  1.27M|        }
 2123|       |
 2124|       |        /*------------- while loop ends here --------------------------------*/
 2125|  1.27M|    } while(SVCD_TRUE == i4_more_data_flag);
  ------------------
  |  |   46|  1.27M|#define SVCD_TRUE 1
  ------------------
  |  Branch (2125:13): [True: 1.27M, False: 2.12k]
  ------------------
 2126|       |
 2127|   162k|    return (i4_pic_bound_status);
 2128|   163k|}
isvcd_nal_parse_non_vcl_nal:
 2164|   110k|{
 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|   110k|    nal_parse_ctxt_t *ps_nal_parse_ctxt;
 2178|   110k|    non_vcl_nal_t *ps_non_vcl_nal;
 2179|   110k|    nal_unit_t *ps_nal_unit;
 2180|   110k|    WORD32 i4_nal_start_flag, i4_cur_pos, i4_status;
 2181|   110k|    WORD32 i4_nal_header_len, i4_more_data_flag;
 2182|   110k|    UWORD32 u4_bytes_consumed_temp = 0;
 2183|   110k|    UWORD8 **ppu1_out_buf;
 2184|   110k|    nal_prms_t *ps_nal_prms;
 2185|       |
 2186|   110k|    ps_nal_parse_ctxt = (nal_parse_ctxt_t *) pv_nal_parse_ctxt;
 2187|   110k|    ps_non_vcl_nal = (non_vcl_nal_t *) pv_out_non_vcl_nal;
 2188|   110k|    ps_nal_unit = (nal_unit_t *) ps_nal_parse_ctxt->pv_nal_unit;
 2189|   110k|    ps_nal_prms = &ps_nal_parse_ctxt->s_nal_prms;
 2190|       |
 2191|       |    /* Initialization */
 2192|   110k|    i4_cur_pos = 0;
 2193|   110k|    *pu4_bytes_consumed = 0;
 2194|   110k|    i4_nal_header_len = 0;
 2195|   110k|    i4_nal_start_flag = SVCD_FALSE;
  ------------------
  |  |   45|   110k|#define SVCD_FALSE 0
  ------------------
 2196|   110k|    i4_more_data_flag = SVCD_TRUE;
  ------------------
  |  |   46|   110k|#define SVCD_TRUE 1
  ------------------
 2197|   110k|    i4_status = PIC_BOUNDARY_FALSE;
 2198|       |
 2199|       |    /* reset the target layer update flag */
 2200|   110k|    ps_nal_parse_ctxt->i4_tgt_lyr_update = SVCD_FALSE;
  ------------------
  |  |   45|   110k|#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|   110k|    if(ANNEX_B == ps_nal_parse_ctxt->i4_input_bitstream_mode &&
  ------------------
  |  |   64|   110k|#define ANNEX_B 0     /*!< Annex B stream*/
  ------------------
  |  Branch (2211:8): [True: 110k, False: 0]
  ------------------
 2212|   110k|       SVCD_TRUE == ps_nal_parse_ctxt->i4_dec_frst_sc_flag)
  ------------------
  |  |   46|   110k|#define SVCD_TRUE 1
  ------------------
  |  Branch (2212:8): [True: 22.5k, False: 87.6k]
  ------------------
 2213|  22.5k|    {
 2214|  22.5k|        WORD32 i4_status;
 2215|       |
 2216|  22.5k|        i4_status =
 2217|  22.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|  22.5k|        if(i4_status == SC_NOT_FOUND)
  ------------------
  |  |   51|  22.5k|#define SC_NOT_FOUND (-1)
  ------------------
  |  Branch (2223:12): [True: 24, False: 22.4k]
  ------------------
 2224|     24|        {
 2225|     24|            return (VCL_NAL_FOUND_FALSE);
 2226|     24|        }
 2227|       |
 2228|  22.4k|        i4_cur_pos = *pu4_bytes_consumed;
 2229|  22.4k|        ps_nal_parse_ctxt->i4_dec_frst_sc_flag = SVCD_FALSE;
  ------------------
  |  |   45|  22.4k|#define SVCD_FALSE 0
  ------------------
 2230|  22.4k|    }
 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|   110k|    if(ps_nal_parse_ctxt->u4_bytes_left >= (UWORD32) *pu4_num_bytes)
  ------------------
  |  Branch (2237:8): [True: 0, False: 110k]
  ------------------
 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|   110k|    do
 2247|   712k|    {
 2248|   712k|        nal_buf_t *ps_nal_buf;
 2249|   712k|        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|   712k|        if(ANNEX_B == ps_nal_parse_ctxt->i4_input_bitstream_mode)
  ------------------
  |  |   64|   712k|#define ANNEX_B 0     /*!< Annex B stream*/
  ------------------
  |  Branch (2262:12): [True: 712k, False: 0]
  ------------------
 2263|   712k|        {
 2264|   712k|            i4_nal_start_flag = isvcd_get_annex_b_nal_unit(
 2265|   712k|                pu1_stream_buffer, i4_cur_pos, *pu4_num_bytes,
 2266|   712k|                &ps_nal_parse_ctxt->i4_find_nal_state, &ps_nal_parse_ctxt->i4_zero_byte_cnt,
 2267|   712k|                &u4_bytes_consumed_temp, ps_nal_parse_ctxt->pv_nal_unit, &i4_more_data_flag);
 2268|       |
 2269|   712k|            i4_cur_pos += u4_bytes_consumed_temp;
 2270|   712k|        }
 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|   712k|        if(SVCD_TRUE == i4_nal_start_flag)
  ------------------
  |  |   46|   712k|#define SVCD_TRUE 1
  ------------------
  |  Branch (2277:12): [True: 712k, False: 327]
  ------------------
 2278|   712k|        {
 2279|   712k|            UWORD32 u4_err_code;
 2280|   712k|            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|   712k|            isvcd_get_nal_prms(ps_nal_unit->pu1_bufs, ps_nal_unit->i4_buf_sizes, ps_nal_prms,
 2287|   712k|                               &ps_nal_parse_ctxt->s_prefix_nal_prms,
 2288|   712k|                               &ps_nal_parse_ctxt->s_prefix_nal_buf, &u4_err_code,
 2289|   712k|                               &i4_sps_pps_corrupt_status, &ps_nal_parse_ctxt->i4_discard_nal_flag,
 2290|   712k|                               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|   712k|            if((NAL_INSUFFICIENT_DATA == (WORD32) u4_err_code) &&
  ------------------
  |  Branch (2296:16): [True: 7.33k, False: 705k]
  ------------------
 2297|  7.33k|               (NAL_END != ps_nal_parse_ctxt->i4_find_nal_state))
  ------------------
  |  Branch (2297:16): [True: 5.36k, False: 1.96k]
  ------------------
 2298|  5.36k|            {
 2299|  5.36k|                ps_nal_parse_ctxt->u4_bytes_left = *pu4_num_bytes - *pu4_bytes_consumed;
 2300|       |
 2301|       |                /* Reset the NAL level tracking variables */
 2302|  5.36k|                isvcd_nal_reset_ctxt(ps_nal_parse_ctxt);
 2303|  5.36k|                break;
 2304|  5.36k|            }
 2305|   706k|            else if(0 != u4_err_code)
  ------------------
  |  Branch (2305:21): [True: 13.4k, False: 693k]
  ------------------
 2306|  13.4k|            {
 2307|  13.4k|                ps_nal_parse_ctxt->i4_discard_nal_flag = SVCD_TRUE;
  ------------------
  |  |   46|  13.4k|#define SVCD_TRUE 1
  ------------------
 2308|  13.4k|            }
 2309|       |
 2310|       |            /* Populate other paramters based on the nal prms */
 2311|   706k|            ps_nal_parse_ctxt->i4_nal_type = ps_nal_prms->i4_derived_nal_type;
 2312|   706k|            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|   706k|            if(VCL_NAL == ps_nal_prms->i4_derived_nal_type &&
  ------------------
  |  Branch (2315:16): [True: 103k, False: 603k]
  ------------------
 2316|   103k|               PREFIX_UNIT_NAL != ps_nal_prms->i4_nal_unit_type)
  ------------------
  |  |   64|   103k|#define PREFIX_UNIT_NAL 14
  ------------------
  |  Branch (2316:16): [True: 100k, False: 2.50k]
  ------------------
 2317|   100k|            {
 2318|   100k|                isvcd_pic_reset_ctxt(ps_nal_parse_ctxt);
 2319|       |
 2320|   100k|                return (VCL_NAL_FOUND_TRUE);
 2321|   100k|            }
 2322|       |
 2323|       |            /* Set the active NAL buffer structure and initialize */
 2324|       |            /* the nal buffer structure                           */
 2325|   606k|            isvcd_get_nal_buf(ps_nal_parse_ctxt, &ps_nal_buf);
 2326|       |
 2327|   606k|            ps_nal_parse_ctxt->ps_nal_buf = ps_nal_buf;
 2328|   606k|        }
 2329|       |
 2330|       |        /* Update the bytes consumed variable */
 2331|       |
 2332|   606k|        *pu4_bytes_consumed += u4_bytes_consumed_temp;
 2333|       |
 2334|   606k|        ps_nal_buf = ps_nal_parse_ctxt->ps_nal_buf;
 2335|   606k|        if(VCL_NAL == ps_nal_parse_ctxt->i4_nal_type)
  ------------------
  |  Branch (2335:12): [True: 2.50k, False: 604k]
  ------------------
 2336|  2.50k|        {
 2337|  2.50k|            ppu1_out_buf = &ps_nal_parse_ctxt->pu1_vcl_nal_buf;
 2338|  2.50k|            pu4_bytes_left = &ps_nal_parse_ctxt->u4_bytes_left_vcl;
 2339|  2.50k|            if(*pu4_bytes_left < (MAX_VCL_NAL_BUFF_SIZE * 0.05))
  ------------------
  |  |   69|  2.50k|#define MAX_VCL_NAL_BUFF_SIZE (1024 * 1024 * 2)
  ------------------
  |  Branch (2339:16): [True: 0, False: 2.50k]
  ------------------
 2340|      0|            {
 2341|      0|                return (VCL_NAL_FOUND_FALSE);
 2342|      0|            }
 2343|  2.50k|        }
 2344|   604k|        else
 2345|   604k|        {
 2346|   604k|            ppu1_out_buf = &ps_nal_parse_ctxt->pu1_non_vcl_nal_buf;
 2347|   604k|            pu4_bytes_left = &ps_nal_parse_ctxt->u4_bytes_left_non_vcl;
 2348|   604k|            if(*pu4_bytes_left < (MAX_NON_VCL_NAL_BUFF_SIZE * 0.05))
  ------------------
  |  |   70|   604k|#define MAX_NON_VCL_NAL_BUFF_SIZE (1024 * 1024 * 2)
  ------------------
  |  Branch (2348:16): [True: 331, False: 603k]
  ------------------
 2349|    331|            {
 2350|    331|                return (VCL_NAL_FOUND_FALSE);
 2351|    331|            }
 2352|   604k|        }
 2353|       |
 2354|       |        /* if 0 bytes left then discard the current NAL */
 2355|   606k|        if(0 >= (WORD32) *pu4_bytes_left)
  ------------------
  |  Branch (2355:12): [True: 0, False: 606k]
  ------------------
 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|   606k|        if(SVCD_FALSE == ps_nal_parse_ctxt->i4_discard_nal_flag)
  ------------------
  |  |   45|   606k|#define SVCD_FALSE 0
  ------------------
  |  Branch (2366:12): [True: 589k, False: 17.1k]
  ------------------
 2367|   589k|        {
 2368|   589k|            UWORD32 u4_output_bytes, u4_buf_inc;
 2369|       |
 2370|   589k|            {
 2371|   589k|                UWORD32 u4_buf_size;
 2372|       |
 2373|       |                /* clip the size before emulation prevention */
 2374|   589k|                u4_buf_size = (UWORD32) CLIP3(0, (WORD32) *pu4_bytes_left,
  ------------------
  |  |   77|   589k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 0, False: 589k]
  |  |  |  Branch (77:54): [True: 0, False: 589k]
  |  |  ------------------
  ------------------
 2375|   589k|                                              (ps_nal_unit->i4_buf_sizes - i4_nal_header_len));
 2376|       |
 2377|   589k|                u4_buf_inc = isvcd_nal_byte_swap_emulation(
 2378|   589k|                    (UWORD32 *) *ppu1_out_buf, &u4_output_bytes,
 2379|   589k|                    ps_nal_unit->pu1_bufs + i4_nal_header_len, u4_buf_size,
 2380|   589k|                    NUM_OF_ZERO_BYTES_BEFORE_START_CODE, &ps_nal_parse_ctxt->s_emulation_ctxt);
  ------------------
  |  |   54|   589k|#define NUM_OF_ZERO_BYTES_BEFORE_START_CODE (2)
  ------------------
 2381|   589k|                i4_nal_header_len = 0;
 2382|       |
 2383|   589k|                u4_buf_inc = UP_ALIGN_8(u4_buf_inc);
  ------------------
  |  |   51|   589k|#define UP_ALIGN_8(x) (((((UWORD64) x) + 7) >> 3) << 3)
  ------------------
 2384|   589k|                *ppu1_out_buf += u4_buf_inc;
 2385|   589k|                *pu4_bytes_left -= u4_buf_inc;
 2386|   589k|                ps_nal_buf->i4_buf_size += u4_output_bytes;
 2387|   589k|            }
 2388|   589k|        }
 2389|       |
 2390|       |        /*********************************************************************/
 2391|       |        /*                UPDATE VARIABLES                                   */
 2392|       |        /*********************************************************************/
 2393|       |
 2394|   606k|        if(NAL_END == ps_nal_parse_ctxt->i4_find_nal_state)
  ------------------
  |  Branch (2394:12): [True: 602k, False: 3.75k]
  ------------------
 2395|   602k|        {
 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|   602k|            if(SVCD_FALSE == ps_nal_parse_ctxt->i4_discard_nal_flag)
  ------------------
  |  |   45|   602k|#define SVCD_FALSE 0
  ------------------
  |  Branch (2400:16): [True: 586k, False: 16.5k]
  ------------------
 2401|   586k|            {
 2402|   586k|                isvcd_update_nal_ctxt(ps_nal_parse_ctxt, NULL, ps_non_vcl_nal);
 2403|       |
 2404|   586k|                UPDATE_NAL_BUF_PTR(ppu1_out_buf, ps_nal_prms->i4_derived_nal_type, pu4_bytes_left);
 2405|   586k|            }
 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|   602k|            if((PREFIX_UNIT_NAL != ps_nal_prms->i4_nal_unit_type) ||
  ------------------
  |  |   64|   602k|#define PREFIX_UNIT_NAL 14
  ------------------
  |  Branch (2413:16): [True: 599k, False: 3.35k]
  ------------------
 2414|  3.35k|               (SVCD_TRUE == ps_nal_parse_ctxt->i4_discard_nal_flag))
  ------------------
  |  |   46|  3.35k|#define SVCD_TRUE 1
  ------------------
  |  Branch (2414:16): [True: 878, False: 2.48k]
  ------------------
 2415|   600k|            {
 2416|   600k|                isvcd_nal_buf_reset(&ps_nal_parse_ctxt->s_prefix_nal_buf);
 2417|   600k|            }
 2418|       |
 2419|       |            /* Reset NAL level tracking variables */
 2420|   602k|            isvcd_nal_reset_ctxt(ps_nal_parse_ctxt);
 2421|   602k|        }
 2422|       |
 2423|   606k|        i4_nal_header_len = 0;
 2424|       |        /*------------- while loop ends here --------------------------------*/
 2425|   606k|    } while(SVCD_TRUE == i4_more_data_flag);
  ------------------
  |  |   46|   606k|#define SVCD_TRUE 1
  ------------------
  |  Branch (2425:13): [True: 602k, False: 3.75k]
  ------------------
 2426|       |
 2427|  9.12k|    if(i4_more_data_flag == 0)
  ------------------
  |  Branch (2427:8): [True: 9.12k, False: 0]
  ------------------
 2428|  9.12k|    {
 2429|  9.12k|        isvcd_pic_reset_ctxt(ps_nal_parse_ctxt);
 2430|  9.12k|        return (VCL_NAL_FOUND_TRUE);
 2431|  9.12k|    }
 2432|       |
 2433|      0|    return (VCL_NAL_FOUND_FALSE);
 2434|  9.12k|}

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

isvcd_parse_bmb_ref_index_cavlc_range1:
   90|  5.56k|{
   91|  5.56k|    UWORD32 u4_i;
   92|  5.56k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
   93|  5.56k|    UWORD32 *pu4_bitstream_off = &ps_bitstrm->u4_ofst;
   94|  5.56k|    UNUSED(u4_num_ref_idx_active_minus1);
  ------------------
  |  |   45|  5.56k|#define UNUSED(x) ((void)(x))
  ------------------
   95|  12.8k|    for(u4_i = 0; u4_i < u4_num_part; u4_i++)
  ------------------
  |  Branch (95:19): [True: 7.25k, False: 5.56k]
  ------------------
   96|  7.25k|    {
   97|  7.25k|        if(pi1_ref_idx[u4_i] > -1 && (((*pu1_motion_prediction_flag >> u4_i) & 0x01) == 0))
  ------------------
  |  Branch (97:12): [True: 2.87k, False: 4.37k]
  |  Branch (97:38): [True: 1.14k, False: 1.73k]
  ------------------
   98|  1.14k|        {
   99|  1.14k|            UWORD32 u4_ref_idx;
  100|  1.14k|            u4_ref_idx = ih264d_tev_range1(pu4_bitstream_off, pu4_bitstrm_buf);
  101|       |
  102|       |            /* Storing Reference Idx Information */
  103|  1.14k|            pi1_ref_idx[u4_i] = (WORD8) u4_ref_idx;
  104|  1.14k|        }
  105|  7.25k|    }
  106|  5.56k|}
isvcd_parse_bmb_ref_index_cavlc:
  138|  10.8k|{
  139|  10.8k|    UWORD32 u4_i;
  140|  10.8k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
  141|  10.8k|    UWORD32 *pu4_bitstream_off = &ps_bitstrm->u4_ofst;
  142|       |
  143|  27.3k|    for(u4_i = 0; u4_i < u4_num_part; u4_i++)
  ------------------
  |  Branch (143:19): [True: 17.7k, False: 9.62k]
  ------------------
  144|  17.7k|    {
  145|  17.7k|        if(pi1_ref_idx[u4_i] > -1 && (((*pu1_motion_prediction_flag >> u4_i) & 0x01) == 0))
  ------------------
  |  Branch (145:12): [True: 9.04k, False: 8.68k]
  |  Branch (145:38): [True: 5.69k, False: 3.34k]
  ------------------
  146|  5.69k|        {
  147|  5.69k|            UWORD32 u4_ref_idx;
  148|       |            // inlining ih264d_uev
  149|  5.69k|            UWORD32 u4_bitstream_offset = *pu4_bitstream_off;
  150|  5.69k|            UWORD32 u4_word, u4_ldz;
  151|       |
  152|       |            /***************************************************************/
  153|       |            /* Find leading zeros in next 32 bits                          */
  154|       |            /***************************************************************/
  155|  5.69k|            NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  5.69k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  5.69k|{                                                                           \
  |  |  152|  5.69k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  5.69k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  5.69k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  5.69k|                                                                            \
  |  |  156|  5.69k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  5.69k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 5.41k, False: 283]
  |  |  ------------------
  |  |  158|  5.69k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  5.41k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  5.69k|}
  ------------------
  156|  5.69k|            u4_ldz = CLZ(u4_word);
  157|       |            /* Flush the ps_bitstrm */
  158|  5.69k|            u4_bitstream_offset += (u4_ldz + 1);
  159|       |            /* Read the suffix from the ps_bitstrm */
  160|  5.69k|            u4_word = 0;
  161|  5.69k|            if(u4_ldz) GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  3.95k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  3.95k|{                                                                           \
  |  |  122|  3.95k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  3.95k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  3.95k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  3.95k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  3.95k|                                                                            \
  |  |  127|  3.95k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 3.60k, False: 350]
  |  |  ------------------
  |  |  128|  3.95k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  3.60k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  3.95k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  3.95k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  3.95k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  3.95k|}                                                                           \
  ------------------
  |  Branch (161:16): [True: 3.95k, False: 1.73k]
  ------------------
  162|  5.69k|            *pu4_bitstream_off = u4_bitstream_offset;
  163|  5.69k|            u4_ref_idx = ((1 << u4_ldz) + u4_word - 1);
  164|       |            // inlining ih264d_uev
  165|  5.69k|            if(u4_ref_idx > u4_num_ref_idx_active_minus1) return ERROR_REF_IDX;
  ------------------
  |  Branch (165:16): [True: 1.22k, False: 4.46k]
  ------------------
  166|       |
  167|       |            /* Storing Reference Idx Information */
  168|  4.46k|            pi1_ref_idx[u4_i] = (WORD8) u4_ref_idx;
  169|  4.46k|        }
  170|  17.7k|    }
  171|  9.62k|    return OK;
  ------------------
  |  |  114|  9.62k|#define OK        0
  ------------------
  172|  10.8k|}
isvcd_parse_pmb_ref_index_cavlc:
  205|  9.64k|{
  206|  9.64k|    UWORD32 u4_i;
  207|  9.64k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
  208|  9.64k|    UWORD32 *pu4_bitstream_off = &ps_bitstrm->u4_ofst;
  209|       |
  210|  24.7k|    for(u4_i = 0; u4_i < u4_num_part; u4_i++)
  ------------------
  |  Branch (210:19): [True: 15.3k, False: 9.41k]
  ------------------
  211|  15.3k|    {
  212|  15.3k|        if(((*pu1_motion_prediction_flag >> u4_i) & 0x01) == 0)
  ------------------
  |  Branch (212:12): [True: 8.28k, False: 7.06k]
  ------------------
  213|  8.28k|        {
  214|  8.28k|            UWORD32 u4_ref_idx;
  215|       |            // Inlined ih264d_uev
  216|  8.28k|            UWORD32 u4_bitstream_offset = *pu4_bitstream_off;
  217|  8.28k|            UWORD32 u4_word, u4_ldz;
  218|       |
  219|       |            /***************************************************************/
  220|       |            /* Find leading zeros in next 32 bits                          */
  221|       |            /***************************************************************/
  222|  8.28k|            NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  8.28k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  8.28k|{                                                                           \
  |  |  152|  8.28k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  8.28k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  8.28k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  8.28k|                                                                            \
  |  |  156|  8.28k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  8.28k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 7.96k, False: 323]
  |  |  ------------------
  |  |  158|  8.28k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  7.96k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  8.28k|}
  ------------------
  223|  8.28k|            u4_ldz = CLZ(u4_word);
  224|       |            /* Flush the ps_bitstrm */
  225|  8.28k|            u4_bitstream_offset += (u4_ldz + 1);
  226|       |            /* Read the suffix from the ps_bitstrm */
  227|  8.28k|            u4_word = 0;
  228|  8.28k|            if(u4_ldz) GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  3.29k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  3.29k|{                                                                           \
  |  |  122|  3.29k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  3.29k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  3.29k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  3.29k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  3.29k|                                                                            \
  |  |  127|  3.29k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 2.80k, False: 499]
  |  |  ------------------
  |  |  128|  3.29k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  2.80k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  3.29k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  3.29k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  3.29k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  3.29k|}                                                                           \
  ------------------
  |  Branch (228:16): [True: 3.29k, False: 4.98k]
  ------------------
  229|  8.28k|            *pu4_bitstream_off = u4_bitstream_offset;
  230|  8.28k|            u4_ref_idx = ((1 << u4_ldz) + u4_word - 1);
  231|       |
  232|       |            // Inlined ih264d_uev
  233|  8.28k|            if(u4_ref_idx > u4_num_ref_idx_active_minus1) return ERROR_REF_IDX;
  ------------------
  |  Branch (233:16): [True: 232, False: 8.05k]
  ------------------
  234|       |
  235|       |            /* Storing Reference Idx Information */
  236|  8.05k|            pi1_ref_idx[u4_i] = (WORD8) u4_ref_idx;
  237|  8.05k|        }
  238|  15.3k|    }
  239|  9.41k|    return OK;
  ------------------
  |  |  114|  9.41k|#define OK        0
  ------------------
  240|  9.64k|}
isvcd_parse_pmb_ref_index_cavlc_range1:
  272|  3.44k|{
  273|  3.44k|    UWORD32 u4_i;
  274|  3.44k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
  275|  3.44k|    UWORD32 *pu4_bitstream_off = &ps_bitstrm->u4_ofst;
  276|  3.44k|    UNUSED(u4_num_ref_idx_active_minus1);
  ------------------
  |  |   45|  3.44k|#define UNUSED(x) ((void)(x))
  ------------------
  277|  10.0k|    for(u4_i = 0; u4_i < u4_num_part; u4_i++)
  ------------------
  |  Branch (277:19): [True: 6.57k, False: 3.44k]
  ------------------
  278|  6.57k|    {
  279|  6.57k|        if(((*pu1_motion_prediction_flag >> u4_i) & 0x01) == 0)
  ------------------
  |  Branch (279:12): [True: 1.98k, False: 4.59k]
  ------------------
  280|  1.98k|        {
  281|  1.98k|            UWORD32 u4_ref_idx;
  282|  1.98k|            u4_ref_idx = ih264d_tev_range1(pu4_bitstream_off, pu4_bitstrm_buf);
  283|       |
  284|       |            /* Storing Reference Idx Information */
  285|  1.98k|            pi1_ref_idx[u4_i] = (WORD8) u4_ref_idx;
  286|  1.98k|        }
  287|  6.57k|    }
  288|  3.44k|}

isvcd_parse_bmb_cabac:
  102|  13.8k|{
  103|  13.8k|    UWORD8 u1_cbp = 0;
  104|  13.8k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
  105|  13.8k|    deblk_mb_t *ps_cur_deblk_mb = ps_dec->ps_deblk_mbn + u4_mb_num;
  106|  13.8k|    const UWORD8 *puc_mb_mc_mode = (const UWORD8 *) gau1_ih264d_mb_mc_mode;
  107|  13.8k|    UWORD8 u1_mb_type = ps_cur_mb_info->u1_mb_type;
  108|  13.8k|    ctxt_inc_mb_info_t *p_curr_ctxt = ps_dec->ps_curr_ctxt_mb_info;
  109|  13.8k|    dec_bit_stream_t *ps_bitstrm = ps_dec->ps_bitstrm;
  110|  13.8k|    decoding_envirnoment_t *ps_cab_env = &ps_dec->s_cab_dec_env;
  111|  13.8k|    WORD32 ret;
  112|  13.8k|    UWORD8 u1_Bdirect_tranform_read = 1;
  113|  13.8k|    dec_slice_svc_ext_params_t *ps_svc_slice_params = NULL;
  114|       |
  115|  13.8k|    ps_svc_slice_params = &ps_svc_lyr_dec->s_svc_slice_params;
  116|  13.8k|    ps_dec->s_high_profile.u1_no_submb_part_size_lt8x8_flag = 1;
  117|  13.8k|    ps_cur_mb_info->u1_mb_mc_mode = puc_mb_mc_mode[5 + u1_mb_type];
  118|  13.8k|    ps_cur_mb_info->u1_yuv_dc_block_flag = 0;
  119|  13.8k|    ps_cur_deblk_mb->u1_mb_type |= D_B_SLICE;
  ------------------
  |  |  384|  13.8k|#define D_B_SLICE         4
  ------------------
  120|       |
  121|  13.8k|    if(u1_mb_type != B_DIRECT)
  ------------------
  |  |  482|  13.8k|#define B_DIRECT  0
  ------------------
  |  Branch (121:8): [True: 12.8k, False: 961]
  ------------------
  122|  12.8k|    {
  123|  12.8k|        ret = isvcd_parse_bmb_non_direct_cabac(ps_svc_lyr_dec, ps_cur_mb_info, ps_svc_cur_mb_info,
  124|  12.8k|                                               u4_mb_num, u4_num_mbsNby2);
  125|  12.8k|        if(ret != OK) return ret;
  ------------------
  |  |  114|  12.8k|#define OK        0
  ------------------
  |  Branch (125:12): [True: 209, False: 12.6k]
  ------------------
  126|  12.8k|    }
  127|    961|    else
  128|    961|    {
  129|       |        /************ STORING PARTITION INFO ***********/
  130|    961|        parse_part_params_t *ps_part_info;
  131|    961|        ps_part_info = ps_dec->ps_part;
  132|    961|        ps_part_info->u1_is_direct = PART_DIRECT_16x16;
  ------------------
  |  |  572|    961|#define PART_DIRECT_16x16              2
  ------------------
  133|    961|        ps_part_info->u1_sub_mb_num = 0;
  134|    961|        ps_dec->ps_part++;
  135|    961|        p_curr_ctxt->u1_mb_type = CAB_BD16x16;
  ------------------
  |  |  396|    961|#define CAB_BD16x16       0x04 /* 0000 0100 */
  ------------------
  136|       |
  137|    961|        MEMSET_16BYTES(&ps_dec->pu1_left_mv_ctxt_inc[0][0], 0);
  ------------------
  |  |  652|    961|#define MEMSET_16BYTES(pu4_start,value)                         \
  |  |  653|    961|{                                                               \
  |  |  654|    961|    memset(pu4_start,value,16);                                 \
  |  |  655|    961|}
  ------------------
  138|    961|        memset(ps_dec->pi1_left_ref_idx_ctxt_inc, 0, 4);
  139|    961|        MEMSET_16BYTES(p_curr_ctxt->u1_mv, 0);
  ------------------
  |  |  652|    961|#define MEMSET_16BYTES(pu4_start,value)                         \
  |  |  653|    961|{                                                               \
  |  |  654|    961|    memset(pu4_start,value,16);                                 \
  |  |  655|    961|}
  ------------------
  140|    961|        memset(p_curr_ctxt->i1_ref_idx, 0, 4);
  141|       |
  142|       |        /* check whether transform8x8 u4_flag to be read or not */
  143|    961|        u1_Bdirect_tranform_read = ps_dec->s_high_profile.u1_direct_8x8_inference_flag;
  144|    961|    }
  145|       |
  146|  13.6k|    if(ps_svc_slice_params->u1_adaptive_residual_prediction_flag &&
  ------------------
  |  Branch (146:8): [True: 3.21k, False: 10.3k]
  ------------------
  147|  3.21k|       ps_svc_cur_mb_info->u1_crop_window_flag)
  ------------------
  |  Branch (147:8): [True: 3.02k, False: 198]
  ------------------
  148|  3.02k|    {
  149|  3.02k|        ps_svc_cur_mb_info->u1_residual_prediction_flag = ih264d_decode_bin(
  150|  3.02k|            1, ps_svc_lyr_dec->ps_residual_prediction_flag, ps_bitstrm, ps_cab_env);
  151|  3.02k|        COPYTHECONTEXT("SVC ext: u1_residual_prediction_flag",
  152|  3.02k|                       ps_svc_cur_mb_info->u1_residual_prediction_flag);
  153|  3.02k|    }
  154|  10.5k|    else
  155|  10.5k|    {
  156|       |        /*residual flag inference code */
  157|  10.5k|        if(1 == ps_svc_cur_mb_info->u1_crop_window_flag &&
  ------------------
  |  Branch (157:12): [True: 10.3k, False: 198]
  ------------------
  158|  10.3k|           1 == ps_svc_cur_mb_info->u1_base_mode_flag)
  ------------------
  |  Branch (158:12): [True: 0, False: 10.3k]
  ------------------
  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.5k|        else
  164|  10.5k|        {
  165|  10.5k|            ps_svc_cur_mb_info->u1_residual_prediction_flag = 0;
  166|  10.5k|        }
  167|  10.5k|    }
  168|       |
  169|  13.6k|    if(ps_svc_slice_params->u1_scan_idx_end >= ps_svc_slice_params->u1_scan_idx_start)
  ------------------
  |  Branch (169:8): [True: 13.6k, False: 0]
  ------------------
  170|  13.6k|    {
  171|       |        /* Read the Coded block pattern */
  172|  13.6k|        u1_cbp = (WORD8) ih264d_parse_ctx_cbp_cabac(ps_dec);
  173|  13.6k|        p_curr_ctxt->u1_cbp = u1_cbp;
  174|  13.6k|        ps_cur_mb_info->u1_cbp = u1_cbp;
  175|       |
  176|  13.6k|        if(u1_cbp > 47) return ERROR_CBP;
  ------------------
  |  Branch (176:12): [True: 0, False: 13.6k]
  ------------------
  177|  13.6k|        COPYTHECONTEXT("coded_block_pattern", u1_cbp);
  178|       |
  179|  13.6k|        ps_cur_mb_info->u1_tran_form8x8 = 0;
  180|  13.6k|        ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = 0;
  181|       |
  182|  13.6k|        if((ps_dec->s_high_profile.u1_transform8x8_present) && (u1_cbp & (0xf)) &&
  ------------------
  |  Branch (182:12): [True: 2.93k, False: 10.6k]
  |  Branch (182:64): [True: 2.22k, False: 703]
  ------------------
  183|  2.22k|           (ps_dec->s_high_profile.u1_no_submb_part_size_lt8x8_flag) && (u1_Bdirect_tranform_read))
  ------------------
  |  Branch (183:12): [True: 1.89k, False: 333]
  |  Branch (183:73): [True: 1.32k, False: 572]
  ------------------
  184|  1.32k|        {
  185|  1.32k|            ps_cur_mb_info->u1_tran_form8x8 =
  186|  1.32k|                ih264d_parse_transform8x8flag_cabac(ps_dec, ps_cur_mb_info);
  187|  1.32k|            COPYTHECONTEXT("transform_size_8x8_flag", ps_cur_mb_info->u1_tran_form8x8);
  188|       |
  189|  1.32k|            ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = ps_cur_mb_info->u1_tran_form8x8;
  190|  1.32k|            p_curr_ctxt->u1_transform8x8_ctxt = ps_cur_mb_info->u1_tran_form8x8;
  191|  1.32k|        }
  192|  12.2k|        else
  193|  12.2k|        {
  194|  12.2k|            p_curr_ctxt->u1_transform8x8_ctxt = 0;
  195|  12.2k|        }
  196|  13.6k|    }
  197|       |
  198|  13.6k|    p_curr_ctxt->u1_intra_chroma_pred_mode = 0;
  199|  13.6k|    p_curr_ctxt->u1_yuv_dc_csbp &= 0xFE;
  200|  13.6k|    ps_dec->pu1_left_yuv_dc_csbp[0] &= 0x6;
  201|       |
  202|       |    /* Read mb_qp_delta */
  203|  13.6k|    if(u1_cbp)
  ------------------
  |  Branch (203:8): [True: 4.17k, False: 9.44k]
  ------------------
  204|  4.17k|    {
  205|  4.17k|        WORD8 c_temp;
  206|  4.17k|        ret = ih264d_parse_mb_qp_delta_cabac(ps_dec, &c_temp);
  207|  4.17k|        if(ret != OK) return ret;
  ------------------
  |  |  114|  4.17k|#define OK        0
  ------------------
  |  Branch (207:12): [True: 85, False: 4.08k]
  ------------------
  208|  4.08k|        COPYTHECONTEXT("mb_qp_delta", c_temp);
  209|  4.08k|        if(c_temp)
  ------------------
  |  Branch (209:12): [True: 1.35k, False: 2.73k]
  ------------------
  210|  1.35k|        {
  211|  1.35k|            ret = ih264d_update_qp(ps_dec, c_temp);
  212|  1.35k|            if(ret != OK) return ret;
  ------------------
  |  |  114|  1.35k|#define OK        0
  ------------------
  |  Branch (212:16): [True: 0, False: 1.35k]
  ------------------
  213|  1.35k|        }
  214|  4.08k|    }
  215|  9.44k|    else
  216|  9.44k|        ps_dec->i1_prev_mb_qp_delta = 0;
  217|       |
  218|       |    /*RESIDUAL FOR Start to end idx*/
  219|  13.5k|    ih264d_parse_residual4x4_cabac(ps_dec, ps_cur_mb_info, 0);
  220|  13.5k|    if(EXCEED_OFFSET(ps_dec->ps_bitstrm)) return ERROR_EOB_TERMINATE_T;
  ------------------
  |  |   93|  13.5k|  (ps_bitstrm->u4_ofst > ps_bitstrm->u4_max_ofst)
  |  |  ------------------
  |  |  |  Branch (93:3): [True: 598, False: 12.9k]
  |  |  ------------------
  ------------------
  221|  12.9k|    return OK;
  ------------------
  |  |  114|  12.9k|#define OK        0
  ------------------
  222|  13.5k|}
isvcd_mv_pred_ref_tfr_nby2_ebmb:
  235|  39.7k|{
  236|  39.7k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec = (svc_dec_lyr_struct_t *) ps_dec;
  237|  39.7k|    parse_pmbarams_t *ps_mb_part_info;
  238|  39.7k|    parse_part_params_t *ps_part;
  239|  39.7k|    mv_pred_t *ps_mv_nmb, *ps_mv_nmb_start, *ps_mv_ntop, *ps_mv_ntop_start;
  240|  39.7k|    pic_buffer_t *ps_ref_frame;
  241|  39.7k|    UWORD8 u1_direct_mode_width;
  242|  39.7k|    UWORD8 i, j;
  243|  39.7k|    dec_mb_info_t *ps_cur_mb_info;
  244|  39.7k|    dec_svc_mb_info_t *ps_svc_cur_mb_info;
  245|  39.7k|    const UWORD8 u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
  246|  39.7k|    UWORD8 u1_field;
  247|  39.7k|    WORD32 ret = 0;
  248|  39.7k|    WORD16 i2_mv_x, i2_mv_y;
  249|       |
  250|  39.7k|    ps_dec->i4_submb_ofst -= (u4_num_mbs - u4_mb_idx) << 4;
  251|  39.7k|    ps_mb_part_info = ps_dec->ps_parse_mb_data;
  252|  39.7k|    ps_part = ps_dec->ps_parse_part_params;
  253|       |
  254|       |    /* N/2 Mb MvPred and Transfer Setup Loop */
  255|   171k|    for(i = u4_mb_idx; i < u4_num_mbs; i++, ps_mb_part_info++)
  ------------------
  |  Branch (255:24): [True: 132k, False: 39.3k]
  ------------------
  256|   132k|    {
  257|   132k|        UWORD8 u1_colz = 0;
  258|   132k|        ps_dec->i4_submb_ofst += SUB_BLK_SIZE;
  ------------------
  |  |  562|   132k|#define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|   132k|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  |  |               #define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|   132k|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  ------------------
  259|       |        /* Restore the slice scratch MbX and MbY context */
  260|   132k|        ps_cur_mb_info = ps_dec->ps_nmb_info + i;
  261|   132k|        ps_svc_cur_mb_info = ps_svc_lyr_dec->ps_svc_nmb_info + i;
  262|   132k|        u1_field = ps_cur_mb_info->u1_mb_field_decodingflag;
  263|   132k|        ps_mv_nmb_start = ps_dec->ps_mv_cur + (i << 4);
  264|   132k|        ps_dec->u2_mbx = ps_cur_mb_info->u2_mbx;
  265|   132k|        ps_dec->u2_mby = ps_cur_mb_info->u2_mby;
  266|   132k|        ps_dec->u1_currB_type = 0;
  267|   132k|        ps_dec->u2_mv_2mb[i & 0x1] = 0;
  268|       |
  269|       |        /* Look for MV Prediction and Reference Transfer in Non-I Mbs */
  270|   132k|        if(!ps_mb_part_info->u4_isI_mb)
  ------------------
  |  Branch (270:12): [True: 131k, False: 499]
  ------------------
  271|   131k|        {
  272|   131k|            UWORD8 u1_blk_no;
  273|   131k|            WORD16 i1_ref_idx, i1_ref_idx1;
  274|   131k|            UWORD8 u1_pred_mode;
  275|   131k|            UWORD8 u1_sub_mb_x, u1_sub_mb_y, u1_sub_mb_num;
  276|   131k|            UWORD8 u1_lx, u1_lx_start, u1_lxend, u1_tmp_lx;
  277|   131k|            UWORD8 u1_num_part, u1_num_ref, u1_wd, u1_ht;
  278|   131k|            UWORD32 *pu4_wt_offst;
  279|   131k|            UWORD8 u1_scale_ref, u4_bot_mb;
  280|   131k|            deblk_mb_t *ps_cur_deblk_mb = ps_dec->ps_deblk_mbn + i;
  281|   131k|            WORD8(*pi1_ref_idx)[MAX_REFIDX_INFO_PER_MB] = ps_mb_part_info->i1_ref_idx;
  282|   131k|            WORD8 *pi1_ref_idx0 = pi1_ref_idx[0], *pi1_ref_idx1 = pi1_ref_idx[1];
  283|   131k|            UWORD32 **ppu4_wt_ofst = ps_mb_part_info->pu4_wt_offst;
  284|   131k|            WORD32 i4_mb_mode_svc;
  285|   131k|            UWORD8 u1_motion_pred_flag_l0 = ps_svc_cur_mb_info->au1_motion_pred_flag[0];
  286|   131k|            UWORD8 u1_motion_pred_flag_l1 = ps_svc_cur_mb_info->au1_motion_pred_flag[1];
  287|       |
  288|       |            /* MB Level initialisations */
  289|   131k|            ps_dec->u4_num_pmbair = i >> u1_mbaff;
  290|   131k|            ps_dec->u4_mb_idx_mv = i;
  291|       |
  292|   131k|            i4_mb_mode_svc = isvcd_interlyr_motion_mode_pred(
  293|   131k|                ps_svc_lyr_dec, ps_cur_mb_info, ps_svc_cur_mb_info, ps_mb_part_info, ps_part);
  294|       |
  295|   131k|            if((-1 == i4_mb_mode_svc) || (SVC_INTER_MB == i4_mb_mode_svc))
  ------------------
  |  |  114|  34.2k|#define SVC_INTER_MB (1 << 0)       /*!< Intra MBs other than IPCM and I_BL */
  ------------------
  |  Branch (295:16): [True: 97.3k, False: 34.2k]
  |  Branch (295:42): [True: 31.4k, False: 2.82k]
  ------------------
  296|   128k|            {
  297|   128k|                ps_mv_ntop_start =
  298|   128k|                    ps_mv_nmb_start - (ps_dec->u2_frm_wd_in_mbs << (4 + u1_mbaff)) + 12;
  299|       |
  300|   128k|                u1_num_part = ps_mb_part_info->u1_num_part;
  301|   128k|                ps_cur_deblk_mb->u1_mb_type |= (u1_num_part > 1) << 1;
  302|   128k|                u1_direct_mode_width = (1 == ps_mb_part_info->u1_num_part) ? 16 : 8;
  ------------------
  |  Branch (302:40): [True: 106k, False: 21.8k]
  ------------------
  303|       |
  304|   128k|                ps_cur_mb_info->u4_pred_info_pkd_idx = ps_dec->u4_pred_info_pkd_idx;
  305|   128k|                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|   128k|                u1_scale_ref = u1_mbaff & ps_cur_mb_info->u1_mb_field_decodingflag;
  312|   128k|                u4_bot_mb = 1 - ps_cur_mb_info->u1_topmb;
  313|   128k|                if(ps_dec->ps_cur_pps->u1_wted_bipred_idc)
  ------------------
  |  Branch (313:20): [True: 77.2k, False: 51.5k]
  ------------------
  314|  77.2k|                {
  315|  77.2k|                    u1_num_ref = MIN(u1_num_part, 4);
  ------------------
  |  |   61|  77.2k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 69.7k, False: 7.47k]
  |  |  ------------------
  ------------------
  316|  77.2k|                    if(PART_DIRECT_16x16 != ps_part->u1_is_direct)
  ------------------
  |  |  572|  77.2k|#define PART_DIRECT_16x16              2
  ------------------
  |  Branch (316:24): [True: 36.5k, False: 40.6k]
  ------------------
  317|  36.5k|                    {
  318|   102k|                        for(u1_blk_no = 0; u1_blk_no < u1_num_ref; u1_blk_no++)
  ------------------
  |  Branch (318:44): [True: 66.2k, False: 36.5k]
  ------------------
  319|  66.2k|                        {
  320|  66.2k|                            i1_ref_idx = MAX(pi1_ref_idx0[u1_blk_no], 0);
  ------------------
  |  |   60|  66.2k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 6.50k, False: 59.7k]
  |  |  ------------------
  ------------------
  321|  66.2k|                            if(u1_scale_ref) i1_ref_idx >>= 1;
  ------------------
  |  Branch (321:32): [True: 0, False: 66.2k]
  ------------------
  322|  66.2k|                            i1_ref_idx *= ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[1];
  323|  66.2k|                            if(u1_scale_ref)
  ------------------
  |  Branch (323:32): [True: 0, False: 66.2k]
  ------------------
  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.2k|                            else
  326|  66.2k|                                i1_ref_idx += MAX(pi1_ref_idx1[u1_blk_no], 0);
  ------------------
  |  |   60|  66.2k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 1.38k, False: 64.9k]
  |  |  ------------------
  ------------------
  327|  66.2k|                            pu4_wt_offst = (UWORD32 *) &ps_dec->pu4_wt_ofsts[2 * X3(i1_ref_idx)];
  ------------------
  |  |   92|  66.2k|#define X3(a)   (((a) << 1) + (a))
  ------------------
  328|       |
  329|  66.2k|                            if(pi1_ref_idx0[u1_blk_no] < 0) pu4_wt_offst += 1;
  ------------------
  |  Branch (329:32): [True: 20.1k, False: 46.1k]
  ------------------
  330|       |
  331|  66.2k|                            ppu4_wt_ofst[u1_blk_no] = pu4_wt_offst;
  332|  66.2k|                            if(u1_scale_ref && (ps_dec->ps_cur_pps->u1_wted_bipred_idc == 2))
  ------------------
  |  Branch (332:32): [True: 0, False: 66.2k]
  |  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.2k|                        }
  349|  36.5k|                    }
  350|  77.2k|                }
  351|       |
  352|       |                /**************************************************/
  353|       |                /* Loop on Partitions                             */
  354|       |                /* direct mode is reflected as a single partition */
  355|       |                /**************************************************/
  356|   306k|                for(j = 0; j < u1_num_part; j++, ps_part++)
  ------------------
  |  Branch (356:28): [True: 178k, False: 128k]
  ------------------
  357|   178k|                {
  358|   178k|                    u1_sub_mb_num = ps_part->u1_sub_mb_num;
  359|   178k|                    ps_dec->u1_sub_mb_num = u1_sub_mb_num;
  360|       |
  361|   178k|                    if(PART_NOT_DIRECT != ps_part->u1_is_direct)
  ------------------
  |  |  570|   178k|#define PART_NOT_DIRECT                0
  ------------------
  |  Branch (361:24): [True: 78.3k, False: 99.7k]
  ------------------
  362|  78.3k|                    {
  363|       |                        /**************************************************/
  364|       |                        /* Direct Mode, Call DecodeSpatial/TemporalDirect */
  365|       |                        /* only (those will in turn call FormMbPartInfo)  */
  366|       |                        /**************************************************/
  367|  78.3k|                        ret = isvcd_decode_spatial_direct(ps_dec, u1_direct_mode_width,
  368|  78.3k|                                                          ps_cur_mb_info, i);
  369|  78.3k|                        if(ret != OK) return ret;
  ------------------
  |  |  114|  78.3k|#define OK        0
  ------------------
  |  Branch (369:28): [True: 0, False: 78.3k]
  ------------------
  370|  78.3k|                        ps_cur_deblk_mb->u1_mb_type |= (ps_dec->u1_currB_type << 1);
  371|  78.3k|                    }
  372|  99.7k|                    else
  373|  99.7k|                    {
  374|  99.7k|                        mv_pred_t s_mvPred = {0};
  375|       |                        /**************************************************/
  376|       |                        /* Non Direct Mode, Call Motion Vector Predictor  */
  377|       |                        /* and FormMbpartInfo                             */
  378|       |                        /**************************************************/
  379|  99.7k|                        u1_sub_mb_x = u1_sub_mb_num & 0x03;
  380|  99.7k|                        u1_sub_mb_y = u1_sub_mb_num >> 2;
  381|  99.7k|                        u1_blk_no = (u1_num_part < 4)
  ------------------
  |  Branch (381:37): [True: 57.6k, False: 42.1k]
  ------------------
  382|  99.7k|                                        ? j
  383|  99.7k|                                        : (((u1_sub_mb_y >> 1) << 1) + (u1_sub_mb_x >> 1));
  384|       |
  385|  99.7k|                        ps_mv_ntop = ps_mv_ntop_start + u1_sub_mb_x;
  386|  99.7k|                        ps_mv_nmb = ps_mv_nmb_start + u1_sub_mb_num;
  387|       |
  388|       |                        /* Populate the colpic info and reference frames */
  389|  99.7k|                        s_mvPred.i1_ref_frame[0] = pi1_ref_idx0[u1_blk_no];
  390|  99.7k|                        s_mvPred.i1_ref_frame[1] = pi1_ref_idx1[u1_blk_no];
  391|  99.7k|                        u1_pred_mode = ps_part->u1_pred_mode;
  392|  99.7k|                        u1_wd = ps_part->u1_partwidth;
  393|  99.7k|                        u1_ht = ps_part->u1_partheight;
  394|       |
  395|  99.7k|                        if(1 != ps_svc_cur_mb_info->u1_base_mode_flag)
  ------------------
  |  Branch (395:28): [True: 47.7k, False: 52.0k]
  ------------------
  396|  47.7k|                        {
  397|  47.7k|                            u1_lx_start = 0;
  398|  47.7k|                            u1_lxend = 2;
  399|  47.7k|                            if(PRED_L0 == u1_pred_mode)
  ------------------
  |  |  483|  47.7k|#define PRED_L0   1
  ------------------
  |  Branch (399:32): [True: 17.7k, False: 29.9k]
  ------------------
  400|  17.7k|                            {
  401|  17.7k|                                s_mvPred.i2_mv[2] = 0;
  402|  17.7k|                                s_mvPred.i2_mv[3] = 0;
  403|  17.7k|                                if(0 == (u1_motion_pred_flag_l0 & (1 << u1_blk_no)))
  ------------------
  |  Branch (403:36): [True: 10.4k, False: 7.33k]
  ------------------
  404|  10.4k|                                {
  405|  10.4k|                                    u1_lxend = 1;
  406|  10.4k|                                }
  407|  7.33k|                                else
  408|  7.33k|                                {
  409|  7.33k|                                    u1_lxend = 0;
  410|  7.33k|                                }
  411|  17.7k|                            }
  412|  29.9k|                            else if(PRED_L1 == u1_pred_mode)
  ------------------
  |  |  484|  29.9k|#define PRED_L1   2
  ------------------
  |  Branch (412:37): [True: 20.7k, False: 9.26k]
  ------------------
  413|  20.7k|                            {
  414|  20.7k|                                s_mvPred.i2_mv[0] = 0;
  415|  20.7k|                                s_mvPred.i2_mv[1] = 0;
  416|  20.7k|                                if(0 == (u1_motion_pred_flag_l1 & (1 << u1_blk_no)))
  ------------------
  |  Branch (416:36): [True: 16.7k, False: 3.99k]
  ------------------
  417|  16.7k|                                {
  418|  16.7k|                                    u1_lx_start = 1;
  419|  16.7k|                                }
  420|  3.99k|                                else
  421|  3.99k|                                {
  422|  3.99k|                                    u1_lx_start = 2;
  423|  3.99k|                                }
  424|  20.7k|                            }
  425|  9.26k|                            else  // Bi Pred
  426|  9.26k|                            {
  427|  9.26k|                                if(0 == (u1_motion_pred_flag_l0 & (1 << u1_blk_no)))
  ------------------
  |  Branch (427:36): [True: 7.67k, False: 1.59k]
  ------------------
  428|  7.67k|                                {
  429|  7.67k|                                    u1_lxend = 1;
  430|  7.67k|                                }
  431|  9.26k|                                if(0 == (u1_motion_pred_flag_l1 & (1 << u1_blk_no)))
  ------------------
  |  Branch (431:36): [True: 2.69k, False: 6.57k]
  ------------------
  432|  2.69k|                                {
  433|  2.69k|                                    u1_lx_start = 1;
  434|  2.69k|                                }
  435|  9.26k|                                if((0 != (u1_motion_pred_flag_l0 & (1 << u1_blk_no))) &&
  ------------------
  |  Branch (435:36): [True: 1.59k, False: 7.67k]
  ------------------
  436|  1.59k|                                   (0 != (u1_motion_pred_flag_l1 & (1 << u1_blk_no))))
  ------------------
  |  Branch (436:36): [True: 1.20k, False: 393]
  ------------------
  437|  1.20k|                                {
  438|  1.20k|                                    u1_lx_start = 0;
  439|  1.20k|                                    u1_lxend = 0;
  440|  1.20k|                                }
  441|  9.26k|                                if((0 == (u1_motion_pred_flag_l0 & (1 << u1_blk_no))) &&
  ------------------
  |  Branch (441:36): [True: 7.67k, False: 1.59k]
  ------------------
  442|  7.67k|                                   (0 == (u1_motion_pred_flag_l1 & (1 << u1_blk_no))))
  ------------------
  |  Branch (442:36): [True: 2.29k, False: 5.37k]
  ------------------
  443|  2.29k|                                {
  444|  2.29k|                                    u1_lx_start = 0;
  445|  2.29k|                                    u1_lxend = 2;
  446|  2.29k|                                }
  447|  9.26k|                            }
  448|  47.7k|                            ps_dec->pf_mvpred(ps_dec, ps_cur_mb_info, ps_mv_nmb, ps_mv_ntop,
  449|  47.7k|                                              &s_mvPred, u1_sub_mb_num, u1_wd, u1_lx_start,
  450|  47.7k|                                              u1_lxend, ps_cur_mb_info->u1_mb_mc_mode);
  451|  47.7k|                        }
  452|       |
  453|       |                        /* for generic case based on pred mode derived / signalled */
  454|  99.7k|                        u1_lx_start = 0;
  455|  99.7k|                        u1_lxend = 2;
  456|  99.7k|                        if(PRED_L0 == u1_pred_mode)
  ------------------
  |  |  483|  99.7k|#define PRED_L0   1
  ------------------
  |  Branch (456:28): [True: 49.2k, False: 50.5k]
  ------------------
  457|  49.2k|                        {
  458|  49.2k|                            s_mvPred.i2_mv[2] = 0;
  459|  49.2k|                            s_mvPred.i2_mv[3] = 0;
  460|  49.2k|                            u1_lxend = 1;
  461|  49.2k|                        }
  462|  99.7k|                        if(PRED_L1 == u1_pred_mode)
  ------------------
  |  |  484|  99.7k|#define PRED_L1   2
  ------------------
  |  Branch (462:28): [True: 28.3k, False: 71.4k]
  ------------------
  463|  28.3k|                        {
  464|  28.3k|                            s_mvPred.i2_mv[0] = 0;
  465|  28.3k|                            s_mvPred.i2_mv[1] = 0;
  466|  28.3k|                            u1_lx_start = 1;
  467|  28.3k|                        }
  468|       |
  469|       |                        /**********************************************************/
  470|       |                        /* Loop on number of predictors, 1 Each for Forw Backw    */
  471|       |                        /* Loop 2 times for BiDirect mode                         */
  472|       |                        /**********************************************************/
  473|   221k|                        for(u1_lx = u1_lx_start; u1_lx < u1_lxend; u1_lx++)
  ------------------
  |  Branch (473:50): [True: 121k, False: 99.4k]
  ------------------
  474|   121k|                        {
  475|   121k|                            UWORD8 u1_motion_pred_flag =
  476|   121k|                                u1_lx ? u1_motion_pred_flag_l1 : u1_motion_pred_flag_l0;
  ------------------
  |  Branch (476:33): [True: 50.5k, False: 71.4k]
  ------------------
  477|       |
  478|   121k|                            if((0 != (u1_motion_pred_flag & (1 << u1_blk_no))) ||
  ------------------
  |  Branch (478:32): [True: 19.4k, False: 102k]
  ------------------
  479|   102k|                               (ps_svc_cur_mb_info->u1_base_mode_flag))
  ------------------
  |  Branch (479:32): [True: 64.9k, False: 37.4k]
  ------------------
  480|  84.4k|                            {
  481|  84.4k|                                isvcd_retrive_infer_mode_mv(ps_svc_lyr_dec, &s_mvPred, u1_lx,
  482|  84.4k|                                                            u1_sub_mb_num);
  483|  84.4k|                            }
  484|       |                            /********************************************************/
  485|       |                            /* Predict Mv                                           */
  486|       |                            /* Add Mv Residuals and store back                      */
  487|       |                            /********************************************************/
  488|   121k|                            u1_tmp_lx = (u1_lx << 1);
  489|   121k|                            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|   121k|                            if(ps_svc_cur_mb_info->u1_base_mode_flag == 1)
  ------------------
  |  Branch (495:32): [True: 64.9k, False: 56.9k]
  ------------------
  496|  64.9k|                            {
  497|  64.9k|                                if(i1_ref_idx > (ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[u1_lx] - 1))
  ------------------
  |  Branch (497:36): [True: 5.59k, False: 59.3k]
  ------------------
  498|  5.59k|                                {
  499|  5.59k|                                    i1_ref_idx = ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[u1_lx] - 1;
  500|  5.59k|                                }
  501|  64.9k|                            }
  502|   121k|                            if(0 == ps_svc_cur_mb_info->u1_base_mode_flag)
  ------------------
  |  Branch (502:32): [True: 56.9k, False: 64.9k]
  ------------------
  503|  56.9k|                            {
  504|  56.9k|                                i2_mv_x = ps_mv_nmb->i2_mv[u1_tmp_lx];
  505|  56.9k|                                i2_mv_y = ps_mv_nmb->i2_mv[u1_tmp_lx + 1];
  506|       |
  507|  56.9k|                                i2_mv_x += s_mvPred.i2_mv[u1_tmp_lx];
  508|  56.9k|                                i2_mv_y += s_mvPred.i2_mv[u1_tmp_lx + 1];
  509|       |
  510|  56.9k|                                s_mvPred.i2_mv[u1_tmp_lx] = i2_mv_x;
  511|  56.9k|                                s_mvPred.i2_mv[u1_tmp_lx + 1] = i2_mv_y;
  512|  56.9k|                            }
  513|  64.9k|                            else
  514|  64.9k|                            {
  515|  64.9k|                                i2_mv_x = s_mvPred.i2_mv[u1_tmp_lx];
  516|  64.9k|                                i2_mv_y = s_mvPred.i2_mv[u1_tmp_lx + 1];
  517|  64.9k|                            }
  518|       |
  519|       |                            /********************************************************/
  520|       |                            /* Transfer setup call                                  */
  521|       |                            /* convert RefIdx if it is MbAff                        */
  522|       |                            /* Pass Weight Offset and refFrame                      */
  523|       |                            /********************************************************/
  524|   121k|                            i1_ref_idx1 = i1_ref_idx >> u1_scale_ref;
  525|       |
  526|   121k|                            if(-1 == i1_ref_idx1) return NOT_OK;
  ------------------
  |  |  116|    334|#define NOT_OK    -1
  ------------------
  |  Branch (526:32): [True: 334, False: 121k]
  ------------------
  527|   121k|                            if(u1_scale_ref && ((i1_ref_idx & 0x01) != u4_bot_mb))
  ------------------
  |  Branch (527:32): [True: 0, False: 121k]
  |  Branch (527:48): [True: 0, False: 0]
  ------------------
  528|      0|                                i1_ref_idx1 += MAX_REF_BUFS;
  ------------------
  |  |   75|      0|#define MAX_REF_BUFS    32
  ------------------
  529|   121k|                            ps_ref_frame = ps_dec->ps_ref_pic_buf_lx[u1_lx][i1_ref_idx1];
  530|       |
  531|       |                            /* Storing Colocated-Zero u4_flag */
  532|   121k|                            if(u1_lx == u1_lx_start)
  ------------------
  |  Branch (532:32): [True: 99.5k, False: 22.0k]
  ------------------
  533|  99.5k|                            {
  534|       |                                /* Fill colocated info in MvPred structure */
  535|  99.5k|                                s_mvPred.u1_col_ref_pic_idx = ps_ref_frame->u1_mv_buf_id;
  536|  99.5k|                                s_mvPred.u1_pic_type = ps_ref_frame->u1_pic_type;
  537|       |
  538|       |                                /* Calculating colocated zero information */
  539|  99.5k|                                u1_colz =
  540|  99.5k|                                    (u1_field << 1) | ((i1_ref_idx == 0) && (ABS(i2_mv_x) <= 1) &&
  ------------------
  |  |  100|  89.7k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 18.5k, False: 71.1k]
  |  |  ------------------
  ------------------
  |  Branch (540:56): [True: 89.7k, False: 9.80k]
  |  Branch (540:77): [True: 54.6k, False: 35.0k]
  ------------------
  541|  54.6k|                                                       (ABS(i2_mv_y) <= 1));
  ------------------
  |  |  100|  54.6k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 4.60k, False: 50.0k]
  |  |  ------------------
  ------------------
  |  Branch (541:56): [True: 46.5k, False: 8.07k]
  ------------------
  542|  99.5k|                                u1_colz |= ps_mb_part_info->u1_col_info[u1_blk_no];
  543|  99.5k|                            }
  544|       |
  545|   121k|                            pu4_wt_offst = ppu4_wt_ofst[u1_blk_no];
  546|   121k|                            {
  547|   121k|                                pred_info_pkd_t *ps_pred_pkd;
  548|   121k|                                WORD16 i2_mv[2];
  549|       |
  550|   121k|                                i2_mv[0] = i2_mv_x;
  551|   121k|                                i2_mv[1] = i2_mv_y;
  552|       |
  553|   121k|                                ps_pred_pkd = ps_dec->ps_pred_pkd + ps_dec->u4_pred_info_pkd_idx;
  554|   121k|                                ih264d_fill_pred_info(i2_mv, u1_wd, u1_ht, u1_sub_mb_num,
  555|   121k|                                                      u1_pred_mode, ps_pred_pkd,
  556|   121k|                                                      ps_ref_frame->u1_pic_buf_id, i1_ref_idx,
  557|   121k|                                                      pu4_wt_offst, ps_ref_frame->u1_pic_type);
  558|   121k|                                ps_dec->u4_pred_info_pkd_idx++;
  559|   121k|                                ps_cur_mb_info->u1_num_pred_parts++;
  560|   121k|                            }
  561|   121k|                        }
  562|  99.4k|                        if(ps_mv_nmb)
  ------------------
  |  Branch (562:28): [True: 99.4k, False: 0]
  ------------------
  563|  99.4k|                        {
  564|  99.4k|                            ih264d_rep_mv_colz(ps_dec, &s_mvPred, ps_mv_nmb, u1_sub_mb_num, u1_colz,
  565|  99.4k|                                               u1_ht, u1_wd);
  566|  99.4k|                        }
  567|      0|                        else
  568|      0|                        {
  569|      0|                            return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  570|      0|                        }
  571|  99.4k|                    }
  572|   178k|                }
  573|       |                /* to take care of 16 parttitions increment for base mode flag case*/
  574|   128k|                if(1 == ps_svc_cur_mb_info->u1_base_mode_flag)
  ------------------
  |  Branch (574:20): [True: 31.4k, False: 97.0k]
  ------------------
  575|  31.4k|                {
  576|  31.4k|                    ps_part += (MAX_NUM_MB_PART - u1_num_part);
  ------------------
  |  |   62|  31.4k|#define MAX_NUM_MB_PART NUM_MB_PARTS *NUM_SUB_MB_PARTS
  |  |  ------------------
  |  |  |  |   59|  31.4k|#define NUM_MB_PARTS 4
  |  |  ------------------
  |  |               #define MAX_NUM_MB_PART NUM_MB_PARTS *NUM_SUB_MB_PARTS
  |  |  ------------------
  |  |  |  |   60|  31.4k|#define NUM_SUB_MB_PARTS 4
  |  |  ------------------
  ------------------
  577|  31.4k|                }
  578|   128k|            }
  579|  2.82k|            else
  580|  2.82k|            {
  581|       |                /* Set zero values in case of Intra Mbs */
  582|  2.82k|                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|  2.82k|                if(1 != ps_svc_cur_mb_info->u1_base_mode_flag)
  ------------------
  |  Branch (584:20): [True: 0, False: 2.82k]
  ------------------
  585|      0|                {
  586|      0|                    return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  587|      0|                }
  588|       |
  589|  2.82k|                ps_cur_deblk_mb->u1_mb_type |= D_INTRA_IBL;
  ------------------
  |  |   72|  2.82k|#define D_INTRA_IBL 16
  ------------------
  590|  2.82k|                if((ps_svc_lyr_dec->u1_layer_identifier != TARGET_LAYER) &&
  ------------------
  |  |  110|  2.82k|#define TARGET_LAYER 2
  ------------------
  |  Branch (590:20): [True: 0, False: 2.82k]
  ------------------
  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|  2.82k|                ps_part += (MAX_NUM_MB_PART);
  ------------------
  |  |   62|  2.82k|#define MAX_NUM_MB_PART NUM_MB_PARTS *NUM_SUB_MB_PARTS
  |  |  ------------------
  |  |  |  |   59|  2.82k|#define NUM_MB_PARTS 4
  |  |  ------------------
  |  |               #define MAX_NUM_MB_PART NUM_MB_PARTS *NUM_SUB_MB_PARTS
  |  |  ------------------
  |  |  |  |   60|  2.82k|#define NUM_SUB_MB_PARTS 4
  |  |  ------------------
  ------------------
  597|       |                /* Storing colocated zero information */
  598|  2.82k|                if(ps_mv_nmb_start)
  ------------------
  |  Branch (598:20): [True: 2.82k, False: 0]
  ------------------
  599|  2.82k|                {
  600|  2.82k|                    ih264d_rep_mv_colz(ps_dec, &s_mvPred, ps_mv_nmb_start, 0,
  601|  2.82k|                                       (UWORD8) (u1_field << 1), 4, 4);
  602|  2.82k|                }
  603|      0|                else
  604|      0|                {
  605|      0|                    return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  606|      0|                }
  607|  2.82k|            }
  608|   131k|        }
  609|    499|        else
  610|    499|        {
  611|       |            /* Set zero values in case of Intra Mbs */
  612|    499|            mv_pred_t s_mvPred = {{0, 0, 0, 0}, {-1, -1}, 0, 0};
  613|       |            /* Storing colocated zero information */
  614|    499|            if(ps_mv_nmb_start)
  ------------------
  |  Branch (614:16): [True: 499, False: 0]
  ------------------
  615|    499|            {
  616|    499|                ih264d_rep_mv_colz(ps_dec, &s_mvPred, ps_mv_nmb_start, 0, (UWORD8) (u1_field << 1),
  617|    499|                                   4, 4);
  618|    499|            }
  619|      0|            else
  620|      0|            {
  621|      0|                return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  622|      0|            }
  623|    499|        }
  624|   132k|    }
  625|       |
  626|  39.3k|    return OK;
  ------------------
  |  |  114|  39.3k|#define OK        0
  ------------------
  627|  39.7k|}
isvcd_parse_bmb_cavlc:
  643|  23.0k|{
  644|  23.0k|    UWORD32 u4_cbp = 0;
  645|  23.0k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
  646|  23.0k|    deblk_mb_t *ps_cur_deblk_mb = ps_dec->ps_deblk_mbn + u4_mb_num;
  647|  23.0k|    dec_bit_stream_t *const ps_bitstrm = ps_dec->ps_bitstrm;
  648|  23.0k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
  649|  23.0k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
  650|  23.0k|    const UWORD8 *puc_mb_mc_mode = (const UWORD8 *) gau1_ih264d_mb_mc_mode;
  651|  23.0k|    UWORD8 u1_mb_type = ps_cur_mb_info->u1_mb_type;
  652|  23.0k|    WORD32 ret;
  653|  23.0k|    UWORD8 u1_Bdirect_tranform_read = 1;
  654|  23.0k|    dec_slice_svc_ext_params_t *ps_svc_slice_params = NULL;
  655|       |
  656|  23.0k|    ps_svc_slice_params = &ps_svc_lyr_dec->s_svc_slice_params;
  657|  23.0k|    ps_dec->s_high_profile.u1_no_submb_part_size_lt8x8_flag = 1;
  658|  23.0k|    ps_cur_mb_info->u1_tran_form8x8 = 0;
  659|  23.0k|    ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = 0;
  660|  23.0k|    ps_cur_mb_info->u1_yuv_dc_block_flag = 0;
  661|  23.0k|    ps_cur_mb_info->u1_mb_mc_mode = puc_mb_mc_mode[5 + u1_mb_type];
  662|  23.0k|    ps_cur_deblk_mb->u1_mb_type |= D_B_SLICE;
  ------------------
  |  |  384|  23.0k|#define D_B_SLICE         4
  ------------------
  663|  23.0k|    if(u1_mb_type != B_DIRECT)
  ------------------
  |  |  482|  23.0k|#define B_DIRECT  0
  ------------------
  |  Branch (663:8): [True: 13.0k, False: 10.0k]
  ------------------
  664|  13.0k|    {
  665|  13.0k|        ret = isvcd_parse_bmb_non_direct_cavlc(ps_svc_lyr_dec, ps_cur_mb_info, ps_svc_cur_mb_info,
  666|  13.0k|                                               u4_mb_num, u4_num_mbsNby2);
  667|  13.0k|        if(ret != OK) return ret;
  ------------------
  |  |  114|  13.0k|#define OK        0
  ------------------
  |  Branch (667:12): [True: 341, False: 12.6k]
  ------------------
  668|  13.0k|    }
  669|  10.0k|    else
  670|  10.0k|    {
  671|       |        /************ STORING PARTITION INFO ***********/
  672|  10.0k|        parse_part_params_t *ps_part_info;
  673|  10.0k|        ps_part_info = ps_dec->ps_part;
  674|  10.0k|        ps_part_info->u1_is_direct = PART_DIRECT_16x16;
  ------------------
  |  |  572|  10.0k|#define PART_DIRECT_16x16              2
  ------------------
  675|  10.0k|        ps_part_info->u1_sub_mb_num = 0;
  676|  10.0k|        ps_dec->ps_part++;
  677|       |        /* check whether transform8x8 u4_flag to be read or not */
  678|  10.0k|        u1_Bdirect_tranform_read = ps_dec->s_high_profile.u1_direct_8x8_inference_flag;
  679|  10.0k|    }
  680|       |
  681|  22.7k|    if(ps_svc_slice_params->u1_adaptive_residual_prediction_flag &&
  ------------------
  |  Branch (681:8): [True: 13.0k, False: 9.66k]
  ------------------
  682|  13.0k|       ps_svc_cur_mb_info->u1_crop_window_flag)
  ------------------
  |  Branch (682:8): [True: 12.3k, False: 764]
  ------------------
  683|  12.3k|    {
  684|  12.3k|        ps_svc_cur_mb_info->u1_residual_prediction_flag = ih264d_get_bit_h264(ps_bitstrm);
  685|  12.3k|        COPYTHECONTEXT("SVC ext: u1_residual_prediction_flag",
  686|  12.3k|                       ps_svc_cur_mb_info->u1_residual_prediction_flag);
  687|  12.3k|    }
  688|  10.4k|    else
  689|  10.4k|    {
  690|       |        /*residual flag inference code */
  691|  10.4k|        if(1 == ps_svc_cur_mb_info->u1_crop_window_flag &&
  ------------------
  |  Branch (691:12): [True: 9.60k, False: 826]
  ------------------
  692|  9.60k|           1 == ps_svc_cur_mb_info->u1_base_mode_flag)
  ------------------
  |  Branch (692:12): [True: 0, False: 9.60k]
  ------------------
  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|  10.4k|        else
  698|  10.4k|        {
  699|  10.4k|            ps_svc_cur_mb_info->u1_residual_prediction_flag = 0;
  700|  10.4k|        }
  701|  10.4k|    }
  702|       |
  703|  22.7k|    if(ps_svc_slice_params->u1_scan_idx_end >= ps_svc_slice_params->u1_scan_idx_start)
  ------------------
  |  Branch (703:8): [True: 22.7k, False: 0]
  ------------------
  704|  22.7k|    {
  705|       |        /* Read the Coded block pattern */
  706|  22.7k|        const UWORD8 *puc_CbpInter = gau1_ih264d_cbp_inter;
  707|       |        // Inlined ih264d_uev
  708|  22.7k|        UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
  709|  22.7k|        UWORD32 u4_word, u4_ldz;
  710|       |
  711|       |        /***************************************************************/
  712|       |        /* Find leading zeros in next 32 bits                          */
  713|       |        /***************************************************************/
  714|  22.7k|        NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  22.7k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  22.7k|{                                                                           \
  |  |  152|  22.7k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  22.7k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  22.7k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  22.7k|                                                                            \
  |  |  156|  22.7k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  22.7k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 22.0k, False: 653]
  |  |  ------------------
  |  |  158|  22.7k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  22.0k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  22.7k|}
  ------------------
  715|  22.7k|        u4_ldz = CLZ(u4_word);
  716|       |        /* Flush the ps_bitstrm */
  717|  22.7k|        u4_bitstream_offset += (u4_ldz + 1);
  718|       |        /* Read the suffix from the ps_bitstrm */
  719|  22.7k|        u4_word = 0;
  720|  22.7k|        if(u4_ldz) GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  8.37k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  8.37k|{                                                                           \
  |  |  122|  8.37k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  8.37k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  8.37k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  8.37k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  8.37k|                                                                            \
  |  |  127|  8.37k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 7.74k, False: 628]
  |  |  ------------------
  |  |  128|  8.37k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  7.74k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  8.37k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  8.37k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  8.37k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  8.37k|}                                                                           \
  ------------------
  |  Branch (720:12): [True: 8.37k, False: 14.3k]
  ------------------
  721|  22.7k|        *pu4_bitstrm_ofst = u4_bitstream_offset;
  722|  22.7k|        u4_cbp = ((1 << u4_ldz) + u4_word - 1);
  723|       |        // Inlined ih264d_uev
  724|  22.7k|        if(u4_cbp > 47) return ERROR_CBP;
  ------------------
  |  Branch (724:12): [True: 588, False: 22.1k]
  ------------------
  725|  22.1k|        u4_cbp = puc_CbpInter[u4_cbp];
  726|       |
  727|  22.1k|        if((ps_dec->s_high_profile.u1_transform8x8_present) && (u4_cbp & (0xf)) &&
  ------------------
  |  Branch (727:12): [True: 8.36k, False: 13.7k]
  |  Branch (727:64): [True: 2.24k, False: 6.11k]
  ------------------
  728|  2.24k|           (ps_dec->s_high_profile.u1_no_submb_part_size_lt8x8_flag) && (u1_Bdirect_tranform_read))
  ------------------
  |  Branch (728:12): [True: 1.65k, False: 595]
  |  Branch (728:73): [True: 1.12k, False: 521]
  ------------------
  729|  1.12k|        {
  730|  1.12k|            ps_cur_mb_info->u1_tran_form8x8 = ih264d_get_bit_h264(ps_bitstrm);
  731|  1.12k|            COPYTHECONTEXT("transform_size_8x8_flag", ps_cur_mb_info->u1_tran_form8x8);
  732|  1.12k|            ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = ps_cur_mb_info->u1_tran_form8x8;
  733|  1.12k|        }
  734|       |
  735|  22.1k|        COPYTHECONTEXT("coded_block_pattern", u4_cbp);
  736|  22.1k|        ps_cur_mb_info->u1_cbp = u4_cbp;
  737|  22.1k|    }
  738|       |
  739|       |    /* Read mb_qp_delta */
  740|  22.1k|    if(u4_cbp)
  ------------------
  |  Branch (740:8): [True: 7.78k, False: 14.3k]
  ------------------
  741|  7.78k|    {
  742|  7.78k|        WORD32 i_temp;
  743|       |        // inlining ih264d_sev
  744|  7.78k|        UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
  745|  7.78k|        UWORD32 u4_word, u4_ldz, u4_abs_val;
  746|       |
  747|       |        /***************************************************************/
  748|       |        /* Find leading zeros in next 32 bits                          */
  749|       |        /***************************************************************/
  750|  7.78k|        NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  7.78k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  7.78k|{                                                                           \
  |  |  152|  7.78k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  7.78k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  7.78k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  7.78k|                                                                            \
  |  |  156|  7.78k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  7.78k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 7.47k, False: 313]
  |  |  ------------------
  |  |  158|  7.78k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  7.47k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  7.78k|}
  ------------------
  751|  7.78k|        u4_ldz = CLZ(u4_word);
  752|       |
  753|       |        /* Flush the ps_bitstrm */
  754|  7.78k|        u4_bitstream_offset += (u4_ldz + 1);
  755|       |
  756|       |        /* Read the suffix from the ps_bitstrm */
  757|  7.78k|        u4_word = 0;
  758|  7.78k|        if(u4_ldz) GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  3.26k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  3.26k|{                                                                           \
  |  |  122|  3.26k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  3.26k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  3.26k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  3.26k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  3.26k|                                                                            \
  |  |  127|  3.26k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 2.85k, False: 413]
  |  |  ------------------
  |  |  128|  3.26k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  2.85k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  3.26k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  3.26k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  3.26k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  3.26k|}                                                                           \
  ------------------
  |  Branch (758:12): [True: 3.26k, False: 4.51k]
  ------------------
  759|       |
  760|  7.78k|        *pu4_bitstrm_ofst = u4_bitstream_offset;
  761|  7.78k|        u4_abs_val = ((1 << u4_ldz) + u4_word) >> 1;
  762|       |
  763|  7.78k|        if(u4_word & 0x1)
  ------------------
  |  Branch (763:12): [True: 1.66k, False: 6.11k]
  ------------------
  764|  1.66k|            i_temp = (-(WORD32) u4_abs_val);
  765|  6.11k|        else
  766|  6.11k|            i_temp = (u4_abs_val);
  767|       |
  768|  7.78k|        if(i_temp < -26 || i_temp > 25) return ERROR_INV_RANGE_QP_T;
  ------------------
  |  Branch (768:12): [True: 106, False: 7.67k]
  |  Branch (768:28): [True: 172, False: 7.50k]
  ------------------
  769|       |        // inlinined ih264d_sev
  770|  7.50k|        COPYTHECONTEXT("mb_qp_delta", i_temp);
  771|  7.50k|        if(i_temp)
  ------------------
  |  Branch (771:12): [True: 2.99k, False: 4.51k]
  ------------------
  772|  2.99k|        {
  773|  2.99k|            ret = ih264d_update_qp(ps_dec, (WORD8) i_temp);
  774|  2.99k|            if(ret != OK) return ret;
  ------------------
  |  |  114|  2.99k|#define OK        0
  ------------------
  |  Branch (774:16): [True: 0, False: 2.99k]
  ------------------
  775|  2.99k|        }
  776|       |
  777|       |        /*SVC residual from start to end idx*/
  778|  7.50k|        ret = ih264d_parse_residual4x4_cavlc(ps_dec, ps_cur_mb_info, 0);
  779|  7.50k|        if(ret != OK) return ret;
  ------------------
  |  |  114|  7.50k|#define OK        0
  ------------------
  |  Branch (779:12): [True: 213, False: 7.29k]
  ------------------
  780|  7.29k|        if(EXCEED_OFFSET(ps_bitstrm)) return ERROR_EOB_TERMINATE_T;
  ------------------
  |  |   93|  7.29k|  (ps_bitstrm->u4_ofst > ps_bitstrm->u4_max_ofst)
  |  |  ------------------
  |  |  |  Branch (93:3): [True: 144, False: 7.14k]
  |  |  ------------------
  ------------------
  781|  7.29k|    }
  782|  14.3k|    else
  783|  14.3k|    {
  784|  14.3k|        ps_dec->i1_prev_mb_qp_delta = 0;
  785|  14.3k|        ih264d_update_nnz_for_skipmb(ps_dec, ps_cur_mb_info, CAVLC);
  ------------------
  |  |  338|  14.3k|#define CAVLC  0
  ------------------
  786|  14.3k|    }
  787|       |
  788|  21.5k|    return OK;
  ------------------
  |  |  114|  21.5k|#define OK        0
  ------------------
  789|  22.1k|}
isvcd_parse_bmb_non_direct_cabac:
  808|  12.8k|{
  809|       |    /* Loads from ps_dec */
  810|  12.8k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
  811|  12.8k|    decoding_envirnoment_t *ps_cab_env = &ps_dec->s_cab_dec_env;
  812|  12.8k|    dec_bit_stream_t *ps_bitstrm = ps_dec->ps_bitstrm;
  813|  12.8k|    ctxt_inc_mb_info_t *p_curr_ctxt = ps_dec->ps_curr_ctxt_mb_info;
  814|  12.8k|    parse_pmbarams_t *ps_parse_mb_data = ps_dec->ps_parse_mb_data + u4_num_mbsNby2;
  815|       |
  816|       |    /* table pointer loads */
  817|  12.8k|    const UWORD8 *pu1_sub_mb_pred_modes = (UWORD8 *) (gau1_ih264d_submb_pred_modes) + 4;
  818|  12.8k|    const UWORD8(*pu1_mb_pred_modes)[32] = (const UWORD8(*)[32]) gau1_ih264d_mb_pred_modes;
  819|  12.8k|    const UWORD8 *pu1_num_mb_part = (const UWORD8 *) gau1_ih264d_num_mb_part;
  820|  12.8k|    const UWORD8 *pu1_sub_mb_mc_mode = (UWORD8 *) (gau1_ih264d_submb_mc_mode) + 4;
  821|       |
  822|  12.8k|    const UWORD8 u1_mb_type = ps_cur_mb_info->u1_mb_type;
  823|  12.8k|    UWORD8 *pu1_col_info = ps_parse_mb_data->u1_col_info;
  824|  12.8k|    WORD8 *pi1_ref_idx_l0 = &ps_parse_mb_data->i1_ref_idx[0][0];
  825|  12.8k|    WORD8 *pi1_ref_idx_l1 = &ps_parse_mb_data->i1_ref_idx[1][0];
  826|  12.8k|    UWORD8 u1_dec_ref_l0, u1_dec_ref_l1;
  827|       |
  828|  12.8k|    UWORD8 u1_num_mb_part, u1_mb_mc_mode, u1_sub_mb, u1_mbpred_mode = 5 + u1_mb_type;
  829|  12.8k|    UWORD32 u4_mb_mc_mode = 0, u4_mb_pred_mode = 0;
  830|  12.8k|    WORD32 ret;
  831|  12.8k|    dec_slice_svc_ext_params_t *ps_svc_slice_params = NULL;
  832|  12.8k|    ps_svc_slice_params = &ps_svc_lyr_dec->s_svc_slice_params;
  833|       |
  834|  12.8k|    p_curr_ctxt->u1_mb_type = CAB_NON_BD16x16;
  ------------------
  |  |  397|  12.8k|#define CAB_NON_BD16x16   0x05 /* 0000 0101 */
  ------------------
  835|  12.8k|    u1_sub_mb = !(u1_mb_type ^ B_8x8);
  ------------------
  |  |  480|  12.8k|#define B_8x8    22
  ------------------
  836|       |
  837|  12.8k|    {
  838|  12.8k|        UWORD8 u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
  839|  12.8k|        UWORD8 *pu1_num_ref_idx_lx_active = ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active;
  840|  12.8k|        UWORD8 uc_field = ps_cur_mb_info->u1_mb_field_decodingflag;
  841|  12.8k|        UWORD8 u1_mbaff_field = (u1_mbaff & uc_field);
  842|  12.8k|        u1_dec_ref_l0 = (pu1_num_ref_idx_lx_active[0] << u1_mbaff_field) - 1;
  843|  12.8k|        u1_dec_ref_l1 = (pu1_num_ref_idx_lx_active[1] << u1_mbaff_field) - 1;
  844|  12.8k|    }
  845|       |
  846|  12.8k|    if(u1_sub_mb)
  ------------------
  |  Branch (846:8): [True: 3.85k, False: 9.00k]
  ------------------
  847|  3.85k|    {
  848|  3.85k|        const UWORD8 u1_colz = ((PRED_8x8) << 6);
  ------------------
  |  |  453|  3.85k|#define PRED_8x8    3
  ------------------
  849|  3.85k|        UWORD8 uc_i;
  850|  3.85k|        u1_mb_mc_mode = 0;
  851|  3.85k|        u1_num_mb_part = 4;
  852|       |        /* Reading the subMB type */
  853|  19.2k|        for(uc_i = 0; uc_i < 4; uc_i++)
  ------------------
  |  Branch (853:23): [True: 15.4k, False: 3.85k]
  ------------------
  854|  15.4k|        {
  855|  15.4k|            UWORD8 u1_sub_mb_mode, u1_subMbPredModes;
  856|  15.4k|            u1_sub_mb_mode =
  857|  15.4k|                ih264d_parse_submb_type_cabac(1, ps_cab_env, ps_bitstrm, ps_dec->p_sub_mb_type_t);
  858|       |
  859|  15.4k|            if(u1_sub_mb_mode > 12) return ERROR_SUB_MB_TYPE;
  ------------------
  |  Branch (859:16): [True: 0, False: 15.4k]
  ------------------
  860|       |
  861|  15.4k|            u1_subMbPredModes = pu1_sub_mb_pred_modes[u1_sub_mb_mode];
  862|  15.4k|            u4_mb_mc_mode = (u4_mb_mc_mode << 8) | pu1_sub_mb_mc_mode[u1_sub_mb_mode];
  863|  15.4k|            u4_mb_pred_mode = (u4_mb_pred_mode << 8) | u1_subMbPredModes;
  864|  15.4k|            *pi1_ref_idx_l0++ = (u1_subMbPredModes & PRED_L0) ? u1_dec_ref_l0 : -1;
  ------------------
  |  |  483|  15.4k|#define PRED_L0   1
  ------------------
  |  Branch (864:33): [True: 9.04k, False: 6.38k]
  ------------------
  865|  15.4k|            *pi1_ref_idx_l1++ = (u1_subMbPredModes & PRED_L1) ? u1_dec_ref_l1 : -1;
  ------------------
  |  |  484|  15.4k|#define PRED_L1   2
  ------------------
  |  Branch (865:33): [True: 11.0k, False: 4.37k]
  ------------------
  866|  15.4k|            COPYTHECONTEXT("sub_mb_type", u1_sub_mb_mode);
  867|       |            /* Storing collocated Mb and SubMb mode information */
  868|  15.4k|            *pu1_col_info++ = (u1_colz | (pu1_sub_mb_mc_mode[u1_sub_mb_mode] << 4));
  869|  15.4k|            if(u1_sub_mb_mode != B_DIRECT_8x8)
  ------------------
  |  |  465|  15.4k|#define B_DIRECT_8x8    0
  ------------------
  |  Branch (869:16): [True: 12.9k, False: 2.46k]
  ------------------
  870|  12.9k|            {
  871|  12.9k|                if(u1_sub_mb_mode > B_BI_8x8)
  ------------------
  |  |  468|  12.9k|#define B_BI_8x8        3
  ------------------
  |  Branch (871:20): [True: 3.68k, False: 9.27k]
  ------------------
  872|  3.68k|                {
  873|  3.68k|                    ps_dec->s_high_profile.u1_no_submb_part_size_lt8x8_flag = 0;
  874|  3.68k|                }
  875|  12.9k|            }
  876|  2.46k|            else if(!ps_dec->s_high_profile.u1_direct_8x8_inference_flag)
  ------------------
  |  Branch (876:21): [True: 901, False: 1.56k]
  ------------------
  877|    901|            {
  878|    901|                ps_dec->s_high_profile.u1_no_submb_part_size_lt8x8_flag = 0;
  879|    901|            }
  880|  15.4k|        }
  881|  3.85k|        pi1_ref_idx_l0 -= 4;
  882|  3.85k|        pi1_ref_idx_l1 -= 4;
  883|  3.85k|    }
  884|  9.00k|    else
  885|  9.00k|    {
  886|  9.00k|        UWORD8 u1_mb_pred_mode_part0 = pu1_mb_pred_modes[0][u1_mbpred_mode];
  887|  9.00k|        UWORD8 u1_mb_pred_mode_part1 = pu1_mb_pred_modes[1][u1_mbpred_mode];
  888|  9.00k|        u1_mb_mc_mode = ps_cur_mb_info->u1_mb_mc_mode;
  889|  9.00k|        u1_num_mb_part = pu1_num_mb_part[u1_mb_mc_mode];
  890|       |        /* Storing collocated Mb and SubMb mode information */
  891|  9.00k|        *pu1_col_info++ = (u1_mb_mc_mode << 6);
  892|  9.00k|        if(u1_mb_mc_mode) *pu1_col_info++ = (u1_mb_mc_mode << 6);
  ------------------
  |  Branch (892:12): [True: 3.12k, False: 5.87k]
  ------------------
  893|  9.00k|        u4_mb_mc_mode = u1_mb_mc_mode | (u1_mb_mc_mode << 8);
  894|  9.00k|        u4_mb_mc_mode <<= 16;
  895|  9.00k|        u4_mb_pred_mode = ((u1_mb_pred_mode_part0 << 8) | u1_mb_pred_mode_part1) << 16;
  896|       |
  897|  9.00k|        *pi1_ref_idx_l0++ = (u1_mb_pred_mode_part0 & PRED_L0) ? u1_dec_ref_l0 : -1;
  ------------------
  |  |  483|  9.00k|#define PRED_L0   1
  ------------------
  |  Branch (897:29): [True: 2.88k, False: 6.11k]
  ------------------
  898|  9.00k|        *pi1_ref_idx_l0-- = (u1_mb_pred_mode_part1 & PRED_L0) ? u1_dec_ref_l0 : -1;
  ------------------
  |  |  483|  9.00k|#define PRED_L0   1
  ------------------
  |  Branch (898:29): [True: 8.33k, False: 669]
  ------------------
  899|  9.00k|        *pi1_ref_idx_l1++ = (u1_mb_pred_mode_part0 & PRED_L1) ? u1_dec_ref_l1 : -1;
  ------------------
  |  |  484|  9.00k|#define PRED_L1   2
  ------------------
  |  Branch (899:29): [True: 6.77k, False: 2.23k]
  ------------------
  900|  9.00k|        *pi1_ref_idx_l1-- = (u1_mb_pred_mode_part1 & PRED_L1) ? u1_dec_ref_l1 : -1;
  ------------------
  |  |  484|  9.00k|#define PRED_L1   2
  ------------------
  |  Branch (900:29): [True: 7.39k, False: 1.61k]
  ------------------
  901|  9.00k|    }
  902|       |
  903|       |    /*Adding SVC extension code to get Motion Prediction Flags*/
  904|  12.8k|    {
  905|  12.8k|        UWORD8 uc_i, u1_mvp_l1, u1_mvp_l0;
  906|  12.8k|        UWORD8 *pu1_motion_pred_flag_l0;
  907|  12.8k|        UWORD8 *pu1_motion_pred_flag_l1;
  908|  12.8k|        WORD8 *pi1_ref_idx;
  909|  12.8k|        WORD8 *pi1_lft_cxt = ps_dec->pi1_left_ref_idx_ctxt_inc;
  910|  12.8k|        WORD8 *pi1_top_cxt = p_curr_ctxt->i1_ref_idx;
  911|       |
  912|  12.8k|        pu1_motion_pred_flag_l0 = &ps_svc_cur_mb_info->au1_motion_pred_flag[0];
  913|  12.8k|        *pu1_motion_pred_flag_l0 = 0;
  914|  12.8k|        pu1_motion_pred_flag_l1 = &ps_svc_cur_mb_info->au1_motion_pred_flag[1];
  915|  12.8k|        *pu1_motion_pred_flag_l1 = 0;
  916|       |
  917|  12.8k|        if(ps_svc_cur_mb_info->u1_crop_window_flag &&
  ------------------
  |  Branch (917:12): [True: 12.6k, False: 198]
  ------------------
  918|  12.6k|           ps_svc_slice_params->u1_adaptive_motion_prediction_flag)
  ------------------
  |  Branch (918:12): [True: 10.4k, False: 2.23k]
  ------------------
  919|  10.4k|        {
  920|  10.4k|            pi1_ref_idx = pi1_ref_idx_l0;
  921|  33.7k|            for(uc_i = 0; uc_i < u1_num_mb_part; uc_i++, pi1_ref_idx++)
  ------------------
  |  Branch (921:27): [True: 23.3k, False: 10.4k]
  ------------------
  922|  23.3k|            {
  923|  23.3k|                if(*pi1_ref_idx > 0)
  ------------------
  |  Branch (923:20): [True: 2.19k, False: 21.1k]
  ------------------
  924|  2.19k|                {
  925|  2.19k|                    u1_mvp_l0 = ih264d_decode_bin(0, ps_svc_lyr_dec->ps_motion_prediction_flag_l0,
  926|  2.19k|                                                  ps_bitstrm, ps_cab_env);
  927|  2.19k|                    COPYTHECONTEXT("SVC ext: u1_motion_prediction_flag_l0", u1_mvp_l0);
  928|       |
  929|  2.19k|                    *pu1_motion_pred_flag_l0 |= (u1_mvp_l0 << uc_i);
  930|  2.19k|                    if((u1_mvp_l0 & 0x01))
  ------------------
  |  Branch (930:24): [True: 894, False: 1.29k]
  ------------------
  931|    894|                    {
  932|    894|                        *pi1_ref_idx = -1;
  933|    894|                    }
  934|  2.19k|                }
  935|  23.3k|            }
  936|  10.4k|            pi1_ref_idx = pi1_ref_idx_l1;
  937|  33.7k|            for(uc_i = 0; uc_i < u1_num_mb_part; uc_i++, pi1_ref_idx++)
  ------------------
  |  Branch (937:27): [True: 23.3k, False: 10.4k]
  ------------------
  938|  23.3k|            {
  939|  23.3k|                if(*pi1_ref_idx > 0)
  ------------------
  |  Branch (939:20): [True: 13.7k, False: 9.61k]
  ------------------
  940|  13.7k|                {
  941|  13.7k|                    u1_mvp_l1 = ih264d_decode_bin(0, ps_svc_lyr_dec->ps_motion_prediction_flag_l1,
  942|  13.7k|                                                  ps_bitstrm, ps_cab_env);
  943|  13.7k|                    COPYTHECONTEXT("SVC ext: u1_motion_prediction_flag_l1", u1_mvp_l1);
  944|       |
  945|  13.7k|                    *pu1_motion_pred_flag_l1 |= (u1_mvp_l1 << uc_i);
  946|       |
  947|  13.7k|                    if((u1_mvp_l1 & 0x01))
  ------------------
  |  Branch (947:24): [True: 8.70k, False: 4.99k]
  ------------------
  948|  8.70k|                    {
  949|  8.70k|                        *pi1_ref_idx = -1;
  950|  8.70k|                    }
  951|  13.7k|                }
  952|  23.3k|            }
  953|  10.4k|        }
  954|  2.43k|        else if(ps_svc_cur_mb_info->u1_crop_window_flag)
  ------------------
  |  Branch (954:17): [True: 2.23k, False: 198]
  ------------------
  955|  2.23k|        {
  956|  2.23k|            *pu1_motion_pred_flag_l0 = ps_svc_slice_params->u1_default_motion_prediction_flag
  ------------------
  |  Branch (956:40): [True: 503, False: 1.73k]
  ------------------
  957|  2.23k|                                           ? ((1 << u1_num_mb_part) - 1)
  958|  2.23k|                                           : 0;
  959|  2.23k|            *pu1_motion_pred_flag_l1 = ps_svc_slice_params->u1_default_motion_prediction_flag
  ------------------
  |  Branch (959:40): [True: 503, False: 1.73k]
  ------------------
  960|  2.23k|                                           ? ((1 << u1_num_mb_part) - 1)
  961|  2.23k|                                           : 0;
  962|  2.23k|            if(ps_svc_slice_params->u1_default_motion_prediction_flag)
  ------------------
  |  Branch (962:16): [True: 503, False: 1.73k]
  ------------------
  963|    503|            {
  964|    503|                pi1_ref_idx_l0[0] = -1;
  965|    503|                pi1_ref_idx_l0[1] = -1;
  966|    503|                pi1_ref_idx_l0[2] = -1;
  967|    503|                pi1_ref_idx_l0[3] = -1;
  968|       |
  969|    503|                pi1_ref_idx_l1[0] = -1;
  970|    503|                pi1_ref_idx_l1[1] = -1;
  971|    503|                pi1_ref_idx_l1[2] = -1;
  972|    503|                pi1_ref_idx_l1[3] = -1;
  973|    503|            }
  974|  2.23k|        }
  975|       |
  976|  12.8k|        ret = ih264d_parse_ref_idx_cabac(u1_num_mb_part, 0, u1_dec_ref_l0, u1_mb_mc_mode,
  977|  12.8k|                                         pi1_ref_idx_l0, pi1_lft_cxt, pi1_top_cxt, ps_cab_env,
  978|  12.8k|                                         ps_bitstrm, ps_dec->p_ref_idx_t);
  979|       |
  980|  12.8k|        if(ret != OK)
  ------------------
  |  |  114|  12.8k|#define OK        0
  ------------------
  |  Branch (980:12): [True: 105, False: 12.7k]
  ------------------
  981|    105|        {
  982|    105|            return ret;
  983|    105|        }
  984|  12.7k|        ret = ih264d_parse_ref_idx_cabac(u1_num_mb_part, 2, u1_dec_ref_l1, u1_mb_mc_mode,
  985|  12.7k|                                         pi1_ref_idx_l1, pi1_lft_cxt, pi1_top_cxt, ps_cab_env,
  986|  12.7k|                                         ps_bitstrm, ps_dec->p_ref_idx_t);
  987|       |
  988|  12.7k|        if(ret != OK)
  ------------------
  |  |  114|  12.7k|#define OK        0
  ------------------
  |  Branch (988:12): [True: 104, False: 12.6k]
  ------------------
  989|    104|        {
  990|    104|            return ret;
  991|    104|        }
  992|  12.7k|    }
  993|       |    /* Read MotionVectors */
  994|  12.6k|    {
  995|  12.6k|        const UWORD8 *pu1_top_left_sub_mb_indx;
  996|  12.6k|        UWORD8 uc_j, uc_lx;
  997|  12.6k|        UWORD8 u1_mb_part_wd, u1_mb_part_ht;
  998|       |
  999|  12.6k|        const UWORD8 *pu1_sub_mb_indx_mod =
 1000|  12.6k|            (const UWORD8 *) gau1_ih264d_submb_indx_mod + (u1_sub_mb * 6);
 1001|  12.6k|        const UWORD8 *pu1_sub_mb_partw = (const UWORD8 *) gau1_ih264d_submb_partw;
 1002|  12.6k|        const UWORD8 *pu1_sub_mb_parth = (const UWORD8 *) gau1_ih264d_submb_parth;
 1003|  12.6k|        const UWORD8 *pu1_num_sub_mb_part = (const UWORD8 *) gau1_ih264d_num_submb_part;
 1004|  12.6k|        const UWORD8 *pu1_mb_partw = (const UWORD8 *) gau1_ih264d_mb_partw;
 1005|  12.6k|        const UWORD8 *pu1_mb_parth = (const UWORD8 *) gau1_ih264d_mb_parth;
 1006|       |
 1007|  12.6k|        UWORD8 u1_p_idx = 0;
 1008|  12.6k|        UWORD8 u1_num_submb_part;
 1009|  12.6k|        parse_part_params_t *ps_part;
 1010|  12.6k|        mv_pred_t *ps_mv_start = ps_dec->ps_mv_cur + (u4_mb_num << 4);
 1011|  12.6k|        ps_part = ps_dec->ps_part;
 1012|       |
 1013|       |        /* Default initialization for non subMb case */
 1014|  12.6k|        u1_mb_part_wd = pu1_mb_partw[u1_mb_mc_mode];
 1015|  12.6k|        u1_mb_part_ht = pu1_mb_parth[u1_mb_mc_mode];
 1016|  12.6k|        u1_num_submb_part = 1;
 1017|       |
 1018|       |        /* Decoding the MV for the subMB */
 1019|  37.9k|        for(uc_lx = 0; uc_lx < 2; uc_lx++)
  ------------------
  |  Branch (1019:24): [True: 25.3k, False: 12.6k]
  ------------------
 1020|  25.3k|        {
 1021|  25.3k|            UWORD8 u1_sub_mb_num = 0;
 1022|  25.3k|            UWORD32 u4_mb_pred_mode_tmp = u4_mb_pred_mode;
 1023|  25.3k|            UWORD32 u4_mb_mc_mode_tmp = u4_mb_mc_mode;
 1024|  25.3k|            UWORD8 u1_mb_mc_mode_1, u1_pred_mode, uc_i;
 1025|  25.3k|            UWORD16 u2_sub_mb_num = 0x028A;
 1026|  25.3k|            UWORD8 u1_b2 = uc_lx << 1;
 1027|  25.3k|            u1_pred_mode = (uc_lx) ? PRED_L1 : PRED_L0;
  ------------------
  |  |  484|  12.6k|#define PRED_L1   2
  ------------------
                          u1_pred_mode = (uc_lx) ? PRED_L1 : PRED_L0;
  ------------------
  |  |  483|  37.9k|#define PRED_L0   1
  ------------------
  |  Branch (1027:28): [True: 12.6k, False: 12.6k]
  ------------------
 1028|       |            /* Default for Cabac */
 1029|  25.3k|            pu1_top_left_sub_mb_indx = pu1_sub_mb_indx_mod + (u1_mb_mc_mode << 1);
 1030|  79.6k|            for(uc_i = 0; uc_i < u1_num_mb_part; uc_i++)
  ------------------
  |  Branch (1030:27): [True: 54.3k, False: 25.3k]
  ------------------
 1031|  54.3k|            {
 1032|  54.3k|                WORD8 i1_pred = (UWORD8) (u4_mb_pred_mode_tmp >> 24);
 1033|  54.3k|                u1_mb_mc_mode_1 = (UWORD8) (u4_mb_mc_mode_tmp >> 24);
 1034|  54.3k|                u4_mb_pred_mode_tmp <<= 8;
 1035|  54.3k|                u4_mb_mc_mode_tmp <<= 8;
 1036|       |
 1037|       |                /* subMb prediction mode */
 1038|  54.3k|                if(u1_sub_mb)
  ------------------
  |  Branch (1038:20): [True: 30.8k, False: 23.4k]
  ------------------
 1039|  30.8k|                {
 1040|  30.8k|                    u1_mb_part_wd = pu1_sub_mb_partw[u1_mb_mc_mode_1];
 1041|  30.8k|                    u1_mb_part_ht = pu1_sub_mb_parth[u1_mb_mc_mode_1];
 1042|  30.8k|                    u1_sub_mb_num = u2_sub_mb_num >> 12;
 1043|  30.8k|                    pu1_top_left_sub_mb_indx = pu1_sub_mb_indx_mod + (u1_mb_mc_mode_1 << 1);
 1044|  30.8k|                    u1_num_submb_part = pu1_num_sub_mb_part[u1_mb_mc_mode_1];
 1045|  30.8k|                    u2_sub_mb_num = u2_sub_mb_num << 4;
 1046|  30.8k|                }
 1047|       |
 1048|   117k|                for(uc_j = 0; uc_j < u1_num_submb_part; uc_j++, pu1_top_left_sub_mb_indx++)
  ------------------
  |  Branch (1048:31): [True: 63.5k, False: 54.3k]
  ------------------
 1049|  63.5k|                {
 1050|  63.5k|                    mv_pred_t *ps_mv;
 1051|  63.5k|                    u1_sub_mb_num = u1_sub_mb_num + *pu1_top_left_sub_mb_indx;
 1052|  63.5k|                    ps_mv = ps_mv_start + u1_sub_mb_num;
 1053|       |
 1054|       |                    /* Storing Info for partitions, writing only once */
 1055|  63.5k|                    if(uc_lx)
  ------------------
  |  Branch (1055:24): [True: 31.7k, False: 31.7k]
  ------------------
 1056|  31.7k|                    {
 1057|  31.7k|                        ps_part->u1_is_direct = (!i1_pred);
 1058|  31.7k|                        ps_part->u1_pred_mode = i1_pred;
 1059|  31.7k|                        ps_part->u1_sub_mb_num = u1_sub_mb_num;
 1060|  31.7k|                        ps_part->u1_partheight = u1_mb_part_ht;
 1061|  31.7k|                        ps_part->u1_partwidth = u1_mb_part_wd;
 1062|       |
 1063|       |                        /* Increment partition Index */
 1064|  31.7k|                        u1_p_idx++;
 1065|  31.7k|                        ps_part++;
 1066|  31.7k|                    }
 1067|       |
 1068|  63.5k|                    ih264d_get_mvd_cabac(u1_sub_mb_num, u1_b2, u1_mb_part_wd, u1_mb_part_ht,
 1069|  63.5k|                                         (UWORD8) (i1_pred & u1_pred_mode), ps_dec, ps_mv);
 1070|  63.5k|                }
 1071|  54.3k|            }
 1072|  25.3k|        }
 1073|       |        /* write back to the scratch partition info */
 1074|  12.6k|        ps_dec->ps_part = ps_part;
 1075|  12.6k|        ps_parse_mb_data->u1_num_part = u1_sub_mb ? u1_p_idx : u1_num_mb_part;
  ------------------
  |  Branch (1075:41): [True: 3.85k, False: 8.79k]
  ------------------
 1076|  12.6k|    }
 1077|       |
 1078|  12.6k|    return OK;
  ------------------
  |  |  114|  12.6k|#define OK        0
  ------------------
 1079|  12.7k|}
isvcd_parse_bmb_non_direct_cavlc:
 1097|  13.0k|{
 1098|  13.0k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
 1099|  13.0k|    dec_bit_stream_t *ps_bitstrm = ps_dec->ps_bitstrm;
 1100|  13.0k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
 1101|  13.0k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
 1102|  13.0k|    UWORD8 *pu1_sub_mb_pred_modes = (UWORD8 *) (gau1_ih264d_submb_pred_modes) + 4;
 1103|  13.0k|    const UWORD8(*pu1_mb_pred_modes)[32] = (const UWORD8(*)[32]) gau1_ih264d_mb_pred_modes;
 1104|  13.0k|    const UWORD8 *pu1_num_mb_part = (const UWORD8 *) gau1_ih264d_num_mb_part;
 1105|  13.0k|    const UWORD8 *pu1_sub_mb_mc_mode = (const UWORD8 *) (gau1_ih264d_submb_mc_mode) + 4;
 1106|  13.0k|    parse_pmbarams_t *ps_parse_mb_data = ps_dec->ps_parse_mb_data + u4_num_mbsNby2;
 1107|  13.0k|    UWORD8 *pu1_col_info = ps_parse_mb_data->u1_col_info;
 1108|  13.0k|    WORD8(*pi1_ref_idx)[MAX_REFIDX_INFO_PER_MB] = ps_parse_mb_data->i1_ref_idx;
 1109|  13.0k|    UWORD8 u1_mb_type = ps_cur_mb_info->u1_mb_type;
 1110|  13.0k|    UWORD8 u1_mb_mc_mode, u1_num_mb_part, u1_sub_mb = !(u1_mb_type ^ B_8x8);
  ------------------
  |  |  480|  13.0k|#define B_8x8    22
  ------------------
 1111|  13.0k|    UWORD32 u4_mb_mc_mode = 0, u4_mb_pred_mode = 0;
 1112|  13.0k|    WORD32 ret = OK;
  ------------------
  |  |  114|  13.0k|#define OK        0
  ------------------
 1113|  13.0k|    dec_slice_svc_ext_params_t *ps_svc_slice_params = NULL;
 1114|  13.0k|    ps_svc_slice_params = &ps_svc_lyr_dec->s_svc_slice_params;
 1115|       |
 1116|  13.0k|    if(u1_sub_mb)
  ------------------
  |  Branch (1116:8): [True: 1.29k, False: 11.7k]
  ------------------
 1117|  1.29k|    {
 1118|  1.29k|        UWORD8 uc_i;
 1119|  1.29k|        u1_mb_mc_mode = 0;
 1120|  1.29k|        u1_num_mb_part = 4;
 1121|       |        /* Reading the subMB type */
 1122|  6.16k|        for(uc_i = 0; uc_i < 4; uc_i++)
  ------------------
  |  Branch (1122:23): [True: 5.00k, False: 1.15k]
  ------------------
 1123|  5.00k|        {
 1124|  5.00k|            UWORD32 ui_sub_mb_mode;
 1125|       |            // Inlined ih264d_uev
 1126|  5.00k|            UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
 1127|  5.00k|            UWORD32 u4_word, u4_ldz;
 1128|       |
 1129|       |            /***************************************************************/
 1130|       |            /* Find leading zeros in next 32 bits                          */
 1131|       |            /***************************************************************/
 1132|  5.00k|            NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  5.00k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  5.00k|{                                                                           \
  |  |  152|  5.00k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  5.00k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  5.00k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  5.00k|                                                                            \
  |  |  156|  5.00k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  5.00k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 4.52k, False: 483]
  |  |  ------------------
  |  |  158|  5.00k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  4.52k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  5.00k|}
  ------------------
 1133|  5.00k|            u4_ldz = CLZ(u4_word);
 1134|       |            /* Flush the ps_bitstrm */
 1135|  5.00k|            u4_bitstream_offset += (u4_ldz + 1);
 1136|       |            /* Read the suffix from the ps_bitstrm */
 1137|  5.00k|            u4_word = 0;
 1138|  5.00k|            if(u4_ldz) GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  2.94k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  2.94k|{                                                                           \
  |  |  122|  2.94k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  2.94k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  2.94k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  2.94k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  2.94k|                                                                            \
  |  |  127|  2.94k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 2.59k, False: 348]
  |  |  ------------------
  |  |  128|  2.94k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  2.59k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  2.94k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  2.94k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  2.94k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  2.94k|}                                                                           \
  ------------------
  |  Branch (1138:16): [True: 2.94k, False: 2.06k]
  ------------------
 1139|  5.00k|            *pu4_bitstrm_ofst = u4_bitstream_offset;
 1140|  5.00k|            ui_sub_mb_mode = ((1 << u4_ldz) + u4_word - 1);
 1141|       |            // Inlined ih264d_uev
 1142|  5.00k|            if(ui_sub_mb_mode > 12)
  ------------------
  |  Branch (1142:16): [True: 136, False: 4.87k]
  ------------------
 1143|    136|                return ERROR_SUB_MB_TYPE;
 1144|  4.87k|            else
 1145|  4.87k|            {
 1146|  4.87k|                UWORD8 u1_subMbPredMode = pu1_sub_mb_pred_modes[ui_sub_mb_mode];
 1147|  4.87k|                u4_mb_mc_mode = (u4_mb_mc_mode << 8) | pu1_sub_mb_mc_mode[ui_sub_mb_mode];
 1148|  4.87k|                u4_mb_pred_mode = (u4_mb_pred_mode << 8) | u1_subMbPredMode;
 1149|  4.87k|                pi1_ref_idx[0][uc_i] = ((u1_subMbPredMode & PRED_L0) - 1) >> 1;
  ------------------
  |  |  483|  4.87k|#define PRED_L0   1
  ------------------
 1150|  4.87k|                pi1_ref_idx[1][uc_i] = ((u1_subMbPredMode & PRED_L1) - 1) >> 1;
  ------------------
  |  |  484|  4.87k|#define PRED_L1   2
  ------------------
 1151|  4.87k|                COPYTHECONTEXT("sub_mb_type", u1_subMbPredMode);
 1152|  4.87k|            }
 1153|       |            /* Storing collocated Mb and SubMb mode information */
 1154|  4.87k|            *pu1_col_info++ = ((PRED_8x8) << 6) | ((pu1_sub_mb_mc_mode[ui_sub_mb_mode] << 4));
  ------------------
  |  |  453|  4.87k|#define PRED_8x8    3
  ------------------
 1155|  4.87k|            if(ui_sub_mb_mode != B_DIRECT_8x8)
  ------------------
  |  |  465|  4.87k|#define B_DIRECT_8x8    0
  ------------------
  |  Branch (1155:16): [True: 2.80k, False: 2.06k]
  ------------------
 1156|  2.80k|            {
 1157|  2.80k|                if(ui_sub_mb_mode > B_BI_8x8)
  ------------------
  |  |  468|  2.80k|#define B_BI_8x8        3
  ------------------
  |  Branch (1157:20): [True: 1.33k, False: 1.47k]
  ------------------
 1158|  1.33k|                {
 1159|  1.33k|                    ps_dec->s_high_profile.u1_no_submb_part_size_lt8x8_flag = 0;
 1160|  1.33k|                }
 1161|  2.80k|            }
 1162|  2.06k|            else if(!ps_dec->s_high_profile.u1_direct_8x8_inference_flag)
  ------------------
  |  Branch (1162:21): [True: 1.37k, False: 684]
  ------------------
 1163|  1.37k|            {
 1164|  1.37k|                ps_dec->s_high_profile.u1_no_submb_part_size_lt8x8_flag = 0;
 1165|  1.37k|            }
 1166|  4.87k|        }
 1167|  1.29k|    }
 1168|  11.7k|    else
 1169|  11.7k|    {
 1170|  11.7k|        UWORD8 u1_mb_pred_mode_idx = 5 + u1_mb_type;
 1171|  11.7k|        UWORD8 u1_mb_pred_mode_part0 = pu1_mb_pred_modes[0][u1_mb_pred_mode_idx];
 1172|  11.7k|        UWORD8 u1_mb_pred_mode_part1 = pu1_mb_pred_modes[1][u1_mb_pred_mode_idx];
 1173|  11.7k|        u1_mb_mc_mode = ps_cur_mb_info->u1_mb_mc_mode;
 1174|  11.7k|        u1_num_mb_part = pu1_num_mb_part[u1_mb_mc_mode];
 1175|       |
 1176|  11.7k|        pi1_ref_idx[0][0] = ((u1_mb_pred_mode_part0 & PRED_L0) - 1) >> 1;
  ------------------
  |  |  483|  11.7k|#define PRED_L0   1
  ------------------
 1177|  11.7k|        pi1_ref_idx[1][0] = ((u1_mb_pred_mode_part0 & PRED_L1) - 1) >> 1;
  ------------------
  |  |  484|  11.7k|#define PRED_L1   2
  ------------------
 1178|  11.7k|        pi1_ref_idx[0][1] = ((u1_mb_pred_mode_part1 & PRED_L0) - 1) >> 1;
  ------------------
  |  |  483|  11.7k|#define PRED_L0   1
  ------------------
 1179|  11.7k|        pi1_ref_idx[1][1] = ((u1_mb_pred_mode_part1 & PRED_L1) - 1) >> 1;
  ------------------
  |  |  484|  11.7k|#define PRED_L1   2
  ------------------
 1180|       |
 1181|  11.7k|        u4_mb_pred_mode = (u1_mb_pred_mode_part0 << 8) | u1_mb_pred_mode_part1;
 1182|  11.7k|        u4_mb_mc_mode = u1_mb_mc_mode | (u1_mb_mc_mode << 8);
 1183|  11.7k|        u4_mb_mc_mode <<= 16;
 1184|  11.7k|        u4_mb_pred_mode <<= 16;
 1185|       |
 1186|       |        /* Storing collocated Mb and SubMb mode information */
 1187|  11.7k|        *pu1_col_info++ = (u1_mb_mc_mode << 6);
 1188|  11.7k|        if(u1_mb_mc_mode) *pu1_col_info++ = (u1_mb_mc_mode << 6);
  ------------------
  |  Branch (1188:12): [True: 5.28k, False: 6.46k]
  ------------------
 1189|  11.7k|    }
 1190|       |
 1191|  12.9k|    {
 1192|  12.9k|        UWORD8 uc_i;
 1193|  12.9k|        UWORD8 *pu1_motion_pred_flag_l0;
 1194|  12.9k|        UWORD8 *pu1_motion_pred_flag_l1;
 1195|  12.9k|        UWORD8 u1_mvp_l1;
 1196|  12.9k|        UWORD8 u1_mvp_l0;
 1197|       |
 1198|  12.9k|        pu1_motion_pred_flag_l0 = &ps_svc_cur_mb_info->au1_motion_pred_flag[0];
 1199|  12.9k|        *pu1_motion_pred_flag_l0 = 0;
 1200|  12.9k|        pu1_motion_pred_flag_l1 = &ps_svc_cur_mb_info->au1_motion_pred_flag[1];
 1201|  12.9k|        *pu1_motion_pred_flag_l1 = 0;
 1202|       |
 1203|  12.9k|        if(ps_svc_cur_mb_info->u1_crop_window_flag &&
  ------------------
  |  Branch (1203:12): [True: 12.8k, False: 90]
  ------------------
 1204|  12.8k|           ps_svc_slice_params->u1_adaptive_motion_prediction_flag)
  ------------------
  |  Branch (1204:12): [True: 5.60k, False: 7.20k]
  ------------------
 1205|  5.60k|        {
 1206|  15.5k|            for(uc_i = 0; uc_i < u1_num_mb_part; uc_i++)
  ------------------
  |  Branch (1206:27): [True: 9.95k, False: 5.60k]
  ------------------
 1207|  9.95k|            {
 1208|  9.95k|                if(pi1_ref_idx[0][uc_i] > -1)
  ------------------
  |  Branch (1208:20): [True: 7.00k, False: 2.94k]
  ------------------
 1209|  7.00k|                {
 1210|  7.00k|                    u1_mvp_l0 = ih264d_get_bit_h264(ps_bitstrm);
 1211|  7.00k|                    COPYTHECONTEXT("SVC ext: ps_motion_prediction_flag_l0", u1_mvp_l0);
 1212|  7.00k|                    *pu1_motion_pred_flag_l0 |= (u1_mvp_l0 << uc_i);
 1213|  7.00k|                }
 1214|  9.95k|            }
 1215|       |
 1216|  15.5k|            for(uc_i = 0; uc_i < u1_num_mb_part; uc_i++)
  ------------------
  |  Branch (1216:27): [True: 9.95k, False: 5.60k]
  ------------------
 1217|  9.95k|            {
 1218|  9.95k|                if(pi1_ref_idx[1][uc_i] > -1)
  ------------------
  |  Branch (1218:20): [True: 2.07k, False: 7.87k]
  ------------------
 1219|  2.07k|                {
 1220|  2.07k|                    u1_mvp_l1 = ih264d_get_bit_h264(ps_bitstrm);
 1221|  2.07k|                    COPYTHECONTEXT("SVC ext: ps_motion_prediction_flag_l1", u1_mvp_l1);
 1222|  2.07k|                    *pu1_motion_pred_flag_l1 |= (u1_mvp_l1 << uc_i);
 1223|  2.07k|                }
 1224|  9.95k|            }
 1225|  5.60k|        }
 1226|  7.29k|        else if(ps_svc_cur_mb_info->u1_crop_window_flag)
  ------------------
  |  Branch (1226:17): [True: 7.20k, False: 90]
  ------------------
 1227|  7.20k|        {
 1228|  7.20k|            *pu1_motion_pred_flag_l0 = ps_svc_slice_params->u1_default_motion_prediction_flag
  ------------------
  |  Branch (1228:40): [True: 2.00k, False: 5.19k]
  ------------------
 1229|  7.20k|                                           ? ((1 << u1_num_mb_part) - 1)
 1230|  7.20k|                                           : 0;
 1231|  7.20k|            *pu1_motion_pred_flag_l1 = ps_svc_slice_params->u1_default_motion_prediction_flag
  ------------------
  |  Branch (1231:40): [True: 2.00k, False: 5.19k]
  ------------------
 1232|  7.20k|                                           ? ((1 << u1_num_mb_part) - 1)
 1233|  7.20k|                                           : 0;
 1234|  7.20k|        }
 1235|       |
 1236|  12.9k|        {
 1237|  12.9k|            UWORD8 u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
 1238|  12.9k|            UWORD8 uc_field = ps_cur_mb_info->u1_mb_field_decodingflag;
 1239|  12.9k|            UWORD8 *pu1_num_ref_idx_lx_active = ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active;
 1240|  12.9k|            const UWORD8 u1_mbaff_field = (u1_mbaff & uc_field);
 1241|  12.9k|            UWORD8 u4_num_ref_idx_lx_active;
 1242|       |
 1243|  12.9k|            u4_num_ref_idx_lx_active = (pu1_num_ref_idx_lx_active[0] << u1_mbaff_field) - 1;
 1244|       |
 1245|  12.9k|            if(u4_num_ref_idx_lx_active)
  ------------------
  |  Branch (1245:16): [True: 8.48k, False: 4.42k]
  ------------------
 1246|  8.48k|            {
 1247|  8.48k|                if(1 == u4_num_ref_idx_lx_active)
  ------------------
  |  Branch (1247:20): [True: 2.36k, False: 6.11k]
  ------------------
 1248|  2.36k|                    isvcd_parse_bmb_ref_index_cavlc_range1(u1_num_mb_part, ps_bitstrm,
 1249|  2.36k|                                                           pi1_ref_idx[0], u4_num_ref_idx_lx_active,
 1250|  2.36k|                                                           pu1_motion_pred_flag_l0);
 1251|  6.11k|                else
 1252|  6.11k|                {
 1253|  6.11k|                    isvcd_parse_bmb_ref_index_cavlc(u1_num_mb_part, ps_bitstrm, pi1_ref_idx[0],
 1254|  6.11k|                                                    u4_num_ref_idx_lx_active,
 1255|  6.11k|                                                    pu1_motion_pred_flag_l0);
 1256|  6.11k|                    if(ret != OK) return ret;
  ------------------
  |  |  114|  6.11k|#define OK        0
  ------------------
  |  Branch (1256:24): [True: 0, False: 6.11k]
  ------------------
 1257|  6.11k|                }
 1258|  8.48k|            }
 1259|       |
 1260|  12.9k|            u4_num_ref_idx_lx_active = (pu1_num_ref_idx_lx_active[1] << u1_mbaff_field) - 1;
 1261|       |
 1262|  12.9k|            if(u4_num_ref_idx_lx_active)
  ------------------
  |  Branch (1262:16): [True: 7.94k, False: 4.95k]
  ------------------
 1263|  7.94k|            {
 1264|  7.94k|                if(1 == u4_num_ref_idx_lx_active)
  ------------------
  |  Branch (1264:20): [True: 3.20k, False: 4.74k]
  ------------------
 1265|  3.20k|                    isvcd_parse_bmb_ref_index_cavlc_range1(u1_num_mb_part, ps_bitstrm,
 1266|  3.20k|                                                           pi1_ref_idx[1], u4_num_ref_idx_lx_active,
 1267|  3.20k|                                                           pu1_motion_pred_flag_l1);
 1268|  4.74k|                else
 1269|  4.74k|                {
 1270|  4.74k|                    ret = isvcd_parse_bmb_ref_index_cavlc(u1_num_mb_part, ps_bitstrm,
 1271|  4.74k|                                                          pi1_ref_idx[1], u4_num_ref_idx_lx_active,
 1272|  4.74k|                                                          pu1_motion_pred_flag_l1);
 1273|  4.74k|                    if(ret != OK) return ret;
  ------------------
  |  |  114|  4.74k|#define OK        0
  ------------------
  |  Branch (1273:24): [True: 205, False: 4.53k]
  ------------------
 1274|  4.74k|                }
 1275|  7.94k|            }
 1276|  12.9k|        }
 1277|  12.9k|    }
 1278|       |    /* Read MotionVectors */
 1279|  12.6k|    {
 1280|  12.6k|        const UWORD8 *pu1_top_left_sub_mb_indx;
 1281|  12.6k|        const UWORD8 *pu1_sub_mb_indx_mod =
 1282|  12.6k|            (const UWORD8 *) (gau1_ih264d_submb_indx_mod) + (u1_sub_mb * 6);
 1283|  12.6k|        const UWORD8 *pu1_sub_mb_partw = (const UWORD8 *) gau1_ih264d_submb_partw;
 1284|  12.6k|        const UWORD8 *pu1_sub_mb_parth = (const UWORD8 *) gau1_ih264d_submb_parth;
 1285|  12.6k|        const UWORD8 *pu1_num_sub_mb_part = (const UWORD8 *) gau1_ih264d_num_submb_part;
 1286|  12.6k|        const UWORD8 *pu1_mb_partw = (const UWORD8 *) gau1_ih264d_mb_partw;
 1287|  12.6k|        const UWORD8 *pu1_mb_parth = (const UWORD8 *) gau1_ih264d_mb_parth;
 1288|  12.6k|        UWORD8 u1_p_idx = 0, u1_num_submb_part, uc_lx;
 1289|  12.6k|        parse_part_params_t *ps_part;
 1290|  12.6k|        mv_pred_t *ps_mv_start = ps_dec->ps_mv_cur + (u4_mb_num << 4);
 1291|  12.6k|        UWORD8 u1_mb_part_wd, u1_mb_part_ht;
 1292|       |
 1293|  12.6k|        ps_part = ps_dec->ps_part;
 1294|       |        /* Default Initialization for Non subMb Case Mode */
 1295|  12.6k|        u1_mb_part_wd = pu1_mb_partw[u1_mb_mc_mode];
 1296|  12.6k|        u1_mb_part_ht = pu1_mb_parth[u1_mb_mc_mode];
 1297|  12.6k|        u1_num_submb_part = 1;
 1298|       |
 1299|       |        /* Decoding the MV for the subMB */
 1300|  38.0k|        for(uc_lx = 0; uc_lx < 2; uc_lx++)
  ------------------
  |  Branch (1300:24): [True: 25.3k, False: 12.6k]
  ------------------
 1301|  25.3k|        {
 1302|  25.3k|            UWORD8 u1_sub_mb_num = 0, u1_pred_mode, uc_i;
 1303|  25.3k|            UWORD32 u4_mb_mc_mode_tmp = u4_mb_mc_mode;
 1304|  25.3k|            UWORD32 u4_mb_pred_mode_tmp = u4_mb_pred_mode;
 1305|  25.3k|            UWORD16 u2_sub_mb_num = 0x028A;  // for sub mb case
 1306|  25.3k|            UWORD8 u1_b2 = uc_lx << 1;
 1307|  25.3k|            u1_pred_mode = (uc_lx) ? PRED_L1 : PRED_L0;
  ------------------
  |  |  484|  12.6k|#define PRED_L1   2
  ------------------
                          u1_pred_mode = (uc_lx) ? PRED_L1 : PRED_L0;
  ------------------
  |  |  483|  38.0k|#define PRED_L0   1
  ------------------
  |  Branch (1307:28): [True: 12.6k, False: 12.6k]
  ------------------
 1308|  25.3k|            pu1_top_left_sub_mb_indx = pu1_sub_mb_indx_mod + (u1_mb_mc_mode << 1);
 1309|       |
 1310|  67.9k|            for(uc_i = 0; uc_i < u1_num_mb_part; uc_i++)
  ------------------
  |  Branch (1310:27): [True: 42.5k, False: 25.3k]
  ------------------
 1311|  42.5k|            {
 1312|  42.5k|                UWORD8 u1_mb_mc_mode, uc_j;
 1313|  42.5k|                UWORD8 i1_pred = u4_mb_pred_mode_tmp >> 24;
 1314|  42.5k|                u1_mb_mc_mode = u4_mb_mc_mode_tmp >> 24;
 1315|  42.5k|                u4_mb_pred_mode_tmp <<= 8;
 1316|  42.5k|                u4_mb_mc_mode_tmp <<= 8;
 1317|       |                /* subMb prediction mode */
 1318|  42.5k|                if(u1_sub_mb)
  ------------------
  |  Branch (1318:20): [True: 9.24k, False: 33.2k]
  ------------------
 1319|  9.24k|                {
 1320|  9.24k|                    u1_mb_part_wd = pu1_sub_mb_partw[u1_mb_mc_mode];
 1321|  9.24k|                    u1_mb_part_ht = pu1_sub_mb_parth[u1_mb_mc_mode];
 1322|  9.24k|                    u1_sub_mb_num = u2_sub_mb_num >> 12;
 1323|  9.24k|                    u1_num_submb_part = pu1_num_sub_mb_part[u1_mb_mc_mode];
 1324|  9.24k|                    pu1_top_left_sub_mb_indx = pu1_sub_mb_indx_mod + (u1_mb_mc_mode << 1);
 1325|  9.24k|                    u2_sub_mb_num <<= 4;
 1326|  9.24k|                }
 1327|  91.0k|                for(uc_j = 0; uc_j < u1_num_submb_part; uc_j++, pu1_top_left_sub_mb_indx++)
  ------------------
  |  Branch (1327:31): [True: 48.5k, False: 42.5k]
  ------------------
 1328|  48.5k|                {
 1329|  48.5k|                    mv_pred_t *ps_mv;
 1330|  48.5k|                    u1_sub_mb_num = u1_sub_mb_num + *pu1_top_left_sub_mb_indx;
 1331|  48.5k|                    ps_mv = ps_mv_start + u1_sub_mb_num;
 1332|       |
 1333|       |                    /* Storing Info for partitions, writing only once */
 1334|  48.5k|                    if(uc_lx)
  ------------------
  |  Branch (1334:24): [True: 24.2k, False: 24.2k]
  ------------------
 1335|  24.2k|                    {
 1336|  24.2k|                        ps_part->u1_is_direct = (!i1_pred);
 1337|  24.2k|                        ps_part->u1_pred_mode = i1_pred;
 1338|  24.2k|                        ps_part->u1_sub_mb_num = u1_sub_mb_num;
 1339|  24.2k|                        ps_part->u1_partheight = u1_mb_part_ht;
 1340|  24.2k|                        ps_part->u1_partwidth = u1_mb_part_wd;
 1341|       |                        /* Increment partition Index */
 1342|  24.2k|                        u1_p_idx++;
 1343|  24.2k|                        ps_part++;
 1344|  24.2k|                    }
 1345|       |
 1346|  48.5k|                    if(i1_pred & u1_pred_mode)
  ------------------
  |  Branch (1346:24): [True: 23.4k, False: 25.0k]
  ------------------
 1347|  23.4k|                    {
 1348|  23.4k|                        WORD16 i2_mvx, i2_mvy;
 1349|       |                        // inlining ih264d_sev
 1350|  23.4k|                        {
 1351|  23.4k|                            UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
 1352|  23.4k|                            UWORD32 u4_word, u4_ldz, u4_abs_val;
 1353|       |
 1354|       |                            /***************************************************************/
 1355|       |                            /* Find leading zeros in next 32 bits                          */
 1356|       |                            /***************************************************************/
 1357|  23.4k|                            NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  23.4k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  23.4k|{                                                                           \
  |  |  152|  23.4k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  23.4k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  23.4k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  23.4k|                                                                            \
  |  |  156|  23.4k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  23.4k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 22.8k, False: 636]
  |  |  ------------------
  |  |  158|  23.4k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  22.8k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  23.4k|}
  ------------------
 1358|  23.4k|                            u4_ldz = CLZ(u4_word);
 1359|       |
 1360|       |                            /* Flush the ps_bitstrm */
 1361|  23.4k|                            u4_bitstream_offset += (u4_ldz + 1);
 1362|       |
 1363|       |                            /* Read the suffix from the ps_bitstrm */
 1364|  23.4k|                            u4_word = 0;
 1365|  23.4k|                            if(u4_ldz)
  ------------------
  |  Branch (1365:32): [True: 10.2k, False: 13.1k]
  ------------------
 1366|  10.2k|                                GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  10.2k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  10.2k|{                                                                           \
  |  |  122|  10.2k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  10.2k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  10.2k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  10.2k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  10.2k|                                                                            \
  |  |  127|  10.2k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 9.53k, False: 720]
  |  |  ------------------
  |  |  128|  10.2k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  9.53k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  10.2k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  10.2k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  10.2k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  10.2k|}                                                                           \
  ------------------
 1367|       |
 1368|  23.4k|                            *pu4_bitstrm_ofst = u4_bitstream_offset;
 1369|  23.4k|                            u4_abs_val = ((1 << u4_ldz) + u4_word) >> 1;
 1370|       |
 1371|  23.4k|                            if(u4_word & 0x1)
  ------------------
  |  Branch (1371:32): [True: 7.80k, False: 15.6k]
  ------------------
 1372|  7.80k|                                i2_mvx = (-(WORD32) u4_abs_val);
 1373|  15.6k|                            else
 1374|  15.6k|                                i2_mvx = (u4_abs_val);
 1375|  23.4k|                        }
 1376|       |                        // inlinined ih264d_sev
 1377|  23.4k|                        {
 1378|  23.4k|                            UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
 1379|  23.4k|                            UWORD32 u4_word, u4_ldz, u4_abs_val;
 1380|       |
 1381|       |                            /***************************************************************/
 1382|       |                            /* Find leading zeros in next 32 bits                          */
 1383|       |                            /***************************************************************/
 1384|  23.4k|                            NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  23.4k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  23.4k|{                                                                           \
  |  |  152|  23.4k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  23.4k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  23.4k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  23.4k|                                                                            \
  |  |  156|  23.4k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  23.4k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 22.6k, False: 763]
  |  |  ------------------
  |  |  158|  23.4k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  22.6k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  23.4k|}
  ------------------
 1385|  23.4k|                            u4_ldz = CLZ(u4_word);
 1386|       |
 1387|       |                            /* Flush the ps_bitstrm */
 1388|  23.4k|                            u4_bitstream_offset += (u4_ldz + 1);
 1389|       |
 1390|       |                            /* Read the suffix from the ps_bitstrm */
 1391|  23.4k|                            u4_word = 0;
 1392|  23.4k|                            if(u4_ldz)
  ------------------
  |  Branch (1392:32): [True: 12.1k, False: 11.3k]
  ------------------
 1393|  12.1k|                                GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  12.1k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  12.1k|{                                                                           \
  |  |  122|  12.1k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  12.1k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  12.1k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  12.1k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  12.1k|                                                                            \
  |  |  127|  12.1k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 11.4k, False: 649]
  |  |  ------------------
  |  |  128|  12.1k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  11.4k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  12.1k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  12.1k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  12.1k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  12.1k|}                                                                           \
  ------------------
 1394|       |
 1395|  23.4k|                            *pu4_bitstrm_ofst = u4_bitstream_offset;
 1396|  23.4k|                            u4_abs_val = ((1 << u4_ldz) + u4_word) >> 1;
 1397|       |
 1398|  23.4k|                            if(u4_word & 0x1)
  ------------------
  |  Branch (1398:32): [True: 4.60k, False: 18.8k]
  ------------------
 1399|  4.60k|                                i2_mvy = (-(WORD32) u4_abs_val);
 1400|  18.8k|                            else
 1401|  18.8k|                                i2_mvy = (u4_abs_val);
 1402|  23.4k|                        }
 1403|       |                        // inlinined ih264d_sev
 1404|       |                        /* Storing Mv residuals */
 1405|  23.4k|                        ps_mv->i2_mv[u1_b2] = i2_mvx;
 1406|  23.4k|                        ps_mv->i2_mv[u1_b2 + 1] = i2_mvy;
 1407|  23.4k|                    }
 1408|  48.5k|                }
 1409|  42.5k|            }
 1410|  25.3k|        }
 1411|       |        /* write back to the scratch partition info */
 1412|  12.6k|        ps_dec->ps_part = ps_part;
 1413|  12.6k|        ps_parse_mb_data->u1_num_part = u1_sub_mb ? u1_p_idx : u1_num_mb_part;
  ------------------
  |  Branch (1413:41): [True: 1.15k, False: 11.5k]
  ------------------
 1414|  12.6k|    }
 1415|  12.6k|    return OK;
  ------------------
  |  |  114|  12.6k|#define OK        0
  ------------------
 1416|  12.9k|}
isvcd_parse_ebslice:
 1431|  13.3k|{
 1432|  13.3k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
 1433|  13.3k|    WORD32 i_status = OK;
  ------------------
  |  |  114|  13.3k|#define OK        0
  ------------------
 1434|  13.3k|    dec_pic_params_t *ps_pps = ps_dec->ps_cur_pps;
 1435|  13.3k|    dec_slice_params_t *ps_slice = ps_dec->ps_cur_slice;
 1436|  13.3k|    dec_bit_stream_t *ps_bitstrm = ps_dec->ps_bitstrm;
 1437|  13.3k|    dec_svc_seq_params_t *ps_subset_seq;
 1438|  13.3k|    dec_slice_svc_ext_params_t *ps_svc_slice_params = NULL;
 1439|  13.3k|    dec_subset_seq_params_t *ps_sps_svc_ext = NULL;
 1440|  13.3k|    dec_nal_unit_svc_ext_params_t *ps_nal_svc_ext = NULL;
 1441|  13.3k|    UWORD8 u1_ref_idx_re_flag_lx;
 1442|  13.3k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
 1443|  13.3k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
 1444|  13.3k|    UWORD64 u8_ref_idx_l0, u8_ref_idx_l1;
 1445|  13.3k|    UWORD32 u4_temp;
 1446|  13.3k|    WORD32 i_temp;
 1447|  13.3k|    WORD32 ret;
 1448|       |
 1449|  13.3k|    ps_nal_svc_ext = ps_svc_lyr_dec->ps_nal_svc_ext;
 1450|  13.3k|    ps_subset_seq = ps_svc_lyr_dec->ps_cur_subset_sps;
 1451|  13.3k|    ps_sps_svc_ext = &ps_subset_seq->s_sps_svc_ext;
 1452|  13.3k|    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.3k|    {
 1458|  13.3k|        WORD8 *pi1_buf;
 1459|  13.3k|        WORD16 *pi2_mv = ps_dec->s_default_mv_pred.i2_mv;
 1460|  13.3k|        WORD32 *pi4_mv = (WORD32 *) pi2_mv;
 1461|  13.3k|        WORD16 *pi16_refFrame;
 1462|  13.3k|        pi1_buf = ps_dec->s_default_mv_pred.i1_ref_frame;
 1463|  13.3k|        pi16_refFrame = (WORD16 *) pi1_buf;
 1464|  13.3k|        *pi4_mv = 0;
 1465|  13.3k|        *(pi4_mv + 1) = 0;
 1466|  13.3k|        *pi16_refFrame = OUT_OF_RANGE_REF;
  ------------------
  |  |   45|  13.3k|#define OUT_OF_RANGE_REF  -1
  ------------------
 1467|  13.3k|        ps_dec->s_default_mv_pred.u1_col_ref_pic_idx = (UWORD8) -1;
 1468|  13.3k|        ps_dec->s_default_mv_pred.u1_pic_type = (UWORD8) -1;
 1469|  13.3k|    }
 1470|       |
 1471|  13.3k|    if(0 == ps_svc_lyr_dec->ps_nal_svc_ext->u1_quality_id)
  ------------------
  |  Branch (1471:8): [True: 13.3k, False: 0]
  ------------------
 1472|  13.3k|    {
 1473|  13.3k|        ps_slice->u1_num_ref_idx_active_override_flag = ih264d_get_bit_h264(ps_bitstrm);
 1474|  13.3k|        COPYTHECONTEXT("Slice Header SVC ext: num_ref_idx_override_flag",
 1475|  13.3k|                       ps_slice->u1_num_ref_idx_active_override_flag);
 1476|       |
 1477|  13.3k|        u8_ref_idx_l0 = ps_dec->ps_cur_pps->u1_num_ref_idx_lx_active[0];
 1478|  13.3k|        u8_ref_idx_l1 = ps_dec->ps_cur_pps->u1_num_ref_idx_lx_active[1];
 1479|  13.3k|        if(ps_slice->u1_num_ref_idx_active_override_flag)
  ------------------
  |  Branch (1479:12): [True: 7.48k, False: 5.81k]
  ------------------
 1480|  7.48k|        {
 1481|  7.48k|            u8_ref_idx_l0 = (UWORD64) 1 + ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1482|  7.48k|            COPYTHECONTEXT("Slice Header SVC ext: num_ref_idx_l0_active_minus1", u8_ref_idx_l0 - 1);
 1483|       |
 1484|  7.48k|            u8_ref_idx_l1 = (UWORD64) 1 + ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1485|  7.48k|            COPYTHECONTEXT("Slice Header SVC ext: num_ref_idx_l1_active_minus1", u8_ref_idx_l1 - 1);
 1486|  7.48k|        }
 1487|       |
 1488|  13.3k|        {
 1489|  13.3k|            UWORD8 u1_max_ref_idx = H264_MAX_REF_PICS;
  ------------------
  |  |  534|  13.3k|#define H264_MAX_REF_PICS         16
  ------------------
 1490|  13.3k|            if(ps_slice->u1_field_pic_flag)
  ------------------
  |  Branch (1490:16): [True: 0, False: 13.3k]
  ------------------
 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.3k|            if((u8_ref_idx_l0 >= u1_max_ref_idx) || (u8_ref_idx_l1 >= u1_max_ref_idx))
  ------------------
  |  Branch (1494:16): [True: 212, False: 13.0k]
  |  Branch (1494:53): [True: 225, False: 12.8k]
  ------------------
 1495|    437|            {
 1496|    437|                return ERROR_NUM_REF;
 1497|    437|            }
 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: 4.38k, False: 8.48k]
  ------------------
 1512|  4.38k|        {
 1513|  4.38k|            WORD8 ret;
 1514|  4.38k|            ps_dec->ps_ref_pic_buf_lx[0] = ps_dec->ps_dpb_mgr->ps_mod_dpb[0];
 1515|  4.38k|            ret = ih264d_ref_idx_reordering(ps_dec, 0);
 1516|  4.38k|            if(ret == -1) return ERROR_REFIDX_ORDER_T;
  ------------------
  |  Branch (1516:16): [True: 0, False: 4.38k]
  ------------------
 1517|  4.38k|        }
 1518|  8.48k|        else
 1519|  8.48k|            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.53k, False: 7.33k]
  ------------------
 1527|  5.53k|        {
 1528|  5.53k|            WORD8 ret;
 1529|  5.53k|            ps_dec->ps_ref_pic_buf_lx[1] = ps_dec->ps_dpb_mgr->ps_mod_dpb[1];
 1530|  5.53k|            ret = ih264d_ref_idx_reordering(ps_dec, 1);
 1531|  5.53k|            if(ret == -1) return ERROR_REFIDX_ORDER_T;
  ------------------
  |  Branch (1531:16): [True: 0, False: 5.53k]
  ------------------
 1532|  5.53k|        }
 1533|  7.33k|        else
 1534|  7.33k|            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|  39.3k|            for(idx = 0; idx < ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[0]; idx++)
  ------------------
  |  Branch (1545:26): [True: 26.5k, False: 12.8k]
  ------------------
 1546|  26.5k|            {
 1547|  26.5k|                ps_pic = ps_dec->ps_ref_pic_buf_lx[0][idx];
 1548|  26.5k|                ppv_map_ref_idx_to_poc_lx[idx] = (ps_pic->pu1_buf1);
 1549|  26.5k|            }
 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|  46.7k|            for(idx = 0; idx < ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[1]; idx++)
  ------------------
  |  Branch (1555:26): [True: 33.8k, False: 12.8k]
  ------------------
 1556|  33.8k|            {
 1557|  33.8k|                ps_pic = ps_dec->ps_ref_pic_buf_lx[1][idx];
 1558|  33.8k|                ppv_map_ref_idx_to_poc_lx[idx] = (ps_pic->pu1_buf1);
 1559|  33.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.71k, False: 5.16k]
  ------------------
 1606|  7.71k|            {
 1607|  7.71k|                WORD32 num_entries;
 1608|  7.71k|                WORD32 size;
 1609|  7.71k|                num_entries = MAX_FRAMES;
  ------------------
  |  |  600|  7.71k|#define MAX_FRAMES              16
  ------------------
 1610|  7.71k|                if((1 >= ps_dec->ps_cur_sps->u1_num_ref_frames) && (0 == ps_dec->i4_display_delay))
  ------------------
  |  Branch (1610:20): [True: 7.06k, False: 641]
  |  Branch (1610:68): [True: 0, False: 7.06k]
  ------------------
 1611|      0|                {
 1612|      0|                    num_entries = 1;
 1613|      0|                }
 1614|       |
 1615|  7.71k|                num_entries = ((2 * num_entries) + 1);
 1616|  7.71k|                num_entries *= 2;
 1617|       |
 1618|  7.71k|                size = num_entries * sizeof(void *);
 1619|  7.71k|                size += PAD_MAP_IDX_POC * sizeof(void *);
  ------------------
  |  |  100|  7.71k|#define PAD_MAP_IDX_POC             (1)
  ------------------
 1620|       |
 1621|  7.71k|                memcpy((void *) ps_dec->ps_parse_cur_slice->ppv_map_ref_idx_to_poc,
 1622|  7.71k|                       ps_dec->ppv_map_ref_idx_to_poc, size);
 1623|  7.71k|            }
 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: 4.99k, False: 7.87k]
  ------------------
 1633|  4.99k|        {
 1634|  4.99k|            if(!ps_nal_svc_ext->u1_no_inter_layer_pred_flag)
  ------------------
  |  Branch (1634:16): [True: 4.99k, False: 0]
  ------------------
 1635|  4.99k|            {
 1636|  4.99k|                ps_svc_slice_params->u1_base_pred_weight_table_flag =
 1637|  4.99k|                    ih264d_get_bit_h264(ps_bitstrm);
 1638|  4.99k|                COPYTHECONTEXT("Slice Header SVC ext: u1_base_pred_weight_table_flag",
 1639|  4.99k|                               ps_svc_slice_params->u1_base_pred_weight_table_flag);
 1640|  4.99k|            }
 1641|       |
 1642|  4.99k|            if(ps_nal_svc_ext->u1_no_inter_layer_pred_flag ||
  ------------------
  |  Branch (1642:16): [True: 0, False: 4.99k]
  ------------------
 1643|  4.99k|               !ps_svc_slice_params->u1_base_pred_weight_table_flag)
  ------------------
  |  Branch (1643:16): [True: 2.43k, False: 2.56k]
  ------------------
 1644|  2.43k|            {
 1645|  2.43k|                ih264d_parse_pred_weight_table(ps_slice, ps_bitstrm);
 1646|       |
 1647|  2.43k|                ih264d_form_pred_weight_matrix(ps_dec);
 1648|  2.43k|                ps_dec->pu4_wt_ofsts = ps_dec->pu4_wts_ofsts_mat;
 1649|  2.43k|            }
 1650|  4.99k|        }
 1651|  7.87k|        else if(ps_pps->u1_wted_bipred_idc == 2)
  ------------------
  |  Branch (1651:17): [True: 3.02k, False: 4.85k]
  ------------------
 1652|  3.02k|        {
 1653|       |            /* Implicit Weighted prediction */
 1654|  3.02k|            ps_slice->u2_log2Y_crwd = 0x0505;
 1655|  3.02k|            ps_dec->pu4_wt_ofsts = ps_dec->pu4_wts_ofsts_mat;
 1656|  3.02k|            ih264d_get_implicit_weights(ps_dec);
 1657|  3.02k|        }
 1658|  4.85k|        else
 1659|  4.85k|            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.58k, False: 5.28k]
  ------------------
 1665|  7.58k|        {
 1666|  7.58k|            if(!ps_dec->ps_dpb_cmds->u1_dpb_commands_read)
  ------------------
  |  Branch (1666:16): [True: 7.51k, False: 75]
  ------------------
 1667|  7.51k|            {
 1668|  7.51k|                dec_pic_params_t *ps_pps = ps_dec->ps_cur_pps;
 1669|  7.51k|                dec_seq_params_t *ps_sps_tmp = ps_pps->ps_sps;
 1670|  7.51k|                UWORD8 u1_nal_unit_type_tmp = ps_dec->u1_nal_unit_type;
 1671|       |
 1672|  7.51k|                ps_pps->ps_sps = ps_dec->ps_cur_sps;
 1673|  7.51k|                if(ps_svc_lyr_dec->ps_nal_svc_ext->u1_idr_flag)
  ------------------
  |  Branch (1673:20): [True: 7.27k, False: 240]
  ------------------
 1674|  7.27k|                    ps_dec->u1_nal_unit_type = IDR_SLICE_NAL;
  ------------------
  |  |  328|  7.27k|#define IDR_SLICE_NAL                   5
  ------------------
 1675|       |
 1676|  7.51k|                i_temp = ih264d_read_mmco_commands(ps_dec);
 1677|       |
 1678|  7.51k|                ps_pps->ps_sps = ps_sps_tmp;
 1679|  7.51k|                ps_dec->u1_nal_unit_type = u1_nal_unit_type_tmp;
 1680|       |
 1681|  7.51k|                if(i_temp < 0)
  ------------------
  |  Branch (1681:20): [True: 68, False: 7.44k]
  ------------------
 1682|     68|                {
 1683|     68|                    return ERROR_DBP_MANAGER_T;
 1684|     68|                }
 1685|  7.44k|                ps_dec->u4_bitoffset = i_temp;
 1686|  7.44k|            }
 1687|     75|            else
 1688|     75|                ps_bitstrm->u4_ofst += ps_dec->u4_bitoffset;
 1689|       |
 1690|  7.52k|            if(!ps_sps_svc_ext->u1_slice_header_restriction_flag)
  ------------------
  |  Branch (1690:16): [True: 6.44k, False: 1.07k]
  ------------------
 1691|  6.44k|            {
 1692|  6.44k|                ps_svc_slice_params->u1_store_ref_base_pic_flag = ih264d_get_bit_h264(ps_bitstrm);
 1693|  6.44k|                COPYTHECONTEXT("SPS_SVC_EXT: u1_store_ref_base_pic_flag",
 1694|  6.44k|                               ps_svc_slice_params->u1_store_ref_base_pic_flag);
 1695|       |
 1696|  6.44k|                if(0 != ps_svc_slice_params->u1_store_ref_base_pic_flag)
  ------------------
  |  Branch (1696:20): [True: 649, False: 5.79k]
  ------------------
 1697|    649|                {
 1698|    649|                    return NOT_OK;
  ------------------
  |  |  116|    649|#define NOT_OK    -1
  ------------------
 1699|    649|                }
 1700|  5.79k|                if(((1 == ps_nal_svc_ext->u1_use_ref_base_pic_flag) ||
  ------------------
  |  Branch (1700:21): [True: 0, False: 5.79k]
  ------------------
 1701|  5.79k|                    (1 == ps_svc_slice_params->u1_store_ref_base_pic_flag)) &&
  ------------------
  |  Branch (1701:21): [True: 0, False: 5.79k]
  ------------------
 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.79k|            }
 1712|  7.52k|        }
 1713|  12.8k|    }
 1714|       |    /* G050 */
 1715|       |    /*Code is present in standard but omitted in the reference code*/
 1716|  12.1k|    if(ps_pps->u1_entropy_coding_mode == CABAC)
  ------------------
  |  |  339|  12.1k|#define CABAC  1
  ------------------
  |  Branch (1716:8): [True: 2.59k, False: 9.55k]
  ------------------
 1717|  2.59k|    {
 1718|  2.59k|        u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1719|  2.59k|        if(u4_temp > MAX_CABAC_INIT_IDC)
  ------------------
  |  |  537|  2.59k|#define MAX_CABAC_INIT_IDC        2
  ------------------
  |  Branch (1719:12): [True: 132, False: 2.46k]
  ------------------
 1720|    132|        {
 1721|    132|            return ERROR_INV_SLICE_HDR_T;
 1722|    132|        }
 1723|  2.46k|        ps_slice->u1_cabac_init_idc = u4_temp;
 1724|  2.46k|        COPYTHECONTEXT("Slice Header SVC ext: cabac_init_idc", ps_slice->u1_cabac_init_idc);
 1725|  2.46k|    }
 1726|       |
 1727|  12.0k|    {
 1728|       |        /* Read slice_qp_delta */
 1729|  12.0k|        WORD64 i8_temp =
 1730|  12.0k|            (WORD64) ps_pps->u1_pic_init_qp + ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1731|  12.0k|        if((i8_temp < MIN_H264_QP) || (i8_temp > MAX_H264_QP))
  ------------------
  |  |  629|  12.0k|#define MIN_H264_QP 0
  ------------------
                      if((i8_temp < MIN_H264_QP) || (i8_temp > MAX_H264_QP))
  ------------------
  |  |  634|  11.7k|#define MAX_H264_QP 51
  ------------------
  |  Branch (1731:12): [True: 296, False: 11.7k]
  |  Branch (1731:39): [True: 1.39k, False: 10.3k]
  ------------------
 1732|  1.69k|        {
 1733|  1.69k|            return ERROR_INV_RANGE_QP_T;
 1734|  1.69k|        }
 1735|  10.3k|        ps_slice->u1_slice_qp = (UWORD8) i8_temp;
 1736|  10.3k|        COPYTHECONTEXT("Slice Header SVC ext: slice_qp_delta",
 1737|  10.3k|                       (WORD8) (ps_slice->u1_slice_qp - ps_pps->u1_pic_init_qp));
 1738|  10.3k|    }
 1739|  10.3k|    if(ps_pps->u1_deblocking_filter_parameters_present_flag == 1)
  ------------------
  |  Branch (1739:8): [True: 6.91k, False: 3.41k]
  ------------------
 1740|  6.91k|    {
 1741|  6.91k|        u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1742|  6.91k|        if(u4_temp > SLICE_BOUNDARY_DBLK_DISABLED)
  ------------------
  |  |  547|  6.91k|#define SLICE_BOUNDARY_DBLK_DISABLED  2
  ------------------
  |  Branch (1742:12): [True: 246, False: 6.66k]
  ------------------
 1743|    246|        {
 1744|    246|            return ERROR_INV_SLICE_HDR_T;
 1745|    246|        }
 1746|  6.66k|        COPYTHECONTEXT("Slice Header SVC ext: disable_deblocking_filter_idc", u4_temp);
 1747|  6.66k|        ps_slice->u1_disable_dblk_filter_idc = u4_temp;
 1748|  6.66k|        if(u4_temp != 1)
  ------------------
  |  Branch (1748:12): [True: 5.96k, False: 702]
  ------------------
 1749|  5.96k|        {
 1750|  5.96k|            i_temp = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf) << 1;
 1751|  5.96k|            if((MIN_DBLK_FIL_OFF > i_temp) || (i_temp > MAX_DBLK_FIL_OFF))
  ------------------
  |  |  550|  5.96k|#define MIN_DBLK_FIL_OFF              -12
  ------------------
                          if((MIN_DBLK_FIL_OFF > i_temp) || (i_temp > MAX_DBLK_FIL_OFF))
  ------------------
  |  |  551|  5.57k|#define MAX_DBLK_FIL_OFF              12
  ------------------
  |  Branch (1751:16): [True: 391, False: 5.57k]
  |  Branch (1751:47): [True: 168, False: 5.40k]
  ------------------
 1752|    559|            {
 1753|    559|                return ERROR_INV_SLICE_HDR_T;
 1754|    559|            }
 1755|  5.40k|            ps_slice->i1_slice_alpha_c0_offset = i_temp;
 1756|  5.40k|            COPYTHECONTEXT("Slice Header SVC ext: slice_alpha_c0_offset_div2",
 1757|  5.40k|                           ps_slice->i1_slice_alpha_c0_offset >> 1);
 1758|       |
 1759|  5.40k|            i_temp = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf) << 1;
 1760|  5.40k|            if((MIN_DBLK_FIL_OFF > i_temp) || (i_temp > MAX_DBLK_FIL_OFF))
  ------------------
  |  |  550|  5.40k|#define MIN_DBLK_FIL_OFF              -12
  ------------------
                          if((MIN_DBLK_FIL_OFF > i_temp) || (i_temp > MAX_DBLK_FIL_OFF))
  ------------------
  |  |  551|  5.19k|#define MAX_DBLK_FIL_OFF              12
  ------------------
  |  Branch (1760:16): [True: 210, False: 5.19k]
  |  Branch (1760:47): [True: 224, False: 4.97k]
  ------------------
 1761|    434|            {
 1762|    434|                return ERROR_INV_SLICE_HDR_T;
 1763|    434|            }
 1764|  4.97k|            ps_slice->i1_slice_beta_offset = i_temp;
 1765|  4.97k|            COPYTHECONTEXT("Slice Header SVC ext: slice_beta_offset_div2",
 1766|  4.97k|                           ps_slice->i1_slice_beta_offset >> 1);
 1767|  4.97k|        }
 1768|    702|        else
 1769|    702|        {
 1770|    702|            ps_slice->i1_slice_alpha_c0_offset = 0;
 1771|    702|            ps_slice->i1_slice_beta_offset = 0;
 1772|    702|        }
 1773|  6.66k|    }
 1774|  3.41k|    else
 1775|  3.41k|    {
 1776|  3.41k|        ps_slice->u1_disable_dblk_filter_idc = 0;
 1777|  3.41k|        ps_slice->i1_slice_alpha_c0_offset = 0;
 1778|  3.41k|        ps_slice->i1_slice_beta_offset = 0;
 1779|  3.41k|    }
 1780|       |
 1781|       |    /* add the remaining part of the code for svc extension from reference */
 1782|  9.08k|    ret = isvcd_set_default_slice_header_ext(ps_svc_lyr_dec);
 1783|  9.08k|    if(ret != OK)
  ------------------
  |  |  114|  9.08k|#define OK        0
  ------------------
  |  Branch (1783:8): [True: 0, False: 9.08k]
  ------------------
 1784|      0|    {
 1785|      0|        return ERROR_INV_SLICE_HDR_T;
 1786|      0|    }
 1787|       |
 1788|  9.08k|    ret = isvcd_parse_slice_header(ps_svc_lyr_dec);
 1789|  9.08k|    if(ret != OK)
  ------------------
  |  |  114|  9.08k|#define OK        0
  ------------------
  |  Branch (1789:8): [True: 664, False: 8.42k]
  ------------------
 1790|    664|    {
 1791|    664|        return ERROR_INV_SLICE_HDR_T;
 1792|    664|    }
 1793|       |
 1794|  8.42k|    ps_dec->u1_slice_header_done = 2;
 1795|  8.42k|    if(!ps_svc_slice_params->u1_slice_skip_flag)
  ------------------
  |  Branch (1795:8): [True: 7.79k, False: 632]
  ------------------
 1796|  7.79k|    {
 1797|  7.79k|        if(ps_pps->u1_entropy_coding_mode)
  ------------------
  |  Branch (1797:12): [True: 2.29k, False: 5.49k]
  ------------------
 1798|  2.29k|        {
 1799|  2.29k|            SWITCHOFFTRACE;
 1800|  2.29k|            SWITCHONTRACECABAC;
 1801|  2.29k|            ps_svc_lyr_dec->pf_parse_inter_slice_svc_ext =
 1802|  2.29k|                isvcd_parse_inter_slice_data_cabac_enh_lyr;
 1803|  2.29k|            ps_svc_lyr_dec->pf_parse_inter_mb_svc_ext = isvcd_parse_bmb_cabac;
 1804|  2.29k|            isvcd_init_cabac_contexts(B_SLICE, ps_dec);
  ------------------
  |  |  369|  2.29k|#define B_SLICE  1
  ------------------
 1805|       |
 1806|  2.29k|            if(ps_dec->ps_cur_slice->u1_mbaff_frame_flag)
  ------------------
  |  Branch (1806:16): [True: 0, False: 2.29k]
  ------------------
 1807|      0|                ps_dec->pf_get_mb_info = ih264d_get_mb_info_cabac_mbaff;
 1808|  2.29k|            else
 1809|  2.29k|                ps_dec->pf_get_mb_info = isvcd_get_mb_info_cabac_nonmbaff;
 1810|  2.29k|        }
 1811|  5.49k|        else
 1812|  5.49k|        {
 1813|  5.49k|            SWITCHONTRACE;
 1814|  5.49k|            SWITCHOFFTRACECABAC;
 1815|  5.49k|            ps_svc_lyr_dec->pf_parse_inter_slice_svc_ext =
 1816|  5.49k|                isvcd_parse_inter_slice_data_cavlc_enh_lyr;
 1817|  5.49k|            ps_svc_lyr_dec->pf_parse_inter_mb_svc_ext = isvcd_parse_bmb_cavlc;
 1818|  5.49k|            if(ps_dec->ps_cur_slice->u1_mbaff_frame_flag)
  ------------------
  |  Branch (1818:16): [True: 0, False: 5.49k]
  ------------------
 1819|      0|                ps_dec->pf_get_mb_info = ih264d_get_mb_info_cavlc_mbaff;
 1820|  5.49k|            else
 1821|  5.49k|                ps_dec->pf_get_mb_info = isvcd_get_mb_info_cavlc_nonmbaff;
 1822|  5.49k|        }
 1823|  7.79k|    }
 1824|    632|    else
 1825|    632|    {
 1826|    632|        return ERROR_FEATURE_UNAVAIL;
 1827|    632|    }
 1828|       |
 1829|  7.79k|    ret = ih264d_cal_col_pic(ps_dec);
 1830|  7.79k|    if(ret != OK) return ret;
  ------------------
  |  |  114|  7.79k|#define OK        0
  ------------------
  |  Branch (1830:8): [True: 0, False: 7.79k]
  ------------------
 1831|  7.79k|    ps_dec->u1_B = 1;
 1832|  7.79k|    ps_dec->pf_mvpred_ref_tfr_nby2mb = isvcd_mv_pred_ref_tfr_nby2_ebmb;
 1833|  7.79k|    ret = ps_svc_lyr_dec->pf_parse_inter_slice_svc_ext(ps_svc_lyr_dec, ps_slice,
 1834|  7.79k|                                                       u2_first_mb_in_slice);
 1835|  7.79k|    if(ret != OK) return ret;
  ------------------
  |  |  114|  7.79k|#define OK        0
  ------------------
  |  Branch (1835:8): [True: 4.23k, False: 3.55k]
  ------------------
 1836|       |
 1837|  3.55k|    return OK;
  ------------------
  |  |  114|  3.55k|#define OK        0
  ------------------
 1838|  7.79k|}
isvcd_parse_bslice:
 1853|  29.9k|{
 1854|  29.9k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
 1855|  29.9k|    dec_pic_params_t *ps_pps = ps_dec->ps_cur_pps;
 1856|  29.9k|    dec_slice_params_t *ps_slice = ps_dec->ps_cur_slice;
 1857|  29.9k|    dec_bit_stream_t *ps_bitstrm = ps_dec->ps_bitstrm;
 1858|  29.9k|    UWORD8 u1_ref_idx_re_flag_lx;
 1859|  29.9k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
 1860|  29.9k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
 1861|  29.9k|    UWORD64 u8_ref_idx_l0, u8_ref_idx_l1;
 1862|  29.9k|    UWORD32 u4_temp;
 1863|  29.9k|    WORD32 i_temp;
 1864|  29.9k|    WORD32 ret;
 1865|       |
 1866|       |    /*--------------------------------------------------------------------*/
 1867|       |    /* Read remaining contents of the slice header                        */
 1868|       |    /*--------------------------------------------------------------------*/
 1869|  29.9k|    {
 1870|  29.9k|        WORD8 *pi1_buf;
 1871|  29.9k|        WORD16 *pi2_mv = ps_dec->s_default_mv_pred.i2_mv;
 1872|  29.9k|        WORD32 *pi4_mv = (WORD32 *) pi2_mv;
 1873|  29.9k|        WORD16 *pi16_refFrame;
 1874|  29.9k|        pi1_buf = ps_dec->s_default_mv_pred.i1_ref_frame;
 1875|  29.9k|        pi16_refFrame = (WORD16 *) pi1_buf;
 1876|  29.9k|        *pi4_mv = 0;
 1877|  29.9k|        *(pi4_mv + 1) = 0;
 1878|  29.9k|        *pi16_refFrame = OUT_OF_RANGE_REF;
  ------------------
  |  |   45|  29.9k|#define OUT_OF_RANGE_REF  -1
  ------------------
 1879|  29.9k|        ps_dec->s_default_mv_pred.u1_col_ref_pic_idx = (UWORD8) -1;
 1880|  29.9k|        ps_dec->s_default_mv_pred.u1_pic_type = (UWORD8) -1;
 1881|  29.9k|    }
 1882|       |
 1883|  29.9k|    ps_slice->u1_num_ref_idx_active_override_flag = ih264d_get_bit_h264(ps_bitstrm);
 1884|  29.9k|    COPYTHECONTEXT("SH: num_ref_idx_override_flag", ps_slice->u1_num_ref_idx_active_override_flag);
 1885|       |
 1886|  29.9k|    u8_ref_idx_l0 = ps_dec->ps_cur_pps->u1_num_ref_idx_lx_active[0];
 1887|  29.9k|    u8_ref_idx_l1 = ps_dec->ps_cur_pps->u1_num_ref_idx_lx_active[1];
 1888|  29.9k|    if(ps_slice->u1_num_ref_idx_active_override_flag)
  ------------------
  |  Branch (1888:8): [True: 17.2k, False: 12.6k]
  ------------------
 1889|  17.2k|    {
 1890|  17.2k|        u8_ref_idx_l0 = (UWORD64) 1 + ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1891|  17.2k|        COPYTHECONTEXT("SH: num_ref_idx_l0_active_minus1", u8_ref_idx_l0 - 1);
 1892|       |
 1893|  17.2k|        u8_ref_idx_l1 = (UWORD64) 1 + ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1894|  17.2k|        COPYTHECONTEXT("SH: num_ref_idx_l1_active_minus1", u8_ref_idx_l1 - 1);
 1895|  17.2k|    }
 1896|       |
 1897|  29.9k|    {
 1898|  29.9k|        UWORD8 u1_max_ref_idx = H264_MAX_REF_PICS;
  ------------------
  |  |  534|  29.9k|#define H264_MAX_REF_PICS         16
  ------------------
 1899|  29.9k|        if(ps_slice->u1_field_pic_flag)
  ------------------
  |  Branch (1899:12): [True: 0, False: 29.9k]
  ------------------
 1900|      0|        {
 1901|      0|            u1_max_ref_idx = H264_MAX_REF_PICS << 1;
  ------------------
  |  |  534|      0|#define H264_MAX_REF_PICS         16
  ------------------
 1902|      0|        }
 1903|  29.9k|        if((u8_ref_idx_l0 >= u1_max_ref_idx) || (u8_ref_idx_l1 >= u1_max_ref_idx))
  ------------------
  |  Branch (1903:12): [True: 618, False: 29.2k]
  |  Branch (1903:49): [True: 584, False: 28.7k]
  ------------------
 1904|  1.20k|        {
 1905|  1.20k|            return ERROR_NUM_REF;
 1906|  1.20k|        }
 1907|  28.7k|        ps_slice->u1_num_ref_idx_lx_active[0] = (UWORD8) u8_ref_idx_l0;
 1908|  28.7k|        ps_slice->u1_num_ref_idx_lx_active[1] = (UWORD8) u8_ref_idx_l1;
 1909|  28.7k|    }
 1910|       |
 1911|      0|    ih264d_init_ref_idx_lx_b(ps_dec);
 1912|       |    /* Store the value for future slices in the same picture */
 1913|  28.7k|    ps_dec->u1_num_ref_idx_lx_active_prev = ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[0];
 1914|       |
 1915|  28.7k|    u1_ref_idx_re_flag_lx = ih264d_get_bit_h264(ps_bitstrm);
 1916|  28.7k|    COPYTHECONTEXT("SH: ref_pic_list_reordering_flag_l0", u1_ref_idx_re_flag_lx);
 1917|       |
 1918|       |    /* Modified temporarily */
 1919|  28.7k|    if(u1_ref_idx_re_flag_lx)
  ------------------
  |  Branch (1919:8): [True: 12.2k, False: 16.4k]
  ------------------
 1920|  12.2k|    {
 1921|  12.2k|        WORD8 ret;
 1922|  12.2k|        ps_dec->ps_ref_pic_buf_lx[0] = ps_dec->ps_dpb_mgr->ps_mod_dpb[0];
 1923|  12.2k|        ret = ih264d_ref_idx_reordering(ps_dec, 0);
 1924|  12.2k|        if(ret == -1) return ERROR_REFIDX_ORDER_T;
  ------------------
  |  Branch (1924:12): [True: 0, False: 12.2k]
  ------------------
 1925|  12.2k|    }
 1926|  16.4k|    else
 1927|  16.4k|        ps_dec->ps_ref_pic_buf_lx[0] = ps_dec->ps_dpb_mgr->ps_init_dpb[0];
 1928|       |
 1929|  28.7k|    u1_ref_idx_re_flag_lx = ih264d_get_bit_h264(ps_bitstrm);
 1930|  28.7k|    COPYTHECONTEXT("SH: ref_pic_list_reordering_flag_l1", u1_ref_idx_re_flag_lx);
 1931|       |
 1932|       |    /* Modified temporarily */
 1933|  28.7k|    if(u1_ref_idx_re_flag_lx)
  ------------------
  |  Branch (1933:8): [True: 11.1k, False: 17.5k]
  ------------------
 1934|  11.1k|    {
 1935|  11.1k|        WORD8 ret;
 1936|  11.1k|        ps_dec->ps_ref_pic_buf_lx[1] = ps_dec->ps_dpb_mgr->ps_mod_dpb[1];
 1937|  11.1k|        ret = ih264d_ref_idx_reordering(ps_dec, 1);
 1938|  11.1k|        if(ret == -1) return ERROR_REFIDX_ORDER_T;
  ------------------
  |  Branch (1938:12): [True: 0, False: 11.1k]
  ------------------
 1939|  11.1k|    }
 1940|  17.5k|    else
 1941|  17.5k|        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|  28.7k|    {
 1945|  28.7k|        void **ppv_map_ref_idx_to_poc_lx;
 1946|  28.7k|        WORD8 idx;
 1947|  28.7k|        struct pic_buffer_t *ps_pic;
 1948|       |
 1949|  28.7k|        ppv_map_ref_idx_to_poc_lx = ps_dec->ppv_map_ref_idx_to_poc + FRM_LIST_L0;
  ------------------
  |  |   89|  28.7k|#define FRM_LIST_L0             0                                               //0
  ------------------
 1950|  28.7k|        ppv_map_ref_idx_to_poc_lx[0] = 0;
 1951|  28.7k|        ppv_map_ref_idx_to_poc_lx++;
 1952|  94.7k|        for(idx = 0; idx < ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[0]; idx++)
  ------------------
  |  Branch (1952:22): [True: 66.0k, False: 28.7k]
  ------------------
 1953|  66.0k|        {
 1954|  66.0k|            ps_pic = ps_dec->ps_ref_pic_buf_lx[0][idx];
 1955|  66.0k|            ppv_map_ref_idx_to_poc_lx[idx] = (ps_pic->pu1_buf1);
 1956|  66.0k|        }
 1957|       |
 1958|  28.7k|        ppv_map_ref_idx_to_poc_lx = ps_dec->ppv_map_ref_idx_to_poc + FRM_LIST_L1;
  ------------------
  |  |   90|  28.7k|#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|  28.7k|#define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  600|  28.7k|#define MAX_FRAMES              16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1959|       |
 1960|  28.7k|        ppv_map_ref_idx_to_poc_lx[0] = 0;
 1961|  28.7k|        ppv_map_ref_idx_to_poc_lx++;
 1962|  84.3k|        for(idx = 0; idx < ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[1]; idx++)
  ------------------
  |  Branch (1962:22): [True: 55.6k, False: 28.7k]
  ------------------
 1963|  55.6k|        {
 1964|  55.6k|            ps_pic = ps_dec->ps_ref_pic_buf_lx[1][idx];
 1965|  55.6k|            ppv_map_ref_idx_to_poc_lx[idx] = (ps_pic->pu1_buf1);
 1966|  55.6k|        }
 1967|       |
 1968|  28.7k|        if(ps_dec->ps_cur_slice->u1_mbaff_frame_flag)
  ------------------
  |  Branch (1968:12): [True: 0, False: 28.7k]
  ------------------
 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|  28.7k|    }
 2011|       |
 2012|  28.7k|    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: 28.7k]
  |  Branch (2012:53): [True: 0, False: 0]
  ------------------
 2013|      0|    {
 2014|      0|        ih264d_convert_frm_mbaff_list(ps_dec);
 2015|      0|    }
 2016|       |
 2017|  28.7k|    if(ps_pps->u1_wted_bipred_idc == 1)
  ------------------
  |  Branch (2017:8): [True: 3.37k, False: 25.3k]
  ------------------
 2018|  3.37k|    {
 2019|  3.37k|        ret = ih264d_parse_pred_weight_table(ps_slice, ps_bitstrm);
 2020|  3.37k|        if(ret != OK) return ret;
  ------------------
  |  |  114|  3.37k|#define OK        0
  ------------------
  |  Branch (2020:12): [True: 1.95k, False: 1.42k]
  ------------------
 2021|  1.42k|        ih264d_form_pred_weight_matrix(ps_dec);
 2022|  1.42k|        ps_dec->pu4_wt_ofsts = ps_dec->pu4_wts_ofsts_mat;
 2023|  1.42k|    }
 2024|  25.3k|    else if(ps_pps->u1_wted_bipred_idc == 2)
  ------------------
  |  Branch (2024:13): [True: 13.4k, False: 11.9k]
  ------------------
 2025|  13.4k|    {
 2026|       |        /* Implicit Weighted prediction */
 2027|  13.4k|        ps_slice->u2_log2Y_crwd = 0x0505;
 2028|  13.4k|        ps_dec->pu4_wt_ofsts = ps_dec->pu4_wts_ofsts_mat;
 2029|  13.4k|        ih264d_get_implicit_weights(ps_dec);
 2030|  13.4k|    }
 2031|  11.9k|    else
 2032|  11.9k|        ps_dec->ps_cur_slice->u2_log2Y_crwd = 0;
 2033|       |
 2034|  26.7k|    ps_dec->ps_parse_cur_slice->u2_log2Y_crwd = ps_dec->ps_cur_slice->u2_log2Y_crwd;
 2035|       |
 2036|       |    /* G050 */
 2037|  26.7k|    if(ps_slice->u1_nal_ref_idc != 0)
  ------------------
  |  Branch (2037:8): [True: 18.3k, False: 8.36k]
  ------------------
 2038|  18.3k|    {
 2039|  18.3k|        if(!ps_dec->ps_dpb_cmds->u1_dpb_commands_read)
  ------------------
  |  Branch (2039:12): [True: 18.1k, False: 200]
  ------------------
 2040|  18.1k|        {
 2041|  18.1k|            dec_pic_params_t *ps_pps = ps_dec->ps_cur_pps;
 2042|  18.1k|            dec_seq_params_t *ps_sps_tmp = ps_pps->ps_sps;
 2043|  18.1k|            UWORD8 u1_nal_unit_type_tmp = ps_dec->u1_nal_unit_type;
 2044|       |
 2045|  18.1k|            ps_pps->ps_sps = ps_dec->ps_cur_sps;
 2046|  18.1k|            if(ps_svc_lyr_dec->ps_nal_svc_ext->u1_idr_flag)
  ------------------
  |  Branch (2046:16): [True: 12.0k, False: 6.10k]
  ------------------
 2047|  12.0k|                ps_dec->u1_nal_unit_type = IDR_SLICE_NAL;
  ------------------
  |  |  328|  12.0k|#define IDR_SLICE_NAL                   5
  ------------------
 2048|       |
 2049|  18.1k|            i_temp = ih264d_read_mmco_commands(ps_dec);
 2050|       |
 2051|  18.1k|            ps_pps->ps_sps = ps_sps_tmp;
 2052|  18.1k|            ps_dec->u1_nal_unit_type = u1_nal_unit_type_tmp;
 2053|       |
 2054|  18.1k|            if(i_temp < 0)
  ------------------
  |  Branch (2054:16): [True: 174, False: 18.0k]
  ------------------
 2055|    174|            {
 2056|    174|                return ERROR_DBP_MANAGER_T;
 2057|    174|            }
 2058|  18.0k|            ps_dec->u4_bitoffset = i_temp;
 2059|  18.0k|        }
 2060|    200|        else
 2061|    200|            ps_bitstrm->u4_ofst += ps_dec->u4_bitoffset;
 2062|  18.3k|    }
 2063|       |    /* G050 */
 2064|       |
 2065|  26.5k|    if(ps_pps->u1_entropy_coding_mode == CABAC)
  ------------------
  |  |  339|  26.5k|#define CABAC  1
  ------------------
  |  Branch (2065:8): [True: 10.4k, False: 16.1k]
  ------------------
 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.02k, False: 9.38k]
  ------------------
 2069|  1.02k|        {
 2070|  1.02k|            return ERROR_INV_SLICE_HDR_T;
 2071|  1.02k|        }
 2072|  9.38k|        ps_slice->u1_cabac_init_idc = u4_temp;
 2073|  9.38k|        COPYTHECONTEXT("SH: cabac_init_idc", ps_slice->u1_cabac_init_idc);
 2074|  9.38k|    }
 2075|  25.5k|    {
 2076|       |        /* Read slice_qp_delta */
 2077|  25.5k|        WORD64 i8_temp =
 2078|  25.5k|            (WORD64) ps_pps->u1_pic_init_qp + ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 2079|  25.5k|        if((i8_temp < MIN_H264_QP) || (i8_temp > MAX_H264_QP))
  ------------------
  |  |  629|  25.5k|#define MIN_H264_QP 0
  ------------------
                      if((i8_temp < MIN_H264_QP) || (i8_temp > MAX_H264_QP))
  ------------------
  |  |  634|  24.8k|#define MAX_H264_QP 51
  ------------------
  |  Branch (2079:12): [True: 749, False: 24.8k]
  |  Branch (2079:39): [True: 1.96k, False: 22.8k]
  ------------------
 2080|  2.71k|        {
 2081|  2.71k|            return ERROR_INV_RANGE_QP_T;
 2082|  2.71k|        }
 2083|  22.8k|        ps_slice->u1_slice_qp = (UWORD8) i8_temp;
 2084|  22.8k|        COPYTHECONTEXT("SH: slice_qp_delta",
 2085|  22.8k|                       (WORD8) (ps_slice->u1_slice_qp - ps_pps->u1_pic_init_qp));
 2086|  22.8k|    }
 2087|  22.8k|    if(ps_pps->u1_deblocking_filter_parameters_present_flag == 1)
  ------------------
  |  Branch (2087:8): [True: 12.3k, False: 10.5k]
  ------------------
 2088|  12.3k|    {
 2089|  12.3k|        u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 2090|  12.3k|        if(u4_temp > SLICE_BOUNDARY_DBLK_DISABLED)
  ------------------
  |  |  547|  12.3k|#define SLICE_BOUNDARY_DBLK_DISABLED  2
  ------------------
  |  Branch (2090:12): [True: 769, False: 11.5k]
  ------------------
 2091|    769|        {
 2092|    769|            return ERROR_INV_SLICE_HDR_T;
 2093|    769|        }
 2094|  11.5k|        COPYTHECONTEXT("SH: disable_deblocking_filter_idc", u4_temp);
 2095|  11.5k|        ps_slice->u1_disable_dblk_filter_idc = u4_temp;
 2096|  11.5k|        if(u4_temp != 1)
  ------------------
  |  Branch (2096:12): [True: 9.63k, False: 1.91k]
  ------------------
 2097|  9.63k|        {
 2098|  9.63k|            i_temp = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf) << 1;
 2099|  9.63k|            if((MIN_DBLK_FIL_OFF > i_temp) || (i_temp > MAX_DBLK_FIL_OFF))
  ------------------
  |  |  550|  9.63k|#define MIN_DBLK_FIL_OFF              -12
  ------------------
                          if((MIN_DBLK_FIL_OFF > i_temp) || (i_temp > MAX_DBLK_FIL_OFF))
  ------------------
  |  |  551|  9.40k|#define MAX_DBLK_FIL_OFF              12
  ------------------
  |  Branch (2099:16): [True: 230, False: 9.40k]
  |  Branch (2099:47): [True: 163, False: 9.23k]
  ------------------
 2100|    393|            {
 2101|    393|                return ERROR_INV_SLICE_HDR_T;
 2102|    393|            }
 2103|  9.23k|            ps_slice->i1_slice_alpha_c0_offset = i_temp;
 2104|  9.23k|            COPYTHECONTEXT("SH: slice_alpha_c0_offset_div2",
 2105|  9.23k|                           ps_slice->i1_slice_alpha_c0_offset >> 1);
 2106|       |
 2107|  9.23k|            i_temp = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf) << 1;
 2108|  9.23k|            if((MIN_DBLK_FIL_OFF > i_temp) || (i_temp > MAX_DBLK_FIL_OFF))
  ------------------
  |  |  550|  9.23k|#define MIN_DBLK_FIL_OFF              -12
  ------------------
                          if((MIN_DBLK_FIL_OFF > i_temp) || (i_temp > MAX_DBLK_FIL_OFF))
  ------------------
  |  |  551|  9.07k|#define MAX_DBLK_FIL_OFF              12
  ------------------
  |  Branch (2108:16): [True: 160, False: 9.07k]
  |  Branch (2108:47): [True: 181, False: 8.89k]
  ------------------
 2109|    341|            {
 2110|    341|                return ERROR_INV_SLICE_HDR_T;
 2111|    341|            }
 2112|  8.89k|            ps_slice->i1_slice_beta_offset = i_temp;
 2113|  8.89k|            COPYTHECONTEXT("SH: slice_beta_offset_div2", ps_slice->i1_slice_beta_offset >> 1);
 2114|  8.89k|        }
 2115|  1.91k|        else
 2116|  1.91k|        {
 2117|  1.91k|            ps_slice->i1_slice_alpha_c0_offset = 0;
 2118|  1.91k|            ps_slice->i1_slice_beta_offset = 0;
 2119|  1.91k|        }
 2120|  11.5k|    }
 2121|  10.5k|    else
 2122|  10.5k|    {
 2123|  10.5k|        ps_slice->u1_disable_dblk_filter_idc = 0;
 2124|  10.5k|        ps_slice->i1_slice_alpha_c0_offset = 0;
 2125|  10.5k|        ps_slice->i1_slice_beta_offset = 0;
 2126|  10.5k|    }
 2127|       |
 2128|  21.3k|    ps_dec->u1_slice_header_done = 2;
 2129|       |
 2130|  21.3k|    if(ps_pps->u1_entropy_coding_mode)
  ------------------
  |  Branch (2130:8): [True: 9.21k, False: 12.1k]
  ------------------
 2131|  9.21k|    {
 2132|  9.21k|        SWITCHOFFTRACE;
 2133|  9.21k|        SWITCHONTRACECABAC;
 2134|  9.21k|        ps_svc_lyr_dec->pf_parse_svc_inter_slice = isvcd_parse_inter_slice_data_cabac;
 2135|  9.21k|        ps_dec->pf_parse_inter_mb = ih264d_parse_bmb_cabac;
 2136|  9.21k|        ih264d_init_cabac_contexts(B_SLICE, ps_dec);
  ------------------
  |  |  369|  9.21k|#define B_SLICE  1
  ------------------
 2137|       |
 2138|  9.21k|        if(ps_dec->ps_cur_slice->u1_mbaff_frame_flag)
  ------------------
  |  Branch (2138:12): [True: 0, False: 9.21k]
  ------------------
 2139|      0|            ps_dec->pf_get_mb_info = ih264d_get_mb_info_cabac_mbaff;
 2140|  9.21k|        else
 2141|  9.21k|            ps_dec->pf_get_mb_info = isvcd_get_mb_info_cabac_nonmbaff;
 2142|  9.21k|    }
 2143|  12.1k|    else
 2144|  12.1k|    {
 2145|  12.1k|        SWITCHONTRACE;
 2146|  12.1k|        SWITCHOFFTRACECABAC;
 2147|  12.1k|        ps_svc_lyr_dec->pf_parse_svc_inter_slice = isvcd_parse_inter_slice_data_cavlc;
 2148|  12.1k|        ps_dec->pf_parse_inter_mb = ih264d_parse_bmb_cavlc;
 2149|  12.1k|        if(ps_dec->ps_cur_slice->u1_mbaff_frame_flag)
  ------------------
  |  Branch (2149:12): [True: 0, False: 12.1k]
  ------------------
 2150|      0|            ps_dec->pf_get_mb_info = ih264d_get_mb_info_cavlc_mbaff;
 2151|  12.1k|        else
 2152|  12.1k|            ps_dec->pf_get_mb_info = isvcd_get_mb_info_cavlc_nonmbaff;
 2153|  12.1k|    }
 2154|       |
 2155|  21.3k|    ret = ih264d_cal_col_pic(ps_dec);
 2156|  21.3k|    if(ret != OK) return ret;
  ------------------
  |  |  114|  21.3k|#define OK        0
  ------------------
  |  Branch (2156:8): [True: 0, False: 21.3k]
  ------------------
 2157|  21.3k|    ps_dec->u1_B = 1;
 2158|  21.3k|    ps_dec->pf_mvpred_ref_tfr_nby2mb = ih264d_mv_pred_ref_tfr_nby2_bmb;
 2159|  21.3k|    ret = ps_svc_lyr_dec->pf_parse_svc_inter_slice(ps_svc_lyr_dec, ps_slice, u2_first_mb_in_slice);
 2160|  21.3k|    if(ret != OK) return ret;
  ------------------
  |  |  114|  21.3k|#define OK        0
  ------------------
  |  Branch (2160:8): [True: 7.11k, False: 14.2k]
  ------------------
 2161|       |
 2162|  14.2k|    return OK;
  ------------------
  |  |  114|  14.2k|#define OK        0
  ------------------
 2163|  21.3k|}

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

isvcd_parse_epslice:
   99|  14.8k|{
  100|  14.8k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
  101|  14.8k|    WORD32 i_status = OK;
  ------------------
  |  |  114|  14.8k|#define OK        0
  ------------------
  102|  14.8k|    dec_pic_params_t *ps_pps = ps_dec->ps_cur_pps;
  103|  14.8k|    dec_slice_params_t *ps_cur_slice = ps_dec->ps_cur_slice;
  104|  14.8k|    dec_bit_stream_t *ps_bitstrm = ps_dec->ps_bitstrm;
  105|  14.8k|    dec_seq_params_t *ps_seq;
  106|  14.8k|    dec_svc_seq_params_t *ps_subset_seq;
  107|  14.8k|    dec_slice_svc_ext_params_t *ps_svc_slice_params = NULL;
  108|  14.8k|    dec_subset_seq_params_t *ps_sps_svc_ext = NULL;
  109|  14.8k|    dec_nal_unit_svc_ext_params_t *ps_nal_svc_ext = NULL;
  110|       |
  111|  14.8k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
  112|  14.8k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
  113|  14.8k|    UWORD8 u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
  114|  14.8k|    UWORD8 u1_field_pic_flag = ps_cur_slice->u1_field_pic_flag;
  115|       |
  116|  14.8k|    UWORD64 u8_ref_idx_l0;
  117|  14.8k|    UWORD32 u4_temp;
  118|  14.8k|    WORD32 i_temp;
  119|  14.8k|    WORD32 ret;
  120|  14.8k|    WORD64 i8_temp;
  121|       |
  122|  14.8k|    ps_nal_svc_ext = ps_svc_lyr_dec->ps_nal_svc_ext;
  123|  14.8k|    ps_seq = ps_pps->ps_sps;
  124|  14.8k|    ps_seq += MAX_NUM_SEQ_PARAMS;
  ------------------
  |  |  521|  14.8k|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
  125|  14.8k|    ps_subset_seq =
  126|  14.8k|        &ps_svc_lyr_dec->ps_subset_sps[MAX_NUM_SEQ_PARAMS + ps_seq->u1_seq_parameter_set_id];
  ------------------
  |  |  521|  14.8k|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
  127|  14.8k|    ps_sps_svc_ext = &ps_subset_seq->s_sps_svc_ext;
  128|  14.8k|    ps_svc_slice_params = &ps_svc_lyr_dec->s_svc_slice_params;
  129|       |
  130|       |    /*--------------------------------------------------------------------*/
  131|       |    /* Read remaining contents of the slice header                        */
  132|       |    /*--------------------------------------------------------------------*/
  133|  14.8k|    {
  134|  14.8k|        WORD8 *pi1_buf;
  135|  14.8k|        WORD16 *pi2_mv = ps_dec->s_default_mv_pred.i2_mv;
  136|  14.8k|        WORD32 *pi4_mv = (WORD32 *) pi2_mv;
  137|  14.8k|        WORD16 *pi16_refFrame;
  138|       |
  139|  14.8k|        pi1_buf = ps_dec->s_default_mv_pred.i1_ref_frame;
  140|  14.8k|        pi16_refFrame = (WORD16 *) pi1_buf;
  141|  14.8k|        *pi4_mv = 0;
  142|  14.8k|        *(pi4_mv + 1) = 0;
  143|  14.8k|        *pi16_refFrame = OUT_OF_RANGE_REF;
  ------------------
  |  |   45|  14.8k|#define OUT_OF_RANGE_REF  -1
  ------------------
  144|  14.8k|        ps_dec->s_default_mv_pred.u1_col_ref_pic_idx = (UWORD8) -1;
  145|  14.8k|        ps_dec->s_default_mv_pred.u1_pic_type = (UWORD8) -1;
  146|  14.8k|    }
  147|       |
  148|  14.8k|    if(0 == ps_svc_lyr_dec->ps_nal_svc_ext->u1_quality_id)
  ------------------
  |  Branch (148:8): [True: 14.8k, False: 0]
  ------------------
  149|  14.8k|    {
  150|  14.8k|        ps_cur_slice->u1_num_ref_idx_active_override_flag = ih264d_get_bit_h264(ps_bitstrm);
  151|       |
  152|  14.8k|        COPYTHECONTEXT("Slice Header SVC ext: num_ref_idx_override_flag",
  153|  14.8k|                       ps_cur_slice->u1_num_ref_idx_active_override_flag);
  154|       |
  155|  14.8k|        u8_ref_idx_l0 = ps_dec->ps_cur_pps->u1_num_ref_idx_lx_active[0];
  156|  14.8k|        if(ps_cur_slice->u1_num_ref_idx_active_override_flag)
  ------------------
  |  Branch (156:12): [True: 9.35k, False: 5.52k]
  ------------------
  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|  14.8k|        {
  162|  14.8k|            UWORD8 u1_max_ref_idx = H264_MAX_REF_PICS << u1_field_pic_flag;
  ------------------
  |  |  534|  14.8k|#define H264_MAX_REF_PICS         16
  ------------------
  163|  14.8k|            if(u8_ref_idx_l0 > u1_max_ref_idx)
  ------------------
  |  Branch (163:16): [True: 139, False: 14.7k]
  ------------------
  164|    139|            {
  165|    139|                return ERROR_NUM_REF;
  166|    139|            }
  167|  14.7k|            ps_cur_slice->u1_num_ref_idx_lx_active[0] = (UWORD8) u8_ref_idx_l0;
  168|  14.7k|            COPYTHECONTEXT("Slice Header SVC ext: num_ref_idx_l0_active_minus1",
  169|  14.7k|                           ps_cur_slice->u1_num_ref_idx_lx_active[0] - 1);
  170|  14.7k|        }
  171|       |
  172|      0|        {
  173|  14.7k|            UWORD8 uc_refIdxReFlagL0 = ih264d_get_bit_h264(ps_bitstrm);
  174|  14.7k|            COPYTHECONTEXT("Slice Header SVC ext: ref_pic_list_reordering_flag_l0",
  175|  14.7k|                           uc_refIdxReFlagL0);
  176|       |
  177|  14.7k|            ih264d_init_ref_idx_lx_p(ps_dec);
  178|       |            /* Store the value for future slices in the same picture */
  179|  14.7k|            ps_dec->u1_num_ref_idx_lx_active_prev = ps_cur_slice->u1_num_ref_idx_lx_active[0];
  180|       |
  181|       |            /* Modified temporarily */
  182|  14.7k|            if(uc_refIdxReFlagL0)
  ------------------
  |  Branch (182:16): [True: 8.27k, False: 6.46k]
  ------------------
  183|  8.27k|            {
  184|  8.27k|                WORD8 ret;
  185|  8.27k|                ps_dec->ps_ref_pic_buf_lx[0] = ps_dec->ps_dpb_mgr->ps_mod_dpb[0];
  186|  8.27k|                ret = ih264d_ref_idx_reordering(ps_dec, 0);
  187|  8.27k|                if(ret == -1) return ERROR_REFIDX_ORDER_T;
  ------------------
  |  Branch (187:20): [True: 0, False: 8.27k]
  ------------------
  188|  8.27k|                ps_dec->ps_ref_pic_buf_lx[0] = ps_dec->ps_dpb_mgr->ps_mod_dpb[0];
  189|  8.27k|            }
  190|  6.46k|            else
  191|  6.46k|                ps_dec->ps_ref_pic_buf_lx[0] = ps_dec->ps_dpb_mgr->ps_init_dpb[0];
  192|  14.7k|        }
  193|       |        /* Create refIdx to POC mapping */
  194|  14.7k|        {
  195|  14.7k|            void **pui_map_ref_idx_to_poc_lx0, **pui_map_ref_idx_to_poc_lx1;
  196|  14.7k|            WORD8 idx;
  197|  14.7k|            struct pic_buffer_t *ps_pic;
  198|       |
  199|  14.7k|            pui_map_ref_idx_to_poc_lx0 = ps_dec->ppv_map_ref_idx_to_poc + FRM_LIST_L0;
  ------------------
  |  |   89|  14.7k|#define FRM_LIST_L0             0                                               //0
  ------------------
  200|  14.7k|            pui_map_ref_idx_to_poc_lx0[0] = 0;
  201|  14.7k|            pui_map_ref_idx_to_poc_lx0++;
  202|  48.1k|            for(idx = 0; idx < ps_cur_slice->u1_num_ref_idx_lx_active[0]; idx++)
  ------------------
  |  Branch (202:26): [True: 33.3k, False: 14.7k]
  ------------------
  203|  33.3k|            {
  204|  33.3k|                ps_pic = ps_dec->ps_ref_pic_buf_lx[0][idx];
  205|  33.3k|                pui_map_ref_idx_to_poc_lx0[idx] = (ps_pic->pu1_buf1);
  206|  33.3k|            }
  207|       |
  208|       |            /* Bug Fix Deblocking */
  209|  14.7k|            pui_map_ref_idx_to_poc_lx1 = ps_dec->ppv_map_ref_idx_to_poc + FRM_LIST_L1;
  ------------------
  |  |   90|  14.7k|#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|  14.7k|#define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  600|  14.7k|#define MAX_FRAMES              16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  210|  14.7k|            pui_map_ref_idx_to_poc_lx1[0] = 0;
  211|       |
  212|  14.7k|            if(u1_mbaff)
  ------------------
  |  Branch (212:16): [True: 0, False: 14.7k]
  ------------------
  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|  14.7k|            if(ps_dec->u4_num_cores >= 2)
  ------------------
  |  Branch (243:16): [True: 9.38k, False: 5.35k]
  ------------------
  244|  9.38k|            {
  245|  9.38k|                WORD32 num_entries;
  246|  9.38k|                WORD32 size;
  247|       |
  248|  9.38k|                num_entries = MAX_FRAMES;
  ------------------
  |  |  600|  9.38k|#define MAX_FRAMES              16
  ------------------
  249|  9.38k|                if((1 >= ps_dec->ps_cur_sps->u1_num_ref_frames) && (0 == ps_dec->i4_display_delay))
  ------------------
  |  Branch (249:20): [True: 7.14k, False: 2.24k]
  |  Branch (249:68): [True: 0, False: 7.14k]
  ------------------
  250|      0|                {
  251|      0|                    num_entries = 1;
  252|      0|                }
  253|  9.38k|                num_entries = ((2 * num_entries) + 1);
  254|  9.38k|                num_entries *= 2;
  255|       |
  256|  9.38k|                size = num_entries * sizeof(void *);
  257|  9.38k|                size += PAD_MAP_IDX_POC * sizeof(void *);
  ------------------
  |  |  100|  9.38k|#define PAD_MAP_IDX_POC             (1)
  ------------------
  258|       |
  259|  9.38k|                memcpy((void *) ps_dec->ps_parse_cur_slice->ppv_map_ref_idx_to_poc,
  260|  9.38k|                       ps_dec->ppv_map_ref_idx_to_poc, size);
  261|  9.38k|            }
  262|  14.7k|        }
  263|  14.7k|        if(ps_pps->u1_wted_pred_flag)
  ------------------
  |  Branch (263:12): [True: 2.45k, False: 12.2k]
  ------------------
  264|  2.45k|        {
  265|  2.45k|            if(!ps_nal_svc_ext->u1_no_inter_layer_pred_flag)
  ------------------
  |  Branch (265:16): [True: 2.45k, False: 0]
  ------------------
  266|  2.45k|            {
  267|  2.45k|                ps_svc_slice_params->u1_base_pred_weight_table_flag =
  268|  2.45k|                    ih264d_get_bit_h264(ps_bitstrm);
  269|  2.45k|                COPYTHECONTEXT("Slice Header SVC ext: u1_base_pred_weight_table_flag",
  270|  2.45k|                               ps_svc_slice_params->u1_base_pred_weight_table_flag);
  271|  2.45k|            }
  272|       |
  273|  2.45k|            if(ps_nal_svc_ext->u1_no_inter_layer_pred_flag ||
  ------------------
  |  Branch (273:16): [True: 0, False: 2.45k]
  ------------------
  274|  2.45k|               !ps_svc_slice_params->u1_base_pred_weight_table_flag)
  ------------------
  |  Branch (274:16): [True: 1.44k, False: 1.01k]
  ------------------
  275|  1.44k|            {
  276|  1.44k|                ret = ih264d_parse_pred_weight_table(ps_cur_slice, ps_bitstrm);
  277|  1.44k|                if(ret != OK) return ret;
  ------------------
  |  |  114|  1.44k|#define OK        0
  ------------------
  |  Branch (277:20): [True: 111, False: 1.33k]
  ------------------
  278|       |
  279|  1.33k|                ih264d_form_pred_weight_matrix(ps_dec);
  280|  1.33k|                ps_dec->pu4_wt_ofsts = ps_dec->pu4_wts_ofsts_mat;
  281|  1.33k|            }
  282|  2.45k|        }
  283|  12.2k|        else
  284|  12.2k|        {
  285|  12.2k|            ps_dec->ps_cur_slice->u2_log2Y_crwd = 0;
  286|  12.2k|            ps_dec->pu4_wt_ofsts = ps_dec->pu4_wts_ofsts_mat;
  287|  12.2k|        }
  288|       |
  289|  14.6k|        ps_dec->ps_parse_cur_slice->u2_log2Y_crwd = ps_dec->ps_cur_slice->u2_log2Y_crwd;
  290|       |
  291|  14.6k|        if(u1_mbaff && (u1_field_pic_flag == 0))
  ------------------
  |  Branch (291:12): [True: 0, False: 14.6k]
  |  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.6k|        if(ps_cur_slice->u1_nal_ref_idc != 0)
  ------------------
  |  Branch (297:12): [True: 14.4k, False: 180]
  ------------------
  298|  14.4k|        {
  299|  14.4k|            if(!ps_dec->ps_dpb_cmds->u1_dpb_commands_read)
  ------------------
  |  Branch (299:16): [True: 14.1k, False: 313]
  ------------------
  300|  14.1k|            {
  301|  14.1k|                dec_pic_params_t *ps_pps = ps_dec->ps_cur_pps;
  302|  14.1k|                dec_seq_params_t *ps_sps_tmp = ps_pps->ps_sps;
  303|  14.1k|                UWORD8 u1_nal_unit_type_tmp = ps_dec->u1_nal_unit_type;
  304|       |
  305|  14.1k|                ps_pps->ps_sps = ps_dec->ps_cur_sps;
  306|       |
  307|  14.1k|                if(ps_svc_lyr_dec->ps_nal_svc_ext->u1_idr_flag)
  ------------------
  |  Branch (307:20): [True: 13.3k, False: 774]
  ------------------
  308|  13.3k|                    ps_dec->u1_nal_unit_type = IDR_SLICE_NAL;
  ------------------
  |  |  328|  13.3k|#define IDR_SLICE_NAL                   5
  ------------------
  309|       |
  310|  14.1k|                i_temp = ih264d_read_mmco_commands(ps_dec);
  311|       |
  312|  14.1k|                ps_pps->ps_sps = ps_sps_tmp;
  313|  14.1k|                ps_dec->u1_nal_unit_type = u1_nal_unit_type_tmp;
  314|       |
  315|  14.1k|                if(i_temp < 0)
  ------------------
  |  Branch (315:20): [True: 127, False: 14.0k]
  ------------------
  316|    127|                {
  317|    127|                    return ERROR_DBP_MANAGER_T;
  318|    127|                }
  319|  14.0k|                ps_dec->u4_bitoffset = i_temp;
  320|  14.0k|            }
  321|    313|            else
  322|    313|                ps_bitstrm->u4_ofst += ps_dec->u4_bitoffset;
  323|       |
  324|  14.3k|            if(!ps_sps_svc_ext->u1_slice_header_restriction_flag)
  ------------------
  |  Branch (324:16): [True: 11.5k, False: 2.76k]
  ------------------
  325|  11.5k|            {
  326|  11.5k|                ps_svc_slice_params->u1_store_ref_base_pic_flag = ih264d_get_bit_h264(ps_bitstrm);
  327|  11.5k|                COPYTHECONTEXT("SPS_SVC_EXT: u1_store_ref_base_pic_flag",
  328|  11.5k|                               ps_svc_slice_params->u1_store_ref_base_pic_flag);
  329|       |
  330|  11.5k|                if(0 != ps_svc_slice_params->u1_store_ref_base_pic_flag)
  ------------------
  |  Branch (330:20): [True: 553, False: 11.0k]
  ------------------
  331|    553|                {
  332|    553|                    return NOT_OK;
  ------------------
  |  |  116|    553|#define NOT_OK    -1
  ------------------
  333|    553|                }
  334|  11.0k|                if(((1 == ps_nal_svc_ext->u1_use_ref_base_pic_flag) ||
  ------------------
  |  Branch (334:21): [True: 0, False: 11.0k]
  ------------------
  335|  11.0k|                    (1 == ps_svc_slice_params->u1_store_ref_base_pic_flag)) &&
  ------------------
  |  Branch (335:21): [True: 0, False: 11.0k]
  ------------------
  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|  11.0k|            }
  346|  14.3k|        }
  347|  14.6k|    }
  348|       |    /* G050 */
  349|       |
  350|  13.9k|    if(ps_pps->u1_entropy_coding_mode == CABAC)
  ------------------
  |  |  339|  13.9k|#define CABAC  1
  ------------------
  |  Branch (350:8): [True: 2.66k, False: 11.2k]
  ------------------
  351|  2.66k|    {
  352|  2.66k|        u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  353|       |
  354|  2.66k|        if(u4_temp > MAX_CABAC_INIT_IDC)
  ------------------
  |  |  537|  2.66k|#define MAX_CABAC_INIT_IDC        2
  ------------------
  |  Branch (354:12): [True: 144, False: 2.52k]
  ------------------
  355|    144|        {
  356|    144|            return ERROR_INV_SLICE_HDR_T;
  357|    144|        }
  358|  2.52k|        ps_cur_slice->u1_cabac_init_idc = u4_temp;
  359|  2.52k|        COPYTHECONTEXT("Slice Header SVC ext: cabac_init_idc", ps_cur_slice->u1_cabac_init_idc);
  360|  2.52k|    }
  361|       |
  362|       |    /* Read slice_qp_delta */
  363|  13.8k|    i8_temp = (WORD64) ps_pps->u1_pic_init_qp + ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  364|  13.8k|    if((i8_temp < MIN_H264_QP) || (i8_temp > MAX_H264_QP))
  ------------------
  |  |  629|  13.8k|#define MIN_H264_QP 0
  ------------------
                  if((i8_temp < MIN_H264_QP) || (i8_temp > MAX_H264_QP))
  ------------------
  |  |  634|  13.6k|#define MAX_H264_QP 51
  ------------------
  |  Branch (364:8): [True: 138, False: 13.6k]
  |  Branch (364:35): [True: 285, False: 13.3k]
  ------------------
  365|    423|    {
  366|    423|        return ERROR_INV_RANGE_QP_T;
  367|    423|    }
  368|  13.3k|    ps_cur_slice->u1_slice_qp = (UWORD8) i8_temp;
  369|  13.3k|    COPYTHECONTEXT("Slice Header SVC ext: slice_qp_delta",
  370|  13.3k|                   (WORD8) (ps_cur_slice->u1_slice_qp - ps_pps->u1_pic_init_qp));
  371|       |
  372|  13.3k|    if(ps_pps->u1_deblocking_filter_parameters_present_flag == 1)
  ------------------
  |  Branch (372:8): [True: 5.78k, False: 7.59k]
  ------------------
  373|  5.78k|    {
  374|  5.78k|        u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  375|  5.78k|        if(u4_temp > SLICE_BOUNDARY_DBLK_DISABLED)
  ------------------
  |  |  547|  5.78k|#define SLICE_BOUNDARY_DBLK_DISABLED  2
  ------------------
  |  Branch (375:12): [True: 187, False: 5.59k]
  ------------------
  376|    187|        {
  377|    187|            return ERROR_INV_SLICE_HDR_T;
  378|    187|        }
  379|       |
  380|  5.59k|        COPYTHECONTEXT("Slice Header SVC ext: disable_deblocking_filter_idc", u4_temp);
  381|  5.59k|        ps_cur_slice->u1_disable_dblk_filter_idc = u4_temp;
  382|  5.59k|        if(u4_temp != 1)
  ------------------
  |  Branch (382:12): [True: 4.28k, False: 1.31k]
  ------------------
  383|  4.28k|        {
  384|  4.28k|            i_temp = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf) << 1;
  385|  4.28k|            if((MIN_DBLK_FIL_OFF > i_temp) || (i_temp > MAX_DBLK_FIL_OFF))
  ------------------
  |  |  550|  4.28k|#define MIN_DBLK_FIL_OFF              -12
  ------------------
                          if((MIN_DBLK_FIL_OFF > i_temp) || (i_temp > MAX_DBLK_FIL_OFF))
  ------------------
  |  |  551|  4.22k|#define MAX_DBLK_FIL_OFF              12
  ------------------
  |  Branch (385:16): [True: 63, False: 4.22k]
  |  Branch (385:47): [True: 81, False: 4.14k]
  ------------------
  386|    144|            {
  387|    144|                return ERROR_INV_SLICE_HDR_T;
  388|    144|            }
  389|  4.14k|            ps_cur_slice->i1_slice_alpha_c0_offset = i_temp;
  390|  4.14k|            COPYTHECONTEXT("Slice Header SVC ext: slice_alpha_c0_offset_div2",
  391|  4.14k|                           ps_cur_slice->i1_slice_alpha_c0_offset >> 1);
  392|       |
  393|  4.14k|            i_temp = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf) << 1;
  394|  4.14k|            if((MIN_DBLK_FIL_OFF > i_temp) || (i_temp > MAX_DBLK_FIL_OFF))
  ------------------
  |  |  550|  4.14k|#define MIN_DBLK_FIL_OFF              -12
  ------------------
                          if((MIN_DBLK_FIL_OFF > i_temp) || (i_temp > MAX_DBLK_FIL_OFF))
  ------------------
  |  |  551|  4.05k|#define MAX_DBLK_FIL_OFF              12
  ------------------
  |  Branch (394:16): [True: 91, False: 4.05k]
  |  Branch (394:47): [True: 77, False: 3.97k]
  ------------------
  395|    168|            {
  396|    168|                return ERROR_INV_SLICE_HDR_T;
  397|    168|            }
  398|  3.97k|            ps_cur_slice->i1_slice_beta_offset = i_temp;
  399|  3.97k|            COPYTHECONTEXT("Slice Header SVC ext: slice_beta_offset_div2",
  400|  3.97k|                           ps_cur_slice->i1_slice_beta_offset >> 1);
  401|  3.97k|        }
  402|  1.31k|        else
  403|  1.31k|        {
  404|  1.31k|            ps_cur_slice->i1_slice_alpha_c0_offset = 0;
  405|  1.31k|            ps_cur_slice->i1_slice_beta_offset = 0;
  406|  1.31k|        }
  407|  5.59k|    }
  408|  7.59k|    else
  409|  7.59k|    {
  410|  7.59k|        ps_cur_slice->u1_disable_dblk_filter_idc = 0;
  411|  7.59k|        ps_cur_slice->i1_slice_alpha_c0_offset = 0;
  412|  7.59k|        ps_cur_slice->i1_slice_beta_offset = 0;
  413|  7.59k|    }
  414|       |
  415|       |    /* add the remaining part of the code for svc extension from reference */
  416|  12.8k|    ret = isvcd_set_default_slice_header_ext(ps_svc_lyr_dec);
  417|  12.8k|    if(ret != OK)
  ------------------
  |  |  114|  12.8k|#define OK        0
  ------------------
  |  Branch (417:8): [True: 0, False: 12.8k]
  ------------------
  418|      0|    {
  419|      0|        return ERROR_INV_SLICE_HDR_T;
  420|      0|    }
  421|       |
  422|  12.8k|    ret = isvcd_parse_slice_header(ps_svc_lyr_dec);
  423|  12.8k|    if(ret != OK)
  ------------------
  |  |  114|  12.8k|#define OK        0
  ------------------
  |  Branch (423:8): [True: 980, False: 11.9k]
  ------------------
  424|    980|    {
  425|    980|        return ERROR_INV_SLICE_HDR_T;
  426|    980|    }
  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: 415]
  ------------------
  431|  11.4k|    {
  432|  11.4k|        if(ps_pps->u1_entropy_coding_mode)
  ------------------
  |  Branch (432:12): [True: 2.42k, False: 9.06k]
  ------------------
  433|  2.42k|        {
  434|  2.42k|            SWITCHOFFTRACE;
  435|  2.42k|            SWITCHONTRACECABAC;
  436|  2.42k|            ps_svc_lyr_dec->pf_parse_inter_slice_svc_ext =
  437|  2.42k|                isvcd_parse_inter_slice_data_cabac_enh_lyr;
  438|  2.42k|            ps_svc_lyr_dec->pf_parse_inter_mb_svc_ext = isvcd_parse_pmb_cabac;
  439|       |
  440|  2.42k|            isvcd_init_cabac_contexts(P_SLICE, ps_dec);
  ------------------
  |  |  368|  2.42k|#define P_SLICE  0
  ------------------
  441|       |
  442|  2.42k|            if(ps_dec->ps_cur_slice->u1_mbaff_frame_flag)
  ------------------
  |  Branch (442:16): [True: 0, False: 2.42k]
  ------------------
  443|      0|                ps_dec->pf_get_mb_info = ih264d_get_mb_info_cabac_mbaff;
  444|  2.42k|            else
  445|  2.42k|                ps_dec->pf_get_mb_info = isvcd_get_mb_info_cabac_nonmbaff;
  446|  2.42k|        }
  447|  9.06k|        else
  448|  9.06k|        {
  449|  9.06k|            SWITCHONTRACE;
  450|  9.06k|            SWITCHOFFTRACECABAC;
  451|  9.06k|            ps_svc_lyr_dec->pf_parse_inter_slice_svc_ext =
  452|  9.06k|                isvcd_parse_inter_slice_data_cavlc_enh_lyr;
  453|  9.06k|            ps_svc_lyr_dec->pf_parse_inter_mb_svc_ext = isvcd_parse_pmb_cavlc;
  454|       |
  455|  9.06k|            if(ps_dec->ps_cur_slice->u1_mbaff_frame_flag)
  ------------------
  |  Branch (455:16): [True: 0, False: 9.06k]
  ------------------
  456|      0|            {
  457|      0|                ps_dec->pf_get_mb_info = ih264d_get_mb_info_cavlc_mbaff;
  458|      0|            }
  459|  9.06k|            else
  460|  9.06k|                ps_dec->pf_get_mb_info = isvcd_get_mb_info_cavlc_nonmbaff;
  461|  9.06k|        }
  462|  11.4k|    }
  463|    415|    else
  464|    415|    {
  465|    415|        return ERROR_FEATURE_UNAVAIL;
  466|    415|    }
  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.08k, False: 6.40k]
  ------------------
  473|       |
  474|  6.40k|    return OK;
  ------------------
  |  |  114|  6.40k|#define OK        0
  ------------------
  475|  11.4k|}
isvcd_parse_inter_slice_data_cabac:
  505|  16.6k|{
  506|  16.6k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
  507|       |
  508|  16.6k|    UWORD32 uc_more_data_flag;
  509|  16.6k|    WORD32 i2_cur_mb_addr;
  510|  16.6k|    UWORD32 u1_num_mbs, u1_num_mbsNby2, u1_mb_idx;
  511|  16.6k|    UWORD32 u1_mbaff;
  512|  16.6k|    UWORD32 u1_num_mbs_next, u1_end_of_row;
  513|  16.6k|    const UWORD16 i2_pic_wdin_mbs = ps_dec->u2_frm_wd_in_mbs;
  514|  16.6k|    UWORD32 u1_slice_end = 0;
  515|  16.6k|    UWORD32 u1_tfr_n_mb = 0;
  516|  16.6k|    UWORD32 u1_decode_nmb = 0;
  517|       |
  518|  16.6k|    deblk_mb_t *ps_cur_deblk_mb;
  519|  16.6k|    dec_mb_info_t *ps_cur_mb_info;
  520|  16.6k|    parse_pmbarams_t *ps_parse_mb_data = ps_dec->ps_parse_mb_data;
  521|  16.6k|    UWORD32 u1_inter_mb_skip_type;
  522|  16.6k|    UWORD32 u1_inter_mb_type;
  523|  16.6k|    UWORD32 u1_deblk_mb_type;
  524|  16.6k|    UWORD32 u1_mb_threshold;
  525|  16.6k|    dec_bit_stream_t *const ps_bitstrm = ps_dec->ps_bitstrm;
  526|  16.6k|    WORD32 ret = OK;
  ------------------
  |  |  114|  16.6k|#define OK        0
  ------------------
  527|       |
  528|       |    /******************************************************/
  529|       |    /* Initialisations specific to B or P slice           */
  530|       |    /******************************************************/
  531|  16.6k|    if(ps_slice->u1_slice_type == P_SLICE)
  ------------------
  |  |  368|  16.6k|#define P_SLICE  0
  ------------------
  |  Branch (531:8): [True: 7.45k, False: 9.21k]
  ------------------
  532|  7.45k|    {
  533|  7.45k|        u1_inter_mb_skip_type = CAB_P_SKIP;
  ------------------
  |  |  403|  7.45k|#define CAB_P_SKIP        0x16 /* 0001 x11x */
  ------------------
  534|  7.45k|        u1_inter_mb_type = P_MB;
  ------------------
  |  |  419|  7.45k|#define P_MB        2
  ------------------
  535|  7.45k|        u1_deblk_mb_type = D_INTER_MB;
  ------------------
  |  |  381|  7.45k|#define D_INTER_MB        0
  ------------------
  536|  7.45k|        u1_mb_threshold = 5;
  537|  7.45k|    }
  538|  9.21k|    else  // B_SLICE
  539|  9.21k|    {
  540|  9.21k|        u1_inter_mb_skip_type = CAB_B_SKIP;
  ------------------
  |  |  404|  9.21k|#define CAB_B_SKIP        0x14 /* 0001 x100 */
  ------------------
  541|  9.21k|        u1_inter_mb_type = B_MB;
  ------------------
  |  |  420|  9.21k|#define B_MB        3
  ------------------
  542|  9.21k|        u1_deblk_mb_type = D_B_SLICE;
  ------------------
  |  |  384|  9.21k|#define D_B_SLICE         4
  ------------------
  543|  9.21k|        u1_mb_threshold = 23;
  544|  9.21k|    }
  545|       |
  546|       |    /******************************************************/
  547|       |    /* Slice Level Initialisations                        */
  548|       |    /******************************************************/
  549|  16.6k|    i2_cur_mb_addr = u2_first_mb_in_slice;
  550|  16.6k|    ps_dec->u1_qp = ps_slice->u1_slice_qp;
  551|  16.6k|    ih264d_update_qp(ps_dec, 0);
  552|  16.6k|    u1_mb_idx = ps_dec->u4_mb_idx;
  553|  16.6k|    u1_num_mbs = u1_mb_idx;
  554|  16.6k|    u1_num_mbsNby2 = 0;
  555|  16.6k|    u1_mbaff = ps_slice->u1_mbaff_frame_flag;
  556|  16.6k|    i2_cur_mb_addr = u2_first_mb_in_slice << u1_mbaff;
  557|  16.6k|    uc_more_data_flag = 1;
  558|       |
  559|       |    /* Initialisations specific to cabac */
  560|  16.6k|    if(ps_bitstrm->u4_ofst & 0x07)
  ------------------
  |  Branch (560:8): [True: 12.8k, False: 3.80k]
  ------------------
  561|  12.8k|    {
  562|  12.8k|        ps_bitstrm->u4_ofst += 8;
  563|  12.8k|        ps_bitstrm->u4_ofst &= 0xFFFFFFF8;
  564|  12.8k|    }
  565|       |
  566|  16.6k|    ret = ih264d_init_cabac_dec_envirnoment(&(ps_dec->s_cab_dec_env), ps_bitstrm);
  567|  16.6k|    if(ret != OK) return ret;
  ------------------
  |  |  114|  16.6k|#define OK        0
  ------------------
  |  Branch (567:8): [True: 840, False: 15.8k]
  ------------------
  568|       |
  569|  15.8k|    ps_dec->i1_prev_mb_qp_delta = 0;
  570|       |
  571|  1.55M|    while(!u1_slice_end)
  ------------------
  |  Branch (571:11): [True: 1.55M, False: 3.44k]
  ------------------
  572|  1.55M|    {
  573|  1.55M|        UWORD8 u1_mb_type;
  574|  1.55M|        UWORD32 u4_mb_skip;
  575|       |
  576|  1.55M|        ps_dec->pv_prev_mb_parse_tu_coeff_data = ps_dec->pv_parse_tu_coeff_data;
  577|       |
  578|  1.55M|        if(i2_cur_mb_addr > ps_dec->ps_cur_sps->u4_max_mb_addr)
  ------------------
  |  Branch (578:12): [True: 6.87k, False: 1.54M]
  ------------------
  579|  6.87k|        {
  580|  6.87k|            break;
  581|  6.87k|        }
  582|       |
  583|  1.54M|        ps_cur_mb_info = ps_dec->ps_nmb_info + u1_num_mbs;
  584|  1.54M|        ps_dec->u4_num_mbs_cur_nmb = u1_num_mbs;
  585|       |
  586|  1.54M|        ps_cur_mb_info->u1_Mux = 0;
  587|  1.54M|        ps_dec->u4_num_pmbair = (u1_num_mbs >> u1_mbaff);
  588|  1.54M|        ps_cur_deblk_mb = ps_dec->ps_deblk_mbn + u1_num_mbs;
  589|  1.54M|        ps_cur_mb_info->u1_end_of_slice = 0;
  590|       |
  591|       |        /* Storing Default partition info */
  592|  1.54M|        ps_parse_mb_data->u1_num_part = 1;
  593|  1.54M|        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.54M|        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.54M|        ps_cur_mb_info->u1_tran_form8x8 = 0;
  605|  1.54M|        ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = 0;
  606|       |
  607|       |        /***************************************************************/
  608|       |        /* Set the deblocking parameters for this MB                   */
  609|       |        /***************************************************************/
  610|  1.54M|        if(ps_dec->u4_app_disable_deblk_frm == 0)
  ------------------
  |  Branch (610:12): [True: 1.54M, False: 0]
  ------------------
  611|  1.54M|            ih264d_set_deblocking_parameters(ps_cur_deblk_mb, ps_slice,
  612|  1.54M|                                             ps_dec->u1_mb_ngbr_availablity,
  613|  1.54M|                                             ps_dec->u1_cur_mb_fld_dec_flag);
  614|       |
  615|  1.54M|        if(u4_mb_skip)
  ------------------
  |  Branch (615:12): [True: 1.33M, False: 210k]
  ------------------
  616|  1.33M|        {
  617|       |            /* Set appropriate flags in ps_cur_mb_info and ps_dec */
  618|  1.33M|            memset(ps_dec->ps_curr_ctxt_mb_info, 0, sizeof(ctxt_inc_mb_info_t));
  619|  1.33M|            ps_dec->ps_curr_ctxt_mb_info->u1_mb_type = u1_inter_mb_skip_type;
  620|       |
  621|  1.33M|            MEMSET_16BYTES(&ps_dec->pu1_left_mv_ctxt_inc[0][0], 0);
  ------------------
  |  |  652|  1.33M|#define MEMSET_16BYTES(pu4_start,value)                         \
  |  |  653|  1.33M|{                                                               \
  |  |  654|  1.33M|    memset(pu4_start,value,16);                                 \
  |  |  655|  1.33M|}
  ------------------
  622|       |
  623|  1.33M|            *((UWORD32 *) ps_dec->pi1_left_ref_idx_ctxt_inc) = 0;
  624|  1.33M|            *(ps_dec->pu1_left_yuv_dc_csbp) = 0;
  625|  1.33M|            ps_dec->i1_prev_mb_qp_delta = 0;
  626|  1.33M|            ps_cur_mb_info->u1_mb_type = MB_SKIP;
  ------------------
  |  |   59|  1.33M|#define MB_SKIP 255
  ------------------
  627|  1.33M|            ps_cur_mb_info->u1_cbp = 0;
  628|       |
  629|  1.33M|            {
  630|       |                /* Storing Skip partition info */
  631|  1.33M|                parse_part_params_t *ps_part_info = ps_dec->ps_part;
  632|  1.33M|                ps_part_info->u1_is_direct = PART_DIRECT_16x16;
  ------------------
  |  |  572|  1.33M|#define PART_DIRECT_16x16              2
  ------------------
  633|  1.33M|                ps_part_info->u1_sub_mb_num = 0;
  634|  1.33M|                ps_dec->ps_part++;
  635|  1.33M|            }
  636|       |
  637|       |            /* Update Nnzs */
  638|  1.33M|            ih264d_update_nnz_for_skipmb(ps_dec, ps_cur_mb_info, CABAC);
  ------------------
  |  |  339|  1.33M|#define CABAC  1
  ------------------
  639|  1.33M|            ps_cur_mb_info->ps_curmb->u1_mb_type = u1_inter_mb_type;
  640|  1.33M|            ps_cur_deblk_mb->u1_mb_type |= u1_deblk_mb_type;
  641|  1.33M|            ps_cur_deblk_mb->u1_mb_qp = ps_dec->u1_qp;
  642|  1.33M|            if(ps_svc_lyr_dec->u1_layer_identifier != TARGET_LAYER)
  ------------------
  |  |  110|  1.33M|#define TARGET_LAYER 2
  ------------------
  |  Branch (642:16): [True: 475k, False: 862k]
  ------------------
  643|   475k|            {
  644|   475k|                ps_cur_deblk_mb->u1_deblocking_mode = MB_DISABLE_FILTERING;
  ------------------
  |  |   70|   475k|#define MB_DISABLE_FILTERING          0x01
  ------------------
  645|   475k|            }
  646|  1.33M|        }
  647|   210k|        else
  648|   210k|        {
  649|       |            /* Macroblock Layer Begins */
  650|       |            /* Decode the u1_mb_type */
  651|   210k|            u1_mb_type = ih264d_parse_mb_type_cabac(ps_dec);
  652|   210k|            ps_cur_mb_info->u1_mb_type = u1_mb_type;
  653|   210k|            if(u1_mb_type > (25 + u1_mb_threshold)) return ERROR_MB_TYPE;
  ------------------
  |  Branch (653:16): [True: 0, False: 210k]
  ------------------
  654|       |
  655|       |            /* Parse Macroblock Data */
  656|   210k|            if(u1_mb_type < u1_mb_threshold)
  ------------------
  |  Branch (656:16): [True: 203k, False: 6.49k]
  ------------------
  657|   203k|            {
  658|   203k|                ps_cur_mb_info->ps_curmb->u1_mb_type = u1_inter_mb_type;
  659|   203k|                *(ps_dec->pu1_left_yuv_dc_csbp) &= 0x6;
  660|       |
  661|   203k|                ret = ps_dec->pf_parse_inter_mb(ps_dec, ps_cur_mb_info, u1_num_mbs, u1_num_mbsNby2);
  662|   203k|                if(ret != OK) return ret;
  ------------------
  |  |  114|   203k|#define OK        0
  ------------------
  |  Branch (662:20): [True: 4.76k, False: 199k]
  ------------------
  663|   199k|                ps_cur_deblk_mb->u1_mb_qp = ps_dec->u1_qp;
  664|   199k|                ps_cur_deblk_mb->u1_mb_type |= u1_deblk_mb_type;
  665|   199k|                if(ps_svc_lyr_dec->u1_layer_identifier != TARGET_LAYER)
  ------------------
  |  |  110|   199k|#define TARGET_LAYER 2
  ------------------
  |  Branch (665:20): [True: 40.7k, False: 158k]
  ------------------
  666|  40.7k|                {
  667|  40.7k|                    ps_cur_deblk_mb->u1_deblocking_mode = MB_DISABLE_FILTERING;
  ------------------
  |  |   70|  40.7k|#define MB_DISABLE_FILTERING          0x01
  ------------------
  668|  40.7k|                }
  669|   199k|            }
  670|  6.49k|            else
  671|  6.49k|            {
  672|       |                /* Storing Intra partition info */
  673|  6.49k|                ps_parse_mb_data->u1_num_part = 0;
  674|  6.49k|                ps_parse_mb_data->u4_isI_mb = 1;
  675|       |
  676|  6.49k|                if((25 + u1_mb_threshold) == u1_mb_type)
  ------------------
  |  Branch (676:20): [True: 245, False: 6.24k]
  ------------------
  677|    245|                {
  678|       |                    /* I_PCM_MB */
  679|    245|                    ps_cur_mb_info->ps_curmb->u1_mb_type = I_PCM_MB;
  ------------------
  |  |  423|    245|#define I_PCM_MB    6
  ------------------
  680|    245|                    ret = ih264d_parse_ipcm_mb(ps_dec, ps_cur_mb_info, u1_num_mbs);
  681|    245|                    if(ret != OK) return ret;
  ------------------
  |  |  114|    245|#define OK        0
  ------------------
  |  Branch (681:24): [True: 172, False: 73]
  ------------------
  682|     73|                    ps_cur_deblk_mb->u1_mb_qp = 0;
  683|     73|                }
  684|  6.24k|                else
  685|  6.24k|                {
  686|  6.24k|                    if(u1_mb_type == u1_mb_threshold)
  ------------------
  |  Branch (686:24): [True: 4.08k, False: 2.16k]
  ------------------
  687|  4.08k|                        ps_cur_mb_info->ps_curmb->u1_mb_type = I_4x4_MB;
  ------------------
  |  |  417|  4.08k|#define I_4x4_MB    0
  ------------------
  688|  2.16k|                    else
  689|  2.16k|                        ps_cur_mb_info->ps_curmb->u1_mb_type = I_16x16_MB;
  ------------------
  |  |  418|  2.16k|#define I_16x16_MB  1
  ------------------
  690|       |
  691|  6.24k|                    ret = ih264d_parse_imb_cabac(ps_dec, ps_cur_mb_info,
  692|  6.24k|                                                 (UWORD8) (u1_mb_type - u1_mb_threshold));
  693|  6.24k|                    if(ret != OK) return ret;
  ------------------
  |  |  114|  6.24k|#define OK        0
  ------------------
  |  Branch (693:24): [True: 575, False: 5.67k]
  ------------------
  694|  5.67k|                    ps_cur_deblk_mb->u1_mb_qp = ps_dec->u1_qp;
  695|  5.67k|                }
  696|  5.74k|                ps_cur_deblk_mb->u1_mb_type |= D_INTRA_MB;
  ------------------
  |  |  382|  5.74k|#define D_INTRA_MB        1
  ------------------
  697|  5.74k|            }
  698|   210k|        }
  699|       |
  700|  1.54M|        if(ps_dec->u1_enable_mb_info)
  ------------------
  |  Branch (700:12): [True: 0, False: 1.54M]
  ------------------
  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.54M|        if(u1_mbaff)
  ------------------
  |  Branch (705:12): [True: 0, False: 1.54M]
  ------------------
  706|      0|        {
  707|      0|            ih264d_update_mbaff_left_nnz(ps_dec, ps_cur_mb_info);
  708|      0|        }
  709|       |
  710|  1.54M|        if(ps_cur_mb_info->u1_topmb && u1_mbaff)
  ------------------
  |  Branch (710:12): [True: 1.54M, False: 0]
  |  Branch (710:40): [True: 0, False: 1.54M]
  ------------------
  711|      0|            uc_more_data_flag = 1;
  712|  1.54M|        else
  713|  1.54M|        {
  714|  1.54M|            uc_more_data_flag = ih264d_decode_terminate(&ps_dec->s_cab_dec_env, ps_bitstrm);
  715|  1.54M|            uc_more_data_flag = !uc_more_data_flag;
  716|  1.54M|            COPYTHECONTEXT("Decode Sliceterm", !uc_more_data_flag);
  717|  1.54M|        }
  718|       |
  719|  1.54M|        if(u1_mbaff)
  ------------------
  |  Branch (719:12): [True: 0, False: 1.54M]
  ------------------
  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.54M|        i2_cur_mb_addr++;
  728|  1.54M|        u1_num_mbs++;
  729|  1.54M|        u1_num_mbsNby2++;
  730|  1.54M|        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.54M|        u1_num_mbs_next = i2_pic_wdin_mbs - ps_dec->u2_mbx - 1;
  738|  1.54M|        u1_end_of_row = (!u1_num_mbs_next) && (!(u1_mbaff && (u1_num_mbs & 0x01)));
  ------------------
  |  Branch (738:25): [True: 114k, False: 1.42M]
  |  Branch (738:50): [True: 0, False: 114k]
  |  Branch (738:62): [True: 0, False: 0]
  ------------------
  739|  1.54M|        u1_slice_end = !uc_more_data_flag;
  740|  1.54M|        u1_tfr_n_mb = (u1_num_mbs == ps_dec->u4_recon_mb_grp) || u1_end_of_row || u1_slice_end;
  ------------------
  |  Branch (740:23): [True: 112k, False: 1.43M]
  |  Branch (740:66): [True: 1.50k, False: 1.42M]
  |  Branch (740:83): [True: 3.13k, False: 1.42M]
  ------------------
  741|  1.54M|        u1_decode_nmb = u1_tfr_n_mb || u1_slice_end;
  ------------------
  |  Branch (741:25): [True: 117k, False: 1.42M]
  |  Branch (741:40): [True: 0, False: 1.42M]
  ------------------
  742|  1.54M|        ps_cur_mb_info->u1_end_of_slice = u1_slice_end;
  743|       |
  744|  1.54M|        if(u1_decode_nmb)
  ------------------
  |  Branch (744:12): [True: 117k, False: 1.42M]
  ------------------
  745|   117k|        {
  746|   117k|            ret = ps_dec->pf_mvpred_ref_tfr_nby2mb(ps_dec, u1_mb_idx, u1_num_mbs);
  747|   117k|            u1_num_mbsNby2 = 0;
  748|   117k|            {
  749|   117k|                ps_parse_mb_data = ps_dec->ps_parse_mb_data;
  750|   117k|                ps_dec->ps_part = ps_dec->ps_parse_part_params;
  751|   117k|            }
  752|   117k|            if(ret != OK) return ret;
  ------------------
  |  |  114|   117k|#define OK        0
  ------------------
  |  Branch (752:16): [True: 0, False: 117k]
  ------------------
  753|   117k|        }
  754|       |
  755|  1.54M|        if(u1_decode_nmb)
  ------------------
  |  Branch (755:12): [True: 117k, False: 1.42M]
  ------------------
  756|   117k|        {
  757|   117k|            if(ps_dec->u1_separate_parse)
  ------------------
  |  Branch (757:16): [True: 28.1k, False: 89.1k]
  ------------------
  758|  28.1k|            {
  759|  28.1k|                ih264d_parse_tfr_nmb(ps_dec, u1_mb_idx, u1_num_mbs, u1_num_mbs_next, u1_tfr_n_mb,
  760|  28.1k|                                     u1_end_of_row);
  761|  28.1k|                ps_dec->ps_nmb_info += u1_num_mbs;
  762|  28.1k|                ps_svc_lyr_dec->ps_svc_nmb_info += u1_num_mbs;
  763|  28.1k|            }
  764|  89.1k|            else
  765|  89.1k|            {
  766|  89.1k|                if(ps_svc_lyr_dec->u1_layer_identifier == TARGET_LAYER)
  ------------------
  |  |  110|  89.1k|#define TARGET_LAYER 2
  ------------------
  |  Branch (766:20): [True: 37.9k, False: 51.2k]
  ------------------
  767|  37.9k|                {
  768|  37.9k|                    ih264d_decode_recon_tfr_nmb(ps_dec, u1_mb_idx, u1_num_mbs, u1_num_mbs_next,
  769|  37.9k|                                                u1_tfr_n_mb, u1_end_of_row);
  770|  37.9k|                }
  771|  51.2k|                else
  772|  51.2k|                {
  773|  51.2k|                    isvcd_decode_recon_tfr_nmb_base_lyr(ps_svc_lyr_dec, u1_mb_idx, u1_num_mbs,
  774|  51.2k|                                                        u1_num_mbs_next, u1_tfr_n_mb,
  775|  51.2k|                                                        u1_end_of_row);
  776|  51.2k|                }
  777|  89.1k|            }
  778|   117k|            ps_dec->u4_total_mbs_coded += u1_num_mbs;
  779|   117k|            if(u1_tfr_n_mb) u1_num_mbs = 0;
  ------------------
  |  Branch (779:16): [True: 117k, False: 0]
  ------------------
  780|   117k|            u1_mb_idx = u1_num_mbs;
  781|   117k|            ps_dec->u4_mb_idx = u1_num_mbs;
  782|   117k|        }
  783|  1.54M|    }
  784|       |
  785|  10.3k|    ps_dec->u4_num_mbs_cur_nmb = 0;
  786|  10.3k|    ps_dec->ps_cur_slice->u4_mbs_in_slice = i2_cur_mb_addr - (u2_first_mb_in_slice << u1_mbaff);
  787|       |
  788|  10.3k|    return ret;
  789|  15.8k|}
isvcd_parse_inter_slice_data_cavlc:
  820|  56.8k|{
  821|  56.8k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
  822|  56.8k|    UWORD32 uc_more_data_flag;
  823|  56.8k|    WORD32 i2_cur_mb_addr;
  824|  56.8k|    UWORD32 u1_num_mbs, u1_num_mbsNby2, u1_mb_idx;
  825|  56.8k|    UWORD32 i2_mb_skip_run;
  826|  56.8k|    UWORD32 u1_read_mb_type;
  827|       |
  828|  56.8k|    UWORD32 u1_mbaff;
  829|  56.8k|    UWORD32 u1_num_mbs_next, u1_end_of_row;
  830|  56.8k|    const UWORD32 i2_pic_wdin_mbs = ps_dec->u2_frm_wd_in_mbs;
  831|  56.8k|    UWORD32 u1_slice_end = 0;
  832|  56.8k|    UWORD32 u1_tfr_n_mb = 0;
  833|  56.8k|    UWORD32 u1_decode_nmb = 0;
  834|       |
  835|  56.8k|    dec_bit_stream_t *const ps_bitstrm = ps_dec->ps_bitstrm;
  836|  56.8k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
  837|  56.8k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
  838|  56.8k|    deblk_mb_t *ps_cur_deblk_mb;
  839|  56.8k|    dec_mb_info_t *ps_cur_mb_info;
  840|  56.8k|    parse_pmbarams_t *ps_parse_mb_data = ps_dec->ps_parse_mb_data;
  841|  56.8k|    UWORD32 u1_inter_mb_type;
  842|  56.8k|    UWORD32 u1_deblk_mb_type;
  843|  56.8k|    UWORD32 u1_mb_threshold;
  844|  56.8k|    WORD32 ret = OK;
  ------------------
  |  |  114|  56.8k|#define OK        0
  ------------------
  845|       |
  846|       |    /******************************************************/
  847|       |    /* Initialisations specific to B or P slice           */
  848|       |    /******************************************************/
  849|  56.8k|    if(ps_slice->u1_slice_type == P_SLICE)
  ------------------
  |  |  368|  56.8k|#define P_SLICE  0
  ------------------
  |  Branch (849:8): [True: 44.6k, False: 12.1k]
  ------------------
  850|  44.6k|    {
  851|  44.6k|        u1_inter_mb_type = P_MB;
  ------------------
  |  |  419|  44.6k|#define P_MB        2
  ------------------
  852|  44.6k|        u1_deblk_mb_type = D_INTER_MB;
  ------------------
  |  |  381|  44.6k|#define D_INTER_MB        0
  ------------------
  853|  44.6k|        u1_mb_threshold = 5;
  854|  44.6k|    }
  855|  12.1k|    else  // B_SLICE
  856|  12.1k|    {
  857|  12.1k|        u1_inter_mb_type = B_MB;
  ------------------
  |  |  420|  12.1k|#define B_MB        3
  ------------------
  858|  12.1k|        u1_deblk_mb_type = D_B_SLICE;
  ------------------
  |  |  384|  12.1k|#define D_B_SLICE         4
  ------------------
  859|  12.1k|        u1_mb_threshold = 23;
  860|  12.1k|    }
  861|       |
  862|       |    /******************************************************/
  863|       |    /* Slice Level Initialisations                        */
  864|       |    /******************************************************/
  865|  56.8k|    ps_dec->u1_qp = ps_slice->u1_slice_qp;
  866|  56.8k|    ih264d_update_qp(ps_dec, 0);
  867|  56.8k|    u1_mb_idx = ps_dec->u4_mb_idx;
  868|  56.8k|    u1_num_mbs = u1_mb_idx;
  869|       |
  870|  56.8k|    u1_num_mbsNby2 = 0;
  871|  56.8k|    u1_mbaff = ps_slice->u1_mbaff_frame_flag;
  872|  56.8k|    i2_cur_mb_addr = u2_first_mb_in_slice << u1_mbaff;
  873|  56.8k|    i2_mb_skip_run = 0;
  874|  56.8k|    uc_more_data_flag = 1;
  875|  56.8k|    u1_read_mb_type = 0;
  876|       |
  877|  1.02M|    while(!u1_slice_end)
  ------------------
  |  Branch (877:11): [True: 1.00M, False: 24.2k]
  ------------------
  878|  1.00M|    {
  879|  1.00M|        UWORD8 u1_mb_type;
  880|       |
  881|  1.00M|        ps_dec->pv_prev_mb_parse_tu_coeff_data = ps_dec->pv_parse_tu_coeff_data;
  882|  1.00M|        if(i2_cur_mb_addr > ps_dec->ps_cur_sps->u4_max_mb_addr)
  ------------------
  |  Branch (882:12): [True: 17.8k, False: 982k]
  ------------------
  883|  17.8k|        {
  884|  17.8k|            break;
  885|  17.8k|        }
  886|       |
  887|   982k|        ps_cur_mb_info = ps_dec->ps_nmb_info + u1_num_mbs;
  888|   982k|        ps_dec->u4_num_mbs_cur_nmb = u1_num_mbs;
  889|   982k|        ps_cur_mb_info->u1_Mux = 0;
  890|   982k|        ps_dec->u4_num_pmbair = (u1_num_mbs >> u1_mbaff);
  891|   982k|        ps_cur_deblk_mb = ps_dec->ps_deblk_mbn + u1_num_mbs;
  892|       |
  893|   982k|        ps_cur_mb_info->u1_end_of_slice = 0;
  894|       |
  895|       |        /* Storing Default partition info */
  896|   982k|        ps_parse_mb_data->u1_num_part = 1;
  897|   982k|        ps_parse_mb_data->u4_isI_mb = 0;
  898|       |
  899|   982k|        if((!i2_mb_skip_run) && (!u1_read_mb_type))
  ------------------
  |  Branch (899:12): [True: 201k, False: 780k]
  |  Branch (899:33): [True: 163k, False: 37.7k]
  ------------------
  900|   163k|        {
  901|       |            // Inlined ih264d_uev
  902|   163k|            UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
  903|   163k|            UWORD32 u4_word, u4_ldz;
  904|       |
  905|       |            /***************************************************************/
  906|       |            /* Find leading zeros in next 32 bits                          */
  907|       |            /***************************************************************/
  908|   163k|            NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|   163k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|   163k|{                                                                           \
  |  |  152|   163k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|   163k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|   163k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|   163k|                                                                            \
  |  |  156|   163k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|   163k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 156k, False: 7.01k]
  |  |  ------------------
  |  |  158|   163k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|   156k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|   163k|}
  ------------------
  909|       |
  910|   163k|            u4_ldz = CLZ(u4_word);
  911|       |
  912|       |            /* Flush the ps_bitstrm */
  913|   163k|            u4_bitstream_offset += (u4_ldz + 1);
  914|       |            /* Read the suffix from the ps_bitstrm */
  915|   163k|            u4_word = 0;
  916|   163k|            if(u4_ldz)
  ------------------
  |  Branch (916:16): [True: 60.8k, False: 102k]
  ------------------
  917|  60.8k|            {
  918|  60.8k|                GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  60.8k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  60.8k|{                                                                           \
  |  |  122|  60.8k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  60.8k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  60.8k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  60.8k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  60.8k|                                                                            \
  |  |  127|  60.8k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 56.7k, False: 4.03k]
  |  |  ------------------
  |  |  128|  60.8k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  56.7k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  60.8k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  60.8k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  60.8k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  60.8k|}                                                                           \
  ------------------
  919|  60.8k|            }
  920|   163k|            *pu4_bitstrm_ofst = u4_bitstream_offset;
  921|   163k|            i2_mb_skip_run = ((1 << u4_ldz) + u4_word - 1);
  922|       |            // Inlined ih264d_uev
  923|   163k|            COPYTHECONTEXT("mb_skip_run", i2_mb_skip_run);
  924|   163k|            uc_more_data_flag = MORE_RBSP_DATA(ps_bitstrm);
  ------------------
  |  |   97|   163k|    CHECK_BITS_SUFFICIENT(ps_bitstrm, 1)
  |  |  ------------------
  |  |  |  |   95|   163k|  (ps_bitstrm->u4_ofst + bits_to_read <= ps_bitstrm->u4_max_ofst)
  |  |  ------------------
  ------------------
  925|   163k|            u1_read_mb_type = uc_more_data_flag;
  926|   163k|        }
  927|       |
  928|       |        /***************************************************************/
  929|       |        /* Get the required information for decoding of MB            */
  930|       |        /* mb_x, mb_y , neighbour availablity,                              */
  931|       |        /***************************************************************/
  932|   982k|        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|   982k|        if(ps_dec->u4_app_disable_deblk_frm == 0)
  ------------------
  |  Branch (937:12): [True: 982k, False: 0]
  ------------------
  938|   982k|            ih264d_set_deblocking_parameters(ps_cur_deblk_mb, ps_slice,
  939|   982k|                                             ps_dec->u1_mb_ngbr_availablity,
  940|   982k|                                             ps_dec->u1_cur_mb_fld_dec_flag);
  941|       |
  942|   982k|        if(i2_mb_skip_run)
  ------------------
  |  Branch (942:12): [True: 841k, False: 140k]
  ------------------
  943|   841k|        {
  944|       |            /* Set appropriate flags in ps_cur_mb_info and ps_dec */
  945|   841k|            ps_dec->i1_prev_mb_qp_delta = 0;
  946|   841k|            ps_dec->u1_sub_mb_num = 0;
  947|   841k|            ps_cur_mb_info->u1_mb_type = MB_SKIP;
  ------------------
  |  |   59|   841k|#define MB_SKIP 255
  ------------------
  948|   841k|            ps_cur_mb_info->u1_mb_mc_mode = PRED_16x16;
  ------------------
  |  |  450|   841k|#define PRED_16x16  0
  ------------------
  949|   841k|            ps_cur_mb_info->u1_cbp = 0;
  950|       |
  951|   841k|            {
  952|       |                /* Storing Skip partition info */
  953|   841k|                parse_part_params_t *ps_part_info = ps_dec->ps_part;
  954|   841k|                ps_part_info->u1_is_direct = PART_DIRECT_16x16;
  ------------------
  |  |  572|   841k|#define PART_DIRECT_16x16              2
  ------------------
  955|   841k|                ps_part_info->u1_sub_mb_num = 0;
  956|   841k|                ps_dec->ps_part++;
  957|   841k|            }
  958|       |
  959|       |            /* Update Nnzs */
  960|   841k|            ih264d_update_nnz_for_skipmb(ps_dec, ps_cur_mb_info, CAVLC);
  ------------------
  |  |  338|   841k|#define CAVLC  0
  ------------------
  961|       |
  962|   841k|            ps_cur_mb_info->ps_curmb->u1_mb_type = u1_inter_mb_type;
  963|   841k|            ps_cur_deblk_mb->u1_mb_type |= u1_deblk_mb_type;
  964|       |
  965|   841k|            if(ps_svc_lyr_dec->u1_layer_identifier != TARGET_LAYER)
  ------------------
  |  |  110|   841k|#define TARGET_LAYER 2
  ------------------
  |  Branch (965:16): [True: 194k, False: 647k]
  ------------------
  966|   194k|            {
  967|   194k|                ps_cur_deblk_mb->u1_deblocking_mode = MB_DISABLE_FILTERING;
  ------------------
  |  |   70|   194k|#define MB_DISABLE_FILTERING          0x01
  ------------------
  968|   194k|            }
  969|       |
  970|   841k|            i2_mb_skip_run--;
  971|   841k|        }
  972|   140k|        else
  973|   140k|        {
  974|   140k|            u1_read_mb_type = 0;
  975|       |            /**************************************************************/
  976|       |            /* Macroblock Layer Begins, Decode the u1_mb_type                */
  977|       |            /**************************************************************/
  978|   140k|            {
  979|   140k|                UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
  980|   140k|                UWORD32 u4_word, u4_ldz, u4_temp;
  981|       |
  982|       |                // Inlined ih264d_uev
  983|       |                /***************************************************************/
  984|       |                /* Find leading zeros in next 32 bits                          */
  985|       |                /***************************************************************/
  986|   140k|                NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|   140k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|   140k|{                                                                           \
  |  |  152|   140k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|   140k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|   140k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|   140k|                                                                            \
  |  |  156|   140k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|   140k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 136k, False: 4.08k]
  |  |  ------------------
  |  |  158|   140k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|   136k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|   140k|}
  ------------------
  987|   140k|                u4_ldz = CLZ(u4_word);
  988|       |                /* Flush the ps_bitstrm */
  989|   140k|                u4_bitstream_offset += (u4_ldz + 1);
  990|       |                /* Read the suffix from the ps_bitstrm */
  991|   140k|                u4_word = 0;
  992|   140k|                if(u4_ldz) GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  67.5k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  67.5k|{                                                                           \
  |  |  122|  67.5k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  67.5k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  67.5k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  67.5k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  67.5k|                                                                            \
  |  |  127|  67.5k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 63.2k, False: 4.35k]
  |  |  ------------------
  |  |  128|  67.5k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  63.2k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  67.5k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  67.5k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  67.5k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  67.5k|}                                                                           \
  ------------------
  |  Branch (992:20): [True: 67.5k, False: 73.0k]
  ------------------
  993|   140k|                *pu4_bitstrm_ofst = u4_bitstream_offset;
  994|   140k|                u4_temp = ((1 << u4_ldz) + u4_word - 1);
  995|       |                // Inlined ih264d_uev
  996|   140k|                if(u4_temp > (UWORD32) (25 + u1_mb_threshold)) return ERROR_MB_TYPE;
  ------------------
  |  Branch (996:20): [True: 1.12k, False: 139k]
  ------------------
  997|   139k|                u1_mb_type = u4_temp;
  998|   139k|                COPYTHECONTEXT("u1_mb_type", u1_mb_type);
  999|   139k|            }
 1000|      0|            ps_cur_mb_info->u1_mb_type = u1_mb_type;
 1001|       |
 1002|       |            /**************************************************************/
 1003|       |            /* Parse Macroblock data                                      */
 1004|       |            /**************************************************************/
 1005|   139k|            if(u1_mb_type < u1_mb_threshold)
  ------------------
  |  Branch (1005:16): [True: 114k, False: 25.2k]
  ------------------
 1006|   114k|            {
 1007|   114k|                ps_cur_mb_info->ps_curmb->u1_mb_type = u1_inter_mb_type;
 1008|       |
 1009|   114k|                ret = ps_dec->pf_parse_inter_mb(ps_dec, ps_cur_mb_info, u1_num_mbs, u1_num_mbsNby2);
 1010|   114k|                if(ret != OK) return ret;
  ------------------
  |  |  114|   114k|#define OK        0
  ------------------
  |  Branch (1010:20): [True: 10.4k, False: 103k]
  ------------------
 1011|   103k|                ps_cur_deblk_mb->u1_mb_type |= u1_deblk_mb_type;
 1012|       |
 1013|   103k|                if(ps_svc_lyr_dec->u1_layer_identifier != TARGET_LAYER)
  ------------------
  |  |  110|   103k|#define TARGET_LAYER 2
  ------------------
  |  Branch (1013:20): [True: 41.3k, False: 62.5k]
  ------------------
 1014|  41.3k|                {
 1015|  41.3k|                    ps_cur_deblk_mb->u1_deblocking_mode = MB_DISABLE_FILTERING;
  ------------------
  |  |   70|  41.3k|#define MB_DISABLE_FILTERING          0x01
  ------------------
 1016|  41.3k|                }
 1017|   103k|            }
 1018|  25.2k|            else
 1019|  25.2k|            {
 1020|       |                /* Storing Intra partition info */
 1021|  25.2k|                ps_parse_mb_data->u1_num_part = 0;
 1022|  25.2k|                ps_parse_mb_data->u4_isI_mb = 1;
 1023|       |
 1024|  25.2k|                if((25 + u1_mb_threshold) == u1_mb_type)
  ------------------
  |  Branch (1024:20): [True: 964, False: 24.2k]
  ------------------
 1025|    964|                {
 1026|       |                    /* I_PCM_MB */
 1027|    964|                    ps_cur_mb_info->ps_curmb->u1_mb_type = I_PCM_MB;
  ------------------
  |  |  423|    964|#define I_PCM_MB    6
  ------------------
 1028|    964|                    ret = ih264d_parse_ipcm_mb(ps_dec, ps_cur_mb_info, u1_num_mbs);
 1029|    964|                    if(ret != OK) return ret;
  ------------------
  |  |  114|    964|#define OK        0
  ------------------
  |  Branch (1029:24): [True: 0, False: 964]
  ------------------
 1030|    964|                    ps_dec->u1_qp = 0;
 1031|    964|                }
 1032|  24.2k|                else
 1033|  24.2k|                {
 1034|  24.2k|                    ret = ih264d_parse_imb_cavlc(ps_dec, ps_cur_mb_info, u1_num_mbs,
 1035|  24.2k|                                                 (UWORD8) (u1_mb_type - u1_mb_threshold));
 1036|  24.2k|                    if(ret != OK) return ret;
  ------------------
  |  |  114|  24.2k|#define OK        0
  ------------------
  |  Branch (1036:24): [True: 3.20k, False: 21.0k]
  ------------------
 1037|  24.2k|                }
 1038|       |
 1039|  22.0k|                ps_cur_deblk_mb->u1_mb_type |= D_INTRA_MB;
  ------------------
  |  |  382|  22.0k|#define D_INTRA_MB        1
  ------------------
 1040|  22.0k|            }
 1041|   125k|            uc_more_data_flag = MORE_RBSP_DATA(ps_bitstrm);
  ------------------
  |  |   97|   125k|    CHECK_BITS_SUFFICIENT(ps_bitstrm, 1)
  |  |  ------------------
  |  |  |  |   95|   125k|  (ps_bitstrm->u4_ofst + bits_to_read <= ps_bitstrm->u4_max_ofst)
  |  |  ------------------
  ------------------
 1042|   125k|        }
 1043|   967k|        ps_cur_deblk_mb->u1_mb_qp = ps_dec->u1_qp;
 1044|       |
 1045|   967k|        if(ps_dec->u1_enable_mb_info)
  ------------------
  |  Branch (1045:12): [True: 0, False: 967k]
  ------------------
 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|   967k|        if(u1_mbaff)
  ------------------
  |  Branch (1050:12): [True: 0, False: 967k]
  ------------------
 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|   967k|        i2_cur_mb_addr++;
 1063|       |
 1064|   967k|        u1_num_mbs++;
 1065|   967k|        u1_num_mbsNby2++;
 1066|   967k|        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|   967k|        u1_num_mbs_next = i2_pic_wdin_mbs - ps_dec->u2_mbx - 1;
 1074|   967k|        u1_end_of_row = (!u1_num_mbs_next) && (!(u1_mbaff && (u1_num_mbs & 0x01)));
  ------------------
  |  Branch (1074:25): [True: 175k, False: 791k]
  |  Branch (1074:50): [True: 0, False: 175k]
  |  Branch (1074:62): [True: 0, False: 0]
  ------------------
 1075|   967k|        u1_slice_end = (!(uc_more_data_flag || i2_mb_skip_run));
  ------------------
  |  Branch (1075:27): [True: 370k, False: 596k]
  |  Branch (1075:48): [True: 572k, False: 24.2k]
  ------------------
 1076|   967k|        u1_tfr_n_mb = (u1_num_mbs == ps_dec->u4_recon_mb_grp) || u1_end_of_row || u1_slice_end;
  ------------------
  |  Branch (1076:23): [True: 175k, False: 792k]
  |  Branch (1076:66): [True: 264, False: 791k]
  |  Branch (1076:83): [True: 21.2k, False: 770k]
  ------------------
 1077|   967k|        u1_decode_nmb = u1_tfr_n_mb || u1_slice_end;
  ------------------
  |  Branch (1077:25): [True: 196k, False: 770k]
  |  Branch (1077:40): [True: 0, False: 770k]
  ------------------
 1078|   967k|        ps_cur_mb_info->u1_end_of_slice = u1_slice_end;
 1079|       |
 1080|   967k|        if(u1_decode_nmb)
  ------------------
  |  Branch (1080:12): [True: 196k, False: 770k]
  ------------------
 1081|   196k|        {
 1082|   196k|            ret = ps_dec->pf_mvpred_ref_tfr_nby2mb(ps_dec, u1_mb_idx, u1_num_mbs);
 1083|   196k|            u1_num_mbsNby2 = 0;
 1084|   196k|            ps_parse_mb_data = ps_dec->ps_parse_mb_data;
 1085|   196k|            ps_dec->ps_part = ps_dec->ps_parse_part_params;
 1086|   196k|            if(ret != OK) return ret;
  ------------------
  |  |  114|   196k|#define OK        0
  ------------------
  |  Branch (1086:16): [True: 0, False: 196k]
  ------------------
 1087|   196k|        }
 1088|       |
 1089|   967k|        if(u1_decode_nmb)
  ------------------
  |  Branch (1089:12): [True: 196k, False: 770k]
  ------------------
 1090|   196k|        {
 1091|   196k|            if(ps_dec->u1_separate_parse)
  ------------------
  |  Branch (1091:16): [True: 47.6k, False: 149k]
  ------------------
 1092|  47.6k|            {
 1093|  47.6k|                ih264d_parse_tfr_nmb(ps_dec, u1_mb_idx, u1_num_mbs, u1_num_mbs_next, u1_tfr_n_mb,
 1094|  47.6k|                                     u1_end_of_row);
 1095|  47.6k|                ps_dec->ps_nmb_info += u1_num_mbs;
 1096|  47.6k|                ps_svc_lyr_dec->ps_svc_nmb_info += u1_num_mbs;
 1097|  47.6k|            }
 1098|   149k|            else
 1099|   149k|            {
 1100|   149k|                if(ps_svc_lyr_dec->u1_layer_identifier == TARGET_LAYER)
  ------------------
  |  |  110|   149k|#define TARGET_LAYER 2
  ------------------
  |  Branch (1100:20): [True: 38.0k, False: 111k]
  ------------------
 1101|  38.0k|                {
 1102|  38.0k|                    ih264d_decode_recon_tfr_nmb(ps_dec, u1_mb_idx, u1_num_mbs, u1_num_mbs_next,
 1103|  38.0k|                                                u1_tfr_n_mb, u1_end_of_row);
 1104|  38.0k|                }
 1105|   111k|                else
 1106|   111k|                {
 1107|   111k|                    isvcd_decode_recon_tfr_nmb_base_lyr(ps_svc_lyr_dec, u1_mb_idx, u1_num_mbs,
 1108|   111k|                                                        u1_num_mbs_next, u1_tfr_n_mb,
 1109|   111k|                                                        u1_end_of_row);
 1110|   111k|                }
 1111|   149k|            }
 1112|   196k|            ps_dec->u4_total_mbs_coded += u1_num_mbs;
 1113|   196k|            if(u1_tfr_n_mb) u1_num_mbs = 0;
  ------------------
  |  Branch (1113:16): [True: 196k, False: 0]
  ------------------
 1114|   196k|            u1_mb_idx = u1_num_mbs;
 1115|   196k|            ps_dec->u4_mb_idx = u1_num_mbs;
 1116|   196k|        }
 1117|   967k|    }
 1118|       |
 1119|  42.0k|    ps_dec->u4_num_mbs_cur_nmb = 0;
 1120|  42.0k|    ps_dec->ps_cur_slice->u4_mbs_in_slice = i2_cur_mb_addr - (u2_first_mb_in_slice << u1_mbaff);
 1121|       |
 1122|  42.0k|    return ret;
 1123|  56.8k|}
isvcd_parse_inter_slice_data_cabac_enh_lyr:
 1154|  4.71k|{
 1155|  4.71k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
 1156|  4.71k|    UWORD32 uc_more_data_flag;
 1157|  4.71k|    WORD32 i2_cur_mb_addr;
 1158|  4.71k|    UWORD32 u1_num_mbs, u1_num_mbsNby2, u1_mb_idx;
 1159|  4.71k|    UWORD32 u1_mbaff;
 1160|  4.71k|    UWORD32 u1_num_mbs_next, u1_end_of_row;
 1161|  4.71k|    const UWORD16 i2_pic_wdin_mbs = ps_dec->u2_frm_wd_in_mbs;
 1162|  4.71k|    UWORD32 u1_slice_end = 0;
 1163|  4.71k|    UWORD32 u1_tfr_n_mb = 0;
 1164|  4.71k|    UWORD32 u1_decode_nmb = 0;
 1165|       |
 1166|  4.71k|    dec_slice_svc_ext_params_t *ps_svc_slice_params = NULL;
 1167|  4.71k|    deblk_mb_t *ps_cur_deblk_mb;
 1168|  4.71k|    dec_mb_info_t *ps_cur_mb_info;
 1169|  4.71k|    dec_svc_mb_info_t *ps_svc_cur_mb_info;
 1170|       |
 1171|  4.71k|    parse_pmbarams_t *ps_parse_mb_data = ps_dec->ps_parse_mb_data;
 1172|  4.71k|    UWORD32 u1_inter_mb_skip_type;
 1173|  4.71k|    UWORD32 u1_inter_mb_type;
 1174|  4.71k|    UWORD32 u1_deblk_mb_type;
 1175|  4.71k|    UWORD32 u1_mb_threshold;
 1176|  4.71k|    dec_bit_stream_t *const ps_bitstrm = ps_dec->ps_bitstrm;
 1177|  4.71k|    decoding_envirnoment_t *ps_cab_env = NULL;
 1178|  4.71k|    WORD32 ret = OK;
  ------------------
  |  |  114|  4.71k|#define OK        0
  ------------------
 1179|       |
 1180|  4.71k|    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.71k|    if(ps_slice->u1_slice_type == P_SLICE)
  ------------------
  |  |  368|  4.71k|#define P_SLICE  0
  ------------------
  |  Branch (1185:8): [True: 2.42k, False: 2.29k]
  ------------------
 1186|  2.42k|    {
 1187|  2.42k|        u1_inter_mb_skip_type = CAB_P_SKIP;
  ------------------
  |  |  403|  2.42k|#define CAB_P_SKIP        0x16 /* 0001 x11x */
  ------------------
 1188|  2.42k|        u1_inter_mb_type = P_MB;
  ------------------
  |  |  419|  2.42k|#define P_MB        2
  ------------------
 1189|  2.42k|        u1_deblk_mb_type = D_INTER_MB;
  ------------------
  |  |  381|  2.42k|#define D_INTER_MB        0
  ------------------
 1190|  2.42k|        u1_mb_threshold = 5;
 1191|  2.42k|    }
 1192|  2.29k|    else  // EB_SLICE
 1193|  2.29k|    {
 1194|  2.29k|        u1_inter_mb_skip_type = CAB_B_SKIP;
  ------------------
  |  |  404|  2.29k|#define CAB_B_SKIP        0x14 /* 0001 x100 */
  ------------------
 1195|  2.29k|        u1_inter_mb_type = B_MB;
  ------------------
  |  |  420|  2.29k|#define B_MB        3
  ------------------
 1196|  2.29k|        u1_deblk_mb_type = D_B_SLICE;
  ------------------
  |  |  384|  2.29k|#define D_B_SLICE         4
  ------------------
 1197|  2.29k|        u1_mb_threshold = 23;
 1198|  2.29k|    }
 1199|       |
 1200|       |    /******************************************************/
 1201|       |    /* Slice Level Initialisations                        */
 1202|       |    /******************************************************/
 1203|  4.71k|    i2_cur_mb_addr = u2_first_mb_in_slice;
 1204|  4.71k|    ps_dec->u1_qp = ps_slice->u1_slice_qp;
 1205|  4.71k|    ih264d_update_qp(ps_dec, 0);
 1206|  4.71k|    u1_mb_idx = ps_dec->u4_mb_idx;
 1207|  4.71k|    u1_num_mbs = u1_mb_idx;
 1208|  4.71k|    u1_num_mbsNby2 = 0;
 1209|  4.71k|    u1_mbaff = ps_slice->u1_mbaff_frame_flag;
 1210|  4.71k|    i2_cur_mb_addr = u2_first_mb_in_slice << u1_mbaff;
 1211|  4.71k|    uc_more_data_flag = 1;
 1212|       |
 1213|       |    /* Initialisations specific to cabac */
 1214|  4.71k|    if(ps_bitstrm->u4_ofst & 0x07)
  ------------------
  |  Branch (1214:8): [True: 4.00k, False: 716]
  ------------------
 1215|  4.00k|    {
 1216|  4.00k|        ps_bitstrm->u4_ofst += 8;
 1217|  4.00k|        ps_bitstrm->u4_ofst &= 0xFFFFFFF8;
 1218|  4.00k|    }
 1219|       |
 1220|  4.71k|    ret = ih264d_init_cabac_dec_envirnoment(&(ps_dec->s_cab_dec_env), ps_bitstrm);
 1221|  4.71k|    if(ret != OK) return ret;
  ------------------
  |  |  114|  4.71k|#define OK        0
  ------------------
  |  Branch (1221:8): [True: 121, False: 4.59k]
  ------------------
 1222|       |
 1223|  4.59k|    ps_cab_env = &ps_dec->s_cab_dec_env;
 1224|  4.59k|    ps_dec->i1_prev_mb_qp_delta = 0;
 1225|       |
 1226|  76.5k|    while(!u1_slice_end)
  ------------------
  |  Branch (1226:11): [True: 75.9k, False: 644]
  ------------------
 1227|  75.9k|    {
 1228|  75.9k|        UWORD8 u1_mb_type;
 1229|  75.9k|        UWORD32 u4_mb_skip;
 1230|  75.9k|        ps_dec->pv_prev_mb_parse_tu_coeff_data = ps_dec->pv_parse_tu_coeff_data;
 1231|  75.9k|        if(i2_cur_mb_addr > ps_dec->ps_cur_sps->u4_max_mb_addr)
  ------------------
  |  Branch (1231:12): [True: 791, False: 75.1k]
  ------------------
 1232|    791|        {
 1233|    791|            break;
 1234|    791|        }
 1235|       |
 1236|  75.1k|        ps_cur_mb_info = ps_dec->ps_nmb_info + u1_num_mbs;
 1237|  75.1k|        ps_svc_cur_mb_info = ps_svc_lyr_dec->ps_svc_nmb_info + u1_num_mbs;
 1238|  75.1k|        ps_dec->u4_num_mbs_cur_nmb = u1_num_mbs;
 1239|  75.1k|        ps_cur_mb_info->u1_Mux = 0;
 1240|  75.1k|        ps_dec->u4_num_pmbair = (u1_num_mbs >> u1_mbaff);
 1241|  75.1k|        ps_cur_deblk_mb = ps_dec->ps_deblk_mbn + u1_num_mbs;
 1242|  75.1k|        ps_cur_mb_info->u1_end_of_slice = 0;
 1243|       |
 1244|       |        /* Storing Default partition info */
 1245|  75.1k|        ps_parse_mb_data->u1_num_part = 1;
 1246|  75.1k|        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|  75.1k|        u4_mb_skip = ps_dec->pf_get_mb_info(ps_dec, i2_cur_mb_addr, ps_cur_mb_info, 1);
 1253|  75.1k|        ps_svc_cur_mb_info->u1_crop_window_flag =
 1254|  75.1k|            *(ps_svc_lyr_dec->pu1_crop_wnd_flag + ps_cur_mb_info->u2_mbx +
 1255|  75.1k|              (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|  75.1k|        ps_cur_mb_info->u1_tran_form8x8 = 0;
 1260|  75.1k|        ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = 0;
 1261|       |
 1262|       |        /***************************************************************/
 1263|       |        /* Set the deblocking parameters for this MB                   */
 1264|       |        /***************************************************************/
 1265|  75.1k|        if(ps_dec->u4_app_disable_deblk_frm == 0)
  ------------------
  |  Branch (1265:12): [True: 75.1k, False: 0]
  ------------------
 1266|  75.1k|            ih264d_set_deblocking_parameters(ps_cur_deblk_mb, ps_slice,
 1267|  75.1k|                                             ps_dec->u1_mb_ngbr_availablity,
 1268|  75.1k|                                             ps_dec->u1_cur_mb_fld_dec_flag);
 1269|       |
 1270|  75.1k|        if(u4_mb_skip)
  ------------------
  |  Branch (1270:12): [True: 23.3k, False: 51.7k]
  ------------------
 1271|  23.3k|        {
 1272|       |            /* Set appropriate flags in ps_cur_mb_info and ps_dec */
 1273|  23.3k|            memset(ps_dec->ps_curr_ctxt_mb_info, 0, sizeof(ctxt_inc_mb_info_t));
 1274|  23.3k|            ps_dec->ps_curr_ctxt_mb_info->u1_mb_type = u1_inter_mb_skip_type;
 1275|       |
 1276|  23.3k|            MEMSET_16BYTES(&ps_dec->pu1_left_mv_ctxt_inc[0][0], 0);
  ------------------
  |  |  652|  23.3k|#define MEMSET_16BYTES(pu4_start,value)                         \
  |  |  653|  23.3k|{                                                               \
  |  |  654|  23.3k|    memset(pu4_start,value,16);                                 \
  |  |  655|  23.3k|}
  ------------------
 1277|       |
 1278|  23.3k|            *((UWORD32 *) ps_dec->pi1_left_ref_idx_ctxt_inc) = 0;
 1279|  23.3k|            *(ps_dec->pu1_left_yuv_dc_csbp) = 0;
 1280|       |
 1281|  23.3k|            ps_dec->i1_prev_mb_qp_delta = 0;
 1282|  23.3k|            ps_cur_mb_info->u1_mb_type = MB_SKIP;
  ------------------
  |  |   59|  23.3k|#define MB_SKIP 255
  ------------------
 1283|  23.3k|            ps_cur_mb_info->u1_cbp = 0;
 1284|  23.3k|            ps_svc_cur_mb_info->u1_base_mode_flag = 0;
 1285|  23.3k|            ps_svc_cur_mb_info->au1_motion_pred_flag[0] = 0;
 1286|  23.3k|            ps_svc_cur_mb_info->au1_motion_pred_flag[1] = 0;
 1287|  23.3k|            ps_svc_cur_mb_info->u1_residual_prediction_flag = 0;
 1288|       |
 1289|  23.3k|            {
 1290|       |                /* Storing Skip partition info */
 1291|  23.3k|                parse_part_params_t *ps_part_info = ps_dec->ps_part;
 1292|  23.3k|                ps_part_info->u1_is_direct = PART_DIRECT_16x16;
  ------------------
  |  |  572|  23.3k|#define PART_DIRECT_16x16              2
  ------------------
 1293|  23.3k|                ps_part_info->u1_sub_mb_num = 0;
 1294|  23.3k|                ps_dec->ps_part++;
 1295|  23.3k|            }
 1296|       |
 1297|       |            /* Update Nnzs */
 1298|  23.3k|            ih264d_update_nnz_for_skipmb(ps_dec, ps_cur_mb_info, CABAC);
  ------------------
  |  |  339|  23.3k|#define CABAC  1
  ------------------
 1299|  23.3k|            ps_cur_mb_info->ps_curmb->u1_mb_type = u1_inter_mb_type;
 1300|  23.3k|            ps_cur_deblk_mb->u1_mb_type |= u1_deblk_mb_type;
 1301|  23.3k|            ps_cur_deblk_mb->u1_mb_qp = ps_dec->u1_qp;
 1302|  23.3k|            if(ps_svc_lyr_dec->u1_layer_identifier != TARGET_LAYER)
  ------------------
  |  |  110|  23.3k|#define TARGET_LAYER 2
  ------------------
  |  Branch (1302:16): [True: 0, False: 23.3k]
  ------------------
 1303|      0|            {
 1304|      0|                ps_cur_deblk_mb->u1_deblocking_mode = MB_DISABLE_FILTERING;
  ------------------
  |  |   70|      0|#define MB_DISABLE_FILTERING          0x01
  ------------------
 1305|      0|            }
 1306|  23.3k|        }
 1307|  51.7k|        else
 1308|  51.7k|        {
 1309|       |            /* Variables for handling Cabac contexts */
 1310|  51.7k|            UWORD8 *pu1_cur_svc_base_mode_flag;
 1311|  51.7k|            UWORD8 u1_left_svc_base_mode_flag;
 1312|  51.7k|            UWORD8 u1_top_svc_base_mode_flag;
 1313|       |
 1314|  51.7k|            UWORD32 u4_a, u4_b, u4_ctxt_inc;
 1315|  51.7k|            ps_svc_cur_mb_info->u1_base_mode_flag = 0;
 1316|       |            /* Macroblock Layer Begins */
 1317|  51.7k|            if(ps_svc_cur_mb_info->u1_crop_window_flag &&
  ------------------
  |  Branch (1317:16): [True: 51.3k, False: 421]
  ------------------
 1318|  51.3k|               ps_svc_slice_params->u1_adaptive_base_mode_flag)
  ------------------
  |  Branch (1318:16): [True: 10.6k, False: 40.7k]
  ------------------
 1319|  10.6k|            {
 1320|  10.6k|                pu1_cur_svc_base_mode_flag =
 1321|  10.6k|                    ps_svc_lyr_dec->pu1_svc_base_mode_flag + ps_cur_mb_info->u2_mbx;
 1322|  10.6k|                pu1_cur_svc_base_mode_flag +=
 1323|  10.6k|                    ps_cur_mb_info->u2_mby * ps_svc_lyr_dec->i4_frm_svc_base_mode_cabac_stride;
 1324|       |
 1325|  10.6k|                u1_left_svc_base_mode_flag = 0;
 1326|  10.6k|                if(ps_dec->u1_mb_ngbr_availablity & LEFT_MB_AVAILABLE_MASK)
  ------------------
  |  |   53|  10.6k|#define LEFT_MB_AVAILABLE_MASK      0x01
  ------------------
  |  Branch (1326:20): [True: 8.13k, False: 2.51k]
  ------------------
 1327|  8.13k|                    u1_left_svc_base_mode_flag = *(pu1_cur_svc_base_mode_flag - 1);
 1328|       |
 1329|  10.6k|                u1_top_svc_base_mode_flag = 0;
 1330|  10.6k|                if(ps_dec->u1_mb_ngbr_availablity & TOP_MB_AVAILABLE_MASK)
  ------------------
  |  |   55|  10.6k|#define TOP_MB_AVAILABLE_MASK       0x04
  ------------------
  |  Branch (1330:20): [True: 9.00k, False: 1.64k]
  ------------------
 1331|  9.00k|                    u1_top_svc_base_mode_flag =
 1332|  9.00k|                        *(pu1_cur_svc_base_mode_flag -
 1333|  9.00k|                          ps_svc_lyr_dec->i4_frm_svc_base_mode_cabac_stride);
 1334|       |
 1335|  10.6k|                u4_a = 1;
 1336|  10.6k|                u4_b = 1;
 1337|       |
 1338|  10.6k|                if(u1_top_svc_base_mode_flag)
  ------------------
  |  Branch (1338:20): [True: 3.21k, False: 7.43k]
  ------------------
 1339|  3.21k|                {
 1340|  3.21k|                    u4_a = 0;
 1341|  3.21k|                }
 1342|       |
 1343|  10.6k|                if(u1_left_svc_base_mode_flag)
  ------------------
  |  Branch (1343:20): [True: 2.92k, False: 7.72k]
  ------------------
 1344|  2.92k|                {
 1345|  2.92k|                    u4_b = 0;
 1346|  2.92k|                }
 1347|       |
 1348|  10.6k|                u4_ctxt_inc = u4_a + u4_b;
 1349|  10.6k|                ps_svc_cur_mb_info->u1_base_mode_flag = ih264d_decode_bin(
 1350|  10.6k|                    u4_ctxt_inc, ps_svc_lyr_dec->ps_base_mode_flag, ps_bitstrm, ps_cab_env);
 1351|  10.6k|                COPYTHECONTEXT("SVC ext: u1_base_mode_flag", ps_svc_cur_mb_info->u1_base_mode_flag);
 1352|  10.6k|                *pu1_cur_svc_base_mode_flag = ps_svc_cur_mb_info->u1_base_mode_flag;
 1353|  10.6k|            }
 1354|  41.1k|            else if(ps_svc_cur_mb_info->u1_crop_window_flag)
  ------------------
  |  Branch (1354:21): [True: 40.7k, False: 421]
  ------------------
 1355|  40.7k|            {
 1356|  40.7k|                ps_svc_cur_mb_info->u1_base_mode_flag =
 1357|  40.7k|                    ps_svc_slice_params->u1_default_base_mode_flag;
 1358|  40.7k|            }
 1359|       |
 1360|  51.7k|            if(!ps_svc_cur_mb_info->u1_base_mode_flag)
  ------------------
  |  Branch (1360:16): [True: 30.6k, False: 21.0k]
  ------------------
 1361|  30.6k|            {
 1362|       |                /* Decode the u1_mb_type */
 1363|  30.6k|                u1_mb_type = ih264d_parse_mb_type_cabac(ps_dec);
 1364|  30.6k|                ps_cur_mb_info->u1_mb_type = u1_mb_type;
 1365|  30.6k|                if(u1_mb_type > (25 + u1_mb_threshold)) return ERROR_MB_TYPE;
  ------------------
  |  Branch (1365:20): [True: 0, False: 30.6k]
  ------------------
 1366|  30.6k|                COPYTHECONTEXT("u1_mb_type", u1_mb_type);
 1367|  30.6k|            }
 1368|  21.0k|            else
 1369|  21.0k|            {
 1370|       |                // default intialization for Base mode flag : reserved
 1371|  21.0k|                ps_dec->ps_part += MAX_NUM_MB_PART;
  ------------------
  |  |   62|  21.0k|#define MAX_NUM_MB_PART NUM_MB_PARTS *NUM_SUB_MB_PARTS
  |  |  ------------------
  |  |  |  |   59|  21.0k|#define NUM_MB_PARTS 4
  |  |  ------------------
  |  |               #define MAX_NUM_MB_PART NUM_MB_PARTS *NUM_SUB_MB_PARTS
  |  |  ------------------
  |  |  |  |   60|  21.0k|#define NUM_SUB_MB_PARTS 4
  |  |  ------------------
  ------------------
 1372|       |
 1373|  21.0k|                ps_svc_cur_mb_info->au1_motion_pred_flag[0] = 0;
 1374|  21.0k|                ps_svc_cur_mb_info->au1_motion_pred_flag[1] = 0;
 1375|  21.0k|                ps_cur_mb_info->u1_mb_type = MB_INFER;
  ------------------
  |  |  112|  21.0k|#define MB_INFER 250
  ------------------
 1376|  21.0k|                ps_cur_deblk_mb->u1_mb_type |= u1_deblk_mb_type;
 1377|  21.0k|                if(ps_svc_lyr_dec->u1_layer_identifier != TARGET_LAYER)
  ------------------
  |  |  110|  21.0k|#define TARGET_LAYER 2
  ------------------
  |  Branch (1377:20): [True: 0, False: 21.0k]
  ------------------
 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|  21.0k|                if(ps_svc_slice_params->u1_adaptive_residual_prediction_flag &&
  ------------------
  |  Branch (1383:20): [True: 16.5k, False: 4.54k]
  ------------------
 1384|  16.5k|                   ps_svc_cur_mb_info->u1_crop_window_flag)
  ------------------
  |  Branch (1384:20): [True: 16.5k, False: 0]
  ------------------
 1385|  16.5k|                {
 1386|  16.5k|                    ps_svc_cur_mb_info->u1_residual_prediction_flag = ih264d_decode_bin(
 1387|  16.5k|                        0, ps_svc_lyr_dec->ps_residual_prediction_flag, ps_bitstrm, ps_cab_env);
 1388|  16.5k|                    COPYTHECONTEXT("SVC ext: u1_residual_prediction_flag",
 1389|  16.5k|                                   ps_svc_cur_mb_info->u1_residual_prediction_flag);
 1390|  16.5k|                }
 1391|  4.54k|                else
 1392|  4.54k|                {
 1393|       |                    /*residual flag inference code */
 1394|  4.54k|                    if(1 == ps_svc_cur_mb_info->u1_crop_window_flag)
  ------------------
  |  Branch (1394:24): [True: 4.54k, False: 0]
  ------------------
 1395|  4.54k|                    {
 1396|  4.54k|                        ps_svc_cur_mb_info->u1_residual_prediction_flag =
 1397|  4.54k|                            ps_svc_slice_params->u1_default_residual_prediction_flag;
 1398|  4.54k|                    }
 1399|      0|                    else
 1400|      0|                    {
 1401|      0|                        ps_svc_cur_mb_info->u1_residual_prediction_flag = 0;
 1402|      0|                    }
 1403|  4.54k|                }
 1404|  21.0k|            }
 1405|       |
 1406|       |            /* Parse Macroblock Data */
 1407|  51.7k|            u1_mb_type = ps_cur_mb_info->u1_mb_type;
 1408|  51.7k|            if(u1_mb_type < u1_mb_threshold)
  ------------------
  |  Branch (1408:16): [True: 28.3k, False: 23.4k]
  ------------------
 1409|  28.3k|            {
 1410|  28.3k|                ps_cur_mb_info->ps_curmb->u1_mb_type = u1_inter_mb_type;
 1411|  28.3k|                *(ps_dec->pu1_left_yuv_dc_csbp) &= 0x6;
 1412|       |
 1413|  28.3k|                ret = ps_svc_lyr_dec->pf_parse_inter_mb_svc_ext(
 1414|  28.3k|                    ps_svc_lyr_dec, ps_cur_mb_info, ps_svc_cur_mb_info, u1_num_mbs, u1_num_mbsNby2);
 1415|  28.3k|                if(ret != OK) return ret;
  ------------------
  |  |  114|  28.3k|#define OK        0
  ------------------
  |  Branch (1415:20): [True: 1.96k, False: 26.3k]
  ------------------
 1416|  26.3k|                ps_cur_deblk_mb->u1_mb_qp = ps_dec->u1_qp;
 1417|  26.3k|                ps_cur_deblk_mb->u1_mb_type |= u1_deblk_mb_type;
 1418|  26.3k|                if(ps_svc_lyr_dec->u1_layer_identifier != TARGET_LAYER)
  ------------------
  |  |  110|  26.3k|#define TARGET_LAYER 2
  ------------------
  |  Branch (1418:20): [True: 0, False: 26.3k]
  ------------------
 1419|      0|                {
 1420|      0|                    ps_cur_deblk_mb->u1_deblocking_mode = MB_DISABLE_FILTERING;
  ------------------
  |  |   70|      0|#define MB_DISABLE_FILTERING          0x01
  ------------------
 1421|      0|                }
 1422|  26.3k|            }
 1423|  23.4k|            else
 1424|  23.4k|            {
 1425|       |                /* Storing Intra partition info */
 1426|  23.4k|                ps_parse_mb_data->u1_num_part = 0;
 1427|  23.4k|                ps_parse_mb_data->u4_isI_mb = 1;
 1428|       |
 1429|  23.4k|                if((25 + u1_mb_threshold) == u1_mb_type)
  ------------------
  |  Branch (1429:20): [True: 354, False: 23.0k]
  ------------------
 1430|    354|                {
 1431|       |                    /* I_PCM_MB */
 1432|    354|                    ps_cur_mb_info->ps_curmb->u1_mb_type = I_PCM_MB;
  ------------------
  |  |  423|    354|#define I_PCM_MB    6
  ------------------
 1433|    354|                    ret = ih264d_parse_ipcm_mb(ps_dec, ps_cur_mb_info, u1_num_mbs);
 1434|    354|                    if(ret != OK) return ret;
  ------------------
  |  |  114|    354|#define OK        0
  ------------------
  |  Branch (1434:24): [True: 287, False: 67]
  ------------------
 1435|     67|                    ps_cur_deblk_mb->u1_mb_qp = 0;
 1436|     67|                    ps_cur_deblk_mb->u1_mb_type |= D_INTRA_MB;
  ------------------
  |  |  382|     67|#define D_INTRA_MB        1
  ------------------
 1437|     67|                }
 1438|  23.0k|                else
 1439|  23.0k|                {
 1440|  23.0k|                    if(u1_mb_type == u1_mb_threshold)
  ------------------
  |  Branch (1440:24): [True: 1.10k, False: 21.9k]
  ------------------
 1441|  1.10k|                        ps_cur_mb_info->ps_curmb->u1_mb_type = I_4x4_MB;
  ------------------
  |  |  417|  1.10k|#define I_4x4_MB    0
  ------------------
 1442|  21.9k|                    else
 1443|  21.9k|                        ps_cur_mb_info->ps_curmb->u1_mb_type = I_16x16_MB;
  ------------------
  |  |  418|  21.9k|#define I_16x16_MB  1
  ------------------
 1444|       |
 1445|  23.0k|                    ret = isvcd_parse_imb_cabac(ps_svc_lyr_dec, ps_cur_mb_info, ps_svc_cur_mb_info,
 1446|  23.0k|                                                (UWORD8) (u1_mb_type - u1_mb_threshold));
 1447|  23.0k|                    if(ret != OK) return ret;
  ------------------
  |  |  114|  23.0k|#define OK        0
  ------------------
  |  Branch (1447:24): [True: 841, False: 22.2k]
  ------------------
 1448|  22.2k|                    ps_cur_deblk_mb->u1_mb_qp = ps_dec->u1_qp;
 1449|  22.2k|                    if(0 == ps_svc_cur_mb_info->u1_base_mode_flag)
  ------------------
  |  Branch (1449:24): [True: 1.91k, False: 20.3k]
  ------------------
 1450|  1.91k|                    {
 1451|  1.91k|                        ps_cur_deblk_mb->u1_mb_type |= D_INTRA_MB;
  ------------------
  |  |  382|  1.91k|#define D_INTRA_MB        1
  ------------------
 1452|  1.91k|                    }
 1453|  22.2k|                }
 1454|  22.3k|                ps_parse_mb_data->u4_isI_mb = !ps_svc_cur_mb_info->u1_base_mode_flag;
 1455|  22.3k|            }
 1456|  51.7k|        }
 1457|       |
 1458|  72.0k|        if(ps_dec->u1_enable_mb_info)
  ------------------
  |  Branch (1458:12): [True: 0, False: 72.0k]
  ------------------
 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|  72.0k|        if(u1_mbaff)
  ------------------
  |  Branch (1463:12): [True: 0, False: 72.0k]
  ------------------
 1464|      0|        {
 1465|      0|            ih264d_update_mbaff_left_nnz(ps_dec, ps_cur_mb_info);
 1466|      0|        }
 1467|       |
 1468|  72.0k|        if(ps_cur_mb_info->u1_topmb && u1_mbaff)
  ------------------
  |  Branch (1468:12): [True: 72.0k, False: 0]
  |  Branch (1468:40): [True: 0, False: 72.0k]
  ------------------
 1469|      0|            uc_more_data_flag = 1;
 1470|  72.0k|        else
 1471|  72.0k|        {
 1472|  72.0k|            uc_more_data_flag = ih264d_decode_terminate(&ps_dec->s_cab_dec_env, ps_bitstrm);
 1473|  72.0k|            uc_more_data_flag = !uc_more_data_flag;
 1474|  72.0k|            COPYTHECONTEXT("Decode Sliceterm", !uc_more_data_flag);
 1475|  72.0k|        }
 1476|       |
 1477|  72.0k|        if(u1_mbaff)
  ------------------
  |  Branch (1477:12): [True: 0, False: 72.0k]
  ------------------
 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|  72.0k|        i2_cur_mb_addr++;
 1486|  72.0k|        u1_num_mbs++;
 1487|  72.0k|        u1_num_mbsNby2++;
 1488|  72.0k|        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|  72.0k|        u1_num_mbs_next = i2_pic_wdin_mbs - ps_dec->u2_mbx - 1;
 1496|  72.0k|        u1_end_of_row = (!u1_num_mbs_next) && (!(u1_mbaff && (u1_num_mbs & 0x01)));
  ------------------
  |  Branch (1496:25): [True: 16.9k, False: 55.1k]
  |  Branch (1496:50): [True: 0, False: 16.9k]
  |  Branch (1496:62): [True: 0, False: 0]
  ------------------
 1497|  72.0k|        u1_slice_end = !uc_more_data_flag;
 1498|  72.0k|        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.6k, False: 55.3k]
  |  Branch (1498:66): [True: 260, False: 55.1k]
  |  Branch (1498:83): [True: 626, False: 54.5k]
  ------------------
 1499|  72.0k|        u1_decode_nmb = u1_tfr_n_mb || u1_slice_end;
  ------------------
  |  Branch (1499:25): [True: 17.5k, False: 54.5k]
  |  Branch (1499:40): [True: 0, False: 54.5k]
  ------------------
 1500|  72.0k|        ps_cur_mb_info->u1_end_of_slice = u1_slice_end;
 1501|       |
 1502|  72.0k|        if(u1_decode_nmb)
  ------------------
  |  Branch (1502:12): [True: 17.5k, False: 54.5k]
  ------------------
 1503|  17.5k|        {
 1504|  17.5k|            ret = ps_dec->pf_mvpred_ref_tfr_nby2mb(ps_dec, u1_mb_idx, u1_num_mbs);
 1505|  17.5k|            u1_num_mbsNby2 = 0;
 1506|  17.5k|            ps_parse_mb_data = ps_dec->ps_parse_mb_data;
 1507|  17.5k|            ps_dec->ps_part = ps_dec->ps_parse_part_params;
 1508|  17.5k|            if(ret != OK) return ret;
  ------------------
  |  |  114|  17.5k|#define OK        0
  ------------------
  |  Branch (1508:16): [True: 73, False: 17.4k]
  ------------------
 1509|  17.5k|        }
 1510|       |
 1511|  71.9k|        if(u1_decode_nmb)
  ------------------
  |  Branch (1511:12): [True: 17.4k, False: 54.5k]
  ------------------
 1512|  17.4k|        {
 1513|  17.4k|            if(ps_dec->u1_separate_parse)
  ------------------
  |  Branch (1513:16): [True: 10.5k, False: 6.95k]
  ------------------
 1514|  10.5k|            {
 1515|  10.5k|                ih264d_parse_tfr_nmb(ps_dec, u1_mb_idx, u1_num_mbs, u1_num_mbs_next, u1_tfr_n_mb,
 1516|  10.5k|                                     u1_end_of_row);
 1517|  10.5k|                ps_dec->ps_nmb_info += u1_num_mbs;
 1518|  10.5k|                ps_svc_lyr_dec->ps_svc_nmb_info += u1_num_mbs;
 1519|  10.5k|            }
 1520|  6.95k|            else
 1521|  6.95k|            {
 1522|  6.95k|                ret = isvcd_decode_recon_tfr_nmb_non_base_lyr(ps_svc_lyr_dec, u1_mb_idx, u1_num_mbs,
 1523|  6.95k|                                                              u1_num_mbs_next, u1_tfr_n_mb,
 1524|  6.95k|                                                              u1_end_of_row);
 1525|  6.95k|                if(ret != OK) return ret;
  ------------------
  |  |  114|  6.95k|#define OK        0
  ------------------
  |  Branch (1525:20): [True: 0, False: 6.95k]
  ------------------
 1526|  6.95k|            }
 1527|  17.4k|            ps_dec->u4_total_mbs_coded += u1_num_mbs;
 1528|  17.4k|            if(u1_tfr_n_mb) u1_num_mbs = 0;
  ------------------
  |  Branch (1528:16): [True: 17.4k, False: 0]
  ------------------
 1529|  17.4k|            u1_mb_idx = u1_num_mbs;
 1530|  17.4k|            ps_dec->u4_mb_idx = u1_num_mbs;
 1531|  17.4k|        }
 1532|  71.9k|    }
 1533|       |
 1534|  1.43k|    ps_dec->u4_num_mbs_cur_nmb = 0;
 1535|  1.43k|    ps_dec->ps_cur_slice->u4_mbs_in_slice = i2_cur_mb_addr - (u2_first_mb_in_slice << u1_mbaff);
 1536|       |
 1537|  1.43k|    return ret;
 1538|  4.59k|}
isvcd_parse_inter_slice_data_cavlc_enh_lyr:
 1569|  14.5k|{
 1570|  14.5k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
 1571|  14.5k|    UWORD32 uc_more_data_flag;
 1572|  14.5k|    WORD32 i2_cur_mb_addr;
 1573|  14.5k|    UWORD32 u1_num_mbs, u1_num_mbsNby2, u1_mb_idx;
 1574|  14.5k|    UWORD32 i2_mb_skip_run;
 1575|  14.5k|    UWORD32 u1_read_mb_type;
 1576|       |
 1577|  14.5k|    UWORD32 u1_mbaff;
 1578|  14.5k|    UWORD32 u1_num_mbs_next, u1_end_of_row;
 1579|  14.5k|    const UWORD32 i2_pic_wdin_mbs = ps_dec->u2_frm_wd_in_mbs;
 1580|  14.5k|    UWORD32 u1_slice_end = 0;
 1581|  14.5k|    UWORD32 u1_tfr_n_mb = 0;
 1582|  14.5k|    UWORD32 u1_decode_nmb = 0;
 1583|       |
 1584|  14.5k|    dec_bit_stream_t *const ps_bitstrm = ps_dec->ps_bitstrm;
 1585|  14.5k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
 1586|  14.5k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
 1587|       |
 1588|  14.5k|    dec_slice_svc_ext_params_t *ps_svc_slice_params = NULL;
 1589|       |
 1590|  14.5k|    deblk_mb_t *ps_cur_deblk_mb;
 1591|  14.5k|    dec_mb_info_t *ps_cur_mb_info;
 1592|  14.5k|    dec_svc_mb_info_t *ps_svc_cur_mb_info;
 1593|       |
 1594|  14.5k|    parse_pmbarams_t *ps_parse_mb_data = ps_dec->ps_parse_mb_data;
 1595|  14.5k|    UWORD32 u1_inter_mb_type;
 1596|  14.5k|    UWORD32 u1_deblk_mb_type;
 1597|  14.5k|    UWORD32 u1_mb_threshold;
 1598|  14.5k|    WORD32 ret = OK;
  ------------------
  |  |  114|  14.5k|#define OK        0
  ------------------
 1599|       |
 1600|  14.5k|    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|  14.5k|    if(ps_slice->u1_slice_type == P_SLICE)
  ------------------
  |  |  368|  14.5k|#define P_SLICE  0
  ------------------
  |  Branch (1606:8): [True: 9.06k, False: 5.49k]
  ------------------
 1607|  9.06k|    {
 1608|  9.06k|        u1_inter_mb_type = P_MB;
  ------------------
  |  |  419|  9.06k|#define P_MB        2
  ------------------
 1609|  9.06k|        u1_deblk_mb_type = D_INTER_MB;
  ------------------
  |  |  381|  9.06k|#define D_INTER_MB        0
  ------------------
 1610|  9.06k|        u1_mb_threshold = 5;
 1611|  9.06k|    }
 1612|  5.49k|    else
 1613|  5.49k|    {
 1614|  5.49k|        u1_inter_mb_type = B_MB;
  ------------------
  |  |  420|  5.49k|#define B_MB        3
  ------------------
 1615|  5.49k|        u1_deblk_mb_type = D_B_SLICE;
  ------------------
  |  |  384|  5.49k|#define D_B_SLICE         4
  ------------------
 1616|  5.49k|        u1_mb_threshold = 23;
 1617|  5.49k|    }
 1618|       |
 1619|       |    /******************************************************/
 1620|       |    /* Slice Level Initialisations                        */
 1621|       |    /******************************************************/
 1622|  14.5k|    ps_dec->u1_qp = ps_slice->u1_slice_qp;
 1623|  14.5k|    ih264d_update_qp(ps_dec, 0);
 1624|  14.5k|    u1_mb_idx = ps_dec->u4_mb_idx;
 1625|  14.5k|    u1_num_mbs = u1_mb_idx;
 1626|  14.5k|    u1_num_mbsNby2 = 0;
 1627|  14.5k|    u1_mbaff = ps_slice->u1_mbaff_frame_flag;
 1628|  14.5k|    i2_cur_mb_addr = u2_first_mb_in_slice << u1_mbaff;
 1629|  14.5k|    i2_mb_skip_run = 0;
 1630|  14.5k|    uc_more_data_flag = 1;
 1631|  14.5k|    u1_read_mb_type = 0;
 1632|       |
 1633|   298k|    while(!u1_slice_end)
  ------------------
  |  Branch (1633:11): [True: 295k, False: 3.37k]
  ------------------
 1634|   295k|    {
 1635|   295k|        UWORD8 u1_mb_type;
 1636|       |
 1637|   295k|        ps_dec->pv_prev_mb_parse_tu_coeff_data = ps_dec->pv_parse_tu_coeff_data;
 1638|       |
 1639|   295k|        if(i2_cur_mb_addr > ps_dec->ps_cur_sps->u4_max_mb_addr)
  ------------------
  |  Branch (1639:12): [True: 5.15k, False: 289k]
  ------------------
 1640|  5.15k|        {
 1641|  5.15k|            break;
 1642|  5.15k|        }
 1643|       |
 1644|   289k|        ps_cur_mb_info = ps_dec->ps_nmb_info + u1_num_mbs;
 1645|   289k|        ps_svc_cur_mb_info = ps_svc_lyr_dec->ps_svc_nmb_info + u1_num_mbs;
 1646|   289k|        ps_dec->u4_num_mbs_cur_nmb = u1_num_mbs;
 1647|       |
 1648|   289k|        ps_cur_mb_info->u1_Mux = 0;
 1649|   289k|        ps_dec->u4_num_pmbair = (u1_num_mbs >> u1_mbaff);
 1650|   289k|        ps_cur_deblk_mb = ps_dec->ps_deblk_mbn + u1_num_mbs;
 1651|       |
 1652|   289k|        ps_cur_mb_info->u1_end_of_slice = 0;
 1653|       |
 1654|       |        /* Storing Default partition info */
 1655|   289k|        ps_parse_mb_data->u1_num_part = 1;
 1656|   289k|        ps_parse_mb_data->u4_isI_mb = 0;
 1657|       |
 1658|   289k|        if((!i2_mb_skip_run) && (!u1_read_mb_type))
  ------------------
  |  Branch (1658:12): [True: 214k, False: 75.4k]
  |  Branch (1658:33): [True: 195k, False: 18.9k]
  ------------------
 1659|   195k|        {
 1660|   195k|            UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
 1661|   195k|            UWORD32 u4_word, u4_ldz;
 1662|       |
 1663|       |            /***************************************************************/
 1664|       |            /* Find leading zeros in next 32 bits                          */
 1665|       |            /***************************************************************/
 1666|   195k|            NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|   195k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|   195k|{                                                                           \
  |  |  152|   195k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|   195k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|   195k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|   195k|                                                                            \
  |  |  156|   195k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|   195k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 189k, False: 6.41k]
  |  |  ------------------
  |  |  158|   195k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|   189k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|   195k|}
  ------------------
 1667|       |
 1668|   195k|            u4_ldz = CLZ(u4_word);
 1669|       |
 1670|       |            /* Flush the ps_bitstrm */
 1671|   195k|            u4_bitstream_offset += (u4_ldz + 1);
 1672|       |            /* Read the suffix from the ps_bitstrm */
 1673|   195k|            u4_word = 0;
 1674|   195k|            if(u4_ldz)
  ------------------
  |  Branch (1674:16): [True: 22.9k, False: 172k]
  ------------------
 1675|  22.9k|            {
 1676|  22.9k|                GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  22.9k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  22.9k|{                                                                           \
  |  |  122|  22.9k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  22.9k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  22.9k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  22.9k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  22.9k|                                                                            \
  |  |  127|  22.9k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 21.7k, False: 1.23k]
  |  |  ------------------
  |  |  128|  22.9k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  21.7k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  22.9k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  22.9k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  22.9k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  22.9k|}                                                                           \
  ------------------
 1677|  22.9k|            }
 1678|   195k|            *pu4_bitstrm_ofst = u4_bitstream_offset;
 1679|   195k|            i2_mb_skip_run = ((1 << u4_ldz) + u4_word - 1);
 1680|       |
 1681|   195k|            COPYTHECONTEXT("mb_skip_run", i2_mb_skip_run);
 1682|   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)
  |  |  ------------------
  ------------------
 1683|   195k|            u1_read_mb_type = uc_more_data_flag;
 1684|   195k|        }
 1685|       |
 1686|       |        /***************************************************************/
 1687|       |        /* Get the required information for decoding of MB             */
 1688|       |        /* mb_x, mb_y , neighbour availablity,                         */
 1689|       |        /***************************************************************/
 1690|   289k|        ps_dec->pf_get_mb_info(ps_dec, i2_cur_mb_addr, ps_cur_mb_info, i2_mb_skip_run);
 1691|   289k|        ps_svc_cur_mb_info->u1_crop_window_flag =
 1692|   289k|            *(ps_svc_lyr_dec->pu1_crop_wnd_flag + ps_cur_mb_info->u2_mbx +
 1693|   289k|              (ps_cur_mb_info->u2_mby * ps_dec->u2_frm_wd_in_mbs));
 1694|       |        /***************************************************************/
 1695|       |        /* Set the deblocking parameters for this MB                   */
 1696|       |        /***************************************************************/
 1697|   289k|        if(ps_dec->u4_app_disable_deblk_frm == 0)
  ------------------
  |  Branch (1697:12): [True: 289k, False: 0]
  ------------------
 1698|   289k|            ih264d_set_deblocking_parameters(ps_cur_deblk_mb, ps_slice,
 1699|   289k|                                             ps_dec->u1_mb_ngbr_availablity,
 1700|   289k|                                             ps_dec->u1_cur_mb_fld_dec_flag);
 1701|       |
 1702|   289k|        if(i2_mb_skip_run)
  ------------------
  |  Branch (1702:12): [True: 98.4k, False: 191k]
  ------------------
 1703|  98.4k|        {
 1704|       |            /* Set appropriate flags in ps_cur_mb_info and ps_dec */
 1705|  98.4k|            ps_dec->i1_prev_mb_qp_delta = 0;
 1706|  98.4k|            ps_dec->u1_sub_mb_num = 0;
 1707|  98.4k|            ps_cur_mb_info->u1_mb_type = MB_SKIP;
  ------------------
  |  |   59|  98.4k|#define MB_SKIP 255
  ------------------
 1708|  98.4k|            ps_cur_mb_info->u1_mb_mc_mode = PRED_16x16;
  ------------------
  |  |  450|  98.4k|#define PRED_16x16  0
  ------------------
 1709|  98.4k|            ps_cur_mb_info->u1_cbp = 0;
 1710|  98.4k|            ps_svc_cur_mb_info->u1_base_mode_flag = 0;
 1711|  98.4k|            ps_svc_cur_mb_info->au1_motion_pred_flag[0] = 0;
 1712|  98.4k|            ps_svc_cur_mb_info->au1_motion_pred_flag[1] = 0;
 1713|  98.4k|            ps_svc_cur_mb_info->u1_residual_prediction_flag = 0;
 1714|       |
 1715|  98.4k|            {
 1716|       |                /* Storing Skip partition info */
 1717|  98.4k|                parse_part_params_t *ps_part_info = ps_dec->ps_part;
 1718|  98.4k|                ps_part_info->u1_is_direct = PART_DIRECT_16x16;
  ------------------
  |  |  572|  98.4k|#define PART_DIRECT_16x16              2
  ------------------
 1719|  98.4k|                ps_part_info->u1_sub_mb_num = 0;
 1720|  98.4k|                ps_dec->ps_part++;
 1721|  98.4k|            }
 1722|       |
 1723|       |            /* Update Nnzs */
 1724|  98.4k|            ih264d_update_nnz_for_skipmb(ps_dec, ps_cur_mb_info, CAVLC);
  ------------------
  |  |  338|  98.4k|#define CAVLC  0
  ------------------
 1725|       |
 1726|  98.4k|            ps_cur_mb_info->ps_curmb->u1_mb_type = u1_inter_mb_type;
 1727|  98.4k|            ps_cur_deblk_mb->u1_mb_type |= u1_deblk_mb_type;
 1728|       |
 1729|  98.4k|            if(ps_svc_lyr_dec->u1_layer_identifier != TARGET_LAYER)
  ------------------
  |  |  110|  98.4k|#define TARGET_LAYER 2
  ------------------
  |  Branch (1729:16): [True: 0, False: 98.4k]
  ------------------
 1730|      0|            {
 1731|      0|                ps_cur_deblk_mb->u1_deblocking_mode = MB_DISABLE_FILTERING;
  ------------------
  |  |   70|      0|#define MB_DISABLE_FILTERING          0x01
  ------------------
 1732|      0|            }
 1733|  98.4k|            i2_mb_skip_run--;
 1734|  98.4k|        }
 1735|   191k|        else
 1736|   191k|        {
 1737|   191k|            UWORD32 u4_word, u4_ldz, u4_temp;
 1738|       |
 1739|   191k|            ps_svc_cur_mb_info->u1_base_mode_flag = 0;
 1740|   191k|            if(ps_svc_cur_mb_info->u1_crop_window_flag &&
  ------------------
  |  Branch (1740:16): [True: 190k, False: 1.03k]
  ------------------
 1741|   190k|               ps_svc_slice_params->u1_adaptive_base_mode_flag)
  ------------------
  |  Branch (1741:16): [True: 99.2k, False: 91.1k]
  ------------------
 1742|  99.2k|            {
 1743|  99.2k|                ps_svc_cur_mb_info->u1_base_mode_flag = ih264d_get_bit_h264(ps_bitstrm);
 1744|  99.2k|                COPYTHECONTEXT("SVC :u1_base_mode_flag", ps_cur_mb_info->u1_base_mode_flag);
 1745|  99.2k|            }
 1746|  92.1k|            else if(ps_svc_cur_mb_info->u1_crop_window_flag)
  ------------------
  |  Branch (1746:21): [True: 91.1k, False: 1.03k]
  ------------------
 1747|  91.1k|            {
 1748|  91.1k|                ps_svc_cur_mb_info->u1_base_mode_flag =
 1749|  91.1k|                    ps_svc_slice_params->u1_default_base_mode_flag;
 1750|  91.1k|            }
 1751|       |
 1752|   191k|            if(!ps_svc_cur_mb_info->u1_base_mode_flag)
  ------------------
  |  Branch (1752:16): [True: 45.5k, False: 145k]
  ------------------
 1753|  45.5k|            {
 1754|  45.5k|                UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
 1755|       |
 1756|  45.5k|                u1_read_mb_type = 0;
 1757|       |                /**************************************************************/
 1758|       |                /* Macroblock Layer Begins, Decode the u1_mb_type              */
 1759|       |                /**************************************************************/
 1760|  45.5k|                {
 1761|       |                    /***************************************************************/
 1762|       |                    /* Find leading zeros in next 32 bits                          */
 1763|       |                    /***************************************************************/
 1764|  45.5k|                    NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  45.5k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  45.5k|{                                                                           \
  |  |  152|  45.5k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  45.5k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  45.5k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  45.5k|                                                                            \
  |  |  156|  45.5k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  45.5k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 44.4k, False: 1.09k]
  |  |  ------------------
  |  |  158|  45.5k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  44.4k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  45.5k|}
  ------------------
 1765|  45.5k|                    u4_ldz = CLZ(u4_word);
 1766|       |                    /* Flush the ps_bitstrm */
 1767|  45.5k|                    u4_bitstream_offset += (u4_ldz + 1);
 1768|       |                    /* Read the suffix from the ps_bitstrm */
 1769|  45.5k|                    u4_word = 0;
 1770|  45.5k|                    if(u4_ldz) GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  23.9k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  23.9k|{                                                                           \
  |  |  122|  23.9k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  23.9k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  23.9k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  23.9k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  23.9k|                                                                            \
  |  |  127|  23.9k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 22.9k, False: 1.06k]
  |  |  ------------------
  |  |  128|  23.9k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  22.9k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  23.9k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  23.9k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  23.9k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  23.9k|}                                                                           \
  ------------------
  |  Branch (1770:24): [True: 23.9k, False: 21.6k]
  ------------------
 1771|  45.5k|                    *pu4_bitstrm_ofst = u4_bitstream_offset;
 1772|  45.5k|                    u4_temp = ((1 << u4_ldz) + u4_word - 1);
 1773|       |
 1774|  45.5k|                    if(u4_temp > (UWORD32) (25 + u1_mb_threshold)) return ERROR_MB_TYPE;
  ------------------
  |  Branch (1774:24): [True: 369, False: 45.2k]
  ------------------
 1775|  45.2k|                    u1_mb_type = u4_temp;
 1776|  45.2k|                    COPYTHECONTEXT("u1_mb_type", u1_mb_type);
 1777|  45.2k|                }
 1778|      0|                ps_cur_mb_info->u1_mb_type = u1_mb_type;
 1779|  45.2k|            }
 1780|   145k|            else
 1781|   145k|            {
 1782|       |                /* default intialization for Base mode flag : reserved */
 1783|   145k|                ps_dec->ps_part += MAX_NUM_MB_PART;
  ------------------
  |  |   62|   145k|#define MAX_NUM_MB_PART NUM_MB_PARTS *NUM_SUB_MB_PARTS
  |  |  ------------------
  |  |  |  |   59|   145k|#define NUM_MB_PARTS 4
  |  |  ------------------
  |  |               #define MAX_NUM_MB_PART NUM_MB_PARTS *NUM_SUB_MB_PARTS
  |  |  ------------------
  |  |  |  |   60|   145k|#define NUM_SUB_MB_PARTS 4
  |  |  ------------------
  ------------------
 1784|   145k|                u1_read_mb_type = 0;
 1785|   145k|                ps_svc_cur_mb_info->au1_motion_pred_flag[0] = 0;
 1786|   145k|                ps_svc_cur_mb_info->au1_motion_pred_flag[1] = 0;
 1787|   145k|                ps_cur_mb_info->u1_mb_type = MB_INFER;
  ------------------
  |  |  112|   145k|#define MB_INFER 250
  ------------------
 1788|   145k|                ps_cur_deblk_mb->u1_mb_type |= u1_deblk_mb_type;
 1789|   145k|                if(ps_svc_lyr_dec->u1_layer_identifier != TARGET_LAYER)
  ------------------
  |  |  110|   145k|#define TARGET_LAYER 2
  ------------------
  |  Branch (1789:20): [True: 0, False: 145k]
  ------------------
 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|   145k|                if(ps_svc_slice_params->u1_adaptive_residual_prediction_flag &&
  ------------------
  |  Branch (1795:20): [True: 21.5k, False: 124k]
  ------------------
 1796|  21.5k|                   ps_svc_cur_mb_info->u1_crop_window_flag)
  ------------------
  |  Branch (1796:20): [True: 21.5k, False: 0]
  ------------------
 1797|  21.5k|                {
 1798|  21.5k|                    ps_svc_cur_mb_info->u1_residual_prediction_flag =
 1799|  21.5k|                        ih264d_get_bit_h264(ps_bitstrm);
 1800|  21.5k|                    COPYTHECONTEXT("SVC ext: u1_residual_prediction_flag",
 1801|  21.5k|                                   ps_cur_mb_info->u1_residual_prediction_flag);
 1802|  21.5k|                }
 1803|   124k|                else
 1804|   124k|                {
 1805|       |                    /*residual flag inference code */
 1806|   124k|                    if(1 == ps_svc_cur_mb_info->u1_crop_window_flag)
  ------------------
  |  Branch (1806:24): [True: 124k, False: 0]
  ------------------
 1807|   124k|                    {
 1808|   124k|                        ps_svc_cur_mb_info->u1_residual_prediction_flag =
 1809|   124k|                            ps_svc_slice_params->u1_default_residual_prediction_flag;
 1810|   124k|                    }
 1811|      0|                    else
 1812|      0|                    {
 1813|      0|                        ps_svc_cur_mb_info->u1_residual_prediction_flag = 0;
 1814|      0|                    }
 1815|   124k|                }
 1816|   145k|            }
 1817|       |
 1818|       |            /**************************************************************/
 1819|       |            /* Parse Macroblock data                                      */
 1820|       |            /**************************************************************/
 1821|   191k|            u1_mb_type = ps_cur_mb_info->u1_mb_type;
 1822|   191k|            if(u1_mb_type < u1_mb_threshold)
  ------------------
  |  Branch (1822:16): [True: 43.5k, False: 147k]
  ------------------
 1823|  43.5k|            {
 1824|  43.5k|                ps_cur_mb_info->ps_curmb->u1_mb_type = u1_inter_mb_type;
 1825|       |
 1826|  43.5k|                ret = ps_svc_lyr_dec->pf_parse_inter_mb_svc_ext(
 1827|  43.5k|                    ps_svc_lyr_dec, ps_cur_mb_info, ps_svc_cur_mb_info, u1_num_mbs, u1_num_mbsNby2);
 1828|  43.5k|                if(ret != OK) return ret;
  ------------------
  |  |  114|  43.5k|#define OK        0
  ------------------
  |  Branch (1828:20): [True: 3.16k, False: 40.3k]
  ------------------
 1829|  40.3k|                ps_cur_deblk_mb->u1_mb_type |= u1_deblk_mb_type;
 1830|       |
 1831|  40.3k|                if(ps_svc_lyr_dec->u1_layer_identifier != TARGET_LAYER)
  ------------------
  |  |  110|  40.3k|#define TARGET_LAYER 2
  ------------------
  |  Branch (1831:20): [True: 0, False: 40.3k]
  ------------------
 1832|      0|                {
 1833|      0|                    ps_cur_deblk_mb->u1_deblocking_mode = MB_DISABLE_FILTERING;
  ------------------
  |  |   70|      0|#define MB_DISABLE_FILTERING          0x01
  ------------------
 1834|      0|                }
 1835|  40.3k|            }
 1836|   147k|            else
 1837|   147k|            {
 1838|       |                /* Storing Intra partition info */
 1839|   147k|                ps_parse_mb_data->u1_num_part = 0;
 1840|       |
 1841|   147k|                if((25 + u1_mb_threshold) == u1_mb_type)
  ------------------
  |  Branch (1841:20): [True: 94, False: 147k]
  ------------------
 1842|     94|                {
 1843|       |                    /* I_PCM_MB */
 1844|     94|                    ps_cur_mb_info->ps_curmb->u1_mb_type = I_PCM_MB;
  ------------------
  |  |  423|     94|#define I_PCM_MB    6
  ------------------
 1845|     94|                    ret = ih264d_parse_ipcm_mb(ps_dec, ps_cur_mb_info, u1_num_mbs);
 1846|     94|                    if(ret != OK) return ret;
  ------------------
  |  |  114|     94|#define OK        0
  ------------------
  |  Branch (1846:24): [True: 0, False: 94]
  ------------------
 1847|     94|                    ps_dec->u1_qp = 0;
 1848|     94|                    ps_cur_deblk_mb->u1_mb_type |= D_INTRA_MB;
  ------------------
  |  |  382|     94|#define D_INTRA_MB        1
  ------------------
 1849|     94|                }
 1850|   147k|                else
 1851|   147k|                {
 1852|   147k|                    ret =
 1853|   147k|                        isvcd_parse_imb_cavlc(ps_svc_lyr_dec, ps_cur_mb_info, ps_svc_cur_mb_info,
 1854|   147k|                                              u1_num_mbs, (UWORD8) (u1_mb_type - u1_mb_threshold));
 1855|   147k|                    if(ret != OK) return ret;
  ------------------
  |  |  114|   147k|#define OK        0
  ------------------
  |  Branch (1855:24): [True: 2.25k, False: 145k]
  ------------------
 1856|       |
 1857|   145k|                    if(0 == ps_svc_cur_mb_info->u1_base_mode_flag)
  ------------------
  |  Branch (1857:24): [True: 980, False: 144k]
  ------------------
 1858|    980|                    {
 1859|    980|                        ps_cur_deblk_mb->u1_mb_type |= D_INTRA_MB;
  ------------------
  |  |  382|    980|#define D_INTRA_MB        1
  ------------------
 1860|    980|                    }
 1861|   145k|                }
 1862|   145k|                ps_parse_mb_data->u4_isI_mb = !ps_svc_cur_mb_info->u1_base_mode_flag;
 1863|   145k|            }
 1864|   185k|            uc_more_data_flag = MORE_RBSP_DATA(ps_bitstrm);
  ------------------
  |  |   97|   185k|    CHECK_BITS_SUFFICIENT(ps_bitstrm, 1)
  |  |  ------------------
  |  |  |  |   95|   185k|  (ps_bitstrm->u4_ofst + bits_to_read <= ps_bitstrm->u4_max_ofst)
  |  |  ------------------
  ------------------
 1865|   185k|        }
 1866|   284k|        ps_cur_deblk_mb->u1_mb_qp = ps_dec->u1_qp;
 1867|       |
 1868|   284k|        if(ps_dec->u1_enable_mb_info)
  ------------------
  |  Branch (1868:12): [True: 0, False: 284k]
  ------------------
 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|   284k|        if(u1_mbaff)
  ------------------
  |  Branch (1873:12): [True: 0, False: 284k]
  ------------------
 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|   284k|        i2_cur_mb_addr++;
 1885|   284k|        u1_num_mbs++;
 1886|   284k|        u1_num_mbsNby2++;
 1887|   284k|        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|   284k|        u1_num_mbs_next = i2_pic_wdin_mbs - ps_dec->u2_mbx - 1;
 1895|   284k|        u1_end_of_row = (!u1_num_mbs_next) && (!(u1_mbaff && (u1_num_mbs & 0x01)));
  ------------------
  |  Branch (1895:25): [True: 85.5k, False: 198k]
  |  Branch (1895:50): [True: 0, False: 85.5k]
  |  Branch (1895:62): [True: 0, False: 0]
  ------------------
 1896|   284k|        u1_slice_end = (!(uc_more_data_flag || i2_mb_skip_run));
  ------------------
  |  Branch (1896:27): [True: 241k, False: 42.2k]
  |  Branch (1896:48): [True: 38.6k, False: 3.51k]
  ------------------
 1897|   284k|        u1_tfr_n_mb = (u1_num_mbs == ps_dec->u4_recon_mb_grp) || u1_end_of_row || u1_slice_end;
  ------------------
  |  Branch (1897:23): [True: 85.5k, False: 198k]
  |  Branch (1897:66): [True: 70, False: 198k]
  |  Branch (1897:83): [True: 2.68k, False: 195k]
  ------------------
 1898|   284k|        u1_decode_nmb = u1_tfr_n_mb || u1_slice_end;
  ------------------
  |  Branch (1898:25): [True: 88.2k, False: 195k]
  |  Branch (1898:40): [True: 0, False: 195k]
  ------------------
 1899|   284k|        ps_cur_mb_info->u1_end_of_slice = u1_slice_end;
 1900|       |
 1901|   284k|        if(u1_decode_nmb)
  ------------------
  |  Branch (1901:12): [True: 88.2k, False: 195k]
  ------------------
 1902|  88.2k|        {
 1903|  88.2k|            ret = ps_dec->pf_mvpred_ref_tfr_nby2mb(ps_dec, u1_mb_idx, u1_num_mbs);
 1904|  88.2k|            u1_num_mbsNby2 = 0;
 1905|  88.2k|            ps_parse_mb_data = ps_dec->ps_parse_mb_data;
 1906|  88.2k|            ps_dec->ps_part = ps_dec->ps_parse_part_params;
 1907|  88.2k|            if(ret != OK) return ret;
  ------------------
  |  |  114|  88.2k|#define OK        0
  ------------------
  |  Branch (1907:16): [True: 247, False: 88.0k]
  ------------------
 1908|  88.2k|        }
 1909|       |
 1910|   283k|        if(u1_decode_nmb)
  ------------------
  |  Branch (1910:12): [True: 88.0k, False: 195k]
  ------------------
 1911|  88.0k|        {
 1912|  88.0k|            if(ps_dec->u1_separate_parse)
  ------------------
  |  Branch (1912:16): [True: 62.9k, False: 25.0k]
  ------------------
 1913|  62.9k|            {
 1914|  62.9k|                ih264d_parse_tfr_nmb(ps_dec, u1_mb_idx, u1_num_mbs, u1_num_mbs_next, u1_tfr_n_mb,
 1915|  62.9k|                                     u1_end_of_row);
 1916|  62.9k|                ps_dec->ps_nmb_info += u1_num_mbs;
 1917|  62.9k|                ps_svc_lyr_dec->ps_svc_nmb_info += u1_num_mbs;
 1918|  62.9k|            }
 1919|  25.0k|            else
 1920|  25.0k|            {
 1921|  25.0k|                ret = isvcd_decode_recon_tfr_nmb_non_base_lyr(ps_svc_lyr_dec, u1_mb_idx, u1_num_mbs,
 1922|  25.0k|                                                              u1_num_mbs_next, u1_tfr_n_mb,
 1923|  25.0k|                                                              u1_end_of_row);
 1924|  25.0k|                if(ret != OK) return ret;
  ------------------
  |  |  114|  25.0k|#define OK        0
  ------------------
  |  Branch (1924:20): [True: 0, False: 25.0k]
  ------------------
 1925|  25.0k|            }
 1926|  88.0k|            ps_dec->u4_total_mbs_coded += u1_num_mbs;
 1927|  88.0k|            if(u1_tfr_n_mb) u1_num_mbs = 0;
  ------------------
  |  Branch (1927:16): [True: 88.0k, False: 0]
  ------------------
 1928|  88.0k|            u1_mb_idx = u1_num_mbs;
 1929|  88.0k|            ps_dec->u4_mb_idx = u1_num_mbs;
 1930|  88.0k|        }
 1931|   283k|    }
 1932|       |
 1933|  8.52k|    ps_dec->u4_num_mbs_cur_nmb = 0;
 1934|  8.52k|    ps_dec->ps_cur_slice->u4_mbs_in_slice = i2_cur_mb_addr - (u2_first_mb_in_slice << u1_mbaff);
 1935|       |
 1936|  8.52k|    return ret;
 1937|  14.5k|}
isvcd_parse_pmb_cabac:
 1953|  14.5k|{
 1954|  14.5k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
 1955|  14.5k|    dec_slice_svc_ext_params_t *ps_svc_slice_params = NULL;
 1956|       |
 1957|  14.5k|    UWORD32 u1_num_mb_part;
 1958|  14.5k|    UWORD32 uc_sub_mb;
 1959|  14.5k|    parse_pmbarams_t *ps_parse_mb_data = ps_dec->ps_parse_mb_data + u4_num_mbsNby2;
 1960|  14.5k|    WORD8 *pi1_ref_idx = ps_parse_mb_data->i1_ref_idx[0];
 1961|  14.5k|    const UWORD8 *pu1_num_mb_part = (const UWORD8 *) gau1_ih264d_num_mb_part;
 1962|  14.5k|    const UWORD32 u1_mb_type = ps_cur_mb_info->u1_mb_type;
 1963|  14.5k|    UWORD8 *pu1_col_info = ps_parse_mb_data->u1_col_info;
 1964|  14.5k|    UWORD32 u1_mb_mc_mode = u1_mb_type;
 1965|  14.5k|    ctxt_inc_mb_info_t *p_curr_ctxt = ps_dec->ps_curr_ctxt_mb_info;
 1966|  14.5k|    decoding_envirnoment_t *ps_cab_env = &ps_dec->s_cab_dec_env;
 1967|  14.5k|    dec_bit_stream_t *ps_bitstrm = ps_dec->ps_bitstrm;
 1968|  14.5k|    UWORD32 u4_sub_mb_pack = 0;
 1969|  14.5k|    WORD32 ret;
 1970|       |
 1971|  14.5k|    UWORD8 u1_no_submb_part_size_lt8x8_flag = 1;
 1972|  14.5k|    ps_svc_slice_params = &ps_svc_lyr_dec->s_svc_slice_params;
 1973|       |
 1974|  14.5k|    ps_cur_mb_info->u1_tran_form8x8 = 0;
 1975|  14.5k|    ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = 0;
 1976|  14.5k|    ps_cur_mb_info->u1_yuv_dc_block_flag = 0;
 1977|  14.5k|    p_curr_ctxt->u1_mb_type = CAB_P;
  ------------------
  |  |  398|  14.5k|#define CAB_P             0x07 /* 0000 0111 */
  ------------------
 1978|  14.5k|    ps_cur_mb_info->u1_mb_mc_mode = u1_mb_type;
 1979|  14.5k|    uc_sub_mb = ((u1_mb_type == PRED_8x8) | (u1_mb_type == PRED_8x8R0));
  ------------------
  |  |  453|  14.5k|#define PRED_8x8    3
  ------------------
                  uc_sub_mb = ((u1_mb_type == PRED_8x8) | (u1_mb_type == PRED_8x8R0));
  ------------------
  |  |  454|  14.5k|#define PRED_8x8R0  4
  ------------------
 1980|       |
 1981|       |    /* Reading the subMB type */
 1982|  14.5k|    if(uc_sub_mb)
  ------------------
  |  Branch (1982:8): [True: 4.57k, False: 9.96k]
  ------------------
 1983|  4.57k|    {
 1984|  4.57k|        UWORD8 u1_colz = (PRED_8x8 << 6);
  ------------------
  |  |  453|  4.57k|#define PRED_8x8    3
  ------------------
 1985|  4.57k|        u1_mb_mc_mode = 0;
 1986|  4.57k|        {
 1987|  4.57k|            UWORD8 u1_sub_mb_mode;
 1988|  4.57k|            u1_sub_mb_mode =
 1989|  4.57k|                ih264d_parse_submb_type_cabac(0, ps_cab_env, ps_bitstrm, ps_dec->p_sub_mb_type_t);
 1990|  4.57k|            if(u1_sub_mb_mode > 3) return ERROR_SUB_MB_TYPE;
  ------------------
  |  Branch (1990:16): [True: 0, False: 4.57k]
  ------------------
 1991|       |
 1992|  4.57k|            u4_sub_mb_pack = (u4_sub_mb_pack << 8) | u1_sub_mb_mode;
 1993|       |            /* Storing collocated information */
 1994|  4.57k|            *pu1_col_info++ = u1_colz | ((UWORD8) (u1_sub_mb_mode << 4));
 1995|  4.57k|            COPYTHECONTEXT("sub_mb_type", u1_sub_mb_mode);
 1996|       |            /* check if Motion compensation is done below 8x8 */
 1997|  4.57k|            if(u1_sub_mb_mode != P_L0_8x8)
  ------------------
  |  |  459|  4.57k|#define P_L0_8x8    0
  ------------------
  |  Branch (1997:16): [True: 3.18k, False: 1.38k]
  ------------------
 1998|  3.18k|            {
 1999|  3.18k|                u1_no_submb_part_size_lt8x8_flag = 0;
 2000|  3.18k|            }
 2001|  4.57k|        }
 2002|      0|        {
 2003|  4.57k|            UWORD8 u1_sub_mb_mode;
 2004|  4.57k|            u1_sub_mb_mode =
 2005|  4.57k|                ih264d_parse_submb_type_cabac(0, ps_cab_env, ps_bitstrm, ps_dec->p_sub_mb_type_t);
 2006|  4.57k|            if(u1_sub_mb_mode > 3) return ERROR_SUB_MB_TYPE;
  ------------------
  |  Branch (2006:16): [True: 0, False: 4.57k]
  ------------------
 2007|       |
 2008|  4.57k|            u4_sub_mb_pack = (u4_sub_mb_pack << 8) | u1_sub_mb_mode;
 2009|       |            /* Storing collocated information */
 2010|  4.57k|            *pu1_col_info++ = u1_colz | ((UWORD8) (u1_sub_mb_mode << 4));
 2011|  4.57k|            COPYTHECONTEXT("sub_mb_type", u1_sub_mb_mode);
 2012|       |            /* check if Motion compensation is done below 8x8 */
 2013|  4.57k|            if(u1_sub_mb_mode != P_L0_8x8)
  ------------------
  |  |  459|  4.57k|#define P_L0_8x8    0
  ------------------
  |  Branch (2013:16): [True: 3.03k, False: 1.53k]
  ------------------
 2014|  3.03k|            {
 2015|  3.03k|                u1_no_submb_part_size_lt8x8_flag = 0;
 2016|  3.03k|            }
 2017|  4.57k|        }
 2018|      0|        {
 2019|  4.57k|            UWORD8 u1_sub_mb_mode;
 2020|  4.57k|            u1_sub_mb_mode =
 2021|  4.57k|                ih264d_parse_submb_type_cabac(0, ps_cab_env, ps_bitstrm, ps_dec->p_sub_mb_type_t);
 2022|  4.57k|            if(u1_sub_mb_mode > 3) return ERROR_SUB_MB_TYPE;
  ------------------
  |  Branch (2022:16): [True: 0, False: 4.57k]
  ------------------
 2023|       |
 2024|  4.57k|            u4_sub_mb_pack = (u4_sub_mb_pack << 8) | u1_sub_mb_mode;
 2025|       |            /* Storing collocated information */
 2026|  4.57k|            *pu1_col_info++ = u1_colz | ((UWORD8) (u1_sub_mb_mode << 4));
 2027|  4.57k|            COPYTHECONTEXT("sub_mb_type", u1_sub_mb_mode);
 2028|       |            /* check if Motion compensation is done below 8x8 */
 2029|  4.57k|            if(u1_sub_mb_mode != P_L0_8x8)
  ------------------
  |  |  459|  4.57k|#define P_L0_8x8    0
  ------------------
  |  Branch (2029:16): [True: 3.30k, False: 1.27k]
  ------------------
 2030|  3.30k|            {
 2031|  3.30k|                u1_no_submb_part_size_lt8x8_flag = 0;
 2032|  3.30k|            }
 2033|  4.57k|        }
 2034|      0|        {
 2035|  4.57k|            UWORD8 u1_sub_mb_mode;
 2036|  4.57k|            u1_sub_mb_mode =
 2037|  4.57k|                ih264d_parse_submb_type_cabac(0, ps_cab_env, ps_bitstrm, ps_dec->p_sub_mb_type_t);
 2038|  4.57k|            if(u1_sub_mb_mode > 3) return ERROR_SUB_MB_TYPE;
  ------------------
  |  Branch (2038:16): [True: 0, False: 4.57k]
  ------------------
 2039|       |
 2040|  4.57k|            u4_sub_mb_pack = (u4_sub_mb_pack << 8) | u1_sub_mb_mode;
 2041|       |            /* Storing collocated information */
 2042|  4.57k|            *pu1_col_info++ = u1_colz | ((UWORD8) (u1_sub_mb_mode << 4));
 2043|  4.57k|            COPYTHECONTEXT("sub_mb_type", u1_sub_mb_mode);
 2044|       |            /* check if Motion compensation is done below 8x8 */
 2045|  4.57k|            if(u1_sub_mb_mode != P_L0_8x8)
  ------------------
  |  |  459|  4.57k|#define P_L0_8x8    0
  ------------------
  |  Branch (2045:16): [True: 3.18k, False: 1.38k]
  ------------------
 2046|  3.18k|            {
 2047|  3.18k|                u1_no_submb_part_size_lt8x8_flag = 0;
 2048|  3.18k|            }
 2049|  4.57k|        }
 2050|      0|        u1_num_mb_part = 4;
 2051|  4.57k|    }
 2052|  9.96k|    else
 2053|  9.96k|    {
 2054|  9.96k|        u1_num_mb_part = pu1_num_mb_part[u1_mb_type];
 2055|       |        /* Storing collocated Mb and SubMb mode information */
 2056|  9.96k|        *pu1_col_info++ = (u1_mb_type << 6);
 2057|  9.96k|        if(u1_mb_type) *pu1_col_info++ = (u1_mb_type << 6);
  ------------------
  |  Branch (2057:12): [True: 1.87k, False: 8.08k]
  ------------------
 2058|  9.96k|    }
 2059|       |
 2060|       |    /*Adding code to get Motion Prediction Flags*/
 2061|  14.5k|    {
 2062|  14.5k|        UWORD8 uc_i;
 2063|  14.5k|        UWORD8 *pu1_motion_pred_flag_l0;
 2064|  14.5k|        UWORD8 u1_mvp_flag;
 2065|  14.5k|        WORD8 *pi1_top_ref_idx_ctx_inc_arr = p_curr_ctxt->i1_ref_idx;
 2066|  14.5k|        WORD8 *pi1_left_ref_idx_ctxt_inc = ps_dec->pi1_left_ref_idx_ctxt_inc;
 2067|  14.5k|        UWORD8 u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
 2068|  14.5k|        UWORD8 uc_field = ps_cur_mb_info->u1_mb_field_decodingflag;
 2069|  14.5k|        UWORD8 uc_num_ref_idx_l0_active_minus1 =
 2070|  14.5k|            (ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[0] << (u1_mbaff & uc_field)) - 1;
 2071|  14.5k|        pu1_motion_pred_flag_l0 = &ps_svc_cur_mb_info->au1_motion_pred_flag[0];
 2072|  14.5k|        *pu1_motion_pred_flag_l0 = 0;
 2073|       |
 2074|  14.5k|        if(ps_svc_cur_mb_info->u1_crop_window_flag &&
  ------------------
  |  Branch (2074:12): [True: 14.3k, False: 222]
  ------------------
 2075|  14.3k|           ps_svc_slice_params->u1_adaptive_motion_prediction_flag)
  ------------------
  |  Branch (2075:12): [True: 7.71k, False: 6.59k]
  ------------------
 2076|  7.71k|        {
 2077|  27.4k|            for(uc_i = 0; uc_i < u1_num_mb_part; uc_i++)
  ------------------
  |  Branch (2077:27): [True: 19.7k, False: 7.71k]
  ------------------
 2078|  19.7k|            {
 2079|       |                /*usage of bins and ctxt check*/
 2080|  19.7k|                u1_mvp_flag = ih264d_decode_bin(0, ps_svc_lyr_dec->ps_motion_prediction_flag_l0,
 2081|  19.7k|                                                ps_bitstrm, ps_cab_env);
 2082|  19.7k|                COPYTHECONTEXT("SVC ext: ps_motion_prediction_flag_l0", u1_mvp_flag);
 2083|       |
 2084|  19.7k|                *pu1_motion_pred_flag_l0 |= (u1_mvp_flag << uc_i);
 2085|  19.7k|                if(u1_mvp_flag)
  ------------------
  |  Branch (2085:20): [True: 6.10k, False: 13.6k]
  ------------------
 2086|  6.10k|                {
 2087|  6.10k|                    pi1_ref_idx[uc_i] = -1;
 2088|  6.10k|                }
 2089|  19.7k|            }
 2090|  7.71k|        }
 2091|  6.81k|        else if(ps_svc_cur_mb_info->u1_crop_window_flag)
  ------------------
  |  Branch (2091:17): [True: 6.59k, False: 222]
  ------------------
 2092|  6.59k|        {
 2093|  6.59k|            *pu1_motion_pred_flag_l0 = ps_svc_slice_params->u1_default_motion_prediction_flag
  ------------------
  |  Branch (2093:40): [True: 1.22k, False: 5.37k]
  ------------------
 2094|  6.59k|                                           ? ((1 << u1_num_mb_part) - 1)
 2095|  6.59k|                                           : 0;
 2096|  6.59k|            if(ps_svc_slice_params->u1_default_motion_prediction_flag)
  ------------------
  |  Branch (2096:16): [True: 1.22k, False: 5.37k]
  ------------------
 2097|  1.22k|            {
 2098|  1.22k|                pi1_ref_idx[0] = -1;
 2099|  1.22k|                pi1_ref_idx[1] = -1;
 2100|  1.22k|                pi1_ref_idx[2] = -1;
 2101|  1.22k|                pi1_ref_idx[3] = -1;
 2102|  1.22k|            }
 2103|  6.59k|        }
 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.5k|        if((uc_num_ref_idx_l0_active_minus1 > 0) & (u1_mb_type != PRED_8x8R0))
  ------------------
  |  |  454|  14.5k|#define PRED_8x8R0  4
  ------------------
  |  Branch (2108:12): [True: 396, False: 14.1k]
  ------------------
 2109|    396|        {
 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|    396|            ret = ih264d_parse_ref_idx_cabac(u1_num_mb_part, 0, uc_num_ref_idx_l0_active_minus1,
 2115|    396|                                             u1_mb_mc_mode, pi1_ref_idx, pi1_left_ref_idx_ctxt_inc,
 2116|    396|                                             pi1_top_ref_idx_ctx_inc_arr, ps_cab_env, ps_bitstrm,
 2117|    396|                                             ps_dec->p_ref_idx_t);
 2118|    396|            if(ret != OK)
  ------------------
  |  |  114|    396|#define OK        0
  ------------------
  |  Branch (2118:16): [True: 69, False: 327]
  ------------------
 2119|     69|            {
 2120|     69|                return ret;
 2121|     69|            }
 2122|    396|        }
 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.5k|    }
 2133|       |
 2134|  14.4k|    {
 2135|  14.4k|        UWORD8 u1_p_idx;
 2136|  14.4k|        UWORD32 uc_i;
 2137|  14.4k|        parse_part_params_t *ps_part = ps_dec->ps_part;
 2138|  14.4k|        UWORD8 u1_sub_mb_mode, u1_num_subpart, u1_mb_part_width, u1_mb_part_height;
 2139|  14.4k|        UWORD32 u4_sub_mb_num;
 2140|  14.4k|        const UWORD8 *pu1_top_left_sub_mb_indx;
 2141|  14.4k|        mv_pred_t *ps_mv_start = ps_dec->ps_mv_cur + (u4_mb_num << 4);
 2142|  14.4k|        UWORD16 u2_sub_mb_num_pack = 0x028A;
 2143|       |
 2144|       |        /* Loading the table pointers */
 2145|  14.4k|        const UWORD8 *pu1_mb_partw = (const UWORD8 *) gau1_ih264d_mb_partw;
 2146|  14.4k|        const UWORD8 *pu1_mb_parth = (const UWORD8 *) gau1_ih264d_mb_parth;
 2147|  14.4k|        const UWORD8 *pu1_sub_mb_indx_mod =
 2148|  14.4k|            (const UWORD8 *) (gau1_ih264d_submb_indx_mod) + (uc_sub_mb * 6);
 2149|  14.4k|        const UWORD8 *pu1_sub_mb_partw = (const UWORD8 *) gau1_ih264d_submb_partw;
 2150|  14.4k|        const UWORD8 *pu1_sub_mb_parth = (const UWORD8 *) gau1_ih264d_submb_parth;
 2151|  14.4k|        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.4k|        u1_sub_mb_mode = 0;
 2158|  14.4k|        u1_num_subpart = 1;
 2159|  14.4k|        u1_mb_part_width = pu1_mb_partw[u1_mb_type];
 2160|  14.4k|        u1_mb_part_height = pu1_mb_parth[u1_mb_type];
 2161|  14.4k|        pu1_top_left_sub_mb_indx = pu1_sub_mb_indx_mod + (u1_mb_type << 1);
 2162|  14.4k|        u4_sub_mb_num = 0;
 2163|       |
 2164|       |        /* Loop on number of partitions */
 2165|  44.4k|        for(uc_i = 0, u1_p_idx = 0; uc_i < u1_num_mb_part; uc_i++)
  ------------------
  |  Branch (2165:37): [True: 29.9k, False: 14.4k]
  ------------------
 2166|  29.9k|        {
 2167|  29.9k|            UWORD8 uc_j;
 2168|  29.9k|            if(uc_sub_mb)
  ------------------
  |  Branch (2168:16): [True: 18.2k, False: 11.6k]
  ------------------
 2169|  18.2k|            {
 2170|  18.2k|                u1_sub_mb_mode = u4_sub_mb_pack >> 24;
 2171|  18.2k|                u1_num_subpart = pu1_num_sub_mb_part[u1_sub_mb_mode];
 2172|  18.2k|                u1_mb_part_width = pu1_sub_mb_partw[u1_sub_mb_mode];
 2173|  18.2k|                u1_mb_part_height = pu1_sub_mb_parth[u1_sub_mb_mode];
 2174|  18.2k|                pu1_top_left_sub_mb_indx = pu1_sub_mb_indx_mod + (u1_sub_mb_mode << 1);
 2175|  18.2k|                u4_sub_mb_num = u2_sub_mb_num_pack >> 12;
 2176|  18.2k|                u4_sub_mb_pack <<= 8;
 2177|  18.2k|                u2_sub_mb_num_pack <<= 4;
 2178|  18.2k|            }
 2179|       |            /* Loop on Number of sub-partitions */
 2180|  76.9k|            for(uc_j = 0; uc_j < u1_num_subpart; uc_j++, pu1_top_left_sub_mb_indx++)
  ------------------
  |  Branch (2180:27): [True: 46.9k, False: 29.9k]
  ------------------
 2181|  46.9k|            {
 2182|  46.9k|                mv_pred_t *ps_mv;
 2183|  46.9k|                u4_sub_mb_num += *pu1_top_left_sub_mb_indx;
 2184|  46.9k|                ps_mv = ps_mv_start + u4_sub_mb_num;
 2185|       |
 2186|       |                /* Storing Info for partitions */
 2187|  46.9k|                ps_part->u1_is_direct = PART_NOT_DIRECT;
  ------------------
  |  |  570|  46.9k|#define PART_NOT_DIRECT                0
  ------------------
 2188|  46.9k|                ps_part->u1_sub_mb_num = u4_sub_mb_num;
 2189|  46.9k|                ps_part->u1_partheight = u1_mb_part_height;
 2190|  46.9k|                ps_part->u1_partwidth = u1_mb_part_width;
 2191|       |
 2192|       |                /* Increment partition Index */
 2193|  46.9k|                u1_p_idx++;
 2194|  46.9k|                ps_part++;
 2195|       |
 2196|  46.9k|                ih264d_get_mvd_cabac(u4_sub_mb_num, 0, u1_mb_part_width, u1_mb_part_height, 1,
 2197|  46.9k|                                     ps_dec, ps_mv);
 2198|  46.9k|            }
 2199|  29.9k|        }
 2200|  14.4k|        ps_parse_mb_data->u1_num_part = u1_p_idx;
 2201|  14.4k|        ps_dec->ps_part = ps_part;
 2202|  14.4k|    }
 2203|       |
 2204|       |    /* update incropwindow*/
 2205|  14.4k|    if(ps_svc_slice_params->u1_adaptive_residual_prediction_flag &&
  ------------------
  |  Branch (2205:8): [True: 1.88k, False: 12.5k]
  ------------------
 2206|  1.88k|       ps_svc_cur_mb_info->u1_crop_window_flag)
  ------------------
  |  Branch (2206:8): [True: 1.66k, False: 222]
  ------------------
 2207|  1.66k|    {
 2208|  1.66k|        ps_svc_cur_mb_info->u1_residual_prediction_flag = ih264d_decode_bin(
 2209|  1.66k|            1, ps_svc_lyr_dec->ps_residual_prediction_flag, ps_bitstrm, ps_cab_env);
 2210|  1.66k|        COPYTHECONTEXT("SVC ext: u1_residual_prediction_flag",
 2211|  1.66k|                       ps_cur_mb_info->u1_residual_prediction_flag);
 2212|  1.66k|    }
 2213|  12.8k|    else
 2214|  12.8k|    {
 2215|       |        /*residual flag inference code */
 2216|  12.8k|        if(1 == ps_svc_cur_mb_info->u1_crop_window_flag)
  ------------------
  |  Branch (2216:12): [True: 12.5k, False: 222]
  ------------------
 2217|  12.5k|        {
 2218|  12.5k|            ps_svc_cur_mb_info->u1_residual_prediction_flag =
 2219|  12.5k|                ps_svc_slice_params->u1_default_residual_prediction_flag;
 2220|  12.5k|        }
 2221|    222|        else
 2222|    222|        {
 2223|    222|            ps_svc_cur_mb_info->u1_residual_prediction_flag = 0;
 2224|    222|        }
 2225|  12.8k|    }
 2226|       |
 2227|  14.4k|    if(ps_svc_slice_params->u1_scan_idx_end >= ps_svc_slice_params->u1_scan_idx_start)
  ------------------
  |  Branch (2227:8): [True: 14.4k, False: 0]
  ------------------
 2228|  14.4k|    {
 2229|  14.4k|        UWORD8 u1_cbp;
 2230|       |        /* Read the Coded block pattern */
 2231|  14.4k|        u1_cbp = (WORD8) ih264d_parse_ctx_cbp_cabac(ps_dec);
 2232|  14.4k|        COPYTHECONTEXT("coded_block_pattern", u1_cbp);
 2233|  14.4k|        ps_cur_mb_info->u1_cbp = u1_cbp;
 2234|  14.4k|        p_curr_ctxt->u1_cbp = u1_cbp;
 2235|  14.4k|        p_curr_ctxt->u1_intra_chroma_pred_mode = 0;
 2236|  14.4k|        p_curr_ctxt->u1_yuv_dc_csbp &= 0xFE;
 2237|  14.4k|        ps_dec->pu1_left_yuv_dc_csbp[0] &= 0x6;
 2238|       |
 2239|  14.4k|        if(u1_cbp > 47) return ERROR_CBP;
  ------------------
  |  Branch (2239:12): [True: 0, False: 14.4k]
  ------------------
 2240|       |
 2241|  14.4k|        ps_cur_mb_info->u1_tran_form8x8 = 0;
 2242|  14.4k|        ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = 0;
 2243|       |
 2244|       |        /* Read the transform8x8 u4_flag if present */
 2245|  14.4k|        if((ps_dec->s_high_profile.u1_transform8x8_present) && (u1_cbp & 0xf) &&
  ------------------
  |  Branch (2245:12): [True: 11.1k, False: 3.32k]
  |  Branch (2245:64): [True: 7.87k, False: 3.26k]
  ------------------
 2246|  7.87k|           u1_no_submb_part_size_lt8x8_flag)
  ------------------
  |  Branch (2246:12): [True: 4.39k, False: 3.47k]
  ------------------
 2247|  4.39k|        {
 2248|  4.39k|            ps_cur_mb_info->u1_tran_form8x8 =
 2249|  4.39k|                ih264d_parse_transform8x8flag_cabac(ps_dec, ps_cur_mb_info);
 2250|  4.39k|            COPYTHECONTEXT("transform_size_8x8_flag", ps_cur_mb_info->u1_tran_form8x8);
 2251|  4.39k|            p_curr_ctxt->u1_transform8x8_ctxt = ps_cur_mb_info->u1_tran_form8x8;
 2252|  4.39k|            ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = ps_cur_mb_info->u1_tran_form8x8;
 2253|  4.39k|        }
 2254|  10.0k|        else
 2255|  10.0k|        {
 2256|  10.0k|            p_curr_ctxt->u1_transform8x8_ctxt = 0;
 2257|  10.0k|        }
 2258|       |
 2259|       |        /* Read mb_qp_delta */
 2260|  14.4k|        if(u1_cbp)
  ------------------
  |  Branch (2260:12): [True: 9.69k, False: 4.77k]
  ------------------
 2261|  9.69k|        {
 2262|  9.69k|            WORD8 c_temp;
 2263|  9.69k|            ret = ih264d_parse_mb_qp_delta_cabac(ps_dec, &c_temp);
 2264|  9.69k|            if(ret != OK) return ret;
  ------------------
  |  |  114|  9.69k|#define OK        0
  ------------------
  |  Branch (2264:16): [True: 144, False: 9.54k]
  ------------------
 2265|  9.54k|            COPYTHECONTEXT("mb_qp_delta", c_temp);
 2266|  9.54k|            if(c_temp != 0)
  ------------------
  |  Branch (2266:16): [True: 2.61k, False: 6.93k]
  ------------------
 2267|  2.61k|            {
 2268|  2.61k|                ret = ih264d_update_qp(ps_dec, c_temp);
 2269|  2.61k|                if(ret != OK) return ret;
  ------------------
  |  |  114|  2.61k|#define OK        0
  ------------------
  |  Branch (2269:20): [True: 0, False: 2.61k]
  ------------------
 2270|  2.61k|            }
 2271|  9.54k|        }
 2272|  4.77k|        else
 2273|  4.77k|            ps_dec->i1_prev_mb_qp_delta = 0;
 2274|       |
 2275|       |        /*residual from start to end idx */
 2276|  14.3k|        ih264d_parse_residual4x4_cabac(ps_dec, ps_cur_mb_info, 0);
 2277|  14.3k|        if(EXCEED_OFFSET(ps_dec->ps_bitstrm)) return ERROR_EOB_TERMINATE_T;
  ------------------
  |  |   93|  14.3k|  (ps_bitstrm->u4_ofst > ps_bitstrm->u4_max_ofst)
  |  |  ------------------
  |  |  |  Branch (93:3): [True: 857, False: 13.4k]
  |  |  ------------------
  ------------------
 2278|  14.3k|    }
 2279|  13.4k|    return OK;
  ------------------
  |  |  114|  13.4k|#define OK        0
  ------------------
 2280|  14.4k|}
isvcd_parse_pmb_cavlc:
 2296|  20.4k|{
 2297|  20.4k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
 2298|  20.4k|    dec_slice_svc_ext_params_t *ps_svc_slice_params = NULL;
 2299|  20.4k|    UWORD32 u1_num_mb_part;
 2300|  20.4k|    UWORD32 uc_sub_mb;
 2301|  20.4k|    dec_bit_stream_t *const ps_bitstrm = ps_dec->ps_bitstrm;
 2302|  20.4k|    UWORD32 *const pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
 2303|  20.4k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
 2304|  20.4k|    parse_pmbarams_t *ps_parse_mb_data = ps_dec->ps_parse_mb_data + u4_num_mbsNby2;
 2305|  20.4k|    WORD8 *pi1_ref_idx = ps_parse_mb_data->i1_ref_idx[0];
 2306|  20.4k|    const UWORD8 u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
 2307|  20.4k|    const UWORD8 *pu1_num_mb_part = (const UWORD8 *) gau1_ih264d_num_mb_part;
 2308|  20.4k|    UWORD8 *pu1_col_info = ps_parse_mb_data->u1_col_info;
 2309|  20.4k|    UWORD32 u1_mb_type = ps_cur_mb_info->u1_mb_type;
 2310|  20.4k|    UWORD32 u4_sum_mb_mode_pack = 0;
 2311|  20.4k|    WORD32 ret;
 2312|  20.4k|    UWORD8 u1_no_submb_part_size_lt8x8_flag = 1;
 2313|       |
 2314|  20.4k|    ps_svc_slice_params = &ps_svc_lyr_dec->s_svc_slice_params;
 2315|  20.4k|    ps_cur_mb_info->u1_tran_form8x8 = 0;
 2316|  20.4k|    ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = 0;
 2317|  20.4k|    ps_cur_mb_info->u1_yuv_dc_block_flag = 0;
 2318|  20.4k|    ps_cur_mb_info->u1_mb_mc_mode = u1_mb_type;
 2319|  20.4k|    uc_sub_mb = ((u1_mb_type == PRED_8x8) | (u1_mb_type == PRED_8x8R0));
  ------------------
  |  |  453|  20.4k|#define PRED_8x8    3
  ------------------
                  uc_sub_mb = ((u1_mb_type == PRED_8x8) | (u1_mb_type == PRED_8x8R0));
  ------------------
  |  |  454|  20.4k|#define PRED_8x8R0  4
  ------------------
 2320|       |
 2321|       |    /* Reading the subMB type */
 2322|  20.4k|    if(uc_sub_mb)
  ------------------
  |  Branch (2322:8): [True: 1.87k, False: 18.5k]
  ------------------
 2323|  1.87k|    {
 2324|  1.87k|        WORD32 i;
 2325|  1.87k|        UWORD8 u1_colz = (PRED_8x8 << 6);
  ------------------
  |  |  453|  1.87k|#define PRED_8x8    3
  ------------------
 2326|       |
 2327|  8.75k|        for(i = 0; i < 4; i++)
  ------------------
  |  Branch (2327:20): [True: 7.11k, False: 1.63k]
  ------------------
 2328|  7.11k|        {
 2329|  7.11k|            UWORD32 ui_sub_mb_mode;
 2330|       |
 2331|       |            // Inlined ih264d_uev
 2332|  7.11k|            UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
 2333|  7.11k|            UWORD32 u4_word, u4_ldz;
 2334|       |
 2335|       |            /***************************************************************/
 2336|       |            /* Find leading zeros in next 32 bits                          */
 2337|       |            /***************************************************************/
 2338|  7.11k|            NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  7.11k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  7.11k|{                                                                           \
  |  |  152|  7.11k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  7.11k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  7.11k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  7.11k|                                                                            \
  |  |  156|  7.11k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  7.11k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 6.64k, False: 476]
  |  |  ------------------
  |  |  158|  7.11k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  6.64k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  7.11k|}
  ------------------
 2339|  7.11k|            u4_ldz = CLZ(u4_word);
 2340|       |            /* Flush the ps_bitstrm */
 2341|  7.11k|            u4_bitstream_offset += (u4_ldz + 1);
 2342|       |            /* Read the suffix from the ps_bitstrm */
 2343|  7.11k|            u4_word = 0;
 2344|  7.11k|            if(u4_ldz) GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  3.09k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  3.09k|{                                                                           \
  |  |  122|  3.09k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  3.09k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  3.09k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  3.09k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  3.09k|                                                                            \
  |  |  127|  3.09k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 2.46k, False: 633]
  |  |  ------------------
  |  |  128|  3.09k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  2.46k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  3.09k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  3.09k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  3.09k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  3.09k|}                                                                           \
  ------------------
  |  Branch (2344:16): [True: 3.09k, False: 4.02k]
  ------------------
 2345|  7.11k|            *pu4_bitstrm_ofst = u4_bitstream_offset;
 2346|  7.11k|            ui_sub_mb_mode = ((1 << u4_ldz) + u4_word - 1);
 2347|       |            // Inlined ih264d_uev
 2348|       |
 2349|  7.11k|            if(ui_sub_mb_mode > 3)
  ------------------
  |  Branch (2349:16): [True: 234, False: 6.88k]
  ------------------
 2350|    234|            {
 2351|    234|                return ERROR_SUB_MB_TYPE;
 2352|    234|            }
 2353|  6.88k|            else
 2354|  6.88k|            {
 2355|  6.88k|                u4_sum_mb_mode_pack = (u4_sum_mb_mode_pack << 8) | ui_sub_mb_mode;
 2356|       |                /* Storing collocated information */
 2357|  6.88k|                *pu1_col_info++ = u1_colz | (UWORD8) (ui_sub_mb_mode << 4);
 2358|       |
 2359|  6.88k|                COPYTHECONTEXT("sub_mb_type", ui_sub_mb_mode);
 2360|  6.88k|            }
 2361|       |
 2362|       |            /* check if Motion compensation is done below 8x8 */
 2363|  6.88k|            if(ui_sub_mb_mode != P_L0_8x8)
  ------------------
  |  |  459|  6.88k|#define P_L0_8x8    0
  ------------------
  |  Branch (2363:16): [True: 2.86k, False: 4.02k]
  ------------------
 2364|  2.86k|            {
 2365|  2.86k|                u1_no_submb_part_size_lt8x8_flag = 0;
 2366|  2.86k|            }
 2367|  6.88k|        }
 2368|  1.63k|        u1_num_mb_part = 4;
 2369|  1.63k|    }
 2370|  18.5k|    else
 2371|  18.5k|    {
 2372|  18.5k|        *pu1_col_info++ = (u1_mb_type << 6);
 2373|  18.5k|        if(u1_mb_type) *pu1_col_info++ = (u1_mb_type << 6);
  ------------------
  |  Branch (2373:12): [True: 7.01k, False: 11.5k]
  ------------------
 2374|  18.5k|        u1_num_mb_part = pu1_num_mb_part[u1_mb_type];
 2375|  18.5k|    }
 2376|       |
 2377|       |    /*Adding code to get Motion Prediction Flags*/
 2378|  20.2k|    {
 2379|       |        /*free the scratch buffer once used*/
 2380|  20.2k|        UWORD8 uc_i;
 2381|  20.2k|        UWORD8 *pu1_motion_pred_flag_l0;
 2382|  20.2k|        UWORD8 u1_mvp_flag;
 2383|  20.2k|        UWORD8 uc_field = ps_cur_mb_info->u1_mb_field_decodingflag;
 2384|  20.2k|        UWORD8 uc_num_ref_idx_l0_active_minus1 =
 2385|  20.2k|            (ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[0] << (u1_mbaff & uc_field)) - 1;
 2386|       |
 2387|  20.2k|        pu1_motion_pred_flag_l0 = &ps_svc_cur_mb_info->au1_motion_pred_flag[0];
 2388|  20.2k|        *pu1_motion_pred_flag_l0 = 0;
 2389|  20.2k|        if(ps_svc_cur_mb_info->u1_crop_window_flag &&
  ------------------
  |  Branch (2389:12): [True: 20.0k, False: 203]
  ------------------
 2390|  20.0k|           ps_svc_slice_params->u1_adaptive_motion_prediction_flag)
  ------------------
  |  Branch (2390:12): [True: 7.98k, False: 12.0k]
  ------------------
 2391|  7.98k|        {
 2392|  22.8k|            for(uc_i = 0; uc_i < u1_num_mb_part; uc_i++)
  ------------------
  |  Branch (2392:27): [True: 14.8k, False: 7.98k]
  ------------------
 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.98k|        }
 2401|  12.2k|        else if(ps_svc_cur_mb_info->u1_crop_window_flag)
  ------------------
  |  Branch (2401:17): [True: 12.0k, False: 203]
  ------------------
 2402|  12.0k|        {
 2403|  12.0k|            *pu1_motion_pred_flag_l0 = ps_svc_slice_params->u1_default_motion_prediction_flag
  ------------------
  |  Branch (2403:40): [True: 4.00k, False: 8.03k]
  ------------------
 2404|  12.0k|                                           ? ((1 << u1_num_mb_part) - 1)
 2405|  12.0k|                                           : 0;
 2406|  12.0k|        }
 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|  20.2k|        if((uc_num_ref_idx_l0_active_minus1 > 0) & (u1_mb_type != PRED_8x8R0))
  ------------------
  |  |  454|  20.2k|#define PRED_8x8R0  4
  ------------------
  |  Branch (2411:12): [True: 13.0k, False: 7.13k]
  ------------------
 2412|  13.0k|        {
 2413|  13.0k|            if(1 == uc_num_ref_idx_l0_active_minus1)
  ------------------
  |  Branch (2413:16): [True: 3.44k, False: 9.64k]
  ------------------
 2414|  3.44k|                isvcd_parse_pmb_ref_index_cavlc_range1(u1_num_mb_part, ps_bitstrm, pi1_ref_idx,
 2415|  3.44k|                                                       uc_num_ref_idx_l0_active_minus1,
 2416|  3.44k|                                                       pu1_motion_pred_flag_l0);
 2417|  9.64k|            else
 2418|  9.64k|            {
 2419|  9.64k|                ret = isvcd_parse_pmb_ref_index_cavlc(u1_num_mb_part, ps_bitstrm, pi1_ref_idx,
 2420|  9.64k|                                                      uc_num_ref_idx_l0_active_minus1,
 2421|  9.64k|                                                      pu1_motion_pred_flag_l0);
 2422|  9.64k|                if(ret != OK) return ret;
  ------------------
  |  |  114|  9.64k|#define OK        0
  ------------------
  |  Branch (2422:20): [True: 232, False: 9.41k]
  ------------------
 2423|  9.64k|            }
 2424|  13.0k|        }
 2425|  7.13k|        else
 2426|  7.13k|        {
 2427|       |            /* When there exists only a single frame to predict from */
 2428|  7.13k|            UWORD32 uc_i;
 2429|  17.1k|            for(uc_i = 0; uc_i < u1_num_mb_part; uc_i++) /* Storing Reference Idx Information */
  ------------------
  |  Branch (2429:27): [True: 10.0k, False: 7.13k]
  ------------------
 2430|  10.0k|                pi1_ref_idx[uc_i] = 0;
 2431|  7.13k|        }
 2432|  20.2k|    }
 2433|       |
 2434|  19.9k|    {
 2435|  19.9k|        UWORD8 u1_p_idx;
 2436|  19.9k|        UWORD32 uc_i;
 2437|  19.9k|        parse_part_params_t *ps_part = ps_dec->ps_part;
 2438|  19.9k|        UWORD8 u1_sub_mb_mode, u1_num_subpart, u1_mb_part_width, u1_mb_part_height;
 2439|  19.9k|        UWORD32 u4_sub_mb_num;
 2440|  19.9k|        const UWORD8 *pu1_top_left_sub_mb_indx;
 2441|  19.9k|        mv_pred_t *ps_mv, *ps_mv_start = ps_dec->ps_mv_cur + (u4_mb_num << 4);
 2442|       |        /* Loading the table pointers */
 2443|  19.9k|        const UWORD8 *pu1_mb_partw = (const UWORD8 *) gau1_ih264d_mb_partw;
 2444|  19.9k|        const UWORD8 *pu1_mb_parth = (const UWORD8 *) gau1_ih264d_mb_parth;
 2445|  19.9k|        const UWORD8 *pu1_sub_mb_indx_mod =
 2446|  19.9k|            (const UWORD8 *) (gau1_ih264d_submb_indx_mod) + (uc_sub_mb * 6);
 2447|  19.9k|        const UWORD8 *pu1_sub_mb_partw = (const UWORD8 *) gau1_ih264d_submb_partw;
 2448|  19.9k|        const UWORD8 *pu1_sub_mb_parth = (const UWORD8 *) gau1_ih264d_submb_parth;
 2449|  19.9k|        const UWORD8 *pu1_num_sub_mb_part = (const UWORD8 *) gau1_ih264d_num_submb_part;
 2450|  19.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|  19.9k|        u1_sub_mb_mode = 0;
 2457|  19.9k|        u1_num_subpart = 1;
 2458|  19.9k|        u1_mb_part_width = pu1_mb_partw[u1_mb_type];
 2459|  19.9k|        u1_mb_part_height = pu1_mb_parth[u1_mb_type];
 2460|  19.9k|        pu1_top_left_sub_mb_indx = pu1_sub_mb_indx_mod + (u1_mb_type << 1);
 2461|  19.9k|        u4_sub_mb_num = 0;
 2462|       |
 2463|       |        /* Loop on number of partitions */
 2464|  51.6k|        for(uc_i = 0, u1_p_idx = 0; uc_i < u1_num_mb_part; uc_i++)
  ------------------
  |  Branch (2464:37): [True: 31.6k, False: 19.9k]
  ------------------
 2465|  31.6k|        {
 2466|  31.6k|            UWORD8 uc_j;
 2467|  31.6k|            if(uc_sub_mb)
  ------------------
  |  Branch (2467:16): [True: 6.50k, False: 25.1k]
  ------------------
 2468|  6.50k|            {
 2469|  6.50k|                u1_sub_mb_mode = u4_sum_mb_mode_pack >> 24;
 2470|  6.50k|                u1_num_subpart = pu1_num_sub_mb_part[u1_sub_mb_mode];
 2471|  6.50k|                u1_mb_part_width = pu1_sub_mb_partw[u1_sub_mb_mode];
 2472|  6.50k|                u1_mb_part_height = pu1_sub_mb_parth[u1_sub_mb_mode];
 2473|  6.50k|                pu1_top_left_sub_mb_indx = pu1_sub_mb_indx_mod + (u1_sub_mb_mode << 1);
 2474|  6.50k|                u4_sub_mb_num = u2_sub_mb_num >> 12;
 2475|  6.50k|                u4_sum_mb_mode_pack <<= 8;
 2476|  6.50k|                u2_sub_mb_num <<= 4;
 2477|  6.50k|            }
 2478|       |            /* Loop on Number of sub-partitions */
 2479|  68.0k|            for(uc_j = 0; uc_j < u1_num_subpart; uc_j++, pu1_top_left_sub_mb_indx++)
  ------------------
  |  Branch (2479:27): [True: 36.3k, False: 31.6k]
  ------------------
 2480|  36.3k|            {
 2481|  36.3k|                WORD16 i2_mvx, i2_mvy;
 2482|  36.3k|                u4_sub_mb_num += *pu1_top_left_sub_mb_indx;
 2483|  36.3k|                ps_mv = ps_mv_start + u4_sub_mb_num;
 2484|       |
 2485|       |                /* Reading the differential Mv from the bitstream */
 2486|       |                // inlining ih264d_sev
 2487|  36.3k|                {
 2488|  36.3k|                    UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
 2489|  36.3k|                    UWORD32 u4_word, u4_ldz, u4_abs_val;
 2490|       |
 2491|       |                    /***************************************************************/
 2492|       |                    /* Find leading zeros in next 32 bits                          */
 2493|       |                    /***************************************************************/
 2494|  36.3k|                    NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  36.3k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  36.3k|{                                                                           \
  |  |  152|  36.3k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  36.3k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  36.3k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  36.3k|                                                                            \
  |  |  156|  36.3k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  36.3k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 35.1k, False: 1.19k]
  |  |  ------------------
  |  |  158|  36.3k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  35.1k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  36.3k|}
  ------------------
 2495|  36.3k|                    u4_ldz = CLZ(u4_word);
 2496|       |
 2497|       |                    /* Flush the ps_bitstrm */
 2498|  36.3k|                    u4_bitstream_offset += (u4_ldz + 1);
 2499|       |
 2500|       |                    /* Read the suffix from the ps_bitstrm */
 2501|  36.3k|                    u4_word = 0;
 2502|  36.3k|                    if(u4_ldz) GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  18.2k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  18.2k|{                                                                           \
  |  |  122|  18.2k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  18.2k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  18.2k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  18.2k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  18.2k|                                                                            \
  |  |  127|  18.2k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 17.0k, False: 1.17k]
  |  |  ------------------
  |  |  128|  18.2k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  17.0k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  18.2k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  18.2k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  18.2k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  18.2k|}                                                                           \
  ------------------
  |  Branch (2502:24): [True: 18.2k, False: 18.1k]
  ------------------
 2503|       |
 2504|  36.3k|                    *pu4_bitstrm_ofst = u4_bitstream_offset;
 2505|  36.3k|                    u4_abs_val = ((1 << u4_ldz) + u4_word) >> 1;
 2506|       |
 2507|  36.3k|                    if(u4_word & 0x1)
  ------------------
  |  Branch (2507:24): [True: 11.0k, False: 25.2k]
  ------------------
 2508|  11.0k|                        i2_mvx = (-(WORD32) u4_abs_val);
 2509|  25.2k|                    else
 2510|  25.2k|                        i2_mvx = (u4_abs_val);
 2511|  36.3k|                }
 2512|       |                // inlinined ih264d_sev
 2513|  36.3k|                COPYTHECONTEXT("MVD", i2_mvx);
 2514|  36.3k|                i2_mvy = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 2515|  36.3k|                COPYTHECONTEXT("MVD", i2_mvy);
 2516|       |
 2517|       |                /* Storing Info for partitions */
 2518|  36.3k|                ps_part->u1_is_direct = PART_NOT_DIRECT;
  ------------------
  |  |  570|  36.3k|#define PART_NOT_DIRECT                0
  ------------------
 2519|  36.3k|                ps_part->u1_sub_mb_num = u4_sub_mb_num;
 2520|  36.3k|                ps_part->u1_partheight = u1_mb_part_height;
 2521|  36.3k|                ps_part->u1_partwidth = u1_mb_part_width;
 2522|       |
 2523|       |                /* Storing Mv residuals */
 2524|  36.3k|                ps_mv->i2_mv[0] = i2_mvx;
 2525|  36.3k|                ps_mv->i2_mv[1] = i2_mvy;
 2526|       |
 2527|       |                /* Increment partition Index */
 2528|  36.3k|                u1_p_idx++;
 2529|  36.3k|                ps_part++;
 2530|  36.3k|            }
 2531|  31.6k|        }
 2532|  19.9k|        ps_parse_mb_data->u1_num_part = u1_p_idx;
 2533|  19.9k|        ps_dec->ps_part = ps_part;
 2534|  19.9k|    }
 2535|       |
 2536|  19.9k|    if(ps_svc_slice_params->u1_adaptive_residual_prediction_flag &&
  ------------------
  |  Branch (2536:8): [True: 3.08k, False: 16.9k]
  ------------------
 2537|  3.08k|       ps_svc_cur_mb_info->u1_crop_window_flag)
  ------------------
  |  Branch (2537:8): [True: 2.87k, False: 203]
  ------------------
 2538|  2.87k|    {
 2539|  2.87k|        ps_svc_cur_mb_info->u1_residual_prediction_flag = ih264d_get_bit_h264(ps_bitstrm);
 2540|  2.87k|        COPYTHECONTEXT("SVC ext: u1_residual_prediction_flag",
 2541|  2.87k|                       ps_svc_cur_mb_info->u1_residual_prediction_flag);
 2542|  2.87k|    }
 2543|  17.1k|    else
 2544|  17.1k|    {
 2545|       |        /*residual flag inference code */
 2546|  17.1k|        if(1 == ps_svc_cur_mb_info->u1_crop_window_flag)
  ------------------
  |  Branch (2546:12): [True: 16.9k, False: 203]
  ------------------
 2547|  16.9k|        {
 2548|  16.9k|            ps_svc_cur_mb_info->u1_residual_prediction_flag =
 2549|  16.9k|                ps_svc_slice_params->u1_default_residual_prediction_flag;
 2550|  16.9k|        }
 2551|    203|        else
 2552|    203|        {
 2553|    203|            ps_svc_cur_mb_info->u1_residual_prediction_flag = 0;
 2554|    203|        }
 2555|  17.1k|    }
 2556|       |
 2557|  19.9k|    if(ps_svc_slice_params->u1_scan_idx_end >= ps_svc_slice_params->u1_scan_idx_start)
  ------------------
  |  Branch (2557:8): [True: 19.9k, False: 0]
  ------------------
 2558|  19.9k|    {
 2559|  19.9k|        UWORD32 u4_cbp;
 2560|       |        /* Read the Coded block pattern */
 2561|  19.9k|        UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
 2562|  19.9k|        UWORD32 u4_word, u4_ldz;
 2563|       |
 2564|       |        /***************************************************************/
 2565|       |        /* Find leading zeros in next 32 bits                          */
 2566|       |        /***************************************************************/
 2567|  19.9k|        NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  19.9k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  19.9k|{                                                                           \
  |  |  152|  19.9k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  19.9k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  19.9k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  19.9k|                                                                            \
  |  |  156|  19.9k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  19.9k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 19.5k, False: 480]
  |  |  ------------------
  |  |  158|  19.9k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  19.5k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  19.9k|}
  ------------------
 2568|  19.9k|        u4_ldz = CLZ(u4_word);
 2569|       |        /* Flush the ps_bitstrm */
 2570|  19.9k|        u4_bitstream_offset += (u4_ldz + 1);
 2571|       |        /* Read the suffix from the ps_bitstrm */
 2572|  19.9k|        u4_word = 0;
 2573|  19.9k|        if(u4_ldz) GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  7.31k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  7.31k|{                                                                           \
  |  |  122|  7.31k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  7.31k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  7.31k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  7.31k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  7.31k|                                                                            \
  |  |  127|  7.31k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 6.63k, False: 681]
  |  |  ------------------
  |  |  128|  7.31k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  6.63k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  7.31k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  7.31k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  7.31k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  7.31k|}                                                                           \
  ------------------
  |  Branch (2573:12): [True: 7.31k, False: 12.6k]
  ------------------
 2574|  19.9k|        *pu4_bitstrm_ofst = u4_bitstream_offset;
 2575|  19.9k|        u4_cbp = ((1 << u4_ldz) + u4_word - 1);
 2576|       |
 2577|  19.9k|        if(u4_cbp > 47) return ERROR_CBP;
  ------------------
  |  Branch (2577:12): [True: 397, False: 19.6k]
  ------------------
 2578|       |
 2579|  19.6k|        u4_cbp = *((UWORD8 *) gau1_ih264d_cbp_inter + u4_cbp);
 2580|  19.6k|        COPYTHECONTEXT("coded_block_pattern", u4_cbp);
 2581|  19.6k|        ps_cur_mb_info->u1_cbp = u4_cbp;
 2582|       |
 2583|       |        /* Read the transform8x8 u4_flag if present */
 2584|  19.6k|        if((ps_dec->s_high_profile.u1_transform8x8_present) && (u4_cbp & 0xf) &&
  ------------------
  |  Branch (2584:12): [True: 2.65k, False: 16.9k]
  |  Branch (2584:64): [True: 1.18k, False: 1.47k]
  ------------------
 2585|  1.18k|           u1_no_submb_part_size_lt8x8_flag)
  ------------------
  |  Branch (2585:12): [True: 982, False: 199]
  ------------------
 2586|    982|        {
 2587|    982|            ps_cur_mb_info->u1_tran_form8x8 = ih264d_get_bit_h264(ps_bitstrm);
 2588|    982|            COPYTHECONTEXT("transform_size_8x8_flag", ps_cur_mb_info->u1_tran_form8x8);
 2589|    982|            ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = ps_cur_mb_info->u1_tran_form8x8;
 2590|    982|        }
 2591|       |
 2592|       |        /* Read mb_qp_delta */
 2593|  19.6k|        if(u4_cbp)
  ------------------
  |  Branch (2593:12): [True: 6.91k, False: 12.6k]
  ------------------
 2594|  6.91k|        {
 2595|  6.91k|            WORD32 i_temp;
 2596|  6.91k|            UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
 2597|  6.91k|            UWORD32 u4_word, u4_ldz, u4_abs_val;
 2598|       |
 2599|       |            /***************************************************************/
 2600|       |            /* Find leading zeros in next 32 bits                          */
 2601|       |            /***************************************************************/
 2602|  6.91k|            NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  6.91k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  6.91k|{                                                                           \
  |  |  152|  6.91k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  6.91k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  6.91k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  6.91k|                                                                            \
  |  |  156|  6.91k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  6.91k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 6.56k, False: 355]
  |  |  ------------------
  |  |  158|  6.91k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  6.56k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  6.91k|}
  ------------------
 2603|  6.91k|            u4_ldz = CLZ(u4_word);
 2604|       |
 2605|       |            /* Flush the ps_bitstrm */
 2606|  6.91k|            u4_bitstream_offset += (u4_ldz + 1);
 2607|       |
 2608|       |            /* Read the suffix from the ps_bitstrm */
 2609|  6.91k|            u4_word = 0;
 2610|  6.91k|            if(u4_ldz) GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  4.28k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  4.28k|{                                                                           \
  |  |  122|  4.28k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  4.28k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  4.28k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  4.28k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  4.28k|                                                                            \
  |  |  127|  4.28k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 3.92k, False: 360]
  |  |  ------------------
  |  |  128|  4.28k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  3.92k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  4.28k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  4.28k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  4.28k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  4.28k|}                                                                           \
  ------------------
  |  Branch (2610:16): [True: 4.28k, False: 2.62k]
  ------------------
 2611|       |
 2612|  6.91k|            *pu4_bitstrm_ofst = u4_bitstream_offset;
 2613|  6.91k|            u4_abs_val = ((1 << u4_ldz) + u4_word) >> 1;
 2614|       |
 2615|  6.91k|            if(u4_word & 0x1)
  ------------------
  |  Branch (2615:16): [True: 2.28k, False: 4.63k]
  ------------------
 2616|  2.28k|                i_temp = (-(WORD32) u4_abs_val);
 2617|  4.63k|            else
 2618|  4.63k|                i_temp = (u4_abs_val);
 2619|       |
 2620|  6.91k|            if((i_temp < -26) || (i_temp > 25)) return ERROR_INV_RANGE_QP_T;
  ------------------
  |  Branch (2620:16): [True: 93, False: 6.82k]
  |  Branch (2620:34): [True: 155, False: 6.66k]
  ------------------
 2621|       |            // inlinined ih264d_sev
 2622|       |
 2623|  6.66k|            COPYTHECONTEXT("mb_qp_delta", i_temp);
 2624|  6.66k|            if(i_temp)
  ------------------
  |  Branch (2624:16): [True: 4.03k, False: 2.62k]
  ------------------
 2625|  4.03k|            {
 2626|  4.03k|                ret = ih264d_update_qp(ps_dec, (WORD8) i_temp);
 2627|  4.03k|                if(ret != OK) return ret;
  ------------------
  |  |  114|  4.03k|#define OK        0
  ------------------
  |  Branch (2627:20): [True: 0, False: 4.03k]
  ------------------
 2628|  4.03k|            }
 2629|       |
 2630|       |            /*change to support start to end idx*/
 2631|  6.66k|            ret = ih264d_parse_residual4x4_cavlc(ps_dec, ps_cur_mb_info, 0);
 2632|  6.66k|            if(ret != OK) return ret;
  ------------------
  |  |  114|  6.66k|#define OK        0
  ------------------
  |  Branch (2632:16): [True: 251, False: 6.41k]
  ------------------
 2633|  6.41k|            if(EXCEED_OFFSET(ps_bitstrm)) return ERROR_EOB_TERMINATE_T;
  ------------------
  |  |   93|  6.41k|  (ps_bitstrm->u4_ofst > ps_bitstrm->u4_max_ofst)
  |  |  ------------------
  |  |  |  Branch (93:3): [True: 234, False: 6.18k]
  |  |  ------------------
  ------------------
 2634|  6.41k|        }
 2635|  12.6k|        else
 2636|  12.6k|        {
 2637|  12.6k|            ih264d_update_nnz_for_skipmb(ps_dec, ps_cur_mb_info, CAVLC);
  ------------------
  |  |  338|  12.6k|#define CAVLC  0
  ------------------
 2638|  12.6k|        }
 2639|  19.6k|    }
 2640|       |
 2641|  18.8k|    return OK;
  ------------------
  |  |  114|  18.8k|#define OK        0
  ------------------
 2642|  19.9k|}
isvcd_mark_err_slice_skip:
 2657|  94.2k|{
 2658|  94.2k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
 2659|  94.2k|    WORD32 i2_cur_mb_addr;
 2660|  94.2k|    UWORD32 u1_num_mbs;
 2661|  94.2k|    UWORD32 u1_mb_idx = ps_dec->u4_mb_idx;
 2662|  94.2k|    UWORD32 i2_mb_skip_run;
 2663|  94.2k|    UWORD32 u1_num_mbs_next, u1_end_of_row;
 2664|  94.2k|    const UWORD32 i2_pic_wdin_mbs = ps_dec->u2_frm_wd_in_mbs;
 2665|  94.2k|    UWORD32 u1_slice_end;
 2666|  94.2k|    UWORD32 u1_tfr_n_mb;
 2667|  94.2k|    UWORD32 u1_decode_nmb;
 2668|  94.2k|    dec_slice_params_t *ps_slice = ps_dec->ps_cur_slice;
 2669|  94.2k|    deblk_mb_t *ps_cur_deblk_mb;
 2670|  94.2k|    dec_mb_info_t *ps_cur_mb_info;
 2671|  94.2k|    dec_svc_mb_info_t *ps_svc_cur_mb_info;
 2672|  94.2k|    parse_pmbarams_t *ps_parse_mb_data;
 2673|  94.2k|    UWORD32 u1_inter_mb_type;
 2674|  94.2k|    UWORD32 u1_deblk_mb_type;
 2675|  94.2k|    UWORD32 u1_mbaff;
 2676|  94.2k|    parse_part_params_t *ps_part_info;
 2677|  94.2k|    WORD32 ret;
 2678|  94.2k|    UNUSED(u1_is_idr_slice);
  ------------------
  |  |   45|  94.2k|#define UNUSED(x) ((void)(x))
  ------------------
 2679|       |
 2680|  94.2k|    ps_svc_lyr_dec->u1_error_in_cur_frame = 1;
 2681|  94.2k|    if(ps_dec->ps_dec_err_status->u1_err_flag & REJECT_CUR_PIC)
  ------------------
  |  |  602|  94.2k|#define REJECT_CUR_PIC    (0x01)
  ------------------
  |  Branch (2681:8): [True: 0, False: 94.2k]
  ------------------
 2682|      0|    {
 2683|      0|        ih264d_err_pic_dispbuf_mgr(ps_dec);
 2684|      0|        return 0;
 2685|      0|    }
 2686|       |
 2687|  94.2k|    if(ps_dec->ps_cur_slice->u1_mbaff_frame_flag && (num_mb_skip & 1))
  ------------------
  |  Branch (2687:8): [True: 0, False: 94.2k]
  |  Branch (2687:53): [True: 0, False: 0]
  ------------------
 2688|      0|    {
 2689|      0|        num_mb_skip++;
 2690|      0|    }
 2691|  94.2k|    ps_dec->ps_dpb_cmds->u1_long_term_reference_flag = 0;
 2692|  94.2k|    if(prev_slice_err == 1)
  ------------------
  |  Branch (2692:8): [True: 50.2k, False: 43.9k]
  ------------------
 2693|  50.2k|    {
 2694|       |        /* first slice - missing/header corruption */
 2695|  50.2k|        ps_dec->ps_cur_slice->u2_frame_num = u2_frame_num;
 2696|  50.2k|        {
 2697|  50.2k|            WORD32 i, j, poc = 0;
 2698|  50.2k|            ps_dec->ps_cur_slice->u2_first_mb_in_slice = 0;
 2699|  50.2k|            ps_dec->pf_mvpred = ih264d_mvpred_nonmbaff;
 2700|  50.2k|            ps_dec->p_form_mb_part_info = ih264d_form_mb_part_info_bp;
 2701|  50.2k|            ps_dec->p_motion_compensate = ih264d_motion_compensate_bp;
 2702|       |
 2703|  50.2k|            if(ps_dec->ps_cur_pic != NULL)
  ------------------
  |  Branch (2703:16): [True: 50.2k, False: 0]
  ------------------
 2704|  50.2k|            {
 2705|  50.2k|                poc = ps_dec->ps_cur_pic->i4_poc;
 2706|  50.2k|                if(poc <= INT32_MAX - 2) poc += 2;
  ------------------
  |  Branch (2706:20): [True: 50.0k, False: 218]
  ------------------
 2707|  50.2k|            }
 2708|       |
 2709|  50.2k|            j = -1;
 2710|  83.0k|            for(i = 0; i < MAX_NUM_PIC_PARAMS; i++)
  ------------------
  |  |  524|  83.0k|#define MAX_NUM_PIC_PARAMS 256
  ------------------
  |  Branch (2710:24): [True: 83.0k, False: 0]
  ------------------
 2711|  83.0k|            {
 2712|  83.0k|                if(ps_dec->ps_pps[i].u1_is_valid == TRUE)
  ------------------
  |  |  591|  83.0k|#define TRUE    1
  ------------------
  |  Branch (2712:20): [True: 50.6k, False: 32.3k]
  ------------------
 2713|  50.6k|                {
 2714|  50.6k|                    if(ps_dec->ps_pps[i].ps_sps->u1_is_valid == TRUE)
  ------------------
  |  |  591|  50.6k|#define TRUE    1
  ------------------
  |  Branch (2714:24): [True: 50.2k, False: 344]
  ------------------
 2715|  50.2k|                    {
 2716|  50.2k|                        j = i;
 2717|  50.2k|                        break;
 2718|  50.2k|                    }
 2719|  50.6k|                }
 2720|  83.0k|            }
 2721|       |
 2722|       |            // if valid SPS PPS is not found return error
 2723|  50.2k|            if(j == -1)
  ------------------
  |  Branch (2723:16): [True: 0, False: 50.2k]
  ------------------
 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|  50.2k|            if(ps_dec->u4_pic_buf_got == 0)
  ------------------
  |  Branch (2729:16): [True: 0, False: 50.2k]
  ------------------
 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|  50.2k|            ps_dec->ps_ref_pic_buf_lx[0][0]->u1_pic_buf_id = 0;
 2750|  50.2k|            ps_dec->u4_output_present = 0;
 2751|       |
 2752|  50.2k|            {
 2753|  50.2k|                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|  50.2k|                if(0 != ps_dec->s_disp_op.u4_error_code)
  ------------------
  |  Branch (2757:20): [True: 47.3k, False: 2.91k]
  ------------------
 2758|  47.3k|                {
 2759|  47.3k|                    ps_dec->u4_output_present = 0;
 2760|  47.3k|                    ps_dec->u4_fmt_conv_cur_row = ps_dec->s_disp_frame_info.u4_y_ht;
 2761|  47.3k|                }
 2762|  2.91k|                else
 2763|  2.91k|                    ps_dec->u4_output_present = 1;
 2764|  50.2k|            }
 2765|       |
 2766|  50.2k|            if(ps_dec->u1_separate_parse == 1)
  ------------------
  |  Branch (2766:16): [True: 28.3k, False: 21.9k]
  ------------------
 2767|  28.3k|            {
 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|  28.3k|            }
 2794|  50.2k|        }
 2795|  50.2k|    }
 2796|  43.9k|    else
 2797|  43.9k|    {
 2798|       |        // Middle / last slice
 2799|  43.9k|        dec_slice_struct_t *ps_parse_cur_slice;
 2800|  43.9k|        ps_parse_cur_slice = ps_dec->ps_dec_slice_buf + ps_dec->u2_cur_slice_num;
 2801|       |
 2802|  43.9k|        if(ps_dec->u1_slice_header_done && ps_parse_cur_slice == ps_dec->ps_parse_cur_slice)
  ------------------
  |  Branch (2802:12): [True: 43.7k, False: 217]
  |  Branch (2802:44): [True: 43.7k, False: 0]
  ------------------
 2803|  43.7k|        {
 2804|       |            // Slice data corrupted
 2805|       |            // in the case of mbaff, conceal from the even mb.
 2806|  43.7k|            if((ps_dec->ps_cur_slice->u1_mbaff_frame_flag) && (ps_dec->u4_num_mbs_cur_nmb & 1))
  ------------------
  |  Branch (2806:16): [True: 0, False: 43.7k]
  |  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|  43.7k|            u1_num_mbs = ps_dec->u4_num_mbs_cur_nmb;
 2813|  43.7k|            if(u1_num_mbs)
  ------------------
  |  Branch (2813:16): [True: 10.3k, False: 33.3k]
  ------------------
 2814|  10.3k|            {
 2815|  10.3k|                ps_cur_mb_info = ps_dec->ps_nmb_info + u1_num_mbs - 1;
 2816|  10.3k|            }
 2817|  33.3k|            else
 2818|  33.3k|            {
 2819|  33.3k|                if(ps_dec->u1_separate_parse)
  ------------------
  |  Branch (2819:20): [True: 8.99k, False: 24.3k]
  ------------------
 2820|  8.99k|                {
 2821|  8.99k|                    ps_cur_mb_info = ps_dec->ps_nmb_info;
 2822|  8.99k|                }
 2823|  24.3k|                else
 2824|  24.3k|                {
 2825|  24.3k|                    ps_cur_mb_info = ps_dec->ps_nmb_info + ps_dec->u4_num_mbs_prev_nmb - 1;
 2826|  24.3k|                }
 2827|  33.3k|            }
 2828|       |
 2829|  43.7k|            ps_dec->u2_mby = ps_cur_mb_info->u2_mby;
 2830|  43.7k|            ps_dec->u2_mbx = ps_cur_mb_info->u2_mbx;
 2831|  43.7k|            ps_dec->u1_mb_ngbr_availablity = ps_cur_mb_info->u1_mb_ngbr_availablity;
 2832|       |
 2833|  43.7k|            if(u1_num_mbs)
  ------------------
  |  Branch (2833:16): [True: 10.3k, False: 33.3k]
  ------------------
 2834|  10.3k|            {
 2835|       |                // Going back 1 mb
 2836|  10.3k|                ps_dec->pv_parse_tu_coeff_data = ps_dec->pv_prev_mb_parse_tu_coeff_data;
 2837|  10.3k|                ps_dec->u4_cur_mb_addr--;
 2838|  10.3k|                ps_dec->i4_submb_ofst -= SUB_BLK_SIZE;
  ------------------
  |  |  562|  10.3k|#define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|  10.3k|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  |  |               #define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|  10.3k|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  ------------------
 2839|       |
 2840|       |                // Parse/decode N-MB left unparsed
 2841|  10.3k|                if(ps_dec->u1_pr_sl_type == P_SLICE || ps_dec->u1_pr_sl_type == B_SLICE)
  ------------------
  |  |  368|  20.7k|#define P_SLICE  0
  ------------------
                              if(ps_dec->u1_pr_sl_type == P_SLICE || ps_dec->u1_pr_sl_type == B_SLICE)
  ------------------
  |  |  369|  6.04k|#define B_SLICE  1
  ------------------
  |  Branch (2841:20): [True: 4.33k, False: 6.04k]
  |  Branch (2841:56): [True: 4.11k, False: 1.92k]
  ------------------
 2842|  8.45k|                {
 2843|  8.45k|                    if((ps_dec->i4_submb_ofst - ((WORD32) ((u1_num_mbs - u1_mb_idx) << 4))) < 0)
  ------------------
  |  Branch (2843:24): [True: 0, False: 8.45k]
  ------------------
 2844|      0|                    {
 2845|      0|                        ps_dec->i4_submb_ofst = ((u1_num_mbs - u1_mb_idx) << 4);
 2846|      0|                    }
 2847|       |
 2848|  8.45k|                    ret = ps_dec->pf_mvpred_ref_tfr_nby2mb(ps_dec, u1_mb_idx, u1_num_mbs);
 2849|  8.45k|                    ps_dec->ps_part = ps_dec->ps_parse_part_params;
 2850|  8.45k|                    if(ret != OK) return ret;
  ------------------
  |  |  114|  8.45k|#define OK        0
  ------------------
  |  Branch (2850:24): [True: 218, False: 8.23k]
  ------------------
 2851|  8.45k|                }
 2852|       |
 2853|  10.1k|                u1_num_mbs_next = i2_pic_wdin_mbs - ps_dec->u2_mbx - 1;
 2854|  10.1k|                u1_end_of_row =
 2855|  10.1k|                    (!u1_num_mbs_next) &&
  ------------------
  |  Branch (2855:21): [True: 0, False: 10.1k]
  ------------------
 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.1k|                u1_slice_end = 1;
 2858|  10.1k|                u1_tfr_n_mb = 1;
 2859|  10.1k|                ps_cur_mb_info->u1_end_of_slice = u1_slice_end;
 2860|       |
 2861|  10.1k|                if(ps_dec->u1_separate_parse)
  ------------------
  |  Branch (2861:20): [True: 5.46k, False: 4.69k]
  ------------------
 2862|  5.46k|                {
 2863|  5.46k|                    ih264d_parse_tfr_nmb(ps_dec, u1_mb_idx, u1_num_mbs, u1_num_mbs_next,
 2864|  5.46k|                                         u1_tfr_n_mb, u1_end_of_row);
 2865|  5.46k|                    ps_dec->ps_nmb_info += u1_num_mbs;
 2866|  5.46k|                    ps_svc_lyr_dec->ps_svc_nmb_info += u1_num_mbs;
 2867|  5.46k|                }
 2868|  4.69k|                else
 2869|  4.69k|                {
 2870|  4.69k|                    ih264d_decode_recon_tfr_nmb(ps_dec, u1_mb_idx, u1_num_mbs, u1_num_mbs_next,
 2871|  4.69k|                                                u1_tfr_n_mb, u1_end_of_row);
 2872|  4.69k|                }
 2873|  10.1k|                ps_dec->u4_total_mbs_coded += u1_num_mbs;
 2874|  10.1k|                ps_dec->u4_mb_idx = 0;
 2875|  10.1k|                ps_dec->u4_num_mbs_cur_nmb = 0;
 2876|  10.1k|            }
 2877|       |
 2878|  43.5k|            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: 43.5k]
  ------------------
 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|  43.5k|            if(ps_dec->ps_parse_cur_slice->u4_first_mb_in_slice <
  ------------------
  |  Branch (2885:16): [True: 43.2k, False: 224]
  ------------------
 2886|  43.5k|               (UWORD32) (ps_dec->u4_total_mbs_coded >> ps_slice->u1_mbaff_frame_flag))
 2887|  43.2k|            {
 2888|  43.2k|                ps_dec->i2_prev_slice_mbx = ps_dec->u2_mbx;
 2889|  43.2k|                ps_dec->i2_prev_slice_mby = ps_dec->u2_mby;
 2890|  43.2k|                ps_dec->u2_cur_slice_num++;
 2891|  43.2k|                ps_dec->ps_parse_cur_slice++;
 2892|  43.2k|            }
 2893|  43.5k|        }
 2894|    217|        else
 2895|    217|        {
 2896|       |            // Slice missing / header corrupted
 2897|    217|            ps_dec->ps_parse_cur_slice = ps_dec->ps_dec_slice_buf + ps_dec->u2_cur_slice_num;
 2898|    217|        }
 2899|  43.9k|    }
 2900|       |
 2901|       |    /******************************************************/
 2902|       |    /* Initializations to new slice                       */
 2903|       |    /******************************************************/
 2904|  94.0k|    {
 2905|  94.0k|        WORD32 num_entries;
 2906|  94.0k|        WORD32 size;
 2907|  94.0k|        UWORD8 *pu1_buf;
 2908|       |
 2909|  94.0k|        num_entries = MAX_FRAMES;
  ------------------
  |  |  600|  94.0k|#define MAX_FRAMES              16
  ------------------
 2910|  94.0k|        if((1 >= ps_dec->ps_cur_sps->u1_num_ref_frames) && (0 == ps_dec->i4_display_delay))
  ------------------
  |  Branch (2910:12): [True: 69.5k, False: 24.5k]
  |  Branch (2910:60): [True: 0, False: 69.5k]
  ------------------
 2911|      0|        {
 2912|      0|            num_entries = 1;
 2913|      0|        }
 2914|  94.0k|        num_entries = ((2 * num_entries) + 1);
 2915|  94.0k|        num_entries *= 2;
 2916|       |
 2917|  94.0k|        size = num_entries * sizeof(void *);
 2918|  94.0k|        size += PAD_MAP_IDX_POC * sizeof(void *);
  ------------------
  |  |  100|  94.0k|#define PAD_MAP_IDX_POC             (1)
  ------------------
 2919|       |
 2920|  94.0k|        pu1_buf = (UWORD8 *) ps_dec->pv_map_ref_idx_to_poc_buf;
 2921|  94.0k|        pu1_buf += size * ps_dec->u2_cur_slice_num;
 2922|  94.0k|        ps_dec->ps_parse_cur_slice->ppv_map_ref_idx_to_poc = (volatile void **) pu1_buf;
 2923|  94.0k|    }
 2924|  94.0k|    u1_mbaff = ps_slice->u1_mbaff_frame_flag;
 2925|  94.0k|    ps_dec->ps_cur_slice->u2_first_mb_in_slice = ps_dec->u4_total_mbs_coded >> u1_mbaff;
 2926|  94.0k|    ps_dec->ps_cur_slice->i1_slice_alpha_c0_offset = 0;
 2927|  94.0k|    ps_dec->ps_cur_slice->i1_slice_beta_offset = 0;
 2928|       |
 2929|  94.0k|    if(ps_dec->ps_cur_slice->u1_field_pic_flag)
  ------------------
  |  Branch (2929:8): [True: 0, False: 94.0k]
  ------------------
 2930|      0|        ps_dec->u2_prv_frame_num = ps_dec->ps_cur_slice->u2_frame_num;
 2931|       |
 2932|  94.0k|    ps_dec->ps_parse_cur_slice->u4_first_mb_in_slice = ps_dec->u4_total_mbs_coded >> u1_mbaff;
 2933|  94.0k|    ps_dec->ps_parse_cur_slice->u2_log2Y_crwd = ps_dec->ps_cur_slice->u2_log2Y_crwd;
 2934|       |
 2935|  94.0k|    if(ps_dec->u1_separate_parse)
  ------------------
  |  Branch (2935:8): [True: 42.8k, False: 51.1k]
  ------------------
 2936|  42.8k|    {
 2937|  42.8k|        ps_dec->ps_parse_cur_slice->pv_tu_coeff_data_start = ps_dec->pv_parse_tu_coeff_data;
 2938|  42.8k|    }
 2939|  51.1k|    else
 2940|  51.1k|    {
 2941|  51.1k|        ps_dec->pv_proc_tu_coeff_data = ps_dec->pv_parse_tu_coeff_data;
 2942|  51.1k|    }
 2943|       |
 2944|       |    /******************************************************/
 2945|       |    /* Initializations specific to P slice                */
 2946|       |    /******************************************************/
 2947|  94.0k|    u1_inter_mb_type = P_MB;
  ------------------
  |  |  419|  94.0k|#define P_MB        2
  ------------------
 2948|  94.0k|    u1_deblk_mb_type = D_INTER_MB;
  ------------------
  |  |  381|  94.0k|#define D_INTER_MB        0
  ------------------
 2949|       |
 2950|  94.0k|    ps_dec->ps_cur_slice->u1_slice_type = P_SLICE;
  ------------------
  |  |  368|  94.0k|#define P_SLICE  0
  ------------------
 2951|  94.0k|    ps_dec->ps_parse_cur_slice->slice_type = P_SLICE;
  ------------------
  |  |  368|  94.0k|#define P_SLICE  0
  ------------------
 2952|  94.0k|    ps_dec->pf_mvpred_ref_tfr_nby2mb = ih264d_mv_pred_ref_tfr_nby2_pmb;
 2953|  94.0k|    ps_dec->ps_part = ps_dec->ps_parse_part_params;
 2954|  94.0k|    ps_dec->u2_mbx =
 2955|  94.0k|        (MOD(ps_dec->ps_cur_slice->u2_first_mb_in_slice - 1, ps_dec->u2_frm_wd_in_mbs));
  ------------------
  |  |   64|  94.0k|#define MOD(x,y) ((x)%(y))
  ------------------
 2956|  94.0k|    ps_dec->u2_mby =
 2957|  94.0k|        (DIV(ps_dec->ps_cur_slice->u2_first_mb_in_slice - 1, ps_dec->u2_frm_wd_in_mbs));
  ------------------
  |  |   65|  94.0k|#define DIV(x,y) ((x)/(y))
  ------------------
 2958|  94.0k|    ps_dec->u2_mby <<= u1_mbaff;
 2959|       |
 2960|       |    /******************************************************/
 2961|       |    /* Parsing / decoding the slice                       */
 2962|       |    /******************************************************/
 2963|  94.0k|    ret = isvcd_parse_interlayer_resamp_func_init(ps_svc_lyr_dec,
 2964|  94.0k|                                                  ps_dec->ps_cur_slice->u2_first_mb_in_slice);
 2965|  94.0k|    ps_dec->u1_slice_header_done = 2;
 2966|       |
 2967|  94.0k|    ps_dec->u1_qp = ps_slice->u1_slice_qp;
 2968|  94.0k|    ih264d_update_qp(ps_dec, 0);
 2969|  94.0k|    u1_mb_idx = ps_dec->u4_mb_idx;
 2970|  94.0k|    ps_parse_mb_data = ps_dec->ps_parse_mb_data;
 2971|  94.0k|    u1_num_mbs = u1_mb_idx;
 2972|  94.0k|    u1_slice_end = 0;
 2973|  94.0k|    u1_tfr_n_mb = 0;
 2974|  94.0k|    u1_decode_nmb = 0;
 2975|  94.0k|    i2_cur_mb_addr = ps_dec->u4_total_mbs_coded;
 2976|  94.0k|    i2_mb_skip_run = num_mb_skip;
 2977|  94.0k|    if(0 == ps_dec->u4_total_mbs_coded)
  ------------------
  |  Branch (2977:8): [True: 50.2k, False: 43.7k]
  ------------------
 2978|  50.2k|    {
 2979|  50.2k|        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|  50.2k|        ps_dec->ps_cur_mb_row += 2;
 2982|  50.2k|        ps_dec->ps_top_mb_row = ps_dec->ps_nbr_mb_row;
 2983|  50.2k|        ps_dec->ps_top_mb_row +=
 2984|  50.2k|            ((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|  50.2k|        ps_dec->ps_top_mb_row += 2;
 2987|       |
 2988|       |        /* CHANGED CODE */
 2989|  50.2k|        ps_dec->ps_mv_cur = ps_dec->s_cur_pic.ps_mv;
 2990|  50.2k|        ps_dec->ps_mv_left = ps_dec->s_cur_pic.ps_mv;
 2991|  50.2k|        ps_dec->ps_mv_top = ps_dec->ps_mv_top_p[0];
 2992|  50.2k|        ps_dec->ps_deblk_mbn = ps_dec->ps_deblk_pic;
 2993|  50.2k|        ps_dec->ps_mv = ps_dec->s_cur_pic.ps_mv;
 2994|  50.2k|        ps_dec->ps_mv_bank_cur = ps_dec->s_cur_pic.ps_mv;
 2995|  50.2k|        ps_dec->pu1_col_zero_flag = ps_dec->s_cur_pic.pu1_col_zero_flag;
 2996|  50.2k|        ps_dec->ps_part = ps_dec->ps_parse_part_params;
 2997|  50.2k|        ps_dec->pf_mvpred_ref_tfr_nby2mb = isvcd_mv_pred_ref_tfr_nby2_epmb;
 2998|  50.2k|    }
 2999|  9.76M|    while(!u1_slice_end)
  ------------------
  |  Branch (2999:11): [True: 9.67M, False: 83.8k]
  ------------------
 3000|  9.67M|    {
 3001|  9.67M|        if(i2_cur_mb_addr > ps_dec->ps_cur_sps->u4_max_mb_addr) break;
  ------------------
  |  Branch (3001:12): [True: 10.1k, False: 9.66M]
  ------------------
 3002|       |
 3003|  9.66M|        ps_svc_cur_mb_info = ps_svc_lyr_dec->ps_svc_nmb_info + u1_num_mbs;
 3004|  9.66M|        ps_cur_mb_info = ps_dec->ps_nmb_info + u1_num_mbs;
 3005|  9.66M|        ps_dec->u4_num_mbs_cur_nmb = u1_num_mbs;
 3006|  9.66M|        ps_cur_mb_info->u1_Mux = 0;
 3007|  9.66M|        ps_dec->u4_num_pmbair = (u1_num_mbs >> u1_mbaff);
 3008|  9.66M|        ps_cur_deblk_mb = ps_dec->ps_deblk_mbn + u1_num_mbs;
 3009|  9.66M|        ps_cur_mb_info->u1_end_of_slice = 0;
 3010|       |
 3011|       |        /* Storing Default partition info */
 3012|  9.66M|        ps_parse_mb_data->u1_num_part = 1;
 3013|  9.66M|        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|  9.66M|        if(u1_mbaff)
  ------------------
  |  Branch (3019:12): [True: 0, False: 9.66M]
  ------------------
 3020|      0|            ih264d_get_mb_info_cavlc_mbaff(ps_dec, i2_cur_mb_addr, ps_cur_mb_info, i2_mb_skip_run);
 3021|  9.66M|        else
 3022|  9.66M|            isvcd_get_mb_info_cavlc_nonmbaff(ps_dec, i2_cur_mb_addr, ps_cur_mb_info,
 3023|  9.66M|                                             i2_mb_skip_run);
 3024|       |
 3025|  9.66M|        {
 3026|  9.66M|            UWORD16 *pu2_res_luma_csbp;
 3027|       |
 3028|       |            /*Pointer assignment for Residual NNZ */
 3029|  9.66M|            pu2_res_luma_csbp = ps_svc_lyr_dec->pu2_frm_res_luma_csbp + ps_cur_mb_info->u2_mbx;
 3030|  9.66M|            pu2_res_luma_csbp +=
 3031|  9.66M|                ps_cur_mb_info->u2_mby * ps_svc_lyr_dec->i4_frm_res_luma_csbp_stride;
 3032|  9.66M|            *pu2_res_luma_csbp = 0;
 3033|  9.66M|            ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb =
 3034|  9.66M|                ps_svc_lyr_dec->ps_inter_lyr_mb_prms_frm_start + ps_cur_mb_info->u2_mbx +
 3035|  9.66M|                (ps_svc_lyr_dec->u2_inter_lyr_mb_prms_stride * (ps_cur_mb_info->u2_mby));
 3036|  9.66M|            ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->i1_mb_mode = SVC_INTER_MB;
  ------------------
  |  |  114|  9.66M|#define SVC_INTER_MB (1 << 0)       /*!< Intra MBs other than IPCM and I_BL */
  ------------------
 3037|  9.66M|            ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->i1_tx_size =
 3038|  9.66M|                ps_cur_mb_info->u1_tran_form8x8;
 3039|  9.66M|            ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->u2_luma_nnz = 0;
 3040|  9.66M|            ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->u1_chroma_nnz = 0;
 3041|  9.66M|        }
 3042|       |
 3043|       |        /* Set the deblocking parameters for this MB */
 3044|  9.66M|        if(ps_dec->u4_app_disable_deblk_frm == 0)
  ------------------
  |  Branch (3044:12): [True: 9.66M, False: 0]
  ------------------
 3045|  9.66M|        {
 3046|  9.66M|            ih264d_set_deblocking_parameters(ps_cur_deblk_mb, ps_slice,
 3047|  9.66M|                                             ps_dec->u1_mb_ngbr_availablity,
 3048|  9.66M|                                             ps_dec->u1_cur_mb_fld_dec_flag);
 3049|  9.66M|        }
 3050|       |
 3051|       |        /* Set appropriate flags in ps_cur_mb_info and ps_dec */
 3052|  9.66M|        ps_dec->i1_prev_mb_qp_delta = 0;
 3053|  9.66M|        ps_dec->u1_sub_mb_num = 0;
 3054|  9.66M|        ps_cur_mb_info->u1_mb_type = MB_SKIP;
  ------------------
  |  |   59|  9.66M|#define MB_SKIP 255
  ------------------
 3055|  9.66M|        ps_cur_mb_info->u1_mb_mc_mode = PRED_16x16;
  ------------------
  |  |  450|  9.66M|#define PRED_16x16  0
  ------------------
 3056|  9.66M|        ps_cur_mb_info->u1_cbp = 0;
 3057|       |
 3058|       |        /* set appropriat flags in svc cur MB info */
 3059|  9.66M|        ps_svc_cur_mb_info->u1_base_mode_flag = 0;
 3060|  9.66M|        ps_svc_cur_mb_info->u1_residual_prediction_flag = 0;
 3061|  9.66M|        ps_svc_cur_mb_info->u1_crop_window_flag = 0;
 3062|  9.66M|        ps_svc_cur_mb_info->au1_motion_pred_flag[0] = 0;
 3063|  9.66M|        ps_svc_cur_mb_info->au1_motion_pred_flag[1] = 0;
 3064|       |
 3065|       |        /* Storing Skip partition info */
 3066|  9.66M|        ps_part_info = ps_dec->ps_part;
 3067|  9.66M|        ps_part_info->u1_is_direct = PART_DIRECT_16x16;
  ------------------
  |  |  572|  9.66M|#define PART_DIRECT_16x16              2
  ------------------
 3068|  9.66M|        ps_part_info->u1_sub_mb_num = 0;
 3069|  9.66M|        ps_dec->ps_part++;
 3070|       |
 3071|       |        /* Update Nnzs */
 3072|  9.66M|        ih264d_update_nnz_for_skipmb(ps_dec, ps_cur_mb_info, CAVLC);
  ------------------
  |  |  338|  9.66M|#define CAVLC  0
  ------------------
 3073|       |
 3074|  9.66M|        ps_cur_mb_info->ps_curmb->u1_mb_type = u1_inter_mb_type;
 3075|  9.66M|        ps_cur_deblk_mb->u1_mb_type |= u1_deblk_mb_type;
 3076|       |
 3077|  9.66M|        if(ps_svc_lyr_dec->u1_layer_identifier != TARGET_LAYER)
  ------------------
  |  |  110|  9.66M|#define TARGET_LAYER 2
  ------------------
  |  Branch (3077:12): [True: 313k, False: 9.35M]
  ------------------
 3078|   313k|        {
 3079|   313k|            ps_cur_deblk_mb->u1_deblocking_mode = MB_DISABLE_FILTERING;
  ------------------
  |  |   70|   313k|#define MB_DISABLE_FILTERING          0x01
  ------------------
 3080|   313k|        }
 3081|       |
 3082|  9.66M|        i2_mb_skip_run--;
 3083|  9.66M|        ps_cur_deblk_mb->u1_mb_qp = ps_dec->u1_qp;
 3084|       |
 3085|  9.66M|        if(u1_mbaff)
  ------------------
  |  Branch (3085:12): [True: 0, False: 9.66M]
  ------------------
 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|  9.66M|        i2_cur_mb_addr++;
 3094|  9.66M|        u1_num_mbs++;
 3095|  9.66M|        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|  9.66M|        u1_num_mbs_next = i2_pic_wdin_mbs - ps_dec->u2_mbx - 1;
 3103|  9.66M|        u1_end_of_row = (!u1_num_mbs_next) && (!(u1_mbaff && (u1_num_mbs & 0x01)));
  ------------------
  |  Branch (3103:25): [True: 1.79M, False: 7.87M]
  |  Branch (3103:50): [True: 0, False: 1.79M]
  |  Branch (3103:62): [True: 0, False: 0]
  ------------------
 3104|  9.66M|        u1_slice_end = !i2_mb_skip_run;
 3105|  9.66M|        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.76M, False: 7.90M]
  |  Branch (3105:66): [True: 35.7k, False: 7.87M]
  |  Branch (3105:83): [True: 107, False: 7.87M]
  ------------------
 3106|  9.66M|        u1_decode_nmb = u1_tfr_n_mb || u1_slice_end;
  ------------------
  |  Branch (3106:25): [True: 1.79M, False: 7.87M]
  |  Branch (3106:40): [True: 0, False: 7.87M]
  ------------------
 3107|  9.66M|        ps_cur_mb_info->u1_end_of_slice = u1_slice_end;
 3108|       |
 3109|  9.66M|        if(u1_decode_nmb)
  ------------------
  |  Branch (3109:12): [True: 1.79M, False: 7.87M]
  ------------------
 3110|  1.79M|        {
 3111|  1.79M|            if((ps_dec->i4_submb_ofst - ((WORD32) ((u1_num_mbs - u1_mb_idx) << 4))) < 0)
  ------------------
  |  Branch (3111:16): [True: 31.1k, False: 1.76M]
  ------------------
 3112|  31.1k|            {
 3113|  31.1k|                ps_dec->i4_submb_ofst = ((u1_num_mbs - u1_mb_idx) << 4);
 3114|  31.1k|            }
 3115|       |
 3116|  1.79M|            ps_dec->pf_mvpred_ref_tfr_nby2mb(ps_dec, u1_mb_idx, u1_num_mbs);
 3117|  1.79M|            ps_parse_mb_data = ps_dec->ps_parse_mb_data;
 3118|  1.79M|            ps_dec->ps_part = ps_dec->ps_parse_part_params;
 3119|       |
 3120|  1.79M|            if(ps_dec->u1_separate_parse)
  ------------------
  |  Branch (3120:16): [True: 912k, False: 885k]
  ------------------
 3121|   912k|            {
 3122|   912k|                ih264d_parse_tfr_nmb(ps_dec, u1_mb_idx, u1_num_mbs, u1_num_mbs_next, u1_tfr_n_mb,
 3123|   912k|                                     u1_end_of_row);
 3124|   912k|                ps_dec->ps_nmb_info += u1_num_mbs;
 3125|   912k|                ps_svc_lyr_dec->ps_svc_nmb_info += u1_num_mbs;
 3126|   912k|            }
 3127|   885k|            else
 3128|   885k|            {
 3129|   885k|                if(ps_svc_lyr_dec->u1_layer_identifier == TARGET_LAYER)
  ------------------
  |  |  110|   885k|#define TARGET_LAYER 2
  ------------------
  |  Branch (3129:20): [True: 792k, False: 93.2k]
  ------------------
 3130|   792k|                {
 3131|   792k|                    ih264d_decode_recon_tfr_nmb(ps_dec, u1_mb_idx, u1_num_mbs, u1_num_mbs_next,
 3132|   792k|                                                u1_tfr_n_mb, u1_end_of_row);
 3133|   792k|                }
 3134|  93.2k|                else
 3135|  93.2k|                {
 3136|  93.2k|                    isvcd_decode_recon_tfr_nmb_base_lyr(ps_svc_lyr_dec, u1_mb_idx, u1_num_mbs,
 3137|  93.2k|                                                        u1_num_mbs_next, u1_tfr_n_mb,
 3138|  93.2k|                                                        u1_end_of_row);
 3139|  93.2k|                }
 3140|   885k|            }
 3141|  1.79M|            ps_dec->u4_total_mbs_coded += u1_num_mbs;
 3142|  1.79M|            if(u1_tfr_n_mb) u1_num_mbs = 0;
  ------------------
  |  Branch (3142:16): [True: 1.79M, False: 0]
  ------------------
 3143|  1.79M|            u1_mb_idx = u1_num_mbs;
 3144|  1.79M|            ps_dec->u4_mb_idx = u1_num_mbs;
 3145|  1.79M|        }
 3146|  9.66M|    }
 3147|       |
 3148|  94.0k|    ps_dec->u4_num_mbs_cur_nmb = 0;
 3149|  94.0k|    ps_dec->ps_cur_slice->u4_mbs_in_slice =
 3150|  94.0k|        i2_cur_mb_addr - ps_dec->ps_parse_cur_slice->u4_first_mb_in_slice;
 3151|       |
 3152|  94.0k|    H264_DEC_DEBUG_PRINT("Mbs in slice: %d\n", ps_dec->ps_cur_slice->u4_mbs_in_slice);
  ------------------
  |  |   39|  94.0k|#define H264_DEC_DEBUG_PRINT(...) {}
  ------------------
 3153|       |
 3154|       |    /* incremented here only if first slice is inserted */
 3155|  94.0k|    if(ps_dec->u4_first_slice_in_pic != 0)
  ------------------
  |  Branch (3155:8): [True: 0, False: 94.0k]
  ------------------
 3156|      0|    {
 3157|      0|        ps_dec->ps_parse_cur_slice++;
 3158|      0|        ps_dec->u2_cur_slice_num++;
 3159|      0|    }
 3160|       |
 3161|  94.0k|    ps_dec->i2_prev_slice_mbx = ps_dec->u2_mbx;
 3162|  94.0k|    ps_dec->i2_prev_slice_mby = ps_dec->u2_mby;
 3163|       |
 3164|  94.0k|    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: 93.8k, False: 163]
  ------------------
 3165|  93.8k|    {
 3166|  93.8k|        ps_dec->u1_pic_decode_done = 1;
 3167|  93.8k|    }
 3168|       |
 3169|  94.0k|    return 0;
 3170|  94.2k|}
isvcd_parse_interlayer_resamp_func_init:
 3184|   227k|{
 3185|   227k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
 3186|   227k|    dec_slice_params_t *ps_slice = ps_dec->ps_cur_slice;
 3187|   227k|    WORD32 ret = OK;
  ------------------
  |  |  114|   227k|#define OK        0
  ------------------
 3188|   227k|    if(ps_svc_lyr_dec->u1_res_init_done == 1)
  ------------------
  |  Branch (3188:8): [True: 94.0k, False: 133k]
  ------------------
 3189|  94.0k|        return ret;
 3190|       |
 3191|   133k|    if(TARGET_LAYER != ps_svc_lyr_dec->u1_layer_identifier)
  ------------------
  |  |  110|   133k|#define TARGET_LAYER 2
  ------------------
  |  Branch (3191:8): [True: 44.3k, False: 88.7k]
  ------------------
 3192|  44.3k|    {
 3193|  44.3k|        ps_slice->u1_disable_dblk_filter_idc = ps_svc_lyr_dec->u1_inter_lyr_disable_dblk_filter_idc;
 3194|  44.3k|        ps_slice->i1_slice_alpha_c0_offset = ps_svc_lyr_dec->i1_inter_lyr_slice_alpha_c0_offset;
 3195|  44.3k|        ps_slice->i1_slice_beta_offset = ps_svc_lyr_dec->i1_inter_lyr_slice_beta_offset;
 3196|  44.3k|    }
 3197|       |
 3198|   133k|    if(0 == u2_first_mb_in_slice)
  ------------------
  |  Branch (3198:8): [True: 133k, False: 0]
  ------------------
 3199|   133k|    {
 3200|   133k|        ret = isvcd_populate_res_prms(ps_svc_lyr_dec);
 3201|   133k|        if(ret != OK) return NOT_OK;
  ------------------
  |  |  114|   133k|#define OK        0
  ------------------
                      if(ret != OK) return NOT_OK;
  ------------------
  |  |  116|    501|#define NOT_OK    -1
  ------------------
  |  Branch (3201:12): [True: 501, False: 132k]
  ------------------
 3202|   132k|        isvcd_crop_wnd_flag_res_int(ps_svc_lyr_dec);
 3203|   132k|        ret = isvcd_comp_mode_mv_res_init(ps_svc_lyr_dec);
 3204|   132k|        if(ret != OK) return NOT_OK;
  ------------------
  |  |  114|   132k|#define OK        0
  ------------------
                      if(ret != OK) return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  |  Branch (3204:12): [True: 0, False: 132k]
  ------------------
 3205|   132k|        ret = isvcd_ii_pred_res_init(ps_svc_lyr_dec);
 3206|   132k|        if(ret != OK) return NOT_OK;
  ------------------
  |  |  114|   132k|#define OK        0
  ------------------
                      if(ret != OK) return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  |  Branch (3206:12): [True: 0, False: 132k]
  ------------------
 3207|   132k|        ret = isvcd_intra_resamp_res_init(ps_svc_lyr_dec);
 3208|   132k|        if(ret != OK) return NOT_OK;
  ------------------
  |  |  114|   132k|#define OK        0
  ------------------
                      if(ret != OK) return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  |  Branch (3208:12): [True: 0, False: 132k]
  ------------------
 3209|   132k|        ret = isvcd_residual_samp_res_init(ps_svc_lyr_dec);
 3210|   132k|        if(ret != OK) return NOT_OK;
  ------------------
  |  |  114|   132k|#define OK        0
  ------------------
                      if(ret != OK) return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  |  Branch (3210:12): [True: 0, False: 132k]
  ------------------
 3211|       |
 3212|   132k|        ps_svc_lyr_dec->u1_res_init_done = 1;
 3213|   132k|    }
 3214|       |
 3215|   132k|    return ret;
 3216|   133k|}
isvcd_parse_pslice:
 3231|  64.1k|{
 3232|  64.1k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
 3233|  64.1k|    dec_pic_params_t *ps_pps = ps_dec->ps_cur_pps;
 3234|  64.1k|    dec_slice_params_t *ps_cur_slice = ps_dec->ps_cur_slice;
 3235|  64.1k|    dec_bit_stream_t *ps_bitstrm = ps_dec->ps_bitstrm;
 3236|  64.1k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
 3237|  64.1k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
 3238|  64.1k|    UWORD8 u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
 3239|  64.1k|    UWORD8 u1_field_pic_flag = ps_cur_slice->u1_field_pic_flag;
 3240|  64.1k|    UWORD64 u8_ref_idx_l0;
 3241|  64.1k|    UWORD32 u4_temp;
 3242|  64.1k|    WORD32 i_temp;
 3243|  64.1k|    WORD32 ret;
 3244|  64.1k|    WORD64 i8_temp;
 3245|       |
 3246|       |    /*--------------------------------------------------------------------*/
 3247|       |    /* Read remaining contents of the slice header                        */
 3248|       |    /*--------------------------------------------------------------------*/
 3249|  64.1k|    {
 3250|  64.1k|        WORD8 *pi1_buf;
 3251|  64.1k|        WORD16 *pi2_mv = ps_dec->s_default_mv_pred.i2_mv;
 3252|  64.1k|        WORD32 *pi4_mv = (WORD32 *) pi2_mv;
 3253|  64.1k|        WORD16 *pi16_refFrame;
 3254|       |
 3255|  64.1k|        pi1_buf = ps_dec->s_default_mv_pred.i1_ref_frame;
 3256|  64.1k|        pi16_refFrame = (WORD16 *) pi1_buf;
 3257|  64.1k|        *pi4_mv = 0;
 3258|  64.1k|        *(pi4_mv + 1) = 0;
 3259|  64.1k|        *pi16_refFrame = OUT_OF_RANGE_REF;
  ------------------
  |  |   45|  64.1k|#define OUT_OF_RANGE_REF  -1
  ------------------
 3260|  64.1k|        ps_dec->s_default_mv_pred.u1_col_ref_pic_idx = (UWORD8) -1;
 3261|  64.1k|        ps_dec->s_default_mv_pred.u1_pic_type = (UWORD8) -1;
 3262|  64.1k|    }
 3263|       |
 3264|  64.1k|    ps_cur_slice->u1_num_ref_idx_active_override_flag = ih264d_get_bit_h264(ps_bitstrm);
 3265|  64.1k|    COPYTHECONTEXT("SH: num_ref_idx_override_flag",
 3266|  64.1k|                   ps_cur_slice->u1_num_ref_idx_active_override_flag);
 3267|       |
 3268|  64.1k|    u8_ref_idx_l0 = ps_dec->ps_cur_pps->u1_num_ref_idx_lx_active[0];
 3269|  64.1k|    if(ps_cur_slice->u1_num_ref_idx_active_override_flag)
  ------------------
  |  Branch (3269:8): [True: 37.5k, False: 26.6k]
  ------------------
 3270|  37.5k|    {
 3271|  37.5k|        u8_ref_idx_l0 = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf) + (UWORD64) 1;
 3272|  37.5k|    }
 3273|       |
 3274|  64.1k|    {
 3275|  64.1k|        UWORD8 u1_max_ref_idx = H264_MAX_REF_PICS << u1_field_pic_flag;
  ------------------
  |  |  534|  64.1k|#define H264_MAX_REF_PICS         16
  ------------------
 3276|  64.1k|        if(u8_ref_idx_l0 >= u1_max_ref_idx)
  ------------------
  |  Branch (3276:12): [True: 759, False: 63.4k]
  ------------------
 3277|    759|        {
 3278|    759|            return ERROR_NUM_REF;
 3279|    759|        }
 3280|  63.4k|        ps_cur_slice->u1_num_ref_idx_lx_active[0] = (UWORD8) u8_ref_idx_l0;
 3281|  63.4k|        COPYTHECONTEXT("SH: num_ref_idx_l0_active_minus1",
 3282|  63.4k|                       ps_cur_slice->u1_num_ref_idx_lx_active[0] - 1);
 3283|  63.4k|    }
 3284|       |
 3285|      0|    {
 3286|  63.4k|        UWORD8 uc_refIdxReFlagL0 = ih264d_get_bit_h264(ps_bitstrm);
 3287|  63.4k|        COPYTHECONTEXT("SH: ref_pic_list_reordering_flag_l0", uc_refIdxReFlagL0);
 3288|       |
 3289|  63.4k|        ih264d_init_ref_idx_lx_p(ps_dec);
 3290|       |        /* Store the value for future slices in the same picture */
 3291|  63.4k|        ps_dec->u1_num_ref_idx_lx_active_prev = ps_cur_slice->u1_num_ref_idx_lx_active[0];
 3292|       |
 3293|       |        /* Modified temporarily */
 3294|  63.4k|        if(uc_refIdxReFlagL0)
  ------------------
  |  Branch (3294:12): [True: 25.4k, False: 37.9k]
  ------------------
 3295|  25.4k|        {
 3296|  25.4k|            WORD8 ret;
 3297|  25.4k|            ps_dec->ps_ref_pic_buf_lx[0] = ps_dec->ps_dpb_mgr->ps_mod_dpb[0];
 3298|  25.4k|            ret = ih264d_ref_idx_reordering(ps_dec, 0);
 3299|  25.4k|            if(ret == -1) return ERROR_REFIDX_ORDER_T;
  ------------------
  |  Branch (3299:16): [True: 0, False: 25.4k]
  ------------------
 3300|  25.4k|            ps_dec->ps_ref_pic_buf_lx[0] = ps_dec->ps_dpb_mgr->ps_mod_dpb[0];
 3301|  25.4k|        }
 3302|  37.9k|        else
 3303|  37.9k|            ps_dec->ps_ref_pic_buf_lx[0] = ps_dec->ps_dpb_mgr->ps_init_dpb[0];
 3304|  63.4k|    }
 3305|       |    /* Create refIdx to POC mapping */
 3306|  63.4k|    {
 3307|  63.4k|        void **pui_map_ref_idx_to_poc_lx0, **pui_map_ref_idx_to_poc_lx1;
 3308|  63.4k|        WORD8 idx;
 3309|  63.4k|        struct pic_buffer_t *ps_pic;
 3310|       |
 3311|  63.4k|        pui_map_ref_idx_to_poc_lx0 = ps_dec->ppv_map_ref_idx_to_poc + FRM_LIST_L0;
  ------------------
  |  |   89|  63.4k|#define FRM_LIST_L0             0                                               //0
  ------------------
 3312|  63.4k|        pui_map_ref_idx_to_poc_lx0[0] = 0;
 3313|  63.4k|        pui_map_ref_idx_to_poc_lx0++;
 3314|   194k|        for(idx = 0; idx < ps_cur_slice->u1_num_ref_idx_lx_active[0]; idx++)
  ------------------
  |  Branch (3314:22): [True: 131k, False: 63.4k]
  ------------------
 3315|   131k|        {
 3316|   131k|            ps_pic = ps_dec->ps_ref_pic_buf_lx[0][idx];
 3317|   131k|            pui_map_ref_idx_to_poc_lx0[idx] = (ps_pic->pu1_buf1);
 3318|   131k|        }
 3319|       |
 3320|       |        /* Bug Fix Deblocking */
 3321|  63.4k|        pui_map_ref_idx_to_poc_lx1 = ps_dec->ppv_map_ref_idx_to_poc + FRM_LIST_L1;
  ------------------
  |  |   90|  63.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|  63.4k|#define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  600|  63.4k|#define MAX_FRAMES              16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3322|  63.4k|        pui_map_ref_idx_to_poc_lx1[0] = 0;
 3323|       |
 3324|  63.4k|        if(u1_mbaff)
  ------------------
  |  Branch (3324:12): [True: 0, False: 63.4k]
  ------------------
 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|  63.4k|    }
 3351|  63.4k|    if(ps_pps->u1_wted_pred_flag)
  ------------------
  |  Branch (3351:8): [True: 15.9k, False: 47.5k]
  ------------------
 3352|  15.9k|    {
 3353|  15.9k|        ret = ih264d_parse_pred_weight_table(ps_cur_slice, ps_bitstrm);
 3354|  15.9k|        if(ret != OK) return ret;
  ------------------
  |  |  114|  15.9k|#define OK        0
  ------------------
  |  Branch (3354:12): [True: 4.60k, False: 11.3k]
  ------------------
 3355|       |
 3356|  11.3k|        ih264d_form_pred_weight_matrix(ps_dec);
 3357|  11.3k|        ps_dec->pu4_wt_ofsts = ps_dec->pu4_wts_ofsts_mat;
 3358|  11.3k|    }
 3359|  47.5k|    else
 3360|  47.5k|    {
 3361|  47.5k|        ps_dec->ps_cur_slice->u2_log2Y_crwd = 0;
 3362|  47.5k|        ps_dec->pu4_wt_ofsts = ps_dec->pu4_wts_ofsts_mat;
 3363|  47.5k|    }
 3364|       |
 3365|  58.8k|    ps_dec->ps_parse_cur_slice->u2_log2Y_crwd = ps_dec->ps_cur_slice->u2_log2Y_crwd;
 3366|       |
 3367|  58.8k|    if(u1_mbaff && (u1_field_pic_flag == 0))
  ------------------
  |  Branch (3367:8): [True: 0, False: 58.8k]
  |  Branch (3367:20): [True: 0, False: 0]
  ------------------
 3368|      0|    {
 3369|      0|        ih264d_convert_frm_mbaff_list(ps_dec);
 3370|      0|    }
 3371|       |
 3372|       |    /* G050 */
 3373|  58.8k|    if(ps_cur_slice->u1_nal_ref_idc != 0)
  ------------------
  |  Branch (3373:8): [True: 56.7k, False: 2.06k]
  ------------------
 3374|  56.7k|    {
 3375|  56.7k|        if(!ps_dec->ps_dpb_cmds->u1_dpb_commands_read)
  ------------------
  |  Branch (3375:12): [True: 56.4k, False: 304]
  ------------------
 3376|  56.4k|        {
 3377|  56.4k|            dec_pic_params_t *ps_pps = ps_dec->ps_cur_pps;
 3378|  56.4k|            dec_seq_params_t *ps_sps_tmp = ps_pps->ps_sps;
 3379|  56.4k|            UWORD8 u1_nal_unit_type_tmp = ps_dec->u1_nal_unit_type;
 3380|       |
 3381|  56.4k|            ps_pps->ps_sps = ps_dec->ps_cur_sps;
 3382|  56.4k|            if(ps_svc_lyr_dec->ps_nal_svc_ext->u1_idr_flag)
  ------------------
  |  Branch (3382:16): [True: 54.9k, False: 1.53k]
  ------------------
 3383|  54.9k|                ps_dec->u1_nal_unit_type = IDR_SLICE_NAL;
  ------------------
  |  |  328|  54.9k|#define IDR_SLICE_NAL                   5
  ------------------
 3384|       |
 3385|  56.4k|            i_temp = ih264d_read_mmco_commands(ps_dec);
 3386|       |
 3387|  56.4k|            ps_pps->ps_sps = ps_sps_tmp;
 3388|  56.4k|            ps_dec->u1_nal_unit_type = u1_nal_unit_type_tmp;
 3389|       |
 3390|  56.4k|            if(i_temp < 0)
  ------------------
  |  Branch (3390:16): [True: 95, False: 56.3k]
  ------------------
 3391|     95|            {
 3392|     95|                return ERROR_DBP_MANAGER_T;
 3393|     95|            }
 3394|  56.3k|            ps_dec->u4_bitoffset = i_temp;
 3395|  56.3k|        }
 3396|    304|        else
 3397|    304|            ps_bitstrm->u4_ofst += ps_dec->u4_bitoffset;
 3398|  56.7k|    }
 3399|       |    /* G050 */
 3400|       |
 3401|  58.7k|    if(ps_pps->u1_entropy_coding_mode == CABAC)
  ------------------
  |  |  339|  58.7k|#define CABAC  1
  ------------------
  |  Branch (3401:8): [True: 8.43k, False: 50.3k]
  ------------------
 3402|  8.43k|    {
 3403|  8.43k|        u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3404|       |
 3405|  8.43k|        if(u4_temp > MAX_CABAC_INIT_IDC)
  ------------------
  |  |  537|  8.43k|#define MAX_CABAC_INIT_IDC        2
  ------------------
  |  Branch (3405:12): [True: 793, False: 7.64k]
  ------------------
 3406|    793|        {
 3407|    793|            return ERROR_INV_SLICE_HDR_T;
 3408|    793|        }
 3409|  7.64k|        ps_cur_slice->u1_cabac_init_idc = u4_temp;
 3410|  7.64k|        COPYTHECONTEXT("SH: cabac_init_idc", ps_cur_slice->u1_cabac_init_idc);
 3411|  7.64k|    }
 3412|       |
 3413|       |    /* Read slice_qp_delta */
 3414|  57.9k|    i8_temp = (WORD64) ps_pps->u1_pic_init_qp + ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3415|  57.9k|    if((i8_temp < MIN_H264_QP) || (i8_temp > MAX_H264_QP))
  ------------------
  |  |  629|  57.9k|#define MIN_H264_QP 0
  ------------------
                  if((i8_temp < MIN_H264_QP) || (i8_temp > MAX_H264_QP))
  ------------------
  |  |  634|  57.3k|#define MAX_H264_QP 51
  ------------------
  |  Branch (3415:8): [True: 590, False: 57.3k]
  |  Branch (3415:35): [True: 2.80k, False: 54.5k]
  ------------------
 3416|  3.39k|    {
 3417|  3.39k|        return ERROR_INV_RANGE_QP_T;
 3418|  3.39k|    }
 3419|  54.5k|    ps_cur_slice->u1_slice_qp = (UWORD8) i8_temp;
 3420|  54.5k|    COPYTHECONTEXT("SH: slice_qp_delta",
 3421|  54.5k|                   (WORD8) (ps_cur_slice->u1_slice_qp - ps_pps->u1_pic_init_qp));
 3422|       |
 3423|  54.5k|    if(ps_pps->u1_deblocking_filter_parameters_present_flag == 1)
  ------------------
  |  Branch (3423:8): [True: 31.2k, False: 23.2k]
  ------------------
 3424|  31.2k|    {
 3425|  31.2k|        u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3426|  31.2k|        if(u4_temp > SLICE_BOUNDARY_DBLK_DISABLED)
  ------------------
  |  |  547|  31.2k|#define SLICE_BOUNDARY_DBLK_DISABLED  2
  ------------------
  |  Branch (3426:12): [True: 1.18k, False: 30.0k]
  ------------------
 3427|  1.18k|        {
 3428|  1.18k|            return ERROR_INV_SLICE_HDR_T;
 3429|  1.18k|        }
 3430|       |
 3431|  30.0k|        COPYTHECONTEXT("SH: disable_deblocking_filter_idc", u4_temp);
 3432|  30.0k|        ps_cur_slice->u1_disable_dblk_filter_idc = u4_temp;
 3433|  30.0k|        if(u4_temp != 1)
  ------------------
  |  Branch (3433:12): [True: 25.5k, False: 4.55k]
  ------------------
 3434|  25.5k|        {
 3435|  25.5k|            i_temp = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf) << 1;
 3436|  25.5k|            if((MIN_DBLK_FIL_OFF > i_temp) || (i_temp > MAX_DBLK_FIL_OFF))
  ------------------
  |  |  550|  25.5k|#define MIN_DBLK_FIL_OFF              -12
  ------------------
                          if((MIN_DBLK_FIL_OFF > i_temp) || (i_temp > MAX_DBLK_FIL_OFF))
  ------------------
  |  |  551|  25.2k|#define MAX_DBLK_FIL_OFF              12
  ------------------
  |  Branch (3436:16): [True: 244, False: 25.2k]
  |  Branch (3436:47): [True: 305, False: 24.9k]
  ------------------
 3437|    549|            {
 3438|    549|                return ERROR_INV_SLICE_HDR_T;
 3439|    549|            }
 3440|  24.9k|            ps_cur_slice->i1_slice_alpha_c0_offset = i_temp;
 3441|  24.9k|            COPYTHECONTEXT("SH: slice_alpha_c0_offset_div2",
 3442|  24.9k|                           ps_cur_slice->i1_slice_alpha_c0_offset >> 1);
 3443|       |
 3444|  24.9k|            i_temp = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf) << 1;
 3445|  24.9k|            if((MIN_DBLK_FIL_OFF > i_temp) || (i_temp > MAX_DBLK_FIL_OFF))
  ------------------
  |  |  550|  24.9k|#define MIN_DBLK_FIL_OFF              -12
  ------------------
                          if((MIN_DBLK_FIL_OFF > i_temp) || (i_temp > MAX_DBLK_FIL_OFF))
  ------------------
  |  |  551|  24.4k|#define MAX_DBLK_FIL_OFF              12
  ------------------
  |  Branch (3445:16): [True: 531, False: 24.4k]
  |  Branch (3445:47): [True: 157, False: 24.3k]
  ------------------
 3446|    688|            {
 3447|    688|                return ERROR_INV_SLICE_HDR_T;
 3448|    688|            }
 3449|  24.3k|            ps_cur_slice->i1_slice_beta_offset = i_temp;
 3450|  24.3k|            COPYTHECONTEXT("SH: slice_beta_offset_div2", ps_cur_slice->i1_slice_beta_offset >> 1);
 3451|  24.3k|        }
 3452|  4.55k|        else
 3453|  4.55k|        {
 3454|  4.55k|            ps_cur_slice->i1_slice_alpha_c0_offset = 0;
 3455|  4.55k|            ps_cur_slice->i1_slice_beta_offset = 0;
 3456|  4.55k|        }
 3457|  30.0k|    }
 3458|  23.2k|    else
 3459|  23.2k|    {
 3460|  23.2k|        ps_cur_slice->u1_disable_dblk_filter_idc = 0;
 3461|  23.2k|        ps_cur_slice->i1_slice_alpha_c0_offset = 0;
 3462|  23.2k|        ps_cur_slice->i1_slice_beta_offset = 0;
 3463|  23.2k|    }
 3464|       |
 3465|  52.1k|    ps_dec->u1_slice_header_done = 2;
 3466|  52.1k|    if(ps_pps->u1_entropy_coding_mode)
  ------------------
  |  Branch (3466:8): [True: 7.45k, False: 44.6k]
  ------------------
 3467|  7.45k|    {
 3468|  7.45k|        SWITCHOFFTRACE;
 3469|  7.45k|        SWITCHONTRACECABAC;
 3470|  7.45k|        ps_svc_lyr_dec->pf_parse_svc_inter_slice = isvcd_parse_inter_slice_data_cabac;
 3471|  7.45k|        ps_dec->pf_parse_inter_mb = ih264d_parse_pmb_cabac;
 3472|  7.45k|        ih264d_init_cabac_contexts(P_SLICE, ps_dec);
  ------------------
  |  |  368|  7.45k|#define P_SLICE  0
  ------------------
 3473|       |
 3474|  7.45k|        if(ps_dec->ps_cur_slice->u1_mbaff_frame_flag)
  ------------------
  |  Branch (3474:12): [True: 0, False: 7.45k]
  ------------------
 3475|      0|            ps_dec->pf_get_mb_info = ih264d_get_mb_info_cabac_mbaff;
 3476|  7.45k|        else
 3477|  7.45k|            ps_dec->pf_get_mb_info = isvcd_get_mb_info_cabac_nonmbaff;
 3478|  7.45k|    }
 3479|  44.6k|    else
 3480|  44.6k|    {
 3481|  44.6k|        SWITCHONTRACE;
 3482|  44.6k|        SWITCHOFFTRACECABAC;
 3483|  44.6k|        ps_svc_lyr_dec->pf_parse_svc_inter_slice = isvcd_parse_inter_slice_data_cavlc;
 3484|  44.6k|        ps_dec->pf_parse_inter_mb = ih264d_parse_pmb_cavlc;
 3485|  44.6k|        if(ps_dec->ps_cur_slice->u1_mbaff_frame_flag)
  ------------------
  |  Branch (3485:12): [True: 0, False: 44.6k]
  ------------------
 3486|      0|        {
 3487|      0|            ps_dec->pf_get_mb_info = ih264d_get_mb_info_cavlc_mbaff;
 3488|      0|        }
 3489|  44.6k|        else
 3490|  44.6k|            ps_dec->pf_get_mb_info = isvcd_get_mb_info_cavlc_nonmbaff;
 3491|  44.6k|    }
 3492|       |
 3493|  52.1k|    ps_dec->u1_B = 0;
 3494|  52.1k|    ps_dec->pf_mvpred_ref_tfr_nby2mb = ih264d_mv_pred_ref_tfr_nby2_pmb;
 3495|  52.1k|    ret = ps_svc_lyr_dec->pf_parse_svc_inter_slice(ps_svc_lyr_dec, ps_cur_slice,
 3496|  52.1k|                                                   u2_first_mb_in_slice);
 3497|  52.1k|    if(ret != OK) return ret;
  ------------------
  |  |  114|  52.1k|#define OK        0
  ------------------
  |  Branch (3497:8): [True: 13.9k, False: 38.1k]
  ------------------
 3498|       |
 3499|  38.1k|    return OK;
  ------------------
  |  |  114|  38.1k|#define OK        0
  ------------------
 3500|  52.1k|}

isvcd_set_default_seq_svc_ext:
   97|  19.5k|{
   98|  19.5k|    ps_seq_svc_ext->u1_inter_layer_deblocking_filter_control_present_flag = 0;
   99|  19.5k|    ps_seq_svc_ext->u1_extended_spatial_scalability_idc = 0;
  100|  19.5k|    ps_seq_svc_ext->u1_chroma_phase_x_plus1_flag = 1;
  101|  19.5k|    ps_seq_svc_ext->u1_chroma_phase_y_plus1 = 1;
  102|  19.5k|    ps_seq_svc_ext->u1_seq_ref_layer_chroma_phase_x_plus1_flag =
  103|  19.5k|        ps_seq_svc_ext->u1_chroma_phase_x_plus1_flag;
  104|  19.5k|    ps_seq_svc_ext->u1_seq_ref_layer_chroma_phase_y_plus1 = ps_seq_svc_ext->u1_chroma_phase_y_plus1;
  105|  19.5k|    ps_seq_svc_ext->i4_seq_scaled_ref_layer_left_offset = 0;
  106|  19.5k|    ps_seq_svc_ext->i4_seq_scaled_ref_layer_top_offset = 0;
  107|  19.5k|    ps_seq_svc_ext->i4_seq_scaled_ref_layer_right_offset = 0;
  108|  19.5k|    ps_seq_svc_ext->i4_seq_scaled_ref_layer_bottom_offset = 0;
  109|  19.5k|    ps_seq_svc_ext->u1_seq_tcoeff_level_prediction_flag =
  110|  19.5k|        ps_seq_svc_ext->u1_adaptive_tcoeff_level_prediction_flag = 0;
  111|  19.5k|    ps_seq_svc_ext->u1_slice_header_restriction_flag = 0;
  112|  19.5k|    ps_seq_svc_ext->u1_svc_vui_parameters_present_flag = 0;
  113|  19.5k|}
isvcd_parse_subset_sps:
  127|  23.9k|{
  128|  23.9k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
  129|  23.9k|    UWORD8 i;
  130|  23.9k|    dec_seq_params_t *ps_seq = NULL;
  131|  23.9k|    dec_svc_seq_params_t *ps_subset_seq = NULL;
  132|  23.9k|    dec_subset_seq_params_t *ps_seq_svc_ext;
  133|  23.9k|    UWORD8 u1_profile_idc, u1_level_idc, u1_seq_parameter_set_id, u1_mb_aff_flag = 0;
  134|  23.9k|    UWORD16 i2_max_frm_num;
  135|  23.9k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
  136|  23.9k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
  137|  23.9k|    UWORD8 u1_frm, uc_constraint_set0_flag, uc_constraint_set1_flag, uc_constraint_set2_flag;
  138|  23.9k|    WORD32 i4_cropped_ht, i4_cropped_wd;
  139|  23.9k|    UWORD32 u4_temp;
  140|  23.9k|    UWORD64 u8_temp;
  141|  23.9k|    UWORD32 u4_pic_height_in_map_units, u4_pic_width_in_mbs;
  142|  23.9k|    UWORD32 u2_pic_wd = 0;
  143|  23.9k|    UWORD32 u2_pic_ht = 0;
  144|  23.9k|    UWORD32 u2_frm_wd_y = 0;
  145|  23.9k|    UWORD32 u2_frm_ht_y = 0;
  146|  23.9k|    UWORD32 u2_frm_wd_uv = 0;
  147|  23.9k|    UWORD32 u2_frm_ht_uv = 0;
  148|  23.9k|    UWORD32 u2_crop_offset_y = 0;
  149|  23.9k|    UWORD32 u2_crop_offset_uv = 0;
  150|  23.9k|    WORD32 ret;
  151|       |    /* High profile related syntax element */
  152|  23.9k|    WORD32 i4_i;
  153|       |    /* G050 */
  154|  23.9k|    UWORD8 u1_frame_cropping_flag,
  155|  23.9k|        u1_frame_cropping_rect_left_ofst = 0, u1_frame_cropping_rect_right_ofst = 0,
  156|  23.9k|        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|  23.9k|    SWITCHONTRACE;
  162|  23.9k|    u1_profile_idc = ih264d_get_bits_h264(ps_bitstrm, 8);
  163|  23.9k|    COPYTHECONTEXT("SPS: profile_idc", u1_profile_idc);
  164|       |
  165|       |    /* G050 */
  166|  23.9k|    uc_constraint_set0_flag = ih264d_get_bit_h264(ps_bitstrm);
  167|  23.9k|    uc_constraint_set1_flag = ih264d_get_bit_h264(ps_bitstrm);
  168|  23.9k|    uc_constraint_set2_flag = ih264d_get_bit_h264(ps_bitstrm);
  169|  23.9k|    UNUSED(uc_constraint_set1_flag);
  ------------------
  |  |   45|  23.9k|#define UNUSED(x) ((void)(x))
  ------------------
  170|  23.9k|    UNUSED(uc_constraint_set2_flag);
  ------------------
  |  |   45|  23.9k|#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|  23.9k|    ih264d_get_bits_h264(ps_bitstrm, 5);
  177|       |    /* G050 */
  178|  23.9k|    u1_level_idc = (UWORD8) ih264d_get_bits_h264(ps_bitstrm, 8);
  179|  23.9k|    COPYTHECONTEXT("SPS: u4_level_idc", u1_level_idc);
  180|       |
  181|  23.9k|    u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  182|  23.9k|    if(u4_temp & MASK_ERR_SEQ_SET_ID) return ERROR_INV_SPS_PPS_T;
  ------------------
  |  |  526|  23.9k|#define MASK_ERR_SEQ_SET_ID   (0xFFFFFFE0)
  ------------------
  |  Branch (182:8): [True: 553, False: 23.3k]
  ------------------
  183|  23.3k|    u1_seq_parameter_set_id = u4_temp;
  184|  23.3k|    COPYTHECONTEXT("SPS: seq_parameter_set_id", u1_seq_parameter_set_id);
  185|       |
  186|  23.3k|    if(u1_seq_parameter_set_id >= MAX_NUM_SEQ_PARAMS) return ERROR_INV_SPS_PPS_T;
  ------------------
  |  |  521|  23.3k|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
  |  Branch (186:8): [True: 0, False: 23.3k]
  ------------------
  187|       |
  188|       |    /*--------------------------------------------------------------------*/
  189|       |    /* Find an seq param entry in seqparam array of decStruct             */
  190|       |    /*--------------------------------------------------------------------*/
  191|  23.3k|    ps_subset_seq = ps_svc_lyr_dec->pv_scratch_subset_sps;
  192|  23.3k|    memset(ps_subset_seq, 0, sizeof(dec_svc_seq_params_t));
  193|  23.3k|    ps_seq = ps_dec->pv_scratch_sps_pps;
  194|  23.3k|    memset(ps_seq, 0, sizeof(dec_seq_params_t));
  195|       |
  196|  23.3k|    ps_seq->u1_profile_idc = u1_profile_idc;
  197|  23.3k|    ps_seq->u1_level_idc = u1_level_idc;
  198|  23.3k|    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|  23.3k|    u1_seq_parameter_set_id += MAX_NUM_SEQ_PARAMS;
  ------------------
  |  |  521|  23.3k|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
  202|  23.3k|    ps_subset_seq->ps_seq = &ps_dec->ps_sps[u1_seq_parameter_set_id];
  203|       |
  204|  23.3k|    if((ps_dec->i4_header_decoded & 1) &&
  ------------------
  |  Branch (204:8): [True: 11.1k, False: 12.2k]
  ------------------
  205|  11.1k|       (1 == ps_dec->ps_sps[u1_seq_parameter_set_id].u1_is_valid) &&
  ------------------
  |  Branch (205:8): [True: 9.68k, False: 1.47k]
  ------------------
  206|  9.68k|       (ps_dec->ps_sps[u1_seq_parameter_set_id].u1_profile_idc != u1_profile_idc))
  ------------------
  |  Branch (206:8): [True: 240, False: 9.44k]
  ------------------
  207|    240|    {
  208|    240|        ps_dec->u1_res_changed = 1;
  209|    240|        return IVD_RES_CHANGED;
  210|    240|    }
  211|       |
  212|  23.1k|    if((ps_dec->i4_header_decoded & 1) &&
  ------------------
  |  Branch (212:8): [True: 10.9k, False: 12.2k]
  ------------------
  213|  10.9k|       (1 == ps_dec->ps_sps[u1_seq_parameter_set_id].u1_is_valid) &&
  ------------------
  |  Branch (213:8): [True: 9.44k, False: 1.47k]
  ------------------
  214|  9.44k|       (ps_dec->ps_sps[u1_seq_parameter_set_id].u1_level_idc != u1_level_idc))
  ------------------
  |  Branch (214:8): [True: 173, False: 9.27k]
  ------------------
  215|    173|    {
  216|    173|        ps_dec->u1_res_changed = 1;
  217|    173|        return IVD_RES_CHANGED;
  218|    173|    }
  219|       |    /*******************************************************************/
  220|       |    /* Initializations for high profile - Sushant                      */
  221|       |    /*******************************************************************/
  222|  22.9k|    ps_seq->i4_chroma_format_idc = 1;
  223|  22.9k|    ps_seq->i4_bit_depth_luma_minus8 = 0;
  224|  22.9k|    ps_seq->i4_bit_depth_chroma_minus8 = 0;
  225|  22.9k|    ps_seq->i4_qpprime_y_zero_transform_bypass_flag = 0;
  226|  22.9k|    ps_seq->i4_seq_scaling_matrix_present_flag = 0;
  227|  22.9k|    if(u1_profile_idc == HIGH_PROFILE_IDC || u1_profile_idc == SCALABLE_BASELINE_PROFILE_IDC ||
  ------------------
  |  |  278|  45.9k|#define HIGH_PROFILE_IDC   100
  ------------------
                  if(u1_profile_idc == HIGH_PROFILE_IDC || u1_profile_idc == SCALABLE_BASELINE_PROFILE_IDC ||
  ------------------
  |  |   59|  45.6k|#define SCALABLE_BASELINE_PROFILE_IDC 83
  ------------------
  |  Branch (227:8): [True: 249, False: 22.7k]
  |  Branch (227:46): [True: 2.34k, False: 20.3k]
  ------------------
  228|  20.3k|       u1_profile_idc == SCALABLE_HIGH_PROFILE_IDC)
  ------------------
  |  |   60|  20.3k|#define SCALABLE_HIGH_PROFILE_IDC 86
  ------------------
  |  Branch (228:8): [True: 3.11k, False: 17.2k]
  ------------------
  229|  5.70k|    {
  230|       |        /* reading chroma_format_idc   */
  231|  5.70k|        ps_seq->i4_chroma_format_idc = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  232|       |
  233|       |        /* Monochrome is not supported */
  234|  5.70k|        if(ps_seq->i4_chroma_format_idc != 1)
  ------------------
  |  Branch (234:12): [True: 166, False: 5.54k]
  ------------------
  235|    166|        {
  236|    166|            return ERROR_FEATURE_UNAVAIL;
  237|    166|        }
  238|       |
  239|       |        /* reading bit_depth_luma_minus8   */
  240|  5.54k|        ps_seq->i4_bit_depth_luma_minus8 = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  241|       |
  242|  5.54k|        if(ps_seq->i4_bit_depth_luma_minus8 != 0)
  ------------------
  |  Branch (242:12): [True: 96, False: 5.44k]
  ------------------
  243|     96|        {
  244|     96|            return ERROR_FEATURE_UNAVAIL;
  245|     96|        }
  246|       |
  247|       |        /* reading bit_depth_chroma_minus8   */
  248|  5.44k|        ps_seq->i4_bit_depth_chroma_minus8 = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  249|       |
  250|  5.44k|        if(ps_seq->i4_bit_depth_chroma_minus8 != 0)
  ------------------
  |  Branch (250:12): [True: 86, False: 5.35k]
  ------------------
  251|     86|        {
  252|     86|            return ERROR_FEATURE_UNAVAIL;
  253|     86|        }
  254|       |
  255|       |        /* reading qpprime_y_zero_transform_bypass_flag   */
  256|  5.35k|        ps_seq->i4_qpprime_y_zero_transform_bypass_flag = (WORD32) ih264d_get_bit_h264(ps_bitstrm);
  257|       |
  258|  5.35k|        if(ps_seq->i4_qpprime_y_zero_transform_bypass_flag != 0)
  ------------------
  |  Branch (258:12): [True: 68, False: 5.29k]
  ------------------
  259|     68|        {
  260|     68|            return ERROR_INV_SPS_PPS_T;
  261|     68|        }
  262|       |
  263|       |        /* reading seq_scaling_matrix_present_flag   */
  264|  5.29k|        ps_seq->i4_seq_scaling_matrix_present_flag = (WORD32) ih264d_get_bit_h264(ps_bitstrm);
  265|       |
  266|  5.29k|        if(ps_seq->i4_seq_scaling_matrix_present_flag)
  ------------------
  |  Branch (266:12): [True: 3.80k, False: 1.48k]
  ------------------
  267|  3.80k|        {
  268|  33.2k|            for(i4_i = 0; i4_i < 8; i4_i++)
  ------------------
  |  Branch (268:27): [True: 29.5k, False: 3.62k]
  ------------------
  269|  29.5k|            {
  270|  29.5k|                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|  29.5k|                ps_seq->u1_use_default_scaling_matrix_flag[i4_i] = 0;
  275|       |
  276|  29.5k|                if(ps_seq->u1_seq_scaling_list_present_flag[i4_i])
  ------------------
  |  Branch (276:20): [True: 14.2k, False: 15.3k]
  ------------------
  277|  14.2k|                {
  278|  14.2k|                    if(i4_i < 6)
  ------------------
  |  Branch (278:24): [True: 10.8k, False: 3.37k]
  ------------------
  279|  10.8k|                    {
  280|  10.8k|                        ret = ih264d_scaling_list(ps_seq->i2_scalinglist4x4[i4_i], 16,
  281|  10.8k|                                                  &ps_seq->u1_use_default_scaling_matrix_flag[i4_i],
  282|  10.8k|                                                  ps_bitstrm);
  283|  10.8k|                    }
  284|  3.37k|                    else
  285|  3.37k|                    {
  286|  3.37k|                        ret = ih264d_scaling_list(ps_seq->i2_scalinglist8x8[i4_i - 6], 64,
  287|  3.37k|                                                  &ps_seq->u1_use_default_scaling_matrix_flag[i4_i],
  288|  3.37k|                                                  ps_bitstrm);
  289|  3.37k|                    }
  290|  14.2k|                    if(ret != OK)
  ------------------
  |  |  114|  14.2k|#define OK        0
  ------------------
  |  Branch (290:24): [True: 184, False: 14.0k]
  ------------------
  291|    184|                    {
  292|    184|                        return ret;
  293|    184|                    }
  294|  14.2k|                }
  295|  29.5k|            }
  296|  3.80k|        }
  297|  5.29k|    }
  298|       |    /*--------------------------------------------------------------------*/
  299|       |    /* Decode MaxFrameNum                                                 */
  300|       |    /*--------------------------------------------------------------------*/
  301|  22.3k|    u8_temp = (UWORD64) 4 + ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  302|  22.3k|    if(u8_temp > MAX_BITS_IN_FRAME_NUM)
  ------------------
  |  |  531|  22.3k|#define MAX_BITS_IN_FRAME_NUM     16
  ------------------
  |  Branch (302:8): [True: 210, False: 22.1k]
  ------------------
  303|    210|    {
  304|    210|        return ERROR_INV_SPS_PPS_T;
  305|    210|    }
  306|  22.1k|    ps_seq->u1_bits_in_frm_num = (UWORD8) u8_temp;
  307|  22.1k|    COPYTHECONTEXT("SPS: log2_max_frame_num_minus4", (ps_seq->u1_bits_in_frm_num - 4));
  308|       |
  309|  22.1k|    i2_max_frm_num = (1 << (ps_seq->u1_bits_in_frm_num));
  310|  22.1k|    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.1k|    u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  315|       |
  316|  22.1k|    if(u4_temp > MAX_PIC_ORDER_CNT_TYPE)
  ------------------
  |  |  529|  22.1k|#define MAX_PIC_ORDER_CNT_TYPE    2
  ------------------
  |  Branch (316:8): [True: 165, False: 21.9k]
  ------------------
  317|    165|    {
  318|    165|        return ERROR_INV_POC_TYPE_T;
  319|    165|    }
  320|  21.9k|    ps_seq->u1_pic_order_cnt_type = u4_temp;
  321|  21.9k|    COPYTHECONTEXT("SPS: pic_order_cnt_type", ps_seq->u1_pic_order_cnt_type);
  322|       |
  323|  21.9k|    ps_seq->u1_num_ref_frames_in_pic_order_cnt_cycle = 1;
  324|  21.9k|    if(ps_seq->u1_pic_order_cnt_type == 0)
  ------------------
  |  Branch (324:8): [True: 17.7k, False: 4.25k]
  ------------------
  325|  17.7k|    {
  326|  17.7k|        u8_temp = (UWORD64) 4 + ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  327|  17.7k|        if(u8_temp > MAX_BITS_IN_POC_LSB)
  ------------------
  |  |  532|  17.7k|#define MAX_BITS_IN_POC_LSB       16
  ------------------
  |  Branch (327:12): [True: 98, False: 17.6k]
  ------------------
  328|     98|        {
  329|     98|            return ERROR_INV_SPS_PPS_T;
  330|     98|        }
  331|  17.6k|        ps_seq->u1_log2_max_pic_order_cnt_lsb_minus = (UWORD8) u8_temp;
  332|  17.6k|        ps_seq->i4_max_pic_order_cntLsb = (1 << u8_temp);
  333|  17.6k|        COPYTHECONTEXT("SPS: log2_max_pic_order_cnt_lsb_minus4", (u8_temp - 4));
  334|  17.6k|    }
  335|  4.25k|    else if(ps_seq->u1_pic_order_cnt_type == 1)
  ------------------
  |  Branch (335:13): [True: 2.70k, False: 1.54k]
  ------------------
  336|  2.70k|    {
  337|  2.70k|        ps_seq->u1_delta_pic_order_always_zero_flag = ih264d_get_bit_h264(ps_bitstrm);
  338|  2.70k|        COPYTHECONTEXT("SPS: delta_pic_order_always_zero_flag",
  339|  2.70k|                       ps_seq->u1_delta_pic_order_always_zero_flag);
  340|       |
  341|  2.70k|        ps_seq->i4_ofst_for_non_ref_pic = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  342|  2.70k|        COPYTHECONTEXT("SPS: offset_for_non_ref_pic", ps_seq->i4_ofst_for_non_ref_pic);
  343|       |
  344|  2.70k|        ps_seq->i4_ofst_for_top_to_bottom_field = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  345|  2.70k|        COPYTHECONTEXT("SPS: offset_for_top_to_bottom_field",
  346|  2.70k|                       ps_seq->i4_ofst_for_top_to_bottom_field);
  347|       |
  348|  2.70k|        u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  349|  2.70k|        if(u4_temp > 255) return ERROR_INV_SPS_PPS_T;
  ------------------
  |  Branch (349:12): [True: 170, False: 2.53k]
  ------------------
  350|  2.53k|        ps_seq->u1_num_ref_frames_in_pic_order_cnt_cycle = u4_temp;
  351|  2.53k|        COPYTHECONTEXT("SPS: num_ref_frames_in_pic_order_cnt_cycle",
  352|  2.53k|                       ps_seq->u1_num_ref_frames_in_pic_order_cnt_cycle);
  353|       |
  354|  19.7k|        for(i = 0; i < ps_seq->u1_num_ref_frames_in_pic_order_cnt_cycle; i++)
  ------------------
  |  Branch (354:20): [True: 17.2k, False: 2.53k]
  ------------------
  355|  17.2k|        {
  356|  17.2k|            ps_seq->i4_ofst_for_ref_frame[i] = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  357|  17.2k|            COPYTHECONTEXT("SPS: offset_for_ref_frame", ps_seq->i4_ofst_for_ref_frame[i]);
  358|  17.2k|        }
  359|  2.53k|    }
  360|       |
  361|  21.7k|    u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  362|       |
  363|  21.7k|    if((u4_temp > H264_MAX_REF_PICS))
  ------------------
  |  |  534|  21.7k|#define H264_MAX_REF_PICS         16
  ------------------
  |  Branch (363:8): [True: 196, False: 21.5k]
  ------------------
  364|    196|    {
  365|    196|        return ERROR_NUM_REF;
  366|    196|    }
  367|       |
  368|       |    /* Compare with older num_ref_frames is header is already once */
  369|  21.5k|    if((ps_dec->i4_header_decoded & 1) &&
  ------------------
  |  Branch (369:8): [True: 10.6k, False: 10.8k]
  ------------------
  370|  10.6k|       (1 == ps_dec->ps_sps[u1_seq_parameter_set_id].u1_is_valid) &&
  ------------------
  |  Branch (370:8): [True: 9.27k, False: 1.37k]
  ------------------
  371|  9.27k|       (ps_dec->ps_sps[u1_seq_parameter_set_id].u1_num_ref_frames != u4_temp))
  ------------------
  |  Branch (371:8): [True: 54, False: 9.21k]
  ------------------
  372|     54|    {
  373|     54|        ps_dec->u1_res_changed = 1;
  374|     54|        return IVD_RES_CHANGED;
  375|     54|    }
  376|  21.4k|    ps_seq->u1_num_ref_frames = u4_temp;
  377|  21.4k|    COPYTHECONTEXT("SPS: num_ref_frames", ps_seq->u1_num_ref_frames);
  378|       |
  379|  21.4k|    ps_seq->u1_gaps_in_frame_num_value_allowed_flag = ih264d_get_bit_h264(ps_bitstrm);
  380|  21.4k|    COPYTHECONTEXT("SPS: gaps_in_frame_num_value_allowed_flag",
  381|  21.4k|                   ps_seq->u1_gaps_in_frame_num_value_allowed_flag);
  382|       |    /* SVC_DEC_REVIEW */
  383|  21.4k|    ps_seq->u1_gaps_in_frame_num_value_allowed_flag = 0;
  384|       |
  385|       |    /*--------------------------------------------------------------------*/
  386|       |    /* Decode FrameWidth and FrameHeight and related values               */
  387|       |    /*--------------------------------------------------------------------*/
  388|  21.4k|    u8_temp = (UWORD64) 1 + ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  389|       |    /* Check  for unsupported resolutions*/
  390|  21.4k|    if(u8_temp > (H264_MAX_FRAME_WIDTH >> 4))
  ------------------
  |  |   39|  21.4k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
  |  Branch (390:8): [True: 155, False: 21.3k]
  ------------------
  391|    155|    {
  392|    155|        return IVD_STREAM_WIDTH_HEIGHT_NOT_SUPPORTED;
  393|    155|    }
  394|  21.3k|    u4_pic_width_in_mbs = (UWORD32) u8_temp;
  395|  21.3k|    COPYTHECONTEXT("SPS: pic_width_in_mbs_minus1", u4_pic_width_in_mbs - 1);
  396|       |
  397|  21.3k|    u8_temp = (UWORD64) 1 + ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  398|  21.3k|    if(u8_temp > (H264_MAX_FRAME_HEIGHT >> 4))
  ------------------
  |  |   40|  21.3k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
  |  Branch (398:8): [True: 189, False: 21.1k]
  ------------------
  399|    189|    {
  400|    189|        return IVD_STREAM_WIDTH_HEIGHT_NOT_SUPPORTED;
  401|    189|    }
  402|  21.1k|    u4_pic_height_in_map_units = (UWORD32) u8_temp;
  403|       |
  404|  21.1k|    ps_seq->u2_frm_wd_in_mbs = u4_pic_width_in_mbs;
  405|  21.1k|    ps_seq->u2_frm_ht_in_mbs = u4_pic_height_in_map_units;
  406|       |
  407|  21.1k|    u2_pic_wd = (u4_pic_width_in_mbs << 4);
  408|  21.1k|    u2_pic_ht = (u4_pic_height_in_map_units << 4);
  409|  21.1k|    if(ps_svc_lyr_dec->pic_width < u2_pic_wd)
  ------------------
  |  Branch (409:8): [True: 7.90k, False: 13.2k]
  ------------------
  410|  7.90k|    {
  411|  7.90k|        ps_svc_lyr_dec->pic_width = u2_pic_wd;
  412|  7.90k|    }
  413|  21.1k|    if(ps_svc_lyr_dec->pic_height < u2_pic_ht)
  ------------------
  |  Branch (413:8): [True: 7.94k, False: 13.1k]
  ------------------
  414|  7.94k|    {
  415|  7.94k|        ps_svc_lyr_dec->pic_height = u2_pic_ht;
  416|  7.94k|    }
  417|       |
  418|       |    /*--------------------------------------------------------------------*/
  419|       |    /* Get the value of MaxMbAddress and Number of bits needed for it     */
  420|       |    /*--------------------------------------------------------------------*/
  421|  21.1k|    ps_seq->u4_max_mb_addr = (ps_seq->u2_frm_wd_in_mbs * ps_seq->u2_frm_ht_in_mbs) - 1;
  422|       |
  423|  21.1k|    ps_seq->u4_total_num_of_mbs = ps_seq->u4_max_mb_addr + 1;
  424|       |
  425|  21.1k|    ps_seq->u1_level_idc = ih264d_correct_level_idc(u1_level_idc, ps_seq->u4_total_num_of_mbs);
  426|       |
  427|  21.1k|    u1_frm = ih264d_get_bit_h264(ps_bitstrm);
  428|       |
  429|  21.1k|    if((ps_dec->i4_header_decoded & 1) &&
  ------------------
  |  Branch (429:8): [True: 10.4k, False: 10.6k]
  ------------------
  430|  10.4k|       (1 == ps_dec->ps_sps[u1_seq_parameter_set_id].u1_is_valid) &&
  ------------------
  |  Branch (430:8): [True: 9.21k, False: 1.25k]
  ------------------
  431|  9.21k|       (ps_dec->ps_sps[u1_seq_parameter_set_id].u1_frame_mbs_only_flag != u1_frm))
  ------------------
  |  Branch (431:8): [True: 117, False: 9.10k]
  ------------------
  432|    117|    {
  433|    117|        ps_dec->u1_res_changed = 1;
  434|    117|        return IVD_RES_CHANGED;
  435|    117|    }
  436|  21.0k|    ps_seq->u1_frame_mbs_only_flag = u1_frm;
  437|       |
  438|  21.0k|    COPYTHECONTEXT("SPS: frame_mbs_only_flag", u1_frm);
  439|       |
  440|  21.0k|    if(!u1_frm) u1_mb_aff_flag = ih264d_get_bit_h264(ps_bitstrm);
  ------------------
  |  Branch (440:8): [True: 3.66k, False: 17.3k]
  ------------------
  441|  21.0k|    if((ps_dec->i4_header_decoded & 1) &&
  ------------------
  |  Branch (441:8): [True: 10.3k, False: 10.6k]
  ------------------
  442|  10.3k|       (1 == ps_dec->ps_sps[u1_seq_parameter_set_id].u1_is_valid) &&
  ------------------
  |  Branch (442:8): [True: 9.10k, False: 1.25k]
  ------------------
  443|  9.10k|       (ps_dec->ps_sps[u1_seq_parameter_set_id].u1_mb_aff_flag != u1_mb_aff_flag))
  ------------------
  |  Branch (443:8): [True: 74, False: 9.02k]
  ------------------
  444|     74|    {
  445|     74|        ps_dec->u1_res_changed = 1;
  446|     74|        return IVD_RES_CHANGED;
  447|     74|    }
  448|  20.9k|    if(!u1_frm)
  ------------------
  |  Branch (448:8): [True: 3.59k, False: 17.3k]
  ------------------
  449|  3.59k|    {
  450|  3.59k|        u2_pic_ht <<= 1;
  451|  3.59k|        ps_seq->u1_mb_aff_flag = u1_mb_aff_flag;
  452|  3.59k|        COPYTHECONTEXT("SPS: mb_adaptive_frame_field_flag", ps_seq->u1_mb_aff_flag);
  453|  3.59k|    }
  454|  17.3k|    else
  455|  17.3k|        ps_seq->u1_mb_aff_flag = 0;
  456|       |
  457|  20.9k|    ps_seq->u1_direct_8x8_inference_flag = ih264d_get_bit_h264(ps_bitstrm);
  458|       |
  459|  20.9k|    COPYTHECONTEXT("SPS: direct_8x8_inference_flag", ps_seq->u1_direct_8x8_inference_flag);
  460|       |
  461|       |    /* G050 */
  462|  20.9k|    u1_frame_cropping_flag = ih264d_get_bit_h264(ps_bitstrm);
  463|  20.9k|    COPYTHECONTEXT("SPS: frame_cropping_flag", u1_frame_cropping_flag);
  464|       |
  465|  20.9k|    if(u1_frame_cropping_flag)
  ------------------
  |  Branch (465:8): [True: 6.08k, False: 14.8k]
  ------------------
  466|  6.08k|    {
  467|  6.08k|        u1_frame_cropping_rect_left_ofst = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  468|  6.08k|        COPYTHECONTEXT("SPS: frame_cropping_rect_left_offset", u1_frame_cropping_rect_left_ofst);
  469|  6.08k|        u1_frame_cropping_rect_right_ofst = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  470|  6.08k|        COPYTHECONTEXT("SPS: frame_cropping_rect_right_offset", u1_frame_cropping_rect_right_ofst);
  471|  6.08k|        u1_frame_cropping_rect_top_ofst = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  472|  6.08k|        COPYTHECONTEXT("SPS: frame_cropping_rect_top_offset", u1_frame_cropping_rect_top_ofst);
  473|  6.08k|        u1_frame_cropping_rect_bottom_ofst = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  474|  6.08k|        COPYTHECONTEXT("SPS: frame_cropping_rect_bottom_offset",
  475|  6.08k|                       u1_frame_cropping_rect_bottom_ofst);
  476|  6.08k|    }
  477|       |    /* G050 */
  478|  20.9k|    ps_seq->u1_vui_parameters_present_flag = ih264d_get_bit_h264(ps_bitstrm);
  479|  20.9k|    COPYTHECONTEXT("SPS: vui_parameters_present_flag", ps_seq->u1_vui_parameters_present_flag);
  480|       |
  481|  20.9k|    u2_frm_wd_y = u2_pic_wd + (UWORD8) (PAD_LEN_Y_H << 1);
  ------------------
  |  |  571|  20.9k|#define PAD_LEN_Y_H                   32
  ------------------
  482|  20.9k|    if(1 == ps_dec->u4_share_disp_buf)
  ------------------
  |  Branch (482:8): [True: 0, False: 20.9k]
  ------------------
  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|  20.9k|    u2_frm_ht_y = u2_pic_ht + (UWORD8) (PAD_LEN_Y_V << 2);
  ------------------
  |  |  572|  20.9k|#define PAD_LEN_Y_V                   20
  ------------------
  488|  20.9k|    u2_frm_wd_uv = u2_pic_wd + (UWORD8) (PAD_LEN_UV_H << 2);
  ------------------
  |  |  573|  20.9k|#define PAD_LEN_UV_H                  16
  ------------------
  489|  20.9k|    u2_frm_wd_uv = MAX(u2_frm_wd_uv, u2_frm_wd_y);
  ------------------
  |  |   60|  20.9k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 0, False: 20.9k]
  |  |  ------------------
  ------------------
  490|       |
  491|  20.9k|    u2_frm_ht_uv = (u2_pic_ht >> 1) + (UWORD8) (PAD_LEN_UV_V << 2);
  ------------------
  |  |  574|  20.9k|#define PAD_LEN_UV_V                  8
  ------------------
  492|  20.9k|    u2_frm_ht_uv = MAX(u2_frm_ht_uv, (u2_frm_ht_y >> 1));
  ------------------
  |  |   60|  20.9k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 0, False: 20.9k]
  |  |  ------------------
  ------------------
  493|       |
  494|       |    /* Calculate display picture width, height and start u4_ofst from YUV420 */
  495|       |    /* pictute buffers as per cropping information parsed above             */
  496|  20.9k|    {
  497|  20.9k|        UWORD16 u2_rgt_ofst = 0;
  498|  20.9k|        UWORD16 u2_lft_ofst = 0;
  499|  20.9k|        UWORD16 u2_top_ofst = 0;
  500|  20.9k|        UWORD16 u2_btm_ofst = 0;
  501|  20.9k|        UWORD8 u1_frm_mbs_flag;
  502|  20.9k|        UWORD8 u1_vert_mult_factor;
  503|       |
  504|  20.9k|        if(u1_frame_cropping_flag)
  ------------------
  |  Branch (504:12): [True: 6.08k, False: 14.8k]
  ------------------
  505|  6.08k|        {
  506|       |            /* Calculate right and left u4_ofst for cropped picture           */
  507|  6.08k|            u2_rgt_ofst = u1_frame_cropping_rect_right_ofst << 1;
  508|  6.08k|            u2_lft_ofst = u1_frame_cropping_rect_left_ofst << 1;
  509|       |
  510|       |            /* Know frame MBs only u4_flag                                      */
  511|  6.08k|            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.08k|            u1_vert_mult_factor = (2 - u1_frm_mbs_flag);
  515|       |
  516|       |            /* Calculate bottom and top u4_ofst for cropped  picture          */
  517|  6.08k|            u2_btm_ofst = (u1_frame_cropping_rect_bottom_ofst << u1_vert_mult_factor);
  518|  6.08k|            u2_top_ofst = (u1_frame_cropping_rect_top_ofst << u1_vert_mult_factor);
  519|  6.08k|        }
  520|       |
  521|       |        /* Calculate u4_ofst from start of YUV 420 picture buffer to start of*/
  522|       |        /* cropped picture buffer                                           */
  523|  20.9k|        u2_crop_offset_y = (u2_frm_wd_y * u2_top_ofst) + (u2_lft_ofst);
  524|  20.9k|        u2_crop_offset_uv =
  525|  20.9k|            (u2_frm_wd_uv * (u2_top_ofst >> 1)) + (u2_lft_ofst >> 1) * YUV420SP_FACTOR;
  ------------------
  |  |  119|  20.9k|#define YUV420SP_FACTOR 2
  ------------------
  526|       |        /* Calculate the display picture width and height based on crop      */
  527|       |        /* information                                                       */
  528|  20.9k|        i4_cropped_ht = (WORD32) u2_pic_ht - (WORD32) (u2_btm_ofst + u2_top_ofst);
  529|  20.9k|        i4_cropped_wd = (WORD32) u2_pic_wd - (WORD32) (u2_rgt_ofst + u2_lft_ofst);
  530|       |
  531|  20.9k|        if((i4_cropped_ht < MB_SIZE) || (i4_cropped_wd < MB_SIZE))
  ------------------
  |  |  554|  20.9k|#define MB_SIZE             16
  ------------------
                      if((i4_cropped_ht < MB_SIZE) || (i4_cropped_wd < MB_SIZE))
  ------------------
  |  |  554|  20.8k|#define MB_SIZE             16
  ------------------
  |  Branch (531:12): [True: 117, False: 20.8k]
  |  Branch (531:41): [True: 97, False: 20.7k]
  ------------------
  532|    214|        {
  533|    214|            return ERROR_INV_SPS_PPS_T;
  534|    214|        }
  535|       |
  536|  20.7k|        if((ps_dec->i4_header_decoded & 1) &&
  ------------------
  |  Branch (536:12): [True: 10.2k, False: 10.4k]
  ------------------
  537|  10.2k|           (1 == ps_dec->ps_sps[u1_seq_parameter_set_id].u1_is_valid) &&
  ------------------
  |  Branch (537:12): [True: 9.02k, False: 1.24k]
  ------------------
  538|  9.02k|           (ps_svc_lyr_dec->ps_subset_sps[u1_seq_parameter_set_id].u2_pic_wd != u2_pic_wd))
  ------------------
  |  Branch (538:12): [True: 98, False: 8.92k]
  ------------------
  539|     98|        {
  540|     98|            ps_dec->u1_res_changed = 1;
  541|     98|            return IVD_RES_CHANGED;
  542|     98|        }
  543|       |
  544|  20.6k|        if((ps_dec->i4_header_decoded & 1) &&
  ------------------
  |  Branch (544:12): [True: 10.1k, False: 10.4k]
  ------------------
  545|  10.1k|           (1 == ps_dec->ps_sps[u1_seq_parameter_set_id].u1_is_valid) &&
  ------------------
  |  Branch (545:12): [True: 8.92k, False: 1.24k]
  ------------------
  546|  8.92k|           (ps_svc_lyr_dec->ps_subset_sps[u1_seq_parameter_set_id].u2_disp_width != i4_cropped_wd))
  ------------------
  |  Branch (546:12): [True: 71, False: 8.85k]
  ------------------
  547|     71|        {
  548|     71|            ps_dec->u1_res_changed = 1;
  549|     71|            return IVD_RES_CHANGED;
  550|     71|        }
  551|       |
  552|  20.5k|        if((ps_dec->i4_header_decoded & 1) &&
  ------------------
  |  Branch (552:12): [True: 10.1k, False: 10.4k]
  ------------------
  553|  10.1k|           (1 == ps_dec->ps_sps[u1_seq_parameter_set_id].u1_is_valid) &&
  ------------------
  |  Branch (553:12): [True: 8.85k, False: 1.24k]
  ------------------
  554|  8.85k|           (ps_svc_lyr_dec->ps_subset_sps[u1_seq_parameter_set_id].u2_pic_ht != u2_pic_ht))
  ------------------
  |  Branch (554:12): [True: 91, False: 8.76k]
  ------------------
  555|     91|        {
  556|     91|            ps_dec->u1_res_changed = 1;
  557|     91|            return IVD_RES_CHANGED;
  558|     91|        }
  559|       |
  560|  20.4k|        if((ps_dec->i4_header_decoded & 1) &&
  ------------------
  |  Branch (560:12): [True: 10.0k, False: 10.4k]
  ------------------
  561|  10.0k|           (1 == ps_dec->ps_sps[u1_seq_parameter_set_id].u1_is_valid) &&
  ------------------
  |  Branch (561:12): [True: 8.76k, False: 1.24k]
  ------------------
  562|  8.76k|           (ps_svc_lyr_dec->ps_subset_sps[u1_seq_parameter_set_id].u2_disp_height != i4_cropped_ht))
  ------------------
  |  Branch (562:12): [True: 67, False: 8.69k]
  ------------------
  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.3k|        if((u2_pic_wd > SVCD_MAX_FRAME_WIDTH) || (u2_pic_ht > SVCD_MAX_FRAME_HEIGHT) ||
  ------------------
  |  |   52|  20.3k|#define SVCD_MAX_FRAME_WIDTH 4096
  ------------------
                      if((u2_pic_wd > SVCD_MAX_FRAME_WIDTH) || (u2_pic_ht > SVCD_MAX_FRAME_HEIGHT) ||
  ------------------
  |  |   53|  20.3k|#define SVCD_MAX_FRAME_HEIGHT 4096
  ------------------
  |  Branch (568:12): [True: 0, False: 20.3k]
  |  Branch (568:50): [True: 91, False: 20.3k]
  ------------------
  569|  20.3k|           (u2_pic_wd < SVCD_MIN_FRAME_WIDTH) || (u2_pic_ht < SVCD_MIN_FRAME_HEIGHT) ||
  ------------------
  |  |   56|  20.3k|#define SVCD_MIN_FRAME_WIDTH 32
  ------------------
                         (u2_pic_wd < SVCD_MIN_FRAME_WIDTH) || (u2_pic_ht < SVCD_MIN_FRAME_HEIGHT) ||
  ------------------
  |  |   57|  20.1k|#define SVCD_MIN_FRAME_HEIGHT 32
  ------------------
  |  Branch (569:12): [True: 199, False: 20.1k]
  |  Branch (569:50): [True: 80, False: 20.0k]
  ------------------
  570|  20.0k|           (u2_pic_wd * (UWORD32) u2_pic_ht > SVCD_MAX_FRAME_SIZE))
  ------------------
  |  |   54|  20.0k|#define SVCD_MAX_FRAME_SIZE (4096 * 4096)
  ------------------
  |  Branch (570:12): [True: 0, False: 20.0k]
  ------------------
  571|    370|        {
  572|    370|            return IVD_STREAM_WIDTH_HEIGHT_NOT_SUPPORTED;
  573|    370|        }
  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.0k|        if((u2_pic_wd << ps_seq->u1_mb_aff_flag) > H264_MAX_FRAME_WIDTH)
  ------------------
  |  |   39|  20.0k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
  |  Branch (579:12): [True: 128, False: 19.8k]
  ------------------
  580|    128|        {
  581|    128|            return IVD_STREAM_WIDTH_HEIGHT_NOT_SUPPORTED;
  582|    128|        }
  583|  20.0k|    }
  584|       |
  585|  19.8k|    if(1 == ps_seq->u1_vui_parameters_present_flag)
  ------------------
  |  Branch (585:8): [True: 4.49k, False: 15.4k]
  ------------------
  586|  4.49k|    {
  587|  4.49k|        ret = ih264d_parse_vui_parametres(&ps_seq->s_vui, ps_bitstrm);
  588|  4.49k|        if(ret != OK) return ret;
  ------------------
  |  |  114|  4.49k|#define OK        0
  ------------------
  |  Branch (588:12): [True: 302, False: 4.19k]
  ------------------
  589|  4.49k|    }
  590|  19.5k|    ps_seq_svc_ext = &ps_subset_seq->s_sps_svc_ext;
  591|       |
  592|  19.5k|    isvcd_set_default_seq_svc_ext(ps_seq_svc_ext);
  593|       |
  594|  19.5k|    if(SCALABLE_BASELINE_PROFILE_IDC == ps_seq->u1_profile_idc ||
  ------------------
  |  |   59|  19.5k|#define SCALABLE_BASELINE_PROFILE_IDC 83
  ------------------
  |  Branch (594:8): [True: 2.07k, False: 17.5k]
  ------------------
  595|  17.5k|       SCALABLE_HIGH_PROFILE_IDC == ps_seq->u1_profile_idc)
  ------------------
  |  |   60|  17.5k|#define SCALABLE_HIGH_PROFILE_IDC 86
  ------------------
  |  Branch (595:8): [True: 2.69k, False: 14.8k]
  ------------------
  596|  4.77k|    {
  597|  4.77k|        SWITCHONTRACE;
  598|  4.77k|        ps_seq_svc_ext->u1_inter_layer_deblocking_filter_control_present_flag =
  599|  4.77k|            ih264d_get_bit_h264(ps_bitstrm);
  600|  4.77k|        COPYTHECONTEXT("SPS_EXt: u1_inter_layer_deblocking_filter_control_present_flag",
  601|  4.77k|                       ps_seq_svc_ext->u1_inter_layer_deblocking_filter_control_present_flag);
  602|       |
  603|  4.77k|        ps_seq_svc_ext->u1_extended_spatial_scalability_idc = ih264d_get_bits_h264(ps_bitstrm, 2);
  604|  4.77k|        COPYTHECONTEXT("SPS_EXt: u1_extended_spatial_scalability_idc",
  605|  4.77k|                       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.77k|        if(ps_seq_svc_ext->u1_extended_spatial_scalability_idc > 2)
  ------------------
  |  Branch (608:12): [True: 115, False: 4.65k]
  ------------------
  609|    115|        {
  610|    115|            return ERROR_SVC_INV_SUBSET_SPS;
  611|    115|        }
  612|       |
  613|       |        /* ChromaArrayType = i4_chroma_format_idc  if  separate_colour_plane_flag =
  614|       |         * 0 for all chroma format except 4:4:4 */
  615|  4.65k|        if(1 == ps_seq->i4_chroma_format_idc || 2 == ps_seq->i4_chroma_format_idc)
  ------------------
  |  Branch (615:12): [True: 4.65k, False: 0]
  |  Branch (615:49): [True: 0, False: 0]
  ------------------
  616|  4.65k|        {
  617|  4.65k|            ps_seq_svc_ext->u1_chroma_phase_x_plus1_flag = ih264d_get_bit_h264(ps_bitstrm);
  618|  4.65k|            COPYTHECONTEXT("SPS_EXt: u1_chroma_phase_x_plus1_flag",
  619|  4.65k|                           ps_seq_svc_ext->u1_chroma_phase_x_plus1_flag);
  620|  4.65k|        }
  621|       |
  622|  4.65k|        if(1 == ps_seq->i4_chroma_format_idc)
  ------------------
  |  Branch (622:12): [True: 4.65k, False: 0]
  ------------------
  623|  4.65k|        {
  624|  4.65k|            ps_seq_svc_ext->u1_chroma_phase_y_plus1 = ih264d_get_bits_h264(ps_bitstrm, 2);
  625|  4.65k|            COPYTHECONTEXT("SPS_EXt: u1_chroma_phase_y_plus1",
  626|  4.65k|                           ps_seq_svc_ext->u1_chroma_phase_y_plus1);
  627|       |
  628|  4.65k|            if(ps_seq_svc_ext->u1_chroma_phase_y_plus1 >= 3)
  ------------------
  |  Branch (628:16): [True: 69, False: 4.58k]
  ------------------
  629|     69|            {
  630|     69|                return ERROR_SVC_INV_SUBSET_SPS;
  631|     69|            }
  632|  4.65k|        }
  633|       |
  634|       |        /* inferred values not covered in isvcd_set_default_seq_svc_ext*/
  635|  4.58k|        ps_seq_svc_ext->u1_seq_ref_layer_chroma_phase_x_plus1_flag =
  636|  4.58k|            ps_seq_svc_ext->u1_chroma_phase_x_plus1_flag;
  637|  4.58k|        ps_seq_svc_ext->u1_seq_ref_layer_chroma_phase_y_plus1 =
  638|  4.58k|            ps_seq_svc_ext->u1_chroma_phase_y_plus1;
  639|       |
  640|  4.58k|        if(1 == ps_seq_svc_ext->u1_extended_spatial_scalability_idc)
  ------------------
  |  Branch (640:12): [True: 1.74k, False: 2.84k]
  ------------------
  641|  1.74k|        {
  642|  1.74k|            if(ps_seq->i4_chroma_format_idc > 0)
  ------------------
  |  Branch (642:16): [True: 1.74k, False: 0]
  ------------------
  643|  1.74k|            {
  644|  1.74k|                ps_seq_svc_ext->u1_seq_ref_layer_chroma_phase_x_plus1_flag =
  645|  1.74k|                    ih264d_get_bit_h264(ps_bitstrm);
  646|  1.74k|                COPYTHECONTEXT("SPS_EXt: u1_seq_ref_layer_chroma_phase_x_plus1_flag",
  647|  1.74k|                               ps_seq_svc_ext->u1_seq_ref_layer_chroma_phase_x_plus1_flag);
  648|       |
  649|  1.74k|                ps_seq_svc_ext->u1_seq_ref_layer_chroma_phase_y_plus1 =
  650|  1.74k|                    ih264d_get_bits_h264(ps_bitstrm, 2);
  651|  1.74k|                COPYTHECONTEXT("SPS_EXt: u1_seq_ref_layer_chroma_phase_y_plus1",
  652|  1.74k|                               ps_seq_svc_ext->u1_seq_ref_layer_chroma_phase_y_plus1);
  653|       |
  654|  1.74k|                if(ps_seq_svc_ext->u1_seq_ref_layer_chroma_phase_y_plus1 >= 3)
  ------------------
  |  Branch (654:20): [True: 70, False: 1.67k]
  ------------------
  655|     70|                {
  656|     70|                    return ERROR_SVC_INV_SUBSET_SPS;
  657|     70|                }
  658|  1.74k|            }
  659|       |
  660|  1.67k|            ps_seq_svc_ext->i4_seq_scaled_ref_layer_left_offset =
  661|  1.67k|                ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  662|  1.67k|            COPYTHECONTEXT("SPS_EXt: i4_seq_scaled_ref_layer_left_offset",
  663|  1.67k|                           ps_seq_svc_ext->i4_seq_scaled_ref_layer_left_offset);
  664|       |
  665|  1.67k|            if(ps_seq_svc_ext->i4_seq_scaled_ref_layer_left_offset != 0)
  ------------------
  |  Branch (665:16): [True: 129, False: 1.54k]
  ------------------
  666|    129|            {
  667|    129|                return ERROR_SVC_INV_SUBSET_SPS;
  668|    129|            }
  669|       |
  670|  1.54k|            if(ps_seq_svc_ext->i4_seq_scaled_ref_layer_left_offset >= MAX_SCLD_REF_LAYER_OFFSET ||
  ------------------
  |  |   71|  3.09k|#define MAX_SCLD_REF_LAYER_OFFSET 32768
  ------------------
  |  Branch (670:16): [True: 0, False: 1.54k]
  ------------------
  671|  1.54k|               ps_seq_svc_ext->i4_seq_scaled_ref_layer_left_offset < MIN_SCLD_REF_LAYER_OFFSET)
  ------------------
  |  |   72|  1.54k|#define MIN_SCLD_REF_LAYER_OFFSET -32768
  ------------------
  |  Branch (671:16): [True: 0, False: 1.54k]
  ------------------
  672|      0|            {
  673|      0|                return ERROR_SVC_INV_SUBSET_SPS;
  674|      0|            }
  675|       |
  676|  1.54k|            ps_seq_svc_ext->i4_seq_scaled_ref_layer_top_offset =
  677|  1.54k|                ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  678|  1.54k|            COPYTHECONTEXT("SPS_EXt: i4_seq_scaled_ref_layer_top_offset",
  679|  1.54k|                           ps_seq_svc_ext->i4_seq_scaled_ref_layer_top_offset);
  680|       |
  681|  1.54k|            if(ps_seq_svc_ext->i4_seq_scaled_ref_layer_top_offset != 0)
  ------------------
  |  Branch (681:16): [True: 92, False: 1.45k]
  ------------------
  682|     92|            {
  683|     92|                return ERROR_SVC_INV_SUBSET_SPS;
  684|     92|            }
  685|       |
  686|  1.45k|            if(ps_seq_svc_ext->i4_seq_scaled_ref_layer_top_offset >= MAX_SCLD_REF_LAYER_OFFSET ||
  ------------------
  |  |   71|  2.91k|#define MAX_SCLD_REF_LAYER_OFFSET 32768
  ------------------
  |  Branch (686:16): [True: 0, False: 1.45k]
  ------------------
  687|  1.45k|               ps_seq_svc_ext->i4_seq_scaled_ref_layer_top_offset < MIN_SCLD_REF_LAYER_OFFSET)
  ------------------
  |  |   72|  1.45k|#define MIN_SCLD_REF_LAYER_OFFSET -32768
  ------------------
  |  Branch (687:16): [True: 0, False: 1.45k]
  ------------------
  688|      0|            {
  689|      0|                return ERROR_SVC_INV_SUBSET_SPS;
  690|      0|            }
  691|       |
  692|  1.45k|            ps_seq_svc_ext->i4_seq_scaled_ref_layer_right_offset =
  693|  1.45k|                ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  694|  1.45k|            COPYTHECONTEXT("SPS_EXt: i4_seq_scaled_ref_layer_right_offset",
  695|  1.45k|                           ps_seq_svc_ext->i4_seq_scaled_ref_layer_right_offset);
  696|       |
  697|  1.45k|            if(ps_seq_svc_ext->i4_seq_scaled_ref_layer_right_offset >= MAX_SCLD_REF_LAYER_OFFSET ||
  ------------------
  |  |   71|  2.91k|#define MAX_SCLD_REF_LAYER_OFFSET 32768
  ------------------
  |  Branch (697:16): [True: 81, False: 1.37k]
  ------------------
  698|  1.37k|               ps_seq_svc_ext->i4_seq_scaled_ref_layer_right_offset < MIN_SCLD_REF_LAYER_OFFSET)
  ------------------
  |  |   72|  1.37k|#define MIN_SCLD_REF_LAYER_OFFSET -32768
  ------------------
  |  Branch (698:16): [True: 91, False: 1.28k]
  ------------------
  699|    172|            {
  700|    172|                return ERROR_SVC_INV_SUBSET_SPS;
  701|    172|            }
  702|       |
  703|  1.28k|            ps_seq_svc_ext->i4_seq_scaled_ref_layer_bottom_offset =
  704|  1.28k|                ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  705|  1.28k|            COPYTHECONTEXT("SPS_EXt: i4_seq_scaled_ref_layer_bottom_offset",
  706|  1.28k|                           ps_seq_svc_ext->i4_seq_scaled_ref_layer_bottom_offset);
  707|       |
  708|  1.28k|            if(ps_seq_svc_ext->i4_seq_scaled_ref_layer_bottom_offset >= MAX_SCLD_REF_LAYER_OFFSET ||
  ------------------
  |  |   71|  2.56k|#define MAX_SCLD_REF_LAYER_OFFSET 32768
  ------------------
  |  Branch (708:16): [True: 74, False: 1.20k]
  ------------------
  709|  1.20k|               ps_seq_svc_ext->i4_seq_scaled_ref_layer_bottom_offset < MIN_SCLD_REF_LAYER_OFFSET)
  ------------------
  |  |   72|  1.20k|#define MIN_SCLD_REF_LAYER_OFFSET -32768
  ------------------
  |  Branch (709:16): [True: 84, False: 1.12k]
  ------------------
  710|    158|            {
  711|    158|                return ERROR_INV_SLICE_HDR_T;
  712|    158|            }
  713|  1.28k|        }
  714|       |
  715|  3.96k|        ps_seq_svc_ext->u1_seq_tcoeff_level_prediction_flag = ih264d_get_bit_h264(ps_bitstrm);
  716|  3.96k|        COPYTHECONTEXT("SPS_EXt: u1_seq_tcoeff_level_prediction_flag",
  717|  3.96k|                       ps_seq_svc_ext->u1_seq_tcoeff_level_prediction_flag);
  718|       |
  719|  3.96k|        if(1 == ps_seq_svc_ext->u1_seq_tcoeff_level_prediction_flag)
  ------------------
  |  Branch (719:12): [True: 2.56k, False: 1.40k]
  ------------------
  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.96k|        ps_seq_svc_ext->u1_slice_header_restriction_flag = ih264d_get_bit_h264(ps_bitstrm);
  728|  3.96k|        COPYTHECONTEXT("SPS_EXt: u1_slice_header_restriction_flag",
  729|  3.96k|                       ps_seq_svc_ext->u1_slice_header_restriction_flag);
  730|       |
  731|  3.96k|        ps_seq_svc_ext->u1_svc_vui_parameters_present_flag = ih264d_get_bit_h264(ps_bitstrm);
  732|  3.96k|        COPYTHECONTEXT("SPS_EXt: u1_svc_vui_parameters_present_flag",
  733|  3.96k|                       ps_seq_svc_ext->u1_svc_vui_parameters_present_flag);
  734|       |
  735|  3.96k|        if(1 == ps_seq_svc_ext->u1_svc_vui_parameters_present_flag)
  ------------------
  |  Branch (735:12): [True: 1.09k, False: 2.87k]
  ------------------
  736|  1.09k|        {
  737|  1.09k|            if(NULL ==
  ------------------
  |  Branch (737:16): [True: 391, False: 706]
  ------------------
  738|  1.09k|               ps_svc_lyr_dec->ps_subset_sps[u1_seq_parameter_set_id].s_sps_svc_ext.ps_svc_vui_ext)
  739|    391|            {
  740|    391|                void *pv_buf;
  741|    391|                UWORD32 size;
  742|       |                /* Memory allocation only if VUI is enabled in a particular subset SPS*/
  743|    391|                size = sizeof(svc_vui_ext_t);
  744|    391|                pv_buf = ps_dec->pf_aligned_alloc(ps_dec->pv_mem_ctxt, 128, size);
  745|    391|                RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|    391|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 391]
  |  |  ------------------
  ------------------
  746|    391|                memset(pv_buf, 0, size);
  747|    391|                ps_seq_svc_ext->ps_svc_vui_ext = pv_buf;
  748|    391|                ps_svc_lyr_dec->ps_subset_sps[u1_seq_parameter_set_id]
  749|    391|                    .s_sps_svc_ext.ps_svc_vui_ext = pv_buf;
  750|    391|            }
  751|    706|            else
  752|    706|            {
  753|    706|                ps_seq_svc_ext->ps_svc_vui_ext =
  754|    706|                    ps_svc_lyr_dec->ps_subset_sps[u1_seq_parameter_set_id]
  755|    706|                        .s_sps_svc_ext.ps_svc_vui_ext;
  756|    706|            }
  757|  1.09k|            ret = isvcd_parse_vui_ext_parametres(ps_seq_svc_ext->ps_svc_vui_ext, ps_bitstrm);
  758|  1.09k|            if(ret != OK) return ret;
  ------------------
  |  |  114|  1.09k|#define OK        0
  ------------------
  |  Branch (758:16): [True: 274, False: 823]
  ------------------
  759|  1.09k|        }
  760|  3.96k|    }
  761|       |    /* Add conditions for SCALABLE BASELINE PROFILE */
  762|  18.5k|    if(SCALABLE_BASELINE_PROFILE_IDC == ps_seq->u1_profile_idc ||
  ------------------
  |  |   59|  18.5k|#define SCALABLE_BASELINE_PROFILE_IDC 83
  ------------------
  |  Branch (762:8): [True: 1.88k, False: 16.6k]
  ------------------
  763|  16.6k|       ((SCALABLE_HIGH_PROFILE_IDC == ps_seq->u1_profile_idc) && (1 == uc_constraint_set0_flag)))
  ------------------
  |  |   60|  16.6k|#define SCALABLE_HIGH_PROFILE_IDC 86
  ------------------
  |  Branch (763:9): [True: 1.81k, False: 14.8k]
  |  Branch (763:66): [True: 256, False: 1.55k]
  ------------------
  764|  2.13k|    {
  765|  2.13k|        if(ps_seq->i4_chroma_format_idc != 1)
  ------------------
  |  Branch (765:12): [True: 0, False: 2.13k]
  ------------------
  766|      0|        {
  767|      0|            return ERROR_FEATURE_UNAVAIL;
  768|      0|        }
  769|       |
  770|  2.13k|        if(ps_seq->i4_bit_depth_luma_minus8 != 0)
  ------------------
  |  Branch (770:12): [True: 0, False: 2.13k]
  ------------------
  771|      0|        {
  772|      0|            return ERROR_FEATURE_UNAVAIL;
  773|      0|        }
  774|       |
  775|  2.13k|        if(ps_seq->i4_bit_depth_chroma_minus8 != 0)
  ------------------
  |  Branch (775:12): [True: 0, False: 2.13k]
  ------------------
  776|      0|        {
  777|      0|            return ERROR_FEATURE_UNAVAIL;
  778|      0|        }
  779|       |
  780|  2.13k|        if(ps_seq->i4_qpprime_y_zero_transform_bypass_flag != 0)
  ------------------
  |  Branch (780:12): [True: 0, False: 2.13k]
  ------------------
  781|      0|        {
  782|      0|            return ERROR_FEATURE_UNAVAIL;
  783|      0|        }
  784|       |
  785|  2.13k|        if(ps_seq->u1_frame_mbs_only_flag != 1)
  ------------------
  |  Branch (785:12): [True: 156, False: 1.98k]
  ------------------
  786|    156|        {
  787|    156|            return ERROR_FEATURE_UNAVAIL;
  788|    156|        }
  789|       |
  790|  1.98k|        if((0 != ps_seq_svc_ext->i4_seq_scaled_ref_layer_left_offset % 16) &&
  ------------------
  |  Branch (790:12): [True: 0, False: 1.98k]
  ------------------
  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.98k|    }
  796|       |    /* Compare older num_reorder_frames with the new one if header is already
  797|       |     * decoded */
  798|  18.3k|    if((ps_dec->i4_header_decoded & 1) &&
  ------------------
  |  Branch (798:8): [True: 9.89k, False: 8.47k]
  ------------------
  799|  9.89k|       (1 == ps_dec->ps_sps[u1_seq_parameter_set_id].u1_is_valid) &&
  ------------------
  |  Branch (799:8): [True: 8.69k, False: 1.19k]
  ------------------
  800|  8.69k|       (1 == ps_dec->ps_sps[u1_seq_parameter_set_id].u1_vui_parameters_present_flag) &&
  ------------------
  |  Branch (800:8): [True: 1.64k, False: 7.05k]
  ------------------
  801|  1.64k|       (1 == ps_dec->ps_sps[u1_seq_parameter_set_id].s_vui.u1_bitstream_restriction_flag))
  ------------------
  |  Branch (801:8): [True: 88, False: 1.55k]
  ------------------
  802|     88|    {
  803|     88|        ps_dec->u1_res_changed = 1;
  804|     88|        return IVD_RES_CHANGED;
  805|     88|    }
  806|       |    /* In case bitstream read has exceeded the filled size, then return an error */
  807|  18.2k|    if(EXCEED_OFFSET(ps_bitstrm))
  ------------------
  |  |   93|  18.2k|  (ps_bitstrm->u4_ofst > ps_bitstrm->u4_max_ofst)
  |  |  ------------------
  |  |  |  Branch (93:3): [True: 658, False: 17.6k]
  |  |  ------------------
  ------------------
  808|    658|    {
  809|    658|        return ERROR_INV_SPS_PPS_T;
  810|    658|    }
  811|       |
  812|       |    /*--------------------------------------------------------------------*/
  813|       |    /* All initializations to ps_dec are beyond this point                */
  814|       |    /*--------------------------------------------------------------------*/
  815|  17.6k|    {
  816|  17.6k|        WORD32 reorder_depth = ih264d_get_dpb_size(ps_seq);
  817|  17.6k|        if((1 == ps_seq->u1_vui_parameters_present_flag) &&
  ------------------
  |  Branch (817:12): [True: 3.45k, False: 14.1k]
  ------------------
  818|  3.45k|           (1 == ps_seq->s_vui.u1_bitstream_restriction_flag))
  ------------------
  |  Branch (818:12): [True: 183, False: 3.27k]
  ------------------
  819|    183|        {
  820|    183|            reorder_depth = ps_seq->s_vui.u4_num_reorder_frames + 1;
  821|    183|        }
  822|       |
  823|  17.6k|        if(reorder_depth > H264_MAX_REF_PICS)
  ------------------
  |  |  534|  17.6k|#define H264_MAX_REF_PICS         16
  ------------------
  |  Branch (823:12): [True: 66, False: 17.5k]
  ------------------
  824|     66|        {
  825|     66|            return ERROR_INV_SPS_PPS_T;
  826|     66|        }
  827|       |
  828|  17.5k|        if(ps_seq->u1_frame_mbs_only_flag != 1) reorder_depth *= 2;
  ------------------
  |  Branch (828:12): [True: 1.42k, False: 16.1k]
  ------------------
  829|  17.5k|        ps_subset_seq->i4_reorder_depth = reorder_depth + DISPLAY_LATENCY;
  ------------------
  |  |   51|  17.5k|#define DISPLAY_LATENCY         2
  ------------------
  830|  17.5k|    }
  831|      0|    ps_subset_seq->u2_disp_height = i4_cropped_ht;
  832|  17.5k|    ps_subset_seq->u2_disp_width = i4_cropped_wd;
  833|  17.5k|    ps_subset_seq->u2_pic_wd = u2_pic_wd;
  834|  17.5k|    ps_subset_seq->u2_pic_ht = u2_pic_ht;
  835|       |
  836|       |    /* Assuming 8k is the maximum resolution svc dec supports*/
  837|  17.5k|    if(u2_frm_wd_y > H264_MAX_FRAME_WIDTH) return (NOT_OK);
  ------------------
  |  |   39|  17.5k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
                  if(u2_frm_wd_y > H264_MAX_FRAME_WIDTH) return (NOT_OK);
  ------------------
  |  |  116|    174|#define NOT_OK    -1
  ------------------
  |  Branch (837:8): [True: 174, False: 17.3k]
  ------------------
  838|  17.3k|    if(u2_frm_ht_y > H264_MAX_FRAME_HEIGHT) return (NOT_OK);
  ------------------
  |  |   40|  17.3k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
                  if(u2_frm_ht_y > H264_MAX_FRAME_HEIGHT) return (NOT_OK);
  ------------------
  |  |  116|    105|#define NOT_OK    -1
  ------------------
  |  Branch (838:8): [True: 105, False: 17.2k]
  ------------------
  839|  17.2k|    if(u2_frm_wd_uv > H264_MAX_FRAME_WIDTH) return (NOT_OK);
  ------------------
  |  |   39|  17.2k|#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.2k]
  ------------------
  840|  17.2k|    if(u2_frm_ht_uv > H264_MAX_FRAME_HEIGHT) return (NOT_OK);
  ------------------
  |  |   40|  17.2k|#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.2k]
  ------------------
  841|       |
  842|       |    /* Determining the Width and Height of Frame from that of Picture */
  843|  17.2k|    ps_subset_seq->u2_frm_wd_y = u2_frm_wd_y;
  844|  17.2k|    ps_subset_seq->u2_frm_ht_y = u2_frm_ht_y;
  845|  17.2k|    ps_subset_seq->u2_frm_wd_uv = u2_frm_wd_uv;
  846|  17.2k|    ps_subset_seq->u2_frm_ht_uv = u2_frm_ht_uv;
  847|       |
  848|  17.2k|    ps_subset_seq->u1_pad_len_y_v = (UWORD8) (PAD_LEN_Y_V << (1 - u1_frm));
  ------------------
  |  |  572|  17.2k|#define PAD_LEN_Y_V                   20
  ------------------
  849|  17.2k|    ps_subset_seq->u1_pad_len_cr_v = (UWORD8) (PAD_LEN_UV_V << (1 - u1_frm));
  ------------------
  |  |  574|  17.2k|#define PAD_LEN_UV_V                  8
  ------------------
  850|       |
  851|  17.2k|    ps_subset_seq->u2_crop_offset_y = u2_crop_offset_y;
  852|  17.2k|    ps_subset_seq->u2_crop_offset_uv = u2_crop_offset_uv;
  853|       |
  854|  17.2k|    ps_seq->u1_is_valid = TRUE;
  ------------------
  |  |  591|  17.2k|#define TRUE    1
  ------------------
  855|  17.2k|    ps_dec->ps_sps[u1_seq_parameter_set_id] = *ps_seq;
  856|  17.2k|    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: 738, False: 16.5k]
  ------------------
  857|    738|    {
  858|    738|        ps_seq_svc_ext->ps_svc_vui_ext =
  859|    738|            ps_svc_lyr_dec->ps_subset_sps[u1_seq_parameter_set_id].s_sps_svc_ext.ps_svc_vui_ext;
  860|    738|    }
  861|  17.2k|    ps_svc_lyr_dec->ps_subset_sps[u1_seq_parameter_set_id] = *ps_subset_seq;
  862|  17.2k|    ps_svc_lyr_dec->ps_cur_subset_sps = &ps_svc_lyr_dec->ps_subset_sps[u1_seq_parameter_set_id];
  863|       |
  864|  17.2k|    return OK;
  ------------------
  |  |  114|  17.2k|#define OK        0
  ------------------
  865|  17.2k|}
isvcd_parse_nal_unit:
  943|   172k|{
  944|   172k|    dec_bit_stream_t *ps_bitstrm;
  945|       |
  946|   172k|    dec_struct_t *ps_dec;
  947|   172k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
  948|   172k|    UWORD8 u1_nal_unit_type;
  949|   172k|    WORD32 i_status = OK;
  ------------------
  |  |  114|   172k|#define OK        0
  ------------------
  950|       |
  951|   172k|    ps_svc_lyr_dec = (svc_dec_lyr_struct_t *) dec_svc_hdl;
  952|   172k|    ps_dec = &ps_svc_lyr_dec->s_dec;
  953|       |
  954|   172k|    {
  955|   172k|        SWITCHOFFTRACE;
  956|   172k|        u1_nal_unit_type = ps_dec->u1_nal_unit_type;
  957|       |
  958|   172k|        ps_bitstrm = ps_dec->ps_bitstrm;
  959|       |
  960|       |        // Skip all NALUs if SPS and PPS are not decoded
  961|   172k|        switch(u1_nal_unit_type)
  962|   172k|        {
  963|      0|            case SLICE_DATA_PARTITION_A_NAL:
  ------------------
  |  |  325|      0|#define SLICE_DATA_PARTITION_A_NAL      2
  ------------------
  |  Branch (963:13): [True: 0, False: 172k]
  ------------------
  964|      0|            case SLICE_DATA_PARTITION_B_NAL:
  ------------------
  |  |  326|      0|#define SLICE_DATA_PARTITION_B_NAL      3
  ------------------
  |  Branch (964:13): [True: 0, False: 172k]
  ------------------
  965|      0|            case SLICE_DATA_PARTITION_C_NAL:
  ------------------
  |  |  327|      0|#define SLICE_DATA_PARTITION_C_NAL      4
  ------------------
  |  Branch (965:13): [True: 0, False: 172k]
  ------------------
  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|   107k|            case IDR_SLICE_NAL:
  ------------------
  |  |  328|   107k|#define IDR_SLICE_NAL                   5
  ------------------
  |  Branch (969:13): [True: 107k, False: 64.8k]
  ------------------
  970|   131k|            case SLICE_NAL:
  ------------------
  |  |  324|   131k|#define SLICE_NAL                       1
  ------------------
  |  Branch (970:13): [True: 23.6k, False: 148k]
  ------------------
  971|       |
  972|   131k|                if(ps_svc_lyr_dec->u1_base_res_flag != 1)
  ------------------
  |  Branch (972:20): [True: 66, False: 131k]
  ------------------
  973|     66|                {
  974|     66|                    return NOT_OK;
  ------------------
  |  |  116|     66|#define NOT_OK    -1
  ------------------
  975|     66|                }
  976|   131k|                if(!ps_dec->i4_decode_header)
  ------------------
  |  Branch (976:20): [True: 131k, False: 0]
  ------------------
  977|   131k|                {
  978|   131k|                    if(ps_dec->i4_header_decoded == 3)
  ------------------
  |  Branch (978:24): [True: 131k, False: 0]
  ------------------
  979|   131k|                    {
  980|       |                        /* ! */
  981|   131k|                        DEBUG_THREADS_PRINTF("Decoding  a slice NAL\n");
  982|   131k|                        {
  983|   131k|                            ih264d_get_pre_sei_params(ps_dec, u1_nal_unit_type);
  984|       |                            /* ! */
  985|   131k|                            ps_dec->u4_slice_start_code_found = 1;
  986|       |
  987|   131k|                            i_status = isvcd_parse_decode_slice(
  988|   131k|                                (UWORD8) (u1_nal_unit_type == IDR_SLICE_NAL), u1_nal_ref_idc,
  ------------------
  |  |  328|   131k|#define IDR_SLICE_NAL                   5
  ------------------
  989|   131k|                                ps_svc_lyr_dec);
  990|       |
  991|   131k|                            if(i_status != OK)
  ------------------
  |  |  114|   131k|#define OK        0
  ------------------
  |  Branch (991:32): [True: 77.7k, False: 53.3k]
  ------------------
  992|  77.7k|                            {
  993|  77.7k|                                return i_status;
  994|  77.7k|                            }
  995|   131k|                        }
  996|   131k|                    }
  997|   131k|                }
  998|  53.3k|                break;
  999|       |
 1000|  53.3k|            case SEI_NAL:
  ------------------
  |  |  329|      0|#define SEI_NAL                         6
  ------------------
  |  Branch (1000:13): [True: 0, False: 172k]
  ------------------
 1001|      0|            case PREFIX_UNIT_NAL:
  ------------------
  |  |   64|      0|#define PREFIX_UNIT_NAL 14
  ------------------
  |  Branch (1001:13): [True: 0, False: 172k]
  ------------------
 1002|      0|            case SEQ_PARAM_NAL:
  ------------------
  |  |  330|      0|#define SEQ_PARAM_NAL                   7
  ------------------
  |  Branch (1002:13): [True: 0, False: 172k]
  ------------------
 1003|      0|            case PIC_PARAM_NAL:
  ------------------
  |  |  331|      0|#define PIC_PARAM_NAL                   8
  ------------------
  |  Branch (1003:13): [True: 0, False: 172k]
  ------------------
 1004|      0|            case SUBSET_SPS_NAL:
  ------------------
  |  |   65|      0|#define SUBSET_SPS_NAL 15
  ------------------
  |  Branch (1004:13): [True: 0, False: 172k]
  ------------------
 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: 172k]
  ------------------
 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: 172k]
  ------------------
 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: 172k]
  ------------------
 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|  41.2k|            case CODED_SLICE_EXTENSION_NAL:
  ------------------
  |  |   66|  41.2k|#define CODED_SLICE_EXTENSION_NAL 20
  ------------------
  |  Branch (1027:13): [True: 41.2k, False: 131k]
  ------------------
 1028|       |
 1029|  41.2k|                if(ps_svc_lyr_dec->u1_base_res_flag == 1)
  ------------------
  |  Branch (1029:20): [True: 3.06k, False: 38.1k]
  ------------------
 1030|  3.06k|                {
 1031|  3.06k|                    return NOT_OK;
  ------------------
  |  |  116|  3.06k|#define NOT_OK    -1
  ------------------
 1032|  3.06k|                }
 1033|  38.1k|                if(!ps_dec->i4_decode_header)
  ------------------
  |  Branch (1033:20): [True: 38.1k, False: 0]
  ------------------
 1034|  38.1k|                {
 1035|  38.1k|                    if(ps_dec->i4_header_decoded == 3)
  ------------------
  |  Branch (1035:24): [True: 38.1k, False: 0]
  ------------------
 1036|  38.1k|                    {
 1037|       |                        /* ! */
 1038|  38.1k|                        DEBUG_THREADS_PRINTF("Decoding  an SVC slice NAL\n");
 1039|  38.1k|                        {
 1040|  38.1k|                            {
 1041|  38.1k|                                ih264d_get_pre_sei_params(ps_dec, u1_nal_unit_type);
 1042|       |                                /* ! */
 1043|  38.1k|                                ps_dec->u4_slice_start_code_found = 1;
 1044|       |
 1045|  38.1k|                                i_status = isvcd_parse_decode_slice_ext_nal(
 1046|  38.1k|                                    (UWORD8) (ps_svc_lyr_dec->ps_nal_svc_ext->u1_idr_flag),
 1047|  38.1k|                                    u1_nal_ref_idc, ps_svc_lyr_dec);
 1048|       |
 1049|  38.1k|                                if(i_status != OK)
  ------------------
  |  |  114|  38.1k|#define OK        0
  ------------------
  |  Branch (1049:36): [True: 26.7k, False: 11.4k]
  ------------------
 1050|  26.7k|                                {
 1051|  26.7k|                                    return i_status;
 1052|  26.7k|                                }
 1053|  38.1k|                            }
 1054|  38.1k|                        }
 1055|  38.1k|                    }
 1056|  38.1k|                }
 1057|  11.4k|                break;
 1058|       |
 1059|  11.4k|            default:
  ------------------
  |  Branch (1059:13): [True: 0, False: 172k]
  ------------------
 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|   172k|        }
 1063|   172k|    }
 1064|  64.8k|    return i_status;
 1065|   172k|}
isvcd_parse_sps:
 1079|  97.9k|{
 1080|  97.9k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
 1081|  97.9k|    UWORD8 i;
 1082|  97.9k|    dec_seq_params_t *ps_seq = NULL;
 1083|  97.9k|    dec_svc_seq_params_t *ps_subset_seq = NULL;
 1084|  97.9k|    UWORD8 u1_profile_idc, u1_level_idc, u1_seq_parameter_set_id, u1_mb_aff_flag = 0;
 1085|  97.9k|    UWORD16 i2_max_frm_num;
 1086|  97.9k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
 1087|  97.9k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
 1088|  97.9k|    UWORD8 u1_frm, uc_constraint_set0_flag, uc_constraint_set1_flag, uc_constraint_set2_flag;
 1089|  97.9k|    WORD32 i4_cropped_ht, i4_cropped_wd;
 1090|  97.9k|    UWORD32 u4_temp;
 1091|  97.9k|    UWORD64 u8_temp;
 1092|  97.9k|    UWORD32 u4_pic_height_in_map_units, u4_pic_width_in_mbs;
 1093|  97.9k|    UWORD32 u2_pic_wd = 0;
 1094|  97.9k|    UWORD32 u2_pic_ht = 0;
 1095|  97.9k|    UWORD32 u2_frm_wd_y = 0;
 1096|  97.9k|    UWORD32 u2_frm_ht_y = 0;
 1097|  97.9k|    UWORD32 u2_frm_wd_uv = 0;
 1098|  97.9k|    UWORD32 u2_frm_ht_uv = 0;
 1099|  97.9k|    UWORD32 u2_crop_offset_y = 0;
 1100|  97.9k|    UWORD32 u2_crop_offset_uv = 0;
 1101|  97.9k|    WORD32 ret;
 1102|  97.9k|    WORD32 num_reorder_frames;
 1103|       |    /* High profile related syntax element */
 1104|  97.9k|    WORD32 i4_i;
 1105|       |    /* G050 */
 1106|  97.9k|    UWORD8 u1_frame_cropping_flag,
 1107|  97.9k|        u1_frame_cropping_rect_left_ofst = 0, u1_frame_cropping_rect_right_ofst = 0,
 1108|  97.9k|        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|  97.9k|    SWITCHONTRACE;
 1114|  97.9k|    u1_profile_idc = ih264d_get_bits_h264(ps_bitstrm, 8);
 1115|  97.9k|    COPYTHECONTEXT("SPS: profile_idc", u1_profile_idc);
 1116|       |
 1117|       |    /* G050 */
 1118|  97.9k|    uc_constraint_set0_flag = ih264d_get_bit_h264(ps_bitstrm);
 1119|  97.9k|    uc_constraint_set1_flag = ih264d_get_bit_h264(ps_bitstrm);
 1120|  97.9k|    uc_constraint_set2_flag = ih264d_get_bit_h264(ps_bitstrm);
 1121|  97.9k|    UNUSED(uc_constraint_set2_flag);
  ------------------
  |  |   45|  97.9k|#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|  97.9k|    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|  97.9k|    if((u1_profile_idc != MAIN_PROFILE_IDC) && (u1_profile_idc != BASE_PROFILE_IDC) &&
  ------------------
  |  |  276|  97.9k|#define MAIN_PROFILE_IDC    77
  ------------------
                  if((u1_profile_idc != MAIN_PROFILE_IDC) && (u1_profile_idc != BASE_PROFILE_IDC) &&
  ------------------
  |  |  275|  62.3k|#define BASE_PROFILE_IDC    66
  ------------------
  |  Branch (1130:8): [True: 62.3k, False: 35.6k]
  |  Branch (1130:48): [True: 53.1k, False: 9.13k]
  ------------------
 1131|  53.1k|       (u1_profile_idc != HIGH_PROFILE_IDC))
  ------------------
  |  |  278|  53.1k|#define HIGH_PROFILE_IDC   100
  ------------------
  |  Branch (1131:8): [True: 49.1k, False: 4.05k]
  ------------------
 1132|  49.1k|    {
 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|  49.1k|        if((u1_profile_idc != EXTENDED_PROFILE_IDC) ||
  ------------------
  |  |  277|  49.1k|#define EXTENDED_PROFILE_IDC    88
  ------------------
  |  Branch (1137:12): [True: 538, False: 48.5k]
  ------------------
 1138|  48.5k|           ((uc_constraint_set1_flag != 1) && (uc_constraint_set0_flag != 1)))
  ------------------
  |  Branch (1138:13): [True: 26.5k, False: 22.0k]
  |  Branch (1138:47): [True: 139, False: 26.3k]
  ------------------
 1139|    677|        {
 1140|    677|            return (ERROR_FEATURE_UNAVAIL);
 1141|    677|        }
 1142|  49.1k|    }
 1143|       |
 1144|  97.3k|    u1_level_idc = ih264d_get_bits_h264(ps_bitstrm, 8);
 1145|  97.3k|    COPYTHECONTEXT("SPS: u4_level_idc", u1_level_idc);
 1146|       |
 1147|  97.3k|    u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1148|  97.3k|    if(u4_temp & MASK_ERR_SEQ_SET_ID) return ERROR_INV_SPS_PPS_T;
  ------------------
  |  |  526|  97.3k|#define MASK_ERR_SEQ_SET_ID   (0xFFFFFFE0)
  ------------------
  |  Branch (1148:8): [True: 453, False: 96.8k]
  ------------------
 1149|  96.8k|    u1_seq_parameter_set_id = u4_temp;
 1150|  96.8k|    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|  96.8k|    ps_subset_seq = ps_svc_lyr_dec->pv_scratch_subset_sps;
 1156|  96.8k|    memset(ps_subset_seq, 0, sizeof(dec_svc_seq_params_t));
 1157|  96.8k|    ps_seq = ps_dec->pv_scratch_sps_pps;
 1158|  96.8k|    memset(ps_seq, 0, sizeof(dec_seq_params_t));
 1159|       |
 1160|  96.8k|    if((ps_dec->i4_header_decoded & 1) &&
  ------------------
  |  Branch (1160:8): [True: 74.9k, False: 21.8k]
  ------------------
 1161|  74.9k|       (1 == ps_dec->ps_sps[u1_seq_parameter_set_id].u1_is_valid) &&
  ------------------
  |  Branch (1161:8): [True: 68.6k, False: 6.33k]
  ------------------
 1162|  68.6k|       (ps_dec->ps_sps[u1_seq_parameter_set_id].u1_profile_idc != u1_profile_idc))
  ------------------
  |  Branch (1162:8): [True: 468, False: 68.1k]
  ------------------
 1163|    468|    {
 1164|    468|        ps_dec->u1_res_changed = 1;
 1165|    468|        return IVD_RES_CHANGED;
 1166|    468|    }
 1167|       |
 1168|  96.3k|    if((ps_dec->i4_header_decoded & 1) &&
  ------------------
  |  Branch (1168:8): [True: 74.5k, False: 21.8k]
  ------------------
 1169|  74.5k|       (1 == ps_dec->ps_sps[u1_seq_parameter_set_id].u1_is_valid) &&
  ------------------
  |  Branch (1169:8): [True: 68.1k, False: 6.33k]
  ------------------
 1170|  68.1k|       (ps_dec->ps_sps[u1_seq_parameter_set_id].u1_level_idc != u1_level_idc))
  ------------------
  |  Branch (1170:8): [True: 1.39k, False: 66.7k]
  ------------------
 1171|  1.39k|    {
 1172|  1.39k|        ps_dec->u1_res_changed = 1;
 1173|  1.39k|        return IVD_RES_CHANGED;
 1174|  1.39k|    }
 1175|       |
 1176|  94.9k|    ps_seq->u1_profile_idc = u1_profile_idc;
 1177|  94.9k|    ps_seq->u1_level_idc = u1_level_idc;
 1178|  94.9k|    ps_seq->u1_seq_parameter_set_id = u1_seq_parameter_set_id;
 1179|  94.9k|    ps_subset_seq->ps_seq = &ps_dec->ps_sps[u1_seq_parameter_set_id];
 1180|       |
 1181|       |    /*******************************************************************/
 1182|       |    /* Initializations for high profile - Sushant                      */
 1183|       |    /*******************************************************************/
 1184|  94.9k|    ps_seq->i4_chroma_format_idc = 1;
 1185|  94.9k|    ps_seq->i4_bit_depth_luma_minus8 = 0;
 1186|  94.9k|    ps_seq->i4_bit_depth_chroma_minus8 = 0;
 1187|  94.9k|    ps_seq->i4_qpprime_y_zero_transform_bypass_flag = 0;
 1188|  94.9k|    ps_seq->i4_seq_scaling_matrix_present_flag = 0;
 1189|  94.9k|    if(u1_profile_idc == HIGH_PROFILE_IDC || u1_profile_idc == SCALABLE_BASELINE_PROFILE_IDC ||
  ------------------
  |  |  278|   189k|#define HIGH_PROFILE_IDC   100
  ------------------
                  if(u1_profile_idc == HIGH_PROFILE_IDC || u1_profile_idc == SCALABLE_BASELINE_PROFILE_IDC ||
  ------------------
  |  |   59|   186k|#define SCALABLE_BASELINE_PROFILE_IDC 83
  ------------------
  |  Branch (1189:8): [True: 3.96k, False: 91.0k]
  |  Branch (1189:46): [True: 0, False: 91.0k]
  ------------------
 1190|  91.0k|       u1_profile_idc == SCALABLE_HIGH_PROFILE_IDC)
  ------------------
  |  |   60|  91.0k|#define SCALABLE_HIGH_PROFILE_IDC 86
  ------------------
  |  Branch (1190:8): [True: 0, False: 91.0k]
  ------------------
 1191|  3.96k|    {
 1192|       |        /* reading chroma_format_idc   */
 1193|  3.96k|        ps_seq->i4_chroma_format_idc = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1194|       |
 1195|       |        /* Monochrome is not supported */
 1196|  3.96k|        if(ps_seq->i4_chroma_format_idc != 1)
  ------------------
  |  Branch (1196:12): [True: 114, False: 3.84k]
  ------------------
 1197|    114|        {
 1198|    114|            return ERROR_FEATURE_UNAVAIL;
 1199|    114|        }
 1200|       |
 1201|       |        /* reading bit_depth_luma_minus8   */
 1202|  3.84k|        ps_seq->i4_bit_depth_luma_minus8 = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1203|       |
 1204|  3.84k|        if(ps_seq->i4_bit_depth_luma_minus8 != 0)
  ------------------
  |  Branch (1204:12): [True: 115, False: 3.73k]
  ------------------
 1205|    115|        {
 1206|    115|            return ERROR_FEATURE_UNAVAIL;
 1207|    115|        }
 1208|       |
 1209|       |        /* reading bit_depth_chroma_minus8   */
 1210|  3.73k|        ps_seq->i4_bit_depth_chroma_minus8 = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1211|       |
 1212|  3.73k|        if(ps_seq->i4_bit_depth_chroma_minus8 != 0)
  ------------------
  |  Branch (1212:12): [True: 80, False: 3.65k]
  ------------------
 1213|     80|        {
 1214|     80|            return ERROR_FEATURE_UNAVAIL;
 1215|     80|        }
 1216|       |
 1217|       |        /* reading qpprime_y_zero_transform_bypass_flag   */
 1218|  3.65k|        ps_seq->i4_qpprime_y_zero_transform_bypass_flag = (WORD32) ih264d_get_bit_h264(ps_bitstrm);
 1219|       |
 1220|  3.65k|        if(ps_seq->i4_qpprime_y_zero_transform_bypass_flag != 0)
  ------------------
  |  Branch (1220:12): [True: 68, False: 3.58k]
  ------------------
 1221|     68|        {
 1222|     68|            return ERROR_INV_SPS_PPS_T;
 1223|     68|        }
 1224|       |
 1225|       |        /* reading seq_scaling_matrix_present_flag   */
 1226|  3.58k|        ps_seq->i4_seq_scaling_matrix_present_flag = (WORD32) ih264d_get_bit_h264(ps_bitstrm);
 1227|       |
 1228|  3.58k|        if(ps_seq->i4_seq_scaling_matrix_present_flag)
  ------------------
  |  Branch (1228:12): [True: 1.17k, False: 2.41k]
  ------------------
 1229|  1.17k|        {
 1230|  9.96k|            for(i4_i = 0; i4_i < 8; i4_i++)
  ------------------
  |  Branch (1230:27): [True: 9.02k, False: 939]
  ------------------
 1231|  9.02k|            {
 1232|  9.02k|                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|  9.02k|                ps_seq->u1_use_default_scaling_matrix_flag[i4_i] = 0;
 1237|       |
 1238|  9.02k|                if(ps_seq->u1_seq_scaling_list_present_flag[i4_i])
  ------------------
  |  Branch (1238:20): [True: 2.41k, False: 6.60k]
  ------------------
 1239|  2.41k|                {
 1240|  2.41k|                    if(i4_i < 6)
  ------------------
  |  Branch (1240:24): [True: 1.89k, False: 520]
  ------------------
 1241|  1.89k|                    {
 1242|  1.89k|                        ret = ih264d_scaling_list(ps_seq->i2_scalinglist4x4[i4_i], 16,
 1243|  1.89k|                                                  &ps_seq->u1_use_default_scaling_matrix_flag[i4_i],
 1244|  1.89k|                                                  ps_bitstrm);
 1245|  1.89k|                    }
 1246|    520|                    else
 1247|    520|                    {
 1248|    520|                        ret = ih264d_scaling_list(ps_seq->i2_scalinglist8x8[i4_i - 6], 64,
 1249|    520|                                                  &ps_seq->u1_use_default_scaling_matrix_flag[i4_i],
 1250|    520|                                                  ps_bitstrm);
 1251|    520|                    }
 1252|  2.41k|                    if(ret != OK)
  ------------------
  |  |  114|  2.41k|#define OK        0
  ------------------
  |  Branch (1252:24): [True: 231, False: 2.18k]
  ------------------
 1253|    231|                    {
 1254|    231|                        return ret;
 1255|    231|                    }
 1256|  2.41k|                }
 1257|  9.02k|            }
 1258|  1.17k|        }
 1259|  3.58k|    }
 1260|       |    /*--------------------------------------------------------------------*/
 1261|       |    /* Decode MaxFrameNum                                                 */
 1262|       |    /*--------------------------------------------------------------------*/
 1263|  94.3k|    u8_temp = (UWORD64) 4 + ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1264|  94.3k|    if(u8_temp > MAX_BITS_IN_FRAME_NUM)
  ------------------
  |  |  531|  94.3k|#define MAX_BITS_IN_FRAME_NUM     16
  ------------------
  |  Branch (1264:8): [True: 192, False: 94.1k]
  ------------------
 1265|    192|    {
 1266|    192|        return ERROR_INV_SPS_PPS_T;
 1267|    192|    }
 1268|  94.1k|    ps_seq->u1_bits_in_frm_num = (UWORD8) u8_temp;
 1269|  94.1k|    COPYTHECONTEXT("SPS: log2_max_frame_num_minus4", (ps_seq->u1_bits_in_frm_num - 4));
 1270|       |
 1271|  94.1k|    i2_max_frm_num = (1 << (ps_seq->u1_bits_in_frm_num));
 1272|  94.1k|    ps_seq->u2_u4_max_pic_num_minus1 = i2_max_frm_num - 1;
 1273|       |    /*--------------------------------------------------------------------*/
 1274|       |    /* Decode picture order count and related values                      */
 1275|       |    /*--------------------------------------------------------------------*/
 1276|  94.1k|    u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1277|  94.1k|    if(u4_temp > MAX_PIC_ORDER_CNT_TYPE)
  ------------------
  |  |  529|  94.1k|#define MAX_PIC_ORDER_CNT_TYPE    2
  ------------------
  |  Branch (1277:8): [True: 184, False: 94.0k]
  ------------------
 1278|    184|    {
 1279|    184|        return ERROR_INV_POC_TYPE_T;
 1280|    184|    }
 1281|  94.0k|    ps_seq->u1_pic_order_cnt_type = u4_temp;
 1282|  94.0k|    COPYTHECONTEXT("SPS: pic_order_cnt_type", ps_seq->u1_pic_order_cnt_type);
 1283|       |
 1284|  94.0k|    ps_seq->u1_num_ref_frames_in_pic_order_cnt_cycle = 1;
 1285|  94.0k|    if(ps_seq->u1_pic_order_cnt_type == 0)
  ------------------
  |  Branch (1285:8): [True: 81.8k, False: 12.1k]
  ------------------
 1286|  81.8k|    {
 1287|  81.8k|        u8_temp = (UWORD64) 4 + ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1288|  81.8k|        if(u8_temp > MAX_BITS_IN_POC_LSB)
  ------------------
  |  |  532|  81.8k|#define MAX_BITS_IN_POC_LSB       16
  ------------------
  |  Branch (1288:12): [True: 74, False: 81.8k]
  ------------------
 1289|     74|        {
 1290|     74|            return ERROR_INV_SPS_PPS_T;
 1291|     74|        }
 1292|  81.8k|        ps_seq->u1_log2_max_pic_order_cnt_lsb_minus = (UWORD8) u8_temp;
 1293|  81.8k|        ps_seq->i4_max_pic_order_cntLsb = (1 << u8_temp);
 1294|  81.8k|        COPYTHECONTEXT("SPS: log2_max_pic_order_cnt_lsb_minus4", (u8_temp - 4));
 1295|  81.8k|    }
 1296|  12.1k|    else if(ps_seq->u1_pic_order_cnt_type == 1)
  ------------------
  |  Branch (1296:13): [True: 11.0k, False: 1.08k]
  ------------------
 1297|  11.0k|    {
 1298|  11.0k|        ps_seq->u1_delta_pic_order_always_zero_flag = ih264d_get_bit_h264(ps_bitstrm);
 1299|  11.0k|        COPYTHECONTEXT("SPS: delta_pic_order_always_zero_flag",
 1300|  11.0k|                       ps_seq->u1_delta_pic_order_always_zero_flag);
 1301|       |
 1302|  11.0k|        ps_seq->i4_ofst_for_non_ref_pic = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1303|  11.0k|        COPYTHECONTEXT("SPS: offset_for_non_ref_pic", ps_seq->i4_ofst_for_non_ref_pic);
 1304|       |
 1305|  11.0k|        ps_seq->i4_ofst_for_top_to_bottom_field = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1306|  11.0k|        COPYTHECONTEXT("SPS: offset_for_top_to_bottom_field",
 1307|  11.0k|                       ps_seq->i4_ofst_for_top_to_bottom_field);
 1308|       |
 1309|  11.0k|        u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1310|  11.0k|        if(u4_temp > 255) return ERROR_INV_SPS_PPS_T;
  ------------------
  |  Branch (1310:12): [True: 172, False: 10.8k]
  ------------------
 1311|  10.8k|        ps_seq->u1_num_ref_frames_in_pic_order_cnt_cycle = u4_temp;
 1312|  10.8k|        COPYTHECONTEXT("SPS: num_ref_frames_in_pic_order_cnt_cycle",
 1313|  10.8k|                       ps_seq->u1_num_ref_frames_in_pic_order_cnt_cycle);
 1314|       |
 1315|  40.6k|        for(i = 0; i < ps_seq->u1_num_ref_frames_in_pic_order_cnt_cycle; i++)
  ------------------
  |  Branch (1315:20): [True: 29.8k, False: 10.8k]
  ------------------
 1316|  29.8k|        {
 1317|  29.8k|            ps_seq->i4_ofst_for_ref_frame[i] = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1318|  29.8k|            COPYTHECONTEXT("SPS: offset_for_ref_frame", ps_seq->i4_ofst_for_ref_frame[i]);
 1319|  29.8k|        }
 1320|  10.8k|    }
 1321|       |
 1322|  93.7k|    u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1323|       |
 1324|  93.7k|    if((u4_temp > H264_MAX_REF_PICS))
  ------------------
  |  |  534|  93.7k|#define H264_MAX_REF_PICS         16
  ------------------
  |  Branch (1324:8): [True: 315, False: 93.4k]
  ------------------
 1325|    315|    {
 1326|    315|        return ERROR_NUM_REF;
 1327|    315|    }
 1328|       |
 1329|       |    /* Compare with older num_ref_frames is header is already once */
 1330|  93.4k|    if((ps_dec->i4_header_decoded & 1) &&
  ------------------
  |  Branch (1330:8): [True: 72.9k, False: 20.5k]
  ------------------
 1331|  72.9k|       (1 == ps_dec->ps_sps[u1_seq_parameter_set_id].u1_is_valid) &&
  ------------------
  |  Branch (1331:8): [True: 66.7k, False: 6.15k]
  ------------------
 1332|  66.7k|       (ps_dec->ps_sps[u1_seq_parameter_set_id].u1_num_ref_frames != u4_temp))
  ------------------
  |  Branch (1332:8): [True: 253, False: 66.4k]
  ------------------
 1333|    253|    {
 1334|    253|        ps_dec->u1_res_changed = 1;
 1335|    253|        return IVD_RES_CHANGED;
 1336|    253|    }
 1337|       |
 1338|  93.1k|    ps_seq->u1_num_ref_frames = u4_temp;
 1339|  93.1k|    COPYTHECONTEXT("SPS: num_ref_frames", ps_seq->u1_num_ref_frames);
 1340|       |
 1341|  93.1k|    ps_seq->u1_gaps_in_frame_num_value_allowed_flag = ih264d_get_bit_h264(ps_bitstrm);
 1342|  93.1k|    COPYTHECONTEXT("SPS: gaps_in_frame_num_value_allowed_flag",
 1343|  93.1k|                   ps_seq->u1_gaps_in_frame_num_value_allowed_flag);
 1344|       |
 1345|  93.1k|    ps_seq->u1_gaps_in_frame_num_value_allowed_flag = 0;
 1346|       |
 1347|       |    /*--------------------------------------------------------------------*/
 1348|       |    /* Decode FrameWidth and FrameHeight and related values               */
 1349|       |    /*--------------------------------------------------------------------*/
 1350|  93.1k|    u8_temp = (UWORD64) 1 + ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1351|       |    /* Check  for unsupported resolutions*/
 1352|  93.1k|    if(u8_temp > (H264_MAX_FRAME_WIDTH >> 4))
  ------------------
  |  |   39|  93.1k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
  |  Branch (1352:8): [True: 122, False: 93.0k]
  ------------------
 1353|    122|    {
 1354|    122|        return IVD_STREAM_WIDTH_HEIGHT_NOT_SUPPORTED;
 1355|    122|    }
 1356|  93.0k|    u4_pic_width_in_mbs = (UWORD32) u8_temp;
 1357|  93.0k|    COPYTHECONTEXT("SPS: pic_width_in_mbs_minus1", u4_pic_width_in_mbs - 1);
 1358|       |
 1359|  93.0k|    u8_temp = (UWORD64) 1 + ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1360|  93.0k|    if(u8_temp > (H264_MAX_FRAME_HEIGHT >> 4))
  ------------------
  |  |   40|  93.0k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
  |  Branch (1360:8): [True: 129, False: 92.9k]
  ------------------
 1361|    129|    {
 1362|    129|        return IVD_STREAM_WIDTH_HEIGHT_NOT_SUPPORTED;
 1363|    129|    }
 1364|  92.9k|    u4_pic_height_in_map_units = (UWORD32) u8_temp;
 1365|       |
 1366|  92.9k|    ps_seq->u2_frm_wd_in_mbs = u4_pic_width_in_mbs;
 1367|  92.9k|    ps_seq->u2_frm_ht_in_mbs = u4_pic_height_in_map_units;
 1368|  92.9k|    u2_pic_wd = (u4_pic_width_in_mbs << 4);
 1369|  92.9k|    u2_pic_ht = (u4_pic_height_in_map_units << 4);
 1370|  92.9k|    if(ps_svc_lyr_dec->pic_width < u2_pic_wd)
  ------------------
  |  Branch (1370:8): [True: 13.3k, False: 79.6k]
  ------------------
 1371|  13.3k|    {
 1372|  13.3k|        ps_svc_lyr_dec->pic_width = u2_pic_wd;
 1373|  13.3k|    }
 1374|  92.9k|    if(ps_svc_lyr_dec->pic_height < u2_pic_ht)
  ------------------
  |  Branch (1374:8): [True: 13.3k, False: 79.5k]
  ------------------
 1375|  13.3k|    {
 1376|  13.3k|        ps_svc_lyr_dec->pic_height = u2_pic_ht;
 1377|  13.3k|    }
 1378|       |
 1379|       |    /*--------------------------------------------------------------------*/
 1380|       |    /* Get the value of MaxMbAddress and Number of bits needed for it     */
 1381|       |    /*--------------------------------------------------------------------*/
 1382|  92.9k|    ps_seq->u4_max_mb_addr = ((UWORD32)ps_seq->u2_frm_wd_in_mbs * (UWORD32)ps_seq->u2_frm_ht_in_mbs) - 1;
 1383|  92.9k|    ps_seq->u4_total_num_of_mbs = ps_seq->u4_max_mb_addr + 1;
 1384|  92.9k|    ps_seq->u1_level_idc = ih264d_correct_level_idc(u1_level_idc, ps_seq->u4_total_num_of_mbs);
 1385|       |
 1386|  92.9k|    u1_frm = ih264d_get_bit_h264(ps_bitstrm);
 1387|  92.9k|    if((ps_dec->i4_header_decoded & 1) &&
  ------------------
  |  Branch (1387:8): [True: 72.6k, False: 20.3k]
  ------------------
 1388|  72.6k|       (1 == ps_dec->ps_sps[u1_seq_parameter_set_id].u1_is_valid) &&
  ------------------
  |  Branch (1388:8): [True: 66.4k, False: 6.13k]
  ------------------
 1389|  66.4k|       (ps_dec->ps_sps[u1_seq_parameter_set_id].u1_frame_mbs_only_flag != u1_frm))
  ------------------
  |  Branch (1389:8): [True: 3.39k, False: 63.0k]
  ------------------
 1390|  3.39k|    {
 1391|  3.39k|        ps_dec->u1_res_changed = 1;
 1392|  3.39k|        return IVD_RES_CHANGED;
 1393|  3.39k|    }
 1394|  89.5k|    ps_seq->u1_frame_mbs_only_flag = u1_frm;
 1395|  89.5k|    COPYTHECONTEXT("SPS: frame_mbs_only_flag", u1_frm);
 1396|       |
 1397|  89.5k|    if(!u1_frm) u1_mb_aff_flag = ih264d_get_bit_h264(ps_bitstrm);
  ------------------
  |  Branch (1397:8): [True: 23.1k, False: 66.4k]
  ------------------
 1398|       |
 1399|  89.5k|    if((ps_dec->i4_header_decoded & 1) &&
  ------------------
  |  Branch (1399:8): [True: 69.2k, False: 20.3k]
  ------------------
 1400|  69.2k|       (1 == ps_dec->ps_sps[u1_seq_parameter_set_id].u1_is_valid) &&
  ------------------
  |  Branch (1400:8): [True: 63.0k, False: 6.13k]
  ------------------
 1401|  63.0k|       (ps_dec->ps_sps[u1_seq_parameter_set_id].u1_mb_aff_flag != u1_mb_aff_flag))
  ------------------
  |  Branch (1401:8): [True: 697, False: 62.3k]
  ------------------
 1402|    697|    {
 1403|    697|        ps_dec->u1_res_changed = 1;
 1404|    697|        return IVD_RES_CHANGED;
 1405|    697|    }
 1406|       |
 1407|  88.8k|    if(!u1_frm)
  ------------------
  |  Branch (1407:8): [True: 22.4k, False: 66.4k]
  ------------------
 1408|  22.4k|    {
 1409|  22.4k|        u2_pic_ht <<= 1;
 1410|  22.4k|        ps_seq->u1_mb_aff_flag = u1_mb_aff_flag;
 1411|  22.4k|        COPYTHECONTEXT("SPS: mb_adaptive_frame_field_flag", ps_seq->u1_mb_aff_flag);
 1412|  22.4k|    }
 1413|  66.4k|    else
 1414|  66.4k|        ps_seq->u1_mb_aff_flag = 0;
 1415|       |
 1416|  88.8k|    ps_seq->u1_direct_8x8_inference_flag = ih264d_get_bit_h264(ps_bitstrm);
 1417|  88.8k|    COPYTHECONTEXT("SPS: direct_8x8_inference_flag", ps_seq->u1_direct_8x8_inference_flag);
 1418|       |
 1419|       |    /* G050 */
 1420|  88.8k|    u1_frame_cropping_flag = ih264d_get_bit_h264(ps_bitstrm);
 1421|  88.8k|    COPYTHECONTEXT("SPS: frame_cropping_flag", u1_frame_cropping_flag);
 1422|       |
 1423|  88.8k|    if(u1_frame_cropping_flag)
  ------------------
  |  Branch (1423:8): [True: 12.7k, False: 76.1k]
  ------------------
 1424|  12.7k|    {
 1425|  12.7k|        u1_frame_cropping_rect_left_ofst = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1426|  12.7k|        COPYTHECONTEXT("SPS: frame_cropping_rect_left_offset", u1_frame_cropping_rect_left_ofst);
 1427|  12.7k|        u1_frame_cropping_rect_right_ofst = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1428|  12.7k|        COPYTHECONTEXT("SPS: frame_cropping_rect_right_offset", u1_frame_cropping_rect_right_ofst);
 1429|  12.7k|        u1_frame_cropping_rect_top_ofst = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1430|  12.7k|        COPYTHECONTEXT("SPS: frame_cropping_rect_top_offset", u1_frame_cropping_rect_top_ofst);
 1431|  12.7k|        u1_frame_cropping_rect_bottom_ofst = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1432|  12.7k|        COPYTHECONTEXT("SPS: frame_cropping_rect_bottom_offset",
 1433|  12.7k|                       u1_frame_cropping_rect_bottom_ofst);
 1434|  12.7k|    }
 1435|       |    /* G050 */
 1436|  88.8k|    ps_seq->u1_vui_parameters_present_flag = ih264d_get_bit_h264(ps_bitstrm);
 1437|  88.8k|    COPYTHECONTEXT("SPS: vui_parameters_present_flag", ps_seq->u1_vui_parameters_present_flag);
 1438|       |
 1439|  88.8k|    u2_frm_wd_y = u2_pic_wd + (UWORD8) (PAD_LEN_Y_H << 1);
  ------------------
  |  |  571|  88.8k|#define PAD_LEN_Y_H                   32
  ------------------
 1440|       |
 1441|  88.8k|    if(1 == ps_dec->u4_share_disp_buf)
  ------------------
  |  Branch (1441:8): [True: 0, False: 88.8k]
  ------------------
 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|  88.8k|    u2_frm_ht_y = u2_pic_ht + (UWORD8) (PAD_LEN_Y_V << 2);
  ------------------
  |  |  572|  88.8k|#define PAD_LEN_Y_V                   20
  ------------------
 1447|  88.8k|    u2_frm_wd_uv = u2_pic_wd + (UWORD8) (PAD_LEN_UV_H << 2);
  ------------------
  |  |  573|  88.8k|#define PAD_LEN_UV_H                  16
  ------------------
 1448|  88.8k|    u2_frm_wd_uv = MAX(u2_frm_wd_uv, u2_frm_wd_y);
  ------------------
  |  |   60|  88.8k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 0, False: 88.8k]
  |  |  ------------------
  ------------------
 1449|  88.8k|    u2_frm_ht_uv = (u2_pic_ht >> 1) + (UWORD8) (PAD_LEN_UV_V << 2);
  ------------------
  |  |  574|  88.8k|#define PAD_LEN_UV_V                  8
  ------------------
 1450|  88.8k|    u2_frm_ht_uv = MAX(u2_frm_ht_uv, (u2_frm_ht_y >> 1));
  ------------------
  |  |   60|  88.8k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 0, False: 88.8k]
  |  |  ------------------
  ------------------
 1451|       |
 1452|       |    /* Calculate display picture width, height and start u4_ofst from YUV420 */
 1453|       |    /* pictute buffers as per cropping information parsed above             */
 1454|  88.8k|    {
 1455|  88.8k|        UWORD16 u2_rgt_ofst = 0;
 1456|  88.8k|        UWORD16 u2_lft_ofst = 0;
 1457|  88.8k|        UWORD16 u2_top_ofst = 0;
 1458|  88.8k|        UWORD16 u2_btm_ofst = 0;
 1459|  88.8k|        UWORD8 u1_frm_mbs_flag;
 1460|  88.8k|        UWORD8 u1_vert_mult_factor;
 1461|       |
 1462|  88.8k|        if(u1_frame_cropping_flag)
  ------------------
  |  Branch (1462:12): [True: 12.7k, False: 76.1k]
  ------------------
 1463|  12.7k|        {
 1464|       |            /* Calculate right and left u4_ofst for cropped picture           */
 1465|  12.7k|            u2_rgt_ofst = u1_frame_cropping_rect_right_ofst << 1;
 1466|  12.7k|            u2_lft_ofst = u1_frame_cropping_rect_left_ofst << 1;
 1467|       |
 1468|       |            /* Know frame MBs only u4_flag                                      */
 1469|  12.7k|            u1_frm_mbs_flag = (1 == ps_seq->u1_frame_mbs_only_flag);
 1470|       |
 1471|       |            /* Simplify the vertical u4_ofst calculation from field/frame     */
 1472|  12.7k|            u1_vert_mult_factor = (2 - u1_frm_mbs_flag);
 1473|       |
 1474|       |            /* Calculate bottom and top u4_ofst for cropped  picture          */
 1475|  12.7k|            u2_btm_ofst = (u1_frame_cropping_rect_bottom_ofst << u1_vert_mult_factor);
 1476|  12.7k|            u2_top_ofst = (u1_frame_cropping_rect_top_ofst << u1_vert_mult_factor);
 1477|  12.7k|        }
 1478|       |
 1479|       |        /* Calculate u4_ofst from start of YUV 420 picture buffer to start of*/
 1480|       |        /* cropped picture buffer                                           */
 1481|  88.8k|        u2_crop_offset_y = (u2_frm_wd_y * u2_top_ofst) + (u2_lft_ofst);
 1482|  88.8k|        u2_crop_offset_uv =
 1483|  88.8k|            (u2_frm_wd_uv * (u2_top_ofst >> 1)) + (u2_lft_ofst >> 1) * YUV420SP_FACTOR;
  ------------------
  |  |  119|  88.8k|#define YUV420SP_FACTOR 2
  ------------------
 1484|       |        /* Calculate the display picture width and height based on crop      */
 1485|       |        /* information                                                       */
 1486|  88.8k|        i4_cropped_ht = (WORD32) u2_pic_ht - (WORD32) (u2_btm_ofst + u2_top_ofst);
 1487|  88.8k|        i4_cropped_wd = (WORD32) u2_pic_wd - (WORD32) (u2_rgt_ofst + u2_lft_ofst);
 1488|       |
 1489|  88.8k|        if((i4_cropped_ht < MB_SIZE) || (i4_cropped_wd < MB_SIZE))
  ------------------
  |  |  554|  88.8k|#define MB_SIZE             16
  ------------------
                      if((i4_cropped_ht < MB_SIZE) || (i4_cropped_wd < MB_SIZE))
  ------------------
  |  |  554|  88.6k|#define MB_SIZE             16
  ------------------
  |  Branch (1489:12): [True: 175, False: 88.6k]
  |  Branch (1489:41): [True: 137, False: 88.5k]
  ------------------
 1490|    312|        {
 1491|    312|            return ERROR_INV_SPS_PPS_T;
 1492|    312|        }
 1493|       |
 1494|  88.5k|        if((ps_dec->i4_header_decoded & 1) &&
  ------------------
  |  Branch (1494:12): [True: 68.4k, False: 20.0k]
  ------------------
 1495|  68.4k|           (1 == ps_dec->ps_sps[u1_seq_parameter_set_id].u1_is_valid) &&
  ------------------
  |  Branch (1495:12): [True: 62.3k, False: 6.10k]
  ------------------
 1496|  62.3k|           (ps_svc_lyr_dec->ps_subset_sps[u1_seq_parameter_set_id].u2_pic_wd != u2_pic_wd))
  ------------------
  |  Branch (1496:12): [True: 180, False: 62.1k]
  ------------------
 1497|    180|        {
 1498|    180|            ps_dec->u1_res_changed = 1;
 1499|    180|            return IVD_RES_CHANGED;
 1500|    180|        }
 1501|       |
 1502|  88.3k|        if((ps_dec->i4_header_decoded & 1) &&
  ------------------
  |  Branch (1502:12): [True: 68.2k, False: 20.0k]
  ------------------
 1503|  68.2k|           (1 == ps_dec->ps_sps[u1_seq_parameter_set_id].u1_is_valid) &&
  ------------------
  |  Branch (1503:12): [True: 62.1k, False: 6.10k]
  ------------------
 1504|  62.1k|           (ps_svc_lyr_dec->ps_subset_sps[u1_seq_parameter_set_id].u2_disp_width != i4_cropped_wd))
  ------------------
  |  Branch (1504:12): [True: 97, False: 62.0k]
  ------------------
 1505|     97|        {
 1506|     97|            ps_dec->u1_res_changed = 1;
 1507|     97|            return IVD_RES_CHANGED;
 1508|     97|        }
 1509|       |
 1510|  88.2k|        if((ps_dec->i4_header_decoded & 1) &&
  ------------------
  |  Branch (1510:12): [True: 68.1k, False: 20.0k]
  ------------------
 1511|  68.1k|           (1 == ps_dec->ps_sps[u1_seq_parameter_set_id].u1_is_valid) &&
  ------------------
  |  Branch (1511:12): [True: 62.0k, False: 6.10k]
  ------------------
 1512|  62.0k|           (ps_svc_lyr_dec->ps_subset_sps[u1_seq_parameter_set_id].u2_pic_ht != u2_pic_ht))
  ------------------
  |  Branch (1512:12): [True: 325, False: 61.7k]
  ------------------
 1513|    325|        {
 1514|    325|            ps_dec->u1_res_changed = 1;
 1515|    325|            return IVD_RES_CHANGED;
 1516|    325|        }
 1517|       |
 1518|  87.9k|        if((ps_dec->i4_header_decoded & 1) &&
  ------------------
  |  Branch (1518:12): [True: 67.8k, False: 20.0k]
  ------------------
 1519|  67.8k|           (1 == ps_dec->ps_sps[u1_seq_parameter_set_id].u1_is_valid) &&
  ------------------
  |  Branch (1519:12): [True: 61.7k, False: 6.10k]
  ------------------
 1520|  61.7k|           (ps_svc_lyr_dec->ps_subset_sps[u1_seq_parameter_set_id].u2_disp_height != i4_cropped_ht))
  ------------------
  |  Branch (1520:12): [True: 113, False: 61.6k]
  ------------------
 1521|    113|        {
 1522|    113|            ps_dec->u1_res_changed = 1;
 1523|    113|            return IVD_RES_CHANGED;
 1524|    113|        }
 1525|       |        /* Check again for unsupported resolutions with updated values*/
 1526|  87.8k|        if((u2_pic_wd > SVCD_MAX_FRAME_WIDTH) || (u2_pic_ht > SVCD_MAX_FRAME_HEIGHT) ||
  ------------------
  |  |   52|  87.8k|#define SVCD_MAX_FRAME_WIDTH 4096
  ------------------
                      if((u2_pic_wd > SVCD_MAX_FRAME_WIDTH) || (u2_pic_ht > SVCD_MAX_FRAME_HEIGHT) ||
  ------------------
  |  |   53|  87.8k|#define SVCD_MAX_FRAME_HEIGHT 4096
  ------------------
  |  Branch (1526:12): [True: 0, False: 87.8k]
  |  Branch (1526:50): [True: 73, False: 87.7k]
  ------------------
 1527|  87.7k|           (u2_pic_wd < SVCD_MIN_FRAME_WIDTH) || (u2_pic_ht < SVCD_MIN_FRAME_HEIGHT) ||
  ------------------
  |  |   56|  87.7k|#define SVCD_MIN_FRAME_WIDTH 32
  ------------------
                         (u2_pic_wd < SVCD_MIN_FRAME_WIDTH) || (u2_pic_ht < SVCD_MIN_FRAME_HEIGHT) ||
  ------------------
  |  |   57|  87.2k|#define SVCD_MIN_FRAME_HEIGHT 32
  ------------------
  |  Branch (1527:12): [True: 537, False: 87.2k]
  |  Branch (1527:50): [True: 108, False: 87.1k]
  ------------------
 1528|  87.1k|           (u2_pic_wd * (UWORD32) u2_pic_ht > SVCD_MAX_FRAME_SIZE))
  ------------------
  |  |   54|  87.1k|#define SVCD_MAX_FRAME_SIZE (4096 * 4096)
  ------------------
  |  Branch (1528:12): [True: 0, False: 87.1k]
  ------------------
 1529|    718|        {
 1530|    718|            return IVD_STREAM_WIDTH_HEIGHT_NOT_SUPPORTED;
 1531|    718|        }
 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|  87.1k|        if((u2_pic_wd << ps_seq->u1_mb_aff_flag) > H264_MAX_FRAME_WIDTH)
  ------------------
  |  |   39|  87.1k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
  |  Branch (1537:12): [True: 73, False: 87.0k]
  ------------------
 1538|     73|        {
 1539|     73|            return IVD_STREAM_WIDTH_HEIGHT_NOT_SUPPORTED;
 1540|     73|        }
 1541|  87.1k|    }
 1542|       |
 1543|       |    /* Backup num_reorder_frames if header is already decoded */
 1544|  87.0k|    if((ps_dec->i4_header_decoded & 1) && (1 == ps_seq->u1_vui_parameters_present_flag) &&
  ------------------
  |  Branch (1544:8): [True: 67.3k, False: 19.6k]
  |  Branch (1544:43): [True: 3.56k, False: 63.8k]
  ------------------
 1545|  3.56k|       (1 == ps_seq->s_vui.u1_bitstream_restriction_flag))
  ------------------
  |  Branch (1545:8): [True: 0, False: 3.56k]
  ------------------
 1546|      0|    {
 1547|      0|        num_reorder_frames = (WORD32) ps_seq->s_vui.u4_num_reorder_frames;
 1548|      0|    }
 1549|  87.0k|    else
 1550|  87.0k|    {
 1551|  87.0k|        num_reorder_frames = -1;
 1552|  87.0k|    }
 1553|  87.0k|    if(1 == ps_seq->u1_vui_parameters_present_flag)
  ------------------
  |  Branch (1553:8): [True: 4.62k, False: 82.4k]
  ------------------
 1554|  4.62k|    {
 1555|  4.62k|        ret = ih264d_parse_vui_parametres(&ps_seq->s_vui, ps_bitstrm);
 1556|  4.62k|        if(ret != OK) return ret;
  ------------------
  |  |  114|  4.62k|#define OK        0
  ------------------
  |  Branch (1556:12): [True: 153, False: 4.47k]
  ------------------
 1557|  4.62k|    }
 1558|       |
 1559|       |    /* Compare older num_reorder_frames with the new one if header is already
 1560|       |     * decoded */
 1561|  86.8k|    if((ps_dec->i4_header_decoded & 1) &&
  ------------------
  |  Branch (1561:8): [True: 67.3k, False: 19.4k]
  ------------------
 1562|  67.3k|       (1 == ps_dec->ps_sps[u1_seq_parameter_set_id].u1_is_valid) && (-1 != num_reorder_frames) &&
  ------------------
  |  Branch (1562:8): [True: 61.6k, False: 5.74k]
  |  Branch (1562:70): [True: 0, False: 61.6k]
  ------------------
 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|  86.8k|    if(EXCEED_OFFSET(ps_bitstrm))
  ------------------
  |  |   93|  86.8k|  (ps_bitstrm->u4_ofst > ps_bitstrm->u4_max_ofst)
  |  |  ------------------
  |  |  |  Branch (93:3): [True: 345, False: 86.5k]
  |  |  ------------------
  ------------------
 1574|    345|    {
 1575|    345|        return ERROR_INV_SPS_PPS_T;
 1576|    345|    }
 1577|       |
 1578|       |    /*--------------------------------------------------------------------*/
 1579|       |    /* All initializations to ps_dec are beyond this point                */
 1580|       |    /*--------------------------------------------------------------------*/
 1581|  86.5k|    {
 1582|  86.5k|        WORD32 reorder_depth = ih264d_get_dpb_size(ps_seq);
 1583|  86.5k|        if((1 == ps_seq->u1_vui_parameters_present_flag) &&
  ------------------
  |  Branch (1583:12): [True: 4.23k, False: 82.2k]
  ------------------
 1584|  4.23k|           (1 == ps_seq->s_vui.u1_bitstream_restriction_flag))
  ------------------
  |  Branch (1584:12): [True: 917, False: 3.32k]
  ------------------
 1585|    917|        {
 1586|    917|            reorder_depth = ps_seq->s_vui.u4_num_reorder_frames + 1;
 1587|    917|        }
 1588|       |
 1589|  86.5k|        if(reorder_depth > H264_MAX_REF_PICS)
  ------------------
  |  |  534|  86.5k|#define H264_MAX_REF_PICS         16
  ------------------
  |  Branch (1589:12): [True: 66, False: 86.4k]
  ------------------
 1590|     66|        {
 1591|     66|            return ERROR_INV_SPS_PPS_T;
 1592|     66|        }
 1593|       |
 1594|  86.4k|        if(ps_seq->u1_frame_mbs_only_flag != 1) reorder_depth *= 2;
  ------------------
  |  Branch (1594:12): [True: 21.3k, False: 65.0k]
  ------------------
 1595|  86.4k|        ps_subset_seq->i4_reorder_depth = reorder_depth + DISPLAY_LATENCY;
  ------------------
  |  |   51|  86.4k|#define DISPLAY_LATENCY         2
  ------------------
 1596|  86.4k|    }
 1597|      0|    ps_subset_seq->u2_disp_height = i4_cropped_ht;
 1598|  86.4k|    ps_subset_seq->u2_disp_width = i4_cropped_wd;
 1599|  86.4k|    ps_subset_seq->u2_pic_wd = u2_pic_wd;
 1600|  86.4k|    ps_subset_seq->u2_pic_ht = u2_pic_ht;
 1601|       |
 1602|       |    /* Determining the Width and Height of Frame from that of Picture */
 1603|  86.4k|    ps_subset_seq->u2_frm_wd_y = u2_frm_wd_y;
 1604|  86.4k|    ps_subset_seq->u2_frm_ht_y = u2_frm_ht_y;
 1605|  86.4k|    ps_subset_seq->u2_frm_wd_uv = u2_frm_wd_uv;
 1606|  86.4k|    ps_subset_seq->u2_frm_ht_uv = u2_frm_ht_uv;
 1607|       |
 1608|  86.4k|    ps_subset_seq->u1_pad_len_y_v = (UWORD8) (PAD_LEN_Y_V << (1 - u1_frm));
  ------------------
  |  |  572|  86.4k|#define PAD_LEN_Y_V                   20
  ------------------
 1609|  86.4k|    ps_subset_seq->u1_pad_len_cr_v = (UWORD8) (PAD_LEN_UV_V << (1 - u1_frm));
  ------------------
  |  |  574|  86.4k|#define PAD_LEN_UV_V                  8
  ------------------
 1610|       |
 1611|  86.4k|    ps_subset_seq->u2_crop_offset_y = u2_crop_offset_y;
 1612|  86.4k|    ps_subset_seq->u2_crop_offset_uv = u2_crop_offset_uv;
 1613|       |
 1614|  86.4k|    ps_seq->u1_is_valid = TRUE;
  ------------------
  |  |  591|  86.4k|#define TRUE    1
  ------------------
 1615|  86.4k|    ps_dec->ps_sps[u1_seq_parameter_set_id] = *ps_seq;
 1616|  86.4k|    ps_svc_lyr_dec->ps_subset_sps[u1_seq_parameter_set_id] = *ps_subset_seq;
 1617|  86.4k|    ps_svc_lyr_dec->ps_cur_subset_sps = &ps_svc_lyr_dec->ps_subset_sps[u1_seq_parameter_set_id];
 1618|       |
 1619|  86.4k|    return OK;
  ------------------
  |  |  114|  86.4k|#define OK        0
  ------------------
 1620|  86.5k|}
isvcd_parse_pps:
 1634|  71.1k|{
 1635|  71.1k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
 1636|  71.1k|    UWORD8 uc_temp;
 1637|  71.1k|    dec_seq_params_t *ps_sps = NULL;
 1638|  71.1k|    dec_pic_params_t *ps_pps = NULL;
 1639|  71.1k|    UWORD32 *pu4_bitstrm_buf = ps_dec->ps_bitstrm->pu4_buffer;
 1640|  71.1k|    UWORD32 *pu4_bitstrm_ofst = &ps_dec->ps_bitstrm->u4_ofst;
 1641|       |
 1642|       |    /* Variables used for error resilience checks */
 1643|  71.1k|    UWORD64 u8_temp;
 1644|  71.1k|    UWORD32 u4_temp;
 1645|  71.1k|    WORD32 i_temp;
 1646|       |
 1647|       |    /* For High profile related syntax elements */
 1648|  71.1k|    UWORD8 u1_more_data_flag;
 1649|  71.1k|    WORD32 i4_i;
 1650|       |
 1651|       |    /*--------------------------------------------------------------------*/
 1652|       |    /* Decode pic_parameter_set_id and find corresponding pic params      */
 1653|       |    /*--------------------------------------------------------------------*/
 1654|  71.1k|    u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1655|  71.1k|    if(u4_temp & MASK_ERR_PIC_SET_ID) return ERROR_INV_SPS_PPS_T;
  ------------------
  |  |  527|  71.1k|#define MASK_ERR_PIC_SET_ID   (0xFFFFFF00)
  ------------------
  |  Branch (1655:8): [True: 155, False: 71.0k]
  ------------------
 1656|  71.0k|    ps_pps = ps_dec->pv_scratch_sps_pps;
 1657|  71.0k|    *ps_pps = ps_dec->ps_pps[u4_temp];
 1658|  71.0k|    ps_pps->u1_pic_parameter_set_id = (UWORD8) u4_temp;
 1659|  71.0k|    COPYTHECONTEXT("PPS: pic_parameter_set_id", ps_pps->u1_pic_parameter_set_id);
 1660|       |
 1661|       |    /************************************************/
 1662|       |    /* initilization of High profile syntax element */
 1663|       |    /************************************************/
 1664|  71.0k|    ps_pps->i4_transform_8x8_mode_flag = 0;
 1665|  71.0k|    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|  71.0k|    u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1671|  71.0k|    if(u4_temp & MASK_ERR_SEQ_SET_ID) return ERROR_INV_SPS_PPS_T;
  ------------------
  |  |  526|  71.0k|#define MASK_ERR_SEQ_SET_ID   (0xFFFFFFE0)
  ------------------
  |  Branch (1671:8): [True: 227, False: 70.8k]
  ------------------
 1672|  70.8k|    COPYTHECONTEXT("PPS: seq_parameter_set_id", u4_temp);
 1673|  70.8k|    ps_sps = &ps_dec->ps_sps[u4_temp];
 1674|  70.8k|    ps_pps->ps_sps = ps_sps;
 1675|       |
 1676|       |    /*--------------------------------------------------------------------*/
 1677|       |    /* Decode entropy_coding_mode                                         */
 1678|       |    /*--------------------------------------------------------------------*/
 1679|  70.8k|    ps_pps->u1_entropy_coding_mode = ih264d_get_bit_h264(ps_bitstrm);
 1680|  70.8k|    COPYTHECONTEXT("PPS: entropy_coding_mode_flag", ps_pps->u1_entropy_coding_mode);
 1681|       |
 1682|  70.8k|    ps_pps->u1_pic_order_present_flag = ih264d_get_bit_h264(ps_bitstrm);
 1683|  70.8k|    COPYTHECONTEXT("PPS: pic_order_present_flag", ps_pps->u1_pic_order_present_flag);
 1684|       |
 1685|       |    /*--------------------------------------------------------------------*/
 1686|       |    /* Decode num_slice_groups_minus1                                     */
 1687|       |    /*--------------------------------------------------------------------*/
 1688|  70.8k|    u8_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf) + (UWORD64) 1;
 1689|  70.8k|    if(u8_temp != 1)
  ------------------
  |  Branch (1689:8): [True: 411, False: 70.4k]
  ------------------
 1690|    411|    {
 1691|    411|        return ERROR_FEATURE_UNAVAIL;
 1692|    411|    }
 1693|  70.4k|    ps_pps->u1_num_slice_groups = (UWORD8) u8_temp;
 1694|  70.4k|    COPYTHECONTEXT("PPS: num_slice_groups_minus1", ps_pps->u1_num_slice_groups - 1);
 1695|       |
 1696|       |    /*--------------------------------------------------------------------*/
 1697|       |    /* Other parameter set values                                         */
 1698|       |    /*--------------------------------------------------------------------*/
 1699|  70.4k|    u8_temp = (UWORD64) 1 + ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1700|  70.4k|    if(u8_temp >= H264_MAX_REF_IDX) return ERROR_REF_IDX;
  ------------------
  |  |  535|  70.4k|#define H264_MAX_REF_IDX          32
  ------------------
  |  Branch (1700:8): [True: 122, False: 70.2k]
  ------------------
 1701|  70.2k|    ps_pps->u1_num_ref_idx_lx_active[0] = (UWORD8) u8_temp;
 1702|  70.2k|    COPYTHECONTEXT("PPS: num_ref_idx_l0_active_minus1", ps_pps->u1_num_ref_idx_lx_active[0] - 1);
 1703|       |
 1704|  70.2k|    u8_temp = (UWORD64) 1 + ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1705|  70.2k|    if(u8_temp >= H264_MAX_REF_IDX) return ERROR_REF_IDX;
  ------------------
  |  |  535|  70.2k|#define H264_MAX_REF_IDX          32
  ------------------
  |  Branch (1705:8): [True: 299, False: 69.9k]
  ------------------
 1706|  69.9k|    ps_pps->u1_num_ref_idx_lx_active[1] = (UWORD8) u8_temp;
 1707|  69.9k|    COPYTHECONTEXT("PPS: num_ref_idx_l1_active_minus1", ps_pps->u1_num_ref_idx_lx_active[1] - 1);
 1708|       |
 1709|  69.9k|    ps_pps->u1_wted_pred_flag = ih264d_get_bit_h264(ps_bitstrm);
 1710|  69.9k|    COPYTHECONTEXT("PPS: weighted prediction u4_flag", ps_pps->u1_wted_pred_flag);
 1711|  69.9k|    uc_temp = (UWORD8) ih264d_get_bits_h264(ps_bitstrm, 2);
 1712|  69.9k|    COPYTHECONTEXT("PPS: weighted_bipred_idc", uc_temp);
 1713|  69.9k|    ps_pps->u1_wted_bipred_idc = uc_temp;
 1714|       |
 1715|  69.9k|    if(ps_pps->u1_wted_bipred_idc > MAX_WEIGHT_BIPRED_IDC) return ERROR_INV_SPS_PPS_T;
  ------------------
  |  |  536|  69.9k|#define MAX_WEIGHT_BIPRED_IDC     2
  ------------------
  |  Branch (1715:8): [True: 161, False: 69.8k]
  ------------------
 1716|       |
 1717|  69.8k|    {
 1718|  69.8k|        WORD64 i8_temp = (WORD64) 26 + ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1719|       |
 1720|  69.8k|        if((i8_temp < MIN_H264_QP) || (i8_temp > MAX_H264_QP)) return ERROR_INV_RANGE_QP_T;
  ------------------
  |  |  629|  69.8k|#define MIN_H264_QP 0
  ------------------
                      if((i8_temp < MIN_H264_QP) || (i8_temp > MAX_H264_QP)) return ERROR_INV_RANGE_QP_T;
  ------------------
  |  |  634|  69.6k|#define MAX_H264_QP 51
  ------------------
  |  Branch (1720:12): [True: 126, False: 69.6k]
  |  Branch (1720:39): [True: 193, False: 69.5k]
  ------------------
 1721|       |
 1722|  69.5k|        ps_pps->u1_pic_init_qp = (UWORD8) i8_temp;
 1723|  69.5k|        COPYTHECONTEXT("PPS: pic_init_qp_minus26", ps_pps->u1_pic_init_qp - 26);
 1724|       |
 1725|  69.5k|        i8_temp = (WORD64) 26 + ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1726|  69.5k|        if((i8_temp < MIN_H264_QP) || (i8_temp > MAX_H264_QP)) return ERROR_INV_RANGE_QP_T;
  ------------------
  |  |  629|  69.5k|#define MIN_H264_QP 0
  ------------------
                      if((i8_temp < MIN_H264_QP) || (i8_temp > MAX_H264_QP)) return ERROR_INV_RANGE_QP_T;
  ------------------
  |  |  634|  69.3k|#define MAX_H264_QP 51
  ------------------
  |  Branch (1726:12): [True: 107, False: 69.3k]
  |  Branch (1726:39): [True: 91, False: 69.3k]
  ------------------
 1727|       |
 1728|  69.3k|        ps_pps->u1_pic_init_qs = (UWORD8) i8_temp;
 1729|  69.3k|        COPYTHECONTEXT("PPS: pic_init_qs_minus26", ps_pps->u1_pic_init_qs - 26);
 1730|  69.3k|    }
 1731|       |
 1732|      0|    i_temp = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1733|  69.3k|    if((i_temp < -12) || (i_temp > 12)) return ERROR_INV_RANGE_QP_T;
  ------------------
  |  Branch (1733:8): [True: 105, False: 69.2k]
  |  Branch (1733:26): [True: 133, False: 69.0k]
  ------------------
 1734|  69.0k|    ps_pps->i1_chroma_qp_index_offset = i_temp;
 1735|  69.0k|    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|  69.0k|    ps_pps->i1_second_chroma_qp_index_offset = ps_pps->i1_chroma_qp_index_offset;
 1742|       |
 1743|  69.0k|    ps_pps->u1_deblocking_filter_parameters_present_flag = ih264d_get_bit_h264(ps_bitstrm);
 1744|  69.0k|    COPYTHECONTEXT("PPS: deblocking_filter_control_present_flag",
 1745|  69.0k|                   ps_pps->u1_deblocking_filter_parameters_present_flag);
 1746|  69.0k|    ps_pps->u1_constrained_intra_pred_flag = ih264d_get_bit_h264(ps_bitstrm);
 1747|  69.0k|    COPYTHECONTEXT("PPS: constrained_intra_pred_flag", ps_pps->u1_constrained_intra_pred_flag);
 1748|  69.0k|    ps_pps->u1_redundant_pic_cnt_present_flag = ih264d_get_bit_h264(ps_bitstrm);
 1749|  69.0k|    COPYTHECONTEXT("PPS: redundant_pic_cnt_present_flag",
 1750|  69.0k|                   ps_pps->u1_redundant_pic_cnt_present_flag);
 1751|       |
 1752|       |    /* High profile related syntax elements */
 1753|  69.0k|    u1_more_data_flag = MORE_RBSP_DATA(ps_bitstrm);
  ------------------
  |  |   97|  69.0k|    CHECK_BITS_SUFFICIENT(ps_bitstrm, 1)
  |  |  ------------------
  |  |  |  |   95|  69.0k|  (ps_bitstrm->u4_ofst + bits_to_read <= ps_bitstrm->u4_max_ofst)
  |  |  ------------------
  ------------------
 1754|       |
 1755|  69.0k|    if(u1_more_data_flag)
  ------------------
  |  Branch (1755:8): [True: 65.9k, False: 3.15k]
  ------------------
 1756|  65.9k|    {
 1757|       |        /* read transform_8x8_mode_flag  */
 1758|  65.9k|        ps_pps->i4_transform_8x8_mode_flag = (WORD32) ih264d_get_bit_h264(ps_bitstrm);
 1759|       |
 1760|       |        /* read pic_scaling_matrix_present_flag */
 1761|  65.9k|        ps_pps->i4_pic_scaling_matrix_present_flag = (WORD32) ih264d_get_bit_h264(ps_bitstrm);
 1762|       |
 1763|  65.9k|        if(ps_pps->i4_pic_scaling_matrix_present_flag)
  ------------------
  |  Branch (1763:12): [True: 2.44k, False: 63.4k]
  ------------------
 1764|  2.44k|        {
 1765|       |            /* read the scaling matrices */
 1766|  17.6k|            for(i4_i = 0; i4_i < (6 + (ps_pps->i4_transform_8x8_mode_flag << 1)); i4_i++)
  ------------------
  |  Branch (1766:27): [True: 15.5k, False: 2.08k]
  ------------------
 1767|  15.5k|            {
 1768|  15.5k|                ps_pps->u1_pic_scaling_list_present_flag[i4_i] = ih264d_get_bit_h264(ps_bitstrm);
 1769|       |
 1770|  15.5k|                if(ps_pps->u1_pic_scaling_list_present_flag[i4_i])
  ------------------
  |  Branch (1770:20): [True: 3.53k, False: 12.0k]
  ------------------
 1771|  3.53k|                {
 1772|  3.53k|                    WORD32 ret;
 1773|  3.53k|                    if(i4_i < 6)
  ------------------
  |  Branch (1773:24): [True: 2.84k, False: 682]
  ------------------
 1774|  2.84k|                    {
 1775|  2.84k|                        ret = ih264d_scaling_list(
 1776|  2.84k|                            ps_pps->i2_pic_scalinglist4x4[i4_i], 16,
 1777|  2.84k|                            &ps_pps->u1_pic_use_default_scaling_matrix_flag[i4_i], ps_bitstrm);
 1778|  2.84k|                    }
 1779|    682|                    else
 1780|    682|                    {
 1781|    682|                        ret = ih264d_scaling_list(
 1782|    682|                            ps_pps->i2_pic_scalinglist8x8[i4_i - 6], 64,
 1783|    682|                            &ps_pps->u1_pic_use_default_scaling_matrix_flag[i4_i], ps_bitstrm);
 1784|    682|                    }
 1785|       |
 1786|  3.53k|                    if(ret != OK)
  ------------------
  |  |  114|  3.53k|#define OK        0
  ------------------
  |  Branch (1786:24): [True: 358, False: 3.17k]
  ------------------
 1787|    358|                    {
 1788|    358|                        return ret;
 1789|    358|                    }
 1790|  3.53k|                }
 1791|  15.5k|            }
 1792|  2.44k|        }
 1793|       |
 1794|       |        /* read second_chroma_qp_index_offset syntax element */
 1795|  65.5k|        i_temp = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1796|  65.5k|        if((i_temp < -12) || (i_temp > 12)) return ERROR_INV_RANGE_QP_T;
  ------------------
  |  Branch (1796:12): [True: 121, False: 65.4k]
  |  Branch (1796:30): [True: 165, False: 65.2k]
  ------------------
 1797|       |
 1798|  65.2k|        ps_pps->i1_second_chroma_qp_index_offset = i_temp;
 1799|  65.2k|    }
 1800|       |
 1801|  68.4k|    if(SCALABLE_BASELINE_PROFILE_IDC == ps_sps->u1_profile_idc)
  ------------------
  |  |   59|  68.4k|#define SCALABLE_BASELINE_PROFILE_IDC 83
  ------------------
  |  Branch (1801:8): [True: 0, False: 68.4k]
  ------------------
 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|  68.4k|    if(EXCEED_OFFSET(ps_bitstrm))
  ------------------
  |  |   93|  68.4k|  (ps_bitstrm->u4_ofst > ps_bitstrm->u4_max_ofst)
  |  |  ------------------
  |  |  |  Branch (93:3): [True: 95, False: 68.3k]
  |  |  ------------------
  ------------------
 1812|     95|    {
 1813|     95|        return ERROR_INV_SPS_PPS_T;
 1814|     95|    }
 1815|  68.3k|    ps_pps->u1_is_valid = TRUE;
  ------------------
  |  |  591|  68.3k|#define TRUE    1
  ------------------
 1816|  68.3k|    ps_dec->ps_pps[ps_pps->u1_pic_parameter_set_id] = *ps_pps;
 1817|  68.3k|    return OK;
  ------------------
  |  |  114|  68.3k|#define OK        0
  ------------------
 1818|  68.4k|}

isvcd_verify_level:
   95|   143k|{
   96|   143k|    switch(u1_level_idc)
   97|   143k|    {
   98|    399|        case H264_LEVEL_1_0:
  ------------------
  |  |  291|    399|#define H264_LEVEL_1_0     10
  ------------------
  |  Branch (98:9): [True: 399, False: 143k]
  ------------------
   99|  35.4k|        case H264_LEVEL_1_1:
  ------------------
  |  |  292|  35.4k|#define H264_LEVEL_1_1     11
  ------------------
  |  Branch (99:9): [True: 35.0k, False: 108k]
  ------------------
  100|  39.6k|        case H264_LEVEL_1_2:
  ------------------
  |  |  293|  39.6k|#define H264_LEVEL_1_2     12
  ------------------
  |  Branch (100:9): [True: 4.23k, False: 139k]
  ------------------
  101|  41.6k|        case H264_LEVEL_1_3:
  ------------------
  |  |  294|  41.6k|#define H264_LEVEL_1_3     13
  ------------------
  |  Branch (101:9): [True: 1.91k, False: 141k]
  ------------------
  102|  93.2k|        case H264_LEVEL_2_0:
  ------------------
  |  |  295|  93.2k|#define H264_LEVEL_2_0     20
  ------------------
  |  Branch (102:9): [True: 51.6k, False: 92.1k]
  ------------------
  103|   101k|        case H264_LEVEL_2_1:
  ------------------
  |  |  296|   101k|#define H264_LEVEL_2_1     21
  ------------------
  |  Branch (103:9): [True: 7.74k, False: 136k]
  ------------------
  104|   102k|        case H264_LEVEL_2_2:
  ------------------
  |  |  297|   102k|#define H264_LEVEL_2_2     22
  ------------------
  |  Branch (104:9): [True: 1.08k, False: 142k]
  ------------------
  105|   105k|        case H264_LEVEL_3_0:
  ------------------
  |  |  298|   105k|#define H264_LEVEL_3_0     30
  ------------------
  |  Branch (105:9): [True: 3.20k, False: 140k]
  ------------------
  106|   106k|        case H264_LEVEL_3_1:
  ------------------
  |  |  299|   106k|#define H264_LEVEL_3_1     31
  ------------------
  |  Branch (106:9): [True: 1.26k, False: 142k]
  ------------------
  107|   123k|        case H264_LEVEL_3_2:
  ------------------
  |  |  300|   123k|#define H264_LEVEL_3_2     32
  ------------------
  |  Branch (107:9): [True: 17.3k, False: 126k]
  ------------------
  108|   138k|        case H264_LEVEL_4_0:
  ------------------
  |  |  301|   138k|#define H264_LEVEL_4_0     40
  ------------------
  |  Branch (108:9): [True: 14.2k, False: 129k]
  ------------------
  109|   139k|        case H264_LEVEL_4_1:
  ------------------
  |  |  302|   139k|#define H264_LEVEL_4_1     41
  ------------------
  |  Branch (109:9): [True: 1.81k, False: 142k]
  ------------------
  110|   143k|        case H264_LEVEL_4_2:
  ------------------
  |  |  303|   143k|#define H264_LEVEL_4_2     42
  ------------------
  |  Branch (110:9): [True: 3.66k, False: 140k]
  ------------------
  111|   143k|        case H264_LEVEL_5_0:
  ------------------
  |  |  304|   143k|#define H264_LEVEL_5_0     50
  ------------------
  |  Branch (111:9): [True: 0, False: 143k]
  ------------------
  112|   143k|        case H264_LEVEL_5_1:
  ------------------
  |  |  305|   143k|#define H264_LEVEL_5_1     51
  ------------------
  |  Branch (112:9): [True: 0, False: 143k]
  ------------------
  113|   143k|            return OK;
  ------------------
  |  |  114|   143k|#define OK        0
  ------------------
  114|    244|        default:
  ------------------
  |  Branch (114:9): [True: 244, False: 143k]
  ------------------
  115|    244|            return NOT_OK;
  ------------------
  |  |  116|    244|#define NOT_OK    -1
  ------------------
  116|   143k|    }
  117|   143k|}
isvcd_start_of_pic:
  133|   135k|{
  134|   135k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
  135|   135k|    pocstruct_t *ps_prev_poc = &ps_dec->s_cur_pic_poc;
  136|   135k|    pocstruct_t *ps_cur_poc = ps_temp_poc;
  137|       |
  138|   135k|    dec_slice_params_t *ps_cur_slice = ps_dec->ps_cur_slice;
  139|   135k|    dec_seq_params_t *ps_seq = ps_dec->ps_cur_sps;
  140|   135k|    UWORD8 u1_bottom_field_flag = ps_cur_slice->u1_bottom_field_flag;
  141|   135k|    UWORD8 u1_field_pic_flag = ps_cur_slice->u1_field_pic_flag;
  142|       |    /* high profile related declarations */
  143|   135k|    WORD32 ret;
  144|       |
  145|   135k|    H264_MUTEX_LOCK(&ps_dec->process_disp_mutex);
  146|       |
  147|   135k|    if(u1_field_pic_flag == 1)
  ------------------
  |  Branch (147:8): [True: 0, False: 135k]
  ------------------
  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|   135k|    if(check_app_out_buf_size(ps_dec) != IV_SUCCESS) return IVD_DISP_FRM_ZERO_OP_BUF_SIZE;
  ------------------
  |  Branch (154:8): [True: 1.47k, False: 133k]
  ------------------
  155|       |
  156|   133k|    ps_prev_poc->i4_pic_order_cnt_lsb = ps_cur_poc->i4_pic_order_cnt_lsb;
  157|   133k|    ps_prev_poc->i4_pic_order_cnt_msb = ps_cur_poc->i4_pic_order_cnt_msb;
  158|   133k|    ps_prev_poc->i4_delta_pic_order_cnt_bottom = ps_cur_poc->i4_delta_pic_order_cnt_bottom;
  159|   133k|    ps_prev_poc->i4_delta_pic_order_cnt[0] = ps_cur_poc->i4_delta_pic_order_cnt[0];
  160|   133k|    ps_prev_poc->i4_delta_pic_order_cnt[1] = ps_cur_poc->i4_delta_pic_order_cnt[1];
  161|   133k|    ps_prev_poc->u1_bot_field = ps_dec->ps_cur_slice->u1_bottom_field_flag;
  162|   133k|    ps_prev_poc->i4_prev_frame_num_ofst = ps_cur_poc->i4_prev_frame_num_ofst;
  163|   133k|    ps_prev_poc->u2_frame_num = u2_frame_num;
  164|   133k|    ps_dec->i1_prev_mb_qp_delta = 0;
  165|   133k|    ps_dec->i1_next_ctxt_idx = 0;
  166|       |
  167|   133k|    ps_dec->u4_nmb_deblk = 0;
  168|   133k|    if(ps_dec->u4_num_cores == 1) ps_dec->u4_nmb_deblk = 1;
  ------------------
  |  Branch (168:8): [True: 83.2k, False: 50.5k]
  ------------------
  169|       |
  170|   133k|    if(ps_seq->u1_mb_aff_flag == 1)
  ------------------
  |  Branch (170:8): [True: 0, False: 133k]
  ------------------
  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|   133k|    ps_dec->u4_use_intrapred_line_copy = 0;
  177|       |
  178|   133k|    if(ps_seq->u1_mb_aff_flag == 0)
  ------------------
  |  Branch (178:8): [True: 133k, False: 0]
  ------------------
  179|   133k|    {
  180|   133k|        ps_dec->u4_use_intrapred_line_copy = 1;
  181|   133k|    }
  182|       |
  183|   133k|    ps_dec->u4_app_disable_deblk_frm = 0;
  184|       |    /* If degrade is enabled, set the degrade flags appropriately */
  185|   133k|    if(ps_dec->i4_degrade_type && ps_dec->i4_degrade_pics)
  ------------------
  |  Branch (185:8): [True: 0, False: 133k]
  |  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|   133k|    {
  242|   133k|        dec_err_status_t *ps_err = ps_dec->ps_dec_err_status;
  243|   133k|        if((ps_cur_slice->u1_slice_type == I_SLICE) || (ps_cur_slice->u1_slice_type == SI_SLICE))
  ------------------
  |  |  370|   133k|#define I_SLICE  2
  ------------------
                      if((ps_cur_slice->u1_slice_type == I_SLICE) || (ps_cur_slice->u1_slice_type == SI_SLICE))
  ------------------
  |  |  372|   121k|#define SI_SLICE 4
  ------------------
  |  Branch (243:12): [True: 12.2k, False: 121k]
  |  Branch (243:56): [True: 314, False: 121k]
  ------------------
  244|  12.5k|            ps_err->u1_cur_pic_type = PIC_TYPE_I;
  ------------------
  |  |  609|  12.5k|#define PIC_TYPE_I        (0x00)
  ------------------
  245|   121k|        else
  246|   121k|            ps_err->u1_cur_pic_type = PIC_TYPE_UNKNOWN;
  ------------------
  |  |  608|   121k|#define PIC_TYPE_UNKNOWN  (0xFF)
  ------------------
  247|       |
  248|   133k|        if(ps_err->u1_pic_aud_i == PIC_TYPE_I)
  ------------------
  |  |  609|   133k|#define PIC_TYPE_I        (0x00)
  ------------------
  |  Branch (248:12): [True: 0, False: 133k]
  ------------------
  249|      0|        {
  250|      0|            ps_err->u1_cur_pic_type = PIC_TYPE_I;
  ------------------
  |  |  609|      0|#define PIC_TYPE_I        (0x00)
  ------------------
  251|      0|            ps_err->u1_pic_aud_i = PIC_TYPE_UNKNOWN;
  ------------------
  |  |  608|      0|#define PIC_TYPE_UNKNOWN  (0xFF)
  ------------------
  252|      0|        }
  253|       |
  254|   133k|        if(ps_cur_slice->u1_nal_unit_type == IDR_SLICE_NAL)
  ------------------
  |  |  328|   133k|#define IDR_SLICE_NAL                   5
  ------------------
  |  Branch (254:12): [True: 111k, False: 21.9k]
  ------------------
  255|   111k|        {
  256|   111k|            if(ps_err->u1_err_flag) ih264d_reset_ref_bufs(ps_dec->ps_dpb_mgr);
  ------------------
  |  Branch (256:16): [True: 0, False: 111k]
  ------------------
  257|   111k|            ps_err->u1_err_flag = ACCEPT_ALL_PICS;
  ------------------
  |  |  601|   111k|#define ACCEPT_ALL_PICS   (0x00)
  ------------------
  258|   111k|        }
  259|   133k|    }
  260|       |
  261|   133k|    if(ps_dec->u1_init_dec_flag && ps_dec->s_prev_seq_params.u1_eoseq_pending)
  ------------------
  |  Branch (261:8): [True: 109k, False: 24.5k]
  |  Branch (261:36): [True: 0, False: 109k]
  ------------------
  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|   133k|    ret = isvcd_init_pic(ps_svc_lyr_dec, u2_frame_num, i4_poc, ps_pps);
  284|   133k|    if(ret != OK) return ret;
  ------------------
  |  |  114|   133k|#define OK        0
  ------------------
  |  Branch (284:8): [True: 0, False: 133k]
  ------------------
  285|       |
  286|   133k|    ps_dec->pv_parse_tu_coeff_data = ps_dec->pv_pic_tu_coeff_data;
  287|   133k|    ps_dec->pv_proc_tu_coeff_data = ps_dec->pv_pic_tu_coeff_data;
  288|   133k|    ps_dec->ps_nmb_info = ps_dec->ps_frm_mb_info;
  289|   133k|    ps_svc_lyr_dec->ps_svc_nmb_info = ps_svc_lyr_dec->ps_svc_frm_mb_info;
  290|   133k|    if(ps_dec->u1_separate_parse)
  ------------------
  |  Branch (290:8): [True: 50.5k, False: 83.2k]
  ------------------
  291|  50.5k|    {
  292|  50.5k|        UWORD32 num_mbs;
  293|  50.5k|        num_mbs = ps_dec->ps_cur_sps->u4_total_num_of_mbs
  294|  50.5k|                  << (1 - ps_dec->ps_cur_sps->u1_frame_mbs_only_flag);
  295|       |
  296|  50.5k|        if(ps_dec->pu1_dec_mb_map)
  ------------------
  |  Branch (296:12): [True: 50.5k, False: 0]
  ------------------
  297|  50.5k|        {
  298|  50.5k|            memset((void *) ps_dec->pu1_dec_mb_map, 0, num_mbs);
  299|  50.5k|        }
  300|       |
  301|  50.5k|        if(ps_dec->pu1_recon_mb_map)
  ------------------
  |  Branch (301:12): [True: 50.5k, False: 0]
  ------------------
  302|  50.5k|        {
  303|  50.5k|            memset((void *) ps_dec->pu1_recon_mb_map, 0, num_mbs);
  304|  50.5k|        }
  305|       |
  306|  50.5k|        if(ps_dec->pu2_slice_num_map)
  ------------------
  |  Branch (306:12): [True: 50.5k, False: 0]
  ------------------
  307|  50.5k|        {
  308|  50.5k|            memset((void *) ps_dec->pu2_slice_num_map, 0, (num_mbs * sizeof(UWORD16)));
  309|  50.5k|        }
  310|  50.5k|    }
  311|       |
  312|   133k|    ps_dec->ps_parse_cur_slice = &(ps_dec->ps_dec_slice_buf[0]);
  313|   133k|    ps_dec->ps_decode_cur_slice = &(ps_dec->ps_dec_slice_buf[0]);
  314|   133k|    ps_dec->ps_computebs_cur_slice = &(ps_dec->ps_dec_slice_buf[0]);
  315|   133k|    ps_dec->u2_cur_slice_num = 0;
  316|       |
  317|       |    /* Initialize all the HP toolsets to zero */
  318|   133k|    ps_dec->s_high_profile.u1_scaling_present = 0;
  319|   133k|    ps_dec->s_high_profile.u1_transform8x8_present = 0;
  320|       |
  321|       |    /* Get Next Free Picture */
  322|   133k|    if(1 == ps_dec->u4_share_disp_buf)
  ------------------
  |  Branch (322:8): [True: 0, False: 133k]
  ------------------
  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|   133k|    if(!(u1_field_pic_flag && 0 != ps_dec->u1_top_bottom_decoded))
  ------------------
  |  Branch (334:10): [True: 0, False: 133k]
  |  Branch (334:31): [True: 0, False: 0]
  ------------------
  335|   133k|    {
  336|   133k|        pic_buffer_t *ps_cur_pic;
  337|   133k|        WORD32 cur_pic_buf_id, cur_mv_buf_id;
  338|   133k|        col_mv_buf_t *ps_col_mv;
  339|   133k|        while(1)
  ------------------
  |  Branch (339:15): [True: 133k, Folded]
  ------------------
  340|   133k|        {
  341|   133k|            ps_cur_pic = (pic_buffer_t *) ih264_buf_mgr_get_next_free(
  342|   133k|                (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|   133k|            if((ps_cur_pic == NULL) && (ps_cur_slice->u1_nal_unit_type == IDR_SLICE_NAL))
  ------------------
  |  |  328|  1.02k|#define IDR_SLICE_NAL                   5
  ------------------
  |  Branch (347:16): [True: 1.02k, False: 132k]
  |  Branch (347:40): [True: 898, False: 123]
  ------------------
  348|    898|            {
  349|    898|                WORD32 j;
  350|       |
  351|  58.3k|                for(j = 0; j < MAX_DISP_BUFS_NEW; j++)
  ------------------
  |  |   76|  58.3k|#define MAX_DISP_BUFS_NEW 64
  ------------------
  |  Branch (351:28): [True: 57.4k, False: 898]
  ------------------
  352|  57.4k|                {
  353|  57.4k|                    ih264_buf_mgr_release((buf_mgr_t *) ps_dec->pv_pic_buf_mgr, j, BUF_MGR_REF);
  ------------------
  |  |   50|  57.4k|#define BUF_MGR_REF          (1 << 2)
  ------------------
  354|  57.4k|                    ih264_buf_mgr_release((buf_mgr_t *) ps_dec->pv_mv_buf_mgr,
  355|  57.4k|                                          ps_dec->as_buf_id_info_map[j].mv_buf_id, BUF_MGR_REF);
  ------------------
  |  |   50|  57.4k|#define BUF_MGR_REF          (1 << 2)
  ------------------
  356|       |
  357|  57.4k|                    ih264_buf_mgr_release((buf_mgr_t *) ps_dec->pv_pic_buf_mgr, j, BUF_MGR_IO);
  ------------------
  |  |   53|  57.4k|#define BUF_MGR_IO           (1 << 3)
  ------------------
  358|  57.4k|                }
  359|    898|                ps_cur_pic = (pic_buffer_t *) ih264_buf_mgr_get_next_free(
  360|    898|                    (buf_mgr_t *) ps_dec->pv_pic_buf_mgr, &cur_pic_buf_id);
  361|    898|            }
  362|   133k|            if(ps_cur_pic == NULL)
  ------------------
  |  Branch (362:16): [True: 123, False: 133k]
  ------------------
  363|    123|            {
  364|    123|                ps_dec->i4_error_code = ERROR_UNAVAIL_PICBUF_T;
  365|    123|                ps_dec->ps_dec_err_status->u1_err_flag |= REJECT_CUR_PIC;
  ------------------
  |  |  602|    123|#define REJECT_CUR_PIC    (0x01)
  ------------------
  366|    123|                return ERROR_UNAVAIL_PICBUF_T;
  367|    123|            }
  368|   133k|            if(0 == ps_dec->u4_disp_buf_mapping[cur_pic_buf_id])
  ------------------
  |  Branch (368:16): [True: 133k, False: 0]
  ------------------
  369|   133k|            {
  370|   133k|                break;
  371|   133k|            }
  372|   133k|        }
  373|   133k|        ps_col_mv = (col_mv_buf_t *) ih264_buf_mgr_get_next_free(
  374|   133k|            (buf_mgr_t *) ps_dec->pv_mv_buf_mgr, &cur_mv_buf_id);
  375|   133k|        if(ps_col_mv == NULL)
  ------------------
  |  Branch (375:12): [True: 604, False: 133k]
  ------------------
  376|    604|        {
  377|    604|            ps_dec->i4_error_code = ERROR_UNAVAIL_MVBUF_T;
  378|    604|            ps_dec->ps_dec_err_status->u1_err_flag |= REJECT_CUR_PIC;
  ------------------
  |  |  602|    604|#define REJECT_CUR_PIC    (0x01)
  ------------------
  379|    604|            return ERROR_UNAVAIL_MVBUF_T;
  380|    604|        }
  381|       |
  382|   133k|        ps_dec->ps_cur_pic = ps_cur_pic;
  383|   133k|        ps_dec->u1_pic_buf_id = cur_pic_buf_id;
  384|   133k|        ps_cur_pic->u4_ts = ps_dec->u4_ts;
  385|   133k|        memcpy(&ps_cur_pic->s_sei_pic, ps_dec->ps_sei, sizeof(sei));
  386|       |
  387|   133k|        ps_cur_pic->u1_mv_buf_id = cur_mv_buf_id;
  388|   133k|        ps_dec->as_buf_id_info_map[cur_pic_buf_id].mv_buf_id = cur_mv_buf_id;
  389|       |
  390|   133k|        if(ps_dec->u1_enable_mb_info)
  ------------------
  |  Branch (390:12): [True: 0, False: 133k]
  ------------------
  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|   133k|        ps_cur_pic->pu1_col_zero_flag = (UWORD8 *) ps_col_mv->pv_col_zero_flag;
  401|   133k|        ps_cur_pic->ps_mv = (mv_pred_t *) ps_col_mv->pv_mv;
  402|   133k|        ps_dec->au1_pic_buf_ref_flag[cur_pic_buf_id] = 0;
  403|       |
  404|   133k|        {
  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|   133k|            ps_dec->ps_ref_pic_buf_lx[0] = ps_dec->ps_dpb_mgr->ps_init_dpb[0];
  409|   133k|            ps_dec->ps_ref_pic_buf_lx[1] = ps_dec->ps_dpb_mgr->ps_init_dpb[1];
  410|   133k|            *(ps_dec->ps_dpb_mgr->ps_init_dpb[0][0]) = *ps_cur_pic;
  411|       |            /* Initialize for field reference as well */
  412|   133k|            *(ps_dec->ps_dpb_mgr->ps_init_dpb[0][MAX_REF_BUFS]) = *ps_cur_pic;
  ------------------
  |  |   75|   133k|#define MAX_REF_BUFS    32
  ------------------
  413|       |
  414|   133k|            *(ps_dec->ps_dpb_mgr->ps_mod_dpb[0][0]) = *ps_cur_pic;
  415|       |            /* Initialize for field reference as well */
  416|   133k|            *(ps_dec->ps_dpb_mgr->ps_mod_dpb[0][MAX_REF_BUFS]) = *ps_cur_pic;
  ------------------
  |  |   75|   133k|#define MAX_REF_BUFS    32
  ------------------
  417|   133k|            *(ps_dec->ps_dpb_mgr->ps_init_dpb[1][0]) = *ps_cur_pic;
  418|       |            /* Initialize for field reference as well */
  419|   133k|            *(ps_dec->ps_dpb_mgr->ps_init_dpb[1][MAX_REF_BUFS]) = *ps_cur_pic;
  ------------------
  |  |   75|   133k|#define MAX_REF_BUFS    32
  ------------------
  420|   133k|            *(ps_dec->ps_dpb_mgr->ps_mod_dpb[1][0]) = *ps_cur_pic;
  421|       |            /* Initialize for field reference as well */
  422|   133k|            *(ps_dec->ps_dpb_mgr->ps_mod_dpb[1][MAX_REF_BUFS]) = *ps_cur_pic;
  ------------------
  |  |   75|   133k|#define MAX_REF_BUFS    32
  ------------------
  423|   133k|        }
  424|       |
  425|   133k|        ps_dec->ps_cur_pic->u1_picturetype = u1_field_pic_flag;
  426|   133k|        ps_dec->ps_cur_pic->u4_pack_slc_typ = SKIP_NONE;
  ------------------
  |  |  375|   133k|#define SKIP_NONE  (0x0)
  ------------------
  427|   133k|        H264_DEC_DEBUG_PRINT("got a buffer\n");
  ------------------
  |  |   39|   133k|#define H264_DEC_DEBUG_PRINT(...) {}
  ------------------
  428|   133k|    }
  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|   133k|    ps_dec->u4_pic_buf_got = 1;
  435|       |
  436|   133k|    ps_dec->ps_cur_pic->i4_poc = i4_poc;
  437|   133k|    ps_dec->ps_cur_pic->i4_frame_num = u2_frame_num;
  438|   133k|    ps_dec->ps_cur_pic->i4_pic_num = u2_frame_num;
  439|   133k|    ps_dec->ps_cur_pic->i4_top_field_order_cnt = ps_pps->i4_top_field_order_cnt;
  440|   133k|    ps_dec->ps_cur_pic->i4_bottom_field_order_cnt = ps_pps->i4_bottom_field_order_cnt;
  441|   133k|    ps_dec->ps_cur_pic->i4_avg_poc = ps_pps->i4_avg_poc;
  442|   133k|    ps_dec->ps_cur_pic->u4_time_stamp = ps_dec->u4_pts;
  443|       |
  444|   133k|    ps_dec->s_cur_pic = *(ps_dec->ps_cur_pic);
  445|   133k|    if(u1_field_pic_flag && u1_bottom_field_flag)
  ------------------
  |  Branch (445:8): [True: 0, False: 133k]
  |  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|   133k|    ps_cur_slice->u1_mbaff_frame_flag = ps_seq->u1_mb_aff_flag && (!u1_field_pic_flag);
  ------------------
  |  Branch (462:41): [True: 0, False: 133k]
  |  Branch (462:67): [True: 0, False: 0]
  ------------------
  463|   133k|    ps_dec->ps_cur_pic->u1_picturetype |= (ps_cur_slice->u1_mbaff_frame_flag << 2);
  464|       |
  465|   133k|    ps_dec->ps_cur_mb_row = ps_dec->ps_nbr_mb_row;
  466|   133k|    ps_dec->ps_cur_mb_row += 2;
  467|   133k|    ps_dec->ps_top_mb_row = ps_dec->ps_nbr_mb_row;
  468|   133k|    ps_dec->ps_top_mb_row +=
  469|   133k|        ((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|   133k|    ps_dec->ps_top_mb_row += 2;
  472|   133k|    ps_dec->ps_mv_cur = ps_dec->s_cur_pic.ps_mv;
  473|   133k|    ps_dec->ps_mv_top = ps_dec->ps_mv_top_p[0];
  474|   133k|    ps_dec->u1_mv_top_p = 0;
  475|   133k|    ps_dec->u4_mb_idx = 0;
  476|   133k|    ps_dec->ps_mv_left = ps_dec->s_cur_pic.ps_mv;
  477|   133k|    ps_dec->u4_total_mbs_coded = 0;
  478|   133k|    ps_dec->i4_submb_ofst = -(SUB_BLK_SIZE);
  ------------------
  |  |  562|   133k|#define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|   133k|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  |  |               #define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|   133k|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  ------------------
  479|   133k|    ps_dec->u4_pred_info_idx = 0;
  480|   133k|    ps_dec->u4_pred_info_pkd_idx = 0;
  481|   133k|    ps_dec->u4_dma_buf_idx = 0;
  482|   133k|    ps_dec->ps_mv = ps_dec->s_cur_pic.ps_mv;
  483|   133k|    ps_dec->ps_mv_bank_cur = ps_dec->s_cur_pic.ps_mv;
  484|   133k|    ps_dec->pu1_col_zero_flag = ps_dec->s_cur_pic.pu1_col_zero_flag;
  485|   133k|    ps_dec->ps_part = ps_dec->ps_parse_part_params;
  486|   133k|    ps_dec->i2_prev_slice_mbx = -1;
  487|   133k|    ps_dec->i2_prev_slice_mby = 0;
  488|   133k|    ps_dec->u2_mv_2mb[0] = 0;
  489|   133k|    ps_dec->u2_mv_2mb[1] = 0;
  490|   133k|    ps_dec->u1_last_pic_not_decoded = 0;
  491|       |
  492|   133k|    ps_dec->u2_cur_slice_num_dec_thread = 0;
  493|   133k|    ps_dec->u2_cur_slice_num_bs = 0;
  494|   133k|    ps_dec->u4_intra_pred_line_ofst = 0;
  495|   133k|    ps_dec->pu1_cur_y_intra_pred_line = ps_dec->pu1_y_intra_pred_line;
  496|   133k|    ps_dec->pu1_cur_u_intra_pred_line = ps_dec->pu1_u_intra_pred_line;
  497|   133k|    ps_dec->pu1_cur_v_intra_pred_line = ps_dec->pu1_v_intra_pred_line;
  498|       |
  499|   133k|    ps_dec->pu1_cur_y_intra_pred_line_base = ps_dec->pu1_y_intra_pred_line;
  500|   133k|    ps_dec->pu1_cur_u_intra_pred_line_base = ps_dec->pu1_u_intra_pred_line;
  501|   133k|    ps_dec->pu1_cur_v_intra_pred_line_base = ps_dec->pu1_v_intra_pred_line;
  502|       |
  503|   133k|    ps_dec->pu1_prev_y_intra_pred_line =
  504|   133k|        ps_dec->pu1_y_intra_pred_line + (ps_dec->u2_frm_wd_in_mbs * MB_SIZE);
  ------------------
  |  |  554|   133k|#define MB_SIZE             16
  ------------------
  505|       |
  506|   133k|    ps_dec->pu1_prev_u_intra_pred_line =
  507|   133k|        ps_dec->pu1_u_intra_pred_line + ps_dec->u2_frm_wd_in_mbs * BLK8x8SIZE * YUV420SP_FACTOR;
  ------------------
  |  |  555|   133k|#define BLK8x8SIZE          8
  ------------------
                      ps_dec->pu1_u_intra_pred_line + ps_dec->u2_frm_wd_in_mbs * BLK8x8SIZE * YUV420SP_FACTOR;
  ------------------
  |  |  119|   133k|#define YUV420SP_FACTOR 2
  ------------------
  508|   133k|    ps_dec->pu1_prev_v_intra_pred_line =
  509|   133k|        ps_dec->pu1_v_intra_pred_line + ps_dec->u2_frm_wd_in_mbs * BLK8x8SIZE;
  ------------------
  |  |  555|   133k|#define BLK8x8SIZE          8
  ------------------
  510|       |
  511|   133k|    ps_dec->ps_deblk_mbn = ps_dec->ps_deblk_pic;
  512|       |    /* Initialize The Function Pointer Depending Upon the Entropy and MbAff Flag
  513|       |     */
  514|   133k|    {
  515|   133k|        if(ps_cur_slice->u1_mbaff_frame_flag)
  ------------------
  |  Branch (515:12): [True: 0, False: 133k]
  ------------------
  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|   133k|        else
  522|   133k|        {
  523|   133k|            ps_dec->pf_compute_bs = ih264d_compute_bs_non_mbaff;
  524|   133k|            ps_svc_lyr_dec->pf_svc_compute_bs = isvcd_compute_bs_non_mbaff;
  525|   133k|            ps_dec->u1_cur_mb_fld_dec_flag = ps_cur_slice->u1_field_pic_flag;
  526|       |
  527|   133k|            if((ps_svc_lyr_dec->u1_layer_identifier == TARGET_LAYER) &&
  ------------------
  |  |  110|   133k|#define TARGET_LAYER 2
  ------------------
  |  Branch (527:16): [True: 88.7k, False: 44.3k]
  ------------------
  528|  88.7k|               (0 == ps_svc_lyr_dec->u1_base_res_flag))
  ------------------
  |  Branch (528:16): [True: 33.8k, False: 54.8k]
  ------------------
  529|  33.8k|            {
  530|  33.8k|                ps_svc_lyr_dec->pf_svc_compute_bs = isvcd_compute_bs_non_mbaff_target_lyr;
  531|  33.8k|            }
  532|       |
  533|   133k|            if((ps_svc_lyr_dec->u1_layer_identifier == TARGET_LAYER) &&
  ------------------
  |  |  110|   133k|#define TARGET_LAYER 2
  ------------------
  |  Branch (533:16): [True: 88.7k, False: 44.3k]
  ------------------
  534|  88.7k|               (1 == ps_svc_lyr_dec->u1_base_res_flag))
  ------------------
  |  Branch (534:16): [True: 54.8k, False: 33.8k]
  ------------------
  535|  54.8k|            {
  536|  54.8k|                ps_svc_lyr_dec->pf_svc_compute_bs =
  537|  54.8k|                    isvcd_compute_bs_non_mbaff_target_lyr_no_inter_layer;
  538|  54.8k|            }
  539|       |
  540|   133k|            if((ps_svc_lyr_dec->u1_layer_identifier == MEDIAL_ENHANCEMENT_LAYER) &&
  ------------------
  |  |  109|   133k|#define MEDIAL_ENHANCEMENT_LAYER 1
  ------------------
  |  Branch (540:16): [True: 0, False: 133k]
  ------------------
  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|   133k|        }
  546|   133k|    }
  547|       |    /* Set up the Parameter for DMA transfer */
  548|   133k|    {
  549|   133k|        UWORD8 u1_field_pic_flag = ps_dec->ps_cur_slice->u1_field_pic_flag;
  550|   133k|        UWORD8 u1_mbaff = ps_cur_slice->u1_mbaff_frame_flag;
  551|   133k|        UWORD16 uc_lastmbs = (((ps_dec->u2_pic_wd) >> 4) % (ps_dec->u4_recon_mb_grp >> u1_mbaff));
  552|   133k|        UWORD16 ui16_lastmbs_widthY =
  553|   133k|            (uc_lastmbs ? (uc_lastmbs << 4) : ((ps_dec->u4_recon_mb_grp >> u1_mbaff) << 4));
  ------------------
  |  Branch (553:14): [True: 0, False: 133k]
  ------------------
  554|   133k|        UWORD16 ui16_lastmbs_widthUV =
  555|   133k|            uc_lastmbs ? (uc_lastmbs << 3) : ((ps_dec->u4_recon_mb_grp >> u1_mbaff) << 3);
  ------------------
  |  Branch (555:13): [True: 0, False: 133k]
  ------------------
  556|       |
  557|   133k|        ps_dec->s_tran_addrecon.pu1_dest_y = ps_dec->s_cur_pic.pu1_buf1;
  558|   133k|        ps_dec->s_tran_addrecon.pu1_dest_u = ps_dec->s_cur_pic.pu1_buf2;
  559|   133k|        ps_dec->s_tran_addrecon.pu1_dest_v = ps_dec->s_cur_pic.pu1_buf3;
  560|       |
  561|   133k|        ps_dec->s_tran_addrecon.u2_frm_wd_y = ps_dec->u2_frm_wd_y << u1_field_pic_flag;
  562|   133k|        ps_dec->s_tran_addrecon.u2_frm_wd_uv = ps_dec->u2_frm_wd_uv << u1_field_pic_flag;
  563|       |
  564|   133k|        if(u1_field_pic_flag)
  ------------------
  |  Branch (564:12): [True: 0, False: 133k]
  ------------------
  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|   133k|        ps_dec->s_tran_addrecon.u4_inc_y[0] = ((ps_dec->u4_recon_mb_grp << 4) >> u1_mbaff);
  572|   133k|        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|   133k|        ps_dec->s_tran_addrecon.u4_inc_y[1] =
  576|   133k|            (ui16_lastmbs_widthY + (PAD_LEN_Y_H << 1) +
  ------------------
  |  |  571|   133k|#define PAD_LEN_Y_H                   32
  ------------------
  577|   133k|             ps_dec->s_tran_addrecon.u2_frm_wd_y * ((15 << u1_mbaff) + u1_mbaff));
  578|   133k|        ps_dec->s_tran_addrecon.u4_inc_uv[1] =
  579|   133k|            (ui16_lastmbs_widthUV + (PAD_LEN_UV_H << 2) +
  ------------------
  |  |  573|   133k|#define PAD_LEN_UV_H                  16
  ------------------
  580|   133k|             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|   133k|        ih264d_assign_pic_num(ps_dec);
  585|   133k|        ps_dec->s_tran_addrecon.u2_mv_top_left_inc =
  586|   133k|            (ps_dec->u4_recon_mb_grp << 2) - 1 - (u1_mbaff << 2);
  587|   133k|        ps_dec->s_tran_addrecon.u2_mv_left_inc = ((ps_dec->u4_recon_mb_grp >> u1_mbaff) - 1)
  588|   133k|                                                 << (4 + u1_mbaff);
  589|   133k|    }
  590|       |    /**********************************************************************/
  591|       |    /* High profile related initialization at pictrue level               */
  592|       |    /**********************************************************************/
  593|   133k|    if((ps_seq->u1_profile_idc == HIGH_PROFILE_IDC) ||
  ------------------
  |  |  278|   133k|#define HIGH_PROFILE_IDC   100
  ------------------
  |  Branch (593:8): [True: 7.81k, False: 125k]
  ------------------
  594|   125k|       (ps_seq->u1_profile_idc == SCALABLE_HIGH_PROFILE_IDC) ||
  ------------------
  |  |   60|   125k|#define SCALABLE_HIGH_PROFILE_IDC 86
  ------------------
  |  Branch (594:8): [True: 1.75k, False: 123k]
  ------------------
  595|   123k|       (ps_seq->u1_profile_idc == SCALABLE_BASELINE_PROFILE_IDC))
  ------------------
  |  |   59|   123k|#define SCALABLE_BASELINE_PROFILE_IDC 83
  ------------------
  |  Branch (595:8): [True: 3.58k, False: 119k]
  ------------------
  596|  13.1k|    {
  597|  13.1k|        if((ps_seq->i4_seq_scaling_matrix_present_flag) ||
  ------------------
  |  Branch (597:12): [True: 8.33k, False: 4.82k]
  ------------------
  598|  4.82k|           (ps_pps->i4_pic_scaling_matrix_present_flag))
  ------------------
  |  Branch (598:12): [True: 988, False: 3.83k]
  ------------------
  599|  9.32k|        {
  600|  9.32k|            ret = ih264d_form_scaling_matrix_picture(ps_seq, ps_pps, ps_dec);
  601|  9.32k|            ps_dec->s_high_profile.u1_scaling_present = 1;
  602|  9.32k|        }
  603|  3.83k|        else
  604|  3.83k|        {
  605|  3.83k|            ret = ih264d_form_default_scaling_matrix(ps_dec);
  606|  3.83k|        }
  607|       |
  608|  13.1k|        if(ps_pps->i4_transform_8x8_mode_flag)
  ------------------
  |  Branch (608:12): [True: 7.55k, False: 5.60k]
  ------------------
  609|  7.55k|        {
  610|  7.55k|            ps_dec->s_high_profile.u1_transform8x8_present = 1;
  611|  7.55k|        }
  612|  13.1k|    }
  613|   119k|    else
  614|   119k|    {
  615|   119k|        ret = ih264d_form_default_scaling_matrix(ps_dec);
  616|   119k|    }
  617|       |
  618|   133k|    if(ret != OK) return ret;
  ------------------
  |  |  114|   133k|#define OK        0
  ------------------
  |  Branch (618:8): [True: 0, False: 133k]
  ------------------
  619|       |
  620|       |    /* required while reading the transform_size_8x8 u4_flag */
  621|   133k|    ps_dec->s_high_profile.u1_direct_8x8_inference_flag = ps_seq->u1_direct_8x8_inference_flag;
  622|   133k|    ps_dec->s_high_profile.s_cavlc_ctxt = ps_dec->s_cavlc_ctxt;
  623|       |
  624|   133k|    ps_dec->i1_recon_in_thread3_flag = 1;
  625|   133k|    ps_dec->ps_frame_buf_ip_recon = &ps_dec->s_tran_addrecon;
  626|   133k|    if(ps_dec->u1_separate_parse)
  ------------------
  |  Branch (626:8): [True: 50.0k, False: 83.0k]
  ------------------
  627|  50.0k|    {
  628|  50.0k|        memcpy(&ps_dec->s_tran_addrecon_parse, &ps_dec->s_tran_addrecon, sizeof(tfr_ctxt_t));
  629|  50.0k|    }
  630|       |
  631|   133k|    ih264d_init_deblk_tfr_ctxt(ps_dec, &(ps_dec->s_pad_mgr), &(ps_dec->s_tran_addrecon),
  632|   133k|                               ps_dec->u2_frm_wd_in_mbs, 0);
  633|       |
  634|   133k|    ps_dec->ps_cur_deblk_mb = ps_dec->ps_deblk_pic;
  635|   133k|    ps_dec->u4_cur_deblk_mb_num = 0;
  636|   133k|    ps_dec->u4_deblk_mb_x = 0;
  637|   133k|    ps_dec->u4_deblk_mb_y = 0;
  638|   133k|    ps_dec->pu4_wt_ofsts = ps_dec->pu4_wts_ofsts_mat;
  639|       |
  640|   133k|    ps_dec->u4_first_slice_in_pic = 0;
  641|   133k|    H264_MUTEX_UNLOCK(&ps_dec->process_disp_mutex);
  642|   133k|    return OK;
  ------------------
  |  |  114|   133k|#define OK        0
  ------------------
  643|   133k|}
isvcd_parse_decode_slice_ext_nal:
  657|  38.1k|{
  658|  38.1k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
  659|  38.1k|    dec_bit_stream_t *ps_bitstrm = ps_dec->ps_bitstrm;
  660|  38.1k|    dec_pic_params_t *ps_pps;
  661|  38.1k|    dec_seq_params_t *ps_seq;
  662|  38.1k|    dec_svc_seq_params_t *ps_subset_seq;
  663|  38.1k|    dec_slice_params_t *ps_cur_slice = NULL;
  664|  38.1k|    dec_slice_svc_ext_params_t *ps_svc_slice_params = NULL;
  665|       |
  666|  38.1k|    pocstruct_t s_tmp_poc = {0};
  667|  38.1k|    WORD32 i_delta_poc[2] = {0};
  668|  38.1k|    WORD32 i4_poc = 0;
  669|  38.1k|    UWORD16 u2_first_mb_in_slice, u2_frame_num;
  670|  38.1k|    UWORD8 u1_field_pic_flag, u1_redundant_pic_cnt = 0, u1_slice_type;
  671|  38.1k|    UWORD32 u4_idr_pic_id = 0;
  672|  38.1k|    UWORD8 u1_bottom_field_flag, u1_pic_order_cnt_type;
  673|       |
  674|  38.1k|    UWORD8 u1_nal_unit_type;
  675|  38.1k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
  676|  38.1k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
  677|  38.1k|    WORD8 i1_is_end_of_poc;
  678|  38.1k|    WORD32 ret;
  679|  38.1k|    WORD32 prev_slice_err, num_mb_skipped;
  680|  38.1k|    UWORD8 u1_mbaff;
  681|  38.1k|    pocstruct_t *ps_cur_poc;
  682|  38.1k|    UWORD32 u4_temp;
  683|  38.1k|    WORD32 i_temp;
  684|  38.1k|    svc_dec_ctxt_t *psvcd_dec_ctxt;
  685|  38.1k|    dec_struct_t *ps_dec_cur_lyr_minus_1;
  686|  38.1k|    svc_dec_lyr_struct_t *ps_svc_cur_lyr_dec_minus_1;
  687|       |
  688|  38.1k|    ps_cur_slice = ps_dec->ps_cur_slice;
  689|  38.1k|    ps_svc_slice_params = &ps_svc_lyr_dec->s_svc_slice_params;
  690|       |
  691|       |    /* read FirstMbInSlice  and slice type*/
  692|  38.1k|    ps_dec->ps_dpb_cmds->u1_dpb_commands_read_slc = 0;
  693|  38.1k|    u2_first_mb_in_slice = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  694|  38.1k|    if(u2_first_mb_in_slice > (ps_dec->u2_frm_ht_in_mbs * ps_dec->u2_frm_wd_in_mbs))
  ------------------
  |  Branch (694:8): [True: 156, False: 37.9k]
  ------------------
  695|    156|    {
  696|    156|        return ERROR_CORRUPTED_SLICE;
  697|    156|    }
  698|       |
  699|       |    /*we currently don not support ASO*/
  700|  37.9k|    if(((u2_first_mb_in_slice << ps_cur_slice->u1_mbaff_frame_flag) <= ps_dec->u4_cur_mb_addr) &&
  ------------------
  |  Branch (700:8): [True: 37.1k, False: 876]
  ------------------
  701|  37.1k|       (ps_dec->u4_first_slice_in_pic == 0))
  ------------------
  |  Branch (701:8): [True: 106, False: 37.0k]
  ------------------
  702|    106|    {
  703|    106|        return ERROR_CORRUPTED_SLICE;
  704|    106|    }
  705|       |
  706|  37.8k|    if(ps_dec->u4_first_slice_in_pic == 1)
  ------------------
  |  Branch (706:8): [True: 37.0k, False: 793]
  ------------------
  707|  37.0k|    {
  708|  37.0k|        if(u2_first_mb_in_slice != 0)
  ------------------
  |  Branch (708:12): [True: 83, False: 37.0k]
  ------------------
  709|     83|        {
  710|     83|            return ERROR_CORRUPTED_SLICE;
  711|     83|        }
  712|  37.0k|    }
  713|       |
  714|  37.7k|    COPYTHECONTEXT("Slice Header SVC ext: first_mb_in_slice", u2_first_mb_in_slice);
  715|       |
  716|  37.7k|    u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  717|       |
  718|  37.7k|    if(u4_temp > 9) return ERROR_INV_SLC_TYPE_T;
  ------------------
  |  Branch (718:8): [True: 94, False: 37.7k]
  ------------------
  719|       |
  720|  37.7k|    u1_slice_type = u4_temp;
  721|  37.7k|    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|  37.7k|    if(u1_slice_type > 4)
  ------------------
  |  Branch (725:8): [True: 392, False: 37.3k]
  ------------------
  726|    392|    {
  727|    392|        u1_slice_type -= 5;
  728|    392|    }
  729|       |
  730|  37.7k|    u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  731|  37.7k|    if(u4_temp & MASK_ERR_PIC_SET_ID) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  |  527|  37.7k|#define MASK_ERR_PIC_SET_ID   (0xFFFFFF00)
  ------------------
  |  Branch (731:8): [True: 69, False: 37.6k]
  ------------------
  732|       |    /* discard slice if pic param is invalid */
  733|  37.6k|    COPYTHECONTEXT("Slice Header SVC ext: pic_parameter_set_id", u4_temp);
  734|  37.6k|    ps_pps = &ps_dec->ps_pps[u4_temp];
  735|  37.6k|    if(FALSE == ps_pps->u1_is_valid)
  ------------------
  |  |  592|  37.6k|#define FALSE   0
  ------------------
  |  Branch (735:8): [True: 53, False: 37.5k]
  ------------------
  736|     53|    {
  737|     53|        return ERROR_INV_SLICE_HDR_T;
  738|     53|    }
  739|       |    /* slices in a layer should have same PPS id*/
  740|  37.5k|    if(UINT32_MAX == ps_svc_lyr_dec->u4_pps_id_for_layer)
  ------------------
  |  Branch (740:8): [True: 36.7k, False: 787]
  ------------------
  741|  36.7k|    {
  742|  36.7k|        ps_svc_lyr_dec->u4_pps_id_for_layer = u4_temp;
  743|  36.7k|    }
  744|    787|    else if(u4_temp != ps_svc_lyr_dec->u4_pps_id_for_layer)
  ------------------
  |  Branch (744:13): [True: 79, False: 708]
  ------------------
  745|     79|    {
  746|     79|        return ERROR_INV_SLICE_HDR_T;
  747|     79|    }
  748|  37.5k|    ps_seq = ps_pps->ps_sps;
  749|  37.5k|    ps_seq += MAX_NUM_SEQ_PARAMS;
  ------------------
  |  |  521|  37.5k|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
  750|  37.5k|    ps_subset_seq =
  751|  37.5k|        &ps_svc_lyr_dec->ps_subset_sps[MAX_NUM_SEQ_PARAMS + ps_seq->u1_seq_parameter_set_id];
  ------------------
  |  |  521|  37.5k|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
  752|       |
  753|  37.5k|    ps_dec->ps_cur_sps = ps_seq;
  754|  37.5k|    ps_svc_lyr_dec->ps_cur_subset_sps = ps_subset_seq;
  755|       |
  756|  37.5k|    if(!ps_seq) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (756:8): [True: 0, False: 37.5k]
  ------------------
  757|  37.5k|    if(FALSE == ps_seq->u1_is_valid) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  |  592|  37.5k|#define FALSE   0
  ------------------
  |  Branch (757:8): [True: 258, False: 37.2k]
  ------------------
  758|  37.2k|    if(ps_seq->u1_mb_aff_flag) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (758:8): [True: 86, False: 37.1k]
  ------------------
  759|  37.1k|    if(ps_seq->u1_level_idc > H264_LEVEL_4_2) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  |  303|  37.1k|#define H264_LEVEL_4_2     42
  ------------------
  |  Branch (759:8): [True: 78, False: 37.0k]
  ------------------
  760|  37.0k|    if(!ps_seq->u1_frame_mbs_only_flag) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (760:8): [True: 67, False: 37.0k]
  ------------------
  761|  37.0k|    if(OK != isvcd_verify_level(ps_seq->u1_level_idc)) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  |  114|  37.0k|#define OK        0
  ------------------
  |  Branch (761:8): [True: 74, False: 36.9k]
  ------------------
  762|       |
  763|  36.9k|    if(ps_dec->u1_init_dec_flag == 1)
  ------------------
  |  Branch (763:8): [True: 29.6k, False: 7.26k]
  ------------------
  764|  29.6k|    {
  765|  29.6k|        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: 66, False: 29.6k]
  ------------------
  766|  29.6k|        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: 67, False: 29.5k]
  ------------------
  767|  29.6k|    }
  768|       |
  769|  36.8k|    if(ps_dec->u1_init_dec_flag == 1)
  ------------------
  |  Branch (769:8): [True: 29.5k, False: 7.26k]
  ------------------
  770|  29.5k|    {
  771|  29.5k|        if(ps_dec->u2_disp_height != ps_subset_seq->u2_disp_height) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (771:12): [True: 92, False: 29.4k]
  ------------------
  772|  29.4k|        if(ps_dec->u2_disp_width != ps_subset_seq->u2_disp_width) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (772:12): [True: 68, False: 29.3k]
  ------------------
  773|  29.4k|    }
  774|       |
  775|  36.6k|    ps_dec->i4_reorder_depth = ps_subset_seq->i4_reorder_depth;
  776|       |
  777|  36.6k|    ps_dec->u2_disp_height = ps_subset_seq->u2_disp_height;
  778|  36.6k|    ps_dec->u2_disp_width = ps_subset_seq->u2_disp_width;
  779|       |
  780|  36.6k|    if(ps_svc_lyr_dec->u1_layer_id > 0)
  ------------------
  |  Branch (780:8): [True: 36.6k, False: 0]
  ------------------
  781|  36.6k|    {
  782|  36.6k|        psvcd_dec_ctxt = ps_svc_lyr_dec->ps_svcd_ctxt;
  783|  36.6k|        ps_svc_cur_lyr_dec_minus_1 =
  784|  36.6k|            &psvcd_dec_ctxt->ps_svc_dec_lyr[ps_svc_lyr_dec->u1_layer_id - 1];
  785|       |
  786|  36.6k|        ps_dec_cur_lyr_minus_1 = &ps_svc_cur_lyr_dec_minus_1->s_dec;
  787|       |
  788|  36.6k|        if((ps_dec_cur_lyr_minus_1->u2_pic_wd > ps_subset_seq->u2_pic_wd) ||
  ------------------
  |  Branch (788:12): [True: 71, False: 36.5k]
  ------------------
  789|  36.5k|           (ps_dec_cur_lyr_minus_1->u2_pic_ht > ps_subset_seq->u2_pic_ht))
  ------------------
  |  Branch (789:12): [True: 73, False: 36.5k]
  ------------------
  790|    144|        {
  791|    144|            return ERROR_CORRUPTED_SLICE;
  792|    144|        }
  793|  36.6k|    }
  794|       |
  795|  36.5k|    ps_dec->u2_pic_wd = ps_subset_seq->u2_pic_wd;
  796|  36.5k|    ps_dec->u2_pic_ht = ps_subset_seq->u2_pic_ht;
  797|  36.5k|    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|  36.5k|    ps_dec->u2_frm_wd_y = ps_subset_seq->u2_frm_wd_y;
  801|  36.5k|    ps_dec->u2_frm_ht_y = ps_subset_seq->u2_frm_ht_y;
  802|       |
  803|  36.5k|    ps_dec->u2_frm_wd_uv = ps_subset_seq->u2_frm_wd_uv;
  804|  36.5k|    ps_dec->u2_frm_ht_uv = ps_subset_seq->u2_frm_ht_uv;
  805|       |
  806|  36.5k|    ps_dec->s_pad_mgr.u1_pad_len_y_v = ps_subset_seq->u1_pad_len_y_v;
  807|  36.5k|    ps_dec->s_pad_mgr.u1_pad_len_cr_v = ps_subset_seq->u1_pad_len_cr_v;
  808|       |
  809|  36.5k|    ps_dec->u2_frm_wd_in_mbs = ps_seq->u2_frm_wd_in_mbs;
  810|  36.5k|    ps_dec->u2_frm_ht_in_mbs = ps_seq->u2_frm_ht_in_mbs;
  811|       |
  812|  36.5k|    ps_dec->u2_crop_offset_y = ps_subset_seq->u2_crop_offset_y;
  813|  36.5k|    ps_dec->u2_crop_offset_uv = ps_subset_seq->u2_crop_offset_uv;
  814|       |
  815|       |    /* Get the frame num */
  816|  36.5k|    u2_frame_num = ih264d_get_bits_h264(ps_bitstrm, ps_seq->u1_bits_in_frm_num);
  817|       |
  818|  36.5k|    COPYTHECONTEXT("Slice Header SVC ext: frame_num", u2_frame_num);
  819|  36.5k|    if(!ps_dec->u1_first_slice_in_stream && ps_dec->u4_first_slice_in_pic)
  ------------------
  |  Branch (819:8): [True: 22.6k, False: 13.8k]
  |  Branch (819:45): [True: 21.9k, False: 708]
  ------------------
  820|  21.9k|    {
  821|  21.9k|        pocstruct_t *ps_prev_poc = &ps_dec->s_prev_pic_poc;
  822|  21.9k|        pocstruct_t *ps_cur_poc = &ps_dec->s_cur_pic_poc;
  823|       |
  824|  21.9k|        ps_dec->u2_mbx = 0xffff;
  825|  21.9k|        ps_dec->u2_mby = 0;
  826|       |
  827|  21.9k|        if((0 == u1_is_idr_slice) && ps_cur_slice->u1_nal_ref_idc)
  ------------------
  |  Branch (827:12): [True: 1.46k, False: 20.4k]
  |  Branch (827:38): [True: 1.34k, False: 125]
  ------------------
  828|  1.34k|            ps_dec->u2_prev_ref_frame_num = ps_cur_slice->u2_frame_num;
  829|       |
  830|  21.9k|        if(u1_is_idr_slice || ps_cur_slice->u1_mmco_equalto5) ps_dec->u2_prev_ref_frame_num = 0;
  ------------------
  |  Branch (830:12): [True: 20.4k, False: 1.46k]
  |  Branch (830:31): [True: 511, False: 956]
  ------------------
  831|       |
  832|  21.9k|        if(ps_dec->ps_cur_sps->u1_gaps_in_frame_num_value_allowed_flag)
  ------------------
  |  Branch (832:12): [True: 0, False: 21.9k]
  ------------------
  833|      0|        {
  834|      0|            isvcd_decode_gaps_in_frame_num(ps_dec, u2_frame_num);
  835|      0|        }
  836|       |
  837|  21.9k|        ps_prev_poc->i4_prev_frame_num_ofst = ps_cur_poc->i4_prev_frame_num_ofst;
  838|  21.9k|        ps_prev_poc->u2_frame_num = ps_cur_poc->u2_frame_num;
  839|  21.9k|        ps_prev_poc->u1_mmco_equalto5 = ps_cur_slice->u1_mmco_equalto5;
  840|  21.9k|        if(ps_cur_slice->u1_nal_ref_idc)
  ------------------
  |  Branch (840:12): [True: 18.4k, False: 3.48k]
  ------------------
  841|  18.4k|        {
  842|  18.4k|            ps_prev_poc->i4_pic_order_cnt_lsb = ps_cur_poc->i4_pic_order_cnt_lsb;
  843|  18.4k|            ps_prev_poc->i4_pic_order_cnt_msb = ps_cur_poc->i4_pic_order_cnt_msb;
  844|  18.4k|            ps_prev_poc->i4_delta_pic_order_cnt_bottom = ps_cur_poc->i4_delta_pic_order_cnt_bottom;
  845|  18.4k|            ps_prev_poc->i4_delta_pic_order_cnt[0] = ps_cur_poc->i4_delta_pic_order_cnt[0];
  846|  18.4k|            ps_prev_poc->i4_delta_pic_order_cnt[1] = ps_cur_poc->i4_delta_pic_order_cnt[1];
  847|  18.4k|            ps_prev_poc->u1_bot_field = ps_cur_poc->u1_bot_field;
  848|  18.4k|        }
  849|       |
  850|  21.9k|        ps_dec->u4_total_mbs_coded = 0;
  851|  21.9k|    }
  852|       |    /* Get the field related flags  */
  853|  36.5k|    if(!ps_seq->u1_frame_mbs_only_flag)
  ------------------
  |  Branch (853:8): [True: 0, False: 36.5k]
  ------------------
  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|  36.5k|    else
  871|  36.5k|    {
  872|  36.5k|        u1_field_pic_flag = 0;
  873|  36.5k|        u1_bottom_field_flag = 0;
  874|  36.5k|        ps_dec->pu1_inv_scan = (UWORD8 *) gau1_ih264d_inv_scan;
  875|  36.5k|    }
  876|       |
  877|  36.5k|    u1_nal_unit_type = SLICE_NAL;
  ------------------
  |  |  324|  36.5k|#define SLICE_NAL                       1
  ------------------
  878|  36.5k|    if(u1_is_idr_slice)
  ------------------
  |  Branch (878:8): [True: 32.9k, False: 3.50k]
  ------------------
  879|  32.9k|    {
  880|  32.9k|        u1_nal_unit_type = IDR_SLICE_NAL;
  ------------------
  |  |  328|  32.9k|#define IDR_SLICE_NAL                   5
  ------------------
  881|  32.9k|        u4_idr_pic_id = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  882|  32.9k|        if(u4_idr_pic_id > 65535) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (882:12): [True: 354, False: 32.6k]
  ------------------
  883|  32.6k|        COPYTHECONTEXT("Slice Header SVC ext:  ", u4_idr_pic_id);
  884|  32.6k|    }
  885|       |
  886|       |    /* read delta pic order count information*/
  887|  36.1k|    i_delta_poc[0] = i_delta_poc[1] = 0;
  888|  36.1k|    s_tmp_poc.i4_pic_order_cnt_lsb = 0;
  889|  36.1k|    s_tmp_poc.i4_delta_pic_order_cnt_bottom = 0;
  890|  36.1k|    u1_pic_order_cnt_type = ps_seq->u1_pic_order_cnt_type;
  891|  36.1k|    if(u1_pic_order_cnt_type == 0)
  ------------------
  |  Branch (891:8): [True: 34.8k, False: 1.29k]
  ------------------
  892|  34.8k|    {
  893|  34.8k|        i_temp = ih264d_get_bits_h264(ps_bitstrm, ps_seq->u1_log2_max_pic_order_cnt_lsb_minus);
  894|  34.8k|        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: 34.8k]
  |  Branch (894:26): [True: 0, False: 34.8k]
  ------------------
  895|  34.8k|        s_tmp_poc.i4_pic_order_cnt_lsb = i_temp;
  896|  34.8k|        COPYTHECONTEXT("Slice Header SVC ext: pic_order_cnt_lsb", s_tmp_poc.i4_pic_order_cnt_lsb);
  897|       |
  898|  34.8k|        if((ps_pps->u1_pic_order_present_flag == 1) && (!u1_field_pic_flag))
  ------------------
  |  Branch (898:12): [True: 4.00k, False: 30.8k]
  |  Branch (898:56): [True: 4.00k, False: 0]
  ------------------
  899|  4.00k|        {
  900|  4.00k|            s_tmp_poc.i4_delta_pic_order_cnt_bottom = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  901|  4.00k|            COPYTHECONTEXT("Slice Header SVC ext: delta_pic_order_cnt_bottom",
  902|  4.00k|                           s_tmp_poc.i4_delta_pic_order_cnt_bottom);
  903|  4.00k|        }
  904|  34.8k|    }
  905|       |
  906|  36.1k|    s_tmp_poc.i4_delta_pic_order_cnt[0] = 0;
  907|  36.1k|    s_tmp_poc.i4_delta_pic_order_cnt[1] = 0;
  908|  36.1k|    if(u1_pic_order_cnt_type == 1 && (!ps_seq->u1_delta_pic_order_always_zero_flag))
  ------------------
  |  Branch (908:8): [True: 1.06k, False: 35.0k]
  |  Branch (908:38): [True: 556, False: 508]
  ------------------
  909|    556|    {
  910|    556|        s_tmp_poc.i4_delta_pic_order_cnt[0] = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  911|    556|        COPYTHECONTEXT("Slice Header SVC ext: delta_pic_order_cnt[0]",
  912|    556|                       s_tmp_poc.i4_delta_pic_order_cnt[0]);
  913|       |
  914|    556|        if(ps_pps->u1_pic_order_present_flag && !u1_field_pic_flag)
  ------------------
  |  Branch (914:12): [True: 375, False: 181]
  |  Branch (914:49): [True: 375, False: 0]
  ------------------
  915|    375|        {
  916|    375|            s_tmp_poc.i4_delta_pic_order_cnt[1] = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  917|    375|            COPYTHECONTEXT("Slice Header SVC ext: delta_pic_order_cnt[1]",
  918|    375|                           s_tmp_poc.i4_delta_pic_order_cnt[1]);
  919|    375|        }
  920|    556|    }
  921|       |
  922|  36.1k|    if(ps_pps->u1_redundant_pic_cnt_present_flag)
  ------------------
  |  Branch (922:8): [True: 13.3k, False: 22.8k]
  ------------------
  923|  13.3k|    {
  924|  13.3k|        u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  925|  13.3k|        if(u4_temp > MAX_REDUNDANT_PIC_CNT) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  |  611|  13.3k|#define MAX_REDUNDANT_PIC_CNT       127
  ------------------
  |  Branch (925:12): [True: 188, False: 13.1k]
  ------------------
  926|  13.1k|        u1_redundant_pic_cnt = u4_temp;
  927|  13.1k|        COPYTHECONTEXT("Slice Header SVC ext: redundant_pic_cnt", u1_redundant_pic_cnt);
  928|  13.1k|    }
  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|  35.9k|    i1_is_end_of_poc = 1;
  935|  35.9k|    ps_dec->ps_dec_err_status->u1_err_flag &= MASK_REJECT_CUR_PIC;
  ------------------
  |  |  605|  35.9k|#define MASK_REJECT_CUR_PIC (0xFE)
  ------------------
  936|       |
  937|  35.9k|    if(ps_dec->u4_first_slice_in_pic == 0)
  ------------------
  |  Branch (937:8): [True: 707, False: 35.2k]
  ------------------
  938|    707|    {
  939|    707|        i1_is_end_of_poc =
  940|    707|            ih264d_is_end_of_pic(u2_frame_num, u1_nal_ref_idc, &s_tmp_poc, &ps_dec->s_cur_pic_poc,
  941|    707|                                 ps_cur_slice, u1_pic_order_cnt_type, u1_nal_unit_type,
  942|    707|                                 u4_idr_pic_id, u1_field_pic_flag, u1_bottom_field_flag);
  943|    707|        if(i1_is_end_of_poc)
  ------------------
  |  Branch (943:12): [True: 70, False: 637]
  ------------------
  944|     70|        {
  945|     70|            ps_dec->u1_first_slice_in_stream = 0;
  946|     70|            return ERROR_INCOMPLETE_FRAME;
  947|     70|        }
  948|    707|    }
  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|  35.8k|    u1_mbaff = ps_seq->u1_mb_aff_flag && (!u1_field_pic_flag);
  ------------------
  |  Branch (954:16): [True: 0, False: 35.8k]
  |  Branch (954:42): [True: 0, False: 0]
  ------------------
  955|  35.8k|    prev_slice_err = 0;
  956|       |
  957|  35.8k|    if(i1_is_end_of_poc || ps_dec->u1_first_slice_in_stream)
  ------------------
  |  Branch (957:8): [True: 35.2k, False: 637]
  |  Branch (957:28): [True: 0, False: 637]
  ------------------
  958|  35.2k|    {
  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|  35.2k|        if((u1_field_pic_flag == 0 || u2_frame_num != ps_dec->u2_prv_frame_num) &&
  ------------------
  |  Branch (964:13): [True: 35.2k, False: 0]
  |  Branch (964:39): [True: 0, False: 0]
  ------------------
  965|  35.2k|           ps_dec->u1_top_bottom_decoded != 0 &&
  ------------------
  |  Branch (965:12): [True: 0, False: 35.2k]
  ------------------
  966|      0|           ps_dec->u1_top_bottom_decoded != (TOP_FIELD_ONLY | BOT_FIELD_ONLY))
  ------------------
  |  |   65|      0|#define TOP_FIELD_ONLY      0x02
  ------------------
                         ps_dec->u1_top_bottom_decoded != (TOP_FIELD_ONLY | BOT_FIELD_ONLY))
  ------------------
  |  |   66|      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)
  ------------------
  |  |   65|      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|  35.2k|        else if(ps_dec->u4_first_slice_in_pic)
  ------------------
  |  Branch (991:17): [True: 35.2k, False: 0]
  ------------------
  992|  35.2k|        {
  993|  35.2k|            if(u2_first_mb_in_slice > 0)
  ------------------
  |  Branch (993:16): [True: 0, False: 35.2k]
  ------------------
  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|  35.2k|        }
 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|  35.2k|    }
 1022|    637|    else
 1023|    637|    {
 1024|    637|        if((u2_first_mb_in_slice << u1_mbaff) > ps_dec->u4_total_mbs_coded)
  ------------------
  |  Branch (1024:12): [True: 69, False: 568]
  ------------------
 1025|     69|        {
 1026|       |            // previous slice - missing/corruption
 1027|     69|            prev_slice_err = 2;
 1028|     69|            num_mb_skipped = (u2_first_mb_in_slice << u1_mbaff) - ps_dec->u4_total_mbs_coded;
 1029|     69|            ps_cur_poc = &s_tmp_poc;
 1030|     69|        }
 1031|    568|        else if((u2_first_mb_in_slice << u1_mbaff) < ps_dec->u4_total_mbs_coded)
  ------------------
  |  Branch (1031:17): [True: 0, False: 568]
  ------------------
 1032|      0|        {
 1033|      0|            return ERROR_CORRUPTED_SLICE;
 1034|      0|        }
 1035|    637|    }
 1036|  35.8k|    if(prev_slice_err)
  ------------------
  |  Branch (1036:8): [True: 69, False: 35.8k]
  ------------------
 1037|     69|    {
 1038|     69|        ret = isvcd_mark_err_slice_skip((svc_dec_lyr_struct_t *) ps_dec, num_mb_skipped,
 1039|     69|                                        u1_is_idr_slice, u2_frame_num, ps_cur_poc, prev_slice_err);
 1040|       |
 1041|     69|        if(ps_dec->u1_dangling_field == 1)
  ------------------
  |  Branch (1041:12): [True: 0, False: 69]
  ------------------
 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;
  ------------------
  |  |   65|      0|#define TOP_FIELD_ONLY      0x02
  ------------------
                          ps_dec->u1_top_bottom_decoded = TOP_FIELD_ONLY | BOT_FIELD_ONLY;
  ------------------
  |  |   66|      0|#define BOT_FIELD_ONLY      0x01
  ------------------
 1046|      0|            return ERROR_DANGLING_FIELD_IN_PIC;
 1047|      0|        }
 1048|       |
 1049|     69|        if(prev_slice_err == 2)
  ------------------
  |  Branch (1049:12): [True: 69, False: 0]
  ------------------
 1050|     69|        {
 1051|     69|            ps_dec->u1_first_slice_in_stream = 0;
 1052|     69|            return ERROR_INCOMPLETE_FRAME;
 1053|     69|        }
 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)
  ------------------
  |  |  602|      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|  35.8k|    if(u1_field_pic_flag)
  ------------------
  |  Branch (1073:8): [True: 0, False: 35.8k]
  ------------------
 1074|      0|    {
 1075|      0|        ps_dec->u2_prv_frame_num = u2_frame_num;
 1076|      0|    }
 1077|       |
 1078|  35.8k|    if(ps_cur_slice->u1_mmco_equalto5)
  ------------------
  |  Branch (1078:8): [True: 960, False: 34.8k]
  ------------------
 1079|    960|    {
 1080|    960|        WORD32 i4_temp_poc;
 1081|    960|        WORD32 i4_top_field_order_poc, i4_bot_field_order_poc;
 1082|    960|        WORD64 i8_result;
 1083|    960|        if(!ps_cur_slice->u1_field_pic_flag)  // or a complementary field pair
  ------------------
  |  Branch (1083:12): [True: 960, False: 0]
  ------------------
 1084|    960|        {
 1085|    960|            i4_top_field_order_poc = ps_dec->ps_cur_pic->i4_top_field_order_cnt;
 1086|    960|            i4_bot_field_order_poc = ps_dec->ps_cur_pic->i4_bottom_field_order_cnt;
 1087|    960|            i4_temp_poc = MIN(i4_top_field_order_poc, i4_bot_field_order_poc);
  ------------------
  |  |   61|    960|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 190, False: 770]
  |  |  ------------------
  ------------------
 1088|    960|        }
 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|    960|        i8_result = (WORD64) i4_temp_poc - ps_dec->ps_cur_pic->i4_top_field_order_cnt;
 1095|    960|        if(IS_OUT_OF_RANGE_S32(i8_result))
  ------------------
  |  |   58|    960|#define IS_OUT_OF_RANGE_S32(a) (((a) < INT32_MIN) || ((a) > INT32_MAX))
  |  |  ------------------
  |  |  |  Branch (58:33): [True: 0, False: 960]
  |  |  |  Branch (58:54): [True: 0, False: 960]
  |  |  ------------------
  ------------------
 1096|      0|        {
 1097|      0|            return ERROR_INV_POC;
 1098|      0|        }
 1099|    960|        ps_dec->ps_cur_pic->i4_top_field_order_cnt = (WORD32) i8_result;
 1100|    960|        i8_result = (WORD64) i4_temp_poc - ps_dec->ps_cur_pic->i4_bottom_field_order_cnt;
 1101|    960|        if(IS_OUT_OF_RANGE_S32(i8_result))
  ------------------
  |  |   58|    960|#define IS_OUT_OF_RANGE_S32(a) (((a) < INT32_MIN) || ((a) > INT32_MAX))
  |  |  ------------------
  |  |  |  Branch (58:33): [True: 0, False: 960]
  |  |  |  Branch (58:54): [True: 0, False: 960]
  |  |  ------------------
  ------------------
 1102|      0|        {
 1103|      0|            return ERROR_INV_POC;
 1104|      0|        }
 1105|    960|        ps_dec->ps_cur_pic->i4_bottom_field_order_cnt = (WORD32) i8_result;
 1106|    960|        ps_dec->ps_cur_pic->i4_poc = i4_temp_poc;
 1107|    960|        ps_dec->ps_cur_pic->i4_avg_poc = i4_temp_poc;
 1108|    960|    }
 1109|  35.8k|    if(ps_dec->u4_first_slice_in_pic)
  ------------------
  |  Branch (1109:8): [True: 35.2k, False: 568]
  ------------------
 1110|  35.2k|    {
 1111|  35.2k|        ret = isvcd_decode_pic_order_cnt(u1_is_idr_slice, u2_frame_num, &ps_dec->s_prev_pic_poc,
 1112|  35.2k|                                         &s_tmp_poc, ps_cur_slice, ps_pps, u1_nal_ref_idc,
 1113|  35.2k|                                         u1_bottom_field_flag, u1_field_pic_flag, &i4_poc, ps_dec);
 1114|  35.2k|        if(ret != OK) return ret;
  ------------------
  |  |  114|  35.2k|#define OK        0
  ------------------
  |  Branch (1114:12): [True: 80, False: 35.1k]
  ------------------
 1115|       |        /* Display seq no calculations */
 1116|  35.1k|        if(i4_poc >= ps_dec->i4_max_poc) ps_dec->i4_max_poc = i4_poc;
  ------------------
  |  Branch (1116:12): [True: 14.4k, False: 20.7k]
  ------------------
 1117|       |        /* IDR Picture or POC wrap around */
 1118|  35.1k|        if(i4_poc == 0)
  ------------------
  |  Branch (1118:12): [True: 4.27k, False: 30.8k]
  ------------------
 1119|  4.27k|        {
 1120|  4.27k|            WORD64 i8_temp;
 1121|  4.27k|            i8_temp = (WORD64) ps_dec->i4_prev_max_display_seq + ps_dec->i4_max_poc +
 1122|  4.27k|                      ps_dec->u1_max_dec_frame_buffering + 1;
 1123|       |            /*If i4_prev_max_display_seq overflows integer range, reset it */
 1124|  4.27k|            ps_dec->i4_prev_max_display_seq = IS_OUT_OF_RANGE_S32(i8_temp) ? 0 : i8_temp;
  ------------------
  |  |   58|  4.27k|#define IS_OUT_OF_RANGE_S32(a) (((a) < INT32_MIN) || ((a) > INT32_MAX))
  |  |  ------------------
  |  |  |  Branch (58:33): [True: 0, False: 4.27k]
  |  |  |  Branch (58:54): [True: 49, False: 4.23k]
  |  |  ------------------
  ------------------
 1125|  4.27k|            ps_dec->i4_max_poc = 0;
 1126|  4.27k|        }
 1127|  35.1k|    }
 1128|       |
 1129|       |    /* Increment only if the current slice has atleast 1 more MB */
 1130|  35.7k|    if(ps_dec->u4_first_slice_in_pic == 0 &&
  ------------------
  |  Branch (1130:8): [True: 568, False: 35.1k]
  ------------------
 1131|    568|       (ps_dec->ps_parse_cur_slice->u4_first_mb_in_slice <
  ------------------
  |  Branch (1131:8): [True: 568, False: 0]
  ------------------
 1132|    568|        (UWORD32) (ps_dec->u4_total_mbs_coded >> ps_dec->ps_cur_slice->u1_mbaff_frame_flag)))
 1133|    568|    {
 1134|    568|        ps_dec->ps_parse_cur_slice++;
 1135|    568|        ps_dec->u2_cur_slice_num++;
 1136|       |        // in the case of single core increment ps_decode_cur_slice
 1137|    568|        if(ps_dec->u1_separate_parse == 0)
  ------------------
  |  Branch (1137:12): [True: 382, False: 186]
  ------------------
 1138|    382|        {
 1139|    382|            ps_dec->ps_decode_cur_slice++;
 1140|    382|        }
 1141|    568|    }
 1142|       |
 1143|  35.7k|    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|  35.7k|    ps_cur_slice->i4_delta_pic_order_cnt[0] = i_delta_poc[0];
 1151|  35.7k|    ps_cur_slice->i4_delta_pic_order_cnt[1] = i_delta_poc[1];
 1152|  35.7k|    ps_cur_slice->u4_idr_pic_id = u4_idr_pic_id;
 1153|  35.7k|    ps_cur_slice->u2_first_mb_in_slice = u2_first_mb_in_slice;
 1154|  35.7k|    ps_cur_slice->u1_field_pic_flag = u1_field_pic_flag;
 1155|  35.7k|    ps_cur_slice->u1_bottom_field_flag = u1_bottom_field_flag;
 1156|  35.7k|    ps_cur_slice->u1_slice_type = u1_slice_type;
 1157|  35.7k|    ps_cur_slice->i4_pic_order_cnt_lsb = s_tmp_poc.i4_pic_order_cnt_lsb;
 1158|       |
 1159|  35.7k|    ps_cur_slice->u1_nal_unit_type = u1_nal_unit_type;
 1160|  35.7k|    ps_cur_slice->u1_redundant_pic_cnt = u1_redundant_pic_cnt;
 1161|  35.7k|    ps_cur_slice->u1_nal_ref_idc = u1_nal_ref_idc;
 1162|  35.7k|    ps_cur_slice->u1_pic_order_cnt_type = u1_pic_order_cnt_type;
 1163|       |
 1164|  35.7k|    if(ps_seq->u1_frame_mbs_only_flag)
  ------------------
  |  Branch (1164:8): [True: 35.7k, False: 0]
  ------------------
 1165|  35.7k|        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|  35.7k|    if(0 == ps_svc_lyr_dec->ps_nal_svc_ext->u1_quality_id)
  ------------------
  |  Branch (1169:8): [True: 35.7k, False: 0]
  ------------------
 1170|  35.7k|    {
 1171|  35.7k|        if(B_SLICE == u1_slice_type)
  ------------------
  |  |  369|  35.7k|#define B_SLICE  1
  ------------------
  |  Branch (1171:12): [True: 13.8k, False: 21.8k]
  ------------------
 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.03k, False: 8.85k]
  ------------------
 1178|  5.03k|                ps_cur_slice->pf_decodeDirect = isvcd_decode_spatial_direct;
 1179|  8.85k|            else
 1180|  8.85k|                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|  21.8k|        else
 1185|  21.8k|        {
 1186|  21.8k|            if(!((ps_seq->u1_mb_aff_flag) && (!u1_field_pic_flag))) /*check if this is valid here */
  ------------------
  |  Branch (1186:18): [True: 0, False: 21.8k]
  |  Branch (1186:46): [True: 0, False: 0]
  ------------------
 1187|  21.8k|                ps_dec->pf_mvpred = ih264d_mvpred_nonmbaff;
 1188|  21.8k|        }
 1189|  35.7k|    }
 1190|       |
 1191|  35.7k|    if(ps_dec->u4_first_slice_in_pic)
  ------------------
  |  Branch (1191:8): [True: 35.1k, False: 568]
  ------------------
 1192|  35.1k|    {
 1193|  35.1k|        if(u2_first_mb_in_slice == 0)
  ------------------
  |  Branch (1193:12): [True: 35.1k, False: 0]
  ------------------
 1194|  35.1k|        {
 1195|  35.1k|            ret = isvcd_start_of_pic(ps_svc_lyr_dec, i4_poc, &s_tmp_poc, u2_frame_num, ps_pps);
 1196|  35.1k|            if(ret != OK) return ret;
  ------------------
  |  |  114|  35.1k|#define OK        0
  ------------------
  |  Branch (1196:16): [True: 1.29k, False: 33.8k]
  ------------------
 1197|       |            /*inter layer buffer intialization */
 1198|  33.8k|            ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb =
 1199|  33.8k|                ps_svc_lyr_dec->ps_inter_lyr_mb_prms_frm_start;
 1200|  33.8k|            ps_svc_lyr_dec->ps_il_pred_mv_bank_buf_cur_mb =
 1201|  33.8k|                ps_svc_lyr_dec->ps_il_pred_mv_bank_buf_base;
 1202|  33.8k|        }
 1203|       |
 1204|  33.8k|        ps_dec->u4_output_present = 0;
 1205|       |
 1206|  33.8k|        {
 1207|  33.8k|            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|  33.8k|            if(0 != ps_dec->s_disp_op.u4_error_code)
  ------------------
  |  Branch (1211:16): [True: 10.9k, False: 22.9k]
  ------------------
 1212|  10.9k|            {
 1213|  10.9k|                ps_dec->u4_output_present = 0;
 1214|  10.9k|                ps_dec->u4_fmt_conv_cur_row = ps_dec->s_disp_frame_info.u4_y_ht;
 1215|  10.9k|            }
 1216|  22.9k|            else
 1217|  22.9k|                ps_dec->u4_output_present = 1;
 1218|  33.8k|        }
 1219|  33.8k|        ret = isvcd_parse_interlayer_resamp_func_init(ps_svc_lyr_dec, u2_first_mb_in_slice);
 1220|  33.8k|        if(ret != OK)
  ------------------
  |  |  114|  33.8k|#define OK        0
  ------------------
  |  Branch (1220:12): [True: 501, False: 33.3k]
  ------------------
 1221|    501|        {
 1222|    501|            return ERROR_CORRUPTED_SLICE;
 1223|    501|        }
 1224|  33.3k|        if((ps_dec->u1_separate_parse == 1) &&
  ------------------
  |  Branch (1224:12): [True: 20.8k, False: 12.5k]
  ------------------
 1225|  20.8k|           (ps_svc_lyr_dec->u1_layer_identifier == TARGET_LAYER) && (ps_svc_lyr_dec->u1_res_init_done == 1))
  ------------------
  |  |  110|  20.8k|#define TARGET_LAYER 2
  ------------------
  |  Branch (1225:12): [True: 20.8k, False: 0]
  |  Branch (1225:69): [True: 20.8k, False: 0]
  ------------------
 1226|  20.8k|        {
 1227|  20.8k|            if(ps_dec->u4_dec_thread_created == 0)
  ------------------
  |  Branch (1227:16): [True: 20.8k, False: 0]
  ------------------
 1228|  20.8k|            {
 1229|  20.8k|                ithread_create(ps_dec->pv_dec_thread_handle, NULL,
 1230|  20.8k|                               (void *) isvcd_decode_picture_thread, (void *) ps_dec);
 1231|       |
 1232|  20.8k|                ps_dec->u4_dec_thread_created = 1;
 1233|  20.8k|            }
 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|  20.8k|        }
 1260|  33.3k|    }
 1261|       |
 1262|       |    /* INITIALIZATION of fn ptrs for MC and formMbPartInfo functions */
 1263|  33.9k|    {
 1264|  33.9k|        UWORD8 uc_nofield_nombaff;
 1265|       |
 1266|  33.9k|        uc_nofield_nombaff =
 1267|  33.9k|            ((ps_dec->ps_cur_slice->u1_field_pic_flag == 0) &&
  ------------------
  |  Branch (1267:14): [True: 33.9k, False: 0]
  ------------------
 1268|  33.9k|             (ps_dec->ps_cur_slice->u1_mbaff_frame_flag == 0) && (u1_slice_type != B_SLICE) &&
  ------------------
  |  |  369|  33.9k|#define B_SLICE  1
  ------------------
  |  Branch (1268:14): [True: 33.9k, False: 0]
  |  Branch (1268:66): [True: 20.6k, False: 13.3k]
  ------------------
 1269|  20.6k|             (ps_dec->ps_cur_pps->u1_wted_pred_flag == 0));
  ------------------
  |  Branch (1269:14): [True: 17.1k, False: 3.48k]
  ------------------
 1270|       |
 1271|       |        /* Initialise MC and formMbPartInfo fn ptrs one time based on profile_idc */
 1272|       |
 1273|  33.9k|        if(uc_nofield_nombaff)
  ------------------
  |  Branch (1273:12): [True: 17.1k, False: 16.7k]
  ------------------
 1274|  17.1k|        {
 1275|  17.1k|            ps_dec->p_form_mb_part_info = ih264d_form_mb_part_info_bp;
 1276|  17.1k|            ps_dec->p_motion_compensate = ih264d_motion_compensate_bp;
 1277|  17.1k|        }
 1278|  16.7k|        else
 1279|  16.7k|        {
 1280|  16.7k|            ps_dec->p_form_mb_part_info = ih264d_form_mb_part_info_mp;
 1281|  16.7k|            ps_dec->p_motion_compensate = ih264d_motion_compensate_mp;
 1282|  16.7k|        }
 1283|  33.9k|    }
 1284|       |
 1285|       |    /*
 1286|       |     * Decide whether to decode the current picture or not
 1287|       |     */
 1288|  33.9k|    {
 1289|  33.9k|        dec_err_status_t *ps_err = ps_dec->ps_dec_err_status;
 1290|  33.9k|        if(ps_err->u4_frm_sei_sync == u2_frame_num)
  ------------------
  |  Branch (1290:12): [True: 0, False: 33.9k]
  ------------------
 1291|      0|        {
 1292|      0|            ps_err->u1_err_flag = ACCEPT_ALL_PICS;
  ------------------
  |  |  601|      0|#define ACCEPT_ALL_PICS   (0x00)
  ------------------
 1293|      0|            ps_err->u4_frm_sei_sync = SYNC_FRM_DEFAULT;
  ------------------
  |  |  610|      0|#define SYNC_FRM_DEFAULT  (0xFFFFFFFF)
  ------------------
 1294|      0|        }
 1295|  33.9k|        ps_err->u4_cur_frm = u2_frame_num;
 1296|  33.9k|    }
 1297|       |
 1298|       |    /* Decision for decoding if the picture is to be skipped */
 1299|  33.9k|    {
 1300|  33.9k|        WORD32 i4_skip_b_pic, i4_skip_p_pic;
 1301|       |
 1302|  33.9k|        i4_skip_b_pic = (ps_dec->u4_skip_frm_mask & B_SLC_BIT) && (B_SLICE == u1_slice_type) &&
  ------------------
  |  |  378|  33.9k|#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: 33.9k]
  |  Branch (1302:67): [True: 0, False: 0]
  ------------------
 1303|      0|                        (0 == u1_nal_ref_idc);
  ------------------
  |  Branch (1303:25): [True: 0, False: 0]
  ------------------
 1304|       |
 1305|  33.9k|        i4_skip_p_pic = (ps_dec->u4_skip_frm_mask & P_SLC_BIT) && (P_SLICE == u1_slice_type) &&
  ------------------
  |  |  377|  33.9k|#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: 33.9k]
  |  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|  33.9k|        if(i4_skip_b_pic)
  ------------------
  |  Branch (1313:12): [True: 0, False: 33.9k]
  ------------------
 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|  33.9k|        if(i4_skip_p_pic)
  ------------------
  |  Branch (1327:12): [True: 0, False: 33.9k]
  ------------------
 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|  33.9k|    }
 1337|       |
 1338|  33.9k|    {
 1339|  33.9k|        UWORD16 u2_mb_x, u2_mb_y;
 1340|       |
 1341|  33.9k|        ps_dec->i4_submb_ofst =
 1342|  33.9k|            ((u2_first_mb_in_slice << ps_cur_slice->u1_mbaff_frame_flag) * SUB_BLK_SIZE) -
  ------------------
  |  |  562|  33.9k|#define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|  33.9k|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  |  |               #define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|  33.9k|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  ------------------
 1343|  33.9k|            SUB_BLK_SIZE;
  ------------------
  |  |  562|  33.9k|#define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|  33.9k|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  |  |               #define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|  33.9k|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  ------------------
 1344|  33.9k|        if(u2_first_mb_in_slice)
  ------------------
  |  Branch (1344:12): [True: 568, False: 33.3k]
  ------------------
 1345|    568|        {
 1346|    568|            UWORD8 u1_mb_aff;
 1347|    568|            UWORD8 u1_field_pic;
 1348|    568|            UWORD16 u2_frm_wd_in_mbs;
 1349|    568|            u2_frm_wd_in_mbs = ps_seq->u2_frm_wd_in_mbs;
 1350|    568|            u1_mb_aff = ps_cur_slice->u1_mbaff_frame_flag;
 1351|    568|            u1_field_pic = ps_cur_slice->u1_field_pic_flag;
 1352|       |
 1353|    568|            {
 1354|    568|                UWORD32 x_offset;
 1355|    568|                UWORD32 y_offset;
 1356|    568|                UWORD32 u4_frame_stride;
 1357|    568|                tfr_ctxt_t *ps_trns_addr;  // = &ps_dec->s_tran_addrecon_parse;
 1358|       |
 1359|    568|                if(ps_dec->u1_separate_parse)
  ------------------
  |  Branch (1359:20): [True: 186, False: 382]
  ------------------
 1360|    186|                {
 1361|    186|                    ps_trns_addr = &ps_dec->s_tran_addrecon_parse;
 1362|    186|                }
 1363|    382|                else
 1364|    382|                {
 1365|    382|                    ps_trns_addr = &ps_dec->s_tran_addrecon;
 1366|    382|                }
 1367|    568|                u2_mb_x = MOD(u2_first_mb_in_slice, u2_frm_wd_in_mbs);
  ------------------
  |  |   64|    568|#define MOD(x,y) ((x)%(y))
  ------------------
 1368|    568|                u2_mb_y = DIV(u2_first_mb_in_slice, u2_frm_wd_in_mbs);
  ------------------
  |  |   65|    568|#define DIV(x,y) ((x)/(y))
  ------------------
 1369|       |
 1370|    568|                u2_mb_y <<= u1_mb_aff;
 1371|       |
 1372|    568|                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: 568]
  |  Branch (1372:56): [True: 0, False: 568]
  ------------------
 1373|      0|                {
 1374|      0|                    return ERROR_CORRUPTED_SLICE;
 1375|      0|                }
 1376|       |
 1377|    568|                u4_frame_stride = ps_dec->u2_frm_wd_y << u1_field_pic;
 1378|    568|                x_offset = u2_mb_x << 4;
 1379|    568|                y_offset = (u2_mb_y * u4_frame_stride) << 4;
 1380|       |
 1381|    568|                ps_trns_addr->pu1_dest_y = ps_dec->s_cur_pic.pu1_buf1 + x_offset + y_offset;
 1382|       |
 1383|    568|                u4_frame_stride = ps_dec->u2_frm_wd_uv << u1_field_pic;
 1384|    568|                x_offset >>= 1;
 1385|    568|                y_offset = (u2_mb_y * u4_frame_stride) << 3;
 1386|       |
 1387|    568|                x_offset *= YUV420SP_FACTOR;
  ------------------
  |  |  119|    568|#define YUV420SP_FACTOR 2
  ------------------
 1388|       |
 1389|    568|                ps_trns_addr->pu1_dest_u = ps_dec->s_cur_pic.pu1_buf2 + x_offset + y_offset;
 1390|    568|                ps_trns_addr->pu1_dest_v = ps_dec->s_cur_pic.pu1_buf3 + x_offset + y_offset;
 1391|       |
 1392|    568|                ps_trns_addr->pu1_mb_y = ps_trns_addr->pu1_dest_y;
 1393|    568|                ps_trns_addr->pu1_mb_u = ps_trns_addr->pu1_dest_u;
 1394|    568|                ps_trns_addr->pu1_mb_v = ps_trns_addr->pu1_dest_v;
 1395|       |
 1396|       |                // assign the deblock structure pointers to start of slice
 1397|    568|                if(ps_dec->u1_separate_parse == 1)
  ------------------
  |  Branch (1397:20): [True: 186, False: 382]
  ------------------
 1398|    186|                {
 1399|    186|                    ps_dec->ps_deblk_mbn =
 1400|    186|                        ps_dec->ps_deblk_pic + (u2_first_mb_in_slice << u1_mb_aff);
 1401|    186|                }
 1402|    382|                else
 1403|    382|                {
 1404|    382|                    ps_dec->ps_deblk_mbn =
 1405|    382|                        ps_dec->ps_deblk_pic + (u2_first_mb_in_slice << u1_mb_aff);
 1406|    382|                }
 1407|       |
 1408|    568|                ps_dec->u4_cur_mb_addr = (u2_first_mb_in_slice << u1_mb_aff);
 1409|       |
 1410|    568|                ps_dec->ps_mv_cur =
 1411|    568|                    ps_dec->s_cur_pic.ps_mv + ((u2_first_mb_in_slice << u1_mb_aff) << 4);
 1412|    568|            }
 1413|    568|        }
 1414|  33.3k|        else
 1415|  33.3k|        {
 1416|  33.3k|            tfr_ctxt_t *ps_trns_addr;
 1417|       |
 1418|  33.3k|            if(ps_dec->u1_separate_parse)
  ------------------
  |  Branch (1418:16): [True: 20.8k, False: 12.5k]
  ------------------
 1419|  20.8k|            {
 1420|  20.8k|                ps_trns_addr = &ps_dec->s_tran_addrecon_parse;
 1421|  20.8k|            }
 1422|  12.5k|            else
 1423|  12.5k|            {
 1424|  12.5k|                ps_trns_addr = &ps_dec->s_tran_addrecon;
 1425|  12.5k|            }
 1426|       |
 1427|  33.3k|            u2_mb_x = 0xffff;
 1428|  33.3k|            u2_mb_y = 0;
 1429|       |            // assign the deblock structure pointers to start of slice
 1430|  33.3k|            ps_dec->u4_cur_mb_addr = 0;
 1431|  33.3k|            ps_dec->ps_deblk_mbn = ps_dec->ps_deblk_pic;
 1432|  33.3k|            ps_dec->ps_mv_cur = ps_dec->s_cur_pic.ps_mv;
 1433|  33.3k|            ps_trns_addr->pu1_dest_y = ps_dec->s_cur_pic.pu1_buf1;
 1434|  33.3k|            ps_trns_addr->pu1_dest_u = ps_dec->s_cur_pic.pu1_buf2;
 1435|  33.3k|            ps_trns_addr->pu1_dest_v = ps_dec->s_cur_pic.pu1_buf3;
 1436|       |
 1437|  33.3k|            ps_trns_addr->pu1_mb_y = ps_trns_addr->pu1_dest_y;
 1438|  33.3k|            ps_trns_addr->pu1_mb_u = ps_trns_addr->pu1_dest_u;
 1439|  33.3k|            ps_trns_addr->pu1_mb_v = ps_trns_addr->pu1_dest_v;
 1440|  33.3k|        }
 1441|       |
 1442|  33.9k|        ps_dec->ps_part = ps_dec->ps_parse_part_params;
 1443|       |
 1444|  33.9k|        ps_dec->u2_mbx = (MOD(u2_first_mb_in_slice - 1, ps_seq->u2_frm_wd_in_mbs));
  ------------------
  |  |   64|  33.9k|#define MOD(x,y) ((x)%(y))
  ------------------
 1445|  33.9k|        ps_dec->u2_mby = (DIV(u2_first_mb_in_slice - 1, ps_seq->u2_frm_wd_in_mbs));
  ------------------
  |  |   65|  33.9k|#define DIV(x,y) ((x)/(y))
  ------------------
 1446|  33.9k|        ps_dec->u2_mby <<= ps_cur_slice->u1_mbaff_frame_flag;
 1447|  33.9k|        ps_dec->i2_prev_slice_mbx = ps_dec->u2_mbx;
 1448|  33.9k|        ps_dec->i2_prev_slice_mby = ps_dec->u2_mby;
 1449|  33.9k|    }
 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|  33.9k|    ps_dec->u1_B = (u1_slice_type == B_SLICE);
  ------------------
  |  |  369|  33.9k|#define B_SLICE  1
  ------------------
 1455|  33.9k|    ps_dec->u4_next_mb_skip = 0;
 1456|       |
 1457|  33.9k|    ps_dec->ps_parse_cur_slice->u4_first_mb_in_slice = ps_dec->ps_cur_slice->u2_first_mb_in_slice;
 1458|  33.9k|    ps_dec->ps_parse_cur_slice->slice_type = ps_dec->ps_cur_slice->u1_slice_type;
 1459|       |
 1460|  33.9k|    ps_dec->u4_start_recon_deblk = 1;
 1461|  33.9k|    {
 1462|  33.9k|        WORD32 num_entries;
 1463|  33.9k|        WORD32 size;
 1464|  33.9k|        UWORD8 *pu1_buf;
 1465|       |
 1466|  33.9k|        num_entries = MAX_FRAMES;
  ------------------
  |  |  600|  33.9k|#define MAX_FRAMES              16
  ------------------
 1467|  33.9k|        if((1 >= ps_dec->ps_cur_sps->u1_num_ref_frames) && (0 == ps_dec->i4_display_delay))
  ------------------
  |  Branch (1467:12): [True: 23.8k, False: 10.1k]
  |  Branch (1467:60): [True: 0, False: 23.8k]
  ------------------
 1468|      0|        {
 1469|      0|            num_entries = 1;
 1470|      0|        }
 1471|  33.9k|        num_entries = ((2 * num_entries) + 1);
 1472|  33.9k|        num_entries *= 2;
 1473|       |
 1474|  33.9k|        size = num_entries * sizeof(void *);
 1475|  33.9k|        size += PAD_MAP_IDX_POC * sizeof(void *);
  ------------------
  |  |  100|  33.9k|#define PAD_MAP_IDX_POC             (1)
  ------------------
 1476|       |
 1477|  33.9k|        pu1_buf = (UWORD8 *) ps_dec->pv_map_ref_idx_to_poc_buf;
 1478|  33.9k|        pu1_buf += size * ps_dec->u2_cur_slice_num;
 1479|  33.9k|        ps_dec->ps_parse_cur_slice->ppv_map_ref_idx_to_poc = (void *) pu1_buf;
 1480|  33.9k|    }
 1481|       |
 1482|  33.9k|    if(ps_dec->u1_separate_parse)
  ------------------
  |  Branch (1482:8): [True: 20.9k, False: 12.9k]
  ------------------
 1483|  20.9k|    {
 1484|  20.9k|        ps_dec->ps_parse_cur_slice->pv_tu_coeff_data_start = ps_dec->pv_parse_tu_coeff_data;
 1485|  20.9k|    }
 1486|  12.9k|    else
 1487|  12.9k|    {
 1488|  12.9k|        ps_dec->pv_proc_tu_coeff_data = ps_dec->pv_parse_tu_coeff_data;
 1489|  12.9k|    }
 1490|       |
 1491|  33.9k|    ret = ih264d_fix_error_in_dpb(ps_dec);
 1492|  33.9k|    if(ret < 0) return ERROR_DBP_MANAGER_T;
  ------------------
  |  Branch (1492:8): [True: 0, False: 33.9k]
  ------------------
 1493|       |
 1494|       |    /*Default initializing default values for some parameters*/
 1495|  33.9k|    ps_svc_slice_params->u1_slice_skip_flag = 0;
 1496|  33.9k|    ps_svc_slice_params->u1_adaptive_base_mode_flag = 0;
 1497|  33.9k|    ps_svc_slice_params->u1_default_base_mode_flag = 0;
 1498|  33.9k|    ps_svc_slice_params->u1_adaptive_motion_prediction_flag = 0;
 1499|  33.9k|    ps_svc_slice_params->u1_default_motion_prediction_flag = 0;
 1500|  33.9k|    ps_svc_slice_params->u1_adaptive_residual_prediction_flag = 0;
 1501|  33.9k|    ps_svc_slice_params->u1_default_residual_prediction_flag = 0;
 1502|       |
 1503|  33.9k|    if(u1_slice_type == I_SLICE)
  ------------------
  |  |  370|  33.9k|#define I_SLICE  2
  ------------------
  |  Branch (1503:8): [True: 5.68k, False: 28.2k]
  ------------------
 1504|  5.68k|    {
 1505|  5.68k|        ps_dec->ps_cur_pic->u4_pack_slc_typ |= I_SLC_BIT;
  ------------------
  |  |  376|  5.68k|#define I_SLC_BIT  (0x1)
  ------------------
 1506|       |
 1507|  5.68k|        ret = isvcd_parse_eislice(ps_svc_lyr_dec, u2_first_mb_in_slice);
 1508|  5.68k|        ps_dec->u1_pr_sl_type = u1_slice_type;
 1509|  5.68k|        if(ps_dec->i4_pic_type != B_SLICE && ps_dec->i4_pic_type != P_SLICE)
  ------------------
  |  |  369|  11.3k|#define B_SLICE  1
  ------------------
                      if(ps_dec->i4_pic_type != B_SLICE && ps_dec->i4_pic_type != P_SLICE)
  ------------------
  |  |  368|  5.52k|#define P_SLICE  0
  ------------------
  |  Branch (1509:12): [True: 5.52k, False: 162]
  |  Branch (1509:46): [True: 5.52k, False: 0]
  ------------------
 1510|  5.52k|            ps_dec->i4_pic_type = I_SLICE;
  ------------------
  |  |  370|  5.52k|#define I_SLICE  2
  ------------------
 1511|  5.68k|    }
 1512|  28.2k|    else if(u1_slice_type == P_SLICE)
  ------------------
  |  |  368|  28.2k|#define P_SLICE  0
  ------------------
  |  Branch (1512:13): [True: 14.8k, False: 13.3k]
  ------------------
 1513|  14.8k|    {
 1514|  14.8k|        ps_dec->ps_cur_pic->u4_pack_slc_typ |= P_SLC_BIT;
  ------------------
  |  |  377|  14.8k|#define P_SLC_BIT  (0x2)
  ------------------
 1515|  14.8k|        ret = isvcd_parse_epslice(ps_svc_lyr_dec, u2_first_mb_in_slice);
 1516|  14.8k|        ps_dec->u1_pr_sl_type = u1_slice_type;
 1517|  14.8k|        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|  14.8k|#define P_SLICE  0
  ------------------
  |  Branch (1517:12): [True: 14.8k, False: 70]
  ------------------
 1518|  14.8k|    }
 1519|  13.3k|    else if(u1_slice_type == B_SLICE)
  ------------------
  |  |  369|  13.3k|#define B_SLICE  1
  ------------------
  |  Branch (1519:13): [True: 13.3k, False: 68]
  ------------------
 1520|  13.3k|    {
 1521|  13.3k|        ps_dec->ps_cur_pic->u4_pack_slc_typ |= B_SLC_BIT;
  ------------------
  |  |  378|  13.3k|#define B_SLC_BIT  (0x4)
  ------------------
 1522|  13.3k|        ret = isvcd_parse_ebslice(ps_svc_lyr_dec, u2_first_mb_in_slice);
 1523|  13.3k|        ps_dec->u1_pr_sl_type = u1_slice_type;
 1524|  13.3k|        ps_dec->i4_pic_type = B_SLICE;
  ------------------
  |  |  369|  13.3k|#define B_SLICE  1
  ------------------
 1525|  13.3k|    }
 1526|     68|    else
 1527|     68|        return ERROR_INV_SLC_TYPE_T;
 1528|       |
 1529|  33.8k|    if(ps_dec->u1_slice_header_done)
  ------------------
  |  Branch (1529:8): [True: 24.6k, False: 9.21k]
  ------------------
 1530|  24.6k|    {
 1531|       |        /* set to zero to indicate a valid slice has been decoded */
 1532|  24.6k|        ps_dec->u1_first_slice_in_stream = 0;
 1533|  24.6k|    }
 1534|       |
 1535|  33.8k|    if(ret != OK) return ret;
  ------------------
  |  |  114|  33.8k|#define OK        0
  ------------------
  |  Branch (1535:8): [True: 22.4k, False: 11.4k]
  ------------------
 1536|       |
 1537|  11.4k|    if(u1_nal_ref_idc != 0)
  ------------------
  |  Branch (1537:8): [True: 10.2k, False: 1.15k]
  ------------------
 1538|  10.2k|    {
 1539|  10.2k|        if(!ps_dec->ps_dpb_cmds->u1_dpb_commands_read)
  ------------------
  |  Branch (1539:12): [True: 10.0k, False: 221]
  ------------------
 1540|  10.0k|        {
 1541|  10.0k|            memcpy((void *) ps_dec->ps_dpb_cmds, (void *) (&(ps_dec->s_dpb_cmds_scratch)),
 1542|  10.0k|                   sizeof(dpb_commands_t));
 1543|  10.0k|        }
 1544|  10.2k|    }
 1545|       |
 1546|       |    /* storing last Mb X and MbY of the slice */
 1547|  11.4k|    ps_dec->i2_prev_slice_mbx = ps_dec->u2_mbx;
 1548|  11.4k|    ps_dec->i2_prev_slice_mby = ps_dec->u2_mby;
 1549|       |
 1550|       |    /* End of Picture detection */
 1551|  11.4k|    if(ps_dec->u4_total_mbs_coded >= (ps_seq->u4_max_mb_addr + 1))
  ------------------
  |  Branch (1551:8): [True: 7.26k, False: 4.16k]
  ------------------
 1552|  7.26k|    {
 1553|  7.26k|        ps_dec->u1_pic_decode_done = 1;
 1554|  7.26k|    }
 1555|       |
 1556|  11.4k|    {
 1557|  11.4k|        dec_err_status_t *ps_err = ps_dec->ps_dec_err_status;
 1558|  11.4k|        if((ps_err->u1_err_flag & REJECT_PB_PICS) && (ps_err->u1_cur_pic_type == PIC_TYPE_I))
  ------------------
  |  |  603|  11.4k|#define REJECT_PB_PICS    (0x02)
  ------------------
                      if((ps_err->u1_err_flag & REJECT_PB_PICS) && (ps_err->u1_cur_pic_type == PIC_TYPE_I))
  ------------------
  |  |  609|      0|#define PIC_TYPE_I        (0x00)
  ------------------
  |  Branch (1558:12): [True: 0, False: 11.4k]
  |  Branch (1558:54): [True: 0, False: 0]
  ------------------
 1559|      0|        {
 1560|      0|            ps_err->u1_err_flag = ACCEPT_ALL_PICS;
  ------------------
  |  |  601|      0|#define ACCEPT_ALL_PICS   (0x00)
  ------------------
 1561|      0|        }
 1562|  11.4k|    }
 1563|       |
 1564|  11.4k|    PRINT_BIN_BIT_RATIO(ps_dec)
 1565|       |
 1566|  11.4k|    return ret;
 1567|  33.8k|}
isvcd_set_default_slice_header_ext:
 1581|  26.5k|{
 1582|  26.5k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
 1583|  26.5k|    WORD32 i_status = OK;
  ------------------
  |  |  114|  26.5k|#define OK        0
  ------------------
 1584|  26.5k|    dec_pic_params_t *ps_pps = ps_dec->ps_cur_pps;
 1585|  26.5k|    dec_seq_params_t *ps_seq;
 1586|  26.5k|    dec_svc_seq_params_t *ps_subset_seq;
 1587|  26.5k|    dec_slice_svc_ext_params_t *ps_svc_slice_params = NULL;
 1588|  26.5k|    dec_subset_seq_params_t *ps_sps_svc_ext = NULL;
 1589|  26.5k|    ps_seq = ps_pps->ps_sps;
 1590|  26.5k|    ps_seq += MAX_NUM_SEQ_PARAMS;
  ------------------
  |  |  521|  26.5k|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
 1591|  26.5k|    ps_subset_seq =
 1592|  26.5k|        &ps_svc_lyr_dec->ps_subset_sps[MAX_NUM_SEQ_PARAMS + ps_seq->u1_seq_parameter_set_id];
  ------------------
  |  |  521|  26.5k|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
 1593|  26.5k|    ps_sps_svc_ext = &ps_subset_seq->s_sps_svc_ext;
 1594|  26.5k|    ps_svc_slice_params = &ps_svc_lyr_dec->s_svc_slice_params;
 1595|       |
 1596|  26.5k|    if(0 == ps_svc_lyr_dec->ps_nal_svc_ext->u1_quality_id)
  ------------------
  |  Branch (1596:8): [True: 26.5k, False: 0]
  ------------------
 1597|  26.5k|    {
 1598|  26.5k|        ps_svc_slice_params->u1_ref_layer_chroma_phase_y_plus1 =
 1599|  26.5k|            ps_sps_svc_ext->u1_seq_ref_layer_chroma_phase_y_plus1;
 1600|       |
 1601|  26.5k|        ps_svc_slice_params->u1_ref_layer_chroma_phase_x_plus1_flag =
 1602|  26.5k|            ps_sps_svc_ext->u1_seq_ref_layer_chroma_phase_x_plus1_flag;
 1603|  26.5k|    }
 1604|       |
 1605|  26.5k|    ps_svc_slice_params->u4_ref_layer_dq_id = UINT32_MAX;
 1606|  26.5k|    ps_svc_slice_params->u4_disable_inter_layer_deblk_filter_idc = 0;
 1607|  26.5k|    ps_svc_slice_params->u1_scan_idx_start = 0;
 1608|  26.5k|    ps_svc_slice_params->u1_scan_idx_end = 15;
 1609|  26.5k|    ps_svc_slice_params->i4_inter_layer_slice_alpha_c0_offset_div2 = 0;
 1610|  26.5k|    ps_svc_slice_params->i4_inter_layer_slice_beta_offset_div2 = 0;
 1611|  26.5k|    ps_svc_slice_params->u1_constrained_intra_resampling_flag = 0;
 1612|       |
 1613|  26.5k|    return i_status;
 1614|  26.5k|}
isvcd_parse_slice_header:
 1628|  26.5k|{
 1629|  26.5k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
 1630|  26.5k|    dec_pic_params_t *ps_pps = ps_dec->ps_cur_pps;
 1631|  26.5k|    dec_bit_stream_t *ps_bitstrm = ps_dec->ps_bitstrm;
 1632|  26.5k|    dec_seq_params_t *ps_seq;
 1633|  26.5k|    dec_svc_seq_params_t *ps_subset_seq;
 1634|  26.5k|    dec_slice_svc_ext_params_t *ps_svc_slice_params = NULL;
 1635|  26.5k|    dec_subset_seq_params_t *ps_sps_svc_ext = NULL;
 1636|  26.5k|    svc_dec_ctxt_t *ps_svcd_ctxt;
 1637|  26.5k|    UWORD32 *pu4_bitstrm_buf = ps_dec->ps_bitstrm->pu4_buffer;
 1638|  26.5k|    UWORD32 *pu4_bitstrm_ofst = &ps_dec->ps_bitstrm->u4_ofst;
 1639|  26.5k|    ps_svcd_ctxt = ps_svc_lyr_dec->ps_svcd_ctxt;
 1640|  26.5k|    ps_seq = ps_pps->ps_sps;
 1641|  26.5k|    ps_seq += MAX_NUM_SEQ_PARAMS;
  ------------------
  |  |  521|  26.5k|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
 1642|  26.5k|    ps_subset_seq =
 1643|  26.5k|        &ps_svc_lyr_dec->ps_subset_sps[MAX_NUM_SEQ_PARAMS + ps_seq->u1_seq_parameter_set_id];
  ------------------
  |  |  521|  26.5k|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
 1644|  26.5k|    ps_sps_svc_ext = &ps_subset_seq->s_sps_svc_ext;
 1645|  26.5k|    ps_svc_slice_params = &ps_svc_lyr_dec->s_svc_slice_params;
 1646|       |
 1647|  26.5k|    if(!ps_svc_lyr_dec->ps_nal_svc_ext->u1_no_inter_layer_pred_flag &&
  ------------------
  |  Branch (1647:8): [True: 26.5k, False: 0]
  ------------------
 1648|  26.5k|       (0 == ps_svc_lyr_dec->ps_nal_svc_ext->u1_quality_id))
  ------------------
  |  Branch (1648:8): [True: 26.5k, False: 0]
  ------------------
 1649|  26.5k|    {
 1650|  26.5k|        ps_svc_slice_params->u4_ref_layer_dq_id = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1651|  26.5k|        COPYTHECONTEXT("Slice Header SVC ext: u4_ref_layer_dq_id",
 1652|  26.5k|                       ps_svc_slice_params->u4_ref_layer_dq_id);
 1653|  26.5k|        if(ps_svc_slice_params->u4_ref_layer_dq_id > MAX_REF_DEP_ID)
  ------------------
  |  |  106|  26.5k|#define MAX_REF_DEP_ID ((MAX_DEPENDENCY_ID << 4) | MAX_QUALITY_ID)
  |  |  ------------------
  |  |  |  |  103|  26.5k|#define MAX_DEPENDENCY_ID 4
  |  |  ------------------
  |  |               #define MAX_REF_DEP_ID ((MAX_DEPENDENCY_ID << 4) | MAX_QUALITY_ID)
  |  |  ------------------
  |  |  |  |  102|  26.5k|#define MAX_QUALITY_ID 0
  |  |  ------------------
  ------------------
  |  Branch (1653:12): [True: 289, False: 26.2k]
  ------------------
 1654|    289|        {
 1655|    289|            return ERROR_INV_SLICE_HDR_T;
 1656|    289|        }
 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|  26.2k|        ps_svc_lyr_dec->ps_dec_svc_ref_layer =
 1666|  26.2k|            &ps_svcd_ctxt->ps_svc_dec_lyr[ps_svc_lyr_dec->u1_ref_layer_id];
 1667|       |
 1668|  26.2k|        if(ps_sps_svc_ext->u1_inter_layer_deblocking_filter_control_present_flag)
  ------------------
  |  Branch (1668:12): [True: 1.41k, False: 24.8k]
  ------------------
 1669|  1.41k|        {
 1670|  1.41k|            ps_svc_slice_params->u4_disable_inter_layer_deblk_filter_idc =
 1671|  1.41k|                ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1672|  1.41k|            COPYTHECONTEXT("Slice Header SVC ext: u4_disable_inter_layer_deblk_filter_idc",
 1673|  1.41k|                           ps_svc_slice_params->u4_disable_inter_layer_deblk_filter_idc);
 1674|       |
 1675|  1.41k|            if(ps_svc_slice_params->u4_disable_inter_layer_deblk_filter_idc > 6)
  ------------------
  |  Branch (1675:16): [True: 135, False: 1.27k]
  ------------------
 1676|    135|            {
 1677|    135|                return ERROR_INV_SLICE_HDR_T;
 1678|    135|            }
 1679|       |
 1680|  1.27k|            if(1 != ps_svc_slice_params->u4_disable_inter_layer_deblk_filter_idc)
  ------------------
  |  Branch (1680:16): [True: 1.14k, False: 135]
  ------------------
 1681|  1.14k|            {
 1682|  1.14k|                ps_svc_slice_params->i4_inter_layer_slice_alpha_c0_offset_div2 =
 1683|  1.14k|                    ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1684|  1.14k|                COPYTHECONTEXT("Slice Header SVC ext: i4_inter_layer_slice_alpha_c0_offset_div2",
 1685|  1.14k|                               ps_svc_slice_params->i4_inter_layer_slice_alpha_c0_offset_div2);
 1686|       |
 1687|  1.14k|                if(ps_svc_slice_params->i4_inter_layer_slice_alpha_c0_offset_div2 > 6 ||
  ------------------
  |  Branch (1687:20): [True: 73, False: 1.06k]
  ------------------
 1688|  1.06k|                   ps_svc_slice_params->i4_inter_layer_slice_alpha_c0_offset_div2 < -6)
  ------------------
  |  Branch (1688:20): [True: 74, False: 995]
  ------------------
 1689|    147|                {
 1690|    147|                    return ERROR_INV_SLICE_HDR_T;
 1691|    147|                }
 1692|       |
 1693|    995|                ps_svc_slice_params->i4_inter_layer_slice_beta_offset_div2 =
 1694|    995|                    ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1695|    995|                COPYTHECONTEXT("Slice Header SVC ext: i4_inter_layer_slice_beta_offset_div2",
 1696|    995|                               ps_svc_slice_params->i4_inter_layer_slice_beta_offset_div2);
 1697|       |
 1698|    995|                if(ps_svc_slice_params->i4_inter_layer_slice_beta_offset_div2 > 6 ||
  ------------------
  |  Branch (1698:20): [True: 147, False: 848]
  ------------------
 1699|    848|                   ps_svc_slice_params->i4_inter_layer_slice_beta_offset_div2 < -6)
  ------------------
  |  Branch (1699:20): [True: 85, False: 763]
  ------------------
 1700|    232|                {
 1701|    232|                    return ERROR_INV_SLICE_HDR_T;
 1702|    232|                }
 1703|    995|            }
 1704|  1.27k|        }
 1705|       |
 1706|  25.7k|        ps_svc_slice_params->u1_constrained_intra_resampling_flag = ih264d_get_bit_h264(ps_bitstrm);
 1707|  25.7k|        COPYTHECONTEXT("Slice Header SVC ext: u1_constrained_intra_resampling_flag",
 1708|  25.7k|                       ps_svc_slice_params->u1_constrained_intra_resampling_flag);
 1709|       |
 1710|  25.7k|        ps_svc_lyr_dec->s_res_prms.i1_constrained_intra_rsmpl_flag =
 1711|  25.7k|            ps_svc_lyr_dec->s_svc_slice_params.u1_constrained_intra_resampling_flag;
 1712|  25.7k|        isvcd_intra_resamp_res_init_update_flags(ps_svc_lyr_dec);
 1713|       |
 1714|  25.7k|        if(2 == ps_sps_svc_ext->u1_extended_spatial_scalability_idc)
  ------------------
  |  Branch (1714:12): [True: 0, False: 25.7k]
  ------------------
 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|  25.7k|        else
 1800|  25.7k|        {
 1801|  25.7k|            ps_svc_slice_params->i4_scaled_ref_layer_left_offset =
 1802|  25.7k|                ps_sps_svc_ext->i4_seq_scaled_ref_layer_left_offset;
 1803|  25.7k|            ps_svc_slice_params->i4_scaled_ref_layer_top_offset =
 1804|  25.7k|                ps_sps_svc_ext->i4_seq_scaled_ref_layer_top_offset;
 1805|  25.7k|            ps_svc_slice_params->i4_scaled_ref_layer_right_offset =
 1806|  25.7k|                ps_sps_svc_ext->i4_seq_scaled_ref_layer_right_offset;
 1807|  25.7k|            ps_svc_slice_params->i4_scaled_ref_layer_bottom_offset =
 1808|  25.7k|                ps_sps_svc_ext->i4_seq_scaled_ref_layer_bottom_offset;
 1809|  25.7k|        }
 1810|  25.7k|    }
 1811|       |
 1812|  25.7k|    if(!ps_svc_lyr_dec->ps_nal_svc_ext->u1_no_inter_layer_pred_flag)
  ------------------
  |  Branch (1812:8): [True: 25.7k, False: 0]
  ------------------
 1813|  25.7k|    {
 1814|  25.7k|        ps_svc_slice_params->u1_slice_skip_flag = ih264d_get_bit_h264(ps_bitstrm);
 1815|  25.7k|        COPYTHECONTEXT("Slice Header SVC ext: u1_slice_skip_flag",
 1816|  25.7k|                       ps_svc_slice_params->u1_slice_skip_flag);
 1817|       |
 1818|  25.7k|        if(ps_svc_slice_params->u1_slice_skip_flag)
  ------------------
  |  Branch (1818:12): [True: 1.25k, False: 24.4k]
  ------------------
 1819|  1.25k|        {
 1820|  1.25k|            ps_svc_slice_params->u4_num_mbs_in_slice_minus1 =
 1821|  1.25k|                ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1822|  1.25k|            COPYTHECONTEXT("Slice Header SVC ext: u4_num_mbs_in_slice_minus1",
 1823|  1.25k|                           ps_svc_slice_params->u4_num_mbs_in_slice_minus1);
 1824|  1.25k|        }
 1825|  24.4k|        else
 1826|  24.4k|        {
 1827|  24.4k|            ps_svc_slice_params->u1_adaptive_base_mode_flag = ih264d_get_bit_h264(ps_bitstrm);
 1828|  24.4k|            COPYTHECONTEXT("Slice Header SVC ext: u1_adaptive_base_mode_flag",
 1829|  24.4k|                           ps_svc_slice_params->u1_adaptive_base_mode_flag);
 1830|       |
 1831|  24.4k|            if(!ps_svc_slice_params->u1_adaptive_base_mode_flag)
  ------------------
  |  Branch (1831:16): [True: 13.9k, False: 10.5k]
  ------------------
 1832|  13.9k|            {
 1833|  13.9k|                ps_svc_slice_params->u1_default_base_mode_flag = ih264d_get_bit_h264(ps_bitstrm);
 1834|  13.9k|                COPYTHECONTEXT("Slice Header SVC ext: u1_default_base_mode_flag",
 1835|  13.9k|                               ps_svc_slice_params->u1_default_base_mode_flag);
 1836|  13.9k|            }
 1837|  24.4k|            if(!ps_svc_slice_params->u1_default_base_mode_flag)
  ------------------
  |  Branch (1837:16): [True: 18.7k, False: 5.69k]
  ------------------
 1838|  18.7k|            {
 1839|  18.7k|                ps_svc_slice_params->u1_adaptive_motion_prediction_flag =
 1840|  18.7k|                    ih264d_get_bit_h264(ps_bitstrm);
 1841|  18.7k|                COPYTHECONTEXT("Slice Header SVC ext: u1_adaptive_motion_prediction_flag",
 1842|  18.7k|                               ps_svc_slice_params->u1_adaptive_motion_prediction_flag);
 1843|       |
 1844|  18.7k|                if(!ps_svc_slice_params->u1_adaptive_motion_prediction_flag)
  ------------------
  |  Branch (1844:20): [True: 12.4k, False: 6.30k]
  ------------------
 1845|  12.4k|                {
 1846|  12.4k|                    ps_svc_slice_params->u1_default_motion_prediction_flag =
 1847|  12.4k|                        ih264d_get_bit_h264(ps_bitstrm);
 1848|  12.4k|                    COPYTHECONTEXT("Slice Header SVC ext: u1_default_motion_prediction_flag",
 1849|  12.4k|                                   ps_svc_slice_params->u1_default_motion_prediction_flag);
 1850|  12.4k|                }
 1851|  18.7k|            }
 1852|  24.4k|            ps_svc_slice_params->u1_adaptive_residual_prediction_flag =
 1853|  24.4k|                ih264d_get_bit_h264(ps_bitstrm);
 1854|  24.4k|            COPYTHECONTEXT("Slice Header SVC ext: u1_adaptive_residual_prediction_flag",
 1855|  24.4k|                           ps_svc_slice_params->u1_adaptive_residual_prediction_flag);
 1856|       |
 1857|  24.4k|            if(!ps_svc_slice_params->u1_adaptive_residual_prediction_flag)
  ------------------
  |  Branch (1857:16): [True: 17.3k, False: 7.18k]
  ------------------
 1858|  17.3k|            {
 1859|  17.3k|                ps_svc_slice_params->u1_default_residual_prediction_flag =
 1860|  17.3k|                    ih264d_get_bit_h264(ps_bitstrm);
 1861|  17.3k|                COPYTHECONTEXT("Slice Header SVC ext: u1_default_residual_prediction_flag",
 1862|  17.3k|                               ps_svc_slice_params->u1_default_residual_prediction_flag);
 1863|  17.3k|            }
 1864|  24.4k|        }
 1865|       |
 1866|  25.7k|        if(ps_sps_svc_ext->u1_adaptive_tcoeff_level_prediction_flag)
  ------------------
  |  Branch (1866:12): [True: 1.28k, False: 24.4k]
  ------------------
 1867|  1.28k|        {
 1868|  1.28k|            ps_svc_slice_params->u1_tcoeff_level_prediction_flag = ih264d_get_bit_h264(ps_bitstrm);
 1869|  1.28k|            COPYTHECONTEXT("Slice Header SVC ext: u1_tcoeff_level_prediction_flag",
 1870|  1.28k|                           ps_svc_slice_params->u1_tcoeff_level_prediction_flag);
 1871|       |
 1872|  1.28k|            if(ps_svc_slice_params->u1_tcoeff_level_prediction_flag != 0)
  ------------------
  |  Branch (1872:16): [True: 153, False: 1.12k]
  ------------------
 1873|    153|            {
 1874|    153|                return ERROR_INV_SPS_PPS_T;
 1875|    153|            }
 1876|  1.28k|        }
 1877|  25.7k|    }
 1878|       |
 1879|  25.5k|    if(!ps_sps_svc_ext->u1_slice_header_restriction_flag &&
  ------------------
  |  Branch (1879:8): [True: 21.9k, False: 3.66k]
  ------------------
 1880|  21.9k|       !ps_svc_slice_params->u1_slice_skip_flag)
  ------------------
  |  Branch (1880:8): [True: 20.9k, False: 939]
  ------------------
 1881|  20.9k|    {
 1882|  20.9k|        ps_svc_slice_params->u1_scan_idx_start = ih264d_get_bits_h264(ps_bitstrm, 4);
 1883|  20.9k|        COPYTHECONTEXT("Slice Header SVC ext: u1_scan_idx_start",
 1884|  20.9k|                       ps_svc_slice_params->u1_scan_idx_start);
 1885|  20.9k|        ps_svc_slice_params->u1_scan_idx_end = ih264d_get_bits_h264(ps_bitstrm, 4);
 1886|  20.9k|        COPYTHECONTEXT("Slice Header SVC ext: u1_scan_idx_end",
 1887|  20.9k|                       ps_svc_slice_params->u1_scan_idx_end);
 1888|       |
 1889|  20.9k|        if(0 != ps_svc_slice_params->u1_scan_idx_start &&
  ------------------
  |  Branch (1889:12): [True: 12.3k, False: 8.62k]
  ------------------
 1890|  12.3k|           15 != ps_svc_slice_params->u1_scan_idx_end)
  ------------------
  |  Branch (1890:12): [True: 933, False: 11.4k]
  ------------------
 1891|    933|            return ERROR_SVC_INV_SCAN_IDX;
 1892|  20.9k|    }
 1893|  24.6k|    return OK;
  ------------------
  |  |  114|  24.6k|#define OK        0
  ------------------
 1894|  25.5k|}
isvcd_parse_decode_slice:
 1911|   131k|{
 1912|   131k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
 1913|   131k|    dec_bit_stream_t *ps_bitstrm = ps_dec->ps_bitstrm;
 1914|   131k|    dec_pic_params_t *ps_pps;
 1915|   131k|    dec_seq_params_t *ps_seq;
 1916|   131k|    dec_svc_seq_params_t *ps_subset_seq;
 1917|   131k|    dec_slice_params_t *ps_cur_slice = ps_dec->ps_cur_slice;
 1918|   131k|    pocstruct_t s_tmp_poc = {0};
 1919|   131k|    WORD32 i_delta_poc[2] = {0};
 1920|   131k|    WORD32 i4_poc = 0;
 1921|   131k|    UWORD16 u2_first_mb_in_slice, u2_frame_num;
 1922|   131k|    UWORD8 u1_field_pic_flag, u1_redundant_pic_cnt = 0, u1_slice_type;
 1923|   131k|    UWORD32 u4_idr_pic_id = 0;
 1924|   131k|    UWORD8 u1_bottom_field_flag, u1_pic_order_cnt_type;
 1925|   131k|    UWORD8 u1_nal_unit_type;
 1926|   131k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
 1927|   131k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
 1928|   131k|    WORD8 i1_is_end_of_poc;
 1929|       |
 1930|   131k|    WORD32 ret;
 1931|   131k|    WORD32 prev_slice_err, num_mb_skipped;
 1932|   131k|    UWORD32 u4_mbaff;
 1933|   131k|    pocstruct_t *ps_cur_poc;
 1934|       |
 1935|   131k|    UWORD32 u4_temp;
 1936|   131k|    WORD32 i_temp;
 1937|   131k|    svc_dec_ctxt_t *psvcd_dec_ctxt;
 1938|   131k|    dec_struct_t *ps_dec_cur_lyr_minus_1;
 1939|   131k|    svc_dec_lyr_struct_t *ps_svc_cur_lyr_dec_minus_1;
 1940|       |
 1941|       |    /* read FirstMbInSlice  and slice type*/
 1942|   131k|    ps_dec->ps_dpb_cmds->u1_dpb_commands_read_slc = 0;
 1943|   131k|    u2_first_mb_in_slice = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1944|   131k|    if(u2_first_mb_in_slice > (ps_dec->u2_frm_ht_in_mbs * ps_dec->u2_frm_wd_in_mbs))
  ------------------
  |  Branch (1944:8): [True: 13.6k, False: 117k]
  ------------------
 1945|  13.6k|    {
 1946|  13.6k|        return ERROR_CORRUPTED_SLICE;
 1947|  13.6k|    }
 1948|       |
 1949|       |    /*we currently don not support ASO*/
 1950|   117k|    if(((u2_first_mb_in_slice << ps_cur_slice->u1_mbaff_frame_flag) <= ps_dec->u4_cur_mb_addr) &&
  ------------------
  |  Branch (1950:8): [True: 110k, False: 7.36k]
  ------------------
 1951|   110k|       (ps_dec->u4_first_slice_in_pic == 0))
  ------------------
  |  Branch (1951:8): [True: 935, False: 109k]
  ------------------
 1952|    935|    {
 1953|    935|        return ERROR_CORRUPTED_SLICE;
 1954|    935|    }
 1955|       |
 1956|   116k|    if(ps_dec->u4_first_slice_in_pic == 1)
  ------------------
  |  Branch (1956:8): [True: 113k, False: 3.35k]
  ------------------
 1957|   113k|    {
 1958|   113k|        if(u2_first_mb_in_slice != 0)
  ------------------
  |  Branch (1958:12): [True: 4.01k, False: 109k]
  ------------------
 1959|  4.01k|        {
 1960|  4.01k|            return ERROR_CORRUPTED_SLICE;
 1961|  4.01k|        }
 1962|   113k|    }
 1963|       |
 1964|   112k|    COPYTHECONTEXT("SH: first_mb_in_slice", u2_first_mb_in_slice);
 1965|       |
 1966|   112k|    u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1967|   112k|    if(u4_temp > 9) return ERROR_INV_SLC_TYPE_T;
  ------------------
  |  Branch (1967:8): [True: 774, False: 111k]
  ------------------
 1968|       |
 1969|   111k|    u1_slice_type = u4_temp;
 1970|   111k|    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|   111k|    if(u1_slice_type > 4)
  ------------------
  |  Branch (1974:8): [True: 4.19k, False: 107k]
  ------------------
 1975|  4.19k|    {
 1976|  4.19k|        u1_slice_type -= 5;
 1977|  4.19k|    }
 1978|       |
 1979|   111k|    u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1980|   111k|    if(u4_temp & MASK_ERR_PIC_SET_ID) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  |  527|   111k|#define MASK_ERR_PIC_SET_ID   (0xFFFFFF00)
  ------------------
  |  Branch (1980:8): [True: 130, False: 111k]
  ------------------
 1981|       |    /* discard slice if pic param is invalid */
 1982|   111k|    COPYTHECONTEXT("SH: pic_parameter_set_id", u4_temp);
 1983|   111k|    ps_pps = &ps_dec->ps_pps[u4_temp];
 1984|   111k|    if(FALSE == ps_pps->u1_is_valid)
  ------------------
  |  |  592|   111k|#define FALSE   0
  ------------------
  |  Branch (1984:8): [True: 3.51k, False: 108k]
  ------------------
 1985|  3.51k|    {
 1986|  3.51k|        return ERROR_INV_SLICE_HDR_T;
 1987|  3.51k|    }
 1988|       |    /* slices in a layer should have same PPS id*/
 1989|   108k|    if(UINT32_MAX == ps_svc_lyr_dec->u4_pps_id_for_layer)
  ------------------
  |  Branch (1989:8): [True: 104k, False: 3.35k]
  ------------------
 1990|   104k|    {
 1991|   104k|        ps_svc_lyr_dec->u4_pps_id_for_layer = u4_temp;
 1992|   104k|    }
 1993|  3.35k|    else if(u4_temp != ps_svc_lyr_dec->u4_pps_id_for_layer)
  ------------------
  |  Branch (1993:13): [True: 66, False: 3.29k]
  ------------------
 1994|     66|    {
 1995|     66|        return ERROR_INV_SLICE_HDR_T;
 1996|     66|    }
 1997|   108k|    ps_seq = ps_pps->ps_sps;
 1998|   108k|    ps_dec->ps_cur_sps = ps_seq;
 1999|   108k|    ps_subset_seq = &ps_svc_lyr_dec->ps_subset_sps[ps_seq->u1_seq_parameter_set_id];
 2000|   108k|    ps_svc_lyr_dec->ps_cur_subset_sps = ps_subset_seq;
 2001|   108k|    if(!ps_seq) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (2001:8): [True: 0, False: 108k]
  ------------------
 2002|   108k|    if(FALSE == ps_seq->u1_is_valid) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  |  592|   108k|#define FALSE   0
  ------------------
  |  Branch (2002:8): [True: 616, False: 107k]
  ------------------
 2003|   107k|    if(ps_seq->u1_mb_aff_flag) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (2003:8): [True: 103, False: 107k]
  ------------------
 2004|   107k|    if(ps_seq->u1_level_idc > H264_LEVEL_4_2) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  |  303|   107k|#define H264_LEVEL_4_2     42
  ------------------
  |  Branch (2004:8): [True: 263, False: 107k]
  ------------------
 2005|   107k|    if(!ps_seq->u1_frame_mbs_only_flag) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (2005:8): [True: 222, False: 106k]
  ------------------
 2006|   106k|    if(OK != isvcd_verify_level(ps_seq->u1_level_idc)) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  |  114|   106k|#define OK        0
  ------------------
  |  Branch (2006:8): [True: 170, False: 106k]
  ------------------
 2007|   106k|    if(ps_dec->u1_init_dec_flag == 1)
  ------------------
  |  Branch (2007:8): [True: 87.6k, False: 18.9k]
  ------------------
 2008|  87.6k|    {
 2009|  87.6k|        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: 141, False: 87.5k]
  ------------------
 2010|  87.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: 110, False: 87.4k]
  ------------------
 2011|  87.5k|    }
 2012|       |
 2013|   106k|    if(ps_dec->u1_init_dec_flag == 1)
  ------------------
  |  Branch (2013:8): [True: 87.4k, False: 18.9k]
  ------------------
 2014|  87.4k|    {
 2015|  87.4k|        if(ps_dec->u2_disp_height != ps_subset_seq->u2_disp_height) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (2015:12): [True: 71, False: 87.3k]
  ------------------
 2016|  87.3k|        if(ps_dec->u2_disp_width != ps_subset_seq->u2_disp_width) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (2016:12): [True: 68, False: 87.2k]
  ------------------
 2017|  87.3k|    }
 2018|       |
 2019|   106k|    if(ps_seq->u1_profile_idc == BASE_PROFILE_IDC)
  ------------------
  |  |  275|   106k|#define BASE_PROFILE_IDC    66
  ------------------
  |  Branch (2019:8): [True: 18.6k, False: 87.6k]
  ------------------
 2020|  18.6k|    {
 2021|  18.6k|        if(ps_pps->u1_entropy_coding_mode != 0)
  ------------------
  |  Branch (2021:12): [True: 155, False: 18.4k]
  ------------------
 2022|    155|        {
 2023|    155|            return ERROR_INV_SPS_PPS_T;
 2024|    155|        }
 2025|  18.6k|    }
 2026|       |
 2027|   106k|    ps_dec->i4_reorder_depth = ps_subset_seq->i4_reorder_depth;
 2028|   106k|    ps_dec->u2_disp_height = ps_subset_seq->u2_disp_height;
 2029|   106k|    ps_dec->u2_disp_width = ps_subset_seq->u2_disp_width;
 2030|       |
 2031|   106k|    if(ps_svc_lyr_dec->u1_layer_id > 0)
  ------------------
  |  Branch (2031:8): [True: 0, False: 106k]
  ------------------
 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|   106k|    ps_dec->u2_pic_wd = ps_subset_seq->u2_pic_wd;
 2047|   106k|    ps_dec->u2_pic_ht = ps_subset_seq->u2_pic_ht;
 2048|   106k|    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|   106k|    ps_dec->u2_frm_wd_y = ps_subset_seq->u2_frm_wd_y;
 2052|   106k|    ps_dec->u2_frm_ht_y = ps_subset_seq->u2_frm_ht_y;
 2053|       |
 2054|   106k|    ps_dec->u2_frm_wd_uv = ps_subset_seq->u2_frm_wd_uv;
 2055|   106k|    ps_dec->u2_frm_ht_uv = ps_subset_seq->u2_frm_ht_uv;
 2056|       |
 2057|   106k|    ps_dec->s_pad_mgr.u1_pad_len_y_v = ps_subset_seq->u1_pad_len_y_v;
 2058|   106k|    ps_dec->s_pad_mgr.u1_pad_len_cr_v = ps_subset_seq->u1_pad_len_cr_v;
 2059|   106k|    ps_dec->u2_frm_wd_in_mbs = ps_seq->u2_frm_wd_in_mbs;
 2060|   106k|    ps_dec->u2_frm_ht_in_mbs = ps_seq->u2_frm_ht_in_mbs;
 2061|       |
 2062|   106k|    ps_dec->u2_crop_offset_y = ps_subset_seq->u2_crop_offset_y;
 2063|   106k|    ps_dec->u2_crop_offset_uv = ps_subset_seq->u2_crop_offset_uv;
 2064|       |
 2065|       |    /* Get the frame num */
 2066|   106k|    u2_frame_num = ih264d_get_bits_h264(ps_bitstrm, ps_seq->u1_bits_in_frm_num);
 2067|   106k|    COPYTHECONTEXT("SH: frame_num", u2_frame_num);
 2068|       |
 2069|   106k|    if(!ps_dec->u1_first_slice_in_stream && ps_dec->u4_first_slice_in_pic)
  ------------------
  |  Branch (2069:8): [True: 80.0k, False: 26.1k]
  |  Branch (2069:45): [True: 76.7k, False: 3.29k]
  ------------------
 2070|  76.7k|    {
 2071|  76.7k|        pocstruct_t *ps_prev_poc = &ps_dec->s_prev_pic_poc;
 2072|  76.7k|        pocstruct_t *ps_cur_poc = &ps_dec->s_cur_pic_poc;
 2073|       |
 2074|  76.7k|        ps_dec->u2_mbx = 0xffff;
 2075|  76.7k|        ps_dec->u2_mby = 0;
 2076|       |
 2077|  76.7k|        if((0 == u1_is_idr_slice) && ps_cur_slice->u1_nal_ref_idc)
  ------------------
  |  Branch (2077:12): [True: 17.2k, False: 59.5k]
  |  Branch (2077:38): [True: 10.4k, False: 6.81k]
  ------------------
 2078|  10.4k|            ps_dec->u2_prev_ref_frame_num = ps_cur_slice->u2_frame_num;
 2079|       |
 2080|  76.7k|        if(u1_is_idr_slice || ps_cur_slice->u1_mmco_equalto5) ps_dec->u2_prev_ref_frame_num = 0;
  ------------------
  |  Branch (2080:12): [True: 59.5k, False: 17.2k]
  |  Branch (2080:31): [True: 1.39k, False: 15.8k]
  ------------------
 2081|       |
 2082|  76.7k|        if(ps_dec->ps_cur_sps->u1_gaps_in_frame_num_value_allowed_flag)
  ------------------
  |  Branch (2082:12): [True: 0, False: 76.7k]
  ------------------
 2083|      0|        {
 2084|      0|            isvcd_decode_gaps_in_frame_num(ps_dec, u2_frame_num);
 2085|      0|        }
 2086|       |
 2087|  76.7k|        ps_prev_poc->i4_prev_frame_num_ofst = ps_cur_poc->i4_prev_frame_num_ofst;
 2088|  76.7k|        ps_prev_poc->u2_frame_num = ps_cur_poc->u2_frame_num;
 2089|  76.7k|        ps_prev_poc->u1_mmco_equalto5 = ps_cur_slice->u1_mmco_equalto5;
 2090|  76.7k|        if(ps_cur_slice->u1_nal_ref_idc)
  ------------------
  |  Branch (2090:12): [True: 67.8k, False: 8.88k]
  ------------------
 2091|  67.8k|        {
 2092|  67.8k|            ps_prev_poc->i4_pic_order_cnt_lsb = ps_cur_poc->i4_pic_order_cnt_lsb;
 2093|  67.8k|            ps_prev_poc->i4_pic_order_cnt_msb = ps_cur_poc->i4_pic_order_cnt_msb;
 2094|  67.8k|            ps_prev_poc->i4_delta_pic_order_cnt_bottom = ps_cur_poc->i4_delta_pic_order_cnt_bottom;
 2095|  67.8k|            ps_prev_poc->i4_delta_pic_order_cnt[0] = ps_cur_poc->i4_delta_pic_order_cnt[0];
 2096|  67.8k|            ps_prev_poc->i4_delta_pic_order_cnt[1] = ps_cur_poc->i4_delta_pic_order_cnt[1];
 2097|  67.8k|            ps_prev_poc->u1_bot_field = ps_cur_poc->u1_bot_field;
 2098|  67.8k|        }
 2099|       |
 2100|  76.7k|        ps_dec->u4_total_mbs_coded = 0;
 2101|  76.7k|    }
 2102|       |    /* Get the field related flags  */
 2103|   106k|    if(!ps_seq->u1_frame_mbs_only_flag)
  ------------------
  |  Branch (2103:8): [True: 0, False: 106k]
  ------------------
 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|   106k|    else
 2121|   106k|    {
 2122|   106k|        u1_field_pic_flag = 0;
 2123|   106k|        u1_bottom_field_flag = 0;
 2124|       |
 2125|   106k|        ps_dec->pu1_inv_scan = (UWORD8 *) gau1_ih264d_inv_scan;
 2126|   106k|    }
 2127|       |
 2128|   106k|    u1_nal_unit_type = SLICE_NAL;
  ------------------
  |  |  324|   106k|#define SLICE_NAL                       1
  ------------------
 2129|   106k|    if(u1_is_idr_slice)
  ------------------
  |  Branch (2129:8): [True: 84.0k, False: 22.0k]
  ------------------
 2130|  84.0k|    {
 2131|  84.0k|        u1_nal_unit_type = IDR_SLICE_NAL;
  ------------------
  |  |  328|  84.0k|#define IDR_SLICE_NAL                   5
  ------------------
 2132|  84.0k|        u4_idr_pic_id = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 2133|  84.0k|        if(u4_idr_pic_id > 65535) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (2133:12): [True: 920, False: 83.1k]
  ------------------
 2134|  83.1k|        COPYTHECONTEXT("SH:  ", u4_idr_pic_id);
 2135|  83.1k|    }
 2136|       |
 2137|       |    /* read delta pic order count information*/
 2138|   105k|    i_delta_poc[0] = i_delta_poc[1] = 0;
 2139|   105k|    s_tmp_poc.i4_pic_order_cnt_lsb = 0;
 2140|   105k|    s_tmp_poc.i4_delta_pic_order_cnt_bottom = 0;
 2141|   105k|    u1_pic_order_cnt_type = ps_seq->u1_pic_order_cnt_type;
 2142|   105k|    if(u1_pic_order_cnt_type == 0)
  ------------------
  |  Branch (2142:8): [True: 78.8k, False: 26.3k]
  ------------------
 2143|  78.8k|    {
 2144|  78.8k|        i_temp = ih264d_get_bits_h264(ps_bitstrm, ps_seq->u1_log2_max_pic_order_cnt_lsb_minus);
 2145|  78.8k|        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: 78.8k]
  |  Branch (2145:26): [True: 0, False: 78.8k]
  ------------------
 2146|  78.8k|        s_tmp_poc.i4_pic_order_cnt_lsb = i_temp;
 2147|  78.8k|        COPYTHECONTEXT("SH: pic_order_cnt_lsb", s_tmp_poc.i4_pic_order_cnt_lsb);
 2148|       |
 2149|  78.8k|        if((ps_pps->u1_pic_order_present_flag == 1) && (!u1_field_pic_flag))
  ------------------
  |  Branch (2149:12): [True: 34.5k, False: 44.3k]
  |  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|  78.8k|    }
 2156|       |
 2157|   105k|    s_tmp_poc.i4_delta_pic_order_cnt[0] = 0;
 2158|   105k|    s_tmp_poc.i4_delta_pic_order_cnt[1] = 0;
 2159|   105k|    if(u1_pic_order_cnt_type == 1 && (!ps_seq->u1_delta_pic_order_always_zero_flag))
  ------------------
  |  Branch (2159:8): [True: 22.8k, False: 82.3k]
  |  Branch (2159:38): [True: 21.5k, False: 1.26k]
  ------------------
 2160|  21.5k|    {
 2161|  21.5k|        s_tmp_poc.i4_delta_pic_order_cnt[0] = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 2162|  21.5k|        COPYTHECONTEXT("SH: delta_pic_order_cnt[0]", s_tmp_poc.i4_delta_pic_order_cnt[0]);
 2163|       |
 2164|  21.5k|        if(ps_pps->u1_pic_order_present_flag && !u1_field_pic_flag)
  ------------------
  |  Branch (2164:12): [True: 19.0k, False: 2.48k]
  |  Branch (2164:49): [True: 19.0k, False: 0]
  ------------------
 2165|  19.0k|        {
 2166|  19.0k|            s_tmp_poc.i4_delta_pic_order_cnt[1] = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 2167|  19.0k|            COPYTHECONTEXT("SH: delta_pic_order_cnt[1]", s_tmp_poc.i4_delta_pic_order_cnt[1]);
 2168|  19.0k|        }
 2169|  21.5k|    }
 2170|       |
 2171|   105k|    if(ps_pps->u1_redundant_pic_cnt_present_flag)
  ------------------
  |  Branch (2171:8): [True: 31.4k, False: 73.7k]
  ------------------
 2172|  31.4k|    {
 2173|  31.4k|        u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 2174|  31.4k|        if(u4_temp > MAX_REDUNDANT_PIC_CNT) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  |  611|  31.4k|#define MAX_REDUNDANT_PIC_CNT       127
  ------------------
  |  Branch (2174:12): [True: 659, False: 30.7k]
  ------------------
 2175|  30.7k|        u1_redundant_pic_cnt = u4_temp;
 2176|  30.7k|        COPYTHECONTEXT("SH: redundant_pic_cnt", u1_redundant_pic_cnt);
 2177|  30.7k|    }
 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|   104k|    i1_is_end_of_poc = 1;
 2184|   104k|    ps_dec->ps_dec_err_status->u1_err_flag &= MASK_REJECT_CUR_PIC;
  ------------------
  |  |  605|   104k|#define MASK_REJECT_CUR_PIC (0xFE)
  ------------------
 2185|       |
 2186|   104k|    if(ps_dec->u4_first_slice_in_pic == 0)
  ------------------
  |  Branch (2186:8): [True: 3.29k, False: 101k]
  ------------------
 2187|  3.29k|    {
 2188|  3.29k|        i1_is_end_of_poc =
 2189|  3.29k|            ih264d_is_end_of_pic(u2_frame_num, u1_nal_ref_idc, &s_tmp_poc, &ps_dec->s_cur_pic_poc,
 2190|  3.29k|                                 ps_cur_slice, u1_pic_order_cnt_type, u1_nal_unit_type,
 2191|  3.29k|                                 u4_idr_pic_id, u1_field_pic_flag, u1_bottom_field_flag);
 2192|  3.29k|        if(i1_is_end_of_poc)
  ------------------
  |  Branch (2192:12): [True: 261, False: 3.02k]
  ------------------
 2193|    261|        {
 2194|    261|            ps_dec->u1_first_slice_in_stream = 0;
 2195|    261|            return ERROR_INCOMPLETE_FRAME;
 2196|    261|        }
 2197|  3.29k|    }
 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|   104k|    u4_mbaff = ps_seq->u1_mb_aff_flag && (!u1_field_pic_flag);
  ------------------
  |  Branch (2203:16): [True: 0, False: 104k]
  |  Branch (2203:42): [True: 0, False: 0]
  ------------------
 2204|   104k|    prev_slice_err = 0;
 2205|       |
 2206|   104k|    if(i1_is_end_of_poc || ps_dec->u1_first_slice_in_stream)
  ------------------
  |  Branch (2206:8): [True: 101k, False: 3.02k]
  |  Branch (2206:28): [True: 0, False: 3.02k]
  ------------------
 2207|   101k|    {
 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|   101k|        if((u1_field_pic_flag == 0 || u2_frame_num != ps_dec->u2_prv_frame_num) &&
  ------------------
  |  Branch (2213:13): [True: 101k, False: 0]
  |  Branch (2213:39): [True: 0, False: 0]
  ------------------
 2214|   101k|           ps_dec->u1_top_bottom_decoded != 0 &&
  ------------------
  |  Branch (2214:12): [True: 0, False: 101k]
  ------------------
 2215|      0|           ps_dec->u1_top_bottom_decoded != (TOP_FIELD_ONLY | BOT_FIELD_ONLY))
  ------------------
  |  |   65|      0|#define TOP_FIELD_ONLY      0x02
  ------------------
                         ps_dec->u1_top_bottom_decoded != (TOP_FIELD_ONLY | BOT_FIELD_ONLY))
  ------------------
  |  |   66|      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)
  ------------------
  |  |   65|      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|   101k|        else if(ps_dec->u4_first_slice_in_pic)
  ------------------
  |  Branch (2240:17): [True: 101k, False: 0]
  ------------------
 2241|   101k|        {
 2242|   101k|            if(u2_first_mb_in_slice > 0)
  ------------------
  |  Branch (2242:16): [True: 0, False: 101k]
  ------------------
 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|   101k|        }
 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|   101k|    }
 2271|  3.02k|    else
 2272|  3.02k|    {
 2273|  3.02k|        if((u2_first_mb_in_slice << u4_mbaff) > ps_dec->u4_total_mbs_coded)
  ------------------
  |  Branch (2273:12): [True: 96, False: 2.93k]
  ------------------
 2274|     96|        {
 2275|       |            // previous slice - missing/corruption
 2276|     96|            prev_slice_err = 2;
 2277|     96|            num_mb_skipped = (u2_first_mb_in_slice << u4_mbaff) - ps_dec->u4_total_mbs_coded;
 2278|     96|            ps_cur_poc = &s_tmp_poc;
 2279|     96|        }
 2280|  2.93k|        else if((u2_first_mb_in_slice << u4_mbaff) < ps_dec->u4_total_mbs_coded)
  ------------------
  |  Branch (2280:17): [True: 0, False: 2.93k]
  ------------------
 2281|      0|        {
 2282|      0|            return ERROR_CORRUPTED_SLICE;
 2283|      0|        }
 2284|  3.02k|    }
 2285|   104k|    if(prev_slice_err)
  ------------------
  |  Branch (2285:8): [True: 96, False: 104k]
  ------------------
 2286|     96|    {
 2287|     96|        ret = isvcd_mark_err_slice_skip((svc_dec_lyr_struct_t *) ps_dec, num_mb_skipped,
 2288|     96|                                        u1_is_idr_slice, u2_frame_num, ps_cur_poc, prev_slice_err);
 2289|       |
 2290|     96|        if(ps_dec->u1_dangling_field == 1)
  ------------------
  |  Branch (2290:12): [True: 0, False: 96]
  ------------------
 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;
  ------------------
  |  |   65|      0|#define TOP_FIELD_ONLY      0x02
  ------------------
                          ps_dec->u1_top_bottom_decoded = TOP_FIELD_ONLY | BOT_FIELD_ONLY;
  ------------------
  |  |   66|      0|#define BOT_FIELD_ONLY      0x01
  ------------------
 2295|      0|            return ERROR_DANGLING_FIELD_IN_PIC;
 2296|      0|        }
 2297|       |
 2298|     96|        if(prev_slice_err == 2)
  ------------------
  |  Branch (2298:12): [True: 96, False: 0]
  ------------------
 2299|     96|        {
 2300|     96|            ps_dec->u1_first_slice_in_stream = 0;
 2301|     96|            return ERROR_INCOMPLETE_FRAME;
 2302|     96|        }
 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)
  ------------------
  |  |  602|      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|   104k|    if(u1_field_pic_flag)
  ------------------
  |  Branch (2322:8): [True: 0, False: 104k]
  ------------------
 2323|      0|    {
 2324|      0|        ps_dec->u2_prv_frame_num = u2_frame_num;
 2325|      0|    }
 2326|       |
 2327|   104k|    if(ps_cur_slice->u1_mmco_equalto5 && NULL != ps_dec->ps_cur_pic)
  ------------------
  |  Branch (2327:8): [True: 2.42k, False: 101k]
  |  Branch (2327:42): [True: 2.30k, False: 118]
  ------------------
 2328|  2.30k|    {
 2329|  2.30k|        WORD32 i4_temp_poc;
 2330|  2.30k|        WORD32 i4_top_field_order_poc, i4_bot_field_order_poc;
 2331|  2.30k|        WORD64 i8_result;
 2332|  2.30k|        if(!ps_cur_slice->u1_field_pic_flag)
  ------------------
  |  Branch (2332:12): [True: 2.30k, False: 0]
  ------------------
 2333|  2.30k|        {
 2334|  2.30k|            i4_top_field_order_poc = ps_dec->ps_cur_pic->i4_top_field_order_cnt;
 2335|  2.30k|            i4_bot_field_order_poc = ps_dec->ps_cur_pic->i4_bottom_field_order_cnt;
 2336|  2.30k|            i4_temp_poc = MIN(i4_top_field_order_poc, i4_bot_field_order_poc);
  ------------------
  |  |   61|  2.30k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 1.15k, False: 1.14k]
  |  |  ------------------
  ------------------
 2337|  2.30k|        }
 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.30k|        i8_result = (WORD64) i4_temp_poc - ps_dec->ps_cur_pic->i4_top_field_order_cnt;
 2344|  2.30k|        if(IS_OUT_OF_RANGE_S32(i8_result))
  ------------------
  |  |   58|  2.30k|#define IS_OUT_OF_RANGE_S32(a) (((a) < INT32_MIN) || ((a) > INT32_MAX))
  |  |  ------------------
  |  |  |  Branch (58:33): [True: 66, False: 2.23k]
  |  |  |  Branch (58:54): [True: 0, False: 2.23k]
  |  |  ------------------
  ------------------
 2345|     66|        {
 2346|     66|            return ERROR_INV_POC;
 2347|     66|        }
 2348|  2.23k|        ps_dec->ps_cur_pic->i4_top_field_order_cnt = (WORD32) i8_result;
 2349|  2.23k|        i8_result = (WORD64) i4_temp_poc - ps_dec->ps_cur_pic->i4_bottom_field_order_cnt;
 2350|  2.23k|        if(IS_OUT_OF_RANGE_S32(i8_result))
  ------------------
  |  |   58|  2.23k|#define IS_OUT_OF_RANGE_S32(a) (((a) < INT32_MIN) || ((a) > INT32_MAX))
  |  |  ------------------
  |  |  |  Branch (58:33): [True: 114, False: 2.12k]
  |  |  |  Branch (58:54): [True: 0, False: 2.12k]
  |  |  ------------------
  ------------------
 2351|    114|        {
 2352|    114|            return ERROR_INV_POC;
 2353|    114|        }
 2354|  2.12k|        ps_dec->ps_cur_pic->i4_bottom_field_order_cnt = (WORD32) i8_result;
 2355|  2.12k|        ps_dec->ps_cur_pic->i4_poc = i4_temp_poc;
 2356|  2.12k|        ps_dec->ps_cur_pic->i4_avg_poc = i4_temp_poc;
 2357|  2.12k|    }
 2358|   104k|    if(ps_dec->u4_first_slice_in_pic)
  ------------------
  |  Branch (2358:8): [True: 101k, False: 2.93k]
  ------------------
 2359|   101k|    {
 2360|   101k|        ret = isvcd_decode_pic_order_cnt(u1_is_idr_slice, u2_frame_num, &ps_dec->s_prev_pic_poc,
 2361|   101k|                                         &s_tmp_poc, ps_cur_slice, ps_pps, u1_nal_ref_idc,
 2362|   101k|                                         u1_bottom_field_flag, u1_field_pic_flag, &i4_poc, ps_dec);
 2363|   101k|        if(ret != OK) return ret;
  ------------------
  |  |  114|   101k|#define OK        0
  ------------------
  |  Branch (2363:12): [True: 966, False: 100k]
  ------------------
 2364|       |        /* Display seq no calculations */
 2365|   100k|        if(i4_poc >= ps_dec->i4_max_poc) ps_dec->i4_max_poc = i4_poc;
  ------------------
  |  Branch (2365:12): [True: 51.2k, False: 48.8k]
  ------------------
 2366|       |        /* IDR Picture or POC wrap around */
 2367|   100k|        if(i4_poc == 0)
  ------------------
  |  Branch (2367:12): [True: 22.5k, False: 77.5k]
  ------------------
 2368|  22.5k|        {
 2369|  22.5k|            WORD64 i8_temp;
 2370|  22.5k|            i8_temp = (WORD64) ps_dec->i4_prev_max_display_seq + ps_dec->i4_max_poc +
 2371|  22.5k|                      ps_dec->u1_max_dec_frame_buffering + 1;
 2372|       |            /*If i4_prev_max_display_seq overflows integer range, reset it */
 2373|  22.5k|            ps_dec->i4_prev_max_display_seq = IS_OUT_OF_RANGE_S32(i8_temp) ? 0 : i8_temp;
  ------------------
  |  |   58|  22.5k|#define IS_OUT_OF_RANGE_S32(a) (((a) < INT32_MIN) || ((a) > INT32_MAX))
  |  |  ------------------
  |  |  |  Branch (58:33): [True: 0, False: 22.5k]
  |  |  |  Branch (58:54): [True: 117, False: 22.4k]
  |  |  ------------------
  ------------------
 2374|  22.5k|            ps_dec->i4_max_poc = 0;
 2375|  22.5k|        }
 2376|   100k|    }
 2377|       |
 2378|       |    /* Increment only if the current slice has atleast 1 more MB */
 2379|   103k|    if(ps_dec->u4_first_slice_in_pic == 0 &&
  ------------------
  |  Branch (2379:8): [True: 2.93k, False: 100k]
  ------------------
 2380|  2.93k|       (ps_dec->ps_parse_cur_slice->u4_first_mb_in_slice <
  ------------------
  |  Branch (2380:8): [True: 2.93k, False: 0]
  ------------------
 2381|  2.93k|        (UWORD32) (ps_dec->u4_total_mbs_coded >> ps_dec->ps_cur_slice->u1_mbaff_frame_flag)))
 2382|  2.93k|    {
 2383|  2.93k|        ps_dec->ps_parse_cur_slice++;
 2384|  2.93k|        ps_dec->u2_cur_slice_num++;
 2385|       |        // in the case of single core increment ps_decode_cur_slice
 2386|  2.93k|        if(ps_dec->u1_separate_parse == 0)
  ------------------
  |  Branch (2386:12): [True: 1.64k, False: 1.29k]
  ------------------
 2387|  1.64k|        {
 2388|  1.64k|            ps_dec->ps_decode_cur_slice++;
 2389|  1.64k|        }
 2390|  2.93k|    }
 2391|       |
 2392|   103k|    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|   103k|    ps_cur_slice->i4_delta_pic_order_cnt[0] = i_delta_poc[0];
 2400|   103k|    ps_cur_slice->i4_delta_pic_order_cnt[1] = i_delta_poc[1];
 2401|   103k|    ps_cur_slice->u4_idr_pic_id = u4_idr_pic_id;
 2402|   103k|    ps_cur_slice->u2_first_mb_in_slice = u2_first_mb_in_slice;
 2403|   103k|    ps_cur_slice->u1_field_pic_flag = u1_field_pic_flag;
 2404|   103k|    ps_cur_slice->u1_bottom_field_flag = u1_bottom_field_flag;
 2405|   103k|    ps_cur_slice->u1_slice_type = u1_slice_type;
 2406|   103k|    ps_cur_slice->i4_pic_order_cnt_lsb = s_tmp_poc.i4_pic_order_cnt_lsb;
 2407|       |
 2408|   103k|    ps_cur_slice->u1_nal_unit_type = u1_nal_unit_type;
 2409|   103k|    ps_cur_slice->u1_redundant_pic_cnt = u1_redundant_pic_cnt;
 2410|   103k|    ps_cur_slice->u1_nal_ref_idc = u1_nal_ref_idc;
 2411|   103k|    ps_cur_slice->u1_pic_order_cnt_type = u1_pic_order_cnt_type;
 2412|       |
 2413|   103k|    if(ps_seq->u1_frame_mbs_only_flag)
  ------------------
  |  Branch (2413:8): [True: 103k, False: 0]
  ------------------
 2414|   103k|        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|   103k|    if(u1_slice_type == B_SLICE)
  ------------------
  |  |  369|   103k|#define B_SLICE  1
  ------------------
  |  Branch (2418:8): [True: 30.3k, False: 72.6k]
  ------------------
 2419|  30.3k|    {
 2420|  30.3k|        ps_cur_slice->u1_direct_spatial_mv_pred_flag = ih264d_get_bit_h264(ps_bitstrm);
 2421|  30.3k|        COPYTHECONTEXT("SH: direct_spatial_mv_pred_flag",
 2422|  30.3k|                       ps_cur_slice->u1_direct_spatial_mv_pred_flag);
 2423|       |
 2424|  30.3k|        if(ps_cur_slice->u1_direct_spatial_mv_pred_flag)
  ------------------
  |  Branch (2424:12): [True: 16.1k, False: 14.1k]
  ------------------
 2425|  16.1k|            ps_cur_slice->pf_decodeDirect = ih264d_decode_spatial_direct;
 2426|  14.1k|        else
 2427|  14.1k|            ps_cur_slice->pf_decodeDirect = ih264d_decode_temporal_direct;
 2428|  30.3k|        if(!((ps_seq->u1_mb_aff_flag) && (!u1_field_pic_flag)))
  ------------------
  |  Branch (2428:14): [True: 0, False: 30.3k]
  |  Branch (2428:42): [True: 0, False: 0]
  ------------------
 2429|  30.3k|            ps_dec->pf_mvpred = ih264d_mvpred_nonmbaffB;
 2430|  30.3k|    }
 2431|  72.6k|    else
 2432|  72.6k|    {
 2433|  72.6k|        if(!((ps_seq->u1_mb_aff_flag) && (!u1_field_pic_flag)))
  ------------------
  |  Branch (2433:14): [True: 0, False: 72.6k]
  |  Branch (2433:42): [True: 0, False: 0]
  ------------------
 2434|  72.6k|            ps_dec->pf_mvpred = ih264d_mvpred_nonmbaff;
 2435|  72.6k|    }
 2436|       |
 2437|   103k|    if(ps_dec->u4_first_slice_in_pic)
  ------------------
  |  Branch (2437:8): [True: 100k, False: 2.93k]
  ------------------
 2438|   100k|    {
 2439|   100k|        if(u2_first_mb_in_slice == 0)
  ------------------
  |  Branch (2439:12): [True: 100k, False: 0]
  ------------------
 2440|   100k|        {
 2441|   100k|            ret = isvcd_start_of_pic(ps_svc_lyr_dec, i4_poc, &s_tmp_poc, u2_frame_num, ps_pps);
 2442|   100k|            if(ret != OK) return ret;
  ------------------
  |  |  114|   100k|#define OK        0
  ------------------
  |  Branch (2442:16): [True: 906, False: 99.2k]
  ------------------
 2443|       |            /*inter layer buffer intialization */
 2444|  99.2k|            ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb =
 2445|  99.2k|                ps_svc_lyr_dec->ps_inter_lyr_mb_prms_frm_start;
 2446|  99.2k|            ps_svc_lyr_dec->ps_il_pred_mv_bank_buf_cur_mb =
 2447|  99.2k|                ps_svc_lyr_dec->ps_il_pred_mv_bank_buf_base;
 2448|  99.2k|        }
 2449|       |
 2450|  99.2k|        ps_dec->u4_output_present = 0;
 2451|       |
 2452|  99.2k|        {
 2453|  99.2k|            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|  99.2k|            if(0 != ps_dec->s_disp_op.u4_error_code)
  ------------------
  |  Branch (2457:16): [True: 41.2k, False: 57.9k]
  ------------------
 2458|  41.2k|            {
 2459|  41.2k|                ps_dec->u4_output_present = 0;
 2460|  41.2k|                ps_dec->u4_fmt_conv_cur_row = ps_dec->s_disp_frame_info.u4_y_ht;
 2461|  41.2k|            }
 2462|  57.9k|            else
 2463|  57.9k|                ps_dec->u4_output_present = 1;
 2464|  99.2k|        }
 2465|  99.2k|        ret = isvcd_parse_interlayer_resamp_func_init(ps_svc_lyr_dec, u2_first_mb_in_slice);
 2466|  99.2k|        if(ret != OK)
  ------------------
  |  |  114|  99.2k|#define OK        0
  ------------------
  |  Branch (2466:12): [True: 0, False: 99.2k]
  ------------------
 2467|      0|        {
 2468|      0|            return ERROR_CORRUPTED_SLICE;
 2469|      0|        }
 2470|  99.2k|        if((ps_dec->u1_separate_parse == 1) && (ps_svc_lyr_dec->u1_res_init_done == 1))
  ------------------
  |  Branch (2470:12): [True: 29.0k, False: 70.1k]
  |  Branch (2470:48): [True: 29.0k, False: 0]
  ------------------
 2471|  29.0k|        {
 2472|  29.0k|            if(ps_dec->u4_dec_thread_created == 0)
  ------------------
  |  Branch (2472:16): [True: 29.0k, False: 0]
  ------------------
 2473|  29.0k|            {
 2474|  29.0k|                if(ps_svc_lyr_dec->u1_layer_identifier != TARGET_LAYER)
  ------------------
  |  |  110|  29.0k|#define TARGET_LAYER 2
  ------------------
  |  Branch (2474:20): [True: 0, False: 29.0k]
  ------------------
 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|  29.0k|                else
 2482|  29.0k|                {
 2483|  29.0k|                    ithread_create(ps_dec->pv_dec_thread_handle, NULL,
 2484|  29.0k|                                   (void *) ih264d_decode_picture_thread, (void *) ps_dec);
 2485|       |
 2486|  29.0k|                    ps_dec->u4_dec_thread_created = 1;
 2487|  29.0k|                }
 2488|  29.0k|            }
 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|  29.0k|        }
 2515|  99.2k|    }
 2516|       |
 2517|       |    /* INITIALIZATION of fn ptrs for MC and formMbPartInfo functions */
 2518|   102k|    {
 2519|   102k|        UWORD8 uc_nofield_nombaff;
 2520|       |
 2521|   102k|        uc_nofield_nombaff =
 2522|   102k|            ((ps_dec->ps_cur_slice->u1_field_pic_flag == 0) &&
  ------------------
  |  Branch (2522:14): [True: 102k, False: 0]
  ------------------
 2523|   102k|             (ps_dec->ps_cur_slice->u1_mbaff_frame_flag == 0) && (u1_slice_type != B_SLICE) &&
  ------------------
  |  |  369|   102k|#define B_SLICE  1
  ------------------
  |  Branch (2523:14): [True: 102k, False: 0]
  |  Branch (2523:66): [True: 72.1k, False: 29.9k]
  ------------------
 2524|  72.1k|             (ps_dec->ps_cur_pps->u1_wted_pred_flag == 0));
  ------------------
  |  Branch (2524:14): [True: 49.4k, False: 22.7k]
  ------------------
 2525|       |
 2526|       |        /* Initialise MC and formMbPartInfo fn ptrs one time based on profile_idc */
 2527|       |
 2528|   102k|        if(uc_nofield_nombaff)
  ------------------
  |  Branch (2528:12): [True: 49.4k, False: 52.6k]
  ------------------
 2529|  49.4k|        {
 2530|  49.4k|            ps_dec->p_form_mb_part_info = ih264d_form_mb_part_info_bp;
 2531|  49.4k|            ps_dec->p_motion_compensate = ih264d_motion_compensate_bp;
 2532|  49.4k|        }
 2533|  52.6k|        else
 2534|  52.6k|        {
 2535|  52.6k|            ps_dec->p_form_mb_part_info = ih264d_form_mb_part_info_mp;
 2536|  52.6k|            ps_dec->p_motion_compensate = ih264d_motion_compensate_mp;
 2537|  52.6k|        }
 2538|   102k|    }
 2539|       |
 2540|       |    /*
 2541|       |     * Decide whether to decode the current picture or not
 2542|       |     */
 2543|   102k|    {
 2544|   102k|        dec_err_status_t *ps_err = ps_dec->ps_dec_err_status;
 2545|   102k|        if(ps_err->u4_frm_sei_sync == u2_frame_num)
  ------------------
  |  Branch (2545:12): [True: 68, False: 102k]
  ------------------
 2546|     68|        {
 2547|     68|            ps_err->u1_err_flag = ACCEPT_ALL_PICS;
  ------------------
  |  |  601|     68|#define ACCEPT_ALL_PICS   (0x00)
  ------------------
 2548|     68|            ps_err->u4_frm_sei_sync = SYNC_FRM_DEFAULT;
  ------------------
  |  |  610|     68|#define SYNC_FRM_DEFAULT  (0xFFFFFFFF)
  ------------------
 2549|     68|        }
 2550|   102k|        ps_err->u4_cur_frm = u2_frame_num;
 2551|   102k|    }
 2552|       |
 2553|       |    /* Decision for decoding if the picture is to be skipped */
 2554|   102k|    {
 2555|   102k|        WORD32 i4_skip_b_pic, i4_skip_p_pic;
 2556|       |
 2557|   102k|        i4_skip_b_pic = (ps_dec->u4_skip_frm_mask & B_SLC_BIT) && (B_SLICE == u1_slice_type) &&
  ------------------
  |  |  378|   102k|#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: 102k]
  |  Branch (2557:67): [True: 0, False: 0]
  ------------------
 2558|      0|                        (0 == u1_nal_ref_idc);
  ------------------
  |  Branch (2558:25): [True: 0, False: 0]
  ------------------
 2559|       |
 2560|   102k|        i4_skip_p_pic = (ps_dec->u4_skip_frm_mask & P_SLC_BIT) && (P_SLICE == u1_slice_type) &&
  ------------------
  |  |  377|   102k|#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: 102k]
  |  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|   102k|        if(i4_skip_b_pic)
  ------------------
  |  Branch (2568:12): [True: 0, False: 102k]
  ------------------
 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|   102k|        if(i4_skip_p_pic)
  ------------------
  |  Branch (2582:12): [True: 0, False: 102k]
  ------------------
 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|   102k|    }
 2592|       |
 2593|   102k|    {
 2594|   102k|        UWORD16 u2_mb_x, u2_mb_y;
 2595|       |
 2596|   102k|        ps_dec->i4_submb_ofst =
 2597|   102k|            ((u2_first_mb_in_slice << ps_cur_slice->u1_mbaff_frame_flag) * SUB_BLK_SIZE) -
  ------------------
  |  |  562|   102k|#define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|   102k|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  |  |               #define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|   102k|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  ------------------
 2598|   102k|            SUB_BLK_SIZE;
  ------------------
  |  |  562|   102k|#define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|   102k|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  |  |               #define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|   102k|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  ------------------
 2599|   102k|        if(u2_first_mb_in_slice)
  ------------------
  |  Branch (2599:12): [True: 2.93k, False: 99.2k]
  ------------------
 2600|  2.93k|        {
 2601|  2.93k|            UWORD8 u1_mb_aff;
 2602|  2.93k|            UWORD8 u1_field_pic;
 2603|  2.93k|            UWORD16 u2_frm_wd_in_mbs;
 2604|  2.93k|            u2_frm_wd_in_mbs = ps_seq->u2_frm_wd_in_mbs;
 2605|  2.93k|            u1_mb_aff = ps_cur_slice->u1_mbaff_frame_flag;
 2606|  2.93k|            u1_field_pic = ps_cur_slice->u1_field_pic_flag;
 2607|       |
 2608|  2.93k|            {
 2609|  2.93k|                UWORD32 x_offset;
 2610|  2.93k|                UWORD32 y_offset;
 2611|  2.93k|                UWORD32 u4_frame_stride;
 2612|  2.93k|                tfr_ctxt_t *ps_trns_addr;
 2613|       |
 2614|  2.93k|                if(ps_dec->u1_separate_parse)
  ------------------
  |  Branch (2614:20): [True: 1.29k, False: 1.64k]
  ------------------
 2615|  1.29k|                {
 2616|  1.29k|                    ps_trns_addr = &ps_dec->s_tran_addrecon_parse;
 2617|  1.29k|                }
 2618|  1.64k|                else
 2619|  1.64k|                {
 2620|  1.64k|                    ps_trns_addr = &ps_dec->s_tran_addrecon;
 2621|  1.64k|                }
 2622|  2.93k|                u2_mb_x = MOD(u2_first_mb_in_slice, u2_frm_wd_in_mbs);
  ------------------
  |  |   64|  2.93k|#define MOD(x,y) ((x)%(y))
  ------------------
 2623|  2.93k|                u2_mb_y = DIV(u2_first_mb_in_slice, u2_frm_wd_in_mbs);
  ------------------
  |  |   65|  2.93k|#define DIV(x,y) ((x)/(y))
  ------------------
 2624|       |
 2625|  2.93k|                u2_mb_y <<= u1_mb_aff;
 2626|       |
 2627|  2.93k|                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: 2.93k]
  |  Branch (2627:56): [True: 84, False: 2.84k]
  ------------------
 2628|     84|                {
 2629|     84|                    return ERROR_CORRUPTED_SLICE;
 2630|     84|                }
 2631|       |
 2632|  2.84k|                u4_frame_stride = ps_dec->u2_frm_wd_y << u1_field_pic;
 2633|  2.84k|                x_offset = u2_mb_x << 4;
 2634|  2.84k|                y_offset = (u2_mb_y * u4_frame_stride) << 4;
 2635|       |
 2636|  2.84k|                ps_trns_addr->pu1_dest_y = ps_dec->s_cur_pic.pu1_buf1 + x_offset + y_offset;
 2637|       |
 2638|  2.84k|                u4_frame_stride = ps_dec->u2_frm_wd_uv << u1_field_pic;
 2639|  2.84k|                x_offset >>= 1;
 2640|  2.84k|                y_offset = (u2_mb_y * u4_frame_stride) << 3;
 2641|       |
 2642|  2.84k|                x_offset *= YUV420SP_FACTOR;
  ------------------
  |  |  119|  2.84k|#define YUV420SP_FACTOR 2
  ------------------
 2643|       |
 2644|  2.84k|                ps_trns_addr->pu1_dest_u = ps_dec->s_cur_pic.pu1_buf2 + x_offset + y_offset;
 2645|  2.84k|                ps_trns_addr->pu1_dest_v = ps_dec->s_cur_pic.pu1_buf3 + x_offset + y_offset;
 2646|       |
 2647|  2.84k|                ps_trns_addr->pu1_mb_y = ps_trns_addr->pu1_dest_y;
 2648|  2.84k|                ps_trns_addr->pu1_mb_u = ps_trns_addr->pu1_dest_u;
 2649|  2.84k|                ps_trns_addr->pu1_mb_v = ps_trns_addr->pu1_dest_v;
 2650|       |
 2651|       |                /* assign the deblock structure pointers to start of slice */
 2652|  2.84k|                if(ps_dec->u1_separate_parse == 1)
  ------------------
  |  Branch (2652:20): [True: 1.22k, False: 1.62k]
  ------------------
 2653|  1.22k|                {
 2654|  1.22k|                    ps_dec->ps_deblk_mbn =
 2655|  1.22k|                        ps_dec->ps_deblk_pic + (u2_first_mb_in_slice << u1_mb_aff);
 2656|  1.22k|                }
 2657|  1.62k|                else
 2658|  1.62k|                {
 2659|  1.62k|                    ps_dec->ps_deblk_mbn =
 2660|  1.62k|                        ps_dec->ps_deblk_pic + (u2_first_mb_in_slice << u1_mb_aff);
 2661|  1.62k|                }
 2662|       |
 2663|  2.84k|                ps_dec->u4_cur_mb_addr = (u2_first_mb_in_slice << u1_mb_aff);
 2664|       |
 2665|  2.84k|                ps_dec->ps_mv_cur =
 2666|  2.84k|                    ps_dec->s_cur_pic.ps_mv + ((u2_first_mb_in_slice << u1_mb_aff) << 4);
 2667|  2.84k|            }
 2668|  2.84k|        }
 2669|  99.2k|        else
 2670|  99.2k|        {
 2671|  99.2k|            tfr_ctxt_t *ps_trns_addr;
 2672|       |
 2673|  99.2k|            if(ps_dec->u1_separate_parse)
  ------------------
  |  Branch (2673:16): [True: 29.0k, False: 70.1k]
  ------------------
 2674|  29.0k|            {
 2675|  29.0k|                ps_trns_addr = &ps_dec->s_tran_addrecon_parse;
 2676|  29.0k|            }
 2677|  70.1k|            else
 2678|  70.1k|            {
 2679|  70.1k|                ps_trns_addr = &ps_dec->s_tran_addrecon;
 2680|  70.1k|            }
 2681|       |
 2682|  99.2k|            u2_mb_x = 0xffff;
 2683|  99.2k|            u2_mb_y = 0;
 2684|       |            // assign the deblock structure pointers to start of slice
 2685|  99.2k|            ps_dec->u4_cur_mb_addr = 0;
 2686|  99.2k|            ps_dec->ps_deblk_mbn = ps_dec->ps_deblk_pic;
 2687|  99.2k|            ps_dec->ps_mv_cur = ps_dec->s_cur_pic.ps_mv;
 2688|  99.2k|            ps_trns_addr->pu1_dest_y = ps_dec->s_cur_pic.pu1_buf1;
 2689|  99.2k|            ps_trns_addr->pu1_dest_u = ps_dec->s_cur_pic.pu1_buf2;
 2690|  99.2k|            ps_trns_addr->pu1_dest_v = ps_dec->s_cur_pic.pu1_buf3;
 2691|       |
 2692|  99.2k|            ps_trns_addr->pu1_mb_y = ps_trns_addr->pu1_dest_y;
 2693|  99.2k|            ps_trns_addr->pu1_mb_u = ps_trns_addr->pu1_dest_u;
 2694|  99.2k|            ps_trns_addr->pu1_mb_v = ps_trns_addr->pu1_dest_v;
 2695|  99.2k|        }
 2696|       |
 2697|   102k|        ps_dec->ps_part = ps_dec->ps_parse_part_params;
 2698|       |
 2699|   102k|        ps_dec->u2_mbx = (MOD(u2_first_mb_in_slice - 1, ps_seq->u2_frm_wd_in_mbs));
  ------------------
  |  |   64|   102k|#define MOD(x,y) ((x)%(y))
  ------------------
 2700|   102k|        ps_dec->u2_mby = (DIV(u2_first_mb_in_slice - 1, ps_seq->u2_frm_wd_in_mbs));
  ------------------
  |  |   65|   102k|#define DIV(x,y) ((x)/(y))
  ------------------
 2701|   102k|        ps_dec->u2_mby <<= ps_cur_slice->u1_mbaff_frame_flag;
 2702|   102k|        ps_dec->i2_prev_slice_mbx = (WORD16) ps_dec->u2_mbx;
 2703|   102k|        ps_dec->i2_prev_slice_mby = (WORD16) ps_dec->u2_mby;
 2704|   102k|    }
 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|   102k|    ps_dec->u1_B = (u1_slice_type == B_SLICE);
  ------------------
  |  |  369|   102k|#define B_SLICE  1
  ------------------
 2710|   102k|    ps_dec->u4_next_mb_skip = 0;
 2711|       |
 2712|   102k|    ps_dec->ps_parse_cur_slice->u4_first_mb_in_slice = ps_dec->ps_cur_slice->u2_first_mb_in_slice;
 2713|   102k|    ps_dec->ps_parse_cur_slice->slice_type = ps_dec->ps_cur_slice->u1_slice_type;
 2714|       |
 2715|   102k|    ps_dec->u4_start_recon_deblk = 1;
 2716|   102k|    {
 2717|   102k|        WORD32 num_entries;
 2718|   102k|        WORD32 size;
 2719|   102k|        UWORD8 *pu1_buf;
 2720|       |
 2721|   102k|        num_entries = MAX_FRAMES;
  ------------------
  |  |  600|   102k|#define MAX_FRAMES              16
  ------------------
 2722|   102k|        if((1 >= ps_dec->ps_cur_sps->u1_num_ref_frames) && (0 == ps_dec->i4_display_delay))
  ------------------
  |  Branch (2722:12): [True: 82.4k, False: 19.6k]
  |  Branch (2722:60): [True: 0, False: 82.4k]
  ------------------
 2723|      0|        {
 2724|      0|            num_entries = 1;
 2725|      0|        }
 2726|   102k|        num_entries = ((2 * num_entries) + 1);
 2727|   102k|        num_entries *= 2;
 2728|       |
 2729|   102k|        size = num_entries * sizeof(void *);
 2730|   102k|        size += PAD_MAP_IDX_POC * sizeof(void *);
  ------------------
  |  |  100|   102k|#define PAD_MAP_IDX_POC             (1)
  ------------------
 2731|       |
 2732|   102k|        pu1_buf = (UWORD8 *) ps_dec->pv_map_ref_idx_to_poc_buf;
 2733|   102k|        pu1_buf += size * ps_dec->u2_cur_slice_num;
 2734|   102k|        ps_dec->ps_parse_cur_slice->ppv_map_ref_idx_to_poc = (void *) pu1_buf;
 2735|   102k|    }
 2736|       |
 2737|   102k|    if(ps_dec->u1_separate_parse)
  ------------------
  |  Branch (2737:8): [True: 30.2k, False: 71.7k]
  ------------------
 2738|  30.2k|    {
 2739|  30.2k|        ps_dec->ps_parse_cur_slice->pv_tu_coeff_data_start = ps_dec->pv_parse_tu_coeff_data;
 2740|  30.2k|    }
 2741|  71.7k|    else
 2742|  71.7k|    {
 2743|  71.7k|        ps_dec->pv_proc_tu_coeff_data = ps_dec->pv_parse_tu_coeff_data;
 2744|  71.7k|    }
 2745|       |
 2746|   102k|    ret = ih264d_fix_error_in_dpb(ps_dec);
 2747|   102k|    if(ret < 0) return ERROR_DBP_MANAGER_T;
  ------------------
  |  Branch (2747:8): [True: 0, False: 102k]
  ------------------
 2748|       |
 2749|   102k|    if(u1_slice_type == I_SLICE)
  ------------------
  |  |  370|   102k|#define I_SLICE  2
  ------------------
  |  Branch (2749:8): [True: 7.51k, False: 94.5k]
  ------------------
 2750|  7.51k|    {
 2751|  7.51k|        ps_dec->ps_cur_pic->u4_pack_slc_typ |= I_SLC_BIT;
  ------------------
  |  |  376|  7.51k|#define I_SLC_BIT  (0x1)
  ------------------
 2752|       |
 2753|  7.51k|        ret = isvcd_parse_islice(ps_svc_lyr_dec, u2_first_mb_in_slice);
 2754|  7.51k|        ps_dec->u1_pr_sl_type = u1_slice_type;
 2755|  7.51k|        if(ps_dec->i4_pic_type != B_SLICE && ps_dec->i4_pic_type != P_SLICE)
  ------------------
  |  |  369|  15.0k|#define B_SLICE  1
  ------------------
                      if(ps_dec->i4_pic_type != B_SLICE && ps_dec->i4_pic_type != P_SLICE)
  ------------------
  |  |  368|  7.40k|#define P_SLICE  0
  ------------------
  |  Branch (2755:12): [True: 7.40k, False: 108]
  |  Branch (2755:46): [True: 6.63k, False: 775]
  ------------------
 2756|  6.63k|            ps_dec->i4_pic_type = I_SLICE;
  ------------------
  |  |  370|  6.63k|#define I_SLICE  2
  ------------------
 2757|  7.51k|    }
 2758|  94.5k|    else if(u1_slice_type == P_SLICE)
  ------------------
  |  |  368|  94.5k|#define P_SLICE  0
  ------------------
  |  Branch (2758:13): [True: 64.1k, False: 30.3k]
  ------------------
 2759|  64.1k|    {
 2760|  64.1k|        ps_dec->ps_cur_pic->u4_pack_slc_typ |= P_SLC_BIT;
  ------------------
  |  |  377|  64.1k|#define P_SLC_BIT  (0x2)
  ------------------
 2761|  64.1k|        ret = isvcd_parse_pslice(ps_svc_lyr_dec, u2_first_mb_in_slice);
 2762|  64.1k|        ps_dec->u1_pr_sl_type = u1_slice_type;
 2763|  64.1k|        if(ps_dec->i4_pic_type != B_SLICE) ps_dec->i4_pic_type = P_SLICE;
  ------------------
  |  |  369|  64.1k|#define B_SLICE  1
  ------------------
                      if(ps_dec->i4_pic_type != B_SLICE) ps_dec->i4_pic_type = P_SLICE;
  ------------------
  |  |  368|  63.9k|#define P_SLICE  0
  ------------------
  |  Branch (2763:12): [True: 63.9k, False: 298]
  ------------------
 2764|  64.1k|    }
 2765|  30.3k|    else if(u1_slice_type == B_SLICE)
  ------------------
  |  |  369|  30.3k|#define B_SLICE  1
  ------------------
  |  Branch (2765:13): [True: 29.9k, False: 434]
  ------------------
 2766|  29.9k|    {
 2767|  29.9k|        ps_dec->ps_cur_pic->u4_pack_slc_typ |= B_SLC_BIT;
  ------------------
  |  |  378|  29.9k|#define B_SLC_BIT  (0x4)
  ------------------
 2768|  29.9k|        ret = isvcd_parse_bslice(ps_svc_lyr_dec, u2_first_mb_in_slice);
 2769|  29.9k|        ps_dec->u1_pr_sl_type = u1_slice_type;
 2770|  29.9k|        ps_dec->i4_pic_type = B_SLICE;
  ------------------
  |  |  369|  29.9k|#define B_SLICE  1
  ------------------
 2771|  29.9k|    }
 2772|    434|    else
 2773|    434|        return ERROR_INV_SLC_TYPE_T;
 2774|       |
 2775|   101k|    if(ps_dec->u1_slice_header_done)
  ------------------
  |  Branch (2775:8): [True: 79.3k, False: 22.2k]
  ------------------
 2776|  79.3k|    {
 2777|       |        /* set to zero to indicate a valid slice has been decoded */
 2778|  79.3k|        ps_dec->u1_first_slice_in_stream = 0;
 2779|  79.3k|    }
 2780|       |
 2781|   101k|    if(ret != OK) return ret;
  ------------------
  |  |  114|   101k|#define OK        0
  ------------------
  |  Branch (2781:8): [True: 48.2k, False: 53.3k]
  ------------------
 2782|       |
 2783|  53.3k|    if(u1_nal_ref_idc != 0)
  ------------------
  |  Branch (2783:8): [True: 48.1k, False: 5.22k]
  ------------------
 2784|  48.1k|    {
 2785|  48.1k|        if(!ps_dec->ps_dpb_cmds->u1_dpb_commands_read)
  ------------------
  |  Branch (2785:12): [True: 47.3k, False: 781]
  ------------------
 2786|  47.3k|        {
 2787|  47.3k|            memcpy((void *) ps_dec->ps_dpb_cmds, (void *) (&(ps_dec->s_dpb_cmds_scratch)),
 2788|  47.3k|                   sizeof(dpb_commands_t));
 2789|  47.3k|        }
 2790|  48.1k|    }
 2791|       |
 2792|       |    /* storing last Mb X and MbY of the slice */
 2793|  53.3k|    ps_dec->i2_prev_slice_mbx = ps_dec->u2_mbx;
 2794|  53.3k|    ps_dec->i2_prev_slice_mby = ps_dec->u2_mby;
 2795|       |
 2796|       |    /* End of Picture detection */
 2797|       |
 2798|  53.3k|    if(ps_dec->u4_total_mbs_coded >= (ps_seq->u4_max_mb_addr + 1))
  ------------------
  |  Branch (2798:8): [True: 25.6k, False: 27.7k]
  ------------------
 2799|  25.6k|    {
 2800|  25.6k|        ps_dec->u1_pic_decode_done = 1;
 2801|  25.6k|    }
 2802|       |
 2803|  53.3k|    {
 2804|  53.3k|        dec_err_status_t *ps_err = ps_dec->ps_dec_err_status;
 2805|  53.3k|        if((ps_err->u1_err_flag & REJECT_PB_PICS) && (ps_err->u1_cur_pic_type == PIC_TYPE_I))
  ------------------
  |  |  603|  53.3k|#define REJECT_PB_PICS    (0x02)
  ------------------
                      if((ps_err->u1_err_flag & REJECT_PB_PICS) && (ps_err->u1_cur_pic_type == PIC_TYPE_I))
  ------------------
  |  |  609|      0|#define PIC_TYPE_I        (0x00)
  ------------------
  |  Branch (2805:12): [True: 0, False: 53.3k]
  |  Branch (2805:54): [True: 0, False: 0]
  ------------------
 2806|      0|        {
 2807|      0|            ps_err->u1_err_flag = ACCEPT_ALL_PICS;
  ------------------
  |  |  601|      0|#define ACCEPT_ALL_PICS   (0x00)
  ------------------
 2808|      0|        }
 2809|  53.3k|    }
 2810|       |
 2811|  53.3k|    PRINT_BIN_BIT_RATIO(ps_dec)
 2812|       |
 2813|  53.3k|    return ret;
 2814|   101k|}

isvcd_pred_residual_recon_chroma_8x8:
   88|   151k|{
   89|   151k|    UWORD8 *pu1_pred_ptr = pu1_pred;
   90|   151k|    WORD16 *pi2_rsd_ptr = pi2_rsd;
   91|   151k|    UWORD8 *pu1_out_ptr = pu1_out;
   92|   151k|    WORD16 i, j;
   93|   151k|    WORD16 i_macro;
   94|       |
   95|  1.36M|    for(i = 0; i < 8; i++)
  ------------------
  |  Branch (95:16): [True: 1.21M, False: 151k]
  ------------------
   96|  1.21M|    {
   97|  1.21M|        pu1_pred_ptr = pu1_pred;
   98|  1.21M|        pi2_rsd_ptr = pi2_rsd;
   99|  1.21M|        pu1_out = pu1_out_ptr;
  100|       |
  101|  10.9M|        for(j = 0; j < 8; j++)
  ------------------
  |  Branch (101:20): [True: 9.70M, False: 1.21M]
  ------------------
  102|  9.70M|        {
  103|  9.70M|            i_macro = *pu1_pred_ptr + *pi2_rsd_ptr;
  104|  9.70M|            *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|  9.70M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  9.70M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 130k, False: 9.57M]
  |  |  |  |  |  Branch (77:54): [True: 3.28k, False: 9.56M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  105|  9.70M|            pu1_pred_ptr += pred_strd;
  106|  9.70M|            pi2_rsd_ptr += rsd_strd;
  107|  9.70M|            pu1_out += out_strd;
  108|  9.70M|        }
  109|       |
  110|  1.21M|        pu1_out_ptr += 2;  // Interleaved store for output
  111|  1.21M|        pu1_pred += 2;     // Interleaved load for pred buffer
  112|  1.21M|        pi2_rsd += 2;
  113|  1.21M|    }
  114|   151k|}
isvcd_pred_residual_recon_chroma_4x4:
  190|  21.3k|{
  191|  21.3k|    UWORD8 *pu1_pred_ptr = pu1_pred;
  192|  21.3k|    WORD16 *pi2_rsd_ptr = pi2_rsd;
  193|  21.3k|    UWORD8 *pu1_out_ptr = pu1_out;
  194|  21.3k|    WORD16 i, j;
  195|  21.3k|    WORD16 i_macro;
  196|       |
  197|   106k|    for(i = 0; i < 4; i++)
  ------------------
  |  Branch (197:16): [True: 85.4k, False: 21.3k]
  ------------------
  198|  85.4k|    {
  199|  85.4k|        pu1_pred_ptr = pu1_pred;
  200|  85.4k|        pi2_rsd_ptr = pi2_rsd;
  201|  85.4k|        pu1_out = pu1_out_ptr;
  202|       |
  203|   427k|        for(j = 0; j < 4; j++)
  ------------------
  |  Branch (203:20): [True: 341k, False: 85.4k]
  ------------------
  204|   341k|        {
  205|   341k|            i_macro = *pu1_pred_ptr + *pi2_rsd_ptr;
  206|   341k|            *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   341k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   341k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 4.62k, False: 337k]
  |  |  |  |  |  Branch (77:54): [True: 266, False: 337k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  207|   341k|            pu1_pred_ptr += pred_strd;
  208|   341k|            pi2_rsd_ptr += rsd_strd;
  209|   341k|            pu1_out += out_strd;
  210|   341k|        }
  211|       |
  212|  85.4k|        pu1_out_ptr += 2;  // Interleaved store for output
  213|  85.4k|        pu1_pred += 2;     // Interleaved load for pred buffer
  214|  85.4k|        pi2_rsd += 2;
  215|  85.4k|    }
  216|  21.3k|}
isvcd_pred_residual_recon_16x16:
  242|  68.9k|{
  243|  68.9k|    WORD32 i4_nnz = 0, i4_nnz_blk[4][4] = {0};
  244|  68.9k|    UWORD8 *pu1_pred_ptr = pu1_pred;
  245|  68.9k|    WORD16 *pi2_rsd_ptr = pi2_rsd;
  246|  68.9k|    UWORD8 *pu1_out_ptr = pu1_out;
  247|  68.9k|    WORD16 i, j;
  248|  68.9k|    WORD16 i_macro;
  249|       |
  250|  1.17M|    for(i = 0; i < 16; i++)
  ------------------
  |  Branch (250:16): [True: 1.10M, False: 68.9k]
  ------------------
  251|  1.10M|    {
  252|  1.10M|        pu1_pred_ptr = pu1_pred;
  253|  1.10M|        pi2_rsd_ptr = pi2_rsd;
  254|  1.10M|        pu1_out = pu1_out_ptr;
  255|       |
  256|  18.7M|        for(j = 0; j < 16; j++)
  ------------------
  |  Branch (256:20): [True: 17.6M, False: 1.10M]
  ------------------
  257|  17.6M|        {
  258|  17.6M|            i_macro = *pi2_rsd_ptr;
  259|  17.6M|            i4_nnz_blk[j >> 2][i >> 2] |= !!i_macro;
  260|  17.6M|            i_macro += *pu1_pred_ptr;
  261|  17.6M|            *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|  17.6M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  17.6M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 68.2k, False: 17.5M]
  |  |  |  |  |  Branch (77:54): [True: 5.22k, False: 17.5M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  262|  17.6M|            pu1_pred_ptr += pred_strd;
  263|  17.6M|            pi2_rsd_ptr += rsd_strd;
  264|  17.6M|            pu1_out += out_strd;
  265|  17.6M|        }
  266|       |
  267|  1.10M|        pu1_out_ptr++;
  268|  1.10M|        pi2_rsd++;
  269|  1.10M|        pu1_pred++;
  270|  1.10M|    }
  271|       |
  272|   344k|    for(i = 0; i < 4; i++)
  ------------------
  |  Branch (272:16): [True: 275k, False: 68.9k]
  ------------------
  273|   275k|    {
  274|  1.37M|        for(j = 0; j < 4; j++)
  ------------------
  |  Branch (274:20): [True: 1.10M, False: 275k]
  ------------------
  275|  1.10M|        {
  276|  1.10M|            i4_nnz |= (i4_nnz_blk[j][i]) << (i + (j << 2));
  277|  1.10M|        }
  278|   275k|    }
  279|       |
  280|  68.9k|    return i4_nnz;
  281|  68.9k|}
isvcd_pred_residual_recon_4x4:
  307|   103k|{
  308|   103k|    WORD32 i4_nnz_blk[4][4] = {0};
  309|   103k|    UWORD8 *pu1_pred_ptr = pu1_pred;
  310|   103k|    WORD16 *pi2_rsd_ptr = pi2_rsd;
  311|   103k|    UWORD8 *pu1_out_ptr = pu1_out;
  312|   103k|    WORD16 i, j;
  313|   103k|    WORD16 i_macro;
  314|       |
  315|   518k|    for(i = 0; i < 4; i++)
  ------------------
  |  Branch (315:16): [True: 414k, False: 103k]
  ------------------
  316|   414k|    {
  317|   414k|        pu1_pred_ptr = pu1_pred;
  318|   414k|        pi2_rsd_ptr = pi2_rsd;
  319|   414k|        pu1_out = pu1_out_ptr;
  320|       |
  321|  2.07M|        for(j = 0; j < 4; j++)
  ------------------
  |  Branch (321:20): [True: 1.65M, False: 414k]
  ------------------
  322|  1.65M|        {
  323|  1.65M|            i_macro = *pi2_rsd_ptr;
  324|  1.65M|            i4_nnz_blk[j >> 2][i >> 2] |= !!i_macro;
  325|  1.65M|            i_macro += *pu1_pred_ptr;
  326|  1.65M|            *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|  1.65M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  1.65M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 16.0k, False: 1.64M]
  |  |  |  |  |  Branch (77:54): [True: 2.44k, False: 1.63M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  327|  1.65M|            pu1_pred_ptr += pred_strd;
  328|  1.65M|            pi2_rsd_ptr += rsd_strd;
  329|  1.65M|            pu1_out += out_strd;
  330|  1.65M|        }
  331|       |
  332|   414k|        pu1_out_ptr++;
  333|   414k|        pi2_rsd++;
  334|   414k|        pu1_pred++;
  335|   414k|    }
  336|       |
  337|   103k|    return i4_nnz_blk[0][0];
  338|   103k|}
isvcd_pred_residual_recon_8x8:
  364|  8.89k|{
  365|  8.89k|    WORD32 i4_nnz = 0, i4_nnz_blk[4][4] = {0};
  366|  8.89k|    UWORD8 *pu1_pred_ptr = pu1_pred;
  367|  8.89k|    WORD16 *pi2_rsd_ptr = pi2_rsd;
  368|  8.89k|    UWORD8 *pu1_out_ptr = pu1_out;
  369|  8.89k|    WORD16 i, j;
  370|  8.89k|    WORD16 i_macro;
  371|       |
  372|  80.0k|    for(i = 0; i < 8; i++)
  ------------------
  |  Branch (372:16): [True: 71.1k, False: 8.89k]
  ------------------
  373|  71.1k|    {
  374|  71.1k|        pu1_pred_ptr = pu1_pred;
  375|  71.1k|        pi2_rsd_ptr = pi2_rsd;
  376|  71.1k|        pu1_out = pu1_out_ptr;
  377|       |
  378|   640k|        for(j = 0; j < 8; j++)
  ------------------
  |  Branch (378:20): [True: 569k, False: 71.1k]
  ------------------
  379|   569k|        {
  380|   569k|            i_macro = *pi2_rsd_ptr;
  381|   569k|            i4_nnz_blk[j >> 2][i >> 2] |= !!i_macro;
  382|   569k|            i_macro += *pu1_pred_ptr;
  383|   569k|            *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   569k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   569k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 14.4k, False: 555k]
  |  |  |  |  |  Branch (77:54): [True: 2.61k, False: 552k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  384|   569k|            pu1_pred_ptr += pred_strd;
  385|   569k|            pi2_rsd_ptr += rsd_strd;
  386|   569k|            pu1_out += out_strd;
  387|   569k|        }
  388|       |
  389|  71.1k|        pu1_out_ptr++;
  390|  71.1k|        pi2_rsd++;
  391|  71.1k|        pu1_pred++;
  392|  71.1k|    }
  393|       |
  394|  8.89k|    i4_nnz = i4_nnz_blk[0][0] | (i4_nnz_blk[1][0] << 4);
  395|  8.89k|    i4_nnz |= (i4_nnz_blk[0][1] << 1) | (i4_nnz_blk[1][1] << 5);
  396|       |
  397|  8.89k|    return i4_nnz;
  398|  8.89k|}

isvcd_one_to_one:
   72|  78.3k|{
   73|  78.3k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
   74|  78.3k|    UWORD8 *pu1_col_zero_flag_start, u1_col_mb_pred_mode, u1_num_blks, u1_sub_mb_num;
   75|  78.3k|    UWORD8 u1_init_colzero_flag;
   76|  78.3k|    UNUSED(ps_cur_mb_info);
  ------------------
  |  |   45|  78.3k|#define UNUSED(x) ((void)(x))
  ------------------
   77|  78.3k|    pu1_col_zero_flag_start = ps_col_pic->pu1_col_zero_flag + u2_sub_mb_ofst;
   78|  78.3k|    u1_col_mb_pred_mode = pu1_col_zero_flag_start[ps_dec->u1_sub_mb_num];
   79|  78.3k|    u1_init_colzero_flag = u1_col_mb_pred_mode & 1;
   80|  78.3k|    u1_col_mb_pred_mode >>= 6;
   81|  78.3k|    ps_direct->u1_vert_mv_scale = ONE_TO_ONE;
  ------------------
  |  |   47|  78.3k|#define ONE_TO_ONE    0
  ------------------
   82|  78.3k|    ps_direct->u1_col_zeroflag_change = (ps_svc_lyr_dec->u1_base_res_flag) ? 0 : 1;
  ------------------
  |  Branch (82:41): [True: 0, False: 78.3k]
  ------------------
   83|       |
   84|  78.3k|    if(u1_wd_x == MB_SIZE)
  ------------------
  |  |  554|  78.3k|#define MB_SIZE             16
  ------------------
  |  Branch (84:8): [True: 74.2k, False: 4.10k]
  ------------------
   85|  74.2k|    {
   86|  74.2k|        ps_dec->u1_currB_type = (!!u1_col_mb_pred_mode);
   87|  74.2k|        if(u1_col_mb_pred_mode == PRED_16x16)
  ------------------
  |  |  450|  74.2k|#define PRED_16x16  0
  ------------------
  |  Branch (87:12): [True: 69.9k, False: 4.29k]
  ------------------
   88|  69.9k|        {
   89|  69.9k|            ps_direct->i1_num_partitions = 1;
   90|  69.9k|            ps_direct->i4_mv_indices[0] = u2_sub_mb_ofst;
   91|  69.9k|            ps_direct->i1_submb_num[0] = 0;
   92|  69.9k|            ps_direct->i1_partitionsize[0] = PRED_16x16;
  ------------------
  |  |  450|  69.9k|#define PRED_16x16  0
  ------------------
   93|       |
   94|  69.9k|            return;
   95|  69.9k|        }
   96|  4.29k|        else if(u1_col_mb_pred_mode < PRED_8x8)
  ------------------
  |  |  453|  4.29k|#define PRED_8x8    3
  ------------------
  |  Branch (96:17): [True: 2.21k, False: 2.08k]
  ------------------
   97|  2.21k|        {
   98|  2.21k|            ps_direct->i1_num_partitions = 2;
   99|  2.21k|            ps_direct->i4_mv_indices[0] = u2_sub_mb_ofst;
  100|  2.21k|            ps_direct->i1_submb_num[0] = 0;
  101|  2.21k|            ps_direct->i1_partitionsize[0] = u1_col_mb_pred_mode;
  102|  2.21k|            u1_sub_mb_num = (u1_col_mb_pred_mode == PRED_16x8) ? 8 : 2;
  ------------------
  |  |  451|  2.21k|#define PRED_16x8   1
  ------------------
  |  Branch (102:29): [True: 1.61k, False: 600]
  ------------------
  103|  2.21k|            ps_direct->i1_submb_num[1] = u1_sub_mb_num;
  104|  2.21k|            ps_direct->i4_mv_indices[1] = u2_sub_mb_ofst + ps_direct->i1_submb_num[1];
  105|  2.21k|            ps_direct->i1_partitionsize[1] = u1_col_mb_pred_mode;
  106|  2.21k|            if((pu1_col_zero_flag_start[u1_sub_mb_num] & 1) != u1_init_colzero_flag)
  ------------------
  |  Branch (106:16): [True: 530, False: 1.68k]
  ------------------
  107|    530|                ps_direct->u1_col_zeroflag_change = 1;
  108|  2.21k|            return;
  109|  2.21k|        }
  110|  2.08k|        else
  111|  2.08k|        {
  112|  2.08k|            u1_num_blks = 4;
  113|  2.08k|        }
  114|  74.2k|    }
  115|  4.10k|    else
  116|  4.10k|    {
  117|  4.10k|        u1_num_blks = 1;
  118|  4.10k|    }
  119|       |
  120|  6.18k|    {
  121|  6.18k|        const UWORD8 *pu1_top_lt_mb_part_idx;
  122|  6.18k|        UWORD8 u1_col_sub_mb_pred_mode, uc_blk, u1_sub_blk, u1_submb_col = 0;
  123|  6.18k|        UWORD8 u1_num_sub_blks, uc_direct8x8inf, *pu1_col_zero_flag, u1_sub_mb_num;
  124|  6.18k|        const UWORD8 *pu1_num_sub_mb_part = (const UWORD8 *) gau1_ih264d_num_submb_part;
  125|  6.18k|        UWORD8 i1_num_partitions = 0, partition_size;
  126|  6.18k|        WORD32 mv_index;
  127|  6.18k|        const UWORD8 *pu1_top_lt_sub_mb_idx = gau1_ih264d_submb_indx_mod_sp_drct;
  128|       |
  129|  6.18k|        u1_sub_mb_num = ps_dec->u1_sub_mb_num;
  130|  6.18k|        uc_direct8x8inf = ps_dec->ps_cur_slice->u1_direct_8x8_inference_flag;
  131|  6.18k|        pu1_top_lt_mb_part_idx = gau1_ih264d_top_left_mb_part_indx_mod + (PRED_8x8 << 1) + 1;
  ------------------
  |  |  453|  6.18k|#define PRED_8x8    3
  ------------------
  132|       |
  133|  18.6k|        for(uc_blk = 0; uc_blk < u1_num_blks; uc_blk++)
  ------------------
  |  Branch (133:25): [True: 12.4k, False: 6.18k]
  ------------------
  134|  12.4k|        {
  135|  12.4k|            partition_size = PRED_8x8;
  ------------------
  |  |  453|  12.4k|#define PRED_8x8    3
  ------------------
  136|  12.4k|            pu1_top_lt_sub_mb_idx = gau1_ih264d_submb_indx_mod_sp_drct;
  137|  12.4k|            if(uc_direct8x8inf == 1)
  ------------------
  |  Branch (137:16): [True: 2.17k, False: 10.2k]
  ------------------
  138|  2.17k|            {
  139|  2.17k|                u1_submb_col = u1_sub_mb_num | (u1_sub_mb_num >> 1);
  140|  2.17k|                mv_index = u2_sub_mb_ofst + u1_submb_col;
  141|  2.17k|                u1_num_sub_blks = 1;
  142|  2.17k|            }
  143|  10.2k|            else
  144|  10.2k|            {
  145|       |                /* colMbPart is either 8x8, 8x4, 4x8, 4x4 */
  146|  10.2k|                pu1_col_zero_flag = pu1_col_zero_flag_start + u1_sub_mb_num;
  147|  10.2k|                u1_col_sub_mb_pred_mode = *pu1_col_zero_flag;
  148|  10.2k|                u1_col_sub_mb_pred_mode = (u1_col_sub_mb_pred_mode & 0x30) >> 4;
  149|  10.2k|                partition_size = (UWORD8) ((u1_col_sub_mb_pred_mode) | (PRED_8x8 << 2));
  ------------------
  |  |  453|  10.2k|#define PRED_8x8    3
  ------------------
  150|  10.2k|                mv_index = u2_sub_mb_ofst + u1_sub_mb_num;
  151|  10.2k|                pu1_top_lt_sub_mb_idx += (u1_col_sub_mb_pred_mode << 1);
  152|  10.2k|                u1_num_sub_blks = pu1_num_sub_mb_part[u1_col_sub_mb_pred_mode];
  153|  10.2k|            }
  154|       |
  155|  26.7k|            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: 14.3k, False: 12.4k]
  ------------------
  156|  14.3k|            {
  157|  14.3k|                u1_sub_mb_num += *pu1_top_lt_sub_mb_idx;
  158|  14.3k|                mv_index += *pu1_top_lt_sub_mb_idx;
  159|  14.3k|                ps_direct->i4_mv_indices[i1_num_partitions] = mv_index;
  160|  14.3k|                ps_direct->i1_submb_num[i1_num_partitions] = u1_sub_mb_num;
  161|  14.3k|                ps_direct->i1_partitionsize[i1_num_partitions] = partition_size;
  162|  14.3k|                i1_num_partitions++;
  163|  14.3k|                if(!uc_direct8x8inf) u1_submb_col = u1_sub_mb_num;
  ------------------
  |  Branch (163:20): [True: 12.1k, False: 2.17k]
  ------------------
  164|  14.3k|                if((pu1_col_zero_flag_start[u1_submb_col] & 1) != u1_init_colzero_flag)
  ------------------
  |  Branch (164:20): [True: 1.32k, False: 13.0k]
  ------------------
  165|  1.32k|                    ps_direct->u1_col_zeroflag_change = 1;
  166|  14.3k|            }
  167|  12.4k|            u1_sub_mb_num = *pu1_top_lt_mb_part_idx++;
  168|  12.4k|        }
  169|  6.18k|        ps_direct->i1_num_partitions = i1_num_partitions;
  170|  6.18k|    }
  171|  6.18k|}
isvcd_decode_spatial_direct:
  187|  78.3k|{
  188|  78.3k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec = (svc_dec_lyr_struct_t *) ps_dec;
  189|  78.3k|    mv_pred_t s_mv_pred = {0};
  190|  78.3k|    mv_pred_t *ps_mv;
  191|  78.3k|    UWORD8 u1_col_zero_flag, u1_direct_zero_pred_flag = 0;
  192|  78.3k|    UWORD32 u4_sub_mb_num;
  193|  78.3k|    UWORD8 u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
  194|  78.3k|    mv_pred_t *ps_mv_ntop_start;
  195|  78.3k|    mv_pred_t *ps_mv_nmb_start = ps_dec->ps_mv_cur + (u4_mb_num << 4);
  196|  78.3k|    UWORD8 partition_size, sub_partition, u1_mb_partw, u1_mb_parth;
  197|  78.3k|    UWORD8 i;
  198|  78.3k|    WORD8 i1_pred, i1_ref_frame0, i1_ref_frame1;
  199|  78.3k|    struct pic_buffer_t *ps_ref_frame = NULL, *ps_col_pic, *ps_pic_buff0 = NULL,
  200|  78.3k|                        *ps_pic_buff1 = NULL;
  201|       |
  202|  78.3k|    UWORD8 u1_zero_pred_cond_f, u1_zero_pred_cond_b;
  203|  78.3k|    WORD16 i2_spat_pred_mv[4] = {0};
  204|  78.3k|    WORD16 *pi2_final_mv0, *pi2_final_mv1;
  205|  78.3k|    UWORD16 ui2_mask_fwd = 0, ui2_mask_bwd = 0;
  206|  78.3k|    UWORD32 *pui32_weight_ofsts = NULL;
  207|  78.3k|    directmv_t s_mvdirect = {0};
  208|  78.3k|    UWORD8 u1_colz;
  209|  78.3k|    UWORD8 u1_final_ref_idx = 0;
  210|  78.3k|    const UWORD8 *pu1_mb_parth = (const UWORD8 *) gau1_ih264d_mb_parth;
  211|  78.3k|    const UWORD8 *pu1_mb_partw = (const UWORD8 *) gau1_ih264d_mb_partw;
  212|       |
  213|  78.3k|    mv_pred_t s_temp_mv_pred = {0};
  214|  78.3k|    ps_mv_ntop_start =
  215|  78.3k|        ps_dec->ps_mv_cur + (u4_mb_num << 4) - (ps_dec->u2_frm_wd_in_mbs << (4 + u1_mbaff)) + 12;
  216|       |
  217|  78.3k|    u1_direct_zero_pred_flag =
  218|  78.3k|        ps_dec->pf_mvpred(ps_dec, ps_cur_mb_info, (ps_mv_nmb_start + ps_dec->u1_sub_mb_num),
  219|  78.3k|                          ps_mv_ntop_start + (ps_dec->u1_sub_mb_num & 0x03), &s_mv_pred,
  220|  78.3k|                          ps_dec->u1_sub_mb_num, (u1_wd_x >> 2), 0, 1, B_DIRECT_SPATIAL);
  ------------------
  |  |  489|  78.3k|#define B_DIRECT_SPATIAL  26
  ------------------
  221|       |
  222|  78.3k|    i2_spat_pred_mv[0] = s_mv_pred.i2_mv[0];
  223|  78.3k|    i2_spat_pred_mv[1] = s_mv_pred.i2_mv[1];
  224|  78.3k|    i2_spat_pred_mv[2] = s_mv_pred.i2_mv[2];
  225|  78.3k|    i2_spat_pred_mv[3] = s_mv_pred.i2_mv[3];
  226|       |
  227|  78.3k|    i1_ref_frame0 = s_mv_pred.i1_ref_frame[0];
  228|  78.3k|    i1_ref_frame1 = s_mv_pred.i1_ref_frame[1];
  229|       |
  230|  78.3k|    i1_ref_frame0 = (i1_ref_frame0 < 0) ? -1 : i1_ref_frame0;
  ------------------
  |  Branch (230:21): [True: 4.15k, False: 74.1k]
  ------------------
  231|  78.3k|    i1_ref_frame1 = (i1_ref_frame1 < 0) ? -1 : i1_ref_frame1;
  ------------------
  |  Branch (231:21): [True: 7.11k, False: 71.2k]
  ------------------
  232|       |
  233|  78.3k|    i1_pred = 0;
  234|       |
  235|  78.3k|    {
  236|  78.3k|        WORD8 u1_ref_idx, u1_ref_idx1;
  237|  78.3k|        UWORD32 uc_Idx, uc_Idx1;
  238|  78.3k|        UWORD8 u1_scale_ref =
  239|  78.3k|            (ps_dec->ps_cur_slice->u1_mbaff_frame_flag && ps_cur_mb_info->u1_mb_field_decodingflag);
  ------------------
  |  Branch (239:14): [True: 0, False: 78.3k]
  |  Branch (239:59): [True: 0, False: 0]
  ------------------
  240|  78.3k|        u1_final_ref_idx = i1_ref_frame0;
  241|  78.3k|        if(i1_ref_frame0 >= 0)
  ------------------
  |  Branch (241:12): [True: 74.1k, False: 4.15k]
  ------------------
  242|  74.1k|        {
  243|       |            /* convert RefIdx if it is MbAff */
  244|  74.1k|            u1_ref_idx = i1_ref_frame0;
  245|  74.1k|            u1_ref_idx1 = i1_ref_frame0;
  246|  74.1k|            if(u1_scale_ref)
  ------------------
  |  Branch (246:16): [True: 0, False: 74.1k]
  ------------------
  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|  74.1k|            ps_pic_buff0 = ps_dec->ps_ref_pic_buf_lx[0][u1_ref_idx1];
  254|  74.1k|            ps_ref_frame = ps_pic_buff0;
  255|  74.1k|            i1_pred = PRED_L0;
  ------------------
  |  |  483|  74.1k|#define PRED_L0   1
  ------------------
  256|  74.1k|        }
  257|       |
  258|  78.3k|        if(i1_ref_frame1 >= 0)
  ------------------
  |  Branch (258:12): [True: 71.2k, False: 7.11k]
  ------------------
  259|  71.2k|        {
  260|       |            /* convert RefIdx if it is MbAff */
  261|  71.2k|            u1_ref_idx = i1_ref_frame1;
  262|  71.2k|            u1_ref_idx1 = i1_ref_frame1;
  263|  71.2k|            if(u1_scale_ref)
  ------------------
  |  Branch (263:16): [True: 0, False: 71.2k]
  ------------------
  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|  71.2k|            ps_pic_buff1 = ps_dec->ps_ref_pic_buf_lx[1][u1_ref_idx1];
  270|  71.2k|            i1_pred = i1_pred | PRED_L1;
  ------------------
  |  |  484|  71.2k|#define PRED_L1   2
  ------------------
  271|  71.2k|        }
  272|  78.3k|        if(i1_ref_frame0 < 0)
  ------------------
  |  Branch (272:12): [True: 4.15k, False: 74.1k]
  ------------------
  273|  4.15k|        {
  274|  4.15k|            ps_ref_frame = ps_pic_buff1;
  275|  4.15k|            u1_final_ref_idx = i1_ref_frame1;
  276|  4.15k|        }
  277|       |
  278|  78.3k|        u1_zero_pred_cond_f = (u1_direct_zero_pred_flag) || (i1_ref_frame0 < 0);
  ------------------
  |  Branch (278:31): [True: 4.36k, False: 73.9k]
  |  Branch (278:61): [True: 4.15k, False: 69.8k]
  ------------------
  279|  78.3k|        u1_zero_pred_cond_b = (u1_direct_zero_pred_flag) || (i1_ref_frame1 < 0);
  ------------------
  |  Branch (279:31): [True: 4.36k, False: 73.9k]
  |  Branch (279:61): [True: 7.11k, False: 66.8k]
  ------------------
  280|       |
  281|  78.3k|        if(ps_dec->ps_cur_pps->u1_wted_bipred_idc)
  ------------------
  |  Branch (281:12): [True: 44.2k, False: 34.0k]
  ------------------
  282|  44.2k|        {
  283|  44.2k|            uc_Idx = ((i1_ref_frame0 < 1) ? 0 : i1_ref_frame0) *
  ------------------
  |  Branch (283:23): [True: 43.8k, False: 464]
  ------------------
  284|  44.2k|                     ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[1];
  285|  44.2k|            if(u1_scale_ref) uc_Idx >>= 1;
  ------------------
  |  Branch (285:16): [True: 0, False: 44.2k]
  ------------------
  286|  44.2k|            uc_Idx1 = (i1_ref_frame1 < 0) ? 0 : i1_ref_frame1;
  ------------------
  |  Branch (286:23): [True: 4.00k, False: 40.2k]
  ------------------
  287|  44.2k|            uc_Idx += (u1_scale_ref) ? (uc_Idx1 >> 1) : uc_Idx1;
  ------------------
  |  Branch (287:23): [True: 0, False: 44.2k]
  ------------------
  288|  44.2k|            pui32_weight_ofsts = (UWORD32 *) &ps_dec->pu4_wt_ofsts[2 * X3(uc_Idx)];
  ------------------
  |  |   92|  44.2k|#define X3(a)   (((a) << 1) + (a))
  ------------------
  289|       |
  290|  44.2k|            if(i1_ref_frame0 < 0) pui32_weight_ofsts += 1;
  ------------------
  |  Branch (290:16): [True: 2.95k, False: 41.3k]
  ------------------
  291|       |
  292|  44.2k|            if(u1_scale_ref && (ps_dec->ps_cur_pps->u1_wted_bipred_idc == 2))
  ------------------
  |  Branch (292:16): [True: 0, False: 44.2k]
  |  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|  44.2k|        }
  304|  78.3k|    }
  305|       |
  306|  78.3k|    s_temp_mv_pred.i1_ref_frame[0] = i1_ref_frame0;
  307|  78.3k|    s_temp_mv_pred.i1_ref_frame[1] = i1_ref_frame1;
  308|  78.3k|    s_temp_mv_pred.u1_col_ref_pic_idx = ps_ref_frame->u1_mv_buf_id;
  309|  78.3k|    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|  78.3k|    isvcd_one_to_one(ps_svc_lyr_dec, ps_dec->ps_col_pic, &s_mvdirect, u1_wd_x,
  317|  78.3k|                     ps_dec->i4_submb_ofst, ps_cur_mb_info);
  318|       |
  319|  78.3k|    ps_col_pic = ps_dec->ps_col_pic;
  320|  78.3k|    if((s_mvdirect.u1_col_zeroflag_change == 0) || u1_direct_zero_pred_flag)
  ------------------
  |  Branch (320:8): [True: 0, False: 78.3k]
  |  Branch (320:52): [True: 4.36k, False: 73.9k]
  ------------------
  321|  4.36k|    {
  322|  4.36k|        WORD16 i2_mv_x, i2_mv_y, i2_mvX1, i2_mvY1;
  323|       |        /* Most probable case */
  324|  4.36k|        u1_col_zero_flag = *(ps_col_pic->pu1_col_zero_flag + s_mvdirect.i4_mv_indices[0]);
  325|  4.36k|        u1_col_zero_flag = u1_col_zero_flag & 0x01;
  326|       |
  327|  4.36k|        if(u1_zero_pred_cond_f || ((i1_ref_frame0 == 0) && (u1_col_zero_flag == 1)))
  ------------------
  |  Branch (327:12): [True: 4.36k, False: 0]
  |  Branch (327:36): [True: 0, False: 0]
  |  Branch (327:60): [True: 0, False: 0]
  ------------------
  328|  4.36k|        {
  329|  4.36k|            i2_mv_x = 0;
  330|  4.36k|            i2_mv_y = 0;
  331|  4.36k|        }
  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.36k|        if(u1_zero_pred_cond_b || ((i1_ref_frame1 == 0) && (u1_col_zero_flag == 1)))
  ------------------
  |  Branch (338:12): [True: 4.36k, False: 0]
  |  Branch (338:36): [True: 0, False: 0]
  |  Branch (338:60): [True: 0, False: 0]
  ------------------
  339|  4.36k|        {
  340|  4.36k|            i2_mvX1 = 0;
  341|  4.36k|            i2_mvY1 = 0;
  342|  4.36k|        }
  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.36k|        u4_sub_mb_num = ps_dec->u1_sub_mb_num;
  350|  4.36k|        u1_mb_partw = (u1_wd_x >> 2);
  351|       |
  352|  4.36k|        if(i1_ref_frame0 >= 0)
  ------------------
  |  Branch (352:12): [True: 4.36k, False: 0]
  ------------------
  353|  4.36k|        {
  354|  4.36k|            {
  355|  4.36k|                pred_info_pkd_t *ps_pred_pkd;
  356|  4.36k|                WORD16 i2_mv[2];
  357|  4.36k|                WORD8 i1_ref_idx = 0;
  358|       |
  359|  4.36k|                i2_mv[0] = i2_mv_x;
  360|  4.36k|                i2_mv[1] = i2_mv_y;
  361|       |
  362|  4.36k|                ps_pred_pkd = ps_dec->ps_pred_pkd + ps_dec->u4_pred_info_pkd_idx;
  363|  4.36k|                ih264d_fill_pred_info(i2_mv, u1_mb_partw, u1_mb_partw, u4_sub_mb_num, i1_pred,
  364|  4.36k|                                      ps_pred_pkd, ps_pic_buff0->u1_pic_buf_id, i1_ref_idx,
  365|  4.36k|                                      pui32_weight_ofsts, ps_pic_buff0->u1_pic_type);
  366|  4.36k|                ps_dec->u4_pred_info_pkd_idx++;
  367|  4.36k|                ps_cur_mb_info->u1_num_pred_parts++;
  368|  4.36k|            }
  369|  4.36k|        }
  370|       |
  371|  4.36k|        if(i1_ref_frame1 >= 0)
  ------------------
  |  Branch (371:12): [True: 4.36k, False: 0]
  ------------------
  372|  4.36k|        {
  373|  4.36k|            {
  374|  4.36k|                pred_info_pkd_t *ps_pred_pkd;
  375|  4.36k|                WORD16 i2_mv[2];
  376|  4.36k|                WORD8 i1_ref_idx = 0;
  377|       |
  378|  4.36k|                i2_mv[0] = i2_mvX1;
  379|  4.36k|                i2_mv[1] = i2_mvY1;
  380|       |
  381|  4.36k|                ps_pred_pkd = ps_dec->ps_pred_pkd + ps_dec->u4_pred_info_pkd_idx;
  382|  4.36k|                ih264d_fill_pred_info(i2_mv, u1_mb_partw, u1_mb_partw, u4_sub_mb_num, i1_pred,
  383|  4.36k|                                      ps_pred_pkd, ps_pic_buff1->u1_pic_buf_id, i1_ref_idx,
  384|  4.36k|                                      pui32_weight_ofsts, ps_pic_buff1->u1_pic_type);
  385|  4.36k|                ps_dec->u4_pred_info_pkd_idx++;
  386|  4.36k|                ps_cur_mb_info->u1_num_pred_parts++;
  387|  4.36k|            }
  388|  4.36k|        }
  389|       |
  390|       |        /* Replication optimisation */
  391|  4.36k|        s_temp_mv_pred.i2_mv[0] = i2_mv_x;
  392|  4.36k|        s_temp_mv_pred.i2_mv[1] = i2_mv_y;
  393|  4.36k|        s_temp_mv_pred.i2_mv[2] = i2_mvX1;
  394|  4.36k|        s_temp_mv_pred.i2_mv[3] = i2_mvY1;
  395|       |
  396|       |        /* Calculating colocated zero information */
  397|  4.36k|        {
  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.36k|            UWORD8 u1_packed_mb_sub_mb_mode = (u1_mb_partw == 2) ? 0x03 : 0;
  ------------------
  |  Branch (409:47): [True: 122, False: 4.24k]
  ------------------
  410|       |
  411|  4.36k|            if(i1_ref_frame0 < 0)
  ------------------
  |  Branch (411:16): [True: 0, False: 4.36k]
  ------------------
  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.36k|            u1_colz = (ps_cur_mb_info->u1_mb_field_decodingflag << 1) |
  419|  4.36k|                      ((u1_final_ref_idx == 0) && (ABS(i2_mv_x) <= 1) && (ABS(i2_mv_y) <= 1));
  ------------------
  |  |  100|  4.36k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 0, False: 4.36k]
  |  |  ------------------
  ------------------
                                    ((u1_final_ref_idx == 0) && (ABS(i2_mv_x) <= 1) && (ABS(i2_mv_y) <= 1));
  ------------------
  |  |  100|  4.36k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 0, False: 4.36k]
  |  |  ------------------
  ------------------
  |  Branch (419:24): [True: 4.36k, False: 0]
  |  Branch (419:51): [True: 4.36k, False: 0]
  |  Branch (419:74): [True: 4.36k, False: 0]
  ------------------
  420|  4.36k|            u1_colz |= (u1_packed_mb_sub_mb_mode << 6);
  421|  4.36k|        }
  422|  4.36k|        ps_mv = ps_mv_nmb_start + u4_sub_mb_num;
  423|  4.36k|        if(ps_mv)
  ------------------
  |  Branch (423:12): [True: 4.36k, False: 0]
  ------------------
  424|  4.36k|        {
  425|  4.36k|            ih264d_rep_mv_colz(ps_dec, &s_temp_mv_pred, ps_mv, u4_sub_mb_num, u1_colz, u1_mb_partw,
  426|  4.36k|                               u1_mb_partw);
  427|  4.36k|        }
  428|      0|        else
  429|      0|        {
  430|      0|            return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  431|      0|        }
  432|       |
  433|  4.36k|        if(u1_wd_x == MB_SIZE) ps_dec->u1_currB_type = 0;
  ------------------
  |  |  554|  4.36k|#define MB_SIZE             16
  ------------------
  |  Branch (433:12): [True: 4.24k, False: 122]
  ------------------
  434|       |
  435|  4.36k|        return OK;
  ------------------
  |  |  114|  4.36k|#define OK        0
  ------------------
  436|  4.36k|    }
  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|  73.9k|    if((u1_wd_x == MB_SIZE) && (s_mvdirect.i1_num_partitions > 2))
  ------------------
  |  |  554|  73.9k|#define MB_SIZE             16
  ------------------
  |  Branch (445:8): [True: 69.9k, False: 3.98k]
  |  Branch (445:32): [True: 2.03k, False: 67.9k]
  ------------------
  446|  2.03k|    {
  447|  2.03k|        ps_cur_mb_info->u1_Mux = 1;
  448|  2.03k|        if(i1_ref_frame0 >= 0)
  ------------------
  |  Branch (448:12): [True: 1.81k, False: 223]
  ------------------
  449|  1.81k|        {
  450|  1.81k|            {
  451|  1.81k|                pred_info_pkd_t *ps_pred_pkd;
  452|  1.81k|                WORD8 i1_ref_idx = 0;
  453|       |
  454|  1.81k|                ps_pred_pkd = ps_dec->ps_pred_pkd + ps_dec->u4_pred_info_pkd_idx;
  455|  1.81k|                ih264d_fill_pred_info(&(i2_spat_pred_mv[0]), 4, 4, 0, i1_pred, ps_pred_pkd,
  456|  1.81k|                                      ps_pic_buff0->u1_pic_buf_id, i1_ref_idx, pui32_weight_ofsts,
  457|  1.81k|                                      ps_pic_buff0->u1_pic_type);
  458|  1.81k|                ps_dec->u4_pred_info_pkd_idx++;
  459|  1.81k|                ps_cur_mb_info->u1_num_pred_parts++;
  460|  1.81k|            }
  461|       |
  462|       |            /******    (0,0) Motion vectors DMA     *****/
  463|  1.81k|            {
  464|  1.81k|                pred_info_pkd_t *ps_pred_pkd;
  465|  1.81k|                WORD16 i2_mv[2];
  466|  1.81k|                WORD8 i1_ref_idx = 0;
  467|       |
  468|  1.81k|                i2_mv[0] = 0;
  469|  1.81k|                i2_mv[1] = 0;
  470|       |
  471|  1.81k|                ps_pred_pkd = ps_dec->ps_pred_pkd + ps_dec->u4_pred_info_pkd_idx;
  472|  1.81k|                ih264d_fill_pred_info(i2_mv, 4, 4, 0, i1_pred, ps_pred_pkd,
  473|  1.81k|                                      ps_pic_buff0->u1_pic_buf_id, i1_ref_idx, pui32_weight_ofsts,
  474|  1.81k|                                      ps_pic_buff0->u1_pic_type);
  475|  1.81k|                ps_dec->u4_pred_info_pkd_idx++;
  476|  1.81k|                ps_cur_mb_info->u1_num_pred_parts++;
  477|  1.81k|            }
  478|  1.81k|        }
  479|  2.03k|        if(i1_ref_frame1 >= 0)
  ------------------
  |  Branch (479:12): [True: 1.50k, False: 529]
  ------------------
  480|  1.50k|        {
  481|  1.50k|            {
  482|  1.50k|                pred_info_pkd_t *ps_pred_pkd;
  483|  1.50k|                WORD8 i1_ref_idx = 0;
  484|       |
  485|  1.50k|                ps_pred_pkd = ps_dec->ps_pred_pkd + ps_dec->u4_pred_info_pkd_idx;
  486|  1.50k|                ih264d_fill_pred_info(&(i2_spat_pred_mv[2]), 4, 4, 0, i1_pred, ps_pred_pkd,
  487|  1.50k|                                      ps_pic_buff1->u1_pic_buf_id, i1_ref_idx, pui32_weight_ofsts,
  488|  1.50k|                                      ps_pic_buff1->u1_pic_type);
  489|  1.50k|                ps_dec->u4_pred_info_pkd_idx++;
  490|  1.50k|                ps_cur_mb_info->u1_num_pred_parts++;
  491|  1.50k|            }
  492|       |
  493|       |            /******    (0,0) Motion vectors DMA     *****/
  494|  1.50k|            {
  495|  1.50k|                pred_info_pkd_t *ps_pred_pkd;
  496|  1.50k|                WORD16 i2_mv[2];
  497|  1.50k|                WORD8 i1_ref_idx = 0;
  498|       |
  499|  1.50k|                i2_mv[0] = 0;
  500|  1.50k|                i2_mv[1] = 0;
  501|       |
  502|  1.50k|                ps_pred_pkd = ps_dec->ps_pred_pkd + ps_dec->u4_pred_info_pkd_idx;
  503|  1.50k|                ih264d_fill_pred_info(i2_mv, 4, 4, 0, i1_pred, ps_pred_pkd,
  504|  1.50k|                                      ps_pic_buff1->u1_pic_buf_id, i1_ref_idx, pui32_weight_ofsts,
  505|  1.50k|                                      ps_pic_buff1->u1_pic_type);
  506|  1.50k|                ps_dec->u4_pred_info_pkd_idx++;
  507|  1.50k|                ps_cur_mb_info->u1_num_pred_parts++;
  508|  1.50k|            }
  509|  1.50k|        }
  510|  2.03k|    }
  511|       |
  512|   158k|    for(i = 0; i < s_mvdirect.i1_num_partitions; i++)
  ------------------
  |  Branch (512:16): [True: 84.1k, False: 73.9k]
  ------------------
  513|  84.1k|    {
  514|  84.1k|        partition_size = s_mvdirect.i1_partitionsize[i];
  515|  84.1k|        u4_sub_mb_num = s_mvdirect.i1_submb_num[i];
  516|       |
  517|  84.1k|        sub_partition = partition_size >> 2;
  518|  84.1k|        partition_size &= 0x3;
  519|  84.1k|        u1_mb_partw = pu1_mb_partw[partition_size];
  520|  84.1k|        u1_mb_parth = pu1_mb_parth[partition_size];
  521|  84.1k|        if(sub_partition != 0)
  ------------------
  |  Branch (521:12): [True: 11.8k, False: 72.3k]
  ------------------
  522|  11.8k|        {
  523|  11.8k|            u1_mb_partw >>= 1;
  524|  11.8k|            u1_mb_parth >>= 1;
  525|  11.8k|        }
  526|       |
  527|  84.1k|        u1_col_zero_flag = *(ps_col_pic->pu1_col_zero_flag + s_mvdirect.i4_mv_indices[i]);
  528|  84.1k|        u1_col_zero_flag = u1_col_zero_flag & 0x01;
  529|       |
  530|       |        /*if(u1_col != u1_col_zero_flag)
  531|       |         u1_init = 1;*/
  532|       |
  533|  84.1k|        pi2_final_mv0 = &i2_spat_pred_mv[0];
  534|  84.1k|        pi2_final_mv1 = &i2_spat_pred_mv[2];
  535|       |
  536|  84.1k|        if(ps_cur_mb_info->u1_Mux != 1)
  ------------------
  |  Branch (536:12): [True: 74.1k, False: 9.99k]
  ------------------
  537|  74.1k|        {
  538|  74.1k|            if(i1_ref_frame0 >= 0)
  ------------------
  |  Branch (538:16): [True: 70.1k, False: 4.04k]
  ------------------
  539|  70.1k|            {
  540|  70.1k|                {
  541|  70.1k|                    pred_info_pkd_t *ps_pred_pkd;
  542|  70.1k|                    WORD8 i1_ref_idx = 0;
  543|       |
  544|  70.1k|                    ps_pred_pkd = ps_dec->ps_pred_pkd + ps_dec->u4_pred_info_pkd_idx;
  545|  70.1k|                    ih264d_fill_pred_info(pi2_final_mv0, u1_mb_partw, u1_mb_parth, u4_sub_mb_num,
  546|  70.1k|                                          i1_pred, ps_pred_pkd, ps_pic_buff0->u1_pic_buf_id,
  547|  70.1k|                                          i1_ref_idx, pui32_weight_ofsts,
  548|  70.1k|                                          ps_pic_buff0->u1_pic_type);
  549|  70.1k|                    ps_dec->u4_pred_info_pkd_idx++;
  550|  70.1k|                    ps_cur_mb_info->u1_num_pred_parts++;
  551|  70.1k|                }
  552|  70.1k|            }
  553|       |
  554|  74.1k|            if(i1_ref_frame1 >= 0)
  ------------------
  |  Branch (554:16): [True: 66.5k, False: 7.64k]
  ------------------
  555|  66.5k|            {
  556|  66.5k|                pred_info_pkd_t *ps_pred_pkd;
  557|  66.5k|                WORD8 i1_ref_idx = 0;
  558|       |
  559|  66.5k|                ps_pred_pkd = ps_dec->ps_pred_pkd + ps_dec->u4_pred_info_pkd_idx;
  560|  66.5k|                ih264d_fill_pred_info(pi2_final_mv1, u1_mb_partw, u1_mb_parth, u4_sub_mb_num,
  561|  66.5k|                                      i1_pred, ps_pred_pkd, ps_pic_buff1->u1_pic_buf_id, i1_ref_idx,
  562|  66.5k|                                      pui32_weight_ofsts, ps_pic_buff1->u1_pic_type);
  563|  66.5k|                ps_dec->u4_pred_info_pkd_idx++;
  564|  66.5k|                ps_cur_mb_info->u1_num_pred_parts++;
  565|  66.5k|            }
  566|  74.1k|        }
  567|       |
  568|       |        /* Replication optimisation */
  569|  84.1k|        s_temp_mv_pred.i2_mv[0] = pi2_final_mv0[0];
  570|  84.1k|        s_temp_mv_pred.i2_mv[1] = pi2_final_mv0[1];
  571|  84.1k|        s_temp_mv_pred.i2_mv[2] = pi2_final_mv1[0];
  572|  84.1k|        s_temp_mv_pred.i2_mv[3] = pi2_final_mv1[1];
  573|       |
  574|       |        /* Calculating colocated zero information */
  575|  84.1k|        {
  576|  84.1k|            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|  84.1k|            UWORD8 u1_packed_mb_sub_mb_mode = sub_partition
  ------------------
  |  Branch (585:47): [True: 11.8k, False: 72.3k]
  ------------------
  586|  84.1k|                                                  ? (s_mvdirect.i1_partitionsize[i])
  587|  84.1k|                                                  : ((s_mvdirect.i1_partitionsize[i]) << 2);
  588|       |
  589|  84.1k|            if(i1_ref_frame0 >= 0)
  ------------------
  |  Branch (589:16): [True: 78.9k, False: 5.14k]
  ------------------
  590|  78.9k|            {
  591|  78.9k|                i2_mv_x = pi2_final_mv0[0];
  592|  78.9k|                i2_mv_y = pi2_final_mv0[1];
  593|  78.9k|            }
  594|  5.14k|            else
  595|  5.14k|            {
  596|  5.14k|                i2_mv_x = pi2_final_mv1[0];
  597|  5.14k|                i2_mv_y = pi2_final_mv1[1];
  598|  5.14k|            }
  599|       |
  600|  84.1k|            u1_colz = (ps_cur_mb_info->u1_mb_field_decodingflag << 1) |
  601|  84.1k|                      ((u1_final_ref_idx == 0) && (ABS(i2_mv_x) <= 1) && (ABS(i2_mv_y) <= 1));
  ------------------
  |  |  100|  82.8k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 5.27k, False: 77.6k]
  |  |  ------------------
  ------------------
                                    ((u1_final_ref_idx == 0) && (ABS(i2_mv_x) <= 1) && (ABS(i2_mv_y) <= 1));
  ------------------
  |  |  100|  78.9k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 2.04k, False: 76.8k]
  |  |  ------------------
  ------------------
  |  Branch (601:24): [True: 82.8k, False: 1.25k]
  |  Branch (601:51): [True: 78.9k, False: 3.94k]
  |  Branch (601:74): [True: 75.6k, False: 3.26k]
  ------------------
  602|  84.1k|            u1_colz |= (u1_packed_mb_sub_mb_mode << 4);
  603|  84.1k|        }
  604|  84.1k|        ps_mv = ps_mv_nmb_start + u4_sub_mb_num;
  605|  84.1k|        if(ps_mv)
  ------------------
  |  Branch (605:12): [True: 84.1k, False: 0]
  ------------------
  606|  84.1k|        {
  607|  84.1k|            ih264d_rep_mv_colz(ps_dec, &s_temp_mv_pred, ps_mv, u4_sub_mb_num, u1_colz, u1_mb_parth,
  608|  84.1k|                               u1_mb_partw);
  609|  84.1k|        }
  610|      0|        else
  611|      0|        {
  612|      0|            return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  613|      0|        }
  614|  84.1k|    }
  615|  73.9k|    i = 0;
  616|  73.9k|    if(i1_ref_frame0 >= 0) ps_cur_mb_info->u2_mask[i++] = ui2_mask_fwd;
  ------------------
  |  Branch (616:8): [True: 69.8k, False: 4.15k]
  ------------------
  617|  73.9k|    if(i1_ref_frame1 >= 0) ps_cur_mb_info->u2_mask[i] = ui2_mask_bwd;
  ------------------
  |  Branch (617:8): [True: 66.8k, False: 7.11k]
  ------------------
  618|       |
  619|  73.9k|    return OK;
  ------------------
  |  |  114|  73.9k|#define OK        0
  ------------------
  620|  73.9k|}

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

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

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

isvcd_decode_recon_tfr_nmb_thread:
   76|   189k|{
   77|   189k|    WORD32 i, j;
   78|   189k|    dec_mb_info_t *ps_cur_mb_info;
   79|   189k|    dec_svc_mb_info_t *ps_svc_cur_mb_info;
   80|   189k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
   81|   189k|    const UWORD32 u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
   82|   189k|    UWORD32 u1_slice_type, u1_B;
   83|   189k|    WORD32 u1_skip_th;
   84|   189k|    UWORD32 u1_ipcm_th;
   85|   189k|    UWORD32 u4_cond;
   86|   189k|    UWORD16 u2_slice_num, u2_cur_dec_mb_num;
   87|   189k|    UWORD32 u4_mb_num;
   88|   189k|    WORD32 nop_cnt = 8 * 128;
   89|   189k|    UWORD16 *pu2_res_luma_csbp;
   90|   189k|    WORD32 ret;
   91|   189k|    u1_slice_type = ps_dec->ps_decode_cur_slice->slice_type;
   92|       |
   93|   189k|    u1_B = (u1_slice_type == B_SLICE);
  ------------------
  |  |  369|   189k|#define B_SLICE  1
  ------------------
   94|   189k|    u1_skip_th = ((u1_slice_type != I_SLICE) ? (u1_B ? B_8x8 : PRED_8x8R0) : -1);
  ------------------
  |  |  370|   189k|#define I_SLICE  2
  ------------------
                  u1_skip_th = ((u1_slice_type != I_SLICE) ? (u1_B ? B_8x8 : PRED_8x8R0) : -1);
  ------------------
  |  |  480|  27.3k|#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: 177k, False: 12.2k]
  |  Branch (94:49): [True: 27.3k, False: 149k]
  ------------------
   95|   189k|    u1_ipcm_th = ((u1_slice_type != I_SLICE) ? (u1_B ? 23 : 5) : 0);
  ------------------
  |  |  370|   189k|#define I_SLICE  2
  ------------------
  |  Branch (95:19): [True: 177k, False: 12.2k]
  |  Branch (95:49): [True: 27.3k, False: 149k]
  ------------------
   96|   189k|    u2_cur_dec_mb_num = ps_dec->cur_dec_mb_num;
   97|       |
   98|   268k|    while(1)
  ------------------
  |  Branch (98:11): [True: 268k, Folded]
  ------------------
   99|   268k|    {
  100|   268k|        UWORD32 u4_max_mb =
  101|   268k|            (UWORD32) (ps_dec->i2_dec_thread_mb_y + (1 << u1_mbaff)) * ps_dec->u2_frm_wd_in_mbs - 1;
  102|   268k|        u4_mb_num = u2_cur_dec_mb_num;
  103|       |        /*introducing 1 MB delay*/
  104|   268k|        u4_mb_num = MIN(u4_mb_num + u4_num_mbs + 1, u4_max_mb);
  ------------------
  |  |   61|   268k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 0, False: 268k]
  |  |  ------------------
  ------------------
  105|       |
  106|   268k|        CHECK_MB_MAP_BYTE(u4_mb_num, ps_dec->pu1_dec_mb_map, u4_cond);
  ------------------
  |  |   80|   268k|#define CHECK_MB_MAP_BYTE(u4_mb_num, mb_map, u4_cond)                                               \
  |  |   81|   268k|{                                                                                                   \
  |  |   82|   268k|        volatile UWORD8 *pu1_mb_flag;                                                               \
  |  |   83|   268k|                                                                                                    \
  |  |   84|   268k|        pu1_mb_flag    = (UWORD8 *)mb_map + (u4_mb_num );                                           \
  |  |   85|   268k|                                                                                                    \
  |  |   86|   268k|        u4_cond = (*pu1_mb_flag);                                                                   \
  |  |   87|   268k|}
  ------------------
  107|   268k|        if(u4_cond)
  ------------------
  |  Branch (107:12): [True: 188k, False: 79.5k]
  ------------------
  108|   188k|        {
  109|   188k|            break;
  110|   188k|        }
  111|  79.5k|        else
  112|  79.5k|        {
  113|  79.5k|            if(nop_cnt > 0)
  ------------------
  |  Branch (113:16): [True: 68.4k, False: 11.0k]
  ------------------
  114|  68.4k|            {
  115|  68.4k|                nop_cnt -= 128;
  116|  68.4k|                NOP(128);
  ------------------
  |  |   87|  8.82M|#define NOP(nop_cnt) {UWORD32 nop_i; for (nop_i = 0; nop_i < nop_cnt; nop_i++) asm("nop");}
  |  |  ------------------
  |  |  |  Branch (87:54): [True: 8.76M, False: 68.4k]
  |  |  ------------------
  ------------------
  117|  68.4k|            }
  118|  11.0k|            else
  119|  11.0k|            {
  120|  11.0k|                if(ps_dec->u4_output_present && (2 == ps_dec->u4_num_cores) &&
  ------------------
  |  Branch (120:20): [True: 9.98k, False: 1.08k]
  |  Branch (120:49): [True: 9.98k, False: 0]
  ------------------
  121|  9.98k|                   (ps_dec->u4_fmt_conv_cur_row < ps_dec->s_disp_frame_info.u4_y_ht))
  ------------------
  |  Branch (121:20): [True: 4.19k, False: 5.78k]
  ------------------
  122|  4.19k|                {
  123|  4.19k|                    ps_dec->u4_fmt_conv_num_rows =
  124|  4.19k|                        MIN(FMT_CONV_NUM_ROWS,
  ------------------
  |  |   61|  4.19k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 3.85k, False: 342]
  |  |  ------------------
  ------------------
  125|  4.19k|                            (ps_dec->s_disp_frame_info.u4_y_ht - ps_dec->u4_fmt_conv_cur_row));
  126|  4.19k|                    ih264d_format_convert(ps_dec, &(ps_dec->s_disp_op), ps_dec->u4_fmt_conv_cur_row,
  127|  4.19k|                                          ps_dec->u4_fmt_conv_num_rows);
  128|  4.19k|                    ps_dec->u4_fmt_conv_cur_row += ps_dec->u4_fmt_conv_num_rows;
  129|  4.19k|                }
  130|  6.87k|                else
  131|  6.87k|                {
  132|  6.87k|                    nop_cnt = 8 * 128;
  133|  6.87k|                    ithread_yield();
  134|  6.87k|                }
  135|  11.0k|                if(1 == ps_svc_lyr_dec->u1_error_in_cur_frame)
  ------------------
  |  Branch (135:20): [True: 802, False: 10.2k]
  ------------------
  136|    802|                {
  137|    802|                    return NOT_OK;
  ------------------
  |  |  116|    802|#define NOT_OK    -1
  ------------------
  138|    802|                }
  139|  11.0k|            }
  140|  79.5k|        }
  141|   268k|    }
  142|       |
  143|       |    /* N Mb MC Loop */
  144|   803k|    for(i = 0; i < u4_num_mbs; i++)
  ------------------
  |  Branch (144:16): [True: 622k, False: 181k]
  ------------------
  145|   622k|    {
  146|   622k|        u4_mb_num = u2_cur_dec_mb_num;
  147|   622k|        GET_SLICE_NUM_MAP(ps_dec->pu2_slice_num_map, u2_cur_dec_mb_num, u2_slice_num);
  ------------------
  |  |  156|   622k|#define GET_SLICE_NUM_MAP(slice_map, mb_number,u2_slice_num)                                                  \
  |  |  157|   622k|{                                                                                                   \
  |  |  158|   622k|        volatile UWORD16 *pu2_slice_map;                                                               \
  |  |  159|   622k|                                                                                                    \
  |  |  160|   622k|        pu2_slice_map    = (UWORD16 *)slice_map + (mb_number);                                         \
  |  |  161|   622k|        u2_slice_num = (*pu2_slice_map) ;                                                               \
  |  |  162|   622k|}
  ------------------
  148|       |
  149|   622k|        if(u2_slice_num != ps_dec->u2_cur_slice_num_dec_thread)
  ------------------
  |  Branch (149:12): [True: 6.96k, False: 615k]
  ------------------
  150|  6.96k|        {
  151|  6.96k|            ps_dec->u4_cur_slice_decode_done = 1;
  152|  6.96k|            break;
  153|  6.96k|        }
  154|       |
  155|   615k|        ps_cur_mb_info = &ps_dec->ps_frm_mb_info[u2_cur_dec_mb_num];
  156|       |
  157|   615k|        ps_dec->u4_dma_buf_idx = 0;
  158|   615k|        ps_dec->u4_pred_info_idx = 0;
  159|       |
  160|       |        /*Pointer assignment for Residual NNZ */
  161|   615k|        pu2_res_luma_csbp = ps_svc_lyr_dec->pu2_frm_res_luma_csbp + ps_cur_mb_info->u2_mbx;
  162|   615k|        pu2_res_luma_csbp += ps_cur_mb_info->u2_mby * ps_svc_lyr_dec->i4_frm_res_luma_csbp_stride;
  163|       |
  164|   615k|        if(ps_cur_mb_info->u1_mb_type <= u1_skip_th)
  ------------------
  |  Branch (164:12): [True: 145k, False: 469k]
  ------------------
  165|   145k|        {
  166|   145k|            WORD32 pred_cnt = 0;
  167|   145k|            pred_info_pkd_t *ps_pred_pkd;
  168|   145k|            UWORD32 u4_pred_info_pkd_idx;
  169|       |
  170|   145k|            u4_pred_info_pkd_idx = ps_cur_mb_info->u4_pred_info_pkd_idx;
  171|       |
  172|   428k|            while(pred_cnt < ps_cur_mb_info->u1_num_pred_parts)
  ------------------
  |  Branch (172:19): [True: 283k, False: 145k]
  ------------------
  173|   283k|            {
  174|   283k|                ps_pred_pkd = ps_dec->ps_pred_pkd + u4_pred_info_pkd_idx;
  175|       |
  176|   283k|                ps_dec->p_form_mb_part_info_thread(ps_pred_pkd, ps_dec, ps_cur_mb_info->u2_mbx,
  177|   283k|                                                   ps_cur_mb_info->u2_mby, (i >> u1_mbaff),
  178|   283k|                                                   ps_cur_mb_info);
  179|       |
  180|   283k|                u4_pred_info_pkd_idx++;
  181|   283k|                pred_cnt++;
  182|   283k|            }
  183|   145k|            ps_dec->p_mc_dec_thread(ps_dec, ps_cur_mb_info);
  184|   145k|        }
  185|   469k|        else if(ps_cur_mb_info->u1_mb_type == MB_SKIP)
  ------------------
  |  |  456|   469k|#define MB_SKIP     255
  ------------------
  |  Branch (185:17): [True: 412k, False: 56.9k]
  ------------------
  186|   412k|        {
  187|   412k|            WORD32 pred_cnt = 0;
  188|   412k|            pred_info_pkd_t *ps_pred_pkd;
  189|   412k|            UWORD32 u4_pred_info_pkd_idx;
  190|       |
  191|   412k|            u4_pred_info_pkd_idx = ps_cur_mb_info->u4_pred_info_pkd_idx;
  192|       |
  193|   865k|            while(pred_cnt < ps_cur_mb_info->u1_num_pred_parts)
  ------------------
  |  Branch (193:19): [True: 452k, False: 412k]
  ------------------
  194|   452k|            {
  195|   452k|                ps_pred_pkd = ps_dec->ps_pred_pkd + u4_pred_info_pkd_idx;
  196|       |
  197|   452k|                ps_dec->p_form_mb_part_info_thread(ps_pred_pkd, ps_dec, ps_cur_mb_info->u2_mbx,
  198|   452k|                                                   ps_cur_mb_info->u2_mby, (i >> u1_mbaff),
  199|   452k|                                                   ps_cur_mb_info);
  200|       |
  201|   452k|                u4_pred_info_pkd_idx++;
  202|   452k|                pred_cnt++;
  203|   452k|            }
  204|       |            /* Decode MB skip */
  205|   412k|            ps_dec->p_mc_dec_thread(ps_dec, ps_cur_mb_info);
  206|       |
  207|   412k|            *pu2_res_luma_csbp = 0;
  208|   412k|            ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb =
  209|   412k|                ps_svc_lyr_dec->ps_inter_lyr_mb_prms_frm_start + ps_cur_mb_info->u2_mbx +
  210|   412k|                (ps_svc_lyr_dec->u2_inter_lyr_mb_prms_stride * (ps_cur_mb_info->u2_mby));
  211|   412k|            ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->i1_mb_mode = SVC_INTER_MB;
  ------------------
  |  |  114|   412k|#define SVC_INTER_MB (1 << 0)       /*!< Intra MBs other than IPCM and I_BL */
  ------------------
  212|   412k|            ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->i1_tx_size =
  213|   412k|                ps_cur_mb_info->u1_tran_form8x8;
  214|   412k|            ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->u2_luma_nnz = 0;
  215|   412k|            ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->u1_chroma_nnz = 0;
  216|   412k|        }
  217|       |
  218|   615k|        u2_cur_dec_mb_num++;
  219|   615k|    }
  220|       |
  221|       |    /* N Mb IQ IT RECON  Loop */
  222|   803k|    for(j = 0; j < i; j++)
  ------------------
  |  Branch (222:16): [True: 615k, False: 188k]
  ------------------
  223|   615k|    {
  224|   615k|        ps_cur_mb_info = &ps_dec->ps_frm_mb_info[ps_dec->cur_dec_mb_num];
  225|   615k|        ps_svc_cur_mb_info = &ps_svc_lyr_dec->ps_svc_frm_mb_info[ps_dec->cur_dec_mb_num];
  226|       |
  227|   615k|        if(NULL == ps_cur_mb_info->ps_curmb)
  ------------------
  |  Branch (227:12): [True: 0, False: 615k]
  ------------------
  228|      0|        {
  229|      0|            return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  230|      0|        }
  231|       |
  232|       |        /*Pointer assignment for Residual NNZ */
  233|   615k|        pu2_res_luma_csbp = ps_svc_lyr_dec->pu2_frm_res_luma_csbp + ps_cur_mb_info->u2_mbx;
  234|   615k|        pu2_res_luma_csbp += ps_cur_mb_info->u2_mby * ps_svc_lyr_dec->i4_frm_res_luma_csbp_stride;
  235|       |
  236|   615k|        ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb =
  237|   615k|            ps_svc_lyr_dec->ps_inter_lyr_mb_prms_frm_start + ps_cur_mb_info->u2_mbx +
  238|   615k|            (ps_svc_lyr_dec->u2_inter_lyr_mb_prms_stride * (ps_cur_mb_info->u2_mby));
  239|       |
  240|   615k|        ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->i1_slice_id = (WORD8) ps_dec->u2_cur_slice_num;
  241|       |
  242|   615k|        if((ps_dec->u4_num_cores == 2) || !ps_dec->i1_recon_in_thread3_flag)
  ------------------
  |  Branch (242:12): [True: 615k, False: 0]
  |  Branch (242:43): [True: 0, False: 0]
  ------------------
  243|   615k|        {
  244|   615k|            if(ps_cur_mb_info->u1_mb_type <= u1_skip_th)
  ------------------
  |  Branch (244:16): [True: 145k, False: 469k]
  ------------------
  245|   145k|            {
  246|   145k|                {
  247|       |                    /* inter intra pred generation */
  248|   145k|                    if(SVCD_FALSE == ps_svc_lyr_dec->u1_dyadic_flag)
  ------------------
  |  |   45|   145k|#define SVCD_FALSE 0
  ------------------
  |  Branch (248:24): [True: 101k, False: 43.5k]
  ------------------
  249|   101k|                    {
  250|   101k|                        ret = isvcd_process_ii_mb(ps_svc_lyr_dec, ps_cur_mb_info,
  251|   101k|                                                  ps_svc_cur_mb_info, j);
  252|   101k|                        if(ret != OK) return ret;
  ------------------
  |  |  114|   101k|#define OK        0
  ------------------
  |  Branch (252:28): [True: 0, False: 101k]
  ------------------
  253|   101k|                    }
  254|   145k|                    if(0 == ps_svc_cur_mb_info->u1_residual_prediction_flag)
  ------------------
  |  Branch (254:24): [True: 35.5k, False: 109k]
  ------------------
  255|  35.5k|                    {
  256|       |                        /* IT + Recon */
  257|  35.5k|                        ih264d_process_inter_mb(ps_dec, ps_cur_mb_info, j);
  258|  35.5k|                        isvcd_update_inter_mb_inter_layer_info(ps_svc_lyr_dec, ps_cur_mb_info, 0);
  259|  35.5k|                        *pu2_res_luma_csbp = ps_cur_mb_info->u2_luma_csbp;
  260|  35.5k|                    }
  261|   109k|                    else
  262|   109k|                    {
  263|       |                        /* IT + Residual + Recon */
  264|   109k|                        ret = isvcd_process_inter_mb_rsd_pred_target_lyr(
  265|   109k|                            ps_svc_lyr_dec, ps_cur_mb_info, j, 0, pu2_res_luma_csbp);
  266|   109k|                        if(ret != OK) return ret;
  ------------------
  |  |  114|   109k|#define OK        0
  ------------------
  |  Branch (266:28): [True: 0, False: 109k]
  ------------------
  267|   109k|                    }
  268|   145k|                }
  269|   145k|            }
  270|       |
  271|   469k|            else if((ps_cur_mb_info->u1_mb_type != MB_SKIP) &&
  ------------------
  |  |  456|   469k|#define MB_SKIP     255
  ------------------
  |  Branch (271:21): [True: 56.9k, False: 412k]
  ------------------
  272|  56.9k|                    (ps_cur_mb_info->u1_mb_type != MB_INFER))
  ------------------
  |  |  112|  56.9k|#define MB_INFER 250
  ------------------
  |  Branch (272:21): [True: 11.9k, False: 44.9k]
  ------------------
  273|  11.9k|            {
  274|  11.9k|                if((u1_ipcm_th + 25) != ps_cur_mb_info->u1_mb_type)
  ------------------
  |  Branch (274:20): [True: 11.8k, False: 108]
  ------------------
  275|  11.8k|                {
  276|  11.8k|                    ps_cur_mb_info->u1_mb_type -= (u1_skip_th + 1);
  277|  11.8k|                    ih264d_process_intra_mb(ps_dec, ps_cur_mb_info, j);
  278|  11.8k|                    isvcd_update_intra_mb_inter_layer_info(ps_svc_lyr_dec, ps_cur_mb_info);
  279|  11.8k|                }
  280|    108|                else
  281|    108|                {
  282|    108|                    isvcd_update_ipcm_mb_inter_layer_info(ps_svc_lyr_dec, ps_cur_mb_info);
  283|    108|                }
  284|  11.9k|                *pu2_res_luma_csbp = 0;
  285|  11.9k|            }
  286|   457k|            else if(ps_cur_mb_info->u1_mb_type == MB_INFER)
  ------------------
  |  |  112|   457k|#define MB_INFER 250
  ------------------
  |  Branch (286:21): [True: 44.9k, False: 412k]
  ------------------
  287|  44.9k|            {
  288|       |                /* inter layer intra prediction : intra upsample, IQ, IT ,deblock */
  289|  44.9k|                {
  290|       |                    /* Intra resample for IBL mode */
  291|  44.9k|                    ret = isvcd_process_ibl_mb(ps_svc_lyr_dec, ps_cur_mb_info, j, 0);
  292|  44.9k|                    if(ret != OK) return ret;
  ------------------
  |  |  114|  44.9k|#define OK        0
  ------------------
  |  Branch (292:24): [True: 0, False: 44.9k]
  ------------------
  293|       |                    /* Pass intra resample as pred to Recon generation */
  294|  44.9k|                    ih264d_process_inter_mb(ps_dec, ps_cur_mb_info, j);
  295|  44.9k|                    isvcd_update_inter_mb_inter_layer_info(ps_svc_lyr_dec, ps_cur_mb_info, 1);
  296|  44.9k|                    *pu2_res_luma_csbp = ps_cur_mb_info->u2_luma_csbp;
  297|  44.9k|                }
  298|  44.9k|                ps_dec->pi1_left_pred_mode[0] = DC;
  ------------------
  |  |  431|  44.9k|#define DC      2
  ------------------
  299|  44.9k|                ps_dec->pi1_left_pred_mode[1] = DC;
  ------------------
  |  |  431|  44.9k|#define DC      2
  ------------------
  300|  44.9k|                ps_dec->pi1_left_pred_mode[2] = DC;
  ------------------
  |  |  431|  44.9k|#define DC      2
  ------------------
  301|  44.9k|                ps_dec->pi1_left_pred_mode[3] = DC;
  ------------------
  |  |  431|  44.9k|#define DC      2
  ------------------
  302|       |
  303|  44.9k|                ps_cur_mb_info->ps_curmb->pi1_intrapredmodes[0] = DC;
  ------------------
  |  |  431|  44.9k|#define DC      2
  ------------------
  304|  44.9k|                ps_cur_mb_info->ps_curmb->pi1_intrapredmodes[1] = DC;
  ------------------
  |  |  431|  44.9k|#define DC      2
  ------------------
  305|  44.9k|                ps_cur_mb_info->ps_curmb->pi1_intrapredmodes[2] = DC;
  ------------------
  |  |  431|  44.9k|#define DC      2
  ------------------
  306|  44.9k|                ps_cur_mb_info->ps_curmb->pi1_intrapredmodes[3] = DC;
  ------------------
  |  |  431|  44.9k|#define DC      2
  ------------------
  307|       |
  308|  44.9k|                isvcd_update_ibl_mb_inter_layer_info(ps_svc_lyr_dec, ps_cur_mb_info);
  309|  44.9k|            }
  310|       |
  311|   615k|            if(ps_dec->u4_use_intrapred_line_copy == 1)
  ------------------
  |  Branch (311:16): [True: 615k, False: 0]
  ------------------
  312|   615k|                ih264d_copy_intra_pred_line(ps_dec, ps_cur_mb_info, j);
  313|   615k|        }
  314|       |
  315|   615k|        DATA_SYNC();
  ------------------
  |  |  116|   615k|#define DATA_SYNC()  __sync_synchronize()
  ------------------
  316|       |
  317|   615k|        u4_mb_num = ps_cur_mb_info->u2_mbx + ps_dec->u2_frm_wd_in_mbs * ps_cur_mb_info->u2_mby;
  318|   615k|        UPDATE_MB_MAP_MBNUM_BYTE(ps_dec->pu1_recon_mb_map, u4_mb_num);
  ------------------
  |  |  136|   615k|#define UPDATE_MB_MAP_MBNUM_BYTE(mb_map, u4_mb_number)                                                  \
  |  |  137|   615k|{                                                                                                   \
  |  |  138|   615k|        volatile UWORD8 *pu1_mb_flag;                                                                       \
  |  |  139|   615k|                                                                                                    \
  |  |  140|   615k|        pu1_mb_flag    = (UWORD8 *)mb_map + (u4_mb_number);                                                     \
  |  |  141|   615k|        /*                                                                                          \
  |  |  142|   615k|         * In case of MbAff, update the mb_map only if the entire MB is done. We can check that     \
  |  |  143|   615k|         * by checking if Y is odd, implying that this is the second row in the MbAff MB            \
  |  |  144|   615k|         */                                                                                         \
  |  |  145|   615k|        (*pu1_mb_flag) = 1;                                                             \
  |  |  146|   615k|}
  ------------------
  319|   615k|        ps_dec->cur_dec_mb_num++;
  320|   615k|    }
  321|       |
  322|       |    /*N MB deblocking*/
  323|   188k|    if(ps_dec->u4_nmb_deblk == 1)
  ------------------
  |  Branch (323:8): [True: 0, False: 188k]
  ------------------
  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|   188k|    if(ps_dec->cur_dec_mb_num > ps_dec->ps_cur_sps->u4_max_mb_addr)
  ------------------
  |  Branch (347:8): [True: 19.3k, False: 169k]
  ------------------
  348|  19.3k|        ps_dec->u4_cur_slice_decode_done = 1;
  349|       |
  350|   188k|    if(i != u4_num_mbs)
  ------------------
  |  Branch (350:8): [True: 6.96k, False: 181k]
  ------------------
  351|  6.96k|    {
  352|  6.96k|        u4_end_of_row = 0;
  353|       |        /*Number of MB's left in row*/
  354|  6.96k|        u4_num_mbs_next = u4_num_mbs_next + ((u4_num_mbs - i) >> u1_mbaff);
  355|  6.96k|    }
  356|       |
  357|   188k|    ih264d_decode_tfr_nmb(ps_dec, (i), u4_num_mbs_next, u4_end_of_row);
  358|       |
  359|   188k|    return OK;
  ------------------
  |  |  114|   188k|#define OK        0
  ------------------
  360|   188k|}
isvcd_decode_slice_thread:
  381|  27.7k|{
  382|  27.7k|    UWORD32 u4_num_mbs_next, u4_num_mbsleft, u4_end_of_row = 0;
  383|  27.7k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
  384|  27.7k|    const UWORD32 i2_pic_wdin_mbs = ps_dec->u2_frm_wd_in_mbs;
  385|  27.7k|    UWORD32 u4_mbaff, u4_num_mbs;
  386|       |
  387|  27.7k|    UWORD16 u2_first_mb_in_slice;
  388|  27.7k|    UWORD16 i16_mb_x, i16_mb_y;
  389|  27.7k|    UWORD8 u1_field_pic;
  390|  27.7k|    UWORD32 u4_frame_stride, x_offset, y_offset;
  391|  27.7k|    WORD32 ret;
  392|  27.7k|    tfr_ctxt_t *ps_trns_addr;
  393|       |
  394|       |    /*check for mb map of first mb in slice to ensure slice header is parsed*/
  395|   137k|    while(1)
  ------------------
  |  Branch (395:11): [True: 137k, Folded]
  ------------------
  396|   137k|    {
  397|   137k|        UWORD32 u4_mb_num = ps_dec->cur_dec_mb_num;
  398|   137k|        UWORD32 u4_cond = 0;
  399|   137k|        WORD32 nop_cnt = 8 * 128;
  400|   137k|        CHECK_MB_MAP_BYTE(u4_mb_num, ps_dec->pu1_dec_mb_map, u4_cond);
  ------------------
  |  |   80|   137k|#define CHECK_MB_MAP_BYTE(u4_mb_num, mb_map, u4_cond)                                               \
  |  |   81|   137k|{                                                                                                   \
  |  |   82|   137k|        volatile UWORD8 *pu1_mb_flag;                                                               \
  |  |   83|   137k|                                                                                                    \
  |  |   84|   137k|        pu1_mb_flag    = (UWORD8 *)mb_map + (u4_mb_num );                                           \
  |  |   85|   137k|                                                                                                    \
  |  |   86|   137k|        u4_cond = (*pu1_mb_flag);                                                                   \
  |  |   87|   137k|}
  ------------------
  401|   137k|        if(u4_cond)
  ------------------
  |  Branch (401:12): [True: 27.1k, False: 110k]
  ------------------
  402|  27.1k|        {
  403|  27.1k|            break;
  404|  27.1k|        }
  405|   110k|        else
  406|   110k|        {
  407|   110k|            if(nop_cnt > 0)
  ------------------
  |  Branch (407:16): [True: 110k, False: 0]
  ------------------
  408|   110k|            {
  409|   110k|                nop_cnt -= 128;
  410|   110k|                NOP(128);
  ------------------
  |  |   87|  14.2M|#define NOP(nop_cnt) {UWORD32 nop_i; for (nop_i = 0; nop_i < nop_cnt; nop_i++) asm("nop");}
  |  |  ------------------
  |  |  |  Branch (87:54): [True: 14.1M, False: 110k]
  |  |  ------------------
  ------------------
  411|   110k|            }
  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|   110k|            if(1 == ps_svc_lyr_dec->u1_error_in_cur_frame)
  ------------------
  |  Branch (427:16): [True: 621, False: 109k]
  ------------------
  428|    621|            {
  429|    621|                return NOT_OK;
  ------------------
  |  |  116|    621|#define NOT_OK    -1
  ------------------
  430|    621|            }
  431|   109k|            DEBUG_THREADS_PRINTF(
  432|   109k|                "waiting for mb mapcur_dec_mb_num = %d,ps_dec->u2_cur_mb_addr  = "
  433|   109k|                "%d\n",
  434|   109k|                u2_cur_dec_mb_num, ps_dec->u2_cur_mb_addr);
  435|   109k|        }
  436|   137k|    }
  437|       |
  438|  27.1k|    u4_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
  439|  27.1k|    u2_first_mb_in_slice = ps_dec->ps_decode_cur_slice->u4_first_mb_in_slice;
  440|  27.1k|    i16_mb_x = MOD(u2_first_mb_in_slice, i2_pic_wdin_mbs);
  ------------------
  |  |   64|  27.1k|#define MOD(x,y) ((x)%(y))
  ------------------
  441|  27.1k|    i16_mb_y = DIV(u2_first_mb_in_slice, i2_pic_wdin_mbs);
  ------------------
  |  |   65|  27.1k|#define DIV(x,y) ((x)/(y))
  ------------------
  442|  27.1k|    i16_mb_y <<= u4_mbaff;
  443|  27.1k|    ps_dec->i2_dec_thread_mb_y = i16_mb_y;
  444|  27.1k|    ps_dec->cur_dec_mb_num = u2_first_mb_in_slice << u4_mbaff;
  445|       |
  446|  27.1k|    if((ps_dec->u4_num_cores == 2) || !ps_dec->i1_recon_in_thread3_flag)
  ------------------
  |  Branch (446:8): [True: 27.1k, False: 0]
  |  Branch (446:39): [True: 0, False: 0]
  ------------------
  447|  27.1k|    {
  448|  27.1k|        ps_dec->pv_proc_tu_coeff_data =
  449|  27.1k|            (void *) ps_dec->ps_decode_cur_slice->pv_tu_coeff_data_start;
  450|  27.1k|    }
  451|       |
  452|       |    // recalculate recon pointers
  453|  27.1k|    u1_field_pic = ps_dec->ps_cur_slice->u1_field_pic_flag;
  454|  27.1k|    u4_frame_stride = ps_dec->u2_frm_wd_y << u1_field_pic;
  455|  27.1k|    x_offset = i16_mb_x << 4;
  456|  27.1k|    y_offset = (i16_mb_y * u4_frame_stride) << 4;
  457|       |
  458|  27.1k|    ps_trns_addr = &(ps_dec->s_tran_addrecon);
  459|       |
  460|  27.1k|    ps_trns_addr->pu1_dest_y = ps_dec->s_cur_pic.pu1_buf1 + x_offset + y_offset;
  461|       |
  462|  27.1k|    u4_frame_stride = ps_dec->u2_frm_wd_uv << u1_field_pic;
  463|  27.1k|    x_offset >>= 1;
  464|  27.1k|    y_offset = (i16_mb_y * u4_frame_stride) << 3;
  465|  27.1k|    x_offset *= YUV420SP_FACTOR;
  ------------------
  |  |  119|  27.1k|#define YUV420SP_FACTOR 2
  ------------------
  466|       |
  467|  27.1k|    ps_trns_addr->pu1_dest_u = ps_dec->s_cur_pic.pu1_buf2 + x_offset + y_offset;
  468|  27.1k|    ps_trns_addr->pu1_dest_v = ps_dec->s_cur_pic.pu1_buf3 + x_offset + y_offset;
  469|       |
  470|  27.1k|    ps_trns_addr->pu1_mb_y = ps_trns_addr->pu1_dest_y;
  471|  27.1k|    ps_trns_addr->pu1_mb_u = ps_trns_addr->pu1_dest_u;
  472|  27.1k|    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.1k|    {
  476|  27.1k|        ps_dec->p_mc_dec_thread = ih264d_motion_compensate_bp;
  477|  27.1k|        ps_dec->p_form_mb_part_info_thread = ih264d_form_mb_part_info_bp;
  478|  27.1k|    }
  479|  27.1k|    {
  480|  27.1k|        UWORD8 uc_nofield_nombaff;
  481|  27.1k|        uc_nofield_nombaff = ((ps_dec->ps_cur_slice->u1_field_pic_flag == 0) &&
  ------------------
  |  Branch (481:31): [True: 27.1k, False: 0]
  ------------------
  482|  27.1k|                              (ps_dec->ps_cur_slice->u1_mbaff_frame_flag == 0) &&
  ------------------
  |  Branch (482:31): [True: 27.1k, False: 0]
  ------------------
  483|  27.1k|                              (ps_dec->ps_decode_cur_slice->slice_type != B_SLICE) &&
  ------------------
  |  |  369|  27.1k|#define B_SLICE  1
  ------------------
  |  Branch (483:31): [True: 23.4k, False: 3.74k]
  ------------------
  484|  23.4k|                              (ps_dec->ps_cur_pps->u1_wted_pred_flag == 0));
  ------------------
  |  Branch (484:31): [True: 20.0k, False: 3.30k]
  ------------------
  485|       |
  486|  27.1k|        if(uc_nofield_nombaff == 0)
  ------------------
  |  Branch (486:12): [True: 7.04k, False: 20.0k]
  ------------------
  487|  7.04k|        {
  488|  7.04k|            ps_dec->p_mc_dec_thread = ih264d_motion_compensate_mp;
  489|  7.04k|            ps_dec->p_form_mb_part_info_thread = ih264d_form_mb_part_info_mp;
  490|  7.04k|        }
  491|  27.1k|    }
  492|       |
  493|  27.1k|    ps_dec->u4_cur_slice_decode_done = 0;
  494|       |
  495|   215k|    while(ps_dec->u4_cur_slice_decode_done != 1)
  ------------------
  |  Branch (495:11): [True: 189k, False: 26.3k]
  ------------------
  496|   189k|    {
  497|   189k|        u4_num_mbsleft = ((i2_pic_wdin_mbs - i16_mb_x) << u4_mbaff);
  498|       |
  499|   189k|        if(u4_num_mbsleft <= ps_dec->u4_recon_mb_grp)
  ------------------
  |  Branch (499:12): [True: 189k, False: 0]
  ------------------
  500|   189k|        {
  501|   189k|            u4_num_mbs = u4_num_mbsleft;
  502|       |
  503|       |            /*Indicate number of mb's left in a row*/
  504|   189k|            u4_num_mbs_next = 0;
  505|   189k|            u4_end_of_row = 1;
  506|   189k|            i16_mb_x = 0;
  507|   189k|        }
  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|   189k|        if(ps_svc_lyr_dec->u1_layer_identifier == TARGET_LAYER)
  ------------------
  |  |  110|   189k|#define TARGET_LAYER 2
  ------------------
  |  Branch (517:12): [True: 189k, False: 0]
  ------------------
  518|   189k|        {
  519|   189k|            ret = isvcd_decode_recon_tfr_nmb_thread(ps_svc_lyr_dec, u4_num_mbs, u4_num_mbs_next,
  520|   189k|                                                    u4_end_of_row);
  521|   189k|        }
  522|   189k|        if(ret != OK) return ret;
  ------------------
  |  |  114|   189k|#define OK        0
  ------------------
  |  Branch (522:12): [True: 802, False: 188k]
  ------------------
  523|   189k|    }
  524|  26.3k|    return OK;
  ------------------
  |  |  114|  26.3k|#define OK        0
  ------------------
  525|  27.1k|}
isvcd_decode_picture_thread:
  546|  20.8k|{
  547|  20.8k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
  548|  20.8k|    WORD32 ret;
  549|  20.8k|    ithread_set_name("isvcd_decode_picture_thread");
  550|  20.8k|    while(1)
  ------------------
  |  Branch (550:11): [True: 20.8k, Folded]
  ------------------
  551|  20.8k|    {
  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|  27.7k|        while(1)
  ------------------
  |  Branch (565:15): [True: 27.7k, Folded]
  ------------------
  566|  27.7k|        {
  567|       |            /*Complete all writes before processing next slice*/
  568|       |
  569|  27.7k|            DEBUG_THREADS_PRINTF(" Entering decode slice svc ext\n");
  570|       |
  571|  27.7k|            ret = isvcd_decode_slice_thread(ps_svc_lyr_dec);
  572|  27.7k|            if(OK != ret) break;
  ------------------
  |  |  114|  27.7k|#define OK        0
  ------------------
  |  Branch (572:16): [True: 1.42k, False: 26.3k]
  ------------------
  573|  26.3k|            DEBUG_THREADS_PRINTF(" Exit  isvcd_decode_slice_thread\n");
  574|       |
  575|  26.3k|            if(ps_dec->cur_dec_mb_num > ps_dec->ps_cur_sps->u4_max_mb_addr)
  ------------------
  |  Branch (575:16): [True: 19.3k, False: 6.96k]
  ------------------
  576|  19.3k|            {
  577|       |                /*Last slice in frame*/
  578|  19.3k|                break;
  579|  19.3k|            }
  580|  6.96k|            else
  581|  6.96k|            {
  582|  6.96k|                ps_dec->ps_decode_cur_slice++;
  583|  6.96k|                ps_dec->u2_cur_slice_num_dec_thread++;
  584|  6.96k|            }
  585|  26.3k|        }
  586|  20.8k|        if(ps_dec->u4_output_present && (2 == ps_dec->u4_num_cores) &&
  ------------------
  |  Branch (586:12): [True: 8.30k, False: 12.5k]
  |  Branch (586:41): [True: 8.30k, False: 0]
  ------------------
  587|  8.30k|           (ps_dec->u4_fmt_conv_cur_row < ps_dec->s_disp_frame_info.u4_y_ht))
  ------------------
  |  Branch (587:12): [True: 7.95k, False: 343]
  ------------------
  588|  7.95k|        {
  589|  7.95k|            ps_dec->u4_fmt_conv_num_rows =
  590|  7.95k|                (ps_dec->s_disp_frame_info.u4_y_ht - ps_dec->u4_fmt_conv_cur_row);
  591|  7.95k|            ih264d_format_convert(ps_dec, &(ps_dec->s_disp_op), ps_dec->u4_fmt_conv_cur_row,
  592|  7.95k|                                  ps_dec->u4_fmt_conv_num_rows);
  593|  7.95k|            ps_dec->u4_fmt_conv_cur_row += ps_dec->u4_fmt_conv_num_rows;
  594|  7.95k|        }
  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|  20.8k|        break;
  606|  20.8k|#endif
  607|  20.8k|    }
  608|  20.8k|}

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

isvcd_parse_vui_ext_parametres:
   68|  1.09k|{
   69|  1.09k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
   70|  1.09k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
   71|  1.09k|    WORD32 ret;
   72|  1.09k|    UWORD32 u4_i;
   73|       |
   74|  1.09k|    ps_svc_vui_ext->u4_vui_ext_num_entries_minus1 = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
   75|  1.09k|    if(ps_svc_vui_ext->u4_vui_ext_num_entries_minus1 > 1023)
  ------------------
  |  Branch (75:8): [True: 119, False: 978]
  ------------------
   76|    119|    {
   77|    119|        return ERROR_INV_SPS_PPS_T;
   78|    119|    }
   79|       |
   80|  25.8k|    for(u4_i = 0; u4_i <= ps_svc_vui_ext->u4_vui_ext_num_entries_minus1; u4_i++)
  ------------------
  |  Branch (80:19): [True: 25.0k, False: 823]
  ------------------
   81|  25.0k|    {
   82|  25.0k|        ps_svc_vui_ext->u1_vui_ext_dependency_id[u4_i] = ih264d_get_bits_h264(ps_bitstrm, 3);
   83|  25.0k|        ps_svc_vui_ext->u1_vui_ext_quality_id[u4_i] = ih264d_get_bits_h264(ps_bitstrm, 4);
   84|  25.0k|        ps_svc_vui_ext->u1_vui_ext_temporal_id[u4_i] = ih264d_get_bits_h264(ps_bitstrm, 3);
   85|  25.0k|        ps_svc_vui_ext->u1_vui_ext_timing_info_present_flag[u4_i] = ih264d_get_bit_h264(ps_bitstrm);
   86|       |
   87|  25.0k|        if(1 == ps_svc_vui_ext->u1_vui_ext_timing_info_present_flag[u4_i])
  ------------------
  |  Branch (87:12): [True: 2.12k, False: 22.8k]
  ------------------
   88|  2.12k|        {
   89|  2.12k|            ps_svc_vui_ext->u4_vui_ext_num_units_in_tick[u4_i] =
   90|  2.12k|                ih264d_get_bits_h264(ps_bitstrm, 32);
   91|  2.12k|            ps_svc_vui_ext->u4_vui_ext_time_scale[u4_i] = ih264d_get_bits_h264(ps_bitstrm, 32);
   92|  2.12k|            ps_svc_vui_ext->u1_vui_ext_fixed_frame_rate_flag[u4_i] =
   93|  2.12k|                ih264d_get_bit_h264(ps_bitstrm);
   94|  2.12k|        }
   95|       |
   96|  25.0k|        ps_svc_vui_ext->u1_vui_ext_nal_hrd_params_present_flag[u4_i] =
   97|  25.0k|            ih264d_get_bit_h264(ps_bitstrm);
   98|  25.0k|        if(ps_svc_vui_ext->u1_vui_ext_nal_hrd_params_present_flag[u4_i])
  ------------------
  |  Branch (98:12): [True: 2.13k, False: 22.8k]
  ------------------
   99|  2.13k|        {
  100|  2.13k|            ret = ih264d_parse_hrd_parametres(&ps_svc_vui_ext->s_nal_hrd[u4_i], ps_bitstrm);
  101|  2.13k|            if(ret != OK) return ret;
  ------------------
  |  |  114|  2.13k|#define OK        0
  ------------------
  |  Branch (101:16): [True: 67, False: 2.06k]
  ------------------
  102|  2.13k|        }
  103|  24.9k|        ps_svc_vui_ext->u1_vui_ext_vcl_hrd_params_present_flag[u4_i] =
  104|  24.9k|            ih264d_get_bit_h264(ps_bitstrm);
  105|  24.9k|        if(ps_svc_vui_ext->u1_vui_ext_vcl_hrd_params_present_flag[u4_i])
  ------------------
  |  Branch (105:12): [True: 2.08k, False: 22.8k]
  ------------------
  106|  2.08k|        {
  107|  2.08k|            ret = ih264d_parse_hrd_parametres(&ps_svc_vui_ext->s_vcl_hrd[u4_i], ps_bitstrm);
  108|  2.08k|            if(ret != OK) return ret;
  ------------------
  |  |  114|  2.08k|#define OK        0
  ------------------
  |  Branch (108:16): [True: 88, False: 1.99k]
  ------------------
  109|  2.08k|        }
  110|  24.8k|        if(ps_svc_vui_ext->u1_vui_ext_nal_hrd_params_present_flag[u4_i] ||
  ------------------
  |  Branch (110:12): [True: 2.00k, False: 22.8k]
  ------------------
  111|  22.8k|           ps_svc_vui_ext->u1_vui_ext_vcl_hrd_params_present_flag[u4_i])
  ------------------
  |  Branch (111:12): [True: 625, False: 22.2k]
  ------------------
  112|  2.62k|        {
  113|  2.62k|            ps_svc_vui_ext->u1_vui_ext_low_delay_hrd_flag[u4_i] = ih264d_get_bit_h264(ps_bitstrm);
  114|  2.62k|        }
  115|  24.8k|        ps_svc_vui_ext->u1_vui_ext_pic_struct_present_flag[u4_i] = ih264d_get_bit_h264(ps_bitstrm);
  116|  24.8k|    }
  117|    823|    return OK;
  ------------------
  |  |  114|    823|#define OK        0
  ------------------
  118|    978|}

ih264d_init_arch:
   85|  84.0k|{
   86|  84.0k|#ifdef DEFAULT_ARCH
   87|  84.0k|#if DEFAULT_ARCH == D_ARCH_X86_SSE42
   88|  84.0k|    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|  84.0k|}

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

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

isvcd_init_function_ptr:
   69|   151k|{
   70|   151k|    isvcd_init_function_ptr_generic(ps_svc_lyr_dec);
   71|   151k|    switch(ps_svc_lyr_dec->s_dec.e_processor_arch)
   72|   151k|    {
   73|  24.9k|        case ARCH_X86_GENERIC:
  ------------------
  |  Branch (73:9): [True: 24.9k, False: 126k]
  ------------------
   74|  24.9k|            isvcd_init_function_ptr_generic(ps_svc_lyr_dec);
   75|  24.9k|            break;
   76|  7.33k|        case ARCH_X86_SSSE3:
  ------------------
  |  Branch (76:9): [True: 7.33k, False: 144k]
  ------------------
   77|  7.33k|            ih264d_init_function_ptr_ssse3(&ps_svc_lyr_dec->s_dec);
   78|  7.33k|            break;
   79|  90.6k|        case ARCH_X86_SSE42:
  ------------------
  |  Branch (79:9): [True: 90.6k, False: 60.9k]
  ------------------
   80|   119k|        default:
  ------------------
  |  Branch (80:9): [True: 28.6k, False: 122k]
  ------------------
   81|   119k|            ih264d_init_function_ptr_ssse3(&ps_svc_lyr_dec->s_dec);
   82|   119k|            isvcd_init_function_ptr_sse42(ps_svc_lyr_dec);
   83|   119k|            break;
   84|   151k|    }
   85|   151k|}

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

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

isvcd_iquant_itrans_residual_recon_4x4_sse42:
   82|  25.0k|{
   83|  25.0k|    WORD32 i4_nnz = 0;
   84|  25.0k|    WORD32 row_0, row_1, row_2, row_3;
   85|  25.0k|    UWORD32 *pu4_out = (UWORD32 *) pu1_out;
   86|  25.0k|    __m128i src_r0_r1, src_r2_r3;
   87|  25.0k|    __m128i src_r0, src_r1, src_r2, src_r3;
   88|  25.0k|    __m128i scalemat_r0_r1, scalemat_r2_r3;
   89|  25.0k|    __m128i pred_r0, pred_r1, pred_r2, pred_r3;
   90|  25.0k|    __m128i rsd_r0, rsd_r1, rsd_r2, rsd_r3;
   91|  25.0k|    __m128i sign_reg, dequant_r0_r1, dequant_r2_r3;
   92|  25.0k|    __m128i zero_8x16b = _mm_setzero_si128();  // all bits reset to zero
   93|  25.0k|    __m128i temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7;
   94|  25.0k|    __m128i resq_r0, resq_r1, resq_r2, resq_r3;
   95|  25.0k|    __m128i add_rshift = _mm_set1_epi32((u4_qp_div_6 < 4) ? (1 << (3 - u4_qp_div_6)) : 0);
  ------------------
  |  Branch (95:41): [True: 11.8k, False: 13.1k]
  ------------------
   96|  25.0k|    __m128i value_32 = _mm_set1_epi32(32);
   97|  25.0k|    __m128i dupmax_8x16b = _mm_set1_epi16(RSD_MAX);
  ------------------
  |  |  772|  25.0k|#define RSD_MAX 255
  ------------------
   98|  25.0k|    __m128i dupmin_8x16b = _mm_set1_epi16(RSD_MIN);
  ------------------
  |  |  773|  25.0k|#define RSD_MIN -255
  ------------------
   99|       |
  100|  25.0k|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|  25.0k|#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|  25.0k|    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|  25.0k|    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|  25.0k|    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|  25.0k|    scalemat_r2_r3 = _mm_loadu_si128((__m128i *) (pu2_iscal_mat + 8));
  114|       |    // q00 q01 q02 q03 q10 q11 q12 q13 -- all 16 bits
  115|  25.0k|    dequant_r0_r1 = _mm_loadu_si128((__m128i *) (pu2_weigh_mat));
  116|       |    // q20 q21 q22 q23 q30 q31 q32 q33 -- all 16 bits
  117|  25.0k|    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|  25.0k|    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|  25.0k|    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|  25.0k|    temp4 = _mm_unpacklo_epi16(temp0, zero_8x16b);
  124|       |    // b10*q10 0 b11*q11 0 b12*q12 0 b13*q13 0 -- 16 bit long
  125|  25.0k|    temp5 = _mm_unpackhi_epi16(temp0, zero_8x16b);
  126|       |    // b00*q00 0 b01*q01 0 b02*q02 0 b03*q03 0 -- 16 bit long
  127|  25.0k|    temp6 = _mm_unpacklo_epi16(temp1, zero_8x16b);
  128|       |    // b10*q10 0 b11*q11 0 b12*q12 0 b13*q13 0 -- 16 bit long
  129|  25.0k|    temp7 = _mm_unpackhi_epi16(temp1, zero_8x16b);
  130|  25.0k|    src_r0 = _mm_unpacklo_epi16(src_r0_r1, zero_8x16b);  // a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  131|  25.0k|    src_r1 = _mm_unpackhi_epi16(src_r0_r1, zero_8x16b);  // a10 0 a11 0 a12 0 a13 0 -- 16 bit long
  132|  25.0k|    src_r2 = _mm_unpacklo_epi16(src_r2_r3, zero_8x16b);  // a20 0 a21 0 a22 0 a23 0 -- 16 bit long
  133|  25.0k|    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|  25.0k|    temp4 = _mm_madd_epi16(src_r0, temp4);
  136|  25.0k|    temp5 = _mm_madd_epi16(src_r1, temp5);
  137|  25.0k|    temp6 = _mm_madd_epi16(src_r2, temp6);
  138|  25.0k|    temp7 = _mm_madd_epi16(src_r3, temp7);
  139|       |
  140|  25.0k|    if(u4_qp_div_6 >= 4)
  ------------------
  |  Branch (140:8): [True: 13.1k, False: 11.8k]
  ------------------
  141|  13.1k|    {
  142|  13.1k|        resq_r0 = _mm_slli_epi32(temp4, u4_qp_div_6 - 4);
  143|  13.1k|        resq_r1 = _mm_slli_epi32(temp5, u4_qp_div_6 - 4);
  144|  13.1k|        resq_r2 = _mm_slli_epi32(temp6, u4_qp_div_6 - 4);
  145|  13.1k|        resq_r3 = _mm_slli_epi32(temp7, u4_qp_div_6 - 4);
  146|  13.1k|    }
  147|  11.8k|    else
  148|  11.8k|    {
  149|  11.8k|        temp4 = _mm_add_epi32(temp4, add_rshift);
  150|  11.8k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  151|  11.8k|        temp6 = _mm_add_epi32(temp6, add_rshift);
  152|  11.8k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  153|  11.8k|        resq_r0 = _mm_srai_epi32(temp4, 4 - u4_qp_div_6);
  154|  11.8k|        resq_r1 = _mm_srai_epi32(temp5, 4 - u4_qp_div_6);
  155|  11.8k|        resq_r2 = _mm_srai_epi32(temp6, 4 - u4_qp_div_6);
  156|  11.8k|        resq_r3 = _mm_srai_epi32(temp7, 4 - u4_qp_div_6);
  157|  11.8k|    }
  158|       |
  159|  25.0k|    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: 25.0k]
  ------------------
  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|  25.0k|    temp1 = _mm_unpacklo_epi32(resq_r0, resq_r1);  // a0 b0 a1 b1
  172|  25.0k|    temp3 = _mm_unpacklo_epi32(resq_r2, resq_r3);  // c0 d0 c1 d1
  173|  25.0k|    temp2 = _mm_unpackhi_epi32(resq_r0, resq_r1);  // a2 b2 a3 b3
  174|  25.0k|    temp4 = _mm_unpackhi_epi32(resq_r2, resq_r3);  // c2 d2 c3 d3
  175|  25.0k|    resq_r0 = _mm_unpacklo_epi64(temp1, temp3);    // a0 b0 c0 d0
  176|  25.0k|    resq_r1 = _mm_unpackhi_epi64(temp1, temp3);    // a1 b1 c1 d1
  177|  25.0k|    resq_r2 = _mm_unpacklo_epi64(temp2, temp4);    // a2 b2 c2 d2
  178|  25.0k|    resq_r3 = _mm_unpackhi_epi64(temp2, temp4);    // a3 b3 c3 d3
  179|       |    // Transform starts -- horizontal transform
  180|       |    /*------------------------------------------------------------------*/
  181|       |    /* z0 = w0 + w2                                             */
  182|  25.0k|    temp0 = _mm_add_epi32(resq_r0, resq_r2);
  183|       |    /* z1 = w0 - w2                                             */
  184|  25.0k|    temp1 = _mm_sub_epi32(resq_r0, resq_r2);
  185|       |    /* z2 = (w1 >> 1) - w3                                      */
  186|  25.0k|    temp2 = _mm_srai_epi32(resq_r1, 1);     //(w1>>1)
  187|  25.0k|    temp2 = _mm_sub_epi32(temp2, resq_r3);  //(w1>>1) - w3
  188|       |    /* z3 = w1 + (w3 >> 1)                                      */
  189|  25.0k|    temp3 = _mm_srai_epi32(resq_r3, 1);  //(w3>>1) + w1
  190|  25.0k|    temp3 = _mm_add_epi32(temp3, resq_r1);
  191|       |    /*----------------------------------------------------------*/
  192|       |    /* x0 = z0 + z3                                             */
  193|  25.0k|    resq_r0 = _mm_add_epi32(temp0, temp3);
  194|       |    /* x1 = z1 + z2                                             */
  195|  25.0k|    resq_r1 = _mm_add_epi32(temp1, temp2);
  196|       |    /* x2 = z1 - z2                                             */
  197|  25.0k|    resq_r2 = _mm_sub_epi32(temp1, temp2);
  198|       |    /* x3 = z0 - z3                                             */
  199|  25.0k|    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|  25.0k|    temp1 = _mm_unpacklo_epi32(resq_r0, resq_r1);  // a0 a1 b0 b1
  208|  25.0k|    temp3 = _mm_unpacklo_epi32(resq_r2, resq_r3);  // a2 a3 b2 b3
  209|  25.0k|    temp2 = _mm_unpackhi_epi32(resq_r0, resq_r1);  // c0 c1 d0 d1
  210|  25.0k|    temp4 = _mm_unpackhi_epi32(resq_r2, resq_r3);  // c2 c3 d2 d3
  211|  25.0k|    resq_r0 = _mm_unpacklo_epi64(temp1, temp3);    // a0 a1 a2 a3
  212|  25.0k|    resq_r1 = _mm_unpackhi_epi64(temp1, temp3);    // b0 b1 b2 b3
  213|  25.0k|    resq_r2 = _mm_unpacklo_epi64(temp2, temp4);    // c0 c1 c2 c3
  214|  25.0k|    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|  25.0k|    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|  25.0k|    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|  25.0k|    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|  25.0k|    pred_r3 = _mm_loadl_epi64((__m128i *) (&pu1_pred[3 * pred_strd]));
  226|       |
  227|  25.0k|    pred_r0 = _mm_cvtepu8_epi32(pred_r0);  // p00 p01 p02 p03 -- all 32 bits
  228|  25.0k|    pred_r1 = _mm_cvtepu8_epi32(pred_r1);  // p10 p11 p12 p13 -- all 32 bits
  229|  25.0k|    pred_r2 = _mm_cvtepu8_epi32(pred_r2);  // p20 p21 p22 p23 -- all 32 bits
  230|  25.0k|    pred_r3 = _mm_cvtepu8_epi32(pred_r3);  // p30 p31 p32 p33 -- all 32 bits
  231|       |
  232|       |    // Load resd buffer
  233|  25.0k|    rsd_r0 = _mm_loadl_epi64((__m128i *) (&pi2_rsd[0]));
  234|  25.0k|    rsd_r1 = _mm_loadl_epi64((__m128i *) (&pi2_rsd[rsd_strd]));
  235|  25.0k|    rsd_r2 = _mm_loadl_epi64((__m128i *) (&pi2_rsd[2 * rsd_strd]));
  236|  25.0k|    rsd_r3 = _mm_loadl_epi64((__m128i *) (&pi2_rsd[3 * rsd_strd]));
  237|       |
  238|  25.0k|    rsd_r0 = _mm_cvtepi16_epi32(rsd_r0);
  239|  25.0k|    rsd_r1 = _mm_cvtepi16_epi32(rsd_r1);
  240|  25.0k|    rsd_r2 = _mm_cvtepi16_epi32(rsd_r2);
  241|  25.0k|    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|  25.0k|    temp0 = _mm_add_epi32(resq_r0, resq_r2);
  250|       |    /* z1j = y0j - y2j                                                        */
  251|  25.0k|    temp1 = _mm_sub_epi32(resq_r0, resq_r2);
  252|       |    /* z2j = (y1j>>1) - y3j */
  253|  25.0k|    temp2 = _mm_srai_epi32(resq_r1, 1);  //(y1j>>1)
  254|  25.0k|    temp2 = _mm_sub_epi32(temp2, resq_r3);
  255|       |    /* z3j = y1j + (y3j>>1) */
  256|  25.0k|    temp3 = _mm_srai_epi32(resq_r3, 1);  //(y3j>>1)
  257|  25.0k|    temp3 = _mm_add_epi32(temp3, resq_r1);
  258|       |
  259|       |    /* x0j = z0j + z3j                                                        */
  260|  25.0k|    temp4 = _mm_add_epi32(temp0, temp3);
  261|  25.0k|    temp4 = _mm_add_epi32(temp4, value_32);
  262|  25.0k|    temp4 = _mm_srai_epi32(temp4, 6);
  263|       |
  264|  25.0k|    row_0 = _mm_test_all_ones(_mm_cmpeq_epi32(temp4, zero_8x16b));  // return 1 if all zeros, else 0
  265|  25.0k|    temp4 = _mm_add_epi32(temp4, rsd_r0);
  266|  25.0k|    temp4 = _mm_min_epi16(dupmax_8x16b, temp4);
  267|  25.0k|    temp4 = _mm_max_epi16(dupmin_8x16b, temp4);
  268|  25.0k|    temp4 = _mm_add_epi32(temp4, pred_r0);
  269|       |    /* x1j = z1j + z2j                                                        */
  270|  25.0k|    temp5 = _mm_add_epi32(temp1, temp2);
  271|  25.0k|    temp5 = _mm_add_epi32(temp5, value_32);
  272|  25.0k|    temp5 = _mm_srai_epi32(temp5, 6);
  273|       |
  274|  25.0k|    row_1 = _mm_test_all_ones(_mm_cmpeq_epi32(temp5, zero_8x16b));  // return 1 if all zeros, else 0
  275|  25.0k|    temp5 = _mm_add_epi32(temp5, rsd_r1);
  276|  25.0k|    temp5 = _mm_min_epi16(dupmax_8x16b, temp5);
  277|  25.0k|    temp5 = _mm_max_epi16(dupmin_8x16b, temp5);
  278|  25.0k|    temp5 = _mm_add_epi32(temp5, pred_r1);
  279|       |    /* x2j = z1j - z2j                                                        */
  280|  25.0k|    temp6 = _mm_sub_epi32(temp1, temp2);
  281|  25.0k|    temp6 = _mm_add_epi32(temp6, value_32);
  282|  25.0k|    temp6 = _mm_srai_epi32(temp6, 6);
  283|       |
  284|  25.0k|    row_2 = _mm_test_all_ones(_mm_cmpeq_epi32(temp6, zero_8x16b));  // return 1 if all zeros, else 0
  285|  25.0k|    temp6 = _mm_add_epi32(temp6, rsd_r2);
  286|  25.0k|    temp6 = _mm_min_epi16(dupmax_8x16b, temp6);
  287|  25.0k|    temp6 = _mm_max_epi16(dupmin_8x16b, temp6);
  288|  25.0k|    temp6 = _mm_add_epi32(temp6, pred_r2);
  289|       |    /* x3j = z0j - z3j                                                        */
  290|  25.0k|    temp7 = _mm_sub_epi32(temp0, temp3);
  291|  25.0k|    temp7 = _mm_add_epi32(temp7, value_32);
  292|  25.0k|    temp7 = _mm_srai_epi32(temp7, 6);
  293|       |
  294|  25.0k|    row_3 = _mm_test_all_ones(_mm_cmpeq_epi32(temp7, zero_8x16b));  // return 1 if all zeros, else 0
  295|  25.0k|    temp7 = _mm_add_epi32(temp7, rsd_r3);
  296|  25.0k|    temp7 = _mm_min_epi16(dupmax_8x16b, temp7);
  297|  25.0k|    temp7 = _mm_max_epi16(dupmin_8x16b, temp7);
  298|  25.0k|    temp7 = _mm_add_epi32(temp7, pred_r3);
  299|       |
  300|       |    // 32-bit to 16-bit conversion
  301|  25.0k|    temp0 = _mm_packs_epi32(temp4, temp5);
  302|  25.0k|    temp1 = _mm_packs_epi32(temp6, temp7);
  303|       |    /*------------------------------------------------------------------*/
  304|       |    // Clipping the results to 8 bits
  305|  25.0k|    sign_reg = _mm_cmpgt_epi16(temp0, zero_8x16b);  // sign check
  306|  25.0k|    temp0 = _mm_and_si128(temp0, sign_reg);
  307|  25.0k|    sign_reg = _mm_cmpgt_epi16(temp1, zero_8x16b);
  308|  25.0k|    temp1 = _mm_and_si128(temp1, sign_reg);
  309|       |
  310|  25.0k|    resq_r0 = _mm_packus_epi16(temp0, temp1);
  311|  25.0k|    resq_r1 = _mm_srli_si128(resq_r0, 4);
  312|  25.0k|    resq_r2 = _mm_srli_si128(resq_r1, 4);
  313|  25.0k|    resq_r3 = _mm_srli_si128(resq_r2, 4);
  314|       |
  315|  25.0k|    *pu4_out = _mm_cvtsi128_si32(resq_r0);
  316|  25.0k|    pu1_out += out_strd;
  317|  25.0k|    pu4_out = (UWORD32 *) (pu1_out);
  318|  25.0k|    *(pu4_out) = _mm_cvtsi128_si32(resq_r1);
  319|  25.0k|    pu1_out += out_strd;
  320|  25.0k|    pu4_out = (UWORD32 *) (pu1_out);
  321|  25.0k|    *(pu4_out) = _mm_cvtsi128_si32(resq_r2);
  322|  25.0k|    pu1_out += out_strd;
  323|  25.0k|    pu4_out = (UWORD32 *) (pu1_out);
  324|  25.0k|    *(pu4_out) = _mm_cvtsi128_si32(resq_r3);
  325|       |
  326|  25.0k|    i4_nnz = !(row_0 && row_1 && row_2 && row_3);
  ------------------
  |  Branch (326:16): [True: 1.82k, False: 23.2k]
  |  Branch (326:25): [True: 1.29k, False: 537]
  |  Branch (326:34): [True: 978, False: 312]
  |  Branch (326:43): [True: 936, False: 42]
  ------------------
  327|  25.0k|    return i4_nnz;
  328|  25.0k|}
isvcd_iquant_itrans_residual_recon_8x8_sse42:
  357|  19.8k|{
  358|  19.8k|    __m128i rsd_r01_b0, rsd_r23_b0, rsd_r45_b2, rsd_r67_b2;
  359|  19.8k|    __m128i rsd_r01_b1, rsd_r23_b1, rsd_r45_b3, rsd_r67_b3;
  360|       |
  361|  19.8k|    WORD32 row_01_b0, row_23_b0, row_45_b2, row_67_b2;
  362|  19.8k|    WORD32 row_01_b1, row_23_b1, row_45_b3, row_67_b3;
  363|  19.8k|    WORD32 i4_nnz, i4_nnz_b0, i4_nnz_b1, i4_nnz_b2, i4_nnz_b3;
  364|  19.8k|    __m128i src_r0;
  365|  19.8k|    __m128i scalemat_r0;
  366|  19.8k|    __m128i zero_8x16b = _mm_setzero_si128();  // all bits reset to zero
  367|  19.8k|    __m128i value_32 = _mm_set1_epi32(32);
  368|  19.8k|    __m128i add_rshift = _mm_set1_epi32((qp_div < 6) ? (1 << (5 - qp_div)) : 0);
  ------------------
  |  Branch (368:41): [True: 13.4k, False: 6.40k]
  ------------------
  369|  19.8k|    __m128i dequant_r0;
  370|  19.8k|    __m128i predload_r;
  371|  19.8k|    __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.8k|    __m128i rsd_r0, rsd_r1, rsd_r2, rsd_r3, rsd_r4, rsd_r5, rsd_r6, rsd_r7;
  374|  19.8k|    __m128i sign_reg;
  375|  19.8k|    __m128i src_r0_1, src_r0_2;
  376|  19.8k|    __m128i scalemat_r0_1, scalemat_r0_2;
  377|  19.8k|    __m128i temp1, temp2, temp3, temp4, temp5, temp6, temp7, temp8;
  378|  19.8k|    __m128i temp10, temp11, temp12, temp13, temp14, temp15, temp16, temp17, temp18, temp19, temp20;
  379|       |    // To store dequantization results
  380|  19.8k|    __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.8k|        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.8k|    __m128i dupmax_8x16b = _mm_set1_epi16(RSD_MAX);
  ------------------
  |  |  772|  19.8k|#define RSD_MAX 255
  ------------------
  383|  19.8k|    __m128i dupmin_8x16b = _mm_set1_epi16(RSD_MIN);
  ------------------
  |  |  773|  19.8k|#define RSD_MIN -255
  ------------------
  384|       |
  385|  19.8k|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|  19.8k|#define UNUSED(x) ((void)(x))
  ------------------
  386|  19.8k|    UNUSED(iq_start_idx);
  ------------------
  |  |   45|  19.8k|#define UNUSED(x) ((void)(x))
  ------------------
  387|  19.8k|    UNUSED(pi2_dc_ld_addr);
  ------------------
  |  |   45|  19.8k|#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.8k|    src_r0 = _mm_loadu_si128((__m128i *) (pi2_src));
  397|       |    // b00 b01 b02 b03 b04 b05 b06 b07 -- the scaling matrix 0th row
  398|  19.8k|    scalemat_r0 = _mm_loadu_si128((__m128i *) (pu2_iscale_mat));
  399|       |    // q0 q1 q2 q3 q4 q5 q6 q7 -- all 16 bits
  400|  19.8k|    dequant_r0 = _mm_loadu_si128((__m128i *) (&pu2_weigh_mat[0]));
  401|  19.8k|    src_r0_1 = _mm_unpacklo_epi16(src_r0, zero_8x16b);  // a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  402|  19.8k|    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.8k|    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.8k|    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.8k|    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.8k|    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.8k|    temp7 = _mm_madd_epi16(src_r0_2, scalemat_r0_2);
  413|       |
  414|  19.8k|    if(qp_div >= 6)
  ------------------
  |  Branch (414:8): [True: 6.40k, False: 13.4k]
  ------------------
  415|  6.40k|    {
  416|  6.40k|        resq_r0_1 = _mm_slli_epi32(temp5, qp_div - 6);
  417|  6.40k|        resq_r0_2 = _mm_slli_epi32(temp7, qp_div - 6);
  418|  6.40k|    }
  419|  13.4k|    else
  420|  13.4k|    {
  421|  13.4k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  422|  13.4k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  423|  13.4k|        resq_r0_1 = _mm_srai_epi32(temp5, 6 - qp_div);
  424|  13.4k|        resq_r0_2 = _mm_srai_epi32(temp7, 6 - qp_div);
  425|  13.4k|    }
  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.8k|    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.8k|    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.8k|    scalemat_r0 = _mm_loadu_si128((__m128i *) (pu2_iscale_mat + 8));
  434|       |    // q0 q1 q2 q3 q4 q5 q6 q7 -- all 16 bits
  435|  19.8k|    dequant_r0 = _mm_loadu_si128((__m128i *) (&pu2_weigh_mat[8]));
  436|       |    // a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  437|  19.8k|    src_r0_1 = _mm_unpacklo_epi16(src_r0, zero_8x16b);
  438|       |    // a04 0 a05 0 a06 0 a07 0 -- 16 bit long
  439|  19.8k|    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.8k|    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.8k|    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.8k|    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.8k|    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.8k|    temp7 = _mm_madd_epi16(src_r0_2, scalemat_r0_2);
  450|  19.8k|    if(qp_div >= 6)
  ------------------
  |  Branch (450:8): [True: 6.40k, False: 13.4k]
  ------------------
  451|  6.40k|    {
  452|  6.40k|        resq_r1_1 = _mm_slli_epi32(temp5, qp_div - 6);
  453|  6.40k|        resq_r1_2 = _mm_slli_epi32(temp7, qp_div - 6);
  454|  6.40k|    }
  455|  13.4k|    else
  456|  13.4k|    {
  457|  13.4k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  458|  13.4k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  459|  13.4k|        resq_r1_1 = _mm_srai_epi32(temp5, 6 - qp_div);
  460|  13.4k|        resq_r1_2 = _mm_srai_epi32(temp7, 6 - qp_div);
  461|  13.4k|    }
  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.8k|    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.8k|    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.8k|    scalemat_r0 = _mm_loadu_si128((__m128i *) (pu2_iscale_mat + 16));
  470|       |    // q0 q1 q2 q3 q4 q5 q6 q7 -- all 16 bits
  471|  19.8k|    dequant_r0 = _mm_loadu_si128((__m128i *) (&pu2_weigh_mat[16]));
  472|  19.8k|    src_r0_1 = _mm_unpacklo_epi16(src_r0, zero_8x16b);  // a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  473|  19.8k|    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.8k|    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.8k|    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.8k|    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.8k|    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.8k|    temp7 = _mm_madd_epi16(src_r0_2, scalemat_r0_2);
  484|  19.8k|    if(qp_div >= 6)
  ------------------
  |  Branch (484:8): [True: 6.40k, False: 13.4k]
  ------------------
  485|  6.40k|    {
  486|  6.40k|        resq_r2_1 = _mm_slli_epi32(temp5, qp_div - 6);
  487|  6.40k|        resq_r2_2 = _mm_slli_epi32(temp7, qp_div - 6);
  488|  6.40k|    }
  489|  13.4k|    else
  490|  13.4k|    {
  491|  13.4k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  492|  13.4k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  493|  13.4k|        resq_r2_1 = _mm_srai_epi32(temp5, 6 - qp_div);
  494|  13.4k|        resq_r2_2 = _mm_srai_epi32(temp7, 6 - qp_div);
  495|  13.4k|    }
  496|       |    // a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 a04*b04*q4 a05*b05*q5 -- 16 bit long
  497|  19.8k|    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.8k|    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.8k|    scalemat_r0 = _mm_loadu_si128((__m128i *) (pu2_iscale_mat + 24));
  503|       |    // q0 q1 q2 q3 q4 q5 q6 q7 -- all 16 bits
  504|  19.8k|    dequant_r0 = _mm_loadu_si128((__m128i *) (&pu2_weigh_mat[24]));
  505|  19.8k|    src_r0_1 = _mm_unpacklo_epi16(src_r0, zero_8x16b);  // a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  506|  19.8k|    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.8k|    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.8k|    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.8k|    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.8k|    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.8k|    temp7 = _mm_madd_epi16(src_r0_2, scalemat_r0_2);
  517|  19.8k|    if(qp_div >= 6)
  ------------------
  |  Branch (517:8): [True: 6.40k, False: 13.4k]
  ------------------
  518|  6.40k|    {
  519|  6.40k|        resq_r3_1 = _mm_slli_epi32(temp5, qp_div - 6);
  520|  6.40k|        resq_r3_2 = _mm_slli_epi32(temp7, qp_div - 6);
  521|  6.40k|    }
  522|  13.4k|    else
  523|  13.4k|    {
  524|  13.4k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  525|  13.4k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  526|  13.4k|        resq_r3_1 = _mm_srai_epi32(temp5, 6 - qp_div);
  527|  13.4k|        resq_r3_2 = _mm_srai_epi32(temp7, 6 - qp_div);
  528|  13.4k|    }
  529|       |    // a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 a04*b04*q4 a05*b05*q5 .... -- 16 bit long
  530|  19.8k|    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.8k|    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.8k|    scalemat_r0 = _mm_loadu_si128((__m128i *) (pu2_iscale_mat + 32));
  536|       |    // q0 q1 q2 q3 q4 q5 q6 q7 -- all 16 bits
  537|  19.8k|    dequant_r0 = _mm_loadu_si128((__m128i *) (&pu2_weigh_mat[32]));
  538|  19.8k|    src_r0_1 = _mm_unpacklo_epi16(src_r0, zero_8x16b);  // a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  539|  19.8k|    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.8k|    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.8k|    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.8k|    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.8k|    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.8k|    temp7 = _mm_madd_epi16(src_r0_2, scalemat_r0_2);
  550|  19.8k|    if(qp_div >= 6)
  ------------------
  |  Branch (550:8): [True: 6.40k, False: 13.4k]
  ------------------
  551|  6.40k|    {
  552|  6.40k|        resq_r4_1 = _mm_slli_epi32(temp5, qp_div - 6);
  553|  6.40k|        resq_r4_2 = _mm_slli_epi32(temp7, qp_div - 6);
  554|  6.40k|    }
  555|  13.4k|    else
  556|  13.4k|    {
  557|  13.4k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  558|  13.4k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  559|  13.4k|        resq_r4_1 = _mm_srai_epi32(temp5, 6 - qp_div);
  560|  13.4k|        resq_r4_2 = _mm_srai_epi32(temp7, 6 - qp_div);
  561|  13.4k|    }
  562|       |    // a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 a04*b04*q4 a05*b05*q5  -- 16 bit long
  563|  19.8k|    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.8k|    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.8k|    scalemat_r0 = _mm_loadu_si128((__m128i *) (pu2_iscale_mat + 40));
  570|       |    // q0 q1 q2 q3 q4 q5 q6 q7 -- all 16 bits
  571|  19.8k|    dequant_r0 = _mm_loadu_si128((__m128i *) (&pu2_weigh_mat[40]));
  572|  19.8k|    src_r0_1 = _mm_unpacklo_epi16(src_r0, zero_8x16b);  // a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  573|  19.8k|    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.8k|    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.8k|    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.8k|    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.8k|    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.8k|    temp7 = _mm_madd_epi16(src_r0_2, scalemat_r0_2);
  584|  19.8k|    if(qp_div >= 6)
  ------------------
  |  Branch (584:8): [True: 6.40k, False: 13.4k]
  ------------------
  585|  6.40k|    {
  586|  6.40k|        resq_r5_1 = _mm_slli_epi32(temp5, qp_div - 6);
  587|  6.40k|        resq_r5_2 = _mm_slli_epi32(temp7, qp_div - 6);
  588|  6.40k|    }
  589|  13.4k|    else
  590|  13.4k|    {
  591|  13.4k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  592|  13.4k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  593|  13.4k|        resq_r5_1 = _mm_srai_epi32(temp5, 6 - qp_div);
  594|  13.4k|        resq_r5_2 = _mm_srai_epi32(temp7, 6 - qp_div);
  595|  13.4k|    }
  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.8k|    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.8k|    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.8k|    scalemat_r0 = _mm_loadu_si128((__m128i *) (pu2_iscale_mat + 48));
  603|       |    // q0 q1 q2 q3 q4 q5 q6 q7 -- all 16 bits
  604|  19.8k|    dequant_r0 = _mm_loadu_si128((__m128i *) (&pu2_weigh_mat[48]));
  605|  19.8k|    src_r0_1 = _mm_unpacklo_epi16(src_r0, zero_8x16b);  // a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  606|  19.8k|    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.8k|    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.8k|    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.8k|    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.8k|    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.8k|    temp7 = _mm_madd_epi16(src_r0_2, scalemat_r0_2);
  617|  19.8k|    if(qp_div >= 6)
  ------------------
  |  Branch (617:8): [True: 6.40k, False: 13.4k]
  ------------------
  618|  6.40k|    {
  619|  6.40k|        resq_r6_1 = _mm_slli_epi32(temp5, qp_div - 6);
  620|  6.40k|        resq_r6_2 = _mm_slli_epi32(temp7, qp_div - 6);
  621|  6.40k|    }
  622|  13.4k|    else
  623|  13.4k|    {
  624|  13.4k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  625|  13.4k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  626|  13.4k|        resq_r6_1 = _mm_srai_epi32(temp5, 6 - qp_div);
  627|  13.4k|        resq_r6_2 = _mm_srai_epi32(temp7, 6 - qp_div);
  628|  13.4k|    }
  629|       |    // a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 a04*b04*q4 a05*b05*q5 -- 16 bit long
  630|  19.8k|    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.8k|    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.8k|    scalemat_r0 = _mm_loadu_si128((__m128i *) (pu2_iscale_mat + 56));
  636|       |    // q0 q1 q2 q3 q4 q5 q6 q7 -- all 16 bits
  637|  19.8k|    dequant_r0 = _mm_loadu_si128((__m128i *) (&pu2_weigh_mat[56]));
  638|  19.8k|    src_r0_1 = _mm_unpacklo_epi16(src_r0, zero_8x16b);  // a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  639|  19.8k|    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.8k|    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.8k|    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.8k|    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.8k|    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.8k|    temp7 = _mm_madd_epi16(src_r0_2, scalemat_r0_2);
  650|  19.8k|    if(qp_div >= 6)
  ------------------
  |  Branch (650:8): [True: 6.40k, False: 13.4k]
  ------------------
  651|  6.40k|    {
  652|  6.40k|        resq_r7_1 = _mm_slli_epi32(temp5, qp_div - 6);
  653|  6.40k|        resq_r7_2 = _mm_slli_epi32(temp7, qp_div - 6);
  654|  6.40k|    }
  655|  13.4k|    else
  656|  13.4k|    {
  657|  13.4k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  658|  13.4k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  659|  13.4k|        resq_r7_1 = _mm_srai_epi32(temp5, 6 - qp_div);
  660|  13.4k|        resq_r7_2 = _mm_srai_epi32(temp7, 6 - qp_div);
  661|  13.4k|    }
  662|       |    // a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 a04*b04*q4 a05*b05*q5 -- 16 bit long
  663|  19.8k|    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.8k|    temp1 = _mm_unpacklo_epi16(resq_r0_1, resq_r1_1);  // a0 b0 a1 b1 a2 b2 a3 b3
  677|  19.8k|    temp3 = _mm_unpacklo_epi16(resq_r2_1, resq_r3_1);  // c0 d0 c1 d1 c2 d2 c3 d3
  678|  19.8k|    temp2 = _mm_unpackhi_epi16(resq_r0_1, resq_r1_1);  // a4 b4 a5 b5 a6 b6 a7 b7
  679|  19.8k|    temp4 = _mm_unpackhi_epi16(resq_r2_1, resq_r3_1);  // c4 d4 c5 d5 c6 d6 c7 d7
  680|  19.8k|    resq_r0_1 = _mm_unpacklo_epi32(temp1, temp3);      // a0 b0 c0 d0 a1 b1 c1 d1
  681|  19.8k|    resq_r1_1 = _mm_unpackhi_epi32(temp1, temp3);      // a2 b2 c2 d2 a3 b3 c3 d3
  682|  19.8k|    resq_r2_1 = _mm_unpacklo_epi32(temp2, temp4);      // a4 b4 c4 d4 a5 b5 c5 d5
  683|  19.8k|    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.8k|    temp1 = _mm_unpacklo_epi16(resq_r4_1, resq_r5_1);  // e0 f0 e1 f1 e2 f2 e2 f3
  691|  19.8k|    temp3 = _mm_unpacklo_epi16(resq_r6_1, resq_r7_1);  // g0 h0 g1 h1 g2 h2 g3 h3
  692|  19.8k|    temp2 = _mm_unpackhi_epi16(resq_r4_1, resq_r5_1);  // e4 f4 e5 f5 e6 f6 e7 f7
  693|  19.8k|    temp4 = _mm_unpackhi_epi16(resq_r6_1, resq_r7_1);  // g4 h4 g5 h5 g6 h6 g7 h7
  694|  19.8k|    resq_r4_1 = _mm_unpacklo_epi32(temp1, temp3);      // e0 f0 g0 h0 e1 f1 g1 h1
  695|  19.8k|    resq_r5_1 = _mm_unpackhi_epi32(temp1, temp3);      // e2 f2 g2 h2 e3 f3 g3 h3
  696|  19.8k|    resq_r6_1 = _mm_unpacklo_epi32(temp2, temp4);      // e4 f4 g4 h4 e5 f5 g5 h5
  697|  19.8k|    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.8k|    resq_r0_2 = _mm_unpacklo_epi64(resq_r0_1, resq_r4_1);  // a0 b0 c0 d0 e0 f0 g0 h0
  709|  19.8k|    resq_r1_2 = _mm_unpackhi_epi64(resq_r0_1, resq_r4_1);  // a1 b1 c1 d1 e1 f1 g1 h1
  710|  19.8k|    resq_r2_2 = _mm_unpacklo_epi64(resq_r1_1, resq_r5_1);  // a2 b2 c2 d2 e2 f2 g2 h2
  711|  19.8k|    resq_r3_2 = _mm_unpackhi_epi64(resq_r1_1, resq_r5_1);  // a3 b3 c3 d3 e3 f3 g3 h3
  712|  19.8k|    resq_r4_2 = _mm_unpacklo_epi64(resq_r2_1, resq_r6_1);  // a4 b4 c4 d4 e4 f4 g4 h4
  713|  19.8k|    resq_r5_2 = _mm_unpackhi_epi64(resq_r2_1, resq_r6_1);  // a5 b5 c5 d5 e5 f5 g5 h5
  714|  19.8k|    resq_r6_2 = _mm_unpacklo_epi64(resq_r3_1, resq_r7_1);  // a6 b6 c6 d6 e6 f6 g6 h6
  715|  19.8k|    resq_r7_2 = _mm_unpackhi_epi64(resq_r3_1, resq_r7_1);  // a7 b7 c7 d7 e7 f7 g7 h7
  716|       |
  717|  19.8k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, resq_r1_2);
  718|  19.8k|    resq_r1_1 = _mm_unpacklo_epi16(resq_r1_2, sign_reg);  // a1 b1 c1 d1 -- 32 bit
  719|  19.8k|    resq_r1_2 = _mm_unpackhi_epi16(resq_r1_2, sign_reg);  // e1 f1 g1 h1 -- 32 bit
  720|  19.8k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, resq_r3_2);
  721|  19.8k|    resq_r3_1 = _mm_unpacklo_epi16(resq_r3_2, sign_reg);  // a3 b3 c3 d3 -- 32 bit
  722|  19.8k|    resq_r3_2 = _mm_unpackhi_epi16(resq_r3_2, sign_reg);  // e3 f3 g3 h3 -- 32 bit
  723|  19.8k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, resq_r5_2);
  724|  19.8k|    resq_r5_1 = _mm_unpacklo_epi16(resq_r5_2, sign_reg);  // a5 b5 c5 d5 -- 32 bit
  725|  19.8k|    resq_r5_2 = _mm_unpackhi_epi16(resq_r5_2, sign_reg);  // e5 f5 g5 h5 -- 32 bit
  726|  19.8k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, resq_r7_2);
  727|  19.8k|    resq_r7_1 = _mm_unpacklo_epi16(resq_r7_2, sign_reg);  // a7 b7 c7 d7 -- 32 bit
  728|  19.8k|    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.8k|    temp1 = _mm_add_epi16(resq_r0_2, resq_r4_2);
  733|       |    /* y2 = w0 - w4                                                      */
  734|  19.8k|    temp3 = _mm_sub_epi16(resq_r0_2, resq_r4_2);
  735|       |    /* y1 = -w3 + w5 - w7 - (w7 >> 1)                                   */
  736|  19.8k|    temp2 = _mm_sub_epi32(resq_r5_1, resq_r3_1);  //-w3+w5
  737|  19.8k|    temp10 = _mm_sub_epi32(resq_r5_2, resq_r3_2);
  738|  19.8k|    temp4 = _mm_sub_epi32(temp2, resq_r7_1);      //-w3+w5-w7
  739|  19.8k|    temp12 = _mm_sub_epi32(temp10, resq_r7_2);
  740|  19.8k|    temp5 = _mm_srai_epi32(resq_r7_1, 1);         // w7>>1
  741|  19.8k|    temp13 = _mm_srai_epi32(resq_r7_2, 1);
  742|  19.8k|    temp2 = _mm_sub_epi32(temp4, temp5);          //-w3+w5-w7 -(w7>>1)
  743|  19.8k|    temp10 = _mm_sub_epi32(temp12, temp13);
  744|  19.8k|    temp2 = _mm_packs_epi32(temp2, temp10);
  745|       |    /* y3 = w1 + w7 - w3 - (w3 >> 1)                                    */
  746|  19.8k|    temp4 = _mm_add_epi32(resq_r1_1, resq_r7_1);  // w1+w7
  747|  19.8k|    temp12 = _mm_add_epi32(resq_r1_2, resq_r7_2);
  748|  19.8k|    temp4 = _mm_sub_epi32(temp4, resq_r3_1);      // w1+w7-w3
  749|  19.8k|    temp12 = _mm_sub_epi32(temp12, resq_r3_2);
  750|  19.8k|    temp5 = _mm_srai_epi32(resq_r3_1, 1);         // w3>>1
  751|  19.8k|    temp13 = _mm_srai_epi32(resq_r3_2, 1);
  752|  19.8k|    temp4 = _mm_sub_epi32(temp4, temp5);          // w1+w7-w3-(w3>>1)
  753|  19.8k|    temp12 = _mm_sub_epi32(temp12, temp13);
  754|  19.8k|    temp4 = _mm_packs_epi32(temp4, temp12);
  755|       |    /* y4 = (w2 >> 1) - w6                                              */
  756|  19.8k|    temp5 = _mm_srai_epi16(resq_r2_2, 1);     // w2>>1
  757|  19.8k|    temp5 = _mm_sub_epi16(temp5, resq_r6_2);  //(w2>>1)-w6
  758|       |    /* y5 = -w1 + w7 + w5 + (w5 >> 1)                                   */
  759|  19.8k|    temp6 = _mm_sub_epi32(resq_r7_1, resq_r1_1);  // w7-w1
  760|  19.8k|    temp14 = _mm_sub_epi32(resq_r7_2, resq_r1_2);
  761|  19.8k|    temp6 = _mm_add_epi32(temp6, resq_r5_1);      // w7-w1+w5
  762|  19.8k|    temp14 = _mm_add_epi32(temp14, resq_r5_2);
  763|  19.8k|    temp7 = _mm_srai_epi32(resq_r5_1, 1);         // w5>>1
  764|  19.8k|    temp15 = _mm_srai_epi32(resq_r5_2, 1);
  765|  19.8k|    temp6 = _mm_add_epi32(temp6, temp7);          // w7-w1_w5+(w5>>1)
  766|  19.8k|    temp14 = _mm_add_epi32(temp14, temp15);
  767|  19.8k|    temp6 = _mm_packs_epi32(temp6, temp14);
  768|       |    /* y6 = w2 + (w6 >> 1)                                              */
  769|  19.8k|    temp7 = _mm_srai_epi16(resq_r6_2, 1);     // w6>>1
  770|  19.8k|    temp7 = _mm_add_epi16(temp7, resq_r2_2);  //(w6>>1)+w2
  771|       |    /* y7 = w3 + w5 + w1 + (w1 >> 1)                                    */
  772|  19.8k|    temp8 = _mm_add_epi32(resq_r3_1, resq_r5_1);  // w3+w5
  773|  19.8k|    temp16 = _mm_add_epi32(resq_r3_2, resq_r5_2);
  774|  19.8k|    temp8 = _mm_add_epi32(temp8, resq_r1_1);      // w3+w5+w1
  775|  19.8k|    temp16 = _mm_add_epi32(temp16, resq_r1_2);
  776|  19.8k|    temp17 = _mm_srai_epi32(resq_r1_1, 1);        // w1>>1
  777|  19.8k|    temp18 = _mm_srai_epi32(resq_r1_2, 1);
  778|  19.8k|    temp8 = _mm_add_epi32(temp8, temp17);         // w3+w5+w1+(w1>>1)
  779|  19.8k|    temp16 = _mm_add_epi32(temp16, temp18);
  780|  19.8k|    temp8 = _mm_packs_epi32(temp8, temp16);
  781|       |    /*------------------------------------------------------------------*/
  782|       |    /*------------------------------------------------------------------*/
  783|       |    /* z0 = y0 + y6                                                        */
  784|  19.8k|    resq_r0_1 = _mm_add_epi16(temp1, temp7);
  785|       |    /* z1 = y1 + (y7 >> 2)                                                */
  786|  19.8k|    resq_r1_1 = _mm_srai_epi16(temp8, 2);
  787|  19.8k|    resq_r1_1 = _mm_add_epi16(resq_r1_1, temp2);
  788|       |    /* z2 = y2 + y4                                                        */
  789|  19.8k|    resq_r2_1 = _mm_add_epi16(temp3, temp5);
  790|       |    /* z3 = y3 + (y5 >> 2)                                                */
  791|  19.8k|    resq_r3_1 = _mm_srai_epi16(temp6, 2);
  792|  19.8k|    resq_r3_1 = _mm_add_epi16(resq_r3_1, temp4);
  793|       |    /* z4 = y2 - y4                                                        */
  794|  19.8k|    resq_r4_1 = _mm_sub_epi16(temp3, temp5);
  795|       |    /* z5 = (y3 >> 2) - y5                                                 */
  796|  19.8k|    resq_r5_1 = _mm_srai_epi16(temp4, 2);
  797|  19.8k|    resq_r5_1 = _mm_sub_epi16(resq_r5_1, temp6);
  798|       |    /* z6 = y0 - y6                                                     */
  799|  19.8k|    resq_r6_1 = _mm_sub_epi16(temp1, temp7);
  800|       |    /* z7 = y7 - (y1 >> 2)                                                 */
  801|  19.8k|    resq_r7_1 = _mm_srai_epi16(temp2, 2);
  802|  19.8k|    resq_r7_1 = _mm_sub_epi16(temp8, resq_r7_1);
  803|       |    /*------------------------------------------------------------------*/
  804|       |    /*------------------------------------------------------------------*/
  805|       |    /* x0 = z0 + z7                                                        */
  806|  19.8k|    temp1 = _mm_add_epi16(resq_r0_1, resq_r7_1);
  807|       |    /* x1 = z2 + z5                                                        */
  808|  19.8k|    temp2 = _mm_add_epi16(resq_r2_1, resq_r5_1);
  809|       |    /* x2 = z4 + z3                                                        */
  810|  19.8k|    temp3 = _mm_add_epi16(resq_r4_1, resq_r3_1);
  811|       |    /* x3 = z6 + z1                                                        */
  812|  19.8k|    temp4 = _mm_add_epi16(resq_r6_1, resq_r1_1);
  813|       |    /* x4 = z6 - z1                                                        */
  814|  19.8k|    temp5 = _mm_sub_epi16(resq_r6_1, resq_r1_1);
  815|       |    /* x5 = z4 - z3                                                        */
  816|  19.8k|    temp6 = _mm_sub_epi16(resq_r4_1, resq_r3_1);
  817|       |    /* x6 = z2 - z5                                                        */
  818|  19.8k|    temp7 = _mm_sub_epi16(resq_r2_1, resq_r5_1);
  819|       |    /* x7 = z0 - z7                                                        */
  820|  19.8k|    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.8k|    temp17 = _mm_unpacklo_epi16(temp1, temp2);       // a0 a1 b0 b1 c0 c1 d0 d1
  830|  19.8k|    temp19 = _mm_unpacklo_epi16(temp3, temp4);       // a2 a3 b2 b3 c2 c3 d2 d3
  831|  19.8k|    temp18 = _mm_unpackhi_epi16(temp1, temp2);       // e0 e1 f0 f1 g0 g1 h0 h1
  832|  19.8k|    temp20 = _mm_unpackhi_epi16(temp3, temp4);       // e2 e3 f2 f3 g2 g3 h2 h3
  833|       |
  834|  19.8k|    resq_r0_1 = _mm_unpacklo_epi32(temp17, temp19);  // a0 a1 a2 a3 b0 b1 b2 b3
  835|  19.8k|    resq_r1_1 = _mm_unpackhi_epi32(temp17, temp19);  // c0 c1 c2 c3 d0 d1 d2 d3
  836|  19.8k|    resq_r2_1 = _mm_unpacklo_epi32(temp18, temp20);  // e0 e1 e2 e3 f0 f1 f2 f3
  837|  19.8k|    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.8k|    temp17 = _mm_unpacklo_epi16(temp5, temp6);       // a4 a5 b4 b5 c4 c5 d4 d5
  845|  19.8k|    temp19 = _mm_unpacklo_epi16(temp7, temp8);       // a6 a7 b6 b7 c6 c7 d6 d7
  846|  19.8k|    temp18 = _mm_unpackhi_epi16(temp5, temp6);       // e4 e5 f4 f5 g4 g5 h4 h5
  847|  19.8k|    temp20 = _mm_unpackhi_epi16(temp7, temp8);       // e6 e7 f6 f7 g6 g7 h6 h7
  848|       |
  849|  19.8k|    resq_r4_1 = _mm_unpacklo_epi32(temp17, temp19);  // a4 a5 a6 a7 b4 b5 b6 b7
  850|  19.8k|    resq_r5_1 = _mm_unpackhi_epi32(temp17, temp19);  // c4 c5 c6 c7 d4 d5 d6 d7
  851|  19.8k|    resq_r6_1 = _mm_unpacklo_epi32(temp18, temp20);  // e4 e5 e6 e7 f4 f5 f6 f7
  852|  19.8k|    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.8k|    resq_r0_2 = _mm_unpacklo_epi64(resq_r0_1, resq_r4_1);  // a0 a1 a2 a3 a4 a5 a6 a7
  863|  19.8k|    resq_r1_2 = _mm_unpackhi_epi64(resq_r0_1, resq_r4_1);  // b0 b1 b2 b3 b4 b5 b6 b7
  864|  19.8k|    resq_r2_2 = _mm_unpacklo_epi64(resq_r1_1, resq_r5_1);  // c0 c1 c2 c3 c4 c5 c6 c7
  865|  19.8k|    resq_r3_2 = _mm_unpackhi_epi64(resq_r1_1, resq_r5_1);  // d0 d1 d2 d3 d4 d5 d6 d7
  866|  19.8k|    resq_r4_2 = _mm_unpacklo_epi64(resq_r2_1, resq_r6_1);  // e0 e1 e2 e3 e4 e5 e6 e7
  867|  19.8k|    resq_r5_2 = _mm_unpackhi_epi64(resq_r2_1, resq_r6_1);  // f0 f1 f2 f3 f4 f5 f6 f7
  868|  19.8k|    resq_r6_2 = _mm_unpacklo_epi64(resq_r3_1, resq_r7_1);  // g0 g1 g2 g3 g4 g5 g6 g7
  869|  19.8k|    resq_r7_2 = _mm_unpackhi_epi64(resq_r3_1, resq_r7_1);  // h0 h1 h2 h3 h4 h5 h6 h7
  870|       |
  871|  19.8k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, resq_r1_2);
  872|  19.8k|    resq_r1_1 = _mm_unpacklo_epi16(resq_r1_2, sign_reg);  // a1 b1 c1 d1 -- 32 bit
  873|  19.8k|    resq_r1_2 = _mm_unpackhi_epi16(resq_r1_2, sign_reg);  // e1 f1 g1 h1 -- 32 bit
  874|  19.8k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, resq_r3_2);
  875|  19.8k|    resq_r3_1 = _mm_unpacklo_epi16(resq_r3_2, sign_reg);  // a3 b3 c3 d3 -- 32 bit
  876|  19.8k|    resq_r3_2 = _mm_unpackhi_epi16(resq_r3_2, sign_reg);  // e3 f3 g3 h3 -- 32 bit
  877|  19.8k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, resq_r5_2);
  878|  19.8k|    resq_r5_1 = _mm_unpacklo_epi16(resq_r5_2, sign_reg);  // a5 b5 c5 d5 -- 32 bit
  879|  19.8k|    resq_r5_2 = _mm_unpackhi_epi16(resq_r5_2, sign_reg);  // e5 f5 g5 h5 -- 32 bit
  880|  19.8k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, resq_r7_2);
  881|  19.8k|    resq_r7_1 = _mm_unpacklo_epi16(resq_r7_2, sign_reg);  // a7 b7 c7 d7 -- 32 bit
  882|  19.8k|    resq_r7_2 = _mm_unpackhi_epi16(resq_r7_2, sign_reg);  // e7 f7 g7 h7 -- 32 bit
  883|       |
  884|  19.8k|    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.8k|    predload_r = _mm_loadl_epi64((__m128i *) (&pu1_pred[0]));
  888|       |    // p0 p1 p2 p3 p4 p5 p6 p7 -- all 16 bits
  889|  19.8k|    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.8k|    predload_r = _mm_loadl_epi64((__m128i *) (&pu1_pred[pred_strd]));
  893|       |    // p0 p1 p2 p3 p4 p5 p6 p7 -- all 16 bits
  894|  19.8k|    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.8k|    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.8k|    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.8k|    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.8k|    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.8k|    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.8k|    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.8k|    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.8k|    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.8k|    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.8k|    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.8k|    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.8k|    pred_r7_1 = _mm_unpacklo_epi8(predload_r, zero_8x16b);
  925|       |
  926|  19.8k|    rsd_r0 = _mm_loadu_si128((__m128i *) (&pi2_rsd[0]));
  927|  19.8k|    rsd_r1 = _mm_loadu_si128((__m128i *) (&pi2_rsd[1 * rsd_strd]));
  928|  19.8k|    rsd_r2 = _mm_loadu_si128((__m128i *) (&pi2_rsd[2 * rsd_strd]));
  929|  19.8k|    rsd_r3 = _mm_loadu_si128((__m128i *) (&pi2_rsd[3 * rsd_strd]));
  930|  19.8k|    rsd_r4 = _mm_loadu_si128((__m128i *) (&pi2_rsd[4 * rsd_strd]));
  931|  19.8k|    rsd_r5 = _mm_loadu_si128((__m128i *) (&pi2_rsd[5 * rsd_strd]));
  932|  19.8k|    rsd_r6 = _mm_loadu_si128((__m128i *) (&pi2_rsd[6 * rsd_strd]));
  933|  19.8k|    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.8k|    temp1 = _mm_add_epi16(resq_r0_2, resq_r4_2);
  944|       |    /* y2j = w0j - w4j                                                      */
  945|  19.8k|    temp3 = _mm_sub_epi16(resq_r0_2, resq_r4_2);
  946|       |    /* y1j = -w3j + w5j - w7j - (w7j >> 1)                                   */
  947|  19.8k|    temp2 = _mm_sub_epi32(resq_r5_1, resq_r3_1);  //-w3+w5
  948|  19.8k|    temp10 = _mm_sub_epi32(resq_r5_2, resq_r3_2);
  949|  19.8k|    temp4 = _mm_sub_epi32(temp2, resq_r7_1);      //-w3+w5-w7
  950|  19.8k|    temp12 = _mm_sub_epi32(temp10, resq_r7_2);
  951|  19.8k|    temp5 = _mm_srai_epi32(resq_r7_1, 1);         // w7>>1
  952|  19.8k|    temp13 = _mm_srai_epi32(resq_r7_2, 1);
  953|  19.8k|    temp2 = _mm_sub_epi32(temp4, temp5);          //-w3+w5-w7 -(w7>>1)
  954|  19.8k|    temp10 = _mm_sub_epi32(temp12, temp13);
  955|  19.8k|    temp2 = _mm_packs_epi32(temp2, temp10);
  956|       |    /* y3j = w1j + w7j - w3j - (w3j >> 1)                                    */
  957|  19.8k|    temp4 = _mm_add_epi32(resq_r1_1, resq_r7_1);  // w1+w7
  958|  19.8k|    temp12 = _mm_add_epi32(resq_r1_2, resq_r7_2);
  959|  19.8k|    temp4 = _mm_sub_epi32(temp4, resq_r3_1);      // w1+w7-w3
  960|  19.8k|    temp12 = _mm_sub_epi32(temp12, resq_r3_2);
  961|  19.8k|    temp5 = _mm_srai_epi32(resq_r3_1, 1);         // w3>>1
  962|  19.8k|    temp13 = _mm_srai_epi32(resq_r3_2, 1);
  963|  19.8k|    temp4 = _mm_sub_epi32(temp4, temp5);          // w1+w7-w3-(w3>>1)
  964|  19.8k|    temp12 = _mm_sub_epi32(temp12, temp13);
  965|  19.8k|    temp4 = _mm_packs_epi32(temp4, temp12);
  966|       |    /* y4j = (w2j >> 1) - w6j                                              */
  967|  19.8k|    temp5 = _mm_srai_epi16(resq_r2_2, 1);     // w2>>1
  968|  19.8k|    temp5 = _mm_sub_epi16(temp5, resq_r6_2);  //(w2>>1)-w6
  969|       |    /* y5j = -w1j + w7j + w5j + (w5j >> 1)                                   */
  970|  19.8k|    temp6 = _mm_sub_epi32(resq_r7_1, resq_r1_1);  // w7-w1
  971|  19.8k|    temp14 = _mm_sub_epi32(resq_r7_2, resq_r1_2);
  972|  19.8k|    temp6 = _mm_add_epi32(temp6, resq_r5_1);      // w7-w1+w5
  973|  19.8k|    temp14 = _mm_add_epi32(temp14, resq_r5_2);
  974|  19.8k|    temp7 = _mm_srai_epi32(resq_r5_1, 1);         // w5>>1
  975|  19.8k|    temp15 = _mm_srai_epi32(resq_r5_2, 1);
  976|  19.8k|    temp6 = _mm_add_epi32(temp6, temp7);          // w7-w1_w5+(w5>>1)
  977|  19.8k|    temp14 = _mm_add_epi32(temp14, temp15);
  978|  19.8k|    temp6 = _mm_packs_epi32(temp6, temp14);
  979|       |    /* y6j = w2j + (w6j >> 1)                                              */
  980|  19.8k|    temp7 = _mm_srai_epi16(resq_r6_2, 1);     // w6>>1
  981|  19.8k|    temp7 = _mm_add_epi16(temp7, resq_r2_2);  //(w6>>1)+w2
  982|       |    /* y7j = w3j + w5j + w1j + (w1j >> 1)                                    */
  983|  19.8k|    temp8 = _mm_add_epi32(resq_r3_1, resq_r5_1);  // w3+w5
  984|  19.8k|    temp16 = _mm_add_epi32(resq_r3_2, resq_r5_2);
  985|  19.8k|    temp8 = _mm_add_epi32(temp8, resq_r1_1);      // w3+w5+w1
  986|  19.8k|    temp16 = _mm_add_epi32(temp16, resq_r1_2);
  987|  19.8k|    temp17 = _mm_srai_epi32(resq_r1_1, 1);        // w1>>1
  988|  19.8k|    temp18 = _mm_srai_epi32(resq_r1_2, 1);
  989|  19.8k|    temp8 = _mm_add_epi32(temp8, temp17);         // w3+w5+w1+(w1>>1)
  990|  19.8k|    temp16 = _mm_add_epi32(temp16, temp18);
  991|  19.8k|    temp8 = _mm_packs_epi32(temp8, temp16);
  992|       |    /*------------------------------------------------------------------*/
  993|       |    /*------------------------------------------------------------------*/
  994|       |    /* z0j = y0j + y6j                                                        */
  995|  19.8k|    resq_r0_1 = _mm_add_epi16(temp1, temp7);
  996|       |    /* z1j = y1j + (y7j >> 2)                                                */
  997|  19.8k|    resq_r1_1 = _mm_srai_epi16(temp8, 2);
  998|  19.8k|    resq_r1_1 = _mm_add_epi16(resq_r1_1, temp2);
  999|       |    /* z2j = y2j + y4j                                                        */
 1000|  19.8k|    resq_r2_1 = _mm_add_epi16(temp3, temp5);
 1001|       |    /* z3j = y3j + (y5j >> 2)                                                */
 1002|  19.8k|    resq_r3_1 = _mm_srai_epi16(temp6, 2);
 1003|  19.8k|    resq_r3_1 = _mm_add_epi16(resq_r3_1, temp4);
 1004|       |    /* z4j = y2j - y4j                                                        */
 1005|  19.8k|    resq_r4_1 = _mm_sub_epi16(temp3, temp5);
 1006|       |    /* z5j = (y3j >> 2) - y5j                                                 */
 1007|  19.8k|    resq_r5_1 = _mm_srai_epi16(temp4, 2);
 1008|  19.8k|    resq_r5_1 = _mm_sub_epi16(resq_r5_1, temp6);
 1009|       |    /* z6j = y0j - y6j                                                     */
 1010|  19.8k|    resq_r6_1 = _mm_sub_epi16(temp1, temp7);
 1011|       |    /* z7j = y7j - (y1j >> 2)                                                 */
 1012|  19.8k|    resq_r7_1 = _mm_srai_epi16(temp2, 2);
 1013|  19.8k|    resq_r7_1 = _mm_sub_epi16(temp8, resq_r7_1);
 1014|       |    /*------------------------------------------------------------------*/
 1015|       |
 1016|       |    /*------------------------------------------------------------------*/
 1017|       |    /* x0j = z0j + z7j                                                        */
 1018|  19.8k|    temp1 = _mm_add_epi16(resq_r0_1, resq_r7_1);
 1019|  19.8k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, temp1);
 1020|  19.8k|    temp10 = _mm_unpacklo_epi16(temp1, sign_reg);
 1021|  19.8k|    temp11 = _mm_unpackhi_epi16(temp1, sign_reg);
 1022|  19.8k|    temp10 = _mm_add_epi32(temp10, value_32);
 1023|  19.8k|    temp11 = _mm_add_epi32(temp11, value_32);
 1024|  19.8k|    temp10 = _mm_srai_epi32(temp10, 6);
 1025|  19.8k|    temp11 = _mm_srai_epi32(temp11, 6);
 1026|  19.8k|    temp10 = _mm_packs_epi32(temp10, temp11);
 1027|  19.8k|    rsd_r0 = _mm_add_epi16(temp10, rsd_r0);
 1028|  19.8k|    rsd_r0 = _mm_min_epi16(dupmax_8x16b, rsd_r0);
 1029|  19.8k|    rsd_r0 = _mm_max_epi16(dupmin_8x16b, rsd_r0);
 1030|  19.8k|    temp1 = _mm_add_epi16(rsd_r0, pred_r0_1);
 1031|       |    /* x1j = z2j + z5j                                                        */
 1032|  19.8k|    temp2 = _mm_add_epi16(resq_r2_1, resq_r5_1);
 1033|  19.8k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, temp2);
 1034|  19.8k|    temp10 = _mm_unpacklo_epi16(temp2, sign_reg);
 1035|  19.8k|    temp11 = _mm_unpackhi_epi16(temp2, sign_reg);
 1036|  19.8k|    temp10 = _mm_add_epi32(temp10, value_32);
 1037|  19.8k|    temp11 = _mm_add_epi32(temp11, value_32);
 1038|  19.8k|    temp10 = _mm_srai_epi32(temp10, 6);
 1039|  19.8k|    temp11 = _mm_srai_epi32(temp11, 6);
 1040|  19.8k|    temp10 = _mm_packs_epi32(temp10, temp11);
 1041|  19.8k|    rsd_r1 = _mm_add_epi16(temp10, rsd_r1);
 1042|  19.8k|    rsd_r1 = _mm_min_epi16(dupmax_8x16b, rsd_r1);
 1043|  19.8k|    rsd_r1 = _mm_max_epi16(dupmin_8x16b, rsd_r1);
 1044|  19.8k|    temp2 = _mm_add_epi16(rsd_r1, pred_r1_1);
 1045|       |    /* x2j = z4j + z3j                                                        */
 1046|  19.8k|    temp3 = _mm_add_epi16(resq_r4_1, resq_r3_1);
 1047|  19.8k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, temp3);
 1048|  19.8k|    temp10 = _mm_unpacklo_epi16(temp3, sign_reg);
 1049|  19.8k|    temp11 = _mm_unpackhi_epi16(temp3, sign_reg);
 1050|  19.8k|    temp10 = _mm_add_epi32(temp10, value_32);
 1051|  19.8k|    temp11 = _mm_add_epi32(temp11, value_32);
 1052|  19.8k|    temp10 = _mm_srai_epi32(temp10, 6);
 1053|  19.8k|    temp11 = _mm_srai_epi32(temp11, 6);
 1054|  19.8k|    temp10 = _mm_packs_epi32(temp10, temp11);
 1055|  19.8k|    rsd_r2 = _mm_add_epi16(temp10, rsd_r2);
 1056|  19.8k|    rsd_r2 = _mm_min_epi16(dupmax_8x16b, rsd_r2);
 1057|  19.8k|    rsd_r2 = _mm_max_epi16(dupmin_8x16b, rsd_r2);
 1058|  19.8k|    temp3 = _mm_add_epi16(rsd_r2, pred_r2_1);
 1059|       |    /* x3j = z6j + z1j                                                        */
 1060|  19.8k|    temp4 = _mm_add_epi16(resq_r6_1, resq_r1_1);
 1061|  19.8k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, temp4);
 1062|  19.8k|    temp10 = _mm_unpacklo_epi16(temp4, sign_reg);
 1063|  19.8k|    temp11 = _mm_unpackhi_epi16(temp4, sign_reg);
 1064|  19.8k|    temp10 = _mm_add_epi32(temp10, value_32);
 1065|  19.8k|    temp11 = _mm_add_epi32(temp11, value_32);
 1066|  19.8k|    temp10 = _mm_srai_epi32(temp10, 6);
 1067|  19.8k|    temp11 = _mm_srai_epi32(temp11, 6);
 1068|  19.8k|    temp10 = _mm_packs_epi32(temp10, temp11);
 1069|  19.8k|    rsd_r3 = _mm_add_epi16(temp10, rsd_r3);
 1070|  19.8k|    rsd_r3 = _mm_min_epi16(dupmax_8x16b, rsd_r3);
 1071|  19.8k|    rsd_r3 = _mm_max_epi16(dupmin_8x16b, rsd_r3);
 1072|  19.8k|    temp4 = _mm_add_epi16(rsd_r3, pred_r3_1);
 1073|       |    /* x4j = z6j - z1j                                                        */
 1074|  19.8k|    temp5 = _mm_sub_epi16(resq_r6_1, resq_r1_1);
 1075|  19.8k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, temp5);
 1076|  19.8k|    temp10 = _mm_unpacklo_epi16(temp5, sign_reg);
 1077|  19.8k|    temp11 = _mm_unpackhi_epi16(temp5, sign_reg);
 1078|  19.8k|    temp10 = _mm_add_epi32(temp10, value_32);
 1079|  19.8k|    temp11 = _mm_add_epi32(temp11, value_32);
 1080|  19.8k|    temp10 = _mm_srai_epi32(temp10, 6);
 1081|  19.8k|    temp11 = _mm_srai_epi32(temp11, 6);
 1082|  19.8k|    temp10 = _mm_packs_epi32(temp10, temp11);
 1083|  19.8k|    rsd_r4 = _mm_add_epi16(temp10, rsd_r4);
 1084|  19.8k|    rsd_r4 = _mm_min_epi16(dupmax_8x16b, rsd_r4);
 1085|  19.8k|    rsd_r4 = _mm_max_epi16(dupmin_8x16b, rsd_r4);
 1086|  19.8k|    temp5 = _mm_add_epi16(rsd_r4, pred_r4_1);
 1087|       |    /* x5j = z4j - z3j                                                        */
 1088|  19.8k|    temp6 = _mm_sub_epi16(resq_r4_1, resq_r3_1);
 1089|  19.8k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, temp6);
 1090|  19.8k|    temp10 = _mm_unpacklo_epi16(temp6, sign_reg);
 1091|  19.8k|    temp11 = _mm_unpackhi_epi16(temp6, sign_reg);
 1092|  19.8k|    temp10 = _mm_add_epi32(temp10, value_32);
 1093|  19.8k|    temp11 = _mm_add_epi32(temp11, value_32);
 1094|  19.8k|    temp10 = _mm_srai_epi32(temp10, 6);
 1095|  19.8k|    temp11 = _mm_srai_epi32(temp11, 6);
 1096|  19.8k|    temp10 = _mm_packs_epi32(temp10, temp11);
 1097|  19.8k|    rsd_r5 = _mm_add_epi16(temp10, rsd_r5);
 1098|  19.8k|    rsd_r5 = _mm_min_epi16(dupmax_8x16b, rsd_r5);
 1099|  19.8k|    rsd_r5 = _mm_max_epi16(dupmin_8x16b, rsd_r5);
 1100|  19.8k|    temp6 = _mm_add_epi16(rsd_r5, pred_r5_1);
 1101|       |    /* x6j = z2j - z5j                                                        */
 1102|  19.8k|    temp7 = _mm_sub_epi16(resq_r2_1, resq_r5_1);
 1103|  19.8k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, temp7);
 1104|  19.8k|    temp10 = _mm_unpacklo_epi16(temp7, sign_reg);
 1105|  19.8k|    temp11 = _mm_unpackhi_epi16(temp7, sign_reg);
 1106|  19.8k|    temp10 = _mm_add_epi32(temp10, value_32);
 1107|  19.8k|    temp11 = _mm_add_epi32(temp11, value_32);
 1108|  19.8k|    temp10 = _mm_srai_epi32(temp10, 6);
 1109|  19.8k|    temp11 = _mm_srai_epi32(temp11, 6);
 1110|  19.8k|    temp10 = _mm_packs_epi32(temp10, temp11);
 1111|  19.8k|    rsd_r6 = _mm_add_epi16(temp10, rsd_r6);
 1112|  19.8k|    rsd_r6 = _mm_min_epi16(dupmax_8x16b, rsd_r6);
 1113|  19.8k|    rsd_r6 = _mm_max_epi16(dupmin_8x16b, rsd_r6);
 1114|  19.8k|    temp7 = _mm_add_epi16(rsd_r6, pred_r6_1);
 1115|       |    /* x7j = z0j - z7j                                                        */
 1116|  19.8k|    temp8 = _mm_sub_epi16(resq_r0_1, resq_r7_1);
 1117|  19.8k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, temp8);
 1118|  19.8k|    temp10 = _mm_unpacklo_epi16(temp8, sign_reg);
 1119|  19.8k|    temp11 = _mm_unpackhi_epi16(temp8, sign_reg);
 1120|  19.8k|    temp10 = _mm_add_epi32(temp10, value_32);
 1121|  19.8k|    temp11 = _mm_add_epi32(temp11, value_32);
 1122|  19.8k|    temp10 = _mm_srai_epi32(temp10, 6);
 1123|  19.8k|    temp11 = _mm_srai_epi32(temp11, 6);
 1124|  19.8k|    temp10 = _mm_packs_epi32(temp10, temp11);
 1125|  19.8k|    rsd_r7 = _mm_add_epi16(temp10, rsd_r7);
 1126|  19.8k|    rsd_r7 = _mm_min_epi16(dupmax_8x16b, rsd_r7);
 1127|  19.8k|    rsd_r7 = _mm_max_epi16(dupmin_8x16b, rsd_r7);
 1128|  19.8k|    temp8 = _mm_add_epi16(rsd_r7, pred_r7_1);
 1129|       |
 1130|  19.8k|    rsd_r01_b0 = _mm_unpacklo_epi64(rsd_r0, rsd_r1);
 1131|  19.8k|    rsd_r23_b0 = _mm_unpacklo_epi64(rsd_r2, rsd_r3);
 1132|  19.8k|    rsd_r45_b2 = _mm_unpacklo_epi64(rsd_r4, rsd_r5);
 1133|  19.8k|    rsd_r67_b2 = _mm_unpacklo_epi64(rsd_r6, rsd_r7);
 1134|       |
 1135|  19.8k|    rsd_r01_b1 = _mm_unpackhi_epi64(rsd_r0, rsd_r1);
 1136|  19.8k|    rsd_r23_b1 = _mm_unpackhi_epi64(rsd_r2, rsd_r3);
 1137|  19.8k|    rsd_r45_b3 = _mm_unpackhi_epi64(rsd_r4, rsd_r5);
 1138|  19.8k|    rsd_r67_b3 = _mm_unpackhi_epi64(rsd_r6, rsd_r7);
 1139|       |
 1140|  19.8k|    row_01_b0 = _mm_test_all_ones(
 1141|  19.8k|        _mm_cmpeq_epi16(rsd_r01_b0, zero_8x16b));  // return 1 if all zeros, else 0
 1142|  19.8k|    row_23_b0 = _mm_test_all_ones(
 1143|  19.8k|        _mm_cmpeq_epi16(rsd_r23_b0, zero_8x16b));  // return 1 if all zeros, else 0
 1144|  19.8k|    row_45_b2 = _mm_test_all_ones(
 1145|  19.8k|        _mm_cmpeq_epi16(rsd_r45_b2, zero_8x16b));  // return 1 if all zeros, else 0
 1146|  19.8k|    row_67_b2 = _mm_test_all_ones(
 1147|  19.8k|        _mm_cmpeq_epi16(rsd_r67_b2, zero_8x16b));  // return 1 if all zeros, else 0
 1148|       |
 1149|  19.8k|    row_01_b1 = _mm_test_all_ones(
 1150|  19.8k|        _mm_cmpeq_epi16(rsd_r01_b1, zero_8x16b));  // return 1 if all zeros, else 0
 1151|  19.8k|    row_23_b1 = _mm_test_all_ones(
 1152|  19.8k|        _mm_cmpeq_epi16(rsd_r23_b1, zero_8x16b));  // return 1 if all zeros, else 0
 1153|  19.8k|    row_45_b3 = _mm_test_all_ones(
 1154|  19.8k|        _mm_cmpeq_epi16(rsd_r45_b3, zero_8x16b));  // return 1 if all zeros, else 0
 1155|  19.8k|    row_67_b3 = _mm_test_all_ones(
 1156|  19.8k|        _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.8k|    sign_reg = _mm_cmpgt_epi16(temp1, zero_8x16b);  // sign check
 1161|  19.8k|    temp1 = _mm_and_si128(temp1, sign_reg);
 1162|  19.8k|    sign_reg = _mm_cmpgt_epi16(temp2, zero_8x16b);  // sign check
 1163|  19.8k|    temp2 = _mm_and_si128(temp2, sign_reg);
 1164|  19.8k|    sign_reg = _mm_cmpgt_epi16(temp3, zero_8x16b);  // sign check
 1165|  19.8k|    temp3 = _mm_and_si128(temp3, sign_reg);
 1166|  19.8k|    sign_reg = _mm_cmpgt_epi16(temp4, zero_8x16b);  // sign check
 1167|  19.8k|    temp4 = _mm_and_si128(temp4, sign_reg);
 1168|  19.8k|    sign_reg = _mm_cmpgt_epi16(temp5, zero_8x16b);  // sign check
 1169|  19.8k|    temp5 = _mm_and_si128(temp5, sign_reg);
 1170|  19.8k|    sign_reg = _mm_cmpgt_epi16(temp6, zero_8x16b);  // sign check
 1171|  19.8k|    temp6 = _mm_and_si128(temp6, sign_reg);
 1172|  19.8k|    sign_reg = _mm_cmpgt_epi16(temp7, zero_8x16b);  // sign check
 1173|  19.8k|    temp7 = _mm_and_si128(temp7, sign_reg);
 1174|  19.8k|    sign_reg = _mm_cmpgt_epi16(temp8, zero_8x16b);  // sign check
 1175|  19.8k|    temp8 = _mm_and_si128(temp8, sign_reg);
 1176|       |
 1177|  19.8k|    resq_r0_2 = _mm_packus_epi16(temp1, zero_8x16b);
 1178|  19.8k|    resq_r1_2 = _mm_packus_epi16(temp2, zero_8x16b);
 1179|  19.8k|    resq_r2_2 = _mm_packus_epi16(temp3, zero_8x16b);
 1180|  19.8k|    resq_r3_2 = _mm_packus_epi16(temp4, zero_8x16b);
 1181|  19.8k|    resq_r4_2 = _mm_packus_epi16(temp5, zero_8x16b);
 1182|  19.8k|    resq_r5_2 = _mm_packus_epi16(temp6, zero_8x16b);
 1183|  19.8k|    resq_r6_2 = _mm_packus_epi16(temp7, zero_8x16b);
 1184|  19.8k|    resq_r7_2 = _mm_packus_epi16(temp8, zero_8x16b);
 1185|       |
 1186|  19.8k|    _mm_storel_epi64((__m128i *) (&pu1_out[0]), resq_r0_2);
 1187|  19.8k|    _mm_storel_epi64((__m128i *) (&pu1_out[out_strd]), resq_r1_2);
 1188|  19.8k|    _mm_storel_epi64((__m128i *) (&pu1_out[2 * out_strd]), resq_r2_2);
 1189|  19.8k|    _mm_storel_epi64((__m128i *) (&pu1_out[3 * out_strd]), resq_r3_2);
 1190|  19.8k|    _mm_storel_epi64((__m128i *) (&pu1_out[4 * out_strd]), resq_r4_2);
 1191|  19.8k|    _mm_storel_epi64((__m128i *) (&pu1_out[5 * out_strd]), resq_r5_2);
 1192|  19.8k|    _mm_storel_epi64((__m128i *) (&pu1_out[6 * out_strd]), resq_r6_2);
 1193|  19.8k|    _mm_storel_epi64((__m128i *) (&pu1_out[7 * out_strd]), resq_r7_2);
 1194|       |
 1195|  19.8k|    i4_nnz_b0 = (!(row_01_b0 && row_23_b0));
  ------------------
  |  Branch (1195:20): [True: 1.43k, False: 18.4k]
  |  Branch (1195:33): [True: 720, False: 718]
  ------------------
 1196|  19.8k|    i4_nnz_b1 = (!(row_01_b1 && row_23_b1)) << 1;
  ------------------
  |  Branch (1196:20): [True: 1.50k, False: 18.3k]
  |  Branch (1196:33): [True: 960, False: 549]
  ------------------
 1197|  19.8k|    i4_nnz_b2 = (!(row_45_b2 && row_67_b2)) << 4;
  ------------------
  |  Branch (1197:20): [True: 966, False: 18.9k]
  |  Branch (1197:33): [True: 900, False: 66]
  ------------------
 1198|  19.8k|    i4_nnz_b3 = (!(row_45_b3 && row_67_b3)) << 5;
  ------------------
  |  Branch (1198:20): [True: 786, False: 19.0k]
  |  Branch (1198:33): [True: 713, False: 73]
  ------------------
 1199|       |
 1200|  19.8k|    i4_nnz = (i4_nnz_b0 | i4_nnz_b1 | i4_nnz_b2 | i4_nnz_b3);
 1201|  19.8k|    return i4_nnz;
 1202|  19.8k|}
isvcd_iquant_itrans_residual_recon_4x4_dc_sse42:
 1231|  1.87k|{
 1232|  1.87k|    __m128i pred_16x8b_0, pred_8x16b_0, rsd_8x16b_0, out_8x16b_0, out_16x8b_0;
 1233|  1.87k|    __m128i pred_16x8b_1, pred_8x16b_1, rsd_8x16b_1, out_8x16b_1, out_16x8b_1;
 1234|  1.87k|    __m128i pred_16x8b_2, pred_8x16b_2, rsd_8x16b_2, out_8x16b_2, out_16x8b_2;
 1235|  1.87k|    __m128i pred_16x8b_3, pred_8x16b_3, rsd_8x16b_3, out_8x16b_3, out_16x8b_3;
 1236|  1.87k|    __m128i rsd_8x16b_01, rsd_8x16b_23;
 1237|       |
 1238|  1.87k|    __m128i i_macro_8x16b, dupmax_8x16b, dupmin_8x16b;
 1239|  1.87k|    __m128i zero_8x16b = _mm_setzero_si128();
 1240|  1.87k|    WORD32 i4_nnz, row_01, row_23;
 1241|  1.87k|    WORD32 q0;
 1242|  1.87k|    WORD16 i_macro;
 1243|  1.87k|    WORD16 rnd_fact = (u4_qp_div_6 < 4) ? 1 << (3 - u4_qp_div_6) : 0;
  ------------------
  |  Branch (1243:23): [True: 594, False: 1.27k]
  ------------------
 1244|  1.87k|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|  1.87k|#define UNUSED(x) ((void)(x))
  ------------------
 1245|       |
 1246|  1.87k|    if(iq_start_idx == 0)
  ------------------
  |  Branch (1246:8): [True: 1.87k, False: 0]
  ------------------
 1247|  1.87k|    {
 1248|  1.87k|        q0 = pi2_src[0];
 1249|  1.87k|        INV_QUANT(q0, pu2_iscal_mat[0], pu2_weigh_mat[0], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|  1.87k|                {\
  |  |  104|  1.87k|                    i4_value *= quant_scale;\
  |  |  105|  1.87k|                    i4_value *= weight_scale;\
  |  |  106|  1.87k|                    i4_value += rndfactor;\
  |  |  107|  1.87k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  1.87k|                    i4_value >>= qbits;\
  |  |  109|  1.87k|                }
  ------------------
 1250|  1.87k|    }
 1251|      0|    else
 1252|      0|    {
 1253|      0|        q0 = pi2_dc_ld_addr[0];  // Restoring dc value for intra case3
 1254|      0|    }
 1255|  1.87k|    i_macro = ((q0 + 32) >> 6);
 1256|       |
 1257|  1.87k|    i_macro_8x16b = _mm_set1_epi16(i_macro);
 1258|  1.87k|    dupmax_8x16b = _mm_set1_epi16(RSD_MAX);
  ------------------
  |  |  772|  1.87k|#define RSD_MAX 255
  ------------------
 1259|  1.87k|    dupmin_8x16b = _mm_set1_epi16(RSD_MIN);
  ------------------
  |  |  773|  1.87k|#define RSD_MIN -255
  ------------------
 1260|       |
 1261|  1.87k|    pred_16x8b_0 = _mm_loadu_si128((__m128i *) (pu1_pred));
 1262|  1.87k|    pred_16x8b_1 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd));
 1263|  1.87k|    pred_16x8b_2 = _mm_loadu_si128((__m128i *) (pu1_pred + (pred_strd << 1)));
 1264|  1.87k|    pred_16x8b_3 = _mm_loadu_si128((__m128i *) (pu1_pred + (pred_strd << 1) + pred_strd));
 1265|       |
 1266|  1.87k|    pred_8x16b_0 = _mm_cvtepu8_epi16(pred_16x8b_0);
 1267|  1.87k|    pred_8x16b_1 = _mm_cvtepu8_epi16(pred_16x8b_1);
 1268|  1.87k|    pred_8x16b_2 = _mm_cvtepu8_epi16(pred_16x8b_2);
 1269|  1.87k|    pred_8x16b_3 = _mm_cvtepu8_epi16(pred_16x8b_3);
 1270|       |
 1271|  1.87k|    rsd_8x16b_0 = _mm_loadu_si128((__m128i *) (pi2_rsd));
 1272|  1.87k|    rsd_8x16b_1 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd));
 1273|  1.87k|    rsd_8x16b_2 = _mm_loadu_si128((__m128i *) (pi2_rsd + (rsd_strd << 1)));
 1274|  1.87k|    rsd_8x16b_3 = _mm_loadu_si128((__m128i *) (pi2_rsd + (rsd_strd << 1) + rsd_strd));
 1275|       |
 1276|  1.87k|    rsd_8x16b_0 = _mm_add_epi16(i_macro_8x16b, rsd_8x16b_0);
 1277|  1.87k|    rsd_8x16b_1 = _mm_add_epi16(i_macro_8x16b, rsd_8x16b_1);
 1278|  1.87k|    rsd_8x16b_2 = _mm_add_epi16(i_macro_8x16b, rsd_8x16b_2);
 1279|  1.87k|    rsd_8x16b_3 = _mm_add_epi16(i_macro_8x16b, rsd_8x16b_3);
 1280|       |
 1281|  1.87k|    rsd_8x16b_0 = _mm_min_epi16(dupmax_8x16b, rsd_8x16b_0);
 1282|  1.87k|    rsd_8x16b_0 = _mm_max_epi16(dupmin_8x16b, rsd_8x16b_0);
 1283|  1.87k|    rsd_8x16b_1 = _mm_min_epi16(dupmax_8x16b, rsd_8x16b_1);
 1284|  1.87k|    rsd_8x16b_1 = _mm_max_epi16(dupmin_8x16b, rsd_8x16b_1);
 1285|  1.87k|    rsd_8x16b_2 = _mm_min_epi16(dupmax_8x16b, rsd_8x16b_2);
 1286|  1.87k|    rsd_8x16b_2 = _mm_max_epi16(dupmin_8x16b, rsd_8x16b_2);
 1287|  1.87k|    rsd_8x16b_3 = _mm_min_epi16(dupmax_8x16b, rsd_8x16b_3);
 1288|  1.87k|    rsd_8x16b_3 = _mm_max_epi16(dupmin_8x16b, rsd_8x16b_3);
 1289|       |
 1290|  1.87k|    rsd_8x16b_01 = _mm_unpacklo_epi64(rsd_8x16b_0, rsd_8x16b_1);
 1291|  1.87k|    rsd_8x16b_23 = _mm_unpacklo_epi64(rsd_8x16b_2, rsd_8x16b_3);
 1292|       |
 1293|  1.87k|    row_01 = _mm_test_all_ones(
 1294|  1.87k|        _mm_cmpeq_epi16(rsd_8x16b_01, zero_8x16b));  // return 1 if all zeros, else 0
 1295|  1.87k|    row_23 = _mm_test_all_ones(_mm_cmpeq_epi16(rsd_8x16b_23, zero_8x16b));
 1296|       |
 1297|  1.87k|    out_8x16b_0 = _mm_add_epi16(pred_8x16b_0, rsd_8x16b_0);
 1298|  1.87k|    out_8x16b_1 = _mm_add_epi16(pred_8x16b_1, rsd_8x16b_1);
 1299|  1.87k|    out_8x16b_2 = _mm_add_epi16(pred_8x16b_2, rsd_8x16b_2);
 1300|  1.87k|    out_8x16b_3 = _mm_add_epi16(pred_8x16b_3, rsd_8x16b_3);
 1301|       |
 1302|  1.87k|    out_16x8b_0 = _mm_packus_epi16(out_8x16b_0, zero_8x16b);
 1303|  1.87k|    out_16x8b_1 = _mm_packus_epi16(out_8x16b_1, zero_8x16b);
 1304|  1.87k|    out_16x8b_2 = _mm_packus_epi16(out_8x16b_2, zero_8x16b);
 1305|  1.87k|    out_16x8b_3 = _mm_packus_epi16(out_8x16b_3, zero_8x16b);
 1306|       |
 1307|  1.87k|    *((WORD32 *) (pu1_out)) = _mm_cvtsi128_si32(out_16x8b_0);
 1308|  1.87k|    *((WORD32 *) (pu1_out + out_strd)) = _mm_cvtsi128_si32(out_16x8b_1);
 1309|  1.87k|    *((WORD32 *) (pu1_out + (out_strd << 1))) = _mm_cvtsi128_si32(out_16x8b_2);
 1310|  1.87k|    *((WORD32 *) (pu1_out + (out_strd * 3))) = _mm_cvtsi128_si32(out_16x8b_3);
 1311|       |
 1312|  1.87k|    i4_nnz = !(row_01 && row_23);
  ------------------
  |  Branch (1312:16): [True: 352, False: 1.52k]
  |  Branch (1312:26): [True: 352, False: 0]
  ------------------
 1313|  1.87k|    return i4_nnz;
 1314|  1.87k|}
isvcd_iquant_itrans_residual_recon_8x8_dc_sse42:
 1343|  1.97k|{
 1344|  1.97k|    __m128i pred_16x8b_0, pred_8x16b_0, rsd_8x16b_0, out_8x16b_0, out_16x8b_0;
 1345|  1.97k|    __m128i pred_16x8b_1, pred_8x16b_1, rsd_8x16b_1, out_8x16b_1, out_16x8b_1;
 1346|  1.97k|    __m128i pred_16x8b_2, pred_8x16b_2, rsd_8x16b_2, out_8x16b_2, out_16x8b_2;
 1347|  1.97k|    __m128i pred_16x8b_3, pred_8x16b_3, rsd_8x16b_3, out_8x16b_3, out_16x8b_3;
 1348|  1.97k|    __m128i pred_16x8b_4, pred_8x16b_4, rsd_8x16b_4, out_8x16b_4, out_16x8b_4;
 1349|  1.97k|    __m128i pred_16x8b_5, pred_8x16b_5, rsd_8x16b_5, out_8x16b_5, out_16x8b_5;
 1350|  1.97k|    __m128i pred_16x8b_6, pred_8x16b_6, rsd_8x16b_6, out_8x16b_6, out_16x8b_6;
 1351|  1.97k|    __m128i pred_16x8b_7, pred_8x16b_7, rsd_8x16b_7, out_8x16b_7, out_16x8b_7;
 1352|  1.97k|    __m128i rsd_8x16b_01_b0, rsd_8x16b_23_b0, rsd_8x16b_45_b2, rsd_8x16b_67_b2;
 1353|  1.97k|    __m128i rsd_8x16b_01_b1, rsd_8x16b_23_b1, rsd_8x16b_45_b3, rsd_8x16b_67_b3;
 1354|       |
 1355|  1.97k|    WORD32 row_01_b0, row_23_b0, row_45_b2, row_67_b2;
 1356|  1.97k|    WORD32 row_01_b1, row_23_b1, row_45_b3, row_67_b3;
 1357|  1.97k|    WORD32 i4_nnz, i4_nnz_b0, i4_nnz_b1, i4_nnz_b2, i4_nnz_b3;
 1358|       |
 1359|  1.97k|    __m128i zero_8x16b = _mm_setzero_si128();
 1360|       |
 1361|  1.97k|    WORD32 pred_strd2 = (pred_strd << 1);
 1362|  1.97k|    WORD32 pred_strd4 = (pred_strd << 2);
 1363|  1.97k|    WORD32 rsd_strd2 = (rsd_strd << 1);
 1364|  1.97k|    WORD32 rsd_strd4 = (rsd_strd << 2);
 1365|  1.97k|    WORD32 out_strd2 = (out_strd << 1);
 1366|  1.97k|    WORD32 out_strd4 = (out_strd << 2);
 1367|       |
 1368|  1.97k|    __m128i i_macro_8x16b, dupmax_8x16b, dupmin_8x16b;
 1369|  1.97k|    WORD32 q;
 1370|  1.97k|    WORD16 i_macro;
 1371|  1.97k|    WORD32 rnd_fact = (qp_div < 6) ? (1 << (5 - qp_div)) : 0;
  ------------------
  |  Branch (1371:23): [True: 1.20k, False: 765]
  ------------------
 1372|  1.97k|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|  1.97k|#define UNUSED(x) ((void)(x))
  ------------------
 1373|  1.97k|    UNUSED(iq_start_idx);
  ------------------
  |  |   45|  1.97k|#define UNUSED(x) ((void)(x))
  ------------------
 1374|  1.97k|    UNUSED(pi2_dc_ld_addr);
  ------------------
  |  |   45|  1.97k|#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|  1.97k|    q = pi2_src[0];
 1380|  1.97k|    INV_QUANT(q, pu2_iscale_mat[0], pu2_weigh_mat[0], qp_div, rnd_fact, 6);
  ------------------
  |  |  103|  1.97k|                {\
  |  |  104|  1.97k|                    i4_value *= quant_scale;\
  |  |  105|  1.97k|                    i4_value *= weight_scale;\
  |  |  106|  1.97k|                    i4_value += rndfactor;\
  |  |  107|  1.97k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  1.97k|                    i4_value >>= qbits;\
  |  |  109|  1.97k|                }
  ------------------
 1381|  1.97k|    i_macro = (q + 32) >> 6;
 1382|       |
 1383|  1.97k|    i_macro_8x16b = _mm_set1_epi16(i_macro);
 1384|  1.97k|    dupmax_8x16b = _mm_set1_epi16(RSD_MAX);
  ------------------
  |  |  772|  1.97k|#define RSD_MAX 255
  ------------------
 1385|  1.97k|    dupmin_8x16b = _mm_set1_epi16(RSD_MIN);
  ------------------
  |  |  773|  1.97k|#define RSD_MIN -255
  ------------------
 1386|       |
 1387|  1.97k|    pred_16x8b_0 = _mm_loadu_si128((__m128i *) (pu1_pred));
 1388|  1.97k|    pred_16x8b_1 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd));
 1389|  1.97k|    pred_16x8b_2 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd2));
 1390|  1.97k|    pred_16x8b_3 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd2 + pred_strd));
 1391|  1.97k|    pred_16x8b_4 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd4));
 1392|  1.97k|    pred_16x8b_5 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd4 + pred_strd));
 1393|  1.97k|    pred_16x8b_6 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd4 + pred_strd2));
 1394|  1.97k|    pred_16x8b_7 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd4 + pred_strd2 + pred_strd));
 1395|       |
 1396|  1.97k|    pred_8x16b_0 = _mm_cvtepu8_epi16(pred_16x8b_0);
 1397|  1.97k|    pred_8x16b_1 = _mm_cvtepu8_epi16(pred_16x8b_1);
 1398|  1.97k|    pred_8x16b_2 = _mm_cvtepu8_epi16(pred_16x8b_2);
 1399|  1.97k|    pred_8x16b_3 = _mm_cvtepu8_epi16(pred_16x8b_3);
 1400|  1.97k|    pred_8x16b_4 = _mm_cvtepu8_epi16(pred_16x8b_4);
 1401|  1.97k|    pred_8x16b_5 = _mm_cvtepu8_epi16(pred_16x8b_5);
 1402|  1.97k|    pred_8x16b_6 = _mm_cvtepu8_epi16(pred_16x8b_6);
 1403|  1.97k|    pred_8x16b_7 = _mm_cvtepu8_epi16(pred_16x8b_7);
 1404|       |
 1405|  1.97k|    rsd_8x16b_0 = _mm_loadu_si128((__m128i *) (pi2_rsd));
 1406|  1.97k|    rsd_8x16b_1 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd));
 1407|  1.97k|    rsd_8x16b_2 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd2));
 1408|  1.97k|    rsd_8x16b_3 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd2 + rsd_strd));
 1409|  1.97k|    rsd_8x16b_4 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd4));
 1410|  1.97k|    rsd_8x16b_5 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd4 + rsd_strd));
 1411|  1.97k|    rsd_8x16b_6 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd4 + rsd_strd2));
 1412|  1.97k|    rsd_8x16b_7 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd4 + rsd_strd2 + rsd_strd));
 1413|       |
 1414|  1.97k|    rsd_8x16b_0 = _mm_add_epi16(i_macro_8x16b, rsd_8x16b_0);
 1415|  1.97k|    rsd_8x16b_1 = _mm_add_epi16(i_macro_8x16b, rsd_8x16b_1);
 1416|  1.97k|    rsd_8x16b_2 = _mm_add_epi16(i_macro_8x16b, rsd_8x16b_2);
 1417|  1.97k|    rsd_8x16b_3 = _mm_add_epi16(i_macro_8x16b, rsd_8x16b_3);
 1418|  1.97k|    rsd_8x16b_4 = _mm_add_epi16(i_macro_8x16b, rsd_8x16b_4);
 1419|  1.97k|    rsd_8x16b_5 = _mm_add_epi16(i_macro_8x16b, rsd_8x16b_5);
 1420|  1.97k|    rsd_8x16b_6 = _mm_add_epi16(i_macro_8x16b, rsd_8x16b_6);
 1421|  1.97k|    rsd_8x16b_7 = _mm_add_epi16(i_macro_8x16b, rsd_8x16b_7);
 1422|       |
 1423|  1.97k|    rsd_8x16b_0 = _mm_min_epi16(dupmax_8x16b, rsd_8x16b_0);
 1424|  1.97k|    rsd_8x16b_0 = _mm_max_epi16(dupmin_8x16b, rsd_8x16b_0);
 1425|  1.97k|    rsd_8x16b_1 = _mm_min_epi16(dupmax_8x16b, rsd_8x16b_1);
 1426|  1.97k|    rsd_8x16b_1 = _mm_max_epi16(dupmin_8x16b, rsd_8x16b_1);
 1427|  1.97k|    rsd_8x16b_2 = _mm_min_epi16(dupmax_8x16b, rsd_8x16b_2);
 1428|  1.97k|    rsd_8x16b_2 = _mm_max_epi16(dupmin_8x16b, rsd_8x16b_2);
 1429|  1.97k|    rsd_8x16b_3 = _mm_min_epi16(dupmax_8x16b, rsd_8x16b_3);
 1430|  1.97k|    rsd_8x16b_3 = _mm_max_epi16(dupmin_8x16b, rsd_8x16b_3);
 1431|  1.97k|    rsd_8x16b_4 = _mm_min_epi16(dupmax_8x16b, rsd_8x16b_4);
 1432|  1.97k|    rsd_8x16b_4 = _mm_max_epi16(dupmin_8x16b, rsd_8x16b_4);
 1433|  1.97k|    rsd_8x16b_5 = _mm_min_epi16(dupmax_8x16b, rsd_8x16b_5);
 1434|  1.97k|    rsd_8x16b_5 = _mm_max_epi16(dupmin_8x16b, rsd_8x16b_5);
 1435|  1.97k|    rsd_8x16b_6 = _mm_min_epi16(dupmax_8x16b, rsd_8x16b_6);
 1436|  1.97k|    rsd_8x16b_6 = _mm_max_epi16(dupmin_8x16b, rsd_8x16b_6);
 1437|  1.97k|    rsd_8x16b_7 = _mm_min_epi16(dupmax_8x16b, rsd_8x16b_7);
 1438|  1.97k|    rsd_8x16b_7 = _mm_max_epi16(dupmin_8x16b, rsd_8x16b_7);
 1439|       |
 1440|  1.97k|    rsd_8x16b_01_b0 = _mm_unpacklo_epi64(rsd_8x16b_0, rsd_8x16b_1);
 1441|  1.97k|    rsd_8x16b_23_b0 = _mm_unpacklo_epi64(rsd_8x16b_2, rsd_8x16b_3);
 1442|  1.97k|    rsd_8x16b_01_b1 = _mm_unpackhi_epi64(rsd_8x16b_0, rsd_8x16b_1);
 1443|  1.97k|    rsd_8x16b_23_b1 = _mm_unpackhi_epi64(rsd_8x16b_2, rsd_8x16b_3);
 1444|       |
 1445|  1.97k|    rsd_8x16b_45_b2 = _mm_unpacklo_epi64(rsd_8x16b_4, rsd_8x16b_5);
 1446|  1.97k|    rsd_8x16b_67_b2 = _mm_unpacklo_epi64(rsd_8x16b_6, rsd_8x16b_7);
 1447|  1.97k|    rsd_8x16b_45_b3 = _mm_unpackhi_epi64(rsd_8x16b_4, rsd_8x16b_5);
 1448|  1.97k|    rsd_8x16b_67_b3 = _mm_unpackhi_epi64(rsd_8x16b_6, rsd_8x16b_7);
 1449|       |
 1450|  1.97k|    row_01_b0 = _mm_test_all_ones(rsd_8x16b_01_b0);  // return 1 if all zeros, else 0
 1451|  1.97k|    row_23_b0 = _mm_test_all_ones(rsd_8x16b_23_b0);
 1452|  1.97k|    row_01_b1 = _mm_test_all_ones(rsd_8x16b_01_b1);
 1453|  1.97k|    row_23_b1 = _mm_test_all_ones(rsd_8x16b_23_b1);
 1454|       |
 1455|  1.97k|    row_45_b2 = _mm_test_all_ones(rsd_8x16b_45_b2);
 1456|  1.97k|    row_67_b2 = _mm_test_all_ones(rsd_8x16b_67_b2);
 1457|  1.97k|    row_45_b3 = _mm_test_all_ones(rsd_8x16b_45_b3);
 1458|  1.97k|    row_67_b3 = _mm_test_all_ones(rsd_8x16b_67_b3);
 1459|       |
 1460|  1.97k|    out_8x16b_0 = _mm_add_epi16(pred_8x16b_0, rsd_8x16b_0);
 1461|  1.97k|    out_8x16b_1 = _mm_add_epi16(pred_8x16b_1, rsd_8x16b_1);
 1462|  1.97k|    out_8x16b_2 = _mm_add_epi16(pred_8x16b_2, rsd_8x16b_2);
 1463|  1.97k|    out_8x16b_3 = _mm_add_epi16(pred_8x16b_3, rsd_8x16b_3);
 1464|  1.97k|    out_8x16b_4 = _mm_add_epi16(pred_8x16b_4, rsd_8x16b_4);
 1465|  1.97k|    out_8x16b_5 = _mm_add_epi16(pred_8x16b_5, rsd_8x16b_5);
 1466|  1.97k|    out_8x16b_6 = _mm_add_epi16(pred_8x16b_6, rsd_8x16b_6);
 1467|  1.97k|    out_8x16b_7 = _mm_add_epi16(pred_8x16b_7, rsd_8x16b_7);
 1468|       |
 1469|  1.97k|    out_16x8b_0 = _mm_packus_epi16(out_8x16b_0, zero_8x16b);
 1470|  1.97k|    out_16x8b_1 = _mm_packus_epi16(out_8x16b_1, zero_8x16b);
 1471|  1.97k|    out_16x8b_2 = _mm_packus_epi16(out_8x16b_2, zero_8x16b);
 1472|  1.97k|    out_16x8b_3 = _mm_packus_epi16(out_8x16b_3, zero_8x16b);
 1473|  1.97k|    out_16x8b_4 = _mm_packus_epi16(out_8x16b_4, zero_8x16b);
 1474|  1.97k|    out_16x8b_5 = _mm_packus_epi16(out_8x16b_5, zero_8x16b);
 1475|  1.97k|    out_16x8b_6 = _mm_packus_epi16(out_8x16b_6, zero_8x16b);
 1476|  1.97k|    out_16x8b_7 = _mm_packus_epi16(out_8x16b_7, zero_8x16b);
 1477|       |
 1478|  1.97k|    _mm_storel_epi64((__m128i *) (pu1_out), out_16x8b_0);
 1479|  1.97k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd), out_16x8b_1);
 1480|  1.97k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd2), out_16x8b_2);
 1481|  1.97k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd2 + out_strd), out_16x8b_3);
 1482|  1.97k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd4), out_16x8b_4);
 1483|  1.97k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd4 + out_strd), out_16x8b_5);
 1484|  1.97k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd4 + out_strd2), out_16x8b_6);
 1485|  1.97k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd4 + out_strd2 + out_strd), out_16x8b_7);
 1486|       |
 1487|  1.97k|    i4_nnz_b0 = (!(row_01_b0 && row_23_b0));
  ------------------
  |  Branch (1487:20): [True: 414, False: 1.55k]
  |  Branch (1487:33): [True: 414, False: 0]
  ------------------
 1488|  1.97k|    i4_nnz_b1 = (!(row_01_b1 && row_23_b1)) << 1;
  ------------------
  |  Branch (1488:20): [True: 414, False: 1.55k]
  |  Branch (1488:33): [True: 414, False: 0]
  ------------------
 1489|  1.97k|    i4_nnz_b2 = (!(row_45_b2 && row_67_b2)) << 4;
  ------------------
  |  Branch (1489:20): [True: 414, False: 1.55k]
  |  Branch (1489:33): [True: 414, False: 0]
  ------------------
 1490|  1.97k|    i4_nnz_b3 = (!(row_45_b3 && row_67_b3)) << 5;
  ------------------
  |  Branch (1490:20): [True: 414, False: 1.55k]
  |  Branch (1490:33): [True: 414, False: 0]
  ------------------
 1491|       |
 1492|  1.97k|    i4_nnz = (i4_nnz_b0 | i4_nnz_b1 | i4_nnz_b2 | i4_nnz_b3);
 1493|  1.97k|    return i4_nnz;
 1494|  1.97k|}
isvcd_iquant_itrans_residual_recon_chroma_4x4_dc_sse42:
 1523|  25.8k|{
 1524|  25.8k|    __m128i pred_16x8b_0, pred_8x16b_0, rsd_8x16b_0, rsd_16x8b_0, out_16x8b_0;
 1525|  25.8k|    __m128i pred_16x8b_1, pred_8x16b_1, rsd_8x16b_1, rsd_16x8b_1, out_16x8b_1;
 1526|  25.8k|    __m128i pred_16x8b_2, pred_8x16b_2, rsd_8x16b_2, rsd_16x8b_2, out_16x8b_2;
 1527|  25.8k|    __m128i pred_16x8b_3, pred_8x16b_3, rsd_8x16b_3, rsd_16x8b_3, out_16x8b_3;
 1528|       |
 1529|  25.8k|    __m128i i_macro_8x16b, dupmax_8x16b, dupmin_8x16b;
 1530|  25.8k|    __m128i chroma_mask, chroma_mask2;
 1531|  25.8k|    __m128i zero_8x16b = _mm_setzero_si128();
 1532|  25.8k|    WORD32 q0;
 1533|  25.8k|    WORD16 i_macro;
 1534|  25.8k|    UNUSED(pi2_src);
  ------------------
  |  |   45|  25.8k|#define UNUSED(x) ((void)(x))
  ------------------
 1535|  25.8k|    UNUSED(pu2_iscal_mat);
  ------------------
  |  |   45|  25.8k|#define UNUSED(x) ((void)(x))
  ------------------
 1536|  25.8k|    UNUSED(pu2_weigh_mat);
  ------------------
  |  |   45|  25.8k|#define UNUSED(x) ((void)(x))
  ------------------
 1537|  25.8k|    UNUSED(u4_qp_div_6);
  ------------------
  |  |   45|  25.8k|#define UNUSED(x) ((void)(x))
  ------------------
 1538|  25.8k|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|  25.8k|#define UNUSED(x) ((void)(x))
  ------------------
 1539|       |
 1540|  25.8k|    q0 = pi2_dc_src[0];  // Restoring dc value for intra case3
 1541|  25.8k|    i_macro = ((q0 + 32) >> 6);
 1542|       |
 1543|  25.8k|    i_macro_8x16b = _mm_set1_epi16(i_macro);
 1544|  25.8k|    dupmax_8x16b = _mm_set1_epi16(RSD_MAX);
  ------------------
  |  |  772|  25.8k|#define RSD_MAX 255
  ------------------
 1545|  25.8k|    dupmin_8x16b = _mm_set1_epi16(RSD_MIN);
  ------------------
  |  |  773|  25.8k|#define RSD_MIN -255
  ------------------
 1546|       |
 1547|  25.8k|    pred_16x8b_0 = _mm_loadu_si128((__m128i *) (pu1_pred));
 1548|  25.8k|    pred_16x8b_1 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd));
 1549|  25.8k|    pred_16x8b_2 = _mm_loadu_si128((__m128i *) (pu1_pred + (pred_strd << 1)));
 1550|  25.8k|    pred_16x8b_3 = _mm_loadu_si128((__m128i *) (pu1_pred + (pred_strd << 1) + pred_strd));
 1551|       |
 1552|  25.8k|    pred_8x16b_0 = _mm_cvtepu8_epi16(pred_16x8b_0);
 1553|  25.8k|    pred_8x16b_1 = _mm_cvtepu8_epi16(pred_16x8b_1);
 1554|  25.8k|    pred_8x16b_2 = _mm_cvtepu8_epi16(pred_16x8b_2);
 1555|  25.8k|    pred_8x16b_3 = _mm_cvtepu8_epi16(pred_16x8b_3);
 1556|       |
 1557|  25.8k|    rsd_8x16b_0 = _mm_loadu_si128((__m128i *) (pi2_rsd));
 1558|  25.8k|    rsd_8x16b_1 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd));
 1559|  25.8k|    rsd_8x16b_2 = _mm_loadu_si128((__m128i *) (pi2_rsd + (rsd_strd << 1)));
 1560|  25.8k|    rsd_8x16b_3 = _mm_loadu_si128((__m128i *) (pi2_rsd + (rsd_strd << 1) + rsd_strd));
 1561|       |
 1562|  25.8k|    rsd_8x16b_0 = _mm_add_epi16(i_macro_8x16b, rsd_8x16b_0);
 1563|  25.8k|    rsd_8x16b_1 = _mm_add_epi16(i_macro_8x16b, rsd_8x16b_1);
 1564|  25.8k|    rsd_8x16b_2 = _mm_add_epi16(i_macro_8x16b, rsd_8x16b_2);
 1565|  25.8k|    rsd_8x16b_3 = _mm_add_epi16(i_macro_8x16b, rsd_8x16b_3);
 1566|       |
 1567|  25.8k|    rsd_8x16b_0 = _mm_min_epi16(dupmax_8x16b, rsd_8x16b_0);
 1568|  25.8k|    rsd_8x16b_0 = _mm_max_epi16(dupmin_8x16b, rsd_8x16b_0);
 1569|  25.8k|    rsd_8x16b_1 = _mm_min_epi16(dupmax_8x16b, rsd_8x16b_1);
 1570|  25.8k|    rsd_8x16b_1 = _mm_max_epi16(dupmin_8x16b, rsd_8x16b_1);
 1571|  25.8k|    rsd_8x16b_2 = _mm_min_epi16(dupmax_8x16b, rsd_8x16b_2);
 1572|  25.8k|    rsd_8x16b_2 = _mm_max_epi16(dupmin_8x16b, rsd_8x16b_2);
 1573|  25.8k|    rsd_8x16b_3 = _mm_min_epi16(dupmax_8x16b, rsd_8x16b_3);
 1574|  25.8k|    rsd_8x16b_3 = _mm_max_epi16(dupmin_8x16b, rsd_8x16b_3);
 1575|       |
 1576|  25.8k|    rsd_8x16b_0 = _mm_add_epi16(pred_8x16b_0, rsd_8x16b_0);
 1577|  25.8k|    rsd_8x16b_1 = _mm_add_epi16(pred_8x16b_1, rsd_8x16b_1);
 1578|  25.8k|    rsd_8x16b_2 = _mm_add_epi16(pred_8x16b_2, rsd_8x16b_2);
 1579|  25.8k|    rsd_8x16b_3 = _mm_add_epi16(pred_8x16b_3, rsd_8x16b_3);
 1580|       |
 1581|  25.8k|    chroma_mask = _mm_set1_epi16(0xFF00);
 1582|  25.8k|    chroma_mask2 = _mm_set1_epi16(0x00FF);
 1583|  25.8k|    out_16x8b_0 = _mm_loadu_si128((__m128i *) (&pu1_out[0]));
 1584|  25.8k|    out_16x8b_1 = _mm_loadu_si128((__m128i *) (&pu1_out[out_strd]));
 1585|  25.8k|    out_16x8b_2 = _mm_loadu_si128((__m128i *) (&pu1_out[(out_strd << 1)]));
 1586|  25.8k|    out_16x8b_3 = _mm_loadu_si128((__m128i *) (&pu1_out[(out_strd << 1) + out_strd]));
 1587|       |
 1588|  25.8k|    out_16x8b_0 = _mm_and_si128(out_16x8b_0, chroma_mask);
 1589|  25.8k|    out_16x8b_1 = _mm_and_si128(out_16x8b_1, chroma_mask);
 1590|  25.8k|    out_16x8b_2 = _mm_and_si128(out_16x8b_2, chroma_mask);
 1591|  25.8k|    out_16x8b_3 = _mm_and_si128(out_16x8b_3, chroma_mask);
 1592|       |
 1593|  25.8k|    rsd_16x8b_0 = _mm_packus_epi16(rsd_8x16b_0, zero_8x16b);
 1594|  25.8k|    rsd_16x8b_1 = _mm_packus_epi16(rsd_8x16b_1, zero_8x16b);
 1595|  25.8k|    rsd_16x8b_2 = _mm_packus_epi16(rsd_8x16b_2, zero_8x16b);
 1596|  25.8k|    rsd_16x8b_3 = _mm_packus_epi16(rsd_8x16b_3, zero_8x16b);
 1597|       |
 1598|  25.8k|    rsd_8x16b_0 = _mm_and_si128(rsd_16x8b_0, chroma_mask2);
 1599|  25.8k|    rsd_8x16b_1 = _mm_and_si128(rsd_16x8b_1, chroma_mask2);
 1600|  25.8k|    rsd_8x16b_2 = _mm_and_si128(rsd_16x8b_2, chroma_mask2);
 1601|  25.8k|    rsd_8x16b_3 = _mm_and_si128(rsd_16x8b_3, chroma_mask2);
 1602|       |
 1603|  25.8k|    out_16x8b_0 = _mm_add_epi8(rsd_8x16b_0, out_16x8b_0);
 1604|  25.8k|    out_16x8b_1 = _mm_add_epi8(rsd_8x16b_1, out_16x8b_1);
 1605|  25.8k|    out_16x8b_2 = _mm_add_epi8(rsd_8x16b_2, out_16x8b_2);
 1606|  25.8k|    out_16x8b_3 = _mm_add_epi8(rsd_8x16b_3, out_16x8b_3);
 1607|       |
 1608|  25.8k|    _mm_storel_epi64((__m128i *) (pu1_out), out_16x8b_0);
 1609|  25.8k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd), out_16x8b_1);
 1610|  25.8k|    _mm_storel_epi64((__m128i *) (pu1_out + (out_strd << 1)), out_16x8b_2);
 1611|  25.8k|    _mm_storel_epi64((__m128i *) (pu1_out + (out_strd * 3)), out_16x8b_3);
 1612|  25.8k|}
isvcd_iquant_itrans_residual_recon_chroma_4x4_sse42:
 1641|  3.83k|{
 1642|  3.83k|    __m128i src_r0_r1, src_r2_r3;
 1643|  3.83k|    __m128i src_r0, src_r1, src_r2, src_r3;
 1644|  3.83k|    __m128i scalemat_r0_r1, scalemat_r2_r3;
 1645|  3.83k|    __m128i pred_r0, pred_r1, pred_r2, pred_r3;
 1646|  3.83k|    __m128i rsd_r0, rsd_r1, rsd_r2, rsd_r3;
 1647|  3.83k|    __m128i dequant_r0_r1, dequant_r2_r3;
 1648|  3.83k|    __m128i zero_8x16b = _mm_setzero_si128();  // all bits reset to zero
 1649|  3.83k|    __m128i temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7;
 1650|  3.83k|    __m128i resq_r0, resq_r1, resq_r2, resq_r3;
 1651|  3.83k|    __m128i add_rshift = _mm_set1_epi32((u4_qp_div_6 < 4) ? (1 << (3 - u4_qp_div_6)) : 0);
  ------------------
  |  Branch (1651:41): [True: 2.50k, False: 1.32k]
  ------------------
 1652|  3.83k|    __m128i value_32 = _mm_set1_epi32(32);
 1653|  3.83k|    __m128i chroma_mask = _mm_set1_epi16(0xFF00);
 1654|  3.83k|    __m128i chroma_mask2 = _mm_set1_epi16(0x00FF);
 1655|  3.83k|    __m128i dupmax_8x16b = _mm_set1_epi16(RSD_MAX);
  ------------------
  |  |  772|  3.83k|#define RSD_MAX 255
  ------------------
 1656|  3.83k|    __m128i dupmin_8x16b = _mm_set1_epi16(RSD_MIN);
  ------------------
  |  |  773|  3.83k|#define RSD_MIN -255
  ------------------
 1657|       |
 1658|  3.83k|    __m128i out_16x8b_0, out_16x8b_1, out_16x8b_2, out_16x8b_3;
 1659|       |
 1660|  3.83k|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|  3.83k|#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|  3.83k|    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|  3.83k|    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|  3.83k|    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|  3.83k|    scalemat_r2_r3 = _mm_loadu_si128((__m128i *) (pu2_iscal_mat + 8));
 1674|       |    // q00 q01 q02 q03 q10 q11  q12 q13 -- all 16 bits
 1675|  3.83k|    dequant_r0_r1 = _mm_loadu_si128((__m128i *) (pu2_weigh_mat));
 1676|       |    // q20 q21 q22 q23 q30 q31 q32 q33 -- all 16 bits
 1677|  3.83k|    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|  3.83k|    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|  3.83k|    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|  3.83k|    temp4 = _mm_unpacklo_epi16(temp0, zero_8x16b);
 1685|       |    // b10*q10 0 b11*q11 0 b12*q12 0 b13*q13 0 -- 16 bit long
 1686|  3.83k|    temp5 = _mm_unpackhi_epi16(temp0, zero_8x16b);
 1687|       |    // b00*q00 0 b01*q01 0 b02*q02 0 b03*q03 0 -- 16 bit long
 1688|  3.83k|    temp6 = _mm_unpacklo_epi16(temp1, zero_8x16b);
 1689|       |    // b10*q10 0 b11*q11 0 b12*q12 0 b13*q13 0 -- 16 bit long
 1690|  3.83k|    temp7 = _mm_unpackhi_epi16(temp1, zero_8x16b);
 1691|       |
 1692|  3.83k|    src_r0 = _mm_unpacklo_epi16(src_r0_r1, zero_8x16b);  // a00 0 a01 0 a02 0 a03 0 -- 16 bit long
 1693|  3.83k|    src_r1 = _mm_unpackhi_epi16(src_r0_r1, zero_8x16b);  // a10 0 a11 0 a12 0 a13 0 -- 16 bit long
 1694|  3.83k|    src_r2 = _mm_unpacklo_epi16(src_r2_r3, zero_8x16b);  // a20 0 a21 0 a22 0 a23 0 -- 16 bit long
 1695|  3.83k|    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|  3.83k|    temp4 = _mm_madd_epi16(src_r0, temp4);
 1699|  3.83k|    temp5 = _mm_madd_epi16(src_r1, temp5);
 1700|  3.83k|    temp6 = _mm_madd_epi16(src_r2, temp6);
 1701|  3.83k|    temp7 = _mm_madd_epi16(src_r3, temp7);
 1702|       |
 1703|  3.83k|    if(u4_qp_div_6 >= 4)
  ------------------
  |  Branch (1703:8): [True: 1.32k, False: 2.50k]
  ------------------
 1704|  1.32k|    {
 1705|  1.32k|        resq_r0 = _mm_slli_epi32(temp4, u4_qp_div_6 - 4);
 1706|  1.32k|        resq_r1 = _mm_slli_epi32(temp5, u4_qp_div_6 - 4);
 1707|  1.32k|        resq_r2 = _mm_slli_epi32(temp6, u4_qp_div_6 - 4);
 1708|  1.32k|        resq_r3 = _mm_slli_epi32(temp7, u4_qp_div_6 - 4);
 1709|  1.32k|    }
 1710|  2.50k|    else
 1711|  2.50k|    {
 1712|  2.50k|        temp4 = _mm_add_epi32(temp4, add_rshift);
 1713|  2.50k|        temp5 = _mm_add_epi32(temp5, add_rshift);
 1714|  2.50k|        temp6 = _mm_add_epi32(temp6, add_rshift);
 1715|  2.50k|        temp7 = _mm_add_epi32(temp7, add_rshift);
 1716|  2.50k|        resq_r0 = _mm_srai_epi32(temp4, 4 - u4_qp_div_6);
 1717|  2.50k|        resq_r1 = _mm_srai_epi32(temp5, 4 - u4_qp_div_6);
 1718|  2.50k|        resq_r2 = _mm_srai_epi32(temp6, 4 - u4_qp_div_6);
 1719|  2.50k|        resq_r3 = _mm_srai_epi32(temp7, 4 - u4_qp_div_6);
 1720|  2.50k|    }
 1721|       |
 1722|  3.83k|    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|  3.83k|    temp1 = _mm_unpacklo_epi32(resq_r0, resq_r1);  // a0 b0 a1 b1
 1735|  3.83k|    temp3 = _mm_unpacklo_epi32(resq_r2, resq_r3);  // c0 d0 c1 d1
 1736|  3.83k|    temp2 = _mm_unpackhi_epi32(resq_r0, resq_r1);  // a2 b2 a3 b3
 1737|  3.83k|    temp4 = _mm_unpackhi_epi32(resq_r2, resq_r3);  // c2 d2 c3 d3
 1738|  3.83k|    resq_r0 = _mm_unpacklo_epi64(temp1, temp3);    // a0 b0 c0 d0
 1739|  3.83k|    resq_r1 = _mm_unpackhi_epi64(temp1, temp3);    // a1 b1 c1 d1
 1740|  3.83k|    resq_r2 = _mm_unpacklo_epi64(temp2, temp4);    // a2 b2 c2 d2
 1741|  3.83k|    resq_r3 = _mm_unpackhi_epi64(temp2, temp4);    // a3 b3 c3 d3
 1742|       |    // Transform starts -- horizontal transform
 1743|       |    /*------------------------------------------------------------------*/
 1744|       |    /* z0 = w0 + w2                                             */
 1745|  3.83k|    temp0 = _mm_add_epi32(resq_r0, resq_r2);
 1746|       |    /* z1 = w0 - w2                                             */
 1747|  3.83k|    temp1 = _mm_sub_epi32(resq_r0, resq_r2);
 1748|       |    /* z2 = (w1 >> 1) - w3                                      */
 1749|  3.83k|    temp2 = _mm_srai_epi32(resq_r1, 1);     //(w1>>1)
 1750|  3.83k|    temp2 = _mm_sub_epi32(temp2, resq_r3);  //(w1>>1) - w3
 1751|       |    /* z3 = w1 + (w3 >> 1)                                      */
 1752|  3.83k|    temp3 = _mm_srai_epi32(resq_r3, 1);  //(w3>>1) + w1
 1753|  3.83k|    temp3 = _mm_add_epi32(temp3, resq_r1);
 1754|       |    /*----------------------------------------------------------*/
 1755|       |    /* x0 = z0 + z3                                             */
 1756|  3.83k|    resq_r0 = _mm_add_epi32(temp0, temp3);
 1757|       |    /* x1 = z1 + z2                                             */
 1758|  3.83k|    resq_r1 = _mm_add_epi32(temp1, temp2);
 1759|       |    /* x2 = z1 - z2                                             */
 1760|  3.83k|    resq_r2 = _mm_sub_epi32(temp1, temp2);
 1761|       |    /* x3 = z0 - z3                                             */
 1762|  3.83k|    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|  3.83k|    temp1 = _mm_unpacklo_epi32(resq_r0, resq_r1);  // a0 a1 b0 b1
 1771|  3.83k|    temp3 = _mm_unpacklo_epi32(resq_r2, resq_r3);  // a2 a3 b2 b3
 1772|  3.83k|    temp2 = _mm_unpackhi_epi32(resq_r0, resq_r1);  // c0 c1 d0 d1
 1773|  3.83k|    temp4 = _mm_unpackhi_epi32(resq_r2, resq_r3);  // c2 c3 d2 d3
 1774|  3.83k|    resq_r0 = _mm_unpacklo_epi64(temp1, temp3);    // a0 a1 a2 a3
 1775|  3.83k|    resq_r1 = _mm_unpackhi_epi64(temp1, temp3);    // b0 b1 b2 b3
 1776|  3.83k|    resq_r2 = _mm_unpacklo_epi64(temp2, temp4);    // c0 c1 c2 c3
 1777|  3.83k|    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|  3.83k|    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|  3.83k|    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|  3.83k|    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|  3.83k|    pred_r3 = _mm_loadl_epi64((__m128i *) (&pu1_pred[3 * pred_strd]));
 1789|       |
 1790|  3.83k|    pred_r0 = _mm_cvtepu8_epi16(pred_r0);  // p00 p01 p02 p03 -- all 16 bits
 1791|  3.83k|    pred_r1 = _mm_cvtepu8_epi16(pred_r1);  // p10 p11 p12 p13 -- all 16 bits
 1792|  3.83k|    pred_r2 = _mm_cvtepu8_epi16(pred_r2);  // p20 p21 p22 p23 -- all 16 bits
 1793|  3.83k|    pred_r3 = _mm_cvtepu8_epi16(pred_r3);  // p30 p31 p32 p33 -- all 16 bits
 1794|       |
 1795|       |    // Load resd buffer
 1796|  3.83k|    rsd_r0 = _mm_loadu_si128((__m128i *) (&pi2_rsd[0]));
 1797|  3.83k|    rsd_r1 = _mm_loadu_si128((__m128i *) (&pi2_rsd[rsd_strd]));
 1798|  3.83k|    rsd_r2 = _mm_loadu_si128((__m128i *) (&pi2_rsd[2 * rsd_strd]));
 1799|  3.83k|    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|  3.83k|    temp0 = _mm_add_epi32(resq_r0, resq_r2);
 1808|       |    /* z1j = y0j - y2j                                                        */
 1809|  3.83k|    temp1 = _mm_sub_epi32(resq_r0, resq_r2);
 1810|       |    /* z2j = (y1j>>1) - y3j */
 1811|  3.83k|    temp2 = _mm_srai_epi32(resq_r1, 1);  //(y1j>>1)
 1812|  3.83k|    temp2 = _mm_sub_epi32(temp2, resq_r3);
 1813|       |    /* z3j = y1j + (y3j>>1) */
 1814|  3.83k|    temp3 = _mm_srai_epi32(resq_r3, 1);  //(y3j>>1)
 1815|  3.83k|    temp3 = _mm_add_epi32(temp3, resq_r1);
 1816|       |
 1817|       |    /* x0j = z0j + z3j                                                        */
 1818|  3.83k|    temp4 = _mm_add_epi32(temp0, temp3);
 1819|  3.83k|    temp4 = _mm_add_epi32(temp4, value_32);
 1820|  3.83k|    temp4 = _mm_srai_epi32(temp4, 6);
 1821|  3.83k|    temp4 = _mm_add_epi16(temp4, rsd_r0);
 1822|  3.83k|    temp4 = _mm_min_epi16(dupmax_8x16b, temp4);
 1823|  3.83k|    temp4 = _mm_max_epi16(dupmin_8x16b, temp4);
 1824|  3.83k|    temp4 = _mm_add_epi16(temp4, pred_r0);
 1825|       |    /* x1j = z1j + z2j                                                        */
 1826|  3.83k|    temp5 = _mm_add_epi32(temp1, temp2);
 1827|  3.83k|    temp5 = _mm_add_epi32(temp5, value_32);
 1828|  3.83k|    temp5 = _mm_srai_epi32(temp5, 6);
 1829|  3.83k|    temp5 = _mm_add_epi16(temp5, rsd_r1);
 1830|  3.83k|    temp5 = _mm_min_epi16(dupmax_8x16b, temp5);
 1831|  3.83k|    temp5 = _mm_max_epi16(dupmin_8x16b, temp5);
 1832|  3.83k|    temp5 = _mm_add_epi16(temp5, pred_r1);
 1833|       |    /* x2j = z1j - z2j                                                        */
 1834|  3.83k|    temp6 = _mm_sub_epi32(temp1, temp2);
 1835|  3.83k|    temp6 = _mm_add_epi32(temp6, value_32);
 1836|  3.83k|    temp6 = _mm_srai_epi32(temp6, 6);
 1837|  3.83k|    temp6 = _mm_add_epi16(temp6, rsd_r2);
 1838|  3.83k|    temp6 = _mm_min_epi16(dupmax_8x16b, temp6);
 1839|  3.83k|    temp6 = _mm_max_epi16(dupmin_8x16b, temp6);
 1840|  3.83k|    temp6 = _mm_add_epi16(temp6, pred_r2);
 1841|       |    /* x3j = z0j - z3j                                                        */
 1842|  3.83k|    temp7 = _mm_sub_epi32(temp0, temp3);
 1843|  3.83k|    temp7 = _mm_add_epi32(temp7, value_32);
 1844|  3.83k|    temp7 = _mm_srai_epi32(temp7, 6);
 1845|  3.83k|    temp7 = _mm_add_epi16(temp7, rsd_r3);
 1846|  3.83k|    temp7 = _mm_min_epi16(dupmax_8x16b, temp7);
 1847|  3.83k|    temp7 = _mm_max_epi16(dupmin_8x16b, temp7);
 1848|  3.83k|    temp7 = _mm_add_epi16(temp7, pred_r3);
 1849|       |
 1850|  3.83k|    out_16x8b_0 = _mm_loadu_si128((__m128i *) (&pu1_out[0]));
 1851|  3.83k|    out_16x8b_1 = _mm_loadu_si128((__m128i *) (&pu1_out[out_strd]));
 1852|  3.83k|    out_16x8b_2 = _mm_loadu_si128((__m128i *) (&pu1_out[(out_strd << 1)]));
 1853|  3.83k|    out_16x8b_3 = _mm_loadu_si128((__m128i *) (&pu1_out[(out_strd << 1) + out_strd]));
 1854|       |
 1855|  3.83k|    out_16x8b_0 = _mm_and_si128(out_16x8b_0, chroma_mask);
 1856|  3.83k|    out_16x8b_1 = _mm_and_si128(out_16x8b_1, chroma_mask);
 1857|  3.83k|    out_16x8b_2 = _mm_and_si128(out_16x8b_2, chroma_mask);
 1858|  3.83k|    out_16x8b_3 = _mm_and_si128(out_16x8b_3, chroma_mask);
 1859|       |
 1860|  3.83k|    temp4 = _mm_packus_epi16(temp4, zero_8x16b);
 1861|  3.83k|    temp5 = _mm_packus_epi16(temp5, zero_8x16b);
 1862|  3.83k|    temp6 = _mm_packus_epi16(temp6, zero_8x16b);
 1863|  3.83k|    temp7 = _mm_packus_epi16(temp7, zero_8x16b);
 1864|       |
 1865|  3.83k|    temp4 = _mm_and_si128(temp4, chroma_mask2);
 1866|  3.83k|    temp5 = _mm_and_si128(temp5, chroma_mask2);
 1867|  3.83k|    temp6 = _mm_and_si128(temp6, chroma_mask2);
 1868|  3.83k|    temp7 = _mm_and_si128(temp7, chroma_mask2);
 1869|       |
 1870|  3.83k|    out_16x8b_0 = _mm_add_epi8(temp4, out_16x8b_0);
 1871|  3.83k|    out_16x8b_1 = _mm_add_epi8(temp5, out_16x8b_1);
 1872|  3.83k|    out_16x8b_2 = _mm_add_epi8(temp6, out_16x8b_2);
 1873|  3.83k|    out_16x8b_3 = _mm_add_epi8(temp7, out_16x8b_3);
 1874|       |
 1875|  3.83k|    _mm_storel_epi64((__m128i *) (pu1_out), out_16x8b_0);
 1876|  3.83k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd), out_16x8b_1);
 1877|  3.83k|    _mm_storel_epi64((__m128i *) (pu1_out + (out_strd << 1)), out_16x8b_2);
 1878|  3.83k|    _mm_storel_epi64((__m128i *) (pu1_out + (out_strd * 3)), out_16x8b_3);
 1879|  3.83k|}

isvcd_iquant_itrans_4x4_dc_sse42:
   84|  1.58k|{
   85|  1.58k|    WORD32 q0;
   86|  1.58k|    WORD16 rnd_fact = (u4_qp_div_6 < 4) ? 1 << (3 - u4_qp_div_6) : 0;
  ------------------
  |  Branch (86:23): [True: 371, False: 1.20k]
  ------------------
   87|  1.58k|    __m128i dupmax_8x16b = _mm_set1_epi16(RSD_MAX);
  ------------------
  |  |  772|  1.58k|#define RSD_MAX 255
  ------------------
   88|  1.58k|    __m128i dupmin_8x16b = _mm_set1_epi16(RSD_MIN);
  ------------------
  |  |  773|  1.58k|#define RSD_MIN -255
  ------------------
   89|  1.58k|    __m128i i_macro;
   90|  1.58k|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|  1.58k|#define UNUSED(x) ((void)(x))
  ------------------
   91|       |
   92|  1.58k|    if(iq_start_idx == 0)
  ------------------
  |  Branch (92:8): [True: 1.58k, False: 0]
  ------------------
   93|  1.58k|    {
   94|  1.58k|        q0 = pi2_src[0];
   95|  1.58k|        INV_QUANT(q0, pu2_iscal_mat[0], pu2_weigh_mat[0], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|  1.58k|                {\
  |  |  104|  1.58k|                    i4_value *= quant_scale;\
  |  |  105|  1.58k|                    i4_value *= weight_scale;\
  |  |  106|  1.58k|                    i4_value += rndfactor;\
  |  |  107|  1.58k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  1.58k|                    i4_value >>= qbits;\
  |  |  109|  1.58k|                }
  ------------------
   96|  1.58k|    }
   97|      0|    else
   98|      0|    {
   99|      0|        q0 = pi2_dc_ld_addr[0];  // Restoring dc value for intra case3
  100|      0|    }
  101|       |
  102|  1.58k|    i_macro = _mm_set1_epi16((q0 + 32) >> 6);
  103|  1.58k|    i_macro = _mm_min_epi16(dupmax_8x16b, i_macro);
  104|  1.58k|    i_macro = _mm_max_epi16(dupmin_8x16b, i_macro);
  105|       |
  106|  1.58k|    _mm_storel_epi64((__m128i *) pi2_out, i_macro);
  107|  1.58k|    pi2_out += out_strd;
  108|  1.58k|    _mm_storel_epi64((__m128i *) pi2_out, i_macro);
  109|  1.58k|    pi2_out += out_strd;
  110|  1.58k|    _mm_storel_epi64((__m128i *) pi2_out, i_macro);
  111|  1.58k|    pi2_out += out_strd;
  112|  1.58k|    _mm_storel_epi64((__m128i *) pi2_out, i_macro);
  113|  1.58k|}
isvcd_iquant_itrans_8x8_dc_sse42:
  142|    798|{
  143|    798|    WORD32 q;
  144|    798|    WORD32 rnd_fact = (qp_div < 6) ? (1 << (5 - qp_div)) : 0;
  ------------------
  |  Branch (144:23): [True: 503, False: 295]
  ------------------
  145|    798|    __m128i dupmin_8x16b, dupmax_8x16b, i_macro;
  146|       |
  147|    798|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|    798|#define UNUSED(x) ((void)(x))
  ------------------
  148|    798|    UNUSED(iq_start_idx);
  ------------------
  |  |   45|    798|#define UNUSED(x) ((void)(x))
  ------------------
  149|    798|    UNUSED(pi2_dc_ld_addr);
  ------------------
  |  |   45|    798|#define UNUSED(x) ((void)(x))
  ------------------
  150|       |
  151|    798|    q = pi2_src[0];
  152|    798|    INV_QUANT(q, pu2_iscale_mat[0], pu2_weigh_mat[0], qp_div, rnd_fact, 6);
  ------------------
  |  |  103|    798|                {\
  |  |  104|    798|                    i4_value *= quant_scale;\
  |  |  105|    798|                    i4_value *= weight_scale;\
  |  |  106|    798|                    i4_value += rndfactor;\
  |  |  107|    798|                    i4_value <<= u4_qp_div_6;\
  |  |  108|    798|                    i4_value >>= qbits;\
  |  |  109|    798|                }
  ------------------
  153|       |
  154|    798|    i_macro = _mm_set1_epi16((q + 32) >> 6);
  155|    798|    dupmax_8x16b = _mm_set1_epi16(RSD_MAX);
  ------------------
  |  |  772|    798|#define RSD_MAX 255
  ------------------
  156|    798|    dupmin_8x16b = _mm_set1_epi16(RSD_MIN);
  ------------------
  |  |  773|    798|#define RSD_MIN -255
  ------------------
  157|       |
  158|    798|    i_macro = _mm_min_epi16(dupmax_8x16b, i_macro);
  159|    798|    i_macro = _mm_max_epi16(dupmin_8x16b, i_macro);
  160|       |
  161|    798|    _mm_storeu_si128((__m128i *) pi2_out, i_macro);
  162|    798|    pi2_out += out_strd;
  163|    798|    _mm_storeu_si128((__m128i *) pi2_out, i_macro);
  164|    798|    pi2_out += out_strd;
  165|    798|    _mm_storeu_si128((__m128i *) pi2_out, i_macro);
  166|    798|    pi2_out += out_strd;
  167|    798|    _mm_storeu_si128((__m128i *) pi2_out, i_macro);
  168|    798|    pi2_out += out_strd;
  169|    798|    _mm_storeu_si128((__m128i *) pi2_out, i_macro);
  170|    798|    pi2_out += out_strd;
  171|    798|    _mm_storeu_si128((__m128i *) pi2_out, i_macro);
  172|    798|    pi2_out += out_strd;
  173|    798|    _mm_storeu_si128((__m128i *) pi2_out, i_macro);
  174|    798|    pi2_out += out_strd;
  175|    798|    _mm_storeu_si128((__m128i *) pi2_out, i_macro);
  176|    798|}
isvcd_iquant_itrans_chroma_4x4_dc_sse42:
  204|  6.24k|{
  205|  6.24k|    __m128i src_r0, src_r1, src_r2, src_r3;
  206|  6.24k|    __m128i i_macro = _mm_set1_epi16((pi2_dc_src[0] + 32) >> 6);
  207|  6.24k|    __m128i chroma_mask_even, chroma_mask_odd;
  208|  6.24k|    __m128i dupmax_8x16b = _mm_set1_epi16(RSD_MAX);
  ------------------
  |  |  772|  6.24k|#define RSD_MAX 255
  ------------------
  209|  6.24k|    __m128i dupmin_8x16b = _mm_set1_epi16(RSD_MIN);
  ------------------
  |  |  773|  6.24k|#define RSD_MIN -255
  ------------------
  210|       |
  211|  6.24k|    UNUSED(pi2_src);
  ------------------
  |  |   45|  6.24k|#define UNUSED(x) ((void)(x))
  ------------------
  212|  6.24k|    UNUSED(pu2_iscal_mat);
  ------------------
  |  |   45|  6.24k|#define UNUSED(x) ((void)(x))
  ------------------
  213|  6.24k|    UNUSED(pu2_weigh_mat);
  ------------------
  |  |   45|  6.24k|#define UNUSED(x) ((void)(x))
  ------------------
  214|  6.24k|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|  6.24k|#define UNUSED(x) ((void)(x))
  ------------------
  215|  6.24k|    UNUSED(u4_qp_div_6);
  ------------------
  |  |   45|  6.24k|#define UNUSED(x) ((void)(x))
  ------------------
  216|       |
  217|  6.24k|    i_macro = _mm_min_epi16(dupmax_8x16b, i_macro);
  218|  6.24k|    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.24k|    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.24k|    src_r1 = _mm_loadu_si128((__m128i *) (pi2_out + (1 * out_strd)));
  224|  6.24k|    src_r2 = _mm_loadu_si128((__m128i *) (pi2_out + (2 * out_strd)));
  225|  6.24k|    src_r3 = _mm_loadu_si128((__m128i *) (pi2_out + (3 * out_strd)));
  226|       |
  227|  6.24k|    chroma_mask_even =
  228|  6.24k|        _mm_set_epi16(0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff);
  229|  6.24k|    chroma_mask_odd = _mm_set_epi16(0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000);
  230|       |
  231|  6.24k|    src_r0 = _mm_and_si128(src_r0, chroma_mask_odd);  // 0 src1 0 src2 0 ...
  232|  6.24k|    src_r1 = _mm_and_si128(src_r1, chroma_mask_odd);
  233|  6.24k|    src_r2 = _mm_and_si128(src_r2, chroma_mask_odd);
  234|  6.24k|    src_r3 = _mm_and_si128(src_r3, chroma_mask_odd);
  235|       |
  236|  6.24k|    i_macro = _mm_and_si128(i_macro, chroma_mask_even);  // macro 0 macro 0 ..
  237|       |
  238|  6.24k|    src_r0 = _mm_add_epi16(src_r0, i_macro);             // macro  src1 macro src2 macro ...
  239|  6.24k|    src_r1 = _mm_add_epi16(src_r1, i_macro);
  240|  6.24k|    src_r2 = _mm_add_epi16(src_r2, i_macro);
  241|  6.24k|    src_r3 = _mm_add_epi16(src_r3, i_macro);
  242|       |
  243|  6.24k|    _mm_storeu_si128((__m128i *) (&pi2_out[0]), src_r0);
  244|  6.24k|    _mm_storeu_si128((__m128i *) (&pi2_out[out_strd]), src_r1);
  245|  6.24k|    _mm_storeu_si128((__m128i *) (&pi2_out[2 * out_strd]), src_r2);
  246|  6.24k|    _mm_storeu_si128((__m128i *) (&pi2_out[3 * out_strd]), src_r3);
  247|  6.24k|}
isvcd_iquant_itrans_4x4_sse42:
  275|  11.3k|{
  276|  11.3k|    __m128i src_r0_r1, src_r2_r3;
  277|  11.3k|    __m128i src_r0, src_r1, src_r2, src_r3;
  278|  11.3k|    __m128i scalemat_r0_r1, scalemat_r2_r3;
  279|  11.3k|    __m128i dequant_r0_r1, dequant_r2_r3;
  280|  11.3k|    __m128i zero_8x16b = _mm_setzero_si128();  // all bits reset to zero
  281|  11.3k|    __m128i temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7;
  282|  11.3k|    __m128i resq_r0, resq_r1, resq_r2, resq_r3;
  283|  11.3k|    __m128i add_rshift = _mm_set1_epi32((u4_qp_div_6 < 4) ? (1 << (3 - u4_qp_div_6)) : 0);
  ------------------
  |  Branch (283:41): [True: 7.66k, False: 3.68k]
  ------------------
  284|  11.3k|    __m128i value_32 = _mm_set1_epi32(32);
  285|  11.3k|    __m128i dupmax_4x32b = _mm_set1_epi32(RSD_MAX);
  ------------------
  |  |  772|  11.3k|#define RSD_MAX 255
  ------------------
  286|  11.3k|    __m128i dupmin_4x32b = _mm_set1_epi32(RSD_MIN);
  ------------------
  |  |  773|  11.3k|#define RSD_MIN -255
  ------------------
  287|  11.3k|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|  11.3k|#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|  11.3k|    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|  11.3k|    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|  11.3k|    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|  11.3k|    scalemat_r2_r3 = _mm_loadu_si128((__m128i *) (pu2_iscal_mat + 8));
  301|       |    // q00 q01 q02 q03 q10 q11 q12 q13 -- all 16 bits
  302|  11.3k|    dequant_r0_r1 = _mm_loadu_si128((__m128i *) (pu2_weigh_mat));
  303|       |    // q20 q21 q22 q23 q30 q31 q32 q33 -- all 16 bits
  304|  11.3k|    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|  11.3k|    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|  11.3k|    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|  11.3k|    temp4 = _mm_unpacklo_epi16(temp0, zero_8x16b);
  313|       |    // b10*q10 0 b11*q11 0 b12*q12 0 b13*q13 0 -- 16 bit long
  314|  11.3k|    temp5 = _mm_unpackhi_epi16(temp0, zero_8x16b);
  315|       |    // b00*q00 0 b01*q01 0 b02*q02 0 b03*q03 0 -- 16 bit long
  316|  11.3k|    temp6 = _mm_unpacklo_epi16(temp1, zero_8x16b);
  317|       |    // b10*q10 0 b11*q11 0 b12*q12 0 b13*q13 0 -- 16 bit long
  318|  11.3k|    temp7 = _mm_unpackhi_epi16(temp1, zero_8x16b);
  319|       |
  320|  11.3k|    src_r0 = _mm_unpacklo_epi16(src_r0_r1, zero_8x16b);  // a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  321|  11.3k|    src_r1 = _mm_unpackhi_epi16(src_r0_r1, zero_8x16b);  // a10 0 a11 0 a12 0 a13 0 -- 16 bit long
  322|  11.3k|    src_r2 = _mm_unpacklo_epi16(src_r2_r3, zero_8x16b);  // a20 0 a21 0 a22 0 a23 0 -- 16 bit long
  323|  11.3k|    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|  11.3k|    temp4 = _mm_madd_epi16(src_r0, temp4);
  327|  11.3k|    temp5 = _mm_madd_epi16(src_r1, temp5);
  328|  11.3k|    temp6 = _mm_madd_epi16(src_r2, temp6);
  329|  11.3k|    temp7 = _mm_madd_epi16(src_r3, temp7);
  330|       |
  331|  11.3k|    if(u4_qp_div_6 >= 4)
  ------------------
  |  Branch (331:8): [True: 3.68k, False: 7.66k]
  ------------------
  332|  3.68k|    {
  333|  3.68k|        resq_r0 = _mm_slli_epi32(temp4, u4_qp_div_6 - 4);
  334|  3.68k|        resq_r1 = _mm_slli_epi32(temp5, u4_qp_div_6 - 4);
  335|  3.68k|        resq_r2 = _mm_slli_epi32(temp6, u4_qp_div_6 - 4);
  336|  3.68k|        resq_r3 = _mm_slli_epi32(temp7, u4_qp_div_6 - 4);
  337|  3.68k|    }
  338|  7.66k|    else
  339|  7.66k|    {
  340|  7.66k|        temp4 = _mm_add_epi32(temp4, add_rshift);
  341|  7.66k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  342|  7.66k|        temp6 = _mm_add_epi32(temp6, add_rshift);
  343|  7.66k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  344|  7.66k|        resq_r0 = _mm_srai_epi32(temp4, 4 - u4_qp_div_6);
  345|  7.66k|        resq_r1 = _mm_srai_epi32(temp5, 4 - u4_qp_div_6);
  346|  7.66k|        resq_r2 = _mm_srai_epi32(temp6, 4 - u4_qp_div_6);
  347|  7.66k|        resq_r3 = _mm_srai_epi32(temp7, 4 - u4_qp_div_6);
  348|  7.66k|    }
  349|       |
  350|  11.3k|    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: 11.3k]
  ------------------
  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|  11.3k|    temp1 = _mm_unpacklo_epi32(resq_r0, resq_r1);  // a0 b0 a1 b1
  363|  11.3k|    temp3 = _mm_unpacklo_epi32(resq_r2, resq_r3);  // c0 d0 c1 d1
  364|  11.3k|    temp2 = _mm_unpackhi_epi32(resq_r0, resq_r1);  // a2 b2 a3 b3
  365|  11.3k|    temp4 = _mm_unpackhi_epi32(resq_r2, resq_r3);  // c2 d2 c3 d3
  366|  11.3k|    resq_r0 = _mm_unpacklo_epi64(temp1, temp3);    // a0 b0 c0 d0
  367|  11.3k|    resq_r1 = _mm_unpackhi_epi64(temp1, temp3);    // a1 b1 c1 d1
  368|  11.3k|    resq_r2 = _mm_unpacklo_epi64(temp2, temp4);    // a2 b2 c2 d2
  369|  11.3k|    resq_r3 = _mm_unpackhi_epi64(temp2, temp4);    // a3 b3 c3 d3
  370|       |    // Transform starts -- horizontal transform
  371|       |    /*------------------------------------------------------------------*/
  372|       |    /* z0 = w0 + w2                                             */
  373|  11.3k|    temp0 = _mm_add_epi32(resq_r0, resq_r2);
  374|       |    /* z1 = w0 - w2                                             */
  375|  11.3k|    temp1 = _mm_sub_epi32(resq_r0, resq_r2);
  376|       |    /* z2 = (w1 >> 1) - w3                                      */
  377|  11.3k|    temp2 = _mm_srai_epi32(resq_r1, 1);     //(w1>>1)
  378|  11.3k|    temp2 = _mm_sub_epi32(temp2, resq_r3);  //(w1>>1) - w3
  379|       |    /* z3 = w1 + (w3 >> 1)                                      */
  380|  11.3k|    temp3 = _mm_srai_epi32(resq_r3, 1);  //(w3>>1) + w1
  381|  11.3k|    temp3 = _mm_add_epi32(temp3, resq_r1);
  382|       |    /*----------------------------------------------------------*/
  383|       |    /* x0 = z0 + z3                                             */
  384|  11.3k|    resq_r0 = _mm_add_epi32(temp0, temp3);
  385|       |    /* x1 = z1 + z2                                             */
  386|  11.3k|    resq_r1 = _mm_add_epi32(temp1, temp2);
  387|       |    /* x2 = z1 - z2                                             */
  388|  11.3k|    resq_r2 = _mm_sub_epi32(temp1, temp2);
  389|       |    /* x3 = z0 - z3                                             */
  390|  11.3k|    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|  11.3k|    temp1 = _mm_unpacklo_epi32(resq_r0, resq_r1);  // a0 a1 b0 b1
  399|  11.3k|    temp3 = _mm_unpacklo_epi32(resq_r2, resq_r3);  // a2 a3 b2 b3
  400|  11.3k|    temp2 = _mm_unpackhi_epi32(resq_r0, resq_r1);  // c0 c1 d0 d1
  401|  11.3k|    temp4 = _mm_unpackhi_epi32(resq_r2, resq_r3);  // c2 c3 d2 d3
  402|  11.3k|    resq_r0 = _mm_unpacklo_epi64(temp1, temp3);    // a0 a1 a2 a3
  403|  11.3k|    resq_r1 = _mm_unpackhi_epi64(temp1, temp3);    // b0 b1 b2 b3
  404|  11.3k|    resq_r2 = _mm_unpacklo_epi64(temp2, temp4);    // c0 c1 c2 c3
  405|  11.3k|    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|  11.3k|    temp0 = _mm_add_epi32(resq_r0, resq_r2);
  415|       |    /* z1j = y0j - y2j                                                        */
  416|  11.3k|    temp1 = _mm_sub_epi32(resq_r0, resq_r2);
  417|       |    /* z2j = (y1j>>1) - y3j */
  418|  11.3k|    temp2 = _mm_srai_epi32(resq_r1, 1);  //(y1j>>1)
  419|  11.3k|    temp2 = _mm_sub_epi32(temp2, resq_r3);
  420|       |    /* z3j = y1j + (y3j>>1) */
  421|  11.3k|    temp3 = _mm_srai_epi32(resq_r3, 1);  //(y3j>>1)
  422|  11.3k|    temp3 = _mm_add_epi32(temp3, resq_r1);
  423|       |
  424|       |    /* x0j = z0j + z3j                                                        */
  425|  11.3k|    temp4 = _mm_add_epi32(temp0, temp3);
  426|  11.3k|    temp4 = _mm_add_epi32(temp4, value_32);
  427|  11.3k|    temp4 = _mm_srai_epi32(temp4, 6);
  428|  11.3k|    temp4 = _mm_min_epi32(dupmax_4x32b, temp4);
  429|  11.3k|    temp4 = _mm_max_epi32(dupmin_4x32b, temp4);
  430|       |
  431|       |    /* x1j = z1j + z2j                                                        */
  432|  11.3k|    temp5 = _mm_add_epi32(temp1, temp2);
  433|  11.3k|    temp5 = _mm_add_epi32(temp5, value_32);
  434|  11.3k|    temp5 = _mm_srai_epi32(temp5, 6);
  435|  11.3k|    temp5 = _mm_min_epi32(dupmax_4x32b, temp5);
  436|  11.3k|    temp5 = _mm_max_epi32(dupmin_4x32b, temp5);
  437|       |
  438|       |    /* x2j = z1j - z2j                                                        */
  439|  11.3k|    temp6 = _mm_sub_epi32(temp1, temp2);
  440|  11.3k|    temp6 = _mm_add_epi32(temp6, value_32);
  441|  11.3k|    temp6 = _mm_srai_epi32(temp6, 6);
  442|  11.3k|    temp6 = _mm_min_epi32(dupmax_4x32b, temp6);
  443|  11.3k|    temp6 = _mm_max_epi32(dupmin_4x32b, temp6);
  444|       |
  445|       |    /* x3j = z0j - z3j                                                        */
  446|  11.3k|    temp7 = _mm_sub_epi32(temp0, temp3);
  447|  11.3k|    temp7 = _mm_add_epi32(temp7, value_32);
  448|  11.3k|    temp7 = _mm_srai_epi32(temp7, 6);
  449|  11.3k|    temp7 = _mm_min_epi32(dupmax_4x32b, temp7);
  450|  11.3k|    temp7 = _mm_max_epi32(dupmin_4x32b, temp7);
  451|       |
  452|       |    // 32-bit to 16-bit conversion
  453|  11.3k|    temp0 = _mm_packs_epi32(temp4, temp5);
  454|  11.3k|    temp1 = _mm_packs_epi32(temp6, temp7);
  455|       |
  456|  11.3k|    resq_r0 = temp0;
  457|  11.3k|    resq_r1 = _mm_srli_si128(temp0, 8);
  458|  11.3k|    resq_r2 = temp1;
  459|  11.3k|    resq_r3 = _mm_srli_si128(temp1, 8);
  460|       |
  461|  11.3k|    _mm_storel_epi64((__m128i *) pi2_out, resq_r0);
  462|  11.3k|    pi2_out += out_strd;
  463|  11.3k|    _mm_storel_epi64((__m128i *) pi2_out, resq_r1);
  464|  11.3k|    pi2_out += out_strd;
  465|  11.3k|    _mm_storel_epi64((__m128i *) pi2_out, resq_r2);
  466|  11.3k|    pi2_out += out_strd;
  467|  11.3k|    _mm_storel_epi64((__m128i *) pi2_out, resq_r3);
  468|  11.3k|}
isvcd_iquant_itrans_8x8_sse42:
  497|  2.61k|{
  498|  2.61k|    __m128i src_r0;
  499|  2.61k|    __m128i scalemat_r0;
  500|  2.61k|    __m128i zero_8x16b = _mm_setzero_si128();  // all bits reset to zero
  501|  2.61k|    __m128i value_32 = _mm_set1_epi32(32);
  502|  2.61k|    __m128i add_rshift = _mm_set1_epi32((qp_div < 6) ? (1 << (5 - qp_div)) : 0);
  ------------------
  |  Branch (502:41): [True: 1.61k, False: 992]
  ------------------
  503|  2.61k|    __m128i dequant_r0;
  504|  2.61k|    __m128i sign_reg;
  505|  2.61k|    __m128i src_r0_1, src_r0_2;
  506|  2.61k|    __m128i scalemat_r0_1, scalemat_r0_2;
  507|  2.61k|    __m128i temp1, temp2, temp3, temp4, temp5, temp6, temp7, temp8;
  508|  2.61k|    __m128i temp10, temp11, temp12, temp13, temp14, temp15, temp16, temp17, temp18, temp19, temp20;
  509|       |    // To store dequantization results
  510|  2.61k|    __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.61k|        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.61k|    __m128i dupmax_4x32b = _mm_set1_epi32(RSD_MAX);
  ------------------
  |  |  772|  2.61k|#define RSD_MAX 255
  ------------------
  513|  2.61k|    __m128i dupmin_4x32b = _mm_set1_epi32(RSD_MIN);
  ------------------
  |  |  773|  2.61k|#define RSD_MIN -255
  ------------------
  514|       |
  515|  2.61k|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|  2.61k|#define UNUSED(x) ((void)(x))
  ------------------
  516|  2.61k|    UNUSED(iq_start_idx);
  ------------------
  |  |   45|  2.61k|#define UNUSED(x) ((void)(x))
  ------------------
  517|  2.61k|    UNUSED(pi2_dc_ld_addr);
  ------------------
  |  |   45|  2.61k|#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.61k|    src_r0 = _mm_loadu_si128((__m128i *) (pi2_src));
  527|       |    // b00 b01 b02 b03 b04 b05 b06 b07 -- the scaling matrix 0th row
  528|  2.61k|    scalemat_r0 = _mm_loadu_si128((__m128i *) (pu2_iscale_mat));
  529|  2.61k|    dequant_r0 =
  530|  2.61k|        _mm_loadu_si128((__m128i *) (&pu2_weigh_mat[0]));  // q0 q1 q2 q3 q4 q5 q6 q7 -- all 16 bits
  531|  2.61k|    src_r0_1 = _mm_unpacklo_epi16(src_r0, zero_8x16b);     // a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  532|  2.61k|    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.61k|    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.61k|    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.61k|    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.61k|    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.61k|    temp7 = _mm_madd_epi16(src_r0_2, scalemat_r0_2);
  544|       |
  545|  2.61k|    if(qp_div >= 6)
  ------------------
  |  Branch (545:8): [True: 992, False: 1.61k]
  ------------------
  546|    992|    {
  547|    992|        resq_r0_1 = _mm_slli_epi32(temp5, qp_div - 6);
  548|    992|        resq_r0_2 = _mm_slli_epi32(temp7, qp_div - 6);
  549|    992|    }
  550|  1.61k|    else
  551|  1.61k|    {
  552|  1.61k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  553|  1.61k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  554|  1.61k|        resq_r0_1 = _mm_srai_epi32(temp5, 6 - qp_div);
  555|  1.61k|        resq_r0_2 = _mm_srai_epi32(temp7, 6 - qp_div);
  556|  1.61k|    }
  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.61k|    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.61k|    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.61k|    scalemat_r0 = _mm_loadu_si128((__m128i *) (pu2_iscale_mat + 8));
  565|       |    // q0 q1 q2 q3 q4 q5 q6 q7 -- all 16 bits
  566|  2.61k|    dequant_r0 = _mm_loadu_si128((__m128i *) (&pu2_weigh_mat[8]));
  567|  2.61k|    src_r0_1 = _mm_unpacklo_epi16(src_r0, zero_8x16b);  // a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  568|  2.61k|    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.61k|    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.61k|    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.61k|    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.61k|    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.61k|    temp7 = _mm_madd_epi16(src_r0_2, scalemat_r0_2);
  579|  2.61k|    if(qp_div >= 6)
  ------------------
  |  Branch (579:8): [True: 992, False: 1.61k]
  ------------------
  580|    992|    {
  581|    992|        resq_r1_1 = _mm_slli_epi32(temp5, qp_div - 6);
  582|    992|        resq_r1_2 = _mm_slli_epi32(temp7, qp_div - 6);
  583|    992|    }
  584|  1.61k|    else
  585|  1.61k|    {
  586|  1.61k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  587|  1.61k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  588|  1.61k|        resq_r1_1 = _mm_srai_epi32(temp5, 6 - qp_div);
  589|  1.61k|        resq_r1_2 = _mm_srai_epi32(temp7, 6 - qp_div);
  590|  1.61k|    }
  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.61k|    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.61k|    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.61k|    scalemat_r0 = _mm_loadu_si128((__m128i *) (pu2_iscale_mat + 16));
  598|       |    // q0 q1 q2 q3 q4 q5 q6 q7 -- all 16 bits
  599|  2.61k|    dequant_r0 = _mm_loadu_si128((__m128i *) (&pu2_weigh_mat[16]));
  600|  2.61k|    src_r0_1 = _mm_unpacklo_epi16(src_r0, zero_8x16b);  // a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  601|  2.61k|    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.61k|    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.61k|    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.61k|    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.61k|    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.61k|    temp7 = _mm_madd_epi16(src_r0_2, scalemat_r0_2);
  612|  2.61k|    if(qp_div >= 6)
  ------------------
  |  Branch (612:8): [True: 992, False: 1.61k]
  ------------------
  613|    992|    {
  614|    992|        resq_r2_1 = _mm_slli_epi32(temp5, qp_div - 6);
  615|    992|        resq_r2_2 = _mm_slli_epi32(temp7, qp_div - 6);
  616|    992|    }
  617|  1.61k|    else
  618|  1.61k|    {
  619|  1.61k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  620|  1.61k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  621|  1.61k|        resq_r2_1 = _mm_srai_epi32(temp5, 6 - qp_div);
  622|  1.61k|        resq_r2_2 = _mm_srai_epi32(temp7, 6 - qp_div);
  623|  1.61k|    }
  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.61k|    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.61k|    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.61k|    scalemat_r0 = _mm_loadu_si128((__m128i *) (pu2_iscale_mat + 24));
  631|       |    // q0 q1 q2 q3 q4 q5 q6 q7 -- all 16 bits
  632|  2.61k|    dequant_r0 = _mm_loadu_si128((__m128i *) (&pu2_weigh_mat[24]));
  633|  2.61k|    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.61k|    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.61k|    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.61k|    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.61k|    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.61k|    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.61k|    temp7 = _mm_madd_epi16(src_r0_2, scalemat_r0_2);
  646|  2.61k|    if(qp_div >= 6)
  ------------------
  |  Branch (646:8): [True: 992, False: 1.61k]
  ------------------
  647|    992|    {
  648|    992|        resq_r3_1 = _mm_slli_epi32(temp5, qp_div - 6);
  649|    992|        resq_r3_2 = _mm_slli_epi32(temp7, qp_div - 6);
  650|    992|    }
  651|  1.61k|    else
  652|  1.61k|    {
  653|  1.61k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  654|  1.61k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  655|  1.61k|        resq_r3_1 = _mm_srai_epi32(temp5, 6 - qp_div);
  656|  1.61k|        resq_r3_2 = _mm_srai_epi32(temp7, 6 - qp_div);
  657|  1.61k|    }
  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.61k|    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.61k|    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.61k|    scalemat_r0 = _mm_loadu_si128((__m128i *) (pu2_iscale_mat + 32));
  665|  2.61k|    dequant_r0 = _mm_loadu_si128(
  666|  2.61k|        (__m128i *) (&pu2_weigh_mat[32]));              // q0 q1 q2 q3 q4 q5 q6 q7 -- all 16 bits
  667|  2.61k|    src_r0_1 = _mm_unpacklo_epi16(src_r0, zero_8x16b);  // a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  668|  2.61k|    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.61k|    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.61k|    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.61k|    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.61k|    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.61k|    temp7 = _mm_madd_epi16(src_r0_2, scalemat_r0_2);
  679|  2.61k|    if(qp_div >= 6)
  ------------------
  |  Branch (679:8): [True: 992, False: 1.61k]
  ------------------
  680|    992|    {
  681|    992|        resq_r4_1 = _mm_slli_epi32(temp5, qp_div - 6);
  682|    992|        resq_r4_2 = _mm_slli_epi32(temp7, qp_div - 6);
  683|    992|    }
  684|  1.61k|    else
  685|  1.61k|    {
  686|  1.61k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  687|  1.61k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  688|  1.61k|        resq_r4_1 = _mm_srai_epi32(temp5, 6 - qp_div);
  689|  1.61k|        resq_r4_2 = _mm_srai_epi32(temp7, 6 - qp_div);
  690|  1.61k|    }
  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.61k|    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.61k|    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.61k|    scalemat_r0 = _mm_loadu_si128((__m128i *) (pu2_iscale_mat + 40));
  698|       |    // q0 q1 q2 q3 q4 q5 q6 q7 -- all 16 bits
  699|  2.61k|    dequant_r0 = _mm_loadu_si128((__m128i *) (&pu2_weigh_mat[40]));
  700|  2.61k|    src_r0_1 = _mm_unpacklo_epi16(src_r0, zero_8x16b);  // a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  701|  2.61k|    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.61k|    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.61k|    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.61k|    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.61k|    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.61k|    temp7 = _mm_madd_epi16(src_r0_2, scalemat_r0_2);
  712|  2.61k|    if(qp_div >= 6)
  ------------------
  |  Branch (712:8): [True: 992, False: 1.61k]
  ------------------
  713|    992|    {
  714|    992|        resq_r5_1 = _mm_slli_epi32(temp5, qp_div - 6);
  715|    992|        resq_r5_2 = _mm_slli_epi32(temp7, qp_div - 6);
  716|    992|    }
  717|  1.61k|    else
  718|  1.61k|    {
  719|  1.61k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  720|  1.61k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  721|  1.61k|        resq_r5_1 = _mm_srai_epi32(temp5, 6 - qp_div);
  722|  1.61k|        resq_r5_2 = _mm_srai_epi32(temp7, 6 - qp_div);
  723|  1.61k|    }
  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.61k|    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.61k|    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.61k|    scalemat_r0 = _mm_loadu_si128((__m128i *) (pu2_iscale_mat + 48));
  731|  2.61k|    dequant_r0 = _mm_loadu_si128(
  732|  2.61k|        (__m128i *) (&pu2_weigh_mat[48]));              // q0 q1 q2 q3 q4 q5 q6 q7 -- all 16 bits
  733|  2.61k|    src_r0_1 = _mm_unpacklo_epi16(src_r0, zero_8x16b);  // a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  734|  2.61k|    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.61k|    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.61k|    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.61k|    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.61k|    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.61k|    temp7 = _mm_madd_epi16(src_r0_2, scalemat_r0_2);
  745|  2.61k|    if(qp_div >= 6)
  ------------------
  |  Branch (745:8): [True: 992, False: 1.61k]
  ------------------
  746|    992|    {
  747|    992|        resq_r6_1 = _mm_slli_epi32(temp5, qp_div - 6);
  748|    992|        resq_r6_2 = _mm_slli_epi32(temp7, qp_div - 6);
  749|    992|    }
  750|  1.61k|    else
  751|  1.61k|    {
  752|  1.61k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  753|  1.61k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  754|  1.61k|        resq_r6_1 = _mm_srai_epi32(temp5, 6 - qp_div);
  755|  1.61k|        resq_r6_2 = _mm_srai_epi32(temp7, 6 - qp_div);
  756|  1.61k|    }
  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.61k|    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.61k|    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.61k|    scalemat_r0 = _mm_loadu_si128((__m128i *) (pu2_iscale_mat + 56));
  764|  2.61k|    dequant_r0 = _mm_loadu_si128(
  765|  2.61k|        (__m128i *) (&pu2_weigh_mat[56]));              // q0 q1 q2 q3 q4 q5 q6 q7 -- all 16 bits
  766|  2.61k|    src_r0_1 = _mm_unpacklo_epi16(src_r0, zero_8x16b);  // a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  767|  2.61k|    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.61k|    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.61k|    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.61k|    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.61k|    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.61k|    temp7 = _mm_madd_epi16(src_r0_2, scalemat_r0_2);
  779|  2.61k|    if(qp_div >= 6)
  ------------------
  |  Branch (779:8): [True: 992, False: 1.61k]
  ------------------
  780|    992|    {
  781|    992|        resq_r7_1 = _mm_slli_epi32(temp5, qp_div - 6);
  782|    992|        resq_r7_2 = _mm_slli_epi32(temp7, qp_div - 6);
  783|    992|    }
  784|  1.61k|    else
  785|  1.61k|    {
  786|  1.61k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  787|  1.61k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  788|  1.61k|        resq_r7_1 = _mm_srai_epi32(temp5, 6 - qp_div);
  789|  1.61k|        resq_r7_2 = _mm_srai_epi32(temp7, 6 - qp_div);
  790|  1.61k|    }
  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.61k|    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.61k|    temp1 = _mm_unpacklo_epi16(resq_r0_1, resq_r1_1);  // a0 b0 a1 b1 a2 b2 a3 b3
  805|  2.61k|    temp3 = _mm_unpacklo_epi16(resq_r2_1, resq_r3_1);  // c0 d0 c1 d1 c2 d2 c3 d3
  806|  2.61k|    temp2 = _mm_unpackhi_epi16(resq_r0_1, resq_r1_1);  // a4 b4 a5 b5 a6 b6 a7 b7
  807|  2.61k|    temp4 = _mm_unpackhi_epi16(resq_r2_1, resq_r3_1);  // c4 d4 c5 d5 c6 d6 c7 d7
  808|  2.61k|    resq_r0_1 = _mm_unpacklo_epi32(temp1, temp3);      // a0 b0 c0 d0 a1 b1 c1 d1
  809|  2.61k|    resq_r1_1 = _mm_unpackhi_epi32(temp1, temp3);      // a2 b2 c2 d2 a3 b3 c3 d3
  810|  2.61k|    resq_r2_1 = _mm_unpacklo_epi32(temp2, temp4);      // a4 b4 c4 d4 a5 b5 c5 d5
  811|  2.61k|    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.61k|    temp1 = _mm_unpacklo_epi16(resq_r4_1, resq_r5_1);  // e0 f0 e1 f1 e2 f2 e2 f3
  819|  2.61k|    temp3 = _mm_unpacklo_epi16(resq_r6_1, resq_r7_1);  // g0 h0 g1 h1 g2 h2 g3 h3
  820|  2.61k|    temp2 = _mm_unpackhi_epi16(resq_r4_1, resq_r5_1);  // e4 f4 e5 f5 e6 f6 e7 f7
  821|  2.61k|    temp4 = _mm_unpackhi_epi16(resq_r6_1, resq_r7_1);  // g4 h4 g5 h5 g6 h6 g7 h7
  822|  2.61k|    resq_r4_1 = _mm_unpacklo_epi32(temp1, temp3);      // e0 f0 g0 h0 e1 f1 g1 h1
  823|  2.61k|    resq_r5_1 = _mm_unpackhi_epi32(temp1, temp3);      // e2 f2 g2 h2 e3 f3 g3 h3
  824|  2.61k|    resq_r6_1 = _mm_unpacklo_epi32(temp2, temp4);      // e4 f4 g4 h4 e5 f5 g5 h5
  825|  2.61k|    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.61k|    resq_r0_2 = _mm_unpacklo_epi64(resq_r0_1, resq_r4_1);  // a0 b0 c0 d0 e0 f0 g0 h0
  837|  2.61k|    resq_r1_2 = _mm_unpackhi_epi64(resq_r0_1, resq_r4_1);  // a1 b1 c1 d1 e1 f1 g1 h1
  838|  2.61k|    resq_r2_2 = _mm_unpacklo_epi64(resq_r1_1, resq_r5_1);  // a2 b2 c2 d2 e2 f2 g2 h2
  839|  2.61k|    resq_r3_2 = _mm_unpackhi_epi64(resq_r1_1, resq_r5_1);  // a3 b3 c3 d3 e3 f3 g3 h3
  840|  2.61k|    resq_r4_2 = _mm_unpacklo_epi64(resq_r2_1, resq_r6_1);  // a4 b4 c4 d4 e4 f4 g4 h4
  841|  2.61k|    resq_r5_2 = _mm_unpackhi_epi64(resq_r2_1, resq_r6_1);  // a5 b5 c5 d5 e5 f5 g5 h5
  842|  2.61k|    resq_r6_2 = _mm_unpacklo_epi64(resq_r3_1, resq_r7_1);  // a6 b6 c6 d6 e6 f6 g6 h6
  843|  2.61k|    resq_r7_2 = _mm_unpackhi_epi64(resq_r3_1, resq_r7_1);  // a7 b7 c7 d7 e7 f7 g7 h7
  844|       |
  845|  2.61k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, resq_r1_2);
  846|  2.61k|    resq_r1_1 = _mm_unpacklo_epi16(resq_r1_2, sign_reg);  // a1 b1 c1 d1 -- 32 bit
  847|  2.61k|    resq_r1_2 = _mm_unpackhi_epi16(resq_r1_2, sign_reg);  // e1 f1 g1 h1 -- 32 bit
  848|  2.61k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, resq_r3_2);
  849|  2.61k|    resq_r3_1 = _mm_unpacklo_epi16(resq_r3_2, sign_reg);  // a3 b3 c3 d3 -- 32 bit
  850|  2.61k|    resq_r3_2 = _mm_unpackhi_epi16(resq_r3_2, sign_reg);  // e3 f3 g3 h3 -- 32 bit
  851|  2.61k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, resq_r5_2);
  852|  2.61k|    resq_r5_1 = _mm_unpacklo_epi16(resq_r5_2, sign_reg);  // a5 b5 c5 d5 -- 32 bit
  853|  2.61k|    resq_r5_2 = _mm_unpackhi_epi16(resq_r5_2, sign_reg);  // e5 f5 g5 h5 -- 32 bit
  854|  2.61k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, resq_r7_2);
  855|  2.61k|    resq_r7_1 = _mm_unpacklo_epi16(resq_r7_2, sign_reg);  // a7 b7 c7 d7 -- 32 bit
  856|  2.61k|    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.61k|    temp1 = _mm_add_epi16(resq_r0_2, resq_r4_2);
  861|       |    /* y2 = w0 - w4                                                      */
  862|  2.61k|    temp3 = _mm_sub_epi16(resq_r0_2, resq_r4_2);
  863|       |    /* y1 = -w3 + w5 - w7 - (w7 >> 1)                                   */
  864|  2.61k|    temp2 = _mm_sub_epi32(resq_r5_1, resq_r3_1);  //-w3+w5
  865|  2.61k|    temp10 = _mm_sub_epi32(resq_r5_2, resq_r3_2);
  866|  2.61k|    temp4 = _mm_sub_epi32(temp2, resq_r7_1);      //-w3+w5-w7
  867|  2.61k|    temp12 = _mm_sub_epi32(temp10, resq_r7_2);
  868|  2.61k|    temp5 = _mm_srai_epi32(resq_r7_1, 1);         // w7>>1
  869|  2.61k|    temp13 = _mm_srai_epi32(resq_r7_2, 1);
  870|  2.61k|    temp2 = _mm_sub_epi32(temp4, temp5);          //-w3+w5-w7 -(w7>>1)
  871|  2.61k|    temp10 = _mm_sub_epi32(temp12, temp13);
  872|  2.61k|    temp2 = _mm_packs_epi32(temp2, temp10);
  873|       |    /* y3 = w1 + w7 - w3 - (w3 >> 1)                                    */
  874|  2.61k|    temp4 = _mm_add_epi32(resq_r1_1, resq_r7_1);  // w1+w7
  875|  2.61k|    temp12 = _mm_add_epi32(resq_r1_2, resq_r7_2);
  876|  2.61k|    temp4 = _mm_sub_epi32(temp4, resq_r3_1);      // w1+w7-w3
  877|  2.61k|    temp12 = _mm_sub_epi32(temp12, resq_r3_2);
  878|  2.61k|    temp5 = _mm_srai_epi32(resq_r3_1, 1);         // w3>>1
  879|  2.61k|    temp13 = _mm_srai_epi32(resq_r3_2, 1);
  880|  2.61k|    temp4 = _mm_sub_epi32(temp4, temp5);          // w1+w7-w3-(w3>>1)
  881|  2.61k|    temp12 = _mm_sub_epi32(temp12, temp13);
  882|  2.61k|    temp4 = _mm_packs_epi32(temp4, temp12);
  883|       |    /* y4 = (w2 >> 1) - w6                                              */
  884|  2.61k|    temp5 = _mm_srai_epi16(resq_r2_2, 1);     // w2>>1
  885|  2.61k|    temp5 = _mm_sub_epi16(temp5, resq_r6_2);  //(w2>>1)-w6
  886|       |    /* y5 = -w1 + w7 + w5 + (w5 >> 1)                                   */
  887|  2.61k|    temp6 = _mm_sub_epi32(resq_r7_1, resq_r1_1);  // w7-w1
  888|  2.61k|    temp14 = _mm_sub_epi32(resq_r7_2, resq_r1_2);
  889|  2.61k|    temp6 = _mm_add_epi32(temp6, resq_r5_1);      // w7-w1+w5
  890|  2.61k|    temp14 = _mm_add_epi32(temp14, resq_r5_2);
  891|  2.61k|    temp7 = _mm_srai_epi32(resq_r5_1, 1);         // w5>>1
  892|  2.61k|    temp15 = _mm_srai_epi32(resq_r5_2, 1);
  893|  2.61k|    temp6 = _mm_add_epi32(temp6, temp7);          // w7-w1_w5+(w5>>1)
  894|  2.61k|    temp14 = _mm_add_epi32(temp14, temp15);
  895|  2.61k|    temp6 = _mm_packs_epi32(temp6, temp14);
  896|       |    /* y6 = w2 + (w6 >> 1)                                              */
  897|  2.61k|    temp7 = _mm_srai_epi16(resq_r6_2, 1);     // w6>>1
  898|  2.61k|    temp7 = _mm_add_epi16(temp7, resq_r2_2);  //(w6>>1)+w2
  899|       |    /* y7 = w3 + w5 + w1 + (w1 >> 1)                                    */
  900|  2.61k|    temp8 = _mm_add_epi32(resq_r3_1, resq_r5_1);  // w3+w5
  901|  2.61k|    temp16 = _mm_add_epi32(resq_r3_2, resq_r5_2);
  902|  2.61k|    temp8 = _mm_add_epi32(temp8, resq_r1_1);      // w3+w5+w1
  903|  2.61k|    temp16 = _mm_add_epi32(temp16, resq_r1_2);
  904|  2.61k|    temp17 = _mm_srai_epi32(resq_r1_1, 1);        // w1>>1
  905|  2.61k|    temp18 = _mm_srai_epi32(resq_r1_2, 1);
  906|  2.61k|    temp8 = _mm_add_epi32(temp8, temp17);         // w3+w5+w1+(w1>>1)
  907|  2.61k|    temp16 = _mm_add_epi32(temp16, temp18);
  908|  2.61k|    temp8 = _mm_packs_epi32(temp8, temp16);
  909|       |    /*------------------------------------------------------------------*/
  910|       |    /*------------------------------------------------------------------*/
  911|       |    /* z0 = y0 + y6                                                        */
  912|  2.61k|    resq_r0_1 = _mm_add_epi16(temp1, temp7);
  913|       |    /* z1 = y1 + (y7 >> 2)                                                */
  914|  2.61k|    resq_r1_1 = _mm_srai_epi16(temp8, 2);
  915|  2.61k|    resq_r1_1 = _mm_add_epi16(resq_r1_1, temp2);
  916|       |    /* z2 = y2 + y4                                                        */
  917|  2.61k|    resq_r2_1 = _mm_add_epi16(temp3, temp5);
  918|       |    /* z3 = y3 + (y5 >> 2)                                                */
  919|  2.61k|    resq_r3_1 = _mm_srai_epi16(temp6, 2);
  920|  2.61k|    resq_r3_1 = _mm_add_epi16(resq_r3_1, temp4);
  921|       |    /* z4 = y2 - y4                                                        */
  922|  2.61k|    resq_r4_1 = _mm_sub_epi16(temp3, temp5);
  923|       |    /* z5 = (y3 >> 2) - y5                                                 */
  924|  2.61k|    resq_r5_1 = _mm_srai_epi16(temp4, 2);
  925|  2.61k|    resq_r5_1 = _mm_sub_epi16(resq_r5_1, temp6);
  926|       |    /* z6 = y0 - y6                                                     */
  927|  2.61k|    resq_r6_1 = _mm_sub_epi16(temp1, temp7);
  928|       |    /* z7 = y7 - (y1 >> 2)                                                 */
  929|  2.61k|    resq_r7_1 = _mm_srai_epi16(temp2, 2);
  930|  2.61k|    resq_r7_1 = _mm_sub_epi16(temp8, resq_r7_1);
  931|       |    /*------------------------------------------------------------------*/
  932|       |    /*------------------------------------------------------------------*/
  933|       |    /* x0 = z0 + z7                                                        */
  934|  2.61k|    temp1 = _mm_add_epi16(resq_r0_1, resq_r7_1);
  935|       |    /* x1 = z2 + z5                                                        */
  936|  2.61k|    temp2 = _mm_add_epi16(resq_r2_1, resq_r5_1);
  937|       |    /* x2 = z4 + z3                                                        */
  938|  2.61k|    temp3 = _mm_add_epi16(resq_r4_1, resq_r3_1);
  939|       |    /* x3 = z6 + z1                                                        */
  940|  2.61k|    temp4 = _mm_add_epi16(resq_r6_1, resq_r1_1);
  941|       |    /* x4 = z6 - z1                                                        */
  942|  2.61k|    temp5 = _mm_sub_epi16(resq_r6_1, resq_r1_1);
  943|       |    /* x5 = z4 - z3                                                        */
  944|  2.61k|    temp6 = _mm_sub_epi16(resq_r4_1, resq_r3_1);
  945|       |    /* x6 = z2 - z5                                                        */
  946|  2.61k|    temp7 = _mm_sub_epi16(resq_r2_1, resq_r5_1);
  947|       |    /* x7 = z0 - z7                                                        */
  948|  2.61k|    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.61k|    temp17 = _mm_unpacklo_epi16(temp1, temp2);       // a0 a1 b0 b1 c0 c1 d0 d1
  958|  2.61k|    temp19 = _mm_unpacklo_epi16(temp3, temp4);       // a2 a3 b2 b3 c2 c3 d2 d3
  959|  2.61k|    temp18 = _mm_unpackhi_epi16(temp1, temp2);       // e0 e1 f0 f1 g0 g1 h0 h1
  960|  2.61k|    temp20 = _mm_unpackhi_epi16(temp3, temp4);       // e2 e3 f2 f3 g2 g3 h2 h3
  961|       |
  962|  2.61k|    resq_r0_1 = _mm_unpacklo_epi32(temp17, temp19);  // a0 a1 a2 a3 b0 b1 b2 b3
  963|  2.61k|    resq_r1_1 = _mm_unpackhi_epi32(temp17, temp19);  // c0 c1 c2 c3 d0 d1 d2 d3
  964|  2.61k|    resq_r2_1 = _mm_unpacklo_epi32(temp18, temp20);  // e0 e1 e2 e3 f0 f1 f2 f3
  965|  2.61k|    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.61k|    temp17 = _mm_unpacklo_epi16(temp5, temp6);       // a4 a5 b4 b5 c4 c5 d4 d5
  973|  2.61k|    temp19 = _mm_unpacklo_epi16(temp7, temp8);       // a6 a7 b6 b7 c6 c7 d6 d7
  974|  2.61k|    temp18 = _mm_unpackhi_epi16(temp5, temp6);       // e4 e5 f4 f5 g4 g5 h4 h5
  975|  2.61k|    temp20 = _mm_unpackhi_epi16(temp7, temp8);       // e6 e7 f6 f7 g6 g7 h6 h7
  976|       |
  977|  2.61k|    resq_r4_1 = _mm_unpacklo_epi32(temp17, temp19);  // a4 a5 a6 a7 b4 b5 b6 b7
  978|  2.61k|    resq_r5_1 = _mm_unpackhi_epi32(temp17, temp19);  // c4 c5 c6 c7 d4 d5 d6 d7
  979|  2.61k|    resq_r6_1 = _mm_unpacklo_epi32(temp18, temp20);  // e4 e5 e6 e7 f4 f5 f6 f7
  980|  2.61k|    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.61k|    resq_r0_2 = _mm_unpacklo_epi64(resq_r0_1, resq_r4_1);  // a0 a1 a2 a3 a4 a5 a6 a7
  991|  2.61k|    resq_r1_2 = _mm_unpackhi_epi64(resq_r0_1, resq_r4_1);  // b0 b1 b2 b3 b4 b5 b6 b7
  992|  2.61k|    resq_r2_2 = _mm_unpacklo_epi64(resq_r1_1, resq_r5_1);  // c0 c1 c2 c3 c4 c5 c6 c7
  993|  2.61k|    resq_r3_2 = _mm_unpackhi_epi64(resq_r1_1, resq_r5_1);  // d0 d1 d2 d3 d4 d5 d6 d7
  994|  2.61k|    resq_r4_2 = _mm_unpacklo_epi64(resq_r2_1, resq_r6_1);  // e0 e1 e2 e3 e4 e5 e6 e7
  995|  2.61k|    resq_r5_2 = _mm_unpackhi_epi64(resq_r2_1, resq_r6_1);  // f0 f1 f2 f3 f4 f5 f6 f7
  996|  2.61k|    resq_r6_2 = _mm_unpacklo_epi64(resq_r3_1, resq_r7_1);  // g0 g1 g2 g3 g4 g5 g6 g7
  997|  2.61k|    resq_r7_2 = _mm_unpackhi_epi64(resq_r3_1, resq_r7_1);  // h0 h1 h2 h3 h4 h5 h6 h7
  998|       |
  999|  2.61k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, resq_r1_2);
 1000|  2.61k|    resq_r1_1 = _mm_unpacklo_epi16(resq_r1_2, sign_reg);  // a1 b1 c1 d1 -- 32 bit
 1001|  2.61k|    resq_r1_2 = _mm_unpackhi_epi16(resq_r1_2, sign_reg);  // e1 f1 g1 h1 -- 32 bit
 1002|  2.61k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, resq_r3_2);
 1003|  2.61k|    resq_r3_1 = _mm_unpacklo_epi16(resq_r3_2, sign_reg);  // a3 b3 c3 d3 -- 32 bit
 1004|  2.61k|    resq_r3_2 = _mm_unpackhi_epi16(resq_r3_2, sign_reg);  // e3 f3 g3 h3 -- 32 bit
 1005|  2.61k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, resq_r5_2);
 1006|  2.61k|    resq_r5_1 = _mm_unpacklo_epi16(resq_r5_2, sign_reg);  // a5 b5 c5 d5 -- 32 bit
 1007|  2.61k|    resq_r5_2 = _mm_unpackhi_epi16(resq_r5_2, sign_reg);  // e5 f5 g5 h5 -- 32 bit
 1008|  2.61k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, resq_r7_2);
 1009|  2.61k|    resq_r7_1 = _mm_unpacklo_epi16(resq_r7_2, sign_reg);  // a7 b7 c7 d7 -- 32 bit
 1010|  2.61k|    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.61k|    temp1 = _mm_add_epi16(resq_r0_2, resq_r4_2);
 1018|       |    /* y2j = w0j - w4j                                                      */
 1019|  2.61k|    temp3 = _mm_sub_epi16(resq_r0_2, resq_r4_2);
 1020|       |    /* y1j = -w3j + w5j - w7j - (w7j >> 1)                                   */
 1021|  2.61k|    temp2 = _mm_sub_epi32(resq_r5_1, resq_r3_1);  //-w3+w5
 1022|  2.61k|    temp10 = _mm_sub_epi32(resq_r5_2, resq_r3_2);
 1023|  2.61k|    temp4 = _mm_sub_epi32(temp2, resq_r7_1);      //-w3+w5-w7
 1024|  2.61k|    temp12 = _mm_sub_epi32(temp10, resq_r7_2);
 1025|  2.61k|    temp5 = _mm_srai_epi32(resq_r7_1, 1);         // w7>>1
 1026|  2.61k|    temp13 = _mm_srai_epi32(resq_r7_2, 1);
 1027|  2.61k|    temp2 = _mm_sub_epi32(temp4, temp5);          //-w3+w5-w7 -(w7>>1)
 1028|  2.61k|    temp10 = _mm_sub_epi32(temp12, temp13);
 1029|  2.61k|    temp2 = _mm_packs_epi32(temp2, temp10);
 1030|       |    /* y3j = w1j + w7j - w3j - (w3j >> 1)                                    */
 1031|  2.61k|    temp4 = _mm_add_epi32(resq_r1_1, resq_r7_1);  // w1+w7
 1032|  2.61k|    temp12 = _mm_add_epi32(resq_r1_2, resq_r7_2);
 1033|  2.61k|    temp4 = _mm_sub_epi32(temp4, resq_r3_1);      // w1+w7-w3
 1034|  2.61k|    temp12 = _mm_sub_epi32(temp12, resq_r3_2);
 1035|  2.61k|    temp5 = _mm_srai_epi32(resq_r3_1, 1);         // w3>>1
 1036|  2.61k|    temp13 = _mm_srai_epi32(resq_r3_2, 1);
 1037|  2.61k|    temp4 = _mm_sub_epi32(temp4, temp5);          // w1+w7-w3-(w3>>1)
 1038|  2.61k|    temp12 = _mm_sub_epi32(temp12, temp13);
 1039|  2.61k|    temp4 = _mm_packs_epi32(temp4, temp12);
 1040|       |    /* y4j = (w2j >> 1) - w6j                                              */
 1041|  2.61k|    temp5 = _mm_srai_epi16(resq_r2_2, 1);     // w2>>1
 1042|  2.61k|    temp5 = _mm_sub_epi16(temp5, resq_r6_2);  //(w2>>1)-w6
 1043|       |    /* y5j = -w1j + w7j + w5j + (w5j >> 1)                                   */
 1044|  2.61k|    temp6 = _mm_sub_epi32(resq_r7_1, resq_r1_1);  // w7-w1
 1045|  2.61k|    temp14 = _mm_sub_epi32(resq_r7_2, resq_r1_2);
 1046|  2.61k|    temp6 = _mm_add_epi32(temp6, resq_r5_1);      // w7-w1+w5
 1047|  2.61k|    temp14 = _mm_add_epi32(temp14, resq_r5_2);
 1048|  2.61k|    temp7 = _mm_srai_epi32(resq_r5_1, 1);         // w5>>1
 1049|  2.61k|    temp15 = _mm_srai_epi32(resq_r5_2, 1);
 1050|  2.61k|    temp6 = _mm_add_epi32(temp6, temp7);          // w7-w1_w5+(w5>>1)
 1051|  2.61k|    temp14 = _mm_add_epi32(temp14, temp15);
 1052|  2.61k|    temp6 = _mm_packs_epi32(temp6, temp14);
 1053|       |    /* y6j = w2j + (w6j >> 1)                                              */
 1054|  2.61k|    temp7 = _mm_srai_epi16(resq_r6_2, 1);     // w6>>1
 1055|  2.61k|    temp7 = _mm_add_epi16(temp7, resq_r2_2);  //(w6>>1)+w2
 1056|       |    /* y7j = w3j + w5j + w1j + (w1j >> 1)                                    */
 1057|  2.61k|    temp8 = _mm_add_epi32(resq_r3_1, resq_r5_1);  // w3+w5
 1058|  2.61k|    temp16 = _mm_add_epi32(resq_r3_2, resq_r5_2);
 1059|  2.61k|    temp8 = _mm_add_epi32(temp8, resq_r1_1);      // w3+w5+w1
 1060|  2.61k|    temp16 = _mm_add_epi32(temp16, resq_r1_2);
 1061|  2.61k|    temp17 = _mm_srai_epi32(resq_r1_1, 1);        // w1>>1
 1062|  2.61k|    temp18 = _mm_srai_epi32(resq_r1_2, 1);
 1063|  2.61k|    temp8 = _mm_add_epi32(temp8, temp17);         // w3+w5+w1+(w1>>1)
 1064|  2.61k|    temp16 = _mm_add_epi32(temp16, temp18);
 1065|  2.61k|    temp8 = _mm_packs_epi32(temp8, temp16);
 1066|       |    /*------------------------------------------------------------------*/
 1067|       |    /*------------------------------------------------------------------*/
 1068|       |    /* z0j = y0j + y6j                                                        */
 1069|  2.61k|    resq_r0_1 = _mm_add_epi16(temp1, temp7);
 1070|       |    /* z1j = y1j + (y7j >> 2)                                                */
 1071|  2.61k|    resq_r1_1 = _mm_srai_epi16(temp8, 2);
 1072|  2.61k|    resq_r1_1 = _mm_add_epi16(resq_r1_1, temp2);
 1073|       |    /* z2j = y2j + y4j                                                        */
 1074|  2.61k|    resq_r2_1 = _mm_add_epi16(temp3, temp5);
 1075|       |    /* z3j = y3j + (y5j >> 2)                                                */
 1076|  2.61k|    resq_r3_1 = _mm_srai_epi16(temp6, 2);
 1077|  2.61k|    resq_r3_1 = _mm_add_epi16(resq_r3_1, temp4);
 1078|       |    /* z4j = y2j - y4j                                                        */
 1079|  2.61k|    resq_r4_1 = _mm_sub_epi16(temp3, temp5);
 1080|       |    /* z5j = (y3j >> 2) - y5j                                                 */
 1081|  2.61k|    resq_r5_1 = _mm_srai_epi16(temp4, 2);
 1082|  2.61k|    resq_r5_1 = _mm_sub_epi16(resq_r5_1, temp6);
 1083|       |    /* z6j = y0j - y6j                                                     */
 1084|  2.61k|    resq_r6_1 = _mm_sub_epi16(temp1, temp7);
 1085|       |    /* z7j = y7j - (y1j >> 2)                                                 */
 1086|  2.61k|    resq_r7_1 = _mm_srai_epi16(temp2, 2);
 1087|  2.61k|    resq_r7_1 = _mm_sub_epi16(temp8, resq_r7_1);
 1088|       |    /*------------------------------------------------------------------*/
 1089|       |
 1090|       |    /*------------------------------------------------------------------*/
 1091|       |    /* x0j = z0j + z7j                                                        */
 1092|  2.61k|    temp1 = _mm_add_epi16(resq_r0_1, resq_r7_1);
 1093|  2.61k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, temp1);
 1094|  2.61k|    temp10 = _mm_unpacklo_epi16(temp1, sign_reg);
 1095|  2.61k|    temp11 = _mm_unpackhi_epi16(temp1, sign_reg);
 1096|  2.61k|    temp10 = _mm_add_epi32(temp10, value_32);
 1097|  2.61k|    temp11 = _mm_add_epi32(temp11, value_32);
 1098|  2.61k|    temp10 = _mm_srai_epi32(temp10, 6);
 1099|  2.61k|    temp10 = _mm_min_epi32(dupmax_4x32b, temp10);
 1100|  2.61k|    temp10 = _mm_max_epi32(dupmin_4x32b, temp10);
 1101|  2.61k|    temp11 = _mm_srai_epi32(temp11, 6);
 1102|  2.61k|    temp11 = _mm_min_epi32(dupmax_4x32b, temp11);
 1103|  2.61k|    temp11 = _mm_max_epi32(dupmin_4x32b, temp11);
 1104|  2.61k|    temp10 = _mm_packs_epi32(temp10, temp11);
 1105|  2.61k|    temp1 = temp10;  //_mm_add_epi16(temp10, pred_r0_1);
 1106|       |    /* x1j = z2j + z5j                                                        */
 1107|  2.61k|    temp2 = _mm_add_epi16(resq_r2_1, resq_r5_1);
 1108|  2.61k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, temp2);
 1109|  2.61k|    temp10 = _mm_unpacklo_epi16(temp2, sign_reg);
 1110|  2.61k|    temp11 = _mm_unpackhi_epi16(temp2, sign_reg);
 1111|  2.61k|    temp10 = _mm_add_epi32(temp10, value_32);
 1112|  2.61k|    temp11 = _mm_add_epi32(temp11, value_32);
 1113|  2.61k|    temp10 = _mm_srai_epi32(temp10, 6);
 1114|  2.61k|    temp10 = _mm_min_epi32(dupmax_4x32b, temp10);
 1115|  2.61k|    temp10 = _mm_max_epi32(dupmin_4x32b, temp10);
 1116|  2.61k|    temp11 = _mm_srai_epi32(temp11, 6);
 1117|  2.61k|    temp11 = _mm_min_epi32(dupmax_4x32b, temp11);
 1118|  2.61k|    temp11 = _mm_max_epi32(dupmin_4x32b, temp11);
 1119|  2.61k|    temp10 = _mm_packs_epi32(temp10, temp11);
 1120|  2.61k|    temp2 = temp10;  //_mm_add_epi16(temp10, pred_r1_1);
 1121|       |    /* x2j = z4j + z3j                                                        */
 1122|  2.61k|    temp3 = _mm_add_epi16(resq_r4_1, resq_r3_1);
 1123|  2.61k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, temp3);
 1124|  2.61k|    temp10 = _mm_unpacklo_epi16(temp3, sign_reg);
 1125|  2.61k|    temp11 = _mm_unpackhi_epi16(temp3, sign_reg);
 1126|  2.61k|    temp10 = _mm_add_epi32(temp10, value_32);
 1127|  2.61k|    temp11 = _mm_add_epi32(temp11, value_32);
 1128|  2.61k|    temp10 = _mm_srai_epi32(temp10, 6);
 1129|  2.61k|    temp10 = _mm_min_epi32(dupmax_4x32b, temp10);
 1130|  2.61k|    temp10 = _mm_max_epi32(dupmin_4x32b, temp10);
 1131|  2.61k|    temp11 = _mm_srai_epi32(temp11, 6);
 1132|  2.61k|    temp11 = _mm_min_epi32(dupmax_4x32b, temp11);
 1133|  2.61k|    temp11 = _mm_max_epi32(dupmin_4x32b, temp11);
 1134|  2.61k|    temp10 = _mm_packs_epi32(temp10, temp11);
 1135|  2.61k|    temp3 = temp10;  //_mm_add_epi16(temp10, pred_r2_1);
 1136|       |    /* x3j = z6j + z1j                                                        */
 1137|  2.61k|    temp4 = _mm_add_epi16(resq_r6_1, resq_r1_1);
 1138|  2.61k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, temp4);
 1139|  2.61k|    temp10 = _mm_unpacklo_epi16(temp4, sign_reg);
 1140|  2.61k|    temp11 = _mm_unpackhi_epi16(temp4, sign_reg);
 1141|  2.61k|    temp10 = _mm_add_epi32(temp10, value_32);
 1142|  2.61k|    temp11 = _mm_add_epi32(temp11, value_32);
 1143|  2.61k|    temp10 = _mm_srai_epi32(temp10, 6);
 1144|  2.61k|    temp10 = _mm_min_epi32(dupmax_4x32b, temp10);
 1145|  2.61k|    temp10 = _mm_max_epi32(dupmin_4x32b, temp10);
 1146|  2.61k|    temp11 = _mm_srai_epi32(temp11, 6);
 1147|  2.61k|    temp11 = _mm_min_epi32(dupmax_4x32b, temp11);
 1148|  2.61k|    temp11 = _mm_max_epi32(dupmin_4x32b, temp11);
 1149|  2.61k|    temp10 = _mm_packs_epi32(temp10, temp11);
 1150|  2.61k|    temp4 = temp10;  //_mm_add_epi16(temp10, pred_r3_1);
 1151|       |    /* x4j = z6j - z1j                                                        */
 1152|  2.61k|    temp5 = _mm_sub_epi16(resq_r6_1, resq_r1_1);
 1153|  2.61k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, temp5);
 1154|  2.61k|    temp10 = _mm_unpacklo_epi16(temp5, sign_reg);
 1155|  2.61k|    temp11 = _mm_unpackhi_epi16(temp5, sign_reg);
 1156|  2.61k|    temp10 = _mm_add_epi32(temp10, value_32);
 1157|  2.61k|    temp11 = _mm_add_epi32(temp11, value_32);
 1158|  2.61k|    temp10 = _mm_srai_epi32(temp10, 6);
 1159|  2.61k|    temp10 = _mm_min_epi32(dupmax_4x32b, temp10);
 1160|  2.61k|    temp10 = _mm_max_epi32(dupmin_4x32b, temp10);
 1161|  2.61k|    temp11 = _mm_srai_epi32(temp11, 6);
 1162|  2.61k|    temp11 = _mm_min_epi32(dupmax_4x32b, temp11);
 1163|  2.61k|    temp11 = _mm_max_epi32(dupmin_4x32b, temp11);
 1164|  2.61k|    temp10 = _mm_packs_epi32(temp10, temp11);
 1165|  2.61k|    temp5 = temp10;  //_mm_add_epi16(temp10, pred_r4_1);
 1166|       |    /* x5j = z4j - z3j                                                        */
 1167|  2.61k|    temp6 = _mm_sub_epi16(resq_r4_1, resq_r3_1);
 1168|  2.61k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, temp6);
 1169|  2.61k|    temp10 = _mm_unpacklo_epi16(temp6, sign_reg);
 1170|  2.61k|    temp11 = _mm_unpackhi_epi16(temp6, sign_reg);
 1171|  2.61k|    temp10 = _mm_add_epi32(temp10, value_32);
 1172|  2.61k|    temp11 = _mm_add_epi32(temp11, value_32);
 1173|  2.61k|    temp10 = _mm_srai_epi32(temp10, 6);
 1174|  2.61k|    temp10 = _mm_min_epi32(dupmax_4x32b, temp10);
 1175|  2.61k|    temp10 = _mm_max_epi32(dupmin_4x32b, temp10);
 1176|  2.61k|    temp11 = _mm_srai_epi32(temp11, 6);
 1177|  2.61k|    temp11 = _mm_min_epi32(dupmax_4x32b, temp11);
 1178|  2.61k|    temp11 = _mm_max_epi32(dupmin_4x32b, temp11);
 1179|  2.61k|    temp10 = _mm_packs_epi32(temp10, temp11);
 1180|  2.61k|    temp6 = temp10;  //_mm_add_epi16(temp10, pred_r5_1);
 1181|       |    /* x6j = z2j - z5j                                                        */
 1182|  2.61k|    temp7 = _mm_sub_epi16(resq_r2_1, resq_r5_1);
 1183|  2.61k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, temp7);
 1184|  2.61k|    temp10 = _mm_unpacklo_epi16(temp7, sign_reg);
 1185|  2.61k|    temp11 = _mm_unpackhi_epi16(temp7, sign_reg);
 1186|  2.61k|    temp10 = _mm_add_epi32(temp10, value_32);
 1187|  2.61k|    temp11 = _mm_add_epi32(temp11, value_32);
 1188|  2.61k|    temp10 = _mm_srai_epi32(temp10, 6);
 1189|  2.61k|    temp10 = _mm_min_epi32(dupmax_4x32b, temp10);
 1190|  2.61k|    temp10 = _mm_max_epi32(dupmin_4x32b, temp10);
 1191|  2.61k|    temp11 = _mm_srai_epi32(temp11, 6);
 1192|  2.61k|    temp11 = _mm_min_epi32(dupmax_4x32b, temp11);
 1193|  2.61k|    temp11 = _mm_max_epi32(dupmin_4x32b, temp11);
 1194|  2.61k|    temp10 = _mm_packs_epi32(temp10, temp11);
 1195|  2.61k|    temp7 = temp10;  //_mm_add_epi16(temp10, pred_r6_1);
 1196|       |    /* x7j = z0j - z7j                                                        */
 1197|  2.61k|    temp8 = _mm_sub_epi16(resq_r0_1, resq_r7_1);
 1198|  2.61k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, temp8);
 1199|  2.61k|    temp10 = _mm_unpacklo_epi16(temp8, sign_reg);
 1200|  2.61k|    temp11 = _mm_unpackhi_epi16(temp8, sign_reg);
 1201|  2.61k|    temp10 = _mm_add_epi32(temp10, value_32);
 1202|  2.61k|    temp11 = _mm_add_epi32(temp11, value_32);
 1203|  2.61k|    temp10 = _mm_srai_epi32(temp10, 6);
 1204|  2.61k|    temp10 = _mm_min_epi32(dupmax_4x32b, temp10);
 1205|  2.61k|    temp10 = _mm_max_epi32(dupmin_4x32b, temp10);
 1206|  2.61k|    temp11 = _mm_srai_epi32(temp11, 6);
 1207|  2.61k|    temp11 = _mm_min_epi32(dupmax_4x32b, temp11);
 1208|  2.61k|    temp11 = _mm_max_epi32(dupmin_4x32b, temp11);
 1209|  2.61k|    temp10 = _mm_packs_epi32(temp10, temp11);
 1210|  2.61k|    temp8 = temp10;  //_mm_add_epi16(temp10, pred_r7_1);
 1211|       |
 1212|  2.61k|    _mm_storeu_si128((__m128i *) (&pi2_out[0]), temp1);
 1213|  2.61k|    _mm_storeu_si128((__m128i *) (&pi2_out[out_strd]), temp2);
 1214|  2.61k|    _mm_storeu_si128((__m128i *) (&pi2_out[2 * out_strd]), temp3);
 1215|  2.61k|    _mm_storeu_si128((__m128i *) (&pi2_out[3 * out_strd]), temp4);
 1216|  2.61k|    _mm_storeu_si128((__m128i *) (&pi2_out[4 * out_strd]), temp5);
 1217|  2.61k|    _mm_storeu_si128((__m128i *) (&pi2_out[5 * out_strd]), temp6);
 1218|  2.61k|    _mm_storeu_si128((__m128i *) (&pi2_out[6 * out_strd]), temp7);
 1219|  2.61k|    _mm_storeu_si128((__m128i *) (&pi2_out[7 * out_strd]), temp8);
 1220|  2.61k|}
isvcd_iquant_itrans_chroma_4x4_sse42:
 1249|  3.00k|{
 1250|  3.00k|    __m128i src_r0_r1, src_r2_r3;
 1251|  3.00k|    __m128i src_r0, src_r1, src_r2, src_r3;
 1252|  3.00k|    __m128i scalemat_r0_r1, scalemat_r2_r3;
 1253|  3.00k|    __m128i dequant_r0_r1, dequant_r2_r3;
 1254|  3.00k|    __m128i zero_8x16b = _mm_setzero_si128();  // all bits reset to zero
 1255|  3.00k|    __m128i temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7;
 1256|  3.00k|    __m128i resq_r0, resq_r1, resq_r2, resq_r3;
 1257|  3.00k|    __m128i add_rshift = _mm_set1_epi32((u4_qp_div_6 < 4) ? (1 << (3 - u4_qp_div_6)) : 0);
  ------------------
  |  Branch (1257:41): [True: 2.17k, False: 831]
  ------------------
 1258|  3.00k|    __m128i value_32 = _mm_set1_epi32(32);
 1259|  3.00k|    __m128i dupmax_4x32b = _mm_set1_epi32(RSD_MAX);
  ------------------
  |  |  772|  3.00k|#define RSD_MAX 255
  ------------------
 1260|  3.00k|    __m128i dupmin_4x32b = _mm_set1_epi32(RSD_MIN);
  ------------------
  |  |  773|  3.00k|#define RSD_MIN -255
  ------------------
 1261|       |
 1262|  3.00k|    __m128i chroma_mask_even =
 1263|  3.00k|        _mm_set_epi16(0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff);
 1264|  3.00k|    __m128i chroma_mask_odd =
 1265|  3.00k|        _mm_set_epi16(0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000);
 1266|       |
 1267|  3.00k|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|  3.00k|#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.00k|    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.00k|    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.00k|    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.00k|    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.00k|    dequant_r0_r1 = _mm_loadu_si128((__m128i *) (pu2_weigh_mat));
 1283|       |    // q20 q21 q22 q23 q30 q31 q32 q33 -- all 16 bits
 1284|  3.00k|    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.00k|    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.00k|    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.00k|    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.00k|    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.00k|    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.00k|    temp7 = _mm_unpackhi_epi16(temp1, zero_8x16b);
 1297|       |
 1298|  3.00k|    src_r0 = _mm_unpacklo_epi16(src_r0_r1, zero_8x16b);  // a00 0 a01 0 a02 0 a03 0 -- 16 bit long
 1299|  3.00k|    src_r1 = _mm_unpackhi_epi16(src_r0_r1, zero_8x16b);  // a10 0 a11 0 a12 0 a13 0 -- 16 bit long
 1300|  3.00k|    src_r2 = _mm_unpacklo_epi16(src_r2_r3, zero_8x16b);  // a20 0 a21 0 a22 0 a23 0 -- 16 bit long
 1301|  3.00k|    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.00k|    temp4 = _mm_madd_epi16(src_r0, temp4);
 1305|  3.00k|    temp5 = _mm_madd_epi16(src_r1, temp5);
 1306|  3.00k|    temp6 = _mm_madd_epi16(src_r2, temp6);
 1307|  3.00k|    temp7 = _mm_madd_epi16(src_r3, temp7);
 1308|       |
 1309|  3.00k|    if(u4_qp_div_6 >= 4)
  ------------------
  |  Branch (1309:8): [True: 831, False: 2.17k]
  ------------------
 1310|    831|    {
 1311|    831|        resq_r0 = _mm_slli_epi32(temp4, u4_qp_div_6 - 4);
 1312|    831|        resq_r1 = _mm_slli_epi32(temp5, u4_qp_div_6 - 4);
 1313|    831|        resq_r2 = _mm_slli_epi32(temp6, u4_qp_div_6 - 4);
 1314|    831|        resq_r3 = _mm_slli_epi32(temp7, u4_qp_div_6 - 4);
 1315|    831|    }
 1316|  2.17k|    else
 1317|  2.17k|    {
 1318|  2.17k|        temp4 = _mm_add_epi32(temp4, add_rshift);
 1319|  2.17k|        temp5 = _mm_add_epi32(temp5, add_rshift);
 1320|  2.17k|        temp6 = _mm_add_epi32(temp6, add_rshift);
 1321|  2.17k|        temp7 = _mm_add_epi32(temp7, add_rshift);
 1322|  2.17k|        resq_r0 = _mm_srai_epi32(temp4, 4 - u4_qp_div_6);
 1323|  2.17k|        resq_r1 = _mm_srai_epi32(temp5, 4 - u4_qp_div_6);
 1324|  2.17k|        resq_r2 = _mm_srai_epi32(temp6, 4 - u4_qp_div_6);
 1325|  2.17k|        resq_r3 = _mm_srai_epi32(temp7, 4 - u4_qp_div_6);
 1326|  2.17k|    }
 1327|       |
 1328|  3.00k|    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.00k|    temp1 = _mm_unpacklo_epi32(resq_r0, resq_r1);  // a0 b0 a1 b1
 1341|  3.00k|    temp3 = _mm_unpacklo_epi32(resq_r2, resq_r3);  // c0 d0 c1 d1
 1342|  3.00k|    temp2 = _mm_unpackhi_epi32(resq_r0, resq_r1);  // a2 b2 a3 b3
 1343|  3.00k|    temp4 = _mm_unpackhi_epi32(resq_r2, resq_r3);  // c2 d2 c3 d3
 1344|  3.00k|    resq_r0 = _mm_unpacklo_epi64(temp1, temp3);    // a0 b0 c0 d0
 1345|  3.00k|    resq_r1 = _mm_unpackhi_epi64(temp1, temp3);    // a1 b1 c1 d1
 1346|  3.00k|    resq_r2 = _mm_unpacklo_epi64(temp2, temp4);    // a2 b2 c2 d2
 1347|  3.00k|    resq_r3 = _mm_unpackhi_epi64(temp2, temp4);    // a3 b3 c3 d3
 1348|       |    // Transform starts -- horizontal transform
 1349|       |    /*------------------------------------------------------------------*/
 1350|       |    /* z0 = w0 + w2                                             */
 1351|  3.00k|    temp0 = _mm_add_epi32(resq_r0, resq_r2);
 1352|       |    /* z1 = w0 - w2                                             */
 1353|  3.00k|    temp1 = _mm_sub_epi32(resq_r0, resq_r2);
 1354|       |    /* z2 = (w1 >> 1) - w3                                      */
 1355|  3.00k|    temp2 = _mm_srai_epi32(resq_r1, 1);     //(w1>>1)
 1356|  3.00k|    temp2 = _mm_sub_epi32(temp2, resq_r3);  //(w1>>1) - w3
 1357|       |    /* z3 = w1 + (w3 >> 1)                                      */
 1358|  3.00k|    temp3 = _mm_srai_epi32(resq_r3, 1);  //(w3>>1) + w1
 1359|  3.00k|    temp3 = _mm_add_epi32(temp3, resq_r1);
 1360|       |    /*----------------------------------------------------------*/
 1361|       |    /* x0 = z0 + z3                                             */
 1362|  3.00k|    resq_r0 = _mm_add_epi32(temp0, temp3);
 1363|       |    /* x1 = z1 + z2                                             */
 1364|  3.00k|    resq_r1 = _mm_add_epi32(temp1, temp2);
 1365|       |    /* x2 = z1 - z2                                             */
 1366|  3.00k|    resq_r2 = _mm_sub_epi32(temp1, temp2);
 1367|       |    /* x3 = z0 - z3                                             */
 1368|  3.00k|    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.00k|    temp1 = _mm_unpacklo_epi32(resq_r0, resq_r1);  // a0 a1 b0 b1
 1377|  3.00k|    temp3 = _mm_unpacklo_epi32(resq_r2, resq_r3);  // a2 a3 b2 b3
 1378|  3.00k|    temp2 = _mm_unpackhi_epi32(resq_r0, resq_r1);  // c0 c1 d0 d1
 1379|  3.00k|    temp4 = _mm_unpackhi_epi32(resq_r2, resq_r3);  // c2 c3 d2 d3
 1380|  3.00k|    resq_r0 = _mm_unpacklo_epi64(temp1, temp3);    // a0 a1 a2 a3
 1381|  3.00k|    resq_r1 = _mm_unpackhi_epi64(temp1, temp3);    // b0 b1 b2 b3
 1382|  3.00k|    resq_r2 = _mm_unpacklo_epi64(temp2, temp4);    // c0 c1 c2 c3
 1383|  3.00k|    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.00k|    temp0 = _mm_add_epi32(resq_r0, resq_r2);
 1392|       |    /* z1j = y0j - y2j                                                        */
 1393|  3.00k|    temp1 = _mm_sub_epi32(resq_r0, resq_r2);
 1394|       |    /* z2j = (y1j>>1) - y3j */
 1395|  3.00k|    temp2 = _mm_srai_epi32(resq_r1, 1);  //(y1j>>1)
 1396|  3.00k|    temp2 = _mm_sub_epi32(temp2, resq_r3);
 1397|       |    /* z3j = y1j + (y3j>>1) */
 1398|  3.00k|    temp3 = _mm_srai_epi32(resq_r3, 1);  //(y3j>>1)
 1399|  3.00k|    temp3 = _mm_add_epi32(temp3, resq_r1);
 1400|       |
 1401|       |    /* x0j = z0j + z3j                                                        */
 1402|  3.00k|    temp4 = _mm_add_epi32(temp0, temp3);
 1403|  3.00k|    temp4 = _mm_add_epi32(temp4, value_32);
 1404|  3.00k|    temp4 = _mm_srai_epi32(temp4, 6);
 1405|  3.00k|    temp4 = _mm_min_epi32(dupmax_4x32b, temp4);
 1406|  3.00k|    temp4 = _mm_max_epi32(dupmin_4x32b, temp4);
 1407|       |
 1408|       |    /* x1j = z1j + z2j                                                        */
 1409|  3.00k|    temp5 = _mm_add_epi32(temp1, temp2);
 1410|  3.00k|    temp5 = _mm_add_epi32(temp5, value_32);
 1411|  3.00k|    temp5 = _mm_srai_epi32(temp5, 6);
 1412|  3.00k|    temp5 = _mm_min_epi32(dupmax_4x32b, temp5);
 1413|  3.00k|    temp5 = _mm_max_epi32(dupmin_4x32b, temp5);
 1414|       |
 1415|       |    /* x2j = z1j - z2j                                                        */
 1416|  3.00k|    temp6 = _mm_sub_epi32(temp1, temp2);
 1417|  3.00k|    temp6 = _mm_add_epi32(temp6, value_32);
 1418|  3.00k|    temp6 = _mm_srai_epi32(temp6, 6);
 1419|  3.00k|    temp6 = _mm_min_epi32(dupmax_4x32b, temp6);
 1420|  3.00k|    temp6 = _mm_max_epi32(dupmin_4x32b, temp6);
 1421|       |
 1422|       |    /* x3j = z0j - z3j                                                        */
 1423|  3.00k|    temp7 = _mm_sub_epi32(temp0, temp3);
 1424|  3.00k|    temp7 = _mm_add_epi32(temp7, value_32);
 1425|  3.00k|    temp7 = _mm_srai_epi32(temp7, 6);
 1426|  3.00k|    temp7 = _mm_min_epi32(dupmax_4x32b, temp7);
 1427|  3.00k|    temp7 = _mm_max_epi32(dupmin_4x32b, temp7);
 1428|       |
 1429|       |    // 32-bit to 16-bit conversion
 1430|  3.00k|    temp0 = _mm_packs_epi32(temp4, temp5);
 1431|  3.00k|    temp1 = _mm_packs_epi32(temp6, temp7);
 1432|       |
 1433|  3.00k|    resq_r0 = temp0;
 1434|  3.00k|    resq_r1 = _mm_srli_si128(temp0, 8);
 1435|  3.00k|    resq_r2 = temp1;
 1436|  3.00k|    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.00k|    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.00k|    src_r1 = _mm_loadu_si128((__m128i *) (pi2_out + (1 * out_strd)));
 1442|       |
 1443|  3.00k|    src_r2 = _mm_loadu_si128((__m128i *) (pi2_out + (2 * out_strd)));
 1444|  3.00k|    src_r3 = _mm_loadu_si128((__m128i *) (pi2_out + (3 * out_strd)));
 1445|       |
 1446|  3.00k|    resq_r0 = _mm_and_si128(temp4, chroma_mask_even);  // macro 0 macro 0 ..
 1447|  3.00k|    resq_r1 = _mm_and_si128(temp5, chroma_mask_even);
 1448|  3.00k|    resq_r2 = _mm_and_si128(temp6, chroma_mask_even);
 1449|  3.00k|    resq_r3 = _mm_and_si128(temp7, chroma_mask_even);
 1450|       |
 1451|  3.00k|    src_r0 = _mm_and_si128(src_r0, chroma_mask_odd);  // 0 src1 0 src2 0 ...
 1452|  3.00k|    src_r1 = _mm_and_si128(src_r1, chroma_mask_odd);
 1453|  3.00k|    src_r2 = _mm_and_si128(src_r2, chroma_mask_odd);
 1454|  3.00k|    src_r3 = _mm_and_si128(src_r3, chroma_mask_odd);
 1455|       |
 1456|  3.00k|    src_r0 = _mm_add_epi16(src_r0, resq_r0);  // macro  src1 macro src2 macro ...
 1457|  3.00k|    src_r1 = _mm_add_epi16(src_r1, resq_r1);
 1458|  3.00k|    src_r2 = _mm_add_epi16(src_r2, resq_r2);
 1459|  3.00k|    src_r3 = _mm_add_epi16(src_r3, resq_r3);
 1460|       |
 1461|  3.00k|    _mm_storeu_si128((__m128i *) (&pi2_out[0]), src_r0);
 1462|  3.00k|    _mm_storeu_si128((__m128i *) (&pi2_out[out_strd]), src_r1);
 1463|  3.00k|    _mm_storeu_si128((__m128i *) (&pi2_out[2 * out_strd]), src_r2);
 1464|  3.00k|    _mm_storeu_si128((__m128i *) (&pi2_out[3 * out_strd]), src_r3);
 1465|  3.00k|}

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

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

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

