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

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

ih264_deblk_luma_vert_bs4:
  108|  68.7k|{
  109|  68.7k|    UWORD8 p3, p2, p1, p0, q0, q1, q2, q3;
  110|  68.7k|    WORD32 pos_p3, pos_p2, pos_p1, pos_p0;
  111|  68.7k|    WORD32 pos_q0, pos_q1, pos_q2,pos_q3;
  112|  68.7k|    UWORD8 a_p, a_q; /* threshold variables */
  113|  68.7k|    WORD32 blk_strd = src_strd << 2; /* block_increment = src_strd * 4 */
  114|  68.7k|    UWORD8 *pu1_src_temp;
  115|  68.7k|    WORD8 i = 0, edge;
  116|       |
  117|  68.7k|    pos_q0 = 0;
  118|  68.7k|    pos_q1 = 1;
  119|  68.7k|    pos_q2 = 2;
  120|  68.7k|    pos_q3 = 3;
  121|  68.7k|    pos_p0 = -1;
  122|  68.7k|    pos_p1 = -2;
  123|  68.7k|    pos_p2 = -3;
  124|  68.7k|    pos_p3 = -4;
  125|       |
  126|   343k|    for(edge = 0; edge < 4; edge++, pu1_src += blk_strd)
  ------------------
  |  Branch (126:19): [True: 274k, False: 68.7k]
  ------------------
  127|   274k|    {
  128|   274k|        pu1_src_temp = pu1_src;
  129|  1.37M|        for(i = 0; i < 4; ++i, pu1_src_temp += src_strd)
  ------------------
  |  Branch (129:20): [True: 1.09M, False: 274k]
  ------------------
  130|  1.09M|        {
  131|  1.09M|            q0 = pu1_src_temp[pos_q0];
  132|  1.09M|            q1 = pu1_src_temp[pos_q1];
  133|  1.09M|            p0 = pu1_src_temp[pos_p0];
  134|  1.09M|            p1 = pu1_src_temp[pos_p1];
  135|       |
  136|       |            /* Filter Decision */
  137|  1.09M|            if((ABS(p0 - q0) >= alpha) ||
  ------------------
  |  |  100|  1.09M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 295k, False: 803k]
  |  |  ------------------
  ------------------
  |  Branch (137:16): [True: 328k, False: 771k]
  ------------------
  138|   771k|               (ABS(q1 - q0) >= beta)  ||
  ------------------
  |  |  100|   771k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 122k, False: 649k]
  |  |  ------------------
  ------------------
  |  Branch (138:16): [True: 84.5k, False: 686k]
  ------------------
  139|   686k|               (ABS(p1 - p0) >= beta))
  ------------------
  |  |  100|   686k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 58.2k, False: 628k]
  |  |  ------------------
  ------------------
  |  Branch (139:16): [True: 23.9k, False: 662k]
  ------------------
  140|   436k|                continue;
  141|       |
  142|   662k|            p2 = pu1_src_temp[pos_p2];
  143|   662k|            p3 = pu1_src_temp[pos_p3];
  144|   662k|            q2 = pu1_src_temp[pos_q2];
  145|   662k|            q3 = pu1_src_temp[pos_q3];
  146|       |
  147|   662k|            if(ABS(p0 - q0) < ((alpha >> 2) + 2))
  ------------------
  |  |  100|   662k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 154k, False: 508k]
  |  |  ------------------
  ------------------
  |  Branch (147:16): [True: 626k, False: 36.2k]
  ------------------
  148|   626k|            {
  149|       |                /* Threshold Variables */
  150|   626k|                a_p = (UWORD8)ABS(p2 - p0);
  ------------------
  |  |  100|   626k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 76.4k, False: 550k]
  |  |  ------------------
  ------------------
  151|   626k|                a_q = (UWORD8)ABS(q2 - q0);
  ------------------
  |  |  100|   626k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 72.1k, False: 554k]
  |  |  ------------------
  ------------------
  152|       |
  153|   626k|                if(a_p < beta)
  ------------------
  |  Branch (153:20): [True: 620k, False: 6.18k]
  ------------------
  154|   620k|                {
  155|       |                    /* p0', p1', p2' */
  156|   620k|                    pu1_src_temp[pos_p0] = ((p2 + X2(p1) + X2(p0) + X2(q0) + q1
  ------------------
  |  |   91|   620k|#define X2(a)   ((a) << 1)
  ------------------
                                  pu1_src_temp[pos_p0] = ((p2 + X2(p1) + X2(p0) + X2(q0) + q1
  ------------------
  |  |   91|   620k|#define X2(a)   ((a) << 1)
  ------------------
                                  pu1_src_temp[pos_p0] = ((p2 + X2(p1) + X2(p0) + X2(q0) + q1
  ------------------
  |  |   91|   620k|#define X2(a)   ((a) << 1)
  ------------------
  157|   620k|                                    + 4) >> 3);
  158|   620k|                    pu1_src_temp[pos_p1] = ((p2 + p1 + p0 + q0 + 2) >> 2);
  159|   620k|                    pu1_src_temp[pos_p2] =
  160|   620k|                                    ((X2(p3) + X3(p2) + p1 + p0 + q0
  ------------------
  |  |   91|   620k|#define X2(a)   ((a) << 1)
  ------------------
                                                  ((X2(p3) + X3(p2) + p1 + p0 + q0
  ------------------
  |  |   92|   620k|#define X3(a)   (((a) << 1) + (a))
  ------------------
  161|   620k|                                                    + 4) >> 3);
  162|   620k|                }
  163|  6.18k|                else
  164|  6.18k|                {
  165|       |                    /* p0'*/
  166|  6.18k|                    pu1_src_temp[pos_p0] = ((X2(p1) + p0 + q1 + 2) >> 2);
  ------------------
  |  |   91|  6.18k|#define X2(a)   ((a) << 1)
  ------------------
  167|  6.18k|                }
  168|       |
  169|   626k|                if(a_q < beta)
  ------------------
  |  Branch (169:20): [True: 619k, False: 7.67k]
  ------------------
  170|   619k|                {
  171|       |                    /* q0', q1', q2' */
  172|   619k|                    pu1_src_temp[pos_q0] = (p1 + X2(p0) + X2(q0) + X2(q1) + q2
  ------------------
  |  |   91|   619k|#define X2(a)   ((a) << 1)
  ------------------
                                  pu1_src_temp[pos_q0] = (p1 + X2(p0) + X2(q0) + X2(q1) + q2
  ------------------
  |  |   91|   619k|#define X2(a)   ((a) << 1)
  ------------------
                                  pu1_src_temp[pos_q0] = (p1 + X2(p0) + X2(q0) + X2(q1) + q2
  ------------------
  |  |   91|   619k|#define X2(a)   ((a) << 1)
  ------------------
  173|   619k|                                    + 4) >> 3;
  174|   619k|                    pu1_src_temp[pos_q1] = (p0 + q0 + q1 + q2 + 2) >> 2;
  175|   619k|                    pu1_src_temp[pos_q2] = (X2(q3) + X3(q2) + q1 + q0 + p0 + 4)
  ------------------
  |  |   91|   619k|#define X2(a)   ((a) << 1)
  ------------------
                                  pu1_src_temp[pos_q2] = (X2(q3) + X3(q2) + q1 + q0 + p0 + 4)
  ------------------
  |  |   92|   619k|#define X3(a)   (((a) << 1) + (a))
  ------------------
  176|   619k|                                    >> 3;
  177|   619k|                }
  178|  7.67k|                else
  179|  7.67k|                {
  180|       |                    /* q0'*/
  181|  7.67k|                    pu1_src_temp[pos_q0] = (X2(q1) + q0 + p1 + 2) >> 2;
  ------------------
  |  |   91|  7.67k|#define X2(a)   ((a) << 1)
  ------------------
  182|  7.67k|                }
  183|   626k|            }
  184|  36.2k|            else
  185|  36.2k|            {
  186|       |                /* p0', q0'*/
  187|  36.2k|                pu1_src_temp[pos_p0] = ((X2(p1) + p0 + q1 + 2) >> 2);
  ------------------
  |  |   91|  36.2k|#define X2(a)   ((a) << 1)
  ------------------
  188|  36.2k|                pu1_src_temp[pos_q0] = (X2(q1) + q0 + p1 + 2) >> 2;
  ------------------
  |  |   91|  36.2k|#define X2(a)   ((a) << 1)
  ------------------
  189|  36.2k|            }
  190|   662k|        }
  191|   274k|    }
  192|  68.7k|}
ih264_deblk_luma_horz_bs4:
  226|  77.1k|{
  227|  77.1k|    UWORD8 p3, p2, p1, p0, q0, q1, q2, q3;
  228|  77.1k|    WORD32 pos_p3, pos_p2, pos_p1, pos_p0, pos_q0, pos_q1,
  229|  77.1k|                    pos_q2, pos_q3;
  230|  77.1k|    UWORD8 a_p, a_q; /* threshold variables */
  231|  77.1k|    UWORD8 *pu1_p3; /* pointer to the src sample p3 */
  232|  77.1k|    UWORD8 *pu1_p3_temp;
  233|  77.1k|    UWORD8 *pu1_src_temp;
  234|  77.1k|    WORD8 i = 0, edge;
  235|       |
  236|  77.1k|    pu1_p3 = pu1_src - (src_strd << 2);
  237|  77.1k|    pos_q0 = 0;
  238|  77.1k|    pos_q1 = src_strd;
  239|  77.1k|    pos_q2 = X2(src_strd);
  ------------------
  |  |   91|  77.1k|#define X2(a)   ((a) << 1)
  ------------------
  240|  77.1k|    pos_q3 = X3(src_strd);
  ------------------
  |  |   92|  77.1k|#define X3(a)   (((a) << 1) + (a))
  ------------------
  241|  77.1k|    pos_p0 = X3(src_strd);
  ------------------
  |  |   92|  77.1k|#define X3(a)   (((a) << 1) + (a))
  ------------------
  242|  77.1k|    pos_p1 = X2(src_strd);
  ------------------
  |  |   91|  77.1k|#define X2(a)   ((a) << 1)
  ------------------
  243|  77.1k|    pos_p2 = src_strd;
  244|  77.1k|    pos_p3 = 0;
  245|       |
  246|   385k|    for(edge = 0; edge < 4; edge++, pu1_src += 4, pu1_p3 += 4)
  ------------------
  |  Branch (246:19): [True: 308k, False: 77.1k]
  ------------------
  247|   308k|    {
  248|   308k|        pu1_src_temp = pu1_src;
  249|   308k|        pu1_p3_temp = pu1_p3;
  250|  1.54M|        for(i = 0; i < 4; ++i, pu1_src_temp++, pu1_p3_temp++)
  ------------------
  |  Branch (250:20): [True: 1.23M, False: 308k]
  ------------------
  251|  1.23M|        {
  252|  1.23M|            q0 = pu1_src_temp[pos_q0];
  253|  1.23M|            q1 = pu1_src_temp[pos_q1];
  254|  1.23M|            p0 = pu1_p3_temp[pos_p0];
  255|  1.23M|            p1 = pu1_p3_temp[pos_p1];
  256|       |
  257|       |            /* Filter Decision */
  258|  1.23M|            if((ABS(p0 - q0) >= alpha) ||
  ------------------
  |  |  100|  1.23M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 305k, False: 929k]
  |  |  ------------------
  ------------------
  |  Branch (258:16): [True: 361k, False: 872k]
  ------------------
  259|   872k|               (ABS(q1 - q0) >= beta) ||
  ------------------
  |  |  100|   872k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 104k, False: 767k]
  |  |  ------------------
  ------------------
  |  Branch (259:16): [True: 80.8k, False: 791k]
  ------------------
  260|   791k|               (ABS(p1 - p0) >= beta))
  ------------------
  |  |  100|   791k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 72.5k, False: 719k]
  |  |  ------------------
  ------------------
  |  Branch (260:16): [True: 17.8k, False: 773k]
  ------------------
  261|   460k|                continue;
  262|       |
  263|   773k|            p2 = pu1_p3_temp[pos_p2];
  264|   773k|            p3 = pu1_p3_temp[pos_p3];
  265|   773k|            q2 = pu1_src_temp[pos_q2];
  266|   773k|            q3 = pu1_src_temp[pos_q3];
  267|       |
  268|   773k|            if(ABS(p0 - q0) < ((alpha >> 2) + 2))
  ------------------
  |  |  100|   773k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 167k, False: 606k]
  |  |  ------------------
  ------------------
  |  Branch (268:16): [True: 725k, False: 48.4k]
  ------------------
  269|   725k|            {
  270|       |                /* Threshold Variables */
  271|   725k|                a_p = ABS(p2 - p0);
  ------------------
  |  |  100|   725k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 78.2k, False: 647k]
  |  |  ------------------
  ------------------
  272|   725k|                a_q = ABS(q2 - q0);
  ------------------
  |  |  100|   725k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 84.5k, False: 640k]
  |  |  ------------------
  ------------------
  273|       |
  274|   725k|                if((a_p < beta))
  ------------------
  |  Branch (274:20): [True: 708k, False: 17.0k]
  ------------------
  275|   708k|                {
  276|       |                    /* p0', p1', p2' */
  277|   708k|                    pu1_p3_temp[pos_p0] = (p2 + X2(p1) + X2(p0) + X2(q0) + q1
  ------------------
  |  |   91|   708k|#define X2(a)   ((a) << 1)
  ------------------
                                  pu1_p3_temp[pos_p0] = (p2 + X2(p1) + X2(p0) + X2(q0) + q1
  ------------------
  |  |   91|   708k|#define X2(a)   ((a) << 1)
  ------------------
                                  pu1_p3_temp[pos_p0] = (p2 + X2(p1) + X2(p0) + X2(q0) + q1
  ------------------
  |  |   91|   708k|#define X2(a)   ((a) << 1)
  ------------------
  278|   708k|                                    + 4) >> 3;
  279|   708k|                    pu1_p3_temp[pos_p1] = (p2 + p1 + p0 + q0 + 2) >> 2;
  280|   708k|                    pu1_p3_temp[pos_p2] =
  281|   708k|                                    (X2(p3) + X3(p2) + p1 + p0 + q0
  ------------------
  |  |   91|   708k|#define X2(a)   ((a) << 1)
  ------------------
                                                  (X2(p3) + X3(p2) + p1 + p0 + q0
  ------------------
  |  |   92|   708k|#define X3(a)   (((a) << 1) + (a))
  ------------------
  282|   708k|                                                    + 4) >> 3;
  283|   708k|                }
  284|  17.0k|                else
  285|  17.0k|                {
  286|       |                    /* p0'*/
  287|  17.0k|                    pu1_p3_temp[pos_p0] = (X2(p1) + p0 + q1 + 2) >> 2;
  ------------------
  |  |   91|  17.0k|#define X2(a)   ((a) << 1)
  ------------------
  288|  17.0k|                }
  289|       |
  290|   725k|                if(a_q < beta)
  ------------------
  |  Branch (290:20): [True: 710k, False: 15.1k]
  ------------------
  291|   710k|                {
  292|       |                    /* q0', q1', q2' */
  293|   710k|                    pu1_src_temp[pos_q0] = (p1 + X2(p0) + X2(q0) + X2(q1)
  ------------------
  |  |   91|   710k|#define X2(a)   ((a) << 1)
  ------------------
                                  pu1_src_temp[pos_q0] = (p1 + X2(p0) + X2(q0) + X2(q1)
  ------------------
  |  |   91|   710k|#define X2(a)   ((a) << 1)
  ------------------
                                  pu1_src_temp[pos_q0] = (p1 + X2(p0) + X2(q0) + X2(q1)
  ------------------
  |  |   91|   710k|#define X2(a)   ((a) << 1)
  ------------------
  294|   710k|                                    + q2 + 4) >> 3;
  295|   710k|                    pu1_src_temp[pos_q1] = (p0 + q0 + q1 + q2 + 2) >> 2;
  296|   710k|                    pu1_src_temp[pos_q2] = (X2(q3) + X3(q2) + q1 + q0 + p0
  ------------------
  |  |   91|   710k|#define X2(a)   ((a) << 1)
  ------------------
                                  pu1_src_temp[pos_q2] = (X2(q3) + X3(q2) + q1 + q0 + p0
  ------------------
  |  |   92|   710k|#define X3(a)   (((a) << 1) + (a))
  ------------------
  297|   710k|                                    + 4) >> 3;
  298|   710k|                }
  299|  15.1k|                else
  300|  15.1k|                {
  301|       |                    /* q0'*/
  302|  15.1k|                    pu1_src_temp[pos_q0] = (X2(q1) + q0 + p1 + 2) >> 2;
  ------------------
  |  |   91|  15.1k|#define X2(a)   ((a) << 1)
  ------------------
  303|  15.1k|                }
  304|   725k|            }
  305|  48.4k|            else
  306|  48.4k|            {
  307|       |                /* p0', q0'*/
  308|  48.4k|                pu1_p3_temp[pos_p0] = (X2(p1) + p0 + q1 + 2) >> 2;
  ------------------
  |  |   91|  48.4k|#define X2(a)   ((a) << 1)
  ------------------
  309|  48.4k|                pu1_src_temp[pos_q0] = (X2(q1) + q0 + p1 + 2) >> 2;
  ------------------
  |  |   91|  48.4k|#define X2(a)   ((a) << 1)
  ------------------
  310|  48.4k|            }
  311|   773k|        }
  312|   308k|    }
  313|  77.1k|}
ih264_deblk_luma_vert_bslt4:
  538|   345k|{
  539|   345k|    WORD8 i = 0, edge;
  540|   345k|    UWORD8 p2, p1, p0, q0, q1, q2;
  541|   345k|    WORD32 pos_p2, pos_p1, pos_p0, pos_q0, pos_q1, pos_q2;
  542|   345k|    UWORD8 a_p, a_q; /* threshold variables */
  543|   345k|    WORD32 blk_strd = src_strd << 2; /* block_increment = src_strd * 4 */
  544|   345k|    UWORD8 *pu1_src_temp;
  545|   345k|    WORD8 delta;
  546|   345k|    WORD8 tc;
  547|   345k|    WORD16 val;
  548|   345k|    UWORD8 tc0, u1_bs;
  549|       |
  550|   345k|    pos_q0 = 0;
  551|   345k|    pos_q1 = 1;
  552|   345k|    pos_q2 = 2;
  553|   345k|    pos_p0 = -1;
  554|   345k|    pos_p1 = -2;
  555|   345k|    pos_p2 = -3;
  556|       |
  557|  1.72M|    for(edge = 0; edge < 4; edge++, pu1_src += blk_strd)
  ------------------
  |  Branch (557:19): [True: 1.38M, False: 345k]
  ------------------
  558|  1.38M|    {
  559|  1.38M|        pu1_src_temp = pu1_src;
  560|       |        /* Filter Decision */
  561|  1.38M|        u1_bs = (UWORD8)((u4_bs >> ((3 - edge) << 3)) & 0x0ff);
  562|  1.38M|        if(!u1_bs)
  ------------------
  |  Branch (562:12): [True: 99.5k, False: 1.28M]
  ------------------
  563|  99.5k|            continue;
  564|       |        /* tc0 */
  565|  1.28M|        tc0 = pu1_cliptab[u1_bs];
  566|  6.42M|        for(i = 0; i < 4; ++i, pu1_src_temp += src_strd)
  ------------------
  |  Branch (566:20): [True: 5.13M, False: 1.28M]
  ------------------
  567|  5.13M|        {
  568|  5.13M|            q0 = pu1_src_temp[pos_q0];
  569|  5.13M|            q1 = pu1_src_temp[pos_q1];
  570|  5.13M|            p0 = pu1_src_temp[pos_p0];
  571|  5.13M|            p1 = pu1_src_temp[pos_p1];
  572|       |
  573|       |            /* Filter Decision */
  574|  5.13M|            if((ABS(p0 - q0) >= alpha) ||
  ------------------
  |  |  100|  5.13M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 626k, False: 4.51M]
  |  |  ------------------
  ------------------
  |  Branch (574:16): [True: 733k, False: 4.40M]
  ------------------
  575|  4.40M|               (ABS(q1 - q0) >= beta) ||
  ------------------
  |  |  100|  4.40M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 328k, False: 4.07M]
  |  |  ------------------
  ------------------
  |  Branch (575:16): [True: 189k, False: 4.21M]
  ------------------
  576|  4.21M|               (ABS(p1 - p0) >= beta))
  ------------------
  |  |  100|  4.21M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 324k, False: 3.88M]
  |  |  ------------------
  ------------------
  |  Branch (576:16): [True: 92.5k, False: 4.12M]
  ------------------
  577|  1.01M|                continue;
  578|       |
  579|  4.12M|            q2 = pu1_src_temp[pos_q2];
  580|  4.12M|            p2 = pu1_src_temp[pos_p2];
  581|       |
  582|  4.12M|            a_p = ABS(p2 - p0);
  ------------------
  |  |  100|  4.12M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 367k, False: 3.75M]
  |  |  ------------------
  ------------------
  583|  4.12M|            a_q = ABS(q2 - q0);
  ------------------
  |  |  100|  4.12M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 263k, False: 3.85M]
  |  |  ------------------
  ------------------
  584|       |
  585|       |            /* tc */
  586|  4.12M|            tc = tc0 + (a_p < beta) + (a_q < beta);
  587|       |
  588|  4.12M|            val = ((((q0 - p0) << 2) + (p1 - q1) + 4) >> 3);
  589|  4.12M|            delta = CLIP3(-tc, tc, val);
  ------------------
  |  |   77|  4.12M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 32.3k, False: 4.08M]
  |  |  |  Branch (77:54): [True: 42.5k, False: 4.04M]
  |  |  ------------------
  ------------------
  590|       |
  591|       |            /* p0' */
  592|  4.12M|            val = p0 + delta;
  593|  4.12M|            pu1_src_temp[pos_p0] = CLIP_U8(val);
  ------------------
  |  |   58|  4.12M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  4.12M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 2.73k, False: 4.11M]
  |  |  |  |  |  Branch (77:54): [True: 506, False: 4.11M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  594|       |            /* q0' */
  595|  4.12M|            val = q0 - delta;
  596|  4.12M|            pu1_src_temp[pos_q0] = CLIP_U8(val);
  ------------------
  |  |   58|  4.12M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  4.12M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 4.35k, False: 4.11M]
  |  |  |  |  |  Branch (77:54): [True: 498, False: 4.11M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  597|       |
  598|       |            /* Luma only */
  599|  4.12M|            if(a_p < beta)
  ------------------
  |  Branch (599:16): [True: 3.98M, False: 137k]
  ------------------
  600|  3.98M|            {
  601|       |                /* p1' */
  602|  3.98M|                val = ((p2 + ((p0 + q0 + 1) >> 1) - (p1 << 1)) >> 1);
  603|  3.98M|                pu1_src_temp[pos_p1] += CLIP3(-tc0, tc0, val);
  ------------------
  |  |   77|  3.98M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 44.4k, False: 3.93M]
  |  |  |  Branch (77:54): [True: 45.4k, False: 3.89M]
  |  |  ------------------
  ------------------
  604|  3.98M|            }
  605|       |
  606|  4.12M|            if(a_q < beta)
  ------------------
  |  Branch (606:16): [True: 4.01M, False: 102k]
  ------------------
  607|  4.01M|            {
  608|       |                /* q1' */
  609|  4.01M|                val = ((q2 + ((p0 + q0 + 1) >> 1) - (q1 << 1)) >> 1);
  610|  4.01M|                pu1_src_temp[pos_q1] += CLIP3(-tc0, tc0, val);
  ------------------
  |  |   77|  4.01M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 50.4k, False: 3.96M]
  |  |  |  Branch (77:54): [True: 44.9k, False: 3.92M]
  |  |  ------------------
  ------------------
  611|  4.01M|            }
  612|  4.12M|        }
  613|  1.28M|    }
  614|   345k|}
ih264_deblk_luma_horz_bslt4:
  772|   345k|{
  773|   345k|    UWORD8 p2, p1, p0, q0, q1, q2;
  774|   345k|    WORD32 pos_p2, pos_p1, pos_p0, pos_q0, pos_q1, pos_q2;
  775|   345k|    UWORD8 a_p, a_q; /* Threshold variables */
  776|   345k|    UWORD8 *pu1_p2; /* Pointer to the src sample p2 */
  777|   345k|    UWORD8 *pu1_p2_temp;
  778|   345k|    UWORD8 *pu1_src_temp;
  779|   345k|    WORD8 i = 0, edge;
  780|   345k|    WORD8 delta;
  781|   345k|    WORD8 tc;
  782|   345k|    WORD16 val;
  783|   345k|    UWORD8 tc0, u1_bs;
  784|       |
  785|   345k|    pu1_p2 = pu1_src - (src_strd << 2);
  786|   345k|    pos_q0 = 0;
  787|   345k|    pos_q1 = src_strd;
  788|   345k|    pos_q2 = X2(src_strd);
  ------------------
  |  |   91|   345k|#define X2(a)   ((a) << 1)
  ------------------
  789|   345k|    pos_p0 = X3(src_strd);
  ------------------
  |  |   92|   345k|#define X3(a)   (((a) << 1) + (a))
  ------------------
  790|   345k|    pos_p1 = X2(src_strd);
  ------------------
  |  |   91|   345k|#define X2(a)   ((a) << 1)
  ------------------
  791|   345k|    pos_p2 = src_strd;
  792|       |
  793|  1.72M|    for(edge = 0; edge < 4; edge++, pu1_src += 4, pu1_p2 += 4)
  ------------------
  |  Branch (793:19): [True: 1.38M, False: 345k]
  ------------------
  794|  1.38M|    {
  795|  1.38M|        pu1_src_temp = pu1_src;
  796|  1.38M|        pu1_p2_temp = pu1_p2;
  797|       |
  798|       |        /* Filter Decision */
  799|  1.38M|        u1_bs = (UWORD8)((u4_bs >> ((3 - edge) << 3)) & 0x0ff);
  800|  1.38M|        if(!u1_bs)
  ------------------
  |  Branch (800:12): [True: 104k, False: 1.27M]
  ------------------
  801|   104k|            continue;
  802|       |        /* tc0 */
  803|  1.27M|        tc0 = pu1_cliptab[u1_bs];
  804|       |
  805|  6.39M|        for(i = 0; i < 4; ++i, pu1_src_temp++, pu1_p2_temp++)
  ------------------
  |  Branch (805:20): [True: 5.11M, False: 1.27M]
  ------------------
  806|  5.11M|        {
  807|  5.11M|            q0 = pu1_src_temp[pos_q0];
  808|  5.11M|            q1 = pu1_src_temp[pos_q1];
  809|  5.11M|            p0 = pu1_p2_temp[pos_p0];
  810|  5.11M|            p1 = pu1_p2_temp[pos_p1];
  811|       |
  812|       |            /* Filter Decision */
  813|  5.11M|            if((ABS(p0 - q0) >= alpha) ||
  ------------------
  |  |  100|  5.11M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 633k, False: 4.48M]
  |  |  ------------------
  ------------------
  |  Branch (813:16): [True: 731k, False: 4.38M]
  ------------------
  814|  4.38M|               (ABS(q1 - q0) >= beta) ||
  ------------------
  |  |  100|  4.38M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 503k, False: 3.88M]
  |  |  ------------------
  ------------------
  |  Branch (814:16): [True: 176k, False: 4.20M]
  ------------------
  815|  4.20M|               (ABS(p1 - p0) >= beta))
  ------------------
  |  |  100|  4.20M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 387k, False: 3.81M]
  |  |  ------------------
  ------------------
  |  Branch (815:16): [True: 126k, False: 4.08M]
  ------------------
  816|  1.03M|                continue;
  817|       |
  818|  4.08M|            q2 = pu1_src_temp[pos_q2];
  819|  4.08M|            p2 = pu1_p2_temp[pos_p2];
  820|       |
  821|  4.08M|            a_p = ABS(p2 - p0);
  ------------------
  |  |  100|  4.08M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 428k, False: 3.65M]
  |  |  ------------------
  ------------------
  822|  4.08M|            a_q = ABS(q2 - q0);
  ------------------
  |  |  100|  4.08M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 475k, False: 3.60M]
  |  |  ------------------
  ------------------
  823|       |
  824|       |            /* tc */
  825|  4.08M|            tc = tc0 + (a_p < beta) + (a_q < beta);
  826|  4.08M|            val = ((((q0 - p0) << 2) + (p1 - q1) + 4) >> 3);
  827|  4.08M|            delta = CLIP3(-tc, tc, val);
  ------------------
  |  |   77|  4.08M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 37.7k, False: 4.04M]
  |  |  |  Branch (77:54): [True: 28.6k, False: 4.01M]
  |  |  ------------------
  ------------------
  828|       |            /* p0' */
  829|  4.08M|            val = p0 + delta;
  830|  4.08M|            pu1_p2_temp[pos_p0] = CLIP_U8(val);
  ------------------
  |  |   58|  4.08M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  4.08M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 2.39k, False: 4.07M]
  |  |  |  |  |  Branch (77:54): [True: 409, False: 4.07M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  831|       |            /* q0' */
  832|  4.08M|            val = q0 - delta;
  833|  4.08M|            pu1_src_temp[pos_q0] = CLIP_U8(val);
  ------------------
  |  |   58|  4.08M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  4.08M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 4.62k, False: 4.07M]
  |  |  |  |  |  Branch (77:54): [True: 749, False: 4.07M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  834|       |
  835|       |            /* Luma */
  836|  4.08M|            if(a_p < beta)
  ------------------
  |  Branch (836:16): [True: 3.92M, False: 159k]
  ------------------
  837|  3.92M|            {
  838|       |                /* p1' */
  839|  3.92M|                val = ((p2 + ((p0 + q0 + 1) >> 1) - (p1 << 1)) >> 1);
  840|  3.92M|                pu1_p2_temp[pos_p1] += CLIP3(-tc0, tc0, val);
  ------------------
  |  |   77|  3.92M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 50.1k, False: 3.87M]
  |  |  |  Branch (77:54): [True: 35.4k, False: 3.83M]
  |  |  ------------------
  ------------------
  841|  3.92M|            }
  842|       |
  843|  4.08M|            if(a_q < beta)
  ------------------
  |  Branch (843:16): [True: 3.90M, False: 179k]
  ------------------
  844|  3.90M|            {
  845|       |                /* q1' */
  846|  3.90M|                val = ((q2 + ((p0 + q0 + 1) >> 1) - (q1 << 1)) >> 1);
  847|  3.90M|                pu1_src_temp[pos_q1] += CLIP3(-tc0, tc0, val);
  ------------------
  |  |   77|  3.90M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 51.5k, False: 3.85M]
  |  |  |  Branch (77:54): [True: 42.2k, False: 3.80M]
  |  |  ------------------
  ------------------
  848|  3.90M|            }
  849|  4.08M|        }
  850|  1.27M|    }
  851|   345k|}
ih264_deblk_chroma_vert_bs4:
 1456|  68.7k|{
 1457|  68.7k|    UWORD8 *pu1_src_u = pu1_src; /* Pointer to the src sample q0 of U */
 1458|  68.7k|    UWORD8 *pu1_src_v = pu1_src + 1; /* Pointer to the src sample q0 of V */
 1459|  68.7k|    UWORD8 p1_u, p0_u, q0_u, q1_u, p1_v, p0_v, q0_v, q1_v;
 1460|  68.7k|    WORD32 blk_strd = src_strd << 1; /* block_increment = src_strd * 2*/
 1461|  68.7k|    WORD32 pos_p1, pos_p0, pos_q0, pos_q1;
 1462|  68.7k|    UWORD8 *pu1_src_temp_u, *pu1_src_temp_v;
 1463|  68.7k|    WORD8 i = 0, edge;
 1464|       |
 1465|  68.7k|    pos_q0 = 0;
 1466|  68.7k|    pos_q1 = 2;
 1467|  68.7k|    pos_p0 = -2;
 1468|  68.7k|    pos_p1 = -4;
 1469|       |
 1470|   343k|    for(edge = 0; edge < 4;
  ------------------
  |  Branch (1470:19): [True: 274k, False: 68.7k]
  ------------------
 1471|   274k|                    edge++, pu1_src_u += blk_strd, pu1_src_v += blk_strd)
 1472|   274k|    {
 1473|   274k|        pu1_src_temp_u = pu1_src_u;
 1474|   274k|        pu1_src_temp_v = pu1_src_v;
 1475|   824k|        for(i = 0; i < 2; ++i, pu1_src_temp_u += src_strd, pu1_src_temp_v +=
  ------------------
  |  Branch (1475:20): [True: 549k, False: 274k]
  ------------------
 1476|   549k|                        src_strd)
 1477|   549k|        {
 1478|   549k|            q0_u = pu1_src_temp_u[pos_q0];
 1479|   549k|            q1_u = pu1_src_temp_u[pos_q1];
 1480|   549k|            p0_u = pu1_src_temp_u[pos_p0];
 1481|   549k|            p1_u = pu1_src_temp_u[pos_p1];
 1482|   549k|            q0_v = pu1_src_temp_v[pos_q0];
 1483|   549k|            q1_v = pu1_src_temp_v[pos_q1];
 1484|   549k|            p0_v = pu1_src_temp_v[pos_p0];
 1485|   549k|            p1_v = pu1_src_temp_v[pos_p1];
 1486|       |
 1487|       |            /* Filter Decision */
 1488|   549k|            if((ABS(p0_u - q0_u) < alpha_cb) &&
  ------------------
  |  |  100|   549k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 50.4k, False: 499k]
  |  |  ------------------
  ------------------
  |  Branch (1488:16): [True: 464k, False: 85.2k]
  ------------------
 1489|   464k|               (ABS(q1_u - q0_u) < beta_cb) &&
  ------------------
  |  |  100|   464k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 23.3k, False: 441k]
  |  |  ------------------
  ------------------
  |  Branch (1489:16): [True: 459k, False: 5.21k]
  ------------------
 1490|   459k|               (ABS(p1_u - p0_u) < beta_cb))
  ------------------
  |  |  100|   459k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 10.0k, False: 449k]
  |  |  ------------------
  ------------------
  |  Branch (1490:16): [True: 455k, False: 3.77k]
  ------------------
 1491|   455k|            {
 1492|       |                /* p0' */
 1493|   455k|                pu1_src_temp_u[pos_p0] = ((X2(p1_u) + p0_u + q1_u + 2) >> 2);
  ------------------
  |  |   91|   455k|#define X2(a)   ((a) << 1)
  ------------------
 1494|       |                /* q0' */
 1495|   455k|                pu1_src_temp_u[pos_q0] = (X2(q1_u) + q0_u + p1_u + 2) >> 2;
  ------------------
  |  |   91|   455k|#define X2(a)   ((a) << 1)
  ------------------
 1496|   455k|            }
 1497|       |
 1498|       |            /* Filter Decision */
 1499|   549k|            if((ABS(p0_v - q0_v) < alpha_cr) &&
  ------------------
  |  |  100|   549k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 37.6k, False: 512k]
  |  |  ------------------
  ------------------
  |  Branch (1499:16): [True: 463k, False: 86.3k]
  ------------------
 1500|   463k|               (ABS(q1_v - q0_v) < beta_cr) &&
  ------------------
  |  |  100|   463k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 5.82k, False: 457k]
  |  |  ------------------
  ------------------
  |  Branch (1500:16): [True: 459k, False: 4.14k]
  ------------------
 1501|   459k|               (ABS(p1_v - p0_v) < beta_cr))
  ------------------
  |  |  100|   459k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 6.62k, False: 452k]
  |  |  ------------------
  ------------------
  |  Branch (1501:16): [True: 455k, False: 3.91k]
  ------------------
 1502|   455k|            {
 1503|       |                /* p0' */
 1504|   455k|                pu1_src_temp_v[pos_p0] = ((X2(p1_v) + p0_v + q1_v + 2) >> 2);
  ------------------
  |  |   91|   455k|#define X2(a)   ((a) << 1)
  ------------------
 1505|       |                /* q0' */
 1506|   455k|                pu1_src_temp_v[pos_q0] = (X2(q1_v) + q0_v + p1_v + 2) >> 2;
  ------------------
  |  |   91|   455k|#define X2(a)   ((a) << 1)
  ------------------
 1507|   455k|            }
 1508|   549k|        }
 1509|   274k|    }
 1510|  68.7k|}
ih264_deblk_chroma_horz_bs4:
 1552|  77.1k|{
 1553|  77.1k|    UWORD8 *pu1_src_u = pu1_src; /* Pointer to the src sample q0 of U */
 1554|  77.1k|    UWORD8 *pu1_src_v = pu1_src + 1; /* Pointer to the src sample q0 of V */
 1555|  77.1k|    UWORD8 p1_u, p0_u, q0_u, q1_u, p1_v, p0_v, q0_v, q1_v;
 1556|  77.1k|    WORD32 pos_p1, pos_p0, pos_q0, pos_q1;
 1557|  77.1k|    UWORD8 *pu1_src_temp_u, *pu1_src_temp_v;
 1558|  77.1k|    UWORD8 *pu1_p1_u; /* Pointer to the src sample p1 of U */
 1559|  77.1k|    UWORD8 *pu1_p1_v; /* Pointer to the src sample p1 of U */
 1560|  77.1k|    UWORD8 *pu1_p1_temp_u, *pu1_p1_temp_v;
 1561|  77.1k|    WORD8 i = 0, edge;
 1562|       |
 1563|  77.1k|    pu1_p1_u = pu1_src_u - (src_strd << 1);
 1564|  77.1k|    pu1_p1_v = pu1_src_v - (src_strd << 1);
 1565|  77.1k|    pos_q0 = 0;
 1566|  77.1k|    pos_q1 = src_strd;
 1567|  77.1k|    pos_p0 = src_strd;
 1568|  77.1k|    pos_p1 = 0;
 1569|       |
 1570|   385k|    for(edge = 0; edge < 4; edge++, pu1_src_u += 4, pu1_p1_u += 4, pu1_src_v +=
  ------------------
  |  Branch (1570:19): [True: 308k, False: 77.1k]
  ------------------
 1571|   308k|                    4, pu1_p1_v += 4)
 1572|   308k|    {
 1573|   308k|        pu1_src_temp_u = pu1_src_u;
 1574|   308k|        pu1_p1_temp_u = pu1_p1_u;
 1575|   308k|        pu1_src_temp_v = pu1_src_v;
 1576|   308k|        pu1_p1_temp_v = pu1_p1_v;
 1577|   925k|        for(i = 0; i < 2; ++i, pu1_src_temp_u += 2, pu1_p1_temp_u += 2,
  ------------------
  |  Branch (1577:20): [True: 617k, False: 308k]
  ------------------
 1578|   617k|                       pu1_src_temp_v += 2, pu1_p1_temp_v += 2)
 1579|   617k|        {
 1580|   617k|            q0_u = pu1_src_temp_u[pos_q0];
 1581|   617k|            q1_u = pu1_src_temp_u[pos_q1];
 1582|   617k|            p0_u = pu1_p1_temp_u[pos_p0];
 1583|   617k|            p1_u = pu1_p1_temp_u[pos_p1];
 1584|       |
 1585|   617k|            q0_v = pu1_src_temp_v[pos_q0];
 1586|   617k|            q1_v = pu1_src_temp_v[pos_q1];
 1587|   617k|            p0_v = pu1_p1_temp_v[pos_p0];
 1588|   617k|            p1_v = pu1_p1_temp_v[pos_p1];
 1589|       |
 1590|       |            /* Filter Decision */
 1591|   617k|            if(ABS(p0_u - q0_u) < alpha_cb && ABS(q1_u - q0_u) < beta_cb
  ------------------
  |  |  100|   617k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 68.6k, False: 548k]
  |  |  ------------------
  ------------------
                          if(ABS(p0_u - q0_u) < alpha_cb && ABS(q1_u - q0_u) < beta_cb
  ------------------
  |  |  100|   497k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 23.5k, False: 474k]
  |  |  ------------------
  ------------------
  |  Branch (1591:16): [True: 497k, False: 119k]
  |  Branch (1591:47): [True: 485k, False: 12.6k]
  ------------------
 1592|   485k|                            && ABS(p1_u - p0_u) < beta_cb)
  ------------------
  |  |  100|   485k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 12.0k, False: 472k]
  |  |  ------------------
  ------------------
  |  Branch (1592:32): [True: 482k, False: 2.93k]
  ------------------
 1593|   482k|            {
 1594|       |                /* p0' */
 1595|   482k|                pu1_p1_temp_u[pos_p0] = (X2(p1_u) + p0_u + q1_u + 2) >> 2;
  ------------------
  |  |   91|   482k|#define X2(a)   ((a) << 1)
  ------------------
 1596|       |                /* q0' */
 1597|   482k|                pu1_src_temp_u[pos_q0] = (X2(q1_u) + q0_u + p1_u + 2) >> 2;
  ------------------
  |  |   91|   482k|#define X2(a)   ((a) << 1)
  ------------------
 1598|   482k|            }
 1599|       |
 1600|       |            /* Filter Decision */
 1601|   617k|            if(ABS(p0_v - q0_v) < alpha_cr && ABS(q1_v - q0_v) < beta_cr
  ------------------
  |  |  100|   617k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 55.0k, False: 562k]
  |  |  ------------------
  ------------------
                          if(ABS(p0_v - q0_v) < alpha_cr && ABS(q1_v - q0_v) < beta_cr
  ------------------
  |  |  100|   496k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 45.3k, False: 450k]
  |  |  ------------------
  ------------------
  |  Branch (1601:16): [True: 496k, False: 121k]
  |  Branch (1601:47): [True: 482k, False: 13.8k]
  ------------------
 1602|   482k|                            && ABS(p1_v - p0_v) < beta_cr)
  ------------------
  |  |  100|   482k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 5.49k, False: 476k]
  |  |  ------------------
  ------------------
  |  Branch (1602:32): [True: 479k, False: 2.32k]
  ------------------
 1603|   479k|            {
 1604|       |                /* p0' */
 1605|   479k|                pu1_p1_temp_v[pos_p0] = (X2(p1_v) + p0_v + q1_v + 2) >> 2;
  ------------------
  |  |   91|   479k|#define X2(a)   ((a) << 1)
  ------------------
 1606|       |                /* q0' */
 1607|   479k|                pu1_src_temp_v[pos_q0] = (X2(q1_v) + q0_v + p1_v + 2) >> 2;
  ------------------
  |  |   91|   479k|#define X2(a)   ((a) << 1)
  ------------------
 1608|   479k|            }
 1609|   617k|        }
 1610|   308k|    }
 1611|  77.1k|}
ih264_deblk_chroma_vert_bslt4:
 1665|   186k|{
 1666|   186k|    UWORD8 *pu1_src_u = pu1_src; /* Pointer to the src sample q0 of plane U*/
 1667|   186k|    UWORD8 *pu1_src_v = pu1_src + 1; /* Pointer to the src sample q0 of plane V*/
 1668|   186k|    UWORD8 p1_u, p0_u, q0_u, q1_u, p1_v, p0_v, q0_v, q1_v;
 1669|   186k|    WORD32 blk_strd = src_strd << 1; /* block_increment = src_strd * 2 */
 1670|   186k|    WORD32 pos_p1, pos_p0, pos_q0, pos_q1;
 1671|   186k|    UWORD8 *pu1_src_temp_u, *pu1_src_temp_v;
 1672|   186k|    WORD8 i = 0, edge;
 1673|   186k|    WORD8 delta;
 1674|   186k|    WORD8 tcb, tcr;
 1675|   186k|    WORD16 val;
 1676|   186k|    UWORD8 tcb0, tcr0, u1_bs;
 1677|       |
 1678|   186k|    pos_q0 = 0;
 1679|   186k|    pos_q1 = 2;
 1680|   186k|    pos_p0 = -2;
 1681|   186k|    pos_p1 = -4;
 1682|       |
 1683|   933k|    for(edge = 0; edge < 4;
  ------------------
  |  Branch (1683:19): [True: 747k, False: 186k]
  ------------------
 1684|   747k|                    edge++, pu1_src_u += blk_strd, pu1_src_v += blk_strd)
 1685|   747k|    {
 1686|   747k|        pu1_src_temp_u = pu1_src_u;
 1687|   747k|        pu1_src_temp_v = pu1_src_v;
 1688|       |        /* Filter Decision */
 1689|   747k|        u1_bs = (UWORD8)((u4_bs >> ((3 - edge) << 3)) & 0x0ff);
 1690|   747k|        if(!u1_bs)
  ------------------
  |  Branch (1690:12): [True: 54.5k, False: 692k]
  ------------------
 1691|  54.5k|            continue;
 1692|       |        /* tc0 */
 1693|   692k|        tcb0 = pu1_cliptab_cb[u1_bs];
 1694|   692k|        tcr0 = pu1_cliptab_cr[u1_bs];
 1695|   692k|        tcb = tcb0 + 1;
 1696|   692k|        tcr = tcr0 + 1;
 1697|  2.07M|        for(i = 0; i < 2; ++i, pu1_src_temp_u += src_strd, pu1_src_temp_v +=
  ------------------
  |  Branch (1697:20): [True: 1.38M, False: 692k]
  ------------------
 1698|  1.38M|                        src_strd)
 1699|  1.38M|        {
 1700|  1.38M|            q0_u = pu1_src_temp_u[pos_q0];
 1701|  1.38M|            q1_u = pu1_src_temp_u[pos_q1];
 1702|  1.38M|            p0_u = pu1_src_temp_u[pos_p0];
 1703|  1.38M|            p1_u = pu1_src_temp_u[pos_p1];
 1704|       |
 1705|  1.38M|            q0_v = pu1_src_temp_v[pos_q0];
 1706|  1.38M|            q1_v = pu1_src_temp_v[pos_q1];
 1707|  1.38M|            p0_v = pu1_src_temp_v[pos_p0];
 1708|  1.38M|            p1_v = pu1_src_temp_v[pos_p1];
 1709|       |
 1710|       |            /* Filter Decision */
 1711|  1.38M|            if(ABS(p0_u - q0_u) < alpha_cb && ABS(q1_u - q0_u) < beta_cb
  ------------------
  |  |  100|  1.38M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 132k, False: 1.25M]
  |  |  ------------------
  ------------------
                          if(ABS(p0_u - q0_u) < alpha_cb && ABS(q1_u - q0_u) < beta_cb
  ------------------
  |  |  100|  1.23M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 48.5k, False: 1.18M]
  |  |  ------------------
  ------------------
  |  Branch (1711:16): [True: 1.23M, False: 149k]
  |  Branch (1711:47): [True: 1.21M, False: 22.4k]
  ------------------
 1712|  1.21M|                            && ABS(p1_u - p0_u) < beta_cb)
  ------------------
  |  |  100|  1.21M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 35.9k, False: 1.17M]
  |  |  ------------------
  ------------------
  |  Branch (1712:32): [True: 1.20M, False: 5.07k]
  ------------------
 1713|  1.20M|            {
 1714|  1.20M|                val = ((((q0_u - p0_u) << 2) + (p1_u - q1_u) + 4) >> 3);
 1715|  1.20M|                delta = CLIP3(-tcb, tcb, val);
  ------------------
  |  |   77|  1.20M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 9.93k, False: 1.19M]
  |  |  |  Branch (77:54): [True: 9.76k, False: 1.18M]
  |  |  ------------------
  ------------------
 1716|       |                /* p0' */
 1717|  1.20M|                val = p0_u + delta;
 1718|  1.20M|                pu1_src_temp_u[pos_p0] = CLIP_U8(val);
  ------------------
  |  |   58|  1.20M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  1.20M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 966, False: 1.20M]
  |  |  |  |  |  Branch (77:54): [True: 432, False: 1.20M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1719|       |                /* q0' */
 1720|  1.20M|                val = q0_u - delta;
 1721|  1.20M|                pu1_src_temp_u[pos_q0] = CLIP_U8(val);
  ------------------
  |  |   58|  1.20M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  1.20M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 420, False: 1.20M]
  |  |  |  |  |  Branch (77:54): [True: 519, False: 1.20M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1722|  1.20M|            }
 1723|       |
 1724|       |            /* Filter Decision */
 1725|  1.38M|            if(ABS(p0_v - q0_v) < alpha_cr && ABS(q1_v - q0_v) < beta_cr
  ------------------
  |  |  100|  1.38M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 104k, False: 1.28M]
  |  |  ------------------
  ------------------
                          if(ABS(p0_v - q0_v) < alpha_cr && ABS(q1_v - q0_v) < beta_cr
  ------------------
  |  |  100|  1.25M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 41.2k, False: 1.20M]
  |  |  ------------------
  ------------------
  |  Branch (1725:16): [True: 1.25M, False: 134k]
  |  Branch (1725:47): [True: 1.23M, False: 17.3k]
  ------------------
 1726|  1.23M|                            && ABS(p1_v - p0_v) < beta_cr)
  ------------------
  |  |  100|  1.23M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 15.0k, False: 1.21M]
  |  |  ------------------
  ------------------
  |  Branch (1726:32): [True: 1.23M, False: 3.29k]
  ------------------
 1727|  1.23M|            {
 1728|  1.23M|                val = ((((q0_v - p0_v) << 2) + (p1_v - q1_v) + 4) >> 3);
 1729|  1.23M|                delta = CLIP3(-tcr, tcr, val);
  ------------------
  |  |   77|  1.23M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 3.79k, False: 1.22M]
  |  |  |  Branch (77:54): [True: 3.71k, False: 1.22M]
  |  |  ------------------
  ------------------
 1730|       |                /* p0' */
 1731|  1.23M|                val = p0_v + delta;
 1732|  1.23M|                pu1_src_temp_v[pos_p0] = CLIP_U8(val);
  ------------------
  |  |   58|  1.23M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  1.23M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 273, False: 1.22M]
  |  |  |  |  |  Branch (77:54): [True: 421, False: 1.22M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1733|       |                /* q0' */
 1734|  1.23M|                val = q0_v - delta;
 1735|  1.23M|                pu1_src_temp_v[pos_q0] = CLIP_U8(val);
  ------------------
  |  |   58|  1.23M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  1.23M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 681, False: 1.22M]
  |  |  |  |  |  Branch (77:54): [True: 347, False: 1.22M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1736|  1.23M|            }
 1737|  1.38M|        }
 1738|   692k|    }
 1739|   186k|}
ih264_deblk_chroma_horz_bslt4:
 1793|   188k|{
 1794|   188k|    UWORD8 *pu1_src_u = pu1_src; /* Pointer to the src sample q0 of plane U*/
 1795|   188k|    UWORD8 *pu1_src_v = pu1_src + 1; /* Pointer to the src sample q0 of plane V*/
 1796|   188k|    UWORD8 p1_u, p0_u, q0_u, q1_u, p1_v, p0_v, q0_v, q1_v;
 1797|   188k|    WORD32 pos_p1, pos_p0, pos_q0, pos_q1;
 1798|   188k|    UWORD8 *pu1_src_temp_u, *pu1_src_temp_v;
 1799|   188k|    UWORD8 *pu1_p1_u; /* Pointer to the src sample p1 of plane U*/
 1800|   188k|    UWORD8 *pu1_p1_v; /* Pointer to the src sample p1 of plane V*/
 1801|   188k|    UWORD8 *pu1_p1_temp_u, *pu1_p1_temp_v;
 1802|   188k|    WORD8 i = 0, edge;
 1803|   188k|    WORD8 delta;
 1804|   188k|    WORD8 tcb, tcr;
 1805|   188k|    WORD16 val;
 1806|   188k|    UWORD8 u1_bs;
 1807|   188k|    UWORD8 tcb0, tcr0;
 1808|       |
 1809|   188k|    pu1_p1_u = pu1_src_u - (src_strd << 1);
 1810|   188k|    pu1_p1_v = pu1_src_v - (src_strd << 1);
 1811|   188k|    pos_q0 = 0;
 1812|   188k|    pos_q1 = src_strd;
 1813|   188k|    pos_p0 = src_strd;
 1814|   188k|    pos_p1 = 0;
 1815|       |
 1816|   940k|    for(edge = 0; edge < 4; edge++, pu1_src_u += 4, pu1_p1_u += 4,
  ------------------
  |  Branch (1816:19): [True: 752k, False: 188k]
  ------------------
 1817|   752k|                    pu1_src_v += 4, pu1_p1_v += 4)
 1818|   752k|    {
 1819|   752k|        pu1_src_temp_u = pu1_src_u;
 1820|   752k|        pu1_p1_temp_u = pu1_p1_u;
 1821|   752k|        pu1_src_temp_v = pu1_src_v;
 1822|   752k|        pu1_p1_temp_v = pu1_p1_v;
 1823|       |
 1824|       |        /* Filter Decision */
 1825|   752k|        u1_bs = (UWORD8)((u4_bs >> ((3 - edge) << 3)) & 0x0ff);
 1826|   752k|        if(!u1_bs)
  ------------------
  |  Branch (1826:12): [True: 61.3k, False: 690k]
  ------------------
 1827|  61.3k|            continue;
 1828|       |        /* tc0 */
 1829|   690k|        tcb0 = pu1_cliptab_cb[u1_bs];
 1830|   690k|        tcr0 = pu1_cliptab_cr[u1_bs];
 1831|       |
 1832|  2.07M|        for(i = 0; i < 2; ++i, pu1_src_temp_u += 2, pu1_p1_temp_u += 2,
  ------------------
  |  Branch (1832:20): [True: 1.38M, False: 690k]
  ------------------
 1833|  1.38M|                       pu1_src_temp_v += 2, pu1_p1_temp_v += 2)
 1834|  1.38M|        {
 1835|  1.38M|            q0_u = pu1_src_temp_u[pos_q0];
 1836|  1.38M|            q1_u = pu1_src_temp_u[pos_q1];
 1837|  1.38M|            p0_u = pu1_p1_temp_u[pos_p0];
 1838|  1.38M|            p1_u = pu1_p1_temp_u[pos_p1];
 1839|       |
 1840|  1.38M|            q0_v = pu1_src_temp_v[pos_q0];
 1841|  1.38M|            q1_v = pu1_src_temp_v[pos_q1];
 1842|  1.38M|            p0_v = pu1_p1_temp_v[pos_p0];
 1843|  1.38M|            p1_v = pu1_p1_temp_v[pos_p1];
 1844|       |
 1845|       |            /* tc */
 1846|  1.38M|            tcb = tcb0 + 1;
 1847|  1.38M|            tcr = tcr0 + 1;
 1848|       |            /* Filter Decision */
 1849|  1.38M|            if(ABS(p0_u - q0_u) < alpha_cb && ABS(q1_u - q0_u) < beta_cb
  ------------------
  |  |  100|  1.38M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 114k, False: 1.26M]
  |  |  ------------------
  ------------------
                          if(ABS(p0_u - q0_u) < alpha_cb && ABS(q1_u - q0_u) < beta_cb
  ------------------
  |  |  100|  1.23M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 37.5k, False: 1.19M]
  |  |  ------------------
  ------------------
  |  Branch (1849:16): [True: 1.23M, False: 148k]
  |  Branch (1849:47): [True: 1.21M, False: 20.9k]
  ------------------
 1850|  1.21M|                            && ABS(p1_u - p0_u) < beta_cb)
  ------------------
  |  |  100|  1.21M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 31.3k, False: 1.18M]
  |  |  ------------------
  ------------------
  |  Branch (1850:32): [True: 1.20M, False: 5.04k]
  ------------------
 1851|  1.20M|            {
 1852|  1.20M|                val = ((((q0_u - p0_u) << 2) + (p1_u - q1_u) + 4) >> 3);
 1853|  1.20M|                delta = CLIP3(-tcb, tcb, val);
  ------------------
  |  |   77|  1.20M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 10.8k, False: 1.19M]
  |  |  |  Branch (77:54): [True: 7.97k, False: 1.18M]
  |  |  ------------------
  ------------------
 1854|       |                /* p0' */
 1855|  1.20M|                val = p0_u + delta;
 1856|  1.20M|                pu1_p1_temp_u[pos_p0] = CLIP_U8(val);
  ------------------
  |  |   58|  1.20M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  1.20M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 313, False: 1.20M]
  |  |  |  |  |  Branch (77:54): [True: 529, False: 1.20M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1857|       |                /* q0' */
 1858|  1.20M|                val = q0_u - delta;
 1859|  1.20M|                pu1_src_temp_u[pos_q0] = CLIP_U8(val);
  ------------------
  |  |   58|  1.20M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  1.20M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 431, False: 1.20M]
  |  |  |  |  |  Branch (77:54): [True: 831, False: 1.20M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1860|  1.20M|            }
 1861|       |            /* Filter Decision */
 1862|  1.38M|            if(ABS(p0_v - q0_v) < alpha_cr && ABS(q1_v - q0_v) < beta_cr
  ------------------
  |  |  100|  1.38M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 195k, False: 1.18M]
  |  |  ------------------
  ------------------
                          if(ABS(p0_v - q0_v) < alpha_cr && ABS(q1_v - q0_v) < beta_cr
  ------------------
  |  |  100|  1.24M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 27.1k, False: 1.21M]
  |  |  ------------------
  ------------------
  |  Branch (1862:16): [True: 1.24M, False: 138k]
  |  Branch (1862:47): [True: 1.22M, False: 14.1k]
  ------------------
 1863|  1.22M|                            && ABS(p1_v - p0_v) < beta_cr)
  ------------------
  |  |  100|  1.22M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 21.3k, False: 1.20M]
  |  |  ------------------
  ------------------
  |  Branch (1863:32): [True: 1.22M, False: 3.93k]
  ------------------
 1864|  1.22M|            {
 1865|  1.22M|                val = ((((q0_v - p0_v) << 2) + (p1_v - q1_v) + 4) >> 3);
 1866|  1.22M|                delta = CLIP3(-tcr, tcr, val);
  ------------------
  |  |   77|  1.22M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 5.00k, False: 1.21M]
  |  |  |  Branch (77:54): [True: 4.51k, False: 1.21M]
  |  |  ------------------
  ------------------
 1867|       |                /* p0' */
 1868|  1.22M|                val = p0_v + delta;
 1869|  1.22M|                pu1_p1_temp_v[pos_p0] = CLIP_U8(val);
  ------------------
  |  |   58|  1.22M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  1.22M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 273, False: 1.22M]
  |  |  |  |  |  Branch (77:54): [True: 480, False: 1.22M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1870|       |                /* q0' */
 1871|  1.22M|                val = q0_v - delta;
 1872|  1.22M|                pu1_src_temp_v[pos_q0] = CLIP_U8(val);
  ------------------
  |  |   58|  1.22M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  1.22M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 290, False: 1.22M]
  |  |  |  |  |  Branch (77:54): [True: 457, False: 1.22M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1873|  1.22M|            }
 1874|  1.38M|        }
 1875|   690k|    }
 1876|   188k|}

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

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

ih264_inter_pred_luma_copy:
  129|  2.86M|{
  130|  2.86M|    WORD32 row, col;
  131|       |
  132|  2.86M|    UNUSED(pu1_tmp);
  ------------------
  |  |   45|  2.86M|#define UNUSED(x) ((void)(x))
  ------------------
  133|  2.86M|    UNUSED(dydx);
  ------------------
  |  |   45|  2.86M|#define UNUSED(x) ((void)(x))
  ------------------
  134|  48.2M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (134:18): [True: 45.3M, False: 2.86M]
  ------------------
  135|  45.3M|    {
  136|   766M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (136:22): [True: 721M, False: 45.3M]
  ------------------
  137|   721M|        {
  138|   721M|            pu1_dst[col] = pu1_src[col];
  139|   721M|        }
  140|       |
  141|  45.3M|        pu1_src += src_strd;
  142|  45.3M|        pu1_dst += dst_strd;
  143|  45.3M|    }
  144|  2.86M|}
ih264_inter_pred_luma_horz:
  251|  83.6k|{
  252|  83.6k|    WORD32 row, col;
  253|  83.6k|    WORD16 i2_tmp;
  254|       |
  255|  83.6k|    UNUSED(pu1_tmp);
  ------------------
  |  |   45|  83.6k|#define UNUSED(x) ((void)(x))
  ------------------
  256|  83.6k|    UNUSED(dydx);
  ------------------
  |  |   45|  83.6k|#define UNUSED(x) ((void)(x))
  ------------------
  257|  1.29M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (257:18): [True: 1.20M, False: 83.6k]
  ------------------
  258|  1.20M|    {
  259|  19.5M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (259:22): [True: 18.3M, False: 1.20M]
  ------------------
  260|  18.3M|        {
  261|  18.3M|            i2_tmp = ih264_g_six_tap[0] * (pu1_src[col - 2] + pu1_src[col + 3])
  262|  18.3M|                     + ih264_g_six_tap[1] * (pu1_src[col - 1] + pu1_src[col + 2])
  263|  18.3M|                     + ih264_g_six_tap[2] * (pu1_src[col] + pu1_src[col + 1]);
  264|  18.3M|            i2_tmp = (i2_tmp + 16) >> 5;
  265|  18.3M|            pu1_dst[col] = CLIP_U8(i2_tmp);
  ------------------
  |  |   58|  18.3M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  18.3M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 9.05k, False: 18.3M]
  |  |  |  |  |  Branch (77:54): [True: 410k, False: 17.9M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  266|  18.3M|        }
  267|  1.20M|        pu1_src += src_strd;
  268|  1.20M|        pu1_dst += dst_strd;
  269|  1.20M|    }
  270|  83.6k|}
ih264_inter_pred_luma_vert:
  321|  23.5k|{
  322|  23.5k|    WORD32 row, col;
  323|  23.5k|    WORD16 i2_tmp;
  324|       |
  325|  23.5k|    UNUSED(pu1_tmp);
  ------------------
  |  |   45|  23.5k|#define UNUSED(x) ((void)(x))
  ------------------
  326|  23.5k|    UNUSED(dydx);
  ------------------
  |  |   45|  23.5k|#define UNUSED(x) ((void)(x))
  ------------------
  327|   348k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (327:18): [True: 324k, False: 23.5k]
  ------------------
  328|   324k|    {
  329|  4.75M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (329:22): [True: 4.43M, False: 324k]
  ------------------
  330|  4.43M|        {
  331|  4.43M|            i2_tmp = ih264_g_six_tap[0] * (pu1_src[col - 2 * src_strd] + pu1_src[col + 3 * src_strd])
  332|  4.43M|                     + ih264_g_six_tap[1] * (pu1_src[col - 1 * src_strd] + pu1_src[col + 2 * src_strd])
  333|  4.43M|                     + ih264_g_six_tap[2] * (pu1_src[col] + pu1_src[col + 1 * src_strd]);
  334|  4.43M|            i2_tmp = (i2_tmp + 16) >> 5;
  335|  4.43M|            pu1_dst[col] = CLIP_U8(i2_tmp);
  ------------------
  |  |   58|  4.43M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  4.43M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 6.39k, False: 4.42M]
  |  |  |  |  |  Branch (77:54): [True: 29.6k, False: 4.39M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  336|  4.43M|        }
  337|   324k|        pu1_src += src_strd;
  338|   324k|        pu1_dst += dst_strd;
  339|   324k|    }
  340|  23.5k|}
ih264_inter_pred_luma_horz_hpel_vert_hpel:
  400|  23.7k|{
  401|  23.7k|    WORD32 row, col;
  402|  23.7k|    WORD32 tmp;
  403|  23.7k|    WORD16 *pi2_pred1_temp;
  404|  23.7k|    WORD16 *pi2_pred1;
  405|       |
  406|  23.7k|    UNUSED(dydx);
  ------------------
  |  |   45|  23.7k|#define UNUSED(x) ((void)(x))
  ------------------
  407|  23.7k|    pi2_pred1_temp = (WORD16*)pu1_tmp;
  408|  23.7k|    pi2_pred1_temp += 2;
  409|  23.7k|    pi2_pred1 = pi2_pred1_temp;
  410|       |
  411|   284k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (411:18): [True: 261k, False: 23.7k]
  ------------------
  412|   261k|    {
  413|  4.89M|        for(col = -2; col < wd + 3; col++)
  ------------------
  |  Branch (413:23): [True: 4.63M, False: 261k]
  ------------------
  414|  4.63M|        {
  415|  4.63M|            tmp = ih264_g_six_tap[0] * (pu1_src[col - 2 * src_strd] + pu1_src[col + 3 * src_strd])
  416|  4.63M|                  + ih264_g_six_tap[1] * (pu1_src[col - 1 * src_strd] + pu1_src[col + 2 * src_strd])
  417|  4.63M|                  + ih264_g_six_tap[2] * (pu1_src[col] + pu1_src[col + 1 * src_strd]);
  418|  4.63M|            pi2_pred1_temp[col] = tmp;
  419|  4.63M|        }
  420|   261k|        pu1_src += src_strd;
  421|   261k|        pi2_pred1_temp = pi2_pred1_temp + wd + 5;
  422|   261k|    }
  423|       |
  424|   284k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (424:18): [True: 261k, False: 23.7k]
  ------------------
  425|   261k|    {
  426|  3.59M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (426:22): [True: 3.33M, False: 261k]
  ------------------
  427|  3.33M|        {
  428|  3.33M|            tmp = ih264_g_six_tap[0] * (pi2_pred1[col - 2] + pi2_pred1[col + 3])
  429|  3.33M|                  + ih264_g_six_tap[1] * (pi2_pred1[col - 1] + pi2_pred1[col + 2])
  430|  3.33M|                  + ih264_g_six_tap[2] * (pi2_pred1[col] + pi2_pred1[col + 1]);
  431|  3.33M|            tmp = (tmp + 512) >> 10;
  432|  3.33M|            pu1_dst[col] = CLIP_U8(tmp);
  ------------------
  |  |   58|  3.33M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  3.33M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 17.0k, False: 3.31M]
  |  |  |  |  |  Branch (77:54): [True: 5.05k, False: 3.30M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  433|  3.33M|        }
  434|   261k|        pi2_pred1 += (wd + 5);
  435|   261k|        pu1_dst += dst_strd;
  436|   261k|    }
  437|  23.7k|}
ih264_inter_pred_luma_horz_qpel:
  496|  62.6k|{
  497|  62.6k|    WORD32 row, col;
  498|  62.6k|    UWORD8 *pu1_pred1;
  499|  62.6k|    WORD32 x_offset = dydx & 0x3;
  500|  62.6k|    UNUSED(pu1_tmp);
  ------------------
  |  |   45|  62.6k|#define UNUSED(x) ((void)(x))
  ------------------
  501|  62.6k|    pu1_pred1 = pu1_src + (x_offset >> 1);
  502|       |
  503|   848k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (503:18): [True: 785k, False: 62.6k]
  ------------------
  504|   785k|    {
  505|  11.2M|        for(col = 0; col < wd; col++, pu1_src++, pu1_dst++)
  ------------------
  |  Branch (505:22): [True: 10.4M, False: 785k]
  ------------------
  506|  10.4M|        {
  507|  10.4M|            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|  10.4M|            i2_temp = pu1_src[-2] + pu1_src[3]
  512|  10.4M|                      - (pu1_src[-1] + pu1_src[2])
  513|  10.4M|                      + ((pu1_src[0] + pu1_src[1] - pu1_src[-1] - pu1_src[2]) << 2)
  514|  10.4M|                      + ((pu1_src[0] + pu1_src[1]) << 4);
  515|  10.4M|            i2_temp = (i2_temp + 16) >> 5;
  516|  10.4M|            i2_temp = CLIP_U8(i2_temp);
  ------------------
  |  |   58|  10.4M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  10.4M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 40.5k, False: 10.4M]
  |  |  |  |  |  Branch (77:54): [True: 2.08k, False: 10.4M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  517|  10.4M|            *pu1_dst = (i2_temp + *pu1_pred1 + 1) >> 1;
  518|       |
  519|  10.4M|            pu1_pred1++;
  520|  10.4M|        }
  521|   785k|        pu1_dst += dst_strd - wd;
  522|   785k|        pu1_src += src_strd - wd;
  523|   785k|        pu1_pred1 += src_strd - wd;
  524|   785k|    }
  525|  62.6k|}
ih264_inter_pred_luma_vert_qpel:
  584|  79.3k|{
  585|  79.3k|    WORD32 row, col;
  586|  79.3k|    WORD32 y_offset = dydx >> 2;
  587|  79.3k|    WORD32 off1, off2, off3;
  588|  79.3k|    UWORD8 *pu1_pred1;
  589|  79.3k|    UNUSED(pu1_tmp);
  ------------------
  |  |   45|  79.3k|#define UNUSED(x) ((void)(x))
  ------------------
  590|  79.3k|    y_offset = y_offset & 0x3;
  591|       |
  592|  79.3k|    off1 = src_strd;
  593|  79.3k|    off2 = src_strd << 1;
  594|  79.3k|    off3 = off1 + off2;
  595|       |
  596|  79.3k|    pu1_pred1 = pu1_src + (y_offset >> 1) * src_strd;
  597|       |
  598|  1.19M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (598:18): [True: 1.11M, False: 79.3k]
  ------------------
  599|  1.11M|    {
  600|  17.0M|        for(col = 0; col < wd; col++, pu1_dst++, pu1_src++, pu1_pred1++)
  ------------------
  |  Branch (600:22): [True: 15.9M, False: 1.11M]
  ------------------
  601|  15.9M|        {
  602|  15.9M|            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|  15.9M|            i2_temp = pu1_src[-off2] + pu1_src[off3]
  608|  15.9M|                       - (pu1_src[-off1] + pu1_src[off2])
  609|  15.9M|                       + ((pu1_src[0] + pu1_src[off1] - pu1_src[-off1] - pu1_src[off2]) << 2)
  610|  15.9M|                       + ((pu1_src[0] + pu1_src[off1]) << 4);
  611|  15.9M|            i2_temp = (i2_temp + 16) >> 5;
  612|  15.9M|            i2_temp = CLIP_U8(i2_temp);
  ------------------
  |  |   58|  15.9M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  15.9M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 17.6k, False: 15.9M]
  |  |  |  |  |  Branch (77:54): [True: 10.8k, False: 15.9M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  613|       |
  614|  15.9M|            *pu1_dst = (i2_temp + *pu1_pred1 + 1) >> 1;
  615|  15.9M|        }
  616|  1.11M|        pu1_src += src_strd - wd;
  617|  1.11M|        pu1_pred1 += src_strd - wd;
  618|  1.11M|        pu1_dst += dst_strd - wd;
  619|  1.11M|    }
  620|  79.3k|}
ih264_inter_pred_luma_horz_qpel_vert_qpel:
  679|   103k|{
  680|   103k|    WORD32 row, col;
  681|   103k|    WORD32 x_offset = dydx & 0x3;
  682|   103k|    WORD32 y_offset = dydx >> 2;
  683|       |
  684|   103k|    WORD32 off1, off2, off3;
  685|   103k|    UWORD8* pu1_pred_vert, *pu1_pred_horz;
  686|   103k|    UNUSED(pu1_tmp);
  ------------------
  |  |   45|   103k|#define UNUSED(x) ((void)(x))
  ------------------
  687|   103k|    y_offset = y_offset & 0x3;
  688|       |
  689|   103k|    off1 = src_strd;
  690|   103k|    off2 = src_strd << 1;
  691|   103k|    off3 = off1 + off2;
  692|       |
  693|   103k|    pu1_pred_horz = pu1_src + (y_offset >> 1) * src_strd;
  694|   103k|    pu1_pred_vert = pu1_src + (x_offset >> 1);
  695|       |
  696|  1.51M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (696:18): [True: 1.41M, False: 103k]
  ------------------
  697|  1.41M|    {
  698|  21.6M|        for(col = 0; col < wd;
  ------------------
  |  Branch (698:22): [True: 20.2M, False: 1.41M]
  ------------------
  699|  20.2M|                        col++, pu1_dst++, pu1_pred_vert++, pu1_pred_horz++)
  700|  20.2M|        {
  701|  20.2M|            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|  20.2M|            i2_temp_vert = pu1_pred_vert[-off2] + pu1_pred_vert[off3]
  707|  20.2M|                            - (pu1_pred_vert[-off1] + pu1_pred_vert[off2])
  708|  20.2M|                            + ((pu1_pred_vert[0] + pu1_pred_vert[off1]
  709|  20.2M|                                            - pu1_pred_vert[-off1]
  710|  20.2M|                                            - pu1_pred_vert[off2]) << 2)
  711|  20.2M|                            + ((pu1_pred_vert[0] + pu1_pred_vert[off1]) << 4);
  712|  20.2M|            i2_temp_vert = (i2_temp_vert + 16) >> 5;
  713|  20.2M|            i2_temp_vert = CLIP_U8(i2_temp_vert);
  ------------------
  |  |   58|  20.2M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  20.2M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 85.3k, False: 20.1M]
  |  |  |  |  |  Branch (77:54): [True: 91.0k, False: 20.0M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  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|  20.2M|            i2_temp_horz = pu1_pred_horz[-2] + pu1_pred_horz[3]
  719|  20.2M|                            - (pu1_pred_horz[-1] + pu1_pred_horz[2])
  720|  20.2M|                            + ((pu1_pred_horz[0] + pu1_pred_horz[1]
  721|  20.2M|                                            - pu1_pred_horz[-1]
  722|  20.2M|                                            - pu1_pred_horz[2]) << 2)
  723|  20.2M|                            + ((pu1_pred_horz[0] + pu1_pred_horz[1]) << 4);
  724|  20.2M|            i2_temp_horz = (i2_temp_horz + 16) >> 5;
  725|  20.2M|            i2_temp_horz = CLIP_U8(i2_temp_horz);
  ------------------
  |  |   58|  20.2M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  20.2M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 31.7k, False: 20.2M]
  |  |  |  |  |  Branch (77:54): [True: 22.6k, False: 20.1M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  726|  20.2M|            *pu1_dst = (i2_temp_vert + i2_temp_horz + 1) >> 1;
  727|  20.2M|        }
  728|  1.41M|        pu1_pred_vert += (src_strd - wd);
  729|  1.41M|        pu1_pred_horz += (src_strd - wd);
  730|  1.41M|        pu1_dst += (dst_strd - wd);
  731|  1.41M|    }
  732|   103k|}
ih264_inter_pred_luma_horz_qpel_vert_hpel:
  792|  32.7k|{
  793|  32.7k|    WORD32 row, col;
  794|  32.7k|    WORD32 tmp;
  795|  32.7k|    WORD16* pi2_pred1_temp, *pi2_pred1;
  796|  32.7k|    UWORD8* pu1_dst_tmp;
  797|  32.7k|    WORD32 x_offset = dydx & 0x3;
  798|  32.7k|    WORD16 i2_macro;
  799|       |
  800|  32.7k|    pi2_pred1_temp = (WORD16*)pu1_tmp;
  801|  32.7k|    pi2_pred1_temp += 2;
  802|  32.7k|    pi2_pred1 = pi2_pred1_temp;
  803|  32.7k|    pu1_dst_tmp = pu1_dst;
  804|       |
  805|   464k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (805:18): [True: 432k, False: 32.7k]
  ------------------
  806|   432k|    {
  807|  8.70M|        for(col = -2; col < wd + 3; col++)
  ------------------
  |  Branch (807:23): [True: 8.27M, False: 432k]
  ------------------
  808|  8.27M|        {
  809|  8.27M|            tmp = 0;/*ih264_g_six_tap[] is the array containing the filter coeffs*/
  810|  8.27M|            tmp = ih264_g_six_tap[0] *
  811|  8.27M|                            (pu1_src[col - 2 * src_strd] + pu1_src[col + 3 * src_strd])
  812|  8.27M|                  + ih264_g_six_tap[1] *
  813|  8.27M|                            (pu1_src[col - 1 * src_strd] + pu1_src[col + 2 * src_strd])
  814|  8.27M|                  + ih264_g_six_tap[2] *
  815|  8.27M|                            (pu1_src[col] + pu1_src[col + 1 * src_strd]);
  816|  8.27M|            pi2_pred1_temp[col] = tmp;
  817|  8.27M|        }
  818|       |
  819|   432k|        pu1_src += src_strd;
  820|   432k|        pi2_pred1_temp = pi2_pred1_temp + wd + 5;
  821|   432k|    }
  822|       |
  823|  32.7k|    pi2_pred1_temp = pi2_pred1;
  824|   464k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (824:18): [True: 432k, False: 32.7k]
  ------------------
  825|   432k|    {
  826|  6.54M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (826:22): [True: 6.11M, False: 432k]
  ------------------
  827|  6.11M|        {
  828|  6.11M|            tmp = 0;/*ih264_g_six_tap[] is the array containing the filter coeffs*/
  829|  6.11M|            tmp = ih264_g_six_tap[0] *
  830|  6.11M|                            (pi2_pred1[col - 2] + pi2_pred1[col + 3])
  831|  6.11M|                  + ih264_g_six_tap[1] *
  832|  6.11M|                            (pi2_pred1[col - 1] + pi2_pred1[col + 2])
  833|  6.11M|                  + ih264_g_six_tap[2] *
  834|  6.11M|                            (pi2_pred1[col] + pi2_pred1[col + 1]);
  835|  6.11M|            tmp = (tmp + 512) >> 10;
  836|  6.11M|            pu1_dst[col] = CLIP_U8(tmp);
  ------------------
  |  |   58|  6.11M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  6.11M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 117k, False: 5.99M]
  |  |  |  |  |  Branch (77:54): [True: 36.8k, False: 5.95M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  837|  6.11M|        }
  838|   432k|        pi2_pred1 += (wd + 5);
  839|   432k|        pu1_dst += dst_strd;
  840|   432k|    }
  841|       |
  842|  32.7k|    pu1_dst = pu1_dst_tmp;
  843|  32.7k|    pi2_pred1_temp += (x_offset >> 1);
  844|   464k|    for(row = ht; row != 0; row--)
  ------------------
  |  Branch (844:19): [True: 432k, False: 32.7k]
  ------------------
  845|   432k|    {
  846|  6.54M|        for(col = wd; col != 0; col--, pu1_dst++, pi2_pred1_temp++)
  ------------------
  |  Branch (846:23): [True: 6.11M, False: 432k]
  ------------------
  847|  6.11M|        {
  848|  6.11M|            UWORD8 uc_temp;
  849|       |            /* Clipping the output of the six tap filter obtained from the
  850|       |             first stage of the 2d filter stage */
  851|  6.11M|            *pi2_pred1_temp = (*pi2_pred1_temp + 16) >> 5;
  852|  6.11M|            i2_macro = (*pi2_pred1_temp);
  853|  6.11M|            uc_temp = CLIP_U8(i2_macro);
  ------------------
  |  |   58|  6.11M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  6.11M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 91.5k, False: 6.02M]
  |  |  |  |  |  Branch (77:54): [True: 36.3k, False: 5.98M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  854|  6.11M|            *pu1_dst = (*pu1_dst + uc_temp + 1) >> 1;
  855|  6.11M|        }
  856|   432k|        pi2_pred1_temp += 5;
  857|   432k|        pu1_dst += dst_strd - wd;
  858|   432k|    }
  859|  32.7k|}
ih264_inter_pred_luma_horz_hpel_vert_qpel:
  957|  92.6k|{
  958|       |
  959|  92.6k|    WORD32 row, col;
  960|  92.6k|    WORD32 tmp;
  961|  92.6k|    WORD32 y_offset = dydx >> 2;
  962|  92.6k|    WORD16* pi2_pred1_temp, *pi2_pred1;
  963|  92.6k|    UWORD8* pu1_dst_tmp;
  964|       |    //WORD32 x_offset = dydx & 0x3;
  965|  92.6k|    WORD16 i2_macro;
  966|       |
  967|  92.6k|    y_offset = y_offset & 0x3;
  968|       |
  969|  92.6k|    pi2_pred1_temp = (WORD16*)pu1_tmp;
  970|  92.6k|    pi2_pred1_temp += 2 * wd;
  971|  92.6k|    pi2_pred1 = pi2_pred1_temp;
  972|  92.6k|    pu1_dst_tmp = pu1_dst;
  973|  92.6k|    pu1_src -= 2 * src_strd;
  974|  1.93M|    for(row = -2; row < ht + 3; row++)
  ------------------
  |  Branch (974:19): [True: 1.83M, False: 92.6k]
  ------------------
  975|  1.83M|    {
  976|  29.5M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (976:22): [True: 27.7M, False: 1.83M]
  ------------------
  977|  27.7M|        {
  978|  27.7M|            tmp = 0;/*ih264_g_six_tap[] is the array containing the filter coeffs*/
  979|  27.7M|            tmp = ih264_g_six_tap[0] * (pu1_src[col - 2] + pu1_src[col + 3])
  980|  27.7M|                  + ih264_g_six_tap[1] * (pu1_src[col - 1] + pu1_src[col + 2])
  981|  27.7M|                  + ih264_g_six_tap[2] * (pu1_src[col] + pu1_src[col + 1]);
  982|  27.7M|            pi2_pred1_temp[col - 2 * wd] = tmp;
  983|  27.7M|        }
  984|       |
  985|  1.83M|        pu1_src += src_strd;
  986|  1.83M|        pi2_pred1_temp += wd;
  987|  1.83M|    }
  988|  92.6k|    pi2_pred1_temp = pi2_pred1;
  989|  1.46M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (989:18): [True: 1.37M, False: 92.6k]
  ------------------
  990|  1.37M|    {
  991|  22.3M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (991:22): [True: 20.9M, False: 1.37M]
  ------------------
  992|  20.9M|        {
  993|  20.9M|            tmp = 0;/*ih264_g_six_tap[] is the array containing the filter coeffs*/
  994|  20.9M|            tmp = ih264_g_six_tap[0] * (pi2_pred1[col - 2 * wd] + pi2_pred1[col + 3 * wd])
  995|  20.9M|                  + ih264_g_six_tap[1] * (pi2_pred1[col - 1 * wd] + pi2_pred1[col + 2 * wd])
  996|  20.9M|                  + ih264_g_six_tap[2] * (pi2_pred1[col] + pi2_pred1[col + 1 * wd]);
  997|  20.9M|            tmp = (tmp + 512) >> 10;
  998|  20.9M|            pu1_dst[col] = CLIP_U8(tmp);
  ------------------
  |  |   58|  20.9M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  20.9M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 42.3k, False: 20.9M]
  |  |  |  |  |  Branch (77:54): [True: 94.5k, False: 20.8M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  999|  20.9M|        }
 1000|  1.37M|        pi2_pred1 += wd;
 1001|  1.37M|        pu1_dst += dst_strd;
 1002|  1.37M|    }
 1003|  92.6k|    pu1_dst = pu1_dst_tmp;
 1004|  92.6k|    pi2_pred1_temp += (y_offset >> 1) * wd;
 1005|  1.46M|    for(row = ht; row != 0; row--)
  ------------------
  |  Branch (1005:19): [True: 1.37M, False: 92.6k]
  ------------------
 1006|       |
 1007|  1.37M|    {
 1008|  22.3M|        for(col = wd; col != 0; col--, pu1_dst++, pi2_pred1_temp++)
  ------------------
  |  Branch (1008:23): [True: 20.9M, False: 1.37M]
  ------------------
 1009|  20.9M|        {
 1010|  20.9M|            UWORD8 u1_temp;
 1011|       |            /* Clipping the output of the six tap filter obtained from the
 1012|       |             first stage of the 2d filter stage */
 1013|  20.9M|            *pi2_pred1_temp = (*pi2_pred1_temp + 16) >> 5;
 1014|  20.9M|            i2_macro = (*pi2_pred1_temp);
 1015|  20.9M|            u1_temp = CLIP_U8(i2_macro);
  ------------------
  |  |   58|  20.9M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  20.9M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 22.4k, False: 20.9M]
  |  |  |  |  |  Branch (77:54): [True: 68.7k, False: 20.8M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1016|  20.9M|            *pu1_dst = (*pu1_dst + u1_temp + 1) >> 1;
 1017|  20.9M|        }
 1018|       |        //pi16_pred1_temp += wd;
 1019|  1.37M|        pu1_dst += dst_strd - wd;
 1020|  1.37M|    }
 1021|  92.6k|}
ih264_inter_pred_chroma:
 1141|  3.36M|{
 1142|  3.36M|    WORD32 row, col;
 1143|  3.36M|    WORD16 i2_tmp;
 1144|       |
 1145|  29.5M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (1145:18): [True: 26.1M, False: 3.36M]
  ------------------
 1146|  26.1M|    {
 1147|   436M|        for(col = 0; col < 2 * wd; col++)
  ------------------
  |  Branch (1147:22): [True: 410M, False: 26.1M]
  ------------------
 1148|   410M|        {
 1149|   410M|            i2_tmp = 0; /* applies equation (8-266) in section 8.4.2.2.2 */
 1150|   410M|            i2_tmp = (8 - dx) * (8 - dy) * pu1_src[col]
 1151|   410M|                     + (dx) * (8 - dy) * pu1_src[col + 2]
 1152|   410M|                     + (8 - dx) * (dy) * (pu1_src + src_strd)[col]
 1153|   410M|                     + (dx) * (dy) * (pu1_src + src_strd)[col + 2];
 1154|   410M|            i2_tmp = (i2_tmp + 32) >> 6;
 1155|   410M|            pu1_dst[col] = CLIP_U8(i2_tmp);
  ------------------
  |  |   58|   410M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   410M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 0, False: 410M]
  |  |  |  |  |  Branch (77:54): [True: 0, False: 410M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1156|   410M|        }
 1157|  26.1M|        pu1_src += src_strd;
 1158|  26.1M|        pu1_dst += dst_strd;
 1159|  26.1M|    }
 1160|  3.36M|}

ih264_iquant_itrans_recon_4x4:
  126|  71.6k|{
  127|  71.6k|    WORD16 *pi2_src_ptr = pi2_src;
  128|  71.6k|    WORD16 *pi2_tmp_ptr = pi2_tmp;
  129|  71.6k|    UWORD8 *pu1_pred_ptr = pu1_pred;
  130|  71.6k|    UWORD8 *pu1_out_ptr = pu1_out;
  131|  71.6k|    WORD16 x0, x1, x2, x3, i;
  132|  71.6k|    WORD32 q0, q1, q2, q3;
  133|  71.6k|    WORD16 i_macro;
  134|  71.6k|    WORD16 rnd_fact = (u4_qp_div_6 < 4) ? 1 << (3 - u4_qp_div_6) : 0;
  ------------------
  |  Branch (134:23): [True: 13.4k, False: 58.1k]
  ------------------
  135|       |
  136|       |    /* inverse quant */
  137|       |    /* horizontal inverse transform */
  138|   358k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|   358k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (138:16): [True: 286k, False: 71.6k]
  ------------------
  139|   286k|    {
  140|   286k|        q0 = pi2_src_ptr[0];
  141|   286k|        INV_QUANT(q0, pu2_iscal_mat[0], pu2_weigh_mat[0], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|   286k|                {\
  |  |  104|   286k|                    i4_value *= quant_scale;\
  |  |  105|   286k|                    i4_value *= weight_scale;\
  |  |  106|   286k|                    i4_value += rndfactor;\
  |  |  107|   286k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|   286k|                    i4_value >>= qbits;\
  |  |  109|   286k|                }
  ------------------
  142|       |        /* Restoring dc value for intra case */
  143|   286k|        if (i==0 && iq_start_idx == 1)
  ------------------
  |  Branch (143:13): [True: 71.6k, False: 214k]
  |  Branch (143:21): [True: 7.95k, False: 63.6k]
  ------------------
  144|  7.95k|        {
  145|  7.95k|            q0 = pi2_dc_ld_addr[0];
  146|  7.95k|        }
  147|       |
  148|   286k|        q2 = pi2_src_ptr[2];
  149|   286k|        INV_QUANT(q2, pu2_iscal_mat[2], pu2_weigh_mat[2], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|   286k|                {\
  |  |  104|   286k|                    i4_value *= quant_scale;\
  |  |  105|   286k|                    i4_value *= weight_scale;\
  |  |  106|   286k|                    i4_value += rndfactor;\
  |  |  107|   286k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|   286k|                    i4_value >>= qbits;\
  |  |  109|   286k|                }
  ------------------
  150|       |
  151|   286k|        x0 = q0 + q2;
  152|   286k|        x1 = q0 - q2;
  153|       |
  154|   286k|        q1 = pi2_src_ptr[1];
  155|   286k|        INV_QUANT(q1, pu2_iscal_mat[1], pu2_weigh_mat[1], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|   286k|                {\
  |  |  104|   286k|                    i4_value *= quant_scale;\
  |  |  105|   286k|                    i4_value *= weight_scale;\
  |  |  106|   286k|                    i4_value += rndfactor;\
  |  |  107|   286k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|   286k|                    i4_value >>= qbits;\
  |  |  109|   286k|                }
  ------------------
  156|       |
  157|   286k|        q3 = pi2_src_ptr[3];
  158|   286k|        INV_QUANT(q3, pu2_iscal_mat[3], pu2_weigh_mat[3], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|   286k|                {\
  |  |  104|   286k|                    i4_value *= quant_scale;\
  |  |  105|   286k|                    i4_value *= weight_scale;\
  |  |  106|   286k|                    i4_value += rndfactor;\
  |  |  107|   286k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|   286k|                    i4_value >>= qbits;\
  |  |  109|   286k|                }
  ------------------
  159|       |
  160|   286k|        x2 = (q1 >> 1) - q3;
  161|   286k|        x3 = q1 + (q3 >> 1);
  162|       |
  163|   286k|        pi2_tmp_ptr[0] = x0 + x3;
  164|   286k|        pi2_tmp_ptr[1] = x1 + x2;
  165|   286k|        pi2_tmp_ptr[2] = x1 - x2;
  166|   286k|        pi2_tmp_ptr[3] = x0 - x3;
  167|       |
  168|   286k|        pi2_src_ptr += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|   286k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  169|   286k|        pi2_tmp_ptr += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|   286k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  170|   286k|        pu2_iscal_mat += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|   286k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  171|   286k|        pu2_weigh_mat += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|   286k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  172|   286k|    }
  173|       |
  174|       |    /* vertical inverse transform */
  175|  71.6k|    pi2_tmp_ptr = pi2_tmp;
  176|   358k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|   358k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (176:16): [True: 286k, False: 71.6k]
  ------------------
  177|   286k|    {
  178|   286k|        pu1_pred_ptr = pu1_pred;
  179|   286k|        pu1_out = pu1_out_ptr;
  180|       |
  181|   286k|        x0 = (pi2_tmp_ptr[0] + pi2_tmp_ptr[8]);
  182|   286k|        x1 = (pi2_tmp_ptr[0] - pi2_tmp_ptr[8]);
  183|   286k|        x2 = (pi2_tmp_ptr[4] >> 1) - pi2_tmp_ptr[12];
  184|   286k|        x3 = pi2_tmp_ptr[4] + (pi2_tmp_ptr[12] >> 1);
  185|       |
  186|       |        /* inverse prediction */
  187|   286k|        i_macro = x0 + x3;
  188|   286k|        i_macro = ((i_macro + 32) >> 6);
  189|   286k|        i_macro += *pu1_pred_ptr;
  190|   286k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   286k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   286k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 76.4k, False: 209k]
  |  |  |  |  |  Branch (77:54): [True: 29.7k, False: 180k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  191|   286k|        pu1_pred_ptr += pred_strd;
  192|   286k|        pu1_out += out_strd;
  193|       |
  194|   286k|        i_macro = x1 + x2;
  195|   286k|        i_macro = ((i_macro + 32) >> 6);
  196|   286k|        i_macro += *pu1_pred_ptr;
  197|   286k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   286k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   286k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 72.5k, False: 213k]
  |  |  |  |  |  Branch (77:54): [True: 30.1k, False: 183k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  198|   286k|        pu1_pred_ptr += pred_strd;
  199|   286k|        pu1_out += out_strd;
  200|       |
  201|   286k|        i_macro = x1 - x2;
  202|   286k|        i_macro = ((i_macro + 32) >> 6);
  203|   286k|        i_macro += *pu1_pred_ptr;
  204|   286k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   286k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   286k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 72.3k, False: 214k]
  |  |  |  |  |  Branch (77:54): [True: 24.0k, False: 190k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  205|   286k|        pu1_pred_ptr += pred_strd;
  206|   286k|        pu1_out += out_strd;
  207|       |
  208|   286k|        i_macro = x0 - x3;
  209|   286k|        i_macro = ((i_macro + 32) >> 6);
  210|   286k|        i_macro += *pu1_pred_ptr;
  211|   286k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   286k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   286k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 79.7k, False: 206k]
  |  |  |  |  |  Branch (77:54): [True: 30.4k, False: 176k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  212|       |
  213|   286k|        pi2_tmp_ptr++;
  214|   286k|        pu1_out_ptr++;
  215|   286k|        pu1_pred++;
  216|   286k|    }
  217|  71.6k|}
ih264_iquant_itrans_recon_4x4_dc:
  280|   384k|{
  281|   384k|    UWORD8 *pu1_pred_ptr = pu1_pred;
  282|   384k|    UWORD8 *pu1_out_ptr = pu1_out;
  283|   384k|    WORD32 q0;
  284|   384k|    WORD16 x, i_macro, i;
  285|   384k|    WORD16 rnd_fact = (u4_qp_div_6 < 4) ? 1 << (3 - u4_qp_div_6) : 0;
  ------------------
  |  Branch (285:23): [True: 92.4k, False: 291k]
  ------------------
  286|       |
  287|   384k|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|   384k|#define UNUSED(x) ((void)(x))
  ------------------
  288|   384k|    if(iq_start_idx == 0)
  ------------------
  |  Branch (288:8): [True: 14.4k, False: 369k]
  ------------------
  289|  14.4k|    {
  290|  14.4k|        q0 = pi2_src[0];
  291|  14.4k|        INV_QUANT(q0, pu2_iscal_mat[0], pu2_weigh_mat[0], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|  14.4k|                {\
  |  |  104|  14.4k|                    i4_value *= quant_scale;\
  |  |  105|  14.4k|                    i4_value *= weight_scale;\
  |  |  106|  14.4k|                    i4_value += rndfactor;\
  |  |  107|  14.4k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  14.4k|                    i4_value >>= qbits;\
  |  |  109|  14.4k|                }
  ------------------
  292|  14.4k|    }
  293|   369k|    else
  294|   369k|    {
  295|   369k|        q0 = pi2_dc_ld_addr[0]; // Restoring dc value for intra case3
  296|   369k|    }
  297|   384k|    i_macro = ((q0 + 32) >> 6);
  298|  1.92M|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|  1.92M|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (298:16): [True: 1.53M, False: 384k]
  ------------------
  299|  1.53M|    {
  300|  1.53M|        pu1_pred_ptr = pu1_pred;
  301|  1.53M|        pu1_out = pu1_out_ptr;
  302|       |
  303|       |        /* inverse prediction */
  304|  1.53M|        x = i_macro + *pu1_pred_ptr;
  305|  1.53M|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  1.53M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  1.53M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 205k, False: 1.33M]
  |  |  |  |  |  Branch (77:54): [True: 233k, False: 1.09M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  306|  1.53M|        pu1_pred_ptr += pred_strd;
  307|  1.53M|        pu1_out += out_strd;
  308|       |
  309|  1.53M|        x = i_macro + *pu1_pred_ptr;
  310|  1.53M|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  1.53M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  1.53M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 204k, False: 1.33M]
  |  |  |  |  |  Branch (77:54): [True: 234k, False: 1.09M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  311|  1.53M|        pu1_pred_ptr += pred_strd;
  312|  1.53M|        pu1_out += out_strd;
  313|       |
  314|  1.53M|        x = i_macro + *pu1_pred_ptr;
  315|  1.53M|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  1.53M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  1.53M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 205k, False: 1.33M]
  |  |  |  |  |  Branch (77:54): [True: 234k, False: 1.09M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  316|  1.53M|        pu1_pred_ptr += pred_strd;
  317|  1.53M|        pu1_out += out_strd;
  318|       |
  319|  1.53M|        x = i_macro + *pu1_pred_ptr;
  320|  1.53M|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  1.53M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  1.53M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 205k, False: 1.33M]
  |  |  |  |  |  Branch (77:54): [True: 235k, False: 1.09M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  321|       |
  322|  1.53M|        pu1_out_ptr++;
  323|  1.53M|        pu1_pred++;
  324|  1.53M|    }
  325|   384k|}
ih264_iquant_itrans_recon_8x8:
  389|  31.3k|{
  390|  31.3k|    WORD32 i;
  391|  31.3k|    WORD16 *pi2_tmp_ptr = pi2_tmp;
  392|  31.3k|    UWORD8 *pu1_pred_ptr = pu1_pred;
  393|  31.3k|    UWORD8 *pu1_out_ptr = pu1_out;
  394|  31.3k|    WORD16 i_z0, i_z1, i_z2, i_z3, i_z4, i_z5, i_z6, i_z7;
  395|  31.3k|    WORD16 i_y0, i_y1, i_y2, i_y3, i_y4, i_y5, i_y6, i_y7;
  396|  31.3k|    WORD16 i_macro;
  397|  31.3k|    WORD32 q;
  398|  31.3k|    WORD32 rnd_fact = (qp_div < 6) ? (1 << (5 - qp_div)) : 0;
  ------------------
  |  Branch (398:23): [True: 19.0k, False: 12.2k]
  ------------------
  399|       |
  400|  31.3k|    UNUSED(iq_start_idx);
  ------------------
  |  |   45|  31.3k|#define UNUSED(x) ((void)(x))
  ------------------
  401|  31.3k|    UNUSED(pi2_dc_ld_addr);
  ------------------
  |  |   45|  31.3k|#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.03M|    for(i = 0; i < (SUB_BLK_WIDTH_8x8 * SUB_BLK_WIDTH_8x8); i++)
  ------------------
  |  |   53|  2.03M|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
                  for(i = 0; i < (SUB_BLK_WIDTH_8x8 * SUB_BLK_WIDTH_8x8); i++)
  ------------------
  |  |   53|  2.03M|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
  |  Branch (406:16): [True: 2.00M, False: 31.3k]
  ------------------
  407|  2.00M|    {
  408|  2.00M|        q = pi2_src[i];
  409|  2.00M|        INV_QUANT(q, pu2_iscale_mat[i], pu2_weigh_mat[i], qp_div, rnd_fact, 6);
  ------------------
  |  |  103|  2.00M|                {\
  |  |  104|  2.00M|                    i4_value *= quant_scale;\
  |  |  105|  2.00M|                    i4_value *= weight_scale;\
  |  |  106|  2.00M|                    i4_value += rndfactor;\
  |  |  107|  2.00M|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  2.00M|                    i4_value >>= qbits;\
  |  |  109|  2.00M|                }
  ------------------
  410|  2.00M|        pi2_tmp_ptr[i] = q;
  411|  2.00M|    }
  412|       |    /* Perform Inverse transform */
  413|       |    /*--------------------------------------------------------------------*/
  414|       |    /* IDCT [ Horizontal transformation ]                                 */
  415|       |    /*--------------------------------------------------------------------*/
  416|   281k|    for(i = 0; i < SUB_BLK_WIDTH_8x8; i++)
  ------------------
  |  |   53|   281k|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
  |  Branch (416:16): [True: 250k, False: 31.3k]
  ------------------
  417|   250k|    {
  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|   250k|        i_y0 = (pi2_tmp_ptr[0] + pi2_tmp_ptr[4] );
  429|       |
  430|   250k|        i_y1 = ((WORD32)(-pi2_tmp_ptr[3]) + pi2_tmp_ptr[5] - pi2_tmp_ptr[7]
  431|   250k|                        - (pi2_tmp_ptr[7] >> 1));
  432|       |
  433|   250k|        i_y2 = (pi2_tmp_ptr[0] - pi2_tmp_ptr[4] );
  434|       |
  435|   250k|        i_y3 = ((WORD32)pi2_tmp_ptr[1] + pi2_tmp_ptr[7] - pi2_tmp_ptr[3]
  436|   250k|                        - (pi2_tmp_ptr[3] >> 1));
  437|       |
  438|   250k|        i_y4 = ((pi2_tmp_ptr[2] >> 1) - pi2_tmp_ptr[6] );
  439|       |
  440|   250k|        i_y5 = ((WORD32)(-pi2_tmp_ptr[1]) + pi2_tmp_ptr[7] + pi2_tmp_ptr[5]
  441|   250k|                        + (pi2_tmp_ptr[5] >> 1));
  442|       |
  443|   250k|        i_y6 = (pi2_tmp_ptr[2] + (pi2_tmp_ptr[6] >> 1));
  444|       |
  445|   250k|        i_y7 = ((WORD32)pi2_tmp_ptr[3] + pi2_tmp_ptr[5] + pi2_tmp_ptr[1]
  446|   250k|                        + (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|   250k|        i_z0 = i_y0 + i_y6;
  459|   250k|        i_z1 = i_y1 + (i_y7 >> 2);
  460|   250k|        i_z2 = i_y2 + i_y4;
  461|   250k|        i_z3 = i_y3 + (i_y5 >> 2);
  462|   250k|        i_z4 = i_y2 - i_y4;
  463|   250k|        i_z5 = (i_y3 >> 2) - i_y5;
  464|   250k|        i_z6 = i_y0 - i_y6;
  465|   250k|        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|   250k|        pi2_tmp_ptr[0] = i_z0 + i_z7;
  478|   250k|        pi2_tmp_ptr[1] = i_z2 + i_z5;
  479|   250k|        pi2_tmp_ptr[2] = i_z4 + i_z3;
  480|   250k|        pi2_tmp_ptr[3] = i_z6 + i_z1;
  481|   250k|        pi2_tmp_ptr[4] = i_z6 - i_z1;
  482|   250k|        pi2_tmp_ptr[5] = i_z4 - i_z3;
  483|   250k|        pi2_tmp_ptr[6] = i_z2 - i_z5;
  484|   250k|        pi2_tmp_ptr[7] = i_z0 - i_z7;
  485|       |
  486|       |        /* move to the next row */
  487|       |        //pi2_src_ptr += SUB_BLK_WIDTH_8x8;
  488|   250k|        pi2_tmp_ptr += SUB_BLK_WIDTH_8x8;
  ------------------
  |  |   53|   250k|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
  489|   250k|    }
  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|  31.3k|    pi2_tmp_ptr = pi2_tmp;
  498|   281k|    for(i = 0; i < SUB_BLK_WIDTH_8x8; i++)
  ------------------
  |  |   53|   281k|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
  |  Branch (498:16): [True: 250k, False: 31.3k]
  ------------------
  499|   250k|    {
  500|   250k|        pu1_pred_ptr = pu1_pred;
  501|   250k|        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|   250k|        i_y0 = pi2_tmp_ptr[0] + pi2_tmp_ptr[32];
  513|       |
  514|   250k|        i_y1 = (WORD32)(-pi2_tmp_ptr[24]) + pi2_tmp_ptr[40] - pi2_tmp_ptr[56]
  515|   250k|                        - (pi2_tmp_ptr[56] >> 1);
  516|       |
  517|   250k|        i_y2 = pi2_tmp_ptr[0] - pi2_tmp_ptr[32];
  518|       |
  519|   250k|        i_y3 = (WORD32)pi2_tmp_ptr[8] + pi2_tmp_ptr[56] - pi2_tmp_ptr[24]
  520|   250k|                        - (pi2_tmp_ptr[24] >> 1);
  521|       |
  522|   250k|        i_y4 = (pi2_tmp_ptr[16] >> 1) - pi2_tmp_ptr[48];
  523|       |
  524|   250k|        i_y5 = (WORD32)(-pi2_tmp_ptr[8]) + pi2_tmp_ptr[56] + pi2_tmp_ptr[40]
  525|   250k|                        + (pi2_tmp_ptr[40] >> 1);
  526|       |
  527|   250k|        i_y6 = pi2_tmp_ptr[16] + (pi2_tmp_ptr[48] >> 1);
  528|       |
  529|   250k|        i_y7 = (WORD32)pi2_tmp_ptr[24] + pi2_tmp_ptr[40] + pi2_tmp_ptr[8]
  530|   250k|                        + (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|   250k|        i_z0 = i_y0 + i_y6;
  543|   250k|        i_z1 = i_y1 + (i_y7 >> 2);
  544|   250k|        i_z2 = i_y2 + i_y4;
  545|   250k|        i_z3 = i_y3 + (i_y5 >> 2);
  546|   250k|        i_z4 = i_y2 - i_y4;
  547|   250k|        i_z5 = (i_y3 >> 2) - i_y5;
  548|   250k|        i_z6 = i_y0 - i_y6;
  549|   250k|        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|   250k|        i_macro = ((i_z0 + i_z7 + 32) >> 6) + *pu1_pred_ptr;
  562|   250k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   250k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   250k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 30.4k, False: 219k]
  |  |  |  |  |  Branch (77:54): [True: 14.3k, False: 205k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  563|       |        /* Change uc_recBuffer to Point to next element in the same column*/
  564|   250k|        pu1_pred_ptr += pred_strd;
  565|   250k|        pu1_out += out_strd;
  566|       |
  567|   250k|        i_macro = ((i_z2 + i_z5 + 32) >> 6) + *pu1_pred_ptr;
  568|   250k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   250k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   250k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 32.6k, False: 217k]
  |  |  |  |  |  Branch (77:54): [True: 11.9k, False: 205k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  569|   250k|        pu1_pred_ptr += pred_strd;
  570|   250k|        pu1_out += out_strd;
  571|       |
  572|   250k|        i_macro = ((i_z4 + i_z3 + 32) >> 6) + *pu1_pred_ptr;
  573|   250k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   250k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   250k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 32.7k, False: 217k]
  |  |  |  |  |  Branch (77:54): [True: 13.5k, False: 204k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  574|   250k|        pu1_pred_ptr += pred_strd;
  575|   250k|        pu1_out += out_strd;
  576|       |
  577|   250k|        i_macro = ((i_z6 + i_z1 + 32) >> 6) + *pu1_pred_ptr;
  578|   250k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   250k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   250k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 29.5k, False: 220k]
  |  |  |  |  |  Branch (77:54): [True: 12.1k, False: 208k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  579|   250k|        pu1_pred_ptr += pred_strd;
  580|   250k|        pu1_out += out_strd;
  581|       |
  582|   250k|        i_macro = ((i_z6 - i_z1 + 32) >> 6) + *pu1_pred_ptr;
  583|   250k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   250k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   250k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 33.3k, False: 217k]
  |  |  |  |  |  Branch (77:54): [True: 12.2k, False: 204k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  584|   250k|        pu1_pred_ptr += pred_strd;
  585|   250k|        pu1_out += out_strd;
  586|       |
  587|   250k|        i_macro = ((i_z4 - i_z3 + 32) >> 6) + *pu1_pred_ptr;
  588|   250k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   250k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   250k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 32.5k, False: 217k]
  |  |  |  |  |  Branch (77:54): [True: 12.3k, False: 205k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  589|   250k|        pu1_pred_ptr += pred_strd;
  590|   250k|        pu1_out += out_strd;
  591|       |
  592|   250k|        i_macro = ((i_z2 - i_z5 + 32) >> 6) + *pu1_pred_ptr;
  593|   250k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   250k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   250k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 31.2k, False: 219k]
  |  |  |  |  |  Branch (77:54): [True: 10.3k, False: 208k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  594|   250k|        pu1_pred_ptr += pred_strd;
  595|   250k|        pu1_out += out_strd;
  596|       |
  597|   250k|        i_macro = ((i_z0 - i_z7 + 32) >> 6) + *pu1_pred_ptr;
  598|   250k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   250k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   250k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 33.9k, False: 216k]
  |  |  |  |  |  Branch (77:54): [True: 13.2k, False: 203k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  599|       |
  600|   250k|        pi2_tmp_ptr++;
  601|   250k|        pu1_out_ptr++;
  602|   250k|        pu1_pred++;
  603|   250k|    }
  604|  31.3k|}
ih264_iquant_itrans_recon_8x8_dc:
  668|  11.3k|{
  669|  11.3k|    UWORD8 *pu1_pred_ptr = pu1_pred;
  670|  11.3k|    UWORD8 *pu1_out_ptr = pu1_out;
  671|  11.3k|    WORD16 x, i, i_macro;
  672|  11.3k|    WORD32 q;
  673|  11.3k|    WORD32 rnd_fact = (qp_div < 6) ? (1 << (5 - qp_div)) : 0;
  ------------------
  |  Branch (673:23): [True: 6.09k, False: 5.30k]
  ------------------
  674|       |
  675|  11.3k|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|  11.3k|#define UNUSED(x) ((void)(x))
  ------------------
  676|  11.3k|    UNUSED(iq_start_idx);
  ------------------
  |  |   45|  11.3k|#define UNUSED(x) ((void)(x))
  ------------------
  677|  11.3k|    UNUSED(pi2_dc_ld_addr);
  ------------------
  |  |   45|  11.3k|#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.3k|    q = pi2_src[0];
  683|  11.3k|    INV_QUANT(q, pu2_iscale_mat[0], pu2_weigh_mat[0], qp_div, rnd_fact, 6);
  ------------------
  |  |  103|  11.3k|                {\
  |  |  104|  11.3k|                    i4_value *= quant_scale;\
  |  |  105|  11.3k|                    i4_value *= weight_scale;\
  |  |  106|  11.3k|                    i4_value += rndfactor;\
  |  |  107|  11.3k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  11.3k|                    i4_value >>= qbits;\
  |  |  109|  11.3k|                }
  ------------------
  684|  11.3k|    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.1k, False: 11.3k]
  ------------------
  696|  91.1k|    {
  697|  91.1k|        pu1_pred_ptr = pu1_pred;
  698|  91.1k|        pu1_out = pu1_out_ptr;
  699|       |
  700|  91.1k|        x = i_macro + *pu1_pred_ptr;
  701|  91.1k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  91.1k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  91.1k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 3.02k, False: 88.1k]
  |  |  |  |  |  Branch (77:54): [True: 22.8k, False: 65.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  702|       |        /* Change uc_recBuffer to Point to next element in the same column*/
  703|  91.1k|        pu1_pred_ptr += pred_strd;
  704|  91.1k|        pu1_out += out_strd;
  705|       |
  706|  91.1k|        x = i_macro + *pu1_pred_ptr;
  707|  91.1k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  91.1k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  91.1k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 3.02k, False: 88.1k]
  |  |  |  |  |  Branch (77:54): [True: 22.8k, False: 65.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  708|  91.1k|        pu1_pred_ptr += pred_strd;
  709|  91.1k|        pu1_out += out_strd;
  710|       |
  711|  91.1k|        x = i_macro + *pu1_pred_ptr;
  712|  91.1k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  91.1k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  91.1k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 3.02k, False: 88.1k]
  |  |  |  |  |  Branch (77:54): [True: 22.8k, False: 65.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  713|  91.1k|        pu1_pred_ptr += pred_strd;
  714|  91.1k|        pu1_out += out_strd;
  715|       |
  716|  91.1k|        x = i_macro + *pu1_pred_ptr;
  717|  91.1k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  91.1k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  91.1k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 3.03k, False: 88.1k]
  |  |  |  |  |  Branch (77:54): [True: 22.8k, False: 65.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  718|  91.1k|        pu1_pred_ptr += pred_strd;
  719|  91.1k|        pu1_out += out_strd;
  720|       |
  721|  91.1k|        x = i_macro + *pu1_pred_ptr;
  722|  91.1k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  91.1k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  91.1k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 3.04k, False: 88.1k]
  |  |  |  |  |  Branch (77:54): [True: 22.8k, False: 65.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  723|  91.1k|        pu1_pred_ptr += pred_strd;
  724|  91.1k|        pu1_out += out_strd;
  725|       |
  726|  91.1k|        x = i_macro + *pu1_pred_ptr;
  727|  91.1k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  91.1k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  91.1k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 3.07k, False: 88.0k]
  |  |  |  |  |  Branch (77:54): [True: 22.8k, False: 65.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  728|  91.1k|        pu1_pred_ptr += pred_strd;
  729|  91.1k|        pu1_out += out_strd;
  730|       |
  731|  91.1k|        x = i_macro + *pu1_pred_ptr;
  732|  91.1k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  91.1k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  91.1k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 3.07k, False: 88.0k]
  |  |  |  |  |  Branch (77:54): [True: 22.8k, False: 65.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  733|  91.1k|        pu1_pred_ptr += pred_strd;
  734|  91.1k|        pu1_out += out_strd;
  735|       |
  736|  91.1k|        x = i_macro + *pu1_pred_ptr;
  737|  91.1k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  91.1k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  91.1k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 3.08k, False: 88.0k]
  |  |  |  |  |  Branch (77:54): [True: 22.8k, False: 65.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  738|       |
  739|  91.1k|        pu1_out_ptr++;
  740|  91.1k|        pu1_pred++;
  741|  91.1k|    }
  742|  11.3k|}
ih264_iquant_itrans_recon_chroma_4x4:
  801|  28.3k|{
  802|  28.3k|    WORD16 *pi2_src_ptr = pi2_src;
  803|  28.3k|    WORD16 *pi2_tmp_ptr = pi2_tmp;
  804|  28.3k|    UWORD8 *pu1_pred_ptr = pu1_pred;
  805|  28.3k|    UWORD8 *pu1_out_ptr = pu1_out;
  806|  28.3k|    WORD16 x0, x1, x2, x3, i;
  807|  28.3k|    WORD32 q0, q1, q2, q3;
  808|  28.3k|    WORD16 i_macro;
  809|  28.3k|    WORD16 rnd_fact = (u4_qp_div_6 < 4) ? 1 << (3 - u4_qp_div_6) : 0;
  ------------------
  |  Branch (809:23): [True: 6.33k, False: 22.0k]
  ------------------
  810|       |
  811|       |    /* inverse quant */
  812|       |    /* horizontal inverse transform */
  813|   141k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|   141k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (813:16): [True: 113k, False: 28.3k]
  ------------------
  814|   113k|    {
  815|   113k|        if(i == 0)
  ------------------
  |  Branch (815:12): [True: 28.3k, False: 85.0k]
  ------------------
  816|  28.3k|        {
  817|  28.3k|            q0 = pi2_dc_src[0];
  818|  28.3k|        }
  819|  85.0k|        else
  820|  85.0k|        {
  821|  85.0k|            q0 = pi2_src_ptr[0];
  822|  85.0k|            INV_QUANT(q0, pu2_iscal_mat[0], pu2_weigh_mat[0], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|  85.0k|                {\
  |  |  104|  85.0k|                    i4_value *= quant_scale;\
  |  |  105|  85.0k|                    i4_value *= weight_scale;\
  |  |  106|  85.0k|                    i4_value += rndfactor;\
  |  |  107|  85.0k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  85.0k|                    i4_value >>= qbits;\
  |  |  109|  85.0k|                }
  ------------------
  823|  85.0k|        }
  824|       |
  825|   113k|        q2 = pi2_src_ptr[2];
  826|   113k|        INV_QUANT(q2, pu2_iscal_mat[2], pu2_weigh_mat[2], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|   113k|                {\
  |  |  104|   113k|                    i4_value *= quant_scale;\
  |  |  105|   113k|                    i4_value *= weight_scale;\
  |  |  106|   113k|                    i4_value += rndfactor;\
  |  |  107|   113k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|   113k|                    i4_value >>= qbits;\
  |  |  109|   113k|                }
  ------------------
  827|       |
  828|   113k|        x0 = q0 + q2;
  829|   113k|        x1 = q0 - q2;
  830|       |
  831|   113k|        q1 = pi2_src_ptr[1];
  832|   113k|        INV_QUANT(q1, pu2_iscal_mat[1], pu2_weigh_mat[1], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|   113k|                {\
  |  |  104|   113k|                    i4_value *= quant_scale;\
  |  |  105|   113k|                    i4_value *= weight_scale;\
  |  |  106|   113k|                    i4_value += rndfactor;\
  |  |  107|   113k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|   113k|                    i4_value >>= qbits;\
  |  |  109|   113k|                }
  ------------------
  833|       |
  834|   113k|        q3 = pi2_src_ptr[3];
  835|   113k|        INV_QUANT(q3, pu2_iscal_mat[3], pu2_weigh_mat[3], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|   113k|                {\
  |  |  104|   113k|                    i4_value *= quant_scale;\
  |  |  105|   113k|                    i4_value *= weight_scale;\
  |  |  106|   113k|                    i4_value += rndfactor;\
  |  |  107|   113k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|   113k|                    i4_value >>= qbits;\
  |  |  109|   113k|                }
  ------------------
  836|       |
  837|   113k|        x2 = (q1 >> 1) - q3;
  838|   113k|        x3 = q1 + (q3 >> 1);
  839|       |
  840|   113k|        pi2_tmp_ptr[0] = x0 + x3;
  841|   113k|        pi2_tmp_ptr[1] = x1 + x2;
  842|   113k|        pi2_tmp_ptr[2] = x1 - x2;
  843|   113k|        pi2_tmp_ptr[3] = x0 - x3;
  844|       |
  845|   113k|        pi2_src_ptr += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|   113k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  846|   113k|        pi2_tmp_ptr += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|   113k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  847|   113k|        pu2_iscal_mat += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|   113k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  848|   113k|        pu2_weigh_mat += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|   113k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  849|   113k|    }
  850|       |
  851|       |    /* vertical inverse transform */
  852|  28.3k|    pi2_tmp_ptr = pi2_tmp;
  853|   141k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|   141k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (853:16): [True: 113k, False: 28.3k]
  ------------------
  854|   113k|    {
  855|   113k|        pu1_pred_ptr = pu1_pred;
  856|   113k|        pu1_out = pu1_out_ptr;
  857|       |
  858|   113k|        x0 = (pi2_tmp_ptr[0] + pi2_tmp_ptr[8]);
  859|   113k|        x1 = (pi2_tmp_ptr[0] - pi2_tmp_ptr[8]);
  860|   113k|        x2 = (pi2_tmp_ptr[4] >> 1) - pi2_tmp_ptr[12];
  861|   113k|        x3 = pi2_tmp_ptr[4] + (pi2_tmp_ptr[12] >> 1);
  862|       |
  863|       |        /* inverse prediction */
  864|   113k|        i_macro = x0 + x3;
  865|   113k|        i_macro = ((i_macro + 32) >> 6);
  866|   113k|        i_macro += *pu1_pred_ptr;
  867|   113k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   113k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   113k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 21.2k, False: 92.1k]
  |  |  |  |  |  Branch (77:54): [True: 23.9k, False: 68.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  868|   113k|        pu1_pred_ptr += pred_strd;
  869|   113k|        pu1_out += out_strd;
  870|       |
  871|   113k|        i_macro = x1 + x2;
  872|   113k|        i_macro = ((i_macro + 32) >> 6);
  873|   113k|        i_macro += *pu1_pred_ptr;
  874|   113k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   113k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   113k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 21.4k, False: 91.8k]
  |  |  |  |  |  Branch (77:54): [True: 23.7k, False: 68.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  875|   113k|        pu1_pred_ptr += pred_strd;
  876|   113k|        pu1_out += out_strd;
  877|       |
  878|   113k|        i_macro = x1 - x2;
  879|   113k|        i_macro = ((i_macro + 32) >> 6);
  880|   113k|        i_macro += *pu1_pred_ptr;
  881|   113k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   113k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   113k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 20.5k, False: 92.8k]
  |  |  |  |  |  Branch (77:54): [True: 23.8k, False: 69.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  882|   113k|        pu1_pred_ptr += pred_strd;
  883|   113k|        pu1_out += out_strd;
  884|       |
  885|   113k|        i_macro = x0 - x3;
  886|   113k|        i_macro = ((i_macro + 32) >> 6);
  887|   113k|        i_macro += *pu1_pred_ptr;
  888|   113k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   113k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   113k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 22.9k, False: 90.4k]
  |  |  |  |  |  Branch (77:54): [True: 23.4k, False: 66.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  889|       |
  890|   113k|        pi2_tmp_ptr++;
  891|   113k|        pu1_out_ptr += 2; // Interleaved store for output
  892|   113k|        pu1_pred += 2; // Interleaved load for pred buffer
  893|   113k|    }
  894|  28.3k|}
ih264_iquant_itrans_recon_chroma_4x4_dc:
  950|   139k|{
  951|   139k|    UWORD8 *pu1_pred_ptr = pu1_pred;
  952|   139k|    UWORD8 *pu1_out_ptr = pu1_out;
  953|   139k|    WORD32 q0;
  954|   139k|    WORD16 x, i_macro, i;
  955|       |
  956|   139k|    UNUSED(pi2_src);
  ------------------
  |  |   45|   139k|#define UNUSED(x) ((void)(x))
  ------------------
  957|   139k|    UNUSED(pu2_iscal_mat);
  ------------------
  |  |   45|   139k|#define UNUSED(x) ((void)(x))
  ------------------
  958|   139k|    UNUSED(pu2_weigh_mat);
  ------------------
  |  |   45|   139k|#define UNUSED(x) ((void)(x))
  ------------------
  959|   139k|    UNUSED(u4_qp_div_6);
  ------------------
  |  |   45|   139k|#define UNUSED(x) ((void)(x))
  ------------------
  960|   139k|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|   139k|#define UNUSED(x) ((void)(x))
  ------------------
  961|       |
  962|   139k|    q0 = pi2_dc_src[0];    // Restoring dc value for intra case3
  963|   139k|    i_macro = ((q0 + 32) >> 6);
  964|       |
  965|   697k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|   697k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (965:16): [True: 557k, False: 139k]
  ------------------
  966|   557k|    {
  967|   557k|        pu1_pred_ptr = pu1_pred;
  968|   557k|        pu1_out = pu1_out_ptr;
  969|       |
  970|       |        /* inverse prediction */
  971|   557k|        x = i_macro + *pu1_pred_ptr;
  972|   557k|        *pu1_out =  CLIP_U8(x);
  ------------------
  |  |   58|   557k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   557k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 142k, False: 415k]
  |  |  |  |  |  Branch (77:54): [True: 10.6k, False: 404k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  973|   557k|        pu1_pred_ptr += pred_strd;
  974|   557k|        pu1_out += out_strd;
  975|       |
  976|   557k|        x = i_macro + *pu1_pred_ptr;
  977|   557k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|   557k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   557k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 142k, False: 415k]
  |  |  |  |  |  Branch (77:54): [True: 10.6k, False: 404k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  978|   557k|        pu1_pred_ptr += pred_strd;
  979|   557k|        pu1_out += out_strd;
  980|       |
  981|   557k|        x = i_macro + *pu1_pred_ptr;
  982|   557k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|   557k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   557k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 142k, False: 415k]
  |  |  |  |  |  Branch (77:54): [True: 10.6k, False: 404k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  983|   557k|        pu1_pred_ptr += pred_strd;
  984|   557k|        pu1_out += out_strd;
  985|       |
  986|   557k|        x = i_macro + *pu1_pred_ptr;
  987|   557k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|   557k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   557k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 142k, False: 415k]
  |  |  |  |  |  Branch (77:54): [True: 10.6k, False: 405k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  988|       |
  989|   557k|        pu1_out_ptr+=2;
  990|   557k|        pu1_pred+=2;
  991|   557k|    }
  992|   139k|}

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

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

ih264_default_weighted_pred_luma:
  110|  66.5k|{
  111|  66.5k|    WORD32 i, j;
  112|       |
  113|  66.5k|    src_strd1 -= wd;
  114|  66.5k|    src_strd2 -= wd;
  115|  66.5k|    dst_strd -= wd;
  116|       |
  117|  1.04M|    for(i = 0; i < ht; i++)
  ------------------
  |  Branch (117:16): [True: 978k, False: 66.5k]
  ------------------
  118|   978k|    {
  119|  15.8M|        for(j = 0; j < wd; j++, pu1_src1++, pu1_src2++, pu1_dst++)
  ------------------
  |  Branch (119:20): [True: 14.8M, False: 978k]
  ------------------
  120|  14.8M|            *pu1_dst = (*pu1_src1 + *pu1_src2 + 1) >> 1;
  121|       |
  122|   978k|        pu1_src1 += src_strd1;
  123|   978k|        pu1_src2 += src_strd2;
  124|   978k|        pu1_dst += dst_strd;
  125|   978k|    }
  126|  66.5k|}
ih264_default_weighted_pred_chroma:
  178|  66.5k|{
  179|  66.5k|    WORD32 i, j;
  180|       |
  181|  66.5k|    wd = wd << 1;
  182|       |
  183|  66.5k|    src_strd1 -= wd;
  184|  66.5k|    src_strd2 -= wd;
  185|  66.5k|    dst_strd -= wd;
  186|       |
  187|   555k|    for(i = 0; i < ht; i++)
  ------------------
  |  Branch (187:16): [True: 489k, False: 66.5k]
  ------------------
  188|   489k|    {
  189|  7.91M|        for(j = 0; j < wd; j++, pu1_src1++, pu1_src2++, pu1_dst++)
  ------------------
  |  Branch (189:20): [True: 7.42M, False: 489k]
  ------------------
  190|  7.42M|            *pu1_dst = (*pu1_src1 + *pu1_src2 + 1) >> 1;
  191|       |
  192|   489k|        pu1_src1 += src_strd1;
  193|   489k|        pu1_src2 += src_strd2;
  194|   489k|        pu1_dst += dst_strd;
  195|   489k|    }
  196|  66.5k|}
ih264_weighted_pred_luma:
  252|  1.37M|{
  253|  1.37M|    WORD32 i, j;
  254|       |
  255|  1.37M|    wt = (WORD16)(wt & 0xffff);
  256|  1.37M|    ofst = (WORD8)(ofst & 0xff);
  257|       |
  258|  1.37M|    src_strd -= wd;
  259|  1.37M|    dst_strd -= wd;
  260|       |
  261|  1.37M|    if(log_wd >= 1)
  ------------------
  |  Branch (261:8): [True: 478k, False: 897k]
  ------------------
  262|   478k|    {
  263|   478k|        WORD32 i_ofst = (1 << (log_wd - 1)) + (ofst << log_wd);
  264|  7.64M|        for(i = 0; i < ht; i++)
  ------------------
  |  Branch (264:20): [True: 7.17M, False: 478k]
  ------------------
  265|  7.17M|        {
  266|   117M|            for(j = 0; j < wd; j++, pu1_src++, pu1_dst++)
  ------------------
  |  Branch (266:24): [True: 110M, False: 7.17M]
  ------------------
  267|   110M|                *pu1_dst = CLIP_U8((wt * (*pu1_src) + i_ofst) >> log_wd);
  ------------------
  |  |   58|   110M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   110M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 32.8M, False: 77.7M]
  |  |  |  |  |  Branch (77:54): [True: 208k, False: 77.4M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  268|       |
  269|  7.17M|            pu1_src += src_strd;
  270|  7.17M|            pu1_dst += dst_strd;
  271|  7.17M|        }
  272|   478k|    }
  273|   897k|    else
  274|   897k|    {
  275|  15.0M|        for(i = 0; i < ht; i++)
  ------------------
  |  Branch (275:20): [True: 14.1M, False: 897k]
  ------------------
  276|  14.1M|        {
  277|   238M|            for(j = 0; j < wd; j++, pu1_src++, pu1_dst++)
  ------------------
  |  Branch (277:24): [True: 224M, False: 14.1M]
  ------------------
  278|   224M|                *pu1_dst = CLIP_U8(wt * (*pu1_src) + ofst);
  ------------------
  |  |   58|   224M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   224M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 6.41M, False: 217M]
  |  |  |  |  |  Branch (77:54): [True: 1.05M, False: 216M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  279|       |
  280|  14.1M|            pu1_src += src_strd;
  281|  14.1M|            pu1_dst += dst_strd;
  282|  14.1M|        }
  283|   897k|    }
  284|  1.37M|}
ih264_weighted_pred_chroma:
  340|  1.37M|{
  341|  1.37M|    WORD32 i, j;
  342|  1.37M|    WORD32 wt_u, wt_v;
  343|  1.37M|    WORD32 ofst_u, ofst_v;
  344|       |
  345|  1.37M|    wt_u = (WORD16)(wt & 0xffff);
  346|  1.37M|    wt_v = (WORD16)(wt >> 16);
  347|       |
  348|  1.37M|    ofst_u = (WORD8)(ofst & 0xff);
  349|  1.37M|    ofst_v = (WORD8)(ofst >> 8);
  350|       |
  351|  1.37M|    src_strd -= wd << 1;
  352|  1.37M|    dst_strd -= wd << 1;
  353|       |
  354|  1.37M|    if(log_wd >= 1)
  ------------------
  |  Branch (354:8): [True: 425k, False: 950k]
  ------------------
  355|   425k|    {
  356|   425k|        ofst_u = (1 << (log_wd - 1)) + (ofst_u << log_wd);
  357|   425k|        ofst_v = (1 << (log_wd - 1)) + (ofst_v << log_wd);
  358|       |
  359|  3.69M|        for(i = 0; i < ht; i++)
  ------------------
  |  Branch (359:20): [True: 3.27M, False: 425k]
  ------------------
  360|  3.27M|        {
  361|  28.7M|            for(j = 0; j < wd; j++, pu1_src++, pu1_dst++)
  ------------------
  |  Branch (361:24): [True: 25.4M, False: 3.27M]
  ------------------
  362|  25.4M|            {
  363|  25.4M|                *pu1_dst = CLIP_U8((wt_u * (*pu1_src) + ofst_u) >> log_wd);
  ------------------
  |  |   58|  25.4M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  25.4M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 1.89M, False: 23.6M]
  |  |  |  |  |  Branch (77:54): [True: 2.76M, False: 20.8M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  364|  25.4M|                pu1_src++;
  365|  25.4M|                pu1_dst++;
  366|  25.4M|                *pu1_dst = CLIP_U8((wt_v * (*pu1_src) + ofst_v) >> log_wd);
  ------------------
  |  |   58|  25.4M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  25.4M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 1.69M, False: 23.7M]
  |  |  |  |  |  Branch (77:54): [True: 2.06M, False: 21.7M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  367|  25.4M|            }
  368|  3.27M|            pu1_src += src_strd;
  369|  3.27M|            pu1_dst += dst_strd;
  370|  3.27M|        }
  371|   425k|    }
  372|   950k|    else
  373|   950k|    {
  374|  8.31M|        for(i = 0; i < ht; i++)
  ------------------
  |  Branch (374:20): [True: 7.36M, False: 950k]
  ------------------
  375|  7.36M|        {
  376|  65.5M|            for(j = 0; j < wd; j++, pu1_src++, pu1_dst++)
  ------------------
  |  Branch (376:24): [True: 58.1M, False: 7.36M]
  ------------------
  377|  58.1M|            {
  378|  58.1M|                *pu1_dst = CLIP_U8(wt_u * (*pu1_src) + ofst_u);
  ------------------
  |  |   58|  58.1M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  58.1M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 1.69M, False: 56.4M]
  |  |  |  |  |  Branch (77:54): [True: 368k, False: 56.1M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  379|  58.1M|                pu1_src++;
  380|  58.1M|                pu1_dst++;
  381|  58.1M|                *pu1_dst = CLIP_U8(wt_v * (*pu1_src) + ofst_v);
  ------------------
  |  |   58|  58.1M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  58.1M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 890k, False: 57.2M]
  |  |  |  |  |  Branch (77:54): [True: 311k, False: 56.9M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  382|  58.1M|            }
  383|  7.36M|            pu1_src += src_strd;
  384|  7.36M|            pu1_dst += dst_strd;
  385|  7.36M|        }
  386|   950k|    }
  387|  1.37M|}
ih264_weighted_bi_pred_luma:
  460|   278k|{
  461|   278k|    WORD32 i, j;
  462|   278k|    WORD32 shft, ofst;
  463|       |
  464|   278k|    ofst1 = (WORD8)(ofst1 & 0xff);
  465|   278k|    ofst2 = (WORD8)(ofst2 & 0xff);
  466|   278k|    wt1 = (WORD16)(wt1 & 0xffff);
  467|   278k|    wt2 = (WORD16)(wt2 & 0xffff);
  468|   278k|    ofst = (ofst1 + ofst2 + 1) >> 1;
  469|       |
  470|   278k|    shft = log_wd + 1;
  471|   278k|    ofst = (1 << log_wd) + (ofst << shft);
  472|       |
  473|   278k|    src_strd1 -= wd;
  474|   278k|    src_strd2 -= wd;
  475|   278k|    dst_strd -= wd;
  476|       |
  477|  4.63M|    for(i = 0; i < ht; i++)
  ------------------
  |  Branch (477:16): [True: 4.35M, False: 278k]
  ------------------
  478|  4.35M|    {
  479|  72.7M|        for(j = 0; j < wd; j++, pu1_src1++, pu1_src2++, pu1_dst++)
  ------------------
  |  Branch (479:20): [True: 68.3M, False: 4.35M]
  ------------------
  480|  68.3M|            *pu1_dst = CLIP_U8((wt1 * (*pu1_src1) + wt2 * (*pu1_src2) + ofst) >> shft);
  ------------------
  |  |   58|  68.3M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  68.3M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 26.9M, False: 41.4M]
  |  |  |  |  |  Branch (77:54): [True: 766k, False: 40.6M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  481|       |
  482|  4.35M|        pu1_src1 += src_strd1;
  483|  4.35M|        pu1_src2 += src_strd2;
  484|  4.35M|        pu1_dst += dst_strd;
  485|  4.35M|    }
  486|   278k|}
ih264_weighted_bi_pred_chroma:
  559|   278k|{
  560|   278k|    WORD32 i, j;
  561|   278k|    WORD32 wt1_u, wt1_v, wt2_u, wt2_v;
  562|   278k|    WORD32 ofst1_u, ofst1_v, ofst2_u, ofst2_v;
  563|   278k|    WORD32 ofst_u, ofst_v;
  564|   278k|    WORD32 shft;
  565|       |
  566|   278k|    ofst1_u = (WORD8)(ofst1 & 0xff);
  567|   278k|    ofst1_v = (WORD8)(ofst1 >> 8);
  568|   278k|    ofst2_u = (WORD8)(ofst2 & 0xff);
  569|   278k|    ofst2_v = (WORD8)(ofst2 >> 8);
  570|   278k|    wt1_u = (WORD16)(wt1 & 0xffff);
  571|   278k|    wt1_v = (WORD16)(wt1 >> 16);
  572|   278k|    wt2_u = (WORD16)(wt2 & 0xffff);
  573|   278k|    wt2_v = (WORD16)(wt2 >> 16);
  574|   278k|    ofst_u = (ofst1_u + ofst2_u + 1) >> 1;
  575|   278k|    ofst_v = (ofst1_v + ofst2_v + 1) >> 1;
  576|       |
  577|   278k|    src_strd1 -= wd << 1;
  578|   278k|    src_strd2 -= wd << 1;
  579|   278k|    dst_strd -= wd << 1;
  580|       |
  581|   278k|    shft = log_wd + 1;
  582|   278k|    ofst_u = (1 << log_wd) + (ofst_u << shft);
  583|   278k|    ofst_v = (1 << log_wd) + (ofst_v << shft);
  584|       |
  585|  2.45M|    for(i = 0; i < ht; i++)
  ------------------
  |  Branch (585:16): [True: 2.17M, False: 278k]
  ------------------
  586|  2.17M|    {
  587|  19.2M|        for(j = 0; j < wd; j++, pu1_src1++, pu1_src2++, pu1_dst++)
  ------------------
  |  Branch (587:20): [True: 17.0M, False: 2.17M]
  ------------------
  588|  17.0M|        {
  589|  17.0M|            *pu1_dst = CLIP_U8((wt1_u * (*pu1_src1) + wt2_u * (*pu1_src2) + ofst_u) >> shft);
  ------------------
  |  |   58|  17.0M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  17.0M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 1.04M, False: 16.0M]
  |  |  |  |  |  Branch (77:54): [True: 743k, False: 15.3M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  590|  17.0M|            pu1_src1++;
  591|  17.0M|            pu1_src2++;
  592|  17.0M|            pu1_dst++;
  593|  17.0M|            *pu1_dst = CLIP_U8((wt1_v * (*pu1_src1) + wt2_v * (*pu1_src2) + ofst_v) >> shft);
  ------------------
  |  |   58|  17.0M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  17.0M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 1.87M, False: 15.2M]
  |  |  |  |  |  Branch (77:54): [True: 112k, False: 15.1M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  594|  17.0M|        }
  595|  2.17M|        pu1_src1 += src_strd1;
  596|  2.17M|        pu1_src2 += src_strd2;
  597|  2.17M|        pu1_dst += dst_strd;
  598|  2.17M|    }
  599|   278k|}

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

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

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

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

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

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

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

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

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

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

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

isvcd_parse_epslice.c:CLZ:
   97|   647k|{
   98|   647k|    if(u4_word)
  ------------------
  |  Branch (98:8): [True: 637k, False: 10.3k]
  ------------------
   99|   637k|    return(__builtin_clz(u4_word));
  100|  10.3k|    else
  101|  10.3k|        return 31;
  102|   647k|}
ih264_iquant_itrans_recon_sse42.c:loadu_32:
   47|   275k|{
   48|   275k|  struct __loadu_si32 {
   49|   275k|    int __v;
   50|   275k|  } __attribute__((__packed__, __may_alias__));
   51|   275k|  int __u = ((struct __loadu_si32*)__a)->__v;
   52|   275k|  return __extension__ (__m128i)(__v4si){__u, 0, 0, 0};
   53|   275k|}
ih264d_cabac.c:CLZ:
   97|  6.78M|{
   98|  6.78M|    if(u4_word)
  ------------------
  |  Branch (98:8): [True: 6.78M, False: 0]
  ------------------
   99|  6.78M|    return(__builtin_clz(u4_word));
  100|      0|    else
  101|      0|        return 31;
  102|  6.78M|}
ih264d_parse_cabac.c:CLZ:
   97|  14.1M|{
   98|  14.1M|    if(u4_word)
  ------------------
  |  Branch (98:8): [True: 14.1M, False: 0]
  ------------------
   99|  14.1M|    return(__builtin_clz(u4_word));
  100|      0|    else
  101|      0|        return 31;
  102|  14.1M|}
ih264d_parse_cavlc.c:CLZ:
   97|  7.51M|{
   98|  7.51M|    if(u4_word)
  ------------------
  |  Branch (98:8): [True: 7.22M, False: 292k]
  ------------------
   99|  7.22M|    return(__builtin_clz(u4_word));
  100|   292k|    else
  101|   292k|        return 31;
  102|  7.51M|}
ih264d_parse_islice.c:CLZ:
   97|   110k|{
   98|   110k|    if(u4_word)
  ------------------
  |  Branch (98:8): [True: 109k, False: 1.32k]
  ------------------
   99|   109k|    return(__builtin_clz(u4_word));
  100|  1.32k|    else
  101|  1.32k|        return 31;
  102|   110k|}
ih264d_parse_mb_header.c:CLZ:
   97|  5.67M|{
   98|  5.67M|    if(u4_word)
  ------------------
  |  Branch (98:8): [True: 5.67M, False: 0]
  ------------------
   99|  5.67M|    return(__builtin_clz(u4_word));
  100|      0|    else
  101|      0|        return 31;
  102|  5.67M|}
ih264d_parse_pslice.c:CLZ:
   97|   167k|{
   98|   167k|    if(u4_word)
  ------------------
  |  Branch (98:8): [True: 160k, False: 6.62k]
  ------------------
   99|   160k|    return(__builtin_clz(u4_word));
  100|  6.62k|    else
  101|  6.62k|        return 31;
  102|   167k|}
ih264d_process_intra_mb.c:CLZ:
   97|  1.46M|{
   98|  1.46M|    if(u4_word)
  ------------------
  |  Branch (98:8): [True: 1.46M, False: 0]
  ------------------
   99|  1.46M|    return(__builtin_clz(u4_word));
  100|      0|    else
  101|      0|        return 31;
  102|  1.46M|}
ih264d_utils.c:CLZ:
   97|   282k|{
   98|   282k|    if(u4_word)
  ------------------
  |  Branch (98:8): [True: 282k, False: 0]
  ------------------
   99|   282k|    return(__builtin_clz(u4_word));
  100|      0|    else
  101|      0|        return 31;
  102|   282k|}
isvcd_parse_cavlc.c:CLZ:
   97|  13.8k|{
   98|  13.8k|    if(u4_word)
  ------------------
  |  Branch (98:8): [True: 13.6k, False: 259]
  ------------------
   99|  13.6k|    return(__builtin_clz(u4_word));
  100|    259|    else
  101|    259|        return 31;
  102|  13.8k|}
isvcd_parse_ebslice.c:CLZ:
   97|  83.9k|{
   98|  83.9k|    if(u4_word)
  ------------------
  |  Branch (98:8): [True: 82.0k, False: 1.94k]
  ------------------
   99|  82.0k|    return(__builtin_clz(u4_word));
  100|  1.94k|    else
  101|  1.94k|        return 31;
  102|  83.9k|}
isvcd_parse_eislice.c:CLZ:
   97|   302k|{
   98|   302k|    if(u4_word)
  ------------------
  |  Branch (98:8): [True: 300k, False: 2.00k]
  ------------------
   99|   300k|    return(__builtin_clz(u4_word));
  100|  2.00k|    else
  101|  2.00k|        return 31;
  102|   302k|}
ih264d_parse_bslice.c:CLZ:
   97|   172k|{
   98|   172k|    if(u4_word)
  ------------------
  |  Branch (98:8): [True: 167k, False: 5.42k]
  ------------------
   99|   167k|    return(__builtin_clz(u4_word));
  100|  5.42k|    else
  101|  5.42k|        return 31;
  102|   172k|}

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

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

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

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

ih264d_update_csbp_8x8:
   32|   275k|{
   33|   275k|    UWORD16 u2_mod_csbp;
   34|       |
   35|   275k|    u2_mod_csbp = u2_luma_csbp;
   36|       |
   37|   275k|    if(u2_mod_csbp & 0x0033)
  ------------------
  |  Branch (37:8): [True: 45.8k, False: 229k]
  ------------------
   38|  45.8k|    {
   39|  45.8k|        u2_mod_csbp |= 0x0033;
   40|  45.8k|    }
   41|       |
   42|   275k|    if(u2_mod_csbp & 0x00CC)
  ------------------
  |  Branch (42:8): [True: 41.9k, False: 233k]
  ------------------
   43|  41.9k|    {
   44|  41.9k|        u2_mod_csbp |= 0x00CC;
   45|  41.9k|    }
   46|       |
   47|   275k|    if(u2_mod_csbp & 0x3300)
  ------------------
  |  Branch (47:8): [True: 46.6k, False: 228k]
  ------------------
   48|  46.6k|    {
   49|  46.6k|        u2_mod_csbp |= 0x3300;
   50|  46.6k|    }
   51|       |
   52|   275k|    if(u2_mod_csbp & 0xCC00)
  ------------------
  |  Branch (52:8): [True: 45.1k, False: 229k]
  ------------------
   53|  45.1k|    {
   54|  45.1k|        u2_mod_csbp |= 0xCC00;
   55|  45.1k|    }
   56|       |
   57|   275k|    return u2_mod_csbp;
   58|   275k|}
ih264d_fill_bs2_horz_vert:
  115|  6.51M|{
  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.51M|    UWORD32 u4_nbr_horz_csbp = (u4_cur_mb_csbp << 4) | (u4_top_mb_csbp >> 12);
  120|  6.51M|    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.51M|    UWORD32 u4_left_mb_masked_csbp = u4_left_mb_csbp & CSBP_RIGHT_BLOCK_MASK;
  ------------------
  |  |  108|  6.51M|#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.51M|    UWORD32 u4_cur_mb_masked_csbp = (u4_cur_mb_csbp << 1)
  131|  6.51M|                    & (~CSBP_LEFT_BLOCK_MASK);
  ------------------
  |  |  107|  6.51M|#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.51M|    UWORD32 u4_nbr_vert_csbp = (u4_cur_mb_masked_csbp)
  137|  6.51M|                    | (u4_left_mb_masked_csbp >> 3);
  138|       |
  139|  6.51M|    UWORD32 u4_vert_bs2_dec = u4_cur_mb_csbp | u4_nbr_vert_csbp;
  140|       |
  141|  6.51M|    UWORD32 u4_reordered_vert_bs2_dec, u4_temp;
  142|       |
  143|  6.51M|    PROFILE_DISABLE_BOUNDARY_STRENGTH()
  ------------------
  |  |  125|  6.51M|#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.51M|    pu4_bs[0] = pu4_packed_bs2[u4_horz_bs2_dec & 0xF];
  149|  6.51M|    pu4_bs[1] = pu4_packed_bs2[(u4_horz_bs2_dec >> 4) & 0xF];
  150|  6.51M|    pu4_bs[2] = pu4_packed_bs2[(u4_horz_bs2_dec >> 8) & 0xF];
  151|  6.51M|    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.51M|    u4_reordered_vert_bs2_dec = pu2_4x4_v2h_reorder[u4_vert_bs2_dec & 0xF];
  157|  6.51M|    u4_temp = pu2_4x4_v2h_reorder[(u4_vert_bs2_dec >> 4) & 0xF];
  158|  6.51M|    u4_reordered_vert_bs2_dec |= (u4_temp << 1);
  159|  6.51M|    u4_temp = pu2_4x4_v2h_reorder[(u4_vert_bs2_dec >> 8) & 0xF];
  160|  6.51M|    u4_reordered_vert_bs2_dec |= (u4_temp << 2);
  161|  6.51M|    u4_temp = pu2_4x4_v2h_reorder[(u4_vert_bs2_dec >> 12) & 0xF];
  162|  6.51M|    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.51M|    pu4_bs[4] = pu4_packed_bs2[u4_reordered_vert_bs2_dec & 0xF];
  168|  6.51M|    pu4_bs[5] = pu4_packed_bs2[(u4_reordered_vert_bs2_dec >> 4) & 0xF];
  169|  6.51M|    pu4_bs[6] = pu4_packed_bs2[(u4_reordered_vert_bs2_dec >> 8) & 0xF];
  170|  6.51M|    pu4_bs[7] = pu4_packed_bs2[(u4_reordered_vert_bs2_dec >> 12) & 0xF];
  171|  6.51M|}
ih264d_fill_bs1_16x16mb_pslice:
  206|  3.11M|{
  207|  3.11M|    WORD16 i2_q_mv0, i2_q_mv1;
  208|  3.11M|    WORD16 i2_p_mv0, i2_p_mv1;
  209|  3.11M|    void *pv_cur_pic_addr0, *pv_cur_pic_addr1;
  210|  3.11M|    void *pv_nbr_pic_addr0, *pv_nbr_pic_addr1;
  211|  3.11M|    void **ppv_map_ref_idx_to_poc_l0; //,*ppv_map_ref_idx_to_poc_l1;
  212|  3.11M|    UWORD32 i;
  213|  3.11M|    UWORD32 u4_bs_horz = pu4_bs_table[0];
  214|  3.11M|    UWORD32 u4_bs_vert = pu4_bs_table[4];
  215|       |
  216|  3.11M|    PROFILE_DISABLE_BOUNDARY_STRENGTH()
  ------------------
  |  |  125|  3.11M|#define PROFILE_DISABLE_BOUNDARY_STRENGTH() ;
  ------------------
  217|       |
  218|  3.11M|    ppv_map_ref_idx_to_poc_l0 = ppv_map_ref_idx_to_poc;
  219|       |
  220|  3.11M|    i2_q_mv0 = ps_cur_mv_pred->i2_mv[0];
  221|  3.11M|    i2_q_mv1 = ps_cur_mv_pred->i2_mv[1];
  222|  3.11M|    pv_cur_pic_addr0 = ppv_map_ref_idx_to_poc_l0[ps_cur_mv_pred->i1_ref_frame[0]];
  223|  3.11M|    pv_cur_pic_addr1 = 0;
  224|       |
  225|       |    /*********************************/
  226|       |    /* Computing Bs for the top edge */
  227|       |    /*********************************/
  228|  15.5M|    for(i = 0; i < 4; i++, ps_top_mv_pred++)
  ------------------
  |  Branch (228:16): [True: 12.4M, False: 3.11M]
  ------------------
  229|  12.4M|    {
  230|  12.4M|        UWORD32 u4_idx = 24 - (i << 3);
  231|       |
  232|       |        /*********************************/
  233|       |        /* check if Bs is already set    */
  234|       |        /*********************************/
  235|  12.4M|        if(!((u4_bs_horz >> u4_idx) & 0xf))
  ------------------
  |  Branch (235:12): [True: 12.2M, False: 192k]
  ------------------
  236|  12.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|  12.2M|            UWORD32 u4_bs_temp1;
  242|  12.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|  12.2M|            i2_p_mv0 = ps_top_mv_pred->i2_mv[0];
  251|  12.2M|            i2_p_mv1 = ps_top_mv_pred->i2_mv[1];
  252|  12.2M|            pv_nbr_pic_addr0 = u4_pic_addrress[i & 2];
  253|  12.2M|            pv_nbr_pic_addr1 = u4_pic_addrress[1 + (i & 2)];
  254|       |
  255|  12.2M|            u4_bs_temp1 = ((ABS((i2_p_mv0 - i2_q_mv0)) >= 4) ||
  ------------------
  |  |  100|  12.2M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 68.9k, False: 12.2M]
  |  |  ------------------
  ------------------
  |  Branch (255:28): [True: 48.2k, False: 12.2M]
  ------------------
  256|  12.2M|                           (ABS((i2_p_mv1 - i2_q_mv1)) >= i4_ver_mvlimit));
  ------------------
  |  |  100|  12.2M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 46.7k, False: 12.1M]
  |  |  ------------------
  ------------------
  |  Branch (256:28): [True: 31.6k, False: 12.1M]
  ------------------
  257|       |
  258|  12.2M|            u4_bs = ((pv_cur_pic_addr0 != pv_nbr_pic_addr0)
  ------------------
  |  Branch (258:22): [True: 514k, False: 11.7M]
  ------------------
  259|  11.7M|                            || (pv_cur_pic_addr1 != pv_nbr_pic_addr1)
  ------------------
  |  Branch (259:32): [True: 3.47k, False: 11.7M]
  ------------------
  260|  11.7M|                            || u4_bs_temp1);
  ------------------
  |  Branch (260:32): [True: 70.2k, False: 11.6M]
  ------------------
  261|       |
  262|  12.2M|            u4_bs_horz |= (u4_bs << u4_idx);
  263|  12.2M|        }
  264|  12.4M|    }
  265|  3.11M|    pu4_bs_table[0] = u4_bs_horz;
  266|       |
  267|       |    /***********************************/
  268|       |    /* Computing Bs for the left edge  */
  269|       |    /***********************************/
  270|  15.5M|    for(i = 0; i < 4; i++, ps_leftmost_mv_pred += 4)
  ------------------
  |  Branch (270:16): [True: 12.4M, False: 3.11M]
  ------------------
  271|  12.4M|    {
  272|  12.4M|        UWORD32 u4_idx = 24 - (i << 3);
  273|       |
  274|       |        /*********************************/
  275|       |        /* check if Bs is already set    */
  276|       |        /*********************************/
  277|  12.4M|        if(!((u4_bs_vert >> u4_idx) & 0xf))
  ------------------
  |  Branch (277:12): [True: 12.3M, False: 96.1k]
  ------------------
  278|  12.3M|        {
  279|       |            /****************************************************/
  280|       |            /* If Bs is not set, evalaute conditions for Bs=1   */
  281|       |            /****************************************************/
  282|  12.3M|            UWORD32 u4_bs_temp1;
  283|  12.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|  12.3M|            i2_p_mv0 = ps_leftmost_mv_pred->i2_mv[0];
  292|  12.3M|            i2_p_mv1 = ps_leftmost_mv_pred->i2_mv[1];
  293|  12.3M|            pv_nbr_pic_addr0 = ps_left_addr->u4_add[i & 2];
  294|  12.3M|            pv_nbr_pic_addr1 = ps_left_addr->u4_add[1 + (i & 2)];
  295|       |
  296|  12.3M|            u4_bs_temp1 =
  297|  12.3M|                            ((ABS((i2_p_mv0 - i2_q_mv0))
  ------------------
  |  |  100|  12.3M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 42.8k, False: 12.3M]
  |  |  ------------------
  ------------------
  298|  12.3M|                                            >= 4)
  299|  12.3M|                                            | (ABS((i2_p_mv1 - i2_q_mv1))
  ------------------
  |  |  100|  12.3M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 42.7k, False: 12.3M]
  |  |  ------------------
  ------------------
  300|  12.3M|                                                            >= i4_ver_mvlimit));
  301|       |
  302|  12.3M|            u4_bs = ((pv_cur_pic_addr0 != pv_nbr_pic_addr0)
  ------------------
  |  Branch (302:22): [True: 50.8k, False: 12.3M]
  ------------------
  303|  12.3M|                            || (pv_cur_pic_addr1 != pv_nbr_pic_addr1)
  ------------------
  |  Branch (303:32): [True: 1.68k, False: 12.3M]
  ------------------
  304|  12.3M|                            || u4_bs_temp1);
  ------------------
  |  Branch (304:32): [True: 60.3k, False: 12.2M]
  ------------------
  305|       |
  306|  12.3M|            u4_bs_vert |= (u4_bs << u4_idx);
  307|  12.3M|        }
  308|  12.4M|    }
  309|  3.11M|    pu4_bs_table[4] = u4_bs_vert;
  310|       |
  311|  3.11M|    return;
  312|  3.11M|}
ih264d_fill_bs1_non16x16mb_pslice:
  347|  78.6k|{
  348|  78.6k|    UWORD32 edge;
  349|  78.6k|    void **ppv_map_ref_idx_to_poc_l0; //,*ppv_map_ref_idx_to_poc_l1;
  350|       |
  351|  78.6k|    PROFILE_DISABLE_BOUNDARY_STRENGTH()
  ------------------
  |  |  125|  78.6k|#define PROFILE_DISABLE_BOUNDARY_STRENGTH() ;
  ------------------
  352|       |
  353|  78.6k|    ppv_map_ref_idx_to_poc_l0 = ppv_map_ref_idx_to_poc;
  354|       |
  355|       |
  356|   393k|    for(edge = 0; edge < 4; edge++, ps_top_mv_pred = ps_cur_mv_pred - 4)
  ------------------
  |  Branch (356:19): [True: 314k, False: 78.6k]
  ------------------
  357|   314k|    {
  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|   314k|        WORD32 i;
  363|   314k|        UWORD32 u4_vert_idx = 24 - (edge << 3);
  364|   314k|        UWORD32 u4_bs_horz = pu4_bs_table[edge];
  365|   314k|        mv_pred_t *ps_left_mv_pred = ps_leftmost_mv_pred + (edge << 2);
  366|       |
  367|  1.57M|        for(i = 0; i < 4; i++, ps_top_mv_pred++, ps_cur_mv_pred++)
  ------------------
  |  Branch (367:20): [True: 1.25M, False: 314k]
  ------------------
  368|  1.25M|        {
  369|  1.25M|            WORD16 i2_cur_mv0, i2_cur_mv1;
  370|  1.25M|            WORD8 i1_cur_ref0;
  371|  1.25M|            void *pv_cur_pic_addr0, *pv_cur_pic_addr1 = 0;
  372|  1.25M|            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.25M|            UWORD32 u4_bs_vert = (pu4_bs_table[i + 4] >> u4_vert_idx) & 0xf;
  379|  1.25M|            UWORD32 u4_horz_idx = 24 - (i << 3);
  380|       |
  381|       |            /*****************************************************/
  382|       |            /* check if vert Bs for this block is already set    */
  383|       |            /*****************************************************/
  384|  1.25M|            if(!u4_bs_vert)
  ------------------
  |  Branch (384:16): [True: 1.15M, False: 108k]
  ------------------
  385|  1.15M|            {
  386|  1.15M|                WORD16 i2_left_mv0, i2_left_mv1;
  387|       |                /************************************************************/
  388|       |                /* If Bs is not set, use left edge and current edge mvs and */
  389|       |                /* reference pictures addresses to evaluate Bs==1           */
  390|       |                /************************************************************/
  391|  1.15M|                i2_left_mv0 = ps_left_mv_pred->i2_mv[0];
  392|  1.15M|                i2_left_mv1 = ps_left_mv_pred->i2_mv[1];
  393|       |
  394|  1.15M|                i2_cur_mv0 = ps_cur_mv_pred->i2_mv[0];
  395|  1.15M|                i2_cur_mv1 = ps_cur_mv_pred->i2_mv[1];
  396|       |
  397|  1.15M|                i1_cur_ref0 = ps_cur_mv_pred->i1_ref_frame[0];
  398|       |
  399|  1.15M|                pv_cur_pic_addr0 = ppv_map_ref_idx_to_poc_l0[i1_cur_ref0];
  400|  1.15M|                if(i)
  ------------------
  |  Branch (400:20): [True: 866k, False: 284k]
  ------------------
  401|   866k|                {
  402|   866k|                    WORD8 i1_left_ref0 = ps_left_mv_pred->i1_ref_frame[0];
  403|   866k|                    pv_nbr_pic_addr0 = ppv_map_ref_idx_to_poc_l0[i1_left_ref0];
  404|   866k|                    pv_nbr_pic_addr1 = 0;
  405|   866k|                }
  406|   284k|                else
  407|   284k|                {
  408|   284k|                    pv_nbr_pic_addr0 = ps_left_addr->u4_add[edge & 2];
  409|   284k|                    pv_nbr_pic_addr1 = ps_left_addr->u4_add[1 + (edge & 2)];
  410|   284k|                }
  411|       |
  412|  1.15M|                {
  413|  1.15M|                    UWORD32 u4_bs_temp1;
  414|       |                    /*********************************************************/
  415|       |                    /* If any motion vector component differs by more than 1 */
  416|       |                    /* integer pel or if reference pictures are different Bs */
  417|       |                    /* is set to 1. Note that this condition shall be met for*/
  418|       |                    /* both (fwd-fwd,bwd-bwd) and (fwd-bwd,bwd-fwd) direction*/
  419|       |                    /*********************************************************/
  420|       |
  421|  1.15M|                    u4_bs_temp1 =
  422|  1.15M|                                    ((ABS((i2_left_mv0 - i2_cur_mv0))
  ------------------
  |  |  100|  1.15M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 103k, False: 1.04M]
  |  |  ------------------
  ------------------
  423|  1.15M|                                                    >= 4)
  424|  1.15M|                                                    | (ABS((i2_left_mv1
  ------------------
  |  |  100|  1.15M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 117k, False: 1.03M]
  |  |  ------------------
  ------------------
  425|  1.15M|                                                                    - i2_cur_mv1))
  426|  1.15M|                                                                    >= i4_ver_mvlimit));
  427|       |
  428|  1.15M|                    u4_bs_vert = ((pv_nbr_pic_addr0 != pv_cur_pic_addr0)
  ------------------
  |  Branch (428:35): [True: 5.75k, False: 1.14M]
  ------------------
  429|  1.14M|                                    || (pv_nbr_pic_addr1 != pv_cur_pic_addr1)
  ------------------
  |  Branch (429:40): [True: 90, False: 1.14M]
  ------------------
  430|  1.14M|                                    || u4_bs_temp1);
  ------------------
  |  Branch (430:40): [True: 99.9k, False: 1.04M]
  ------------------
  431|       |
  432|  1.15M|                    pu4_bs_table[i + 4] |= (u4_bs_vert << u4_vert_idx);
  433|  1.15M|                }
  434|  1.15M|            }
  435|       |
  436|       |            /*****************************************************/
  437|       |            /* check if horz Bs for this block is already set    */
  438|       |            /*****************************************************/
  439|  1.25M|            if(!((u4_bs_horz >> u4_horz_idx) & 0xf))
  ------------------
  |  Branch (439:16): [True: 1.14M, False: 111k]
  ------------------
  440|  1.14M|            {
  441|  1.14M|                WORD16 i2_top_mv0, i2_top_mv1;
  442|       |                /************************************************************/
  443|       |                /* If Bs is not set, use top edge and current edge mvs and  */
  444|       |                /* reference pictures addresses to evaluate Bs==1           */
  445|       |                /************************************************************/
  446|  1.14M|                i2_cur_mv0 = ps_cur_mv_pred->i2_mv[0];
  447|  1.14M|                i2_cur_mv1 = ps_cur_mv_pred->i2_mv[1];
  448|       |
  449|  1.14M|                i1_cur_ref0 = ps_cur_mv_pred->i1_ref_frame[0];
  450|       |
  451|  1.14M|                i2_top_mv0 = ps_top_mv_pred->i2_mv[0];
  452|  1.14M|                i2_top_mv1 = ps_top_mv_pred->i2_mv[1];
  453|       |
  454|  1.14M|                pv_cur_pic_addr0 = ppv_map_ref_idx_to_poc_l0[i1_cur_ref0];
  455|  1.14M|                if(edge)
  ------------------
  |  Branch (455:20): [True: 863k, False: 283k]
  ------------------
  456|   863k|                {
  457|   863k|                    WORD8 i1_top_ref0 = ps_top_mv_pred->i1_ref_frame[0];
  458|   863k|                    pv_nbr_pic_addr0 = ppv_map_ref_idx_to_poc_l0[i1_top_ref0];
  459|   863k|                    pv_nbr_pic_addr1 = 0;
  460|   863k|                }
  461|   283k|                else
  462|   283k|                {
  463|   283k|                    pv_nbr_pic_addr0 = u4_pic_addrress[i & 2];
  464|   283k|                    pv_nbr_pic_addr1 = u4_pic_addrress[1 + (i & 2)];
  465|   283k|                }
  466|       |
  467|  1.14M|                {
  468|  1.14M|                    UWORD32 u4_bs_temp1;
  469|  1.14M|                    UWORD32 u4_bs;
  470|       |                    /*********************************************************/
  471|       |                    /* If any motion vector component differs by more than 1 */
  472|       |                    /* integer pel or if reference pictures are different Bs */
  473|       |                    /* is set to 1. Note that this condition shall be met for*/
  474|       |                    /* both (fwd-fwd,bwd-bwd) and (fwd-bwd,bwd-fwd) direction*/
  475|       |                    /*********************************************************/
  476|       |
  477|  1.14M|                    u4_bs_temp1 =
  478|  1.14M|                                    ((ABS((i2_top_mv0 - i2_cur_mv0))
  ------------------
  |  |  100|  1.14M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 109k, False: 1.03M]
  |  |  ------------------
  ------------------
  479|  1.14M|                                                    >= 4)
  480|  1.14M|                                                    | (ABS((i2_top_mv1
  ------------------
  |  |  100|  1.14M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 116k, False: 1.03M]
  |  |  ------------------
  ------------------
  481|  1.14M|                                                                    - i2_cur_mv1))
  482|  1.14M|                                                                    >= i4_ver_mvlimit));
  483|       |
  484|  1.14M|                    u4_bs = ((pv_nbr_pic_addr0 != pv_cur_pic_addr0)
  ------------------
  |  Branch (484:30): [True: 12.0k, False: 1.13M]
  ------------------
  485|  1.13M|                                    || (pv_nbr_pic_addr1 != pv_cur_pic_addr1)
  ------------------
  |  Branch (485:40): [True: 340, False: 1.13M]
  ------------------
  486|  1.13M|                                    || u4_bs_temp1);
  ------------------
  |  Branch (486:40): [True: 82.3k, False: 1.05M]
  ------------------
  487|       |
  488|  1.14M|                    u4_bs_horz |= (u4_bs << u4_horz_idx);
  489|  1.14M|                }
  490|  1.14M|            }
  491|       |
  492|  1.25M|            ps_left_mv_pred = ps_cur_mv_pred;
  493|  1.25M|        }
  494|       |
  495|   314k|        pu4_bs_table[edge] = u4_bs_horz;
  496|   314k|    }
  497|  78.6k|}
ih264d_fill_bs1_16x16mb_bslice:
  532|  3.24M|{
  533|  3.24M|    WORD16 i2_q_mv0, i2_q_mv1, i2_q_mv2, i2_q_mv3;
  534|  3.24M|    WORD16 i2_p_mv0, i2_p_mv1, i2_p_mv2, i2_p_mv3;
  535|  3.24M|    void *pv_cur_pic_addr0, *pv_cur_pic_addr1;
  536|  3.24M|    void *pv_nbr_pic_addr0, *pv_nbr_pic_addr1;
  537|  3.24M|    void **ppv_map_ref_idx_to_poc_l0, **ppv_map_ref_idx_to_poc_l1;
  538|  3.24M|    UWORD32 i;
  539|  3.24M|    UWORD32 u4_bs_horz = pu4_bs_table[0];
  540|  3.24M|    UWORD32 u4_bs_vert = pu4_bs_table[4];
  541|       |
  542|  3.24M|    PROFILE_DISABLE_BOUNDARY_STRENGTH()
  ------------------
  |  |  125|  3.24M|#define PROFILE_DISABLE_BOUNDARY_STRENGTH() ;
  ------------------
  543|       |
  544|  3.24M|    ppv_map_ref_idx_to_poc_l0 = ppv_map_ref_idx_to_poc;
  545|  3.24M|    ppv_map_ref_idx_to_poc_l1 = ppv_map_ref_idx_to_poc + POC_LIST_L0_TO_L1_DIFF;
  ------------------
  |  |   86|  3.24M|#define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
  |  |  ------------------
  |  |  |  |  600|  3.24M|#define MAX_FRAMES              16
  |  |  ------------------
  ------------------
  546|  3.24M|    i2_q_mv0 = ps_cur_mv_pred->i2_mv[0];
  547|  3.24M|    i2_q_mv1 = ps_cur_mv_pred->i2_mv[1];
  548|  3.24M|    i2_q_mv2 = ps_cur_mv_pred->i2_mv[2];
  549|  3.24M|    i2_q_mv3 = ps_cur_mv_pred->i2_mv[3];
  550|  3.24M|    pv_cur_pic_addr0 = ppv_map_ref_idx_to_poc_l0[ps_cur_mv_pred->i1_ref_frame[0]];
  551|  3.24M|    pv_cur_pic_addr1 = ppv_map_ref_idx_to_poc_l1[ps_cur_mv_pred->i1_ref_frame[1]];
  552|       |
  553|       |    /*********************************/
  554|       |    /* Computing Bs for the top edge */
  555|       |    /*********************************/
  556|  16.2M|    for(i = 0; i < 4; i++, ps_top_mv_pred++)
  ------------------
  |  Branch (556:16): [True: 12.9M, False: 3.24M]
  ------------------
  557|  12.9M|    {
  558|  12.9M|        UWORD32 u4_idx = 24 - (i << 3);
  559|       |
  560|       |        /*********************************/
  561|       |        /* check if Bs is already set    */
  562|       |        /*********************************/
  563|  12.9M|        if(!((u4_bs_horz >> u4_idx) & 0xf))
  ------------------
  |  Branch (563:12): [True: 12.9M, False: 50.7k]
  ------------------
  564|  12.9M|        {
  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.9M|            UWORD32 u4_bs_temp1, u4_bs_temp2;
  570|  12.9M|            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.9M|            i2_p_mv0 = ps_top_mv_pred->i2_mv[0];
  579|  12.9M|            i2_p_mv1 = ps_top_mv_pred->i2_mv[1];
  580|  12.9M|            i2_p_mv2 = ps_top_mv_pred->i2_mv[2];
  581|  12.9M|            i2_p_mv3 = ps_top_mv_pred->i2_mv[3];
  582|  12.9M|            pv_nbr_pic_addr0 = u4_pic_addrress[i & 2];
  583|  12.9M|            pv_nbr_pic_addr1 = u4_pic_addrress[1 + (i & 2)];
  584|       |
  585|  12.9M|            u4_bs_temp1 =
  586|  12.9M|                            ((ABS((i2_p_mv0 - i2_q_mv0))
  ------------------
  |  |  100|  12.9M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 52.8k, False: 12.8M]
  |  |  ------------------
  ------------------
  587|  12.9M|                                            >= 4)
  588|  12.9M|                                            | (ABS((i2_p_mv1 - i2_q_mv1))
  ------------------
  |  |  100|  12.9M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 57.0k, False: 12.8M]
  |  |  ------------------
  ------------------
  589|  12.9M|                                                            >= i4_ver_mvlimit)
  590|  12.9M|                                            | (ABS((i2_p_mv2 - i2_q_mv2))
  ------------------
  |  |  100|  12.9M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 65.9k, False: 12.8M]
  |  |  ------------------
  ------------------
  591|  12.9M|                                                            >= 4)
  592|  12.9M|                                            | (ABS((i2_p_mv3 - i2_q_mv3))
  ------------------
  |  |  100|  12.9M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 51.1k, False: 12.8M]
  |  |  ------------------
  ------------------
  593|  12.9M|                                                            >= i4_ver_mvlimit));
  594|       |
  595|  12.9M|            u4_bs_temp2 =
  596|  12.9M|                            ((ABS((i2_p_mv0 - i2_q_mv2))
  ------------------
  |  |  100|  12.9M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 355k, False: 12.5M]
  |  |  ------------------
  ------------------
  597|  12.9M|                                            >= 4)
  598|  12.9M|                                            | (ABS((i2_p_mv1 - i2_q_mv3))
  ------------------
  |  |  100|  12.9M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 428k, False: 12.4M]
  |  |  ------------------
  ------------------
  599|  12.9M|                                                            >= i4_ver_mvlimit)
  600|  12.9M|                                            | (ABS((i2_p_mv2 - i2_q_mv0))
  ------------------
  |  |  100|  12.9M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 8.98M, False: 3.92M]
  |  |  ------------------
  ------------------
  601|  12.9M|                                                            >= 4)
  602|  12.9M|                                            | (ABS((i2_p_mv3 - i2_q_mv1))
  ------------------
  |  |  100|  12.9M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 8.88M, False: 4.02M]
  |  |  ------------------
  ------------------
  603|  12.9M|                                                            >= i4_ver_mvlimit));
  604|       |
  605|  12.9M|            u4_bs = ((pv_cur_pic_addr0 != pv_nbr_pic_addr0)
  ------------------
  |  Branch (605:22): [True: 383k, False: 12.5M]
  ------------------
  606|  12.5M|                            || (pv_cur_pic_addr1 != pv_nbr_pic_addr1)
  ------------------
  |  Branch (606:32): [True: 293k, False: 12.2M]
  ------------------
  607|  12.2M|                            || u4_bs_temp1)
  ------------------
  |  Branch (607:32): [True: 30.2k, False: 12.2M]
  ------------------
  608|   707k|                            && ((pv_cur_pic_addr0 != pv_nbr_pic_addr1)
  ------------------
  |  Branch (608:33): [True: 448k, False: 258k]
  ------------------
  609|   258k|                                            || (pv_cur_pic_addr1
  ------------------
  |  Branch (609:48): [True: 210k, False: 47.8k]
  ------------------
  610|   258k|                                                            != pv_nbr_pic_addr0)
  611|  47.8k|                                            || u4_bs_temp2);
  ------------------
  |  Branch (611:48): [True: 28.5k, False: 19.3k]
  ------------------
  612|       |
  613|  12.9M|            u4_bs_horz |= (u4_bs << u4_idx);
  614|  12.9M|        }
  615|  12.9M|    }
  616|  3.24M|    pu4_bs_table[0] = u4_bs_horz;
  617|       |
  618|       |    /***********************************/
  619|       |    /* Computing Bs for the left edge  */
  620|       |    /***********************************/
  621|  16.2M|    for(i = 0; i < 4; i++, ps_leftmost_mv_pred += 4)
  ------------------
  |  Branch (621:16): [True: 12.9M, False: 3.24M]
  ------------------
  622|  12.9M|    {
  623|  12.9M|        UWORD32 u4_idx = 24 - (i << 3);
  624|       |
  625|       |        /*********************************/
  626|       |        /* check if Bs is already set    */
  627|       |        /*********************************/
  628|  12.9M|        if(!((u4_bs_vert >> u4_idx) & 0xf))
  ------------------
  |  Branch (628:12): [True: 12.9M, False: 47.6k]
  ------------------
  629|  12.9M|        {
  630|       |            /****************************************************/
  631|       |            /* If Bs is not set, evalaute conditions for Bs=1   */
  632|       |            /****************************************************/
  633|  12.9M|            UWORD32 u4_bs_temp1, u4_bs_temp2;
  634|  12.9M|            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.9M|            i2_p_mv0 = ps_leftmost_mv_pred->i2_mv[0];
  643|  12.9M|            i2_p_mv1 = ps_leftmost_mv_pred->i2_mv[1];
  644|  12.9M|            i2_p_mv2 = ps_leftmost_mv_pred->i2_mv[2];
  645|  12.9M|            i2_p_mv3 = ps_leftmost_mv_pred->i2_mv[3];
  646|  12.9M|            pv_nbr_pic_addr0 = ps_left_addr->u4_add[i & 2];
  647|  12.9M|            pv_nbr_pic_addr1 = ps_left_addr->u4_add[1 + (i & 2)];
  648|       |
  649|  12.9M|            u4_bs_temp1 =
  650|  12.9M|                            ((ABS((i2_p_mv0 - i2_q_mv0))
  ------------------
  |  |  100|  12.9M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 41.7k, False: 12.8M]
  |  |  ------------------
  ------------------
  651|  12.9M|                                            >= 4)
  652|  12.9M|                                            | (ABS((i2_p_mv1 - i2_q_mv1))
  ------------------
  |  |  100|  12.9M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 48.5k, False: 12.8M]
  |  |  ------------------
  ------------------
  653|  12.9M|                                                            >= i4_ver_mvlimit)
  654|  12.9M|                                            | (ABS((i2_p_mv2 - i2_q_mv2))
  ------------------
  |  |  100|  12.9M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 47.9k, False: 12.8M]
  |  |  ------------------
  ------------------
  655|  12.9M|                                                            >= 4)
  656|  12.9M|                                            | (ABS((i2_p_mv3 - i2_q_mv3))
  ------------------
  |  |  100|  12.9M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 42.5k, False: 12.8M]
  |  |  ------------------
  ------------------
  657|  12.9M|                                                            >= i4_ver_mvlimit));
  658|       |
  659|  12.9M|            u4_bs_temp2 =
  660|  12.9M|                            ((ABS((i2_p_mv0 - i2_q_mv2))
  ------------------
  |  |  100|  12.9M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 355k, False: 12.5M]
  |  |  ------------------
  ------------------
  661|  12.9M|                                            >= 4)
  662|  12.9M|                                            | (ABS((i2_p_mv1 - i2_q_mv3))
  ------------------
  |  |  100|  12.9M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 428k, False: 12.4M]
  |  |  ------------------
  ------------------
  663|  12.9M|                                                            >= i4_ver_mvlimit)
  664|  12.9M|                                            | (ABS((i2_p_mv2 - i2_q_mv0))
  ------------------
  |  |  100|  12.9M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 9.27M, False: 3.63M]
  |  |  ------------------
  ------------------
  665|  12.9M|                                                            >= 4)
  666|  12.9M|                                            | (ABS((i2_p_mv3 - i2_q_mv1))
  ------------------
  |  |  100|  12.9M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 9.18M, False: 3.73M]
  |  |  ------------------
  ------------------
  667|  12.9M|                                                            >= i4_ver_mvlimit));
  668|       |
  669|  12.9M|            u4_bs = ((pv_cur_pic_addr0 != pv_nbr_pic_addr0)
  ------------------
  |  Branch (669:22): [True: 146k, False: 12.7M]
  ------------------
  670|  12.7M|                            || (pv_cur_pic_addr1 != pv_nbr_pic_addr1)
  ------------------
  |  Branch (670:32): [True: 102k, False: 12.6M]
  ------------------
  671|  12.6M|                            || u4_bs_temp1)
  ------------------
  |  Branch (671:32): [True: 58.3k, False: 12.6M]
  ------------------
  672|   307k|                            && ((pv_cur_pic_addr0 != pv_nbr_pic_addr1)
  ------------------
  |  Branch (672:33): [True: 166k, False: 141k]
  ------------------
  673|   141k|                                            || (pv_cur_pic_addr1
  ------------------
  |  Branch (673:48): [True: 86.2k, False: 55.3k]
  ------------------
  674|   141k|                                                            != pv_nbr_pic_addr0)
  675|  55.3k|                                            || u4_bs_temp2);
  ------------------
  |  Branch (675:48): [True: 47.8k, False: 7.49k]
  ------------------
  676|       |
  677|  12.9M|            u4_bs_vert |= (u4_bs << u4_idx);
  678|  12.9M|        }
  679|  12.9M|    }
  680|  3.24M|    pu4_bs_table[4] = u4_bs_vert;
  681|       |
  682|  3.24M|    return;
  683|  3.24M|}
ih264d_fill_bs1_non16x16mb_bslice:
  718|  81.8k|{
  719|  81.8k|    UWORD32 edge;
  720|  81.8k|    void **ppv_map_ref_idx_to_poc_l0, **ppv_map_ref_idx_to_poc_l1;
  721|  81.8k|    ppv_map_ref_idx_to_poc_l0 = ppv_map_ref_idx_to_poc;
  722|  81.8k|    ppv_map_ref_idx_to_poc_l1 = ppv_map_ref_idx_to_poc + POC_LIST_L0_TO_L1_DIFF;
  ------------------
  |  |   86|  81.8k|#define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
  |  |  ------------------
  |  |  |  |  600|  81.8k|#define MAX_FRAMES              16
  |  |  ------------------
  ------------------
  723|       |
  724|  81.8k|    PROFILE_DISABLE_BOUNDARY_STRENGTH()
  ------------------
  |  |  125|  81.8k|#define PROFILE_DISABLE_BOUNDARY_STRENGTH() ;
  ------------------
  725|       |
  726|   409k|    for(edge = 0; edge < 4; edge++, ps_top_mv_pred = ps_cur_mv_pred - 4)
  ------------------
  |  Branch (726:19): [True: 327k, False: 81.8k]
  ------------------
  727|   327k|    {
  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|   327k|        WORD32 i;
  733|   327k|        UWORD32 u4_vert_idx = 24 - (edge << 3);
  734|   327k|        UWORD32 u4_bs_horz = pu4_bs_table[edge];
  735|   327k|        mv_pred_t *ps_left_mv_pred = ps_leftmost_mv_pred + (edge << 2);
  736|       |
  737|  1.63M|        for(i = 0; i < 4; i++, ps_top_mv_pred++, ps_cur_mv_pred++)
  ------------------
  |  Branch (737:20): [True: 1.30M, False: 327k]
  ------------------
  738|  1.30M|        {
  739|  1.30M|            WORD16 i2_cur_mv0, i2_cur_mv1, i16_curMv2, i16_curMv3;
  740|  1.30M|            WORD8 i1_cur_ref0, i1_cur_ref1;
  741|  1.30M|            void *pv_cur_pic_addr0, *pv_cur_pic_addr1;
  742|  1.30M|            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.30M|            UWORD32 u4_bs_vert = (pu4_bs_table[i + 4] >> u4_vert_idx) & 0xf;
  749|  1.30M|            UWORD32 u4_horz_idx = 24 - (i << 3);
  750|       |
  751|       |            /*****************************************************/
  752|       |            /* check if vert Bs for this block is already set    */
  753|       |            /*****************************************************/
  754|  1.30M|            if(!u4_bs_vert)
  ------------------
  |  Branch (754:16): [True: 1.22M, False: 83.9k]
  ------------------
  755|  1.22M|            {
  756|  1.22M|                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.22M|                i2_left_mv0 = ps_left_mv_pred->i2_mv[0];
  762|  1.22M|                i2_left_mv1 = ps_left_mv_pred->i2_mv[1];
  763|  1.22M|                i2_left_mv2 = ps_left_mv_pred->i2_mv[2];
  764|  1.22M|                i2_left_mv3 = ps_left_mv_pred->i2_mv[3];
  765|       |
  766|  1.22M|                i2_cur_mv0 = ps_cur_mv_pred->i2_mv[0];
  767|  1.22M|                i2_cur_mv1 = ps_cur_mv_pred->i2_mv[1];
  768|  1.22M|                i16_curMv2 = ps_cur_mv_pred->i2_mv[2];
  769|  1.22M|                i16_curMv3 = ps_cur_mv_pred->i2_mv[3];
  770|  1.22M|                i1_cur_ref0 = ps_cur_mv_pred->i1_ref_frame[0];
  771|  1.22M|                i1_cur_ref1 = ps_cur_mv_pred->i1_ref_frame[1];
  772|  1.22M|                pv_cur_pic_addr0 = ppv_map_ref_idx_to_poc_l0[i1_cur_ref0];
  773|  1.22M|                pv_cur_pic_addr1 = ppv_map_ref_idx_to_poc_l1[i1_cur_ref1];
  774|       |
  775|  1.22M|                if(i)
  ------------------
  |  Branch (775:20): [True: 922k, False: 302k]
  ------------------
  776|   922k|                {
  777|   922k|                    WORD8 i1_left_ref0, i1_left_ref1;
  778|   922k|                    i1_left_ref0 = ps_left_mv_pred->i1_ref_frame[0];
  779|   922k|                    i1_left_ref1 = ps_left_mv_pred->i1_ref_frame[1];
  780|   922k|                    pv_nbr_pic_addr0 = ppv_map_ref_idx_to_poc_l0[i1_left_ref0];
  781|   922k|                    pv_nbr_pic_addr1 = ppv_map_ref_idx_to_poc_l1[i1_left_ref1];
  782|   922k|                }
  783|   302k|                else
  784|   302k|                {
  785|   302k|                    pv_nbr_pic_addr0 = ps_left_addr->u4_add[edge & 2];
  786|   302k|                    pv_nbr_pic_addr1 = ps_left_addr->u4_add[1 + (edge & 2)];
  787|   302k|                }
  788|       |
  789|  1.22M|                {
  790|  1.22M|                    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.22M|                    u4_bs_temp1 =
  799|  1.22M|                                    ((ABS((i2_left_mv0 - i2_cur_mv0))
  ------------------
  |  |  100|  1.22M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 115k, False: 1.11M]
  |  |  ------------------
  ------------------
  800|  1.22M|                                                    >= 4)
  801|  1.22M|                                                    | (ABS((i2_left_mv1
  ------------------
  |  |  100|  1.22M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 114k, False: 1.11M]
  |  |  ------------------
  ------------------
  802|  1.22M|                                                                    - i2_cur_mv1))
  803|  1.22M|                                                                    >= i4_ver_mvlimit)
  804|  1.22M|                                                    | (ABS((i2_left_mv2
  ------------------
  |  |  100|  1.22M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 61.3k, False: 1.16M]
  |  |  ------------------
  ------------------
  805|  1.22M|                                                                    - i16_curMv2))
  806|  1.22M|                                                                    >= 4)
  807|  1.22M|                                                    | (ABS((i2_left_mv3
  ------------------
  |  |  100|  1.22M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 47.3k, False: 1.17M]
  |  |  ------------------
  ------------------
  808|  1.22M|                                                                    - i16_curMv3))
  809|  1.22M|                                                                    >= i4_ver_mvlimit));
  810|       |
  811|  1.22M|                    u4_bs_temp2 =
  812|  1.22M|                                    ((ABS((i2_left_mv0 - i16_curMv2))
  ------------------
  |  |  100|  1.22M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 238k, False: 987k]
  |  |  ------------------
  ------------------
  813|  1.22M|                                                    >= 4)
  814|  1.22M|                                                    | (ABS((i2_left_mv1
  ------------------
  |  |  100|  1.22M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 255k, False: 969k]
  |  |  ------------------
  ------------------
  815|  1.22M|                                                                    - i16_curMv3))
  816|  1.22M|                                                                    >= i4_ver_mvlimit)
  817|  1.22M|                                                    | (ABS((i2_left_mv2
  ------------------
  |  |  100|  1.22M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 478k, False: 747k]
  |  |  ------------------
  ------------------
  818|  1.22M|                                                                    - i2_cur_mv0))
  819|  1.22M|                                                                    >= 4)
  820|  1.22M|                                                    | (ABS((i2_left_mv3
  ------------------
  |  |  100|  1.22M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 462k, False: 763k]
  |  |  ------------------
  ------------------
  821|  1.22M|                                                                    - i2_cur_mv1))
  822|  1.22M|                                                                    >= i4_ver_mvlimit));
  823|       |
  824|  1.22M|                    u4_bs_vert =
  825|  1.22M|                                    ((pv_nbr_pic_addr0 != pv_cur_pic_addr0)
  ------------------
  |  Branch (825:38): [True: 101k, False: 1.12M]
  ------------------
  826|  1.12M|                                                    || (pv_nbr_pic_addr1
  ------------------
  |  Branch (826:56): [True: 61.5k, False: 1.06M]
  ------------------
  827|  1.12M|                                                                    != pv_cur_pic_addr1)
  828|  1.06M|                                                    || u4_bs_temp1)
  ------------------
  |  Branch (828:56): [True: 100k, False: 961k]
  ------------------
  829|   264k|                                                    && ((pv_nbr_pic_addr0
  ------------------
  |  Branch (829:57): [True: 160k, False: 103k]
  ------------------
  830|   264k|                                                                    != pv_cur_pic_addr1)
  831|   103k|                                                                    || (pv_nbr_pic_addr1
  ------------------
  |  Branch (831:72): [True: 52.6k, False: 50.8k]
  ------------------
  832|   103k|                                                                                    != pv_cur_pic_addr0)
  833|  50.8k|                                                                    || u4_bs_temp2);
  ------------------
  |  Branch (833:72): [True: 42.6k, False: 8.18k]
  ------------------
  834|       |
  835|  1.22M|                    pu4_bs_table[i + 4] |= (u4_bs_vert << u4_vert_idx);
  836|  1.22M|                }
  837|  1.22M|            }
  838|       |
  839|       |            /*****************************************************/
  840|       |            /* check if horz Bs for this block is already set    */
  841|       |            /*****************************************************/
  842|  1.30M|            if(!((u4_bs_horz >> u4_horz_idx) & 0xf))
  ------------------
  |  Branch (842:16): [True: 1.22M, False: 87.0k]
  ------------------
  843|  1.22M|            {
  844|  1.22M|                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.22M|                i2_cur_mv0 = ps_cur_mv_pred->i2_mv[0];
  850|  1.22M|                i2_cur_mv1 = ps_cur_mv_pred->i2_mv[1];
  851|  1.22M|                i16_curMv2 = ps_cur_mv_pred->i2_mv[2];
  852|  1.22M|                i16_curMv3 = ps_cur_mv_pred->i2_mv[3];
  853|  1.22M|                i1_cur_ref0 = ps_cur_mv_pred->i1_ref_frame[0];
  854|  1.22M|                i1_cur_ref1 = ps_cur_mv_pred->i1_ref_frame[1];
  855|       |
  856|  1.22M|                i2_top_mv0 = ps_top_mv_pred->i2_mv[0];
  857|  1.22M|                i2_top_mv1 = ps_top_mv_pred->i2_mv[1];
  858|  1.22M|                i16_topMv2 = ps_top_mv_pred->i2_mv[2];
  859|  1.22M|                i16_topMv3 = ps_top_mv_pred->i2_mv[3];
  860|  1.22M|                pv_cur_pic_addr0 = ppv_map_ref_idx_to_poc_l0[i1_cur_ref0];
  861|  1.22M|                pv_cur_pic_addr1 = ppv_map_ref_idx_to_poc_l1[i1_cur_ref1];
  862|  1.22M|                if(edge)
  ------------------
  |  Branch (862:20): [True: 921k, False: 301k]
  ------------------
  863|   921k|                {
  864|   921k|                    WORD8 i1_top_ref0, i1_top_ref1;
  865|   921k|                    i1_top_ref0 = ps_top_mv_pred->i1_ref_frame[0];
  866|   921k|                    i1_top_ref1 = ps_top_mv_pred->i1_ref_frame[1];
  867|   921k|                    pv_nbr_pic_addr0 = ppv_map_ref_idx_to_poc_l0[i1_top_ref0];
  868|   921k|                    pv_nbr_pic_addr1 = ppv_map_ref_idx_to_poc_l1[i1_top_ref1];
  869|   921k|                }
  870|   301k|                else
  871|   301k|                {
  872|   301k|                    pv_nbr_pic_addr0 = u4_pic_addrress[i & 2];
  873|   301k|                    pv_nbr_pic_addr1 = u4_pic_addrress[1 + (i & 2)];
  874|   301k|                }
  875|       |
  876|  1.22M|                {
  877|  1.22M|                    UWORD32 u4_bs_temp1, u4_bs_temp2;
  878|  1.22M|                    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.22M|                    u4_bs_temp1 =
  887|  1.22M|                                    ((ABS((i2_top_mv0 - i2_cur_mv0))
  ------------------
  |  |  100|  1.22M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 157k, False: 1.06M]
  |  |  ------------------
  ------------------
  888|  1.22M|                                                    >= 4)
  889|  1.22M|                                                    | (ABS((i2_top_mv1
  ------------------
  |  |  100|  1.22M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 148k, False: 1.07M]
  |  |  ------------------
  ------------------
  890|  1.22M|                                                                    - i2_cur_mv1))
  891|  1.22M|                                                                    >= i4_ver_mvlimit)
  892|  1.22M|                                                    | (ABS((i16_topMv2
  ------------------
  |  |  100|  1.22M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 68.9k, False: 1.15M]
  |  |  ------------------
  ------------------
  893|  1.22M|                                                                    - i16_curMv2))
  894|  1.22M|                                                                    >= 4)
  895|  1.22M|                                                    | (ABS((i16_topMv3
  ------------------
  |  |  100|  1.22M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 57.3k, False: 1.16M]
  |  |  ------------------
  ------------------
  896|  1.22M|                                                                    - i16_curMv3))
  897|  1.22M|                                                                    >= i4_ver_mvlimit));
  898|       |
  899|  1.22M|                    u4_bs_temp2 =
  900|  1.22M|                                    ((ABS((i2_top_mv0 - i16_curMv2))
  ------------------
  |  |  100|  1.22M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 234k, False: 988k]
  |  |  ------------------
  ------------------
  901|  1.22M|                                                    >= 4)
  902|  1.22M|                                                    | (ABS((i2_top_mv1
  ------------------
  |  |  100|  1.22M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 252k, False: 970k]
  |  |  ------------------
  ------------------
  903|  1.22M|                                                                    - i16_curMv3))
  904|  1.22M|                                                                    >= i4_ver_mvlimit)
  905|  1.22M|                                                    | (ABS((i16_topMv2
  ------------------
  |  |  100|  1.22M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 472k, False: 750k]
  |  |  ------------------
  ------------------
  906|  1.22M|                                                                    - i2_cur_mv0))
  907|  1.22M|                                                                    >= 4)
  908|  1.22M|                                                    | (ABS((i16_topMv3
  ------------------
  |  |  100|  1.22M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 460k, False: 761k]
  |  |  ------------------
  ------------------
  909|  1.22M|                                                                    - i2_cur_mv1))
  910|  1.22M|                                                                    >= i4_ver_mvlimit));
  911|       |
  912|  1.22M|                    u4_bs =
  913|  1.22M|                                    ((pv_nbr_pic_addr0 != pv_cur_pic_addr0)
  ------------------
  |  Branch (913:38): [True: 105k, False: 1.11M]
  ------------------
  914|  1.11M|                                                    || (pv_nbr_pic_addr1
  ------------------
  |  Branch (914:56): [True: 68.6k, False: 1.04M]
  ------------------
  915|  1.11M|                                                                    != pv_cur_pic_addr1)
  916|  1.04M|                                                    || u4_bs_temp1)
  ------------------
  |  Branch (916:56): [True: 121k, False: 927k]
  ------------------
  917|   295k|                                                    && ((pv_nbr_pic_addr0
  ------------------
  |  Branch (917:57): [True: 174k, False: 121k]
  ------------------
  918|   295k|                                                                    != pv_cur_pic_addr1)
  919|   121k|                                                                    || (pv_nbr_pic_addr1
  ------------------
  |  Branch (919:72): [True: 66.0k, False: 55.2k]
  ------------------
  920|   121k|                                                                                    != pv_cur_pic_addr0)
  921|  55.2k|                                                                    || u4_bs_temp2);
  ------------------
  |  Branch (921:72): [True: 39.6k, False: 15.5k]
  ------------------
  922|       |
  923|  1.22M|                    u4_bs_horz |= (u4_bs << u4_horz_idx);
  924|  1.22M|                }
  925|  1.22M|            }
  926|       |
  927|  1.30M|            ps_left_mv_pred = ps_cur_mv_pred;
  928|  1.30M|        }
  929|       |
  930|   327k|        pu4_bs_table[edge] = u4_bs_horz;
  931|   327k|    }
  932|  81.8k|}
ih264d_compute_bs_non_mbaff:
 1146|  6.99M|{
 1147|       |    /* Mvpred and Nnz for top and Courrent */
 1148|  6.99M|    mv_pred_t *ps_cur_mv_pred, *ps_top_mv_pred = NULL, *ps_left_mv_pred;
 1149|       |    /* deblk_mb_t Params */
 1150|  6.99M|    deblk_mb_t *ps_cur_mb_params; /*< Parameters of current MacroBlock */
 1151|  6.99M|    deblkmb_neighbour_t *ps_deblk_top_mb;
 1152|       |
 1153|       |    /* Reference Index to POC mapping*/
 1154|  6.99M|    void ** apv_map_ref_idx_to_poc;
 1155|  6.99M|    UWORD32 u4_leftmbtype;
 1156|       |
 1157|  6.99M|    UWORD16 u2_left_csbp, u2_top_csbp, u2_cur_csbp;
 1158|       |
 1159|       |    /* Set of flags */
 1160|  6.99M|    UWORD32 u4_cur_mb_intra, u1_top_mb_typ, u4_cur_mb_fld;
 1161|  6.99M|    UWORD32 u1_cur_mb_type;
 1162|  6.99M|    UWORD32 * pu4_bs_table;
 1163|       |
 1164|       |    /* Neighbour availability */
 1165|       |    /* Initialization */
 1166|  6.99M|    const UWORD32 u2_mbx = ps_cur_mb_info->u2_mbx;
 1167|  6.99M|    const UWORD32 u2_mby = ps_cur_mb_info->u2_mby;
 1168|  6.99M|    const UWORD32 u1_pingpong = u2_mbx & 0x01;
 1169|       |
 1170|  6.99M|    PROFILE_DISABLE_BOUNDARY_STRENGTH()
  ------------------
  |  |  125|  6.99M|#define PROFILE_DISABLE_BOUNDARY_STRENGTH() ;
  ------------------
 1171|       |
 1172|  6.99M|    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.99M|    ps_cur_mb_params = ps_dec->ps_deblk_mbn + u2_mbxn_mb;
 1177|  6.99M|    ps_cur_mv_pred = ps_dec->ps_mv_cur + (u2_mbxn_mb << 4);
 1178|       |
 1179|  6.99M|    apv_map_ref_idx_to_poc = ps_dec->ppv_map_ref_idx_to_poc + 1;
 1180|  6.99M|    u1_cur_mb_type = ps_cur_mb_params->u1_mb_type;
 1181|  6.99M|    u1_top_mb_typ = ps_deblk_top_mb->u1_mb_type;
 1182|  6.99M|    ps_deblk_top_mb->u1_mb_type = u1_cur_mb_type;
 1183|       |
 1184|  6.99M|    {
 1185|  6.99M|        UWORD8 mb_qp_temp;
 1186|       |
 1187|  6.99M|        ps_cur_mb_params->u1_topmb_qp = ps_deblk_top_mb->u1_mb_qp;
 1188|  6.99M|        ps_deblk_top_mb->u1_mb_qp = ps_cur_mb_params->u1_mb_qp;
 1189|       |
 1190|  6.99M|        ps_cur_mb_params->u1_left_mb_qp = ps_dec->deblk_left_mb[1].u1_mb_qp;
 1191|  6.99M|        ps_dec->deblk_left_mb[1].u1_mb_qp = ps_cur_mb_params->u1_mb_qp;
 1192|       |
 1193|  6.99M|    }
 1194|       |
 1195|       |    /* if no deblocking required for current Mb then continue */
 1196|       |    /* Check next Mbs   in Mb group                           */
 1197|  6.99M|    if(ps_cur_mb_params->u1_deblocking_mode & MB_DISABLE_FILTERING)
  ------------------
  |  |   70|  6.99M|#define MB_DISABLE_FILTERING          0x01
  ------------------
  |  Branch (1197:8): [True: 1.44M, False: 5.54M]
  ------------------
 1198|  1.44M|    {
 1199|  1.44M|        void ** pu4_map_ref_idx_to_poc_l1 = apv_map_ref_idx_to_poc +
 1200|  1.44M|        POC_LIST_L0_TO_L1_DIFF;
  ------------------
  |  |   86|  1.44M|#define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
  |  |  ------------------
  |  |  |  |  600|  1.44M|#define MAX_FRAMES              16
  |  |  ------------------
  ------------------
 1201|  1.44M|        {
 1202|       |            /* Store Parameter for Top MvPred refernce frame Address */
 1203|       |
 1204|  1.44M|            void ** ppv_top_mv_pred_addr = ps_cur_mb_info->ps_curmb->u4_pic_addrress;
 1205|  1.44M|            WORD8 * p1_refTop0 = (ps_cur_mv_pred + 12)->i1_ref_frame;
 1206|  1.44M|            WORD8 * p1_refTop1 = (ps_cur_mv_pred + 14)->i1_ref_frame;
 1207|       |
 1208|       |            /* Store Left addresses for Next Mb   */
 1209|  1.44M|            void ** ppv_left_mv_pred_addr =
 1210|  1.44M|                            ps_dec->ps_left_mvpred_addr[!u1_pingpong][1].u4_add;
 1211|  1.44M|            WORD8 * p1_refleft0 = (ps_cur_mv_pred + 3)->i1_ref_frame;
 1212|       |
 1213|       |
 1214|  1.44M|            ppv_top_mv_pred_addr[0] = apv_map_ref_idx_to_poc[p1_refTop0[0]];
 1215|  1.44M|            ppv_top_mv_pred_addr[1] = pu4_map_ref_idx_to_poc_l1[p1_refTop0[1]];
 1216|       |
 1217|  1.44M|            ppv_left_mv_pred_addr[2] = apv_map_ref_idx_to_poc[p1_refTop1[0]];
 1218|  1.44M|            ppv_top_mv_pred_addr[2] = apv_map_ref_idx_to_poc[p1_refTop1[0]];
 1219|  1.44M|            ppv_left_mv_pred_addr[3] = pu4_map_ref_idx_to_poc_l1[p1_refTop1[1]];
 1220|  1.44M|            ppv_top_mv_pred_addr[3] = pu4_map_ref_idx_to_poc_l1[p1_refTop1[1]];
 1221|       |
 1222|  1.44M|            ppv_left_mv_pred_addr[0] = apv_map_ref_idx_to_poc[p1_refleft0[0]];
 1223|  1.44M|            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.44M|            ps_dec->deblk_left_mb[1].u1_mb_type = ps_cur_mb_params->u1_mb_type;
 1227|  1.44M|        }
 1228|       |
 1229|  1.44M|        return;
 1230|  1.44M|    }
 1231|       |
 1232|       |    /* Flag for extra left Edge */
 1233|  5.54M|    ps_cur_mb_params->u1_single_call = 1;
 1234|       |
 1235|       |    /* Update the Left deblk_mb_t and Left MvPred Parameters           */
 1236|  5.54M|    if(!u2_mbx)
  ------------------
  |  Branch (1236:8): [True: 699k, False: 4.85M]
  ------------------
 1237|   699k|    {
 1238|   699k|        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|   699k|        ps_left_mv_pred = ps_dec->ps_mv_cur + 3;
 1244|   699k|    }
 1245|  4.85M|    else
 1246|  4.85M|    {
 1247|  4.85M|        u4_leftmbtype = ps_dec->deblk_left_mb[1].u1_mb_type;
 1248|       |
 1249|       |        /* Come to Left Most Edge of the MB */
 1250|  4.85M|        ps_left_mv_pred = (u2_mbxn_mb) ?
  ------------------
  |  Branch (1250:27): [True: 4.82M, False: 22.9k]
  ------------------
 1251|  4.82M|                        ps_dec->ps_mv_cur + ((u2_mbxn_mb - 1) << 4) + 3 :
 1252|  4.85M|                        ps_dec->ps_mv_left + 3;
 1253|  4.85M|    }
 1254|       |
 1255|  5.54M|    if(!u2_mby)
  ------------------
  |  Branch (1255:8): [True: 200k, False: 5.34M]
  ------------------
 1256|   200k|        u1_top_mb_typ = 0;
 1257|       |
 1258|       |    /* MvPred Pointer Calculation */
 1259|       |    /* CHANGED CODE */
 1260|  5.54M|    ps_top_mv_pred = ps_cur_mv_pred - (ps_dec->u2_frm_wd_in_mbs << 4) + 12;
 1261|       |
 1262|  5.54M|    u4_cur_mb_intra = u1_cur_mb_type & D_INTRA_MB;
  ------------------
  |  |  382|  5.54M|#define D_INTRA_MB        1
  ------------------
 1263|  5.54M|    u4_cur_mb_fld = !!(u1_cur_mb_type & D_FLD_MB);
  ------------------
  |  |  386|  5.54M|#define D_FLD_MB          0x80
  ------------------
 1264|       |    /* Compute BS function */
 1265|  5.54M|    pu4_bs_table = ps_cur_mb_params->u4_bs_table;
 1266|       |
 1267|  5.54M|    u2_cur_csbp = ps_cur_mb_info->ps_curmb->u2_luma_csbp;
 1268|  5.54M|    u2_left_csbp = ps_cur_mb_info->ps_left_mb->u2_luma_csbp;
 1269|  5.54M|    u2_top_csbp = ps_cur_mb_info->ps_top_mb->u2_luma_csbp;
 1270|       |    /* Compute BS function */
 1271|  5.54M|    if(ps_dec->ps_cur_sps->u1_profile_idc == HIGH_PROFILE_IDC)
  ------------------
  |  |  278|  5.54M|#define HIGH_PROFILE_IDC   100
  ------------------
  |  Branch (1271:8): [True: 1.39M, False: 4.15M]
  ------------------
 1272|  1.39M|    {
 1273|  1.39M|        if(ps_cur_mb_info->u1_tran_form8x8 == 1)
  ------------------
  |  Branch (1273:12): [True: 82.6k, False: 1.31M]
  ------------------
 1274|  82.6k|        {
 1275|  82.6k|            u2_cur_csbp = ih264d_update_csbp_8x8(
 1276|  82.6k|                            ps_cur_mb_info->ps_curmb->u2_luma_csbp);
 1277|  82.6k|        }
 1278|       |
 1279|  1.39M|        if(ps_cur_mb_info->ps_left_mb->u1_tran_form8x8 == 1)
  ------------------
  |  Branch (1279:12): [True: 51.6k, False: 1.34M]
  ------------------
 1280|  51.6k|        {
 1281|  51.6k|            u2_left_csbp = ih264d_update_csbp_8x8(
 1282|  51.6k|                            ps_cur_mb_info->ps_left_mb->u2_luma_csbp);
 1283|  51.6k|        }
 1284|       |
 1285|  1.39M|        if(ps_cur_mb_info->ps_top_mb->u1_tran_form8x8 == 1)
  ------------------
  |  Branch (1285:12): [True: 71.2k, False: 1.32M]
  ------------------
 1286|  71.2k|        {
 1287|  71.2k|            u2_top_csbp = ih264d_update_csbp_8x8(
 1288|  71.2k|                            ps_cur_mb_info->ps_top_mb->u2_luma_csbp);
 1289|  71.2k|        }
 1290|  1.39M|    }
 1291|  5.54M|    if(u4_cur_mb_intra)
  ------------------
  |  Branch (1291:8): [True: 31.9k, False: 5.51M]
  ------------------
 1292|  31.9k|    {
 1293|       |
 1294|  31.9k|        pu4_bs_table[4] = 0x04040404;
 1295|  31.9k|        pu4_bs_table[0] = u4_cur_mb_fld ? 0x03030303 : 0x04040404;
  ------------------
  |  Branch (1295:27): [True: 0, False: 31.9k]
  ------------------
 1296|  31.9k|        pu4_bs_table[1] = 0x03030303;
 1297|  31.9k|        pu4_bs_table[2] = 0x03030303;
 1298|  31.9k|        pu4_bs_table[3] = 0x03030303;
 1299|  31.9k|        pu4_bs_table[5] = 0x03030303;
 1300|  31.9k|        pu4_bs_table[6] = 0x03030303;
 1301|  31.9k|        pu4_bs_table[7] = 0x03030303;
 1302|  31.9k|    }
 1303|  5.51M|    else
 1304|  5.51M|    {
 1305|  5.51M|        UWORD32 u4_is_non16x16 = !!(u1_cur_mb_type & D_PRED_NON_16x16);
  ------------------
  |  |  383|  5.51M|#define D_PRED_NON_16x16  2
  ------------------
 1306|  5.51M|        UWORD32 u4_is_b = ps_dec->u1_B;
 1307|       |
 1308|  5.51M|        ih264d_fill_bs2_horz_vert(
 1309|  5.51M|                        pu4_bs_table, u2_left_csbp, u2_top_csbp, u2_cur_csbp,
 1310|  5.51M|                        (const UWORD32 *)(gau4_ih264d_packed_bs2),
 1311|  5.51M|                        (const UWORD16 *)(gau2_ih264d_4x4_v2h_reorder));
 1312|       |
 1313|  5.51M|        if(u4_leftmbtype & D_INTRA_MB)
  ------------------
  |  |  382|  5.51M|#define D_INTRA_MB        1
  ------------------
  |  Branch (1313:12): [True: 5.14k, False: 5.51M]
  ------------------
 1314|  5.14k|            pu4_bs_table[4] = 0x04040404;
 1315|       |
 1316|  5.51M|        if(u1_top_mb_typ & D_INTRA_MB)
  ------------------
  |  |  382|  5.51M|#define D_INTRA_MB        1
  ------------------
  |  Branch (1316:12): [True: 24.5k, False: 5.49M]
  ------------------
 1317|  24.5k|            pu4_bs_table[0] = u4_cur_mb_fld ? 0x03030303 : 0x04040404;
  ------------------
  |  Branch (1317:31): [True: 0, False: 24.5k]
  ------------------
 1318|       |
 1319|  5.51M|        ps_dec->pf_fill_bs1[u4_is_b][u4_is_non16x16](
 1320|  5.51M|                        ps_cur_mv_pred, ps_top_mv_pred, apv_map_ref_idx_to_poc,
 1321|  5.51M|                        pu4_bs_table, ps_left_mv_pred,
 1322|  5.51M|                        &(ps_dec->ps_left_mvpred_addr[u1_pingpong][1]),
 1323|  5.51M|                        ps_cur_mb_info->ps_top_mb->u4_pic_addrress,
 1324|  5.51M|                        (4 >> u4_cur_mb_fld));
 1325|  5.51M|    }
 1326|       |
 1327|  5.54M|    {
 1328|  5.54M|        void ** pu4_map_ref_idx_to_poc_l1 = apv_map_ref_idx_to_poc +
 1329|  5.54M|        POC_LIST_L0_TO_L1_DIFF;
  ------------------
  |  |   86|  5.54M|#define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
  |  |  ------------------
  |  |  |  |  600|  5.54M|#define MAX_FRAMES              16
  |  |  ------------------
  ------------------
 1330|  5.54M|        {
 1331|       |            /* Store Parameter for Top MvPred refernce frame Address */
 1332|       |
 1333|  5.54M|            void ** ppv_top_mv_pred_addr = ps_cur_mb_info->ps_curmb->u4_pic_addrress;
 1334|  5.54M|            WORD8 * p1_refTop0 = (ps_cur_mv_pred + 12)->i1_ref_frame;
 1335|  5.54M|            WORD8 * p1_refTop1 = (ps_cur_mv_pred + 14)->i1_ref_frame;
 1336|       |
 1337|       |            /* Store Left addresses for Next Mb   */
 1338|  5.54M|            void ** ppv_left_mv_pred_addr =
 1339|  5.54M|                            ps_dec->ps_left_mvpred_addr[!u1_pingpong][1].u4_add;
 1340|  5.54M|            WORD8 * p1_refleft0 = (ps_cur_mv_pred + 3)->i1_ref_frame;
 1341|       |
 1342|  5.54M|            ppv_top_mv_pred_addr[0] = apv_map_ref_idx_to_poc[p1_refTop0[0]];
 1343|  5.54M|            ppv_top_mv_pred_addr[1] = pu4_map_ref_idx_to_poc_l1[p1_refTop0[1]];
 1344|       |
 1345|  5.54M|            ppv_left_mv_pred_addr[2] = apv_map_ref_idx_to_poc[p1_refTop1[0]];
 1346|  5.54M|            ppv_top_mv_pred_addr[2] = apv_map_ref_idx_to_poc[p1_refTop1[0]];
 1347|  5.54M|            ppv_left_mv_pred_addr[3] = pu4_map_ref_idx_to_poc_l1[p1_refTop1[1]];
 1348|  5.54M|            ppv_top_mv_pred_addr[3] = pu4_map_ref_idx_to_poc_l1[p1_refTop1[1]];
 1349|       |
 1350|  5.54M|            ppv_left_mv_pred_addr[0] = apv_map_ref_idx_to_poc[p1_refleft0[0]];
 1351|  5.54M|            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.54M|            ps_dec->deblk_left_mb[1].u1_mb_type = ps_cur_mb_params->u1_mb_type;
 1355|       |
 1356|  5.54M|        }
 1357|  5.54M|    }
 1358|       |
 1359|       |    /* For transform 8x8 disable deblocking of the intrernal edges of a 8x8 block */
 1360|  5.54M|    if(ps_cur_mb_info->u1_tran_form8x8)
  ------------------
  |  Branch (1360:8): [True: 91.3k, False: 5.45M]
  ------------------
 1361|  91.3k|    {
 1362|  91.3k|        pu4_bs_table[1] = 0;
 1363|  91.3k|        pu4_bs_table[3] = 0;
 1364|  91.3k|        pu4_bs_table[5] = 0;
 1365|  91.3k|        pu4_bs_table[7] = 0;
 1366|  91.3k|    }
 1367|  5.54M|}

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

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

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

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

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

ih264d_transfer_mb_group_data:
 1396|  2.30M|{
 1397|  2.30M|    dec_mb_info_t *ps_cur_mb_info = ps_dec->ps_nmb_info;
 1398|  2.30M|    tfr_ctxt_t *ps_trns_addr = &ps_dec->s_tran_addrecon;
 1399|  2.30M|    UWORD16 u2_mb_y;
 1400|  2.30M|    UWORD32 y_offset;
 1401|  2.30M|    UWORD32 u4_frame_stride;
 1402|  2.30M|    mb_neigbour_params_t *ps_temp;
 1403|  2.30M|    const UWORD8 u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
 1404|  2.30M|    UNUSED(u4_end_of_row_next);
  ------------------
  |  |   45|  2.30M|#define UNUSED(x) ((void)(x))
  ------------------
 1405|       |
 1406|  2.30M|    ps_trns_addr->pu1_dest_y += ps_trns_addr->u4_inc_y[u4_end_of_row];
 1407|  2.30M|    ps_trns_addr->pu1_dest_u += ps_trns_addr->u4_inc_uv[u4_end_of_row];
 1408|  2.30M|    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.30M|    if(u4_end_of_row)
  ------------------
  |  Branch (1411:8): [True: 2.26M, False: 43.7k]
  ------------------
 1412|  2.26M|    {
 1413|       |
 1414|  2.26M|        if(ps_dec->u1_separate_parse)
  ------------------
  |  Branch (1414:12): [True: 1.10M, False: 1.16M]
  ------------------
 1415|  1.10M|        {
 1416|  1.10M|            u2_mb_y = ps_dec->i2_dec_thread_mb_y;
 1417|  1.10M|        }
 1418|  1.16M|        else
 1419|  1.16M|        {
 1420|  1.16M|            ps_temp = ps_dec->ps_cur_mb_row;
 1421|  1.16M|            ps_dec->ps_cur_mb_row = ps_dec->ps_top_mb_row;
 1422|  1.16M|            ps_dec->ps_top_mb_row = ps_temp;
 1423|       |
 1424|  1.16M|            u2_mb_y = ps_dec->u2_mby + (1 + u1_mbaff);
 1425|  1.16M|        }
 1426|       |
 1427|  2.26M|        u4_frame_stride = ps_dec->u2_frm_wd_y
 1428|  2.26M|                        << ps_dec->ps_cur_slice->u1_field_pic_flag;
 1429|  2.26M|        y_offset = (u2_mb_y * u4_frame_stride) << 4;
 1430|  2.26M|        ps_trns_addr->pu1_dest_y = ps_dec->s_cur_pic.pu1_buf1 + y_offset;
 1431|       |
 1432|  2.26M|        u4_frame_stride = ps_dec->u2_frm_wd_uv
 1433|  2.26M|                        << ps_dec->ps_cur_slice->u1_field_pic_flag;
 1434|  2.26M|        y_offset = (u2_mb_y * u4_frame_stride) << 3;
 1435|  2.26M|        ps_trns_addr->pu1_dest_u = ps_dec->s_cur_pic.pu1_buf2 + y_offset;
 1436|  2.26M|        ps_trns_addr->pu1_dest_v = ps_dec->s_cur_pic.pu1_buf3 + y_offset;
 1437|       |
 1438|  2.26M|        ps_trns_addr->pu1_mb_y = ps_trns_addr->pu1_dest_y;
 1439|  2.26M|        ps_trns_addr->pu1_mb_u = ps_trns_addr->pu1_dest_u;
 1440|  2.26M|        ps_trns_addr->pu1_mb_v = ps_trns_addr->pu1_dest_v;
 1441|  2.26M|    }
 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.30M|    ps_dec->s_tran_addrecon.u2_mv_left_inc = ((WORD16)(u4_num_mbs >> u1_mbaff) - 1)
 1450|  2.30M|                    << (4 + u1_mbaff);
 1451|  2.30M|    ps_dec->s_tran_addrecon.u2_mv_top_left_inc = (WORD16)(u4_num_mbs << 2) - 1
 1452|  2.30M|                    - (u1_mbaff << 2);
 1453|       |
 1454|  2.30M|    if(ps_dec->u1_separate_parse == 0)
  ------------------
  |  Branch (1454:8): [True: 1.18M, False: 1.12M]
  ------------------
 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.30M|    if(ps_dec->u1_separate_parse == 0)
  ------------------
  |  Branch (1465:8): [True: 1.18M, False: 1.12M]
  ------------------
 1466|  1.18M|    {
 1467|  1.18M|        ps_dec->ps_deblk_mbn += u4_num_mbs;
 1468|  1.18M|    }
 1469|       |
 1470|  2.30M|}

ih264d_get_motion_vector_predictor:
   80|  1.91M|{
   81|  1.91M|    WORD8 c_temp;
   82|  1.91M|    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.91M|    c_temp =
   87|  1.91M|                    (ps_mv_pred[LEFT]->i1_ref_frame[u1_B] == u1_ref_idx)
  ------------------
  |  |  512|  1.91M|#define LEFT  0
  ------------------
   88|  1.91M|                                    | ((ps_mv_pred[TOP]->i1_ref_frame[u1_B]
  ------------------
  |  |  514|  1.91M|#define TOP   1
  ------------------
   89|  1.91M|                                                    == u1_ref_idx) << 1)
   90|  1.91M|                                    | ((ps_mv_pred[TOP_R]->i1_ref_frame[u1_B]
  ------------------
  |  |  516|  1.91M|#define TOP_R 2
  ------------------
   91|  1.91M|                                                    == u1_ref_idx) << 2);
   92|  1.91M|    c_temp = pu1_mv_pred_condition[c_temp];
   93|       |
   94|  1.91M|    if(c_temp != -1)
  ------------------
  |  Branch (94:8): [True: 94.2k, False: 1.82M]
  ------------------
   95|  94.2k|    {
   96|       |        /* Case when only when one of the cadidate block has the same
   97|       |         reference frame as the current block */
   98|  94.2k|        ps_result->i2_mv[uc_B2 + 0] = ps_mv_pred[c_temp]->i2_mv[uc_B2 + 0];
   99|  94.2k|        ps_result->i2_mv[uc_B2 + 1] = ps_mv_pred[c_temp]->i2_mv[uc_B2 + 1];
  100|  94.2k|    }
  101|  1.82M|    else
  102|  1.82M|    {
  103|  1.82M|        WORD32 D0, D1;
  104|  1.82M|        D0 = MIN(ps_mv_pred[0]->i2_mv[uc_B2 + 0],
  ------------------
  |  |   61|  1.82M|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 109k, False: 1.71M]
  |  |  ------------------
  ------------------
  105|  1.82M|                 ps_mv_pred[1]->i2_mv[uc_B2 + 0]);
  106|  1.82M|        D1 = MAX(ps_mv_pred[0]->i2_mv[uc_B2 + 0],
  ------------------
  |  |   60|  1.82M|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 124k, False: 1.70M]
  |  |  ------------------
  ------------------
  107|  1.82M|                 ps_mv_pred[1]->i2_mv[uc_B2 + 0]);
  108|  1.82M|        D1 = MIN(D1, ps_mv_pred[2]->i2_mv[uc_B2 + 0]);
  ------------------
  |  |   61|  1.82M|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 73.4k, False: 1.75M]
  |  |  ------------------
  ------------------
  109|  1.82M|        ps_result->i2_mv[uc_B2 + 0] = (WORD16)(MAX(D0, D1));
  ------------------
  |  |   60|  1.82M|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 62.7k, False: 1.76M]
  |  |  ------------------
  ------------------
  110|       |
  111|  1.82M|        D0 = MIN(ps_mv_pred[0]->i2_mv[uc_B2 + 1],
  ------------------
  |  |   61|  1.82M|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 89.6k, False: 1.73M]
  |  |  ------------------
  ------------------
  112|  1.82M|                 ps_mv_pred[1]->i2_mv[uc_B2 + 1]);
  113|  1.82M|        D1 = MAX(ps_mv_pred[0]->i2_mv[uc_B2 + 1],
  ------------------
  |  |   60|  1.82M|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 114k, False: 1.71M]
  |  |  ------------------
  ------------------
  114|  1.82M|                 ps_mv_pred[1]->i2_mv[uc_B2 + 1]);
  115|  1.82M|        D1 = MIN(D1, ps_mv_pred[2]->i2_mv[uc_B2 + 1]);
  ------------------
  |  |   61|  1.82M|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 55.5k, False: 1.76M]
  |  |  ------------------
  ------------------
  116|  1.82M|        ps_result->i2_mv[uc_B2 + 1] = (WORD16)(MAX(D0, D1));
  ------------------
  |  |   60|  1.82M|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 55.1k, False: 1.77M]
  |  |  ------------------
  ------------------
  117|       |
  118|  1.82M|    }
  119|  1.91M|}
ih264d_non_mbaff_mv_pred:
  342|  13.2M|{
  343|  13.2M|    UWORD16 u2_b_in = 0, u2_c_in = 0, u2_d_in = 0;
  344|  13.2M|    UWORD32 u4_sub_mb_x = (u4_sub_mb_num & 3), uc_sub_mb_y = (u4_sub_mb_num >> 2);
  345|       |
  346|       |    /* Checking in the subMB exists, calculating their motion vectors to be
  347|       |     used as predictors and the reference frames of those subMBs */
  348|       |
  349|  13.2M|    ps_mv_pred[LEFT] = &ps_dec->s_default_mv_pred;
  ------------------
  |  |  512|  13.2M|#define LEFT  0
  ------------------
  350|  13.2M|    ps_mv_pred[TOP] = &(ps_dec->s_default_mv_pred);
  ------------------
  |  |  514|  13.2M|#define TOP   1
  ------------------
  351|  13.2M|    ps_mv_pred[TOP_R] = &(ps_dec->s_default_mv_pred);
  ------------------
  |  |  516|  13.2M|#define TOP_R 2
  ------------------
  352|       |    /* Check if the left subMb is available */
  353|       |
  354|  13.2M|    if(u4_sub_mb_x)
  ------------------
  |  Branch (354:8): [True: 206k, False: 13.0M]
  ------------------
  355|   206k|    {
  356|   206k|        ps_mv_pred[LEFT] = (ps_mv_nmb - 1);
  ------------------
  |  |  512|   206k|#define LEFT  0
  ------------------
  357|   206k|    }
  358|  13.0M|    else
  359|  13.0M|    {
  360|  13.0M|        if(ps_cur_mb_info->u1_mb_ngbr_availablity & LEFT_MB_AVAILABLE_MASK)
  ------------------
  |  |   53|  13.0M|#define LEFT_MB_AVAILABLE_MASK      0x01
  ------------------
  |  Branch (360:12): [True: 10.8M, False: 2.18M]
  ------------------
  361|  10.8M|        {
  362|  10.8M|            ps_mv_pred[LEFT] = (ps_mv_nmb - 13);
  ------------------
  |  |  512|  10.8M|#define LEFT  0
  ------------------
  363|  10.8M|        }
  364|  13.0M|    }
  365|       |
  366|       |    /* Check if the top subMB is available */
  367|  13.2M|    if(uc_sub_mb_y)
  ------------------
  |  Branch (367:8): [True: 220k, False: 13.0M]
  ------------------
  368|   220k|    {
  369|   220k|        u2_b_in = 1;
  370|   220k|        ps_mv_ntop = ps_mv_nmb - 4;
  371|   220k|        ps_mv_pred[TOP] = ps_mv_ntop;
  ------------------
  |  |  514|   220k|#define TOP   1
  ------------------
  372|       |
  373|   220k|    }
  374|  13.0M|    else
  375|  13.0M|    {
  376|  13.0M|        u2_b_in = (ps_cur_mb_info->u1_mb_ngbr_availablity & TOP_MB_AVAILABLE_MASK);
  ------------------
  |  |   55|  13.0M|#define TOP_MB_AVAILABLE_MASK       0x04
  ------------------
  377|  13.0M|        if(u2_b_in)
  ------------------
  |  Branch (377:12): [True: 12.1M, False: 855k]
  ------------------
  378|  12.1M|        {
  379|  12.1M|            ps_mv_pred[TOP] = ps_mv_ntop;
  ------------------
  |  |  514|  12.1M|#define TOP   1
  ------------------
  380|  12.1M|        }
  381|  13.0M|    }
  382|       |
  383|       |    /* Check if the top right subMb is available. The top right subMb is
  384|       |     defined as the top right subMb at the top right corner of the MB
  385|       |     partition. The top right subMb index starting from the top left
  386|       |     corner of the MB partition is given by
  387|       |     TopRightSubMbIndx = TopLeftSubMbIndx + (WidthOfMbPartition - 6) / 2
  388|       |     */
  389|  13.2M|    u2_c_in = CHECKBIT(ps_cur_mb_info->u2_top_right_avail_mask,
  ------------------
  |  |   54|  13.2M|#define CHECKBIT(a,i) ((a) &  (1 << i))
  ------------------
  390|  13.2M|                        (u4_sub_mb_num + uc_mb_part_width - 1));
  391|  13.2M|    if(u2_c_in)
  ------------------
  |  Branch (391:8): [True: 10.2M, False: 2.94M]
  ------------------
  392|  10.2M|    {
  393|  10.2M|        ps_mv_pred[TOP_R] = (ps_mv_ntop + uc_mb_part_width);
  ------------------
  |  |  516|  10.2M|#define TOP_R 2
  ------------------
  394|       |
  395|  10.2M|        if(uc_sub_mb_y == 0)
  ------------------
  |  Branch (395:12): [True: 10.2M, False: 77.1k]
  ------------------
  396|  10.2M|        {
  397|       |            /* CHANGED CODE */
  398|  10.2M|            if((u4_sub_mb_x + uc_mb_part_width) > 3)
  ------------------
  |  Branch (398:16): [True: 10.1M, False: 101k]
  ------------------
  399|  10.1M|                ps_mv_pred[TOP_R] += 12;
  ------------------
  |  |  516|  10.1M|#define TOP_R 2
  ------------------
  400|  10.2M|        }
  401|  10.2M|    }
  402|  2.94M|    else
  403|  2.94M|    {
  404|  2.94M|        u2_d_in = CHECKBIT(ps_cur_mb_info->u2_top_left_avail_mask, u4_sub_mb_num);
  ------------------
  |  |   54|  2.94M|#define CHECKBIT(a,i) ((a) &  (1 << i))
  ------------------
  405|       |        /* Check if the the top left subMB is available */
  406|  2.94M|        if(u2_d_in)
  ------------------
  |  Branch (406:12): [True: 2.08M, False: 860k]
  ------------------
  407|  2.08M|        {
  408|       |            /* CHANGED CODE */
  409|  2.08M|            ps_mv_pred[TOP_R] = (ps_mv_ntop - 1);
  ------------------
  |  |  516|  2.08M|#define TOP_R 2
  ------------------
  410|  2.08M|            if(u4_sub_mb_x == 0)
  ------------------
  |  Branch (410:16): [True: 2.00M, False: 85.7k]
  ------------------
  411|  2.00M|            {
  412|  2.00M|                if(uc_sub_mb_y)
  ------------------
  |  Branch (412:20): [True: 62.1k, False: 1.94M]
  ------------------
  413|  62.1k|                {
  414|  62.1k|                    ps_mv_pred[TOP_R] = (ps_mv_nmb - 17);
  ------------------
  |  |  516|  62.1k|#define TOP_R 2
  ------------------
  415|  62.1k|                }
  416|  1.94M|                else
  417|  1.94M|                {
  418|       |                    /* CHANGED CODE */
  419|  1.94M|                    ps_mv_pred[TOP_R] -= 12;
  ------------------
  |  |  516|  1.94M|#define TOP_R 2
  ------------------
  420|  1.94M|                }
  421|  2.00M|            }
  422|  2.08M|        }
  423|   860k|        else if(u2_b_in == 0)
  ------------------
  |  Branch (423:17): [True: 819k, False: 40.7k]
  ------------------
  424|   819k|        {
  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|   819k|            ps_mv_pred[TOP] = ps_mv_pred[LEFT];
  ------------------
  |  |  514|   819k|#define TOP   1
  ------------------
                          ps_mv_pred[TOP] = ps_mv_pred[LEFT];
  ------------------
  |  |  512|   819k|#define LEFT  0
  ------------------
  428|   819k|            ps_mv_pred[TOP_R] = ps_mv_pred[LEFT];
  ------------------
  |  |  516|   819k|#define TOP_R 2
  ------------------
                          ps_mv_pred[TOP_R] = ps_mv_pred[LEFT];
  ------------------
  |  |  512|   819k|#define LEFT  0
  ------------------
  429|   819k|        }
  430|  2.94M|    }
  431|  13.2M|}
ih264d_mvpred_nonmbaffB:
  468|  3.24M|{
  469|  3.24M|    UWORD8 u1_a_in, u1_b_in, uc_temp1, uc_temp2, uc_temp3;
  470|  3.24M|    mv_pred_t *ps_mv_pred[3];
  471|  3.24M|    UWORD8 uc_B2, uc_lx, u1_ref_idx;
  472|  3.24M|    UWORD8 u1_direct_zero_pred_flag = 0;
  473|       |
  474|  3.24M|    ih264d_non_mbaff_mv_pred(ps_mv_pred, u4_sub_mb_num, ps_mv_nmb, ps_mv_ntop,
  475|  3.24M|                             ps_dec, uc_mb_part_width, ps_cur_mb_info);
  476|       |
  477|  6.54M|    for(uc_lx = u1_lx_start; uc_lx < u1_lxend; uc_lx++)
  ------------------
  |  Branch (477:30): [True: 3.29M, False: 3.24M]
  ------------------
  478|  3.29M|    {
  479|  3.29M|        u1_ref_idx = ps_mv_final_pred->i1_ref_frame[uc_lx];
  480|  3.29M|        uc_B2 = (uc_lx << 1);
  481|  3.29M|        switch(u1_mb_mc_mode)
  482|  3.29M|        {
  483|   103k|            case PRED_16x8:
  ------------------
  |  |  451|   103k|#define PRED_16x8   1
  ------------------
  |  Branch (483:13): [True: 103k, False: 3.19M]
  ------------------
  484|       |                /* Directional prediction for a 16x8 MB partition */
  485|   103k|                if(u4_sub_mb_num == 0)
  ------------------
  |  Branch (485:20): [True: 42.4k, False: 60.7k]
  ------------------
  486|  42.4k|                {
  487|       |                    /* Calculating the MV pred for the top 16x8 block */
  488|  42.4k|                    if(ps_mv_pred[TOP]->i1_ref_frame[uc_lx] == u1_ref_idx)
  ------------------
  |  |  514|  42.4k|#define TOP   1
  ------------------
  |  Branch (488:24): [True: 21.1k, False: 21.2k]
  ------------------
  489|  21.1k|                    {
  490|       |                        /* If the reference frame used by the top subMB is same as the
  491|       |                         reference frame used by the current block then MV predictor to
  492|       |                         be used for the current block is same as the MV of the top
  493|       |                         subMB */
  494|  21.1k|                        ps_mv_final_pred->i2_mv[uc_B2 + 0] =
  495|  21.1k|                                        ps_mv_pred[TOP]->i2_mv[uc_B2 + 0];
  ------------------
  |  |  514|  21.1k|#define TOP   1
  ------------------
  496|  21.1k|                        ps_mv_final_pred->i2_mv[uc_B2 + 1] =
  497|  21.1k|                                        ps_mv_pred[TOP]->i2_mv[uc_B2 + 1];
  ------------------
  |  |  514|  21.1k|#define TOP   1
  ------------------
  498|  21.1k|                    }
  499|  21.2k|                    else
  500|  21.2k|                    {
  501|       |                        /* The MV predictor is calculated according to the process
  502|       |                         defined in 8.4.1.2.1 */
  503|  21.2k|                        ih264d_get_motion_vector_predictor(
  504|  21.2k|                                        ps_mv_final_pred,
  505|  21.2k|                                        ps_mv_pred,
  506|  21.2k|                                        u1_ref_idx,
  507|  21.2k|                                        uc_lx,
  508|  21.2k|                                        (const UWORD8 *)gau1_ih264d_mv_pred_condition);
  509|  21.2k|                    }
  510|  42.4k|                }
  511|  60.7k|                else
  512|  60.7k|                {
  513|  60.7k|                    if(ps_mv_pred[LEFT]->i1_ref_frame[uc_lx] == u1_ref_idx)
  ------------------
  |  |  512|  60.7k|#define LEFT  0
  ------------------
  |  Branch (513:24): [True: 28.8k, False: 31.8k]
  ------------------
  514|  28.8k|                    {
  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|  28.8k|                        ps_mv_final_pred->i2_mv[uc_B2 + 0] =
  520|  28.8k|                                        ps_mv_pred[LEFT]->i2_mv[uc_B2 + 0];
  ------------------
  |  |  512|  28.8k|#define LEFT  0
  ------------------
  521|  28.8k|                        ps_mv_final_pred->i2_mv[uc_B2 + 1] =
  522|  28.8k|                                        ps_mv_pred[LEFT]->i2_mv[uc_B2 + 1];
  ------------------
  |  |  512|  28.8k|#define LEFT  0
  ------------------
  523|  28.8k|                    }
  524|  31.8k|                    else
  525|  31.8k|                    {
  526|       |                        /* The MV predictor is calculated according to the process
  527|       |                         defined in 8.4.1.2.1 */
  528|  31.8k|                        ih264d_get_motion_vector_predictor(
  529|  31.8k|                                        ps_mv_final_pred,
  530|  31.8k|                                        ps_mv_pred,
  531|  31.8k|                                        u1_ref_idx,
  532|  31.8k|                                        uc_lx,
  533|  31.8k|                                        (const UWORD8 *)gau1_ih264d_mv_pred_condition);
  534|  31.8k|                    }
  535|  60.7k|                }
  536|   103k|                break;
  537|  47.9k|            case PRED_8x16:
  ------------------
  |  |  452|  47.9k|#define PRED_8x16   2
  ------------------
  |  Branch (537:13): [True: 47.9k, False: 3.25M]
  ------------------
  538|       |                /* Directional prediction for a 8x16 MB partition */
  539|  47.9k|                if(u4_sub_mb_num == 0)
  ------------------
  |  Branch (539:20): [True: 23.7k, False: 24.1k]
  ------------------
  540|  23.7k|                {
  541|  23.7k|                    if(ps_mv_pred[LEFT]->i1_ref_frame[uc_lx] == u1_ref_idx)
  ------------------
  |  |  512|  23.7k|#define LEFT  0
  ------------------
  |  Branch (541:24): [True: 12.0k, False: 11.7k]
  ------------------
  542|  12.0k|                    {
  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.0k|                        ps_mv_final_pred->i2_mv[uc_B2 + 0] =
  548|  12.0k|                                        ps_mv_pred[LEFT]->i2_mv[uc_B2 + 0];
  ------------------
  |  |  512|  12.0k|#define LEFT  0
  ------------------
  549|  12.0k|                        ps_mv_final_pred->i2_mv[uc_B2 + 1] =
  550|  12.0k|                                        ps_mv_pred[LEFT]->i2_mv[uc_B2 + 1];
  ------------------
  |  |  512|  12.0k|#define LEFT  0
  ------------------
  551|  12.0k|                    }
  552|  11.7k|                    else
  553|  11.7k|                    {
  554|       |                        /* The MV predictor is calculated according to the process
  555|       |                         defined in 8.4.1.2.1 */
  556|  11.7k|                        ih264d_get_motion_vector_predictor(
  557|  11.7k|                                        ps_mv_final_pred,
  558|  11.7k|                                        ps_mv_pred,
  559|  11.7k|                                        u1_ref_idx,
  560|  11.7k|                                        uc_lx,
  561|  11.7k|                                        (const UWORD8 *)gau1_ih264d_mv_pred_condition);
  562|  11.7k|                    }
  563|  23.7k|                }
  564|  24.1k|                else
  565|  24.1k|                {
  566|  24.1k|                    if(ps_mv_pred[TOP_R]->i1_ref_frame[uc_lx] == u1_ref_idx)
  ------------------
  |  |  516|  24.1k|#define TOP_R 2
  ------------------
  |  Branch (566:24): [True: 13.4k, False: 10.6k]
  ------------------
  567|  13.4k|                    {
  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.4k|                        ps_mv_final_pred->i2_mv[uc_B2 + 0] =
  573|  13.4k|                                        ps_mv_pred[TOP_R]->i2_mv[uc_B2 + 0];
  ------------------
  |  |  516|  13.4k|#define TOP_R 2
  ------------------
  574|  13.4k|                        ps_mv_final_pred->i2_mv[uc_B2 + 1] =
  575|  13.4k|                                        ps_mv_pred[TOP_R]->i2_mv[uc_B2 + 1];
  ------------------
  |  |  516|  13.4k|#define TOP_R 2
  ------------------
  576|  13.4k|                    }
  577|  10.6k|                    else
  578|  10.6k|                    {
  579|       |                        /* The MV predictor is calculated according to the process
  580|       |                         defined in 8.4.1.2.1 */
  581|  10.6k|                        ih264d_get_motion_vector_predictor(
  582|  10.6k|                                        ps_mv_final_pred,
  583|  10.6k|                                        ps_mv_pred,
  584|  10.6k|                                        u1_ref_idx,
  585|  10.6k|                                        uc_lx,
  586|  10.6k|                                        (const UWORD8 *)gau1_ih264d_mv_pred_condition);
  587|  10.6k|                    }
  588|  24.1k|                }
  589|  47.9k|                break;
  590|   674k|            case B_DIRECT_SPATIAL:
  ------------------
  |  |  489|   674k|#define B_DIRECT_SPATIAL  26
  ------------------
  |  Branch (590:13): [True: 674k, False: 2.62M]
  ------------------
  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|   674k|                uc_temp1 = (UWORD8)ps_mv_pred[LEFT]->i1_ref_frame[0];
  ------------------
  |  |  512|   674k|#define LEFT  0
  ------------------
  599|   674k|                uc_temp2 = (UWORD8)ps_mv_pred[TOP]->i1_ref_frame[0];
  ------------------
  |  |  514|   674k|#define TOP   1
  ------------------
  600|   674k|                uc_temp3 = (UWORD8)ps_mv_pred[TOP_R]->i1_ref_frame[0];
  ------------------
  |  |  516|   674k|#define TOP_R 2
  ------------------
  601|       |
  602|   674k|                ps_mv_final_pred->i1_ref_frame[0] = MIN(uc_temp1,
  ------------------
  |  |   61|  1.34M|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 5.15k, False: 668k]
  |  |  |  Branch (61:24): [True: 8.02k, False: 665k]
  |  |  |  Branch (61:32): [True: 7.99k, False: 660k]
  |  |  ------------------
  ------------------
  603|   674k|                                                      MIN(uc_temp2, uc_temp3));
  604|       |
  605|   674k|                uc_temp1 = (UWORD8)ps_mv_pred[LEFT]->i1_ref_frame[1];
  ------------------
  |  |  512|   674k|#define LEFT  0
  ------------------
  606|   674k|                uc_temp2 = (UWORD8)ps_mv_pred[TOP]->i1_ref_frame[1];
  ------------------
  |  |  514|   674k|#define TOP   1
  ------------------
  607|   674k|                uc_temp3 = (UWORD8)ps_mv_pred[TOP_R]->i1_ref_frame[1];
  ------------------
  |  |  516|   674k|#define TOP_R 2
  ------------------
  608|       |
  609|   674k|                ps_mv_final_pred->i1_ref_frame[1] = MIN(uc_temp1,
  ------------------
  |  |   61|  1.34M|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 3.77k, False: 670k]
  |  |  |  Branch (61:24): [True: 7.57k, False: 666k]
  |  |  |  Branch (61:32): [True: 7.54k, False: 662k]
  |  |  ------------------
  ------------------
  610|   674k|                                                      MIN(uc_temp2, uc_temp3));
  611|       |
  612|   674k|                if((ps_mv_final_pred->i1_ref_frame[0] < 0)
  ------------------
  |  Branch (612:20): [True: 99.3k, False: 574k]
  ------------------
  613|  99.3k|                                && (ps_mv_final_pred->i1_ref_frame[1] < 0))
  ------------------
  |  Branch (613:36): [True: 14.8k, False: 84.4k]
  ------------------
  614|  14.8k|                {
  615|  14.8k|                    u1_direct_zero_pred_flag = 1;
  616|  14.8k|                    ps_mv_final_pred->i1_ref_frame[0] = 0;
  617|  14.8k|                    ps_mv_final_pred->i1_ref_frame[1] = 0;
  618|  14.8k|                }
  619|   674k|                ih264d_get_motion_vector_predictor(
  620|   674k|                                ps_mv_final_pred, ps_mv_pred,
  621|   674k|                                ps_mv_final_pred->i1_ref_frame[0], 0,
  622|   674k|                                (const UWORD8 *)gau1_ih264d_mv_pred_condition);
  623|       |
  624|   674k|                ih264d_get_motion_vector_predictor(
  625|   674k|                                ps_mv_final_pred, ps_mv_pred,
  626|   674k|                                ps_mv_final_pred->i1_ref_frame[1], 1,
  627|   674k|                                (const UWORD8 *)gau1_ih264d_mv_pred_condition);
  628|       |
  629|   674k|                break;
  630|  2.28M|            case MB_SKIP:
  ------------------
  |  |  456|  2.28M|#define MB_SKIP     255
  ------------------
  |  Branch (630:13): [True: 2.28M, False: 1.01M]
  ------------------
  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.28M|                u1_a_in = (ps_cur_mb_info->u1_mb_ngbr_availablity &
  639|  2.28M|                LEFT_MB_AVAILABLE_MASK);
  ------------------
  |  |   53|  2.28M|#define LEFT_MB_AVAILABLE_MASK      0x01
  ------------------
  640|  2.28M|                u1_b_in = (ps_cur_mb_info->u1_mb_ngbr_availablity &
  641|  2.28M|                TOP_MB_AVAILABLE_MASK);
  ------------------
  |  |   55|  2.28M|#define TOP_MB_AVAILABLE_MASK       0x04
  ------------------
  642|  2.28M|                if(((u1_a_in * u1_b_in) == 0)
  ------------------
  |  Branch (642:20): [True: 366k, False: 1.92M]
  ------------------
  643|  1.92M|                                || ((ps_mv_pred[LEFT]->i2_mv[0]
  ------------------
  |  |  512|  1.92M|#define LEFT  0
  ------------------
  |  Branch (643:36): [True: 1.92M, False: 535]
  ------------------
  644|  1.92M|                                                | ps_mv_pred[LEFT]->i2_mv[1]
  ------------------
  |  |  512|  1.92M|#define LEFT  0
  ------------------
  645|  1.92M|                                                | ps_mv_pred[LEFT]->i1_ref_frame[0])
  ------------------
  |  |  512|  1.92M|#define LEFT  0
  ------------------
  646|  1.92M|                                                == 0)
  647|    535|                                || ((ps_mv_pred[TOP]->i2_mv[0]
  ------------------
  |  |  514|    535|#define TOP   1
  ------------------
  |  Branch (647:36): [True: 9, False: 526]
  ------------------
  648|    535|                                                | ps_mv_pred[TOP]->i2_mv[1]
  ------------------
  |  |  514|    535|#define TOP   1
  ------------------
  649|    535|                                                | ps_mv_pred[TOP]->i1_ref_frame[0])
  ------------------
  |  |  514|    535|#define TOP   1
  ------------------
  650|    535|                                                == 0))
  651|  2.28M|                {
  652|  2.28M|                    ps_mv_final_pred->i2_mv[0] = 0;
  653|  2.28M|                    ps_mv_final_pred->i2_mv[1] = 0;
  654|  2.28M|                    break;
  655|  2.28M|                }
  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|   186k|            default:
  ------------------
  |  Branch (658:13): [True: 186k, False: 3.11M]
  ------------------
  659|   186k|                ih264d_get_motion_vector_predictor(
  660|   186k|                                ps_mv_final_pred, ps_mv_pred, u1_ref_idx, uc_lx,
  661|   186k|                                (const UWORD8 *)gau1_ih264d_mv_pred_condition);
  662|   186k|                break;
  663|  3.29M|        }
  664|  3.29M|    }
  665|  3.24M|    return (u1_direct_zero_pred_flag);
  666|  3.24M|}
ih264d_mvpred_nonmbaff:
  703|  9.98M|{
  704|  9.98M|    UWORD8 u1_a_in, u1_b_in, uc_temp1, uc_temp2, uc_temp3;
  705|  9.98M|    mv_pred_t *ps_mv_pred[3];
  706|  9.98M|    UWORD8 u1_ref_idx;
  707|  9.98M|    UWORD8 u1_direct_zero_pred_flag = 0;
  708|  9.98M|    UNUSED(u1_lx_start);
  ------------------
  |  |   45|  9.98M|#define UNUSED(x) ((void)(x))
  ------------------
  709|  9.98M|    UNUSED(u1_lxend);
  ------------------
  |  |   45|  9.98M|#define UNUSED(x) ((void)(x))
  ------------------
  710|  9.98M|    ih264d_non_mbaff_mv_pred(ps_mv_pred, u4_sub_mb_num, ps_mv_nmb, ps_mv_ntop,
  711|  9.98M|                             ps_dec, uc_mb_part_width, ps_cur_mb_info);
  712|       |
  713|  9.98M|    u1_ref_idx = ps_mv_final_pred->i1_ref_frame[0];
  714|       |
  715|  9.98M|    switch(u1_mb_mc_mode)
  716|  9.98M|    {
  717|  62.4k|        case PRED_16x8:
  ------------------
  |  |  451|  62.4k|#define PRED_16x8   1
  ------------------
  |  Branch (717:9): [True: 62.4k, False: 9.92M]
  ------------------
  718|       |            /* Directional prediction for a 16x8 MB partition */
  719|  62.4k|            if(u4_sub_mb_num == 0)
  ------------------
  |  Branch (719:16): [True: 31.2k, False: 31.2k]
  ------------------
  720|  31.2k|            {
  721|       |                /* Calculating the MV pred for the top 16x8 block */
  722|  31.2k|                if(ps_mv_pred[TOP]->i1_ref_frame[0] == u1_ref_idx)
  ------------------
  |  |  514|  31.2k|#define TOP   1
  ------------------
  |  Branch (722:20): [True: 17.9k, False: 13.3k]
  ------------------
  723|  17.9k|                {
  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|  17.9k|                    ps_mv_final_pred->i2_mv[0] = ps_mv_pred[TOP]->i2_mv[0];
  ------------------
  |  |  514|  17.9k|#define TOP   1
  ------------------
  730|  17.9k|                    ps_mv_final_pred->i2_mv[1] = ps_mv_pred[TOP]->i2_mv[1];
  ------------------
  |  |  514|  17.9k|#define TOP   1
  ------------------
  731|  17.9k|                }
  732|  13.3k|                else
  733|  13.3k|                {
  734|       |                    /* The MV predictor is calculated according to the process
  735|       |                     defined in 8.4.1.2.1 */
  736|  13.3k|                    ih264d_get_motion_vector_predictor(
  737|  13.3k|                                    ps_mv_final_pred,
  738|  13.3k|                                    ps_mv_pred,
  739|  13.3k|                                    u1_ref_idx,
  740|  13.3k|                                    0,
  741|  13.3k|                                    (const UWORD8 *)gau1_ih264d_mv_pred_condition);
  742|  13.3k|                }
  743|  31.2k|            }
  744|  31.2k|            else
  745|  31.2k|            {
  746|  31.2k|                if(ps_mv_pred[LEFT]->i1_ref_frame[0] == u1_ref_idx)
  ------------------
  |  |  512|  31.2k|#define LEFT  0
  ------------------
  |  Branch (746:20): [True: 11.8k, False: 19.3k]
  ------------------
  747|  11.8k|                {
  748|       |                    /* If the reference frame used by the left subMB is same as the
  749|       |                     reference frame used by the current block then MV predictor to
  750|       |                     be used for the current block is same as the MV of the left
  751|       |                     subMB */
  752|       |
  753|  11.8k|                    ps_mv_final_pred->i2_mv[0] = ps_mv_pred[LEFT]->i2_mv[0];
  ------------------
  |  |  512|  11.8k|#define LEFT  0
  ------------------
  754|  11.8k|                    ps_mv_final_pred->i2_mv[1] = ps_mv_pred[LEFT]->i2_mv[1];
  ------------------
  |  |  512|  11.8k|#define LEFT  0
  ------------------
  755|  11.8k|                }
  756|  19.3k|                else
  757|  19.3k|                {
  758|       |                    /* The MV predictor is calculated according to the process
  759|       |                     defined in 8.4.1.2.1 */
  760|  19.3k|                    ih264d_get_motion_vector_predictor(
  761|  19.3k|                                    ps_mv_final_pred,
  762|  19.3k|                                    ps_mv_pred,
  763|  19.3k|                                    u1_ref_idx,
  764|  19.3k|                                    0,
  765|  19.3k|                                    (const UWORD8 *)gau1_ih264d_mv_pred_condition);
  766|  19.3k|                }
  767|  31.2k|            }
  768|  62.4k|            break;
  769|  58.2k|        case PRED_8x16:
  ------------------
  |  |  452|  58.2k|#define PRED_8x16   2
  ------------------
  |  Branch (769:9): [True: 58.2k, False: 9.92M]
  ------------------
  770|       |            /* Directional prediction for a 8x16 MB partition */
  771|  58.2k|            if(u4_sub_mb_num == 0)
  ------------------
  |  Branch (771:16): [True: 30.5k, False: 27.7k]
  ------------------
  772|  30.5k|            {
  773|  30.5k|                if(ps_mv_pred[LEFT]->i1_ref_frame[0] == u1_ref_idx)
  ------------------
  |  |  512|  30.5k|#define LEFT  0
  ------------------
  |  Branch (773:20): [True: 9.46k, False: 21.0k]
  ------------------
  774|  9.46k|                {
  775|       |                    /* If the reference frame used by the left subMB is same as the
  776|       |                     reference frame used by the current block then MV predictor to
  777|       |                     be used for the current block is same as the MV of the left
  778|       |                     subMB */
  779|       |
  780|  9.46k|                    ps_mv_final_pred->i2_mv[0] = ps_mv_pred[LEFT]->i2_mv[0];
  ------------------
  |  |  512|  9.46k|#define LEFT  0
  ------------------
  781|  9.46k|                    ps_mv_final_pred->i2_mv[1] = ps_mv_pred[LEFT]->i2_mv[1];
  ------------------
  |  |  512|  9.46k|#define LEFT  0
  ------------------
  782|  9.46k|                }
  783|  21.0k|                else
  784|  21.0k|                {
  785|       |                    /* The MV predictor is calculated according to the process
  786|       |                     defined in 8.4.1.2.1 */
  787|  21.0k|                    ih264d_get_motion_vector_predictor(
  788|  21.0k|                                    ps_mv_final_pred,
  789|  21.0k|                                    ps_mv_pred,
  790|  21.0k|                                    u1_ref_idx,
  791|  21.0k|                                    0,
  792|  21.0k|                                    (const UWORD8 *)gau1_ih264d_mv_pred_condition);
  793|  21.0k|                }
  794|  30.5k|            }
  795|  27.7k|            else
  796|  27.7k|            {
  797|  27.7k|                if(ps_mv_pred[TOP_R]->i1_ref_frame[0] == u1_ref_idx)
  ------------------
  |  |  516|  27.7k|#define TOP_R 2
  ------------------
  |  Branch (797:20): [True: 17.7k, False: 9.95k]
  ------------------
  798|  17.7k|                {
  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|  17.7k|                    ps_mv_final_pred->i2_mv[0] = ps_mv_pred[TOP_R]->i2_mv[0];
  ------------------
  |  |  516|  17.7k|#define TOP_R 2
  ------------------
  805|  17.7k|                    ps_mv_final_pred->i2_mv[1] = ps_mv_pred[TOP_R]->i2_mv[1];
  ------------------
  |  |  516|  17.7k|#define TOP_R 2
  ------------------
  806|  17.7k|                }
  807|  9.95k|                else
  808|  9.95k|                {
  809|       |                    /* The MV predictor is calculated according to the process
  810|       |                     defined in 8.4.1.2.1 */
  811|  9.95k|                    ih264d_get_motion_vector_predictor(
  812|  9.95k|                                    ps_mv_final_pred,
  813|  9.95k|                                    ps_mv_pred,
  814|  9.95k|                                    u1_ref_idx,
  815|  9.95k|                                    0,
  816|  9.95k|                                    (const UWORD8 *)gau1_ih264d_mv_pred_condition);
  817|  9.95k|                }
  818|  27.7k|            }
  819|  58.2k|            break;
  820|      0|        case B_DIRECT_SPATIAL:
  ------------------
  |  |  489|      0|#define B_DIRECT_SPATIAL  26
  ------------------
  |  Branch (820:9): [True: 0, False: 9.98M]
  ------------------
  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.64M|        case MB_SKIP:
  ------------------
  |  |  456|  9.64M|#define MB_SKIP     255
  ------------------
  |  Branch (860:9): [True: 9.64M, False: 340k]
  ------------------
  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.64M|            u1_a_in = (ps_cur_mb_info->u1_mb_ngbr_availablity &
  869|  9.64M|            LEFT_MB_AVAILABLE_MASK);
  ------------------
  |  |   53|  9.64M|#define LEFT_MB_AVAILABLE_MASK      0x01
  ------------------
  870|  9.64M|            u1_b_in = (ps_cur_mb_info->u1_mb_ngbr_availablity &
  871|  9.64M|            TOP_MB_AVAILABLE_MASK);
  ------------------
  |  |   55|  9.64M|#define TOP_MB_AVAILABLE_MASK       0x04
  ------------------
  872|  9.64M|            if(((u1_a_in * u1_b_in) == 0)
  ------------------
  |  Branch (872:16): [True: 2.16M, False: 7.47M]
  ------------------
  873|  7.47M|                            || ((ps_mv_pred[LEFT]->i2_mv[0]
  ------------------
  |  |  512|  7.47M|#define LEFT  0
  ------------------
  |  Branch (873:32): [True: 7.44M, False: 33.3k]
  ------------------
  874|  7.47M|                                            | ps_mv_pred[LEFT]->i2_mv[1]
  ------------------
  |  |  512|  7.47M|#define LEFT  0
  ------------------
  875|  7.47M|                                            | ps_mv_pred[LEFT]->i1_ref_frame[0])
  ------------------
  |  |  512|  7.47M|#define LEFT  0
  ------------------
  876|  7.47M|                                            == 0)
  877|  33.3k|                            || ((ps_mv_pred[TOP]->i2_mv[0]
  ------------------
  |  |  514|  33.3k|#define TOP   1
  ------------------
  |  Branch (877:32): [True: 7.26k, False: 26.0k]
  ------------------
  878|  33.3k|                                            | ps_mv_pred[TOP]->i2_mv[1]
  ------------------
  |  |  514|  33.3k|#define TOP   1
  ------------------
  879|  33.3k|                                            | ps_mv_pred[TOP]->i1_ref_frame[0])
  ------------------
  |  |  514|  33.3k|#define TOP   1
  ------------------
  880|  33.3k|                                            == 0))
  881|  9.61M|            {
  882|       |
  883|  9.61M|                ps_mv_final_pred->i2_mv[0] = 0;
  884|  9.61M|                ps_mv_final_pred->i2_mv[1] = 0;
  885|  9.61M|                break;
  886|  9.61M|            }
  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|   245k|        default:
  ------------------
  |  Branch (889:9): [True: 219k, False: 9.76M]
  ------------------
  890|   245k|            ih264d_get_motion_vector_predictor(
  891|   245k|                            ps_mv_final_pred, ps_mv_pred, u1_ref_idx, 0,
  892|   245k|                            (const UWORD8 *)gau1_ih264d_mv_pred_condition);
  893|   245k|            break;
  894|  9.98M|    }
  895|       |
  896|  9.98M|    return (u1_direct_zero_pred_flag);
  897|  9.98M|}
ih264d_rep_mv_colz:
 1175|  14.0M|{
 1176|       |
 1177|  14.0M|    UWORD8 k, m;
 1178|  14.0M|    UWORD8 *pu1_colz = ps_dec->pu1_col_zero_flag + ps_dec->i4_submb_ofst
 1179|  14.0M|                    + u4_sub_mb_num;
 1180|       |
 1181|  68.9M|    for(k = 0; k < u1_ht; k++)
  ------------------
  |  Branch (1181:16): [True: 54.9M, False: 14.0M]
  ------------------
 1182|  54.9M|    {
 1183|   271M|        for(m = 0; m < u1_wd; m++)
  ------------------
  |  Branch (1183:20): [True: 216M, False: 54.9M]
  ------------------
 1184|   216M|        {
 1185|   216M|            *(ps_mv_pred_dst + m) = *(ps_mv_pred_src);
 1186|   216M|            *(pu1_colz + m) = u1_colz;
 1187|       |
 1188|   216M|        }
 1189|  54.9M|        pu1_colz += SUB_BLK_WIDTH;
  ------------------
  |  |  560|  54.9M|#define SUB_BLK_WIDTH                 4
  ------------------
 1190|  54.9M|        ps_mv_pred_dst += SUB_BLK_WIDTH;
  ------------------
  |  |  560|  54.9M|#define SUB_BLK_WIDTH                 4
  ------------------
 1191|  54.9M|    }
 1192|  14.0M|}

ih264d_parse_bmb_non_direct_cavlc:
   79|  26.3k|{
   80|  26.3k|    dec_bit_stream_t * ps_bitstrm = ps_dec->ps_bitstrm;
   81|  26.3k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
   82|  26.3k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
   83|  26.3k|    UWORD8 * pu1_sub_mb_pred_modes = (UWORD8 *)(gau1_ih264d_submb_pred_modes) + 4;
   84|  26.3k|    const UWORD8 (*pu1_mb_pred_modes)[32] =
   85|  26.3k|                    (const UWORD8 (*)[32])gau1_ih264d_mb_pred_modes;
   86|  26.3k|    const UWORD8 * pu1_num_mb_part = (const UWORD8 *)gau1_ih264d_num_mb_part;
   87|  26.3k|    const UWORD8 * pu1_sub_mb_mc_mode = (const UWORD8 *)(gau1_ih264d_submb_mc_mode)
   88|  26.3k|                    + 4;
   89|       |
   90|  26.3k|    parse_pmbarams_t * ps_parse_mb_data = ps_dec->ps_parse_mb_data
   91|  26.3k|                    + u4_num_mbsNby2;
   92|  26.3k|    UWORD8 * pu1_col_info = ps_parse_mb_data->u1_col_info;
   93|  26.3k|    WORD8 (*pi1_ref_idx)[MAX_REFIDX_INFO_PER_MB] = ps_parse_mb_data->i1_ref_idx;
   94|  26.3k|    UWORD8 u1_mb_type = ps_cur_mb_info->u1_mb_type;
   95|  26.3k|    UWORD8 u1_mb_mc_mode, u1_num_mb_part, u1_sub_mb = !(u1_mb_type ^ B_8x8);
  ------------------
  |  |  480|  26.3k|#define B_8x8    22
  ------------------
   96|  26.3k|    UWORD32 u4_mb_mc_mode = 0, u4_mb_pred_mode = 0;
   97|  26.3k|    WORD32 ret;
   98|       |
   99|  26.3k|    if(u1_sub_mb)
  ------------------
  |  Branch (99:8): [True: 1.41k, False: 24.9k]
  ------------------
  100|  1.41k|    {
  101|  1.41k|        UWORD8 uc_i;
  102|  1.41k|        u1_mb_mc_mode = 0;
  103|  1.41k|        u1_num_mb_part = 4;
  104|       |        /* Reading the subMB type */
  105|  6.87k|        for(uc_i = 0; uc_i < 4; uc_i++)
  ------------------
  |  Branch (105:23): [True: 5.59k, False: 1.28k]
  ------------------
  106|  5.59k|        {
  107|       |
  108|  5.59k|            UWORD32 ui_sub_mb_mode;
  109|       |
  110|       |//Inlined ih264d_uev
  111|  5.59k|            UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
  112|  5.59k|            UWORD32 u4_word, u4_ldz;
  113|       |
  114|       |            /***************************************************************/
  115|       |            /* Find leading zeros in next 32 bits                          */
  116|       |            /***************************************************************/
  117|  5.59k|            NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  5.59k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  5.59k|{                                                                           \
  |  |  152|  5.59k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  5.59k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  5.59k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  5.59k|                                                                            \
  |  |  156|  5.59k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  5.59k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 5.27k, False: 317]
  |  |  ------------------
  |  |  158|  5.59k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  5.27k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  5.59k|}
  ------------------
  118|  5.59k|            u4_ldz = CLZ(u4_word);
  119|       |            /* Flush the ps_bitstrm */
  120|  5.59k|            u4_bitstream_offset += (u4_ldz + 1);
  121|       |            /* Read the suffix from the ps_bitstrm */
  122|  5.59k|            u4_word = 0;
  123|  5.59k|            if(u4_ldz)
  ------------------
  |  Branch (123:16): [True: 2.00k, False: 3.59k]
  ------------------
  124|  2.00k|                GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf,
  ------------------
  |  |  120|  2.00k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  2.00k|{                                                                           \
  |  |  122|  2.00k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  2.00k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  2.00k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  2.00k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  2.00k|                                                                            \
  |  |  127|  2.00k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 1.83k, False: 171]
  |  |  ------------------
  |  |  128|  2.00k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  1.83k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  2.00k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  2.00k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  2.00k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  2.00k|}                                                                           \
  ------------------
  125|  5.59k|                        u4_ldz);
  126|  5.59k|            *pu4_bitstrm_ofst = u4_bitstream_offset;
  127|  5.59k|            ui_sub_mb_mode = ((1 << u4_ldz) + u4_word - 1);
  128|       |//Inlined ih264d_uev
  129|       |
  130|  5.59k|            if(ui_sub_mb_mode > 12)
  ------------------
  |  Branch (130:16): [True: 133, False: 5.46k]
  ------------------
  131|    133|                return ERROR_SUB_MB_TYPE;
  132|  5.46k|            else
  133|  5.46k|            {
  134|  5.46k|                UWORD8 u1_subMbPredMode = pu1_sub_mb_pred_modes[ui_sub_mb_mode];
  135|  5.46k|                u4_mb_mc_mode = (u4_mb_mc_mode << 8)
  136|  5.46k|                                | pu1_sub_mb_mc_mode[ui_sub_mb_mode];
  137|  5.46k|                u4_mb_pred_mode = (u4_mb_pred_mode << 8) | u1_subMbPredMode;
  138|  5.46k|                pi1_ref_idx[0][uc_i] = ((u1_subMbPredMode & PRED_L0) - 1) >> 1;
  ------------------
  |  |  483|  5.46k|#define PRED_L0   1
  ------------------
  139|  5.46k|                pi1_ref_idx[1][uc_i] = ((u1_subMbPredMode & PRED_L1) - 1) >> 1;
  ------------------
  |  |  484|  5.46k|#define PRED_L1   2
  ------------------
  140|  5.46k|                COPYTHECONTEXT("sub_mb_type", u1_subMbPredMode);
  141|  5.46k|            }
  142|       |            /* Storing collocated Mb and SubMb mode information */
  143|  5.46k|            *pu1_col_info++ = ((PRED_8x8) << 6)
  ------------------
  |  |  453|  5.46k|#define PRED_8x8    3
  ------------------
  144|  5.46k|                            | ((pu1_sub_mb_mc_mode[ui_sub_mb_mode] << 4));
  145|  5.46k|            if(ui_sub_mb_mode != B_DIRECT_8x8)
  ------------------
  |  |  465|  5.46k|#define B_DIRECT_8x8    0
  ------------------
  |  Branch (145:16): [True: 1.87k, False: 3.59k]
  ------------------
  146|  1.87k|            {
  147|  1.87k|                if(ui_sub_mb_mode > B_BI_8x8)
  ------------------
  |  |  468|  1.87k|#define B_BI_8x8        3
  ------------------
  |  Branch (147:20): [True: 753, False: 1.11k]
  ------------------
  148|    753|                {
  149|    753|                    ps_dec->s_high_profile.u1_no_submb_part_size_lt8x8_flag = 0;
  150|    753|                }
  151|  1.87k|            }
  152|  3.59k|            else if(!ps_dec->s_high_profile.u1_direct_8x8_inference_flag)
  ------------------
  |  Branch (152:21): [True: 3.07k, False: 519]
  ------------------
  153|  3.07k|            {
  154|  3.07k|                ps_dec->s_high_profile.u1_no_submb_part_size_lt8x8_flag = 0;
  155|  3.07k|            }
  156|  5.46k|        }
  157|  1.41k|    }
  158|  24.9k|    else
  159|  24.9k|    {
  160|  24.9k|        UWORD8 u1_mb_pred_mode_idx = 5 + u1_mb_type;
  161|  24.9k|        UWORD8 u1_mb_pred_mode_part0 = pu1_mb_pred_modes[0][u1_mb_pred_mode_idx];
  162|  24.9k|        UWORD8 u1_mb_pred_mode_part1 = pu1_mb_pred_modes[1][u1_mb_pred_mode_idx];
  163|  24.9k|        u1_mb_mc_mode = ps_cur_mb_info->u1_mb_mc_mode;
  164|  24.9k|        u1_num_mb_part = pu1_num_mb_part[u1_mb_mc_mode];
  165|       |
  166|  24.9k|        pi1_ref_idx[0][0] = ((u1_mb_pred_mode_part0 & PRED_L0) - 1) >> 1;
  ------------------
  |  |  483|  24.9k|#define PRED_L0   1
  ------------------
  167|  24.9k|        pi1_ref_idx[1][0] = ((u1_mb_pred_mode_part0 & PRED_L1) - 1) >> 1;
  ------------------
  |  |  484|  24.9k|#define PRED_L1   2
  ------------------
  168|  24.9k|        pi1_ref_idx[0][1] = ((u1_mb_pred_mode_part1 & PRED_L0) - 1) >> 1;
  ------------------
  |  |  483|  24.9k|#define PRED_L0   1
  ------------------
  169|  24.9k|        pi1_ref_idx[1][1] = ((u1_mb_pred_mode_part1 & PRED_L1) - 1) >> 1;
  ------------------
  |  |  484|  24.9k|#define PRED_L1   2
  ------------------
  170|       |
  171|  24.9k|        u4_mb_pred_mode = (u1_mb_pred_mode_part0 << 8) | u1_mb_pred_mode_part1;
  172|  24.9k|        u4_mb_mc_mode = u1_mb_mc_mode | (u1_mb_mc_mode << 8);
  173|  24.9k|        u4_mb_mc_mode <<= 16;
  174|  24.9k|        u4_mb_pred_mode <<= 16;
  175|       |
  176|       |        /* Storing collocated Mb and SubMb mode information */
  177|  24.9k|        *pu1_col_info++ = (u1_mb_mc_mode << 6);
  178|  24.9k|        if(u1_mb_mc_mode)
  ------------------
  |  Branch (178:12): [True: 13.4k, False: 11.5k]
  ------------------
  179|  13.4k|            *pu1_col_info++ = (u1_mb_mc_mode << 6);
  180|  24.9k|    }
  181|       |
  182|  26.2k|    {
  183|  26.2k|        UWORD8 u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
  184|  26.2k|        UWORD8 uc_field = ps_cur_mb_info->u1_mb_field_decodingflag;
  185|  26.2k|        UWORD8 *pu1_num_ref_idx_lx_active =
  186|  26.2k|                        ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active;
  187|  26.2k|        const UWORD8 u1_mbaff_field = (u1_mbaff & uc_field);
  188|  26.2k|        UWORD8 u4_num_ref_idx_lx_active;
  189|       |
  190|  26.2k|        u4_num_ref_idx_lx_active = (pu1_num_ref_idx_lx_active[0]
  191|  26.2k|                        << u1_mbaff_field) - 1;
  192|       |
  193|  26.2k|        if(u4_num_ref_idx_lx_active)
  ------------------
  |  Branch (193:12): [True: 10.5k, False: 15.6k]
  ------------------
  194|  10.5k|        {
  195|  10.5k|            if(1 == u4_num_ref_idx_lx_active)
  ------------------
  |  Branch (195:16): [True: 2.16k, False: 8.40k]
  ------------------
  196|  2.16k|                ih264d_parse_bmb_ref_index_cavlc_range1(
  197|  2.16k|                                u1_num_mb_part, ps_bitstrm, pi1_ref_idx[0],
  198|  2.16k|                                u4_num_ref_idx_lx_active);
  199|  8.40k|            else
  200|  8.40k|            {
  201|  8.40k|                ret = ih264d_parse_bmb_ref_index_cavlc(u1_num_mb_part, ps_bitstrm,
  202|  8.40k|                                                 pi1_ref_idx[0],
  203|  8.40k|                                                 u4_num_ref_idx_lx_active);
  204|  8.40k|                if(ret != OK)
  ------------------
  |  |  114|  8.40k|#define OK        0
  ------------------
  |  Branch (204:20): [True: 338, False: 8.06k]
  ------------------
  205|    338|                    return ret;
  206|  8.40k|            }
  207|  10.5k|        }
  208|       |
  209|  25.8k|        u4_num_ref_idx_lx_active = (pu1_num_ref_idx_lx_active[1]
  210|  25.8k|                        << u1_mbaff_field) - 1;
  211|       |
  212|  25.8k|        if(u4_num_ref_idx_lx_active)
  ------------------
  |  Branch (212:12): [True: 13.5k, False: 12.3k]
  ------------------
  213|  13.5k|        {
  214|  13.5k|            if(1 == u4_num_ref_idx_lx_active)
  ------------------
  |  Branch (214:16): [True: 8.86k, False: 4.64k]
  ------------------
  215|  8.86k|                ih264d_parse_bmb_ref_index_cavlc_range1(
  216|  8.86k|                                u1_num_mb_part, ps_bitstrm, pi1_ref_idx[1],
  217|  8.86k|                                u4_num_ref_idx_lx_active);
  218|  4.64k|            else
  219|  4.64k|            {
  220|  4.64k|                ret = ih264d_parse_bmb_ref_index_cavlc(u1_num_mb_part, ps_bitstrm,
  221|  4.64k|                                                 pi1_ref_idx[1],
  222|  4.64k|                                                 u4_num_ref_idx_lx_active);
  223|  4.64k|                if(ret != OK)
  ------------------
  |  |  114|  4.64k|#define OK        0
  ------------------
  |  Branch (223:20): [True: 156, False: 4.48k]
  ------------------
  224|    156|                    return ret;
  225|  4.64k|            }
  226|  13.5k|        }
  227|  25.8k|    }
  228|       |
  229|       |    /* Read MotionVectors */
  230|  25.7k|    {
  231|  25.7k|        const UWORD8 * pu1_top_left_sub_mb_indx;
  232|       |
  233|  25.7k|        const UWORD8 * pu1_sub_mb_indx_mod =
  234|  25.7k|                        (const UWORD8 *)(gau1_ih264d_submb_indx_mod)
  235|  25.7k|                                        + (u1_sub_mb * 6);
  236|  25.7k|        const UWORD8 * pu1_sub_mb_partw = (const UWORD8 *)gau1_ih264d_submb_partw;
  237|  25.7k|        const UWORD8 * pu1_sub_mb_parth = (const UWORD8 *)gau1_ih264d_submb_parth;
  238|  25.7k|        const UWORD8 * pu1_num_sub_mb_part =
  239|  25.7k|                        (const UWORD8 *)gau1_ih264d_num_submb_part;
  240|  25.7k|        const UWORD8 * pu1_mb_partw = (const UWORD8 *)gau1_ih264d_mb_partw;
  241|  25.7k|        const UWORD8 * pu1_mb_parth = (const UWORD8 *)gau1_ih264d_mb_parth;
  242|  25.7k|        UWORD8 u1_p_idx = 0, u1_num_submb_part, uc_lx;
  243|  25.7k|        parse_part_params_t * ps_part;
  244|  25.7k|        mv_pred_t *ps_mv_start = ps_dec->ps_mv_cur + (u4_mb_num << 4);
  245|  25.7k|        UWORD8 u1_mb_part_wd, u1_mb_part_ht;
  246|       |
  247|       |        /* Initialisations */
  248|  25.7k|        ps_part = ps_dec->ps_part;
  249|       |        /* Default Initialization for Non subMb Case Mode */
  250|  25.7k|        u1_mb_part_wd = pu1_mb_partw[u1_mb_mc_mode];
  251|  25.7k|        u1_mb_part_ht = pu1_mb_parth[u1_mb_mc_mode];
  252|  25.7k|        u1_num_submb_part = 1;
  253|       |
  254|       |        /* Decoding the MV for the subMB */
  255|  77.1k|        for(uc_lx = 0; uc_lx < 2; uc_lx++)
  ------------------
  |  Branch (255:24): [True: 51.4k, False: 25.7k]
  ------------------
  256|  51.4k|        {
  257|  51.4k|            UWORD8 u1_sub_mb_num = 0, u1_pred_mode, uc_i;
  258|  51.4k|            UWORD32 u4_mb_mc_mode_tmp = u4_mb_mc_mode;
  259|  51.4k|            UWORD32 u4_mb_pred_mode_tmp = u4_mb_pred_mode;
  260|  51.4k|            UWORD16 u2_sub_mb_num = 0x028A; // for sub mb case
  261|  51.4k|            UWORD8 u1_b2 = uc_lx << 1;
  262|  51.4k|            u1_pred_mode = (uc_lx) ? PRED_L1 : PRED_L0;
  ------------------
  |  |  484|  25.7k|#define PRED_L1   2
  ------------------
                          u1_pred_mode = (uc_lx) ? PRED_L1 : PRED_L0;
  ------------------
  |  |  483|  77.1k|#define PRED_L0   1
  ------------------
  |  Branch (262:28): [True: 25.7k, False: 25.7k]
  ------------------
  263|  51.4k|            pu1_top_left_sub_mb_indx = pu1_sub_mb_indx_mod + (u1_mb_mc_mode << 1);
  264|       |
  265|   136k|            for(uc_i = 0; uc_i < u1_num_mb_part; uc_i++)
  ------------------
  |  Branch (265:27): [True: 85.3k, False: 51.4k]
  ------------------
  266|  85.3k|            {
  267|  85.3k|                UWORD8 u1_mb_mc_mode, uc_j;
  268|  85.3k|                UWORD8 i1_pred = u4_mb_pred_mode_tmp >> 24;
  269|  85.3k|                u1_mb_mc_mode = u4_mb_mc_mode_tmp >> 24;
  270|  85.3k|                u4_mb_pred_mode_tmp <<= 8;
  271|  85.3k|                u4_mb_mc_mode_tmp <<= 8;
  272|       |                /* subMb prediction mode */
  273|  85.3k|                if(u1_sub_mb)
  ------------------
  |  Branch (273:20): [True: 10.2k, False: 75.0k]
  ------------------
  274|  10.2k|                {
  275|       |
  276|  10.2k|                    u1_mb_part_wd = pu1_sub_mb_partw[u1_mb_mc_mode];
  277|  10.2k|                    u1_mb_part_ht = pu1_sub_mb_parth[u1_mb_mc_mode];
  278|  10.2k|                    u1_sub_mb_num = u2_sub_mb_num >> 12;
  279|  10.2k|                    u1_num_submb_part = pu1_num_sub_mb_part[u1_mb_mc_mode];
  280|  10.2k|                    pu1_top_left_sub_mb_indx = pu1_sub_mb_indx_mod
  281|  10.2k|                                    + (u1_mb_mc_mode << 1);
  282|  10.2k|                    u2_sub_mb_num <<= 4;
  283|  10.2k|                }
  284|   172k|                for(uc_j = 0; uc_j < u1_num_submb_part;
  ------------------
  |  Branch (284:31): [True: 87.0k, False: 85.3k]
  ------------------
  285|  87.0k|                                uc_j++, pu1_top_left_sub_mb_indx++)
  286|  87.0k|                {
  287|  87.0k|                    mv_pred_t * ps_mv;
  288|  87.0k|                    u1_sub_mb_num = u1_sub_mb_num + *pu1_top_left_sub_mb_indx;
  289|  87.0k|                    ps_mv = ps_mv_start + u1_sub_mb_num;
  290|       |
  291|       |                    /* Storing Info for partitions, writing only once */
  292|  87.0k|                    if(uc_lx)
  ------------------
  |  Branch (292:24): [True: 43.5k, False: 43.5k]
  ------------------
  293|  43.5k|                    {
  294|  43.5k|                        ps_part->u1_is_direct = (!i1_pred);
  295|  43.5k|                        ps_part->u1_pred_mode = i1_pred;
  296|  43.5k|                        ps_part->u1_sub_mb_num = u1_sub_mb_num;
  297|  43.5k|                        ps_part->u1_partheight = u1_mb_part_ht;
  298|  43.5k|                        ps_part->u1_partwidth = u1_mb_part_wd;
  299|       |                        /* Increment partition Index */
  300|  43.5k|                        u1_p_idx++;
  301|  43.5k|                        ps_part++;
  302|  43.5k|                    }
  303|       |
  304|  87.0k|                    if(i1_pred & u1_pred_mode)
  ------------------
  |  Branch (304:24): [True: 42.1k, False: 44.9k]
  ------------------
  305|  42.1k|                    {
  306|  42.1k|                        WORD16 i2_mvx, i2_mvy;
  307|       |
  308|       |//inlining ih264d_sev
  309|  42.1k|                        {
  310|  42.1k|                            UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
  311|  42.1k|                            UWORD32 u4_word, u4_ldz, u4_abs_val;
  312|       |
  313|       |                            /***************************************************************/
  314|       |                            /* Find leading zeros in next 32 bits                          */
  315|       |                            /***************************************************************/
  316|  42.1k|                            NEXTBITS_32(u4_word, u4_bitstream_offset,
  ------------------
  |  |  150|  42.1k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  42.1k|{                                                                           \
  |  |  152|  42.1k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  42.1k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  42.1k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  42.1k|                                                                            \
  |  |  156|  42.1k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  42.1k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 40.4k, False: 1.69k]
  |  |  ------------------
  |  |  158|  42.1k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  40.4k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  42.1k|}
  ------------------
  317|  42.1k|                                        pu4_bitstrm_buf);
  318|  42.1k|                            u4_ldz = CLZ(u4_word);
  319|       |
  320|       |                            /* Flush the ps_bitstrm */
  321|  42.1k|                            u4_bitstream_offset += (u4_ldz + 1);
  322|       |
  323|       |                            /* Read the suffix from the ps_bitstrm */
  324|  42.1k|                            u4_word = 0;
  325|  42.1k|                            if(u4_ldz)
  ------------------
  |  Branch (325:32): [True: 15.9k, False: 26.2k]
  ------------------
  326|  15.9k|                                GETBITS(u4_word, u4_bitstream_offset,
  ------------------
  |  |  120|  15.9k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  15.9k|{                                                                           \
  |  |  122|  15.9k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  15.9k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  15.9k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  15.9k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  15.9k|                                                                            \
  |  |  127|  15.9k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 14.9k, False: 1.01k]
  |  |  ------------------
  |  |  128|  15.9k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  14.9k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  15.9k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  15.9k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  15.9k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  15.9k|}                                                                           \
  ------------------
  327|  42.1k|                                        pu4_bitstrm_buf, u4_ldz);
  328|       |
  329|  42.1k|                            *pu4_bitstrm_ofst = u4_bitstream_offset;
  330|  42.1k|                            u4_abs_val = ((1 << u4_ldz) + u4_word) >> 1;
  331|       |
  332|  42.1k|                            if(u4_word & 0x1)
  ------------------
  |  Branch (332:32): [True: 9.12k, False: 33.0k]
  ------------------
  333|  9.12k|                                i2_mvx = (-(WORD32)u4_abs_val);
  334|  33.0k|                            else
  335|  33.0k|                                i2_mvx = (u4_abs_val);
  336|  42.1k|                        }
  337|       |//inlinined ih264d_sev
  338|       |
  339|       |//inlining ih264d_sev
  340|  42.1k|                        {
  341|  42.1k|                            UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
  342|  42.1k|                            UWORD32 u4_word, u4_ldz, u4_abs_val;
  343|       |
  344|       |                            /***************************************************************/
  345|       |                            /* Find leading zeros in next 32 bits                          */
  346|       |                            /***************************************************************/
  347|  42.1k|                            NEXTBITS_32(u4_word, u4_bitstream_offset,
  ------------------
  |  |  150|  42.1k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  42.1k|{                                                                           \
  |  |  152|  42.1k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  42.1k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  42.1k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  42.1k|                                                                            \
  |  |  156|  42.1k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  42.1k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 40.5k, False: 1.63k]
  |  |  ------------------
  |  |  158|  42.1k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  40.5k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  42.1k|}
  ------------------
  348|  42.1k|                                        pu4_bitstrm_buf);
  349|  42.1k|                            u4_ldz = CLZ(u4_word);
  350|       |
  351|       |                            /* Flush the ps_bitstrm */
  352|  42.1k|                            u4_bitstream_offset += (u4_ldz + 1);
  353|       |
  354|       |                            /* Read the suffix from the ps_bitstrm */
  355|  42.1k|                            u4_word = 0;
  356|  42.1k|                            if(u4_ldz)
  ------------------
  |  Branch (356:32): [True: 21.1k, False: 21.0k]
  ------------------
  357|  21.1k|                                GETBITS(u4_word, u4_bitstream_offset,
  ------------------
  |  |  120|  21.1k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  21.1k|{                                                                           \
  |  |  122|  21.1k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  21.1k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  21.1k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  21.1k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  21.1k|                                                                            \
  |  |  127|  21.1k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 20.4k, False: 635]
  |  |  ------------------
  |  |  128|  21.1k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  20.4k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  21.1k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  21.1k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  21.1k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  21.1k|}                                                                           \
  ------------------
  358|  42.1k|                                        pu4_bitstrm_buf, u4_ldz);
  359|       |
  360|  42.1k|                            *pu4_bitstrm_ofst = u4_bitstream_offset;
  361|  42.1k|                            u4_abs_val = ((1 << u4_ldz) + u4_word) >> 1;
  362|       |
  363|  42.1k|                            if(u4_word & 0x1)
  ------------------
  |  Branch (363:32): [True: 9.62k, False: 32.5k]
  ------------------
  364|  9.62k|                                i2_mvy = (-(WORD32)u4_abs_val);
  365|  32.5k|                            else
  366|  32.5k|                                i2_mvy = (u4_abs_val);
  367|  42.1k|                        }
  368|       |//inlinined ih264d_sev
  369|       |
  370|       |                        /* Storing Mv residuals */
  371|  42.1k|                        ps_mv->i2_mv[u1_b2] = i2_mvx;
  372|  42.1k|                        ps_mv->i2_mv[u1_b2 + 1] = i2_mvy;
  373|  42.1k|                    }
  374|  87.0k|                }
  375|  85.3k|            }
  376|  51.4k|        }
  377|       |        /* write back to the scratch partition info */
  378|  25.7k|        ps_dec->ps_part = ps_part;
  379|  25.7k|        ps_parse_mb_data->u1_num_part = u1_sub_mb ? u1_p_idx : u1_num_mb_part;
  ------------------
  |  Branch (379:41): [True: 1.28k, False: 24.4k]
  ------------------
  380|       |
  381|  25.7k|    }
  382|  25.7k|    return OK;
  ------------------
  |  |  114|  25.7k|#define OK        0
  ------------------
  383|  25.8k|}
ih264d_parse_bmb_non_direct_cabac:
  402|  88.5k|{
  403|       |    /* Loads from ps_dec */
  404|  88.5k|    decoding_envirnoment_t * ps_cab_env = &ps_dec->s_cab_dec_env;
  405|  88.5k|    dec_bit_stream_t * ps_bitstrm = ps_dec->ps_bitstrm;
  406|  88.5k|    ctxt_inc_mb_info_t *p_curr_ctxt = ps_dec->ps_curr_ctxt_mb_info;
  407|  88.5k|    parse_pmbarams_t * ps_parse_mb_data = ps_dec->ps_parse_mb_data
  408|  88.5k|                    + u4_num_mbsNby2;
  409|       |
  410|       |    /* table pointer loads */
  411|  88.5k|    const UWORD8 * pu1_sub_mb_pred_modes = (UWORD8 *)(gau1_ih264d_submb_pred_modes)
  412|  88.5k|                    + 4;
  413|  88.5k|    const UWORD8 (*pu1_mb_pred_modes)[32] =
  414|  88.5k|                    (const UWORD8 (*)[32])gau1_ih264d_mb_pred_modes;
  415|  88.5k|    const UWORD8 *pu1_num_mb_part = (const UWORD8 *)gau1_ih264d_num_mb_part;
  416|  88.5k|    const UWORD8 *pu1_sub_mb_mc_mode = (UWORD8 *)(gau1_ih264d_submb_mc_mode) + 4;
  417|       |
  418|  88.5k|    const UWORD8 u1_mb_type = ps_cur_mb_info->u1_mb_type;
  419|  88.5k|    UWORD8 * pu1_col_info = ps_parse_mb_data->u1_col_info;
  420|  88.5k|    WORD8 *pi1_ref_idx_l0 = &ps_parse_mb_data->i1_ref_idx[0][0];
  421|  88.5k|    WORD8 *pi1_ref_idx_l1 = &ps_parse_mb_data->i1_ref_idx[1][0];
  422|  88.5k|    UWORD8 u1_dec_ref_l0, u1_dec_ref_l1;
  423|       |
  424|  88.5k|    UWORD8 u1_num_mb_part, u1_mb_mc_mode, u1_sub_mb, u1_mbpred_mode = 5
  425|  88.5k|                    + u1_mb_type;
  426|  88.5k|    UWORD32 u4_mb_mc_mode = 0, u4_mb_pred_mode = 0;
  427|  88.5k|    WORD32 ret;
  428|       |
  429|  88.5k|    p_curr_ctxt->u1_mb_type = CAB_NON_BD16x16;
  ------------------
  |  |  397|  88.5k|#define CAB_NON_BD16x16   0x05 /* 0000 0101 */
  ------------------
  430|  88.5k|    u1_sub_mb = !(u1_mb_type ^ B_8x8);
  ------------------
  |  |  480|  88.5k|#define B_8x8    22
  ------------------
  431|       |
  432|  88.5k|    {
  433|  88.5k|        UWORD8 u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
  434|  88.5k|        UWORD8 *pu1_num_ref_idx_lx_active =
  435|  88.5k|                        ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active;
  436|  88.5k|        UWORD8 uc_field = ps_cur_mb_info->u1_mb_field_decodingflag;
  437|  88.5k|        UWORD8 u1_mbaff_field = (u1_mbaff & uc_field);
  438|  88.5k|        u1_dec_ref_l0 = (pu1_num_ref_idx_lx_active[0] << u1_mbaff_field) - 1;
  439|  88.5k|        u1_dec_ref_l1 = (pu1_num_ref_idx_lx_active[1] << u1_mbaff_field) - 1;
  440|  88.5k|    }
  441|       |
  442|  88.5k|    if(u1_sub_mb)
  ------------------
  |  Branch (442:8): [True: 23.5k, False: 64.9k]
  ------------------
  443|  23.5k|    {
  444|  23.5k|        const UWORD8 u1_colz = ((PRED_8x8) << 6);
  ------------------
  |  |  453|  23.5k|#define PRED_8x8    3
  ------------------
  445|  23.5k|        UWORD8 uc_i;
  446|  23.5k|        u1_mb_mc_mode = 0;
  447|  23.5k|        u1_num_mb_part = 4;
  448|       |        /* Reading the subMB type */
  449|   117k|        for(uc_i = 0; uc_i < 4; uc_i++)
  ------------------
  |  Branch (449:23): [True: 94.0k, False: 23.5k]
  ------------------
  450|  94.0k|        {
  451|  94.0k|            UWORD8 u1_sub_mb_mode, u1_subMbPredModes;
  452|  94.0k|            u1_sub_mb_mode = ih264d_parse_submb_type_cabac(
  453|  94.0k|                            1, ps_cab_env, ps_bitstrm,
  454|  94.0k|                            ps_dec->p_sub_mb_type_t);
  455|       |
  456|  94.0k|            if(u1_sub_mb_mode > 12)
  ------------------
  |  Branch (456:16): [True: 0, False: 94.0k]
  ------------------
  457|      0|                return ERROR_SUB_MB_TYPE;
  458|       |
  459|  94.0k|            u1_subMbPredModes = pu1_sub_mb_pred_modes[u1_sub_mb_mode];
  460|  94.0k|            u4_mb_mc_mode = (u4_mb_mc_mode << 8) | pu1_sub_mb_mc_mode[u1_sub_mb_mode];
  461|  94.0k|            u4_mb_pred_mode = (u4_mb_pred_mode << 8) | u1_subMbPredModes;
  462|  94.0k|            *pi1_ref_idx_l0++ =
  463|  94.0k|                            (u1_subMbPredModes & PRED_L0) ? u1_dec_ref_l0 : -1;
  ------------------
  |  |  483|  94.0k|#define PRED_L0   1
  ------------------
  |  Branch (463:29): [True: 73.7k, False: 20.2k]
  ------------------
  464|  94.0k|            *pi1_ref_idx_l1++ =
  465|  94.0k|                            (u1_subMbPredModes & PRED_L1) ? u1_dec_ref_l1 : -1;
  ------------------
  |  |  484|  94.0k|#define PRED_L1   2
  ------------------
  |  Branch (465:29): [True: 35.4k, False: 58.5k]
  ------------------
  466|  94.0k|            COPYTHECONTEXT("sub_mb_type", u1_sub_mb_mode);
  467|       |            /* Storing collocated Mb and SubMb mode information */
  468|  94.0k|            *pu1_col_info++ =
  469|  94.0k|                            (u1_colz | (pu1_sub_mb_mc_mode[u1_sub_mb_mode] << 4));
  470|  94.0k|            if(u1_sub_mb_mode != B_DIRECT_8x8)
  ------------------
  |  |  465|  94.0k|#define B_DIRECT_8x8    0
  ------------------
  |  Branch (470:16): [True: 83.6k, False: 10.3k]
  ------------------
  471|  83.6k|            {
  472|  83.6k|                if(u1_sub_mb_mode > B_BI_8x8)
  ------------------
  |  |  468|  83.6k|#define B_BI_8x8        3
  ------------------
  |  Branch (472:20): [True: 9.48k, False: 74.1k]
  ------------------
  473|  9.48k|                {
  474|  9.48k|                    ps_dec->s_high_profile.u1_no_submb_part_size_lt8x8_flag = 0;
  475|  9.48k|                }
  476|  83.6k|            }
  477|  10.3k|            else if(!ps_dec->s_high_profile.u1_direct_8x8_inference_flag)
  ------------------
  |  Branch (477:21): [True: 9.57k, False: 814]
  ------------------
  478|  9.57k|            {
  479|  9.57k|                ps_dec->s_high_profile.u1_no_submb_part_size_lt8x8_flag = 0;
  480|  9.57k|            }
  481|  94.0k|        }
  482|  23.5k|        pi1_ref_idx_l0 -= 4;
  483|  23.5k|        pi1_ref_idx_l1 -= 4;
  484|  23.5k|    }
  485|  64.9k|    else
  486|  64.9k|    {
  487|  64.9k|        UWORD8 u1_mb_pred_mode_part0 = pu1_mb_pred_modes[0][u1_mbpred_mode];
  488|  64.9k|        UWORD8 u1_mb_pred_mode_part1 = pu1_mb_pred_modes[1][u1_mbpred_mode];
  489|  64.9k|        u1_mb_mc_mode = ps_cur_mb_info->u1_mb_mc_mode;
  490|  64.9k|        u1_num_mb_part = pu1_num_mb_part[u1_mb_mc_mode];
  491|       |        /* Storing collocated Mb and SubMb mode information */
  492|  64.9k|        *pu1_col_info++ = (u1_mb_mc_mode << 6);
  493|  64.9k|        if(u1_mb_mc_mode)
  ------------------
  |  Branch (493:12): [True: 42.2k, False: 22.7k]
  ------------------
  494|  42.2k|            *pu1_col_info++ = (u1_mb_mc_mode << 6);
  495|  64.9k|        u4_mb_mc_mode = u1_mb_mc_mode | (u1_mb_mc_mode << 8);
  496|  64.9k|        u4_mb_mc_mode <<= 16;
  497|  64.9k|        u4_mb_pred_mode = ((u1_mb_pred_mode_part0 << 8) | u1_mb_pred_mode_part1) << 16;
  498|       |
  499|  64.9k|        *pi1_ref_idx_l0++ = (u1_mb_pred_mode_part0 & PRED_L0) ? u1_dec_ref_l0 : -1;
  ------------------
  |  |  483|  64.9k|#define PRED_L0   1
  ------------------
  |  Branch (499:29): [True: 39.9k, False: 25.0k]
  ------------------
  500|  64.9k|        *pi1_ref_idx_l0-- = (u1_mb_pred_mode_part1 & PRED_L0) ? u1_dec_ref_l0 : -1;
  ------------------
  |  |  483|  64.9k|#define PRED_L0   1
  ------------------
  |  Branch (500:29): [True: 56.8k, False: 8.16k]
  ------------------
  501|  64.9k|        *pi1_ref_idx_l1++ = (u1_mb_pred_mode_part0 & PRED_L1) ? u1_dec_ref_l1 : -1;
  ------------------
  |  |  484|  64.9k|#define PRED_L1   2
  ------------------
  |  Branch (501:29): [True: 34.9k, False: 30.0k]
  ------------------
  502|  64.9k|        *pi1_ref_idx_l1-- = (u1_mb_pred_mode_part1 & PRED_L1) ? u1_dec_ref_l1 : -1;
  ------------------
  |  |  484|  64.9k|#define PRED_L1   2
  ------------------
  |  Branch (502:29): [True: 57.0k, False: 7.94k]
  ------------------
  503|  64.9k|    }
  504|  88.5k|    {
  505|  88.5k|        WORD8 *pi1_lft_cxt = ps_dec->pi1_left_ref_idx_ctxt_inc;
  506|  88.5k|        WORD8 *pi1_top_cxt = p_curr_ctxt->i1_ref_idx;
  507|       |
  508|  88.5k|        ret = ih264d_parse_ref_idx_cabac(u1_num_mb_part, 0, u1_dec_ref_l0,
  509|  88.5k|                                   u1_mb_mc_mode, pi1_ref_idx_l0, pi1_lft_cxt,
  510|  88.5k|                                   pi1_top_cxt, ps_cab_env, ps_bitstrm,
  511|  88.5k|                                   ps_dec->p_ref_idx_t);
  512|  88.5k|        if(ret != OK)
  ------------------
  |  |  114|  88.5k|#define OK        0
  ------------------
  |  Branch (512:12): [True: 160, False: 88.3k]
  ------------------
  513|    160|            return ret;
  514|       |
  515|  88.3k|        ret = ih264d_parse_ref_idx_cabac(u1_num_mb_part, 2, u1_dec_ref_l1,
  516|  88.3k|                                   u1_mb_mc_mode, pi1_ref_idx_l1, pi1_lft_cxt,
  517|  88.3k|                                   pi1_top_cxt, ps_cab_env, ps_bitstrm,
  518|  88.3k|                                   ps_dec->p_ref_idx_t);
  519|  88.3k|        if(ret != OK)
  ------------------
  |  |  114|  88.3k|#define OK        0
  ------------------
  |  Branch (519:12): [True: 230, False: 88.1k]
  ------------------
  520|    230|            return ret;
  521|  88.3k|    }
  522|       |    /* Read MotionVectors */
  523|  88.1k|    {
  524|  88.1k|        const UWORD8 *pu1_top_left_sub_mb_indx;
  525|  88.1k|        UWORD8 uc_j, uc_lx;
  526|  88.1k|        UWORD8 u1_mb_part_wd, u1_mb_part_ht;
  527|       |
  528|  88.1k|        const UWORD8 *pu1_sub_mb_indx_mod =
  529|  88.1k|                        (const UWORD8 *)gau1_ih264d_submb_indx_mod
  530|  88.1k|                                        + (u1_sub_mb * 6);
  531|  88.1k|        const UWORD8 *pu1_sub_mb_partw = (const UWORD8 *)gau1_ih264d_submb_partw;
  532|  88.1k|        const UWORD8 *pu1_sub_mb_parth = (const UWORD8 *)gau1_ih264d_submb_parth;
  533|  88.1k|        const UWORD8 *pu1_num_sub_mb_part =
  534|  88.1k|                        (const UWORD8 *)gau1_ih264d_num_submb_part;
  535|  88.1k|        const UWORD8 *pu1_mb_partw = (const UWORD8 *)gau1_ih264d_mb_partw;
  536|  88.1k|        const UWORD8 *pu1_mb_parth = (const UWORD8 *)gau1_ih264d_mb_parth;
  537|       |
  538|  88.1k|        UWORD8 u1_p_idx = 0;
  539|  88.1k|        UWORD8 u1_num_submb_part;
  540|  88.1k|        parse_part_params_t *ps_part;
  541|       |        /* Initialisations */
  542|  88.1k|        mv_pred_t *ps_mv_start = ps_dec->ps_mv_cur + (u4_mb_num << 4);
  543|  88.1k|        ps_part = ps_dec->ps_part;
  544|       |
  545|       |        /* Default initialization for non subMb case */
  546|  88.1k|        u1_mb_part_wd = pu1_mb_partw[u1_mb_mc_mode];
  547|  88.1k|        u1_mb_part_ht = pu1_mb_parth[u1_mb_mc_mode];
  548|  88.1k|        u1_num_submb_part = 1;
  549|       |
  550|       |        /* Decoding the MV for the subMB */
  551|   264k|        for(uc_lx = 0; uc_lx < 2; uc_lx++)
  ------------------
  |  Branch (551:24): [True: 176k, False: 88.1k]
  ------------------
  552|   176k|        {
  553|   176k|            UWORD32 u4_sub_mb_num = 0;
  554|   176k|            UWORD32 u4_mb_pred_mode_tmp = u4_mb_pred_mode;
  555|   176k|            UWORD32 u4_mb_mc_mode_tmp = u4_mb_mc_mode;
  556|   176k|            UWORD8 u1_mb_mc_mode_1, u1_pred_mode, uc_i;
  557|   176k|            UWORD16 u2_sub_mb_num = 0x028A;
  558|   176k|            UWORD8 u1_b2 = uc_lx << 1;
  559|   176k|            u1_pred_mode = (uc_lx) ? PRED_L1 : PRED_L0;
  ------------------
  |  |  484|  88.1k|#define PRED_L1   2
  ------------------
                          u1_pred_mode = (uc_lx) ? PRED_L1 : PRED_L0;
  ------------------
  |  |  483|   264k|#define PRED_L0   1
  ------------------
  |  Branch (559:28): [True: 88.1k, False: 88.1k]
  ------------------
  560|       |            /* Default for Cabac */
  561|   176k|            pu1_top_left_sub_mb_indx = pu1_sub_mb_indx_mod + (u1_mb_mc_mode << 1);
  562|   577k|            for(uc_i = 0; uc_i < u1_num_mb_part; uc_i++)
  ------------------
  |  Branch (562:27): [True: 401k, False: 176k]
  ------------------
  563|   401k|            {
  564|       |
  565|   401k|                WORD8 i1_pred = (UWORD8)(u4_mb_pred_mode_tmp >> 24);
  566|   401k|                u1_mb_mc_mode_1 = (UWORD8)(u4_mb_mc_mode_tmp >> 24);
  567|   401k|                u4_mb_pred_mode_tmp <<= 8;
  568|   401k|                u4_mb_mc_mode_tmp <<= 8;
  569|       |
  570|       |                /* subMb prediction mode */
  571|   401k|                if(u1_sub_mb)
  ------------------
  |  Branch (571:20): [True: 188k, False: 213k]
  ------------------
  572|   188k|                {
  573|   188k|                    u1_mb_part_wd = pu1_sub_mb_partw[u1_mb_mc_mode_1];
  574|   188k|                    u1_mb_part_ht = pu1_sub_mb_parth[u1_mb_mc_mode_1];
  575|   188k|                    u4_sub_mb_num = u2_sub_mb_num >> 12;
  576|   188k|                    pu1_top_left_sub_mb_indx = pu1_sub_mb_indx_mod + (u1_mb_mc_mode_1 << 1);
  577|   188k|                    u1_num_submb_part = pu1_num_sub_mb_part[u1_mb_mc_mode_1];
  578|   188k|                    u2_sub_mb_num = u2_sub_mb_num << 4;
  579|   188k|                }
  580|       |
  581|   827k|                for(uc_j = 0; uc_j < u1_num_submb_part;
  ------------------
  |  Branch (581:31): [True: 426k, False: 401k]
  ------------------
  582|   426k|                                uc_j++, pu1_top_left_sub_mb_indx++)
  583|   426k|                {
  584|   426k|                    mv_pred_t *ps_mv;
  585|   426k|                    u4_sub_mb_num = u4_sub_mb_num + *pu1_top_left_sub_mb_indx;
  586|   426k|                    ps_mv = ps_mv_start + u4_sub_mb_num;
  587|       |
  588|       |                    /* Storing Info for partitions, writing only once */
  589|   426k|                    if(uc_lx)
  ------------------
  |  Branch (589:24): [True: 213k, False: 213k]
  ------------------
  590|   213k|                    {
  591|   213k|                        ps_part->u1_is_direct = (!i1_pred);
  592|   213k|                        ps_part->u1_pred_mode = i1_pred;
  593|   213k|                        ps_part->u1_sub_mb_num = u4_sub_mb_num;
  594|   213k|                        ps_part->u1_partheight = u1_mb_part_ht;
  595|   213k|                        ps_part->u1_partwidth = u1_mb_part_wd;
  596|       |
  597|       |                        /* Increment partition Index */
  598|   213k|                        u1_p_idx++;
  599|   213k|                        ps_part++;
  600|   213k|                    }
  601|       |
  602|   426k|                    ih264d_get_mvd_cabac(u4_sub_mb_num, u1_b2, u1_mb_part_wd,
  603|   426k|                                         u1_mb_part_ht,
  604|   426k|                                         (UWORD8)(i1_pred & u1_pred_mode), ps_dec,
  605|   426k|                                         ps_mv);
  606|   426k|                }
  607|   401k|            }
  608|   176k|        }
  609|       |        /* write back to the scratch partition info */
  610|       |
  611|  88.1k|        ps_dec->ps_part = ps_part;
  612|  88.1k|        ps_parse_mb_data->u1_num_part = u1_sub_mb ? u1_p_idx : u1_num_mb_part;
  ------------------
  |  Branch (612:41): [True: 23.5k, False: 64.6k]
  ------------------
  613|       |
  614|  88.1k|    }
  615|       |
  616|  88.1k|    return OK;
  ------------------
  |  |  114|  88.1k|#define OK        0
  ------------------
  617|  88.3k|}
ih264d_parse_bmb_cabac:
  634|  92.3k|{
  635|  92.3k|    UWORD8 u1_cbp;
  636|  92.3k|    deblk_mb_t * ps_cur_deblk_mb = ps_dec->ps_deblk_mbn + u4_mb_num;
  637|  92.3k|    const UWORD8 *puc_mb_mc_mode = (const UWORD8 *)gau1_ih264d_mb_mc_mode;
  638|  92.3k|    UWORD8 u1_mb_type = ps_cur_mb_info->u1_mb_type;
  639|  92.3k|    ctxt_inc_mb_info_t *p_curr_ctxt = ps_dec->ps_curr_ctxt_mb_info;
  640|       |
  641|  92.3k|    WORD32 ret;
  642|  92.3k|    UWORD8 u1_Bdirect_tranform_read = 1;
  643|  92.3k|    ps_dec->s_high_profile.u1_no_submb_part_size_lt8x8_flag = 1;
  644|       |
  645|  92.3k|    ps_cur_mb_info->u1_mb_mc_mode = puc_mb_mc_mode[5 + u1_mb_type];
  646|       |
  647|  92.3k|    ps_cur_mb_info->u1_yuv_dc_block_flag = 0;
  648|       |
  649|  92.3k|    ps_cur_deblk_mb->u1_mb_type |= D_B_SLICE;
  ------------------
  |  |  384|  92.3k|#define D_B_SLICE         4
  ------------------
  650|  92.3k|    if(u1_mb_type != B_DIRECT)
  ------------------
  |  |  482|  92.3k|#define B_DIRECT  0
  ------------------
  |  Branch (650:8): [True: 88.5k, False: 3.88k]
  ------------------
  651|  88.5k|    {
  652|  88.5k|        ret = ih264d_parse_bmb_non_direct_cabac(ps_dec, ps_cur_mb_info, u4_mb_num,
  653|  88.5k|                                          u4_num_mbsNby2);
  654|  88.5k|        if(ret != OK)
  ------------------
  |  |  114|  88.5k|#define OK        0
  ------------------
  |  Branch (654:12): [True: 390, False: 88.1k]
  ------------------
  655|    390|            return ret;
  656|  88.5k|    }
  657|  3.88k|    else
  658|  3.88k|    {
  659|       |
  660|       |        /************ STORING PARTITION INFO ***********/
  661|  3.88k|        parse_part_params_t * ps_part_info;
  662|  3.88k|        ps_part_info = ps_dec->ps_part;
  663|  3.88k|        ps_part_info->u1_is_direct = PART_DIRECT_16x16;
  ------------------
  |  |  571|  3.88k|#define PART_DIRECT_16x16              2
  ------------------
  664|  3.88k|        ps_part_info->u1_sub_mb_num = 0;
  665|  3.88k|        ps_dec->ps_part++;
  666|  3.88k|        p_curr_ctxt->u1_mb_type = CAB_BD16x16;
  ------------------
  |  |  396|  3.88k|#define CAB_BD16x16       0x04 /* 0000 0100 */
  ------------------
  667|       |
  668|  3.88k|        MEMSET_16BYTES(&ps_dec->pu1_left_mv_ctxt_inc[0][0], 0);
  ------------------
  |  |  652|  3.88k|#define MEMSET_16BYTES(pu4_start,value)                         \
  |  |  653|  3.88k|{                                                               \
  |  |  654|  3.88k|    memset(pu4_start,value,16);                                 \
  |  |  655|  3.88k|}
  ------------------
  669|  3.88k|        memset(ps_dec->pi1_left_ref_idx_ctxt_inc, 0, 4);
  670|  3.88k|        MEMSET_16BYTES(p_curr_ctxt->u1_mv, 0);
  ------------------
  |  |  652|  3.88k|#define MEMSET_16BYTES(pu4_start,value)                         \
  |  |  653|  3.88k|{                                                               \
  |  |  654|  3.88k|    memset(pu4_start,value,16);                                 \
  |  |  655|  3.88k|}
  ------------------
  671|  3.88k|        memset(p_curr_ctxt->i1_ref_idx, 0, 4);
  672|       |
  673|       |        /* check whether transform8x8 u4_flag to be read or not */
  674|  3.88k|        u1_Bdirect_tranform_read =
  675|  3.88k|                        ps_dec->s_high_profile.u1_direct_8x8_inference_flag;
  676|  3.88k|    }
  677|       |
  678|       |    /* Read the Coded block pattern */
  679|  91.9k|    u1_cbp = (WORD8)ih264d_parse_ctx_cbp_cabac(ps_dec);
  680|  91.9k|    p_curr_ctxt->u1_cbp = u1_cbp;
  681|  91.9k|    ps_cur_mb_info->u1_cbp = u1_cbp;
  682|       |
  683|  91.9k|    if(u1_cbp > 47)
  ------------------
  |  Branch (683:8): [True: 0, False: 91.9k]
  ------------------
  684|      0|        return ERROR_CBP;
  685|       |
  686|  91.9k|    COPYTHECONTEXT("coded_block_pattern", u1_cbp);
  687|       |
  688|  91.9k|    ps_cur_mb_info->u1_tran_form8x8 = 0;
  689|  91.9k|    ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = 0;
  690|       |
  691|  91.9k|    if((ps_dec->s_high_profile.u1_transform8x8_present) && (u1_cbp & (0xf))
  ------------------
  |  Branch (691:8): [True: 4.39k, False: 87.6k]
  |  Branch (691:60): [True: 1.69k, False: 2.69k]
  ------------------
  692|  1.69k|                    && (ps_dec->s_high_profile.u1_no_submb_part_size_lt8x8_flag)
  ------------------
  |  Branch (692:24): [True: 1.18k, False: 516]
  ------------------
  693|  1.18k|                    && (u1_Bdirect_tranform_read))
  ------------------
  |  Branch (693:24): [True: 1.08k, False: 94]
  ------------------
  694|  1.08k|    {
  695|  1.08k|        ps_cur_mb_info->u1_tran_form8x8 = ih264d_parse_transform8x8flag_cabac(
  696|  1.08k|                        ps_dec, ps_cur_mb_info);
  697|  1.08k|        COPYTHECONTEXT("transform_size_8x8_flag", ps_cur_mb_info->u1_tran_form8x8);
  698|       |
  699|  1.08k|        ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = ps_cur_mb_info->u1_tran_form8x8;
  700|  1.08k|        p_curr_ctxt->u1_transform8x8_ctxt = ps_cur_mb_info->u1_tran_form8x8;
  701|  1.08k|    }
  702|  90.9k|    else
  703|  90.9k|    {
  704|  90.9k|        p_curr_ctxt->u1_transform8x8_ctxt = 0;
  705|  90.9k|    }
  706|       |
  707|  91.9k|    p_curr_ctxt->u1_intra_chroma_pred_mode = 0;
  708|  91.9k|    p_curr_ctxt->u1_yuv_dc_csbp &= 0xFE;
  709|  91.9k|    ps_dec->pu1_left_yuv_dc_csbp[0] &= 0x6;
  710|       |
  711|       |    /* Read mb_qp_delta */
  712|  91.9k|    if(u1_cbp)
  ------------------
  |  Branch (712:8): [True: 22.4k, False: 69.5k]
  ------------------
  713|  22.4k|    {
  714|  22.4k|        WORD8 c_temp;
  715|  22.4k|        ret = ih264d_parse_mb_qp_delta_cabac(ps_dec, &c_temp);
  716|  22.4k|        if(ret != OK)
  ------------------
  |  |  114|  22.4k|#define OK        0
  ------------------
  |  Branch (716:12): [True: 143, False: 22.2k]
  ------------------
  717|    143|            return ret;
  718|  22.2k|        COPYTHECONTEXT("mb_qp_delta", c_temp);
  719|  22.2k|        if(c_temp)
  ------------------
  |  Branch (719:12): [True: 2.13k, False: 20.1k]
  ------------------
  720|  2.13k|        {
  721|  2.13k|            ret = ih264d_update_qp(ps_dec, c_temp);
  722|  2.13k|            if(ret != OK)
  ------------------
  |  |  114|  2.13k|#define OK        0
  ------------------
  |  Branch (722:16): [True: 0, False: 2.13k]
  ------------------
  723|      0|                return ret;
  724|  2.13k|        }
  725|  22.2k|    }
  726|  69.5k|    else
  727|  69.5k|        ps_dec->i1_prev_mb_qp_delta = 0;
  728|       |
  729|  91.8k|    ih264d_parse_residual4x4_cabac(ps_dec, ps_cur_mb_info, 0);
  730|  91.8k|    if(EXCEED_OFFSET(ps_dec->ps_bitstrm))
  ------------------
  |  |   93|  91.8k|  (ps_bitstrm->u4_ofst > ps_bitstrm->u4_max_ofst)
  |  |  ------------------
  |  |  |  Branch (93:3): [True: 1.68k, False: 90.1k]
  |  |  ------------------
  ------------------
  731|  1.68k|        return ERROR_EOB_TERMINATE_T;
  732|  90.1k|    return OK;
  ------------------
  |  |  114|  90.1k|#define OK        0
  ------------------
  733|  91.8k|}
ih264d_parse_bmb_cavlc:
  749|  67.4k|{
  750|  67.4k|    UWORD32 u4_cbp;
  751|  67.4k|    deblk_mb_t * ps_cur_deblk_mb = ps_dec->ps_deblk_mbn + u4_mb_num;
  752|  67.4k|    dec_bit_stream_t * const ps_bitstrm = ps_dec->ps_bitstrm;
  753|  67.4k|    UWORD32 * pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
  754|  67.4k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
  755|  67.4k|    const UWORD8 *puc_mb_mc_mode = (const UWORD8 *)gau1_ih264d_mb_mc_mode;
  756|  67.4k|    UWORD8 u1_mb_type = ps_cur_mb_info->u1_mb_type;
  757|       |
  758|  67.4k|    WORD32 ret;
  759|  67.4k|    UWORD8 u1_Bdirect_tranform_read = 1;
  760|  67.4k|    ps_dec->s_high_profile.u1_no_submb_part_size_lt8x8_flag = 1;
  761|  67.4k|    ps_cur_mb_info->u1_tran_form8x8 = 0;
  762|  67.4k|    ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = 0;
  763|       |
  764|  67.4k|    ps_cur_mb_info->u1_yuv_dc_block_flag = 0;
  765|       |
  766|  67.4k|    ps_cur_mb_info->u1_mb_mc_mode = puc_mb_mc_mode[5 + u1_mb_type];
  767|       |
  768|  67.4k|    ps_cur_deblk_mb->u1_mb_type |= D_B_SLICE;
  ------------------
  |  |  384|  67.4k|#define D_B_SLICE         4
  ------------------
  769|  67.4k|    if(u1_mb_type != B_DIRECT)
  ------------------
  |  |  482|  67.4k|#define B_DIRECT  0
  ------------------
  |  Branch (769:8): [True: 26.3k, False: 41.1k]
  ------------------
  770|  26.3k|    {
  771|  26.3k|        ret = ih264d_parse_bmb_non_direct_cavlc(ps_dec, ps_cur_mb_info, u4_mb_num,
  772|  26.3k|                                          u4_num_mbsNby2);
  773|  26.3k|        if(ret != OK)
  ------------------
  |  |  114|  26.3k|#define OK        0
  ------------------
  |  Branch (773:12): [True: 627, False: 25.7k]
  ------------------
  774|    627|            return ret;
  775|  26.3k|    }
  776|  41.1k|    else
  777|  41.1k|    {
  778|       |        /************ STORING PARTITION INFO ***********/
  779|  41.1k|        parse_part_params_t * ps_part_info;
  780|  41.1k|        ps_part_info = ps_dec->ps_part;
  781|  41.1k|        ps_part_info->u1_is_direct = PART_DIRECT_16x16;
  ------------------
  |  |  571|  41.1k|#define PART_DIRECT_16x16              2
  ------------------
  782|  41.1k|        ps_part_info->u1_sub_mb_num = 0;
  783|  41.1k|        ps_dec->ps_part++;
  784|       |        /* check whether transform8x8 u4_flag to be read or not */
  785|  41.1k|        u1_Bdirect_tranform_read =
  786|  41.1k|                        ps_dec->s_high_profile.u1_direct_8x8_inference_flag;
  787|  41.1k|    }
  788|       |
  789|       |    /* Read the Coded block pattern */
  790|  66.8k|    {
  791|  66.8k|        const UWORD8 * puc_CbpInter = gau1_ih264d_cbp_inter;
  792|       |//Inlined ih264d_uev
  793|  66.8k|        UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
  794|  66.8k|        UWORD32 u4_word, u4_ldz;
  795|       |
  796|       |        /***************************************************************/
  797|       |        /* Find leading zeros in next 32 bits                          */
  798|       |        /***************************************************************/
  799|  66.8k|        NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  66.8k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  66.8k|{                                                                           \
  |  |  152|  66.8k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  66.8k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  66.8k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  66.8k|                                                                            \
  |  |  156|  66.8k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  66.8k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 65.2k, False: 1.62k]
  |  |  ------------------
  |  |  158|  66.8k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  65.2k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  66.8k|}
  ------------------
  800|  66.8k|        u4_ldz = CLZ(u4_word);
  801|       |        /* Flush the ps_bitstrm */
  802|  66.8k|        u4_bitstream_offset += (u4_ldz + 1);
  803|       |        /* Read the suffix from the ps_bitstrm */
  804|  66.8k|        u4_word = 0;
  805|  66.8k|        if(u4_ldz)
  ------------------
  |  Branch (805:12): [True: 17.3k, False: 49.5k]
  ------------------
  806|  17.3k|            GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  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.2k, False: 1.03k]
  |  |  ------------------
  |  |  128|  17.3k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  16.2k|#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|}                                                                           \
  ------------------
  807|  66.8k|        *pu4_bitstrm_ofst = u4_bitstream_offset;
  808|  66.8k|        u4_cbp = ((1 << u4_ldz) + u4_word - 1);
  809|       |//Inlined ih264d_uev
  810|  66.8k|        if(u4_cbp > 47)
  ------------------
  |  Branch (810:12): [True: 1.15k, False: 65.6k]
  ------------------
  811|  1.15k|            return ERROR_CBP;
  812|  65.6k|        u4_cbp = puc_CbpInter[u4_cbp];
  813|       |
  814|  65.6k|        if((ps_dec->s_high_profile.u1_transform8x8_present) && (u4_cbp & (0xf))
  ------------------
  |  Branch (814:12): [True: 4.03k, False: 61.6k]
  |  Branch (814:64): [True: 1.88k, False: 2.15k]
  ------------------
  815|  1.88k|                        && (ps_dec->s_high_profile.u1_no_submb_part_size_lt8x8_flag)
  ------------------
  |  Branch (815:28): [True: 1.68k, False: 199]
  ------------------
  816|  1.68k|                        && (u1_Bdirect_tranform_read))
  ------------------
  |  Branch (816:28): [True: 1.18k, False: 503]
  ------------------
  817|  1.18k|        {
  818|  1.18k|            ps_cur_mb_info->u1_tran_form8x8 = ih264d_get_bit_h264(ps_bitstrm);
  819|  1.18k|            COPYTHECONTEXT("transform_size_8x8_flag", ps_cur_mb_info->u1_tran_form8x8);
  820|  1.18k|            ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = ps_cur_mb_info->u1_tran_form8x8;
  821|  1.18k|        }
  822|       |
  823|  65.6k|    }
  824|       |
  825|      0|    COPYTHECONTEXT("coded_block_pattern", u4_cbp);
  826|  65.6k|    ps_cur_mb_info->u1_cbp = u4_cbp;
  827|       |
  828|       |    /* Read mb_qp_delta */
  829|  65.6k|    if(u4_cbp)
  ------------------
  |  Branch (829:8): [True: 16.1k, False: 49.5k]
  ------------------
  830|  16.1k|    {
  831|  16.1k|        WORD32 i_temp;
  832|       |//inlining ih264d_sev
  833|       |
  834|  16.1k|        UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
  835|  16.1k|        UWORD32 u4_word, u4_ldz, u4_abs_val;
  836|       |
  837|       |        /***************************************************************/
  838|       |        /* Find leading zeros in next 32 bits                          */
  839|       |        /***************************************************************/
  840|  16.1k|        NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  16.1k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  16.1k|{                                                                           \
  |  |  152|  16.1k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  16.1k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  16.1k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  16.1k|                                                                            \
  |  |  156|  16.1k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  16.1k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 15.5k, False: 640]
  |  |  ------------------
  |  |  158|  16.1k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  15.5k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  16.1k|}
  ------------------
  841|  16.1k|        u4_ldz = CLZ(u4_word);
  842|       |
  843|       |        /* Flush the ps_bitstrm */
  844|  16.1k|        u4_bitstream_offset += (u4_ldz + 1);
  845|       |
  846|       |        /* Read the suffix from the ps_bitstrm */
  847|  16.1k|        u4_word = 0;
  848|  16.1k|        if(u4_ldz)
  ------------------
  |  Branch (848:12): [True: 8.74k, False: 7.41k]
  ------------------
  849|  8.74k|            GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  8.74k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  8.74k|{                                                                           \
  |  |  122|  8.74k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  8.74k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  8.74k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  8.74k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  8.74k|                                                                            \
  |  |  127|  8.74k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 8.17k, False: 574]
  |  |  ------------------
  |  |  128|  8.74k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  8.17k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  8.74k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  8.74k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  8.74k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  8.74k|}                                                                           \
  ------------------
  850|       |
  851|  16.1k|        *pu4_bitstrm_ofst = u4_bitstream_offset;
  852|  16.1k|        u4_abs_val = ((1 << u4_ldz) + u4_word) >> 1;
  853|       |
  854|  16.1k|        if(u4_word & 0x1)
  ------------------
  |  Branch (854:12): [True: 5.15k, False: 11.0k]
  ------------------
  855|  5.15k|            i_temp = (-(WORD32)u4_abs_val);
  856|  11.0k|        else
  857|  11.0k|            i_temp = (u4_abs_val);
  858|       |
  859|  16.1k|        if(i_temp < -26 || i_temp > 25)
  ------------------
  |  Branch (859:12): [True: 114, False: 16.0k]
  |  Branch (859:28): [True: 362, False: 15.6k]
  ------------------
  860|    476|            return ERROR_INV_RANGE_QP_T;
  861|       |//inlinined ih264d_sev
  862|  15.6k|        COPYTHECONTEXT("mb_qp_delta", i_temp);
  863|  15.6k|        if(i_temp)
  ------------------
  |  Branch (863:12): [True: 8.26k, False: 7.41k]
  ------------------
  864|  8.26k|        {
  865|  8.26k|            ret = ih264d_update_qp(ps_dec, (WORD8)i_temp);
  866|  8.26k|            if(ret != OK)
  ------------------
  |  |  114|  8.26k|#define OK        0
  ------------------
  |  Branch (866:16): [True: 0, False: 8.26k]
  ------------------
  867|      0|                return ret;
  868|  8.26k|        }
  869|       |
  870|  15.6k|        ret = ih264d_parse_residual4x4_cavlc(ps_dec, ps_cur_mb_info, 0);
  871|  15.6k|        if(ret != OK)
  ------------------
  |  |  114|  15.6k|#define OK        0
  ------------------
  |  Branch (871:12): [True: 1.12k, False: 14.5k]
  ------------------
  872|  1.12k|            return ret;
  873|  14.5k|        if(EXCEED_OFFSET(ps_bitstrm))
  ------------------
  |  |   93|  14.5k|  (ps_bitstrm->u4_ofst > ps_bitstrm->u4_max_ofst)
  |  |  ------------------
  |  |  |  Branch (93:3): [True: 622, False: 13.9k]
  |  |  ------------------
  ------------------
  874|    622|            return ERROR_EOB_TERMINATE_T;
  875|  14.5k|    }
  876|  49.5k|    else
  877|  49.5k|    {
  878|  49.5k|        ps_dec->i1_prev_mb_qp_delta = 0;
  879|  49.5k|        ih264d_update_nnz_for_skipmb(ps_dec, ps_cur_mb_info, CAVLC);
  ------------------
  |  |  338|  49.5k|#define CAVLC  0
  ------------------
  880|  49.5k|    }
  881|       |
  882|  63.4k|    return OK;
  ------------------
  |  |  114|  63.4k|#define OK        0
  ------------------
  883|  65.6k|}
ih264d_mv_pred_ref_tfr_nby2_bmb:
  888|   126k|{
  889|   126k|    parse_pmbarams_t * ps_mb_part_info;
  890|   126k|    parse_part_params_t * ps_part;
  891|   126k|    mv_pred_t *ps_mv_nmb, *ps_mv_nmb_start, *ps_mv_ntop, *ps_mv_ntop_start;
  892|   126k|    pic_buffer_t * ps_ref_frame;
  893|   126k|    UWORD8 u1_direct_mode_width;
  894|   126k|    UWORD32 i;
  895|   126k|    UWORD8 j;
  896|   126k|    dec_mb_info_t * ps_cur_mb_info;
  897|   126k|    const UWORD8 u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
  898|   126k|    UWORD8 u1_field;
  899|   126k|    WORD32 ret = 0;
  900|       |
  901|   126k|    ps_dec->i4_submb_ofst -= (WORD32)(u4_num_mbs - u4_mb_idx) << 4;
  902|   126k|    ps_mb_part_info = ps_dec->ps_parse_mb_data;
  903|   126k|    ps_part = ps_dec->ps_parse_part_params;
  904|       |
  905|       |    /* N/2 Mb MvPred and Transfer Setup Loop */
  906|  1.08M|    for(i = u4_mb_idx; i < u4_num_mbs; i++, ps_mb_part_info++)
  ------------------
  |  Branch (906:24): [True: 961k, False: 126k]
  ------------------
  907|   961k|    {
  908|   961k|        UWORD8 u1_colz = 0;
  909|   961k|        ps_dec->i4_submb_ofst += SUB_BLK_SIZE;
  ------------------
  |  |  562|   961k|#define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|   961k|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  |  |               #define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|   961k|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  ------------------
  910|       |        /* Restore the slice scratch MbX and MbY context */
  911|   961k|        ps_cur_mb_info = ps_dec->ps_nmb_info + i;
  912|       |
  913|       |
  914|   961k|        u1_field = ps_cur_mb_info->u1_mb_field_decodingflag;
  915|       |
  916|   961k|        ps_mv_nmb_start = ps_dec->ps_mv_cur + (i << 4);
  917|   961k|        ps_dec->u2_mbx = ps_cur_mb_info->u2_mbx;
  918|   961k|        ps_dec->u2_mby = ps_cur_mb_info->u2_mby;
  919|   961k|        ps_dec->u1_currB_type = 0;
  920|   961k|        ps_dec->u2_mv_2mb[i & 0x1] = 0;
  921|       |
  922|       |        /* Look for MV Prediction and Reference Transfer in Non-I Mbs */
  923|   961k|        if(!ps_mb_part_info->u4_isI_mb)
  ------------------
  |  Branch (923:12): [True: 960k, False: 937]
  ------------------
  924|   960k|        {
  925|   960k|            UWORD8 u1_blk_no;
  926|   960k|            WORD16 i1_ref_idx, i1_ref_idx1;
  927|   960k|            UWORD8 u1_pred_mode;
  928|   960k|            UWORD8 u1_sub_mb_x, u1_sub_mb_y, u1_sub_mb_num;
  929|   960k|            UWORD8 u1_lx, u1_lx_start, u1_lxend, u1_tmp_lx;
  930|   960k|            UWORD8 u1_num_part, u1_num_ref, u1_wd, u1_ht;
  931|   960k|            UWORD32 *pu4_wt_offst;
  932|   960k|            UWORD8 u1_scale_ref, u4_bot_mb;
  933|   960k|            deblk_mb_t * ps_cur_deblk_mb = ps_dec->ps_deblk_mbn + i;
  934|   960k|            WORD8 (*pi1_ref_idx)[MAX_REFIDX_INFO_PER_MB] =
  935|   960k|                            ps_mb_part_info->i1_ref_idx;
  936|   960k|            WORD8 *pi1_ref_idx0 = pi1_ref_idx[0],
  937|   960k|                            *pi1_ref_idx1 = pi1_ref_idx[1];
  938|   960k|            UWORD32 **ppu4_wt_ofst = ps_mb_part_info->pu4_wt_offst;
  939|       |
  940|       |            /* MB Level initialisations */
  941|   960k|            ps_dec->u4_num_pmbair = i >> u1_mbaff;
  942|   960k|            ps_dec->u4_mb_idx_mv = i;
  943|       |
  944|       |            /* CHANGED CODE */
  945|   960k|            ps_mv_ntop_start = ps_mv_nmb_start
  946|   960k|                            - (ps_dec->u2_frm_wd_in_mbs << (4 + u1_mbaff)) + 12;
  947|       |
  948|   960k|            u1_num_part = ps_mb_part_info->u1_num_part;
  949|   960k|            ps_cur_deblk_mb->u1_mb_type |= (u1_num_part > 1) << 1;
  950|   960k|            u1_direct_mode_width = (1 == ps_mb_part_info->u1_num_part) ? 16 : 8;
  ------------------
  |  Branch (950:36): [True: 883k, False: 77.3k]
  ------------------
  951|       |
  952|       |
  953|   960k|            ps_cur_mb_info->u4_pred_info_pkd_idx = ps_dec->u4_pred_info_pkd_idx;
  954|   960k|            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|   960k|            u1_scale_ref = u1_mbaff & ps_cur_mb_info->u1_mb_field_decodingflag;
  961|   960k|            u4_bot_mb = 1 - ps_cur_mb_info->u1_topmb;
  962|   960k|            if(ps_dec->ps_cur_pps->u1_wted_bipred_idc)
  ------------------
  |  Branch (962:16): [True: 649k, False: 311k]
  ------------------
  963|   649k|            {
  964|   649k|                u1_num_ref = MIN(u1_num_part, 4);
  ------------------
  |  |   61|   649k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 645k, False: 3.92k]
  |  |  ------------------
  ------------------
  965|   649k|                if(PART_DIRECT_16x16 != ps_part->u1_is_direct)
  ------------------
  |  |  571|   649k|#define PART_DIRECT_16x16              2
  ------------------
  |  Branch (965:20): [True: 31.0k, False: 617k]
  ------------------
  966|  31.0k|                {
  967|  85.7k|                    for(u1_blk_no = 0; u1_blk_no < u1_num_ref; u1_blk_no++)
  ------------------
  |  Branch (967:40): [True: 54.6k, False: 31.0k]
  ------------------
  968|  54.6k|                    {
  969|  54.6k|                        i1_ref_idx = MAX(pi1_ref_idx0[u1_blk_no], 0);
  ------------------
  |  |   60|  54.6k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 6.42k, False: 48.2k]
  |  |  ------------------
  ------------------
  970|  54.6k|                        if(u1_scale_ref)
  ------------------
  |  Branch (970:28): [True: 0, False: 54.6k]
  ------------------
  971|      0|                            i1_ref_idx >>= 1;
  972|  54.6k|                        i1_ref_idx *=
  973|  54.6k|                                        ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[1];
  974|  54.6k|                        if(u1_scale_ref)
  ------------------
  |  Branch (974:28): [True: 0, False: 54.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|  54.6k|                        else
  979|  54.6k|                            i1_ref_idx += MAX(pi1_ref_idx1[u1_blk_no], 0);
  ------------------
  |  |   60|  54.6k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 4.52k, False: 50.1k]
  |  |  ------------------
  ------------------
  980|  54.6k|                        pu4_wt_offst = (UWORD32*)&ps_dec->pu4_wt_ofsts[2
  981|  54.6k|                                        * X3(i1_ref_idx)];
  ------------------
  |  |   92|  54.6k|#define X3(a)   (((a) << 1) + (a))
  ------------------
  982|       |
  983|  54.6k|                        if(pi1_ref_idx0[u1_blk_no] < 0)
  ------------------
  |  Branch (983:28): [True: 21.4k, False: 33.1k]
  ------------------
  984|  21.4k|                            pu4_wt_offst += 1;
  985|       |
  986|  54.6k|                        ppu4_wt_ofst[u1_blk_no] = pu4_wt_offst;
  987|  54.6k|                        if(u1_scale_ref
  ------------------
  |  Branch (987:28): [True: 0, False: 54.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|  54.6k|                    }
 1009|  31.0k|                }
 1010|   649k|            }
 1011|       |
 1012|       |            /**************************************************/
 1013|       |            /* Loop on Partitions                             */
 1014|       |            /* direct mode is reflected as a single partition */
 1015|       |            /**************************************************/
 1016|  2.05M|            for(j = 0; j < u1_num_part; j++, ps_part++)
  ------------------
  |  Branch (1016:24): [True: 1.09M, False: 960k]
  ------------------
 1017|  1.09M|            {
 1018|  1.09M|                u1_sub_mb_num = ps_part->u1_sub_mb_num;
 1019|  1.09M|                ps_dec->u1_sub_mb_num = u1_sub_mb_num;
 1020|       |
 1021|  1.09M|                if(PART_NOT_DIRECT != ps_part->u1_is_direct)
  ------------------
  |  |  569|  1.09M|#define PART_NOT_DIRECT                0
  ------------------
  |  Branch (1021:20): [True: 864k, False: 233k]
  ------------------
 1022|   864k|                {
 1023|       |                    /**************************************************/
 1024|       |                    /* Direct Mode, Call DecodeSpatial/TemporalDirect */
 1025|       |                    /* only (those will in turn call FormMbPartInfo)  */
 1026|       |                    /**************************************************/
 1027|   864k|                    ret = ps_dec->ps_cur_slice->pf_decodeDirect(ps_dec,
 1028|   864k|                                                                u1_direct_mode_width,
 1029|   864k|                                                                ps_cur_mb_info, i);
 1030|   864k|                    if(ret != OK)
  ------------------
  |  |  114|   864k|#define OK        0
  ------------------
  |  Branch (1030:24): [True: 0, False: 864k]
  ------------------
 1031|      0|                        return ret;
 1032|   864k|                    ps_cur_deblk_mb->u1_mb_type |= (ps_dec->u1_currB_type << 1);
 1033|       |
 1034|   864k|                }
 1035|   233k|                else
 1036|   233k|                {
 1037|   233k|                    mv_pred_t s_mvPred;
 1038|       |                    /**************************************************/
 1039|       |                    /* Non Direct Mode, Call Motion Vector Predictor  */
 1040|       |                    /* and FormMbpartInfo                             */
 1041|       |                    /**************************************************/
 1042|   233k|                    u1_sub_mb_x = u1_sub_mb_num & 0x03;
 1043|   233k|                    u1_sub_mb_y = u1_sub_mb_num >> 2;
 1044|   233k|                    u1_blk_no =
 1045|   233k|                                    (u1_num_part < 4) ?
  ------------------
  |  Branch (1045:37): [True: 138k, False: 94.8k]
  ------------------
 1046|   138k|                                                    j :
 1047|   233k|                                                    (((u1_sub_mb_y >> 1) << 1)
 1048|  94.8k|                                                                    + (u1_sub_mb_x
 1049|  94.8k|                                                                                    >> 1));
 1050|       |
 1051|   233k|                    ps_mv_ntop = ps_mv_ntop_start + u1_sub_mb_x;
 1052|   233k|                    ps_mv_nmb = ps_mv_nmb_start + u1_sub_mb_num;
 1053|       |
 1054|   233k|                    u1_pred_mode = ps_part->u1_pred_mode;
 1055|   233k|                    u1_wd = ps_part->u1_partwidth;
 1056|   233k|                    u1_ht = ps_part->u1_partheight;
 1057|       |
 1058|   233k|                    u1_lx_start = 0;
 1059|   233k|                    u1_lxend = 2;
 1060|   233k|                    if( PRED_L0 == u1_pred_mode)
  ------------------
  |  |  483|   233k|#define PRED_L0   1
  ------------------
  |  Branch (1060:25): [True: 107k, False: 125k]
  ------------------
 1061|   107k|                    {
 1062|   107k|                        s_mvPred.i2_mv[2] = 0;
 1063|   107k|                        s_mvPred.i2_mv[3] = 0;
 1064|   107k|                        u1_lxend = 1;
 1065|   107k|                    }
 1066|   233k|                    if( PRED_L1 == u1_pred_mode)
  ------------------
  |  |  484|   233k|#define PRED_L1   2
  ------------------
  |  Branch (1066:25): [True: 62.3k, False: 171k]
  ------------------
 1067|  62.3k|                    {
 1068|  62.3k|                        s_mvPred.i2_mv[0] = 0;
 1069|  62.3k|                        s_mvPred.i2_mv[1] = 0;
 1070|  62.3k|                        u1_lx_start = 1;
 1071|  62.3k|                    }
 1072|       |
 1073|       |                    /* Populate the colpic info and reference frames */
 1074|   233k|                    s_mvPred.i1_ref_frame[0] = pi1_ref_idx0[u1_blk_no];
 1075|   233k|                    s_mvPred.i1_ref_frame[1] = pi1_ref_idx1[u1_blk_no];
 1076|       |
 1077|   233k|                    ps_dec->pf_mvpred(ps_dec, ps_cur_mb_info, ps_mv_nmb, ps_mv_ntop,
 1078|   233k|                                      &s_mvPred, u1_sub_mb_num, u1_wd,
 1079|   233k|                                      u1_lx_start, u1_lxend,
 1080|   233k|                                      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|   530k|                    for(u1_lx = u1_lx_start; u1_lx < u1_lxend; u1_lx++)
  ------------------
  |  Branch (1086:46): [True: 296k, False: 233k]
  ------------------
 1087|   296k|                    {
 1088|   296k|                        WORD16 i2_mv_x, i2_mv_y;
 1089|       |
 1090|       |                        /********************************************************/
 1091|       |                        /* Predict Mv                                           */
 1092|       |                        /* Add Mv Residuals and store back                      */
 1093|       |                        /********************************************************/
 1094|   296k|                        i1_ref_idx = s_mvPred.i1_ref_frame[u1_lx];
 1095|   296k|                        u1_tmp_lx = (u1_lx << 1);
 1096|       |
 1097|   296k|                        i2_mv_x = ps_mv_nmb->i2_mv[u1_tmp_lx];
 1098|   296k|                        i2_mv_y = ps_mv_nmb->i2_mv[u1_tmp_lx + 1];
 1099|       |
 1100|   296k|                        i2_mv_x += s_mvPred.i2_mv[u1_tmp_lx];
 1101|   296k|                        i2_mv_y += s_mvPred.i2_mv[u1_tmp_lx + 1];
 1102|   296k|                        s_mvPred.i2_mv[u1_tmp_lx] = i2_mv_x;
 1103|   296k|                        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|   296k|                        i1_ref_idx1 = i1_ref_idx >> u1_scale_ref;
 1111|   296k|                        if(u1_scale_ref && ((i1_ref_idx & 0x01) != u4_bot_mb))
  ------------------
  |  Branch (1111:28): [True: 0, False: 296k]
  |  Branch (1111:44): [True: 0, False: 0]
  ------------------
 1112|      0|                            i1_ref_idx1 += MAX_REF_BUFS;
  ------------------
  |  |   75|      0|#define MAX_REF_BUFS    32
  ------------------
 1113|   296k|                        ps_ref_frame =
 1114|   296k|                                        ps_dec->ps_ref_pic_buf_lx[u1_lx][i1_ref_idx1];
 1115|       |
 1116|       |                        /* Storing Colocated-Zero u4_flag */
 1117|   296k|                        if(u1_lx == u1_lx_start)
  ------------------
  |  Branch (1117:28): [True: 233k, False: 63.4k]
  ------------------
 1118|   233k|                        {
 1119|       |                            /* Fill colocated info in MvPred structure */
 1120|   233k|                            s_mvPred.u1_col_ref_pic_idx =
 1121|   233k|                                            ps_ref_frame->u1_mv_buf_id;
 1122|   233k|                            s_mvPred.u1_pic_type = ps_ref_frame->u1_pic_type;
 1123|       |
 1124|       |                            /* Calculating colocated zero information */
 1125|   233k|                            u1_colz =
 1126|   233k|                                            (u1_field << 1)
 1127|   233k|                                                            | ((i1_ref_idx == 0)
  ------------------
  |  Branch (1127:64): [True: 192k, False: 41.4k]
  ------------------
 1128|   192k|                                                                            && (ABS(i2_mv_x)
  ------------------
  |  |  100|   192k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 33.1k, False: 158k]
  |  |  ------------------
  ------------------
  |  Branch (1128:80): [True: 90.4k, False: 101k]
  ------------------
 1129|   192k|                                                                                            <= 1)
 1130|  90.4k|                                                                            && (ABS(i2_mv_y)
  ------------------
  |  |  100|  90.4k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 18.0k, False: 72.4k]
  |  |  ------------------
  ------------------
  |  Branch (1130:80): [True: 71.1k, False: 19.3k]
  ------------------
 1131|  90.4k|                                                                                            <= 1));
 1132|   233k|                            u1_colz |= ps_mb_part_info->u1_col_info[u1_blk_no];
 1133|   233k|                        }
 1134|       |
 1135|   296k|                        pu4_wt_offst = ppu4_wt_ofst[u1_blk_no];
 1136|   296k|                        {
 1137|   296k|                            pred_info_pkd_t *ps_pred_pkd;
 1138|   296k|                           WORD16 i2_mv[2];
 1139|       |
 1140|   296k|                           i2_mv[0] = i2_mv_x;
 1141|   296k|                           i2_mv[1] = i2_mv_y;
 1142|       |
 1143|   296k|                           ps_pred_pkd = ps_dec->ps_pred_pkd + ps_dec->u4_pred_info_pkd_idx;
 1144|   296k|                        ih264d_fill_pred_info(i2_mv,u1_wd,u1_ht,u1_sub_mb_num,u1_pred_mode,
 1145|   296k|                                        ps_pred_pkd,ps_ref_frame->u1_pic_buf_id,i1_ref_idx,pu4_wt_offst,
 1146|   296k|                                        ps_ref_frame->u1_pic_type);
 1147|   296k|                        ps_dec->u4_pred_info_pkd_idx++;
 1148|   296k|                        ps_cur_mb_info->u1_num_pred_parts++;
 1149|       |
 1150|       |
 1151|   296k|                        }
 1152|       |
 1153|   296k|                    }
 1154|   233k|                    ih264d_rep_mv_colz(ps_dec, &s_mvPred, ps_mv_nmb,
 1155|   233k|                                       u1_sub_mb_num, u1_colz, u1_ht,
 1156|   233k|                                       u1_wd);
 1157|   233k|                }
 1158|  1.09M|            }
 1159|       |
 1160|   960k|        }
 1161|    937|        else
 1162|    937|        {
 1163|       |            /* Set zero values in case of Intra Mbs */
 1164|    937|            mv_pred_t s_mvPred =
 1165|    937|                {
 1166|    937|                    { 0, 0, 0, 0 },
 1167|    937|                      { -1, -1 }, 0, 0};
 1168|       |            /* Storing colocated zero information */
 1169|    937|            ih264d_rep_mv_colz(ps_dec, &s_mvPred, ps_mv_nmb_start, 0,
 1170|    937|                               (UWORD8)(u1_field << 1), 4, 4);
 1171|    937|        }
 1172|       |
 1173|       |        /*if num _cores is set to 3 ,compute bs will be done in another thread*/
 1174|   961k|        if(ps_dec->u4_num_cores < 3)
  ------------------
  |  Branch (1174:12): [True: 961k, False: 0]
  ------------------
 1175|   961k|        {
 1176|   961k|            if(ps_dec->u4_app_disable_deblk_frm == 0)
  ------------------
  |  Branch (1176:16): [True: 961k, False: 0]
  ------------------
 1177|   961k|                ps_dec->pf_compute_bs(ps_dec, ps_cur_mb_info,
 1178|   961k|                                     (UWORD16)(i >> u1_mbaff));
 1179|   961k|        }
 1180|   961k|    }
 1181|   126k|    return OK;
  ------------------
  |  |  114|   126k|#define OK        0
  ------------------
 1182|   126k|}
ih264d_get_implicit_weights:
 1196|  16.2k|{
 1197|  16.2k|    UWORD32 *pu4_iwt_ofst;
 1198|  16.2k|    UWORD8 i, j;
 1199|  16.2k|    struct pic_buffer_t *ps_pic_buff0, *ps_pic_buff1;
 1200|  16.2k|    WORD16 i2_dist_scale_factor;
 1201|  16.2k|    WORD16 i2_tb, i2_td, i2_tx;
 1202|  16.2k|    WORD64 i8_tb, i8_td;
 1203|  16.2k|    WORD32 i4_poc0, i4_poc1;
 1204|  16.2k|    UWORD32 ui_temp0, ui_temp1;
 1205|  16.2k|    UWORD8 uc_num_ref_idx_l0_active, uc_num_ref_idx_l1_active;
 1206|       |
 1207|  16.2k|    pu4_iwt_ofst = ps_dec->pu4_wts_ofsts_mat;
 1208|  16.2k|    uc_num_ref_idx_l0_active =
 1209|  16.2k|                    ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[0];
 1210|  16.2k|    uc_num_ref_idx_l1_active =
 1211|  16.2k|                    ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[1];
 1212|       |
 1213|  54.5k|    for(i = 0; i < uc_num_ref_idx_l0_active; i++)
  ------------------
  |  Branch (1213:16): [True: 38.3k, False: 16.2k]
  ------------------
 1214|  38.3k|    {
 1215|  38.3k|        ps_pic_buff0 = ps_dec->ps_ref_pic_buf_lx[0][i];
 1216|  38.3k|        i4_poc0 = ps_pic_buff0->i4_avg_poc;
 1217|   130k|        for(j = 0; j < uc_num_ref_idx_l1_active; j++)
  ------------------
  |  Branch (1217:20): [True: 92.5k, False: 38.3k]
  ------------------
 1218|  92.5k|        {
 1219|  92.5k|            ps_pic_buff1 = ps_dec->ps_ref_pic_buf_lx[1][j];
 1220|  92.5k|            i4_poc1 = ps_pic_buff1->i4_avg_poc;
 1221|       |
 1222|  92.5k|            if(i4_poc1 != i4_poc0)
  ------------------
  |  Branch (1222:16): [True: 11.7k, False: 80.8k]
  ------------------
 1223|  11.7k|            {
 1224|  11.7k|                i8_tb = (WORD64)ps_dec->ps_cur_pic->i4_poc - i4_poc0;
 1225|  11.7k|                i2_tb = CLIP_S8(i8_tb);
  ------------------
  |  |   59|  11.7k|#define CLIP_S8(x) CLIP3(INT8_MIN, INT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  11.7k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 3.11k, False: 8.64k]
  |  |  |  |  |  Branch (77:54): [True: 4.31k, False: 4.32k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1226|  11.7k|                i8_td = (WORD64)i4_poc1 - i4_poc0;
 1227|  11.7k|                i2_td = CLIP_S8(i8_td);
  ------------------
  |  |   59|  11.7k|#define CLIP_S8(x) CLIP3(INT8_MIN, INT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  11.7k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 2.73k, False: 9.02k]
  |  |  |  |  |  Branch (77:54): [True: 3.91k, False: 5.10k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1228|  11.7k|                i2_tx = (16384 + ABS(SIGN_POW2_DIV(i2_td, 1))) / i2_td;
  ------------------
  |  |  100|  23.5k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 4.20k, False: 7.55k]
  |  |  |  Branch (100:27): [True: 5.19k, False: 6.56k]
  |  |  |  Branch (100:39): [True: 4.20k, False: 0]
  |  |  |  Branch (100:46): [True: 988, False: 6.56k]
  |  |  ------------------
  ------------------
 1229|  11.7k|                i2_dist_scale_factor = CLIP_S11(
  ------------------
  |  |   65|  11.7k|#define CLIP_S11(x) CLIP3(-1024, 1023, (x))
  |  |  ------------------
  |  |  |  |   77|  11.7k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 505, False: 11.2k]
  |  |  |  |  |  Branch (77:54): [True: 1.08k, False: 10.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1230|  11.7k|                                            (((i2_tb * i2_tx) + 32) >> 6));
 1231|       |
 1232|  11.7k|                if(/*((u4_poc1 - u4_poc0) == 0) ||*/
 1233|  11.7k|                (!(ps_pic_buff1->u1_is_short && ps_pic_buff0->u1_is_short))
  ------------------
  |  Branch (1233:20): [True: 10.1k, False: 1.62k]
  |  Branch (1233:49): [True: 9.09k, False: 1.04k]
  ------------------
 1234|  9.09k|                                || ((i2_dist_scale_factor >> 2) < -64)
  ------------------
  |  Branch (1234:36): [True: 1.46k, False: 7.63k]
  ------------------
 1235|  7.63k|                                || ((i2_dist_scale_factor >> 2) > 128))
  ------------------
  |  Branch (1235:36): [True: 870, False: 6.76k]
  ------------------
 1236|  5.00k|                {
 1237|       |                    /* same for forward and backward, wt=32 and Offset = 0 */
 1238|  5.00k|                    ui_temp0 = 0x00000020;
 1239|  5.00k|                    ui_temp1 = 0x00000020;
 1240|  5.00k|                }
 1241|  6.76k|                else
 1242|  6.76k|                {
 1243|  6.76k|                    ui_temp0 = 64 - (i2_dist_scale_factor >> 2);
 1244|  6.76k|                    ui_temp1 = (i2_dist_scale_factor >> 2);
 1245|  6.76k|                }
 1246|  11.7k|            }
 1247|  80.8k|            else
 1248|  80.8k|            {
 1249|  80.8k|                ui_temp0 = 0x00000020;
 1250|  80.8k|                ui_temp1 = 0x00000020;
 1251|  80.8k|            }
 1252|  92.5k|            pu4_iwt_ofst[0] = pu4_iwt_ofst[2] = pu4_iwt_ofst[4] = ui_temp0;
 1253|  92.5k|            pu4_iwt_ofst[1] = pu4_iwt_ofst[3] = pu4_iwt_ofst[5] = ui_temp1;
 1254|  92.5k|            pu4_iwt_ofst += 6;
 1255|  92.5k|        }
 1256|  38.3k|    }
 1257|  16.2k|    if(ps_dec->ps_cur_slice->u1_mbaff_frame_flag)
  ------------------
  |  Branch (1257:8): [True: 0, False: 16.2k]
  ------------------
 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.2k|}

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

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

ih264d_get_pre_sei_params:
   86|   175k|{
   87|   175k|    if((NULL != ps_dec->ps_sei) &&
  ------------------
  |  Branch (87:8): [True: 175k, False: 0]
  ------------------
   88|   175k|        ((0 == ps_dec->ps_sei->s_sei_ccv_params.u1_ccv_cancel_flag) &&
  ------------------
  |  Branch (88:10): [True: 175k, False: 276]
  ------------------
   89|   175k|        (0 == ps_dec->ps_sei->s_sei_ccv_params.u1_ccv_persistence_flag)))
  ------------------
  |  Branch (89:9): [True: 175k, False: 98]
  ------------------
   90|   175k|    {
   91|   175k|        ps_dec->ps_sei->u1_sei_ccv_params_present_flag = 0;
   92|   175k|        memset(&ps_dec->ps_sei->s_sei_ccv_params, 0, sizeof(sei_ccv_params_t));
   93|   175k|    }
   94|       |
   95|   175k|    if((NULL != ps_dec->ps_cur_sps) &&
  ------------------
  |  Branch (95:8): [True: 145k, False: 30.6k]
  ------------------
   96|   145k|        ((1 == ps_dec->ps_cur_sps->u1_vui_parameters_present_flag) &&
  ------------------
  |  Branch (96:10): [True: 18.2k, False: 126k]
  ------------------
   97|  18.2k|        ((2 != ps_dec->ps_cur_sps->s_vui.u1_colour_primaries) &&
  ------------------
  |  Branch (97:10): [True: 2.23k, False: 16.0k]
  ------------------
   98|  2.23k|        (2 != ps_dec->ps_cur_sps->s_vui.u1_matrix_coeffs) &&
  ------------------
  |  Branch (98:9): [True: 2.01k, False: 220]
  ------------------
   99|  2.01k|        (2 != ps_dec->ps_cur_sps->s_vui.u1_tfr_chars) &&
  ------------------
  |  Branch (99:9): [True: 1.93k, False: 77]
  ------------------
  100|  1.93k|        (4 != ps_dec->ps_cur_sps->s_vui.u1_tfr_chars) &&
  ------------------
  |  Branch (100:9): [True: 1.73k, False: 202]
  ------------------
  101|  1.73k|        (5 != ps_dec->ps_cur_sps->s_vui.u1_tfr_chars))))
  ------------------
  |  Branch (101:9): [True: 1.52k, False: 210]
  ------------------
  102|  1.52k|    {
  103|  1.52k|        if((1 == ps_dec->ps_sei_parse->u1_sei_ccv_params_present_flag) ||
  ------------------
  |  Branch (103:12): [True: 97, False: 1.42k]
  ------------------
  104|  1.42k|            (IDR_SLICE_NAL == u1_nal_unit_type))
  ------------------
  |  |  328|  1.42k|#define IDR_SLICE_NAL                   5
  ------------------
  |  Branch (104:13): [True: 514, False: 914]
  ------------------
  105|    611|        {
  106|    611|            ps_dec->ps_sei->u1_sei_ccv_params_present_flag =
  107|    611|                        ps_dec->ps_sei_parse->u1_sei_ccv_params_present_flag;
  108|    611|            ps_dec->ps_sei->s_sei_ccv_params = ps_dec->ps_sei_parse->s_sei_ccv_params;
  109|    611|        }
  110|  1.52k|    }
  111|   174k|    else
  112|   174k|    {
  113|   174k|        ps_dec->ps_sei->u1_sei_ccv_params_present_flag = 0;
  114|   174k|        memset(&ps_dec->ps_sei->s_sei_ccv_params, 0, sizeof(sei_ccv_params_t));
  115|   174k|    }
  116|       |
  117|   175k|    if(IDR_SLICE_NAL == u1_nal_unit_type)
  ------------------
  |  |  328|   175k|#define IDR_SLICE_NAL                   5
  ------------------
  |  Branch (117:8): [True: 112k, False: 63.4k]
  ------------------
  118|   112k|    {
  119|   112k|        ps_dec->ps_sei->u1_sei_mdcv_params_present_flag =
  120|   112k|                        ps_dec->ps_sei_parse->u1_sei_mdcv_params_present_flag;
  121|   112k|        ps_dec->ps_sei->s_sei_mdcv_params = ps_dec->ps_sei_parse->s_sei_mdcv_params;
  122|   112k|        ps_dec->ps_sei->u1_sei_cll_params_present_flag =
  123|   112k|                        ps_dec->ps_sei_parse->u1_sei_cll_params_present_flag;
  124|   112k|        ps_dec->ps_sei->s_sei_cll_params = ps_dec->ps_sei_parse->s_sei_cll_params;
  125|   112k|        ps_dec->ps_sei->u1_sei_ave_params_present_flag =
  126|   112k|                        ps_dec->ps_sei_parse->u1_sei_ave_params_present_flag;
  127|   112k|        ps_dec->ps_sei->s_sei_ave_params = ps_dec->ps_sei_parse->s_sei_ave_params;
  128|   112k|        ps_dec->ps_sei->u1_sei_sii_params_present_flag =
  129|   112k|            ps_dec->ps_sei_parse->u1_sei_sii_params_present_flag;
  130|   112k|        ps_dec->ps_sei->s_sei_sii_params = ps_dec->ps_sei_parse->s_sei_sii_params;
  131|   112k|    }
  132|       |
  133|   175k|    if(NULL != ps_dec->ps_sei)
  ------------------
  |  Branch (133:8): [True: 175k, False: 0]
  ------------------
  134|   175k|    {
  135|   175k|        ps_dec->ps_sei->u1_sei_fgc_params_present_flag =
  136|   175k|            ps_dec->ps_sei_parse->u1_sei_fgc_params_present_flag;
  137|   175k|        ps_dec->ps_sei->s_sei_fgc_params = ps_dec->ps_sei_parse->s_sei_fgc_params;
  138|   175k|    }
  139|       |
  140|   175k|    ps_dec->ps_sei_parse->u1_sei_mdcv_params_present_flag = 0;
  141|   175k|    memset(&ps_dec->ps_sei_parse->s_sei_mdcv_params, 0, sizeof(sei_mdcv_params_t));
  142|   175k|    ps_dec->ps_sei_parse->u1_sei_cll_params_present_flag = 0;
  143|   175k|    memset(&ps_dec->ps_sei_parse->s_sei_cll_params, 0, sizeof(sei_cll_params_t));
  144|   175k|    ps_dec->ps_sei_parse->u1_sei_ave_params_present_flag = 0;
  145|   175k|    memset(&ps_dec->ps_sei_parse->s_sei_ave_params, 0, sizeof(sei_ave_params_t));
  146|   175k|    ps_dec->ps_sei_parse->u1_sei_ccv_params_present_flag = 0;
  147|   175k|    memset(&ps_dec->ps_sei_parse->s_sei_ccv_params, 0, sizeof(sei_ccv_params_t));
  148|   175k|    ps_dec->ps_sei_parse->u1_sei_sii_params_present_flag = 0;
  149|   175k|    memset(&ps_dec->ps_sei_parse->s_sei_sii_params, 0, sizeof(sei_sii_params_t));
  150|   175k|}
ih264d_parse_sei:
  207|  1.82k|{
  208|  1.82k|    UNUSED(ps_dec);
  ------------------
  |  |   45|  1.82k|#define UNUSED(x) ((void)(x))
  ------------------
  209|  1.82k|    UNUSED(ps_bitstrm);
  ------------------
  |  |   45|  1.82k|#define UNUSED(x) ((void)(x))
  ------------------
  210|  1.82k|    return (0);
  211|  1.82k|}
ih264d_correct_level_idc:
  500|  99.6k|{
  501|  99.6k|    UWORD32 u4_max_mbs_allowed;
  502|       |
  503|  99.6k|    switch(u4_level_idc)
  504|  99.6k|    {
  505|  1.40k|        case H264_LEVEL_1_0:
  ------------------
  |  |  291|  1.40k|#define H264_LEVEL_1_0     10
  ------------------
  |  Branch (505:9): [True: 1.40k, False: 98.2k]
  ------------------
  506|  1.40k|            u4_max_mbs_allowed = MAX_MBS_LEVEL_10;
  ------------------
  |  |  321|  1.40k|#define MAX_MBS_LEVEL_10 99
  ------------------
  507|  1.40k|            break;
  508|  19.4k|        case H264_LEVEL_1_1:
  ------------------
  |  |  292|  19.4k|#define H264_LEVEL_1_1     11
  ------------------
  |  Branch (508:9): [True: 19.4k, False: 80.1k]
  ------------------
  509|  19.4k|            u4_max_mbs_allowed = MAX_MBS_LEVEL_11;
  ------------------
  |  |  320|  19.4k|#define MAX_MBS_LEVEL_11 396
  ------------------
  510|  19.4k|            break;
  511|  1.93k|        case H264_LEVEL_1_2:
  ------------------
  |  |  293|  1.93k|#define H264_LEVEL_1_2     12
  ------------------
  |  Branch (511:9): [True: 1.93k, False: 97.6k]
  ------------------
  512|  1.93k|            u4_max_mbs_allowed = MAX_MBS_LEVEL_12;
  ------------------
  |  |  319|  1.93k|#define MAX_MBS_LEVEL_12 396
  ------------------
  513|  1.93k|            break;
  514|    960|        case H264_LEVEL_1_3:
  ------------------
  |  |  294|    960|#define H264_LEVEL_1_3     13
  ------------------
  |  Branch (514:9): [True: 960, False: 98.6k]
  ------------------
  515|    960|            u4_max_mbs_allowed = MAX_MBS_LEVEL_13;
  ------------------
  |  |  318|    960|#define MAX_MBS_LEVEL_13 396
  ------------------
  516|    960|            break;
  517|  23.6k|        case H264_LEVEL_2_0:
  ------------------
  |  |  295|  23.6k|#define H264_LEVEL_2_0     20
  ------------------
  |  Branch (517:9): [True: 23.6k, False: 75.9k]
  ------------------
  518|  23.6k|            u4_max_mbs_allowed = MAX_MBS_LEVEL_20;
  ------------------
  |  |  317|  23.6k|#define MAX_MBS_LEVEL_20 396
  ------------------
  519|  23.6k|            break;
  520|  2.90k|        case H264_LEVEL_2_1:
  ------------------
  |  |  296|  2.90k|#define H264_LEVEL_2_1     21
  ------------------
  |  Branch (520:9): [True: 2.90k, False: 96.6k]
  ------------------
  521|  2.90k|            u4_max_mbs_allowed = MAX_MBS_LEVEL_21;
  ------------------
  |  |  316|  2.90k|#define MAX_MBS_LEVEL_21 792
  ------------------
  522|  2.90k|            break;
  523|    656|        case H264_LEVEL_2_2:
  ------------------
  |  |  297|    656|#define H264_LEVEL_2_2     22
  ------------------
  |  Branch (523:9): [True: 656, False: 98.9k]
  ------------------
  524|    656|            u4_max_mbs_allowed = MAX_MBS_LEVEL_22;
  ------------------
  |  |  315|    656|#define MAX_MBS_LEVEL_22 1620
  ------------------
  525|    656|            break;
  526|  1.57k|        case H264_LEVEL_3_0:
  ------------------
  |  |  298|  1.57k|#define H264_LEVEL_3_0     30
  ------------------
  |  Branch (526:9): [True: 1.57k, False: 98.0k]
  ------------------
  527|  1.57k|            u4_max_mbs_allowed = MAX_MBS_LEVEL_30;
  ------------------
  |  |  314|  1.57k|#define MAX_MBS_LEVEL_30 1620
  ------------------
  528|  1.57k|            break;
  529|  1.34k|        case H264_LEVEL_3_1:
  ------------------
  |  |  299|  1.34k|#define H264_LEVEL_3_1     31
  ------------------
  |  Branch (529:9): [True: 1.34k, False: 98.2k]
  ------------------
  530|  1.34k|            u4_max_mbs_allowed = MAX_MBS_LEVEL_31;
  ------------------
  |  |  313|  1.34k|#define MAX_MBS_LEVEL_31 3600
  ------------------
  531|  1.34k|            break;
  532|  14.9k|        case H264_LEVEL_3_2:
  ------------------
  |  |  300|  14.9k|#define H264_LEVEL_3_2     32
  ------------------
  |  Branch (532:9): [True: 14.9k, False: 84.6k]
  ------------------
  533|  14.9k|            u4_max_mbs_allowed = MAX_MBS_LEVEL_32;
  ------------------
  |  |  312|  14.9k|#define MAX_MBS_LEVEL_32 5120
  ------------------
  534|  14.9k|            break;
  535|  2.67k|        case H264_LEVEL_4_0:
  ------------------
  |  |  301|  2.67k|#define H264_LEVEL_4_0     40
  ------------------
  |  Branch (535:9): [True: 2.67k, False: 96.9k]
  ------------------
  536|  2.67k|            u4_max_mbs_allowed = MAX_MBS_LEVEL_40;
  ------------------
  |  |  311|  2.67k|#define MAX_MBS_LEVEL_40 8192
  ------------------
  537|  2.67k|            break;
  538|  1.12k|        case H264_LEVEL_4_1:
  ------------------
  |  |  302|  1.12k|#define H264_LEVEL_4_1     41
  ------------------
  |  Branch (538:9): [True: 1.12k, False: 98.4k]
  ------------------
  539|  1.12k|            u4_max_mbs_allowed = MAX_MBS_LEVEL_41;
  ------------------
  |  |  310|  1.12k|#define MAX_MBS_LEVEL_41 8192
  ------------------
  540|  1.12k|            break;
  541|  3.73k|        case H264_LEVEL_4_2:
  ------------------
  |  |  303|  3.73k|#define H264_LEVEL_4_2     42
  ------------------
  |  Branch (541:9): [True: 3.73k, False: 95.8k]
  ------------------
  542|  3.73k|            u4_max_mbs_allowed = MAX_MBS_LEVEL_42;
  ------------------
  |  |  309|  3.73k|#define MAX_MBS_LEVEL_42 8704
  ------------------
  543|  3.73k|            break;
  544|    226|        case H264_LEVEL_5_0:
  ------------------
  |  |  304|    226|#define H264_LEVEL_5_0     50
  ------------------
  |  Branch (544:9): [True: 226, False: 99.3k]
  ------------------
  545|    226|            u4_max_mbs_allowed = MAX_MBS_LEVEL_50;
  ------------------
  |  |  308|    226|#define MAX_MBS_LEVEL_50 22080
  ------------------
  546|    226|            break;
  547|      2|        case H264_LEVEL_5_1:
  ------------------
  |  |  305|      2|#define H264_LEVEL_5_1     51
  ------------------
  |  Branch (547:9): [True: 2, False: 99.6k]
  ------------------
  548|  23.0k|        default:
  ------------------
  |  Branch (548:9): [True: 23.0k, False: 76.5k]
  ------------------
  549|  23.0k|            u4_max_mbs_allowed = MAX_MBS_LEVEL_51;
  ------------------
  |  |  307|  23.0k|#define MAX_MBS_LEVEL_51 36864
  ------------------
  550|  23.0k|            break;
  551|       |
  552|  99.6k|    }
  553|       |
  554|       |    /*correct of the level is incorrect*/
  555|  99.6k|    if(u4_total_mbs > u4_max_mbs_allowed)
  ------------------
  |  Branch (555:8): [True: 1.48k, False: 98.1k]
  ------------------
  556|  1.48k|    {
  557|  1.48k|        if(u4_total_mbs > MAX_MBS_LEVEL_50)
  ------------------
  |  |  308|  1.48k|#define MAX_MBS_LEVEL_50 22080
  ------------------
  |  Branch (557:12): [True: 79, False: 1.40k]
  ------------------
  558|     79|            u4_level_idc = H264_LEVEL_5_1;
  ------------------
  |  |  305|     79|#define H264_LEVEL_5_1     51
  ------------------
  559|  1.40k|        else if(u4_total_mbs > MAX_MBS_LEVEL_42)
  ------------------
  |  |  309|  1.40k|#define MAX_MBS_LEVEL_42 8704
  ------------------
  |  Branch (559:17): [True: 111, False: 1.29k]
  ------------------
  560|    111|            u4_level_idc = H264_LEVEL_5_0;
  ------------------
  |  |  304|    111|#define H264_LEVEL_5_0     50
  ------------------
  561|  1.29k|        else if(u4_total_mbs > MAX_MBS_LEVEL_41)
  ------------------
  |  |  310|  1.29k|#define MAX_MBS_LEVEL_41 8192
  ------------------
  |  Branch (561:17): [True: 146, False: 1.15k]
  ------------------
  562|    146|            u4_level_idc = H264_LEVEL_4_2;
  ------------------
  |  |  303|    146|#define H264_LEVEL_4_2     42
  ------------------
  563|  1.15k|        else if(u4_total_mbs > MAX_MBS_LEVEL_40)
  ------------------
  |  |  311|  1.15k|#define MAX_MBS_LEVEL_40 8192
  ------------------
  |  Branch (563:17): [True: 0, False: 1.15k]
  ------------------
  564|      0|            u4_level_idc = H264_LEVEL_4_1;
  ------------------
  |  |  302|      0|#define H264_LEVEL_4_1     41
  ------------------
  565|  1.15k|        else if(u4_total_mbs > MAX_MBS_LEVEL_32)
  ------------------
  |  |  312|  1.15k|#define MAX_MBS_LEVEL_32 5120
  ------------------
  |  Branch (565:17): [True: 128, False: 1.02k]
  ------------------
  566|    128|            u4_level_idc = H264_LEVEL_4_0;
  ------------------
  |  |  301|    128|#define H264_LEVEL_4_0     40
  ------------------
  567|  1.02k|        else if(u4_total_mbs > MAX_MBS_LEVEL_31)
  ------------------
  |  |  313|  1.02k|#define MAX_MBS_LEVEL_31 3600
  ------------------
  |  Branch (567:17): [True: 131, False: 892]
  ------------------
  568|    131|            u4_level_idc = H264_LEVEL_3_2;
  ------------------
  |  |  300|    131|#define H264_LEVEL_3_2     32
  ------------------
  569|    892|        else if(u4_total_mbs > MAX_MBS_LEVEL_30)
  ------------------
  |  |  314|    892|#define MAX_MBS_LEVEL_30 1620
  ------------------
  |  Branch (569:17): [True: 114, False: 778]
  ------------------
  570|    114|            u4_level_idc = H264_LEVEL_3_1;
  ------------------
  |  |  299|    114|#define H264_LEVEL_3_1     31
  ------------------
  571|    778|        else if(u4_total_mbs > MAX_MBS_LEVEL_21)
  ------------------
  |  |  316|    778|#define MAX_MBS_LEVEL_21 792
  ------------------
  |  Branch (571:17): [True: 101, False: 677]
  ------------------
  572|    101|            u4_level_idc = H264_LEVEL_3_0;
  ------------------
  |  |  298|    101|#define H264_LEVEL_3_0     30
  ------------------
  573|    677|        else if(u4_total_mbs > MAX_MBS_LEVEL_20)
  ------------------
  |  |  317|    677|#define MAX_MBS_LEVEL_20 396
  ------------------
  |  Branch (573:17): [True: 457, False: 220]
  ------------------
  574|    457|            u4_level_idc = H264_LEVEL_2_1;
  ------------------
  |  |  296|    457|#define H264_LEVEL_2_1     21
  ------------------
  575|    220|        else if(u4_total_mbs > MAX_MBS_LEVEL_10)
  ------------------
  |  |  321|    220|#define MAX_MBS_LEVEL_10 99
  ------------------
  |  Branch (575:17): [True: 220, False: 0]
  ------------------
  576|    220|            u4_level_idc = H264_LEVEL_2_0;
  ------------------
  |  |  295|    220|#define H264_LEVEL_2_0     20
  ------------------
  577|  1.48k|    }
  578|       |
  579|  99.6k|    return (u4_level_idc);
  580|       |
  581|  99.6k|}

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

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

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

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

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

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

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

ih264d_scaling_list:
   52|  19.0k|{
   53|  19.0k|    WORD32 i4_j, i4_delta_scale, i4_lastScale = 8, i4_nextScale = 8;
   54|  19.0k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
   55|  19.0k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
   56|       |
   57|  19.0k|    *pu1_use_default_scaling_matrix_flag = 0;
   58|       |
   59|   505k|    for(i4_j = 0; i4_j < i4_size_of_scalinglist; i4_j++)
  ------------------
  |  Branch (59:19): [True: 487k, False: 18.3k]
  ------------------
   60|   487k|    {
   61|   487k|        if(i4_nextScale != 0)
  ------------------
  |  Branch (61:12): [True: 212k, False: 274k]
  ------------------
   62|   212k|        {
   63|   212k|            i4_delta_scale = ih264d_sev(pu4_bitstrm_ofst,
   64|   212k|                                        pu4_bitstrm_buf);
   65|       |
   66|   212k|            if(i4_delta_scale < MIN_H264_DELTA_SCALE ||
  ------------------
  |  |  639|   425k|#define MIN_H264_DELTA_SCALE (-128)
  ------------------
  |  Branch (66:16): [True: 176, False: 212k]
  ------------------
   67|   212k|                        i4_delta_scale > MAX_H264_DELTA_SCALE)
  ------------------
  |  |  644|   212k|#define MAX_H264_DELTA_SCALE 127
  ------------------
  |  Branch (67:25): [True: 550, False: 212k]
  ------------------
   68|    726|            {
   69|    726|                return ERROR_INV_RANGE_QP_T;
   70|    726|            }
   71|   212k|            i4_nextScale = ((i4_lastScale + i4_delta_scale + 256) & 0xff);
   72|       |
   73|   212k|            *pu1_use_default_scaling_matrix_flag = ((i4_j == 0)
  ------------------
  |  Branch (73:53): [True: 19.0k, False: 193k]
  ------------------
   74|  19.0k|                            && (i4_nextScale == 0));
  ------------------
  |  Branch (74:32): [True: 220, False: 18.7k]
  ------------------
   75|       |
   76|   212k|        }
   77|   486k|        pi2_scaling_list[i4_j] =
   78|   486k|                        (i4_nextScale == 0) ? (i4_lastScale) : (i4_nextScale);
  ------------------
  |  Branch (78:25): [True: 288k, False: 198k]
  ------------------
   79|   486k|        i4_lastScale = pi2_scaling_list[i4_j];
   80|   486k|    }
   81|  18.3k|    return OK;
  ------------------
  |  |  114|  18.3k|#define OK        0
  ------------------
   82|  19.0k|}
ih264d_form_default_scaling_matrix:
   85|   128k|{
   86|       |
   87|       |    /*************************************************************************/
   88|       |    /* perform the inverse scanning for the frame and field scaling matrices */
   89|       |    /*************************************************************************/
   90|   128k|    {
   91|   128k|        UWORD8 *pu1_inv_scan;
   92|   128k|        WORD32 i4_i, i4_j;
   93|       |
   94|   128k|        pu1_inv_scan = (UWORD8 *)gau1_ih264d_inv_scan;
   95|       |
   96|       |        /* for all 4x4 matrices */
   97|   898k|        for(i4_i = 0; i4_i < 6; i4_i++)
  ------------------
  |  Branch (97:23): [True: 769k, False: 128k]
  ------------------
   98|   769k|        {
   99|  13.0M|            for(i4_j = 0; i4_j < 16; i4_j++)
  ------------------
  |  Branch (99:27): [True: 12.3M, False: 769k]
  ------------------
  100|  12.3M|            {
  101|  12.3M|                ps_dec->s_high_profile.i2_scalinglist4x4[i4_i][pu1_inv_scan[i4_j]] =
  102|  12.3M|                                16;
  103|       |
  104|  12.3M|            }
  105|   769k|        }
  106|       |
  107|       |        /* for all 8x8 matrices */
  108|   384k|        for(i4_i = 0; i4_i < 2; i4_i++)
  ------------------
  |  Branch (108:23): [True: 256k, False: 128k]
  ------------------
  109|   256k|        {
  110|  16.6M|            for(i4_j = 0; i4_j < 64; i4_j++)
  ------------------
  |  Branch (110:27): [True: 16.4M, False: 256k]
  ------------------
  111|  16.4M|            {
  112|  16.4M|                ps_dec->s_high_profile.i2_scalinglist8x8[i4_i][gau1_ih264d_inv_scan_prog8x8_cabac[i4_j]] =
  113|  16.4M|                                16;
  114|       |
  115|  16.4M|            }
  116|   256k|        }
  117|   128k|    }
  118|   128k|    return OK;
  ------------------
  |  |  114|   128k|#define OK        0
  ------------------
  119|   128k|}
ih264d_form_scaling_matrix_picture:
  124|  10.5k|{
  125|       |    /* default scaling matrices */
  126|  10.5k|    WORD32 i4_i;
  127|       |
  128|       |    /* check the SPS first */
  129|  10.5k|    if(ps_seq->i4_seq_scaling_matrix_present_flag)
  ------------------
  |  Branch (129:8): [True: 9.45k, False: 1.13k]
  ------------------
  130|  9.45k|    {
  131|  85.1k|        for(i4_i = 0; i4_i < 8; i4_i++)
  ------------------
  |  Branch (131:23): [True: 75.6k, False: 9.45k]
  ------------------
  132|  75.6k|        {
  133|  75.6k|            if(i4_i < 6)
  ------------------
  |  Branch (133:16): [True: 56.7k, False: 18.9k]
  ------------------
  134|  56.7k|            {
  135|       |                /* fall-back rule A */
  136|  56.7k|                if(!ps_seq->u1_seq_scaling_list_present_flag[i4_i])
  ------------------
  |  Branch (136:20): [True: 31.7k, False: 24.9k]
  ------------------
  137|  31.7k|                {
  138|  31.7k|                    if((i4_i == 0) || (i4_i == 3))
  ------------------
  |  Branch (138:24): [True: 2.89k, False: 28.8k]
  |  Branch (138:39): [True: 7.83k, False: 21.0k]
  ------------------
  139|  10.7k|                    {
  140|  10.7k|                        ps_dec->s_high_profile.pi2_scale_mat[i4_i] =
  141|  10.7k|                                        (i4_i == 0) ? (WORD16 *)(gai2_ih264d_default_intra4x4) : (WORD16 *)(gai2_ih264d_default_inter4x4);
  ------------------
  |  Branch (141:41): [True: 2.89k, False: 7.83k]
  ------------------
  142|  10.7k|                    }
  143|  21.0k|                    else
  144|  21.0k|                    {
  145|  21.0k|                        ps_dec->s_high_profile.pi2_scale_mat[i4_i] =
  146|  21.0k|                                        ps_dec->s_high_profile.pi2_scale_mat[i4_i
  147|  21.0k|                                                        - 1];
  148|  21.0k|                    }
  149|  31.7k|                }
  150|  24.9k|                else
  151|  24.9k|                {
  152|  24.9k|                    if(ps_seq->u1_use_default_scaling_matrix_flag[i4_i])
  ------------------
  |  Branch (152:24): [True: 333, False: 24.6k]
  ------------------
  153|    333|                    {
  154|    333|                        ps_dec->s_high_profile.pi2_scale_mat[i4_i] =
  155|    333|                                        (i4_i < 3) ? (WORD16 *)(gai2_ih264d_default_intra4x4) : (WORD16 *)(gai2_ih264d_default_inter4x4);
  ------------------
  |  Branch (155:41): [True: 317, False: 16]
  ------------------
  156|    333|                    }
  157|  24.6k|                    else
  158|  24.6k|                    {
  159|  24.6k|                        ps_dec->s_high_profile.pi2_scale_mat[i4_i] =
  160|  24.6k|                                        ps_seq->i2_scalinglist4x4[i4_i];
  161|  24.6k|                    }
  162|  24.9k|                }
  163|       |
  164|  56.7k|            }
  165|  18.9k|            else
  166|  18.9k|            {
  167|       |                /* fall-back rule A */
  168|  18.9k|                if((!ps_seq->u1_seq_scaling_list_present_flag[i4_i])
  ------------------
  |  Branch (168:20): [True: 11.5k, False: 7.41k]
  ------------------
  169|  7.41k|                                || (ps_seq->u1_use_default_scaling_matrix_flag[i4_i]))
  ------------------
  |  Branch (169:36): [True: 232, False: 7.18k]
  ------------------
  170|  11.7k|                {
  171|  11.7k|                    ps_dec->s_high_profile.pi2_scale_mat[i4_i] =
  172|  11.7k|                                    (i4_i == 6) ? ((WORD16*)gai2_ih264d_default_intra8x8) : ((WORD16*)gai2_ih264d_default_inter8x8);
  ------------------
  |  Branch (172:37): [True: 2.99k, False: 8.73k]
  ------------------
  173|  11.7k|                }
  174|  7.18k|                else
  175|  7.18k|                {
  176|  7.18k|                    ps_dec->s_high_profile.pi2_scale_mat[i4_i] =
  177|  7.18k|                                    ps_seq->i2_scalinglist8x8[i4_i - 6];
  178|  7.18k|                }
  179|  18.9k|            }
  180|  75.6k|        }
  181|  9.45k|    }
  182|       |
  183|       |    /* checking for the PPS */
  184|       |
  185|  10.5k|    if(ps_pic->i4_pic_scaling_matrix_present_flag)
  ------------------
  |  Branch (185:8): [True: 2.65k, False: 7.93k]
  ------------------
  186|  2.65k|    {
  187|  23.9k|        for(i4_i = 0; i4_i < 8; i4_i++)
  ------------------
  |  Branch (187:23): [True: 21.2k, False: 2.65k]
  ------------------
  188|  21.2k|        {
  189|  21.2k|            if(i4_i < 6)
  ------------------
  |  Branch (189:16): [True: 15.9k, False: 5.31k]
  ------------------
  190|  15.9k|            {
  191|       |                /* fall back rule B */
  192|  15.9k|                if(!ps_pic->u1_pic_scaling_list_present_flag[i4_i])
  ------------------
  |  Branch (192:20): [True: 12.8k, False: 3.11k]
  ------------------
  193|  12.8k|                {
  194|  12.8k|                    if((i4_i == 0) || (i4_i == 3))
  ------------------
  |  Branch (194:24): [True: 1.86k, False: 10.9k]
  |  Branch (194:39): [True: 2.18k, False: 8.79k]
  ------------------
  195|  4.04k|                    {
  196|  4.04k|                        if(!ps_seq->i4_seq_scaling_matrix_present_flag)
  ------------------
  |  Branch (196:28): [True: 1.98k, False: 2.05k]
  ------------------
  197|  1.98k|                        {
  198|  1.98k|                            ps_dec->s_high_profile.pi2_scale_mat[i4_i] =
  199|  1.98k|                                            (i4_i == 0) ? (WORD16 *)(gai2_ih264d_default_intra4x4) : (WORD16 *)(gai2_ih264d_default_inter4x4);
  ------------------
  |  Branch (199:45): [True: 1.00k, False: 980]
  ------------------
  200|  1.98k|                        }
  201|  4.04k|                    }
  202|  8.79k|                    else
  203|  8.79k|                    {
  204|  8.79k|                        ps_dec->s_high_profile.pi2_scale_mat[i4_i] =
  205|  8.79k|                                        ps_dec->s_high_profile.pi2_scale_mat[i4_i
  206|  8.79k|                                                        - 1];
  207|  8.79k|                    }
  208|  12.8k|                }
  209|  3.11k|                else
  210|  3.11k|                {
  211|  3.11k|                    if(ps_pic->u1_pic_use_default_scaling_matrix_flag[i4_i])
  ------------------
  |  Branch (211:24): [True: 304, False: 2.80k]
  ------------------
  212|    304|                    {
  213|    304|                        ps_dec->s_high_profile.pi2_scale_mat[i4_i] =
  214|    304|                                        (i4_i < 3) ? (WORD16 *)(gai2_ih264d_default_intra4x4) : (WORD16 *)(gai2_ih264d_default_inter4x4);
  ------------------
  |  Branch (214:41): [True: 113, False: 191]
  ------------------
  215|    304|                    }
  216|  2.80k|                    else
  217|  2.80k|                    {
  218|  2.80k|                        ps_dec->s_high_profile.pi2_scale_mat[i4_i] =
  219|  2.80k|                                        ps_pic->i2_pic_scalinglist4x4[i4_i];
  220|  2.80k|                    }
  221|  3.11k|                }
  222|  15.9k|            }
  223|  5.31k|            else
  224|  5.31k|            {
  225|  5.31k|                if(!ps_pic->u1_pic_scaling_list_present_flag[i4_i])
  ------------------
  |  Branch (225:20): [True: 4.18k, False: 1.13k]
  ------------------
  226|  4.18k|                {
  227|  4.18k|                    if(!ps_seq->i4_seq_scaling_matrix_present_flag)
  ------------------
  |  Branch (227:24): [True: 2.23k, False: 1.95k]
  ------------------
  228|  2.23k|                    {
  229|  2.23k|                        ps_dec->s_high_profile.pi2_scale_mat[i4_i] =
  230|  2.23k|                                        (i4_i == 6) ? ((WORD16*)gai2_ih264d_default_intra8x8) : ((WORD16*)gai2_ih264d_default_inter8x8);
  ------------------
  |  Branch (230:41): [True: 1.11k, False: 1.11k]
  ------------------
  231|  2.23k|                    }
  232|  4.18k|                }
  233|  1.13k|                else
  234|  1.13k|                {
  235|  1.13k|                    if(ps_pic->u1_pic_use_default_scaling_matrix_flag[i4_i])
  ------------------
  |  Branch (235:24): [True: 226, False: 905]
  ------------------
  236|    226|                    {
  237|    226|                        ps_dec->s_high_profile.pi2_scale_mat[i4_i] =
  238|    226|                                        (i4_i == 6) ? (WORD16 *)(gai2_ih264d_default_intra8x8) : (WORD16 *)(gai2_ih264d_default_inter8x8);
  ------------------
  |  Branch (238:41): [True: 162, False: 64]
  ------------------
  239|    226|                    }
  240|    905|                    else
  241|    905|                    {
  242|    905|                        ps_dec->s_high_profile.pi2_scale_mat[i4_i] =
  243|    905|                                        ps_pic->i2_pic_scalinglist8x8[i4_i - 6];
  244|    905|                    }
  245|  1.13k|                }
  246|  5.31k|            }
  247|  21.2k|        }
  248|  2.65k|    }
  249|       |
  250|       |    /*************************************************************************/
  251|       |    /* perform the inverse scanning for the frame and field scaling matrices */
  252|       |    /*************************************************************************/
  253|  10.5k|    {
  254|  10.5k|        UWORD8 *pu1_inv_scan_4x4;
  255|  10.5k|        WORD32 i4_i, i4_j;
  256|       |
  257|  10.5k|        pu1_inv_scan_4x4 = (UWORD8 *)gau1_ih264d_inv_scan;
  258|       |
  259|       |        /* for all 4x4 matrices */
  260|  74.1k|        for(i4_i = 0; i4_i < 6; i4_i++)
  ------------------
  |  Branch (260:23): [True: 63.5k, False: 10.5k]
  ------------------
  261|  63.5k|        {
  262|  63.5k|            if(ps_dec->s_high_profile.pi2_scale_mat[i4_i] == NULL)
  ------------------
  |  Branch (262:16): [True: 0, False: 63.5k]
  ------------------
  263|      0|                return ERROR_CORRUPTED_SLICE;
  264|       |
  265|  1.08M|            for(i4_j = 0; i4_j < 16; i4_j++)
  ------------------
  |  Branch (265:27): [True: 1.01M, False: 63.5k]
  ------------------
  266|  1.01M|            {
  267|  1.01M|                ps_dec->s_high_profile.i2_scalinglist4x4[i4_i][pu1_inv_scan_4x4[i4_j]] =
  268|  1.01M|                                ps_dec->s_high_profile.pi2_scale_mat[i4_i][i4_j];
  269|       |
  270|  1.01M|            }
  271|  63.5k|        }
  272|       |
  273|       |        /* for all 8x8 matrices */
  274|  31.7k|        for(i4_i = 0; i4_i < 2; i4_i++)
  ------------------
  |  Branch (274:23): [True: 21.1k, False: 10.5k]
  ------------------
  275|  21.1k|        {
  276|  21.1k|            if(ps_dec->s_high_profile.pi2_scale_mat[i4_i + 6] == NULL)
  ------------------
  |  Branch (276:16): [True: 0, False: 21.1k]
  ------------------
  277|      0|                return ERROR_CORRUPTED_SLICE;
  278|       |
  279|  1.37M|            for(i4_j = 0; i4_j < 64; i4_j++)
  ------------------
  |  Branch (279:27): [True: 1.35M, False: 21.1k]
  ------------------
  280|  1.35M|            {
  281|  1.35M|                ps_dec->s_high_profile.i2_scalinglist8x8[i4_i][gau1_ih264d_inv_scan_prog8x8_cabac[i4_j]] =
  282|  1.35M|                                ps_dec->s_high_profile.pi2_scale_mat[i4_i + 6][i4_j];
  283|       |
  284|  1.35M|            }
  285|  21.1k|        }
  286|  10.5k|    }
  287|  10.5k|    return OK;
  ------------------
  |  |  114|  10.5k|#define OK        0
  ------------------
  288|  10.5k|}

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

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

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

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

ih264d_parse_hrd_parametres:
   70|  5.97k|{
   71|  5.97k|    UWORD8 u1_index;
   72|  5.97k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
   73|  5.97k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
   74|       |
   75|  5.97k|    ps_hrd->u4_cpb_cnt = 1
   76|  5.97k|                    + ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
   77|  5.97k|    if(ps_hrd->u4_cpb_cnt > 31)
  ------------------
  |  Branch (77:8): [True: 397, False: 5.57k]
  ------------------
   78|    397|        return ERROR_INV_SPS_PPS_T;
   79|  5.57k|    ps_hrd->u1_bit_rate_scale = ih264d_get_bits_h264(ps_bitstrm, 4);
   80|  5.57k|    ps_hrd->u1_cpb_size_scale = ih264d_get_bits_h264(ps_bitstrm, 4);
   81|       |
   82|  21.7k|    for(u1_index = 0; u1_index < (UWORD8)ps_hrd->u4_cpb_cnt; u1_index++)
  ------------------
  |  Branch (82:23): [True: 16.1k, False: 5.57k]
  ------------------
   83|  16.1k|    {
   84|  16.1k|        ps_hrd->u4_bit_rate[u1_index] = 1
   85|  16.1k|                        + ih264d_uev(pu4_bitstrm_ofst,
   86|  16.1k|                                     pu4_bitstrm_buf);
   87|  16.1k|        ps_hrd->u4_cpb_size[u1_index] = 1
   88|  16.1k|                        + ih264d_uev(pu4_bitstrm_ofst,
   89|  16.1k|                                     pu4_bitstrm_buf);
   90|  16.1k|        ps_hrd->u1_cbr_flag[u1_index] = ih264d_get_bits_h264(ps_bitstrm, 1);
   91|  16.1k|    }
   92|       |
   93|  5.57k|    ps_hrd->u1_initial_cpb_removal_delay = 1
   94|  5.57k|                    + ih264d_get_bits_h264(ps_bitstrm, 5);
   95|  5.57k|    ps_hrd->u1_cpb_removal_delay_length = 1
   96|  5.57k|                    + ih264d_get_bits_h264(ps_bitstrm, 5);
   97|  5.57k|    ps_hrd->u1_dpb_output_delay_length = 1
   98|  5.57k|                    + ih264d_get_bits_h264(ps_bitstrm, 5);
   99|  5.57k|    ps_hrd->u1_time_offset_length = ih264d_get_bits_h264(ps_bitstrm, 5);
  100|       |
  101|  5.57k|    return OK;
  ------------------
  |  |  114|  5.57k|#define OK        0
  ------------------
  102|  5.97k|}
ih264d_parse_vui_parametres:
  127|  9.35k|{
  128|  9.35k|    UWORD8 u4_bits;
  129|  9.35k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
  130|  9.35k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
  131|  9.35k|    WORD32 ret;
  132|       |
  133|  9.35k|    u4_bits = ih264d_get_bits_h264(ps_bitstrm, 1);
  134|  9.35k|    if(u4_bits)
  ------------------
  |  Branch (134:8): [True: 6.72k, False: 2.63k]
  ------------------
  135|  6.72k|    {
  136|  6.72k|        u4_bits = ih264d_get_bits_h264(ps_bitstrm, 8);
  137|  6.72k|        ps_vu4->u1_aspect_ratio_idc = (UWORD8)u4_bits;
  138|  6.72k|        if(VUI_EXTENDED_SAR == u4_bits)
  ------------------
  |  |   46|  6.72k|#define VUI_EXTENDED_SAR    255
  ------------------
  |  Branch (138:12): [True: 3.08k, False: 3.63k]
  ------------------
  139|  3.08k|        {
  140|  3.08k|            ps_vu4->u2_sar_width = ih264d_get_bits_h264(ps_bitstrm, 16);
  141|  3.08k|            ps_vu4->u2_sar_height = ih264d_get_bits_h264(ps_bitstrm, 16);
  142|  3.08k|        }
  143|  6.72k|    }
  144|       |
  145|  9.35k|    u4_bits = ih264d_get_bits_h264(ps_bitstrm, 1);
  146|  9.35k|    if(u4_bits)
  ------------------
  |  Branch (146:8): [True: 2.51k, False: 6.84k]
  ------------------
  147|  2.51k|    {
  148|  2.51k|        ps_vu4->u1_overscan_appropriate_flag = ih264d_get_bits_h264(
  149|  2.51k|                        ps_bitstrm, 1);
  150|  2.51k|    }
  151|  9.35k|    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.35k|    ps_vu4->u1_video_format = 5;
  155|  9.35k|    ps_vu4->u1_video_full_range_flag = 0;
  156|  9.35k|    ps_vu4->u1_colour_primaries = 2;
  157|  9.35k|    ps_vu4->u1_tfr_chars = 2;
  158|  9.35k|    ps_vu4->u1_matrix_coeffs = 2;
  159|       |
  160|  9.35k|    if(u4_bits)
  ------------------
  |  Branch (160:8): [True: 2.88k, False: 6.47k]
  ------------------
  161|  2.88k|    {
  162|  2.88k|        ps_vu4->u1_video_format = ih264d_get_bits_h264(ps_bitstrm, 3);
  163|  2.88k|        ps_vu4->u1_video_full_range_flag = ih264d_get_bits_h264(ps_bitstrm,
  164|  2.88k|                                                                1);
  165|  2.88k|        u4_bits = ih264d_get_bits_h264(ps_bitstrm, 1);
  166|  2.88k|        if(u4_bits)
  ------------------
  |  Branch (166:12): [True: 1.45k, False: 1.42k]
  ------------------
  167|  1.45k|        {
  168|  1.45k|            ps_vu4->u1_colour_primaries = ih264d_get_bits_h264(ps_bitstrm,
  169|  1.45k|                                                               8);
  170|  1.45k|            ps_vu4->u1_tfr_chars = ih264d_get_bits_h264(ps_bitstrm, 8);
  171|  1.45k|            ps_vu4->u1_matrix_coeffs = ih264d_get_bits_h264(ps_bitstrm, 8);
  172|  1.45k|        }
  173|  2.88k|    }
  174|       |
  175|  9.35k|    u4_bits = ih264d_get_bits_h264(ps_bitstrm, 1);
  176|  9.35k|    if(u4_bits)
  ------------------
  |  Branch (176:8): [True: 1.70k, False: 7.64k]
  ------------------
  177|  1.70k|    {
  178|  1.70k|        ps_vu4->u1_cr_top_field = ih264d_uev(pu4_bitstrm_ofst,
  179|  1.70k|                                             pu4_bitstrm_buf);
  180|  1.70k|        ps_vu4->u1_cr_bottom_field = ih264d_uev(pu4_bitstrm_ofst,
  181|  1.70k|                                                pu4_bitstrm_buf);
  182|  1.70k|    }
  183|       |
  184|  9.35k|    u4_bits = ih264d_get_bits_h264(ps_bitstrm, 1);
  185|  9.35k|    if(u4_bits)
  ------------------
  |  Branch (185:8): [True: 1.21k, False: 8.13k]
  ------------------
  186|  1.21k|    {
  187|  1.21k|        ps_vu4->u4_num_units_in_tick = ih264d_get_bits_h264(ps_bitstrm, 32);
  188|  1.21k|        ps_vu4->u4_time_scale = ih264d_get_bits_h264(ps_bitstrm, 32);
  189|  1.21k|        ps_vu4->u1_fixed_frame_rate_flag = ih264d_get_bits_h264(ps_bitstrm,
  190|  1.21k|                                                                1);
  191|  1.21k|    }
  192|       |
  193|  9.35k|    u4_bits = ih264d_get_bits_h264(ps_bitstrm, 1);
  194|  9.35k|    ps_vu4->u1_nal_hrd_params_present = u4_bits;
  195|  9.35k|    if(u4_bits)
  ------------------
  |  Branch (195:8): [True: 1.62k, False: 7.72k]
  ------------------
  196|  1.62k|    {
  197|  1.62k|        ret = ih264d_parse_hrd_parametres(&ps_vu4->s_nal_hrd, ps_bitstrm);
  198|  1.62k|        if(ret != OK)
  ------------------
  |  |  114|  1.62k|#define OK        0
  ------------------
  |  Branch (198:12): [True: 89, False: 1.54k]
  ------------------
  199|     89|            return ret;
  200|  1.62k|    }
  201|  9.26k|    u4_bits = ih264d_get_bits_h264(ps_bitstrm, 1);
  202|  9.26k|    ps_vu4->u1_vcl_hrd_params_present = u4_bits;
  203|  9.26k|    if(u4_bits)
  ------------------
  |  Branch (203:8): [True: 1.75k, False: 7.51k]
  ------------------
  204|  1.75k|    {
  205|  1.75k|        ret = ih264d_parse_hrd_parametres(&ps_vu4->s_vcl_hrd, ps_bitstrm);
  206|  1.75k|        if(ret != OK)
  ------------------
  |  |  114|  1.75k|#define OK        0
  ------------------
  |  Branch (206:12): [True: 153, False: 1.60k]
  ------------------
  207|    153|            return ret;
  208|  1.75k|    }
  209|       |
  210|  9.11k|    if(ps_vu4->u1_nal_hrd_params_present || u4_bits)
  ------------------
  |  Branch (210:8): [True: 1.49k, False: 7.61k]
  |  Branch (210:45): [True: 673, False: 6.94k]
  ------------------
  211|  2.16k|    {
  212|  2.16k|        ps_vu4->u1_low_delay_hrd_flag = ih264d_get_bits_h264(ps_bitstrm, 1);
  213|  2.16k|    }
  214|  9.11k|    ps_vu4->u1_pic_struct_present_flag = ih264d_get_bits_h264(ps_bitstrm, 1);
  215|       |
  216|  9.11k|    ps_vu4->u1_bitstream_restriction_flag = ih264d_get_bits_h264(ps_bitstrm, 1);
  217|       |
  218|  9.11k|    if(ps_vu4->u1_bitstream_restriction_flag)
  ------------------
  |  Branch (218:8): [True: 1.88k, False: 7.23k]
  ------------------
  219|  1.88k|    {
  220|  1.88k|        ps_vu4->u1_mv_over_pic_boundaries_flag = ih264d_get_bits_h264(
  221|  1.88k|                        ps_bitstrm, 1);
  222|  1.88k|        ps_vu4->u4_max_bytes_per_pic_denom = ih264d_uev(pu4_bitstrm_ofst,
  223|  1.88k|                                                        pu4_bitstrm_buf);
  224|  1.88k|        ps_vu4->u4_max_bits_per_mb_denom = ih264d_uev(pu4_bitstrm_ofst,
  225|  1.88k|                                                      pu4_bitstrm_buf);
  226|  1.88k|        ps_vu4->u4_log2_max_mv_length_horz = ih264d_uev(pu4_bitstrm_ofst,
  227|  1.88k|                                                        pu4_bitstrm_buf);
  228|  1.88k|        ps_vu4->u4_log2_max_mv_length_vert = ih264d_uev(pu4_bitstrm_ofst,
  229|  1.88k|                                                        pu4_bitstrm_buf);
  230|  1.88k|        ps_vu4->u4_num_reorder_frames = ih264d_uev(pu4_bitstrm_ofst,
  231|  1.88k|                                                   pu4_bitstrm_buf);
  232|  1.88k|        ps_vu4->u4_max_dec_frame_buffering = ih264d_uev(pu4_bitstrm_ofst,
  233|  1.88k|                                                        pu4_bitstrm_buf);
  234|  1.88k|        if((ps_vu4->u4_max_dec_frame_buffering > (H264_MAX_REF_PICS * 2)) ||
  ------------------
  |  |  534|  1.88k|#define H264_MAX_REF_PICS         16
  ------------------
  |  Branch (234:12): [True: 146, False: 1.73k]
  ------------------
  235|  1.73k|           (ps_vu4->u4_num_reorder_frames > ps_vu4->u4_max_dec_frame_buffering))
  ------------------
  |  Branch (235:12): [True: 124, False: 1.61k]
  ------------------
  236|    270|        {
  237|    270|            return ERROR_INV_SPS_PPS_T;
  238|    270|        }
  239|  1.88k|    }
  240|  7.23k|    else
  241|  7.23k|    {
  242|       |        /* Setting this to a large value if not present */
  243|  7.23k|        ps_vu4->u4_num_reorder_frames = 64;
  244|  7.23k|        ps_vu4->u4_max_dec_frame_buffering = 64;
  245|  7.23k|    }
  246|       |
  247|  8.84k|    return OK;
  ------------------
  |  |  114|  8.84k|#define OK        0
  ------------------
  248|  9.11k|}

isvcd_set_processor:
  979|  23.3k|{
  980|  23.3k|    isvcd_ctl_set_processor_ip_t *ps_ip;
  981|  23.3k|    isvcd_ctl_set_processor_op_t *ps_op;
  982|  23.3k|    UWORD8 u1_layer_id;
  983|  23.3k|    svc_dec_lyr_struct_t *ps_codec;
  984|  23.3k|    svc_dec_ctxt_t *ps_svcd_ctxt;
  985|  23.3k|    ps_svcd_ctxt = (svc_dec_ctxt_t *) dec_hdl->pv_codec_handle;
  986|       |
  987|  23.3k|    ps_ip = (isvcd_ctl_set_processor_ip_t *) pv_api_ip;
  988|  23.3k|    ps_op = (isvcd_ctl_set_processor_op_t *) pv_api_op;
  989|       |
  990|  23.3k|    ps_svcd_ctxt->e_processor_arch = (IVD_ARCH_T) ps_ip->u4_arch;
  991|  23.3k|    ps_svcd_ctxt->e_processor_soc = (IVD_SOC_T) ps_ip->u4_soc;
  992|       |
  993|  93.4k|    for(u1_layer_id = 0; u1_layer_id < MAX_NUM_RES_LYRS; u1_layer_id++)
  ------------------
  |  |   94|  93.4k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (993:26): [True: 70.1k, False: 23.3k]
  ------------------
  994|  70.1k|    {
  995|  70.1k|        ps_codec = &ps_svcd_ctxt->ps_svc_dec_lyr[u1_layer_id];
  996|  70.1k|        ps_codec->s_dec.e_processor_arch = (IVD_ARCH_T) ps_ip->u4_arch;
  997|  70.1k|        ps_codec->s_dec.e_processor_soc = (IVD_SOC_T) ps_ip->u4_soc;
  998|       |
  999|  70.1k|        isvcd_init_function_ptr(ps_codec);
 1000|  70.1k|    }
 1001|       |
 1002|  23.3k|    ps_op->u4_error_code = 0;
 1003|  23.3k|    return IV_SUCCESS;
 1004|  23.3k|}
isvcd_init_decoder:
 1029|  85.5k|{
 1030|  85.5k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec = (svc_dec_lyr_struct_t *) ps_dec_svc_lyr_params;
 1031|  85.5k|    dec_struct_t *ps_dec;
 1032|  85.5k|    dec_slice_params_t *ps_cur_slice;
 1033|  85.5k|    pocstruct_t *ps_prev_poc, *ps_cur_poc;
 1034|  85.5k|    size_t size;
 1035|  85.5k|    ps_dec = &ps_svc_lyr_dec->s_dec;
 1036|       |
 1037|  85.5k|    size = sizeof(pred_info_t) * 2 * 32;
 1038|  85.5k|    memset(ps_dec->ps_pred, 0, size);
 1039|       |
 1040|  85.5k|    size = sizeof(disp_mgr_t);
 1041|  85.5k|    memset(ps_dec->pv_disp_buf_mgr, 0, size);
 1042|       |
 1043|  85.5k|    size = ih264_buf_mgr_size();
 1044|  85.5k|    memset(ps_dec->pv_pic_buf_mgr, 0, size);
 1045|       |
 1046|  85.5k|    size = sizeof(dec_err_status_t);
 1047|  85.5k|    memset(ps_dec->ps_dec_err_status, 0, size);
 1048|       |
 1049|  85.5k|    size = sizeof(sei);
 1050|  85.5k|    memset(ps_dec->ps_sei, 0, size);
 1051|       |
 1052|  85.5k|    size = sizeof(sei);
 1053|  85.5k|    memset(ps_dec->ps_sei_parse, 0, size);
 1054|       |
 1055|  85.5k|    size = sizeof(dpb_commands_t);
 1056|  85.5k|    memset(ps_dec->ps_dpb_cmds, 0, size);
 1057|       |
 1058|  85.5k|    size = sizeof(dec_bit_stream_t);
 1059|  85.5k|    memset(ps_dec->ps_bitstrm, 0, size);
 1060|       |
 1061|  85.5k|    size = sizeof(dec_slice_params_t);
 1062|  85.5k|    memset(ps_dec->ps_cur_slice, 0, size);
 1063|       |
 1064|  85.5k|    size = MAX(sizeof(dec_seq_params_t), sizeof(dec_pic_params_t));
  ------------------
  |  |   60|  85.5k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 85.5k, Folded]
  |  |  ------------------
  ------------------
 1065|  85.5k|    memset(ps_dec->pv_scratch_sps_pps, 0, size);
 1066|       |
 1067|  85.5k|    size = sizeof(dec_svc_seq_params_t);
 1068|  85.5k|    memset(ps_svc_lyr_dec->pv_scratch_subset_sps, 0, size);
 1069|       |
 1070|  85.5k|    size = sizeof(ctxt_inc_mb_info_t);
 1071|  85.5k|    memset(ps_dec->ps_left_mb_ctxt_info, 0, size);
 1072|       |
 1073|  85.5k|    size = (sizeof(neighbouradd_t) << 2);
 1074|  85.5k|    memset(ps_dec->ps_left_mvpred_addr, 0, size);
 1075|       |
 1076|  85.5k|    size = ih264_buf_mgr_size();
 1077|  85.5k|    memset(ps_dec->pv_mv_buf_mgr, 0, size);
 1078|       |
 1079|       |    /* Free any dynamic buffers that are allocated */
 1080|  85.5k|    isvcd_free_dynamic_bufs(ps_svc_lyr_dec);
 1081|       |
 1082|  85.5k|    isvcd_init_dpb_ref_bufs(ps_dec);
 1083|       |
 1084|  85.5k|    ps_cur_slice = ps_dec->ps_cur_slice;
 1085|  85.5k|    ps_dec->init_done = 0;
 1086|       |
 1087|  85.5k|    ps_dec->u4_num_cores = 1;
 1088|  85.5k|    ps_dec->u2_pic_ht = ps_dec->u2_pic_wd = 0;
 1089|       |
 1090|  85.5k|    ps_dec->u1_separate_parse = DEFAULT_SEPARATE_PARSE;
  ------------------
  |  |  540|  85.5k|#define DEFAULT_SEPARATE_PARSE (H264_DEFAULT_NUM_CORES == 2)? 1 :0
  |  |  ------------------
  |  |  |  |  539|  85.5k|#define H264_DEFAULT_NUM_CORES 1
  |  |  ------------------
  |  |  |  Branch (540:32): [Folded, False: 85.5k]
  |  |  ------------------
  ------------------
 1091|  85.5k|    ps_dec->u4_app_disable_deblk_frm = 0;
 1092|  85.5k|    ps_dec->i4_degrade_type = 0;
 1093|  85.5k|    ps_dec->i4_degrade_pics = 0;
 1094|       |
 1095|       |    /* Initialization of function pointers ih264d_deblock_picture function*/
 1096|  85.5k|    ps_dec->p_DeblockPicture[0] = ih264d_deblock_picture_non_mbaff;
 1097|  85.5k|    ps_dec->p_DeblockPicture[1] = ih264d_deblock_picture_mbaff;
 1098|       |
 1099|  85.5k|    ps_dec->s_cab_dec_env.pv_codec_handle = ps_dec;
 1100|  85.5k|    ps_dec->u4_num_fld_in_frm = 0;
 1101|  85.5k|    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|  85.5k|    ps_dec->ps_sei->u1_is_valid = 0;
 1105|       |
 1106|       |    /* decParams Initializations */
 1107|  85.5k|    ps_dec->ps_cur_pps = NULL;
 1108|  85.5k|    ps_dec->ps_cur_sps = NULL;
 1109|  85.5k|    ps_dec->u1_init_dec_flag = 0;
 1110|  85.5k|    ps_dec->u1_first_slice_in_stream = 1;
 1111|  85.5k|    ps_dec->u1_last_pic_not_decoded = 0;
 1112|  85.5k|    ps_dec->u4_app_disp_width = 0;
 1113|  85.5k|    ps_dec->i4_header_decoded = 0;
 1114|  85.5k|    ps_dec->u4_total_frames_decoded = 0;
 1115|       |
 1116|  85.5k|    ps_dec->i4_error_code = 0;
 1117|  85.5k|    ps_dec->i4_content_type = IV_CONTENTTYPE_NA;
 1118|  85.5k|    ps_dec->ps_cur_slice->u1_mbaff_frame_flag = 0;
 1119|       |
 1120|  85.5k|    ps_dec->ps_dec_err_status->u1_err_flag = ACCEPT_ALL_PICS;
  ------------------
  |  |  600|  85.5k|#define ACCEPT_ALL_PICS   (0x00)
  ------------------
 1121|  85.5k|    ps_dec->ps_dec_err_status->u1_cur_pic_type = PIC_TYPE_UNKNOWN;
  ------------------
  |  |  607|  85.5k|#define PIC_TYPE_UNKNOWN  (0xFF)
  ------------------
 1122|  85.5k|    ps_dec->ps_dec_err_status->u4_frm_sei_sync = SYNC_FRM_DEFAULT;
  ------------------
  |  |  609|  85.5k|#define SYNC_FRM_DEFAULT  (0xFFFFFFFF)
  ------------------
 1123|  85.5k|    ps_dec->ps_dec_err_status->u4_cur_frm = INIT_FRAME;
  ------------------
  |  |  610|  85.5k|#define INIT_FRAME        (0xFFFFFF)
  ------------------
 1124|  85.5k|    ps_dec->ps_dec_err_status->u1_pic_aud_i = PIC_TYPE_UNKNOWN;
  ------------------
  |  |  607|  85.5k|#define PIC_TYPE_UNKNOWN  (0xFF)
  ------------------
 1125|       |
 1126|  85.5k|    ps_dec->u1_pr_sl_type = 0xFF;
 1127|  85.5k|    ps_dec->u2_mbx = 0xffff;
 1128|  85.5k|    ps_dec->u2_mby = 0;
 1129|  85.5k|    ps_dec->u4_total_mbs_coded = 0;
 1130|       |
 1131|       |    /* POC initializations */
 1132|  85.5k|    ps_prev_poc = &ps_dec->s_prev_pic_poc;
 1133|  85.5k|    ps_cur_poc = &ps_dec->s_cur_pic_poc;
 1134|  85.5k|    ps_prev_poc->i4_pic_order_cnt_lsb = ps_cur_poc->i4_pic_order_cnt_lsb = 0;
 1135|  85.5k|    ps_prev_poc->i4_pic_order_cnt_msb = ps_cur_poc->i4_pic_order_cnt_msb = 0;
 1136|  85.5k|    ps_prev_poc->i4_delta_pic_order_cnt_bottom = ps_cur_poc->i4_delta_pic_order_cnt_bottom = 0;
 1137|  85.5k|    ps_prev_poc->i4_delta_pic_order_cnt[0] = ps_cur_poc->i4_delta_pic_order_cnt[0] = 0;
 1138|  85.5k|    ps_prev_poc->i4_delta_pic_order_cnt[1] = ps_cur_poc->i4_delta_pic_order_cnt[1] = 0;
 1139|  85.5k|    ps_prev_poc->u1_mmco_equalto5 = ps_cur_poc->u1_mmco_equalto5 = 0;
 1140|  85.5k|    ps_prev_poc->i4_top_field_order_count = ps_cur_poc->i4_top_field_order_count = 0;
 1141|  85.5k|    ps_prev_poc->i4_bottom_field_order_count = ps_cur_poc->i4_bottom_field_order_count = 0;
 1142|  85.5k|    ps_prev_poc->u1_bot_field = ps_cur_poc->u1_bot_field = 0;
 1143|  85.5k|    ps_prev_poc->u1_mmco_equalto5 = ps_cur_poc->u1_mmco_equalto5 = 0;
 1144|  85.5k|    ps_prev_poc->i4_prev_frame_num_ofst = ps_cur_poc->i4_prev_frame_num_ofst = 0;
 1145|  85.5k|    ps_cur_slice->u1_mmco_equalto5 = 0;
 1146|  85.5k|    ps_cur_slice->u2_frame_num = 0;
 1147|       |
 1148|  85.5k|    ps_dec->i4_max_poc = 0;
 1149|  85.5k|    ps_dec->i4_prev_max_display_seq = 0;
 1150|  85.5k|    ps_dec->u4_recon_mb_grp = 4;
 1151|  85.5k|    ps_dec->i4_reorder_depth = -1;
 1152|       |
 1153|       |    /* Field PIC initializations */
 1154|  85.5k|    ps_dec->u1_second_field = 0;
 1155|  85.5k|    ps_dec->s_prev_seq_params.u1_eoseq_pending = 0;
 1156|       |
 1157|       |    /* Set the cropping parameters as zero */
 1158|  85.5k|    ps_dec->u2_crop_offset_y = 0;
 1159|  85.5k|    ps_dec->u2_crop_offset_uv = 0;
 1160|       |
 1161|       |    /* The Initial Frame Rate Info is not Present */
 1162|  85.5k|    ps_dec->i4_vui_frame_rate = -1;
 1163|  85.5k|    ps_dec->i4_pic_type = NA_SLICE;
  ------------------
  |  |  367|  85.5k|#define NA_SLICE -1
  ------------------
 1164|  85.5k|    ps_dec->i4_frametype = IV_NA_FRAME;
 1165|  85.5k|    ps_dec->i4_content_type = IV_CONTENTTYPE_NA;
 1166|       |
 1167|  85.5k|    ps_dec->u1_res_changed = 0;
 1168|       |
 1169|  85.5k|    ps_dec->u1_frame_decoded_flag = 0;
 1170|       |
 1171|       |    /* Set the default frame seek mask mode */
 1172|  85.5k|    ps_dec->u4_skip_frm_mask = SKIP_NONE;
  ------------------
  |  |  375|  85.5k|#define SKIP_NONE  (0x0)
  ------------------
 1173|       |
 1174|       |    /********************************************************/
 1175|       |    /* Initialize CAVLC residual decoding function pointers */
 1176|       |    /********************************************************/
 1177|  85.5k|    ps_dec->pf_cavlc_4x4res_block[0] = ih264d_cavlc_4x4res_block_totalcoeff_1;
 1178|  85.5k|    ps_dec->pf_cavlc_4x4res_block[1] = ih264d_cavlc_4x4res_block_totalcoeff_2to10;
 1179|  85.5k|    ps_dec->pf_cavlc_4x4res_block[2] = ih264d_cavlc_4x4res_block_totalcoeff_11to16;
 1180|       |
 1181|  85.5k|    ps_dec->pf_cavlc_parse4x4coeff[0] = ih264d_cavlc_parse4x4coeff_n0to7;
 1182|  85.5k|    ps_dec->pf_cavlc_parse4x4coeff[1] = ih264d_cavlc_parse4x4coeff_n8;
 1183|       |
 1184|  85.5k|    ps_dec->pf_cavlc_parse_8x8block[0] = ih264d_cavlc_parse_8x8block_none_available;
 1185|  85.5k|    ps_dec->pf_cavlc_parse_8x8block[1] = ih264d_cavlc_parse_8x8block_left_available;
 1186|  85.5k|    ps_dec->pf_cavlc_parse_8x8block[2] = ih264d_cavlc_parse_8x8block_top_available;
 1187|  85.5k|    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|  85.5k|    ps_dec->pf_fill_bs1[0][0] = ih264d_fill_bs1_16x16mb_pslice;
 1193|  85.5k|    ps_dec->pf_fill_bs1[0][1] = ih264d_fill_bs1_non16x16mb_pslice;
 1194|       |
 1195|  85.5k|    ps_dec->pf_fill_bs1[1][0] = ih264d_fill_bs1_16x16mb_bslice;
 1196|  85.5k|    ps_dec->pf_fill_bs1[1][1] = ih264d_fill_bs1_non16x16mb_bslice;
 1197|       |
 1198|  85.5k|    ps_dec->pf_fill_bs_xtra_left_edge[0] = ih264d_fill_bs_xtra_left_edge_cur_frm;
 1199|  85.5k|    ps_dec->pf_fill_bs_xtra_left_edge[1] = ih264d_fill_bs_xtra_left_edge_cur_fld;
 1200|       |
 1201|       |    /* Initialize Reference Pic Buffers */
 1202|  85.5k|    ih264d_init_ref_bufs(ps_dec->ps_dpb_mgr);
 1203|       |
 1204|  85.5k|    ps_dec->u2_prv_frame_num = 0;
 1205|  85.5k|    ps_dec->u1_top_bottom_decoded = 0;
 1206|  85.5k|    ps_dec->u1_dangling_field = 0;
 1207|       |
 1208|  85.5k|    ps_dec->s_cab_dec_env.cabac_table = gau4_ih264d_cabac_table;
 1209|       |
 1210|  85.5k|    ps_dec->pu1_left_mv_ctxt_inc = ps_dec->u1_left_mv_ctxt_inc_arr[0];
 1211|  85.5k|    ps_dec->pi1_left_ref_idx_ctxt_inc = &ps_dec->i1_left_ref_idx_ctx_inc_arr[0][0];
 1212|  85.5k|    ps_dec->pu1_left_yuv_dc_csbp = &ps_dec->u1_yuv_dc_csbp_topmb;
 1213|       |
 1214|       |    /* ! */
 1215|       |    /* Initializing flush frame u4_flag */
 1216|  85.5k|    ps_dec->u1_flushfrm = 0;
 1217|       |
 1218|  85.5k|    ps_dec->s_cab_dec_env.pv_codec_handle = (void *) ps_dec;
 1219|  85.5k|    ps_dec->ps_bitstrm->pv_codec_handle = (void *) ps_dec;
 1220|  85.5k|    ps_dec->ps_cur_slice->pv_codec_handle = (void *) ps_dec;
 1221|  85.5k|    ps_dec->ps_dpb_mgr->pv_codec_handle = (void *) ps_dec;
 1222|       |
 1223|  85.5k|    memset(ps_dec->disp_bufs, 0, (MAX_DISP_BUFS_NEW) * sizeof(disp_buf_t));
  ------------------
  |  |   76|  85.5k|#define MAX_DISP_BUFS_NEW 64
  ------------------
 1224|  85.5k|    memset(ps_dec->u4_disp_buf_mapping, 0, (MAX_DISP_BUFS_NEW) * sizeof(UWORD32));
  ------------------
  |  |   76|  85.5k|#define MAX_DISP_BUFS_NEW 64
  ------------------
 1225|  85.5k|    memset(ps_dec->u4_disp_buf_to_be_freed, 0, (MAX_DISP_BUFS_NEW) * sizeof(UWORD32));
  ------------------
  |  |   76|  85.5k|#define MAX_DISP_BUFS_NEW 64
  ------------------
 1226|  85.5k|    memset(ps_dec->ps_cur_slice, 0, sizeof(dec_slice_params_t));
 1227|       |
 1228|  85.5k|    ih264d_init_arch(ps_dec);
 1229|  85.5k|    isvcd_init_function_ptr(ps_svc_lyr_dec);
 1230|  85.5k|    ps_dec->e_frm_out_mode = IVD_DISPLAY_FRAME_OUT;
 1231|  85.5k|    ps_dec->init_done = 1;
 1232|  85.5k|    ps_svc_lyr_dec->u1_layer_identifier = BASE_LAYER;
  ------------------
  |  |  108|  85.5k|#define BASE_LAYER 0
  ------------------
 1233|  85.5k|}
isvcd_nal_parse_ctxt_free:
 1257|  23.3k|{
 1258|  23.3k|    dec_struct_t *ps_dec;
 1259|  23.3k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 1260|  23.3k|    void (*pf_aligned_free)(void *pv_mem_ctxt, void *pv_buf);
 1261|  23.3k|    void *pv_mem_ctxt;
 1262|  23.3k|    nal_parse_ctxt_t *ps_ctxt;
 1263|  23.3k|    ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[0];
 1264|  23.3k|    ps_dec = &ps_svc_lyr_dec->s_dec;
 1265|  23.3k|    pf_aligned_free = ps_dec->pf_aligned_free;
 1266|       |
 1267|  23.3k|    pv_mem_ctxt = ps_dec->pv_mem_ctxt;
 1268|  23.3k|    ps_ctxt = (nal_parse_ctxt_t *) ps_svcd_ctxt->pv_nal_parse_ctxt;
 1269|       |
 1270|  23.3k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->s_dqid_ctxt.ps_dqid_node);
 1271|  23.3k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->pv_nal_header_buf);
 1272|  23.3k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->pv_nal_unit);
 1273|  23.3k|    pf_aligned_free(pv_mem_ctxt, ps_svcd_ctxt->pv_vcl_nal_buff);
 1274|  23.3k|    pf_aligned_free(pv_mem_ctxt, ps_svcd_ctxt->pv_non_vcl_nal_buff);
 1275|  23.3k|    pf_aligned_free(pv_mem_ctxt, ps_svcd_ctxt->pv_nal_parse_ctxt);
 1276|  23.3k|}
isvcd_residual_resample_ctxt_free:
 1299|  23.3k|{
 1300|  23.3k|    dec_struct_t *ps_dec;
 1301|  23.3k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 1302|  23.3k|    void (*pf_aligned_free)(void *pv_mem_ctxt, void *pv_buf);
 1303|  23.3k|    void *pv_mem_ctxt;
 1304|  23.3k|    residual_sampling_ctxt_t *ps_ctxt;
 1305|  23.3k|    ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[0];
 1306|  23.3k|    ps_dec = &ps_svc_lyr_dec->s_dec;
 1307|  23.3k|    pf_aligned_free = ps_dec->pf_aligned_free;
 1308|       |
 1309|  23.3k|    pv_mem_ctxt = ps_dec->pv_mem_ctxt;
 1310|  23.3k|    ps_ctxt = (residual_sampling_ctxt_t *) ps_svcd_ctxt->pv_residual_sample_ctxt;
 1311|       |
 1312|  23.3k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->pi2_refarray_buffer);
 1313|  23.3k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->pu1_ref_x_ptr_incr);
 1314|  23.3k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->as_res_lyrs[0].s_luma_map_ctxt.ps_x_offset_length);
 1315|  23.3k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->as_res_lyrs[0].s_luma_map_ctxt.ps_y_offset_length);
 1316|  23.3k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->as_res_lyrs[0].s_luma_map_ctxt.ps_x_pos_phase);
 1317|  23.3k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->as_res_lyrs[0].s_luma_map_ctxt.ps_y_pos_phase);
 1318|  23.3k|    pf_aligned_free(pv_mem_ctxt, ps_svcd_ctxt->pv_residual_sample_ctxt);
 1319|  23.3k|}
isvcd_intra_resample_ctxt_free:
 1342|  23.3k|{
 1343|  23.3k|    dec_struct_t *ps_dec;
 1344|  23.3k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 1345|  23.3k|    void (*pf_aligned_free)(void *pv_mem_ctxt, void *pv_buf);
 1346|  23.3k|    void *pv_mem_ctxt;
 1347|  23.3k|    intra_sampling_ctxt_t *ps_ctxt;
 1348|  23.3k|    ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[0];
 1349|  23.3k|    ps_dec = &ps_svc_lyr_dec->s_dec;
 1350|  23.3k|    pf_aligned_free = ps_dec->pf_aligned_free;
 1351|       |
 1352|  23.3k|    pv_mem_ctxt = ps_dec->pv_mem_ctxt;
 1353|  23.3k|    ps_ctxt = (intra_sampling_ctxt_t *) ps_svcd_ctxt->pv_intra_sample_ctxt;
 1354|       |
 1355|  23.3k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->pu1_refarray_buffer);
 1356|  23.3k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->pu1_refarray_cb);
 1357|  23.3k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->pu1_refarray_cr);
 1358|  23.3k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->pi4_temp_interpolation_buffer);
 1359|  23.3k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->as_res_lyrs[0].s_luma_map_ctxt.ps_x_offset_length);
 1360|  23.3k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->as_res_lyrs[0].s_luma_map_ctxt.ps_y_offset_length);
 1361|  23.3k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->as_res_lyrs[0].s_luma_map_ctxt.ps_x_min_max);
 1362|  23.3k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->as_res_lyrs[0].s_luma_map_ctxt.ps_y_min_max);
 1363|  23.3k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->as_res_lyrs[0].s_luma_map_ctxt.ps_x_pos_phase);
 1364|  23.3k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->as_res_lyrs[0].s_luma_map_ctxt.ps_y_pos_phase);
 1365|  23.3k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->as_res_lyrs[0].s_luma_map_ctxt.pi2_xd_index);
 1366|  23.3k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->as_res_lyrs[0].s_luma_map_ctxt.pi2_yd_index);
 1367|  23.3k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->as_res_lyrs[0].s_luma_map_ctxt.pi2_ya_index);
 1368|  23.3k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->as_res_lyrs[0].s_luma_map_ctxt.ps_seg_lookup_horz);
 1369|  23.3k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->as_res_lyrs[0].s_luma_map_ctxt.ps_seg_lookup_vert);
 1370|  23.3k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->as_res_lyrs[0].s_luma_map_ctxt.pu1_refarray_x_idx);
 1371|  23.3k|    pf_aligned_free(pv_mem_ctxt, ps_svcd_ctxt->pv_intra_sample_ctxt);
 1372|  23.3k|    pf_aligned_free(pv_mem_ctxt, ps_svcd_ctxt->pv_ii_pred_ctxt);
 1373|  23.3k|}
isvcd_mode_mv_resample_ctxt_free:
 1395|  23.3k|{
 1396|  23.3k|    dec_struct_t *ps_dec;
 1397|  23.3k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 1398|  23.3k|    void (*pf_aligned_free)(void *pv_mem_ctxt, void *pv_buf);
 1399|  23.3k|    void *pv_mem_ctxt;
 1400|  23.3k|    mode_motion_ctxt_t *ps_mode_motion;
 1401|       |
 1402|  23.3k|    ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[0];
 1403|  23.3k|    ps_dec = &ps_svc_lyr_dec->s_dec;
 1404|  23.3k|    pf_aligned_free = ps_dec->pf_aligned_free;
 1405|       |
 1406|  23.3k|    pv_mem_ctxt = ps_dec->pv_mem_ctxt;
 1407|  23.3k|    ps_mode_motion = (mode_motion_ctxt_t *) ps_svcd_ctxt->pv_mode_mv_sample_ctxt;
 1408|       |
 1409|  23.3k|    pf_aligned_free(pv_mem_ctxt, ps_mode_motion->ps_motion_pred_struct);
 1410|  23.3k|    pf_aligned_free(pv_mem_ctxt, ps_mode_motion->as_res_lyr_mem[0].pi2_ref_loc_x);
 1411|  23.3k|    pf_aligned_free(pv_mem_ctxt, ps_mode_motion->as_res_lyr_mem[0].pi2_ref_loc_y);
 1412|  23.3k|    pf_aligned_free(pv_mem_ctxt, ps_svcd_ctxt->pv_ref_lyr_offset);
 1413|  23.3k|    pf_aligned_free(pv_mem_ctxt, ps_svcd_ctxt->pv_mode_mv_sample_ctxt);
 1414|  23.3k|}
isvcd_free_static_bufs:
 1437|  23.3k|{
 1438|  23.3k|    dec_struct_t *ps_dec;
 1439|  23.3k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 1440|       |
 1441|  23.3k|    UWORD8 u1_layer_id;
 1442|  23.3k|    svc_dec_ctxt_t *ps_svcd_ctxt;
 1443|       |
 1444|  23.3k|    void (*pf_aligned_free)(void *pv_mem_ctxt, void *pv_buf);
 1445|  23.3k|    void *pv_mem_ctxt;
 1446|       |
 1447|  23.3k|    ps_svcd_ctxt = (svc_dec_ctxt_t *) dec_hdl->pv_codec_handle;
 1448|       |
 1449|  23.3k|    isvcd_intra_resample_ctxt_free(ps_svcd_ctxt);
 1450|  23.3k|    isvcd_residual_resample_ctxt_free(ps_svcd_ctxt);
 1451|  23.3k|    isvcd_mode_mv_resample_ctxt_free(ps_svcd_ctxt);
 1452|  23.3k|    isvcd_nal_parse_ctxt_free(ps_svcd_ctxt);
 1453|       |
 1454|  93.4k|    for(u1_layer_id = 0; u1_layer_id < MAX_NUM_RES_LYRS; u1_layer_id++)
  ------------------
  |  |   94|  93.4k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (1454:26): [True: 70.1k, False: 23.3k]
  ------------------
 1455|  70.1k|    {
 1456|  70.1k|        ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[u1_layer_id];
 1457|  70.1k|        ps_dec = &ps_svc_lyr_dec->s_dec;
 1458|  70.1k|        pf_aligned_free = ps_dec->pf_aligned_free;
 1459|  70.1k|        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|  70.1k|        if(0 == u1_layer_id)
  ------------------
  |  Branch (1511:12): [True: 23.3k, False: 46.7k]
  ------------------
 1512|  23.3k|        {
 1513|  23.3k|            UWORD8 u1_sps_ctr;
 1514|  23.3k|            PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_sps);
  ------------------
  |  |   43|  23.3k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  23.3k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 23.3k, False: 0]
  |  |  ------------------
  ------------------
 1515|  1.51M|            for(u1_sps_ctr = 0; u1_sps_ctr < (2 * MAX_NUM_SEQ_PARAMS); u1_sps_ctr++)
  ------------------
  |  |  521|  1.51M|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
  |  Branch (1515:33): [True: 1.49M, False: 23.3k]
  ------------------
 1516|  1.49M|            {
 1517|  1.49M|                if(NULL != ps_svcd_ctxt->ps_subset_sps[u1_sps_ctr].s_sps_svc_ext.ps_svc_vui_ext)
  ------------------
  |  Branch (1517:20): [True: 491, False: 1.49M]
  ------------------
 1518|    491|                {
 1519|    491|                    PS_DEC_ALIGNED_FREE(
  ------------------
  |  |   43|    491|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|    491|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 491, False: 0]
  |  |  ------------------
  ------------------
 1520|    491|                        ps_dec,
 1521|    491|                        ps_svcd_ctxt->ps_subset_sps[u1_sps_ctr].s_sps_svc_ext.ps_svc_vui_ext);
 1522|    491|                }
 1523|  1.49M|            }
 1524|  23.3k|            PS_DEC_ALIGNED_FREE(ps_dec, ps_svc_lyr_dec->ps_subset_sps);
  ------------------
  |  |   43|  23.3k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  23.3k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 23.3k, False: 0]
  |  |  ------------------
  ------------------
 1525|  23.3k|            PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_pps);
  ------------------
  |  |   43|  23.3k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  23.3k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 23.3k, False: 0]
  |  |  ------------------
  ------------------
 1526|  23.3k|            PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_sei);
  ------------------
  |  |   43|  23.3k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  23.3k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 23.3k, False: 0]
  |  |  ------------------
  ------------------
 1527|  23.3k|            PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_sei_parse);
  ------------------
  |  |   43|  23.3k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  23.3k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 23.3k, False: 0]
  |  |  ------------------
  ------------------
 1528|  23.3k|        }
 1529|       |
 1530|  70.1k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pv_dec_thread_handle);
  ------------------
  |  |   43|  70.1k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  70.1k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 70.1k, False: 0]
  |  |  ------------------
  ------------------
 1531|  70.1k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pv_bs_deblk_thread_handle);
  ------------------
  |  |   43|  70.1k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  70.1k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 70.1k, False: 0]
  |  |  ------------------
  ------------------
 1532|       |
 1533|  70.1k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_dpb_mgr);
  ------------------
  |  |   43|  70.1k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  70.1k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 70.1k, False: 0]
  |  |  ------------------
  ------------------
 1534|  70.1k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_pred);
  ------------------
  |  |   43|  70.1k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  70.1k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 70.1k, False: 0]
  |  |  ------------------
  ------------------
 1535|  70.1k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pv_disp_buf_mgr);
  ------------------
  |  |   43|  70.1k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  70.1k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 70.1k, False: 0]
  |  |  ------------------
  ------------------
 1536|  70.1k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_pic_buf_base);
  ------------------
  |  |   43|  70.1k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  70.1k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 70.1k, False: 0]
  |  |  ------------------
  ------------------
 1537|  70.1k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_dec_err_status);
  ------------------
  |  |   43|  70.1k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  70.1k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 70.1k, False: 0]
  |  |  ------------------
  ------------------
 1538|       |
 1539|  70.1k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_dpb_cmds);
  ------------------
  |  |   43|  70.1k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  70.1k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 70.1k, False: 0]
  |  |  ------------------
  ------------------
 1540|  70.1k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_bitstrm);
  ------------------
  |  |   43|  70.1k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  70.1k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 70.1k, False: 0]
  |  |  ------------------
  ------------------
 1541|  70.1k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_svc_lyr_dec->ps_nal_svc_ext);
  ------------------
  |  |   43|  70.1k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  70.1k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 70.1k, False: 0]
  |  |  ------------------
  ------------------
 1542|  70.1k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_cur_slice);
  ------------------
  |  |   43|  70.1k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  70.1k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 70.1k, False: 0]
  |  |  ------------------
  ------------------
 1543|  70.1k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pv_scratch_sps_pps);
  ------------------
  |  |   43|  70.1k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  70.1k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 70.1k, False: 0]
  |  |  ------------------
  ------------------
 1544|  70.1k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_svc_lyr_dec->pv_scratch_subset_sps);
  ------------------
  |  |   43|  70.1k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  70.1k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 70.1k, False: 0]
  |  |  ------------------
  ------------------
 1545|  70.1k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pu1_bits_buf_static);
  ------------------
  |  |   43|  70.1k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  70.1k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 70.1k, False: 0]
  |  |  ------------------
  ------------------
 1546|  70.1k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ppv_map_ref_idx_to_poc_base);
  ------------------
  |  |   43|  70.1k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  70.1k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 70.1k, False: 0]
  |  |  ------------------
  ------------------
 1547|  70.1k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->p_cabac_ctxt_table_t);
  ------------------
  |  |   43|  70.1k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  70.1k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 70.1k, False: 0]
  |  |  ------------------
  ------------------
 1548|  70.1k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_left_mb_ctxt_info);
  ------------------
  |  |   43|  70.1k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  70.1k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 70.1k, False: 0]
  |  |  ------------------
  ------------------
 1549|  70.1k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pu1_ref_buff_base);
  ------------------
  |  |   43|  70.1k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  70.1k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 70.1k, False: 0]
  |  |  ------------------
  ------------------
 1550|  70.1k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pi2_pred1);
  ------------------
  |  |   43|  70.1k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  70.1k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 70.1k, False: 0]
  |  |  ------------------
  ------------------
 1551|  70.1k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pu1_temp_mc_buffer);
  ------------------
  |  |   43|  70.1k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  70.1k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 70.1k, False: 0]
  |  |  ------------------
  ------------------
 1552|  70.1k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pu1_init_dpb_base);
  ------------------
  |  |   43|  70.1k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  70.1k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 70.1k, False: 0]
  |  |  ------------------
  ------------------
 1553|  70.1k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pu4_mbaff_wt_mat);
  ------------------
  |  |   43|  70.1k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  70.1k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 70.1k, False: 0]
  |  |  ------------------
  ------------------
 1554|  70.1k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pu4_wts_ofsts_mat);
  ------------------
  |  |   43|  70.1k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  70.1k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 70.1k, False: 0]
  |  |  ------------------
  ------------------
 1555|  70.1k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_left_mvpred_addr);
  ------------------
  |  |   43|  70.1k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  70.1k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 70.1k, False: 0]
  |  |  ------------------
  ------------------
 1556|  70.1k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_col_mv_base);
  ------------------
  |  |   43|  70.1k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  70.1k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 70.1k, False: 0]
  |  |  ------------------
  ------------------
 1557|  70.1k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_svc_lyr_dec->pu1_ii_resamp_buffer_luma);
  ------------------
  |  |   43|  70.1k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  70.1k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 70.1k, False: 0]
  |  |  ------------------
  ------------------
 1558|       |
 1559|  70.1k|        if(NULL != ps_dec->pv_pic_buf_mgr)
  ------------------
  |  Branch (1559:12): [True: 70.1k, False: 0]
  ------------------
 1560|  70.1k|        {
 1561|  70.1k|            if(u1_layer_id < ps_svcd_ctxt->u1_prev_num_res_layers)
  ------------------
  |  Branch (1561:16): [True: 38.9k, False: 31.1k]
  ------------------
 1562|  38.9k|            {
 1563|  38.9k|                if(((buf_mgr_t *) ps_dec->pv_pic_buf_mgr)->pv_mutex != NULL)
  ------------------
  |  Branch (1563:20): [True: 24.0k, False: 14.9k]
  ------------------
 1564|  24.0k|                    ih264_buf_mgr_free(ps_dec->pv_pic_buf_mgr);
 1565|  38.9k|            }
 1566|  70.1k|            PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pv_pic_buf_mgr);
  ------------------
  |  |   43|  70.1k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  70.1k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 70.1k, False: 0]
  |  |  ------------------
  ------------------
 1567|  70.1k|        }
 1568|  70.1k|        if(NULL != ps_dec->pv_mv_buf_mgr)
  ------------------
  |  Branch (1568:12): [True: 70.1k, False: 0]
  ------------------
 1569|  70.1k|        {
 1570|  70.1k|            if(u1_layer_id < ps_svcd_ctxt->u1_prev_num_res_layers)
  ------------------
  |  Branch (1570:16): [True: 38.9k, False: 31.1k]
  ------------------
 1571|  38.9k|            {
 1572|  38.9k|                if(((buf_mgr_t *) ps_dec->pv_mv_buf_mgr)->pv_mutex != NULL)
  ------------------
  |  Branch (1572:20): [True: 24.0k, False: 14.9k]
  ------------------
 1573|  24.0k|                    ih264_buf_mgr_free(ps_dec->pv_mv_buf_mgr);
 1574|  38.9k|            }
 1575|  70.1k|            PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pv_mv_buf_mgr);
  ------------------
  |  |   43|  70.1k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  70.1k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 70.1k, False: 0]
  |  |  ------------------
  ------------------
 1576|  70.1k|        }
 1577|  70.1k|    }
 1578|       |
 1579|  23.3k|    pf_aligned_free(pv_mem_ctxt, ps_svcd_ctxt->ps_svc_dec_lyr);
 1580|  23.3k|    pf_aligned_free(pv_mem_ctxt, dec_hdl->pv_codec_handle);
 1581|       |
 1582|  23.3k|    if(dec_hdl)
  ------------------
  |  Branch (1582:8): [True: 23.3k, False: 0]
  ------------------
 1583|  23.3k|    {
 1584|  23.3k|        pf_aligned_free(pv_mem_ctxt, dec_hdl);
 1585|  23.3k|    }
 1586|       |
 1587|  23.3k|    return IV_SUCCESS;
 1588|  23.3k|}
isvcd_nal_parse_ctxt_create:
 1614|  23.3k|{
 1615|  23.3k|    isvcd_create_ip_t *ps_create_ip;
 1616|  23.3k|    void *pv_buf;
 1617|  23.3k|    void *(*pf_aligned_alloc)(void *pv_mem_ctxt, WORD32 alignment, WORD32 size);
 1618|  23.3k|    void *pv_mem_ctxt;
 1619|  23.3k|    WORD32 size;
 1620|  23.3k|    nal_parse_ctxt_t *ps_nal_parse_ctxt;
 1621|  23.3k|    UWORD8 *pu1_ptr;
 1622|  23.3k|    UNUSED(pv_api_op);
  ------------------
  |  |   45|  23.3k|#define UNUSED(x) ((void)(x))
  ------------------
 1623|       |
 1624|  23.3k|    ps_create_ip = (isvcd_create_ip_t *) pv_api_ip;
 1625|       |
 1626|  23.3k|    pf_aligned_alloc = ps_create_ip->s_ivd_create_ip_t.pf_aligned_alloc;
 1627|  23.3k|    pv_mem_ctxt = ps_create_ip->s_ivd_create_ip_t.pv_mem_ctxt;
 1628|       |
 1629|       |    /*-----------------------------------------------------------------------*/
 1630|       |    /* Handle                                                                */
 1631|       |    /*-----------------------------------------------------------------------*/
 1632|  23.3k|    size = sizeof(nal_parse_ctxt_t);
 1633|  23.3k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1634|  23.3k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.3k]
  |  |  ------------------
  ------------------
 1635|  23.3k|    memset(pv_buf, 0, size);
 1636|  23.3k|    ps_nal_parse_ctxt = pv_buf;
 1637|       |
 1638|       |    /* set the lowest dqid to -1 */
 1639|  23.3k|    ps_nal_parse_ctxt->i4_prev_dq_id = -1;
 1640|       |
 1641|       |    /*-----------------------------------------------------------------------*/
 1642|       |    /* DQID list buffer and initialization of vcl node buffer context        */
 1643|       |    /*-----------------------------------------------------------------------*/
 1644|  23.3k|    {
 1645|  23.3k|        WORD32 i4_lyr_idx;
 1646|  23.3k|        WORD32 i4_max_num_lyrs;
 1647|  23.3k|        vcl_node_t *ps_vcl_node;
 1648|  23.3k|        dqid_node_t *ps_dqid_node;
 1649|  23.3k|        dqid_ctxt_t *ps_dqid_ctxt;
 1650|       |
 1651|  23.3k|        size = sizeof(vcl_node_t);
 1652|  23.3k|        size += sizeof(dqid_node_t);
 1653|  23.3k|        size *= MAX_NUM_RES_LYRS;
  ------------------
  |  |   94|  23.3k|#define MAX_NUM_RES_LYRS 3
  ------------------
 1654|       |
 1655|  23.3k|        ps_dqid_ctxt = &ps_nal_parse_ctxt->s_dqid_ctxt;
 1656|       |
 1657|  23.3k|        ps_dqid_ctxt->i4_max_num_lyrs = MAX_NUM_RES_LYRS;
  ------------------
  |  |   94|  23.3k|#define MAX_NUM_RES_LYRS 3
  ------------------
 1658|       |
 1659|  23.3k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1660|  23.3k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.3k]
  |  |  ------------------
  ------------------
 1661|  23.3k|        memset(pv_buf, 0, size);
 1662|       |
 1663|  23.3k|        ps_dqid_ctxt->ps_dqid_node = pv_buf;
 1664|  23.3k|        ps_dqid_node = ps_dqid_ctxt->ps_dqid_node;
 1665|       |
 1666|  23.3k|        i4_max_num_lyrs = ps_dqid_ctxt->i4_max_num_lyrs;
 1667|       |
 1668|  23.3k|        pu1_ptr = pv_buf;
 1669|  23.3k|        pu1_ptr += sizeof(dqid_node_t) * i4_max_num_lyrs;
 1670|  23.3k|        ps_vcl_node = (vcl_node_t *) pu1_ptr;
 1671|       |
 1672|  93.4k|        for(i4_lyr_idx = 0; i4_lyr_idx < i4_max_num_lyrs; i4_lyr_idx++)
  ------------------
  |  Branch (1672:29): [True: 70.1k, False: 23.3k]
  ------------------
 1673|  70.1k|        {
 1674|  70.1k|            ps_dqid_node->ps_vcl_node = ps_vcl_node;
 1675|       |
 1676|       |            /* Loop updates */
 1677|  70.1k|            ps_vcl_node += 1;
 1678|  70.1k|            ps_dqid_node += 1;
 1679|  70.1k|        } /* Loop over all the layers */
 1680|  23.3k|    }
 1681|       |
 1682|       |    /*-----------------------------------------------------------------------*/
 1683|       |    /* Common memory                                                         */
 1684|       |    /*-----------------------------------------------------------------------*/
 1685|  23.3k|    size = UP_ALIGN_8(HEADER_BUFFER_LEN_BEFORE_EP);
  ------------------
  |  |   51|  23.3k|#define UP_ALIGN_8(x) (((((UWORD64) x) + 7) >> 3) << 3)
  ------------------
 1686|  23.3k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1687|  23.3k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.3k]
  |  |  ------------------
  ------------------
 1688|  23.3k|    memset(pv_buf, 0, size);
 1689|  23.3k|    ps_nal_parse_ctxt->pv_nal_header_buf = (void *) pv_buf;
 1690|       |
 1691|       |    /*-----------------------------------------------------------------------*/
 1692|       |    /* Layer params memory                                                   */
 1693|       |    /*-----------------------------------------------------------------------*/
 1694|  23.3k|    size = sizeof(nal_unit_t);
 1695|  23.3k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1696|  23.3k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.3k]
  |  |  ------------------
  ------------------
 1697|  23.3k|    memset(pv_buf, 0, size);
 1698|  23.3k|    ps_nal_parse_ctxt->pv_nal_unit = pv_buf;
 1699|       |
 1700|  23.3k|    size = MAX_VCL_NAL_BUFF_SIZE * sizeof(UWORD8);
  ------------------
  |  |   69|  23.3k|#define MAX_VCL_NAL_BUFF_SIZE (1024 * 1024 * 2)
  ------------------
 1701|  23.3k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1702|  23.3k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.3k]
  |  |  ------------------
  ------------------
 1703|  23.3k|    memset(pv_buf, 0, size);
 1704|  23.3k|    ps_svcd_ctxt->pv_vcl_nal_buff = pv_buf;
 1705|       |
 1706|  23.3k|    size = MAX_NON_VCL_NAL_BUFF_SIZE * sizeof(UWORD8);
  ------------------
  |  |   70|  23.3k|#define MAX_NON_VCL_NAL_BUFF_SIZE (1024 * 1024 * 2)
  ------------------
 1707|  23.3k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1708|  23.3k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.3k]
  |  |  ------------------
  ------------------
 1709|  23.3k|    memset(pv_buf, 0, size);
 1710|  23.3k|    ps_svcd_ctxt->pv_non_vcl_nal_buff = pv_buf;
 1711|       |
 1712|       |    /*-----------------------------------------------------------------------*/
 1713|       |    /* Registering the seq and pic prms buffer pointers                      */
 1714|       |    /*-----------------------------------------------------------------------*/
 1715|  23.3k|    if(NULL == ps_svcd_ctxt->ps_sps || NULL == ps_svcd_ctxt->ps_pps)
  ------------------
  |  Branch (1715:8): [True: 0, False: 23.3k]
  |  Branch (1715:40): [True: 0, False: 23.3k]
  ------------------
 1716|      0|    {
 1717|      0|        return IV_FAIL;
 1718|      0|    }
 1719|       |
 1720|  23.3k|    ps_svcd_ctxt->pv_nal_parse_ctxt = ps_nal_parse_ctxt;
 1721|  23.3k|    ps_nal_parse_ctxt->pv_seq_prms = ps_svcd_ctxt->ps_sps;
 1722|  23.3k|    ps_nal_parse_ctxt->pv_pic_prms = ps_svcd_ctxt->ps_pps;
 1723|       |
 1724|       |    /* register VCL and NON VCL buffer pointers */
 1725|  23.3k|    if(NULL == ps_svcd_ctxt->pv_vcl_nal_buff || NULL == ps_svcd_ctxt->pv_non_vcl_nal_buff)
  ------------------
  |  Branch (1725:8): [True: 0, False: 23.3k]
  |  Branch (1725:49): [True: 0, False: 23.3k]
  ------------------
 1726|      0|    {
 1727|      0|        return IV_FAIL;
 1728|      0|    }
 1729|       |
 1730|  23.3k|    ps_nal_parse_ctxt->pv_vcl_nal_buf = (UWORD8 *) ps_svcd_ctxt->pv_vcl_nal_buff;
 1731|  23.3k|    ps_nal_parse_ctxt->pv_non_vcl_nal_buf = (UWORD8 *) ps_svcd_ctxt->pv_non_vcl_nal_buff;
 1732|  23.3k|    isvcd_nal_parse_reset_ctxt(ANNEX_B, PARTIAL_INPUT_MODE, ps_nal_parse_ctxt);
  ------------------
  |  |   64|  23.3k|#define ANNEX_B 0     /*!< Annex B stream*/
  ------------------
 1733|       |
 1734|  23.3k|    return IV_SUCCESS;
 1735|  23.3k|}
isvcd_intra_resample_ctxt_create:
 1759|  23.3k|{
 1760|  23.3k|    isvcd_create_ip_t *ps_create_ip;
 1761|  23.3k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 1762|  23.3k|    void *pv_buf;
 1763|  23.3k|    UWORD8 u1_layer_id;
 1764|  23.3k|    void *(*pf_aligned_alloc)(void *pv_mem_ctxt, WORD32 alignment, WORD32 size);
 1765|  23.3k|    void *pv_mem_ctxt;
 1766|  23.3k|    WORD32 size;
 1767|  23.3k|    intra_inter_pred_ctxt_t *ps_ii_pred_ctxt;
 1768|       |
 1769|  23.3k|    intra_sampling_ctxt_t *ps_ctxt;
 1770|  23.3k|    UNUSED(pv_api_op);
  ------------------
  |  |   45|  23.3k|#define UNUSED(x) ((void)(x))
  ------------------
 1771|  23.3k|    ps_create_ip = (isvcd_create_ip_t *) pv_api_ip;
 1772|       |
 1773|  23.3k|    pf_aligned_alloc = ps_create_ip->s_ivd_create_ip_t.pf_aligned_alloc;
 1774|  23.3k|    pv_mem_ctxt = ps_create_ip->s_ivd_create_ip_t.pv_mem_ctxt;
 1775|       |
 1776|  23.3k|    {
 1777|  23.3k|        intra_samp_lyr_ctxt *ps_lyr_ctxt;
 1778|       |
 1779|       |        /* allocate context structure */
 1780|  23.3k|        size = ((sizeof(intra_sampling_ctxt_t) + 127) >> 7) << 7;
 1781|  23.3k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1782|  23.3k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.3k]
  |  |  ------------------
  ------------------
 1783|  23.3k|        memset(pv_buf, 0, size);
 1784|  23.3k|        ps_ctxt = pv_buf;
 1785|       |
 1786|       |        /* luma reference array buffer  */
 1787|  23.3k|        size = REF_ARRAY_WIDTH * REF_ARRAY_HEIGHT * sizeof(UWORD8);
  ------------------
  |  |   73|  23.3k|#define REF_ARRAY_WIDTH 48
  ------------------
                      size = REF_ARRAY_WIDTH * REF_ARRAY_HEIGHT * sizeof(UWORD8);
  ------------------
  |  |   74|  23.3k|#define REF_ARRAY_HEIGHT 48
  ------------------
 1788|  23.3k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1789|  23.3k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.3k]
  |  |  ------------------
  ------------------
 1790|  23.3k|        memset(pv_buf, 0, size);
 1791|  23.3k|        ps_ctxt->pu1_refarray_buffer = pv_buf;
 1792|       |
 1793|       |        /* cb reference array buffer */
 1794|  23.3k|        size = REF_ARRAY_WIDTH * REF_ARRAY_HEIGHT * sizeof(UWORD8);
  ------------------
  |  |   73|  23.3k|#define REF_ARRAY_WIDTH 48
  ------------------
                      size = REF_ARRAY_WIDTH * REF_ARRAY_HEIGHT * sizeof(UWORD8);
  ------------------
  |  |   74|  23.3k|#define REF_ARRAY_HEIGHT 48
  ------------------
 1795|  23.3k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1796|  23.3k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.3k]
  |  |  ------------------
  ------------------
 1797|  23.3k|        memset(pv_buf, 0, size);
 1798|  23.3k|        ps_ctxt->pu1_refarray_cb = pv_buf;
 1799|       |
 1800|       |        /* cr reference array buffer */
 1801|  23.3k|        size = ((DYADIC_REF_W_C + 2) * (DYADIC_REF_H_C + 2) * sizeof(UWORD8));
  ------------------
  |  |   58|  23.3k|#define DYADIC_REF_W_C 10
  ------------------
                      size = ((DYADIC_REF_W_C + 2) * (DYADIC_REF_H_C + 2) * sizeof(UWORD8));
  ------------------
  |  |   59|  23.3k|#define DYADIC_REF_H_C 10
  ------------------
 1802|  23.3k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1803|  23.3k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.3k]
  |  |  ------------------
  ------------------
 1804|  23.3k|        memset(pv_buf, 0, size);
 1805|  23.3k|        ps_ctxt->pu1_refarray_cr = pv_buf;
 1806|       |
 1807|       |        /* Temp Intermediate Buffer */
 1808|  23.3k|        size = INTERMEDIATE_BUFF_WIDTH * INTERMEDIATE_BUFF_HEIGHT * sizeof(WORD32);
  ------------------
  |  |   50|  23.3k|#define INTERMEDIATE_BUFF_WIDTH 48
  ------------------
                      size = INTERMEDIATE_BUFF_WIDTH * INTERMEDIATE_BUFF_HEIGHT * sizeof(WORD32);
  ------------------
  |  |   51|  23.3k|#define INTERMEDIATE_BUFF_HEIGHT (MB_HEIGHT + 4)
  |  |  ------------------
  |  |  |  |   68|  23.3k|#define MB_HEIGHT 16
  |  |  ------------------
  ------------------
 1809|  23.3k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1810|  23.3k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.3k]
  |  |  ------------------
  ------------------
 1811|  23.3k|        memset(pv_buf, 0, size);
 1812|  23.3k|        ps_ctxt->pi4_temp_interpolation_buffer = pv_buf;
 1813|       |
 1814|       |        /****************** projected locations buffers ******************/
 1815|  23.3k|        {
 1816|  23.3k|            intra_samp_map_ctxt_t *ps_luma_map;
 1817|  23.3k|            intra_samp_map_ctxt_t *ps_chroma_map;
 1818|  23.3k|            WORD32 i4_lyr_id;
 1819|  23.3k|            ref_mb_map_t *ps_off_len_map;
 1820|  23.3k|            ref_pixel_map_t *ps_pos_phase_map;
 1821|  23.3k|            ref_min_max_map_t *ps_min_max;
 1822|  23.3k|            WORD16 *pi2_mem;
 1823|  23.3k|            UWORD8 *pu1_mem;
 1824|  23.3k|            seg_lookup_desc_t *ps_seg_lookup;
 1825|       |
 1826|       |            /****************** Horz offset length ******************/
 1827|       |
 1828|  23.3k|            size = (H264_MAX_FRAME_WIDTH >> 4) * MAX_NUM_RES_LYRS * 2 * sizeof(ref_mb_map_t);
  ------------------
  |  |   39|  23.3k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
                          size = (H264_MAX_FRAME_WIDTH >> 4) * MAX_NUM_RES_LYRS * 2 * sizeof(ref_mb_map_t);
  ------------------
  |  |   94|  23.3k|#define MAX_NUM_RES_LYRS 3
  ------------------
 1829|  23.3k|            pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1830|  23.3k|            RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.3k]
  |  |  ------------------
  ------------------
 1831|  23.3k|            memset(pv_buf, 0, size);
 1832|  23.3k|            ps_off_len_map = pv_buf;
 1833|       |
 1834|       |            /* loop over num layers -1 */
 1835|  93.4k|            for(i4_lyr_id = 0; i4_lyr_id < MAX_NUM_RES_LYRS; i4_lyr_id++)
  ------------------
  |  |   94|  93.4k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (1835:32): [True: 70.1k, False: 23.3k]
  ------------------
 1836|  70.1k|            {
 1837|       |                /* derive the layer map ctxt */
 1838|  70.1k|                ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[i4_lyr_id];
 1839|  70.1k|                ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 1840|  70.1k|                ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 1841|       |
 1842|       |                /* initialise the pointers */
 1843|  70.1k|                ps_luma_map->ps_x_offset_length = ps_off_len_map;
 1844|  70.1k|                ps_off_len_map += (H264_MAX_FRAME_WIDTH >> 4);
  ------------------
  |  |   39|  70.1k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
 1845|  70.1k|                ps_chroma_map->ps_x_offset_length = ps_off_len_map;
 1846|  70.1k|                ps_off_len_map += (H264_MAX_FRAME_WIDTH >> 4);
  ------------------
  |  |   39|  70.1k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
 1847|       |
 1848|  70.1k|            } /* end of loop over resolution layers */
 1849|       |
 1850|       |            /****************** Vert offset length ******************/
 1851|  23.3k|            size = (H264_MAX_FRAME_HEIGHT >> 4) * MAX_NUM_RES_LYRS * 2 * sizeof(ref_mb_map_t);
  ------------------
  |  |   40|  23.3k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
                          size = (H264_MAX_FRAME_HEIGHT >> 4) * MAX_NUM_RES_LYRS * 2 * sizeof(ref_mb_map_t);
  ------------------
  |  |   94|  23.3k|#define MAX_NUM_RES_LYRS 3
  ------------------
 1852|  23.3k|            pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1853|  23.3k|            RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.3k]
  |  |  ------------------
  ------------------
 1854|  23.3k|            memset(pv_buf, 0, size);
 1855|  23.3k|            ps_off_len_map = pv_buf;
 1856|       |
 1857|       |            /* loop over num layers -1 */
 1858|  93.4k|            for(i4_lyr_id = 0; i4_lyr_id < MAX_NUM_RES_LYRS; i4_lyr_id++)
  ------------------
  |  |   94|  93.4k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (1858:32): [True: 70.1k, False: 23.3k]
  ------------------
 1859|  70.1k|            {
 1860|       |                /* derive the layer map ctxt */
 1861|  70.1k|                ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[i4_lyr_id];
 1862|  70.1k|                ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 1863|  70.1k|                ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 1864|       |
 1865|       |                /* initialise the pointers */
 1866|  70.1k|                ps_luma_map->ps_y_offset_length = ps_off_len_map;
 1867|  70.1k|                ps_off_len_map += (H264_MAX_FRAME_HEIGHT >> 4);
  ------------------
  |  |   40|  70.1k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
 1868|  70.1k|                ps_chroma_map->ps_y_offset_length = ps_off_len_map;
 1869|  70.1k|                ps_off_len_map += (H264_MAX_FRAME_HEIGHT >> 4);
  ------------------
  |  |   40|  70.1k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
 1870|       |
 1871|  70.1k|            } /* end of loop over resolution layers */
 1872|       |
 1873|       |            /****************** Horz Min Max Pos ******************/
 1874|       |
 1875|  23.3k|            size = (H264_MAX_FRAME_WIDTH >> 4) * MAX_NUM_RES_LYRS * 2 * sizeof(ref_mb_map_t);
  ------------------
  |  |   39|  23.3k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
                          size = (H264_MAX_FRAME_WIDTH >> 4) * MAX_NUM_RES_LYRS * 2 * sizeof(ref_mb_map_t);
  ------------------
  |  |   94|  23.3k|#define MAX_NUM_RES_LYRS 3
  ------------------
 1876|  23.3k|            pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1877|  23.3k|            RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.3k]
  |  |  ------------------
  ------------------
 1878|  23.3k|            memset(pv_buf, 0, size);
 1879|  23.3k|            ps_min_max = pv_buf;
 1880|       |
 1881|       |            /* loop over num layers -1 */
 1882|  93.4k|            for(i4_lyr_id = 0; i4_lyr_id < MAX_NUM_RES_LYRS; i4_lyr_id++)
  ------------------
  |  |   94|  93.4k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (1882:32): [True: 70.1k, False: 23.3k]
  ------------------
 1883|  70.1k|            {
 1884|       |                /* derive the layer map ctxt */
 1885|  70.1k|                ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[i4_lyr_id];
 1886|  70.1k|                ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 1887|  70.1k|                ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 1888|       |
 1889|       |                /* initialise the pointers */
 1890|  70.1k|                ps_luma_map->ps_x_min_max = ps_min_max;
 1891|  70.1k|                ps_min_max += (H264_MAX_FRAME_WIDTH >> 4);
  ------------------
  |  |   39|  70.1k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
 1892|  70.1k|                ps_chroma_map->ps_x_min_max = ps_min_max;
 1893|  70.1k|                ps_min_max += (H264_MAX_FRAME_WIDTH >> 4);
  ------------------
  |  |   39|  70.1k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
 1894|  70.1k|            } /* end of loop over resolution layers */
 1895|       |
 1896|       |            /****************** Vert Min Max Pos ******************/
 1897|  23.3k|            size = (H264_MAX_FRAME_HEIGHT >> 4) * MAX_NUM_RES_LYRS * 2 * sizeof(ref_mb_map_t);
  ------------------
  |  |   40|  23.3k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
                          size = (H264_MAX_FRAME_HEIGHT >> 4) * MAX_NUM_RES_LYRS * 2 * sizeof(ref_mb_map_t);
  ------------------
  |  |   94|  23.3k|#define MAX_NUM_RES_LYRS 3
  ------------------
 1898|       |
 1899|  23.3k|            pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1900|  23.3k|            RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.3k]
  |  |  ------------------
  ------------------
 1901|  23.3k|            memset(pv_buf, 0, size);
 1902|  23.3k|            ps_min_max = pv_buf;
 1903|       |
 1904|       |            /* loop over num layers -1 */
 1905|  93.4k|            for(i4_lyr_id = 0; i4_lyr_id < MAX_NUM_RES_LYRS; i4_lyr_id++)
  ------------------
  |  |   94|  93.4k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (1905:32): [True: 70.1k, False: 23.3k]
  ------------------
 1906|  70.1k|            {
 1907|       |                /* derive the layer map ctxt */
 1908|  70.1k|                ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[i4_lyr_id];
 1909|  70.1k|                ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 1910|  70.1k|                ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 1911|       |
 1912|       |                /* initialise the pointers */
 1913|  70.1k|                ps_luma_map->ps_y_min_max = ps_min_max;
 1914|  70.1k|                ps_min_max += (H264_MAX_FRAME_HEIGHT >> 4);
  ------------------
  |  |   40|  70.1k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
 1915|  70.1k|                ps_chroma_map->ps_y_min_max = ps_min_max;
 1916|  70.1k|                ps_min_max += (H264_MAX_FRAME_HEIGHT >> 4);
  ------------------
  |  |   40|  70.1k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
 1917|       |
 1918|  70.1k|            } /* end of loop over resolution layers */
 1919|       |
 1920|       |            /****************** Horz position phase ******************/
 1921|  23.3k|            size = (H264_MAX_FRAME_WIDTH) *MAX_NUM_RES_LYRS * 2 * sizeof(ref_pixel_map_t);
  ------------------
  |  |   39|  23.3k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
                          size = (H264_MAX_FRAME_WIDTH) *MAX_NUM_RES_LYRS * 2 * sizeof(ref_pixel_map_t);
  ------------------
  |  |   94|  23.3k|#define MAX_NUM_RES_LYRS 3
  ------------------
 1922|  23.3k|            pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1923|  23.3k|            RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.3k]
  |  |  ------------------
  ------------------
 1924|  23.3k|            memset(pv_buf, 0, size);
 1925|  23.3k|            ps_pos_phase_map = pv_buf;
 1926|       |
 1927|       |            /* loop over num layers -1 */
 1928|  93.4k|            for(i4_lyr_id = 0; i4_lyr_id < MAX_NUM_RES_LYRS; i4_lyr_id++)
  ------------------
  |  |   94|  93.4k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (1928:32): [True: 70.1k, False: 23.3k]
  ------------------
 1929|  70.1k|            {
 1930|       |                /* derive the layer map ctxt */
 1931|  70.1k|                ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[i4_lyr_id];
 1932|  70.1k|                ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 1933|  70.1k|                ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 1934|       |
 1935|       |                /* initialise the pointers */
 1936|  70.1k|                ps_luma_map->ps_x_pos_phase = ps_pos_phase_map;
 1937|  70.1k|                ps_pos_phase_map += (H264_MAX_FRAME_WIDTH);
  ------------------
  |  |   39|  70.1k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
 1938|  70.1k|                ps_chroma_map->ps_x_pos_phase = ps_pos_phase_map;
 1939|  70.1k|                ps_pos_phase_map += (H264_MAX_FRAME_WIDTH);
  ------------------
  |  |   39|  70.1k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
 1940|       |
 1941|  70.1k|            } /* end of loop over resolution layers */
 1942|       |
 1943|       |            /****************** Vert position phase ******************/
 1944|       |
 1945|  23.3k|            size = (H264_MAX_FRAME_HEIGHT) *MAX_NUM_RES_LYRS * 2 * sizeof(ref_pixel_map_t);
  ------------------
  |  |   40|  23.3k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
                          size = (H264_MAX_FRAME_HEIGHT) *MAX_NUM_RES_LYRS * 2 * sizeof(ref_pixel_map_t);
  ------------------
  |  |   94|  23.3k|#define MAX_NUM_RES_LYRS 3
  ------------------
 1946|  23.3k|            pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1947|  23.3k|            RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.3k]
  |  |  ------------------
  ------------------
 1948|  23.3k|            memset(pv_buf, 0, size);
 1949|  23.3k|            ps_pos_phase_map = pv_buf;
 1950|       |
 1951|       |            /* loop over num layers -1 */
 1952|  93.4k|            for(i4_lyr_id = 0; i4_lyr_id < MAX_NUM_RES_LYRS; i4_lyr_id++)
  ------------------
  |  |   94|  93.4k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (1952:32): [True: 70.1k, False: 23.3k]
  ------------------
 1953|  70.1k|            {
 1954|       |                /* derive the layer map ctxt */
 1955|  70.1k|                ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[i4_lyr_id];
 1956|  70.1k|                ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 1957|  70.1k|                ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 1958|       |
 1959|       |                /* initialise the pointers */
 1960|  70.1k|                ps_luma_map->ps_y_pos_phase = ps_pos_phase_map;
 1961|  70.1k|                ps_pos_phase_map += (H264_MAX_FRAME_HEIGHT);
  ------------------
  |  |   40|  70.1k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
 1962|  70.1k|                ps_chroma_map->ps_y_pos_phase = ps_pos_phase_map;
 1963|  70.1k|                ps_pos_phase_map += (H264_MAX_FRAME_HEIGHT);
  ------------------
  |  |   40|  70.1k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
 1964|       |
 1965|  70.1k|            } /* end of loop over resolution layers */
 1966|       |
 1967|       |            /**************** XD Index ******************************/
 1968|  23.3k|            size = (MB_WIDTH) *MAX_NUM_RES_LYRS * 2 * sizeof(WORD16);
  ------------------
  |  |   67|  23.3k|#define MB_WIDTH 16
  ------------------
                          size = (MB_WIDTH) *MAX_NUM_RES_LYRS * 2 * sizeof(WORD16);
  ------------------
  |  |   94|  23.3k|#define MAX_NUM_RES_LYRS 3
  ------------------
 1969|  23.3k|            pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1970|  23.3k|            RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.3k]
  |  |  ------------------
  ------------------
 1971|  23.3k|            memset(pv_buf, 0, size);
 1972|  23.3k|            pi2_mem = pv_buf;
 1973|       |
 1974|       |            /* loop over num layers -1 */
 1975|  93.4k|            for(i4_lyr_id = 0; i4_lyr_id < MAX_NUM_RES_LYRS; i4_lyr_id++)
  ------------------
  |  |   94|  93.4k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (1975:32): [True: 70.1k, False: 23.3k]
  ------------------
 1976|  70.1k|            {
 1977|       |                /* derive the layer map ctxt */
 1978|  70.1k|                ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[i4_lyr_id];
 1979|  70.1k|                ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 1980|  70.1k|                ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 1981|       |
 1982|       |                /* initialise the pointers */
 1983|  70.1k|                ps_luma_map->pi2_xd_index = pi2_mem;
 1984|  70.1k|                pi2_mem += MB_WIDTH;
  ------------------
  |  |   67|  70.1k|#define MB_WIDTH 16
  ------------------
 1985|  70.1k|                ps_chroma_map->pi2_xd_index = pi2_mem;
 1986|  70.1k|                pi2_mem += MB_WIDTH;
  ------------------
  |  |   67|  70.1k|#define MB_WIDTH 16
  ------------------
 1987|       |
 1988|  70.1k|            } /* end of loop over resolution layers */
 1989|       |
 1990|       |            /**************** YD Index ******************************/
 1991|  23.3k|            size = (MB_HEIGHT) *MAX_NUM_RES_LYRS * 2 * sizeof(WORD16);
  ------------------
  |  |   68|  23.3k|#define MB_HEIGHT 16
  ------------------
                          size = (MB_HEIGHT) *MAX_NUM_RES_LYRS * 2 * sizeof(WORD16);
  ------------------
  |  |   94|  23.3k|#define MAX_NUM_RES_LYRS 3
  ------------------
 1992|  23.3k|            pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1993|  23.3k|            RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.3k]
  |  |  ------------------
  ------------------
 1994|  23.3k|            memset(pv_buf, 0, size);
 1995|  23.3k|            pi2_mem = pv_buf;
 1996|       |
 1997|       |            /* loop over num layers -1 */
 1998|  93.4k|            for(i4_lyr_id = 0; i4_lyr_id < MAX_NUM_RES_LYRS; i4_lyr_id++)
  ------------------
  |  |   94|  93.4k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (1998:32): [True: 70.1k, False: 23.3k]
  ------------------
 1999|  70.1k|            {
 2000|       |                /* derive the layer map ctxt */
 2001|  70.1k|                ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[i4_lyr_id];
 2002|  70.1k|                ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 2003|  70.1k|                ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 2004|       |
 2005|       |                /* initialise the pointers */
 2006|  70.1k|                ps_luma_map->pi2_yd_index = pi2_mem;
 2007|  70.1k|                pi2_mem += MB_HEIGHT;
  ------------------
  |  |   68|  70.1k|#define MB_HEIGHT 16
  ------------------
 2008|  70.1k|                ps_chroma_map->pi2_yd_index = pi2_mem;
 2009|  70.1k|                pi2_mem += MB_HEIGHT;
  ------------------
  |  |   68|  70.1k|#define MB_HEIGHT 16
  ------------------
 2010|       |
 2011|  70.1k|            } /* end of loop over resolution layers */
 2012|       |
 2013|       |            /**************** YA Index ******************************/
 2014|  23.3k|            size = MB_HEIGHT * MAX_NUM_RES_LYRS * 2 * sizeof(WORD16);
  ------------------
  |  |   68|  23.3k|#define MB_HEIGHT 16
  ------------------
                          size = MB_HEIGHT * MAX_NUM_RES_LYRS * 2 * sizeof(WORD16);
  ------------------
  |  |   94|  23.3k|#define MAX_NUM_RES_LYRS 3
  ------------------
 2015|  23.3k|            pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2016|  23.3k|            RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.3k]
  |  |  ------------------
  ------------------
 2017|  23.3k|            memset(pv_buf, 0, size);
 2018|  23.3k|            pi2_mem = pv_buf;
 2019|       |
 2020|       |            /* loop over num layers -1 */
 2021|  93.4k|            for(i4_lyr_id = 0; i4_lyr_id < MAX_NUM_RES_LYRS; i4_lyr_id++)
  ------------------
  |  |   94|  93.4k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (2021:32): [True: 70.1k, False: 23.3k]
  ------------------
 2022|  70.1k|            {
 2023|       |                /* derive the layer map ctxt */
 2024|  70.1k|                ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[i4_lyr_id];
 2025|  70.1k|                ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 2026|  70.1k|                ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 2027|       |
 2028|       |                /* initialise the pointers */
 2029|  70.1k|                ps_luma_map->pi2_ya_index = pi2_mem;
 2030|  70.1k|                pi2_mem += MB_HEIGHT;
  ------------------
  |  |   68|  70.1k|#define MB_HEIGHT 16
  ------------------
 2031|  70.1k|                ps_chroma_map->pi2_ya_index = pi2_mem;
 2032|  70.1k|                pi2_mem += MB_HEIGHT;
  ------------------
  |  |   68|  70.1k|#define MB_HEIGHT 16
  ------------------
 2033|       |
 2034|  70.1k|            } /* 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|  23.3k|            size = (MB_WIDTH * sizeof(seg_lookup_desc_t)) * MAX_NUM_RES_LYRS;
  ------------------
  |  |   67|  23.3k|#define MB_WIDTH 16
  ------------------
                          size = (MB_WIDTH * sizeof(seg_lookup_desc_t)) * MAX_NUM_RES_LYRS;
  ------------------
  |  |   94|  23.3k|#define MAX_NUM_RES_LYRS 3
  ------------------
 2040|       |
 2041|  23.3k|            size += (BLOCK_WIDTH * sizeof(seg_lookup_desc_t)) * MAX_NUM_RES_LYRS;
  ------------------
  |  |   64|  23.3k|#define BLOCK_WIDTH 8
  ------------------
                          size += (BLOCK_WIDTH * sizeof(seg_lookup_desc_t)) * MAX_NUM_RES_LYRS;
  ------------------
  |  |   94|  23.3k|#define MAX_NUM_RES_LYRS 3
  ------------------
 2042|       |
 2043|  23.3k|            pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2044|  23.3k|            RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.3k]
  |  |  ------------------
  ------------------
 2045|  23.3k|            memset(pv_buf, 0, size);
 2046|  23.3k|            ps_seg_lookup = pv_buf;
 2047|       |
 2048|       |            /* loop over num layers -1 */
 2049|  93.4k|            for(i4_lyr_id = 0; i4_lyr_id < MAX_NUM_RES_LYRS; i4_lyr_id++)
  ------------------
  |  |   94|  93.4k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (2049:32): [True: 70.1k, False: 23.3k]
  ------------------
 2050|  70.1k|            {
 2051|       |                /* derive the layer map ctxt */
 2052|  70.1k|                ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[i4_lyr_id];
 2053|  70.1k|                ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 2054|  70.1k|                ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 2055|       |
 2056|       |                /* initialise the pointers */
 2057|  70.1k|                ps_luma_map->ps_seg_lookup_horz = ps_seg_lookup;
 2058|  70.1k|                ps_seg_lookup += MB_WIDTH;
  ------------------
  |  |   67|  70.1k|#define MB_WIDTH 16
  ------------------
 2059|  70.1k|                ps_chroma_map->ps_seg_lookup_horz = ps_seg_lookup;
 2060|  70.1k|                ps_seg_lookup += BLOCK_WIDTH;
  ------------------
  |  |   64|  70.1k|#define BLOCK_WIDTH 8
  ------------------
 2061|       |
 2062|  70.1k|            } /* 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|  23.3k|            size = (MB_HEIGHT * sizeof(seg_lookup_desc_t)) * MAX_NUM_RES_LYRS;
  ------------------
  |  |   68|  23.3k|#define MB_HEIGHT 16
  ------------------
                          size = (MB_HEIGHT * sizeof(seg_lookup_desc_t)) * MAX_NUM_RES_LYRS;
  ------------------
  |  |   94|  23.3k|#define MAX_NUM_RES_LYRS 3
  ------------------
 2068|       |
 2069|  23.3k|            size += (BLOCK_HEIGHT * sizeof(seg_lookup_desc_t)) * MAX_NUM_RES_LYRS;
  ------------------
  |  |   65|  23.3k|#define BLOCK_HEIGHT 8
  ------------------
                          size += (BLOCK_HEIGHT * sizeof(seg_lookup_desc_t)) * MAX_NUM_RES_LYRS;
  ------------------
  |  |   94|  23.3k|#define MAX_NUM_RES_LYRS 3
  ------------------
 2070|       |
 2071|  23.3k|            pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2072|  23.3k|            RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.3k]
  |  |  ------------------
  ------------------
 2073|  23.3k|            memset(pv_buf, 0, size);
 2074|  23.3k|            ps_seg_lookup = pv_buf;
 2075|       |
 2076|       |            /* loop over num layers -1 */
 2077|  93.4k|            for(i4_lyr_id = 0; i4_lyr_id < MAX_NUM_RES_LYRS; i4_lyr_id++)
  ------------------
  |  |   94|  93.4k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (2077:32): [True: 70.1k, False: 23.3k]
  ------------------
 2078|  70.1k|            {
 2079|       |                /* derive the layer map ctxt */
 2080|  70.1k|                ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[i4_lyr_id];
 2081|  70.1k|                ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 2082|  70.1k|                ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 2083|       |
 2084|       |                /* initialise the pointers */
 2085|  70.1k|                ps_luma_map->ps_seg_lookup_vert = ps_seg_lookup;
 2086|  70.1k|                ps_seg_lookup += MB_HEIGHT;
  ------------------
  |  |   68|  70.1k|#define MB_HEIGHT 16
  ------------------
 2087|  70.1k|                ps_chroma_map->ps_seg_lookup_vert = ps_seg_lookup;
 2088|  70.1k|                ps_seg_lookup += BLOCK_HEIGHT;
  ------------------
  |  |   65|  70.1k|#define BLOCK_HEIGHT 8
  ------------------
 2089|       |
 2090|  70.1k|            } /* 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|  23.3k|            size = (MAX_REF_IDX_ARRAY * MAX_NUM_RES_LYRS * 4);
  ------------------
  |  |   55|  23.3k|#define MAX_REF_IDX_ARRAY (MAX_REF_ARR_WD_HT + MB_WIDTH)
  |  |  ------------------
  |  |  |  |   53|  23.3k|#define MAX_REF_ARR_WD_HT 48
  |  |  ------------------
  |  |               #define MAX_REF_IDX_ARRAY (MAX_REF_ARR_WD_HT + MB_WIDTH)
  |  |  ------------------
  |  |  |  |   67|  23.3k|#define MB_WIDTH 16
  |  |  ------------------
  ------------------
                          size = (MAX_REF_IDX_ARRAY * MAX_NUM_RES_LYRS * 4);
  ------------------
  |  |   94|  23.3k|#define MAX_NUM_RES_LYRS 3
  ------------------
 2099|  23.3k|            pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2100|  23.3k|            RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.3k]
  |  |  ------------------
  ------------------
 2101|  23.3k|            memset(pv_buf, 0, size);
 2102|  23.3k|            pu1_mem = pv_buf;
 2103|       |
 2104|       |            /* loop over num layers -1 */
 2105|  93.4k|            for(i4_lyr_id = 0; i4_lyr_id < MAX_NUM_RES_LYRS; i4_lyr_id++)
  ------------------
  |  |   94|  93.4k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (2105:32): [True: 70.1k, False: 23.3k]
  ------------------
 2106|  70.1k|            {
 2107|       |                /* derive the layer map ctxt */
 2108|  70.1k|                ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[i4_lyr_id];
 2109|  70.1k|                ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 2110|  70.1k|                ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 2111|       |
 2112|       |                /* initialise the pointers */
 2113|  70.1k|                ps_luma_map->pu1_refarray_x_idx = pu1_mem;
 2114|  70.1k|                pu1_mem += MAX_REF_IDX_ARRAY;
  ------------------
  |  |   55|  70.1k|#define MAX_REF_IDX_ARRAY (MAX_REF_ARR_WD_HT + MB_WIDTH)
  |  |  ------------------
  |  |  |  |   53|  70.1k|#define MAX_REF_ARR_WD_HT 48
  |  |  ------------------
  |  |               #define MAX_REF_IDX_ARRAY (MAX_REF_ARR_WD_HT + MB_WIDTH)
  |  |  ------------------
  |  |  |  |   67|  70.1k|#define MB_WIDTH 16
  |  |  ------------------
  ------------------
 2115|       |
 2116|  70.1k|                ps_luma_map->pu1_refarray_y_idx = pu1_mem;
 2117|  70.1k|                pu1_mem += MAX_REF_IDX_ARRAY;
  ------------------
  |  |   55|  70.1k|#define MAX_REF_IDX_ARRAY (MAX_REF_ARR_WD_HT + MB_WIDTH)
  |  |  ------------------
  |  |  |  |   53|  70.1k|#define MAX_REF_ARR_WD_HT 48
  |  |  ------------------
  |  |               #define MAX_REF_IDX_ARRAY (MAX_REF_ARR_WD_HT + MB_WIDTH)
  |  |  ------------------
  |  |  |  |   67|  70.1k|#define MB_WIDTH 16
  |  |  ------------------
  ------------------
 2118|       |
 2119|  70.1k|                ps_chroma_map->pu1_refarray_x_idx = pu1_mem;
 2120|  70.1k|                pu1_mem += MAX_REF_IDX_ARRAY;
  ------------------
  |  |   55|  70.1k|#define MAX_REF_IDX_ARRAY (MAX_REF_ARR_WD_HT + MB_WIDTH)
  |  |  ------------------
  |  |  |  |   53|  70.1k|#define MAX_REF_ARR_WD_HT 48
  |  |  ------------------
  |  |               #define MAX_REF_IDX_ARRAY (MAX_REF_ARR_WD_HT + MB_WIDTH)
  |  |  ------------------
  |  |  |  |   67|  70.1k|#define MB_WIDTH 16
  |  |  ------------------
  ------------------
 2121|       |
 2122|  70.1k|                ps_chroma_map->pu1_refarray_y_idx = pu1_mem;
 2123|  70.1k|                pu1_mem += MAX_REF_IDX_ARRAY;
  ------------------
  |  |   55|  70.1k|#define MAX_REF_IDX_ARRAY (MAX_REF_ARR_WD_HT + MB_WIDTH)
  |  |  ------------------
  |  |  |  |   53|  70.1k|#define MAX_REF_ARR_WD_HT 48
  |  |  ------------------
  |  |               #define MAX_REF_IDX_ARRAY (MAX_REF_ARR_WD_HT + MB_WIDTH)
  |  |  ------------------
  |  |  |  |   67|  70.1k|#define MB_WIDTH 16
  |  |  ------------------
  ------------------
 2124|       |
 2125|  70.1k|            } /* end of loop over resolution layers */
 2126|  23.3k|        }
 2127|       |
 2128|      0|        size = ((sizeof(intra_inter_pred_ctxt_t) + 127) >> 7) << 7;
 2129|  23.3k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2130|  23.3k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.3k]
  |  |  ------------------
  ------------------
 2131|  23.3k|        memset(pv_buf, 0, size);
 2132|  23.3k|        ps_ii_pred_ctxt = pv_buf;
 2133|  23.3k|    }
 2134|       |
 2135|      0|    ps_svcd_ctxt->pv_intra_sample_ctxt = ps_ctxt;
 2136|  23.3k|    ps_svcd_ctxt->pv_ii_pred_ctxt = ps_ii_pred_ctxt;
 2137|       |
 2138|  93.4k|    for(u1_layer_id = 0; u1_layer_id < MAX_NUM_RES_LYRS; u1_layer_id++)
  ------------------
  |  |   94|  93.4k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (2138:26): [True: 70.1k, False: 23.3k]
  ------------------
 2139|  70.1k|    {
 2140|  70.1k|        ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[u1_layer_id];
 2141|  70.1k|        ps_svc_lyr_dec->pv_intra_sample_ctxt = ps_svcd_ctxt->pv_intra_sample_ctxt;
 2142|  70.1k|        ps_svc_lyr_dec->pv_ii_pred_ctxt = ps_svcd_ctxt->pv_ii_pred_ctxt;
 2143|  70.1k|    }
 2144|       |
 2145|  23.3k|    return IV_SUCCESS;
 2146|  23.3k|}
isvcd_residual_resample_ctxt_create:
 2170|  23.3k|{
 2171|  23.3k|    isvcd_create_ip_t *ps_create_ip;
 2172|  23.3k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 2173|  23.3k|    void *pv_buf;
 2174|  23.3k|    UWORD8 u1_layer_id;
 2175|  23.3k|    void *(*pf_aligned_alloc)(void *pv_mem_ctxt, WORD32 alignment, WORD32 size);
 2176|  23.3k|    void *pv_mem_ctxt;
 2177|  23.3k|    WORD32 size;
 2178|       |
 2179|  23.3k|    residual_sampling_ctxt_t *ps_ctxt;
 2180|  23.3k|    res_lyr_ctxt *ps_lyr_ctxt;
 2181|  23.3k|    UNUSED(pv_api_op);
  ------------------
  |  |   45|  23.3k|#define UNUSED(x) ((void)(x))
  ------------------
 2182|  23.3k|    ps_create_ip = (isvcd_create_ip_t *) pv_api_ip;
 2183|       |
 2184|  23.3k|    pf_aligned_alloc = ps_create_ip->s_ivd_create_ip_t.pf_aligned_alloc;
 2185|  23.3k|    pv_mem_ctxt = ps_create_ip->s_ivd_create_ip_t.pv_mem_ctxt;
 2186|       |
 2187|       |    /* allocate context structure */
 2188|  23.3k|    size = ((sizeof(residual_sampling_ctxt_t) + 127) >> 7) << 7;
 2189|  23.3k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2190|  23.3k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.3k]
  |  |  ------------------
  ------------------
 2191|  23.3k|    memset(pv_buf, 0, size);
 2192|  23.3k|    ps_ctxt = pv_buf;
 2193|       |
 2194|       |    /* reference array buffer  */
 2195|  23.3k|    size = REF_ARRAY_WIDTH_RES_SAMP * REF_ARRAY_HEIGHT_RES_SAMP * sizeof(WORD16);
  ------------------
  |  |   45|  23.3k|#define REF_ARRAY_WIDTH_RES_SAMP (MB_WIDTH + 6)
  |  |  ------------------
  |  |  |  |   67|  23.3k|#define MB_WIDTH 16
  |  |  ------------------
  ------------------
                  size = REF_ARRAY_WIDTH_RES_SAMP * REF_ARRAY_HEIGHT_RES_SAMP * sizeof(WORD16);
  ------------------
  |  |   46|  23.3k|#define REF_ARRAY_HEIGHT_RES_SAMP (MB_HEIGHT + 6)
  |  |  ------------------
  |  |  |  |   68|  23.3k|#define MB_HEIGHT 16
  |  |  ------------------
  ------------------
 2196|  23.3k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2197|  23.3k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.3k]
  |  |  ------------------
  ------------------
 2198|  23.3k|    memset(pv_buf, 0, size);
 2199|  23.3k|    ps_ctxt->pi2_refarray_buffer = pv_buf;
 2200|       |
 2201|       |    /* reference array pointer increment buffer */
 2202|  23.3k|    {
 2203|  23.3k|        WORD32 i4_size;
 2204|       |
 2205|  23.3k|        i4_size = REF_ARRAY_WIDTH_RES_SAMP * REF_ARRAY_HEIGHT_RES_SAMP * sizeof(UWORD8);
  ------------------
  |  |   45|  23.3k|#define REF_ARRAY_WIDTH_RES_SAMP (MB_WIDTH + 6)
  |  |  ------------------
  |  |  |  |   67|  23.3k|#define MB_WIDTH 16
  |  |  ------------------
  ------------------
                      i4_size = REF_ARRAY_WIDTH_RES_SAMP * REF_ARRAY_HEIGHT_RES_SAMP * sizeof(UWORD8);
  ------------------
  |  |   46|  23.3k|#define REF_ARRAY_HEIGHT_RES_SAMP (MB_HEIGHT + 6)
  |  |  ------------------
  |  |  |  |   68|  23.3k|#define MB_HEIGHT 16
  |  |  ------------------
  ------------------
 2206|  23.3k|        size = REF_ARRAY_WIDTH_RES_SAMP * REF_ARRAY_HEIGHT_RES_SAMP * 2 * sizeof(UWORD8);
  ------------------
  |  |   45|  23.3k|#define REF_ARRAY_WIDTH_RES_SAMP (MB_WIDTH + 6)
  |  |  ------------------
  |  |  |  |   67|  23.3k|#define MB_WIDTH 16
  |  |  ------------------
  ------------------
                      size = REF_ARRAY_WIDTH_RES_SAMP * REF_ARRAY_HEIGHT_RES_SAMP * 2 * sizeof(UWORD8);
  ------------------
  |  |   46|  23.3k|#define REF_ARRAY_HEIGHT_RES_SAMP (MB_HEIGHT + 6)
  |  |  ------------------
  |  |  |  |   68|  23.3k|#define MB_HEIGHT 16
  |  |  ------------------
  ------------------
 2207|  23.3k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2208|  23.3k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.3k]
  |  |  ------------------
  ------------------
 2209|  23.3k|        memset(pv_buf, 0, size);
 2210|  23.3k|        ps_ctxt->pu1_ref_x_ptr_incr = pv_buf;
 2211|  23.3k|        ps_ctxt->pu1_ref_y_ptr_incr = ps_ctxt->pu1_ref_x_ptr_incr + i4_size;
 2212|  23.3k|    }
 2213|       |
 2214|       |    /****************** projected locations buffers ******************/
 2215|      0|    {
 2216|  23.3k|        residual_samp_map_ctxt_t *ps_luma_map;
 2217|  23.3k|        residual_samp_map_ctxt_t *ps_chroma_map;
 2218|  23.3k|        WORD32 i4_lyr_id;
 2219|  23.3k|        ref_mb_map_t *ps_off_len_map;
 2220|  23.3k|        ref_pixel_map_t *ps_pos_phase_map;
 2221|       |
 2222|       |        /****************** Horz offset length ******************/
 2223|  23.3k|        size = (H264_MAX_FRAME_WIDTH >> 4) * MAX_NUM_RES_LYRS * 2 * sizeof(ref_mb_map_t);
  ------------------
  |  |   39|  23.3k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
                      size = (H264_MAX_FRAME_WIDTH >> 4) * MAX_NUM_RES_LYRS * 2 * sizeof(ref_mb_map_t);
  ------------------
  |  |   94|  23.3k|#define MAX_NUM_RES_LYRS 3
  ------------------
 2224|  23.3k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2225|  23.3k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.3k]
  |  |  ------------------
  ------------------
 2226|  23.3k|        memset(pv_buf, 0, size);
 2227|  23.3k|        ps_off_len_map = pv_buf;
 2228|       |
 2229|       |        /* loop over num layers -1 */
 2230|  93.4k|        for(i4_lyr_id = 0; i4_lyr_id < MAX_NUM_RES_LYRS; i4_lyr_id++)
  ------------------
  |  |   94|  93.4k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (2230:28): [True: 70.1k, False: 23.3k]
  ------------------
 2231|  70.1k|        {
 2232|       |            /* derive the layer map ctxt */
 2233|  70.1k|            ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[i4_lyr_id];
 2234|  70.1k|            ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 2235|  70.1k|            ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 2236|       |
 2237|       |            /* initialise the pointers */
 2238|  70.1k|            ps_luma_map->ps_x_offset_length = ps_off_len_map;
 2239|  70.1k|            ps_off_len_map += (H264_MAX_FRAME_WIDTH >> 4);
  ------------------
  |  |   39|  70.1k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
 2240|  70.1k|            ps_chroma_map->ps_x_offset_length = ps_off_len_map;
 2241|  70.1k|            ps_off_len_map += (H264_MAX_FRAME_WIDTH >> 4);
  ------------------
  |  |   39|  70.1k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
 2242|       |
 2243|  70.1k|        } /* end of loop over resolution layers */
 2244|       |
 2245|       |        /****************** Vert offset length ******************/
 2246|  23.3k|        size = (H264_MAX_FRAME_HEIGHT >> 4) * MAX_NUM_RES_LYRS * 2 * sizeof(ref_mb_map_t);
  ------------------
  |  |   40|  23.3k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
                      size = (H264_MAX_FRAME_HEIGHT >> 4) * MAX_NUM_RES_LYRS * 2 * sizeof(ref_mb_map_t);
  ------------------
  |  |   94|  23.3k|#define MAX_NUM_RES_LYRS 3
  ------------------
 2247|  23.3k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2248|  23.3k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.3k]
  |  |  ------------------
  ------------------
 2249|  23.3k|        memset(pv_buf, 0, size);
 2250|  23.3k|        ps_off_len_map = pv_buf;
 2251|       |
 2252|       |        /* loop over num layers -1 */
 2253|  93.4k|        for(i4_lyr_id = 0; i4_lyr_id < MAX_NUM_RES_LYRS; i4_lyr_id++)
  ------------------
  |  |   94|  93.4k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (2253:28): [True: 70.1k, False: 23.3k]
  ------------------
 2254|  70.1k|        {
 2255|       |            /* derive the layer map ctxt */
 2256|  70.1k|            ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[i4_lyr_id];
 2257|  70.1k|            ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 2258|  70.1k|            ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 2259|       |
 2260|       |            /* initialise the pointers */
 2261|  70.1k|            ps_luma_map->ps_y_offset_length = ps_off_len_map;
 2262|  70.1k|            ps_off_len_map += (H264_MAX_FRAME_HEIGHT >> 4);
  ------------------
  |  |   40|  70.1k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
 2263|  70.1k|            ps_chroma_map->ps_y_offset_length = ps_off_len_map;
 2264|  70.1k|            ps_off_len_map += (H264_MAX_FRAME_HEIGHT >> 4);
  ------------------
  |  |   40|  70.1k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
 2265|       |
 2266|  70.1k|        } /* end of loop over resolution layers */
 2267|       |
 2268|       |        /****************** Horz position phase ******************/
 2269|  23.3k|        size = H264_MAX_FRAME_WIDTH * MAX_NUM_RES_LYRS * 2 * sizeof(ref_pixel_map_t);
  ------------------
  |  |   39|  23.3k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
                      size = H264_MAX_FRAME_WIDTH * MAX_NUM_RES_LYRS * 2 * sizeof(ref_pixel_map_t);
  ------------------
  |  |   94|  23.3k|#define MAX_NUM_RES_LYRS 3
  ------------------
 2270|  23.3k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2271|  23.3k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.3k]
  |  |  ------------------
  ------------------
 2272|  23.3k|        memset(pv_buf, 0, size);
 2273|  23.3k|        ps_pos_phase_map = pv_buf;
 2274|       |
 2275|       |        /* loop over num layers -1 */
 2276|  93.4k|        for(i4_lyr_id = 0; i4_lyr_id < MAX_NUM_RES_LYRS; i4_lyr_id++)
  ------------------
  |  |   94|  93.4k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (2276:28): [True: 70.1k, False: 23.3k]
  ------------------
 2277|  70.1k|        {
 2278|       |            /* derive the layer map ctxt */
 2279|  70.1k|            ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[i4_lyr_id];
 2280|  70.1k|            ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 2281|  70.1k|            ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 2282|       |
 2283|       |            /* initialise the pointers */
 2284|  70.1k|            ps_luma_map->ps_x_pos_phase = ps_pos_phase_map;
 2285|  70.1k|            ps_pos_phase_map += H264_MAX_FRAME_WIDTH;
  ------------------
  |  |   39|  70.1k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
 2286|  70.1k|            ps_chroma_map->ps_x_pos_phase = ps_pos_phase_map;
 2287|  70.1k|            ps_pos_phase_map += H264_MAX_FRAME_WIDTH;
  ------------------
  |  |   39|  70.1k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
 2288|       |
 2289|  70.1k|        } /* end of loop over resolution layers */
 2290|       |
 2291|       |        /****************** Vert position phase ******************/
 2292|       |
 2293|  23.3k|        size = H264_MAX_FRAME_HEIGHT * MAX_NUM_RES_LYRS * 2 * sizeof(ref_pixel_map_t);
  ------------------
  |  |   40|  23.3k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
                      size = H264_MAX_FRAME_HEIGHT * MAX_NUM_RES_LYRS * 2 * sizeof(ref_pixel_map_t);
  ------------------
  |  |   94|  23.3k|#define MAX_NUM_RES_LYRS 3
  ------------------
 2294|  23.3k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2295|  23.3k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.3k]
  |  |  ------------------
  ------------------
 2296|  23.3k|        memset(pv_buf, 0, size);
 2297|  23.3k|        ps_pos_phase_map = pv_buf;
 2298|       |
 2299|       |        /* loop over num layers -1 */
 2300|  93.4k|        for(i4_lyr_id = 0; i4_lyr_id < MAX_NUM_RES_LYRS; i4_lyr_id++)
  ------------------
  |  |   94|  93.4k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (2300:28): [True: 70.1k, False: 23.3k]
  ------------------
 2301|  70.1k|        {
 2302|       |            /* derive the layer map ctxt */
 2303|  70.1k|            ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[i4_lyr_id];
 2304|  70.1k|            ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 2305|  70.1k|            ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 2306|       |
 2307|       |            /* initialise the pointers */
 2308|  70.1k|            ps_luma_map->ps_y_pos_phase = ps_pos_phase_map;
 2309|  70.1k|            ps_pos_phase_map += H264_MAX_FRAME_HEIGHT;
  ------------------
  |  |   40|  70.1k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
 2310|  70.1k|            ps_chroma_map->ps_y_pos_phase = ps_pos_phase_map;
 2311|  70.1k|            ps_pos_phase_map += H264_MAX_FRAME_HEIGHT;
  ------------------
  |  |   40|  70.1k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
 2312|       |
 2313|  70.1k|        } /* end of loop over resolution layers */
 2314|  23.3k|    }
 2315|       |
 2316|      0|    ps_svcd_ctxt->pv_residual_sample_ctxt = ps_ctxt;
 2317|       |
 2318|  93.4k|    for(u1_layer_id = 0; u1_layer_id < MAX_NUM_RES_LYRS; u1_layer_id++)
  ------------------
  |  |   94|  93.4k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (2318:26): [True: 70.1k, False: 23.3k]
  ------------------
 2319|  70.1k|    {
 2320|  70.1k|        ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[u1_layer_id];
 2321|  70.1k|        ps_svc_lyr_dec->pv_residual_sample_ctxt = ps_svcd_ctxt->pv_residual_sample_ctxt;
 2322|  70.1k|    }
 2323|  23.3k|    return IV_SUCCESS;
 2324|  23.3k|}
isvcd_mode_mv_resample_ctxt_create:
 2347|  23.3k|{
 2348|  23.3k|    isvcd_create_ip_t *ps_create_ip;
 2349|  23.3k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 2350|  23.3k|    void *pv_buf;
 2351|  23.3k|    WORD16 *pi2_mem;
 2352|  23.3k|    UWORD8 u1_layer_id;
 2353|  23.3k|    void *(*pf_aligned_alloc)(void *pv_mem_ctxt, WORD32 alignment, WORD32 size);
 2354|  23.3k|    void *pv_mem_ctxt;
 2355|  23.3k|    WORD32 size, i4_res_id;
 2356|  23.3k|    ref_lyr_scaled_offset_t *ps_ref_pic_offsets;
 2357|  23.3k|    mode_motion_ctxt_t *ps_mode_motion;
 2358|  23.3k|    mode_motion_lyr_ctxt *ps_lyr_mem;
 2359|  23.3k|    UNUSED(pv_api_op);
  ------------------
  |  |   45|  23.3k|#define UNUSED(x) ((void)(x))
  ------------------
 2360|  23.3k|    ps_create_ip = (isvcd_create_ip_t *) pv_api_ip;
 2361|       |
 2362|  23.3k|    pf_aligned_alloc = ps_create_ip->s_ivd_create_ip_t.pf_aligned_alloc;
 2363|  23.3k|    pv_mem_ctxt = ps_create_ip->s_ivd_create_ip_t.pv_mem_ctxt;
 2364|       |
 2365|  23.3k|    size = ((sizeof(mode_motion_ctxt_t) + 127) >> 7) << 7;
 2366|  23.3k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2367|  23.3k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.3k]
  |  |  ------------------
  ------------------
 2368|  23.3k|    memset(pv_buf, 0, size);
 2369|  23.3k|    ps_mode_motion = pv_buf;
 2370|       |
 2371|       |    /* motion pred structure */
 2372|  23.3k|    size = 2 * NUM_MB_PARTS * NUM_SUB_MB_PARTS * sizeof(mv_pred_t);
  ------------------
  |  |   59|  23.3k|#define NUM_MB_PARTS 4
  ------------------
                  size = 2 * NUM_MB_PARTS * NUM_SUB_MB_PARTS * sizeof(mv_pred_t);
  ------------------
  |  |   60|  23.3k|#define NUM_SUB_MB_PARTS 4
  ------------------
 2373|  23.3k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2374|  23.3k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.3k]
  |  |  ------------------
  ------------------
 2375|  23.3k|    memset(pv_buf, 0, size);
 2376|  23.3k|    ps_mode_motion->ps_motion_pred_struct = (mv_pred_t *) pv_buf;
 2377|       |
 2378|       |    /* projected locations X */
 2379|  23.3k|    size = H264_MAX_FRAME_WIDTH * MAX_NUM_RES_LYRS * sizeof(WORD16);
  ------------------
  |  |   39|  23.3k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
                  size = H264_MAX_FRAME_WIDTH * MAX_NUM_RES_LYRS * sizeof(WORD16);
  ------------------
  |  |   94|  23.3k|#define MAX_NUM_RES_LYRS 3
  ------------------
 2380|  23.3k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2381|  23.3k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.3k]
  |  |  ------------------
  ------------------
 2382|  23.3k|    memset(pv_buf, 0, size);
 2383|  23.3k|    pi2_mem = (WORD16 *) pv_buf;
 2384|       |
 2385|       |    /* loop over NUM resolution layers */
 2386|  93.4k|    for(i4_res_id = 0; i4_res_id < MAX_NUM_RES_LYRS; i4_res_id++)
  ------------------
  |  |   94|  93.4k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (2386:24): [True: 70.1k, False: 23.3k]
  ------------------
 2387|  70.1k|    {
 2388|  70.1k|        ps_lyr_mem = &ps_mode_motion->as_res_lyr_mem[i4_res_id];
 2389|       |
 2390|       |        /* initialise the pointers */
 2391|  70.1k|        ps_lyr_mem->pi2_ref_loc_x = pi2_mem;
 2392|       |
 2393|       |        /* increment the buffer pointer */
 2394|  70.1k|        pi2_mem += H264_MAX_FRAME_WIDTH;
  ------------------
  |  |   39|  70.1k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
 2395|       |
 2396|  70.1k|    } /* end of loop over num resolution layers */
 2397|       |
 2398|       |    /* projected locations Y */
 2399|  23.3k|    size = H264_MAX_FRAME_HEIGHT * MAX_NUM_RES_LYRS * sizeof(WORD16);
  ------------------
  |  |   40|  23.3k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
                  size = H264_MAX_FRAME_HEIGHT * MAX_NUM_RES_LYRS * sizeof(WORD16);
  ------------------
  |  |   94|  23.3k|#define MAX_NUM_RES_LYRS 3
  ------------------
 2400|  23.3k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2401|  23.3k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.3k]
  |  |  ------------------
  ------------------
 2402|  23.3k|    memset(pv_buf, 0, size);
 2403|  23.3k|    pi2_mem = (WORD16 *) pv_buf;
 2404|       |    /* loop over NUM resolution layers */
 2405|  93.4k|    for(i4_res_id = 0; i4_res_id < MAX_NUM_RES_LYRS; i4_res_id++)
  ------------------
  |  |   94|  93.4k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (2405:24): [True: 70.1k, False: 23.3k]
  ------------------
 2406|  70.1k|    {
 2407|  70.1k|        ps_lyr_mem = &ps_mode_motion->as_res_lyr_mem[i4_res_id];
 2408|       |
 2409|       |        /* initialise the pointers */
 2410|  70.1k|        ps_lyr_mem->pi2_ref_loc_y = pi2_mem;
 2411|       |        /* increment the buffer pointer */
 2412|  70.1k|        pi2_mem += H264_MAX_FRAME_HEIGHT;
  ------------------
  |  |   40|  70.1k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
 2413|       |
 2414|  70.1k|    } /* end of loop over num resolution layers */
 2415|       |
 2416|  23.3k|    size = sizeof(ref_lyr_scaled_offset_t) * MAX_NUM_RES_LYRS * MAX_NUM_PIC_BUFS;
  ------------------
  |  |   94|  23.3k|#define MAX_NUM_RES_LYRS 3
  ------------------
                  size = sizeof(ref_lyr_scaled_offset_t) * MAX_NUM_RES_LYRS * MAX_NUM_PIC_BUFS;
  ------------------
  |  |   99|  23.3k|#define MAX_NUM_PIC_BUFS (32 + 1)
  ------------------
 2417|  23.3k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2418|  23.3k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.3k]
  |  |  ------------------
  ------------------
 2419|  23.3k|    memset(pv_buf, 0, size);
 2420|  23.3k|    ps_svcd_ctxt->pv_ref_lyr_offset = pv_buf;
 2421|       |
 2422|       |    /* loop over NUM resolution layers */
 2423|  23.3k|    ps_ref_pic_offsets = (ref_lyr_scaled_offset_t *) ps_svcd_ctxt->pv_ref_lyr_offset;
 2424|       |
 2425|  93.4k|    for(i4_res_id = 0; i4_res_id < MAX_NUM_RES_LYRS; i4_res_id++)
  ------------------
  |  |   94|  93.4k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (2425:24): [True: 70.1k, False: 23.3k]
  ------------------
 2426|  70.1k|    {
 2427|  70.1k|        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|  70.1k|        ps_lyr_mem->ps_ref_pic_lyr_offsets = ps_ref_pic_offsets + (i4_res_id * MAX_NUM_PIC_BUFS);
  ------------------
  |  |   99|  70.1k|#define MAX_NUM_PIC_BUFS (32 + 1)
  ------------------
 2431|       |
 2432|  70.1k|    } /* end of loop over num resolution layers */
 2433|       |
 2434|  23.3k|    ps_svcd_ctxt->pv_mode_mv_sample_ctxt = ps_mode_motion;
 2435|       |
 2436|  93.4k|    for(u1_layer_id = 0; u1_layer_id < MAX_NUM_RES_LYRS; u1_layer_id++)
  ------------------
  |  |   94|  93.4k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (2436:26): [True: 70.1k, False: 23.3k]
  ------------------
 2437|  70.1k|    {
 2438|  70.1k|        ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[u1_layer_id];
 2439|  70.1k|        ps_svc_lyr_dec->pv_mode_mv_sample_ctxt = ps_svcd_ctxt->pv_mode_mv_sample_ctxt;
 2440|  70.1k|        ps_svc_lyr_dec->pv_ref_lyr_offset = ps_svcd_ctxt->pv_ref_lyr_offset;
 2441|  70.1k|    }
 2442|  23.3k|    return IV_SUCCESS;
 2443|  23.3k|}
isvcd_allocate_static_bufs:
 2465|  23.3k|{
 2466|  23.3k|    isvcd_create_ip_t *ps_create_ip;
 2467|  23.3k|    isvcd_create_op_t *ps_create_op;
 2468|  23.3k|    void *pv_buf;
 2469|  23.3k|    UWORD8 *pu1_buf;
 2470|  23.3k|    dec_struct_t *ps_dec;
 2471|  23.3k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 2472|  23.3k|    svc_dec_ctxt_t *ps_svcd_ctxt;
 2473|  23.3k|    void *(*pf_aligned_alloc)(void *pv_mem_ctxt, WORD32 alignment, WORD32 size);
 2474|  23.3k|    void (*pf_aligned_free)(void *pv_mem_ctxt, void *pv_buf);
 2475|  23.3k|    void *pv_mem_ctxt;
 2476|  23.3k|    WORD32 size;
 2477|  23.3k|    UWORD8 u1_layer_id, u1_sps_ctr;
 2478|  23.3k|    UWORD8 u1_chroma_format;
 2479|  23.3k|    WORD32 ret;
 2480|       |
 2481|  23.3k|    ps_create_ip = (isvcd_create_ip_t *) pv_api_ip;
 2482|  23.3k|    ps_create_op = (isvcd_create_op_t *) pv_api_op;
 2483|       |
 2484|  23.3k|    ps_create_op->s_ivd_create_op_t.u4_error_code = 0;
 2485|  23.3k|    pf_aligned_alloc = ps_create_ip->s_ivd_create_ip_t.pf_aligned_alloc;
 2486|  23.3k|    pf_aligned_free = ps_create_ip->s_ivd_create_ip_t.pf_aligned_free;
 2487|  23.3k|    pv_mem_ctxt = ps_create_ip->s_ivd_create_ip_t.pv_mem_ctxt;
 2488|  23.3k|    u1_chroma_format = (UWORD8) (ps_create_ip->s_ivd_create_ip_t.e_output_format);
 2489|       |
 2490|  23.3k|    if((u1_chroma_format != IV_YUV_420P) && (u1_chroma_format != IV_YUV_420SP_UV) &&
  ------------------
  |  Branch (2490:8): [True: 13.5k, False: 9.85k]
  |  Branch (2490:45): [True: 6.29k, False: 7.23k]
  ------------------
 2491|  6.29k|       (u1_chroma_format != IV_YUV_420SP_VU))
  ------------------
  |  Branch (2491:8): [True: 9, False: 6.28k]
  ------------------
 2492|      9|    {
 2493|      9|        ps_create_op->s_ivd_create_op_t.pv_handle = NULL;
 2494|       |
 2495|      9|        return IV_FAIL;
 2496|      9|    }
 2497|       |
 2498|       |    /* Initialize return handle to NULL */
 2499|  23.3k|    ps_create_op->s_ivd_create_op_t.pv_handle = NULL;
 2500|  23.3k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, sizeof(iv_obj_t));
 2501|  23.3k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.3k]
  |  |  ------------------
  ------------------
 2502|  23.3k|    memset(pv_buf, 0, sizeof(iv_obj_t));
 2503|  23.3k|    *dec_hdl = (iv_obj_t *) pv_buf;
 2504|  23.3k|    ps_create_op->s_ivd_create_op_t.pv_handle = *dec_hdl;
 2505|       |
 2506|  23.3k|    (*dec_hdl)->pv_codec_handle = NULL;
 2507|  23.3k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, sizeof(svc_dec_ctxt_t));
 2508|  23.3k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.3k]
  |  |  ------------------
  ------------------
 2509|  23.3k|    (*dec_hdl)->pv_codec_handle = (svc_dec_ctxt_t *) pv_buf;
 2510|  23.3k|    ps_svcd_ctxt = (svc_dec_ctxt_t *) pv_buf;
 2511|       |
 2512|  23.3k|    memset(ps_svcd_ctxt, 0, sizeof(svc_dec_ctxt_t));
 2513|       |
 2514|  23.3k|    ps_svcd_ctxt->u1_prev_num_res_layers = UINT8_MAX;
 2515|  23.3k|    ps_svcd_ctxt->u1_pre_parse_in_flush = 1;
 2516|       |    /* set default to maximum values supported */
 2517|  23.3k|    ps_svcd_ctxt->u1_tgt_dep_id = MAX_DEPENDENCY_ID;
  ------------------
  |  |  103|  23.3k|#define MAX_DEPENDENCY_ID 4
  ------------------
 2518|  23.3k|    ps_svcd_ctxt->u1_tgt_quality_id = MAX_QUALITY_ID;
  ------------------
  |  |  102|  23.3k|#define MAX_QUALITY_ID 0
  ------------------
 2519|  23.3k|    ps_svcd_ctxt->u1_tgt_temp_id = MAX_TEMPORAL_ID;
  ------------------
  |  |  104|  23.3k|#define MAX_TEMPORAL_ID 7
  ------------------
 2520|  23.3k|    ps_svcd_ctxt->u1_tgt_priority_id = MAX_PRIORITY_ID;
  ------------------
  |  |  105|  23.3k|#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|  23.3k|    size = ((sizeof(dec_seq_params_t)) * MAX_NUM_SEQ_PARAMS * 2);
  ------------------
  |  |  521|  23.3k|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
 2525|  23.3k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2526|  23.3k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.3k]
  |  |  ------------------
  ------------------
 2527|  23.3k|    memset(pv_buf, 0, size);
 2528|  23.3k|    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|  23.3k|    size = ((sizeof(dec_svc_seq_params_t)) * MAX_NUM_SEQ_PARAMS * 2);
  ------------------
  |  |  521|  23.3k|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
 2533|  23.3k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2534|  23.3k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.3k]
  |  |  ------------------
  ------------------
 2535|  23.3k|    memset(pv_buf, 0, size);
 2536|  23.3k|    ps_svcd_ctxt->ps_subset_sps = pv_buf;
 2537|       |
 2538|  1.51M|    for(u1_sps_ctr = 0; u1_sps_ctr < (2 * MAX_NUM_SEQ_PARAMS); u1_sps_ctr++)
  ------------------
  |  |  521|  1.51M|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
  |  Branch (2538:25): [True: 1.49M, False: 23.3k]
  ------------------
 2539|  1.49M|    {
 2540|  1.49M|        ps_svcd_ctxt->ps_subset_sps[u1_sps_ctr].ps_seq = &ps_svcd_ctxt->ps_sps[u1_sps_ctr];
 2541|  1.49M|    }
 2542|       |
 2543|  23.3k|    size = sizeof(sei);
 2544|  23.3k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2545|  23.3k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.3k]
  |  |  ------------------
  ------------------
 2546|  23.3k|    memset(pv_buf, 0, size);
 2547|  23.3k|    ps_svcd_ctxt->ps_sei = (sei *) pv_buf;
 2548|       |
 2549|  23.3k|    size = sizeof(sei);
 2550|  23.3k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2551|  23.3k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.3k]
  |  |  ------------------
  ------------------
 2552|  23.3k|    memset(pv_buf, 0, size);
 2553|  23.3k|    ps_svcd_ctxt->ps_sei_parse = (sei *) pv_buf;
 2554|       |
 2555|  23.3k|    size = (sizeof(dec_pic_params_t)) * MAX_NUM_PIC_PARAMS;
  ------------------
  |  |  524|  23.3k|#define MAX_NUM_PIC_PARAMS 256
  ------------------
 2556|  23.3k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2557|  23.3k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.3k]
  |  |  ------------------
  ------------------
 2558|  23.3k|    memset(pv_buf, 0, size);
 2559|  23.3k|    ps_svcd_ctxt->ps_pps = pv_buf;
 2560|       |
 2561|  23.3k|    size = (sizeof(svc_dec_lyr_struct_t)) * MAX_NUM_RES_LYRS;
  ------------------
  |  |   94|  23.3k|#define MAX_NUM_RES_LYRS 3
  ------------------
 2562|  23.3k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2563|  23.3k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.3k]
  |  |  ------------------
  ------------------
 2564|  23.3k|    memset(pv_buf, 0, size);
 2565|  23.3k|    ps_svcd_ctxt->ps_svc_dec_lyr = pv_buf;
 2566|  23.3k|    ps_svcd_ctxt->u1_target_layer_id = 0;
 2567|  23.3k|    ps_svcd_ctxt->u1_cur_layer_id = 0;
 2568|  23.3k|    ps_svcd_ctxt->i4_eos_flag = 0;
 2569|       |
 2570|  23.3k|    ret = isvcd_mode_mv_resample_ctxt_create(ps_svcd_ctxt, pv_api_ip, pv_api_op);
 2571|  23.3k|    if(ret != IV_SUCCESS)
  ------------------
  |  Branch (2571:8): [True: 0, False: 23.3k]
  ------------------
 2572|      0|    {
 2573|      0|        return ret;
 2574|      0|    }
 2575|  23.3k|    ret = isvcd_intra_resample_ctxt_create(ps_svcd_ctxt, pv_api_ip, pv_api_op);
 2576|  23.3k|    if(ret != IV_SUCCESS)
  ------------------
  |  Branch (2576:8): [True: 0, False: 23.3k]
  ------------------
 2577|      0|    {
 2578|      0|        return ret;
 2579|      0|    }
 2580|  23.3k|    ret = isvcd_residual_resample_ctxt_create(ps_svcd_ctxt, pv_api_ip, pv_api_op);
 2581|  23.3k|    if(ret != IV_SUCCESS)
  ------------------
  |  Branch (2581:8): [True: 0, False: 23.3k]
  ------------------
 2582|      0|    {
 2583|      0|        return ret;
 2584|      0|    }
 2585|  23.3k|    ret = isvcd_nal_parse_ctxt_create(ps_svcd_ctxt, pv_api_ip, pv_api_op);
 2586|  23.3k|    if(ret != IV_SUCCESS)
  ------------------
  |  Branch (2586:8): [True: 0, False: 23.3k]
  ------------------
 2587|      0|    {
 2588|      0|        return ret;
 2589|      0|    }
 2590|  93.4k|    for(u1_layer_id = 0; u1_layer_id < MAX_NUM_RES_LYRS; u1_layer_id++)
  ------------------
  |  |   94|  93.4k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (2590:26): [True: 70.1k, False: 23.3k]
  ------------------
 2591|  70.1k|    {
 2592|  70.1k|        ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[u1_layer_id];
 2593|  70.1k|        ps_dec = &ps_svc_lyr_dec->s_dec;
 2594|       |
 2595|  70.1k|        ps_svc_lyr_dec->ps_svcd_ctxt = ps_svcd_ctxt;
 2596|  70.1k|        ps_svc_lyr_dec->u1_layer_id = u1_layer_id;
 2597|  70.1k|        ps_svc_lyr_dec->u1_dyadic_flag = 1;
 2598|  70.1k|        ps_svc_lyr_dec->u1_restricted_res_change_flag = 1;
 2599|  70.1k|        ps_svc_lyr_dec->u1_base_res_flag = 1;
 2600|  70.1k|        ps_svc_lyr_dec->u1_ref_layer_id = u1_layer_id - 1;
 2601|  70.1k|        ps_svc_lyr_dec->ps_dec_svc_ref_layer =
 2602|  70.1k|            &ps_svcd_ctxt->ps_svc_dec_lyr[ps_svc_lyr_dec->u1_ref_layer_id];
 2603|  70.1k|        ps_svc_lyr_dec->u4_pps_id_for_layer = UINT32_MAX;
 2604|       |
 2605|  70.1k|#ifndef LOGO_EN
 2606|  70.1k|        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|  70.1k|        ps_dec->u1_chroma_format = (UWORD8) (ps_create_ip->s_ivd_create_ip_t.e_output_format);
 2612|       |
 2613|  70.1k|        if((ps_dec->u1_chroma_format != IV_YUV_420P) &&
  ------------------
  |  Branch (2613:12): [True: 40.5k, False: 29.5k]
  ------------------
 2614|  40.5k|           (ps_dec->u1_chroma_format != IV_YUV_420SP_UV) &&
  ------------------
  |  Branch (2614:12): [True: 18.8k, False: 21.7k]
  ------------------
 2615|  18.8k|           (ps_dec->u1_chroma_format != IV_YUV_420SP_VU))
  ------------------
  |  Branch (2615:12): [True: 0, False: 18.8k]
  ------------------
 2616|      0|        {
 2617|      0|            ps_dec->u4_share_disp_buf = 0;
 2618|      0|        }
 2619|       |
 2620|  70.1k|        ps_dec->u1_enable_mb_info = ps_create_ip->u4_enable_frame_info;
 2621|  70.1k|        ps_dec->pf_aligned_alloc = pf_aligned_alloc;
 2622|  70.1k|        ps_dec->pf_aligned_free = pf_aligned_free;
 2623|  70.1k|        ps_dec->pv_mem_ctxt = pv_mem_ctxt;
 2624|       |
 2625|  70.1k|        ps_dec->ps_sps = ps_svcd_ctxt->ps_sps;
 2626|  70.1k|        ps_svc_lyr_dec->ps_subset_sps = ps_svcd_ctxt->ps_subset_sps;
 2627|  70.1k|        ps_dec->ps_pps = ps_svcd_ctxt->ps_pps;
 2628|  70.1k|        ps_dec->ps_sei = ps_svcd_ctxt->ps_sei;
 2629|  70.1k|        ps_dec->ps_sei_parse = ps_svcd_ctxt->ps_sei_parse;
 2630|       |
 2631|  70.1k|        size = ithread_get_handle_size();
 2632|  70.1k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2633|  70.1k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  70.1k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 70.1k]
  |  |  ------------------
  ------------------
 2634|  70.1k|        memset(pv_buf, 0, size);
 2635|  70.1k|        ps_dec->pv_dec_thread_handle = pv_buf;
 2636|       |
 2637|  70.1k|        size = ithread_get_handle_size();
 2638|  70.1k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2639|  70.1k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  70.1k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 70.1k]
  |  |  ------------------
  ------------------
 2640|  70.1k|        memset(pv_buf, 0, size);
 2641|  70.1k|        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|  70.1k|        size = sizeof(dpb_manager_t);
 2692|  70.1k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2693|  70.1k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  70.1k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 70.1k]
  |  |  ------------------
  ------------------
 2694|  70.1k|        memset(pv_buf, 0, size);
 2695|  70.1k|        ps_dec->ps_dpb_mgr = pv_buf;
 2696|       |
 2697|  70.1k|        size = sizeof(pred_info_t) * 2 * 32;
 2698|  70.1k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2699|  70.1k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  70.1k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 70.1k]
  |  |  ------------------
  ------------------
 2700|  70.1k|        memset(pv_buf, 0, size);
 2701|  70.1k|        ps_dec->ps_pred = pv_buf;
 2702|       |
 2703|  70.1k|        size = sizeof(disp_mgr_t);
 2704|  70.1k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2705|  70.1k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  70.1k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 70.1k]
  |  |  ------------------
  ------------------
 2706|  70.1k|        memset(pv_buf, 0, size);
 2707|  70.1k|        ps_dec->pv_disp_buf_mgr = pv_buf;
 2708|       |
 2709|  70.1k|        size = ih264_buf_mgr_size();
 2710|  70.1k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2711|  70.1k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  70.1k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 70.1k]
  |  |  ------------------
  ------------------
 2712|  70.1k|        memset(pv_buf, 0, size);
 2713|  70.1k|        ps_dec->pv_pic_buf_mgr = pv_buf;
 2714|       |
 2715|  70.1k|        size = sizeof(struct pic_buffer_t) * (H264_MAX_REF_PICS * 2);
  ------------------
  |  |  534|  70.1k|#define H264_MAX_REF_PICS         16
  ------------------
 2716|  70.1k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2717|  70.1k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  70.1k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 70.1k]
  |  |  ------------------
  ------------------
 2718|  70.1k|        memset(pv_buf, 0, size);
 2719|  70.1k|        ps_dec->ps_pic_buf_base = pv_buf;
 2720|       |
 2721|  70.1k|        size = sizeof(dec_err_status_t);
 2722|  70.1k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2723|  70.1k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  70.1k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 70.1k]
  |  |  ------------------
  ------------------
 2724|  70.1k|        memset(pv_buf, 0, size);
 2725|  70.1k|        ps_dec->ps_dec_err_status = (dec_err_status_t *) pv_buf;
 2726|       |
 2727|  70.1k|        size = sizeof(dpb_commands_t);
 2728|  70.1k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2729|  70.1k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  70.1k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 70.1k]
  |  |  ------------------
  ------------------
 2730|  70.1k|        memset(pv_buf, 0, size);
 2731|  70.1k|        ps_dec->ps_dpb_cmds = (dpb_commands_t *) pv_buf;
 2732|       |
 2733|  70.1k|        size = sizeof(dec_bit_stream_t);
 2734|  70.1k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2735|  70.1k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  70.1k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 70.1k]
  |  |  ------------------
  ------------------
 2736|  70.1k|        memset(pv_buf, 0, size);
 2737|  70.1k|        ps_dec->ps_bitstrm = (dec_bit_stream_t *) pv_buf;
 2738|       |
 2739|  70.1k|        size = sizeof(dec_nal_unit_svc_ext_params_t);
 2740|  70.1k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2741|  70.1k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  70.1k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 70.1k]
  |  |  ------------------
  ------------------
 2742|  70.1k|        memset(pv_buf, 0, size);
 2743|  70.1k|        ps_svc_lyr_dec->ps_nal_svc_ext = (dec_nal_unit_svc_ext_params_t *) pv_buf;
 2744|       |
 2745|  70.1k|        size = sizeof(dec_slice_params_t);
 2746|  70.1k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2747|  70.1k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  70.1k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 70.1k]
  |  |  ------------------
  ------------------
 2748|  70.1k|        memset(pv_buf, 0, size);
 2749|  70.1k|        ps_dec->ps_cur_slice = (dec_slice_params_t *) pv_buf;
 2750|       |
 2751|  70.1k|        size = MAX(sizeof(dec_seq_params_t), sizeof(dec_pic_params_t));
  ------------------
  |  |   60|  70.1k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 70.1k, Folded]
  |  |  ------------------
  ------------------
 2752|  70.1k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2753|  70.1k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  70.1k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 70.1k]
  |  |  ------------------
  ------------------
 2754|  70.1k|        memset(pv_buf, 0, size);
 2755|  70.1k|        ps_dec->pv_scratch_sps_pps = pv_buf;
 2756|       |
 2757|  70.1k|        size = sizeof(dec_svc_seq_params_t);
 2758|  70.1k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2759|  70.1k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  70.1k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 70.1k]
  |  |  ------------------
  ------------------
 2760|  70.1k|        memset(pv_buf, 0, size);
 2761|  70.1k|        ps_svc_lyr_dec->pv_scratch_subset_sps = pv_buf;
 2762|       |
 2763|  70.1k|        ps_dec->u4_static_bits_buf_size = 256000;
 2764|  70.1k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, ps_dec->u4_static_bits_buf_size);
 2765|  70.1k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  70.1k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 70.1k]
  |  |  ------------------
  ------------------
 2766|  70.1k|        memset(pv_buf, 0, ps_dec->u4_static_bits_buf_size);
 2767|  70.1k|        ps_dec->pu1_bits_buf_static = pv_buf;
 2768|       |
 2769|  70.1k|        size = ((TOTAL_LIST_ENTRIES + PAD_MAP_IDX_POC) * sizeof(void *));
  ------------------
  |  |   95|  70.1k|#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|  70.1k|#define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  600|  70.1k|#define MAX_FRAMES              16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      size = ((TOTAL_LIST_ENTRIES + PAD_MAP_IDX_POC) * sizeof(void *));
  ------------------
  |  |  100|  70.1k|#define PAD_MAP_IDX_POC             (1)
  ------------------
 2770|  70.1k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2771|  70.1k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  70.1k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 70.1k]
  |  |  ------------------
  ------------------
 2772|  70.1k|        ps_dec->ppv_map_ref_idx_to_poc_base = pv_buf;
 2773|  70.1k|        memset(ps_dec->ppv_map_ref_idx_to_poc_base, 0, size);
 2774|       |
 2775|  70.1k|        ps_dec->ppv_map_ref_idx_to_poc = ps_dec->ppv_map_ref_idx_to_poc_base + OFFSET_MAP_IDX_POC;
  ------------------
  |  |  103|  70.1k|#define OFFSET_MAP_IDX_POC          (1)
  ------------------
 2776|       |
 2777|  70.1k|        size = (sizeof(bin_ctxt_model_t) * NUM_CABAC_CTXTS_SVC);
  ------------------
  |  |   46|  70.1k|#define NUM_CABAC_CTXTS_SVC 467
  ------------------
 2778|  70.1k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2779|  70.1k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  70.1k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 70.1k]
  |  |  ------------------
  ------------------
 2780|  70.1k|        memset(pv_buf, 0, size);
 2781|  70.1k|        ps_dec->p_cabac_ctxt_table_t = pv_buf;
 2782|       |
 2783|  70.1k|        size = sizeof(ctxt_inc_mb_info_t);
 2784|  70.1k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2785|  70.1k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  70.1k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 70.1k]
  |  |  ------------------
  ------------------
 2786|  70.1k|        memset(pv_buf, 0, size);
 2787|  70.1k|        ps_dec->ps_left_mb_ctxt_info = pv_buf;
 2788|       |
 2789|  70.1k|        size = MAX_REF_BUF_SIZE * 2;
  ------------------
  |  |   67|  70.1k|#define MAX_REF_BUF_SIZE       (3776*2*2)
  ------------------
 2790|  70.1k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2791|  70.1k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  70.1k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 70.1k]
  |  |  ------------------
  ------------------
 2792|  70.1k|        memset(pv_buf, 0, size);
 2793|  70.1k|        ps_dec->pu1_ref_buff_base = pv_buf;
 2794|  70.1k|        ps_dec->pu1_ref_buff = ps_dec->pu1_ref_buff_base + MAX_REF_BUF_SIZE;
  ------------------
  |  |   67|  70.1k|#define MAX_REF_BUF_SIZE       (3776*2*2)
  ------------------
 2795|       |
 2796|  70.1k|        size = ((sizeof(WORD16)) * PRED_BUFFER_WIDTH * PRED_BUFFER_HEIGHT * 2);
  ------------------
  |  |   55|  70.1k|#define PRED_BUFFER_WIDTH   24*2
  ------------------
                      size = ((sizeof(WORD16)) * PRED_BUFFER_WIDTH * PRED_BUFFER_HEIGHT * 2);
  ------------------
  |  |   56|  70.1k|#define PRED_BUFFER_HEIGHT  24*2
  ------------------
 2797|  70.1k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2798|  70.1k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  70.1k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 70.1k]
  |  |  ------------------
  ------------------
 2799|  70.1k|        memset(pv_buf, 0, size);
 2800|  70.1k|        ps_dec->pi2_pred1 = pv_buf;
 2801|       |
 2802|  70.1k|        size = sizeof(UWORD8) * (MB_LUM_SIZE);
  ------------------
  |  |  563|  70.1k|#define MB_LUM_SIZE                   256
  ------------------
 2803|  70.1k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2804|  70.1k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  70.1k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 70.1k]
  |  |  ------------------
  ------------------
 2805|  70.1k|        memset(pv_buf, 0, size);
 2806|  70.1k|        ps_dec->pu1_temp_mc_buffer = pv_buf;
 2807|       |
 2808|  70.1k|        size = 8 * MAX_REF_BUFS * sizeof(struct pic_buffer_t);
  ------------------
  |  |   75|  70.1k|#define MAX_REF_BUFS    32
  ------------------
 2809|  70.1k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2810|  70.1k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  70.1k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 70.1k]
  |  |  ------------------
  ------------------
 2811|  70.1k|        memset(pv_buf, 0, size);
 2812|       |
 2813|  70.1k|        ps_dec->pu1_init_dpb_base = pv_buf;
 2814|  70.1k|        pu1_buf = pv_buf;
 2815|  70.1k|        ps_dec->ps_dpb_mgr->ps_init_dpb[0][0] = (struct pic_buffer_t *) pu1_buf;
 2816|       |
 2817|  70.1k|        pu1_buf += size / 2;
 2818|  70.1k|        ps_dec->ps_dpb_mgr->ps_init_dpb[1][0] = (struct pic_buffer_t *) pu1_buf;
 2819|       |
 2820|  70.1k|        size = (sizeof(UWORD32) * 2 * 3 * ((MAX_FRAMES << 1) * (MAX_FRAMES << 1)) * 2);
  ------------------
  |  |  600|  70.1k|#define MAX_FRAMES              16
  ------------------
                      size = (sizeof(UWORD32) * 2 * 3 * ((MAX_FRAMES << 1) * (MAX_FRAMES << 1)) * 2);
  ------------------
  |  |  600|  70.1k|#define MAX_FRAMES              16
  ------------------
 2821|  70.1k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2822|  70.1k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  70.1k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 70.1k]
  |  |  ------------------
  ------------------
 2823|  70.1k|        memset(pv_buf, 0, size);
 2824|  70.1k|        ps_dec->pu4_mbaff_wt_mat = pv_buf;
 2825|       |
 2826|  70.1k|        size = sizeof(UWORD32) * 2 * 3 * ((MAX_FRAMES << 1) * (MAX_FRAMES << 1));
  ------------------
  |  |  600|  70.1k|#define MAX_FRAMES              16
  ------------------
                      size = sizeof(UWORD32) * 2 * 3 * ((MAX_FRAMES << 1) * (MAX_FRAMES << 1));
  ------------------
  |  |  600|  70.1k|#define MAX_FRAMES              16
  ------------------
 2827|  70.1k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2828|  70.1k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  70.1k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 70.1k]
  |  |  ------------------
  ------------------
 2829|  70.1k|        memset(pv_buf, 0, size);
 2830|  70.1k|        ps_dec->pu4_wts_ofsts_mat = pv_buf;
 2831|       |
 2832|  70.1k|        size = (sizeof(neighbouradd_t) << 2);
 2833|  70.1k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2834|  70.1k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  70.1k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 70.1k]
  |  |  ------------------
  ------------------
 2835|  70.1k|        memset(pv_buf, 0, size);
 2836|  70.1k|        ps_dec->ps_left_mvpred_addr = pv_buf;
 2837|       |
 2838|  70.1k|        size = ih264_buf_mgr_size();
 2839|  70.1k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2840|  70.1k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  70.1k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 70.1k]
  |  |  ------------------
  ------------------
 2841|  70.1k|        memset(pv_buf, 0, size);
 2842|  70.1k|        ps_dec->pv_mv_buf_mgr = pv_buf;
 2843|       |
 2844|  70.1k|        size = sizeof(col_mv_buf_t) * (H264_MAX_REF_PICS * 2);
  ------------------
  |  |  534|  70.1k|#define H264_MAX_REF_PICS         16
  ------------------
 2845|  70.1k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2846|  70.1k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  70.1k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 70.1k]
  |  |  ------------------
  ------------------
 2847|  70.1k|        ps_dec->ps_col_mv_base = pv_buf;
 2848|  70.1k|        memset(ps_dec->ps_col_mv_base, 0, size);
 2849|       |
 2850|  70.1k|        size = ((MB_SIZE * MB_SIZE * 3) >> 1) + MB_SIZE;
  ------------------
  |  |  554|  70.1k|#define MB_SIZE             16
  ------------------
                      size = ((MB_SIZE * MB_SIZE * 3) >> 1) + MB_SIZE;
  ------------------
  |  |  554|  70.1k|#define MB_SIZE             16
  ------------------
                      size = ((MB_SIZE * MB_SIZE * 3) >> 1) + MB_SIZE;
  ------------------
  |  |  554|  70.1k|#define MB_SIZE             16
  ------------------
 2851|  70.1k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2852|  70.1k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  70.1k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 70.1k]
  |  |  ------------------
  ------------------
 2853|  70.1k|        ps_svc_lyr_dec->pu1_ii_resamp_buffer_luma = pv_buf;
 2854|  70.1k|        ps_svc_lyr_dec->pu1_ii_resamp_buffer_chroma =
 2855|  70.1k|            ps_svc_lyr_dec->pu1_ii_resamp_buffer_luma + (MB_SIZE * MB_SIZE);
  ------------------
  |  |  554|  70.1k|#define MB_SIZE             16
  ------------------
                          ps_svc_lyr_dec->pu1_ii_resamp_buffer_luma + (MB_SIZE * MB_SIZE);
  ------------------
  |  |  554|  70.1k|#define MB_SIZE             16
  ------------------
 2856|  70.1k|        memset(ps_svc_lyr_dec->pu1_ii_resamp_buffer_luma, 0, size);
 2857|       |
 2858|  70.1k|        isvcd_init_decoder(ps_svc_lyr_dec);
 2859|  70.1k|    }
 2860|  23.3k|    return IV_SUCCESS;
 2861|  23.3k|}
isvcd_create:
 2884|  23.3k|{
 2885|  23.3k|    isvcd_create_ip_t *ps_create_ip;
 2886|  23.3k|    isvcd_create_op_t *ps_create_op;
 2887|  23.3k|    WORD32 ret;
 2888|       |
 2889|  23.3k|    ps_create_ip = (isvcd_create_ip_t *) pv_api_ip;
 2890|  23.3k|    ps_create_op = (isvcd_create_op_t *) pv_api_op;
 2891|       |
 2892|  23.3k|    ps_create_op->s_ivd_create_op_t.u4_error_code = 0;
 2893|  23.3k|    dec_hdl = NULL;
 2894|  23.3k|    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|  23.3k|    if(IV_FAIL == ret)
  ------------------
  |  Branch (2897:8): [True: 9, False: 23.3k]
  ------------------
 2898|      9|    {
 2899|      9|        if(dec_hdl)
  ------------------
  |  Branch (2899:12): [True: 0, False: 9]
  ------------------
 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|      9|        ps_create_op->s_ivd_create_op_t.u4_error_code = IVD_MEM_ALLOC_FAILED;
 2916|      9|        ps_create_op->s_ivd_create_op_t.u4_error_code |= 1 << IVD_FATALERROR;
 2917|      9|        return IV_FAIL;
 2918|      9|    }
 2919|       |
 2920|  23.3k|    return IV_SUCCESS;
 2921|  23.3k|}
isvcd_update_dqid:
 2951|   238k|{
 2952|   238k|    vcl_node_t *ps_vcl_node;
 2953|       |
 2954|       |    /* sanity checks */
 2955|   238k|    if((NULL == ps_cur_lyr_node) || (NULL == pps_bot_lyr_node))
  ------------------
  |  Branch (2955:8): [True: 0, False: 238k]
  |  Branch (2955:37): [True: 0, False: 238k]
  ------------------
 2956|      0|    {
 2957|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 2958|      0|    }
 2959|       |
 2960|   238k|    ps_vcl_node = ps_cur_lyr_node->ps_bot_node;
 2961|   238k|    while(NULL != ps_vcl_node)
  ------------------
  |  Branch (2961:11): [True: 77.6k, False: 160k]
  ------------------
 2962|  77.6k|    {
 2963|  77.6k|        WORD32 i4_dqid;
 2964|       |
 2965|  77.6k|        i4_dqid = (ps_vcl_node->i4_dependency_id << 4) + ps_vcl_node->i4_quality_id;
 2966|       |
 2967|       |        /* if reference layer DQ ID matches */
 2968|       |        /* or reference layer is a layer below reference dq id layer */
 2969|  77.6k|        if((i4_dqid == i4_ref_lyr_dqid) ||
  ------------------
  |  Branch (2969:12): [True: 65.6k, False: 11.9k]
  ------------------
 2970|  11.9k|           (ps_vcl_node->i4_quality_id < (i4_ref_lyr_dqid & 0x0F)) ||
  ------------------
  |  Branch (2970:12): [True: 11.8k, False: 175]
  ------------------
 2971|    175|           (ps_vcl_node->i4_dependency_id < (i4_ref_lyr_dqid >> 4)))
  ------------------
  |  Branch (2971:12): [True: 69, False: 106]
  ------------------
 2972|  77.5k|        {
 2973|  77.5k|            break;
 2974|  77.5k|        }
 2975|    106|        ps_vcl_node = ps_vcl_node->ps_bot_node;
 2976|    106|    }
 2977|       |
 2978|       |    /* Update the top and bottom node of ref layer and current layer nodes */
 2979|       |
 2980|   238k|    if(NULL != ps_vcl_node)
  ------------------
  |  Branch (2980:8): [True: 77.5k, False: 160k]
  ------------------
 2981|  77.5k|    {
 2982|  77.5k|        ps_cur_lyr_node->ps_bot_node = ps_vcl_node;
 2983|  77.5k|        ps_vcl_node->ps_top_node = ps_cur_lyr_node;
 2984|  77.5k|    }
 2985|       |
 2986|       |    /* Update pointer to bottom VCL node */
 2987|   238k|    *pps_bot_lyr_node = ps_vcl_node;
 2988|   238k|    return (OK);
  ------------------
  |  |  114|   238k|#define OK        0
  ------------------
 2989|   238k|}
isvcd_detect_res_change:
 3017|   238k|{
 3018|   238k|    UWORD16 u2_scaled_ref_width_sps;
 3019|   238k|    UWORD16 u2_scaled_ref_ht_sps;
 3020|   238k|    UNUSED(ps_prev_subset_sps);
  ------------------
  |  |   45|   238k|#define UNUSED(x) ((void)(x))
  ------------------
 3021|       |
 3022|   238k|    if(NULL == ps_prev_sps)
  ------------------
  |  Branch (3022:8): [True: 160k, False: 77.4k]
  ------------------
 3023|   160k|    {
 3024|       |        /* indicates bottom most layer in Access unit */
 3025|   160k|        return (SVCD_FALSE);
  ------------------
  |  |   45|   160k|#define SVCD_FALSE 0
  ------------------
 3026|   160k|    }
 3027|       |    /* Check for the ESS idc */
 3028|  77.4k|    if(2 == ps_curr_subset_sps->s_sps_svc_ext.u1_extended_spatial_scalability_idc)
  ------------------
  |  Branch (3028:8): [True: 254, False: 77.1k]
  ------------------
 3029|    254|    {
 3030|    254|        return (SVCD_TRUE);
  ------------------
  |  |   46|    254|#define SVCD_TRUE 1
  ------------------
 3031|    254|    }
 3032|       |
 3033|       |    /* Calculate the scaled reference width and height */
 3034|  77.1k|    u2_scaled_ref_width_sps = (ps_curr_sps->u2_frm_wd_in_mbs << 4);
 3035|  77.1k|    u2_scaled_ref_width_sps -=
 3036|  77.1k|        (ps_curr_subset_sps->s_sps_svc_ext.i4_seq_scaled_ref_layer_left_offset +
 3037|  77.1k|         ps_curr_subset_sps->s_sps_svc_ext.i4_seq_scaled_ref_layer_right_offset);
 3038|       |
 3039|  77.1k|    u2_scaled_ref_ht_sps = (ps_curr_sps->u2_frm_ht_in_mbs << 4);
 3040|  77.1k|    u2_scaled_ref_ht_sps -=
 3041|  77.1k|        (ps_curr_subset_sps->s_sps_svc_ext.i4_seq_scaled_ref_layer_top_offset +
 3042|  77.1k|         ps_curr_subset_sps->s_sps_svc_ext.i4_seq_scaled_ref_layer_bottom_offset);
 3043|       |
 3044|       |    /* Check for frame width being different */
 3045|  77.1k|    if(u2_scaled_ref_width_sps != (ps_prev_sps->u2_frm_wd_in_mbs << 4))
  ------------------
  |  Branch (3045:8): [True: 54.4k, False: 22.7k]
  ------------------
 3046|  54.4k|    {
 3047|  54.4k|        return (SVCD_TRUE);
  ------------------
  |  |   46|  54.4k|#define SVCD_TRUE 1
  ------------------
 3048|  54.4k|    }
 3049|       |
 3050|       |    /* Check for frame height being different */
 3051|  22.7k|    if(u2_scaled_ref_ht_sps != (ps_prev_sps->u2_frm_ht_in_mbs << 4))
  ------------------
  |  Branch (3051:8): [True: 748, False: 22.0k]
  ------------------
 3052|    748|    {
 3053|    748|        return (SVCD_TRUE);
  ------------------
  |  |   46|    748|#define SVCD_TRUE 1
  ------------------
 3054|    748|    }
 3055|       |
 3056|       |    /* check for crop offset not MB aligned */
 3057|  22.0k|    if((0 != (ps_curr_subset_sps->s_sps_svc_ext.i4_seq_scaled_ref_layer_left_offset & 15)) ||
  ------------------
  |  Branch (3057:8): [True: 0, False: 22.0k]
  ------------------
 3058|  22.0k|       (0 != (ps_curr_subset_sps->s_sps_svc_ext.i4_seq_scaled_ref_layer_top_offset & 15)))
  ------------------
  |  Branch (3058:8): [True: 0, False: 22.0k]
  ------------------
 3059|      0|    {
 3060|      0|        return (SVCD_TRUE);
  ------------------
  |  |   46|      0|#define SVCD_TRUE 1
  ------------------
 3061|      0|    }
 3062|       |
 3063|       |    /* check for chroma Phase Y being different */
 3064|  22.0k|    if(ps_curr_subset_sps->s_sps_svc_ext.u1_chroma_phase_x_plus1_flag !=
  ------------------
  |  Branch (3064:8): [True: 911, False: 21.0k]
  ------------------
 3065|  22.0k|       ps_curr_subset_sps->s_sps_svc_ext.u1_seq_ref_layer_chroma_phase_x_plus1_flag)
 3066|    911|    {
 3067|    911|        return (SVCD_TRUE);
  ------------------
  |  |   46|    911|#define SVCD_TRUE 1
  ------------------
 3068|    911|    }
 3069|       |
 3070|       |    /* check for chroma Phase Y being different */
 3071|  21.0k|    if(ps_curr_subset_sps->s_sps_svc_ext.u1_chroma_phase_y_plus1 !=
  ------------------
  |  Branch (3071:8): [True: 205, False: 20.8k]
  ------------------
 3072|  21.0k|       ps_curr_subset_sps->s_sps_svc_ext.u1_seq_ref_layer_chroma_phase_y_plus1)
 3073|    205|    {
 3074|    205|        return (SVCD_TRUE);
  ------------------
  |  |   46|    205|#define SVCD_TRUE 1
  ------------------
 3075|    205|    }
 3076|       |
 3077|       |    /* If none of the above are true then there is no resolution change */
 3078|  20.8k|    return (SVCD_FALSE);
  ------------------
  |  |   45|  20.8k|#define SVCD_FALSE 0
  ------------------
 3079|  21.0k|}
isvcd_parse_ref_pic_list_modify:
 3107|  50.1k|{
 3108|  50.1k|    WORD32 i4_mod_flag;
 3109|  50.1k|    UWORD16 ui_nextUev;
 3110|  50.1k|    WORD32 i4_num_sets_ctr = 0;
 3111|  50.1k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
 3112|  50.1k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
 3113|       |
 3114|  50.1k|    if(I_SLICE != ps_slice_prms->u1_slice_type)
  ------------------
  |  |  370|  50.1k|#define I_SLICE  2
  ------------------
  |  Branch (3114:8): [True: 40.9k, False: 9.21k]
  ------------------
 3115|  40.9k|    {
 3116|       |        /* ref_pic_list_modification_flag_l0 */
 3117|  40.9k|        i4_mod_flag = ih264d_get_bit_h264(ps_bitstrm);
 3118|       |
 3119|  40.9k|        if(0 != i4_mod_flag)
  ------------------
  |  Branch (3119:12): [True: 13.3k, False: 27.6k]
  ------------------
 3120|  13.3k|        {
 3121|  13.3k|            WORD32 i4_mod_pic_num_idc;
 3122|       |
 3123|  13.3k|            i4_num_sets_ctr = 0;
 3124|  13.3k|            do
 3125|  90.4k|            {
 3126|       |                /* modification_of_pic_nums_idc */
 3127|  90.4k|                i4_mod_pic_num_idc = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3128|       |
 3129|  90.4k|                if((i4_mod_pic_num_idc > 3) || (i4_mod_pic_num_idc < 0))
  ------------------
  |  Branch (3129:20): [True: 6.31k, False: 84.1k]
  |  Branch (3129:48): [True: 188, False: 83.9k]
  ------------------
 3130|  6.49k|                {
 3131|  6.49k|                    return ERROR_INV_SLICE_HDR_T;
 3132|  6.49k|                }
 3133|  83.9k|                if(3 != i4_mod_pic_num_idc)
  ------------------
  |  Branch (3133:20): [True: 81.8k, False: 2.03k]
  ------------------
 3134|  81.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|  81.8k|                    ui_nextUev = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3139|  81.8k|                    if(ui_nextUev > (ps_curr_sps->u2_u4_max_pic_num_minus1 + 1))
  ------------------
  |  Branch (3139:24): [True: 1.61k, False: 80.2k]
  ------------------
 3140|  1.61k|                        return ERROR_INV_SLICE_HDR_T;
 3141|  81.8k|                }
 3142|       |
 3143|  82.3k|                i4_num_sets_ctr++;
 3144|       |
 3145|       |                /* if the number of commands recieved exceeds max limit */
 3146|  82.3k|                if((H264_MAX_REF_PICS) == i4_num_sets_ctr) break;
  ------------------
  |  |  534|  82.3k|#define H264_MAX_REF_PICS         16
  ------------------
  |  Branch (3146:20): [True: 3.21k, False: 79.1k]
  ------------------
 3147|       |
 3148|  82.3k|            } while(3 != i4_mod_pic_num_idc);
  ------------------
  |  Branch (3148:21): [True: 77.0k, False: 2.03k]
  ------------------
 3149|  13.3k|        }
 3150|       |
 3151|       |        /*********** if (I_SLICE != u1_slice_type) ***************************/
 3152|  40.9k|    }
 3153|       |
 3154|  42.0k|    if(B_SLICE != ps_slice_prms->u1_slice_type)
  ------------------
  |  |  369|  42.0k|#define B_SLICE  1
  ------------------
  |  Branch (3154:8): [True: 26.7k, False: 15.3k]
  ------------------
 3155|  26.7k|    {
 3156|  26.7k|        return (OK);
  ------------------
  |  |  114|  26.7k|#define OK        0
  ------------------
 3157|  26.7k|    }
 3158|       |
 3159|       |    /* ref_pic_list_modification_flag_l1 */
 3160|  15.3k|    i4_mod_flag = ih264d_get_bit_h264(ps_bitstrm);
 3161|       |
 3162|  15.3k|    if(0 != i4_mod_flag)
  ------------------
  |  Branch (3162:8): [True: 4.33k, False: 10.9k]
  ------------------
 3163|  4.33k|    {
 3164|  4.33k|        WORD32 i4_mod_pic_num_idc;
 3165|       |
 3166|  4.33k|        do
 3167|  35.3k|        {
 3168|       |            /* modification_of_pic_nums_idc */
 3169|  35.3k|            i4_mod_pic_num_idc = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3170|       |
 3171|  35.3k|            if((i4_mod_pic_num_idc > 3) || (i4_mod_pic_num_idc < 0))
  ------------------
  |  Branch (3171:16): [True: 3.26k, False: 32.1k]
  |  Branch (3171:44): [True: 26, False: 32.0k]
  ------------------
 3172|  3.29k|            {
 3173|  3.29k|                return ERROR_INV_SLICE_HDR_T;
 3174|  3.29k|            }
 3175|  32.0k|            if(3 != i4_mod_pic_num_idc)
  ------------------
  |  Branch (3175:16): [True: 31.7k, False: 364]
  ------------------
 3176|  31.7k|            {
 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|  31.7k|                ui_nextUev = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3181|  31.7k|                if(ui_nextUev > (ps_curr_sps->u2_u4_max_pic_num_minus1 + 1))
  ------------------
  |  Branch (3181:20): [True: 466, False: 31.2k]
  ------------------
 3182|    466|                    return ERROR_INV_SLICE_HDR_T;
 3183|  31.7k|            }
 3184|       |
 3185|  31.6k|            i4_num_sets_ctr++;
 3186|       |
 3187|       |            /* if the number of commands recieved exceeds max limit */
 3188|  31.6k|            if((H264_MAX_REF_PICS) == i4_num_sets_ctr) break;
  ------------------
  |  |  534|  31.6k|#define H264_MAX_REF_PICS         16
  ------------------
  |  Branch (3188:16): [True: 215, False: 31.4k]
  ------------------
 3189|       |
 3190|  31.6k|        } while(3 != i4_mod_pic_num_idc);
  ------------------
  |  Branch (3190:17): [True: 31.0k, False: 364]
  ------------------
 3191|  4.33k|    }
 3192|       |
 3193|  11.5k|    return (OK);
  ------------------
  |  |  114|  11.5k|#define OK        0
  ------------------
 3194|  15.3k|}
isvcd_parse_slice_hdr_refdq_id:
 3228|  58.9k|{
 3229|  58.9k|    UWORD8 u1_pps_id;
 3230|  58.9k|    WORD32 i_temp;
 3231|  58.9k|    UWORD32 u4_temp;
 3232|  58.9k|    WORD32 i4_nal_unit_type;
 3233|  58.9k|    WORD32 i4_nal_ref_idc, i4_quality_id;
 3234|  58.9k|    WORD32 i4_use_ref_base, i4_idr_pic_flag;
 3235|  58.9k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
 3236|  58.9k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
 3237|  58.9k|    dec_svc_seq_params_t *ps_subset_sps = NULL;
 3238|  58.9k|    WORD32 ret = OK;
  ------------------
  |  |  114|  58.9k|#define OK        0
  ------------------
 3239|       |
 3240|  58.9k|    i4_nal_unit_type = ps_vcl_node->i4_nal_unit_type;
 3241|  58.9k|    i4_nal_ref_idc = ps_vcl_node->i4_nal_ref_idc;
 3242|  58.9k|    i4_quality_id = ps_vcl_node->i4_quality_id;
 3243|  58.9k|    i4_use_ref_base = ps_vcl_node->i4_use_ref_base;
 3244|  58.9k|    i4_idr_pic_flag = ps_vcl_node->i4_idr_pic_flag;
 3245|       |
 3246|       |    /*-----------------------------------------------------------------------*/
 3247|       |    /*--------------------- first mb in slice -------------------------------*/
 3248|       |    /*-----------------------------------------------------------------------*/
 3249|  58.9k|    ps_slice_prms->u2_first_mb_in_slice = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3250|       |
 3251|       |    /*-----------------------------------------------------------------------*/
 3252|       |    /*---------------------------- slice type -------------------------------*/
 3253|       |    /*-----------------------------------------------------------------------*/
 3254|  58.9k|    ps_slice_prms->u1_slice_type = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3255|  58.9k|    if(ps_slice_prms->u1_slice_type > 4)
  ------------------
  |  Branch (3255:8): [True: 2.34k, False: 56.6k]
  ------------------
 3256|  2.34k|    {
 3257|  2.34k|        ps_slice_prms->u1_slice_type -= 5;
 3258|  2.34k|    }
 3259|       |
 3260|       |    /*-----------------------------------------------------------------------*/
 3261|       |    /*----------------------------- PPS id ----------------------------------*/
 3262|       |    /*-----------------------------------------------------------------------*/
 3263|  58.9k|    u1_pps_id = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3264|       |
 3265|       |    /* set correspoding sps and pps id also */
 3266|  58.9k|    ps_pps += u1_pps_id;
 3267|  58.9k|    if(FALSE == ps_pps->u1_is_valid)
  ------------------
  |  |  592|  58.9k|#define FALSE   0
  ------------------
  |  Branch (3267:8): [True: 2.95k, False: 56.0k]
  ------------------
 3268|  2.95k|    {
 3269|  2.95k|        return ERROR_INV_SLICE_HDR_T;
 3270|  2.95k|    }
 3271|  56.0k|    ps_sps = ps_pps->ps_sps;
 3272|  56.0k|    ps_subset_sps = &ps_svcd_ctxt->ps_subset_sps[ps_sps->u1_seq_parameter_set_id];
 3273|  56.0k|    if(CODED_SLICE_EXTENSION_NAL == i4_nal_unit_type)
  ------------------
  |  |   66|  56.0k|#define CODED_SLICE_EXTENSION_NAL 20
  ------------------
  |  Branch (3273:8): [True: 55.1k, False: 932]
  ------------------
 3274|  55.1k|    {
 3275|  55.1k|        ps_sps += MAX_NUM_SEQ_PARAMS;
  ------------------
  |  |  521|  55.1k|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
 3276|  55.1k|        ps_subset_sps =
 3277|  55.1k|            &ps_svcd_ctxt->ps_subset_sps[MAX_NUM_SEQ_PARAMS + ps_sps->u1_seq_parameter_set_id];
  ------------------
  |  |  521|  55.1k|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
 3278|  55.1k|    }
 3279|       |    /*-----------------------------------------------------------------------*/
 3280|       |    /*--------------------------- frm num -----------------------------------*/
 3281|       |    /*-----------------------------------------------------------------------*/
 3282|  56.0k|    if(!ps_sps) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (3282:8): [True: 0, False: 56.0k]
  ------------------
 3283|  56.0k|    if(FALSE == ps_sps->u1_is_valid) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  |  592|  56.0k|#define FALSE   0
  ------------------
  |  Branch (3283:8): [True: 2.48k, False: 53.5k]
  ------------------
 3284|       |
 3285|  53.5k|    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|  53.5k|    if(SVCD_TRUE != ps_sps->u1_frame_mbs_only_flag)
  ------------------
  |  |   46|  53.5k|#define SVCD_TRUE 1
  ------------------
  |  Branch (3290:8): [True: 319, False: 53.2k]
  ------------------
 3291|    319|    {
 3292|    319|        return ERROR_INV_SLICE_HDR_T;
 3293|    319|    }
 3294|       |    /*-----------------------------------------------------------------------*/
 3295|       |    /*--------------------------- IDR pic id --------------------------------*/
 3296|       |    /*-----------------------------------------------------------------------*/
 3297|  53.2k|    if(SVCD_TRUE == i4_idr_pic_flag)
  ------------------
  |  |   46|  53.2k|#define SVCD_TRUE 1
  ------------------
  |  Branch (3297:8): [True: 44.9k, False: 8.26k]
  ------------------
 3298|  44.9k|    {
 3299|  44.9k|        UWORD32 u4_idr_pic_id = 0;
 3300|  44.9k|        u4_idr_pic_id = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3301|  44.9k|        if(u4_idr_pic_id > 65535) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (3301:12): [True: 1.48k, False: 43.4k]
  ------------------
 3302|  44.9k|    }
 3303|       |
 3304|       |    /*-----------------------------------------------------------------------*/
 3305|       |    /*----------------- poc lsb and delts_poc_bottom ------------------------*/
 3306|       |    /*-----------------------------------------------------------------------*/
 3307|  51.7k|    if(0 == ps_sps->u1_pic_order_cnt_type)
  ------------------
  |  Branch (3307:8): [True: 46.9k, False: 4.84k]
  ------------------
 3308|  46.9k|    {
 3309|  46.9k|        i_temp = ih264d_get_bits_h264(ps_bitstrm, ps_sps->u1_log2_max_pic_order_cnt_lsb_minus);
 3310|       |
 3311|  46.9k|        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: 46.9k]
  |  Branch (3311:26): [True: 0, False: 46.9k]
  ------------------
 3312|  46.9k|        if(SVCD_TRUE == ps_pps->u1_pic_order_present_flag)
  ------------------
  |  |   46|  46.9k|#define SVCD_TRUE 1
  ------------------
  |  Branch (3312:12): [True: 7.04k, False: 39.8k]
  ------------------
 3313|  7.04k|        {
 3314|  7.04k|            i_temp = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3315|  7.04k|        }
 3316|  46.9k|    }
 3317|       |
 3318|       |    /*-----------------------------------------------------------------------*/
 3319|       |    /*---------------- delta_poc_count[0] and [1] ---------------------------*/
 3320|       |    /*-----------------------------------------------------------------------*/
 3321|  51.7k|    if((1 == ps_sps->u1_pic_order_cnt_type) && (!ps_sps->u1_delta_pic_order_always_zero_flag))
  ------------------
  |  Branch (3321:8): [True: 3.62k, False: 48.1k]
  |  Branch (3321:48): [True: 2.56k, False: 1.05k]
  ------------------
 3322|  2.56k|    {
 3323|  2.56k|        i_temp = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3324|       |
 3325|  2.56k|        if(ps_pps->u1_pic_order_present_flag)
  ------------------
  |  Branch (3325:12): [True: 1.53k, False: 1.02k]
  ------------------
 3326|  1.53k|        {
 3327|  1.53k|            i_temp = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3328|  1.53k|        }
 3329|  2.56k|    }
 3330|       |
 3331|       |    /*-----------------------------------------------------------------------*/
 3332|       |    /*---------------------- redundant pic cnt ------------------------------*/
 3333|       |    /*-----------------------------------------------------------------------*/
 3334|  51.7k|    if(ps_pps->u1_redundant_pic_cnt_present_flag)
  ------------------
  |  Branch (3334:8): [True: 16.9k, False: 34.8k]
  ------------------
 3335|  16.9k|    {
 3336|  16.9k|        u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3337|  16.9k|        if(u4_temp > MAX_REDUNDANT_PIC_CNT) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  |  611|  16.9k|#define MAX_REDUNDANT_PIC_CNT       127
  ------------------
  |  Branch (3337:12): [True: 675, False: 16.2k]
  ------------------
 3338|  16.9k|    }
 3339|       |    /*-----------------------------------------------------------------------*/
 3340|       |    /*-----------------Direct_spatial_mv_pred_flag --------------------------*/
 3341|       |    /*-----------------num ref active override flag -------------------------*/
 3342|       |    /*-----------------num_ref_idx_active_l0&1 ------------------------------*/
 3343|       |    /*-----------------------------------------------------------------------*/
 3344|  51.0k|    if(0 == i4_quality_id)
  ------------------
  |  Branch (3344:8): [True: 51.0k, False: 0]
  ------------------
 3345|  51.0k|    {
 3346|  51.0k|        if(B_SLICE == ps_slice_prms->u1_slice_type)
  ------------------
  |  |  369|  51.0k|#define B_SLICE  1
  ------------------
  |  Branch (3346:12): [True: 19.0k, False: 31.9k]
  ------------------
 3347|  19.0k|        {
 3348|  19.0k|            ps_slice_prms->u1_direct_spatial_mv_pred_flag = ih264d_get_bit_h264(ps_bitstrm);
 3349|  19.0k|        }
 3350|       |
 3351|  51.0k|        if((P_SLICE == ps_slice_prms->u1_slice_type) || (B_SLICE == ps_slice_prms->u1_slice_type))
  ------------------
  |  |  368|  51.0k|#define P_SLICE  0
  ------------------
                      if((P_SLICE == ps_slice_prms->u1_slice_type) || (B_SLICE == ps_slice_prms->u1_slice_type))
  ------------------
  |  |  369|  28.9k|#define B_SLICE  1
  ------------------
  |  Branch (3351:12): [True: 22.1k, False: 28.9k]
  |  Branch (3351:57): [True: 19.0k, False: 9.87k]
  ------------------
 3352|  41.2k|        {
 3353|  41.2k|            WORD8 i1_over_ride_flag;
 3354|  41.2k|            i1_over_ride_flag = ih264d_get_bit_h264(ps_bitstrm);
 3355|       |
 3356|  41.2k|            ps_slice_prms->u1_num_ref_idx_active_override_flag = i1_over_ride_flag;
 3357|       |
 3358|  41.2k|            if(SVCD_TRUE == i1_over_ride_flag)
  ------------------
  |  |   46|  41.2k|#define SVCD_TRUE 1
  ------------------
  |  Branch (3358:16): [True: 20.1k, False: 21.0k]
  ------------------
 3359|  20.1k|            {
 3360|  20.1k|                UWORD8 u8_ref_idx_l0;
 3361|  20.1k|                u8_ref_idx_l0 = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3362|  20.1k|                if(u8_ref_idx_l0 > H264_MAX_REF_PICS)
  ------------------
  |  |  534|  20.1k|#define H264_MAX_REF_PICS         16
  ------------------
  |  Branch (3362:20): [True: 570, False: 19.5k]
  ------------------
 3363|    570|                {
 3364|    570|                    return ERROR_NUM_REF;
 3365|    570|                }
 3366|  19.5k|                if(B_SLICE == ps_slice_prms->u1_slice_type)
  ------------------
  |  |  369|  19.5k|#define B_SLICE  1
  ------------------
  |  Branch (3366:20): [True: 7.61k, False: 11.9k]
  ------------------
 3367|  7.61k|                {
 3368|  7.61k|                    UWORD8 u8_ref_idx_l1;
 3369|  7.61k|                    u8_ref_idx_l1 = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3370|  7.61k|                    if(u8_ref_idx_l1 > H264_MAX_REF_PICS)
  ------------------
  |  |  534|  7.61k|#define H264_MAX_REF_PICS         16
  ------------------
  |  Branch (3370:24): [True: 321, False: 7.29k]
  ------------------
 3371|    321|                    {
 3372|    321|                        return ERROR_NUM_REF;
 3373|    321|                    }
 3374|  7.61k|                }
 3375|  19.5k|            }
 3376|  41.2k|        }
 3377|       |
 3378|       |        /*-----------------------------------------------------------------------*/
 3379|       |        /*---------------------- ref pic list modification ----------------------*/
 3380|       |        /*-----------------------------------------------------------------------*/
 3381|  50.1k|        {
 3382|  50.1k|            ret = isvcd_parse_ref_pic_list_modify(ps_bitstrm, ps_slice_prms, ps_sps);
 3383|  50.1k|            if(OK != ret) return ret;
  ------------------
  |  |  114|  50.1k|#define OK        0
  ------------------
  |  Branch (3383:16): [True: 11.8k, False: 38.3k]
  ------------------
 3384|  50.1k|        }
 3385|       |
 3386|  38.3k|        if(((1 == ps_pps->u1_wted_pred_flag) && (P_SLICE == ps_slice_prms->u1_slice_type)) ||
  ------------------
  |  |  368|  5.72k|#define P_SLICE  0
  ------------------
  |  Branch (3386:13): [True: 5.72k, False: 32.5k]
  |  Branch (3386:49): [True: 2.60k, False: 3.12k]
  ------------------
 3387|  35.7k|           ((B_SLICE == ps_slice_prms->u1_slice_type) && (1 == ps_pps->u1_wted_bipred_idc)))
  ------------------
  |  |  369|  35.7k|#define B_SLICE  1
  ------------------
  |  Branch (3387:13): [True: 11.5k, False: 24.1k]
  |  Branch (3387:58): [True: 4.14k, False: 7.42k]
  ------------------
 3388|  6.74k|        {
 3389|  6.74k|            if((ps_slice_prms->u1_num_ref_idx_lx_active[0] >= H264_MAX_REF_IDX) ||
  ------------------
  |  |  535|  6.74k|#define H264_MAX_REF_IDX          32
  ------------------
  |  Branch (3389:16): [True: 0, False: 6.74k]
  ------------------
 3390|  6.74k|               (ps_slice_prms->u1_num_ref_idx_lx_active[1] >= H264_MAX_REF_IDX))
  ------------------
  |  |  535|  6.74k|#define H264_MAX_REF_IDX          32
  ------------------
  |  Branch (3390:16): [True: 0, False: 6.74k]
  ------------------
 3391|      0|            {
 3392|      0|                return ERROR_NUM_REF;
 3393|      0|            }
 3394|       |            /*-------------------------------------------------------------------*/
 3395|       |            /*------------------------- Pred weight table -----------------------*/
 3396|       |            /*-------------------------------------------------------------------*/
 3397|  6.74k|            if(CODED_SLICE_EXTENSION_NAL == i4_nal_unit_type)
  ------------------
  |  |   66|  6.74k|#define CODED_SLICE_EXTENSION_NAL 20
  ------------------
  |  Branch (3397:16): [True: 6.56k, False: 181]
  ------------------
 3398|  6.56k|            {
 3399|  6.56k|                WORD32 i4_base_pred_wt_tbl_flag = 1;
 3400|       |
 3401|       |                /* base_pred_weight_table_flag */
 3402|  6.56k|                if(0 == i4_no_int_lyr_pred)
  ------------------
  |  Branch (3402:20): [True: 6.49k, False: 66]
  ------------------
 3403|  6.49k|                {
 3404|  6.49k|                    i4_base_pred_wt_tbl_flag = ih264d_get_bit_h264(ps_bitstrm);
 3405|  6.49k|                }
 3406|       |
 3407|  6.56k|                if((1 == i4_no_int_lyr_pred) || (0 == i4_base_pred_wt_tbl_flag))
  ------------------
  |  Branch (3407:20): [True: 66, False: 6.49k]
  |  Branch (3407:49): [True: 5.21k, False: 1.28k]
  ------------------
 3408|  5.27k|                {
 3409|  5.27k|                    ret = ih264d_parse_pred_weight_table(ps_slice_prms, ps_bitstrm);
 3410|  5.27k|                    if(ret != OK) return ret;
  ------------------
  |  |  114|  5.27k|#define OK        0
  ------------------
  |  Branch (3410:24): [True: 2.59k, False: 2.68k]
  ------------------
 3411|  5.27k|                }
 3412|  6.56k|            }
 3413|    181|            else
 3414|    181|            {
 3415|    181|                ret = ih264d_parse_pred_weight_table(ps_slice_prms, ps_bitstrm);
 3416|    181|                if(ret != OK) return ret;
  ------------------
  |  |  114|    181|#define OK        0
  ------------------
  |  Branch (3416:20): [True: 97, False: 84]
  ------------------
 3417|    181|            }
 3418|  6.74k|        }
 3419|       |
 3420|       |        /*-----------------------------------------------------------------------*/
 3421|       |        /*------------------------- ref pic marking -----------------------------*/
 3422|       |        /*-----------------------------------------------------------------------*/
 3423|  35.6k|        if(0 != i4_nal_ref_idc)
  ------------------
  |  Branch (3423:12): [True: 28.2k, False: 7.36k]
  ------------------
 3424|  28.2k|        {
 3425|  28.2k|            dec_struct_t *ps_dec;
 3426|  28.2k|            svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 3427|  28.2k|            UWORD8 u1_store_ref_base_pic;
 3428|  28.2k|            ps_svc_lyr_dec = ps_svcd_ctxt->ps_svc_dec_lyr;
 3429|  28.2k|            ps_dec = &ps_svc_lyr_dec->s_dec;
 3430|  28.2k|            {
 3431|  28.2k|                dec_seq_params_t *ps_sps_tmp = ps_pps->ps_sps;
 3432|       |
 3433|  28.2k|                ps_dec->u1_nal_unit_type = i4_nal_unit_type;
 3434|  28.2k|                ps_svc_lyr_dec->ps_nal_svc_ext->u1_idr_flag = i4_idr_pic_flag;
 3435|  28.2k|                ps_dec->ps_cur_sps = ps_sps;
 3436|  28.2k|                ps_dec->ps_cur_pps = ps_pps;
 3437|  28.2k|                ps_pps->ps_sps = ps_sps;
 3438|       |
 3439|  28.2k|                if(ps_svc_lyr_dec->ps_nal_svc_ext->u1_idr_flag)
  ------------------
  |  Branch (3439:20): [True: 22.3k, False: 5.94k]
  ------------------
 3440|  22.3k|                    ps_dec->u1_nal_unit_type = IDR_SLICE_NAL;
  ------------------
  |  |  328|  22.3k|#define IDR_SLICE_NAL                   5
  ------------------
 3441|       |
 3442|  28.2k|                i_temp = ih264d_read_mmco_commands(ps_dec);
 3443|  28.2k|                ps_pps->ps_sps = ps_sps_tmp;
 3444|  28.2k|                ps_dec->u1_nal_unit_type = i4_nal_unit_type;
 3445|  28.2k|                if(i_temp < 0)
  ------------------
  |  Branch (3445:20): [True: 212, False: 28.0k]
  ------------------
 3446|    212|                {
 3447|    212|                    return ERROR_DBP_MANAGER_T;
 3448|    212|                }
 3449|  28.0k|                ps_dec->u4_bitoffset = i_temp;
 3450|  28.0k|            }
 3451|       |
 3452|  28.0k|            if(0 == ps_subset_sps->s_sps_svc_ext.u1_slice_header_restriction_flag)
  ------------------
  |  Branch (3452:16): [True: 20.5k, False: 7.44k]
  ------------------
 3453|  20.5k|            {
 3454|       |                /* store_ref_base_pic_flag */
 3455|  20.5k|                u1_store_ref_base_pic = ih264d_get_bit_h264(ps_bitstrm);
 3456|  20.5k|                if(0 != u1_store_ref_base_pic)
  ------------------
  |  Branch (3456:20): [True: 4.29k, False: 16.2k]
  ------------------
 3457|  4.29k|                {
 3458|  4.29k|                    return ERROR_INV_SLICE_HDR_T;
 3459|  4.29k|                }
 3460|       |
 3461|  16.2k|                if(((1 == i4_use_ref_base) || (1 == u1_store_ref_base_pic)) &&
  ------------------
  |  Branch (3461:21): [True: 0, False: 16.2k]
  |  Branch (3461:47): [True: 0, False: 16.2k]
  ------------------
 3462|      0|                   (SVCD_FALSE == i4_idr_pic_flag))
  ------------------
  |  |   45|      0|#define SVCD_FALSE 0
  ------------------
  |  Branch (3462:20): [True: 0, False: 0]
  ------------------
 3463|      0|                {
 3464|      0|                    i_temp = isvcd_dec_ref_base_pic_marking(
 3465|      0|                        &ps_svc_lyr_dec->s_svc_slice_params.s_ref_base_pic_marking_svc_ext,
 3466|      0|                        ps_bitstrm);
 3467|      0|                    if(i_temp != OK)
  ------------------
  |  |  114|      0|#define OK        0
  ------------------
  |  Branch (3467:24): [True: 0, False: 0]
  ------------------
 3468|      0|                    {
 3469|      0|                        return i_temp;
 3470|      0|                    }
 3471|      0|                }
 3472|       |                /******* End of if (SVC_VCL_NAL == i4_nal_unit_type) *********/
 3473|  16.2k|            }
 3474|       |            /******** End of if(0 != i4_nal_ref_idc) *************************/
 3475|  28.0k|        }
 3476|       |        /************* End of if(0 == i4_quality_id) *************************/
 3477|  35.6k|    }
 3478|       |
 3479|       |    /*-----------------------------------------------------------------------*/
 3480|       |    /*--------------------------- cabac int idc -----------------------------*/
 3481|       |    /*-----------------------------------------------------------------------*/
 3482|  31.1k|    if((ps_pps->u1_entropy_coding_mode == CABAC) && (I_SLICE != ps_slice_prms->u1_slice_type))
  ------------------
  |  |  339|  31.1k|#define CABAC  1
  ------------------
                  if((ps_pps->u1_entropy_coding_mode == CABAC) && (I_SLICE != ps_slice_prms->u1_slice_type))
  ------------------
  |  |  370|  5.01k|#define I_SLICE  2
  ------------------
  |  Branch (3482:8): [True: 5.01k, False: 26.0k]
  |  Branch (3482:53): [True: 3.14k, False: 1.86k]
  ------------------
 3483|  3.14k|    {
 3484|  3.14k|        ps_slice_prms->u1_cabac_init_idc = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3485|  3.14k|        if(ps_slice_prms->u1_cabac_init_idc > MAX_CABAC_INIT_IDC)
  ------------------
  |  |  537|  3.14k|#define MAX_CABAC_INIT_IDC        2
  ------------------
  |  Branch (3485:12): [True: 2.34k, False: 803]
  ------------------
 3486|  2.34k|        {
 3487|  2.34k|            return ERROR_INV_SLICE_HDR_T;
 3488|  2.34k|        }
 3489|  3.14k|    }
 3490|       |
 3491|       |    /*-----------------------------------------------------------------------*/
 3492|       |    /*--------------------------- slice qp delta ----------------------------*/
 3493|       |    /*-----------------------------------------------------------------------*/
 3494|  28.7k|    {
 3495|  28.7k|        WORD8 i1_slice_qp_delta;
 3496|  28.7k|        i1_slice_qp_delta = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3497|  28.7k|        i1_slice_qp_delta += ps_pps->u1_pic_init_qp;
 3498|  28.7k|        if((i1_slice_qp_delta < MIN_H264_QP) || (i1_slice_qp_delta > MAX_H264_QP))
  ------------------
  |  |  629|  28.7k|#define MIN_H264_QP 0
  ------------------
                      if((i1_slice_qp_delta < MIN_H264_QP) || (i1_slice_qp_delta > MAX_H264_QP))
  ------------------
  |  |  634|  27.3k|#define MAX_H264_QP 51
  ------------------
  |  Branch (3498:12): [True: 1.37k, False: 27.3k]
  |  Branch (3498:49): [True: 865, False: 26.5k]
  ------------------
 3499|  2.24k|        {
 3500|  2.24k|            return ERROR_INV_RANGE_QP_T;
 3501|  2.24k|        }
 3502|  26.5k|        ps_slice_prms->u1_slice_qp = (UWORD8) i1_slice_qp_delta;
 3503|  26.5k|    }
 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|  26.5k|    if(SVCD_TRUE == ps_pps->u1_deblocking_filter_parameters_present_flag)
  ------------------
  |  |   46|  26.5k|#define SVCD_TRUE 1
  ------------------
  |  Branch (3511:8): [True: 11.3k, False: 15.1k]
  ------------------
 3512|  11.3k|    {
 3513|  11.3k|        ps_slice_prms->u1_disable_dblk_filter_idc = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3514|       |
 3515|  11.3k|        if(ps_slice_prms->u1_disable_dblk_filter_idc > SLICE_BOUNDARY_DBLK_DISABLED)
  ------------------
  |  |  547|  11.3k|#define SLICE_BOUNDARY_DBLK_DISABLED  2
  ------------------
  |  Branch (3515:12): [True: 2.23k, False: 9.11k]
  ------------------
 3516|  2.23k|        {
 3517|  2.23k|            return ERROR_INV_SLICE_HDR_T;
 3518|  2.23k|        }
 3519|       |        /*-------------------------------------------------------------------*/
 3520|       |        /*--------------------------- slice_alpha_c0_offset_div2 ------------*/
 3521|       |        /*--------------------------- slice_beta_offset_div2 ----------------*/
 3522|       |        /*-------------------------------------------------------------------*/
 3523|  9.11k|        if(1 != ps_slice_prms->u1_disable_dblk_filter_idc)
  ------------------
  |  Branch (3523:12): [True: 7.58k, False: 1.53k]
  ------------------
 3524|  7.58k|        {
 3525|       |            /* slice_alpha_c0_offset_div2 */
 3526|  7.58k|            ps_slice_prms->i1_slice_alpha_c0_offset = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3527|  7.58k|            if((MIN_DBLK_FIL_OFF > ps_slice_prms->i1_slice_alpha_c0_offset) ||
  ------------------
  |  |  550|  7.58k|#define MIN_DBLK_FIL_OFF              -12
  ------------------
  |  Branch (3527:16): [True: 203, False: 7.37k]
  ------------------
 3528|  7.37k|               (ps_slice_prms->i1_slice_alpha_c0_offset > MAX_DBLK_FIL_OFF))
  ------------------
  |  |  551|  7.37k|#define MAX_DBLK_FIL_OFF              12
  ------------------
  |  Branch (3528:16): [True: 201, False: 7.17k]
  ------------------
 3529|    404|            {
 3530|    404|                return ERROR_INV_SLICE_HDR_T;
 3531|    404|            }
 3532|  7.17k|            ps_slice_prms->i1_slice_beta_offset = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3533|  7.17k|            if((MIN_DBLK_FIL_OFF > ps_slice_prms->i1_slice_beta_offset) ||
  ------------------
  |  |  550|  7.17k|#define MIN_DBLK_FIL_OFF              -12
  ------------------
  |  Branch (3533:16): [True: 164, False: 7.01k]
  ------------------
 3534|  7.01k|               (ps_slice_prms->i1_slice_beta_offset > MAX_DBLK_FIL_OFF))
  ------------------
  |  |  551|  7.01k|#define MAX_DBLK_FIL_OFF              12
  ------------------
  |  Branch (3534:16): [True: 294, False: 6.71k]
  ------------------
 3535|    458|            {
 3536|    458|                return ERROR_INV_SLICE_HDR_T;
 3537|    458|            }
 3538|  7.17k|        }
 3539|  9.11k|    }
 3540|       |
 3541|  23.4k|    *pi4_ref_dq_id = -1;
 3542|       |
 3543|  23.4k|    if((0 == i4_no_int_lyr_pred) && (0 == i4_quality_id))
  ------------------
  |  Branch (3543:8): [True: 22.9k, False: 441]
  |  Branch (3543:37): [True: 22.9k, False: 0]
  ------------------
 3544|  22.9k|    {
 3545|  22.9k|        WORD32 i4_inter_lyr_dblk_idc;
 3546|  22.9k|        WORD32 i4_inter_lyr_alpha_c0_offset;
 3547|  22.9k|        WORD32 i4_inter_lyr_beta_offset;
 3548|       |
 3549|       |        /*-------------------------------------------------------------------*/
 3550|       |        /*--------------------------- ref_layer_dq_id -----------------------*/
 3551|       |        /*-------------------------------------------------------------------*/
 3552|  22.9k|        *pi4_ref_dq_id = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3553|       |
 3554|  22.9k|        if(*pi4_ref_dq_id > MAX_REF_DEP_ID)
  ------------------
  |  |  106|  22.9k|#define MAX_REF_DEP_ID ((MAX_DEPENDENCY_ID << 4) | MAX_QUALITY_ID)
  |  |  ------------------
  |  |  |  |  103|  22.9k|#define MAX_DEPENDENCY_ID 4
  |  |  ------------------
  |  |               #define MAX_REF_DEP_ID ((MAX_DEPENDENCY_ID << 4) | MAX_QUALITY_ID)
  |  |  ------------------
  |  |  |  |  102|  22.9k|#define MAX_QUALITY_ID 0
  |  |  ------------------
  ------------------
  |  Branch (3554:12): [True: 1.77k, False: 21.2k]
  ------------------
 3555|  1.77k|        {
 3556|  1.77k|            return ERROR_INV_SLICE_HDR_T;
 3557|  1.77k|        }
 3558|       |        /* ------------------------------------------- */
 3559|       |        /* ---- Inter layer de-blocking parameters ---- */
 3560|       |        /* ------------------------------------------- */
 3561|  21.2k|        i4_inter_lyr_dblk_idc = 0;
 3562|  21.2k|        i4_inter_lyr_alpha_c0_offset = 0;
 3563|  21.2k|        i4_inter_lyr_beta_offset = 0;
 3564|  21.2k|        if(SVCD_TRUE ==
  ------------------
  |  |   46|  21.2k|#define SVCD_TRUE 1
  ------------------
  |  Branch (3564:12): [True: 2.97k, False: 18.2k]
  ------------------
 3565|  21.2k|           ps_subset_sps->s_sps_svc_ext.u1_inter_layer_deblocking_filter_control_present_flag)
 3566|  2.97k|        {
 3567|  2.97k|            i4_inter_lyr_dblk_idc = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3568|       |
 3569|  2.97k|            if(i4_inter_lyr_dblk_idc > 6)
  ------------------
  |  Branch (3569:16): [True: 483, False: 2.49k]
  ------------------
 3570|    483|            {
 3571|    483|                return ERROR_INV_SLICE_HDR_T;
 3572|    483|            }
 3573|  2.49k|            if(1 != i4_inter_lyr_dblk_idc)
  ------------------
  |  Branch (3573:16): [True: 2.13k, False: 359]
  ------------------
 3574|  2.13k|            {
 3575|       |                /* Alpha Offset */
 3576|  2.13k|                i4_inter_lyr_alpha_c0_offset = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3577|  2.13k|                if(i4_inter_lyr_alpha_c0_offset > 6 || i4_inter_lyr_alpha_c0_offset < -6)
  ------------------
  |  Branch (3577:20): [True: 215, False: 1.92k]
  |  Branch (3577:56): [True: 155, False: 1.76k]
  ------------------
 3578|    370|                {
 3579|    370|                    return ERROR_INV_SLICE_HDR_T;
 3580|    370|                }
 3581|  1.76k|                i4_inter_lyr_alpha_c0_offset <<= 1;
 3582|       |
 3583|       |                /* Beta Offset */
 3584|  1.76k|                i4_inter_lyr_beta_offset = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3585|  1.76k|                if(i4_inter_lyr_beta_offset > 6 || i4_inter_lyr_beta_offset < -6)
  ------------------
  |  Branch (3585:20): [True: 344, False: 1.42k]
  |  Branch (3585:52): [True: 158, False: 1.26k]
  ------------------
 3586|    502|                {
 3587|    502|                    return ERROR_INV_SLICE_HDR_T;
 3588|    502|                }
 3589|  1.26k|                i4_inter_lyr_beta_offset <<= 1;
 3590|  1.26k|            }
 3591|  2.49k|        }
 3592|  19.8k|        ps_vcl_node->i4_inter_lyr_dblk_idc = i4_inter_lyr_dblk_idc;
 3593|  19.8k|        ps_vcl_node->i4_inter_lyr_beta_offset = i4_inter_lyr_beta_offset;
 3594|  19.8k|        ps_vcl_node->i4_inter_lyr_alpha_c0_offset = i4_inter_lyr_alpha_c0_offset;
 3595|  19.8k|    }
 3596|       |
 3597|  20.2k|    return (0);
 3598|  23.4k|}
isvcd_get_ref_lyr_dqid:
 3631|  84.1k|{
 3632|  84.1k|    WORD32 i4_status;
 3633|  84.1k|    WORD32 ai4_ref_dq_id[2] = {0};
 3634|  84.1k|    WORD32 i4_num_slc_dec;
 3635|       |
 3636|       |    /* local structures */
 3637|  84.1k|    dec_slice_params_t s_slice_prms = {0};
 3638|       |
 3639|       |    /* vcl buffer */
 3640|  84.1k|    vcl_buf_hdr_t *ps_vcl_buf;
 3641|  84.1k|    dec_struct_t *ps_dec;
 3642|  84.1k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec = ps_svcd_ctxt->ps_svc_dec_lyr;
 3643|  84.1k|    UNUSED(i4_prev_au_dqid);
  ------------------
  |  |   45|  84.1k|#define UNUSED(x) ((void)(x))
  ------------------
 3644|  84.1k|    ps_dec = &ps_svc_lyr_dec->s_dec;
 3645|       |    /* Sanity checks */
 3646|  84.1k|    if((NULL == ps_vcl_node) || (NULL == ps_sps) || (NULL == ps_pps) || (NULL == pi4_ref_lyr_dqid))
  ------------------
  |  Branch (3646:8): [True: 0, False: 84.1k]
  |  Branch (3646:33): [True: 0, False: 84.1k]
  |  Branch (3646:53): [True: 0, False: 84.1k]
  |  Branch (3646:73): [True: 0, False: 84.1k]
  ------------------
 3647|      0|    {
 3648|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 3649|      0|    }
 3650|       |
 3651|  84.1k|    i4_num_slc_dec = 0;
 3652|  84.1k|    ps_vcl_buf = ps_vcl_node->ps_first_vcl_nal;
 3653|  84.1k|    i4_status = NOT_OK;
  ------------------
  |  |  116|  84.1k|#define NOT_OK    -1
  ------------------
 3654|       |
 3655|  84.1k|    while(NULL != ps_vcl_buf)
  ------------------
  |  Branch (3655:11): [True: 58.9k, False: 25.1k]
  ------------------
 3656|  58.9k|    {
 3657|  58.9k|        WORD32 i4_error;
 3658|       |
 3659|       |        /* Fill the stream context structure */
 3660|  58.9k|        ps_dec->ps_bitstrm->u4_ofst = 0;
 3661|  58.9k|        ps_dec->ps_bitstrm->pu4_buffer =
 3662|  58.9k|            (UWORD32 *) ((UWORD8 *) ps_vcl_buf + ps_vcl_buf->i4_buf_offset +
 3663|  58.9k|                         ps_vcl_buf->i4_slice_offset);
 3664|  58.9k|        ps_dec->ps_bitstrm->u4_max_ofst = ps_vcl_buf->u4_max_bits;
 3665|       |
 3666|       |        /* call the function which decodes the slice header */
 3667|  58.9k|        i4_error = isvcd_parse_slice_hdr_refdq_id(ps_vcl_node, &s_slice_prms, ps_dec->ps_bitstrm,
 3668|  58.9k|                                                  &ai4_ref_dq_id[i4_num_slc_dec], ps_sps, ps_pps,
 3669|  58.9k|                                                  ps_vcl_buf->i4_no_int_lyr_pred, ps_svcd_ctxt);
 3670|       |
 3671|       |        /* store the first error encountered */
 3672|  58.9k|        if(0 == *pi4_err_code)
  ------------------
  |  Branch (3672:12): [True: 14.7k, False: 44.2k]
  ------------------
 3673|  14.7k|        {
 3674|  14.7k|            *pi4_err_code = i4_error;
 3675|  14.7k|        }
 3676|  58.9k|        if(i4_error != 0)
  ------------------
  |  Branch (3676:12): [True: 38.6k, False: 20.2k]
  ------------------
 3677|  38.6k|        {
 3678|       |            /* check on the Error returned */
 3679|  38.6k|            return NOT_OK;
  ------------------
  |  |  116|  38.6k|#define NOT_OK    -1
  ------------------
 3680|  38.6k|        }
 3681|       |
 3682|       |        /* set the return status */
 3683|  20.2k|        i4_status = OK;
  ------------------
  |  |  114|  20.2k|#define OK        0
  ------------------
 3684|  20.2k|        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|  45.4k|    *pi4_ref_lyr_dqid = ai4_ref_dq_id[0];
 3692|       |
 3693|  45.4k|    return (i4_status);
 3694|  84.1k|}
isvcd_conceal_node_params:
 3719|  77.7k|{
 3720|  77.7k|    vcl_node_t *ps_node;
 3721|  77.7k|    WORD32 i4_conceal_lyrs;
 3722|  77.7k|    WORD32 i4_no_gaps_flag;
 3723|       |
 3724|       |    /* get the bottom node */
 3725|  77.7k|    ps_node = ps_vcl_nal->ps_bot_node;
 3726|  77.7k|    i4_conceal_lyrs = SVCD_FALSE;
  ------------------
  |  |   45|  77.7k|#define SVCD_FALSE 0
  ------------------
 3727|  77.7k|    i4_no_gaps_flag = SVCD_FALSE;
  ------------------
  |  |   45|  77.7k|#define SVCD_FALSE 0
  ------------------
 3728|       |
 3729|       |    /* loop over all nodes present in the current AU */
 3730|   233k|    while(NULL != ps_node)
  ------------------
  |  Branch (3730:11): [True: 155k, False: 77.7k]
  ------------------
 3731|   155k|    {
 3732|   155k|        WORD32 i4_dep_id = 0;
 3733|   155k|        WORD32 i4_qua_id = 0;
 3734|   155k|        UWORD16 u2_frm_num_dep = 0;
 3735|   155k|        WORD32 i4_idr_pic_flag = 0;
 3736|   155k|        WORD32 i4_idr_pic_num = 0;
 3737|   155k|        WORD32 i4_nal_ref_idc = 0;
 3738|   155k|        WORD32 i4_poc_syntax = 0;
 3739|   155k|        WORD32 i4_qua_zero_lyr_sts = 0;
 3740|       |
 3741|   155k|        i4_dep_id = ps_node->i4_dependency_id;
 3742|   155k|        i4_qua_id = ps_node->i4_quality_id;
 3743|       |
 3744|       |        /* reset the quality 0 layer updated status */
 3745|   155k|        if(0 == i4_qua_id)
  ------------------
  |  Branch (3745:12): [True: 155k, False: 0]
  ------------------
 3746|   155k|        {
 3747|   155k|            i4_qua_zero_lyr_sts = SVCD_FALSE;
  ------------------
  |  |   45|   155k|#define SVCD_FALSE 0
  ------------------
 3748|   155k|        }
 3749|       |
 3750|       |        /* process the quality id 0 layers */
 3751|   155k|        if((0 == i4_qua_id) && (NULL != ps_node->ps_first_vcl_nal))
  ------------------
  |  Branch (3751:12): [True: 155k, False: 0]
  |  Branch (3751:32): [True: 125k, False: 29.5k]
  ------------------
 3752|   125k|        {
 3753|       |            /* if current and previous are reference pictures */
 3754|   125k|            if((0 != ps_prev_au_prms[i4_dep_id].i4_nal_ref_id) && (0 != ps_node->i4_nal_ref_idc))
  ------------------
  |  Branch (3754:16): [True: 96.0k, False: 29.9k]
  |  Branch (3754:67): [True: 88.9k, False: 7.08k]
  ------------------
 3755|  88.9k|            {
 3756|  88.9k|                if(ps_prev_au_prms[i4_dep_id].u2_frm_num == ps_node->u2_frm_num)
  ------------------
  |  Branch (3756:20): [True: 27.4k, False: 61.4k]
  ------------------
 3757|  27.4k|                {
 3758|       |                    /* frame number is concealed */
 3759|  27.4k|                    ps_node->u2_frm_num++;
 3760|  27.4k|                    i4_conceal_lyrs = SVCD_TRUE;
  ------------------
  |  |   46|  27.4k|#define SVCD_TRUE 1
  ------------------
 3761|  27.4k|                }
 3762|  61.4k|                else if((SVCD_TRUE == i4_conceal_lyrs) || (SVCD_TRUE == i4_no_gaps_flag))
  ------------------
  |  |   46|  61.4k|#define SVCD_TRUE 1
  ------------------
                              else if((SVCD_TRUE == i4_conceal_lyrs) || (SVCD_TRUE == i4_no_gaps_flag))
  ------------------
  |  |   46|  52.6k|#define SVCD_TRUE 1
  ------------------
  |  Branch (3762:25): [True: 8.82k, False: 52.6k]
  |  Branch (3762:59): [True: 6.70k, False: 45.9k]
  ------------------
 3763|  15.5k|                {
 3764|       |                    /* if the current au frm_num is less than prev */
 3765|       |                    /* or the difference is greater than 1         */
 3766|  15.5k|                    if((ps_prev_au_prms[i4_dep_id].u2_frm_num > ps_node->u2_frm_num) ||
  ------------------
  |  Branch (3766:24): [True: 470, False: 15.0k]
  ------------------
 3767|  15.0k|                       ((ps_node->u2_frm_num - ps_prev_au_prms[i4_dep_id].u2_frm_num) > 1))
  ------------------
  |  Branch (3767:24): [True: 14.7k, False: 284]
  ------------------
 3768|  15.2k|                    {
 3769|       |                        /* frame number is concealed */
 3770|  15.2k|                        ps_node->u2_frm_num = ps_prev_au_prms[i4_dep_id].u2_frm_num + 1;
 3771|  15.2k|                    }
 3772|  15.5k|                }
 3773|       |
 3774|       |                /* set the no gaps flag */
 3775|  88.9k|                if(1 == (ps_node->u2_frm_num - ps_prev_au_prms[i4_dep_id].u2_frm_num))
  ------------------
  |  Branch (3775:20): [True: 59.3k, False: 29.5k]
  ------------------
 3776|  59.3k|                {
 3777|  59.3k|                    i4_no_gaps_flag = SVCD_TRUE;
  ------------------
  |  |   46|  59.3k|#define SVCD_TRUE 1
  ------------------
 3778|  59.3k|                }
 3779|  88.9k|            }
 3780|       |
 3781|       |            /* store the final frame number */
 3782|   125k|            u2_frm_num_dep = ps_node->u2_frm_num;
 3783|   125k|            i4_idr_pic_flag = ps_node->i4_idr_pic_flag;
 3784|   125k|            i4_idr_pic_num = ps_node->i4_idr_pic_num;
 3785|   125k|            i4_nal_ref_idc = ps_node->i4_nal_ref_idc;
 3786|   125k|            i4_poc_syntax = ps_node->i4_poc_syntax;
 3787|   125k|            i4_qua_zero_lyr_sts = SVCD_TRUE;
  ------------------
  |  |   46|   125k|#define SVCD_TRUE 1
  ------------------
 3788|   125k|        }
 3789|  29.5k|        else
 3790|  29.5k|        {
 3791|  29.5k|            if(SVCD_TRUE == i4_qua_zero_lyr_sts)
  ------------------
  |  |   46|  29.5k|#define SVCD_TRUE 1
  ------------------
  |  Branch (3791:16): [True: 0, False: 29.5k]
  ------------------
 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|  29.5k|        }
 3802|       |
 3803|       |        /* get the upper node pointer */
 3804|   155k|        ps_node = ps_node->ps_top_node;
 3805|   155k|    }
 3806|  77.7k|}
isvcd_refine_dep_list:
 3840|   162k|{
 3841|   162k|    vcl_nal_t *ps_vcl_nal;
 3842|   162k|    vcl_node_t *ps_vcl_node;
 3843|   162k|    WORD32 i4_idr_pic_flag;
 3844|   162k|    WORD32 i4_nal_ref_idc;
 3845|   162k|    WORD32 i4_idr_pic_num;
 3846|   162k|    WORD32 i4_num_res_lyrs_bup;
 3847|   162k|    WORD32 i4_restore_prms_flag;
 3848|   162k|    vcl_node_t *ps_node_bup;
 3849|   162k|    WORD32 ai4_dep_id[MAX_NUM_RES_LYRS] = {0};
 3850|       |
 3851|       |    /* used for checking the init prms */
 3852|   162k|    dec_seq_params_t *ps_sps_tgt_minus1_lyr = NULL;
 3853|   162k|    dec_seq_params_t *ps_sps_tgt_minus2_lyr = NULL;
 3854|   162k|    UNUSED(pi4_err_code);
  ------------------
  |  |   45|   162k|#define UNUSED(x) ((void)(x))
  ------------------
 3855|       |    /* sanity checks */
 3856|   162k|    if((NULL == pv_out_vcl_ctxt) || (NULL == ps_sps) || (NULL == ps_pps))
  ------------------
  |  Branch (3856:8): [True: 0, False: 162k]
  |  Branch (3856:37): [True: 0, False: 162k]
  |  Branch (3856:57): [True: 0, False: 162k]
  ------------------
 3857|      0|    {
 3858|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 3859|      0|    }
 3860|       |
 3861|   162k|    ps_vcl_nal = (vcl_nal_t *) pv_out_vcl_ctxt;
 3862|       |
 3863|       |    /*  no node is present */
 3864|   162k|    if(NULL == ps_vcl_nal->ps_bot_node)
  ------------------
  |  Branch (3864:8): [True: 1.23k, False: 161k]
  ------------------
 3865|  1.23k|    {
 3866|  1.23k|        return (NOT_OK);
  ------------------
  |  |  116|  1.23k|#define NOT_OK    -1
  ------------------
 3867|  1.23k|    }
 3868|       |
 3869|       |    /* set the single layer flag if top node and bottom node are same */
 3870|   161k|    if((ps_vcl_nal->ps_bot_node == ps_vcl_nal->ps_top_node) &&
  ------------------
  |  Branch (3870:8): [True: 83.9k, False: 77.7k]
  ------------------
 3871|  83.9k|       (0 == ps_vcl_nal->ps_bot_node->i4_dependency_id))
  ------------------
  |  Branch (3871:8): [True: 83.9k, False: 0]
  ------------------
 3872|  83.9k|    {
 3873|  83.9k|    }
 3874|  77.7k|    else
 3875|  77.7k|    {
 3876|       |        /* call the function which corrects the frame number of each node */
 3877|       |        /* based on previous access unit frame number                     */
 3878|  77.7k|        isvcd_conceal_node_params(ps_vcl_nal, ps_prev_au_prms);
 3879|  77.7k|    }
 3880|       |    /* get the top most node */
 3881|   161k|    ps_vcl_node = ps_vcl_nal->ps_top_node;
 3882|       |
 3883|       |    /* get the IDR picture flag for top most layer in current AU */
 3884|       |    /* if not valid then set the value present in the first valid node */
 3885|   161k|    {
 3886|   161k|        vcl_node_t *ps_node;
 3887|   161k|        WORD32 i4_node_present_flag;
 3888|       |
 3889|   161k|        ps_node = ps_vcl_node;
 3890|   161k|        i4_node_present_flag = SVCD_FALSE;
  ------------------
  |  |   45|   161k|#define SVCD_FALSE 0
  ------------------
 3891|       |
 3892|       |        /* store default values */
 3893|   161k|        i4_idr_pic_flag = SVCD_FALSE;
  ------------------
  |  |   45|   161k|#define SVCD_FALSE 0
  ------------------
 3894|   161k|        i4_nal_ref_idc = 0;
 3895|   161k|        i4_idr_pic_num = 0;
 3896|       |
 3897|       |        /* loop until valid node */
 3898|   164k|        while(NULL != ps_node)
  ------------------
  |  Branch (3898:15): [True: 164k, False: 580]
  ------------------
 3899|   164k|        {
 3900|   164k|            if(NULL != ps_node->ps_first_vcl_nal)
  ------------------
  |  Branch (3900:16): [True: 135k, False: 28.8k]
  ------------------
 3901|   135k|            {
 3902|   135k|                i4_idr_pic_flag = ps_node->i4_idr_pic_flag;
 3903|   135k|                i4_nal_ref_idc = ps_node->i4_nal_ref_idc;
 3904|   135k|                i4_idr_pic_num = ps_node->i4_idr_pic_num;
 3905|   135k|                i4_node_present_flag = SVCD_TRUE;
  ------------------
  |  |   46|   135k|#define SVCD_TRUE 1
  ------------------
 3906|   135k|                break;
 3907|   135k|            }
 3908|  28.8k|            else if(SVCD_TRUE == ps_node->i4_idr_pic_flag)
  ------------------
  |  |   46|  28.8k|#define SVCD_TRUE 1
  ------------------
  |  Branch (3908:21): [True: 25.8k, False: 3.03k]
  ------------------
 3909|  25.8k|            {
 3910|  25.8k|                i4_idr_pic_flag = ps_node->i4_idr_pic_flag;
 3911|  25.8k|                i4_nal_ref_idc = ps_node->i4_nal_ref_idc;
 3912|  25.8k|                i4_idr_pic_num = ps_node->i4_idr_pic_num;
 3913|  25.8k|                i4_node_present_flag = SVCD_TRUE;
  ------------------
  |  |   46|  25.8k|#define SVCD_TRUE 1
  ------------------
 3914|  25.8k|                break;
 3915|  25.8k|            }
 3916|       |            /* point to next node */
 3917|  3.03k|            ps_node = ps_node->ps_bot_node;
 3918|  3.03k|        }
 3919|       |
 3920|       |        /* alteast one node should be present */
 3921|   161k|        if(SVCD_FALSE == i4_node_present_flag)
  ------------------
  |  |   45|   161k|#define SVCD_FALSE 0
  ------------------
  |  Branch (3921:12): [True: 580, False: 161k]
  ------------------
 3922|    580|        {
 3923|    580|            return (NOT_OK);
  ------------------
  |  |  116|    580|#define NOT_OK    -1
  ------------------
 3924|    580|        }
 3925|   161k|    }
 3926|       |
 3927|       |    /* initially the access unit is considered to have a single resolution */
 3928|   161k|    ai4_dep_id[0] = 0;
 3929|   161k|    ps_vcl_nal->i4_num_res_lyrs = 1;
 3930|   161k|    i4_restore_prms_flag = SVCD_FALSE;
  ------------------
  |  |   45|   161k|#define SVCD_FALSE 0
  ------------------
 3931|       |
 3932|       |    /*-----------------------------------------------------------------------*/
 3933|       |    /* loop until all the nodes are processed                                */
 3934|       |    /*-----------------------------------------------------------------------*/
 3935|   399k|    while(NULL != ps_vcl_node)
  ------------------
  |  Branch (3935:11): [True: 238k, False: 160k]
  ------------------
 3936|   238k|    {
 3937|   238k|        WORD32 i4_ref_lyr_dqid, i4_status;
 3938|   238k|        vcl_node_t *ps_bot_vcl_node;
 3939|   238k|        WORD32 i4_res_chnge_flag = SVCD_FALSE;
  ------------------
  |  |   45|   238k|#define SVCD_FALSE 0
  ------------------
 3940|   238k|        WORD32 i4_dep_id, i4_qua_id;
 3941|   238k|        WORD32 i4_prev_sps_pps_valid;
 3942|   238k|        WORD32 i4_prev_au_prms_valid;
 3943|       |
 3944|       |        /* set the reference layer DQID to -1 */
 3945|   238k|        i4_ref_lyr_dqid = -1;
 3946|       |
 3947|       |        /* get the current layer dependency and quality id */
 3948|   238k|        i4_dep_id = ps_vcl_node->i4_dependency_id;
 3949|   238k|        i4_qua_id = ps_vcl_node->i4_quality_id;
 3950|       |
 3951|       |        /* get the valid status of prev access unit params */
 3952|   238k|        i4_prev_au_prms_valid = ps_prev_au_prms[i4_dep_id].i4_updated_sts;
 3953|   238k|        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|   238k|        if(NULL == ps_vcl_node->ps_first_vcl_nal)
  ------------------
  |  Branch (3956:12): [True: 32.4k, False: 206k]
  ------------------
 3957|  32.4k|        {
 3958|       |            /* store the params appropriately */
 3959|  32.4k|            ps_vcl_node->i4_idr_pic_flag = i4_idr_pic_flag;
 3960|  32.4k|            ps_vcl_node->i4_nal_ref_idc = i4_nal_ref_idc;
 3961|  32.4k|            ps_vcl_node->i4_idr_pic_num = i4_idr_pic_num;
 3962|  32.4k|            ps_vcl_node->i4_num_slices = 0;
 3963|  32.4k|            ps_vcl_node->i4_use_ref_base = 0;
 3964|  32.4k|            ps_vcl_node->i4_temporal_id = 0;
 3965|       |
 3966|  32.4k|            if((0 != i4_dep_id) || (0 != i4_qua_id))
  ------------------
  |  Branch (3966:16): [True: 25.1k, False: 7.31k]
  |  Branch (3966:36): [True: 0, False: 7.31k]
  ------------------
 3967|  25.1k|            {
 3968|  25.1k|                ps_vcl_node->i4_nal_unit_type = CODED_SLICE_EXTENSION_NAL;
  ------------------
  |  |   66|  25.1k|#define CODED_SLICE_EXTENSION_NAL 20
  ------------------
 3969|  25.1k|                ps_vcl_node->u1_acc_no_int_pred = 0;
 3970|  25.1k|            }
 3971|  7.31k|            else if(SVCD_TRUE == i4_idr_pic_flag)
  ------------------
  |  |   46|  7.31k|#define SVCD_TRUE 1
  ------------------
  |  Branch (3971:21): [True: 6.36k, False: 956]
  ------------------
 3972|  6.36k|            {
 3973|  6.36k|                ps_vcl_node->i4_nal_unit_type = IDR_SLICE_NAL;
  ------------------
  |  |  328|  6.36k|#define IDR_SLICE_NAL                   5
  ------------------
 3974|  6.36k|                ps_vcl_node->u1_acc_no_int_pred = 1;
 3975|  6.36k|            }
 3976|    956|            else
 3977|    956|            {
 3978|    956|                ps_vcl_node->i4_nal_unit_type = SLICE_NAL;
  ------------------
  |  |  324|    956|#define SLICE_NAL                       1
  ------------------
 3979|    956|                ps_vcl_node->u1_acc_no_int_pred = 1;
 3980|    956|            }
 3981|       |
 3982|  32.4k|            if(SVCD_FALSE == i4_idr_pic_flag)
  ------------------
  |  |   45|  32.4k|#define SVCD_FALSE 0
  ------------------
  |  Branch (3982:16): [True: 1.96k, False: 30.4k]
  ------------------
 3983|  1.96k|            {
 3984|       |                /* pick the other params form previous access unit */
 3985|  1.96k|                if(SVCD_TRUE == i4_prev_sps_pps_valid)
  ------------------
  |  |   46|  1.96k|#define SVCD_TRUE 1
  ------------------
  |  Branch (3985:20): [True: 1.96k, False: 0]
  ------------------
 3986|  1.96k|                {
 3987|  1.96k|                    ps_vcl_node->u1_pps_id =
 3988|  1.96k|                        ps_pps_sps_prev[(i4_dep_id << 4) + i4_qua_id].u1_pps_id;
 3989|       |
 3990|  1.96k|                    ps_vcl_node->u1_sps_id =
 3991|  1.96k|                        ps_pps_sps_prev[(i4_dep_id << 4) + i4_qua_id].u1_sps_id;
 3992|  1.96k|                }
 3993|       |
 3994|  1.96k|                if(SVCD_TRUE == i4_prev_au_prms_valid)
  ------------------
  |  |   46|  1.96k|#define SVCD_TRUE 1
  ------------------
  |  Branch (3994:20): [True: 1.94k, False: 15]
  ------------------
 3995|  1.94k|                {
 3996|  1.94k|                    if(0 == ps_vcl_node->i4_nal_ref_idc)
  ------------------
  |  Branch (3996:24): [True: 577, False: 1.37k]
  ------------------
 3997|    577|                    {
 3998|    577|                        ps_vcl_node->u2_frm_num = ps_prev_au_prms[i4_dep_id].u2_frm_num;
 3999|    577|                    }
 4000|  1.37k|                    else
 4001|  1.37k|                    {
 4002|  1.37k|                        ps_vcl_node->u2_frm_num = ps_prev_au_prms[i4_dep_id].u2_frm_num + 1;
 4003|  1.37k|                    }
 4004|  1.94k|                }
 4005|  1.96k|            }
 4006|  32.4k|        }
 4007|       |
 4008|       |        /* SPS id cannot change unless its an IDR pic */
 4009|   238k|        if(SVCD_FALSE == ps_vcl_node->i4_idr_pic_flag)
  ------------------
  |  |   45|   238k|#define SVCD_FALSE 0
  ------------------
  |  Branch (4009:12): [True: 41.4k, False: 197k]
  ------------------
 4010|  41.4k|        {
 4011|  41.4k|            if(SVCD_TRUE == i4_prev_sps_pps_valid)
  ------------------
  |  |   46|  41.4k|#define SVCD_TRUE 1
  ------------------
  |  Branch (4011:16): [True: 41.3k, False: 68]
  ------------------
 4012|  41.3k|            {
 4013|       |                /* store the SPS id of the current layer */
 4014|  41.3k|                ps_vcl_node->u1_sps_id = ps_pps_sps_prev[(i4_dep_id << 4) + i4_qua_id].u1_sps_id;
 4015|  41.3k|            }
 4016|  41.4k|        }
 4017|       |
 4018|       |        /* store the PPS id and SPS id of the current layer */
 4019|   238k|        ps_pps_sps_prev[(i4_dep_id << 4) + i4_qua_id].u1_pps_id = ps_vcl_node->u1_pps_id;
 4020|   238k|        ps_pps_sps_prev[(i4_dep_id << 4) + i4_qua_id].u1_sps_id = ps_vcl_node->u1_sps_id;
 4021|   238k|        ps_pps_sps_prev[(i4_dep_id << 4) + i4_qua_id].i4_updated_sts = SVCD_TRUE;
  ------------------
  |  |   46|   238k|#define SVCD_TRUE 1
  ------------------
 4022|       |
 4023|       |        /* handling of no_inter_layer_pred_flag 1 cases */
 4024|   238k|        if((1 == ps_vcl_node->u1_acc_no_int_pred) && (NULL != ps_vcl_node->ps_bot_node))
  ------------------
  |  Branch (4024:12): [True: 154k, False: 84.1k]
  |  Branch (4024:54): [True: 409, False: 154k]
  ------------------
 4025|    409|        {
 4026|    409|            if(SVCD_TRUE == i4_idr_pic_flag)
  ------------------
  |  |   46|    409|#define SVCD_TRUE 1
  ------------------
  |  Branch (4026:16): [True: 305, False: 104]
  ------------------
 4027|    305|            {
 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|    305|                if(SVCD_FALSE == i4_restore_prms_flag)
  ------------------
  |  |   45|    305|#define SVCD_FALSE 0
  ------------------
  |  Branch (4031:20): [True: 305, False: 0]
  ------------------
 4032|    305|                {
 4033|       |                    /* get the number of resolution detected so far */
 4034|    305|                    i4_num_res_lyrs_bup = ps_vcl_nal->i4_num_res_lyrs;
 4035|       |
 4036|    305|                    ps_node_bup = ps_vcl_node;
 4037|       |
 4038|       |                    /* set the restore params flag */
 4039|    305|                    i4_restore_prms_flag = SVCD_TRUE;
  ------------------
  |  |   46|    305|#define SVCD_TRUE 1
  ------------------
 4040|    305|                }
 4041|    305|            }
 4042|    104|            else
 4043|    104|            {
 4044|    104|                ps_vcl_node->i4_ref_dq_id = -1;
 4045|    104|                ps_vcl_node->i4_res_change_flag = i4_res_chnge_flag;
 4046|       |
 4047|       |                /* store the reference DQID for current dependency */
 4048|    104|                ps_prev_au_prms[i4_dep_id].i4_ref_dq_id = -1;
 4049|    104|                ps_prev_au_prms[i4_dep_id].u2_frm_num = ps_vcl_node->u2_frm_num;
 4050|    104|                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|    104|                ps_vcl_node->ps_bot_node = NULL;
 4054|    104|                break;
 4055|    104|            }
 4056|    409|        }
 4057|       |
 4058|       |        /* derive the reference layer DQID for quality id equal to 0 */
 4059|   238k|        if(0 == i4_qua_id)
  ------------------
  |  Branch (4059:12): [True: 238k, False: 0]
  ------------------
 4060|   238k|        {
 4061|   238k|            dec_seq_params_t *ps_curr_sps;
 4062|   238k|            dec_svc_seq_params_t *ps_curr_subset_sps;
 4063|       |
 4064|       |            /* derive current SPS */
 4065|   238k|            ps_curr_sps = ps_sps + ps_vcl_node->u1_sps_id;
 4066|   238k|            ps_curr_subset_sps = ps_subset_sps + ps_vcl_node->u1_sps_id;
 4067|       |
 4068|   238k|            {
 4069|   238k|                WORD32 i4_max_frm_num;
 4070|       |
 4071|       |                /* get the maximum value of frame number */
 4072|   238k|                i4_max_frm_num = (1 << (ps_curr_sps->u1_bits_in_frm_num + 1));
 4073|   238k|                ps_vcl_node->u2_frm_num = ps_vcl_node->u2_frm_num % i4_max_frm_num;
 4074|   238k|                if(SVCD_TRUE == ps_vcl_node->i4_idr_pic_flag)
  ------------------
  |  |   46|   238k|#define SVCD_TRUE 1
  ------------------
  |  Branch (4074:20): [True: 197k, False: 41.3k]
  ------------------
 4075|   197k|                {
 4076|       |                    /* if idr then frm num should be 0 */
 4077|   197k|                    ps_vcl_node->u2_frm_num = 0;
 4078|   197k|                }
 4079|   238k|            }
 4080|       |
 4081|       |            /* store default params to inter layer deblocking params */
 4082|   238k|            ps_vcl_node->i4_inter_lyr_dblk_idc = 0;
 4083|   238k|            ps_vcl_node->i4_inter_lyr_beta_offset = 0;
 4084|   238k|            ps_vcl_node->i4_inter_lyr_alpha_c0_offset = 0;
 4085|       |            /* No SEI support for scalability info*/
 4086|   238k|            i4_status = NOT_OK;
  ------------------
  |  |  116|   238k|#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|   238k|            if(1 == ps_vcl_node->u1_acc_no_int_pred)
  ------------------
  |  Branch (4091:16): [True: 154k, False: 84.1k]
  ------------------
 4092|   154k|            {
 4093|   154k|                i4_status = NOT_OK;
  ------------------
  |  |  116|   154k|#define NOT_OK    -1
  ------------------
 4094|   154k|            }
 4095|  84.1k|            else
 4096|  84.1k|            {
 4097|  84.1k|                WORD32 *pi4_ref_dq_id;
 4098|  84.1k|                WORD32 i4_ref_dq_id_temp;
 4099|       |
 4100|       |                /* check if the SEI message has given the ref_dq_id */
 4101|  84.1k|                if(NOT_OK == i4_status)
  ------------------
  |  |  116|  84.1k|#define NOT_OK    -1
  ------------------
  |  Branch (4101:20): [True: 84.1k, False: 0]
  ------------------
 4102|  84.1k|                {
 4103|  84.1k|                    pi4_ref_dq_id = &i4_ref_lyr_dqid;
 4104|  84.1k|                }
 4105|      0|                else
 4106|      0|                {
 4107|      0|                    pi4_ref_dq_id = &i4_ref_dq_id_temp;
 4108|      0|                }
 4109|       |
 4110|  84.1k|                i4_status = isvcd_get_ref_lyr_dqid(ps_vcl_node, ps_sps, ps_pps, pi4_ref_dq_id,
 4111|  84.1k|                                                   ps_prev_au_prms[i4_dep_id].i4_ref_dq_id,
 4112|  84.1k|                                                   &ps_svcd_ctxt->i4_error_code, ps_svcd_ctxt);
 4113|  84.1k|            }
 4114|       |
 4115|       |            /* no slice in the layer has been successfully decoded */
 4116|   238k|            if(NOT_OK == i4_status)
  ------------------
  |  |  116|   238k|#define NOT_OK    -1
  ------------------
  |  Branch (4116:16): [True: 218k, False: 20.2k]
  ------------------
 4117|   218k|            {
 4118|       |                /* check for IDR picture */
 4119|   218k|                if(SVCD_TRUE == i4_idr_pic_flag)
  ------------------
  |  |   46|   218k|#define SVCD_TRUE 1
  ------------------
  |  Branch (4119:20): [True: 178k, False: 39.3k]
  ------------------
 4120|   178k|                {
 4121|       |                    /* set the next lower layer as the reference layer */
 4122|   178k|                    if(NULL != ps_vcl_node->ps_bot_node)
  ------------------
  |  Branch (4122:24): [True: 51.9k, False: 126k]
  ------------------
 4123|  51.9k|                    {
 4124|  51.9k|                        i4_ref_lyr_dqid = ps_vcl_node->ps_bot_node->i4_dependency_id << 4;
 4125|       |
 4126|  51.9k|                        i4_ref_lyr_dqid += ps_vcl_node->ps_bot_node->i4_quality_id;
 4127|  51.9k|                    }
 4128|   126k|                    else
 4129|   126k|                    {
 4130|   126k|                        i4_ref_lyr_dqid = -1;
 4131|   126k|                    }
 4132|   178k|                }
 4133|  39.3k|                else
 4134|  39.3k|                {
 4135|       |                    /* take the reference dq id from previous access unit */
 4136|  39.3k|                    i4_ref_lyr_dqid = ps_prev_au_prms[i4_dep_id].i4_ref_dq_id;
 4137|  39.3k|                }
 4138|   218k|            }
 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|   238k|            i4_status = isvcd_update_dqid(i4_ref_lyr_dqid, ps_vcl_node, &ps_bot_vcl_node);
 4144|       |
 4145|   238k|            if(!(OK == i4_status))
  ------------------
  |  |  114|   238k|#define OK        0
  ------------------
  |  Branch (4145:16): [True: 0, False: 238k]
  ------------------
 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|   238k|            ps_prev_au_prms[i4_dep_id].i4_ref_dq_id = i4_ref_lyr_dqid;
 4153|   238k|            ps_prev_au_prms[i4_dep_id].i4_nal_ref_id = ps_vcl_node->i4_nal_ref_idc;
 4154|   238k|            ps_prev_au_prms[i4_dep_id].u2_frm_num = ps_vcl_node->u2_frm_num;
 4155|   238k|            ps_prev_au_prms[i4_dep_id].i4_updated_sts = SVCD_TRUE;
  ------------------
  |  |   46|   238k|#define SVCD_TRUE 1
  ------------------
 4156|       |
 4157|       |            /* ------- Detect Resolution Change ---------------- */
 4158|   238k|            {
 4159|   238k|                dec_seq_params_t *ps_lower_sps = NULL;
 4160|   238k|                dec_svc_seq_params_t *ps_lower_subset_sps = NULL;
 4161|       |
 4162|   238k|                if(NULL != ps_bot_vcl_node)
  ------------------
  |  Branch (4162:20): [True: 77.5k, False: 160k]
  ------------------
 4163|  77.5k|                {
 4164|  77.5k|                    if((NULL != ps_bot_vcl_node->ps_first_vcl_nal) ||
  ------------------
  |  Branch (4164:24): [True: 73.2k, False: 4.32k]
  ------------------
 4165|  4.32k|                       (SVCD_TRUE == i4_idr_pic_flag))
  ------------------
  |  |   46|  4.32k|#define SVCD_TRUE 1
  ------------------
  |  Branch (4165:24): [True: 3.25k, False: 1.06k]
  ------------------
 4166|  76.4k|                    {
 4167|       |                        /* get the SPS of layer */
 4168|  76.4k|                        ps_lower_sps = ps_sps + ps_bot_vcl_node->u1_sps_id;
 4169|  76.4k|                        ps_lower_subset_sps = ps_subset_sps + ps_bot_vcl_node->u1_sps_id;
 4170|  76.4k|                    }
 4171|  1.06k|                    else
 4172|  1.06k|                    {
 4173|       |                        /* if the bottom layer is completely missed */
 4174|  1.06k|                        WORD32 i4_bot_dep_id, i4_bot_qua_id;
 4175|  1.06k|                        UWORD8 u1_sps_id = 0;
 4176|       |
 4177|       |                        /* sps id is picked from previous access unit */
 4178|  1.06k|                        i4_bot_dep_id = ps_bot_vcl_node->i4_dependency_id;
 4179|  1.06k|                        i4_bot_qua_id = ps_bot_vcl_node->i4_quality_id;
 4180|       |
 4181|  1.06k|                        if(SVCD_TRUE ==
  ------------------
  |  |   46|  1.06k|#define SVCD_TRUE 1
  ------------------
  |  Branch (4181:28): [True: 956, False: 113]
  ------------------
 4182|  1.06k|                           ps_pps_sps_prev[(i4_bot_dep_id << 4) + i4_bot_qua_id].i4_updated_sts)
 4183|    956|                        {
 4184|    956|                            u1_sps_id =
 4185|    956|                                ps_pps_sps_prev[(i4_bot_dep_id << 4) + i4_bot_qua_id].u1_sps_id;
 4186|    956|                        }
 4187|    113|                        else
 4188|    113|                        {
 4189|       |                            /* should not enter here */
 4190|    113|                            return NOT_OK;
  ------------------
  |  |  116|    113|#define NOT_OK    -1
  ------------------
 4191|    113|                        }
 4192|       |
 4193|       |                        /* get the SPS of lower layer */
 4194|    956|                        ps_lower_sps = ps_sps + u1_sps_id;
 4195|    956|                        ps_lower_subset_sps = ps_subset_sps + u1_sps_id;
 4196|    956|                    }
 4197|  77.5k|                }
 4198|       |
 4199|       |                /* call the function which detects resolution change */
 4200|   238k|                i4_res_chnge_flag = isvcd_detect_res_change(
 4201|   238k|                    ps_curr_sps, ps_lower_sps, ps_curr_subset_sps, ps_lower_subset_sps);
 4202|       |
 4203|       |                /* if a resolution exists below current resolution */
 4204|   238k|                if(SVCD_TRUE == i4_res_chnge_flag)
  ------------------
  |  |   46|   238k|#define SVCD_TRUE 1
  ------------------
  |  Branch (4204:20): [True: 56.5k, False: 181k]
  ------------------
 4205|  56.5k|                {
 4206|       |                    /* if current picture id IDR */
 4207|  56.5k|                    if(SVCD_TRUE == i4_idr_pic_flag)
  ------------------
  |  |   46|  56.5k|#define SVCD_TRUE 1
  ------------------
  |  Branch (4207:24): [True: 50.1k, False: 6.40k]
  ------------------
 4208|  50.1k|                    {
 4209|       |                        /* store the depedency id of bottom most layer in current resolution */
 4210|  50.1k|                        ai4_dep_id[ps_vcl_nal->i4_num_res_lyrs - 1] = i4_dep_id;
 4211|  50.1k|                    }
 4212|       |
 4213|       |                    /* increment the num resolution layer counter */
 4214|  56.5k|                    ps_vcl_nal->i4_num_res_lyrs++;
 4215|       |
 4216|       |                    /* store the SPS of target -1 and -2 resolution layers */
 4217|  56.5k|                    if(2 == ps_vcl_nal->i4_num_res_lyrs)
  ------------------
  |  Branch (4217:24): [True: 56.5k, False: 0]
  ------------------
 4218|  56.5k|                    {
 4219|  56.5k|                        ps_sps_tgt_minus1_lyr = ps_curr_sps;
 4220|  56.5k|                    }
 4221|      0|                    else if(3 == ps_vcl_nal->i4_num_res_lyrs)
  ------------------
  |  Branch (4221:29): [True: 0, False: 0]
  ------------------
 4222|      0|                    {
 4223|      0|                        ps_sps_tgt_minus2_lyr = ps_curr_sps;
 4224|      0|                    }
 4225|      0|                    else if(ps_vcl_nal->i4_num_res_lyrs > MAX_NUM_RES_LYRS)
  ------------------
  |  |   94|      0|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (4225:29): [True: 0, False: 0]
  ------------------
 4226|      0|                    {
 4227|      0|                        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 4228|      0|                    }
 4229|  56.5k|                }
 4230|   238k|            }
 4231|       |
 4232|       |            /* -------- end of resolution change detection -------- */
 4233|   238k|        }
 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|   238k|        ps_vcl_node->i4_res_change_flag = i4_res_chnge_flag;
 4260|   238k|        ps_vcl_node->i4_ref_dq_id = i4_ref_lyr_dqid;
 4261|       |
 4262|       |        /* go to the next node */
 4263|   238k|        ps_vcl_node = ps_bot_vcl_node;
 4264|   238k|    }
 4265|       |
 4266|       |    /* update the Dependency array for each resolution */
 4267|   161k|    if(SVCD_TRUE == i4_idr_pic_flag)
  ------------------
  |  |   46|   161k|#define SVCD_TRUE 1
  ------------------
  |  Branch (4267:8): [True: 128k, False: 32.8k]
  ------------------
 4268|   128k|    {
 4269|   128k|        WORD32 i4_idx;
 4270|       |
 4271|   128k|        ai4_dep_id[ps_vcl_nal->i4_num_res_lyrs - 1] = 0;
 4272|       |
 4273|       |        /* loop over number of resolutions detected */
 4274|   306k|        for(i4_idx = 0; i4_idx < ps_vcl_nal->i4_num_res_lyrs; i4_idx++)
  ------------------
  |  Branch (4274:25): [True: 178k, False: 128k]
  ------------------
 4275|   178k|        {
 4276|   178k|            pi4_dep_id_map[i4_idx] = ai4_dep_id[ps_vcl_nal->i4_num_res_lyrs - 1 - i4_idx];
 4277|   178k|        }
 4278|   128k|    }
 4279|       |
 4280|   161k|    if(SVCD_TRUE == i4_restore_prms_flag)
  ------------------
  |  |   46|   161k|#define SVCD_TRUE 1
  ------------------
  |  Branch (4280:8): [True: 305, False: 160k]
  ------------------
 4281|    305|    {
 4282|       |        /* restore the number of resolutions */
 4283|    305|        ps_vcl_nal->i4_num_res_lyrs = i4_num_res_lyrs_bup;
 4284|       |
 4285|    305|        ps_vcl_node = ps_node_bup;
 4286|       |
 4287|       |        /* set the bottom node to NULL */
 4288|    305|        ps_vcl_node->ps_bot_node = NULL;
 4289|       |
 4290|    305|        ps_vcl_node->i4_ref_dq_id = -1;
 4291|    305|        ps_vcl_node->i4_res_change_flag = SVCD_FALSE;
  ------------------
  |  |   45|    305|#define SVCD_FALSE 0
  ------------------
 4292|       |
 4293|       |        /* store the reference DQID for current dependency */
 4294|    305|        ps_prev_au_prms[ps_vcl_node->i4_dependency_id].i4_ref_dq_id = -1;
 4295|       |
 4296|    305|        ps_prev_au_prms[ps_vcl_node->i4_dependency_id].u2_frm_num = ps_vcl_node->u2_frm_num;
 4297|       |
 4298|    305|        ps_prev_au_prms[ps_vcl_node->i4_dependency_id].i4_nal_ref_id = ps_vcl_node->i4_nal_ref_idc;
 4299|    305|    }
 4300|       |
 4301|       |    /* Finally update the bottom most node in the current access unit */
 4302|   161k|    ps_vcl_node = ps_vcl_nal->ps_top_node;
 4303|       |
 4304|   238k|    while(NULL != ps_vcl_node->ps_bot_node)
  ------------------
  |  Branch (4304:11): [True: 77.2k, False: 161k]
  ------------------
 4305|  77.2k|    {
 4306|  77.2k|        ps_vcl_node = ps_vcl_node->ps_bot_node;
 4307|  77.2k|    }
 4308|       |
 4309|   161k|    ps_vcl_nal->ps_bot_node = ps_vcl_node;
 4310|       |
 4311|       |    /* check on validity of Target Layer -1 and -2 dimensions */
 4312|   161k|    if((NULL != ps_sps_tgt_minus1_lyr) && (0 == ps_sps_tgt_minus1_lyr->u1_is_valid))
  ------------------
  |  Branch (4312:8): [True: 56.5k, False: 104k]
  |  Branch (4312:43): [True: 4.36k, False: 52.1k]
  ------------------
 4313|  4.36k|    {
 4314|  4.36k|        if((H264_MAX_FRAME_WIDTH < (WORD32) (ps_sps_tgt_minus1_lyr->u2_frm_wd_in_mbs << 4)) ||
  ------------------
  |  |   39|  4.36k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
  |  Branch (4314:12): [True: 0, False: 4.36k]
  ------------------
 4315|  4.36k|           (H264_MAX_FRAME_HEIGHT < (WORD32) (ps_sps_tgt_minus1_lyr->u2_frm_ht_in_mbs << 4)))
  ------------------
  |  |   40|  4.36k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
  |  Branch (4315:12): [True: 0, False: 4.36k]
  ------------------
 4316|      0|        {
 4317|      0|            return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 4318|      0|        }
 4319|  4.36k|    }
 4320|       |
 4321|   161k|    if((NULL != ps_sps_tgt_minus2_lyr) && (0 == ps_sps_tgt_minus2_lyr->u1_is_valid))
  ------------------
  |  Branch (4321:8): [True: 0, False: 161k]
  |  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|   161k|    return (OK);
  ------------------
  |  |  114|   161k|#define OK        0
  ------------------
 4331|   161k|}
isvcd_dec_non_vcl:
 4361|   149k|{
 4362|       |    /* local varibles */
 4363|   149k|    non_vcl_nal_t *ps_non_vcl;
 4364|   149k|    WORD32 i4_unit_indx;
 4365|   149k|    non_vcl_buf_hdr_t *ps_non_vcl_buf;
 4366|   149k|    WORD32 i_status = OK;
  ------------------
  |  |  114|   149k|#define OK        0
  ------------------
 4367|   149k|    dec_struct_t *ps_dec;
 4368|   149k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 4369|   149k|    dec_bit_stream_t *ps_bitstrm;
 4370|       |
 4371|   149k|    if((NULL == pv_out_non_vcl) || (NULL == pv_seq_params) || (NULL == pv_pic_params))
  ------------------
  |  Branch (4371:8): [True: 0, False: 149k]
  |  Branch (4371:36): [True: 0, False: 149k]
  |  Branch (4371:63): [True: 0, False: 149k]
  ------------------
 4372|      0|    {
 4373|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 4374|      0|    }
 4375|   149k|    UNUSED(pv_seq_params);
  ------------------
  |  |   45|   149k|#define UNUSED(x) ((void)(x))
  ------------------
 4376|   149k|    UNUSED(pv_pic_params);
  ------------------
  |  |   45|   149k|#define UNUSED(x) ((void)(x))
  ------------------
 4377|       |
 4378|       |    /* currently SEI decoding is not supported */
 4379|       |    /* derive the local variables */
 4380|   149k|    ps_non_vcl = (non_vcl_nal_t *) pv_out_non_vcl;
 4381|   149k|    ps_non_vcl_buf = ps_non_vcl->ps_first_non_vcl_nal;
 4382|   149k|    if(NULL == ps_non_vcl_buf) return (NOT_OK);
  ------------------
  |  |  116|  31.4k|#define NOT_OK    -1
  ------------------
  |  Branch (4382:8): [True: 31.4k, False: 117k]
  ------------------
 4383|       |
 4384|       |    /* loop until all NON VCL NAL are decoded */
 4385|   370k|    for(i4_unit_indx = 0; i4_unit_indx < ps_non_vcl->i4_num_non_vcl_nals; i4_unit_indx++)
  ------------------
  |  Branch (4385:27): [True: 281k, False: 89.1k]
  ------------------
 4386|   281k|    {
 4387|   281k|        UWORD32 u4_nal_unit_type;
 4388|   281k|        ps_svc_lyr_dec = ps_svcd_ctxt->ps_svc_dec_lyr;
 4389|   281k|        ps_dec = &ps_svc_lyr_dec->s_dec;
 4390|   281k|        if(NULL == ps_non_vcl_buf) return (NOT_OK);
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  |  Branch (4390:12): [True: 0, False: 281k]
  ------------------
 4391|       |        /* get the current NAL unit type */
 4392|   281k|        u4_nal_unit_type = (UWORD32) ps_non_vcl_buf->i4_nal_unit_type;
 4393|   281k|        if(u4_nal_unit_type > MAX_SVC_NAL_UNIT_TYPE) return (NOT_OK);
  ------------------
  |  |   73|   281k|#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: 281k]
  ------------------
 4394|   281k|        ps_dec->u1_nal_unit_type = u4_nal_unit_type;
 4395|       |
 4396|   281k|        ps_dec->ps_bitstrm->pu4_buffer =
 4397|   281k|            (UWORD32 *) ((UWORD8 *) ps_non_vcl_buf + ps_non_vcl_buf->i4_buf_offset);
 4398|   281k|        ps_dec->ps_bitstrm->u4_ofst = 0;
 4399|   281k|        ps_dec->ps_bitstrm->u4_max_ofst = isvcd_nal_rbsp_to_sodb(
 4400|   281k|            (UWORD8 *) ps_dec->ps_bitstrm->pu4_buffer, ps_non_vcl_buf->i4_buf_size, 0);
 4401|   281k|        if(ps_dec->ps_bitstrm->u4_max_ofst <= 0) return (NOT_OK);
  ------------------
  |  |  116|  2.05k|#define NOT_OK    -1
  ------------------
  |  Branch (4401:12): [True: 2.05k, False: 278k]
  ------------------
 4402|       |
 4403|   278k|        ps_bitstrm = ps_dec->ps_bitstrm;
 4404|       |
 4405|       |        /* call the processing module based on nal unit type */
 4406|   278k|        switch(u4_nal_unit_type)
 4407|   278k|        {
 4408|  78.2k|            case SEQ_PARAM_NAL:
  ------------------
  |  |  330|  78.2k|#define SEQ_PARAM_NAL                   7
  ------------------
  |  Branch (4408:13): [True: 78.2k, False: 200k]
  ------------------
 4409|       |
 4410|  78.2k|                i_status = isvcd_parse_sps(ps_svc_lyr_dec, ps_bitstrm);
 4411|       |
 4412|  78.2k|                if(!i_status)
  ------------------
  |  Branch (4412:20): [True: 69.8k, False: 8.41k]
  ------------------
 4413|  69.8k|                {
 4414|  69.8k|                    ps_dec->i4_header_decoded |= 0x1;
 4415|  69.8k|                    ps_svcd_ctxt->u4_num_sps_ctr++;
 4416|       |
 4417|  69.8k|                    if(ps_svcd_ctxt->pic_width < ps_svc_lyr_dec->pic_width)
  ------------------
  |  Branch (4417:24): [True: 13.3k, False: 56.4k]
  ------------------
 4418|  13.3k|                    {
 4419|  13.3k|                        ps_svcd_ctxt->pic_width = ps_svc_lyr_dec->pic_width;
 4420|  13.3k|                    }
 4421|  69.8k|                    if(ps_svcd_ctxt->pic_height < ps_svc_lyr_dec->pic_height)
  ------------------
  |  Branch (4421:24): [True: 13.3k, False: 56.4k]
  ------------------
 4422|  13.3k|                    {
 4423|  13.3k|                        ps_svcd_ctxt->pic_height = ps_svc_lyr_dec->pic_height;
 4424|  13.3k|                    }
 4425|  69.8k|                }
 4426|       |
 4427|  78.2k|                if(i_status) return i_status;
  ------------------
  |  Branch (4427:20): [True: 8.41k, False: 69.8k]
  ------------------
 4428|       |
 4429|  69.8k|                break;
 4430|  69.8k|            case SUBSET_SPS_NAL:
  ------------------
  |  |   65|  30.9k|#define SUBSET_SPS_NAL 15
  ------------------
  |  Branch (4430:13): [True: 30.9k, False: 248k]
  ------------------
 4431|       |
 4432|  30.9k|                i_status = isvcd_parse_subset_sps(ps_svc_lyr_dec, ps_bitstrm);
 4433|       |
 4434|  30.9k|                if(!i_status)
  ------------------
  |  Branch (4434:20): [True: 21.8k, False: 9.07k]
  ------------------
 4435|  21.8k|                {
 4436|  21.8k|                    ps_svcd_ctxt->u4_num_sps_ctr++;
 4437|  21.8k|                    ps_dec->i4_header_decoded |= 0x1;
 4438|       |
 4439|  21.8k|                    if(ps_svcd_ctxt->pic_width < ps_svc_lyr_dec->pic_width)
  ------------------
  |  Branch (4439:24): [True: 7.57k, False: 14.2k]
  ------------------
 4440|  7.57k|                    {
 4441|  7.57k|                        ps_svcd_ctxt->pic_width = ps_svc_lyr_dec->pic_width;
 4442|  7.57k|                    }
 4443|  21.8k|                    if(ps_svcd_ctxt->pic_height < ps_svc_lyr_dec->pic_height)
  ------------------
  |  Branch (4443:24): [True: 7.61k, False: 14.2k]
  ------------------
 4444|  7.61k|                    {
 4445|  7.61k|                        ps_svcd_ctxt->pic_height = ps_svc_lyr_dec->pic_height;
 4446|  7.61k|                    }
 4447|  21.8k|                }
 4448|  30.9k|                if(i_status) return i_status;
  ------------------
  |  Branch (4448:20): [True: 9.07k, False: 21.8k]
  ------------------
 4449|       |
 4450|  21.8k|                break;
 4451|       |
 4452|  69.4k|            case PIC_PARAM_NAL:
  ------------------
  |  |  331|  69.4k|#define PIC_PARAM_NAL                   8
  ------------------
  |  Branch (4452:13): [True: 69.4k, False: 209k]
  ------------------
 4453|       |
 4454|  69.4k|                i_status = isvcd_parse_pps(ps_svc_lyr_dec, ps_bitstrm);
 4455|  69.4k|                if(!i_status)
  ------------------
  |  Branch (4455:20): [True: 66.7k, False: 2.73k]
  ------------------
 4456|  66.7k|                {
 4457|  66.7k|                    ps_dec->i4_header_decoded |= 0x2;
 4458|  66.7k|                    ps_svcd_ctxt->u4_num_pps_ctr++;
 4459|  66.7k|                }
 4460|  69.4k|                if(i_status) return i_status;
  ------------------
  |  Branch (4460:20): [True: 2.73k, False: 66.7k]
  ------------------
 4461|  66.7k|                break;
 4462|  66.7k|            case SEI_NAL:
  ------------------
  |  |  329|  8.34k|#define SEI_NAL                         6
  ------------------
  |  Branch (4462:13): [True: 8.34k, False: 270k]
  ------------------
 4463|  8.34k|            {
 4464|  8.34k|                i_status = ih264d_parse_sei_message(ps_dec, ps_bitstrm);
 4465|  8.34k|                if(i_status) return i_status;
  ------------------
  |  Branch (4465:20): [True: 6.52k, False: 1.82k]
  ------------------
 4466|  1.82k|                ih264d_parse_sei(ps_dec, ps_bitstrm);
 4467|  1.82k|            }
 4468|      0|            break;
 4469|  92.0k|            default:
  ------------------
  |  Branch (4469:13): [True: 92.0k, False: 186k]
  ------------------
 4470|       |                /* no other NON VCL UNIT is supported */
 4471|  92.0k|                break;
 4472|   278k|        }
 4473|       |
 4474|       |        /* get the next non vcl bufffer */
 4475|   252k|        ps_non_vcl_buf = ps_non_vcl_buf->ps_next;
 4476|       |
 4477|   252k|    } /* end of loop over all NAL units */
 4478|       |
 4479|  89.1k|    return (OK);
  ------------------
  |  |  114|  89.1k|#define OK        0
  ------------------
 4480|   117k|}
isvcd_seq_hdr_dec:
 4505|   114k|{
 4506|   114k|    WORD32 i4_status;
 4507|       |
 4508|       |    /* Decode all non VCL NAL till first VCL NAL is encountered */
 4509|   114k|    ps_svcd_ctxt->s_non_vcl_nal.i4_num_non_vcl_nals = 0;
 4510|   114k|    i4_status = isvcd_nal_parse_non_vcl_nal(
 4511|   114k|        ps_svcd_ctxt->pv_nal_parse_ctxt, ps_in_bufs->pv_stream_buffer, &ps_svcd_ctxt->s_non_vcl_nal,
 4512|   114k|        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|   114k|    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|   114k|    i4_status = isvcd_dec_non_vcl(&ps_svcd_ctxt->s_non_vcl_nal, ps_svcd_ctxt->ps_sps, ps_svcd_ctxt->ps_pps,
 4528|   114k|                      ps_svcd_ctxt);
 4529|       |
 4530|   114k|    return (i4_status);
 4531|   114k|}
isvcd_pre_parse_refine_au:
 4560|   677k|{
 4561|   677k|    WORD32 i4_status = 0, i4_non_vcl_status;
 4562|   677k|    UWORD32 u4_bytes_consumed = 0;
 4563|   677k|    dec_struct_t *ps_dec;
 4564|   677k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 4565|   677k|    ps_svc_lyr_dec = ps_svcd_ctxt->ps_svc_dec_lyr;
 4566|   677k|    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|   677k|    if(SVCD_FALSE == ps_dec->i4_header_decoded)
  ------------------
  |  |   45|   677k|#define SVCD_FALSE 0
  ------------------
  |  Branch (4572:8): [True: 114k, False: 562k]
  ------------------
 4573|   114k|    {
 4574|   114k|        i4_status = isvcd_seq_hdr_dec(ps_svcd_ctxt, ps_in_bufs, &u4_bytes_consumed);
 4575|       |
 4576|   114k|        if((VCL_NAL_FOUND_TRUE == i4_status) && (ps_svcd_ctxt->u4_num_sps_ctr != 0) &&
  ------------------
  |  Branch (4576:12): [True: 0, False: 114k]
  |  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|   114k|    }
 4583|   677k|    *pu4_bytes_consumed = u4_bytes_consumed;
 4584|   677k|    if (i4_status)
  ------------------
  |  Branch (4584:9): [True: 50.5k, False: 626k]
  ------------------
 4585|  50.5k|    {
 4586|  50.5k|        return NOT_OK;
  ------------------
  |  |  116|  50.5k|#define NOT_OK    -1
  ------------------
 4587|  50.5k|    }
 4588|   626k|    if(1 == ps_dec->i4_decode_header)
  ------------------
  |  Branch (4588:8): [True: 440k, False: 186k]
  ------------------
 4589|   440k|    {
 4590|   440k|        return OK;
  ------------------
  |  |  114|   440k|#define OK        0
  ------------------
 4591|   440k|    }
 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|   186k|    if(SVCD_FALSE == ps_svcd_ctxt->i4_eos_flag)
  ------------------
  |  |   45|   186k|#define SVCD_FALSE 0
  ------------------
  |  Branch (4609:8): [True: 186k, False: 0]
  ------------------
 4610|   186k|    {
 4611|   186k|        if(ps_dec->i4_header_decoded == 3)
  ------------------
  |  Branch (4611:12): [True: 168k, False: 18.6k]
  ------------------
 4612|   168k|        {
 4613|   168k|            i4_status = isvcd_nal_parse_vcl_nal_partial(
 4614|   168k|                ps_svcd_ctxt->pv_nal_parse_ctxt, ps_in_bufs->pv_stream_buffer,
 4615|   168k|                &ps_svcd_ctxt->s_non_vcl_nal, &ps_svcd_ctxt->s_vcl_nal, &u4_bytes_consumed,
 4616|   168k|                &ps_in_bufs->u4_num_Bytes);
 4617|   168k|        }
 4618|  18.6k|        else
 4619|  18.6k|        {
 4620|  18.6k|            return NOT_OK;
  ------------------
  |  |  116|  18.6k|#define NOT_OK    -1
  ------------------
 4621|  18.6k|        }
 4622|   186k|    }
 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|   168k|    *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|   168k|    if(PIC_BOUNDARY_FALSE == i4_status)
  ------------------
  |  Branch (4641:8): [True: 5.16k, False: 162k]
  ------------------
 4642|  5.16k|    {
 4643|  5.16k|        return (NOT_OK);
  ------------------
  |  |  116|  5.16k|#define NOT_OK    -1
  ------------------
 4644|  5.16k|    }
 4645|       |
 4646|   162k|    else if(FLUSH_DECODED_PICTURE == i4_status)
  ------------------
  |  Branch (4646:13): [True: 10, False: 162k]
  ------------------
 4647|     10|    {
 4648|       |        /* No more data is expected to come. Pictures decoded   */
 4649|       |        /* so far needs to be sent for display                  */
 4650|     10|        return (FLUSH);
  ------------------
  |  |   50|     10|#define FLUSH 2
  ------------------
 4651|     10|    }
 4652|       |
 4653|   162k|    if(PIC_BOUNDARY_TRUE != i4_status)
  ------------------
  |  Branch (4653:8): [True: 0, False: 162k]
  ------------------
 4654|      0|    {
 4655|      0|        return (NOT_OK);
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 4656|      0|    }
 4657|       |
 4658|       |    /* check if the application has set any of the skip modes       */
 4659|       |    /* add the support for P and B skip modes                       */
 4660|       |    /* if(ps_dec_ctxt->s_dyn_prms.u1_frame_skip_mode)               */
 4661|       |
 4662|       |    /* Parse slice header to decode reference layer dQId and refine */
 4663|       |    /* the dependency list                                          */
 4664|       |    /* NOTE: Yes, this processing could be moved into NAL parsing   */
 4665|       |    /*       routine to avoid unneccessary emulation prevention and */
 4666|       |    /*       byte swapping over discardable data. This Optimization */
 4667|       |    /*       has been deferred for some time. In future if we found */
 4668|       |    /*       that there are many such streams which doesn't set     */
 4669|       |    /*       'discard_flag' correctly in NAL header, we will take a */
 4670|       |    /*       hit to optimize it.                                    */
 4671|       |
 4672|       |    /* At present this routine also performs the following          */
 4673|       |    /* 1. Refine DQID list based on reference layer DQID            */
 4674|       |    /* 2. Calculates the POC for the target layer                   */
 4675|       |
 4676|   162k|    {
 4677|   162k|        i4_status = isvcd_refine_dep_list(
 4678|   162k|            &ps_svcd_ctxt->s_vcl_nal, ps_svcd_ctxt->ps_sps, ps_svcd_ctxt->ps_subset_sps,
 4679|   162k|            ps_svcd_ctxt->ps_pps, &ps_svcd_ctxt->ai4_dq_id_map[0], &ps_svcd_ctxt->as_au_prms_dep[0],
 4680|   162k|            &ps_svcd_ctxt->as_pps_sps_prev_au[0], &ps_svcd_ctxt->i4_error_code, ps_svcd_ctxt);
 4681|   162k|    }
 4682|       |
 4683|   162k|    if(0 != ps_svcd_ctxt->s_non_vcl_nal.i4_num_non_vcl_nals)
  ------------------
  |  Branch (4683:8): [True: 34.9k, False: 128k]
  ------------------
 4684|  34.9k|    {
 4685|       |        /* Decoding of non VCL data. In current implementation it  */
 4686|       |        /* decodes the followings:                                 */
 4687|       |        /*          1. Sequence parameter set                      */
 4688|       |        /*          2. Picture parameter set                       */
 4689|       |        /*          3. SEI message                                 */
 4690|  34.9k|        i4_non_vcl_status = isvcd_dec_non_vcl(&ps_svcd_ctxt->s_non_vcl_nal, ps_svcd_ctxt->ps_sps,
 4691|  34.9k|                                              ps_svcd_ctxt->ps_pps, ps_svcd_ctxt);
 4692|       |
 4693|  34.9k|        if(OK != i4_non_vcl_status) return i4_non_vcl_status;
  ------------------
  |  |  114|  34.9k|#define OK        0
  ------------------
  |  Branch (4693:12): [True: 9.69k, False: 25.2k]
  ------------------
 4694|  34.9k|    }
 4695|   153k|    if(OK != i4_status) return (i4_status);
  ------------------
  |  |  114|   153k|#define OK        0
  ------------------
  |  Branch (4695:8): [True: 1.57k, False: 151k]
  ------------------
 4696|   151k|    return (OK);
  ------------------
  |  |  114|   151k|#define OK        0
  ------------------
 4697|   153k|}
isvcd_video_decode:
 4721|   749k|{
 4722|   749k|    dec_struct_t *ps_dec;
 4723|   749k|    dec_struct_t *ps_dec_zero_lyr;
 4724|   749k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 4725|   749k|    svc_dec_lyr_struct_t *ps_svc_lyr_zero_dec;
 4726|       |
 4727|   749k|    svc_dec_ctxt_t *ps_svcd_ctxt;
 4728|   749k|    WORD32 i4_err_status = 0;
 4729|       |
 4730|   749k|    UWORD32 bytes_consumed = 0;
 4731|   749k|    WORD32 ret = 0, api_ret_value = IV_SUCCESS;
 4732|   749k|    isvcd_video_decode_ip_t *ps_h264d_dec_ip;
 4733|   749k|    isvcd_video_decode_op_t *ps_h264d_dec_op;
 4734|   749k|    ivd_video_decode_ip_t *ps_dec_ip;
 4735|   749k|    ivd_video_decode_op_t *ps_dec_op;
 4736|   749k|    UWORD8 u1_res_id;
 4737|       |
 4738|   749k|    ithread_set_name((void *) "Parse_thread");
 4739|       |
 4740|   749k|    ps_svcd_ctxt = (svc_dec_ctxt_t *) (dec_hdl->pv_codec_handle);
 4741|   749k|    ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[0];
 4742|   749k|    ps_dec = &ps_svc_lyr_dec->s_dec;
 4743|       |
 4744|   749k|    ps_h264d_dec_ip = (isvcd_video_decode_ip_t *) pv_api_ip;
 4745|   749k|    ps_h264d_dec_op = (isvcd_video_decode_op_t *) pv_api_op;
 4746|   749k|    ps_dec_ip = &ps_h264d_dec_ip->s_ivd_video_decode_ip_t;
 4747|   749k|    ps_dec_op = &ps_h264d_dec_op->s_ivd_video_decode_op_t;
 4748|       |
 4749|   749k|    {
 4750|   749k|        UWORD32 u4_size;
 4751|   749k|        u4_size = ps_dec_op->u4_size;
 4752|   749k|        memset(ps_h264d_dec_op, 0, sizeof(isvcd_video_decode_op_t));
 4753|   749k|        ps_dec_op->u4_size = u4_size;
 4754|   749k|    }
 4755|       |
 4756|   749k|    ps_dec->pv_dec_out = ps_dec_op;
 4757|   749k|    if(ps_dec->init_done != 1)
  ------------------
  |  Branch (4757:8): [True: 0, False: 749k]
  ------------------
 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|   749k|    DATA_SYNC();
  ------------------
  |  |  116|   749k|#define DATA_SYNC()  __sync_synchronize()
  ------------------
 4765|       |
 4766|   749k|    if(0 == ps_dec->u1_flushfrm)
  ------------------
  |  Branch (4766:8): [True: 749k, False: 0]
  ------------------
 4767|   749k|    {
 4768|   749k|        if(ps_dec_ip->pv_stream_buffer == NULL)
  ------------------
  |  Branch (4768:12): [True: 0, False: 749k]
  ------------------
 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|   749k|        if(ps_dec_ip->u4_num_Bytes <= 16)
  ------------------
  |  Branch (4774:12): [True: 71.8k, False: 677k]
  ------------------
 4775|  71.8k|        {
 4776|  71.8k|            ps_dec_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
 4777|  71.8k|            ps_dec_op->u4_error_code |= IVD_DEC_NUMBYTES_INV;
 4778|  71.8k|            return IV_FAIL;
 4779|  71.8k|        }
 4780|   749k|    }
 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|   677k|    ps_dec->u4_dec_thread_created = 0;
 4798|   677k|    ps_dec->u4_bs_deblk_thread_created = 0;
 4799|   677k|#endif
 4800|   677k|    ps_dec_op->u4_num_bytes_consumed = 0;
 4801|   677k|    ps_dec_op->i4_reorder_depth = -1;
 4802|   677k|    ps_dec_op->i4_display_index = DEFAULT_POC;
  ------------------
  |  |   45|   677k|#define DEFAULT_POC 0x7FFFFFFF
  ------------------
 4803|       |
 4804|   677k|    ps_dec->ps_out_buffer = NULL;
 4805|   677k|    if(ps_dec_ip->u4_size >= offsetof(ivd_video_decode_ip_t, s_out_buffer))
  ------------------
  |  Branch (4805:8): [True: 677k, False: 0]
  ------------------
 4806|   677k|        ps_dec->ps_out_buffer = &ps_dec_ip->s_out_buffer;
 4807|       |
 4808|   677k|    if(0 == ps_dec->u4_share_disp_buf && ps_dec->i4_decode_header == 0)
  ------------------
  |  Branch (4808:8): [True: 677k, False: 0]
  |  Branch (4808:42): [True: 197k, False: 479k]
  ------------------
 4809|   197k|    {
 4810|   197k|        UWORD32 i;
 4811|   197k|        if((ps_dec->ps_out_buffer->u4_num_bufs == 0) ||
  ------------------
  |  Branch (4811:12): [True: 0, False: 197k]
  ------------------
 4812|   197k|           (ps_dec->ps_out_buffer->u4_num_bufs > IVD_VIDDEC_MAX_IO_BUFFERS))
  ------------------
  |  |   45|   197k|#define IVD_VIDDEC_MAX_IO_BUFFERS 64
  ------------------
  |  Branch (4812:12): [True: 0, False: 197k]
  ------------------
 4813|      0|        {
 4814|      0|            ps_dec_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
 4815|      0|            ps_dec_op->u4_error_code |= IVD_DISP_FRM_ZERO_OP_BUFS;
 4816|      0|            return IV_FAIL;
 4817|      0|        }
 4818|       |
 4819|   692k|        for(i = 0; i < ps_dec->ps_out_buffer->u4_num_bufs; i++)
  ------------------
  |  Branch (4819:20): [True: 494k, False: 197k]
  ------------------
 4820|   494k|        {
 4821|   494k|            if(ps_dec->ps_out_buffer->pu1_bufs[i] == NULL)
  ------------------
  |  Branch (4821:16): [True: 0, False: 494k]
  ------------------
 4822|      0|            {
 4823|      0|                ps_dec_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
 4824|      0|                ps_dec_op->u4_error_code |= IVD_DISP_FRM_OP_BUF_NULL;
 4825|      0|                return IV_FAIL;
 4826|      0|            }
 4827|       |
 4828|   494k|            if(ps_dec->ps_out_buffer->u4_min_out_buf_size[i] == 0)
  ------------------
  |  Branch (4828:16): [True: 0, False: 494k]
  ------------------
 4829|      0|            {
 4830|      0|                ps_dec_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
 4831|      0|                ps_dec_op->u4_error_code |= IVD_DISP_FRM_ZERO_OP_BUF_SIZE;
 4832|      0|                return IV_FAIL;
 4833|      0|            }
 4834|   494k|        }
 4835|   197k|    }
 4836|       |
 4837|   677k|    if(ps_dec->u4_total_frames_decoded >= NUM_FRAMES_LIMIT)
  ------------------
  |  |  157|   677k|#define NUM_FRAMES_LIMIT 0x7FFFFFFF
  ------------------
  |  Branch (4837:8): [True: 0, False: 677k]
  ------------------
 4838|      0|    {
 4839|      0|        ps_dec_op->u4_error_code = ERROR_FRAME_LIMIT_OVER;
 4840|      0|        return IV_FAIL;
 4841|      0|    }
 4842|       |
 4843|   677k|    ps_dec_op->u4_error_code = 0;
 4844|   677k|    ps_dec_op->e_pic_type = IV_NA_FRAME;
 4845|   677k|    ps_dec_op->u4_output_present = 0;
 4846|   677k|    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|   677k|    if(ps_dec->u1_init_dec_flag == 1 && ps_dec->u4_share_disp_buf == 1 && ps_dec->u1_flushfrm == 0)
  ------------------
  |  Branch (4851:8): [True: 122k, False: 554k]
  |  Branch (4851:41): [True: 0, False: 122k]
  |  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|   677k|    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: 677k]
  |  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|   677k|    if(ps_dec->u1_flushfrm && (1 == ps_svcd_ctxt->u1_pre_parse_in_flush))
  ------------------
  |  Branch (4947:8): [True: 0, False: 677k]
  |  Branch (4947:31): [True: 0, False: 0]
  ------------------
 4948|      0|    {
 4949|      0|        if(ps_dec->u1_init_dec_flag == 0)
  ------------------
  |  Branch (4949:12): [True: 0, False: 0]
  ------------------
 4950|      0|        {
 4951|      0|            ps_dec->u1_flushfrm = 0;
 4952|      0|            return (IV_FAIL);
 4953|      0|        }
 4954|       |
 4955|      0|        ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[ps_svcd_ctxt->s_vcl_nal.i4_num_res_lyrs - 1];
 4956|      0|        ps_dec = &ps_svc_lyr_dec->s_dec;
 4957|      0|        ps_dec->u4_fmt_conv_cur_row = 0;
 4958|      0|        ps_dec->u4_output_present = 0;
 4959|      0|        ps_dec->s_disp_op.u4_error_code = 1;
 4960|       |
 4961|      0|        ps_dec->ps_out_buffer = NULL;
 4962|      0|        if(ps_dec_ip->u4_size >= offsetof(ivd_video_decode_ip_t, s_out_buffer))
  ------------------
  |  Branch (4962:12): [True: 0, False: 0]
  ------------------
 4963|      0|        {
 4964|      0|            ps_dec->ps_out_buffer = &ps_dec_ip->s_out_buffer;
 4965|      0|        }
 4966|      0|        ih264d_get_next_display_field(ps_dec, ps_dec->ps_out_buffer, &(ps_dec->s_disp_op));
 4967|      0|        if(0 == ps_dec->s_disp_op.u4_error_code)
  ------------------
  |  Branch (4967:12): [True: 0, False: 0]
  ------------------
 4968|      0|        {
 4969|       |            /* check output buffer size given by the application */
 4970|      0|            if(check_app_out_buf_size(ps_dec) != IV_SUCCESS)
  ------------------
  |  Branch (4970:16): [True: 0, False: 0]
  ------------------
 4971|      0|            {
 4972|      0|                ps_dec_op->u4_error_code = IVD_DISP_FRM_ZERO_OP_BUF_SIZE;
 4973|      0|                return (IV_FAIL);
 4974|      0|            }
 4975|       |
 4976|      0|            ps_dec->u4_fmt_conv_cur_row = 0;
 4977|      0|            ps_dec->u4_fmt_conv_num_rows = ps_dec->s_disp_frame_info.u4_y_ht;
 4978|      0|            ih264d_format_convert(ps_dec, &(ps_dec->s_disp_op), ps_dec->u4_fmt_conv_cur_row,
 4979|      0|                                  ps_dec->u4_fmt_conv_num_rows);
 4980|      0|            ps_dec->u4_fmt_conv_cur_row += ps_dec->u4_fmt_conv_num_rows;
 4981|      0|            ps_dec->u4_output_present = 1;
 4982|      0|            if(ps_dec->u1_enable_mb_info)
  ------------------
  |  Branch (4982:16): [True: 0, False: 0]
  ------------------
 4983|      0|            {
 4984|      0|                UWORD32 disp_buf_id = ps_dec->s_disp_op.u4_disp_buf_id;
 4985|      0|                if(ps_h264d_dec_ip->pu1_8x8_blk_qp_map)
  ------------------
  |  Branch (4985:20): [True: 0, False: 0]
  ------------------
 4986|      0|                {
 4987|      0|                    ps_h264d_dec_op->pu1_8x8_blk_qp_map = ps_h264d_dec_ip->pu1_8x8_blk_qp_map;
 4988|      0|                    ps_h264d_dec_op->u4_8x8_blk_qp_map_size = ps_dec->u4_total_mbs << 2;
 4989|      0|                    memcpy(ps_h264d_dec_op->pu1_8x8_blk_qp_map,
 4990|      0|                                 ps_dec->as_buf_id_info_map[disp_buf_id].pu1_qp_map,
 4991|      0|                                 ps_dec->u4_total_mbs << 2);
 4992|      0|                }
 4993|      0|                if(ps_h264d_dec_ip->pu1_8x8_blk_type_map)
  ------------------
  |  Branch (4993:20): [True: 0, False: 0]
  ------------------
 4994|      0|                {
 4995|      0|                    ps_h264d_dec_op->pu1_8x8_blk_type_map = ps_h264d_dec_ip->pu1_8x8_blk_type_map;
 4996|      0|                    ps_h264d_dec_op->u4_8x8_blk_type_map_size = ps_dec->u4_total_mbs << 2;
 4997|      0|                    memcpy(ps_h264d_dec_op->pu1_8x8_blk_type_map,
 4998|      0|                                 ps_dec->as_buf_id_info_map[disp_buf_id].pu1_mb_type_map,
 4999|      0|                                 ps_dec->u4_total_mbs << 2);
 5000|      0|                }
 5001|      0|            }
 5002|      0|        }
 5003|      0|        ih264d_export_sei_params(&ps_dec_op->s_sei_decode_op, ps_dec);
 5004|       |
 5005|      0|        ih264d_release_display_field(ps_dec, &(ps_dec->s_disp_op));
 5006|       |
 5007|      0|        ps_dec_op->u4_pic_wd = (UWORD32) ps_dec->u2_disp_width;
 5008|      0|        ps_dec_op->u4_pic_ht = (UWORD32) ps_dec->u2_disp_height;
 5009|      0|        ps_dec_op->i4_reorder_depth = ps_dec->i4_reorder_depth;
 5010|      0|        ps_dec_op->i4_display_index = ps_dec->i4_display_index;
 5011|      0|        ps_dec_op->u4_new_seq = 0;
 5012|       |
 5013|      0|        ps_dec_op->u4_output_present = ps_dec->u4_output_present;
 5014|      0|        ps_dec_op->u4_progressive_frame_flag = ps_dec->s_disp_op.u4_progressive_frame_flag;
 5015|      0|        ps_dec_op->e_output_format = ps_dec->s_disp_op.e_output_format;
 5016|      0|        ps_dec_op->s_disp_frm_buf = ps_dec->s_disp_op.s_disp_frm_buf;
 5017|      0|        ps_dec_op->e4_fld_type = ps_dec->s_disp_op.e4_fld_type;
 5018|      0|        ps_dec_op->u4_ts = ps_dec->s_disp_op.u4_ts;
 5019|      0|        ps_dec_op->u4_disp_buf_id = ps_dec->s_disp_op.u4_disp_buf_id;
 5020|       |
 5021|       |        /*In the case of flush ,since no frame is decoded set pic type as invalid*/
 5022|      0|        ps_dec_op->u4_is_ref_flag = UINT32_MAX;
 5023|      0|        ps_dec_op->e_pic_type = IV_NA_FRAME;
 5024|      0|        ps_dec_op->u4_frame_decoded_flag = 0;
 5025|       |
 5026|      0|        if(0 == ps_dec->s_disp_op.u4_error_code)
  ------------------
  |  Branch (5026:12): [True: 0, False: 0]
  ------------------
 5027|      0|        {
 5028|      0|            return (IV_SUCCESS);
 5029|      0|        }
 5030|      0|        else
 5031|      0|            return (IV_FAIL);
 5032|      0|    }
 5033|       |
 5034|   677k|    if(ps_dec->u1_res_changed == 1)
  ------------------
  |  Branch (5034:8): [True: 3.03k, False: 674k]
  ------------------
 5035|  3.03k|    {
 5036|       |        /*if resolution has changed and all buffers have been flushed, reset
 5037|       |         * decoder*/
 5038|  3.03k|        if(((buf_mgr_t *) ps_dec->pv_pic_buf_mgr)->pv_mutex != NULL)
  ------------------
  |  Branch (5038:12): [True: 153, False: 2.88k]
  ------------------
 5039|    153|            ih264_buf_mgr_free(ps_dec->pv_pic_buf_mgr);
 5040|  3.03k|        if(((buf_mgr_t *) ps_dec->pv_mv_buf_mgr)->pv_mutex != NULL)
  ------------------
  |  Branch (5040:12): [True: 153, False: 2.88k]
  ------------------
 5041|    153|            ih264_buf_mgr_free(ps_dec->pv_mv_buf_mgr);
 5042|       |
 5043|  3.03k|        isvcd_init_decoder(ps_svc_lyr_dec);
 5044|  3.03k|    }
 5045|       |
 5046|   677k|    DEBUG_THREADS_PRINTF(" Starting process call\n");
 5047|       |
 5048|   677k|    {
 5049|   677k|        vcl_node_t *ps_cur_node;
 5050|   677k|        UWORD8 u1_num_res_lyrs;
 5051|   677k|        vcl_buf_hdr_t *ps_vcl_buf;
 5052|   677k|        UWORD8 flush_decode = 1;
 5053|   677k|        ps_svcd_ctxt->u1_pre_parse_in_flush = 0;
 5054|       |
 5055|   677k|        ret = isvcd_pre_parse_refine_au(ps_svcd_ctxt, ps_dec_ip, &ps_dec_op->u4_num_bytes_consumed);
 5056|   677k|        ps_svcd_ctxt->u1_pre_parse_in_flush = (ret == FLUSH);
  ------------------
  |  |   50|   677k|#define FLUSH 2
  ------------------
 5057|       |
 5058|   677k|        if(ret != OK)
  ------------------
  |  |  114|   677k|#define OK        0
  ------------------
  |  Branch (5058:12): [True: 85.6k, False: 591k]
  ------------------
 5059|  85.6k|        {
 5060|  85.6k|            UWORD32 error = ih264d_map_error((UWORD32) ret);
 5061|  85.6k|            if(ret != NOT_OK)
  ------------------
  |  |  116|  85.6k|#define NOT_OK    -1
  ------------------
  |  Branch (5061:16): [True: 8.79k, False: 76.8k]
  ------------------
 5062|  8.79k|            {
 5063|  8.79k|                ps_dec_op->u4_error_code = error | ret;
 5064|  8.79k|            }
 5065|  85.6k|            if((ps_dec_op->u4_error_code >> IVD_FATALERROR) & 1)
  ------------------
  |  Branch (5065:16): [True: 1.08k, False: 84.5k]
  ------------------
 5066|  1.08k|            {
 5067|  1.08k|                ps_svcd_ctxt->u1_exit_till_next_IDR = 1;
 5068|  1.08k|            }
 5069|  85.6k|            api_ret_value = IV_FAIL;
 5070|  85.6k|            if((ret == IVD_RES_CHANGED) || (ret == IVD_MEM_ALLOC_FAILED) ||
  ------------------
  |  Branch (5070:16): [True: 5.99k, False: 79.6k]
  |  Branch (5070:44): [True: 0, False: 79.6k]
  ------------------
 5071|  79.6k|               (ret == ERROR_UNAVAIL_PICBUF_T) || (ret == ERROR_UNAVAIL_MVBUF_T) ||
  ------------------
  |  Branch (5071:16): [True: 0, False: 79.6k]
  |  Branch (5071:51): [True: 0, False: 79.6k]
  ------------------
 5072|  79.6k|               (ret == ERROR_INV_SPS_PPS_T) || (ret == ERROR_FEATURE_UNAVAIL) ||
  ------------------
  |  Branch (5072:16): [True: 669, False: 78.9k]
  |  Branch (5072:48): [True: 579, False: 78.3k]
  ------------------
 5073|  78.3k|               (ret == IVD_STREAM_WIDTH_HEIGHT_NOT_SUPPORTED) ||
  ------------------
  |  Branch (5073:16): [True: 502, False: 77.8k]
  ------------------
 5074|  77.8k|               (ret == IVD_DISP_FRM_ZERO_OP_BUF_SIZE))
  ------------------
  |  Branch (5074:16): [True: 0, False: 77.8k]
  ------------------
 5075|  7.74k|            {
 5076|  7.74k|                ps_dec->u4_slice_start_code_found = 0;
 5077|  7.74k|            }
 5078|  85.6k|            if((ret == ERROR_INCOMPLETE_FRAME) || (ret == ERROR_DANGLING_FIELD_IN_PIC))
  ------------------
  |  Branch (5078:16): [True: 0, False: 85.6k]
  |  Branch (5078:51): [True: 0, False: 85.6k]
  ------------------
 5079|      0|            {
 5080|      0|                api_ret_value = IV_FAIL;
 5081|      0|            }
 5082|       |
 5083|  85.6k|            if(ret == ERROR_IN_LAST_SLICE_OF_PIC)
  ------------------
  |  Branch (5083:16): [True: 0, False: 85.6k]
  ------------------
 5084|      0|            {
 5085|      0|                api_ret_value = IV_FAIL;
 5086|      0|            }
 5087|  85.6k|        }
 5088|       |
 5089|   677k|        if(NOT_OK == ret)
  ------------------
  |  |  116|   677k|#define NOT_OK    -1
  ------------------
  |  Branch (5089:12): [True: 76.8k, False: 600k]
  ------------------
 5090|  76.8k|        {
 5091|  76.8k|            if(ps_dec->u4_pic_buf_got == 0)
  ------------------
  |  Branch (5091:16): [True: 69.8k, False: 6.97k]
  ------------------
 5092|  69.8k|            {
 5093|  69.8k|                ps_dec->i4_error_code = ERROR_START_CODE_NOT_FOUND;
 5094|  69.8k|                ps_dec_op->u4_error_code |= 1 << IVD_INSUFFICIENTDATA;
 5095|       |
 5096|  69.8k|                isvcd_fill_output_struct_from_context(ps_svc_lyr_dec, ps_dec_op);
 5097|       |
 5098|  69.8k|                ps_dec_op->u4_error_code = ps_dec->i4_error_code;
 5099|  69.8k|                ps_dec_op->u4_frame_decoded_flag = 0;
 5100|  69.8k|                return (IV_FAIL);
 5101|  69.8k|            }
 5102|  6.97k|            return (IV_SUCCESS);
 5103|  76.8k|        }
 5104|       |
 5105|   600k|        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|   600k|        {
 5110|   600k|            ps_cur_node = ps_svcd_ctxt->s_vcl_nal.ps_bot_node;
 5111|       |
 5112|   600k|            if(NULL != ps_cur_node)
  ------------------
  |  Branch (5112:16): [True: 160k, False: 440k]
  ------------------
 5113|   160k|            {
 5114|   160k|                if(!ps_cur_node->i4_idr_pic_flag)
  ------------------
  |  Branch (5114:20): [True: 32.8k, False: 127k]
  ------------------
 5115|  32.8k|                {
 5116|  32.8k|                    if(u1_num_res_lyrs != ps_svcd_ctxt->u1_prev_num_res_layers)
  ------------------
  |  Branch (5116:24): [True: 5.07k, False: 27.7k]
  ------------------
 5117|  5.07k|                    {
 5118|  5.07k|                        ps_svcd_ctxt->u1_exit_till_next_IDR = 1;
 5119|  5.07k|                        ps_dec_op->u4_error_code = ERROR_UNKNOWN_NAL;
 5120|  5.07k|                        return IV_FAIL;
 5121|  5.07k|                    }
 5122|  32.8k|                }
 5123|   127k|                else
 5124|   127k|                {
 5125|   127k|                    if(u1_num_res_lyrs != ps_svcd_ctxt->u1_prev_num_res_layers)
  ------------------
  |  Branch (5125:24): [True: 46.5k, False: 80.7k]
  ------------------
 5126|  46.5k|                    {
 5127|  46.5k|                        ps_svcd_ctxt->u1_prev_num_res_layers = u1_num_res_lyrs;
 5128|  46.5k|                    }
 5129|   127k|                }
 5130|   160k|            }
 5131|   600k|        }
 5132|   595k|        if(ps_svcd_ctxt->u1_prev_num_res_layers != u1_num_res_lyrs && (u1_num_res_lyrs != 0))
  ------------------
  |  Branch (5132:12): [True: 440k, False: 155k]
  |  Branch (5132:71): [True: 69, False: 440k]
  ------------------
 5133|     69|        {
 5134|     69|            ps_svc_lyr_dec = ps_svcd_ctxt->ps_svc_dec_lyr + u1_num_res_lyrs - 1;
 5135|     69|            ps_dec = &ps_svc_lyr_dec->s_dec;
 5136|       |
 5137|     69|            if(ps_dec->u1_init_dec_flag == 1)
  ------------------
  |  Branch (5137:16): [True: 3, False: 66]
  ------------------
 5138|      3|            {
 5139|      3|                ih264d_release_pics_in_dpb((void *) ps_dec, ps_dec->u1_pic_bufs);
 5140|      3|                ih264d_release_display_bufs(ps_dec);
 5141|      3|                ih264_disp_mgr_init((disp_mgr_t *) ps_dec->pv_disp_buf_mgr);
 5142|       |
 5143|      3|                ih264_buf_mgr_reset(ps_dec->pv_pic_buf_mgr);
 5144|      3|                ih264_buf_mgr_reset(ps_dec->pv_mv_buf_mgr);
 5145|      3|                ih264d_init_ref_bufs(ps_dec->ps_dpb_mgr);
 5146|      3|            }
 5147|       |
 5148|       |            // ps_svcd_ctxt->u1_prev_num_res_layers = u1_num_res_lyrs;
 5149|     69|        }
 5150|   595k|        ps_svcd_ctxt->u1_parse_nal_unit_error = 0;
 5151|       |
 5152|   595k|        if((1 == ps_svcd_ctxt->u1_exit_till_next_IDR) &&
  ------------------
  |  Branch (5152:12): [True: 56.5k, False: 538k]
  ------------------
 5153|  56.5k|           (ps_svcd_ctxt->s_vcl_nal.ps_bot_node != NULL))
  ------------------
  |  Branch (5153:12): [True: 56.3k, False: 248]
  ------------------
 5154|  56.3k|        {
 5155|  56.3k|            if(1 == ps_svcd_ctxt->s_vcl_nal.ps_bot_node->i4_idr_pic_flag)
  ------------------
  |  Branch (5155:16): [True: 51.1k, False: 5.20k]
  ------------------
 5156|  51.1k|            {
 5157|  51.1k|                ps_svcd_ctxt->u1_exit_till_next_IDR = 0;
 5158|       |
 5159|   133k|                for(u1_res_id = 0; u1_res_id < u1_num_res_lyrs; u1_res_id++)
  ------------------
  |  Branch (5159:36): [True: 82.2k, False: 51.1k]
  ------------------
 5160|  82.2k|                {
 5161|  82.2k|                    ps_svc_lyr_dec = ps_svcd_ctxt->ps_svc_dec_lyr + u1_res_id;
 5162|  82.2k|                    ps_dec = &ps_svc_lyr_dec->s_dec;
 5163|  82.2k|                    ih264_buf_mgr_reset(ps_dec->pv_pic_buf_mgr);
 5164|  82.2k|                    ih264_buf_mgr_reset(ps_dec->pv_mv_buf_mgr);
 5165|  82.2k|                }
 5166|  51.1k|            }
 5167|  5.20k|            else
 5168|  5.20k|            {
 5169|  5.20k|                ps_dec_op->u4_error_code = ERROR_UNKNOWN_NAL;
 5170|  5.20k|                return IV_FAIL;
 5171|  5.20k|            }
 5172|  56.3k|        }
 5173|       |
 5174|   590k|        if((0 == ps_dec->i4_decode_header) && (OK == ret))
  ------------------
  |  |  114|   150k|#define OK        0
  ------------------
  |  Branch (5174:12): [True: 150k, False: 440k]
  |  Branch (5174:47): [True: 141k, False: 8.23k]
  ------------------
 5175|   141k|        {
 5176|   141k|            flush_decode = 0;
 5177|   141k|            ps_cur_node = ps_svcd_ctxt->s_vcl_nal.ps_bot_node;
 5178|   141k|            ps_svc_lyr_zero_dec = ps_svcd_ctxt->ps_svc_dec_lyr;
 5179|   141k|            ps_dec_zero_lyr = &ps_svc_lyr_zero_dec->s_dec;
 5180|       |            /* master loop */
 5181|       |
 5182|   272k|            for(u1_res_id = 0; u1_res_id < u1_num_res_lyrs; u1_res_id++)
  ------------------
  |  Branch (5182:32): [True: 181k, False: 91.1k]
  ------------------
 5183|   181k|            {
 5184|   181k|                UWORD8 u1_layer_nal_data_present = 0;
 5185|   181k|                ps_svcd_ctxt->u1_cur_layer_id = u1_res_id;
 5186|   181k|                ps_svc_lyr_dec = ps_svcd_ctxt->ps_svc_dec_lyr + u1_res_id;
 5187|   181k|                ps_svc_lyr_dec->u1_res_init_done = 0;
 5188|   181k|                ps_dec = &ps_svc_lyr_dec->s_dec;
 5189|       |
 5190|   181k|                ps_dec->i4_decode_header = ps_dec_zero_lyr->i4_decode_header;
 5191|   181k|                ps_dec->i4_header_decoded = ps_dec_zero_lyr->i4_header_decoded;
 5192|   181k|                ps_dec->u1_pic_decode_done = 0;
 5193|   181k|                ps_dec->u4_fmt_conv_cur_row = 0;
 5194|       |
 5195|   181k|                ps_dec->u4_output_present = 0;
 5196|   181k|                ps_dec->s_disp_op.u4_error_code = 1;
 5197|   181k|                ps_dec->u4_fmt_conv_num_rows = FMT_CONV_NUM_ROWS;
  ------------------
  |  |   46|   181k|#define FMT_CONV_NUM_ROWS       16
  ------------------
 5198|   181k|                ps_dec->u4_ts = ps_dec_ip->u4_ts;
 5199|   181k|                ps_dec->i4_frametype = IV_NA_FRAME;
 5200|   181k|                ps_dec->i4_content_type = IV_CONTENTTYPE_NA;
 5201|       |
 5202|   181k|                ps_dec->u4_slice_start_code_found = 0;
 5203|   181k|                ps_dec->u4_cur_mb_addr = 0;
 5204|   181k|                ps_dec->u4_total_mbs_coded = 0;
 5205|   181k|                ps_dec->u2_cur_slice_num = 0;
 5206|   181k|                ps_dec->cur_dec_mb_num = 0;
 5207|   181k|                ps_dec->cur_recon_mb_num = 0;
 5208|   181k|                ps_dec->u4_first_slice_in_pic = 1;
 5209|   181k|                ps_dec->u1_slice_header_done = 0;
 5210|   181k|                ps_dec->u1_dangling_field = 0;
 5211|       |
 5212|   181k|                ps_dec->u4_dec_thread_created = 0;
 5213|   181k|                ps_dec->u4_bs_deblk_thread_created = 0;
 5214|   181k|                ps_dec->u4_cur_bs_mb_num = 0;
 5215|   181k|                ps_dec->u4_cur_deblk_mb_num = 0;
 5216|   181k|                ps_dec->u4_start_recon_deblk = 0;
 5217|   181k|                ps_dec->u4_sps_cnt_in_process = 0;
 5218|   181k|                ps_dec->u4_pic_buf_got = 0;
 5219|   181k|                ps_dec->pv_dec_out = ps_dec_op;
 5220|       |
 5221|   181k|                if(ps_dec_ip->u4_size >= offsetof(ivd_video_decode_ip_t, s_out_buffer))
  ------------------
  |  Branch (5221:20): [True: 181k, False: 0]
  ------------------
 5222|   181k|                    ps_dec->ps_out_buffer = &ps_dec_ip->s_out_buffer;
 5223|       |
 5224|   181k|                ps_dec->u1_nal_unit_type = ps_cur_node->i4_nal_unit_type;
 5225|   181k|                ps_dec->u1_separate_parse = 0;
 5226|   181k|                if(u1_res_id == (u1_num_res_lyrs - 1))
  ------------------
  |  Branch (5226:20): [True: 130k, False: 50.8k]
  ------------------
 5227|   130k|                {
 5228|   130k|                    ps_svc_lyr_dec->u1_layer_identifier = TARGET_LAYER;
  ------------------
  |  |  110|   130k|#define TARGET_LAYER 2
  ------------------
 5229|   130k|                    if(ps_dec->u4_num_cores >= 2)
  ------------------
  |  Branch (5229:24): [True: 66.5k, False: 64.1k]
  ------------------
 5230|  66.5k|                    {
 5231|  66.5k|                        ps_dec->u4_num_cores = 2;
 5232|  66.5k|                        ps_dec->u1_separate_parse = 1;
 5233|  66.5k|                    }
 5234|   130k|                }
 5235|  50.8k|                else if(u1_res_id == 0)
  ------------------
  |  Branch (5235:25): [True: 50.8k, False: 0]
  ------------------
 5236|  50.8k|                {
 5237|  50.8k|                    ps_svc_lyr_dec->u1_layer_identifier = BASE_LAYER;
  ------------------
  |  |  108|  50.8k|#define BASE_LAYER 0
  ------------------
 5238|  50.8k|                    ps_dec->u1_separate_parse = 0;
 5239|  50.8k|                    ps_dec->u4_num_cores = 1;
 5240|  50.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|   181k|                ps_svc_lyr_dec->u1_base_res_flag = (0 == u1_res_id);
 5253|   181k|                ps_svc_lyr_dec->ps_nal_svc_ext->u1_idr_flag = ps_cur_node->i4_idr_pic_flag;
 5254|   181k|                ps_svc_lyr_dec->ps_nal_svc_ext->u1_dependency_id = ps_cur_node->i4_dependency_id;
 5255|   181k|                ps_svc_lyr_dec->ps_nal_svc_ext->u1_priority_id = ps_cur_node->i4_priority_id;
 5256|   181k|                ps_svc_lyr_dec->ps_nal_svc_ext->u1_no_inter_layer_pred_flag =
 5257|   181k|                    ps_cur_node->u1_acc_no_int_pred;
 5258|       |
 5259|   181k|                ps_svc_lyr_dec->ps_nal_svc_ext->u1_quality_id = ps_cur_node->i4_quality_id;
 5260|   181k|                ps_svc_lyr_dec->ps_nal_svc_ext->u1_temporal_id = ps_cur_node->i4_temporal_id;
 5261|       |
 5262|   181k|                ps_svc_lyr_dec->ps_nal_svc_ext->u1_use_ref_base_pic_flag =
 5263|   181k|                    ps_cur_node->i4_use_ref_base;
 5264|   181k|                ps_svc_lyr_dec->ps_nal_svc_ext->u1_discardable_flag = 0;
 5265|   181k|                ps_svc_lyr_dec->ps_nal_svc_ext->u1_svc_ext_flag = (u1_res_id > 1);
 5266|   181k|                ps_svc_lyr_dec->u4_pps_id_for_layer = UINT32_MAX;
 5267|   181k|                ps_vcl_buf = ps_cur_node->ps_first_vcl_nal;
 5268|   181k|                ps_svc_lyr_dec->u1_error_in_cur_frame = 0;
 5269|       |
 5270|       |                /* Only for Non target Layers*/
 5271|   181k|                if(NULL != ps_cur_node->ps_top_node)
  ------------------
  |  Branch (5271:20): [True: 65.2k, False: 116k]
  ------------------
 5272|  65.2k|                {
 5273|  65.2k|                    ps_svc_lyr_dec->u1_inter_lyr_disable_dblk_filter_idc =
 5274|  65.2k|                        ps_cur_node->ps_top_node->i4_inter_lyr_dblk_idc;
 5275|  65.2k|                    ps_svc_lyr_dec->i1_inter_lyr_slice_alpha_c0_offset =
 5276|  65.2k|                        ps_cur_node->ps_top_node->i4_inter_lyr_alpha_c0_offset;
 5277|  65.2k|                    ps_svc_lyr_dec->i1_inter_lyr_slice_beta_offset =
 5278|  65.2k|                        ps_cur_node->ps_top_node->i4_inter_lyr_beta_offset;
 5279|  65.2k|                }
 5280|       |
 5281|   249k|                while(NULL != ps_vcl_buf)
  ------------------
  |  Branch (5281:23): [True: 179k, False: 70.2k]
  ------------------
 5282|   179k|                {
 5283|   179k|                    u1_layer_nal_data_present = 1;
 5284|   179k|                    ps_dec->ps_bitstrm->u4_ofst = 0;
 5285|   179k|                    ps_dec->ps_bitstrm->pu4_buffer =
 5286|   179k|                        (UWORD32 *) ((UWORD8 *) ps_vcl_buf + ps_vcl_buf->i4_buf_offset +
 5287|   179k|                                     ps_vcl_buf->i4_slice_offset);
 5288|       |
 5289|   179k|                    ps_dec->ps_bitstrm->u4_max_ofst = ps_vcl_buf->u4_max_bits;
 5290|       |
 5291|   179k|                    ps_dec_op->u4_frame_decoded_flag = 0;
 5292|   179k|                    ret = isvcd_parse_nal_unit(ps_svc_lyr_dec, ps_cur_node->i4_nal_ref_idc);
 5293|   179k|                    if(ret != OK)
  ------------------
  |  |  114|   179k|#define OK        0
  ------------------
  |  Branch (5293:24): [True: 111k, False: 67.8k]
  ------------------
 5294|   111k|                    {
 5295|   111k|                        ps_svcd_ctxt->u1_parse_nal_unit_error = 1;
 5296|   111k|                        break;
 5297|   111k|                    }
 5298|       |
 5299|       |                    /* go to the next slice */
 5300|  67.8k|                    ps_vcl_buf = ps_vcl_buf->ps_next;
 5301|  67.8k|                }
 5302|       |                /* error concelment: exit till next IDR if a Layer data is missing */
 5303|   181k|                if(0 == u1_layer_nal_data_present)
  ------------------
  |  Branch (5303:20): [True: 7.48k, False: 174k]
  ------------------
 5304|  7.48k|                {
 5305|  7.48k|                    ps_svcd_ctxt->u1_exit_till_next_IDR = 1;
 5306|  7.48k|                    ps_dec_op->u4_error_code = ERROR_UNKNOWN_NAL;
 5307|  7.48k|                    return IV_FAIL;
 5308|  7.48k|                }
 5309|       |                /* error concelment: exit till next IDR if any of Non Target layers are
 5310|       |                 * corrupted */
 5311|   174k|                if((ret != OK) && (u1_res_id != (u1_num_res_lyrs - 1)))
  ------------------
  |  |  114|   174k|#define OK        0
  ------------------
  |  Branch (5311:20): [True: 111k, False: 62.7k]
  |  Branch (5311:35): [True: 10.3k, False: 101k]
  ------------------
 5312|  10.3k|                {
 5313|  10.3k|                    ps_svcd_ctxt->u1_exit_till_next_IDR = 1;
 5314|  10.3k|                    ps_dec_op->u4_error_code = ERROR_UNKNOWN_NAL;
 5315|  10.3k|                    return IV_FAIL;
 5316|  10.3k|                }
 5317|       |
 5318|   163k|                if((ret != OK) && (u1_res_id == (u1_num_res_lyrs - 1)))
  ------------------
  |  |  114|   163k|#define OK        0
  ------------------
  |  Branch (5318:20): [True: 101k, False: 62.7k]
  |  Branch (5318:35): [True: 101k, False: 0]
  ------------------
 5319|   101k|                {
 5320|   101k|                    ps_svc_lyr_dec = ps_svcd_ctxt->ps_svc_dec_lyr + u1_num_res_lyrs - 1;
 5321|   101k|                    ps_dec = &ps_svc_lyr_dec->s_dec;
 5322|       |
 5323|   101k|                    if((0 == ps_svcd_ctxt->u4_num_sps_ctr) || (0 == ps_svcd_ctxt->u4_num_pps_ctr) ||
  ------------------
  |  Branch (5323:24): [True: 0, False: 101k]
  |  Branch (5323:63): [True: 0, False: 101k]
  ------------------
 5324|   101k|                       (NULL == ps_dec->ps_cur_pps) || (ps_svc_lyr_dec->u1_res_init_done == 0))
  ------------------
  |  Branch (5324:24): [True: 13.6k, False: 87.3k]
  |  Branch (5324:56): [True: 18.7k, False: 68.6k]
  ------------------
 5325|  32.3k|                    {
 5326|  32.3k|                        ps_svcd_ctxt->u1_exit_till_next_IDR = 1;
 5327|  32.3k|                        ps_dec_op->u4_error_code = ERROR_UNKNOWN_NAL;
 5328|  32.3k|                        ih264d_signal_decode_thread(ps_dec);
 5329|  32.3k|                        return IV_FAIL;
 5330|  32.3k|                    }
 5331|   101k|                }
 5332|   131k|                ps_cur_node = ps_cur_node->ps_top_node;
 5333|       |
 5334|   131k|                if((ps_dec->u4_pic_buf_got == 1) && (ret != IVD_MEM_ALLOC_FAILED) &&
  ------------------
  |  Branch (5334:20): [True: 131k, False: 0]
  |  Branch (5334:53): [True: 131k, False: 0]
  ------------------
 5335|   131k|                   ps_dec->u4_total_mbs_coded < ps_dec->u2_frm_ht_in_mbs * ps_dec->u2_frm_wd_in_mbs)
  ------------------
  |  Branch (5335:20): [True: 97.5k, False: 33.8k]
  ------------------
 5336|  97.5k|                {
 5337|       |                    // last slice - missing/corruption
 5338|  97.5k|                    WORD32 num_mb_skipped;
 5339|  97.5k|                    WORD32 prev_slice_err;
 5340|  97.5k|                    pocstruct_t temp_poc;
 5341|  97.5k|                    WORD32 ret1;
 5342|  97.5k|                    WORD32 ht_in_mbs;
 5343|  97.5k|                    ht_in_mbs = ps_dec->u2_pic_ht >> (4 + ps_dec->ps_cur_slice->u1_field_pic_flag);
 5344|  97.5k|                    num_mb_skipped =
 5345|  97.5k|                        (ht_in_mbs * ps_dec->u2_frm_wd_in_mbs) - ps_dec->u4_total_mbs_coded;
 5346|       |
 5347|  97.5k|                    if(ps_dec->u4_first_slice_in_pic && (ps_dec->u4_pic_buf_got == 0))
  ------------------
  |  Branch (5347:24): [True: 0, False: 97.5k]
  |  Branch (5347:57): [True: 0, False: 0]
  ------------------
 5348|      0|                        prev_slice_err = 1;
 5349|  97.5k|                    else
 5350|  97.5k|                        prev_slice_err = 2;
 5351|       |
 5352|  97.5k|                    if(ps_dec->u4_total_mbs_coded == 0)
  ------------------
  |  Branch (5352:24): [True: 51.5k, False: 46.0k]
  ------------------
 5353|  51.5k|                    {
 5354|  51.5k|                        prev_slice_err = 1;
 5355|  51.5k|                    }
 5356|  97.5k|                    ret1 = isvcd_mark_err_slice_skip(
 5357|  97.5k|                        ps_svc_lyr_dec, num_mb_skipped, ps_dec->u1_nal_unit_type == IDR_SLICE_NAL,
  ------------------
  |  |  328|  97.5k|#define IDR_SLICE_NAL                   5
  ------------------
 5358|  97.5k|                        ps_dec->ps_cur_slice->u2_frame_num, &temp_poc, prev_slice_err);
 5359|       |
 5360|  97.5k|                    if((ret1 == ERROR_UNAVAIL_PICBUF_T) || (ret1 == ERROR_UNAVAIL_MVBUF_T) ||
  ------------------
  |  Branch (5360:24): [True: 0, False: 97.5k]
  |  Branch (5360:60): [True: 0, False: 97.5k]
  ------------------
 5361|  97.5k|                       (ret1 == ERROR_INV_SPS_PPS_T) || (ret1 == ERROR_CORRUPTED_SLICE) ||
  ------------------
  |  Branch (5361:24): [True: 0, False: 97.5k]
  |  Branch (5361:57): [True: 0, False: 97.5k]
  ------------------
 5362|  97.5k|                       (ret == NOT_OK))
  ------------------
  |  |  116|  97.5k|#define NOT_OK    -1
  ------------------
  |  Branch (5362:24): [True: 1.60k, False: 95.9k]
  ------------------
 5363|  1.60k|                    {
 5364|  1.60k|                        ret = ret1;
 5365|  1.60k|                    }
 5366|  97.5k|                }
 5367|       |
 5368|   131k|                if((ret == IVD_RES_CHANGED) || (ret == IVD_MEM_ALLOC_FAILED) ||
  ------------------
  |  Branch (5368:20): [True: 0, False: 131k]
  |  Branch (5368:48): [True: 0, False: 131k]
  ------------------
 5369|   131k|                   (ret == ERROR_UNAVAIL_PICBUF_T) || (ret == ERROR_UNAVAIL_MVBUF_T) ||
  ------------------
  |  Branch (5369:20): [True: 0, False: 131k]
  |  Branch (5369:55): [True: 0, False: 131k]
  ------------------
 5370|   131k|                   (ret == ERROR_INV_SPS_PPS_T) || (ret == ERROR_CORRUPTED_SLICE) ||
  ------------------
  |  Branch (5370:20): [True: 0, False: 131k]
  |  Branch (5370:52): [True: 547, False: 130k]
  ------------------
 5371|   130k|                   (ret == IVD_DISP_FRM_ZERO_OP_BUF_SIZE) || (ret == NOT_OK))
  ------------------
  |  |  116|   130k|#define NOT_OK    -1
  ------------------
  |  Branch (5371:20): [True: 0, False: 130k]
  |  Branch (5371:62): [True: 88, False: 130k]
  ------------------
 5372|    635|                {
 5373|    635|                    ps_svcd_ctxt->u1_exit_till_next_IDR = 1;
 5374|       |                    /* signal the decode thread */
 5375|    635|                    ih264d_signal_decode_thread(ps_dec);
 5376|       |                    /* dont consume bitstream for change in resolution case */
 5377|    635|                    if(ret == IVD_RES_CHANGED)
  ------------------
  |  Branch (5377:24): [True: 0, False: 635]
  ------------------
 5378|      0|                    {
 5379|      0|                        ps_dec_op->u4_num_bytes_consumed -= bytes_consumed;
 5380|      0|                    }
 5381|    635|                    return IV_FAIL;
 5382|    635|                }
 5383|       |
 5384|       |                /* Multi thread - for target Layer decoding*/
 5385|   130k|                if((ps_dec->u1_separate_parse) &&
  ------------------
  |  Branch (5385:20): [True: 52.4k, False: 78.2k]
  ------------------
 5386|  52.4k|                   (ps_svc_lyr_dec->u1_layer_identifier == TARGET_LAYER) &&
  ------------------
  |  |  110|  52.4k|#define TARGET_LAYER 2
  ------------------
  |  Branch (5386:20): [True: 52.4k, False: 0]
  ------------------
 5387|  52.4k|                   (0 == ps_svc_lyr_dec->u1_error_in_cur_frame))
  ------------------
  |  Branch (5387:20): [True: 7.21k, False: 45.2k]
  ------------------
 5388|  7.21k|                {
 5389|       |                    /* If Format conversion is not complete,
 5390|       |                     complete it here */
 5391|  7.21k|                    if(ps_dec->u4_num_cores == 2)
  ------------------
  |  Branch (5391:24): [True: 7.21k, False: 0]
  ------------------
 5392|  7.21k|                    {
 5393|       |                        /*do deblocking of all mbs*/
 5394|  7.21k|                        if((ps_dec->u4_nmb_deblk == 0) && (ps_dec->u4_start_recon_deblk == 1) &&
  ------------------
  |  Branch (5394:28): [True: 7.21k, False: 0]
  |  Branch (5394:59): [True: 7.21k, False: 0]
  ------------------
 5395|  7.21k|                           (ps_dec->ps_cur_sps->u1_mb_aff_flag == 0))
  ------------------
  |  Branch (5395:28): [True: 7.21k, False: 0]
  ------------------
 5396|  7.21k|                        {
 5397|  7.21k|                            UWORD8 u1_end_of_row = 0;
 5398|  7.21k|                            UWORD32 u4_max_addr;
 5399|  7.21k|                            tfr_ctxt_t s_tfr_ctxt = {0};
 5400|  7.21k|                            tfr_ctxt_t *ps_tfr_cxt = &s_tfr_ctxt;
 5401|  7.21k|                            pad_mgr_t *ps_pad_mgr = &ps_dec->s_pad_mgr;
 5402|  7.21k|                            UWORD32 u4_slice_end = 0;
 5403|       |
 5404|       |                            /*BS is done for all mbs while parsing*/
 5405|  7.21k|                            u4_max_addr = (ps_dec->u2_frm_wd_in_mbs * ps_dec->u2_frm_ht_in_mbs) - 1;
 5406|       |                            /* BS is moved post recon gen in SVC ext*/
 5407|       |
 5408|  7.21k|                            ih264d_init_deblk_tfr_ctxt(ps_dec, ps_pad_mgr, ps_tfr_cxt,
 5409|  7.21k|                                                       ps_dec->u2_frm_wd_in_mbs, 0);
 5410|       |
 5411|  7.21k|                            {
 5412|   141M|                                while(u4_slice_end != 1)
  ------------------
  |  Branch (5412:39): [True: 141M, False: 7.21k]
  ------------------
 5413|   141M|                                {
 5414|   141M|                                    dec_mb_info_t *p_cur_mb;
 5415|   141M|                                    WORD32 i, bs_mb_grp;
 5416|   141M|                                    bs_mb_grp = ps_dec->cur_dec_mb_num - ps_dec->u4_cur_bs_mb_num;
 5417|       |
 5418|   142M|                                    for(i = 0; i < bs_mb_grp; i++)
  ------------------
  |  Branch (5418:48): [True: 927k, False: 141M]
  ------------------
 5419|   927k|                                    {
 5420|   927k|                                        p_cur_mb =
 5421|   927k|                                            &ps_dec->ps_frm_mb_info[ps_dec->u4_cur_bs_mb_num];
 5422|       |
 5423|   927k|                                        DEBUG_THREADS_PRINTF("ps_dec->u4_cur_bs_mb_num = %d\n",
 5424|   927k|                                                             ps_dec->u4_cur_bs_mb_num);
 5425|   927k|                                        isvcd_compute_bs_non_mbaff_thread(ps_svc_lyr_dec, p_cur_mb,
 5426|   927k|                                                                          ps_dec->u4_cur_bs_mb_num);
 5427|       |
 5428|   927k|                                        ps_dec->u4_cur_bs_mb_num++;
 5429|   927k|                                        ps_dec->u4_bs_cur_slice_num_mbs++;
 5430|   927k|                                    }
 5431|   141M|                                    if(ps_dec->u4_cur_bs_mb_num > u4_max_addr)
  ------------------
  |  Branch (5431:40): [True: 7.21k, False: 141M]
  ------------------
 5432|  7.21k|                                    {
 5433|  7.21k|                                        u4_slice_end = 1;
 5434|  7.21k|                                        u1_end_of_row = 1;
 5435|  7.21k|                                    }
 5436|       |                                    /*deblock MB group*/
 5437|   141M|                                    {
 5438|   141M|                                        UWORD32 u4_num_mbs;
 5439|       |
 5440|   141M|                                        if(ps_dec->u4_cur_bs_mb_num > ps_dec->u4_cur_deblk_mb_num)
  ------------------
  |  Branch (5440:44): [True: 117M, False: 23.6M]
  ------------------
 5441|   117M|                                        {
 5442|   117M|                                            if(u1_end_of_row)
  ------------------
  |  Branch (5442:48): [True: 7.21k, False: 117M]
  ------------------
 5443|  7.21k|                                            {
 5444|  7.21k|                                                u4_num_mbs = ps_dec->u4_cur_bs_mb_num -
 5445|  7.21k|                                                             ps_dec->u4_cur_deblk_mb_num;
 5446|  7.21k|                                            }
 5447|   117M|                                            else
 5448|   117M|                                            {
 5449|   117M|                                                u4_num_mbs = ps_dec->u4_cur_bs_mb_num -
 5450|   117M|                                                             ps_dec->u4_cur_deblk_mb_num - 1;
 5451|   117M|                                            }
 5452|   117M|                                        }
 5453|  23.6M|                                        else
 5454|  23.6M|                                            u4_num_mbs = 0;
 5455|       |
 5456|   141M|                                        ih264d_check_mb_map_deblk(ps_dec, u4_num_mbs, ps_tfr_cxt,
 5457|   141M|                                                                  0);
 5458|   141M|                                    }
 5459|   141M|                                }
 5460|  7.21k|                            }
 5461|  7.21k|                        }
 5462|  7.21k|                    }
 5463|       |
 5464|       |                    /*signal the decode thread*/
 5465|  7.21k|                    ih264d_signal_decode_thread(ps_dec);
 5466|  7.21k|                }
 5467|   123k|                else if((ps_dec->u1_separate_parse) &&
  ------------------
  |  Branch (5467:25): [True: 45.2k, False: 78.2k]
  ------------------
 5468|  45.2k|                        (ps_svc_lyr_dec->u1_layer_identifier == TARGET_LAYER))
  ------------------
  |  |  110|  45.2k|#define TARGET_LAYER 2
  ------------------
  |  Branch (5468:25): [True: 45.2k, False: 0]
  ------------------
 5469|  45.2k|                {
 5470|       |                    /*signal the decode thread*/
 5471|  45.2k|                    ih264d_signal_decode_thread(ps_dec);
 5472|  45.2k|                }
 5473|       |
 5474|   130k|                DATA_SYNC();
  ------------------
  |  |  116|   130k|#define DATA_SYNC()  __sync_synchronize()
  ------------------
 5475|       |
 5476|   130k|                if((ps_dec_op->u4_error_code & 0xff) != ERROR_DYNAMIC_RESOLUTION_NOT_SUPPORTED)
  ------------------
  |  Branch (5476:20): [True: 130k, False: 0]
  ------------------
 5477|   130k|                {
 5478|   130k|                    ps_dec_op->u4_pic_wd = (UWORD32) ps_dec->u2_disp_width;
 5479|   130k|                    ps_dec_op->u4_pic_ht = (UWORD32) ps_dec->u2_disp_height;
 5480|   130k|                    ps_dec_op->i4_reorder_depth = ps_dec->i4_reorder_depth;
 5481|   130k|                }
 5482|       |
 5483|       |                // Report if header (sps and pps) has not been decoded yet
 5484|   130k|                if(ps_dec->i4_decode_header == 1 && ps_dec->i4_header_decoded != 3)
  ------------------
  |  Branch (5484:20): [True: 0, False: 130k]
  |  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|   130k|                if((ps_dec->u4_pic_buf_got == 1) && (ERROR_DANGLING_FIELD_IN_PIC != i4_err_status))
  ------------------
  |  Branch (5490:20): [True: 130k, False: 0]
  |  Branch (5490:53): [True: 130k, False: 0]
  ------------------
 5491|   130k|                {
 5492|       |                    /* For field pictures, set bottom and top picture decoded u4_flag correctly */
 5493|       |
 5494|   130k|                    if(ps_dec->ps_cur_slice->u1_field_pic_flag)
  ------------------
  |  Branch (5494:24): [True: 0, False: 130k]
  ------------------
 5495|      0|                    {
 5496|      0|                        if(1 == ps_dec->ps_cur_slice->u1_bottom_field_flag)
  ------------------
  |  Branch (5496:28): [True: 0, False: 0]
  ------------------
 5497|      0|                        {
 5498|      0|                            ps_dec->u1_top_bottom_decoded |= BOT_FIELD_ONLY;
  ------------------
  |  |   65|      0|#define BOT_FIELD_ONLY      0x01
  ------------------
 5499|      0|                        }
 5500|      0|                        else
 5501|      0|                        {
 5502|      0|                            ps_dec->u1_top_bottom_decoded |= TOP_FIELD_ONLY;
  ------------------
  |  |   64|      0|#define TOP_FIELD_ONLY      0x02
  ------------------
 5503|      0|                        }
 5504|      0|                    }
 5505|   130k|                    else
 5506|   130k|                    {
 5507|   130k|                        ps_dec->u1_top_bottom_decoded = TOP_FIELD_ONLY | BOT_FIELD_ONLY;
  ------------------
  |  |   64|   130k|#define TOP_FIELD_ONLY      0x02
  ------------------
                                      ps_dec->u1_top_bottom_decoded = TOP_FIELD_ONLY | BOT_FIELD_ONLY;
  ------------------
  |  |   65|   130k|#define BOT_FIELD_ONLY      0x01
  ------------------
 5508|   130k|                    }
 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|   130k|                    if((ps_dec->ps_dec_err_status->u1_err_flag & REJECT_CUR_PIC) == 0)
  ------------------
  |  |  601|   130k|#define REJECT_CUR_PIC    (0x01)
  ------------------
  |  Branch (5514:24): [True: 130k, False: 0]
  ------------------
 5515|   130k|                    {
 5516|       |                        /* Calling Function to deblock Picture and Display */
 5517|   130k|                        ret = ih264d_deblock_display(ps_dec);
 5518|   130k|                    }
 5519|       |
 5520|       |                    /*set to complete ,as we dont support partial frame decode*/
 5521|   130k|                    if(ps_dec->i4_header_decoded == 3)
  ------------------
  |  Branch (5521:24): [True: 130k, False: 0]
  ------------------
 5522|   130k|                    {
 5523|   130k|                        ps_dec->u4_total_mbs_coded = ps_dec->ps_cur_sps->u4_max_mb_addr + 1;
 5524|   130k|                    }
 5525|       |
 5526|       |                    /*Update the i4_frametype at the end of picture*/
 5527|   130k|                    if(ps_dec->ps_cur_slice->u1_nal_unit_type == IDR_SLICE_NAL)
  ------------------
  |  |  328|   130k|#define IDR_SLICE_NAL                   5
  ------------------
  |  Branch (5527:24): [True: 108k, False: 22.0k]
  ------------------
 5528|   108k|                    {
 5529|   108k|                        ps_dec->i4_frametype = IV_IDR_FRAME;
 5530|   108k|                    }
 5531|  22.0k|                    else if(ps_dec->i4_pic_type == B_SLICE)
  ------------------
  |  |  369|  22.0k|#define B_SLICE  1
  ------------------
  |  Branch (5531:29): [True: 15.5k, False: 6.52k]
  ------------------
 5532|  15.5k|                    {
 5533|  15.5k|                        ps_dec->i4_frametype = IV_B_FRAME;
 5534|  15.5k|                    }
 5535|  6.52k|                    else if(ps_dec->i4_pic_type == P_SLICE)
  ------------------
  |  |  368|  6.52k|#define P_SLICE  0
  ------------------
  |  Branch (5535:29): [True: 3.81k, False: 2.70k]
  ------------------
 5536|  3.81k|                    {
 5537|  3.81k|                        ps_dec->i4_frametype = IV_P_FRAME;
 5538|  3.81k|                    }
 5539|  2.70k|                    else if(ps_dec->i4_pic_type == I_SLICE)
  ------------------
  |  |  370|  2.70k|#define I_SLICE  2
  ------------------
  |  Branch (5539:29): [True: 2.43k, False: 269]
  ------------------
 5540|  2.43k|                    {
 5541|  2.43k|                        ps_dec->i4_frametype = IV_I_FRAME;
 5542|  2.43k|                    }
 5543|    269|                    else
 5544|    269|                    {
 5545|    269|                        H264_DEC_DEBUG_PRINT("Shouldn't come here\n");
  ------------------
  |  |   39|    269|#define H264_DEC_DEBUG_PRINT(...) {}
  ------------------
 5546|    269|                    }
 5547|       |
 5548|       |                    // Update the content type
 5549|   130k|                    ps_dec->i4_content_type = ps_dec->ps_cur_slice->u1_field_pic_flag;
 5550|       |
 5551|   130k|                    ps_dec->u4_total_frames_decoded = ps_dec->u4_total_frames_decoded + 2;
 5552|   130k|                    ps_dec->u4_total_frames_decoded =
 5553|   130k|                        ps_dec->u4_total_frames_decoded - ps_dec->ps_cur_slice->u1_field_pic_flag;
 5554|   130k|                }
 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|   130k|                if((IVD_DECODE_FRAME_OUT == ps_dec->e_frm_out_mode) && ps_dec->u1_init_dec_flag)
  ------------------
  |  Branch (5561:20): [True: 0, False: 130k]
  |  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|   130k|                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|   130k|                if((ps_svc_lyr_dec->u1_layer_identifier == TARGET_LAYER) &&
  ------------------
  |  |  110|   130k|#define TARGET_LAYER 2
  ------------------
  |  Branch (5583:20): [True: 91.1k, False: 39.6k]
  ------------------
 5584|  91.1k|                   ps_dec->u4_output_present &&
  ------------------
  |  Branch (5584:20): [True: 25.0k, False: 66.0k]
  ------------------
 5585|  25.0k|                   (ps_dec->u4_fmt_conv_cur_row < ps_dec->s_disp_frame_info.u4_y_ht))
  ------------------
  |  Branch (5585:20): [True: 9.26k, False: 15.7k]
  ------------------
 5586|  9.26k|                {
 5587|  9.26k|                    ps_dec->u4_fmt_conv_num_rows =
 5588|  9.26k|                        ps_dec->s_disp_frame_info.u4_y_ht - ps_dec->u4_fmt_conv_cur_row;
 5589|  9.26k|                    ih264d_format_convert(ps_dec, &(ps_dec->s_disp_op), ps_dec->u4_fmt_conv_cur_row,
 5590|  9.26k|                                          ps_dec->u4_fmt_conv_num_rows);
 5591|  9.26k|                    ps_dec->u4_fmt_conv_cur_row += ps_dec->u4_fmt_conv_num_rows;
 5592|  9.26k|                }
 5593|       |
 5594|   130k|                ih264d_release_display_field(ps_dec, &(ps_dec->s_disp_op));
 5595|       |
 5596|   130k|                if(ps_dec->i4_decode_header == 1 && (ps_dec->i4_header_decoded & 1) == 1)
  ------------------
  |  Branch (5596:20): [True: 0, False: 130k]
  |  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|   130k|                if((TOP_FIELD_ONLY | BOT_FIELD_ONLY) == ps_dec->u1_top_bottom_decoded)
  ------------------
  |  |   64|   130k|#define TOP_FIELD_ONLY      0x02
  ------------------
                              if((TOP_FIELD_ONLY | BOT_FIELD_ONLY) == ps_dec->u1_top_bottom_decoded)
  ------------------
  |  |   65|   130k|#define BOT_FIELD_ONLY      0x01
  ------------------
  |  Branch (5607:20): [True: 130k, False: 0]
  ------------------
 5608|   130k|                {
 5609|   130k|                    ps_dec->u1_top_bottom_decoded = 0;
 5610|   130k|                }
 5611|       |                /*--------------------------------------------------------------------*/
 5612|       |                /* Do End of Pic processing.                                          */
 5613|       |                /* Should be called only if frame was decoded in previous process call*/
 5614|       |                /*--------------------------------------------------------------------*/
 5615|   130k|                if(ps_dec->u4_pic_buf_got == 1)
  ------------------
  |  Branch (5615:20): [True: 130k, False: 0]
  ------------------
 5616|   130k|                {
 5617|   130k|                    if(1 == ps_dec->u1_last_pic_not_decoded)
  ------------------
  |  Branch (5617:24): [True: 0, False: 130k]
  ------------------
 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|   130k|                    else
 5627|   130k|                    {
 5628|   130k|                        ret = ih264d_end_of_pic(ps_dec);
 5629|   130k|                        if(ret != OK) return ret;
  ------------------
  |  |  114|   130k|#define OK        0
  ------------------
  |  Branch (5629:28): [True: 0, False: 130k]
  ------------------
 5630|   130k|                    }
 5631|   130k|                }
 5632|       |
 5633|   130k|                if(ps_dec->u1_enable_mb_info && ps_dec->u4_output_present)
  ------------------
  |  Branch (5633:20): [True: 0, False: 130k]
  |  Branch (5633:49): [True: 0, False: 0]
  ------------------
 5634|      0|                {
 5635|      0|                    UWORD32 disp_buf_id = ps_dec->s_disp_op.u4_disp_buf_id;
 5636|      0|                    if(ps_h264d_dec_ip->pu1_8x8_blk_qp_map)
  ------------------
  |  Branch (5636:24): [True: 0, False: 0]
  ------------------
 5637|      0|                    {
 5638|      0|                        ps_h264d_dec_op->pu1_8x8_blk_qp_map = ps_h264d_dec_ip->pu1_8x8_blk_qp_map;
 5639|      0|                        ps_h264d_dec_op->u4_8x8_blk_qp_map_size = ps_dec->u4_total_mbs << 2;
 5640|      0|                        memcpy(ps_h264d_dec_op->pu1_8x8_blk_qp_map,
 5641|      0|                                     ps_dec->as_buf_id_info_map[disp_buf_id].pu1_qp_map,
 5642|      0|                                     ps_dec->u4_total_mbs << 2);
 5643|      0|                    }
 5644|      0|                    if(ps_h264d_dec_ip->pu1_8x8_blk_type_map)
  ------------------
  |  Branch (5644:24): [True: 0, False: 0]
  ------------------
 5645|      0|                    {
 5646|      0|                        ps_h264d_dec_op->pu1_8x8_blk_type_map =
 5647|      0|                            ps_h264d_dec_ip->pu1_8x8_blk_type_map;
 5648|      0|                        ps_h264d_dec_op->u4_8x8_blk_type_map_size = ps_dec->u4_total_mbs << 2;
 5649|      0|                        memcpy(ps_h264d_dec_op->pu1_8x8_blk_type_map,
 5650|      0|                                     ps_dec->as_buf_id_info_map[disp_buf_id].pu1_mb_type_map,
 5651|      0|                                     ps_dec->u4_total_mbs << 2);
 5652|      0|                    }
 5653|      0|                }
 5654|       |                /*Data memory barrier instruction,so that yuv write by the library is
 5655|       |                 * complete*/
 5656|   130k|                DATA_SYNC();
  ------------------
  |  |  116|   130k|#define DATA_SYNC()  __sync_synchronize()
  ------------------
 5657|       |
 5658|   130k|                H264_DEC_DEBUG_PRINT("The num bytes consumed: %d\n",
  ------------------
  |  |   39|   130k|#define H264_DEC_DEBUG_PRINT(...) {}
  ------------------
 5659|   130k|                                     ps_dec_op->u4_num_bytes_consumed);
 5660|   130k|            }
 5661|   141k|        }
 5662|       |        /* highest layer for flush validation */
 5663|       |
 5664|   539k|        if((ps_dec->u1_flushfrm) && (1 == flush_decode))
  ------------------
  |  Branch (5664:12): [True: 0, False: 539k]
  |  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|   539k|    }
 5724|       |
 5725|   539k|    if((ps_dec_op->u4_error_code & 0xff) != ERROR_DYNAMIC_RESOLUTION_NOT_SUPPORTED)
  ------------------
  |  Branch (5725:8): [True: 539k, False: 0]
  ------------------
 5726|   539k|    {
 5727|   539k|        ps_dec_op->u4_pic_wd = (UWORD32) ps_dec->u2_disp_width;
 5728|   539k|        ps_dec_op->u4_pic_ht = (UWORD32) ps_dec->u2_disp_height;
 5729|   539k|        ps_dec_op->i4_reorder_depth = ps_dec->i4_reorder_depth;
 5730|   539k|    }
 5731|   539k|    return api_ret_value;
 5732|   539k|}
isvcd_set_params:
 6163|  46.7k|{
 6164|  46.7k|    dec_struct_t *ps_dec;
 6165|  46.7k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 6166|  46.7k|    WORD32 ret = IV_SUCCESS;
 6167|  46.7k|    svc_dec_ctxt_t *ps_svcd_ctxt;
 6168|  46.7k|    WORD32 u1_layer_id;
 6169|       |
 6170|  46.7k|    ps_svcd_ctxt = (svc_dec_ctxt_t *) dec_hdl->pv_codec_handle;
 6171|  46.7k|    ps_svcd_ctxt->i4_eos_flag = 0;
 6172|   186k|    for(u1_layer_id = 0; u1_layer_id < MAX_NUM_RES_LYRS; u1_layer_id++)
  ------------------
  |  |   94|   186k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (6172:26): [True: 140k, False: 46.7k]
  ------------------
 6173|   140k|    {
 6174|   140k|        isvcd_ctl_set_config_ip_t *ps_h264d_ctl_ip = (isvcd_ctl_set_config_ip_t *) pv_api_ip;
 6175|   140k|        isvcd_ctl_set_config_op_t *ps_h264d_ctl_op = (isvcd_ctl_set_config_op_t *) pv_api_op;
 6176|   140k|        ivd_ctl_set_config_ip_t *ps_ctl_ip = &ps_h264d_ctl_ip->s_ivd_ctl_set_config_ip_t;
 6177|   140k|        ivd_ctl_set_config_op_t *ps_ctl_op = &ps_h264d_ctl_op->s_ivd_ctl_set_config_op_t;
 6178|       |
 6179|   140k|        ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[u1_layer_id];
 6180|   140k|        ps_dec = &ps_svc_lyr_dec->s_dec;
 6181|       |
 6182|   140k|        ps_dec->u1_flushfrm = 0;
 6183|   140k|        ps_dec->u4_skip_frm_mask = 0;
 6184|   140k|        ps_ctl_op->u4_error_code = 0;
 6185|       |
 6186|   140k|        if(ps_ctl_ip->e_frm_skip_mode != IVD_SKIP_NONE)
  ------------------
  |  Branch (6186:12): [True: 0, False: 140k]
  ------------------
 6187|      0|        {
 6188|      0|            ps_ctl_op->u4_error_code = (1 << IVD_UNSUPPORTEDPARAM);
 6189|      0|            ret = IV_FAIL;
 6190|      0|        }
 6191|       |
 6192|   140k|        if(ps_ctl_ip->u4_disp_wd >= ps_dec->u2_disp_width)
  ------------------
  |  Branch (6192:12): [True: 140k, False: 0]
  ------------------
 6193|   140k|        {
 6194|   140k|            ps_dec->u4_app_disp_width = ps_ctl_ip->u4_disp_wd;
 6195|   140k|        }
 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|   140k|        if(ps_ctl_ip->e_vid_dec_mode == IVD_DECODE_FRAME)
  ------------------
  |  Branch (6216:12): [True: 70.1k, False: 70.1k]
  ------------------
 6217|  70.1k|            ps_dec->i4_decode_header = 0;
 6218|  70.1k|        else if(ps_ctl_ip->e_vid_dec_mode == IVD_DECODE_HEADER)
  ------------------
  |  Branch (6218:17): [True: 70.1k, False: 0]
  ------------------
 6219|  70.1k|            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|   140k|        ps_dec->e_frm_out_mode = IVD_DISPLAY_FRAME_OUT;
 6227|       |
 6228|   140k|        if((ps_ctl_ip->e_frm_out_mode != IVD_DECODE_FRAME_OUT) &&
  ------------------
  |  Branch (6228:12): [True: 140k, False: 0]
  ------------------
 6229|   140k|           (ps_ctl_ip->e_frm_out_mode != IVD_DISPLAY_FRAME_OUT))
  ------------------
  |  Branch (6229:12): [True: 0, False: 140k]
  ------------------
 6230|      0|        {
 6231|      0|            ps_ctl_op->u4_error_code = (1 << IVD_UNSUPPORTEDPARAM);
 6232|      0|            ret = IV_FAIL;
 6233|      0|        }
 6234|   140k|        ps_dec->e_frm_out_mode = ps_ctl_ip->e_frm_out_mode;
 6235|   140k|    }
 6236|  46.7k|    return ret;
 6237|  46.7k|}
isvcd_set_target_layer:
 6260|  23.3k|{
 6261|  23.3k|    WORD32 ret = IV_SUCCESS;
 6262|       |
 6263|  23.3k|    isvcd_set_target_layer_ip_t *ps_ip;
 6264|  23.3k|    isvcd_set_target_layer_op_t *ps_op;
 6265|  23.3k|    svc_dec_ctxt_t *ps_svcd_ctxt;
 6266|  23.3k|    ps_svcd_ctxt = (svc_dec_ctxt_t *) dec_hdl->pv_codec_handle;
 6267|       |
 6268|  23.3k|    ps_ip = (isvcd_set_target_layer_ip_t *) pv_api_ip;
 6269|  23.3k|    ps_op = (isvcd_set_target_layer_op_t *) pv_api_op;
 6270|       |
 6271|  23.3k|    ps_svcd_ctxt->u1_tgt_dep_id = ps_ip->u1_tgt_dep_id;
 6272|  23.3k|    ps_svcd_ctxt->u1_tgt_quality_id = ps_ip->u1_tgt_quality_id;
 6273|  23.3k|    ps_svcd_ctxt->u1_tgt_temp_id = ps_ip->u1_tgt_temp_id;
 6274|  23.3k|    ps_svcd_ctxt->u1_tgt_priority_id = ps_ip->u1_tgt_priority_id;
 6275|       |
 6276|  23.3k|    ret = isvcd_nal_parse_set_target_attr(ps_ip->u1_tgt_quality_id, ps_ip->u1_tgt_dep_id,
 6277|  23.3k|                                          ps_ip->u1_tgt_temp_id, ps_ip->u1_tgt_priority_id,
 6278|  23.3k|                                          ps_svcd_ctxt->pv_nal_parse_ctxt);
 6279|  23.3k|    ps_op->u4_error_code = 0;
 6280|       |
 6281|  23.3k|    return ret;
 6282|  23.3k|}
isvcd_delete:
 6351|  23.3k|{
 6352|  23.3k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 6353|  23.3k|    isvcd_delete_ip_t *ps_ip = (isvcd_delete_ip_t *) pv_api_ip;
 6354|  23.3k|    isvcd_delete_op_t *ps_op = (isvcd_delete_op_t *) pv_api_op;
 6355|       |
 6356|  23.3k|    UWORD8 u1_layer_id;
 6357|  23.3k|    svc_dec_ctxt_t *ps_svcd_ctxt;
 6358|  23.3k|    ps_svcd_ctxt = (svc_dec_ctxt_t *) dec_hdl->pv_codec_handle;
 6359|  23.3k|    UNUSED(ps_ip);
  ------------------
  |  |   45|  23.3k|#define UNUSED(x) ((void)(x))
  ------------------
 6360|       |
 6361|  93.4k|    for(u1_layer_id = 0; u1_layer_id < MAX_NUM_RES_LYRS; u1_layer_id++)
  ------------------
  |  |   94|  93.4k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (6361:26): [True: 70.1k, False: 23.3k]
  ------------------
 6362|  70.1k|    {
 6363|  70.1k|        ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[u1_layer_id];
 6364|  70.1k|        isvcd_free_dynamic_bufs(ps_svc_lyr_dec);
 6365|  70.1k|    }
 6366|  23.3k|    isvcd_free_static_bufs(dec_hdl);
 6367|  23.3k|    ps_op->s_ivd_delete_op_t.u4_error_code = 0;
 6368|       |
 6369|  23.3k|    return IV_SUCCESS;
 6370|  23.3k|}
isvcd_reset:
 6393|  4.11k|{
 6394|  4.11k|    dec_struct_t *ps_dec;
 6395|  4.11k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 6396|  4.11k|    ivd_ctl_reset_op_t *ps_ctl_op = (ivd_ctl_reset_op_t *) pv_api_op;
 6397|  4.11k|    UWORD8 u1_layer_id;
 6398|  4.11k|    svc_dec_ctxt_t *ps_svcd_ctxt;
 6399|  4.11k|    ps_svcd_ctxt = (svc_dec_ctxt_t *) dec_hdl->pv_codec_handle;
 6400|  4.11k|    UNUSED(pv_api_ip);
  ------------------
  |  |   45|  4.11k|#define UNUSED(x) ((void)(x))
  ------------------
 6401|  4.11k|    ps_ctl_op->u4_error_code = 0;
 6402|       |
 6403|  4.11k|    ps_svcd_ctxt->i4_eos_flag = 0;
 6404|  4.11k|    ps_svcd_ctxt->u4_num_sps_ctr = 0;
 6405|  4.11k|    ps_svcd_ctxt->u4_num_pps_ctr = 0;
 6406|  4.11k|    ps_svcd_ctxt->u1_pre_parse_in_flush = 1;
 6407|  16.4k|    for(u1_layer_id = 0; u1_layer_id < MAX_NUM_RES_LYRS; u1_layer_id++)
  ------------------
  |  |   94|  16.4k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (6407:26): [True: 12.3k, False: 4.11k]
  ------------------
 6408|  12.3k|    {
 6409|  12.3k|        ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[u1_layer_id];
 6410|  12.3k|        ps_dec = &ps_svc_lyr_dec->s_dec;
 6411|  12.3k|        if(ps_dec != NULL)
  ------------------
  |  Branch (6411:12): [True: 12.3k, False: 0]
  ------------------
 6412|  12.3k|        {
 6413|  12.3k|            if(((buf_mgr_t *) ps_dec->pv_pic_buf_mgr)->pv_mutex != NULL)
  ------------------
  |  Branch (6413:16): [True: 877, False: 11.4k]
  ------------------
 6414|    877|                ih264_buf_mgr_free(ps_dec->pv_pic_buf_mgr);
 6415|  12.3k|            if(((buf_mgr_t *) ps_dec->pv_mv_buf_mgr)->pv_mutex != NULL)
  ------------------
  |  Branch (6415:16): [True: 877, False: 11.4k]
  ------------------
 6416|    877|                ih264_buf_mgr_free(ps_dec->pv_mv_buf_mgr);
 6417|       |
 6418|  12.3k|            isvcd_init_decoder(ps_svc_lyr_dec);
 6419|  12.3k|            ps_dec->u1_flushfrm = 0;
 6420|  12.3k|        }
 6421|      0|        else
 6422|      0|        {
 6423|      0|            H264_DEC_DEBUG_PRINT("\nReset called without Initializing the decoder\n");
  ------------------
  |  |   39|      0|#define H264_DEC_DEBUG_PRINT(...) {}
  ------------------
 6424|      0|            ps_ctl_op->u4_error_code = ERROR_INIT_NOT_DONE;
 6425|      0|        }
 6426|  12.3k|    }
 6427|  4.11k|    return IV_SUCCESS;
 6428|  4.11k|}
isvcd_ctl:
 6451|   120k|{
 6452|   120k|    ivd_ctl_set_config_ip_t *ps_ctl_ip;
 6453|   120k|    ivd_ctl_set_config_op_t *ps_ctl_op;
 6454|   120k|    WORD32 ret = IV_SUCCESS;
 6455|   120k|    UWORD32 subcommand;
 6456|   120k|    dec_struct_t *ps_dec;
 6457|   120k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 6458|   120k|    svc_dec_ctxt_t *ps_svcd_ctxt;
 6459|   120k|    ps_svcd_ctxt = (svc_dec_ctxt_t *) dec_hdl->pv_codec_handle;
 6460|   120k|    ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[ps_svcd_ctxt->u1_target_layer_id];
 6461|   120k|    ps_dec = &ps_svc_lyr_dec->s_dec;
 6462|   120k|    if(ps_dec->init_done != 1)
  ------------------
  |  Branch (6462:8): [True: 0, False: 120k]
  ------------------
 6463|      0|    {
 6464|      0|        return IV_FAIL;
 6465|      0|    }
 6466|   120k|    ps_ctl_ip = (ivd_ctl_set_config_ip_t *) pv_api_ip;
 6467|   120k|    ps_ctl_op = (ivd_ctl_set_config_op_t *) pv_api_op;
 6468|   120k|    ps_ctl_op->u4_error_code = 0;
 6469|   120k|    subcommand = ps_ctl_ip->e_sub_cmd;
 6470|       |
 6471|   120k|    switch(subcommand)
 6472|   120k|    {
 6473|      0|        case IVD_CMD_CTL_GETPARAMS:
  ------------------
  |  Branch (6473:9): [True: 0, False: 120k]
  ------------------
 6474|      0|            ret = isvcd_get_status(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 6475|      0|            break;
 6476|  46.7k|        case IVD_CMD_CTL_SETPARAMS:
  ------------------
  |  Branch (6476:9): [True: 46.7k, False: 74.2k]
  ------------------
 6477|  46.7k|            ret = isvcd_set_params(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 6478|  46.7k|            break;
 6479|  4.11k|        case IVD_CMD_CTL_RESET:
  ------------------
  |  Branch (6479:9): [True: 4.11k, False: 116k]
  ------------------
 6480|  4.11k|            ret = isvcd_reset(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 6481|  4.11k|            break;
 6482|      0|        case IVD_CMD_CTL_SETDEFAULT:
  ------------------
  |  Branch (6482:9): [True: 0, False: 120k]
  ------------------
 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: 120k]
  ------------------
 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: 120k]
  ------------------
 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: 120k]
  ------------------
 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: 120k]
  ------------------
 6495|      0|            ret = isvcd_set_degrade(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 6496|      0|            break;
 6497|       |
 6498|  23.3k|        case IH264D_CMD_CTL_SET_NUM_CORES:
  ------------------
  |  Branch (6498:9): [True: 23.3k, False: 97.6k]
  ------------------
 6499|  23.3k|            ret = isvcd_set_num_cores(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 6500|  23.3k|            break;
 6501|      0|        case IH264D_CMD_CTL_GET_BUFFER_DIMENSIONS:
  ------------------
  |  Branch (6501:9): [True: 0, False: 120k]
  ------------------
 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: 120k]
  ------------------
 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: 120k]
  ------------------
 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: 120k]
  ------------------
 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: 120k]
  ------------------
 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: 120k]
  ------------------
 6517|      0|            ret = isvcd_get_sei_ccv_params(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 6518|      0|            break;
 6519|  23.3k|        case IH264D_CMD_CTL_SET_PROCESSOR:
  ------------------
  |  Branch (6519:9): [True: 23.3k, False: 97.6k]
  ------------------
 6520|  23.3k|            ret = isvcd_set_processor(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 6521|  23.3k|            break;
 6522|  23.3k|        case ISVCD_CMD_CTL_SET_TGT_LAYER:
  ------------------
  |  Branch (6522:9): [True: 23.3k, False: 97.6k]
  ------------------
 6523|  23.3k|            ret = isvcd_set_target_layer(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 6524|  23.3k|            break;
 6525|      0|        default:
  ------------------
  |  Branch (6525:9): [True: 0, False: 120k]
  ------------------
 6526|      0|            H264_DEC_DEBUG_PRINT("\ndo nothing\n");
  ------------------
  |  |   39|      0|#define H264_DEC_DEBUG_PRINT(...) {}
  ------------------
 6527|      0|            break;
 6528|   120k|    }
 6529|       |
 6530|   120k|    return ret;
 6531|   120k|}
isvcd_set_num_cores:
 7120|  23.3k|{
 7121|  23.3k|    UWORD8 u1_layer_id;
 7122|  23.3k|    isvcd_ctl_set_num_cores_ip_t *ps_ip;
 7123|  23.3k|    isvcd_ctl_set_num_cores_op_t *ps_op;
 7124|  23.3k|    dec_struct_t *ps_dec;
 7125|  23.3k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 7126|  23.3k|    svc_dec_ctxt_t *ps_svcd_ctxt;
 7127|  23.3k|    ps_svcd_ctxt = (svc_dec_ctxt_t *) dec_hdl->pv_codec_handle;
 7128|       |
 7129|  23.3k|    ps_ip = (isvcd_ctl_set_num_cores_ip_t *) pv_api_ip;
 7130|  23.3k|    ps_op = (isvcd_ctl_set_num_cores_op_t *) pv_api_op;
 7131|  23.3k|    ps_op->u4_error_code = 0;
 7132|  93.4k|    for(u1_layer_id = 0; u1_layer_id < MAX_NUM_RES_LYRS; u1_layer_id++)
  ------------------
  |  |   94|  93.4k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (7132:26): [True: 70.1k, False: 23.3k]
  ------------------
 7133|  70.1k|    {
 7134|  70.1k|        ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[u1_layer_id];
 7135|  70.1k|        ps_dec = &ps_svc_lyr_dec->s_dec;
 7136|  70.1k|        ps_dec->u4_num_cores = ps_ip->u4_num_cores;
 7137|       |
 7138|  70.1k|        if(ps_dec->u4_num_cores == 1)
  ------------------
  |  Branch (7138:12): [True: 34.6k, False: 35.5k]
  ------------------
 7139|  34.6k|        {
 7140|  34.6k|            ps_dec->u1_separate_parse = 0;
 7141|  34.6k|        }
 7142|  35.5k|        else
 7143|  35.5k|        {
 7144|  35.5k|            ps_dec->u1_separate_parse = 1;
 7145|  35.5k|        }
 7146|       |
 7147|       |        /*using only upto three threads currently*/
 7148|  70.1k|        if(ps_dec->u4_num_cores > 3) ps_dec->u4_num_cores = 3;
  ------------------
  |  Branch (7148:12): [True: 18.6k, False: 51.4k]
  ------------------
 7149|  70.1k|    }
 7150|  23.3k|    return IV_SUCCESS;
 7151|  23.3k|}
isvcd_fill_output_struct_from_context:
 7175|   200k|{
 7176|   200k|    dec_struct_t *ps_dec;
 7177|   200k|    ps_dec = &ps_svc_lyr_dec->s_dec;
 7178|   200k|    if((ps_dec_op->u4_error_code & 0xff) != ERROR_DYNAMIC_RESOLUTION_NOT_SUPPORTED)
  ------------------
  |  Branch (7178:8): [True: 200k, False: 0]
  ------------------
 7179|   200k|    {
 7180|   200k|        ps_dec_op->u4_pic_wd = (UWORD32) ps_dec->u2_disp_width;
 7181|   200k|        ps_dec_op->u4_pic_ht = (UWORD32) ps_dec->u2_disp_height;
 7182|   200k|    }
 7183|   200k|    ps_dec_op->i4_reorder_depth = ps_dec->i4_reorder_depth;
 7184|   200k|    ps_dec_op->i4_display_index = ps_dec->i4_display_index;
 7185|   200k|    ps_dec_op->e_pic_type = ps_dec->i4_frametype;
 7186|       |
 7187|   200k|    ps_dec_op->u4_new_seq = 0;
 7188|   200k|    ps_dec_op->u4_output_present =
 7189|   200k|        (ps_svc_lyr_dec->u1_layer_identifier == TARGET_LAYER) ? ps_dec->u4_output_present : 0;
  ------------------
  |  |  110|   200k|#define TARGET_LAYER 2
  ------------------
  |  Branch (7189:9): [True: 92.3k, False: 108k]
  ------------------
 7190|   200k|    ps_dec_op->u4_progressive_frame_flag = ps_dec->s_disp_op.u4_progressive_frame_flag;
 7191|       |
 7192|   200k|    ps_dec_op->u4_is_ref_flag = 1;
 7193|   200k|    if(ps_dec_op->u4_frame_decoded_flag)
  ------------------
  |  Branch (7193:8): [True: 130k, False: 69.8k]
  ------------------
 7194|   130k|    {
 7195|   130k|        if(ps_dec->ps_cur_slice->u1_nal_ref_idc == 0) ps_dec_op->u4_is_ref_flag = 0;
  ------------------
  |  Branch (7195:12): [True: 17.5k, False: 113k]
  ------------------
 7196|   130k|    }
 7197|       |
 7198|   200k|    ps_dec_op->e_output_format = ps_dec->s_disp_op.e_output_format;
 7199|   200k|    ps_dec_op->s_disp_frm_buf = ps_dec->s_disp_op.s_disp_frm_buf;
 7200|   200k|    ps_dec_op->e4_fld_type = ps_dec->s_disp_op.e4_fld_type;
 7201|   200k|    ps_dec_op->u4_ts = ps_dec->s_disp_op.u4_ts;
 7202|   200k|    ps_dec_op->u4_disp_buf_id = ps_dec->s_disp_op.u4_disp_buf_id;
 7203|       |
 7204|   200k|    ih264d_export_sei_params(&ps_dec_op->s_sei_decode_op, ps_dec);
 7205|   200k|}
isvcd_api_function:
 7228|   917k|{
 7229|   917k|    UWORD32 command;
 7230|   917k|    UWORD32 *pu2_ptr_cmd;
 7231|   917k|    UWORD32 u4_api_ret;
 7232|   917k|    IV_API_CALL_STATUS_T e_status;
 7233|   917k|    e_status = api_check_struct_sanity(dec_hdl, pv_api_ip, pv_api_op);
 7234|       |
 7235|   917k|    if(e_status != IV_SUCCESS)
  ------------------
  |  Branch (7235:8): [True: 589, False: 917k]
  ------------------
 7236|    589|    {
 7237|    589|        UWORD32 *ptr_err;
 7238|       |
 7239|    589|        ptr_err = (UWORD32 *) pv_api_op;
 7240|    589|        UNUSED(ptr_err);
  ------------------
  |  |   45|    589|#define UNUSED(x) ((void)(x))
  ------------------
 7241|    589|        H264_DEC_DEBUG_PRINT("error code = %d\n", *(ptr_err + 1));
  ------------------
  |  |   39|    589|#define H264_DEC_DEBUG_PRINT(...) {}
  ------------------
 7242|    589|        return IV_FAIL;
 7243|    589|    }
 7244|       |
 7245|   917k|    pu2_ptr_cmd = (UWORD32 *) pv_api_ip;
 7246|   917k|    pu2_ptr_cmd++;
 7247|       |
 7248|   917k|    command = *pu2_ptr_cmd;
 7249|   917k|    switch(command)
 7250|   917k|    {
 7251|  23.3k|        case IVD_CMD_CREATE:
  ------------------
  |  Branch (7251:9): [True: 23.3k, False: 893k]
  ------------------
 7252|  23.3k|            u4_api_ret = isvcd_create(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 7253|  23.3k|            break;
 7254|  23.3k|        case IVD_CMD_DELETE:
  ------------------
  |  Branch (7254:9): [True: 23.3k, False: 893k]
  ------------------
 7255|  23.3k|            u4_api_ret = isvcd_delete(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 7256|  23.3k|            break;
 7257|       |
 7258|   749k|        case IVD_CMD_VIDEO_DECODE:
  ------------------
  |  Branch (7258:9): [True: 749k, False: 167k]
  ------------------
 7259|   749k|            u4_api_ret = isvcd_video_decode(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 7260|   749k|            break;
 7261|       |
 7262|      0|        case IVD_CMD_GET_DISPLAY_FRAME:
  ------------------
  |  Branch (7262:9): [True: 0, False: 917k]
  ------------------
 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: 917k]
  ------------------
 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: 917k]
  ------------------
 7273|      0|            u4_api_ret = isvcd_rel_display_frame(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 7274|      0|            break;
 7275|       |
 7276|   120k|        case IVD_CMD_VIDEO_CTL:
  ------------------
  |  Branch (7276:9): [True: 120k, False: 796k]
  ------------------
 7277|   120k|            u4_api_ret = isvcd_ctl(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 7278|   120k|            break;
 7279|      0|        default:
  ------------------
  |  Branch (7279:9): [True: 0, False: 917k]
  ------------------
 7280|      0|            u4_api_ret = IV_FAIL;
 7281|      0|            break;
 7282|   917k|    }
 7283|       |
 7284|   917k|    return u4_api_ret;
 7285|   917k|}
isvcd_api.c:api_check_struct_sanity:
  188|   917k|{
  189|   917k|    IVD_API_COMMAND_TYPE_T e_cmd;
  190|   917k|    UWORD32 *pu4_api_ip;
  191|   917k|    UWORD32 *pu4_api_op;
  192|   917k|    UWORD32 i;
  193|       |
  194|   917k|    if(NULL == pv_api_op) return (IV_FAIL);
  ------------------
  |  Branch (194:8): [True: 0, False: 917k]
  ------------------
  195|       |
  196|   917k|    if(NULL == pv_api_ip) return (IV_FAIL);
  ------------------
  |  Branch (196:8): [True: 0, False: 917k]
  ------------------
  197|       |
  198|   917k|    pu4_api_ip = (UWORD32 *) pv_api_ip;
  199|   917k|    pu4_api_op = (UWORD32 *) pv_api_op;
  200|   917k|    e_cmd = *(pu4_api_ip + 1);
  201|       |
  202|       |    /* error checks on handle */
  203|   917k|    switch((WORD32) e_cmd)
  204|   917k|    {
  205|  23.3k|        case IVD_CMD_CREATE:
  ------------------
  |  Branch (205:9): [True: 23.3k, False: 894k]
  ------------------
  206|  23.3k|            break;
  207|       |
  208|      0|        case IVD_CMD_REL_DISPLAY_FRAME:
  ------------------
  |  Branch (208:9): [True: 0, False: 917k]
  ------------------
  209|      0|        case IVD_CMD_SET_DISPLAY_FRAME:
  ------------------
  |  Branch (209:9): [True: 0, False: 917k]
  ------------------
  210|      0|        case IVD_CMD_GET_DISPLAY_FRAME:
  ------------------
  |  Branch (210:9): [True: 0, False: 917k]
  ------------------
  211|   749k|        case IVD_CMD_VIDEO_DECODE:
  ------------------
  |  Branch (211:9): [True: 749k, False: 167k]
  ------------------
  212|   773k|        case IVD_CMD_DELETE:
  ------------------
  |  Branch (212:9): [True: 23.3k, False: 894k]
  ------------------
  213|   894k|        case IVD_CMD_VIDEO_CTL:
  ------------------
  |  Branch (213:9): [True: 121k, False: 796k]
  ------------------
  214|   894k|            if(ps_handle == NULL)
  ------------------
  |  Branch (214:16): [True: 584, False: 893k]
  ------------------
  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|   893k|            if(ps_handle->u4_size != sizeof(iv_obj_t))
  ------------------
  |  Branch (221:16): [True: 0, False: 893k]
  ------------------
  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|   893k|            if(ps_handle->pv_fxns != isvcd_api_function)
  ------------------
  |  Branch (228:16): [True: 0, False: 893k]
  ------------------
  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|   893k|            if(ps_handle->pv_codec_handle == NULL)
  ------------------
  |  Branch (235:16): [True: 0, False: 893k]
  ------------------
  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|   893k|            break;
  242|   893k|        default:
  ------------------
  |  Branch (242:9): [True: 0, False: 917k]
  ------------------
  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|   917k|    }
  247|       |
  248|   917k|    switch((WORD32) e_cmd)
  ------------------
  |  Branch (248:12): [True: 917k, False: 0]
  ------------------
  249|   917k|    {
  250|  23.3k|        case IVD_CMD_CREATE:
  ------------------
  |  Branch (250:9): [True: 23.3k, False: 893k]
  ------------------
  251|  23.3k|        {
  252|  23.3k|            isvcd_create_ip_t *ps_ip = (isvcd_create_ip_t *) pv_api_ip;
  253|  23.3k|            isvcd_create_op_t *ps_op = (isvcd_create_op_t *) pv_api_op;
  254|       |
  255|  23.3k|            ps_op->s_ivd_create_op_t.u4_error_code = 0;
  256|       |
  257|  23.3k|            if((ps_ip->s_ivd_create_ip_t.u4_size > sizeof(isvcd_create_ip_t)) ||
  ------------------
  |  Branch (257:16): [True: 0, False: 23.3k]
  ------------------
  258|  23.3k|               (ps_ip->s_ivd_create_ip_t.u4_size < sizeof(ivd_create_ip_t)))
  ------------------
  |  Branch (258:16): [True: 0, False: 23.3k]
  ------------------
  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|  23.3k|            if((ps_op->s_ivd_create_op_t.u4_size != sizeof(isvcd_create_op_t)) &&
  ------------------
  |  Branch (266:16): [True: 0, False: 23.3k]
  ------------------
  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|  23.3k|            if((ps_ip->s_ivd_create_ip_t.e_output_format != IV_YUV_420P) &&
  ------------------
  |  Branch (275:16): [True: 13.5k, False: 9.85k]
  ------------------
  276|  13.5k|               (ps_ip->s_ivd_create_ip_t.e_output_format != IV_YUV_422ILE) &&
  ------------------
  |  Branch (276:16): [True: 13.5k, False: 8]
  ------------------
  277|  13.5k|               (ps_ip->s_ivd_create_ip_t.e_output_format != IV_RGB_565) &&
  ------------------
  |  Branch (277:16): [True: 13.5k, False: 1]
  ------------------
  278|  13.5k|               (ps_ip->s_ivd_create_ip_t.e_output_format != IV_YUV_420SP_UV) &&
  ------------------
  |  Branch (278:16): [True: 6.28k, False: 7.23k]
  ------------------
  279|  6.28k|               (ps_ip->s_ivd_create_ip_t.e_output_format != IV_YUV_420SP_VU))
  ------------------
  |  Branch (279:16): [True: 5, False: 6.28k]
  ------------------
  280|      5|            {
  281|      5|                ps_op->s_ivd_create_op_t.u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  282|      5|                ps_op->s_ivd_create_op_t.u4_error_code |= IVD_INIT_DEC_COL_FMT_NOT_SUPPORTED;
  283|      5|                H264_DEC_DEBUG_PRINT("\n");
  ------------------
  |  |   39|      5|#define H264_DEC_DEBUG_PRINT(...) {}
  ------------------
  284|      5|                return (IV_FAIL);
  285|      5|            }
  286|  23.3k|        }
  287|  23.3k|        break;
  288|       |
  289|  23.3k|        case IVD_CMD_GET_DISPLAY_FRAME:
  ------------------
  |  Branch (289:9): [True: 0, False: 917k]
  ------------------
  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: 917k]
  ------------------
  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: 917k]
  ------------------
  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|   749k|        case IVD_CMD_VIDEO_DECODE:
  ------------------
  |  Branch (417:9): [True: 749k, False: 167k]
  ------------------
  418|   749k|        {
  419|   749k|            isvcd_video_decode_ip_t *ps_ip = (isvcd_video_decode_ip_t *) pv_api_ip;
  420|   749k|            isvcd_video_decode_op_t *ps_op = (isvcd_video_decode_op_t *) pv_api_op;
  421|       |
  422|   749k|            H264_DEC_DEBUG_PRINT("The input bytes is: %d",
  ------------------
  |  |   39|   749k|#define H264_DEC_DEBUG_PRINT(...) {}
  ------------------
  423|   749k|                                 ps_ip->s_ivd_video_decode_ip_t.u4_num_Bytes);
  424|   749k|            ps_op->s_ivd_video_decode_op_t.u4_error_code = 0;
  425|       |
  426|   749k|            if(ps_ip->s_ivd_video_decode_ip_t.u4_size != sizeof(isvcd_video_decode_ip_t) &&
  ------------------
  |  Branch (426:16): [True: 0, False: 749k]
  ------------------
  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|   749k|            if(ps_op->s_ivd_video_decode_op_t.u4_size != sizeof(isvcd_video_decode_op_t) &&
  ------------------
  |  Branch (435:16): [True: 0, False: 749k]
  ------------------
  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|   749k|            {
  444|   749k|                svc_dec_ctxt_t *ps_svcd_ctxt;
  445|   749k|                svc_dec_lyr_struct_t *ps_svc_lyr_dec;
  446|   749k|                dec_struct_t *ps_dec;
  447|   749k|                ps_svcd_ctxt = (svc_dec_ctxt_t *) (ps_handle->pv_codec_handle);
  448|   749k|                ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[0];
  449|   749k|                ps_dec = &ps_svc_lyr_dec->s_dec;
  450|   749k|                if(ps_dec->u1_enable_mb_info)
  ------------------
  |  Branch (450:20): [True: 0, False: 749k]
  ------------------
  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|   749k|            }
  461|   749k|        }
  462|   749k|        break;
  463|       |
  464|   749k|        case IVD_CMD_DELETE:
  ------------------
  |  Branch (464:9): [True: 23.3k, False: 893k]
  ------------------
  465|  23.3k|        {
  466|  23.3k|            isvcd_delete_ip_t *ps_ip = (isvcd_delete_ip_t *) pv_api_ip;
  467|  23.3k|            isvcd_delete_op_t *ps_op = (isvcd_delete_op_t *) pv_api_op;
  468|       |
  469|  23.3k|            ps_op->s_ivd_delete_op_t.u4_error_code = 0;
  470|       |
  471|  23.3k|            if(ps_ip->s_ivd_delete_ip_t.u4_size != sizeof(isvcd_delete_ip_t))
  ------------------
  |  Branch (471:16): [True: 0, False: 23.3k]
  ------------------
  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|  23.3k|            if(ps_op->s_ivd_delete_op_t.u4_size != sizeof(isvcd_delete_op_t))
  ------------------
  |  Branch (478:16): [True: 0, False: 23.3k]
  ------------------
  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|  23.3k|        }
  485|  23.3k|        break;
  486|       |
  487|   120k|        case IVD_CMD_VIDEO_CTL:
  ------------------
  |  Branch (487:9): [True: 120k, False: 796k]
  ------------------
  488|   120k|        {
  489|   120k|            UWORD32 *pu4_ptr_cmd;
  490|   120k|            UWORD32 sub_command;
  491|       |
  492|   120k|            pu4_ptr_cmd = (UWORD32 *) pv_api_ip;
  493|   120k|            pu4_ptr_cmd += 2;
  494|   120k|            sub_command = *pu4_ptr_cmd;
  495|       |
  496|   120k|            switch(sub_command)
  497|   120k|            {
  498|  46.7k|                case IVD_CMD_CTL_SETPARAMS:
  ------------------
  |  Branch (498:17): [True: 46.7k, False: 74.2k]
  ------------------
  499|  46.7k|                {
  500|  46.7k|                    isvcd_ctl_set_config_ip_t *ps_ip;
  501|  46.7k|                    isvcd_ctl_set_config_op_t *ps_op;
  502|  46.7k|                    ps_ip = (isvcd_ctl_set_config_ip_t *) pv_api_ip;
  503|  46.7k|                    ps_op = (isvcd_ctl_set_config_op_t *) pv_api_op;
  504|       |
  505|  46.7k|                    if(ps_ip->s_ivd_ctl_set_config_ip_t.u4_size !=
  ------------------
  |  Branch (505:24): [True: 0, False: 46.7k]
  ------------------
  506|  46.7k|                       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|  46.7k|                }
  514|  46.7k|                break;
  515|       |
  516|  46.7k|                case IVD_CMD_CTL_SETDEFAULT:
  ------------------
  |  Branch (516:17): [True: 0, False: 120k]
  ------------------
  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: 120k]
  ------------------
  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: 120k]
  ------------------
  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: 120k]
  ------------------
  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: 120k]
  ------------------
  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.11k|                case IVD_CMD_CTL_RESET:
  ------------------
  |  Branch (631:17): [True: 4.11k, False: 116k]
  ------------------
  632|  4.11k|                {
  633|  4.11k|                    isvcd_ctl_reset_ip_t *ps_ip;
  634|  4.11k|                    isvcd_ctl_reset_op_t *ps_op;
  635|  4.11k|                    ps_ip = (isvcd_ctl_reset_ip_t *) pv_api_ip;
  636|  4.11k|                    ps_op = (isvcd_ctl_reset_op_t *) pv_api_op;
  637|  4.11k|                    if(ps_ip->s_ivd_ctl_reset_ip_t.u4_size != sizeof(isvcd_ctl_reset_ip_t))
  ------------------
  |  Branch (637:24): [True: 0, False: 4.11k]
  ------------------
  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.11k|                    if(ps_op->s_ivd_ctl_reset_op_t.u4_size != sizeof(isvcd_ctl_reset_op_t))
  ------------------
  |  Branch (644:24): [True: 0, False: 4.11k]
  ------------------
  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.11k|                }
  652|  4.11k|                break;
  653|       |
  654|  4.11k|                case IH264D_CMD_CTL_DEGRADE:
  ------------------
  |  Branch (654:17): [True: 0, False: 120k]
  ------------------
  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: 120k]
  ------------------
  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: 120k]
  ------------------
  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: 120k]
  ------------------
  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: 120k]
  ------------------
  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: 120k]
  ------------------
  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: 120k]
  ------------------
  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|  23.3k|                case IH264D_CMD_CTL_SET_NUM_CORES:
  ------------------
  |  Branch (835:17): [True: 23.3k, False: 97.6k]
  ------------------
  836|  23.3k|                {
  837|  23.3k|                    isvcd_ctl_set_num_cores_ip_t *ps_ip;
  838|  23.3k|                    isvcd_ctl_set_num_cores_op_t *ps_op;
  839|       |
  840|  23.3k|                    ps_ip = (isvcd_ctl_set_num_cores_ip_t *) pv_api_ip;
  841|  23.3k|                    ps_op = (isvcd_ctl_set_num_cores_op_t *) pv_api_op;
  842|       |
  843|  23.3k|                    if(ps_ip->u4_size != sizeof(isvcd_ctl_set_num_cores_ip_t))
  ------------------
  |  Branch (843:24): [True: 0, False: 23.3k]
  ------------------
  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|  23.3k|                    if(ps_op->u4_size != sizeof(isvcd_ctl_set_num_cores_op_t))
  ------------------
  |  Branch (850:24): [True: 0, False: 23.3k]
  ------------------
  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|  23.3k|                    if((ps_ip->u4_num_cores != 1) && (ps_ip->u4_num_cores != 2) &&
  ------------------
  |  Branch (857:24): [True: 11.8k, False: 11.5k]
  |  Branch (857:54): [True: 8.06k, False: 3.76k]
  ------------------
  858|  8.06k|                       (ps_ip->u4_num_cores != 3) && (ps_ip->u4_num_cores != 4))
  ------------------
  |  Branch (858:24): [True: 6.23k, False: 1.83k]
  |  Branch (858:54): [True: 0, False: 6.23k]
  ------------------
  859|      0|                    {
  860|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  861|      0|                        return IV_FAIL;
  862|      0|                    }
  863|  23.3k|                    break;
  864|  23.3k|                }
  865|  23.3k|                case IH264D_CMD_CTL_SET_PROCESSOR:
  ------------------
  |  Branch (865:17): [True: 23.3k, False: 97.6k]
  ------------------
  866|  23.3k|                {
  867|  23.3k|                    isvcd_ctl_set_processor_ip_t *ps_ip;
  868|  23.3k|                    isvcd_ctl_set_processor_op_t *ps_op;
  869|       |
  870|  23.3k|                    ps_ip = (isvcd_ctl_set_processor_ip_t *) pv_api_ip;
  871|  23.3k|                    ps_op = (isvcd_ctl_set_processor_op_t *) pv_api_op;
  872|       |
  873|  23.3k|                    if(ps_ip->u4_size != sizeof(isvcd_ctl_set_processor_ip_t))
  ------------------
  |  Branch (873:24): [True: 0, False: 23.3k]
  ------------------
  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|  23.3k|                    if(ps_op->u4_size != sizeof(isvcd_ctl_set_processor_op_t))
  ------------------
  |  Branch (880:24): [True: 0, False: 23.3k]
  ------------------
  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|  23.3k|                    break;
  888|  23.3k|                }
  889|       |
  890|  23.3k|                case ISVCD_CMD_CTL_SET_TGT_LAYER:
  ------------------
  |  Branch (890:17): [True: 23.3k, False: 97.6k]
  ------------------
  891|  23.3k|                {
  892|  23.3k|                    isvcd_set_target_layer_ip_t *ps_ip;
  893|  23.3k|                    isvcd_set_target_layer_op_t *ps_op;
  894|       |
  895|  23.3k|                    ps_ip = (isvcd_set_target_layer_ip_t *) pv_api_ip;
  896|  23.3k|                    ps_op = (isvcd_set_target_layer_op_t *) pv_api_op;
  897|       |
  898|  23.3k|                    if(ps_ip->u4_size != sizeof(isvcd_set_target_layer_ip_t))
  ------------------
  |  Branch (898:24): [True: 0, False: 23.3k]
  ------------------
  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|  23.3k|                    if(ps_ip->u1_tgt_dep_id > MAX_DEPENDENCY_ID)
  ------------------
  |  |  103|  23.3k|#define MAX_DEPENDENCY_ID 4
  ------------------
  |  Branch (905:24): [True: 0, False: 23.3k]
  ------------------
  906|      0|                    {
  907|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  908|      0|                        return IV_FAIL;
  909|      0|                    }
  910|       |
  911|  23.3k|                    if(ps_ip->u1_tgt_temp_id > MAX_TEMPORAL_ID)
  ------------------
  |  |  104|  23.3k|#define MAX_TEMPORAL_ID 7
  ------------------
  |  Branch (911:24): [True: 0, False: 23.3k]
  ------------------
  912|      0|                    {
  913|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  914|      0|                        return IV_FAIL;
  915|      0|                    }
  916|       |
  917|  23.3k|                    if(ps_ip->u1_tgt_quality_id > MAX_QUALITY_ID)
  ------------------
  |  |  102|  23.3k|#define MAX_QUALITY_ID 0
  ------------------
  |  Branch (917:24): [True: 0, False: 23.3k]
  ------------------
  918|      0|                    {
  919|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  920|      0|                        return IV_FAIL;
  921|      0|                    }
  922|       |
  923|  23.3k|                    if(ps_ip->u1_tgt_priority_id > MAX_PRIORITY_ID)
  ------------------
  |  |  105|  23.3k|#define MAX_PRIORITY_ID 63
  ------------------
  |  Branch (923:24): [True: 0, False: 23.3k]
  ------------------
  924|      0|                    {
  925|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  926|      0|                        return IV_FAIL;
  927|      0|                    }
  928|       |
  929|  23.3k|                    if(ps_op->u4_size != sizeof(isvcd_set_target_layer_op_t))
  ------------------
  |  Branch (929:24): [True: 0, False: 23.3k]
  ------------------
  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|  23.3k|                    break;
  937|  23.3k|                }
  938|       |
  939|  23.3k|                default:
  ------------------
  |  Branch (939:17): [True: 0, False: 120k]
  ------------------
  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|   120k|            }
  945|   120k|        }
  946|   120k|        break;
  947|   917k|    }
  948|       |
  949|   917k|    return IV_SUCCESS;
  950|   917k|}

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

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

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

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

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

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

isvcd_iquant_itrans_4x4:
   87|  43.4k|{
   88|  43.4k|    WORD16 *pi2_src_ptr = pi2_src;
   89|  43.4k|    WORD16 *pi2_tmp_ptr = pi2_tmp;
   90|  43.4k|    WORD16 *pi2_out_ptr = pi2_out;
   91|  43.4k|    WORD16 x0, x1, x2, x3, i;
   92|  43.4k|    WORD32 q0, q1, q2, q3;
   93|  43.4k|    WORD16 i_macro;
   94|  43.4k|    WORD16 rnd_fact = (u4_qp_div_6 < 4) ? 1 << (3 - u4_qp_div_6) : 0;
  ------------------
  |  Branch (94:23): [True: 22.9k, False: 20.5k]
  ------------------
   95|       |
   96|       |    /* inverse quant */
   97|       |    /*horizontal inverse transform */
   98|   217k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|   217k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (98:16): [True: 173k, False: 43.4k]
  ------------------
   99|   173k|    {
  100|   173k|        q0 = pi2_src_ptr[0];
  101|   173k|        INV_QUANT(q0, pu2_iscal_mat[0], pu2_weigh_mat[0], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|   173k|                {\
  |  |  104|   173k|                    i4_value *= quant_scale;\
  |  |  105|   173k|                    i4_value *= weight_scale;\
  |  |  106|   173k|                    i4_value += rndfactor;\
  |  |  107|   173k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|   173k|                    i4_value >>= qbits;\
  |  |  109|   173k|                }
  ------------------
  102|   173k|        if(i == 0 && iq_start_idx == 1)
  ------------------
  |  Branch (102:12): [True: 43.4k, False: 130k]
  |  Branch (102:22): [True: 0, False: 43.4k]
  ------------------
  103|      0|            q0 = pi2_dc_ld_addr[0];  // Restoring dc value for intra case
  104|       |
  105|   173k|        q2 = pi2_src_ptr[2];
  106|   173k|        INV_QUANT(q2, pu2_iscal_mat[2], pu2_weigh_mat[2], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|   173k|                {\
  |  |  104|   173k|                    i4_value *= quant_scale;\
  |  |  105|   173k|                    i4_value *= weight_scale;\
  |  |  106|   173k|                    i4_value += rndfactor;\
  |  |  107|   173k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|   173k|                    i4_value >>= qbits;\
  |  |  109|   173k|                }
  ------------------
  107|       |
  108|   173k|        x0 = q0 + q2;
  109|   173k|        x1 = q0 - q2;
  110|       |
  111|   173k|        q1 = pi2_src_ptr[1];
  112|   173k|        INV_QUANT(q1, pu2_iscal_mat[1], pu2_weigh_mat[1], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|   173k|                {\
  |  |  104|   173k|                    i4_value *= quant_scale;\
  |  |  105|   173k|                    i4_value *= weight_scale;\
  |  |  106|   173k|                    i4_value += rndfactor;\
  |  |  107|   173k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|   173k|                    i4_value >>= qbits;\
  |  |  109|   173k|                }
  ------------------
  113|       |
  114|   173k|        q3 = pi2_src_ptr[3];
  115|   173k|        INV_QUANT(q3, pu2_iscal_mat[3], pu2_weigh_mat[3], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|   173k|                {\
  |  |  104|   173k|                    i4_value *= quant_scale;\
  |  |  105|   173k|                    i4_value *= weight_scale;\
  |  |  106|   173k|                    i4_value += rndfactor;\
  |  |  107|   173k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|   173k|                    i4_value >>= qbits;\
  |  |  109|   173k|                }
  ------------------
  116|       |
  117|   173k|        x2 = (q1 >> 1) - q3;
  118|   173k|        x3 = q1 + (q3 >> 1);
  119|       |
  120|   173k|        pi2_tmp_ptr[0] = x0 + x3;
  121|   173k|        pi2_tmp_ptr[1] = x1 + x2;
  122|   173k|        pi2_tmp_ptr[2] = x1 - x2;
  123|   173k|        pi2_tmp_ptr[3] = x0 - x3;
  124|       |
  125|   173k|        pi2_src_ptr += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|   173k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  126|   173k|        pi2_tmp_ptr += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|   173k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  127|   173k|        pu2_iscal_mat += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|   173k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  128|   173k|        pu2_weigh_mat += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|   173k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  129|   173k|    }
  130|       |
  131|       |    /* vertical inverse transform */
  132|  43.4k|    pi2_tmp_ptr = pi2_tmp;
  133|   217k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|   217k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (133:16): [True: 173k, False: 43.4k]
  ------------------
  134|   173k|    {
  135|   173k|        pi2_out = pi2_out_ptr;
  136|       |
  137|   173k|        x0 = (pi2_tmp_ptr[0] + pi2_tmp_ptr[8]);
  138|   173k|        x1 = (pi2_tmp_ptr[0] - pi2_tmp_ptr[8]);
  139|   173k|        x2 = (pi2_tmp_ptr[4] >> 1) - pi2_tmp_ptr[12];
  140|   173k|        x3 = pi2_tmp_ptr[4] + (pi2_tmp_ptr[12] >> 1);
  141|       |
  142|       |        /* inverse prediction */
  143|   173k|        i_macro = x0 + x3;
  144|   173k|        *pi2_out = CLIP_RSD((i_macro + 32) >> 6);
  ------------------
  |  |  774|   173k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   173k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 7.27k, False: 166k]
  |  |  |  |  |  Branch (77:54): [True: 7.15k, False: 159k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  145|   173k|        pi2_out += out_strd;
  146|       |
  147|   173k|        i_macro = x1 + x2;
  148|   173k|        *pi2_out = CLIP_RSD((i_macro + 32) >> 6);
  ------------------
  |  |  774|   173k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   173k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 6.22k, False: 167k]
  |  |  |  |  |  Branch (77:54): [True: 6.44k, False: 161k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  149|   173k|        pi2_out += out_strd;
  150|       |
  151|   173k|        i_macro = x1 - x2;
  152|   173k|        *pi2_out = CLIP_RSD((i_macro + 32) >> 6);
  ------------------
  |  |  774|   173k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   173k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 6.57k, False: 167k]
  |  |  |  |  |  Branch (77:54): [True: 6.66k, False: 160k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  153|   173k|        pi2_out += out_strd;
  154|       |
  155|   173k|        i_macro = x0 - x3;
  156|   173k|        *pi2_out = CLIP_RSD((i_macro + 32) >> 6);
  ------------------
  |  |  774|   173k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   173k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 7.24k, False: 166k]
  |  |  |  |  |  Branch (77:54): [True: 6.53k, False: 160k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  157|   173k|        pi2_tmp_ptr++;
  158|   173k|        pi2_out_ptr++;
  159|   173k|    }
  160|  43.4k|}
isvcd_iquant_itrans_4x4_dc:
  188|  6.42k|{
  189|  6.42k|    WORD16 *pi2_out_ptr = pi2_out;
  190|  6.42k|    WORD32 q0;
  191|  6.42k|    WORD16 i_macro, i;
  192|  6.42k|    WORD16 rnd_fact = (u4_qp_div_6 < 4) ? 1 << (3 - u4_qp_div_6) : 0;
  ------------------
  |  Branch (192:23): [True: 622, False: 5.80k]
  ------------------
  193|  6.42k|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|  6.42k|#define UNUSED(x) ((void)(x))
  ------------------
  194|       |
  195|  6.42k|    if(iq_start_idx == 0)
  ------------------
  |  Branch (195:8): [True: 6.42k, False: 0]
  ------------------
  196|  6.42k|    {
  197|  6.42k|        q0 = pi2_src[0];
  198|  6.42k|        INV_QUANT(q0, pu2_iscal_mat[0], pu2_weigh_mat[0], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|  6.42k|                {\
  |  |  104|  6.42k|                    i4_value *= quant_scale;\
  |  |  105|  6.42k|                    i4_value *= weight_scale;\
  |  |  106|  6.42k|                    i4_value += rndfactor;\
  |  |  107|  6.42k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  6.42k|                    i4_value >>= qbits;\
  |  |  109|  6.42k|                }
  ------------------
  199|  6.42k|    }
  200|      0|    else
  201|      0|    {
  202|      0|        q0 = pi2_dc_ld_addr[0];  // Restoring dc value for intra case3
  203|      0|    }
  204|  6.42k|    i_macro = CLIP_RSD((q0 + 32) >> 6);
  ------------------
  |  |  774|  6.42k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  6.42k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 437, False: 5.98k]
  |  |  |  |  |  Branch (77:54): [True: 1.05k, False: 4.93k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  205|  32.1k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|  32.1k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (205:16): [True: 25.6k, False: 6.42k]
  ------------------
  206|  25.6k|    {
  207|  25.6k|        pi2_out = pi2_out_ptr;
  208|       |
  209|       |        /* inverse prediction */
  210|  25.6k|        *pi2_out = i_macro;
  211|  25.6k|        pi2_out += out_strd;
  212|  25.6k|        *pi2_out = i_macro;
  213|  25.6k|        pi2_out += out_strd;
  214|  25.6k|        *pi2_out = i_macro;
  215|  25.6k|        pi2_out += out_strd;
  216|  25.6k|        *pi2_out = i_macro;
  217|  25.6k|        pi2_out_ptr++;
  218|  25.6k|    }
  219|  6.42k|}
isvcd_iquant_itrans_chroma_4x4:
  246|  11.7k|{
  247|  11.7k|    WORD16 *pi2_src_ptr = pi2_src;
  248|  11.7k|    WORD16 *pi2_tmp_ptr = pi2_tmp;
  249|  11.7k|    WORD16 *pi2_out_ptr = pi2_out;
  250|  11.7k|    WORD16 x0, x1, x2, x3, i;
  251|  11.7k|    WORD32 q0, q1, q2, q3;
  252|  11.7k|    WORD16 i_macro;
  253|  11.7k|    WORD16 rnd_fact = (u4_qp_div_6 < 4) ? 1 << (3 - u4_qp_div_6) : 0;
  ------------------
  |  Branch (253:23): [True: 7.92k, False: 3.81k]
  ------------------
  254|       |
  255|       |    /* inverse quant */
  256|       |    /*horizontal inverse transform */
  257|  58.7k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|  58.7k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (257:16): [True: 46.9k, False: 11.7k]
  ------------------
  258|  46.9k|    {
  259|  46.9k|        if(i == 0)
  ------------------
  |  Branch (259:12): [True: 11.7k, False: 35.2k]
  ------------------
  260|  11.7k|        {
  261|  11.7k|            q0 = pi2_dc_src[0];
  262|  11.7k|        }
  263|  35.2k|        else
  264|  35.2k|        {
  265|  35.2k|            q0 = pi2_src_ptr[0];
  266|  35.2k|            INV_QUANT(q0, pu2_iscal_mat[0], pu2_weigh_mat[0], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|  35.2k|                {\
  |  |  104|  35.2k|                    i4_value *= quant_scale;\
  |  |  105|  35.2k|                    i4_value *= weight_scale;\
  |  |  106|  35.2k|                    i4_value += rndfactor;\
  |  |  107|  35.2k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  35.2k|                    i4_value >>= qbits;\
  |  |  109|  35.2k|                }
  ------------------
  267|  35.2k|        }
  268|       |
  269|  46.9k|        q2 = pi2_src_ptr[2];
  270|  46.9k|        INV_QUANT(q2, pu2_iscal_mat[2], pu2_weigh_mat[2], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|  46.9k|                {\
  |  |  104|  46.9k|                    i4_value *= quant_scale;\
  |  |  105|  46.9k|                    i4_value *= weight_scale;\
  |  |  106|  46.9k|                    i4_value += rndfactor;\
  |  |  107|  46.9k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  46.9k|                    i4_value >>= qbits;\
  |  |  109|  46.9k|                }
  ------------------
  271|       |
  272|  46.9k|        x0 = q0 + q2;
  273|  46.9k|        x1 = q0 - q2;
  274|       |
  275|  46.9k|        q1 = pi2_src_ptr[1];
  276|  46.9k|        INV_QUANT(q1, pu2_iscal_mat[1], pu2_weigh_mat[1], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|  46.9k|                {\
  |  |  104|  46.9k|                    i4_value *= quant_scale;\
  |  |  105|  46.9k|                    i4_value *= weight_scale;\
  |  |  106|  46.9k|                    i4_value += rndfactor;\
  |  |  107|  46.9k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  46.9k|                    i4_value >>= qbits;\
  |  |  109|  46.9k|                }
  ------------------
  277|       |
  278|  46.9k|        q3 = pi2_src_ptr[3];
  279|  46.9k|        INV_QUANT(q3, pu2_iscal_mat[3], pu2_weigh_mat[3], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|  46.9k|                {\
  |  |  104|  46.9k|                    i4_value *= quant_scale;\
  |  |  105|  46.9k|                    i4_value *= weight_scale;\
  |  |  106|  46.9k|                    i4_value += rndfactor;\
  |  |  107|  46.9k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  46.9k|                    i4_value >>= qbits;\
  |  |  109|  46.9k|                }
  ------------------
  280|       |
  281|  46.9k|        x2 = (q1 >> 1) - q3;
  282|  46.9k|        x3 = q1 + (q3 >> 1);
  283|       |
  284|  46.9k|        pi2_tmp_ptr[0] = x0 + x3;
  285|  46.9k|        pi2_tmp_ptr[1] = x1 + x2;
  286|  46.9k|        pi2_tmp_ptr[2] = x1 - x2;
  287|  46.9k|        pi2_tmp_ptr[3] = x0 - x3;
  288|       |
  289|  46.9k|        pi2_src_ptr += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|  46.9k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  290|  46.9k|        pi2_tmp_ptr += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|  46.9k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  291|  46.9k|        pu2_iscal_mat += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|  46.9k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  292|  46.9k|        pu2_weigh_mat += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|  46.9k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  293|  46.9k|    }
  294|       |
  295|       |    /* vertical inverse transform */
  296|  11.7k|    pi2_tmp_ptr = pi2_tmp;
  297|  58.7k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|  58.7k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (297:16): [True: 46.9k, False: 11.7k]
  ------------------
  298|  46.9k|    {
  299|  46.9k|        pi2_out = pi2_out_ptr;
  300|       |
  301|  46.9k|        x0 = (pi2_tmp_ptr[0] + pi2_tmp_ptr[8]);
  302|  46.9k|        x1 = (pi2_tmp_ptr[0] - pi2_tmp_ptr[8]);
  303|  46.9k|        x2 = (pi2_tmp_ptr[4] >> 1) - pi2_tmp_ptr[12];
  304|  46.9k|        x3 = pi2_tmp_ptr[4] + (pi2_tmp_ptr[12] >> 1);
  305|       |
  306|       |        /* inverse prediction */
  307|  46.9k|        i_macro = x0 + x3;
  308|  46.9k|        *pi2_out = CLIP_RSD((i_macro + 32) >> 6);
  ------------------
  |  |  774|  46.9k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  46.9k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 1.26k, False: 45.7k]
  |  |  |  |  |  Branch (77:54): [True: 1.28k, False: 44.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  309|  46.9k|        pi2_out += out_strd;
  310|       |
  311|  46.9k|        i_macro = x1 + x2;
  312|  46.9k|        *pi2_out = CLIP_RSD((i_macro + 32) >> 6);
  ------------------
  |  |  774|  46.9k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  46.9k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 983, False: 45.9k]
  |  |  |  |  |  Branch (77:54): [True: 1.21k, False: 44.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  313|  46.9k|        pi2_out += out_strd;
  314|       |
  315|  46.9k|        i_macro = x1 - x2;
  316|  46.9k|        *pi2_out = CLIP_RSD((i_macro + 32) >> 6);
  ------------------
  |  |  774|  46.9k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  46.9k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 1.17k, False: 45.7k]
  |  |  |  |  |  Branch (77:54): [True: 1.01k, False: 44.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  317|  46.9k|        pi2_out += out_strd;
  318|       |
  319|  46.9k|        i_macro = x0 - x3;
  320|  46.9k|        *pi2_out = CLIP_RSD((i_macro + 32) >> 6);
  ------------------
  |  |  774|  46.9k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  46.9k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 1.17k, False: 45.7k]
  |  |  |  |  |  Branch (77:54): [True: 1.35k, False: 44.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  321|  46.9k|        pi2_tmp_ptr++;
  322|  46.9k|        pi2_out_ptr += 2;  // Interleaved store for output
  323|  46.9k|    }
  324|  11.7k|}
isvcd_iquant_itrans_chroma_4x4_dc:
  351|  27.2k|{
  352|  27.2k|    WORD16 *pi2_out_ptr = pi2_out;
  353|  27.2k|    WORD32 q0;
  354|  27.2k|    WORD16 i_macro, i;
  355|  27.2k|    UNUSED(pi2_src);
  ------------------
  |  |   45|  27.2k|#define UNUSED(x) ((void)(x))
  ------------------
  356|  27.2k|    UNUSED(pu2_iscal_mat);
  ------------------
  |  |   45|  27.2k|#define UNUSED(x) ((void)(x))
  ------------------
  357|  27.2k|    UNUSED(pu2_weigh_mat);
  ------------------
  |  |   45|  27.2k|#define UNUSED(x) ((void)(x))
  ------------------
  358|  27.2k|    UNUSED(u4_qp_div_6);
  ------------------
  |  |   45|  27.2k|#define UNUSED(x) ((void)(x))
  ------------------
  359|  27.2k|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|  27.2k|#define UNUSED(x) ((void)(x))
  ------------------
  360|       |
  361|  27.2k|    q0 = pi2_dc_src[0];  // Restoring dc value for intra case3
  362|  27.2k|    i_macro = CLIP_RSD((q0 + 32) >> 6);
  ------------------
  |  |  774|  27.2k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  27.2k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 669, False: 26.6k]
  |  |  |  |  |  Branch (77:54): [True: 575, False: 26.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  363|       |
  364|   136k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|   136k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (364:16): [True: 109k, False: 27.2k]
  ------------------
  365|   109k|    {
  366|   109k|        pi2_out = pi2_out_ptr;
  367|       |
  368|       |        /* inverse prediction */
  369|   109k|        *pi2_out = i_macro;
  370|   109k|        pi2_out += out_strd;
  371|       |
  372|   109k|        *pi2_out = i_macro;
  373|   109k|        pi2_out += out_strd;
  374|       |
  375|   109k|        *pi2_out = i_macro;
  376|   109k|        pi2_out += out_strd;
  377|       |
  378|   109k|        *pi2_out = i_macro;
  379|       |
  380|   109k|        pi2_out_ptr += 2;
  381|   109k|    }
  382|  27.2k|}
isvcd_iquant_itrans_8x8_dc:
  440|  5.16k|{
  441|  5.16k|    WORD16 *pi2_out_ptr = pi2_out;
  442|  5.16k|    WORD16 i, i_macro;
  443|  5.16k|    WORD32 q;
  444|  5.16k|    WORD32 rnd_fact = (qp_div < 6) ? (1 << (5 - qp_div)) : 0;
  ------------------
  |  Branch (444:23): [True: 2.32k, False: 2.84k]
  ------------------
  445|  5.16k|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|  5.16k|#define UNUSED(x) ((void)(x))
  ------------------
  446|  5.16k|    UNUSED(iq_start_idx);
  ------------------
  |  |   45|  5.16k|#define UNUSED(x) ((void)(x))
  ------------------
  447|  5.16k|    UNUSED(pi2_dc_ld_addr);
  ------------------
  |  |   45|  5.16k|#define UNUSED(x) ((void)(x))
  ------------------
  448|       |    /*************************************************************/
  449|       |    /* Dequantization of coefficients. Will be replaced by SIMD  */
  450|       |    /* operations on platform. Note : DC coeff is not scaled     */
  451|       |    /*************************************************************/
  452|  5.16k|    q = pi2_src[0];
  453|  5.16k|    INV_QUANT(q, pu2_iscale_mat[0], pu2_weigh_mat[0], qp_div, rnd_fact, 6);
  ------------------
  |  |  103|  5.16k|                {\
  |  |  104|  5.16k|                    i4_value *= quant_scale;\
  |  |  105|  5.16k|                    i4_value *= weight_scale;\
  |  |  106|  5.16k|                    i4_value += rndfactor;\
  |  |  107|  5.16k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  5.16k|                    i4_value >>= qbits;\
  |  |  109|  5.16k|                }
  ------------------
  454|  5.16k|    i_macro = CLIP_RSD((q + 32) >> 6);
  ------------------
  |  |  774|  5.16k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  5.16k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 629, False: 4.53k]
  |  |  |  |  |  Branch (77:54): [True: 1.12k, False: 3.41k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  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|  46.4k|    for(i = 0; i < SUB_BLK_WIDTH_8x8; i++)
  ------------------
  |  |   53|  46.4k|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
  |  Branch (465:16): [True: 41.3k, False: 5.16k]
  ------------------
  466|  41.3k|    {
  467|  41.3k|        pi2_out = pi2_out_ptr;
  468|       |
  469|  41.3k|        *pi2_out = i_macro;
  470|       |        /* Change uc_recBuffer to Point to next element in the same column*/
  471|  41.3k|        pi2_out += out_strd;
  472|       |
  473|  41.3k|        *pi2_out = i_macro;
  474|  41.3k|        pi2_out += out_strd;
  475|       |
  476|  41.3k|        *pi2_out = i_macro;
  477|  41.3k|        pi2_out += out_strd;
  478|       |
  479|  41.3k|        *pi2_out = i_macro;
  480|  41.3k|        pi2_out += out_strd;
  481|       |
  482|  41.3k|        *pi2_out = i_macro;
  483|  41.3k|        pi2_out += out_strd;
  484|       |
  485|  41.3k|        *pi2_out = i_macro;
  486|  41.3k|        pi2_out += out_strd;
  487|       |
  488|  41.3k|        *pi2_out = i_macro;
  489|  41.3k|        pi2_out += out_strd;
  490|       |
  491|  41.3k|        *pi2_out = i_macro;
  492|       |
  493|  41.3k|        pi2_out_ptr++;
  494|  41.3k|    }
  495|  5.16k|}
isvcd_iquant_itrans_8x8:
  523|  14.8k|{
  524|  14.8k|    WORD32 i;
  525|  14.8k|    WORD16 *pi2_tmp_ptr = pi2_tmp;
  526|  14.8k|    WORD16 *pi2_out_ptr = pi2_out;
  527|  14.8k|    WORD16 i_z0, i_z1, i_z2, i_z3, i_z4, i_z5, i_z6, i_z7;
  528|  14.8k|    WORD16 i_y0, i_y1, i_y2, i_y3, i_y4, i_y5, i_y6, i_y7;
  529|  14.8k|    WORD32 q;
  530|  14.8k|    WORD32 rnd_fact = (qp_div < 6) ? (1 << (5 - qp_div)) : 0;
  ------------------
  |  Branch (530:23): [True: 7.79k, False: 7.03k]
  ------------------
  531|  14.8k|    UNUSED(iq_start_idx);
  ------------------
  |  |   45|  14.8k|#define UNUSED(x) ((void)(x))
  ------------------
  532|  14.8k|    UNUSED(pi2_dc_ld_addr);
  ------------------
  |  |   45|  14.8k|#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|   963k|    for(i = 0; i < (SUB_BLK_WIDTH_8x8 * SUB_BLK_WIDTH_8x8); i++)
  ------------------
  |  |   53|   963k|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
                  for(i = 0; i < (SUB_BLK_WIDTH_8x8 * SUB_BLK_WIDTH_8x8); i++)
  ------------------
  |  |   53|   963k|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
  |  Branch (537:16): [True: 948k, False: 14.8k]
  ------------------
  538|   948k|    {
  539|   948k|        q = pi2_src[i];
  540|   948k|        INV_QUANT(q, pu2_iscale_mat[i], pu2_weigh_mat[i], qp_div, rnd_fact, 6);
  ------------------
  |  |  103|   948k|                {\
  |  |  104|   948k|                    i4_value *= quant_scale;\
  |  |  105|   948k|                    i4_value *= weight_scale;\
  |  |  106|   948k|                    i4_value += rndfactor;\
  |  |  107|   948k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|   948k|                    i4_value >>= qbits;\
  |  |  109|   948k|                }
  ------------------
  541|   948k|        pi2_tmp_ptr[i] = q;
  542|   948k|    }
  543|       |    /* Perform Inverse transform */
  544|       |    /*--------------------------------------------------------------------*/
  545|       |    /* IDCT [ Horizontal transformation ]                                 */
  546|       |    /*--------------------------------------------------------------------*/
  547|   133k|    for(i = 0; i < SUB_BLK_WIDTH_8x8; i++)
  ------------------
  |  |   53|   133k|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
  |  Branch (547:16): [True: 118k, False: 14.8k]
  ------------------
  548|   118k|    {
  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|   118k|        i_y0 = (pi2_tmp_ptr[0] + pi2_tmp_ptr[4]);
  560|       |
  561|   118k|        i_y1 =
  562|   118k|            ((WORD32) (-pi2_tmp_ptr[3]) + pi2_tmp_ptr[5] - pi2_tmp_ptr[7] - (pi2_tmp_ptr[7] >> 1));
  563|       |
  564|   118k|        i_y2 = (pi2_tmp_ptr[0] - pi2_tmp_ptr[4]);
  565|       |
  566|   118k|        i_y3 = ((WORD32) pi2_tmp_ptr[1] + pi2_tmp_ptr[7] - pi2_tmp_ptr[3] - (pi2_tmp_ptr[3] >> 1));
  567|       |
  568|   118k|        i_y4 = ((pi2_tmp_ptr[2] >> 1) - pi2_tmp_ptr[6]);
  569|       |
  570|   118k|        i_y5 =
  571|   118k|            ((WORD32) (-pi2_tmp_ptr[1]) + pi2_tmp_ptr[7] + pi2_tmp_ptr[5] + (pi2_tmp_ptr[5] >> 1));
  572|       |
  573|   118k|        i_y6 = (pi2_tmp_ptr[2] + (pi2_tmp_ptr[6] >> 1));
  574|       |
  575|   118k|        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|   118k|        i_z0 = i_y0 + i_y6;
  588|   118k|        i_z1 = i_y1 + (i_y7 >> 2);
  589|   118k|        i_z2 = i_y2 + i_y4;
  590|   118k|        i_z3 = i_y3 + (i_y5 >> 2);
  591|   118k|        i_z4 = i_y2 - i_y4;
  592|   118k|        i_z5 = (i_y3 >> 2) - i_y5;
  593|   118k|        i_z6 = i_y0 - i_y6;
  594|   118k|        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|   118k|        pi2_tmp_ptr[0] = i_z0 + i_z7;
  607|   118k|        pi2_tmp_ptr[1] = i_z2 + i_z5;
  608|   118k|        pi2_tmp_ptr[2] = i_z4 + i_z3;
  609|   118k|        pi2_tmp_ptr[3] = i_z6 + i_z1;
  610|   118k|        pi2_tmp_ptr[4] = i_z6 - i_z1;
  611|   118k|        pi2_tmp_ptr[5] = i_z4 - i_z3;
  612|   118k|        pi2_tmp_ptr[6] = i_z2 - i_z5;
  613|   118k|        pi2_tmp_ptr[7] = i_z0 - i_z7;
  614|       |
  615|       |        /* move to the next row */
  616|       |        // pi2_src_ptr += SUB_BLK_WIDTH_8x8;
  617|   118k|        pi2_tmp_ptr += SUB_BLK_WIDTH_8x8;
  ------------------
  |  |   53|   118k|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
  618|   118k|    }
  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|  14.8k|    pi2_tmp_ptr = pi2_tmp;
  627|   133k|    for(i = 0; i < SUB_BLK_WIDTH_8x8; i++)
  ------------------
  |  |   53|   133k|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
  |  Branch (627:16): [True: 118k, False: 14.8k]
  ------------------
  628|   118k|    {
  629|   118k|        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|   118k|        i_y0 = pi2_tmp_ptr[0] + pi2_tmp_ptr[32];
  641|       |
  642|   118k|        i_y1 = (WORD32) (-pi2_tmp_ptr[24]) + pi2_tmp_ptr[40] - pi2_tmp_ptr[56] -
  643|   118k|               (pi2_tmp_ptr[56] >> 1);
  644|       |
  645|   118k|        i_y2 = pi2_tmp_ptr[0] - pi2_tmp_ptr[32];
  646|       |
  647|   118k|        i_y3 = (WORD32) pi2_tmp_ptr[8] + pi2_tmp_ptr[56] - pi2_tmp_ptr[24] - (pi2_tmp_ptr[24] >> 1);
  648|       |
  649|   118k|        i_y4 = (pi2_tmp_ptr[16] >> 1) - pi2_tmp_ptr[48];
  650|       |
  651|   118k|        i_y5 =
  652|   118k|            (WORD32) (-pi2_tmp_ptr[8]) + pi2_tmp_ptr[56] + pi2_tmp_ptr[40] + (pi2_tmp_ptr[40] >> 1);
  653|       |
  654|   118k|        i_y6 = pi2_tmp_ptr[16] + (pi2_tmp_ptr[48] >> 1);
  655|       |
  656|   118k|        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|   118k|        i_z0 = i_y0 + i_y6;
  669|   118k|        i_z1 = i_y1 + (i_y7 >> 2);
  670|   118k|        i_z2 = i_y2 + i_y4;
  671|   118k|        i_z3 = i_y3 + (i_y5 >> 2);
  672|   118k|        i_z4 = i_y2 - i_y4;
  673|   118k|        i_z5 = (i_y3 >> 2) - i_y5;
  674|   118k|        i_z6 = i_y0 - i_y6;
  675|   118k|        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|   118k|        *pi2_out = CLIP_RSD((i_z0 + i_z7 + 32) >> 6);
  ------------------
  |  |  774|   118k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   118k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 11.4k, False: 107k]
  |  |  |  |  |  Branch (77:54): [True: 12.1k, False: 95.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  688|       |        /* Change uc_recBuffer to Point to next element in the same column*/
  689|   118k|        pi2_out += out_strd;
  690|       |
  691|   118k|        *pi2_out = CLIP_RSD((i_z2 + i_z5 + 32) >> 6);
  ------------------
  |  |  774|   118k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   118k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 10.2k, False: 108k]
  |  |  |  |  |  Branch (77:54): [True: 11.1k, False: 97.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  692|   118k|        pi2_out += out_strd;
  693|       |
  694|   118k|        *pi2_out = CLIP_RSD((i_z4 + i_z3 + 32) >> 6);
  ------------------
  |  |  774|   118k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   118k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 9.19k, False: 109k]
  |  |  |  |  |  Branch (77:54): [True: 11.0k, False: 98.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  695|   118k|        pi2_out += out_strd;
  696|       |
  697|   118k|        *pi2_out = CLIP_RSD((i_z6 + i_z1 + 32) >> 6);
  ------------------
  |  |  774|   118k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   118k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 8.89k, False: 109k]
  |  |  |  |  |  Branch (77:54): [True: 10.4k, False: 99.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  698|   118k|        pi2_out += out_strd;
  699|       |
  700|   118k|        *pi2_out = CLIP_RSD((i_z6 - i_z1 + 32) >> 6);
  ------------------
  |  |  774|   118k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   118k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 8.92k, False: 109k]
  |  |  |  |  |  Branch (77:54): [True: 10.2k, False: 99.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  701|   118k|        pi2_out += out_strd;
  702|       |
  703|   118k|        *pi2_out = CLIP_RSD((i_z4 - i_z3 + 32) >> 6);
  ------------------
  |  |  774|   118k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   118k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 9.74k, False: 108k]
  |  |  |  |  |  Branch (77:54): [True: 10.4k, False: 98.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  704|   118k|        pi2_out += out_strd;
  705|       |
  706|   118k|        *pi2_out = CLIP_RSD((i_z2 - i_z5 + 32) >> 6);
  ------------------
  |  |  774|   118k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   118k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 10.1k, False: 108k]
  |  |  |  |  |  Branch (77:54): [True: 11.4k, False: 96.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  707|   118k|        pi2_out += out_strd;
  708|       |
  709|   118k|        *pi2_out = CLIP_RSD((i_z0 - i_z7 + 32) >> 6);
  ------------------
  |  |  774|   118k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   118k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 11.3k, False: 107k]
  |  |  |  |  |  Branch (77:54): [True: 11.7k, False: 95.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  710|       |
  711|   118k|        pi2_tmp_ptr++;
  712|   118k|        pi2_out_ptr++;
  713|   118k|    }
  714|  14.8k|}

isvcd_iquant_itrans_residual_recon_4x4:
   86|  40.3k|{
   87|  40.3k|    WORD32 i4_nnz = 0;
   88|  40.3k|    WORD16 *pi2_src_ptr = pi2_src;
   89|  40.3k|    WORD16 *pi2_tmp_ptr = pi2_tmp;
   90|  40.3k|    UWORD8 *pu1_pred_ptr = pu1_pred;
   91|  40.3k|    WORD16 *pi2_rsd_ptr = pi2_rsd;
   92|  40.3k|    UWORD8 *pu1_out_ptr = pu1_out;
   93|  40.3k|    WORD16 x0, x1, x2, x3, i;
   94|  40.3k|    WORD32 q0, q1, q2, q3;
   95|  40.3k|    WORD16 i_macro;
   96|  40.3k|    WORD16 rnd_fact = (u4_qp_div_6 < 4) ? 1 << (3 - u4_qp_div_6) : 0;
  ------------------
  |  Branch (96:23): [True: 29.9k, False: 10.3k]
  ------------------
   97|       |
   98|       |    /* inverse quant */
   99|       |    /*horizontal inverse transform */
  100|   201k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|   201k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (100:16): [True: 161k, False: 40.3k]
  ------------------
  101|   161k|    {
  102|   161k|        q0 = pi2_src_ptr[0];
  103|   161k|        INV_QUANT(q0, pu2_iscal_mat[0], pu2_weigh_mat[0], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|   161k|                {\
  |  |  104|   161k|                    i4_value *= quant_scale;\
  |  |  105|   161k|                    i4_value *= weight_scale;\
  |  |  106|   161k|                    i4_value += rndfactor;\
  |  |  107|   161k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|   161k|                    i4_value >>= qbits;\
  |  |  109|   161k|                }
  ------------------
  104|   161k|        if(i == 0 && iq_start_idx == 1)
  ------------------
  |  Branch (104:12): [True: 40.3k, False: 120k]
  |  Branch (104:22): [True: 0, False: 40.3k]
  ------------------
  105|      0|            q0 = pi2_dc_ld_addr[0];  // Restoring dc value for intra case
  106|       |
  107|   161k|        q2 = pi2_src_ptr[2];
  108|   161k|        INV_QUANT(q2, pu2_iscal_mat[2], pu2_weigh_mat[2], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|   161k|                {\
  |  |  104|   161k|                    i4_value *= quant_scale;\
  |  |  105|   161k|                    i4_value *= weight_scale;\
  |  |  106|   161k|                    i4_value += rndfactor;\
  |  |  107|   161k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|   161k|                    i4_value >>= qbits;\
  |  |  109|   161k|                }
  ------------------
  109|       |
  110|   161k|        x0 = q0 + q2;
  111|   161k|        x1 = q0 - q2;
  112|       |
  113|   161k|        q1 = pi2_src_ptr[1];
  114|   161k|        INV_QUANT(q1, pu2_iscal_mat[1], pu2_weigh_mat[1], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|   161k|                {\
  |  |  104|   161k|                    i4_value *= quant_scale;\
  |  |  105|   161k|                    i4_value *= weight_scale;\
  |  |  106|   161k|                    i4_value += rndfactor;\
  |  |  107|   161k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|   161k|                    i4_value >>= qbits;\
  |  |  109|   161k|                }
  ------------------
  115|       |
  116|   161k|        q3 = pi2_src_ptr[3];
  117|   161k|        INV_QUANT(q3, pu2_iscal_mat[3], pu2_weigh_mat[3], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|   161k|                {\
  |  |  104|   161k|                    i4_value *= quant_scale;\
  |  |  105|   161k|                    i4_value *= weight_scale;\
  |  |  106|   161k|                    i4_value += rndfactor;\
  |  |  107|   161k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|   161k|                    i4_value >>= qbits;\
  |  |  109|   161k|                }
  ------------------
  118|       |
  119|   161k|        x2 = (q1 >> 1) - q3;
  120|   161k|        x3 = q1 + (q3 >> 1);
  121|       |
  122|   161k|        pi2_tmp_ptr[0] = x0 + x3;
  123|   161k|        pi2_tmp_ptr[1] = x1 + x2;
  124|   161k|        pi2_tmp_ptr[2] = x1 - x2;
  125|   161k|        pi2_tmp_ptr[3] = x0 - x3;
  126|       |
  127|   161k|        pi2_src_ptr += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|   161k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  128|   161k|        pi2_tmp_ptr += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|   161k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  129|   161k|        pu2_iscal_mat += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|   161k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  130|   161k|        pu2_weigh_mat += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|   161k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  131|   161k|    }
  132|       |
  133|       |    /* vertical inverse transform */
  134|  40.3k|    pi2_tmp_ptr = pi2_tmp;
  135|   201k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|   201k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (135:16): [True: 161k, False: 40.3k]
  ------------------
  136|   161k|    {
  137|   161k|        pu1_pred_ptr = pu1_pred;
  138|   161k|        pi2_rsd_ptr = pi2_rsd;
  139|   161k|        pu1_out = pu1_out_ptr;
  140|       |
  141|   161k|        x0 = (pi2_tmp_ptr[0] + pi2_tmp_ptr[8]);
  142|   161k|        x1 = (pi2_tmp_ptr[0] - pi2_tmp_ptr[8]);
  143|   161k|        x2 = (pi2_tmp_ptr[4] >> 1) - pi2_tmp_ptr[12];
  144|   161k|        x3 = pi2_tmp_ptr[4] + (pi2_tmp_ptr[12] >> 1);
  145|       |
  146|       |        /* inverse prediction */
  147|   161k|        i_macro = x0 + x3;
  148|   161k|        i_macro = ((i_macro + 32) >> 6);
  149|   161k|        i_macro = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|   161k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   161k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 915, False: 160k]
  |  |  |  |  |  Branch (77:54): [True: 720, False: 159k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  150|   161k|        i4_nnz |= !!i_macro;
  151|   161k|        i_macro += *pu1_pred_ptr;
  152|   161k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   161k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   161k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 66.3k, False: 94.9k]
  |  |  |  |  |  Branch (77:54): [True: 1.27k, False: 93.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  153|   161k|        pu1_pred_ptr += pred_strd;
  154|   161k|        pi2_rsd_ptr += rsd_strd;
  155|   161k|        pu1_out += out_strd;
  156|       |
  157|   161k|        i_macro = x1 + x2;
  158|   161k|        i_macro = ((i_macro + 32) >> 6);
  159|   161k|        i_macro = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|   161k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   161k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 744, False: 160k]
  |  |  |  |  |  Branch (77:54): [True: 558, False: 159k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  160|   161k|        i4_nnz |= !!i_macro;
  161|   161k|        i_macro += *pu1_pred_ptr;
  162|   161k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   161k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   161k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 70.7k, False: 90.5k]
  |  |  |  |  |  Branch (77:54): [True: 1.17k, False: 89.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  163|   161k|        pu1_pred_ptr += pred_strd;
  164|   161k|        pi2_rsd_ptr += rsd_strd;
  165|   161k|        pu1_out += out_strd;
  166|       |
  167|   161k|        i_macro = x1 - x2;
  168|   161k|        i_macro = ((i_macro + 32) >> 6);
  169|   161k|        i_macro = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|   161k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   161k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 509, False: 160k]
  |  |  |  |  |  Branch (77:54): [True: 588, False: 160k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  170|   161k|        i4_nnz |= !!i_macro;
  171|   161k|        i_macro += *pu1_pred_ptr;
  172|   161k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   161k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   161k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 61.5k, False: 99.7k]
  |  |  |  |  |  Branch (77:54): [True: 1.85k, False: 97.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  173|   161k|        pu1_pred_ptr += pred_strd;
  174|   161k|        pi2_rsd_ptr += rsd_strd;
  175|   161k|        pu1_out += out_strd;
  176|       |
  177|   161k|        i_macro = x0 - x3;
  178|   161k|        i_macro = ((i_macro + 32) >> 6);
  179|   161k|        i4_nnz |= !!i_macro;
  180|   161k|        i_macro = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|   161k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   161k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 709, False: 160k]
  |  |  |  |  |  Branch (77:54): [True: 647, False: 159k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  181|   161k|        i_macro += *pu1_pred_ptr;
  182|   161k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   161k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   161k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 62.5k, False: 98.7k]
  |  |  |  |  |  Branch (77:54): [True: 2.11k, False: 96.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  183|       |
  184|   161k|        pi2_tmp_ptr++;
  185|   161k|        pu1_out_ptr++;
  186|   161k|        pi2_rsd++;
  187|   161k|        pu1_pred++;
  188|   161k|    }
  189|  40.3k|    return i4_nnz;
  190|  40.3k|}
isvcd_iquant_itrans_residual_recon_4x4_dc:
  221|  4.52k|{
  222|  4.52k|    WORD32 i4_nnz = 0;
  223|  4.52k|    UWORD8 *pu1_pred_ptr = pu1_pred;
  224|  4.52k|    WORD16 *pi2_rsd_ptr = pi2_rsd;
  225|  4.52k|    UWORD8 *pu1_out_ptr = pu1_out;
  226|  4.52k|    WORD32 q0;
  227|  4.52k|    WORD16 x, i_macro, i;
  228|  4.52k|    WORD16 rnd_fact = (u4_qp_div_6 < 4) ? 1 << (3 - u4_qp_div_6) : 0;
  ------------------
  |  Branch (228:23): [True: 1.00k, False: 3.52k]
  ------------------
  229|  4.52k|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|  4.52k|#define UNUSED(x) ((void)(x))
  ------------------
  230|       |
  231|  4.52k|    if(iq_start_idx == 0)
  ------------------
  |  Branch (231:8): [True: 4.52k, False: 0]
  ------------------
  232|  4.52k|    {
  233|  4.52k|        q0 = pi2_src[0];
  234|  4.52k|        INV_QUANT(q0, pu2_iscal_mat[0], pu2_weigh_mat[0], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|  4.52k|                {\
  |  |  104|  4.52k|                    i4_value *= quant_scale;\
  |  |  105|  4.52k|                    i4_value *= weight_scale;\
  |  |  106|  4.52k|                    i4_value += rndfactor;\
  |  |  107|  4.52k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  4.52k|                    i4_value >>= qbits;\
  |  |  109|  4.52k|                }
  ------------------
  235|  4.52k|    }
  236|      0|    else
  237|      0|    {
  238|      0|        q0 = pi2_dc_ld_addr[0];  // Restoring dc value for intra case3
  239|      0|    }
  240|  4.52k|    i_macro = ((q0 + 32) >> 6);
  241|  22.6k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|  22.6k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (241:16): [True: 18.1k, False: 4.52k]
  ------------------
  242|  18.1k|    {
  243|  18.1k|        pu1_pred_ptr = pu1_pred;
  244|  18.1k|        pi2_rsd_ptr = pi2_rsd;
  245|  18.1k|        pu1_out = pu1_out_ptr;
  246|       |
  247|       |        /* inverse prediction */
  248|  18.1k|        x = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  18.1k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  18.1k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 530, False: 17.5k]
  |  |  |  |  |  Branch (77:54): [True: 3.20k, False: 14.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  249|  18.1k|        i4_nnz |= !!x;
  250|  18.1k|        x += *pu1_pred_ptr;
  251|  18.1k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  18.1k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  18.1k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 4.00k, False: 14.1k]
  |  |  |  |  |  Branch (77:54): [True: 1.88k, False: 12.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  252|  18.1k|        pu1_pred_ptr += pred_strd;
  253|  18.1k|        pi2_rsd_ptr += rsd_strd;
  254|  18.1k|        pu1_out += out_strd;
  255|       |
  256|  18.1k|        x = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  18.1k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  18.1k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 529, False: 17.5k]
  |  |  |  |  |  Branch (77:54): [True: 3.20k, False: 14.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  257|  18.1k|        i4_nnz |= !!x;
  258|  18.1k|        x += *pu1_pred_ptr;
  259|  18.1k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  18.1k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  18.1k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 4.03k, False: 14.0k]
  |  |  |  |  |  Branch (77:54): [True: 1.90k, False: 12.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  260|  18.1k|        pu1_pred_ptr += pred_strd;
  261|  18.1k|        pi2_rsd_ptr += rsd_strd;
  262|  18.1k|        pu1_out += out_strd;
  263|       |
  264|  18.1k|        x = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  18.1k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  18.1k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 527, False: 17.5k]
  |  |  |  |  |  Branch (77:54): [True: 3.20k, False: 14.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  265|  18.1k|        i4_nnz |= !!x;
  266|  18.1k|        x += *pu1_pred_ptr;
  267|  18.1k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  18.1k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  18.1k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 3.98k, False: 14.1k]
  |  |  |  |  |  Branch (77:54): [True: 1.84k, False: 12.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  268|  18.1k|        pu1_pred_ptr += pred_strd;
  269|  18.1k|        pi2_rsd_ptr += rsd_strd;
  270|  18.1k|        pu1_out += out_strd;
  271|       |
  272|  18.1k|        x = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  18.1k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  18.1k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 528, False: 17.5k]
  |  |  |  |  |  Branch (77:54): [True: 3.20k, False: 14.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  273|  18.1k|        i4_nnz |= !!x;
  274|  18.1k|        x += *pu1_pred_ptr;
  275|  18.1k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  18.1k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  18.1k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 3.92k, False: 14.1k]
  |  |  |  |  |  Branch (77:54): [True: 1.91k, False: 12.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  276|       |
  277|  18.1k|        pu1_out_ptr++;
  278|  18.1k|        pu1_pred++;
  279|  18.1k|        pi2_rsd++;
  280|  18.1k|    }
  281|  4.52k|    return i4_nnz;
  282|  4.52k|}
isvcd_iquant_itrans_residual_recon_chroma_4x4:
  311|  8.44k|{
  312|  8.44k|    WORD16 *pi2_src_ptr = pi2_src;
  313|  8.44k|    WORD16 *pi2_tmp_ptr = pi2_tmp;
  314|  8.44k|    UWORD8 *pu1_pred_ptr = pu1_pred;
  315|  8.44k|    WORD16 *pi2_rsd_ptr = pi2_rsd;
  316|  8.44k|    UWORD8 *pu1_out_ptr = pu1_out;
  317|  8.44k|    WORD16 x0, x1, x2, x3, i;
  318|  8.44k|    WORD32 q0, q1, q2, q3;
  319|  8.44k|    WORD16 i_macro;
  320|  8.44k|    WORD16 rnd_fact = (u4_qp_div_6 < 4) ? 1 << (3 - u4_qp_div_6) : 0;
  ------------------
  |  Branch (320:23): [True: 4.01k, False: 4.43k]
  ------------------
  321|       |
  322|       |    /* inverse quant */
  323|       |    /*horizontal inverse transform */
  324|  42.2k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|  42.2k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (324:16): [True: 33.7k, False: 8.44k]
  ------------------
  325|  33.7k|    {
  326|  33.7k|        if(i == 0)
  ------------------
  |  Branch (326:12): [True: 8.44k, False: 25.3k]
  ------------------
  327|  8.44k|        {
  328|  8.44k|            q0 = pi2_dc_src[0];
  329|  8.44k|        }
  330|  25.3k|        else
  331|  25.3k|        {
  332|  25.3k|            q0 = pi2_src_ptr[0];
  333|  25.3k|            INV_QUANT(q0, pu2_iscal_mat[0], pu2_weigh_mat[0], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|  25.3k|                {\
  |  |  104|  25.3k|                    i4_value *= quant_scale;\
  |  |  105|  25.3k|                    i4_value *= weight_scale;\
  |  |  106|  25.3k|                    i4_value += rndfactor;\
  |  |  107|  25.3k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  25.3k|                    i4_value >>= qbits;\
  |  |  109|  25.3k|                }
  ------------------
  334|  25.3k|        }
  335|       |
  336|  33.7k|        q2 = pi2_src_ptr[2];
  337|  33.7k|        INV_QUANT(q2, pu2_iscal_mat[2], pu2_weigh_mat[2], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|  33.7k|                {\
  |  |  104|  33.7k|                    i4_value *= quant_scale;\
  |  |  105|  33.7k|                    i4_value *= weight_scale;\
  |  |  106|  33.7k|                    i4_value += rndfactor;\
  |  |  107|  33.7k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  33.7k|                    i4_value >>= qbits;\
  |  |  109|  33.7k|                }
  ------------------
  338|       |
  339|  33.7k|        x0 = q0 + q2;
  340|  33.7k|        x1 = q0 - q2;
  341|       |
  342|  33.7k|        q1 = pi2_src_ptr[1];
  343|  33.7k|        INV_QUANT(q1, pu2_iscal_mat[1], pu2_weigh_mat[1], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|  33.7k|                {\
  |  |  104|  33.7k|                    i4_value *= quant_scale;\
  |  |  105|  33.7k|                    i4_value *= weight_scale;\
  |  |  106|  33.7k|                    i4_value += rndfactor;\
  |  |  107|  33.7k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  33.7k|                    i4_value >>= qbits;\
  |  |  109|  33.7k|                }
  ------------------
  344|       |
  345|  33.7k|        q3 = pi2_src_ptr[3];
  346|  33.7k|        INV_QUANT(q3, pu2_iscal_mat[3], pu2_weigh_mat[3], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|  33.7k|                {\
  |  |  104|  33.7k|                    i4_value *= quant_scale;\
  |  |  105|  33.7k|                    i4_value *= weight_scale;\
  |  |  106|  33.7k|                    i4_value += rndfactor;\
  |  |  107|  33.7k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  33.7k|                    i4_value >>= qbits;\
  |  |  109|  33.7k|                }
  ------------------
  347|       |
  348|  33.7k|        x2 = (q1 >> 1) - q3;
  349|  33.7k|        x3 = q1 + (q3 >> 1);
  350|       |
  351|  33.7k|        pi2_tmp_ptr[0] = x0 + x3;
  352|  33.7k|        pi2_tmp_ptr[1] = x1 + x2;
  353|  33.7k|        pi2_tmp_ptr[2] = x1 - x2;
  354|  33.7k|        pi2_tmp_ptr[3] = x0 - x3;
  355|       |
  356|  33.7k|        pi2_src_ptr += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|  33.7k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  357|  33.7k|        pi2_tmp_ptr += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|  33.7k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  358|  33.7k|        pu2_iscal_mat += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|  33.7k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  359|  33.7k|        pu2_weigh_mat += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|  33.7k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  360|  33.7k|    }
  361|       |
  362|       |    /* vertical inverse transform */
  363|  8.44k|    pi2_tmp_ptr = pi2_tmp;
  364|  42.2k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|  42.2k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (364:16): [True: 33.7k, False: 8.44k]
  ------------------
  365|  33.7k|    {
  366|  33.7k|        pu1_pred_ptr = pu1_pred;
  367|  33.7k|        pi2_rsd_ptr = pi2_rsd;
  368|  33.7k|        pu1_out = pu1_out_ptr;
  369|       |
  370|  33.7k|        x0 = (pi2_tmp_ptr[0] + pi2_tmp_ptr[8]);
  371|  33.7k|        x1 = (pi2_tmp_ptr[0] - pi2_tmp_ptr[8]);
  372|  33.7k|        x2 = (pi2_tmp_ptr[4] >> 1) - pi2_tmp_ptr[12];
  373|  33.7k|        x3 = pi2_tmp_ptr[4] + (pi2_tmp_ptr[12] >> 1);
  374|       |
  375|       |        /* inverse prediction */
  376|  33.7k|        i_macro = x0 + x3;
  377|  33.7k|        i_macro = ((i_macro + 32) >> 6);
  378|  33.7k|        i_macro = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  33.7k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  33.7k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 907, False: 32.8k]
  |  |  |  |  |  Branch (77:54): [True: 1.68k, False: 31.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  379|  33.7k|        i_macro += *pu1_pred_ptr;
  380|  33.7k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|  33.7k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  33.7k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 8.92k, False: 24.8k]
  |  |  |  |  |  Branch (77:54): [True: 1.54k, False: 23.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  381|  33.7k|        pu1_pred_ptr += pred_strd;
  382|  33.7k|        pi2_rsd_ptr += rsd_strd;
  383|  33.7k|        pu1_out += out_strd;
  384|       |
  385|  33.7k|        i_macro = x1 + x2;
  386|  33.7k|        i_macro = ((i_macro + 32) >> 6);
  387|  33.7k|        i_macro = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  33.7k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  33.7k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 1.28k, False: 32.4k]
  |  |  |  |  |  Branch (77:54): [True: 1.36k, False: 31.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  388|  33.7k|        i_macro += *pu1_pred_ptr;
  389|  33.7k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|  33.7k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  33.7k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 9.29k, False: 24.4k]
  |  |  |  |  |  Branch (77:54): [True: 1.14k, False: 23.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  390|  33.7k|        pu1_pred_ptr += pred_strd;
  391|  33.7k|        pi2_rsd_ptr += rsd_strd;
  392|  33.7k|        pu1_out += out_strd;
  393|       |
  394|  33.7k|        i_macro = x1 - x2;
  395|  33.7k|        i_macro = ((i_macro + 32) >> 6);
  396|  33.7k|        i_macro = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  33.7k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  33.7k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 932, False: 32.8k]
  |  |  |  |  |  Branch (77:54): [True: 1.47k, False: 31.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  397|  33.7k|        i_macro += *pu1_pred_ptr;
  398|  33.7k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|  33.7k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  33.7k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 7.93k, False: 25.8k]
  |  |  |  |  |  Branch (77:54): [True: 1.80k, False: 24.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  399|  33.7k|        pu1_pred_ptr += pred_strd;
  400|  33.7k|        pi2_rsd_ptr += rsd_strd;
  401|  33.7k|        pu1_out += out_strd;
  402|       |
  403|  33.7k|        i_macro = x0 - x3;
  404|  33.7k|        i_macro = ((i_macro + 32) >> 6);
  405|  33.7k|        i_macro = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  33.7k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  33.7k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 888, False: 32.8k]
  |  |  |  |  |  Branch (77:54): [True: 1.56k, False: 31.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  406|  33.7k|        i_macro += *pu1_pred_ptr;
  407|  33.7k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|  33.7k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  33.7k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 7.44k, False: 26.3k]
  |  |  |  |  |  Branch (77:54): [True: 1.78k, False: 24.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  408|       |
  409|  33.7k|        pi2_tmp_ptr++;
  410|  33.7k|        pu1_out_ptr += 2;  // Interleaved store for output
  411|  33.7k|        pu1_pred += 2;     // Interleaved load for pred buffer
  412|  33.7k|        pi2_rsd += 2;
  413|  33.7k|    }
  414|  8.44k|}
isvcd_iquant_itrans_residual_recon_chroma_4x4_dc:
  443|  24.7k|{
  444|  24.7k|    UWORD8 *pu1_pred_ptr = pu1_pred;
  445|  24.7k|    WORD16 *pi2_rsd_ptr = pi2_rsd;
  446|  24.7k|    UWORD8 *pu1_out_ptr = pu1_out;
  447|  24.7k|    WORD32 q0;
  448|  24.7k|    WORD16 x, i_macro, i;
  449|  24.7k|    UNUSED(pi2_src);
  ------------------
  |  |   45|  24.7k|#define UNUSED(x) ((void)(x))
  ------------------
  450|  24.7k|    UNUSED(pu2_iscal_mat);
  ------------------
  |  |   45|  24.7k|#define UNUSED(x) ((void)(x))
  ------------------
  451|  24.7k|    UNUSED(pu2_weigh_mat);
  ------------------
  |  |   45|  24.7k|#define UNUSED(x) ((void)(x))
  ------------------
  452|  24.7k|    UNUSED(u4_qp_div_6);
  ------------------
  |  |   45|  24.7k|#define UNUSED(x) ((void)(x))
  ------------------
  453|  24.7k|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|  24.7k|#define UNUSED(x) ((void)(x))
  ------------------
  454|       |
  455|  24.7k|    q0 = pi2_dc_src[0];  // Restoring dc value for intra case3
  456|  24.7k|    i_macro = ((q0 + 32) >> 6);
  457|       |
  458|   123k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|   123k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (458:16): [True: 99.0k, False: 24.7k]
  ------------------
  459|  99.0k|    {
  460|  99.0k|        pu1_pred_ptr = pu1_pred;
  461|  99.0k|        pi2_rsd_ptr = pi2_rsd;
  462|  99.0k|        pu1_out = pu1_out_ptr;
  463|       |
  464|       |        /* inverse prediction */
  465|  99.0k|        x = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  99.0k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  99.0k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 497, False: 98.5k]
  |  |  |  |  |  Branch (77:54): [True: 1.37k, False: 97.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  466|  99.0k|        x += *pu1_pred_ptr;
  467|  99.0k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  99.0k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  99.0k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 25.4k, False: 73.5k]
  |  |  |  |  |  Branch (77:54): [True: 2.71k, False: 70.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  468|  99.0k|        pu1_pred_ptr += pred_strd;
  469|  99.0k|        pi2_rsd_ptr += rsd_strd;
  470|  99.0k|        pu1_out += out_strd;
  471|       |
  472|  99.0k|        x = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  99.0k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  99.0k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 497, False: 98.5k]
  |  |  |  |  |  Branch (77:54): [True: 1.37k, False: 97.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  473|  99.0k|        x += *pu1_pred_ptr;
  474|  99.0k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  99.0k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  99.0k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 25.5k, False: 73.4k]
  |  |  |  |  |  Branch (77:54): [True: 2.71k, False: 70.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  475|  99.0k|        pu1_pred_ptr += pred_strd;
  476|  99.0k|        pi2_rsd_ptr += rsd_strd;
  477|  99.0k|        pu1_out += out_strd;
  478|       |
  479|  99.0k|        x = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  99.0k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  99.0k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 497, False: 98.5k]
  |  |  |  |  |  Branch (77:54): [True: 1.35k, False: 97.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  480|  99.0k|        x += *pu1_pred_ptr;
  481|  99.0k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  99.0k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  99.0k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 25.7k, False: 73.2k]
  |  |  |  |  |  Branch (77:54): [True: 2.71k, False: 70.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  482|  99.0k|        pu1_pred_ptr += pred_strd;
  483|  99.0k|        pi2_rsd_ptr += rsd_strd;
  484|  99.0k|        pu1_out += out_strd;
  485|       |
  486|  99.0k|        x = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  99.0k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  99.0k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 494, False: 98.5k]
  |  |  |  |  |  Branch (77:54): [True: 1.36k, False: 97.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  487|  99.0k|        x += *pu1_pred_ptr;
  488|  99.0k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  99.0k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  99.0k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 25.6k, False: 73.3k]
  |  |  |  |  |  Branch (77:54): [True: 2.67k, False: 70.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  489|       |
  490|  99.0k|        pu1_out_ptr += 2;
  491|  99.0k|        pu1_pred += 2;
  492|  99.0k|        pi2_rsd += 2;
  493|  99.0k|    }
  494|  24.7k|}
isvcd_iquant_itrans_residual_recon_8x8:
  525|  7.42k|{
  526|  7.42k|    WORD32 i4_nnz = 0, i4_nnz_H = 0, i4_nnz_L = 0;
  527|  7.42k|    WORD32 i;
  528|  7.42k|    WORD16 *pi2_tmp_ptr = pi2_tmp;
  529|  7.42k|    UWORD8 *pu1_pred_ptr = pu1_pred;
  530|  7.42k|    WORD16 *pi2_rsd_ptr = pi2_rsd;
  531|  7.42k|    UWORD8 *pu1_out_ptr = pu1_out;
  532|  7.42k|    WORD16 i_z0, i_z1, i_z2, i_z3, i_z4, i_z5, i_z6, i_z7;
  533|  7.42k|    WORD16 i_y0, i_y1, i_y2, i_y3, i_y4, i_y5, i_y6, i_y7;
  534|  7.42k|    WORD16 i_macro;
  535|  7.42k|    WORD32 q;
  536|  7.42k|    WORD32 rnd_fact = (qp_div < 6) ? (1 << (5 - qp_div)) : 0;
  ------------------
  |  Branch (536:23): [True: 6.31k, False: 1.10k]
  ------------------
  537|  7.42k|    UNUSED(iq_start_idx);
  ------------------
  |  |   45|  7.42k|#define UNUSED(x) ((void)(x))
  ------------------
  538|  7.42k|    UNUSED(pi2_dc_ld_addr);
  ------------------
  |  |   45|  7.42k|#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|   482k|    for(i = 0; i < (SUB_BLK_WIDTH_8x8 * SUB_BLK_WIDTH_8x8); i++)
  ------------------
  |  |   53|   482k|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
                  for(i = 0; i < (SUB_BLK_WIDTH_8x8 * SUB_BLK_WIDTH_8x8); i++)
  ------------------
  |  |   53|   482k|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
  |  Branch (543:16): [True: 475k, False: 7.42k]
  ------------------
  544|   475k|    {
  545|   475k|        q = pi2_src[i];
  546|   475k|        INV_QUANT(q, pu2_iscale_mat[i], pu2_weigh_mat[i], qp_div, rnd_fact, 6);
  ------------------
  |  |  103|   475k|                {\
  |  |  104|   475k|                    i4_value *= quant_scale;\
  |  |  105|   475k|                    i4_value *= weight_scale;\
  |  |  106|   475k|                    i4_value += rndfactor;\
  |  |  107|   475k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|   475k|                    i4_value >>= qbits;\
  |  |  109|   475k|                }
  ------------------
  547|   475k|        pi2_tmp_ptr[i] = q;
  548|   475k|    }
  549|       |    /* Perform Inverse transform */
  550|       |    /*--------------------------------------------------------------------*/
  551|       |    /* IDCT [ Horizontal transformation ]                                 */
  552|       |    /*--------------------------------------------------------------------*/
  553|  66.7k|    for(i = 0; i < SUB_BLK_WIDTH_8x8; i++)
  ------------------
  |  |   53|  66.7k|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
  |  Branch (553:16): [True: 59.3k, False: 7.42k]
  ------------------
  554|  59.3k|    {
  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|  59.3k|        i_y0 = (pi2_tmp_ptr[0] + pi2_tmp_ptr[4]);
  566|       |
  567|  59.3k|        i_y1 =
  568|  59.3k|            ((WORD32) (-pi2_tmp_ptr[3]) + pi2_tmp_ptr[5] - pi2_tmp_ptr[7] - (pi2_tmp_ptr[7] >> 1));
  569|       |
  570|  59.3k|        i_y2 = (pi2_tmp_ptr[0] - pi2_tmp_ptr[4]);
  571|       |
  572|  59.3k|        i_y3 = ((WORD32) pi2_tmp_ptr[1] + pi2_tmp_ptr[7] - pi2_tmp_ptr[3] - (pi2_tmp_ptr[3] >> 1));
  573|       |
  574|  59.3k|        i_y4 = ((pi2_tmp_ptr[2] >> 1) - pi2_tmp_ptr[6]);
  575|       |
  576|  59.3k|        i_y5 =
  577|  59.3k|            ((WORD32) (-pi2_tmp_ptr[1]) + pi2_tmp_ptr[7] + pi2_tmp_ptr[5] + (pi2_tmp_ptr[5] >> 1));
  578|       |
  579|  59.3k|        i_y6 = (pi2_tmp_ptr[2] + (pi2_tmp_ptr[6] >> 1));
  580|       |
  581|  59.3k|        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|  59.3k|        i_z0 = i_y0 + i_y6;
  594|  59.3k|        i_z1 = i_y1 + (i_y7 >> 2);
  595|  59.3k|        i_z2 = i_y2 + i_y4;
  596|  59.3k|        i_z3 = i_y3 + (i_y5 >> 2);
  597|  59.3k|        i_z4 = i_y2 - i_y4;
  598|  59.3k|        i_z5 = (i_y3 >> 2) - i_y5;
  599|  59.3k|        i_z6 = i_y0 - i_y6;
  600|  59.3k|        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|  59.3k|        pi2_tmp_ptr[0] = i_z0 + i_z7;
  613|  59.3k|        pi2_tmp_ptr[1] = i_z2 + i_z5;
  614|  59.3k|        pi2_tmp_ptr[2] = i_z4 + i_z3;
  615|  59.3k|        pi2_tmp_ptr[3] = i_z6 + i_z1;
  616|  59.3k|        pi2_tmp_ptr[4] = i_z6 - i_z1;
  617|  59.3k|        pi2_tmp_ptr[5] = i_z4 - i_z3;
  618|  59.3k|        pi2_tmp_ptr[6] = i_z2 - i_z5;
  619|  59.3k|        pi2_tmp_ptr[7] = i_z0 - i_z7;
  620|       |
  621|       |        /* move to the next row */
  622|  59.3k|        pi2_tmp_ptr += SUB_BLK_WIDTH_8x8;
  ------------------
  |  |   53|  59.3k|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
  623|  59.3k|    }
  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|  7.42k|    pi2_tmp_ptr = pi2_tmp;
  632|  66.7k|    for(i = 0; i < SUB_BLK_WIDTH_8x8; i++)
  ------------------
  |  |   53|  66.7k|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
  |  Branch (632:16): [True: 59.3k, False: 7.42k]
  ------------------
  633|  59.3k|    {
  634|  59.3k|        pu1_pred_ptr = pu1_pred;
  635|  59.3k|        pi2_rsd_ptr = pi2_rsd;
  636|  59.3k|        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|  59.3k|        i_y0 = pi2_tmp_ptr[0] + pi2_tmp_ptr[32];
  648|       |
  649|  59.3k|        i_y1 = (WORD32) (-pi2_tmp_ptr[24]) + pi2_tmp_ptr[40] - pi2_tmp_ptr[56] -
  650|  59.3k|               (pi2_tmp_ptr[56] >> 1);
  651|       |
  652|  59.3k|        i_y2 = pi2_tmp_ptr[0] - pi2_tmp_ptr[32];
  653|       |
  654|  59.3k|        i_y3 = (WORD32) pi2_tmp_ptr[8] + pi2_tmp_ptr[56] - pi2_tmp_ptr[24] - (pi2_tmp_ptr[24] >> 1);
  655|       |
  656|  59.3k|        i_y4 = (pi2_tmp_ptr[16] >> 1) - pi2_tmp_ptr[48];
  657|       |
  658|  59.3k|        i_y5 =
  659|  59.3k|            (WORD32) (-pi2_tmp_ptr[8]) + pi2_tmp_ptr[56] + pi2_tmp_ptr[40] + (pi2_tmp_ptr[40] >> 1);
  660|       |
  661|  59.3k|        i_y6 = pi2_tmp_ptr[16] + (pi2_tmp_ptr[48] >> 1);
  662|       |
  663|  59.3k|        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|  59.3k|        i_z0 = i_y0 + i_y6;
  676|  59.3k|        i_z1 = i_y1 + (i_y7 >> 2);
  677|  59.3k|        i_z2 = i_y2 + i_y4;
  678|  59.3k|        i_z3 = i_y3 + (i_y5 >> 2);
  679|  59.3k|        i_z4 = i_y2 - i_y4;
  680|  59.3k|        i_z5 = (i_y3 >> 2) - i_y5;
  681|  59.3k|        i_z6 = i_y0 - i_y6;
  682|  59.3k|        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|  59.3k|        i_macro = CLIP_RSD(((i_z0 + i_z7 + 32) >> 6) + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  59.3k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  59.3k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 1.22k, False: 58.1k]
  |  |  |  |  |  Branch (77:54): [True: 993, False: 57.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  695|  59.3k|        i4_nnz_H |= !!i_macro;
  696|  59.3k|        i_macro += *pu1_pred_ptr;
  697|  59.3k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|  59.3k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  59.3k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 21.4k, False: 37.9k]
  |  |  |  |  |  Branch (77:54): [True: 1.67k, False: 36.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  698|       |        /* Change uc_recBuffer to Point to next element in the same column*/
  699|  59.3k|        pu1_pred_ptr += pred_strd;
  700|  59.3k|        pi2_rsd_ptr += rsd_strd;
  701|  59.3k|        pu1_out += out_strd;
  702|       |
  703|  59.3k|        i_macro = CLIP_RSD(((i_z2 + i_z5 + 32) >> 6) + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  59.3k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  59.3k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 1.05k, False: 58.3k]
  |  |  |  |  |  Branch (77:54): [True: 496, False: 57.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  704|  59.3k|        i4_nnz_H |= !!i_macro;
  705|  59.3k|        i_macro += *pu1_pred_ptr;
  706|  59.3k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|  59.3k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  59.3k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 20.6k, False: 38.7k]
  |  |  |  |  |  Branch (77:54): [True: 1.43k, False: 37.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  707|  59.3k|        pu1_pred_ptr += pred_strd;
  708|  59.3k|        pi2_rsd_ptr += rsd_strd;
  709|  59.3k|        pu1_out += out_strd;
  710|       |
  711|  59.3k|        i_macro = CLIP_RSD(((i_z4 + i_z3 + 32) >> 6) + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  59.3k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  59.3k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 865, False: 58.5k]
  |  |  |  |  |  Branch (77:54): [True: 608, False: 57.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  712|  59.3k|        i4_nnz_H |= !!i_macro;
  713|  59.3k|        i_macro += *pu1_pred_ptr;
  714|  59.3k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|  59.3k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  59.3k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 18.7k, False: 40.6k]
  |  |  |  |  |  Branch (77:54): [True: 1.54k, False: 39.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  715|  59.3k|        pu1_pred_ptr += pred_strd;
  716|  59.3k|        pi2_rsd_ptr += rsd_strd;
  717|  59.3k|        pu1_out += out_strd;
  718|       |
  719|  59.3k|        i_macro = CLIP_RSD(((i_z6 + i_z1 + 32) >> 6) + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  59.3k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  59.3k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 1.18k, False: 58.1k]
  |  |  |  |  |  Branch (77:54): [True: 972, False: 57.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  720|  59.3k|        i4_nnz_H |= !!i_macro;
  721|  59.3k|        i_macro += *pu1_pred_ptr;
  722|  59.3k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|  59.3k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  59.3k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 20.0k, False: 39.3k]
  |  |  |  |  |  Branch (77:54): [True: 1.62k, False: 37.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  723|  59.3k|        pu1_pred_ptr += pred_strd;
  724|  59.3k|        pi2_rsd_ptr += rsd_strd;
  725|  59.3k|        pu1_out += out_strd;
  726|       |
  727|  59.3k|        i_macro = CLIP_RSD(((i_z6 - i_z1 + 32) >> 6) + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  59.3k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  59.3k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 624, False: 58.7k]
  |  |  |  |  |  Branch (77:54): [True: 1.74k, False: 57.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  728|  59.3k|        i4_nnz_L |= !!i_macro;
  729|  59.3k|        i_macro += *pu1_pred_ptr;
  730|  59.3k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|  59.3k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  59.3k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 19.3k, False: 40.0k]
  |  |  |  |  |  Branch (77:54): [True: 2.26k, False: 37.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  731|  59.3k|        pu1_pred_ptr += pred_strd;
  732|  59.3k|        pi2_rsd_ptr += rsd_strd;
  733|  59.3k|        pu1_out += out_strd;
  734|       |
  735|  59.3k|        i_macro = CLIP_RSD(((i_z4 - i_z3 + 32) >> 6) + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  59.3k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  59.3k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 528, False: 58.8k]
  |  |  |  |  |  Branch (77:54): [True: 893, False: 57.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  736|  59.3k|        i4_nnz_L |= !!i_macro;
  737|  59.3k|        i_macro += *pu1_pred_ptr;
  738|  59.3k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|  59.3k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  59.3k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 18.1k, False: 41.1k]
  |  |  |  |  |  Branch (77:54): [True: 1.82k, False: 39.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  739|  59.3k|        pu1_pred_ptr += pred_strd;
  740|  59.3k|        pi2_rsd_ptr += rsd_strd;
  741|  59.3k|        pu1_out += out_strd;
  742|       |
  743|  59.3k|        i_macro = CLIP_RSD(((i_z2 - i_z5 + 32) >> 6) + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  59.3k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  59.3k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 709, False: 58.6k]
  |  |  |  |  |  Branch (77:54): [True: 1.10k, False: 57.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  744|  59.3k|        i4_nnz_L |= !!i_macro;
  745|  59.3k|        i_macro += *pu1_pred_ptr;
  746|  59.3k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|  59.3k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  59.3k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 19.7k, False: 39.6k]
  |  |  |  |  |  Branch (77:54): [True: 1.99k, False: 37.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  747|  59.3k|        pu1_pred_ptr += pred_strd;
  748|  59.3k|        pi2_rsd_ptr += rsd_strd;
  749|  59.3k|        pu1_out += out_strd;
  750|       |
  751|  59.3k|        i_macro = CLIP_RSD(((i_z0 - i_z7 + 32) >> 6) + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  59.3k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  59.3k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 1.60k, False: 57.7k]
  |  |  |  |  |  Branch (77:54): [True: 1.16k, False: 56.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  752|  59.3k|        i4_nnz_L |= !!i_macro;
  753|  59.3k|        i_macro += *pu1_pred_ptr;
  754|  59.3k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|  59.3k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  59.3k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 21.1k, False: 38.2k]
  |  |  |  |  |  Branch (77:54): [True: 1.86k, False: 36.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  755|       |
  756|  59.3k|        pi2_tmp_ptr++;
  757|  59.3k|        pu1_out_ptr++;
  758|  59.3k|        pi2_rsd++;
  759|  59.3k|        pu1_pred++;
  760|  59.3k|        if(i == 3)
  ------------------
  |  Branch (760:12): [True: 7.42k, False: 51.9k]
  ------------------
  761|  7.42k|        {
  762|  7.42k|            i4_nnz = i4_nnz_H | (i4_nnz_L << 4);
  763|  7.42k|            i4_nnz_L = 0;
  764|  7.42k|            i4_nnz_H = 0;
  765|  7.42k|        }
  766|  59.3k|    }
  767|  7.42k|    i4_nnz |= (i4_nnz_H << 1) | (i4_nnz_L << 5);
  768|  7.42k|    return i4_nnz;
  769|  7.42k|}
isvcd_iquant_itrans_residual_recon_8x8_dc:
  800|  1.45k|{
  801|  1.45k|    WORD32 i4_nnz = 0, i4_nnz_H = 0, i4_nnz_L = 0;
  802|  1.45k|    UWORD8 *pu1_pred_ptr = pu1_pred;
  803|  1.45k|    WORD16 *pi2_rsd_ptr = pi2_rsd;
  804|  1.45k|    UWORD8 *pu1_out_ptr = pu1_out;
  805|  1.45k|    WORD16 x, i, i_macro;
  806|  1.45k|    WORD32 q;
  807|  1.45k|    WORD32 rnd_fact = (qp_div < 6) ? (1 << (5 - qp_div)) : 0;
  ------------------
  |  Branch (807:23): [True: 868, False: 587]
  ------------------
  808|  1.45k|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|  1.45k|#define UNUSED(x) ((void)(x))
  ------------------
  809|  1.45k|    UNUSED(iq_start_idx);
  ------------------
  |  |   45|  1.45k|#define UNUSED(x) ((void)(x))
  ------------------
  810|  1.45k|    UNUSED(pi2_dc_ld_addr);
  ------------------
  |  |   45|  1.45k|#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.45k|    q = pi2_src[0];
  816|  1.45k|    INV_QUANT(q, pu2_iscale_mat[0], pu2_weigh_mat[0], qp_div, rnd_fact, 6);
  ------------------
  |  |  103|  1.45k|                {\
  |  |  104|  1.45k|                    i4_value *= quant_scale;\
  |  |  105|  1.45k|                    i4_value *= weight_scale;\
  |  |  106|  1.45k|                    i4_value += rndfactor;\
  |  |  107|  1.45k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  1.45k|                    i4_value >>= qbits;\
  |  |  109|  1.45k|                }
  ------------------
  817|  1.45k|    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|  13.0k|    for(i = 0; i < SUB_BLK_WIDTH_8x8; i++)
  ------------------
  |  |   53|  13.0k|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
  |  Branch (828:16): [True: 11.6k, False: 1.45k]
  ------------------
  829|  11.6k|    {
  830|  11.6k|        pu1_pred_ptr = pu1_pred;
  831|  11.6k|        pi2_rsd_ptr = pi2_rsd;
  832|  11.6k|        pu1_out = pu1_out_ptr;
  833|       |
  834|  11.6k|        x = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  11.6k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  11.6k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 698, False: 10.9k]
  |  |  |  |  |  Branch (77:54): [True: 764, False: 10.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  835|  11.6k|        i4_nnz_H |= !!x;
  836|  11.6k|        x += *pu1_pred_ptr;
  837|  11.6k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  11.6k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  11.6k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 3.49k, False: 8.14k]
  |  |  |  |  |  Branch (77:54): [True: 574, False: 7.57k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  838|       |        /* Change uc_recBuffer to Point to next element in the same column*/
  839|  11.6k|        pu1_pred_ptr += pred_strd;
  840|  11.6k|        pi2_rsd_ptr += rsd_strd;
  841|  11.6k|        pu1_out += out_strd;
  842|       |
  843|  11.6k|        x = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  11.6k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  11.6k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 683, False: 10.9k]
  |  |  |  |  |  Branch (77:54): [True: 756, False: 10.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  844|  11.6k|        i4_nnz_H |= !!x;
  845|  11.6k|        x += *pu1_pred_ptr;
  846|  11.6k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  11.6k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  11.6k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 3.38k, False: 8.25k]
  |  |  |  |  |  Branch (77:54): [True: 632, False: 7.62k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  847|  11.6k|        pu1_pred_ptr += pred_strd;
  848|  11.6k|        pi2_rsd_ptr += rsd_strd;
  849|  11.6k|        pu1_out += out_strd;
  850|       |
  851|  11.6k|        x = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  11.6k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  11.6k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 691, False: 10.9k]
  |  |  |  |  |  Branch (77:54): [True: 773, False: 10.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  852|  11.6k|        i4_nnz_H |= !!x;
  853|  11.6k|        x += *pu1_pred_ptr;
  854|  11.6k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  11.6k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  11.6k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 3.46k, False: 8.17k]
  |  |  |  |  |  Branch (77:54): [True: 677, False: 7.49k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  855|  11.6k|        pu1_pred_ptr += pred_strd;
  856|  11.6k|        pi2_rsd_ptr += rsd_strd;
  857|  11.6k|        pu1_out += out_strd;
  858|       |
  859|  11.6k|        x = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  11.6k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  11.6k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 682, False: 10.9k]
  |  |  |  |  |  Branch (77:54): [True: 788, False: 10.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  860|  11.6k|        i4_nnz_H |= !!x;
  861|  11.6k|        x += *pu1_pred_ptr;
  862|  11.6k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  11.6k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  11.6k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 3.47k, False: 8.17k]
  |  |  |  |  |  Branch (77:54): [True: 710, False: 7.46k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  863|  11.6k|        pu1_pred_ptr += pred_strd;
  864|  11.6k|        pi2_rsd_ptr += rsd_strd;
  865|  11.6k|        pu1_out += out_strd;
  866|       |
  867|  11.6k|        x = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  11.6k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  11.6k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 671, False: 10.9k]
  |  |  |  |  |  Branch (77:54): [True: 828, False: 10.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  868|  11.6k|        i4_nnz_L |= !!x;
  869|  11.6k|        x += *pu1_pred_ptr;
  870|  11.6k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  11.6k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  11.6k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 3.45k, False: 8.18k]
  |  |  |  |  |  Branch (77:54): [True: 693, False: 7.49k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  871|  11.6k|        pu1_pred_ptr += pred_strd;
  872|  11.6k|        pi2_rsd_ptr += rsd_strd;
  873|  11.6k|        pu1_out += out_strd;
  874|       |
  875|  11.6k|        x = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  11.6k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  11.6k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 682, False: 10.9k]
  |  |  |  |  |  Branch (77:54): [True: 909, False: 10.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  876|  11.6k|        i4_nnz_L |= !!x;
  877|  11.6k|        x += *pu1_pred_ptr;
  878|  11.6k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  11.6k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  11.6k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 3.47k, False: 8.16k]
  |  |  |  |  |  Branch (77:54): [True: 659, False: 7.50k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  879|  11.6k|        pu1_pred_ptr += pred_strd;
  880|  11.6k|        pi2_rsd_ptr += rsd_strd;
  881|  11.6k|        pu1_out += out_strd;
  882|       |
  883|  11.6k|        x = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  11.6k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  11.6k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 661, False: 10.9k]
  |  |  |  |  |  Branch (77:54): [True: 776, False: 10.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  884|  11.6k|        i4_nnz_L |= !!x;
  885|  11.6k|        x += *pu1_pred_ptr;
  886|  11.6k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  11.6k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  11.6k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 3.60k, False: 8.03k]
  |  |  |  |  |  Branch (77:54): [True: 546, False: 7.48k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  887|  11.6k|        pu1_pred_ptr += pred_strd;
  888|  11.6k|        pi2_rsd_ptr += rsd_strd;
  889|  11.6k|        pu1_out += out_strd;
  890|       |
  891|  11.6k|        x = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  11.6k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  11.6k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 650, False: 10.9k]
  |  |  |  |  |  Branch (77:54): [True: 772, False: 10.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  892|  11.6k|        i4_nnz_L |= !!x;
  893|  11.6k|        x += *pu1_pred_ptr;
  894|  11.6k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  11.6k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  11.6k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 3.44k, False: 8.19k]
  |  |  |  |  |  Branch (77:54): [True: 552, False: 7.64k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  895|       |
  896|  11.6k|        pu1_out_ptr++;
  897|  11.6k|        pu1_pred++;
  898|  11.6k|        pi2_rsd++;
  899|  11.6k|        if(i == 3)
  ------------------
  |  Branch (899:12): [True: 1.45k, False: 10.1k]
  ------------------
  900|  1.45k|        {
  901|  1.45k|            i4_nnz = i4_nnz_H | (i4_nnz_L << 4);
  902|  1.45k|            i4_nnz_L = 0;
  903|  1.45k|            i4_nnz_H = 0;
  904|  1.45k|        }
  905|  11.6k|    }
  906|  1.45k|    i4_nnz |= (i4_nnz_H << 1) | (i4_nnz_L << 5);
  907|  1.45k|    return i4_nnz;
  908|  1.45k|}

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

isvcd_ref_lyr_part_idc:
  783|   140k|{
  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|   140k|    mode_motion_ctxt_t *ps_ctxt;
  799|   140k|    mode_motion_lyr_ctxt *ps_lyr_mem;
  800|   140k|    inter_lyr_mb_prms_t *ps_inter_lyr_mb_prms;
  801|   140k|    WORD32 i4_blk_y, i4_blk_x;
  802|   140k|    WORD32 i4_mb_x, i4_mb_y;
  803|   140k|    WORD32 i4_intra_mb_flag;
  804|   140k|    WORD32 i4_inter_lyr_mb_prms_stride;
  805|   140k|    dec_mb_info_t *ps_mb_params;
  806|       |
  807|   140k|    ps_mb_params = (dec_mb_info_t *) pv_mb_params;
  808|   140k|    ps_ctxt = (mode_motion_ctxt_t *) pv_comp_mode_mv_ctxt;
  809|       |
  810|       |    /* get the current layer ctxt */
  811|   140k|    ps_lyr_mem = &ps_ctxt->as_res_lyr_mem[ps_ctxt->i4_res_id];
  812|       |
  813|       |    /* ref layer mb mode */
  814|   140k|    ps_inter_lyr_mb_prms = (inter_lyr_mb_prms_t *) ps_lyr_mem->s_ref_mb_mode.pv_buffer;
  815|   140k|    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|   140k|    i4_mb_x = ps_mb_params->u2_mbx;
  819|   140k|    i4_mb_y = ps_mb_params->u2_mby;
  820|       |
  821|       |    /* set the intra MB flag to default TRUE */
  822|   140k|    i4_intra_mb_flag = SVCD_TRUE;
  ------------------
  |  |   46|   140k|#define SVCD_TRUE 1
  ------------------
  823|       |
  824|       |    /*-----------------------------------------------------------------------*/
  825|       |    /* derive the reference layer part idc for all 16 partitions             */
  826|       |    /*-----------------------------------------------------------------------*/
  827|   702k|    for(i4_blk_y = 0; i4_blk_y < NUM_SUB_MB_PARTS; i4_blk_y++)
  ------------------
  |  |   60|   702k|#define NUM_SUB_MB_PARTS 4
  ------------------
  |  Branch (827:23): [True: 562k, False: 140k]
  ------------------
  828|   562k|    {
  829|  2.81M|        for(i4_blk_x = 0; i4_blk_x < NUM_SUB_MB_PARTS; i4_blk_x++)
  ------------------
  |  |   60|  2.81M|#define NUM_SUB_MB_PARTS 4
  ------------------
  |  Branch (829:27): [True: 2.24M, False: 562k]
  ------------------
  830|  2.24M|        {
  831|  2.24M|            WORD32 i4_curr_x, i4_curr_y;
  832|  2.24M|            WORD32 i4_ref_x, i4_ref_y;
  833|  2.24M|            WORD32 i4_ref_mb_x, i4_ref_mb_y;
  834|  2.24M|            WORD8 i1_ref_mb_mode;
  835|  2.24M|            inter_lyr_mb_prms_t *ps_inter_lyr_mb_prms_temp;
  836|       |
  837|  2.24M|            i4_curr_x = (i4_mb_x << 4) + (i4_blk_x << 2) + 1;
  838|  2.24M|            i4_curr_y = (i4_mb_y << 4) + (i4_blk_y << 2) + 1;
  839|       |
  840|       |            /* get the colocated position in the refernce layer */
  841|  2.24M|            i4_ref_x = ps_lyr_mem->pi2_ref_loc_x[i4_curr_x];
  842|  2.24M|            i4_ref_y = ps_lyr_mem->pi2_ref_loc_y[i4_curr_y];
  843|       |
  844|  2.24M|            i4_ref_x = CLIP3(0, ((ps_lyr_mem->i4_ref_width) - 1), i4_ref_x);
  ------------------
  |  |   77|  2.24M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 0, False: 2.24M]
  |  |  |  Branch (77:54): [True: 0, False: 2.24M]
  |  |  ------------------
  ------------------
  845|       |
  846|  2.24M|            i4_ref_y = CLIP3(0, ((ps_lyr_mem->i4_ref_height) - 1), i4_ref_y);
  ------------------
  |  |   77|  2.24M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 0, False: 2.24M]
  |  |  |  Branch (77:54): [True: 0, False: 2.24M]
  |  |  ------------------
  ------------------
  847|       |
  848|       |            /* get the reference mb x and y */
  849|  2.24M|            i4_ref_mb_x = (i4_ref_x >> 4);
  850|  2.24M|            i4_ref_mb_y = (i4_ref_y >> 4);
  851|       |
  852|       |            /* get the appropriate mb params in reference layer */
  853|  2.24M|            ps_inter_lyr_mb_prms_temp = ps_inter_lyr_mb_prms + i4_ref_mb_x;
  854|  2.24M|            ps_inter_lyr_mb_prms_temp += i4_ref_mb_y * i4_inter_lyr_mb_prms_stride;
  855|       |
  856|  2.24M|            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.24M|            if(i1_ref_mb_mode > SVC_INTER_MB)
  ------------------
  |  |  114|  2.24M|#define SVC_INTER_MB (1 << 0)       /*!< Intra MBs other than IPCM and I_BL */
  ------------------
  |  Branch (859:16): [True: 280k, False: 1.96M]
  ------------------
  860|   280k|            {
  861|       |                /* store the -1 value */
  862|   280k|                ai4_ref_part_idc[i4_blk_y][i4_blk_x] = -1;
  863|   280k|            }
  864|  1.96M|            else
  865|  1.96M|            {
  866|       |                /* pack and store the reference x and y */
  867|  1.96M|                ai4_ref_part_idc[i4_blk_y][i4_blk_x] = (i4_ref_y << 16) + i4_ref_x;
  868|  1.96M|                i4_intra_mb_flag = SVCD_FALSE;
  ------------------
  |  |   45|  1.96M|#define SVCD_FALSE 0
  ------------------
  869|  1.96M|            }
  870|       |
  871|  2.24M|        } /* end of block x loop */
  872|       |
  873|   562k|    }     /* 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|   140k|    if(SVCD_FALSE == (ps_lyr_mem->ps_curr_lyr_res_prms->u1_rstrct_res_change_flag) &&
  ------------------
  |  |   45|   140k|#define SVCD_FALSE 0
  ------------------
  |  Branch (879:8): [True: 140k, False: 0]
  ------------------
  880|   140k|       (SVCD_FALSE == i4_intra_mb_flag))
  ------------------
  |  |   45|   140k|#define SVCD_FALSE 0
  ------------------
  |  Branch (880:8): [True: 130k, False: 9.58k]
  ------------------
  881|   130k|    {
  882|       |        /* replace values of "-1" on a 4x4 block basis */
  883|   130k|        WORD32 i4_xp, i4_yp;
  884|   130k|        WORD32 i4_indx_x, i4_indx_y;
  885|   130k|        WORD32 ai4_flag_8x8[2][2] = {SVCD_FALSE};
  ------------------
  |  |   45|   130k|#define SVCD_FALSE 0
  ------------------
  886|       |
  887|       |        /* loop over (4) 8x8 partitions */
  888|   392k|        for(i4_yp = 0; i4_yp < 2; i4_yp++)
  ------------------
  |  Branch (888:24): [True: 261k, False: 130k]
  ------------------
  889|   261k|        {
  890|   785k|            for(i4_xp = 0; i4_xp < 2; i4_xp++)
  ------------------
  |  Branch (890:28): [True: 523k, False: 261k]
  ------------------
  891|   523k|            {
  892|   523k|                WORD32 i4_xs, i4_ys;
  893|   523k|                WORD32 ai4_flag_4x4[2][2] = {SVCD_FALSE};
  ------------------
  |  |   45|   523k|#define SVCD_FALSE 0
  ------------------
  894|       |
  895|       |                /* loop over (4) 4x4 partitions */
  896|  1.57M|                for(i4_ys = 0; i4_ys < 2; i4_ys++)
  ------------------
  |  Branch (896:32): [True: 1.04M, False: 523k]
  ------------------
  897|  1.04M|                {
  898|  3.14M|                    for(i4_xs = 0; i4_xs < 2; i4_xs++)
  ------------------
  |  Branch (898:36): [True: 2.09M, False: 1.04M]
  ------------------
  899|  2.09M|                    {
  900|       |                        /* index to the exact 4x4 block */
  901|  2.09M|                        i4_indx_y = (i4_yp << 1) + i4_ys;
  902|  2.09M|                        i4_indx_x = (i4_xp << 1) + i4_xs;
  903|       |
  904|       |                        /* check if the current part idc is -1*/
  905|  2.09M|                        if(ai4_ref_part_idc[i4_indx_y][i4_indx_x] == -1)
  ------------------
  |  Branch (905:28): [True: 126k, False: 1.96M]
  ------------------
  906|   126k|                        {
  907|   126k|                            WORD32 i4_temp_x = 1 - i4_xs;
  908|   126k|                            WORD32 i4_temp_y = 1 - i4_ys;
  909|   126k|                            WORD32 i4_temp_part_y = (i4_yp << 1) + i4_temp_y;
  910|       |
  911|   126k|                            WORD32 i4_temp_part_x = (i4_xp << 1) + i4_temp_x;
  912|       |
  913|   126k|                            ai4_flag_4x4[i4_ys][i4_xs] = SVCD_TRUE;
  ------------------
  |  |   46|   126k|#define SVCD_TRUE 1
  ------------------
  914|       |
  915|       |                            /* replace with appropriate values */
  916|   126k|                            if((SVCD_FALSE == ai4_flag_4x4[i4_ys][i4_temp_x]) &&
  ------------------
  |  |   45|   126k|#define SVCD_FALSE 0
  ------------------
  |  Branch (916:32): [True: 63.4k, False: 63.4k]
  ------------------
  917|  63.4k|                               (ai4_ref_part_idc[i4_indx_y][i4_temp_part_x] != -1))
  ------------------
  |  Branch (917:32): [True: 0, False: 63.4k]
  ------------------
  918|      0|                            {
  919|      0|                                ai4_ref_part_idc[i4_indx_y][i4_indx_x] =
  920|      0|                                    ai4_ref_part_idc[i4_indx_y][i4_temp_part_x];
  921|      0|                            }
  922|   126k|                            else if((SVCD_FALSE == ai4_flag_4x4[i4_temp_y][i4_xs]) &&
  ------------------
  |  |   45|   126k|#define SVCD_FALSE 0
  ------------------
  |  Branch (922:37): [True: 63.4k, False: 63.4k]
  ------------------
  923|  63.4k|                                    (ai4_ref_part_idc[i4_temp_part_y][i4_indx_x] != -1))
  ------------------
  |  Branch (923:37): [True: 0, False: 63.4k]
  ------------------
  924|      0|                            {
  925|      0|                                ai4_ref_part_idc[i4_indx_y][i4_indx_x] =
  926|      0|                                    ai4_ref_part_idc[i4_temp_part_y][i4_indx_x];
  927|      0|                            }
  928|   126k|                            else if((SVCD_FALSE == ai4_flag_4x4[i4_temp_y][i4_temp_x]) &&
  ------------------
  |  |   45|   126k|#define SVCD_FALSE 0
  ------------------
  |  Branch (928:37): [True: 63.4k, False: 63.4k]
  ------------------
  929|  63.4k|                                    (ai4_ref_part_idc[i4_temp_part_y][i4_temp_part_x] != -1))
  ------------------
  |  Branch (929:37): [True: 0, False: 63.4k]
  ------------------
  930|      0|                            {
  931|      0|                                ai4_ref_part_idc[i4_indx_y][i4_indx_x] =
  932|      0|                                    ai4_ref_part_idc[i4_temp_part_y][i4_temp_part_x];
  933|      0|                            }
  934|   126k|                        } /* end of part idc equal to -1 check */
  935|       |
  936|  2.09M|                    }     /* end of sub partition xs loop */
  937|       |
  938|  1.04M|                }         /* end of sub partition ys loop */
  939|       |
  940|   523k|            }             /* end of partition xp loop */
  941|       |
  942|   261k|        }                 /* end of partition yp loop */
  943|       |
  944|       |        /* replace values of "-1" on an 8x8 block basis */
  945|       |
  946|       |        /* loop over (4) 8x8 partitions */
  947|   392k|        for(i4_yp = 0; i4_yp < 2; i4_yp++)
  ------------------
  |  Branch (947:24): [True: 261k, False: 130k]
  ------------------
  948|   261k|        {
  949|   785k|            for(i4_xp = 0; i4_xp < 2; i4_xp++)
  ------------------
  |  Branch (949:28): [True: 523k, False: 261k]
  ------------------
  950|   523k|            {
  951|   523k|                WORD32 i4_yp_inv = 1 - i4_yp;
  952|   523k|                WORD32 i4_xp_inv = 1 - i4_xp;
  953|   523k|                WORD32 i4_xo_inv = (2 - i4_xp);
  954|   523k|                WORD32 i4_yo_inv = (2 - i4_yp);
  955|   523k|                i4_indx_x = (i4_xp << 1);
  956|   523k|                i4_indx_y = (i4_yp << 1);
  957|       |
  958|       |                /* check if the current part idc is -1*/
  959|   523k|                if(ai4_ref_part_idc[i4_indx_y][i4_indx_x] == -1)
  ------------------
  |  Branch (959:20): [True: 31.7k, False: 492k]
  ------------------
  960|  31.7k|                {
  961|  31.7k|                    ai4_flag_8x8[i4_yp][i4_xp] = SVCD_TRUE;
  ------------------
  |  |   46|  31.7k|#define SVCD_TRUE 1
  ------------------
  962|       |
  963|       |                    /* replace the -1 with appropriate values */
  964|  31.7k|                    if(SVCD_FALSE == ai4_flag_8x8[i4_yp][i4_xp_inv] &&
  ------------------
  |  |   45|  31.7k|#define SVCD_FALSE 0
  ------------------
  |  Branch (964:24): [True: 24.4k, False: 7.27k]
  ------------------
  965|  24.4k|                       ai4_ref_part_idc[i4_indx_y][i4_xo_inv] != -1)
  ------------------
  |  Branch (965:24): [True: 17.1k, False: 7.27k]
  ------------------
  966|  17.1k|                    {
  967|  17.1k|                        ai4_ref_part_idc[i4_indx_y][i4_indx_x] =
  968|  17.1k|                            ai4_ref_part_idc[i4_indx_y][i4_xo_inv];
  969|       |
  970|  17.1k|                        ai4_ref_part_idc[i4_indx_y + 1][i4_indx_x] =
  971|  17.1k|                            ai4_ref_part_idc[i4_indx_y + 1][i4_xo_inv];
  972|       |
  973|  17.1k|                        ai4_ref_part_idc[i4_indx_y][i4_indx_x + 1] =
  974|  17.1k|                            ai4_ref_part_idc[i4_indx_y][i4_xo_inv];
  975|       |
  976|  17.1k|                        ai4_ref_part_idc[i4_indx_y + 1][i4_indx_x + 1] =
  977|  17.1k|                            ai4_ref_part_idc[i4_indx_y + 1][i4_xo_inv];
  978|  17.1k|                    }
  979|  14.5k|                    else if(SVCD_FALSE == ai4_flag_8x8[i4_yp_inv][i4_xp] &&
  ------------------
  |  |   45|  14.5k|#define SVCD_FALSE 0
  ------------------
  |  Branch (979:29): [True: 14.2k, False: 313]
  ------------------
  980|  14.2k|                            ai4_ref_part_idc[i4_yo_inv][i4_indx_x] != -1)
  ------------------
  |  Branch (980:29): [True: 13.9k, False: 296]
  ------------------
  981|  13.9k|                    {
  982|  13.9k|                        ai4_ref_part_idc[i4_indx_y][i4_indx_x] =
  983|  13.9k|                            ai4_ref_part_idc[i4_yo_inv][i4_indx_x];
  984|       |
  985|  13.9k|                        ai4_ref_part_idc[i4_indx_y + 1][i4_indx_x] =
  986|  13.9k|                            ai4_ref_part_idc[i4_yo_inv][i4_indx_x];
  987|       |
  988|  13.9k|                        ai4_ref_part_idc[i4_indx_y][i4_indx_x + 1] =
  989|  13.9k|                            ai4_ref_part_idc[i4_yo_inv][i4_indx_x + 1];
  990|       |
  991|  13.9k|                        ai4_ref_part_idc[i4_indx_y + 1][i4_indx_x + 1] =
  992|  13.9k|                            ai4_ref_part_idc[i4_yo_inv][i4_indx_x + 1];
  993|  13.9k|                    }
  994|    609|                    else if(SVCD_FALSE == ai4_flag_8x8[i4_yp_inv][i4_xp_inv] &&
  ------------------
  |  |   45|    609|#define SVCD_FALSE 0
  ------------------
  |  Branch (994:29): [True: 609, False: 0]
  ------------------
  995|    609|                            ai4_ref_part_idc[i4_yo_inv][i4_xo_inv] != -1)
  ------------------
  |  Branch (995:29): [True: 609, False: 0]
  ------------------
  996|    609|                    {
  997|    609|                        ai4_ref_part_idc[i4_indx_y][i4_indx_x] =
  998|    609|                            ai4_ref_part_idc[i4_yo_inv][i4_xo_inv];
  999|       |
 1000|    609|                        ai4_ref_part_idc[i4_indx_y + 1][i4_indx_x] =
 1001|    609|                            ai4_ref_part_idc[i4_yo_inv][i4_xo_inv];
 1002|       |
 1003|    609|                        ai4_ref_part_idc[i4_indx_y][i4_indx_x + 1] =
 1004|    609|                            ai4_ref_part_idc[i4_yo_inv][i4_xo_inv];
 1005|       |
 1006|    609|                        ai4_ref_part_idc[i4_indx_y + 1][i4_indx_x + 1] =
 1007|    609|                            ai4_ref_part_idc[i4_yo_inv][i4_xo_inv];
 1008|    609|                    }
 1009|  31.7k|                } /* end of part idc equal to -1 check */
 1010|       |
 1011|   523k|            }     /* end of partition xp loop */
 1012|       |
 1013|   261k|        }         /* end of partition yp loop */
 1014|       |
 1015|   130k|    }             /* end of refinement of part idc for non dyadic case*/
 1016|       |
 1017|       |    /* store the intra flag in the location provided */
 1018|   140k|    *pi4_intra_flag = i4_intra_mb_flag;
 1019|       |
 1020|   140k|    return;
 1021|   140k|}
isvcd_check_motion:
 1049|   577k|{
 1050|   577k|    mv_pred_t *ps_part_a;
 1051|   577k|    mv_pred_t *ps_part_b;
 1052|   577k|    WORD32 i4_cntr;
 1053|   577k|    WORD32 i4_mv_treshold;
 1054|   577k|    WORD32 i4_flag = 0;
 1055|       |
 1056|   577k|    ps_part_a = (mv_pred_t *) pv_motion_prm_mb_part_a;
 1057|   577k|    ps_part_b = (mv_pred_t *) pv_motion_prm_mb_part_b;
 1058|       |
 1059|  1.22M|    for(i4_cntr = 0; i4_cntr < i4_listx; i4_cntr++)
  ------------------
  |  Branch (1059:22): [True: 692k, False: 527k]
  ------------------
 1060|   692k|    {
 1061|       |        /* calculate the absolute diff of both components */
 1062|   692k|        i4_mv_treshold = ABS((ps_part_a->i2_mv[2 * i4_cntr]) - (ps_part_b->i2_mv[2 * i4_cntr]));
  ------------------
  |  |  100|   692k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 18.7k, False: 674k]
  |  |  ------------------
  ------------------
 1063|   692k|        i4_mv_treshold +=
 1064|   692k|            ABS((ps_part_a->i2_mv[1 + 2 * i4_cntr]) - (ps_part_b->i2_mv[1 + 2 * i4_cntr]));
  ------------------
  |  |  100|   692k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 17.8k, False: 675k]
  |  |  ------------------
  ------------------
 1065|       |
 1066|   692k|        if((0 == i4_mv_treshold) &&
  ------------------
  |  Branch (1066:12): [True: 651k, False: 41.3k]
  ------------------
 1067|   651k|           (ps_part_a->i1_ref_frame[i4_cntr] == ps_part_b->i1_ref_frame[i4_cntr]))
  ------------------
  |  Branch (1067:12): [True: 642k, False: 8.98k]
  ------------------
 1068|   642k|        {
 1069|   642k|            i4_flag = 1;
 1070|   642k|        }
 1071|  50.3k|        else
 1072|  50.3k|        {
 1073|  50.3k|            i4_flag = 0;
 1074|  50.3k|            return (i4_flag);
 1075|  50.3k|        }
 1076|       |
 1077|   692k|    } /* end of loop over lists */
 1078|       |
 1079|   527k|    return (i4_flag);
 1080|   577k|}
isvcd_get_min_positive:
 1104|  2.49M|{
 1105|  2.49M|    UWORD32 u4_x, u4_y;
 1106|  2.49M|    WORD32 i4_min_positive;
 1107|       |
 1108|       |    /* get positive values */
 1109|  2.49M|    u4_x = (UWORD32) i4_input_1;
 1110|  2.49M|    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.49M|    if((u4_y < u4_x) && (0 <= i4_input_2))
  ------------------
  |  Branch (1127:8): [True: 4.92k, False: 2.49M]
  |  Branch (1127:25): [True: 4.92k, False: 0]
  ------------------
 1128|  4.92k|    {
 1129|  4.92k|        i4_min_positive = i4_input_2;
 1130|  4.92k|    }
 1131|  2.49M|    else
 1132|  2.49M|    {
 1133|  2.49M|        i4_min_positive = i4_input_1;
 1134|  2.49M|    }
 1135|  2.49M|    return (i4_min_positive);
 1136|  2.49M|}
isvcd_interlyr_motion_scale:
 1286|  2.30M|{
 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.30M|    mode_motion_ctxt_t *ps_ctxt;
 1294|  2.30M|    mode_motion_lyr_ctxt *ps_lyr_mem;
 1295|  2.30M|    mv_pred_t *ps_motion_pred;
 1296|  2.30M|    mv_pred_t *ps_ref_mv;
 1297|  2.30M|    WORD32 i4_lists;
 1298|  2.30M|    WORD32 i4_ref_16x16_flag = 0;
 1299|  2.30M|    WORD32 i4_scale_x, i4_scale_y;
 1300|  2.30M|    WORD16 i2_max_mv_x, i2_max_mv_y;
 1301|       |
 1302|  2.30M|    ps_ctxt = (mode_motion_ctxt_t *) pv_comp_mode_mv_ctxt;
 1303|       |
 1304|       |    /* get the current layer ctxt */
 1305|  2.30M|    ps_lyr_mem = &ps_ctxt->as_res_lyr_mem[ps_ctxt->i4_res_id];
 1306|       |
 1307|       |    /* ----------- Get the reference layer MV structure ---------- */
 1308|  2.30M|    {
 1309|  2.30M|        mv_pred_t *ps_ref_lyr_motion_prms;
 1310|  2.30M|        WORD32 i4_ref_x, i4_ref_y;
 1311|  2.30M|        WORD32 i4_ref_mb_x, i4_ref_mb_y;
 1312|  2.30M|        WORD32 i4_ref_width;
 1313|       |
 1314|  2.30M|        ps_ref_lyr_motion_prms = (mv_pred_t *) ps_lyr_mem->pv_ref_mv_bank_l0;
 1315|  2.30M|        i4_ref_width = ps_lyr_mem->i4_ref_width;
 1316|  2.30M|        i2_max_mv_x = i4_ref_width << 2;
 1317|  2.30M|        i2_max_mv_y = ps_lyr_mem->i4_ref_height << 2;
 1318|       |
 1319|       |        /* extract the reference x and y positions */
 1320|  2.30M|        i4_ref_x = (*pi4_ref_part_idc) & 0xFFFF;
 1321|  2.30M|        i4_ref_y = (*pi4_ref_part_idc) >> 16;
 1322|       |
 1323|       |        /* get the reference mb x and y */
 1324|  2.30M|        i4_ref_mb_x = (i4_ref_x >> 4);
 1325|  2.30M|        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.30M|        ps_ref_mv = ps_ref_lyr_motion_prms + (i4_ref_mb_x << 4);
 1330|  2.30M|        ps_ref_mv += (i4_ref_mb_y * i4_ref_width);
 1331|       |
 1332|       |        /* if reference layer mb type is non 16x16 */
 1333|  2.30M|        if(0 == i4_ref_16x16_flag)
  ------------------
  |  Branch (1333:12): [True: 2.30M, False: 0]
  ------------------
 1334|  2.30M|        {
 1335|       |            /* increment the pointer to appropaite 4x4 */
 1336|  2.30M|            ps_ref_mv += ((i4_ref_x >> 2) & 0x03);
 1337|  2.30M|            ps_ref_mv += (((i4_ref_y >> 2) & 0x03) << 2);
 1338|  2.30M|        }
 1339|  2.30M|    }
 1340|       |
 1341|       |    /* motion pred structure */
 1342|  2.30M|    ps_motion_pred = pv_motion_pred;
 1343|       |
 1344|       |    /* retrive the scale factors */
 1345|  2.30M|    i4_scale_x = ps_lyr_mem->i4_scale_mv_x;
 1346|  2.30M|    i4_scale_y = ps_lyr_mem->i4_scale_mv_y;
 1347|       |
 1348|       |    /* loop on the lists given as input */
 1349|  5.09M|    for(i4_lists = 0; i4_lists < i4_listx; i4_lists++)
  ------------------
  |  Branch (1349:23): [True: 2.79M, False: 2.30M]
  ------------------
 1350|  2.79M|    {
 1351|  2.79M|        WORD32 i4_mv_x, i4_mv_y;
 1352|  2.79M|        WORD16 i2_mv_x, i2_mv_y;
 1353|       |
 1354|       |        /* if the refernce index is -1 set the default values */
 1355|  2.79M|        if(-1 == ps_ref_mv->i1_ref_frame[i4_lists])
  ------------------
  |  Branch (1355:12): [True: 311k, False: 2.48M]
  ------------------
 1356|   311k|        {
 1357|   311k|            ps_motion_pred->i1_ref_frame[i4_lists] = -1;
 1358|   311k|            ps_motion_pred->i2_mv[2 * i4_lists] = 0;
 1359|   311k|            ps_motion_pred->i2_mv[1 + 2 * i4_lists] = 0;
 1360|   311k|        }
 1361|  2.48M|        else
 1362|  2.48M|        {
 1363|       |            /* field MB and field pictures modification are present */
 1364|       |            /* currently not implemented */
 1365|  2.48M|            ps_motion_pred->i1_ref_frame[i4_lists] = ps_ref_mv->i1_ref_frame[i4_lists];
 1366|       |
 1367|  2.48M|            i2_mv_x = ps_ref_mv->i2_mv[2 * i4_lists];
 1368|  2.48M|            i2_mv_y = ps_ref_mv->i2_mv[1 + 2 * i4_lists];
 1369|  2.48M|            i2_mv_x = CLIP3(-i2_max_mv_x, i2_max_mv_x, i2_mv_x);
  ------------------
  |  |   77|  2.48M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 1.85k, False: 2.48M]
  |  |  |  Branch (77:54): [True: 1.10k, False: 2.47M]
  |  |  ------------------
  ------------------
 1370|  2.48M|            i2_mv_y = CLIP3(-i2_max_mv_y, i2_max_mv_y, i2_mv_y);
  ------------------
  |  |   77|  2.48M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 1.32k, False: 2.48M]
  |  |  |  Branch (77:54): [True: 1.19k, False: 2.47M]
  |  |  ------------------
  ------------------
 1371|       |            /* scale the motion vectors */
 1372|  2.48M|            i4_mv_x = (i2_mv_x * i4_scale_x + 32768) >> 16;
 1373|  2.48M|            i4_mv_y = (i2_mv_y * i4_scale_y + 32768) >> 16;
 1374|       |
 1375|       |            /* store the final motion vectors */
 1376|  2.48M|            ps_motion_pred->i2_mv[2 * i4_lists] = i4_mv_x;
 1377|  2.48M|            ps_motion_pred->i2_mv[1 + 2 * i4_lists] = i4_mv_y;
 1378|       |
 1379|       |            /* if cropping change flag is present */
 1380|  2.48M|            if(SVCD_TRUE == ps_lyr_mem->ps_curr_lyr_res_prms->u1_cropping_change_flag)
  ------------------
  |  |   46|  2.48M|#define SVCD_TRUE 1
  ------------------
  |  Branch (1380:16): [True: 0, False: 2.48M]
  ------------------
 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.48M|        }
 1388|  2.79M|    } /* end of lists loop */
 1389|       |
 1390|  2.30M|    return (i4_ref_16x16_flag);
 1391|  2.30M|}
isvcd_store_motion_map:
 1425|   205k|{
 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|   205k|    WORD32 i4_i, i4_j;
 1432|   205k|    mv_pred_t *ps_mv_pred_src;
 1433|   205k|    mv_pred_t *ps_mv_map_dst;
 1434|       |
 1435|   205k|    ps_mv_pred_src = (mv_pred_t *) pv_motion_pred;
 1436|   205k|    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|   615k|    for(i4_i = 0; i4_i < i4_part_height; i4_i++)
  ------------------
  |  Branch (1439:19): [True: 410k, False: 205k]
  ------------------
 1440|   410k|    {
 1441|  1.23M|        for(i4_j = 0; i4_j < i4_part_width; i4_j++)
  ------------------
  |  Branch (1441:23): [True: 820k, False: 410k]
  ------------------
 1442|   820k|        {
 1443|       |            /* copy form source to destination */
 1444|   820k|            *(ps_mv_map_dst + i4_j) = *(ps_mv_pred_src + (i4_src_update_flag * i4_j));
 1445|       |
 1446|   820k|        } /* end of loop over partition width */
 1447|       |
 1448|   410k|        ps_mv_map_dst += i4_dst_stride;
 1449|   410k|        ps_mv_pred_src += (i4_src_stride * i4_src_update_flag);
 1450|       |
 1451|   410k|    } /* end of loop over partition height */
 1452|   205k|    return;
 1453|   205k|}
isvcd_check_mv_diff:
 1482|  2.61M|{
 1483|  2.61M|    mv_pred_t *ps_part_a;
 1484|  2.61M|    mv_pred_t *ps_part_b;
 1485|  2.61M|    WORD32 i4_cntr;
 1486|  2.61M|    WORD32 i4_mv_treshold;
 1487|  2.61M|    WORD32 i4_flag;
 1488|       |
 1489|  2.61M|    ps_part_a = (mv_pred_t *) pv_motion_prm_a;
 1490|  2.61M|    ps_part_b = (mv_pred_t *) pv_motion_prm_b;
 1491|       |
 1492|  2.61M|    i4_flag = 1;
 1493|  5.69M|    for(i4_cntr = 0; i4_cntr < i4_listx; i4_cntr++)
  ------------------
  |  Branch (1493:22): [True: 3.11M, False: 2.57M]
  ------------------
 1494|  3.11M|    {
 1495|       |        /* calculate the absolute diff of both components */
 1496|  3.11M|        i4_mv_treshold = ABS((ps_part_a->i2_mv[2 * i4_cntr]) - (ps_part_b->i2_mv[2 * i4_cntr]));
  ------------------
  |  |  100|  3.11M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 23.3k, False: 3.09M]
  |  |  ------------------
  ------------------
 1497|  3.11M|        i4_mv_treshold +=
 1498|  3.11M|            ABS((ps_part_a->i2_mv[1 + (2 * i4_cntr)]) - (ps_part_b->i2_mv[1 + (2 * i4_cntr)]));
  ------------------
  |  |  100|  3.11M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 28.0k, False: 3.09M]
  |  |  ------------------
  ------------------
 1499|       |
 1500|  3.11M|        if(i4_actual_threshold < i4_mv_treshold)
  ------------------
  |  Branch (1500:12): [True: 45.6k, False: 3.07M]
  ------------------
 1501|  45.6k|        {
 1502|  45.6k|            i4_flag = 0;
 1503|  45.6k|            break;
 1504|  45.6k|        }
 1505|       |
 1506|  3.11M|    } /* end of loop over lists */
 1507|  2.61M|    return (i4_flag);
 1508|  2.61M|}
isvcd_interlyr_motion_submbmode_pred:
 1541|   130k|{
 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|   130k|    mode_motion_ctxt_t *ps_ctxt;
 1558|   130k|    mode_motion_lyr_ctxt *ps_lyr_mem;
 1559|   130k|    mv_pred_t *ps_motion_pred;
 1560|   130k|    dec_mb_info_t *ps_mb_params;
 1561|   130k|    dec_svc_mb_info_t *ps_svc_mb_params;
 1562|   130k|    WORD32 i4_blk_y, i4_blk_x;
 1563|   130k|    WORD32 i4_i;
 1564|   130k|    WORD32 i4_listx;
 1565|   130k|    WORD32 i4_mv_treshold;
 1566|   130k|    WORD32 ai4_temp_ref_indx[NUM_REF_LISTS][NUM_MB_PARTS] = {0};
 1567|   130k|    WORD32 i4_mb_x, i4_mb_y;
 1568|   130k|    WORD32 i4_mb_pic_x, i4_mb_pic_y;
 1569|   130k|    dec_struct_t *ps_dec;
 1570|       |
 1571|   130k|    ps_dec = (dec_struct_t *) pv_dec;
 1572|   130k|    ps_ctxt = (mode_motion_ctxt_t *) pv_comp_mode_mv_ctxt;
 1573|       |
 1574|       |    /* get the current layer ctxt */
 1575|   130k|    ps_lyr_mem = &ps_ctxt->as_res_lyr_mem[ps_ctxt->i4_res_id];
 1576|       |
 1577|   130k|    ps_mb_params = (dec_mb_info_t *) pv_mb_params;
 1578|   130k|    ps_svc_mb_params = (dec_svc_mb_info_t *) pv_svc_mb_params;
 1579|   130k|    ps_motion_pred = ps_ctxt->ps_motion_pred_struct;
 1580|       |
 1581|   130k|    i4_listx = ps_ctxt->i4_listx;
 1582|       |
 1583|       |    /* derive the MB_X and MB_Y for the current MB */
 1584|   130k|    i4_mb_x = ps_mb_params->u2_mbx;
 1585|   130k|    i4_mb_y = ps_mb_params->u2_mby;
 1586|       |
 1587|       |    /* convert into picture units */
 1588|   130k|    i4_mb_pic_x = i4_mb_x << 4;
 1589|   130k|    i4_mb_pic_y = i4_mb_y << 4;
 1590|       |
 1591|       |    /* compute the motion vectors and reference indices of all part */
 1592|   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 (1592:23): [True: 523k, False: 130k]
  ------------------
 1593|   523k|    {
 1594|  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 (1594:27): [True: 2.09M, False: 523k]
  ------------------
 1595|  2.09M|        {
 1596|  2.09M|            isvcd_interlyr_motion_scale(pv_comp_mode_mv_ctxt, &ai4_ref_part_idc[i4_blk_y][i4_blk_x],
 1597|  2.09M|                                        ps_mb_params, (ps_motion_pred + (4 * i4_blk_y) + i4_blk_x),
 1598|  2.09M|                                        i4_listx, (i4_mb_pic_x + (i4_blk_x << 2) + 1),
 1599|  2.09M|                                        (i4_mb_pic_y + (i4_blk_y << 2) + 1),
 1600|  2.09M|                                        ps_dec->ppv_map_ref_idx_to_poc);
 1601|       |
 1602|  2.09M|        } /* end of blk x loop */
 1603|   523k|    }     /* end of blk y loop */
 1604|       |
 1605|       |    /********************************************************/
 1606|       |    /* get the final reference index into a temparory array */
 1607|       |    /********************************************************/
 1608|       |
 1609|       |    /* set reference indices */
 1610|   287k|    for(i4_i = 0; i4_i < i4_listx; i4_i++)
  ------------------
  |  Branch (1610:19): [True: 156k, False: 130k]
  ------------------
 1611|   156k|    {
 1612|   156k|        ai4_temp_ref_indx[i4_i][0] = ps_motion_pred[0].i1_ref_frame[i4_i];
 1613|   156k|        ai4_temp_ref_indx[i4_i][1] = ps_motion_pred[2].i1_ref_frame[i4_i];
 1614|   156k|        ai4_temp_ref_indx[i4_i][2] = ps_motion_pred[8].i1_ref_frame[i4_i];
 1615|   156k|        ai4_temp_ref_indx[i4_i][3] = ps_motion_pred[10].i1_ref_frame[i4_i];
 1616|       |
 1617|   156k|    } /* end of loop over lists */
 1618|       |
 1619|       |    /* if restricted spatial resolution change is not set */
 1620|   130k|    if(SVCD_FALSE == ps_lyr_mem->ps_curr_lyr_res_prms->u1_rstrct_res_change_flag)
  ------------------
  |  |   45|   130k|#define SVCD_FALSE 0
  ------------------
  |  Branch (1620:8): [True: 130k, False: 0]
  ------------------
 1621|   130k|    {
 1622|   130k|        WORD32 i4_xp, i4_yp;
 1623|   130k|        WORD32 i4_xs, i4_ys;
 1624|       |
 1625|       |        /* merge reference indices and modify the motion vectors */
 1626|   287k|        for(i4_i = 0; i4_i < i4_listx; i4_i++)
  ------------------
  |  Branch (1626:23): [True: 156k, False: 130k]
  ------------------
 1627|   156k|        {
 1628|   468k|            for(i4_yp = 0; i4_yp < 2; i4_yp++)
  ------------------
  |  Branch (1628:28): [True: 312k, False: 156k]
  ------------------
 1629|   312k|            {
 1630|   936k|                for(i4_xp = 0; i4_xp < 2; i4_xp++)
  ------------------
  |  Branch (1630:32): [True: 624k, False: 312k]
  ------------------
 1631|   624k|                {
 1632|       |                    /* get the minimum positive of the refernce index */
 1633|  1.87M|                    for(i4_ys = 0; i4_ys < 2; i4_ys++)
  ------------------
  |  Branch (1633:36): [True: 1.24M, False: 624k]
  ------------------
 1634|  1.24M|                    {
 1635|  3.74M|                        for(i4_xs = 0; i4_xs < 2; i4_xs++)
  ------------------
  |  Branch (1635:40): [True: 2.49M, False: 1.24M]
  ------------------
 1636|  2.49M|                        {
 1637|  2.49M|                            mv_pred_t *ps_temp;
 1638|  2.49M|                            ps_temp = ps_motion_pred + (i4_xp << 1) + i4_xs;
 1639|  2.49M|                            ps_temp += 4 * ((i4_yp << 1) + i4_ys);
 1640|       |
 1641|       |                            /* get the minimum positive */
 1642|  2.49M|                            ai4_temp_ref_indx[i4_i][2 * i4_yp + i4_xp] =
 1643|  2.49M|                                isvcd_get_min_positive(ai4_temp_ref_indx[i4_i][2 * i4_yp + i4_xp],
 1644|  2.49M|                                                       ps_temp->i1_ref_frame[i4_i]);
 1645|  2.49M|                        }
 1646|  1.24M|                    }
 1647|       |                    /* update motion vectors */
 1648|  1.87M|                    for(i4_ys = 0; i4_ys < 2; i4_ys++)
  ------------------
  |  Branch (1648:36): [True: 1.24M, False: 624k]
  ------------------
 1649|  1.24M|                    {
 1650|  3.74M|                        for(i4_xs = 0; i4_xs < 2; i4_xs++)
  ------------------
  |  Branch (1650:40): [True: 2.49M, False: 1.24M]
  ------------------
 1651|  2.49M|                        {
 1652|  2.49M|                            mv_pred_t *ps_temp;
 1653|  2.49M|                            ps_temp = ps_motion_pred + (i4_xp << 1) + i4_xs;
 1654|  2.49M|                            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.49M|                            if(ai4_temp_ref_indx[i4_i][2 * i4_yp + i4_xp] !=
  ------------------
  |  Branch (1659:32): [True: 13.7k, False: 2.48M]
  ------------------
 1660|  2.49M|                               ps_temp->i1_ref_frame[i4_i])
 1661|  13.7k|                            {
 1662|  13.7k|                                mv_pred_t *ps_temp_1;
 1663|  13.7k|                                WORD32 i4_updated_flag = SVCD_FALSE;
  ------------------
  |  |   45|  13.7k|#define SVCD_FALSE 0
  ------------------
 1664|       |
 1665|  13.7k|                                ps_temp_1 = ps_motion_pred + (i4_xp << 1) + (1 - i4_xs);
 1666|  13.7k|                                ps_temp_1 += 4 * ((i4_yp << 1) + i4_ys);
 1667|       |
 1668|       |                                /* store the appropriate neighbours */
 1669|  13.7k|                                if(ai4_temp_ref_indx[i4_i][2 * i4_yp + i4_xp] ==
  ------------------
  |  Branch (1669:36): [True: 4.88k, False: 8.84k]
  ------------------
 1670|  13.7k|                                   ps_temp_1->i1_ref_frame[i4_i])
 1671|  4.88k|                                {
 1672|  4.88k|                                    ps_temp->i2_mv[2 * i4_i] = ps_temp_1->i2_mv[2 * i4_i];
 1673|       |
 1674|  4.88k|                                    ps_temp->i2_mv[1 + (2 * i4_i)] =
 1675|  4.88k|                                        ps_temp_1->i2_mv[1 + (2 * i4_i)];
 1676|  4.88k|                                    i4_updated_flag = SVCD_TRUE;
  ------------------
  |  |   46|  4.88k|#define SVCD_TRUE 1
  ------------------
 1677|  4.88k|                                }
 1678|       |
 1679|  13.7k|                                if(SVCD_FALSE == i4_updated_flag)
  ------------------
  |  |   45|  13.7k|#define SVCD_FALSE 0
  ------------------
  |  Branch (1679:36): [True: 8.84k, False: 4.88k]
  ------------------
 1680|  8.84k|                                {
 1681|  8.84k|                                    ps_temp_1 = ps_motion_pred + (i4_xp << 1) + i4_xs;
 1682|       |
 1683|  8.84k|                                    ps_temp_1 += 4 * ((i4_yp << 1) + 1 - i4_ys);
 1684|       |
 1685|  8.84k|                                    if(ai4_temp_ref_indx[i4_i][2 * i4_yp + i4_xp] ==
  ------------------
  |  Branch (1685:40): [True: 8.54k, False: 304]
  ------------------
 1686|  8.84k|                                       ps_temp_1->i1_ref_frame[i4_i])
 1687|  8.54k|                                    {
 1688|  8.54k|                                        ps_temp->i2_mv[2 * i4_i] = ps_temp_1->i2_mv[2 * i4_i];
 1689|       |
 1690|  8.54k|                                        ps_temp->i2_mv[1 + (2 * i4_i)] =
 1691|  8.54k|                                            ps_temp_1->i2_mv[1 + (2 * i4_i)];
 1692|  8.54k|                                        i4_updated_flag = SVCD_TRUE;
  ------------------
  |  |   46|  8.54k|#define SVCD_TRUE 1
  ------------------
 1693|  8.54k|                                    }
 1694|  8.84k|                                }
 1695|  13.7k|                                if(SVCD_FALSE == i4_updated_flag)
  ------------------
  |  |   45|  13.7k|#define SVCD_FALSE 0
  ------------------
  |  Branch (1695:36): [True: 304, False: 13.4k]
  ------------------
 1696|    304|                                {
 1697|    304|                                    ps_temp_1 = ps_motion_pred + (i4_xp << 1) + (1 - i4_xs);
 1698|    304|                                    ps_temp_1 += 4 * ((i4_yp << 1) + 1 - i4_ys);
 1699|       |
 1700|    304|                                    ps_temp->i2_mv[2 * i4_i] = ps_temp_1->i2_mv[2 * i4_i];
 1701|       |
 1702|    304|                                    ps_temp->i2_mv[1 + (2 * i4_i)] =
 1703|    304|                                        ps_temp_1->i2_mv[1 + (2 * i4_i)];
 1704|       |
 1705|    304|                                    i4_updated_flag = SVCD_TRUE;
  ------------------
  |  |   46|    304|#define SVCD_TRUE 1
  ------------------
 1706|    304|                                }
 1707|  13.7k|                            } /* end of replacement of mv based on ref indx */
 1708|  2.49M|                        }     /* end of loop over sub partition xs */
 1709|  1.24M|                    }         /* end of loop over sub partition ys */
 1710|   624k|                }             /* end of loop over partition xp */
 1711|   312k|            }                 /* end of loop over partition yp */
 1712|   156k|        }                     /* end of loop over lists */
 1713|   130k|    }
 1714|       |
 1715|       |    /************************************************************************/
 1716|       |    /* if restircted saptial resolution change flag is 0                    */
 1717|       |    /* modify the reference indixes and motion vectors                      */
 1718|       |    /************************************************************************/
 1719|   130k|    if((SVCD_FALSE == ps_lyr_mem->ps_curr_lyr_res_prms->u1_rstrct_res_change_flag) &&
  ------------------
  |  |   45|   130k|#define SVCD_FALSE 0
  ------------------
  |  Branch (1719:8): [True: 130k, False: 0]
  ------------------
 1720|   130k|       (2 == i4_listx) && (SVCD_TRUE == ps_ctxt->u1_direct_8x8_inference_flag))
  ------------------
  |  |   46|  25.1k|#define SVCD_TRUE 1
  ------------------
  |  Branch (1720:8): [True: 25.1k, False: 105k]
  |  Branch (1720:27): [True: 5.59k, False: 19.5k]
  ------------------
 1721|  5.59k|    {
 1722|       |        /* only applicable for EB Slice */
 1723|       |        /* store the corner 4x4 motion vectors to the whole block */
 1724|       |        /* 2 lists and 4 partitions */
 1725|  5.59k|        mot_vec_t s_temp_mv[2][4];
 1726|  5.59k|        WORD32 i4_xp, i4_yp;
 1727|  5.59k|        memset(&s_temp_mv[0][0], 0, sizeof(s_temp_mv));
 1728|       |
 1729|  16.7k|        for(i4_i = 0; i4_i < i4_listx; i4_i++)
  ------------------
  |  Branch (1729:23): [True: 11.1k, False: 5.59k]
  ------------------
 1730|  11.1k|        {
 1731|  11.1k|            s_temp_mv[i4_i][0].i2_mv_x = ps_motion_pred[0].i2_mv[2 * i4_i];
 1732|  11.1k|            s_temp_mv[i4_i][0].i2_mv_y = ps_motion_pred[0].i2_mv[1 + (2 * i4_i)];
 1733|       |
 1734|  11.1k|            s_temp_mv[i4_i][1].i2_mv_x = ps_motion_pred[3].i2_mv[2 * i4_i];
 1735|  11.1k|            s_temp_mv[i4_i][1].i2_mv_y = ps_motion_pred[3].i2_mv[1 + (2 * i4_i)];
 1736|       |
 1737|  11.1k|            s_temp_mv[i4_i][2].i2_mv_x = ps_motion_pred[12].i2_mv[2 * i4_i];
 1738|  11.1k|            s_temp_mv[i4_i][2].i2_mv_y = ps_motion_pred[12].i2_mv[1 + (2 * i4_i)];
 1739|       |
 1740|  11.1k|            s_temp_mv[i4_i][3].i2_mv_x = ps_motion_pred[15].i2_mv[2 * i4_i];
 1741|  11.1k|            s_temp_mv[i4_i][3].i2_mv_y = ps_motion_pred[15].i2_mv[1 + (2 * i4_i)];
 1742|       |
 1743|  11.1k|        } /* end of loop over lists */
 1744|       |
 1745|       |        /* replace the motion vectors */
 1746|  16.7k|        for(i4_i = 0; i4_i < i4_listx; i4_i++)
  ------------------
  |  Branch (1746:23): [True: 11.1k, False: 5.59k]
  ------------------
 1747|  11.1k|        {
 1748|  55.9k|            for(i4_yp = 0; i4_yp < 4; i4_yp++)
  ------------------
  |  Branch (1748:28): [True: 44.7k, False: 11.1k]
  ------------------
 1749|  44.7k|            {
 1750|   223k|                for(i4_xp = 0; i4_xp < 4; i4_xp++)
  ------------------
  |  Branch (1750:32): [True: 178k, False: 44.7k]
  ------------------
 1751|   178k|                {
 1752|   178k|                    mv_pred_t *ps_temp;
 1753|   178k|                    ps_temp = ps_motion_pred + i4_xp;
 1754|   178k|                    ps_temp += 4 * i4_yp;
 1755|       |
 1756|   178k|                    ps_temp->i2_mv[2 * i4_i] =
 1757|   178k|                        s_temp_mv[i4_i][2 * (i4_yp >> 1) + (i4_xp >> 1)].i2_mv_x;
 1758|       |
 1759|   178k|                    ps_temp->i2_mv[1 + (2 * i4_i)] =
 1760|   178k|                        s_temp_mv[i4_i][2 * (i4_yp >> 1) + (i4_xp >> 1)].i2_mv_y;
 1761|       |
 1762|   178k|                } /* end of loop over sub partitions xp */
 1763|  44.7k|            }     /* end of loop over sub partitions yp */
 1764|  11.1k|        }         /* end of loop over lists */
 1765|  5.59k|    }
 1766|       |
 1767|       |    /* store the final reference index for all sub partitions */
 1768|       |    /* approporiate reference index is stored for each 4x4 belonging to 8x8 */
 1769|   130k|    {
 1770|   130k|        WORD32 i4_xp, i4_yp;
 1771|       |
 1772|   287k|        for(i4_i = 0; i4_i < i4_listx; i4_i++)
  ------------------
  |  Branch (1772:23): [True: 156k, False: 130k]
  ------------------
 1773|   156k|        {
 1774|   780k|            for(i4_yp = 0; i4_yp < 4; i4_yp++)
  ------------------
  |  Branch (1774:28): [True: 624k, False: 156k]
  ------------------
 1775|   624k|            {
 1776|  3.12M|                for(i4_xp = 0; i4_xp < 4; i4_xp++)
  ------------------
  |  Branch (1776:32): [True: 2.49M, False: 624k]
  ------------------
 1777|  2.49M|                {
 1778|  2.49M|                    mv_pred_t *ps_temp;
 1779|  2.49M|                    ps_temp = ps_motion_pred + i4_xp;
 1780|  2.49M|                    ps_temp += 4 * i4_yp;
 1781|       |
 1782|  2.49M|                    ps_temp->i1_ref_frame[i4_i] =
 1783|  2.49M|                        ai4_temp_ref_indx[i4_i][2 * (i4_yp >> 1) + (i4_xp >> 1)];
 1784|       |
 1785|  2.49M|                } /* end of loop over partition xp */
 1786|   624k|            }     /* end of loop over partition yp */
 1787|   156k|        }         /* end of loop over lists */
 1788|   130k|    }
 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|   130k|    if(SVCD_FALSE == ps_lyr_mem->ps_curr_lyr_res_prms->u1_rstrct_res_change_flag)
  ------------------
  |  |   45|   130k|#define SVCD_FALSE 0
  ------------------
  |  Branch (1794:8): [True: 130k, False: 0]
  ------------------
 1795|   130k|    {
 1796|       |        /* non dyadic cases set the mv treshold to 1 */
 1797|   130k|        i4_mv_treshold = 1;
 1798|   130k|    }
 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|   130k|    if((SVCD_FALSE == ps_lyr_mem->ps_curr_lyr_res_prms->u1_rstrct_res_change_flag) ||
  ------------------
  |  |   45|   130k|#define SVCD_FALSE 0
  ------------------
  |  Branch (1806:8): [True: 130k, False: 0]
  ------------------
 1807|      0|       (1 == ps_svc_mb_params->u1_base_mode_flag))
  ------------------
  |  Branch (1807:8): [True: 0, False: 0]
  ------------------
 1808|   130k|    {
 1809|   130k|        WORD32 i4_xp, i4_yp;
 1810|   392k|        for(i4_yp = 0; i4_yp < 2; i4_yp++)
  ------------------
  |  Branch (1810:24): [True: 261k, False: 130k]
  ------------------
 1811|   261k|        {
 1812|   785k|            for(i4_xp = 0; i4_xp < 2; i4_xp++)
  ------------------
  |  Branch (1812:28): [True: 523k, False: 261k]
  ------------------
 1813|   523k|            {
 1814|   523k|                mv_pred_t *ps_temp;
 1815|   523k|                WORD32 i4_part_size = 0;
 1816|   523k|                WORD32 i4_horz1_match, i4_vert1_match;
 1817|   523k|                WORD32 i4_horz2_match, i4_vert2_match;
 1818|   523k|                WORD32 i4_diag_match;
 1819|       |
 1820|   523k|                WORD32 i4_8x8_match, i4_horz_match, i4_vert_match;
 1821|   523k|                WORD32 i4_mv_x, i4_mv_y;
 1822|       |
 1823|   523k|                ps_temp = ps_motion_pred + (i4_xp << 1);
 1824|   523k|                ps_temp += 4 * ((i4_yp << 1));
 1825|       |
 1826|       |                /* default init */
 1827|   523k|                i4_8x8_match = i4_horz_match = i4_vert_match = SVCD_TRUE;
  ------------------
  |  |   46|   523k|#define SVCD_TRUE 1
  ------------------
 1828|       |
 1829|       |                /* check if the mv diff in horz direction is under threshold*/
 1830|   523k|                i4_horz1_match =
 1831|   523k|                    isvcd_check_mv_diff(ps_temp, (ps_temp + 1), i4_listx, i4_mv_treshold);
 1832|       |
 1833|   523k|                i4_horz2_match =
 1834|   523k|                    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|   523k|                i4_vert1_match =
 1838|   523k|                    isvcd_check_mv_diff(ps_temp, (ps_temp + 4), i4_listx, i4_mv_treshold);
 1839|       |
 1840|   523k|                i4_vert2_match =
 1841|   523k|                    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|   523k|                i4_diag_match =
 1845|   523k|                    isvcd_check_mv_diff(ps_temp, (ps_temp + 4 + 1), i4_listx, i4_mv_treshold);
 1846|       |
 1847|       |                /* calculate the excat matching points*/
 1848|   523k|                i4_8x8_match = i4_8x8_match && i4_horz1_match && i4_vert1_match && i4_diag_match;
  ------------------
  |  Branch (1848:32): [True: 523k, False: 0]
  |  Branch (1848:48): [True: 515k, False: 8.07k]
  |  Branch (1848:66): [True: 508k, False: 6.95k]
  |  Branch (1848:84): [True: 508k, False: 159]
  ------------------
 1849|   523k|                i4_horz_match = i4_horz_match && i4_horz1_match && i4_horz2_match;
  ------------------
  |  Branch (1849:33): [True: 523k, False: 0]
  |  Branch (1849:50): [True: 515k, False: 8.07k]
  |  Branch (1849:68): [True: 515k, False: 300]
  ------------------
 1850|   523k|                i4_vert_match = i4_vert_match && i4_vert1_match && i4_vert2_match;
  ------------------
  |  Branch (1850:33): [True: 523k, False: 0]
  |  Branch (1850:50): [True: 516k, False: 7.28k]
  |  Branch (1850:68): [True: 516k, False: 251]
  ------------------
 1851|       |
 1852|       |                /* modify the motion vectors appropriately */
 1853|       |
 1854|  1.14M|                for(i4_i = 0; i4_i < i4_listx; i4_i++)
  ------------------
  |  Branch (1854:31): [True: 624k, False: 523k]
  ------------------
 1855|   624k|                {
 1856|       |                    /* 8x8 mode all the 4 blocks are under threshold */
 1857|   624k|                    if(SVCD_TRUE == i4_8x8_match)
  ------------------
  |  |   46|   624k|#define SVCD_TRUE 1
  ------------------
  |  Branch (1857:24): [True: 607k, False: 17.3k]
  ------------------
 1858|   607k|                    {
 1859|       |                        /* calculate the avarage */
 1860|   607k|                        i4_mv_x =
 1861|   607k|                            ((ps_temp[0].i2_mv[2 * i4_i]) + (ps_temp[1].i2_mv[2 * i4_i]) +
 1862|   607k|                             (ps_temp[4].i2_mv[2 * i4_i]) + (ps_temp[5].i2_mv[2 * i4_i] + 2)) >>
 1863|   607k|                            2;
 1864|       |
 1865|   607k|                        i4_mv_y = ((ps_temp[0].i2_mv[1 + (2 * i4_i)]) +
 1866|   607k|                                   (ps_temp[1].i2_mv[1 + (2 * i4_i)]) +
 1867|   607k|                                   (ps_temp[4].i2_mv[1 + (2 * i4_i)]) +
 1868|   607k|                                   (ps_temp[5].i2_mv[1 + (2 * i4_i)] + 2)) >>
 1869|   607k|                                  2;
 1870|       |
 1871|       |                        /* store the modified motion vectors */
 1872|   607k|                        ps_temp[0].i2_mv[2 * i4_i] = (WORD16) i4_mv_x;
 1873|   607k|                        ps_temp[1].i2_mv[2 * i4_i] = (WORD16) i4_mv_x;
 1874|   607k|                        ps_temp[4].i2_mv[2 * i4_i] = (WORD16) i4_mv_x;
 1875|   607k|                        ps_temp[5].i2_mv[2 * i4_i] = (WORD16) i4_mv_x;
 1876|       |
 1877|   607k|                        ps_temp[0].i2_mv[1 + (2 * i4_i)] = (WORD16) i4_mv_y;
 1878|   607k|                        ps_temp[1].i2_mv[1 + (2 * i4_i)] = (WORD16) i4_mv_y;
 1879|   607k|                        ps_temp[4].i2_mv[1 + (2 * i4_i)] = (WORD16) i4_mv_y;
 1880|   607k|                        ps_temp[5].i2_mv[1 + (2 * i4_i)] = (WORD16) i4_mv_y;
 1881|       |
 1882|       |                        /* store the sub mb partition size */
 1883|   607k|                        i4_part_size = SUBMB_8x8;
  ------------------
  |  |  501|   607k|#define SUBMB_8x8    0
  ------------------
 1884|   607k|                    }
 1885|       |                    /* 8x4 mode  */
 1886|  17.3k|                    else if(SVCD_TRUE == i4_horz_match)
  ------------------
  |  |   46|  17.3k|#define SVCD_TRUE 1
  ------------------
  |  Branch (1886:29): [True: 8.84k, False: 8.51k]
  ------------------
 1887|  8.84k|                    {
 1888|       |                        /* horizontal directional merging */
 1889|       |                        /* calculate the average of first two and store back*/
 1890|  8.84k|                        i4_mv_x =
 1891|  8.84k|                            ((ps_temp[0].i2_mv[2 * i4_i]) + (ps_temp[1].i2_mv[2 * i4_i] + 1)) >> 1;
 1892|       |
 1893|  8.84k|                        i4_mv_y = ((ps_temp[0].i2_mv[1 + (2 * i4_i)]) +
 1894|  8.84k|                                   (ps_temp[1].i2_mv[1 + (2 * i4_i)] + 1)) >>
 1895|  8.84k|                                  1;
 1896|       |
 1897|  8.84k|                        ps_temp[0].i2_mv[2 * i4_i] = (WORD16) i4_mv_x;
 1898|  8.84k|                        ps_temp[1].i2_mv[2 * i4_i] = (WORD16) i4_mv_x;
 1899|       |
 1900|  8.84k|                        ps_temp[0].i2_mv[1 + (2 * i4_i)] = (WORD16) i4_mv_y;
 1901|  8.84k|                        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|  8.84k|                        i4_mv_x =
 1905|  8.84k|                            ((ps_temp[4].i2_mv[2 * i4_i]) + (ps_temp[5].i2_mv[2 * i4_i] + 1)) >> 1;
 1906|       |
 1907|  8.84k|                        i4_mv_y = ((ps_temp[4].i2_mv[1 + (2 * i4_i)]) +
 1908|  8.84k|                                   (ps_temp[5].i2_mv[1 + (2 * i4_i)] + 1)) >>
 1909|  8.84k|                                  1;
 1910|       |
 1911|  8.84k|                        ps_temp[4].i2_mv[2 * i4_i] = (WORD16) i4_mv_x;
 1912|  8.84k|                        ps_temp[5].i2_mv[2 * i4_i] = (WORD16) i4_mv_x;
 1913|       |
 1914|  8.84k|                        ps_temp[4].i2_mv[1 + (2 * i4_i)] = (WORD16) i4_mv_y;
 1915|  8.84k|                        ps_temp[5].i2_mv[1 + (2 * i4_i)] = (WORD16) i4_mv_y;
 1916|       |                        /* store the sub mb partition size */
 1917|  8.84k|                        i4_part_size = SUBMB_8x4;
  ------------------
  |  |  502|  8.84k|#define SUBMB_8x4    1
  ------------------
 1918|  8.84k|                    }
 1919|       |                    /* 4x8 mode all the 4 blocks are under threshold */
 1920|  8.51k|                    else if(SVCD_TRUE == i4_vert_match)
  ------------------
  |  |   46|  8.51k|#define SVCD_TRUE 1
  ------------------
  |  Branch (1920:29): [True: 7.77k, False: 741]
  ------------------
 1921|  7.77k|                    {
 1922|       |                        /* vertical directional merging */
 1923|  7.77k|                        i4_mv_x =
 1924|  7.77k|                            ((ps_temp[0].i2_mv[2 * i4_i]) + (ps_temp[4].i2_mv[2 * i4_i] + 1)) >> 1;
 1925|       |
 1926|  7.77k|                        i4_mv_y = ((ps_temp[0].i2_mv[1 + (2 * i4_i)]) +
 1927|  7.77k|                                   (ps_temp[4].i2_mv[1 + (2 * i4_i)] + 1)) >>
 1928|  7.77k|                                  1;
 1929|       |
 1930|  7.77k|                        ps_temp[0].i2_mv[2 * i4_i] = (WORD16) i4_mv_x;
 1931|  7.77k|                        ps_temp[4].i2_mv[2 * i4_i] = (WORD16) i4_mv_x;
 1932|       |
 1933|  7.77k|                        ps_temp[0].i2_mv[1 + (2 * i4_i)] = (WORD16) i4_mv_y;
 1934|  7.77k|                        ps_temp[4].i2_mv[1 + (2 * i4_i)] = (WORD16) i4_mv_y;
 1935|       |
 1936|       |                        /* calculate the average of next two and store back*/
 1937|  7.77k|                        i4_mv_x =
 1938|  7.77k|                            ((ps_temp[1].i2_mv[2 * i4_i]) + (ps_temp[5].i2_mv[2 * i4_i] + 1)) >> 1;
 1939|       |
 1940|  7.77k|                        i4_mv_y = ((ps_temp[1].i2_mv[1 + (2 * i4_i)]) +
 1941|  7.77k|                                   (ps_temp[5].i2_mv[1 + (2 * i4_i)] + 1)) >>
 1942|  7.77k|                                  1;
 1943|       |
 1944|  7.77k|                        ps_temp[1].i2_mv[2 * i4_i] = (WORD16) i4_mv_x;
 1945|  7.77k|                        ps_temp[5].i2_mv[2 * i4_i] = (WORD16) i4_mv_x;
 1946|       |
 1947|  7.77k|                        ps_temp[1].i2_mv[1 + (2 * i4_i)] = (WORD16) i4_mv_y;
 1948|  7.77k|                        ps_temp[5].i2_mv[1 + (2 * i4_i)] = (WORD16) i4_mv_y;
 1949|       |                        /* store the sub mb partition size */
 1950|  7.77k|                        i4_part_size = SUBMB_4x8;
  ------------------
  |  |  503|  7.77k|#define SUBMB_4x8    2
  ------------------
 1951|  7.77k|                    }
 1952|    741|                    else
 1953|    741|                    {
 1954|       |                        /* store the sub mb partition size */
 1955|    741|                        i4_part_size = SUBMB_4x4;
  ------------------
  |  |  504|    741|#define SUBMB_4x4    3
  ------------------
 1956|    741|                    }
 1957|       |
 1958|   624k|                } /* end of loop over lists */
 1959|       |
 1960|       |                /* store the sub MB type B slice */
 1961|   523k|                if(2 == i4_listx)
  ------------------
  |  Branch (1961:20): [True: 100k, False: 423k]
  ------------------
 1962|   100k|                {
 1963|   100k|                    WORD32 i4_part_mode_a;
 1964|   100k|                    WORD32 i4_indx;
 1965|       |
 1966|   100k|                    i4_part_mode_a = 0;
 1967|       |                    /* check the 0th partiton reference indices */
 1968|   100k|                    if(0 <= ps_temp[0].i1_ref_frame[0])
  ------------------
  |  Branch (1968:24): [True: 83.3k, False: 17.2k]
  ------------------
 1969|  83.3k|                    {
 1970|  83.3k|                        i4_part_mode_a += 1;
 1971|  83.3k|                    }
 1972|   100k|                    if(0 <= ps_temp[0].i1_ref_frame[1])
  ------------------
  |  Branch (1972:24): [True: 56.6k, False: 43.9k]
  ------------------
 1973|  56.6k|                    {
 1974|  56.6k|                        i4_part_mode_a += 2;
 1975|  56.6k|                    }
 1976|   100k|                    i4_indx = 3 * i4_part_size + (i4_part_mode_a - 1);
 1977|       |
 1978|   100k|                    pi4_sub_mb_mode[2 * i4_yp + i4_xp] = g_au1_eb_submb_type[i4_indx];
 1979|   100k|                }
 1980|       |                /* P slice */
 1981|   423k|                else
 1982|   423k|                {
 1983|   423k|                    pi4_sub_mb_mode[2 * i4_yp + i4_xp] = g_au1_ep_submb_type[i4_part_size];
 1984|   423k|                }
 1985|   523k|            } /* end of loop over partition xp */
 1986|       |
 1987|   261k|        }     /* end of loop over partition yp */
 1988|   130k|    }
 1989|       |
 1990|   130k|    return;
 1991|   130k|}
isvcd_interlyr_mbmode_pred_bmb:
 2020|  35.1k|{
 2021|  35.1k|    WORD32 i4_part_mode_a, i4_part_mode_b;
 2022|  35.1k|    WORD32 i4_idx;
 2023|  35.1k|    dec_mb_info_t *ps_mb_params = (dec_mb_info_t *) pv_mb_params;
 2024|  35.1k|    parse_part_params_t *ps_part = (parse_part_params_t *) pv_part;
 2025|       |
 2026|  35.1k|    UNUSED(ps_ctxt);
  ------------------
  |  |   45|  35.1k|#define UNUSED(x) ((void)(x))
  ------------------
 2027|       |
 2028|  35.1k|    i4_part_mode_a = 0;
 2029|       |
 2030|       |    /* check the 0th partiton reference indices */
 2031|  35.1k|    if(PRED_8x8 != i4_part_size)
  ------------------
  |  |  453|  35.1k|#define PRED_8x8    3
  ------------------
  |  Branch (2031:8): [True: 30.3k, False: 4.74k]
  ------------------
 2032|  30.3k|    {
 2033|  30.3k|        if(0 <= ps_motion_pred[0].i1_ref_frame[0])
  ------------------
  |  Branch (2033:12): [True: 26.6k, False: 3.74k]
  ------------------
 2034|  26.6k|        {
 2035|  26.6k|            i4_part_mode_a += 1;
 2036|  26.6k|        }
 2037|  30.3k|        if(0 <= ps_motion_pred[0].i1_ref_frame[1])
  ------------------
  |  Branch (2037:12): [True: 13.8k, False: 16.4k]
  ------------------
 2038|  13.8k|        {
 2039|  13.8k|            i4_part_mode_a += 2;
 2040|  13.8k|        }
 2041|  30.3k|    }
 2042|       |
 2043|       |    /* check the 15th partiton reference indices */
 2044|       |    /* this done since all the reference indices will be replicated */
 2045|  35.1k|    i4_part_mode_b = 0;
 2046|       |
 2047|  35.1k|    if((PRED_16x8 == i4_part_size) || (PRED_8x16 == i4_part_size))
  ------------------
  |  |  451|  35.1k|#define PRED_16x8   1
  ------------------
                  if((PRED_16x8 == i4_part_size) || (PRED_8x16 == i4_part_size))
  ------------------
  |  |  452|  31.0k|#define PRED_8x16   2
  ------------------
  |  Branch (2047:8): [True: 4.03k, False: 31.0k]
  |  Branch (2047:39): [True: 2.18k, False: 28.9k]
  ------------------
 2048|  6.21k|    {
 2049|  6.21k|        ps_motion_pred += (3 * i4_cur_mot_stride) + 3;
 2050|       |
 2051|  6.21k|        if(0 <= ps_motion_pred[0].i1_ref_frame[0])
  ------------------
  |  Branch (2051:12): [True: 4.79k, False: 1.42k]
  ------------------
 2052|  4.79k|        {
 2053|  4.79k|            i4_part_mode_b += 1;
 2054|  4.79k|        }
 2055|  6.21k|        if(0 <= ps_motion_pred[0].i1_ref_frame[1])
  ------------------
  |  Branch (2055:12): [True: 2.38k, False: 3.83k]
  ------------------
 2056|  2.38k|        {
 2057|  2.38k|            i4_part_mode_b += 2;
 2058|  2.38k|        }
 2059|  6.21k|    }
 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|  35.1k|    if(PRED_8x8 != i4_part_size)
  ------------------
  |  |  453|  35.1k|#define PRED_8x8    3
  ------------------
  |  Branch (2064:8): [True: 30.3k, False: 4.74k]
  ------------------
 2065|  30.3k|    {
 2066|  30.3k|        UWORD8 u1_pred_mode_part0;
 2067|  30.3k|        UWORD8 u1_pred_mode_part1;
 2068|       |
 2069|  30.3k|        i4_idx = 3 * i4_part_size;
 2070|  30.3k|        i4_idx += 3 * (i4_part_mode_a - 1);
 2071|  30.3k|        i4_part_mode_b = (i4_part_mode_b > 0) ? i4_part_mode_b : 1;
  ------------------
  |  Branch (2071:26): [True: 6.21k, False: 24.1k]
  ------------------
 2072|  30.3k|        i4_idx += (i4_part_mode_b - 1);
 2073|  30.3k|        i4_idx = (i4_idx < 0) ? 0 : i4_idx;
  ------------------
  |  Branch (2073:18): [True: 0, False: 30.3k]
  ------------------
 2074|       |        /* Get the mb type                     */
 2075|       |        /* From mb type - get prediciton modes */
 2076|       |        /*  of parttions                       */
 2077|       |        /* Update the prediciton mode parma of */
 2078|       |        /* mb param structure                  */
 2079|       |
 2080|  30.3k|        ps_mb_params->u1_mb_type = g_au1_eb_mb_type[i4_idx + (6 * i4_part_size)];
 2081|  30.3k|        u1_pred_mode_part0 = g_au1_mb_pred_mode[0][5 + ps_mb_params->u1_mb_type];
 2082|  30.3k|        u1_pred_mode_part1 = g_au1_mb_pred_mode[1][5 + ps_mb_params->u1_mb_type];
 2083|  30.3k|        ps_part[0].u1_pred_mode = u1_pred_mode_part0;
 2084|  30.3k|        ps_part[1].u1_pred_mode = u1_pred_mode_part1;
 2085|  30.3k|    }
 2086|  4.74k|    else
 2087|  4.74k|    {
 2088|  4.74k|        WORD32 i4_i, i4_ctr, i4_num_submb_part;
 2089|  4.74k|        UWORD8 u1_sub_mb_type, u1_sub_mb_mc_mode;
 2090|  4.74k|        UWORD8 u1_pred_mode;
 2091|       |
 2092|  4.74k|        ps_mb_params->u1_mb_type = B_8x8;
  ------------------
  |  |  480|  4.74k|#define B_8x8    22
  ------------------
 2093|       |
 2094|  23.7k|        for(i4_i = 0; i4_i < NUM_MB_PARTS; i4_i++)
  ------------------
  |  |   59|  23.7k|#define NUM_MB_PARTS 4
  ------------------
  |  Branch (2094:23): [True: 18.9k, False: 4.74k]
  ------------------
 2095|  18.9k|        {
 2096|  18.9k|            u1_sub_mb_type = (UWORD8) pi4_sub_mb_mode[i4_i];
 2097|       |
 2098|  18.9k|            u1_sub_mb_mc_mode = gau1_ih264d_submb_mc_mode[4 + u1_sub_mb_type];
 2099|  18.9k|            i4_num_submb_part = g_au1_num_sub_mb_part[u1_sub_mb_mc_mode];
 2100|  18.9k|            *pu1_col_info |= (u1_sub_mb_mc_mode << 4);
 2101|  18.9k|            pu1_col_info++;
 2102|  18.9k|            u1_pred_mode = g_au1_sub_mb_pred_mode[4 + u1_sub_mb_type];
 2103|  52.0k|            for(i4_ctr = 0; i4_ctr < i4_num_submb_part; i4_ctr++)
  ------------------
  |  Branch (2103:29): [True: 33.0k, False: 18.9k]
  ------------------
 2104|  33.0k|            {
 2105|  33.0k|                ps_part->u1_pred_mode = u1_pred_mode;
 2106|  33.0k|                ps_part++;
 2107|  33.0k|            }
 2108|  18.9k|        }
 2109|  4.74k|    }
 2110|       |
 2111|  35.1k|    return;
 2112|  35.1k|}
isvcd_populate_ref_idx:
 2139|  28.7k|{
 2140|  28.7k|    UWORD8 u1_mot_pred_flag;
 2141|  28.7k|    WORD32 i4_lx;
 2142|       |
 2143|  70.1k|    for(i4_lx = 0; i4_lx < i4_listx; i4_lx++)
  ------------------
  |  Branch (2143:20): [True: 41.3k, False: 28.7k]
  ------------------
 2144|  41.3k|    {
 2145|  41.3k|        u1_mot_pred_flag = ps_svc_mb_params->au1_motion_pred_flag[i4_lx];
 2146|       |
 2147|  41.3k|        if((PRED_16x16 == ps_mb_params->u1_mb_mc_mode) && (u1_mot_pred_flag & 0x1))
  ------------------
  |  |  450|  41.3k|#define PRED_16x16  0
  ------------------
  |  Branch (2147:12): [True: 15.0k, False: 26.2k]
  |  Branch (2147:59): [True: 11.4k, False: 3.69k]
  ------------------
 2148|  11.4k|        {
 2149|  11.4k|            ps_mb_part_info->i1_ref_idx[i4_lx][0] = ps_motion_pred[0].i1_ref_frame[i4_lx];
 2150|  11.4k|        }
 2151|  29.9k|        else if((PRED_8x16 == ps_mb_params->u1_mb_mc_mode))
  ------------------
  |  |  452|  29.9k|#define PRED_8x16   2
  ------------------
  |  Branch (2151:17): [True: 10.7k, False: 19.2k]
  ------------------
 2152|  10.7k|        {
 2153|  10.7k|            if(u1_mot_pred_flag & 0x01)
  ------------------
  |  Branch (2153:16): [True: 3.13k, False: 7.63k]
  ------------------
 2154|  3.13k|            {
 2155|  3.13k|                ps_mb_part_info->i1_ref_idx[i4_lx][0] = ps_motion_pred[0].i1_ref_frame[i4_lx];
 2156|  3.13k|            }
 2157|  10.7k|            if(u1_mot_pred_flag & 0x02)
  ------------------
  |  Branch (2157:16): [True: 6.11k, False: 4.66k]
  ------------------
 2158|  6.11k|            {
 2159|  6.11k|                ps_mb_part_info->i1_ref_idx[i4_lx][1] = ps_motion_pred[2].i1_ref_frame[i4_lx];
 2160|  6.11k|            }
 2161|  10.7k|        }
 2162|  19.2k|        else if((PRED_16x8 == ps_mb_params->u1_mb_mc_mode))
  ------------------
  |  |  451|  19.2k|#define PRED_16x8   1
  ------------------
  |  Branch (2162:17): [True: 6.42k, False: 12.7k]
  ------------------
 2163|  6.42k|        {
 2164|  6.42k|            if(u1_mot_pred_flag & 0x01)
  ------------------
  |  Branch (2164:16): [True: 4.15k, False: 2.26k]
  ------------------
 2165|  4.15k|            {
 2166|  4.15k|                ps_mb_part_info->i1_ref_idx[i4_lx][0] = ps_motion_pred[0].i1_ref_frame[i4_lx];
 2167|  4.15k|            }
 2168|  6.42k|            if(u1_mot_pred_flag & 0x02)
  ------------------
  |  Branch (2168:16): [True: 4.70k, False: 1.72k]
  ------------------
 2169|  4.70k|            {
 2170|  4.70k|                ps_mb_part_info->i1_ref_idx[i4_lx][1] = ps_motion_pred[8].i1_ref_frame[i4_lx];
 2171|  4.70k|            }
 2172|  6.42k|        }
 2173|  12.7k|        else if((PRED_8x8 == ps_mb_params->u1_mb_mc_mode))
  ------------------
  |  |  453|  12.7k|#define PRED_8x8    3
  ------------------
  |  Branch (2173:17): [True: 9.04k, False: 3.74k]
  ------------------
 2174|  9.04k|        {
 2175|  9.04k|            if(u1_mot_pred_flag & 0x01)
  ------------------
  |  Branch (2175:16): [True: 3.71k, False: 5.33k]
  ------------------
 2176|  3.71k|            {
 2177|  3.71k|                ps_mb_part_info->i1_ref_idx[i4_lx][0] = ps_motion_pred[0].i1_ref_frame[i4_lx];
 2178|  3.71k|            }
 2179|  9.04k|            if(u1_mot_pred_flag & 0x02)
  ------------------
  |  Branch (2179:16): [True: 3.56k, False: 5.48k]
  ------------------
 2180|  3.56k|            {
 2181|  3.56k|                ps_mb_part_info->i1_ref_idx[i4_lx][1] = ps_motion_pred[2].i1_ref_frame[i4_lx];
 2182|  3.56k|            }
 2183|  9.04k|            if(u1_mot_pred_flag & 0x04)
  ------------------
  |  Branch (2183:16): [True: 4.38k, False: 4.66k]
  ------------------
 2184|  4.38k|            {
 2185|  4.38k|                ps_mb_part_info->i1_ref_idx[i4_lx][2] = ps_motion_pred[8].i1_ref_frame[i4_lx];
 2186|  4.38k|            }
 2187|  9.04k|            if(u1_mot_pred_flag & 0x08)
  ------------------
  |  Branch (2187:16): [True: 3.84k, False: 5.19k]
  ------------------
 2188|  3.84k|            {
 2189|  3.84k|                ps_mb_part_info->i1_ref_idx[i4_lx][3] = ps_motion_pred[10].i1_ref_frame[i4_lx];
 2190|  3.84k|            }
 2191|  9.04k|        }
 2192|  41.3k|    }
 2193|  28.7k|}
isvcd_interlyr_mbmode_pred:
 2223|   122k|{
 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|   122k|    mode_motion_ctxt_t *ps_ctxt;
 2231|   122k|    mv_pred_t *ps_motion_pred;
 2232|   122k|    dec_mb_info_t *ps_mb_params;
 2233|   122k|    WORD32 i4_listx;
 2234|   122k|    WORD32 i4_part_size;
 2235|   122k|    WORD32 i4_mb_mode_flag;
 2236|   122k|    WORD32 i4_i;
 2237|   122k|    WORD32 i4_blk_mode;
 2238|   122k|    parse_part_params_t *ps_part = (parse_part_params_t *) pv_part;
 2239|   122k|    parse_pmbarams_t *ps_mb_part_info = (parse_pmbarams_t *) pv_mb_part_info;
 2240|   122k|    UWORD8 *pu1_col_info = ps_mb_part_info->u1_col_info;
 2241|   122k|    UNUSED(pv_dec);
  ------------------
  |  |   45|   122k|#define UNUSED(x) ((void)(x))
  ------------------
 2242|       |
 2243|   122k|    ps_ctxt = (mode_motion_ctxt_t *) pv_comp_mode_mv_ctxt;
 2244|   122k|    ps_motion_pred = ps_ctxt->ps_motion_pred_struct;
 2245|   122k|    ps_mb_params = (dec_mb_info_t *) pv_mb_params;
 2246|       |
 2247|       |    /*********** store the MB mode as inter *************************/
 2248|   122k|    *pi4_mb_mode = SVC_INTER_MB;
  ------------------
  |  |  114|   122k|#define SVC_INTER_MB (1 << 0)       /*!< Intra MBs other than IPCM and I_BL */
  ------------------
 2249|       |
 2250|       |    /***********************************************************************/
 2251|       |    /* derivation of part type                                             */
 2252|       |    /***********************************************************************/
 2253|   122k|    i4_listx = ps_ctxt->i4_listx;
 2254|       |
 2255|       |    /* set the mb mode derivation flag to false */
 2256|   122k|    i4_mb_mode_flag = SVCD_FALSE;
  ------------------
  |  |   45|   122k|#define SVCD_FALSE 0
  ------------------
 2257|       |
 2258|       |    /* for B and P slice different blk mod treshold */
 2259|   122k|    if(2 == i4_listx)
  ------------------
  |  Branch (2259:8): [True: 21.5k, False: 100k]
  ------------------
 2260|  21.5k|    {
 2261|  21.5k|        i4_blk_mode = B_BI_8x8;
  ------------------
  |  |  468|  21.5k|#define B_BI_8x8        3
  ------------------
 2262|  21.5k|    }
 2263|   100k|    else
 2264|   100k|    {
 2265|   100k|        i4_blk_mode = P_L0_8x8;
  ------------------
  |  |  459|   100k|#define P_L0_8x8    0
  ------------------
 2266|   100k|    }
 2267|       |
 2268|       |    /* set the mode derivation flag to true base on conditions */
 2269|   122k|    if((i4_blk_mode >= pi4_sub_mb_mode[0]) && (i4_blk_mode >= pi4_sub_mb_mode[1]) &&
  ------------------
  |  Branch (2269:8): [True: 119k, False: 2.41k]
  |  Branch (2269:47): [True: 116k, False: 3.41k]
  ------------------
 2270|   116k|       (i4_blk_mode >= pi4_sub_mb_mode[2]) && (i4_blk_mode >= pi4_sub_mb_mode[3]))
  ------------------
  |  Branch (2270:8): [True: 114k, False: 2.31k]
  |  Branch (2270:47): [True: 113k, False: 958]
  ------------------
 2271|   113k|    {
 2272|   113k|        i4_mb_mode_flag = SVCD_TRUE;
  ------------------
  |  |   46|   113k|#define SVCD_TRUE 1
  ------------------
 2273|   113k|    }
 2274|       |
 2275|       |    /* store the default 8x8 mode */
 2276|   122k|    ps_mb_part_info->u1_num_part = 4;
 2277|   122k|    i4_part_size = PRED_8x8;
  ------------------
  |  |  453|   122k|#define PRED_8x8    3
  ------------------
 2278|       |
 2279|       |    /* further check is present if all are 8x8 mode */
 2280|   122k|    if(SVCD_TRUE == i4_mb_mode_flag)
  ------------------
  |  |   46|   122k|#define SVCD_TRUE 1
  ------------------
  |  Branch (2280:8): [True: 113k, False: 9.08k]
  ------------------
 2281|   113k|    {
 2282|   113k|        WORD32 i4_horz_match, i4_vert_match;
 2283|       |
 2284|       |        /* check if the motion in horz direction are same*/
 2285|   113k|        i4_horz_match = isvcd_check_motion(ps_motion_pred, (ps_motion_pred + 2), i4_listx);
 2286|   113k|        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|   113k|        i4_vert_match = isvcd_check_motion(ps_motion_pred, (ps_motion_pred + 8), i4_listx);
 2290|   113k|        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|   113k|        if((2 == i4_horz_match) && (2 == i4_vert_match))
  ------------------
  |  Branch (2293:12): [True: 102k, False: 10.9k]
  |  Branch (2293:36): [True: 95.1k, False: 7.12k]
  ------------------
 2294|  95.1k|        {
 2295|  95.1k|            ps_mb_params->u1_mb_type = P_L0_16x16;
 2296|  95.1k|            i4_part_size = PRED_16x16;
  ------------------
  |  |  450|  95.1k|#define PRED_16x16  0
  ------------------
 2297|  95.1k|            ps_mb_part_info->u1_num_part = 1;
 2298|  95.1k|            *pu1_col_info++ = (PRED_16x16 << 6);
  ------------------
  |  |  450|  95.1k|#define PRED_16x16  0
  ------------------
 2299|  95.1k|            ps_mb_part_info->i1_ref_idx[0][0] = ps_motion_pred->i1_ref_frame[0];
 2300|  95.1k|            if(2 == i4_listx) ps_mb_part_info->i1_ref_idx[1][0] = ps_motion_pred->i1_ref_frame[1];
  ------------------
  |  Branch (2300:16): [True: 12.6k, False: 82.4k]
  ------------------
 2301|       |
 2302|  95.1k|            ps_part->u1_partwidth = 4;  // interms of 4x4
 2303|  95.1k|            ps_part->u1_partheight = 4;
 2304|  95.1k|            ps_part->u1_pred_mode = PRED_L0;
  ------------------
  |  |  483|  95.1k|#define PRED_L0   1
  ------------------
 2305|  95.1k|            ps_part->u1_is_direct = 0;
 2306|  95.1k|            ps_part->u1_sub_mb_num = 0;
 2307|  95.1k|        }
 2308|  18.0k|        else if(2 == i4_horz_match)
  ------------------
  |  Branch (2308:17): [True: 7.12k, False: 10.9k]
  ------------------
 2309|  7.12k|        {
 2310|  7.12k|            i4_part_size = PRED_16x8;
  ------------------
  |  |  451|  7.12k|#define PRED_16x8   1
  ------------------
 2311|  7.12k|            ps_mb_params->u1_mb_type = P_L0_L0_16x8;
 2312|  7.12k|            ps_mb_part_info->u1_num_part = 2;
 2313|  7.12k|            *pu1_col_info++ = (PRED_16x8 << 6);
  ------------------
  |  |  451|  7.12k|#define PRED_16x8   1
  ------------------
 2314|  7.12k|            *pu1_col_info++ = (PRED_16x8 << 6);
  ------------------
  |  |  451|  7.12k|#define PRED_16x8   1
  ------------------
 2315|       |
 2316|  7.12k|            ps_mb_part_info->i1_ref_idx[0][0] = ps_motion_pred->i1_ref_frame[0];
 2317|  7.12k|            ps_mb_part_info->i1_ref_idx[0][1] = ps_motion_pred[8].i1_ref_frame[0];
 2318|  7.12k|            if(2 == i4_listx)
  ------------------
  |  Branch (2318:16): [True: 3.74k, False: 3.37k]
  ------------------
 2319|  3.74k|            {
 2320|  3.74k|                ps_mb_part_info->i1_ref_idx[1][0] = ps_motion_pred->i1_ref_frame[1];
 2321|  3.74k|                ps_mb_part_info->i1_ref_idx[1][1] = ps_motion_pred[8].i1_ref_frame[1];
 2322|  3.74k|            }
 2323|  7.12k|            ps_part->u1_partwidth = 4;  // interms of 4x4
 2324|  7.12k|            ps_part->u1_partheight = 2;
 2325|  7.12k|            ps_part->u1_pred_mode = PRED_L0;
  ------------------
  |  |  483|  7.12k|#define PRED_L0   1
  ------------------
 2326|  7.12k|            ps_part->u1_is_direct = 0;
 2327|  7.12k|            ps_part->u1_sub_mb_num = 0;
 2328|       |
 2329|  7.12k|            ps_part++;
 2330|  7.12k|            ps_part->u1_partwidth = 4;
 2331|  7.12k|            ps_part->u1_partheight = 2;
 2332|  7.12k|            ps_part->u1_pred_mode = PRED_L0;
  ------------------
  |  |  483|  7.12k|#define PRED_L0   1
  ------------------
 2333|  7.12k|            ps_part->u1_is_direct = 0;
 2334|  7.12k|            ps_part->u1_sub_mb_num = 8;
 2335|  7.12k|        }
 2336|  10.9k|        else if(2 == i4_vert_match)
  ------------------
  |  Branch (2336:17): [True: 4.40k, False: 6.52k]
  ------------------
 2337|  4.40k|        {
 2338|  4.40k|            ps_mb_params->u1_mb_type = P_L0_L0_8x16;
 2339|  4.40k|            i4_part_size = PRED_8x16;
  ------------------
  |  |  452|  4.40k|#define PRED_8x16   2
  ------------------
 2340|  4.40k|            ps_mb_part_info->u1_num_part = 2;
 2341|  4.40k|            *pu1_col_info++ = (PRED_8x16 << 6);
  ------------------
  |  |  452|  4.40k|#define PRED_8x16   2
  ------------------
 2342|  4.40k|            *pu1_col_info++ = (PRED_8x16 << 6);
  ------------------
  |  |  452|  4.40k|#define PRED_8x16   2
  ------------------
 2343|       |
 2344|  4.40k|            ps_mb_part_info->i1_ref_idx[0][0] = ps_motion_pred->i1_ref_frame[0];
 2345|  4.40k|            ps_mb_part_info->i1_ref_idx[0][1] = ps_motion_pred[2].i1_ref_frame[0];
 2346|  4.40k|            if(2 == i4_listx)
  ------------------
  |  Branch (2346:16): [True: 1.35k, False: 3.04k]
  ------------------
 2347|  1.35k|            {
 2348|  1.35k|                ps_mb_part_info->i1_ref_idx[1][0] = ps_motion_pred->i1_ref_frame[1];
 2349|  1.35k|                ps_mb_part_info->i1_ref_idx[1][1] = ps_motion_pred[2].i1_ref_frame[1];
 2350|  1.35k|            }
 2351|  4.40k|            ps_part->u1_partwidth = 2;  // interms of 4x4
 2352|  4.40k|            ps_part->u1_partheight = 4;
 2353|  4.40k|            ps_part->u1_pred_mode = PRED_L0;
  ------------------
  |  |  483|  4.40k|#define PRED_L0   1
  ------------------
 2354|  4.40k|            ps_part->u1_is_direct = 0;
 2355|  4.40k|            ps_part->u1_sub_mb_num = 0;
 2356|       |
 2357|  4.40k|            ps_part++;
 2358|  4.40k|            ps_part->u1_partwidth = 2;
 2359|  4.40k|            ps_part->u1_partheight = 4;
 2360|  4.40k|            ps_part->u1_pred_mode = PRED_L0;
  ------------------
  |  |  483|  4.40k|#define PRED_L0   1
  ------------------
 2361|  4.40k|            ps_part->u1_is_direct = 0;
 2362|  4.40k|            ps_part->u1_sub_mb_num = 2;
 2363|  4.40k|        }
 2364|   113k|    }
 2365|       |
 2366|       |    /* store the part size to the mb params */
 2367|   122k|    ps_mb_params->u1_mb_mc_mode = i4_part_size;
 2368|       |
 2369|       |    /* in case of slice derive the partition modes */
 2370|       |
 2371|   122k|    {
 2372|       |        /* store the sub MB modes if 8x8 mode is choosen */
 2373|   122k|        if(PRED_8x8 == i4_part_size)
  ------------------
  |  |  453|   122k|#define PRED_8x8    3
  ------------------
  |  Branch (2373:12): [True: 15.6k, False: 106k]
  ------------------
 2374|  15.6k|        {
 2375|  15.6k|            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.6k|            ps_mb_params->u1_mb_type = P_8x8;
 2379|  15.6k|            ps_mb_part_info->i1_ref_idx[0][0] = ps_motion_pred[0].i1_ref_frame[0];
 2380|  15.6k|            ps_mb_part_info->i1_ref_idx[0][1] = ps_motion_pred[2].i1_ref_frame[0];
 2381|  15.6k|            ps_mb_part_info->i1_ref_idx[0][2] = ps_motion_pred[8].i1_ref_frame[0];
 2382|  15.6k|            ps_mb_part_info->i1_ref_idx[0][3] = ps_motion_pred[10].i1_ref_frame[0];
 2383|  15.6k|            if(2 == i4_listx)
  ------------------
  |  Branch (2383:16): [True: 3.74k, False: 11.8k]
  ------------------
 2384|  3.74k|            {
 2385|  3.74k|                ps_mb_part_info->i1_ref_idx[1][0] = ps_motion_pred[0].i1_ref_frame[1];
 2386|  3.74k|                ps_mb_part_info->i1_ref_idx[1][1] = ps_motion_pred[2].i1_ref_frame[1];
 2387|  3.74k|                ps_mb_part_info->i1_ref_idx[1][2] = ps_motion_pred[8].i1_ref_frame[1];
 2388|  3.74k|                ps_mb_part_info->i1_ref_idx[1][3] = ps_motion_pred[10].i1_ref_frame[1];
 2389|  3.74k|            }
 2390|       |
 2391|  15.6k|            ps_mb_part_info->u1_num_part = 0;
 2392|  78.0k|            for(i4_i = 0; i4_i < NUM_MB_PARTS; i4_i++)
  ------------------
  |  |   59|  78.0k|#define NUM_MB_PARTS 4
  ------------------
  |  Branch (2392:27): [True: 62.4k, False: 15.6k]
  ------------------
 2393|  62.4k|            {
 2394|  62.4k|                WORD32 i4_num_submb_part, i4_part_width, i4_part_height, i4_ctr;
 2395|  62.4k|                u1_sub_mb_type = (UWORD8) pi4_sub_mb_mode[i4_i];
 2396|       |
 2397|  62.4k|                if(1 == i4_listx)
  ------------------
  |  Branch (2397:20): [True: 47.5k, False: 14.9k]
  ------------------
 2398|  47.5k|                {
 2399|  47.5k|                    u1_sub_mb_mc_mode = gau1_ih264d_submb_mc_mode[u1_sub_mb_type];
 2400|  47.5k|                }
 2401|  14.9k|                else if(2 == i4_listx)
  ------------------
  |  Branch (2401:25): [True: 14.9k, False: 0]
  ------------------
 2402|  14.9k|                {
 2403|  14.9k|                    u1_sub_mb_mc_mode = gau1_ih264d_submb_mc_mode[4 + u1_sub_mb_type];
 2404|  14.9k|                }
 2405|  62.4k|                i4_num_submb_part = g_au1_num_sub_mb_part[u1_sub_mb_mc_mode];
 2406|       |
 2407|  62.4k|                ps_mb_part_info->u1_num_part += i4_num_submb_part;
 2408|       |
 2409|  62.4k|                i4_part_width = g_au1_sub_mb_part_wd[u1_sub_mb_mc_mode];
 2410|  62.4k|                i4_part_height = g_au1_sub_mb_part_ht[u1_sub_mb_mc_mode];
 2411|  62.4k|                *pu1_col_info++ = (PRED_8x8 << 6) | (u1_sub_mb_mc_mode << 4);
  ------------------
  |  |  453|  62.4k|#define PRED_8x8    3
  ------------------
 2412|   141k|                for(i4_ctr = 0; i4_ctr < i4_num_submb_part; i4_ctr++)
  ------------------
  |  Branch (2412:33): [True: 78.7k, False: 62.4k]
  ------------------
 2413|  78.7k|                {
 2414|  78.7k|                    ps_part->u1_partwidth = i4_part_width;  // interms of 4x4
 2415|  78.7k|                    ps_part->u1_partheight = i4_part_height;
 2416|  78.7k|                    ps_part->u1_pred_mode = PRED_L0;
  ------------------
  |  |  483|  78.7k|#define PRED_L0   1
  ------------------
 2417|  78.7k|                    ps_part->u1_is_direct = 0;
 2418|  78.7k|                    ps_part->u1_sub_mb_num = (i4_i & 0x01) * 2 + (i4_i >> 1) * 8;
 2419|  78.7k|                    if(i4_num_submb_part == 2)
  ------------------
  |  Branch (2419:24): [True: 28.4k, False: 50.3k]
  ------------------
 2420|  28.4k|                    {
 2421|  28.4k|                        ps_part->u1_sub_mb_num +=
 2422|  28.4k|                            i4_ctr ? (((i4_part_width - 1) << 2) + (i4_part_height - 1)) : 0;
  ------------------
  |  Branch (2422:29): [True: 14.2k, False: 14.2k]
  ------------------
 2423|  28.4k|                    }
 2424|  50.3k|                    else if(i4_num_submb_part == 4)
  ------------------
  |  Branch (2424:29): [True: 2.78k, False: 47.5k]
  ------------------
 2425|  2.78k|                    {
 2426|  2.78k|                        ps_part->u1_sub_mb_num += ((i4_ctr >> 1) << 2) + (i4_ctr & 0x01);
 2427|  2.78k|                    }
 2428|       |
 2429|  78.7k|                    ps_part++;
 2430|  78.7k|                }
 2431|  62.4k|            }
 2432|  15.6k|        }
 2433|   122k|        if(2 == i4_listx)
  ------------------
  |  Branch (2433:12): [True: 21.5k, False: 100k]
  ------------------
 2434|  21.5k|        {
 2435|  21.5k|            ps_part = (parse_part_params_t *) pv_part;
 2436|  21.5k|            pu1_col_info = ps_mb_part_info->u1_col_info;
 2437|       |            /* B_MBs */
 2438|  21.5k|            isvcd_interlyr_mbmode_pred_bmb(ps_ctxt, ps_motion_pred, 4, i4_part_size,
 2439|  21.5k|                                           pi4_sub_mb_mode, ps_mb_params, ps_part, pu1_col_info);
 2440|  21.5k|        }
 2441|   122k|    }
 2442|       |
 2443|   122k|    return;
 2444|   122k|}
isvcd_compute_interlyr_motion_mode:
 2474|   140k|{
 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|   140k|    mode_motion_ctxt_t *ps_ctxt;
 2483|   140k|    WORD32 i4_intra_flag;
 2484|   140k|    WORD32 ai4_sub_mb_mode[NUM_MB_PARTS] = {0};
 2485|   140k|    dec_mb_info_t *ps_mb_params;
 2486|   140k|    dec_svc_mb_info_t *ps_svc_mb_params;
 2487|   140k|    dec_struct_t *ps_dec = (dec_struct_t *) pv_dec;
 2488|   140k|    WORD32 i4_mb_mode = -1;
 2489|   140k|    parse_pmbarams_t *ps_mb_part_info = (parse_pmbarams_t *) pv_mb_part_info;
 2490|   140k|    parse_part_params_t *ps_part = (parse_part_params_t *) pv_part;
 2491|       |
 2492|   140k|    ps_ctxt = (mode_motion_ctxt_t *) pv_comp_mode_mv_ctxt;
 2493|   140k|    ps_mb_params = (dec_mb_info_t *) pv_mb_params;
 2494|   140k|    ps_svc_mb_params = (dec_svc_mb_info_t *) pv_svc_mb_params;
 2495|       |
 2496|   140k|    i4_intra_flag = SVCD_FALSE;
  ------------------
  |  |   45|   140k|#define SVCD_FALSE 0
  ------------------
 2497|       |
 2498|   140k|    isvcd_ref_lyr_part_idc(pv_comp_mode_mv_ctxt, ps_ctxt->ai4_ref_part_idc, &i4_intra_flag,
 2499|   140k|                           pv_mb_params);
 2500|       |
 2501|       |    /* If base is Intra */
 2502|   140k|    if(SVCD_TRUE == i4_intra_flag)
  ------------------
  |  |   46|   140k|#define SVCD_TRUE 1
  ------------------
  |  Branch (2502:8): [True: 9.58k, False: 130k]
  ------------------
 2503|  9.58k|    {
 2504|  9.58k|        if(1 == ps_svc_mb_params->u1_base_mode_flag)
  ------------------
  |  Branch (2504:12): [True: 9.23k, False: 349]
  ------------------
 2505|  9.23k|        {
 2506|  9.23k|            i4_mb_mode = SVC_IBL_MB;
  ------------------
  |  |  117|  9.23k|#define SVC_IBL_MB (1 << 3)         /*!< I_BL MB always inferred */
  ------------------
 2507|  9.23k|            ps_svc_mb_params->u1_residual_prediction_flag = 0;
 2508|  9.23k|        }
 2509|  9.58k|    }
 2510|   130k|    else
 2511|   130k|    {
 2512|       |        /* derive the motion and reference index by inter layer predcition */
 2513|   130k|        isvcd_interlyr_motion_submbmode_pred(pv_comp_mode_mv_ctxt, ps_mb_params, ps_svc_mb_params,
 2514|   130k|                                             ps_ctxt->ai4_ref_part_idc, ai4_sub_mb_mode, pv_dec);
 2515|       |
 2516|       |        /* derive the MB mode */
 2517|   130k|        if(1 == ps_svc_mb_params->u1_base_mode_flag)
  ------------------
  |  Branch (2517:12): [True: 122k, False: 8.69k]
  ------------------
 2518|   122k|        {
 2519|   122k|            isvcd_interlyr_mbmode_pred(pv_comp_mode_mv_ctxt, pv_mb_params, ai4_sub_mb_mode,
 2520|   122k|                                       &i4_mb_mode, ps_dec, ps_mb_part_info, ps_part);
 2521|   122k|        }
 2522|  8.69k|        else
 2523|  8.69k|        {
 2524|  8.69k|            isvcd_populate_ref_idx(ps_mb_params, ps_svc_mb_params, ps_ctxt->ps_motion_pred_struct,
 2525|  8.69k|                                   ps_mb_part_info, ps_ctxt->i4_listx);
 2526|  8.69k|        }
 2527|   130k|    }
 2528|       |
 2529|   140k|    return i4_mb_mode;
 2530|   140k|}
isvcd_interlyr_motion_mode_pred_dyadic:
 2564|  65.4k|{
 2565|  65.4k|    mode_motion_ctxt_t *ps_ctxt;
 2566|  65.4k|    mode_motion_lyr_ctxt *ps_lyr_mem;
 2567|  65.4k|    dec_mb_info_t *ps_mb_params;
 2568|  65.4k|    dec_svc_mb_info_t *ps_svc_mb_params;
 2569|  65.4k|    WORD32 i4_listx;
 2570|  65.4k|    WORD32 i4_mb_pic_x, i4_mb_pic_y;
 2571|  65.4k|    WORD32 i4_ref_x, i4_ref_y;
 2572|  65.4k|    UWORD8 u1_base_mode_flag;
 2573|  65.4k|    dec_struct_t *ps_dec = (dec_struct_t *) pv_dec;
 2574|  65.4k|    WORD32 i4_mb_mode = -1;
 2575|  65.4k|    parse_pmbarams_t *ps_mb_part_info = (parse_pmbarams_t *) pv_mb_part_info;
 2576|  65.4k|    UWORD8 *pu1_col_info = ps_mb_part_info->u1_col_info;
 2577|  65.4k|    parse_part_params_t *ps_part = (parse_part_params_t *) pv_part;
 2578|       |
 2579|  65.4k|    ps_ctxt = (mode_motion_ctxt_t *) pv_comp_mode_mv_ctxt;
 2580|       |
 2581|       |    /* get the current layer ctxt */
 2582|  65.4k|    ps_lyr_mem = &ps_ctxt->as_res_lyr_mem[ps_ctxt->i4_res_id];
 2583|       |
 2584|  65.4k|    ps_mb_params = (dec_mb_info_t *) pv_mb_params;
 2585|  65.4k|    ps_svc_mb_params = (dec_svc_mb_info_t *) pv_svc_mb_params;
 2586|  65.4k|    i4_listx = ps_ctxt->i4_listx;
 2587|       |
 2588|  65.4k|    {
 2589|  65.4k|        WORD32 i4_mb_x, i4_mb_y;
 2590|       |        /* derive the MB_X and MB_Y for the current MB */
 2591|  65.4k|        i4_mb_x = ps_mb_params->u2_mbx;
 2592|  65.4k|        i4_mb_y = ps_mb_params->u2_mby;
 2593|       |
 2594|       |        /* get the colocated position in the refernce layer */
 2595|  65.4k|        i4_ref_x = ps_lyr_mem->pi2_ref_loc_x[i4_mb_x << 4];
 2596|  65.4k|        i4_ref_y = ps_lyr_mem->pi2_ref_loc_y[i4_mb_y << 4];
 2597|  65.4k|        i4_ref_x = CLIP3(0, ((ps_lyr_mem->i4_ref_width) - 1), i4_ref_x);
  ------------------
  |  |   77|  65.4k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 0, False: 65.4k]
  |  |  |  Branch (77:54): [True: 0, False: 65.4k]
  |  |  ------------------
  ------------------
 2598|  65.4k|        i4_ref_y = CLIP3(0, ((ps_lyr_mem->i4_ref_height) - 1), i4_ref_y);
  ------------------
  |  |   77|  65.4k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 0, False: 65.4k]
  |  |  |  Branch (77:54): [True: 319, False: 65.1k]
  |  |  ------------------
  ------------------
 2599|       |
 2600|       |        /* convert into picture units */
 2601|  65.4k|        i4_mb_pic_x = i4_mb_x << 4;
 2602|  65.4k|        i4_mb_pic_y = i4_mb_y << 4;
 2603|  65.4k|    }
 2604|       |
 2605|       |    /* ref layer mb mode */
 2606|  65.4k|    {
 2607|  65.4k|        inter_lyr_mb_prms_t *ps_inter_lyr_mb_prms;
 2608|  65.4k|        WORD32 i4_inter_lyr_mb_prms_stride;
 2609|  65.4k|        WORD32 i4_ref_mb_x, i4_ref_mb_y;
 2610|  65.4k|        WORD8 i1_ref_mb_mode;
 2611|       |
 2612|  65.4k|        ps_inter_lyr_mb_prms = (inter_lyr_mb_prms_t *) ps_lyr_mem->s_ref_mb_mode.pv_buffer;
 2613|  65.4k|        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|  65.4k|        i4_ref_mb_x = (i4_ref_x >> 4);
 2617|  65.4k|        i4_ref_mb_y = (i4_ref_y >> 4);
 2618|       |
 2619|       |        /* get the appropriate mb params in reference layer */
 2620|  65.4k|        ps_inter_lyr_mb_prms += i4_ref_mb_x;
 2621|  65.4k|        ps_inter_lyr_mb_prms += i4_ref_mb_y * i4_inter_lyr_mb_prms_stride;
 2622|  65.4k|        i1_ref_mb_mode = ps_inter_lyr_mb_prms->i1_mb_mode;
 2623|  65.4k|        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|  65.4k|        if(i1_ref_mb_mode > SVC_INTER_MB)
  ------------------
  |  |  114|  65.4k|#define SVC_INTER_MB (1 << 0)       /*!< Intra MBs other than IPCM and I_BL */
  ------------------
  |  Branch (2626:12): [True: 14.1k, False: 51.2k]
  ------------------
 2627|  14.1k|        {
 2628|  14.1k|            if(1 == u1_base_mode_flag)
  ------------------
  |  Branch (2628:16): [True: 13.8k, False: 352]
  ------------------
 2629|  13.8k|            {
 2630|  13.8k|                i4_mb_mode = SVC_IBL_MB;
  ------------------
  |  |  117|  13.8k|#define SVC_IBL_MB (1 << 3)         /*!< I_BL MB always inferred */
  ------------------
 2631|  13.8k|                ps_svc_mb_params->u1_residual_prediction_flag = 0;
 2632|  13.8k|            }
 2633|  14.1k|            return i4_mb_mode;
 2634|  14.1k|        }
 2635|  65.4k|    }
 2636|       |
 2637|       |    /*-----------------------------------------------------------------------*/
 2638|       |    /* Inter MB upsampling process                                           */
 2639|       |    /*-----------------------------------------------------------------------*/
 2640|  51.2k|    {
 2641|  51.2k|        mv_pred_t *ps_motion_pred;
 2642|  51.2k|        WORD32 i4_16x16_flag;
 2643|  51.2k|        WORD32 i4_part_idc;
 2644|  51.2k|        WORD32 i4_blk_idx;
 2645|  51.2k|        WORD32 i4_curr_mot_stride;
 2646|       |
 2647|       |        /* choose the appropriate mv bank pointer and stride */
 2648|  51.2k|        if(1 == u1_base_mode_flag)
  ------------------
  |  Branch (2648:12): [True: 31.2k, False: 20.0k]
  ------------------
 2649|  31.2k|        {
 2650|  31.2k|            i4_mb_mode = SVC_INTER_MB;
  ------------------
  |  |  114|  31.2k|#define SVC_INTER_MB (1 << 0)       /*!< Intra MBs other than IPCM and I_BL */
  ------------------
 2651|  31.2k|        }
 2652|       |
 2653|  51.2k|        ps_motion_pred = ps_ctxt->ps_motion_pred_struct;
 2654|  51.2k|        i4_curr_mot_stride = 4;
 2655|       |
 2656|       |        /* call the motion upsampling for 1st 4x4 */
 2657|  51.2k|        i4_part_idc = (i4_ref_y << 16) + i4_ref_x;
 2658|  51.2k|        i4_16x16_flag = isvcd_interlyr_motion_scale(
 2659|  51.2k|            pv_comp_mode_mv_ctxt, &i4_part_idc, ps_mb_params, ps_motion_pred, i4_listx,
 2660|  51.2k|            (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|  51.2k|        if(i4_16x16_flag)
  ------------------
  |  Branch (2663:12): [True: 0, False: 51.2k]
  ------------------
 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|  51.2k|        else
 2715|  51.2k|        {
 2716|  51.2k|            WORD32 ai4_sub_mb_mode[NUM_MB_PARTS] = {0};
 2717|       |
 2718|       |            /* replicate the motion vectors for 8x8 */
 2719|  51.2k|            isvcd_store_motion_map(ps_motion_pred, ps_motion_pred, 0, i4_curr_mot_stride, 2, 2,
 2720|  51.2k|                                   SVCD_FALSE);
  ------------------
  |  |   45|  51.2k|#define SVCD_FALSE 0
  ------------------
 2721|       |
 2722|  51.2k|            if(2 == i4_listx)
  ------------------
  |  Branch (2722:16): [True: 22.6k, False: 28.6k]
  ------------------
 2723|  22.6k|            {
 2724|  22.6k|                WORD32 i4_indx = 0;
 2725|       |
 2726|       |                /* replicate the motion vectors for 8x8 */
 2727|       |                /* check the 0th partiton reference indices */
 2728|  22.6k|                if(0 <= ps_motion_pred[0].i1_ref_frame[0])
  ------------------
  |  Branch (2728:20): [True: 21.9k, False: 624]
  ------------------
 2729|  21.9k|                {
 2730|  21.9k|                    i4_indx += 1;
 2731|  21.9k|                }
 2732|  22.6k|                if(0 <= ps_motion_pred[0].i1_ref_frame[1])
  ------------------
  |  Branch (2732:20): [True: 7.55k, False: 15.0k]
  ------------------
 2733|  7.55k|                {
 2734|  7.55k|                    i4_indx += 2;
 2735|  7.55k|                }
 2736|       |
 2737|  22.6k|                i4_indx = 3 * PRED_8x8 + (i4_indx - 1);
  ------------------
  |  |  453|  22.6k|#define PRED_8x8    3
  ------------------
 2738|  22.6k|                ai4_sub_mb_mode[0] = g_au1_eb_submb_type[i4_indx];
 2739|  22.6k|            }
 2740|       |
 2741|       |            /* derive the motion vectors and reference indices of 3 rem partitions */
 2742|   205k|            for(i4_blk_idx = 1; i4_blk_idx < NUM_MB_PARTS; i4_blk_idx++)
  ------------------
  |  |   59|   205k|#define NUM_MB_PARTS 4
  ------------------
  |  Branch (2742:33): [True: 153k, False: 51.2k]
  ------------------
 2743|   153k|            {
 2744|   153k|                WORD32 i4_blk_y, i4_blk_x;
 2745|   153k|                mv_pred_t *ps_temp;
 2746|       |
 2747|   153k|                i4_blk_x = i4_blk_idx & 1;
 2748|   153k|                i4_blk_y = i4_blk_idx >> 1;
 2749|       |
 2750|   153k|                ps_temp = ps_motion_pred + (i4_blk_x << 1);
 2751|   153k|                ps_temp += (i4_blk_y * i4_curr_mot_stride << 1);
 2752|       |
 2753|       |                /* store the reference layer positions */
 2754|   153k|                i4_part_idc = ((i4_ref_y + (i4_blk_y << 2)) << 16) + (i4_ref_x + (i4_blk_x << 2));
 2755|   153k|                isvcd_interlyr_motion_scale(pv_comp_mode_mv_ctxt, &i4_part_idc, ps_mb_params,
 2756|   153k|                                            ps_temp, i4_listx, (i4_mb_pic_x + (i4_blk_x << 2) + 1),
 2757|   153k|                                            (i4_mb_pic_y + (i4_blk_y << 2) + 1),
 2758|   153k|                                            ps_dec->ppv_map_ref_idx_to_poc);
 2759|       |
 2760|       |                /* replicate the motion vectors for 8x8 */
 2761|   153k|                isvcd_store_motion_map(ps_temp, ps_temp, 0, i4_curr_mot_stride, 2, 2, SVCD_FALSE);
  ------------------
  |  |   45|   153k|#define SVCD_FALSE 0
  ------------------
 2762|       |
 2763|   153k|                if(2 == i4_listx)
  ------------------
  |  Branch (2763:20): [True: 67.8k, False: 86.0k]
  ------------------
 2764|  67.8k|                {
 2765|  67.8k|                    WORD32 i4_indx = 0;
 2766|       |
 2767|       |                    /* check the 0th partiton reference indices */
 2768|  67.8k|                    if(0 <= ps_temp[0].i1_ref_frame[0])
  ------------------
  |  Branch (2768:24): [True: 65.9k, False: 1.87k]
  ------------------
 2769|  65.9k|                    {
 2770|  65.9k|                        i4_indx += 1;
 2771|  65.9k|                    }
 2772|  67.8k|                    if(0 <= ps_temp[0].i1_ref_frame[1])
  ------------------
  |  Branch (2772:24): [True: 23.2k, False: 44.5k]
  ------------------
 2773|  23.2k|                    {
 2774|  23.2k|                        i4_indx += 2;
 2775|  23.2k|                    }
 2776|       |
 2777|  67.8k|                    i4_indx = 3 * PRED_8x8 + (i4_indx - 1);
  ------------------
  |  |  453|  67.8k|#define PRED_8x8    3
  ------------------
 2778|       |
 2779|  67.8k|                    ai4_sub_mb_mode[i4_blk_idx] = g_au1_eb_submb_type[i4_indx];
 2780|  67.8k|                }
 2781|   153k|            }
 2782|       |
 2783|       |            /* if MB mode has to derivied */
 2784|  51.2k|            if(1 == u1_base_mode_flag)
  ------------------
  |  Branch (2784:16): [True: 31.2k, False: 20.0k]
  ------------------
 2785|  31.2k|            {
 2786|  31.2k|                WORD32 i4_horz_match, i4_vert_match;
 2787|  31.2k|                WORD32 i4_part_size = PRED_8x8;
  ------------------
  |  |  453|  31.2k|#define PRED_8x8    3
  ------------------
 2788|       |
 2789|  31.2k|                mv_pred_t *ps_motion_1;
 2790|  31.2k|                mv_pred_t *ps_motion_2;
 2791|  31.2k|                mv_pred_t *ps_motion_3;
 2792|       |
 2793|  31.2k|                ps_motion_1 = ps_motion_pred + 2;
 2794|  31.2k|                ps_motion_2 = ps_motion_pred + (i4_curr_mot_stride << 1);
 2795|  31.2k|                ps_motion_3 = ps_motion_2 + 2;
 2796|       |
 2797|       |                /* check if the motion in horz direction are same*/
 2798|  31.2k|                i4_horz_match = isvcd_check_motion(ps_motion_pred, ps_motion_1, i4_listx);
 2799|  31.2k|                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|  31.2k|                i4_vert_match = isvcd_check_motion(ps_motion_pred, ps_motion_2, i4_listx);
 2803|  31.2k|                i4_vert_match += isvcd_check_motion(ps_motion_1, ps_motion_3, i4_listx);
 2804|       |
 2805|  31.2k|                ps_mb_part_info->u1_num_part = 4;
 2806|       |
 2807|       |                /* decide the partition size based on the results of matching */
 2808|  31.2k|                if((2 == i4_horz_match) && (2 == i4_vert_match))
  ------------------
  |  Branch (2808:20): [True: 28.5k, False: 2.65k]
  |  Branch (2808:44): [True: 28.0k, False: 544]
  ------------------
 2809|  28.0k|                {
 2810|  28.0k|                    ps_mb_params->u1_mb_type = P_L0_16x16;
 2811|  28.0k|                    i4_part_size = PRED_16x16;
  ------------------
  |  |  450|  28.0k|#define PRED_16x16  0
  ------------------
 2812|  28.0k|                    ps_mb_part_info->u1_num_part = 1;
 2813|  28.0k|                    *pu1_col_info++ = (PRED_16x16 << 6);
  ------------------
  |  |  450|  28.0k|#define PRED_16x16  0
  ------------------
 2814|       |
 2815|  28.0k|                    ps_mb_part_info->i1_ref_idx[0][0] = ps_motion_pred->i1_ref_frame[0];
 2816|  28.0k|                    if(2 == i4_listx)
  ------------------
  |  Branch (2816:24): [True: 11.4k, False: 16.5k]
  ------------------
 2817|  11.4k|                        ps_mb_part_info->i1_ref_idx[1][0] = ps_motion_pred->i1_ref_frame[1];
 2818|       |
 2819|  28.0k|                    ps_part->u1_partwidth = 4;  // interms of 4x4
 2820|  28.0k|                    ps_part->u1_partheight = 4;
 2821|  28.0k|                    ps_part->u1_pred_mode = PRED_L0;
  ------------------
  |  |  483|  28.0k|#define PRED_L0   1
  ------------------
 2822|  28.0k|                    ps_part->u1_is_direct = 0;
 2823|  28.0k|                    ps_part->u1_sub_mb_num = 0;
 2824|  28.0k|                }
 2825|  3.20k|                else if(2 == i4_horz_match)
  ------------------
  |  Branch (2825:25): [True: 544, False: 2.65k]
  ------------------
 2826|    544|                {
 2827|    544|                    ps_mb_params->u1_mb_type = P_L0_L0_16x8;
 2828|    544|                    i4_part_size = PRED_16x8;
  ------------------
  |  |  451|    544|#define PRED_16x8   1
  ------------------
 2829|    544|                    ps_mb_part_info->u1_num_part = 2;
 2830|    544|                    *pu1_col_info++ = (PRED_16x8 << 6);
  ------------------
  |  |  451|    544|#define PRED_16x8   1
  ------------------
 2831|    544|                    *pu1_col_info++ = (PRED_16x8 << 6);
  ------------------
  |  |  451|    544|#define PRED_16x8   1
  ------------------
 2832|       |
 2833|    544|                    ps_mb_part_info->i1_ref_idx[0][0] = ps_motion_pred->i1_ref_frame[0];
 2834|    544|                    ps_mb_part_info->i1_ref_idx[0][1] = ps_motion_pred[8].i1_ref_frame[0];
 2835|    544|                    if(2 == i4_listx)
  ------------------
  |  Branch (2835:24): [True: 284, False: 260]
  ------------------
 2836|    284|                    {
 2837|    284|                        ps_mb_part_info->i1_ref_idx[1][0] = ps_motion_pred->i1_ref_frame[1];
 2838|    284|                        ps_mb_part_info->i1_ref_idx[1][1] = ps_motion_pred[8].i1_ref_frame[1];
 2839|    284|                    }
 2840|    544|                    ps_part->u1_partwidth = 4;  // interms of 4x4
 2841|    544|                    ps_part->u1_partheight = 2;
 2842|    544|                    ps_part->u1_pred_mode = PRED_L0;
  ------------------
  |  |  483|    544|#define PRED_L0   1
  ------------------
 2843|    544|                    ps_part->u1_is_direct = 0;
 2844|    544|                    ps_part->u1_sub_mb_num = 0;
 2845|       |
 2846|    544|                    ps_part++;
 2847|    544|                    ps_part->u1_partwidth = 4;
 2848|    544|                    ps_part->u1_partheight = 2;
 2849|    544|                    ps_part->u1_pred_mode = PRED_L0;
  ------------------
  |  |  483|    544|#define PRED_L0   1
  ------------------
 2850|    544|                    ps_part->u1_is_direct = 0;
 2851|    544|                    ps_part->u1_sub_mb_num = 8;
 2852|    544|                }
 2853|  2.65k|                else if(2 == i4_vert_match)
  ------------------
  |  Branch (2853:25): [True: 996, False: 1.66k]
  ------------------
 2854|    996|                {
 2855|    996|                    ps_mb_params->u1_mb_type = P_L0_L0_8x16;
 2856|    996|                    i4_part_size = PRED_8x16;
  ------------------
  |  |  452|    996|#define PRED_8x16   2
  ------------------
 2857|    996|                    ps_mb_part_info->u1_num_part = 2;
 2858|    996|                    *pu1_col_info++ = (PRED_8x16 << 6);
  ------------------
  |  |  452|    996|#define PRED_8x16   2
  ------------------
 2859|    996|                    *pu1_col_info++ = (PRED_8x16 << 6);
  ------------------
  |  |  452|    996|#define PRED_8x16   2
  ------------------
 2860|       |
 2861|    996|                    ps_mb_part_info->i1_ref_idx[0][0] = ps_motion_pred->i1_ref_frame[0];
 2862|    996|                    ps_mb_part_info->i1_ref_idx[0][1] = ps_motion_pred[2].i1_ref_frame[0];
 2863|    996|                    if(2 == i4_listx)
  ------------------
  |  Branch (2863:24): [True: 831, False: 165]
  ------------------
 2864|    831|                    {
 2865|    831|                        ps_mb_part_info->i1_ref_idx[1][0] = ps_motion_pred->i1_ref_frame[1];
 2866|    831|                        ps_mb_part_info->i1_ref_idx[1][1] = ps_motion_pred[2].i1_ref_frame[1];
 2867|    831|                    }
 2868|    996|                    ps_part->u1_partwidth = 2;  // interms of 4x4
 2869|    996|                    ps_part->u1_partheight = 4;
 2870|    996|                    ps_part->u1_pred_mode = PRED_L0;
  ------------------
  |  |  483|    996|#define PRED_L0   1
  ------------------
 2871|    996|                    ps_part->u1_is_direct = 0;
 2872|    996|                    ps_part->u1_sub_mb_num = 0;
 2873|       |
 2874|    996|                    ps_part++;
 2875|    996|                    ps_part->u1_partwidth = 2;
 2876|    996|                    ps_part->u1_partheight = 4;
 2877|    996|                    ps_part->u1_pred_mode = PRED_L0;
  ------------------
  |  |  483|    996|#define PRED_L0   1
  ------------------
 2878|    996|                    ps_part->u1_is_direct = 0;
 2879|    996|                    ps_part->u1_sub_mb_num = 2;
 2880|    996|                }
 2881|       |
 2882|       |                /* store the part size to the mb params */
 2883|  31.2k|                ps_mb_params->u1_mb_mc_mode = i4_part_size;
 2884|       |
 2885|       |                /* store the sub partition size */
 2886|  31.2k|                if(PRED_8x8 == i4_part_size)
  ------------------
  |  |  453|  31.2k|#define PRED_8x8    3
  ------------------
  |  Branch (2886:20): [True: 1.66k, False: 29.5k]
  ------------------
 2887|  1.66k|                {
 2888|  1.66k|                    UWORD8 u1_ctr;
 2889|       |                    /* for P_MB sub part type is P_L0_8x8*/
 2890|       |
 2891|  1.66k|                    ps_mb_params->u1_mb_type = P_8x8;
 2892|  1.66k|                    ps_mb_part_info->i1_ref_idx[0][0] = ps_motion_pred[0].i1_ref_frame[0];
 2893|  1.66k|                    ps_mb_part_info->i1_ref_idx[0][1] = ps_motion_pred[2].i1_ref_frame[0];
 2894|  1.66k|                    ps_mb_part_info->i1_ref_idx[0][2] = ps_motion_pred[8].i1_ref_frame[0];
 2895|  1.66k|                    ps_mb_part_info->i1_ref_idx[0][3] = ps_motion_pred[10].i1_ref_frame[0];
 2896|  1.66k|                    if(2 == i4_listx)
  ------------------
  |  Branch (2896:24): [True: 1.00k, False: 660]
  ------------------
 2897|  1.00k|                    {
 2898|  1.00k|                        ps_mb_part_info->i1_ref_idx[1][0] = ps_motion_pred[0].i1_ref_frame[1];
 2899|  1.00k|                        ps_mb_part_info->i1_ref_idx[1][1] = ps_motion_pred[2].i1_ref_frame[1];
 2900|  1.00k|                        ps_mb_part_info->i1_ref_idx[1][2] = ps_motion_pred[8].i1_ref_frame[1];
 2901|  1.00k|                        ps_mb_part_info->i1_ref_idx[1][3] = ps_motion_pred[10].i1_ref_frame[1];
 2902|  1.00k|                    }
 2903|       |
 2904|  8.30k|                    for(u1_ctr = 0; u1_ctr < 4; u1_ctr++)
  ------------------
  |  Branch (2904:37): [True: 6.64k, False: 1.66k]
  ------------------
 2905|  6.64k|                    {
 2906|  6.64k|                        *pu1_col_info++ = (PRED_8x8 << 6);
  ------------------
  |  |  453|  6.64k|#define PRED_8x8    3
  ------------------
 2907|       |
 2908|  6.64k|                        ps_part->u1_partwidth = 2;  // interms of 4x4
 2909|  6.64k|                        ps_part->u1_partheight = 2;
 2910|  6.64k|                        ps_part->u1_pred_mode = PRED_L0;
  ------------------
  |  |  483|  6.64k|#define PRED_L0   1
  ------------------
 2911|  6.64k|                        ps_part->u1_is_direct = 0;
 2912|  6.64k|                        ps_part->u1_sub_mb_num = (u1_ctr & 0x01) * 2 + (u1_ctr >> 1) * 8;
 2913|  6.64k|                        ps_part++;
 2914|  6.64k|                    }
 2915|  1.66k|                }
 2916|       |
 2917|  31.2k|                if(2 == i4_listx)
  ------------------
  |  Branch (2917:20): [True: 13.6k, False: 17.6k]
  ------------------
 2918|  13.6k|                {
 2919|  13.6k|                    ps_part = (parse_part_params_t *) pv_part;
 2920|  13.6k|                    pu1_col_info = ps_mb_part_info->u1_col_info;
 2921|  13.6k|                    isvcd_interlyr_mbmode_pred_bmb(ps_ctxt, ps_motion_pred, i4_curr_mot_stride,
 2922|  13.6k|                                                   i4_part_size, &ai4_sub_mb_mode[0], ps_mb_params,
 2923|  13.6k|                                                   ps_part, pu1_col_info);
 2924|  13.6k|                }
 2925|  31.2k|            } /* end of mode derivation */
 2926|  20.0k|            else
 2927|  20.0k|            {
 2928|  20.0k|                isvcd_populate_ref_idx(ps_mb_params, ps_svc_mb_params, ps_motion_pred,
 2929|  20.0k|                                       ps_mb_part_info, i4_listx);
 2930|       |
 2931|  20.0k|            } /* non 16x16 mv mode derivation */
 2932|  51.2k|        }
 2933|  51.2k|    }
 2934|  51.2k|    return i4_mb_mode;
 2935|  51.2k|}
isvcd_compute_scaled_offsets:
 2968|  34.7k|{
 2969|  34.7k|    WORD32 i4_offset_x, i4_offset_y;
 2970|  34.7k|    UWORD32 i4_scaled_ref_lyr_width;
 2971|  34.7k|    UWORD32 i4_scaled_ref_lyr_height;
 2972|  34.7k|    UWORD32 i4_ref_lyr_width;
 2973|  34.7k|    UWORD32 i4_ref_lyr_height;
 2974|  34.7k|    UWORD32 i4_shift_x, i4_shift_y;
 2975|  34.7k|    UWORD32 i4_scale_x, i4_scale_y;
 2976|  34.7k|    WORD32 i4_cntr;
 2977|  34.7k|    WORD32 i4_scale_add_x, i4_scale_add_y;
 2978|  34.7k|    WORD32 i4_curr_lyr_width, i4_curr_lyr_height;
 2979|       |
 2980|  34.7k|    if((NULL == ps_curr_res_prms) || (NULL == ps_ref_res_prms) || (NULL == pi2_offset_x) ||
  ------------------
  |  Branch (2980:8): [True: 0, False: 34.7k]
  |  Branch (2980:38): [True: 0, False: 34.7k]
  |  Branch (2980:67): [True: 0, False: 34.7k]
  ------------------
 2981|  34.7k|       (NULL == pi2_offset_y))
  ------------------
  |  Branch (2981:8): [True: 0, False: 34.7k]
  ------------------
 2982|      0|    {
 2983|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 2984|      0|    }
 2985|       |    /* initial calculation */
 2986|  34.7k|    i4_offset_x = ps_curr_res_prms->s_ref_lyr_scaled_offset.i2_left;
 2987|  34.7k|    i4_offset_y = ps_curr_res_prms->s_ref_lyr_scaled_offset.i2_top;
 2988|       |
 2989|       |    /* get the width and height */
 2990|  34.7k|    i4_scaled_ref_lyr_width = ps_curr_res_prms->u2_scaled_ref_width;
 2991|  34.7k|    i4_scaled_ref_lyr_height = ps_curr_res_prms->u2_scaled_ref_height;
 2992|  34.7k|    i4_ref_lyr_width = ps_ref_res_prms->i4_res_width;
 2993|  34.7k|    i4_ref_lyr_height = ps_ref_res_prms->i4_res_height;
 2994|  34.7k|    i4_curr_lyr_width = ps_curr_res_prms->i4_res_width;
 2995|  34.7k|    i4_curr_lyr_height = ps_curr_res_prms->i4_res_height;
 2996|       |
 2997|       |    /* derive shift x and y based on level idd */
 2998|  34.7k|    if(u1_level_idc <= 30)
  ------------------
  |  Branch (2998:8): [True: 32.7k, False: 2.03k]
  ------------------
 2999|  32.7k|    {
 3000|  32.7k|        i4_shift_x = 16;
 3001|  32.7k|        i4_shift_y = 16;
 3002|  32.7k|    }
 3003|  2.03k|    else
 3004|  2.03k|    {
 3005|  2.03k|        i4_shift_x = 31 - isvcd_get_ceil_log2(i4_ref_lyr_width);
 3006|  2.03k|        i4_shift_y = 31 - isvcd_get_ceil_log2(i4_ref_lyr_height);
 3007|  2.03k|    }
 3008|       |
 3009|       |    /* assert on max ranges of width and shift values */
 3010|  34.7k|    if((i4_ref_lyr_width > H264_MAX_FRAME_WIDTH) ||
  ------------------
  |  |   39|  34.7k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
  |  Branch (3010:8): [True: 0, False: 34.7k]
  ------------------
 3011|  34.7k|       (i4_scaled_ref_lyr_width > H264_MAX_FRAME_WIDTH) ||
  ------------------
  |  |   39|  34.7k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
  |  Branch (3011:8): [True: 0, False: 34.7k]
  ------------------
 3012|  34.7k|       (i4_ref_lyr_height > H264_MAX_FRAME_HEIGHT) ||
  ------------------
  |  |   40|  34.7k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
  |  Branch (3012:8): [True: 0, False: 34.7k]
  ------------------
 3013|  34.7k|       (i4_scaled_ref_lyr_height > H264_MAX_FRAME_HEIGHT) ||
  ------------------
  |  |   40|  34.7k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
  |  Branch (3013:8): [True: 0, False: 34.7k]
  ------------------
 3014|  34.7k|       (i4_curr_lyr_width > H264_MAX_FRAME_WIDTH) || (i4_curr_lyr_height > H264_MAX_FRAME_HEIGHT))
  ------------------
  |  |   39|  34.7k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
                     (i4_curr_lyr_width > H264_MAX_FRAME_WIDTH) || (i4_curr_lyr_height > H264_MAX_FRAME_HEIGHT))
  ------------------
  |  |   40|  34.7k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
  |  Branch (3014:8): [True: 0, False: 34.7k]
  |  Branch (3014:54): [True: 0, False: 34.7k]
  ------------------
 3015|      0|    {
 3016|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 3017|      0|    }
 3018|       |
 3019|       |    /* calculate scale factor x and y */
 3020|  34.7k|    i4_scale_x = (((UWORD32) i4_ref_lyr_width << i4_shift_x) + (i4_scaled_ref_lyr_width >> 1)) /
 3021|  34.7k|                 i4_scaled_ref_lyr_width;
 3022|       |
 3023|  34.7k|    i4_scale_y = (((UWORD32) i4_ref_lyr_height << i4_shift_y) + (i4_scaled_ref_lyr_height >> 1)) /
 3024|  34.7k|                 i4_scaled_ref_lyr_height;
 3025|       |
 3026|       |    /* calcualte the values to be added based on left and top offset */
 3027|  34.7k|    i4_scale_add_x = (1 << (i4_shift_x - 1)) - (i4_offset_x * (WORD32) i4_scale_x);
 3028|  34.7k|    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.97M|    for(i4_cntr = 0; i4_cntr < i4_curr_lyr_width; i4_cntr++)
  ------------------
  |  Branch (3031:22): [True: 1.94M, False: 34.7k]
  ------------------
 3032|  1.94M|    {
 3033|  1.94M|        WORD32 i4_ref_x;
 3034|  1.94M|        i4_ref_x = (i4_cntr * i4_scale_x + i4_scale_add_x) >> i4_shift_x;
 3035|  1.94M|        *pi2_offset_x++ = (WORD16) i4_ref_x;
 3036|  1.94M|    }
 3037|       |
 3038|       |    /* derive the projected locations in the reference layer */
 3039|  5.18M|    for(i4_cntr = 0; i4_cntr < i4_curr_lyr_height; i4_cntr++)
  ------------------
  |  Branch (3039:22): [True: 5.15M, False: 34.7k]
  ------------------
 3040|  5.15M|    {
 3041|  5.15M|        WORD32 i4_ref_y;
 3042|  5.15M|        i4_ref_y = (i4_cntr * i4_scale_y + i4_scale_add_y) >> i4_shift_y;
 3043|  5.15M|        *pi2_offset_y++ = (WORD16) i4_ref_y;
 3044|  5.15M|    }
 3045|  34.7k|    return OK;
  ------------------
  |  |  114|  34.7k|#define OK        0
  ------------------
 3046|  34.7k|}
isvcd_comp_mode_mv_res_init:
 3077|   138k|{
 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|   138k|    mode_motion_ctxt_t *ps_ctxt;
 3086|   138k|    mode_motion_lyr_ctxt *ps_lyr_mem;
 3087|   138k|    dec_seq_params_t *ps_sps;
 3088|   138k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec = (svc_dec_lyr_struct_t *) pv_svc_dec;
 3089|   138k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
 3090|   138k|    svc_dec_lyr_struct_t *ps_svc_dec_ref_layer;
 3091|   138k|    WORD32 ret;
 3092|   138k|    WORD32 i4_scaled_ref_lyr_width;
 3093|   138k|    WORD32 i4_scaled_ref_lyr_height;
 3094|   138k|    WORD32 i4_ref_lyr_width;
 3095|   138k|    WORD32 i4_ref_lyr_height;
 3096|   138k|    res_prms_t *ps_curr_lyr_res_prms = &ps_svc_lyr_dec->s_res_prms;
 3097|       |
 3098|   138k|    ps_svc_dec_ref_layer = ps_svc_lyr_dec->ps_dec_svc_ref_layer;
 3099|   138k|    if(NULL == ps_curr_lyr_res_prms)
  ------------------
  |  Branch (3099:8): [True: 0, False: 138k]
  ------------------
 3100|      0|    {
 3101|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 3102|      0|    }
 3103|       |
 3104|   138k|    ps_ctxt = (mode_motion_ctxt_t *) ps_svc_lyr_dec->pv_mode_mv_sample_ctxt;
 3105|   138k|    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|   138k|    if(SVCD_TRUE == ps_svc_lyr_dec->u1_base_res_flag)
  ------------------
  |  |   46|   138k|#define SVCD_TRUE 1
  ------------------
  |  Branch (3108:8): [True: 103k, False: 34.7k]
  ------------------
 3109|   103k|    {
 3110|   103k|        ps_ctxt->i4_res_id = -1;
 3111|   103k|        ps_ctxt->i4_ref_width = ps_curr_lyr_res_prms->i4_res_width;
 3112|   103k|        ps_ctxt->i4_ref_height = ps_curr_lyr_res_prms->i4_res_height;
 3113|   103k|        return OK;
  ------------------
  |  |  114|   103k|#define OK        0
  ------------------
 3114|   103k|    }
 3115|       |
 3116|       |    /* call the function which populates the projected ref locations */
 3117|  34.7k|    ps_sps = ps_dec->ps_cur_sps;
 3118|       |
 3119|       |    /* store the res id appropriately */
 3120|  34.7k|    ps_ctxt->i4_res_id = ps_svc_lyr_dec->u1_layer_id - 1;
 3121|       |
 3122|       |    /* get the current layer ctxt */
 3123|  34.7k|    ps_lyr_mem = &ps_ctxt->as_res_lyr_mem[ps_ctxt->i4_res_id];
 3124|       |
 3125|       |    /* store the current and reference res params to the context */
 3126|  34.7k|    ps_lyr_mem->ps_curr_lyr_res_prms = ps_curr_lyr_res_prms;
 3127|       |
 3128|       |    /* store the reference layer mv bank pointer */
 3129|  34.7k|    ps_lyr_mem->pv_ref_mv_bank_l0 = ps_svc_dec_ref_layer->s_dec.s_cur_pic.ps_mv;
 3130|       |
 3131|       |    /* store the reference layer mb mode pointer */
 3132|  34.7k|    ps_lyr_mem->s_ref_mb_mode.pv_buffer = ps_svc_dec_ref_layer->ps_inter_lyr_mb_prms_frm_start;
 3133|  34.7k|    ps_lyr_mem->s_ref_mb_mode.i4_num_element_stride =
 3134|  34.7k|        ps_svc_dec_ref_layer->u2_inter_lyr_mb_prms_stride;
 3135|  34.7k|    ps_lyr_mem->s_ref_mb_mode.i4_element_size = sizeof(inter_lyr_mb_prms_t);
 3136|       |
 3137|       |    /* check for recomputation of mapping required */
 3138|  34.7k|    if(SVCD_TRUE == ps_curr_lyr_res_prms->u1_remap_req_flag)
  ------------------
  |  |   46|  34.7k|#define SVCD_TRUE 1
  ------------------
  |  Branch (3138:8): [True: 34.7k, False: 0]
  ------------------
 3139|  34.7k|    {
 3140|  34.7k|        res_prms_t s_ref_res_prms = {0};
 3141|       |
 3142|       |        /* store the reference layer resolution width and height */
 3143|  34.7k|        s_ref_res_prms.i4_res_width = ps_ctxt->i4_ref_width;
 3144|  34.7k|        s_ref_res_prms.i4_res_height = ps_ctxt->i4_ref_height;
 3145|       |
 3146|       |        /* call projection map calculation function */
 3147|  34.7k|        ret = isvcd_compute_scaled_offsets(ps_curr_lyr_res_prms, &s_ref_res_prms,
 3148|  34.7k|                                           ps_lyr_mem->pi2_ref_loc_x, ps_lyr_mem->pi2_ref_loc_y,
 3149|  34.7k|                                           ps_sps->u1_level_idc);
 3150|  34.7k|        if(OK != ret)
  ------------------
  |  |  114|  34.7k|#define OK        0
  ------------------
  |  Branch (3150:12): [True: 0, False: 34.7k]
  ------------------
 3151|      0|        {
 3152|      0|            return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 3153|      0|        }
 3154|       |
 3155|       |        /* derive the scaling variables */
 3156|  34.7k|        ps_lyr_mem->i4_offset_x = ps_curr_lyr_res_prms->s_ref_lyr_scaled_offset.i2_left;
 3157|       |
 3158|  34.7k|        ps_lyr_mem->i4_offset_y = ps_curr_lyr_res_prms->s_ref_lyr_scaled_offset.i2_top;
 3159|       |
 3160|       |        /* get the width and heights */
 3161|  34.7k|        i4_scaled_ref_lyr_width = ps_curr_lyr_res_prms->u2_scaled_ref_width;
 3162|  34.7k|        i4_scaled_ref_lyr_height = ps_curr_lyr_res_prms->u2_scaled_ref_height;
 3163|  34.7k|        i4_ref_lyr_width = ps_ctxt->i4_ref_width;
 3164|  34.7k|        i4_ref_lyr_height = ps_ctxt->i4_ref_height;
 3165|       |
 3166|       |        /*store the reference layer width adn height */
 3167|  34.7k|        ps_lyr_mem->i4_ref_width = ps_ctxt->i4_ref_width;
 3168|  34.7k|        ps_lyr_mem->i4_ref_height = ps_ctxt->i4_ref_height;
 3169|       |
 3170|  34.7k|        if((i4_ref_lyr_width > H264_MAX_FRAME_WIDTH) || (i4_ref_lyr_width <= 0)) return NOT_OK;
  ------------------
  |  |   39|  34.7k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
                      if((i4_ref_lyr_width > H264_MAX_FRAME_WIDTH) || (i4_ref_lyr_width <= 0)) return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  |  Branch (3170:12): [True: 0, False: 34.7k]
  |  Branch (3170:57): [True: 0, False: 34.7k]
  ------------------
 3171|  34.7k|        if((i4_scaled_ref_lyr_width > H264_MAX_FRAME_WIDTH) || (i4_scaled_ref_lyr_width <= 0))
  ------------------
  |  |   39|  34.7k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
  |  Branch (3171:12): [True: 0, False: 34.7k]
  |  Branch (3171:64): [True: 0, False: 34.7k]
  ------------------
 3172|      0|            return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 3173|  34.7k|        if((i4_ref_lyr_height > H264_MAX_FRAME_HEIGHT) || (i4_ref_lyr_height <= 0)) return NOT_OK;
  ------------------
  |  |   40|  34.7k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
                      if((i4_ref_lyr_height > H264_MAX_FRAME_HEIGHT) || (i4_ref_lyr_height <= 0)) return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  |  Branch (3173:12): [True: 0, False: 34.7k]
  |  Branch (3173:59): [True: 0, False: 34.7k]
  ------------------
 3174|  34.7k|        if((i4_scaled_ref_lyr_height > H264_MAX_FRAME_HEIGHT) || (i4_scaled_ref_lyr_height <= 0))
  ------------------
  |  |   40|  34.7k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
  |  Branch (3174:12): [True: 0, False: 34.7k]
  |  Branch (3174:66): [True: 0, False: 34.7k]
  ------------------
 3175|      0|            return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 3176|       |
 3177|       |        /* derivation of variables for dyadic cases cropping should be MB aligned */
 3178|       |        /* default values for flags */
 3179|  34.7k|        ps_lyr_mem->pf_inter_lyr_pred = &isvcd_compute_interlyr_motion_mode;
 3180|       |
 3181|  34.7k|        if(SVCD_TRUE == ps_curr_lyr_res_prms->u1_dyadic_flag)
  ------------------
  |  |   46|  34.7k|#define SVCD_TRUE 1
  ------------------
  |  Branch (3181:12): [True: 17.1k, False: 17.5k]
  ------------------
 3182|  17.1k|        {
 3183|  17.1k|            ps_lyr_mem->pf_inter_lyr_pred = &isvcd_interlyr_motion_mode_pred_dyadic;
 3184|  17.1k|        }
 3185|       |
 3186|       |        /* Store the Dyadic flag */
 3187|  34.7k|        ps_lyr_mem->i4_dyadic_flag = ps_curr_lyr_res_prms->u1_dyadic_flag;
 3188|       |
 3189|       |        /* derive the scaling factors for motion upscaling */
 3190|       |        /* this is derived assuming no crop change flag is present */
 3191|  34.7k|        ps_lyr_mem->i4_scale_mv_x =
 3192|  34.7k|            ((i4_scaled_ref_lyr_width << 16) + (i4_ref_lyr_width >> 1)) / i4_ref_lyr_width;
 3193|       |
 3194|  34.7k|        ps_lyr_mem->i4_scale_mv_y =
 3195|  34.7k|            ((i4_scaled_ref_lyr_height << 16) + (i4_ref_lyr_height >> 1)) / i4_ref_lyr_height;
 3196|  34.7k|    }
 3197|      0|    else
 3198|      0|    {
 3199|       |        /* should take false value */
 3200|      0|        if(SVCD_FALSE != ps_curr_lyr_res_prms->u1_remap_req_flag)
  ------------------
  |  |   45|      0|#define SVCD_FALSE 0
  ------------------
  |  Branch (3200:12): [True: 0, False: 0]
  ------------------
 3201|      0|        {
 3202|      0|            return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 3203|      0|        }
 3204|      0|    }
 3205|       |
 3206|       |    /* store the current layer width and height to context */
 3207|  34.7k|    ps_ctxt->i4_ref_width = ps_curr_lyr_res_prms->i4_res_width;
 3208|  34.7k|    ps_ctxt->i4_ref_height = ps_curr_lyr_res_prms->i4_res_height;
 3209|       |
 3210|  34.7k|    return OK;
  ------------------
  |  |  114|  34.7k|#define OK        0
  ------------------
 3211|  34.7k|}

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

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

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

isvcd_parse_bmb_ref_index_cavlc_range1:
   90|  4.28k|{
   91|  4.28k|    UWORD32 u4_i;
   92|  4.28k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
   93|  4.28k|    UWORD32 *pu4_bitstream_off = &ps_bitstrm->u4_ofst;
   94|  4.28k|    UNUSED(u4_num_ref_idx_active_minus1);
  ------------------
  |  |   45|  4.28k|#define UNUSED(x) ((void)(x))
  ------------------
   95|  10.2k|    for(u4_i = 0; u4_i < u4_num_part; u4_i++)
  ------------------
  |  Branch (95:19): [True: 6.01k, False: 4.28k]
  ------------------
   96|  6.01k|    {
   97|  6.01k|        if(pi1_ref_idx[u4_i] > -1 && (((*pu1_motion_prediction_flag >> u4_i) & 0x01) == 0))
  ------------------
  |  Branch (97:12): [True: 2.30k, False: 3.70k]
  |  Branch (97:38): [True: 903, False: 1.40k]
  ------------------
   98|    903|        {
   99|    903|            UWORD32 u4_ref_idx;
  100|    903|            u4_ref_idx = ih264d_tev_range1(pu4_bitstream_off, pu4_bitstrm_buf);
  101|       |
  102|       |            /* Storing Reference Idx Information */
  103|    903|            pi1_ref_idx[u4_i] = (WORD8) u4_ref_idx;
  104|    903|        }
  105|  6.01k|    }
  106|  4.28k|}
isvcd_parse_bmb_ref_index_cavlc:
  138|  12.5k|{
  139|  12.5k|    UWORD32 u4_i;
  140|  12.5k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
  141|  12.5k|    UWORD32 *pu4_bitstream_off = &ps_bitstrm->u4_ofst;
  142|       |
  143|  32.1k|    for(u4_i = 0; u4_i < u4_num_part; u4_i++)
  ------------------
  |  Branch (143:19): [True: 21.9k, False: 10.2k]
  ------------------
  144|  21.9k|    {
  145|  21.9k|        if(pi1_ref_idx[u4_i] > -1 && (((*pu1_motion_prediction_flag >> u4_i) & 0x01) == 0))
  ------------------
  |  Branch (145:12): [True: 10.9k, False: 10.9k]
  |  Branch (145:38): [True: 6.87k, False: 4.03k]
  ------------------
  146|  6.87k|        {
  147|  6.87k|            UWORD32 u4_ref_idx;
  148|       |            // inlining ih264d_uev
  149|  6.87k|            UWORD32 u4_bitstream_offset = *pu4_bitstream_off;
  150|  6.87k|            UWORD32 u4_word, u4_ldz;
  151|       |
  152|       |            /***************************************************************/
  153|       |            /* Find leading zeros in next 32 bits                          */
  154|       |            /***************************************************************/
  155|  6.87k|            NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  6.87k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  6.87k|{                                                                           \
  |  |  152|  6.87k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  6.87k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  6.87k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  6.87k|                                                                            \
  |  |  156|  6.87k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  6.87k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 6.36k, False: 505]
  |  |  ------------------
  |  |  158|  6.87k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  6.36k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  6.87k|}
  ------------------
  156|  6.87k|            u4_ldz = CLZ(u4_word);
  157|       |            /* Flush the ps_bitstrm */
  158|  6.87k|            u4_bitstream_offset += (u4_ldz + 1);
  159|       |            /* Read the suffix from the ps_bitstrm */
  160|  6.87k|            u4_word = 0;
  161|  6.87k|            if(u4_ldz) GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  5.88k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  5.88k|{                                                                           \
  |  |  122|  5.88k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  5.88k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  5.88k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  5.88k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  5.88k|                                                                            \
  |  |  127|  5.88k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 5.44k, False: 434]
  |  |  ------------------
  |  |  128|  5.88k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  5.44k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  5.88k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  5.88k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  5.88k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  5.88k|}                                                                           \
  ------------------
  |  Branch (161:16): [True: 5.88k, False: 992]
  ------------------
  162|  6.87k|            *pu4_bitstream_off = u4_bitstream_offset;
  163|  6.87k|            u4_ref_idx = ((1 << u4_ldz) + u4_word - 1);
  164|       |            // inlining ih264d_uev
  165|  6.87k|            if(u4_ref_idx > u4_num_ref_idx_active_minus1) return ERROR_REF_IDX;
  ------------------
  |  Branch (165:16): [True: 2.30k, False: 4.56k]
  ------------------
  166|       |
  167|       |            /* Storing Reference Idx Information */
  168|  4.56k|            pi1_ref_idx[u4_i] = (WORD8) u4_ref_idx;
  169|  4.56k|        }
  170|  21.9k|    }
  171|  10.2k|    return OK;
  ------------------
  |  |  114|  10.2k|#define OK        0
  ------------------
  172|  12.5k|}
isvcd_parse_pmb_ref_index_cavlc:
  205|  8.67k|{
  206|  8.67k|    UWORD32 u4_i;
  207|  8.67k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
  208|  8.67k|    UWORD32 *pu4_bitstream_off = &ps_bitstrm->u4_ofst;
  209|       |
  210|  22.4k|    for(u4_i = 0; u4_i < u4_num_part; u4_i++)
  ------------------
  |  Branch (210:19): [True: 13.8k, False: 8.50k]
  ------------------
  211|  13.8k|    {
  212|  13.8k|        if(((*pu1_motion_prediction_flag >> u4_i) & 0x01) == 0)
  ------------------
  |  Branch (212:12): [True: 7.00k, False: 6.89k]
  ------------------
  213|  7.00k|        {
  214|  7.00k|            UWORD32 u4_ref_idx;
  215|       |            // Inlined ih264d_uev
  216|  7.00k|            UWORD32 u4_bitstream_offset = *pu4_bitstream_off;
  217|  7.00k|            UWORD32 u4_word, u4_ldz;
  218|       |
  219|       |            /***************************************************************/
  220|       |            /* Find leading zeros in next 32 bits                          */
  221|       |            /***************************************************************/
  222|  7.00k|            NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  7.00k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  7.00k|{                                                                           \
  |  |  152|  7.00k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  7.00k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  7.00k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  7.00k|                                                                            \
  |  |  156|  7.00k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  7.00k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 6.62k, False: 379]
  |  |  ------------------
  |  |  158|  7.00k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  6.62k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  7.00k|}
  ------------------
  223|  7.00k|            u4_ldz = CLZ(u4_word);
  224|       |            /* Flush the ps_bitstrm */
  225|  7.00k|            u4_bitstream_offset += (u4_ldz + 1);
  226|       |            /* Read the suffix from the ps_bitstrm */
  227|  7.00k|            u4_word = 0;
  228|  7.00k|            if(u4_ldz) GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  2.73k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  2.73k|{                                                                           \
  |  |  122|  2.73k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  2.73k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  2.73k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  2.73k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  2.73k|                                                                            \
  |  |  127|  2.73k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 2.41k, False: 318]
  |  |  ------------------
  |  |  128|  2.73k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  2.41k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  2.73k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  2.73k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  2.73k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  2.73k|}                                                                           \
  ------------------
  |  Branch (228:16): [True: 2.73k, False: 4.27k]
  ------------------
  229|  7.00k|            *pu4_bitstream_off = u4_bitstream_offset;
  230|  7.00k|            u4_ref_idx = ((1 << u4_ldz) + u4_word - 1);
  231|       |
  232|       |            // Inlined ih264d_uev
  233|  7.00k|            if(u4_ref_idx > u4_num_ref_idx_active_minus1) return ERROR_REF_IDX;
  ------------------
  |  Branch (233:16): [True: 170, False: 6.83k]
  ------------------
  234|       |
  235|       |            /* Storing Reference Idx Information */
  236|  6.83k|            pi1_ref_idx[u4_i] = (WORD8) u4_ref_idx;
  237|  6.83k|        }
  238|  13.8k|    }
  239|  8.50k|    return OK;
  ------------------
  |  |  114|  8.50k|#define OK        0
  ------------------
  240|  8.67k|}
isvcd_parse_pmb_ref_index_cavlc_range1:
  272|  3.24k|{
  273|  3.24k|    UWORD32 u4_i;
  274|  3.24k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
  275|  3.24k|    UWORD32 *pu4_bitstream_off = &ps_bitstrm->u4_ofst;
  276|  3.24k|    UNUSED(u4_num_ref_idx_active_minus1);
  ------------------
  |  |   45|  3.24k|#define UNUSED(x) ((void)(x))
  ------------------
  277|  8.74k|    for(u4_i = 0; u4_i < u4_num_part; u4_i++)
  ------------------
  |  Branch (277:19): [True: 5.50k, False: 3.24k]
  ------------------
  278|  5.50k|    {
  279|  5.50k|        if(((*pu1_motion_prediction_flag >> u4_i) & 0x01) == 0)
  ------------------
  |  Branch (279:12): [True: 1.78k, False: 3.72k]
  ------------------
  280|  1.78k|        {
  281|  1.78k|            UWORD32 u4_ref_idx;
  282|  1.78k|            u4_ref_idx = ih264d_tev_range1(pu4_bitstream_off, pu4_bitstrm_buf);
  283|       |
  284|       |            /* Storing Reference Idx Information */
  285|  1.78k|            pi1_ref_idx[u4_i] = (WORD8) u4_ref_idx;
  286|  1.78k|        }
  287|  5.50k|    }
  288|  3.24k|}

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

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

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

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

isvcd_verify_level:
   95|   149k|{
   96|   149k|    switch(u1_level_idc)
   97|   149k|    {
   98|    399|        case H264_LEVEL_1_0:
  ------------------
  |  |  291|    399|#define H264_LEVEL_1_0     10
  ------------------
  |  Branch (98:9): [True: 399, False: 149k]
  ------------------
   99|  37.3k|        case H264_LEVEL_1_1:
  ------------------
  |  |  292|  37.3k|#define H264_LEVEL_1_1     11
  ------------------
  |  Branch (99:9): [True: 36.9k, False: 112k]
  ------------------
  100|  41.6k|        case H264_LEVEL_1_2:
  ------------------
  |  |  293|  41.6k|#define H264_LEVEL_1_2     12
  ------------------
  |  Branch (100:9): [True: 4.32k, False: 145k]
  ------------------
  101|  44.1k|        case H264_LEVEL_1_3:
  ------------------
  |  |  294|  44.1k|#define H264_LEVEL_1_3     13
  ------------------
  |  Branch (101:9): [True: 2.45k, False: 147k]
  ------------------
  102|  96.8k|        case H264_LEVEL_2_0:
  ------------------
  |  |  295|  96.8k|#define H264_LEVEL_2_0     20
  ------------------
  |  Branch (102:9): [True: 52.7k, False: 96.8k]
  ------------------
  103|   104k|        case H264_LEVEL_2_1:
  ------------------
  |  |  296|   104k|#define H264_LEVEL_2_1     21
  ------------------
  |  Branch (103:9): [True: 7.87k, False: 141k]
  ------------------
  104|   105k|        case H264_LEVEL_2_2:
  ------------------
  |  |  297|   105k|#define H264_LEVEL_2_2     22
  ------------------
  |  Branch (104:9): [True: 837, False: 148k]
  ------------------
  105|   109k|        case H264_LEVEL_3_0:
  ------------------
  |  |  298|   109k|#define H264_LEVEL_3_0     30
  ------------------
  |  Branch (105:9): [True: 3.95k, False: 145k]
  ------------------
  106|   110k|        case H264_LEVEL_3_1:
  ------------------
  |  |  299|   110k|#define H264_LEVEL_3_1     31
  ------------------
  |  Branch (106:9): [True: 1.39k, False: 148k]
  ------------------
  107|   129k|        case H264_LEVEL_3_2:
  ------------------
  |  |  300|   129k|#define H264_LEVEL_3_2     32
  ------------------
  |  Branch (107:9): [True: 18.1k, False: 131k]
  ------------------
  108|   143k|        case H264_LEVEL_4_0:
  ------------------
  |  |  301|   143k|#define H264_LEVEL_4_0     40
  ------------------
  |  Branch (108:9): [True: 14.5k, False: 135k]
  ------------------
  109|   145k|        case H264_LEVEL_4_1:
  ------------------
  |  |  302|   145k|#define H264_LEVEL_4_1     41
  ------------------
  |  Branch (109:9): [True: 2.00k, False: 147k]
  ------------------
  110|   149k|        case H264_LEVEL_4_2:
  ------------------
  |  |  303|   149k|#define H264_LEVEL_4_2     42
  ------------------
  |  Branch (110:9): [True: 3.59k, False: 145k]
  ------------------
  111|   149k|        case H264_LEVEL_5_0:
  ------------------
  |  |  304|   149k|#define H264_LEVEL_5_0     50
  ------------------
  |  Branch (111:9): [True: 0, False: 149k]
  ------------------
  112|   149k|        case H264_LEVEL_5_1:
  ------------------
  |  |  305|   149k|#define H264_LEVEL_5_1     51
  ------------------
  |  Branch (112:9): [True: 0, False: 149k]
  ------------------
  113|   149k|            return OK;
  ------------------
  |  |  114|   149k|#define OK        0
  ------------------
  114|    311|        default:
  ------------------
  |  Branch (114:9): [True: 311, False: 149k]
  ------------------
  115|    311|            return NOT_OK;
  ------------------
  |  |  116|    311|#define NOT_OK    -1
  ------------------
  116|   149k|    }
  117|   149k|}
isvcd_start_of_pic:
  133|   141k|{
  134|   141k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
  135|   141k|    pocstruct_t *ps_prev_poc = &ps_dec->s_cur_pic_poc;
  136|   141k|    pocstruct_t *ps_cur_poc = ps_temp_poc;
  137|       |
  138|   141k|    dec_slice_params_t *ps_cur_slice = ps_dec->ps_cur_slice;
  139|   141k|    dec_seq_params_t *ps_seq = ps_dec->ps_cur_sps;
  140|   141k|    UWORD8 u1_bottom_field_flag = ps_cur_slice->u1_bottom_field_flag;
  141|   141k|    UWORD8 u1_field_pic_flag = ps_cur_slice->u1_field_pic_flag;
  142|       |    /* high profile related declarations */
  143|   141k|    WORD32 ret;
  144|       |
  145|   141k|    H264_MUTEX_LOCK(&ps_dec->process_disp_mutex);
  146|       |
  147|   141k|    if(u1_field_pic_flag == 1)
  ------------------
  |  Branch (147:8): [True: 0, False: 141k]
  ------------------
  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|   141k|    if(check_app_out_buf_size(ps_dec) != IV_SUCCESS) return IVD_DISP_FRM_ZERO_OP_BUF_SIZE;
  ------------------
  |  Branch (154:8): [True: 1.40k, False: 139k]
  ------------------
  155|       |
  156|   139k|    ps_prev_poc->i4_pic_order_cnt_lsb = ps_cur_poc->i4_pic_order_cnt_lsb;
  157|   139k|    ps_prev_poc->i4_pic_order_cnt_msb = ps_cur_poc->i4_pic_order_cnt_msb;
  158|   139k|    ps_prev_poc->i4_delta_pic_order_cnt_bottom = ps_cur_poc->i4_delta_pic_order_cnt_bottom;
  159|   139k|    ps_prev_poc->i4_delta_pic_order_cnt[0] = ps_cur_poc->i4_delta_pic_order_cnt[0];
  160|   139k|    ps_prev_poc->i4_delta_pic_order_cnt[1] = ps_cur_poc->i4_delta_pic_order_cnt[1];
  161|   139k|    ps_prev_poc->u1_bot_field = ps_dec->ps_cur_slice->u1_bottom_field_flag;
  162|   139k|    ps_prev_poc->i4_prev_frame_num_ofst = ps_cur_poc->i4_prev_frame_num_ofst;
  163|   139k|    ps_prev_poc->u2_frame_num = u2_frame_num;
  164|   139k|    ps_dec->i1_prev_mb_qp_delta = 0;
  165|   139k|    ps_dec->i1_next_ctxt_idx = 0;
  166|       |
  167|   139k|    ps_dec->u4_nmb_deblk = 0;
  168|   139k|    if(ps_dec->u4_num_cores == 1) ps_dec->u4_nmb_deblk = 1;
  ------------------
  |  Branch (168:8): [True: 86.1k, False: 53.5k]
  ------------------
  169|       |
  170|   139k|    if(ps_seq->u1_mb_aff_flag == 1)
  ------------------
  |  Branch (170:8): [True: 0, False: 139k]
  ------------------
  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|   139k|    ps_dec->u4_use_intrapred_line_copy = 0;
  177|       |
  178|   139k|    if(ps_seq->u1_mb_aff_flag == 0)
  ------------------
  |  Branch (178:8): [True: 139k, False: 0]
  ------------------
  179|   139k|    {
  180|   139k|        ps_dec->u4_use_intrapred_line_copy = 1;
  181|   139k|    }
  182|       |
  183|   139k|    ps_dec->u4_app_disable_deblk_frm = 0;
  184|       |    /* If degrade is enabled, set the degrade flags appropriately */
  185|   139k|    if(ps_dec->i4_degrade_type && ps_dec->i4_degrade_pics)
  ------------------
  |  Branch (185:8): [True: 0, False: 139k]
  |  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|   139k|    {
  242|   139k|        dec_err_status_t *ps_err = ps_dec->ps_dec_err_status;
  243|   139k|        if((ps_cur_slice->u1_slice_type == I_SLICE) || (ps_cur_slice->u1_slice_type == SI_SLICE))
  ------------------
  |  |  370|   139k|#define I_SLICE  2
  ------------------
                      if((ps_cur_slice->u1_slice_type == I_SLICE) || (ps_cur_slice->u1_slice_type == SI_SLICE))
  ------------------
  |  |  372|   126k|#define SI_SLICE 4
  ------------------
  |  Branch (243:12): [True: 13.2k, False: 126k]
  |  Branch (243:56): [True: 328, False: 126k]
  ------------------
  244|  13.6k|            ps_err->u1_cur_pic_type = PIC_TYPE_I;
  ------------------
  |  |  608|  13.6k|#define PIC_TYPE_I        (0x00)
  ------------------
  245|   126k|        else
  246|   126k|            ps_err->u1_cur_pic_type = PIC_TYPE_UNKNOWN;
  ------------------
  |  |  607|   126k|#define PIC_TYPE_UNKNOWN  (0xFF)
  ------------------
  247|       |
  248|   139k|        if(ps_err->u1_pic_aud_i == PIC_TYPE_I)
  ------------------
  |  |  608|   139k|#define PIC_TYPE_I        (0x00)
  ------------------
  |  Branch (248:12): [True: 0, False: 139k]
  ------------------
  249|      0|        {
  250|      0|            ps_err->u1_cur_pic_type = PIC_TYPE_I;
  ------------------
  |  |  608|      0|#define PIC_TYPE_I        (0x00)
  ------------------
  251|      0|            ps_err->u1_pic_aud_i = PIC_TYPE_UNKNOWN;
  ------------------
  |  |  607|      0|#define PIC_TYPE_UNKNOWN  (0xFF)
  ------------------
  252|      0|        }
  253|       |
  254|   139k|        if(ps_cur_slice->u1_nal_unit_type == IDR_SLICE_NAL)
  ------------------
  |  |  328|   139k|#define IDR_SLICE_NAL                   5
  ------------------
  |  Branch (254:12): [True: 116k, False: 23.2k]
  ------------------
  255|   116k|        {
  256|   116k|            if(ps_err->u1_err_flag) ih264d_reset_ref_bufs(ps_dec->ps_dpb_mgr);
  ------------------
  |  Branch (256:16): [True: 0, False: 116k]
  ------------------
  257|   116k|            ps_err->u1_err_flag = ACCEPT_ALL_PICS;
  ------------------
  |  |  600|   116k|#define ACCEPT_ALL_PICS   (0x00)
  ------------------
  258|   116k|        }
  259|   139k|    }
  260|       |
  261|   139k|    if(ps_dec->u1_init_dec_flag && ps_dec->s_prev_seq_params.u1_eoseq_pending)
  ------------------
  |  Branch (261:8): [True: 114k, False: 25.4k]
  |  Branch (261:36): [True: 0, False: 114k]
  ------------------
  262|      0|    {
  263|       |        /* Reset the decoder picture buffers */
  264|      0|        WORD32 j;
  265|      0|        for(j = 0; j < MAX_DISP_BUFS_NEW; j++)
  ------------------
  |  |   76|      0|#define MAX_DISP_BUFS_NEW 64
  ------------------
  |  Branch (265:20): [True: 0, False: 0]
  ------------------
  266|      0|        {
  267|      0|            ih264_buf_mgr_release((buf_mgr_t *) ps_dec->pv_pic_buf_mgr, j, BUF_MGR_REF);
  ------------------
  |  |   50|      0|#define BUF_MGR_REF          (1 << 2)
  ------------------
  268|      0|            ih264_buf_mgr_release((buf_mgr_t *) ps_dec->pv_mv_buf_mgr,
  269|      0|                                  ps_dec->as_buf_id_info_map[j].mv_buf_id, BUF_MGR_REF);
  ------------------
  |  |   50|      0|#define BUF_MGR_REF          (1 << 2)
  ------------------
  270|      0|            ih264_buf_mgr_release((buf_mgr_t *) ps_dec->pv_pic_buf_mgr, j, BUF_MGR_IO);
  ------------------
  |  |   53|      0|#define BUF_MGR_IO           (1 << 3)
  ------------------
  271|      0|        }
  272|       |
  273|       |        /* reset the decoder structure parameters related to buffer handling */
  274|      0|        ps_dec->u1_second_field = 0;
  275|      0|        ps_dec->i4_cur_display_seq = 0;
  276|       |
  277|       |        /********************************************************************/
  278|       |        /* indicate in the decoder output i4_status that some frames are being */
  279|       |        /* dropped, so that it resets timestamp and wait for a new sequence */
  280|       |        /********************************************************************/
  281|      0|        ps_dec->s_prev_seq_params.u1_eoseq_pending = 0;
  282|      0|    }
  283|   139k|    ret = isvcd_init_pic(ps_svc_lyr_dec, u2_frame_num, i4_poc, ps_pps);
  284|   139k|    if(ret != OK) return ret;
  ------------------
  |  |  114|   139k|#define OK        0
  ------------------
  |  Branch (284:8): [True: 0, False: 139k]
  ------------------
  285|       |
  286|   139k|    ps_dec->pv_parse_tu_coeff_data = ps_dec->pv_pic_tu_coeff_data;
  287|   139k|    ps_dec->pv_proc_tu_coeff_data = ps_dec->pv_pic_tu_coeff_data;
  288|   139k|    ps_dec->ps_nmb_info = ps_dec->ps_frm_mb_info;
  289|   139k|    ps_svc_lyr_dec->ps_svc_nmb_info = ps_svc_lyr_dec->ps_svc_frm_mb_info;
  290|   139k|    if(ps_dec->u1_separate_parse)
  ------------------
  |  Branch (290:8): [True: 53.5k, False: 86.1k]
  ------------------
  291|  53.5k|    {
  292|  53.5k|        UWORD32 num_mbs;
  293|  53.5k|        num_mbs = ps_dec->ps_cur_sps->u4_total_num_of_mbs
  294|  53.5k|                  << (1 - ps_dec->ps_cur_sps->u1_frame_mbs_only_flag);
  295|       |
  296|  53.5k|        if(ps_dec->pu1_dec_mb_map)
  ------------------
  |  Branch (296:12): [True: 53.5k, False: 0]
  ------------------
  297|  53.5k|        {
  298|  53.5k|            memset((void *) ps_dec->pu1_dec_mb_map, 0, num_mbs);
  299|  53.5k|        }
  300|       |
  301|  53.5k|        if(ps_dec->pu1_recon_mb_map)
  ------------------
  |  Branch (301:12): [True: 53.5k, False: 0]
  ------------------
  302|  53.5k|        {
  303|  53.5k|            memset((void *) ps_dec->pu1_recon_mb_map, 0, num_mbs);
  304|  53.5k|        }
  305|       |
  306|  53.5k|        if(ps_dec->pu2_slice_num_map)
  ------------------
  |  Branch (306:12): [True: 53.5k, False: 0]
  ------------------
  307|  53.5k|        {
  308|  53.5k|            memset((void *) ps_dec->pu2_slice_num_map, 0, (num_mbs * sizeof(UWORD16)));
  309|  53.5k|        }
  310|  53.5k|    }
  311|       |
  312|   139k|    ps_dec->ps_parse_cur_slice = &(ps_dec->ps_dec_slice_buf[0]);
  313|   139k|    ps_dec->ps_decode_cur_slice = &(ps_dec->ps_dec_slice_buf[0]);
  314|   139k|    ps_dec->ps_computebs_cur_slice = &(ps_dec->ps_dec_slice_buf[0]);
  315|   139k|    ps_dec->u2_cur_slice_num = 0;
  316|       |
  317|       |    /* Initialize all the HP toolsets to zero */
  318|   139k|    ps_dec->s_high_profile.u1_scaling_present = 0;
  319|   139k|    ps_dec->s_high_profile.u1_transform8x8_present = 0;
  320|       |
  321|       |    /* Get Next Free Picture */
  322|   139k|    if(1 == ps_dec->u4_share_disp_buf)
  ------------------
  |  Branch (322:8): [True: 0, False: 139k]
  ------------------
  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|   139k|    if(!(u1_field_pic_flag && 0 != ps_dec->u1_top_bottom_decoded))
  ------------------
  |  Branch (334:10): [True: 0, False: 139k]
  |  Branch (334:31): [True: 0, False: 0]
  ------------------
  335|   139k|    {
  336|   139k|        pic_buffer_t *ps_cur_pic;
  337|   139k|        WORD32 cur_pic_buf_id, cur_mv_buf_id;
  338|   139k|        col_mv_buf_t *ps_col_mv;
  339|   139k|        while(1)
  ------------------
  |  Branch (339:15): [True: 139k, Folded]
  ------------------
  340|   139k|        {
  341|   139k|            ps_cur_pic = (pic_buffer_t *) ih264_buf_mgr_get_next_free(
  342|   139k|                (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|   139k|            if((ps_cur_pic == NULL) && (ps_cur_slice->u1_nal_unit_type == IDR_SLICE_NAL))
  ------------------
  |  |  328|  1.15k|#define IDR_SLICE_NAL                   5
  ------------------
  |  Branch (347:16): [True: 1.15k, False: 138k]
  |  Branch (347:40): [True: 1.00k, False: 153]
  ------------------
  348|  1.00k|            {
  349|  1.00k|                WORD32 j;
  350|       |
  351|  65.1k|                for(j = 0; j < MAX_DISP_BUFS_NEW; j++)
  ------------------
  |  |   76|  65.1k|#define MAX_DISP_BUFS_NEW 64
  ------------------
  |  Branch (351:28): [True: 64.1k, False: 1.00k]
  ------------------
  352|  64.1k|                {
  353|  64.1k|                    ih264_buf_mgr_release((buf_mgr_t *) ps_dec->pv_pic_buf_mgr, j, BUF_MGR_REF);
  ------------------
  |  |   50|  64.1k|#define BUF_MGR_REF          (1 << 2)
  ------------------
  354|  64.1k|                    ih264_buf_mgr_release((buf_mgr_t *) ps_dec->pv_mv_buf_mgr,
  355|  64.1k|                                          ps_dec->as_buf_id_info_map[j].mv_buf_id, BUF_MGR_REF);
  ------------------
  |  |   50|  64.1k|#define BUF_MGR_REF          (1 << 2)
  ------------------
  356|       |
  357|  64.1k|                    ih264_buf_mgr_release((buf_mgr_t *) ps_dec->pv_pic_buf_mgr, j, BUF_MGR_IO);
  ------------------
  |  |   53|  64.1k|#define BUF_MGR_IO           (1 << 3)
  ------------------
  358|  64.1k|                }
  359|  1.00k|                ps_cur_pic = (pic_buffer_t *) ih264_buf_mgr_get_next_free(
  360|  1.00k|                    (buf_mgr_t *) ps_dec->pv_pic_buf_mgr, &cur_pic_buf_id);
  361|  1.00k|            }
  362|   139k|            if(ps_cur_pic == NULL)
  ------------------
  |  Branch (362:16): [True: 153, False: 139k]
  ------------------
  363|    153|            {
  364|    153|                ps_dec->i4_error_code = ERROR_UNAVAIL_PICBUF_T;
  365|    153|                ps_dec->ps_dec_err_status->u1_err_flag |= REJECT_CUR_PIC;
  ------------------
  |  |  601|    153|#define REJECT_CUR_PIC    (0x01)
  ------------------
  366|    153|                return ERROR_UNAVAIL_PICBUF_T;
  367|    153|            }
  368|   139k|            if(0 == ps_dec->u4_disp_buf_mapping[cur_pic_buf_id])
  ------------------
  |  Branch (368:16): [True: 139k, False: 0]
  ------------------
  369|   139k|            {
  370|   139k|                break;
  371|   139k|            }
  372|   139k|        }
  373|   139k|        ps_col_mv = (col_mv_buf_t *) ih264_buf_mgr_get_next_free(
  374|   139k|            (buf_mgr_t *) ps_dec->pv_mv_buf_mgr, &cur_mv_buf_id);
  375|   139k|        if(ps_col_mv == NULL)
  ------------------
  |  Branch (375:12): [True: 609, False: 138k]
  ------------------
  376|    609|        {
  377|    609|            ps_dec->i4_error_code = ERROR_UNAVAIL_MVBUF_T;
  378|    609|            ps_dec->ps_dec_err_status->u1_err_flag |= REJECT_CUR_PIC;
  ------------------
  |  |  601|    609|#define REJECT_CUR_PIC    (0x01)
  ------------------
  379|    609|            return ERROR_UNAVAIL_MVBUF_T;
  380|    609|        }
  381|       |
  382|   138k|        ps_dec->ps_cur_pic = ps_cur_pic;
  383|   138k|        ps_dec->u1_pic_buf_id = cur_pic_buf_id;
  384|   138k|        ps_cur_pic->u4_ts = ps_dec->u4_ts;
  385|   138k|        memcpy(&ps_cur_pic->s_sei_pic, ps_dec->ps_sei, sizeof(sei));
  386|       |
  387|   138k|        ps_cur_pic->u1_mv_buf_id = cur_mv_buf_id;
  388|   138k|        ps_dec->as_buf_id_info_map[cur_pic_buf_id].mv_buf_id = cur_mv_buf_id;
  389|       |
  390|   138k|        if(ps_dec->u1_enable_mb_info)
  ------------------
  |  Branch (390:12): [True: 0, False: 138k]
  ------------------
  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|   138k|        ps_cur_pic->pu1_col_zero_flag = (UWORD8 *) ps_col_mv->pv_col_zero_flag;
  401|   138k|        ps_cur_pic->ps_mv = (mv_pred_t *) ps_col_mv->pv_mv;
  402|   138k|        ps_dec->au1_pic_buf_ref_flag[cur_pic_buf_id] = 0;
  403|       |
  404|   138k|        {
  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|   138k|            ps_dec->ps_ref_pic_buf_lx[0] = ps_dec->ps_dpb_mgr->ps_init_dpb[0];
  409|   138k|            ps_dec->ps_ref_pic_buf_lx[1] = ps_dec->ps_dpb_mgr->ps_init_dpb[1];
  410|   138k|            *(ps_dec->ps_dpb_mgr->ps_init_dpb[0][0]) = *ps_cur_pic;
  411|       |            /* Initialize for field reference as well */
  412|   138k|            *(ps_dec->ps_dpb_mgr->ps_init_dpb[0][MAX_REF_BUFS]) = *ps_cur_pic;
  ------------------
  |  |   75|   138k|#define MAX_REF_BUFS    32
  ------------------
  413|       |
  414|   138k|            *(ps_dec->ps_dpb_mgr->ps_mod_dpb[0][0]) = *ps_cur_pic;
  415|       |            /* Initialize for field reference as well */
  416|   138k|            *(ps_dec->ps_dpb_mgr->ps_mod_dpb[0][MAX_REF_BUFS]) = *ps_cur_pic;
  ------------------
  |  |   75|   138k|#define MAX_REF_BUFS    32
  ------------------
  417|   138k|            *(ps_dec->ps_dpb_mgr->ps_init_dpb[1][0]) = *ps_cur_pic;
  418|       |            /* Initialize for field reference as well */
  419|   138k|            *(ps_dec->ps_dpb_mgr->ps_init_dpb[1][MAX_REF_BUFS]) = *ps_cur_pic;
  ------------------
  |  |   75|   138k|#define MAX_REF_BUFS    32
  ------------------
  420|   138k|            *(ps_dec->ps_dpb_mgr->ps_mod_dpb[1][0]) = *ps_cur_pic;
  421|       |            /* Initialize for field reference as well */
  422|   138k|            *(ps_dec->ps_dpb_mgr->ps_mod_dpb[1][MAX_REF_BUFS]) = *ps_cur_pic;
  ------------------
  |  |   75|   138k|#define MAX_REF_BUFS    32
  ------------------
  423|   138k|        }
  424|       |
  425|   138k|        ps_dec->ps_cur_pic->u1_picturetype = u1_field_pic_flag;
  426|   138k|        ps_dec->ps_cur_pic->u4_pack_slc_typ = SKIP_NONE;
  ------------------
  |  |  375|   138k|#define SKIP_NONE  (0x0)
  ------------------
  427|   138k|        H264_DEC_DEBUG_PRINT("got a buffer\n");
  ------------------
  |  |   39|   138k|#define H264_DEC_DEBUG_PRINT(...) {}
  ------------------
  428|   138k|    }
  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|   138k|    ps_dec->u4_pic_buf_got = 1;
  435|       |
  436|   138k|    ps_dec->ps_cur_pic->i4_poc = i4_poc;
  437|   138k|    ps_dec->ps_cur_pic->i4_frame_num = u2_frame_num;
  438|   138k|    ps_dec->ps_cur_pic->i4_pic_num = u2_frame_num;
  439|   138k|    ps_dec->ps_cur_pic->i4_top_field_order_cnt = ps_pps->i4_top_field_order_cnt;
  440|   138k|    ps_dec->ps_cur_pic->i4_bottom_field_order_cnt = ps_pps->i4_bottom_field_order_cnt;
  441|   138k|    ps_dec->ps_cur_pic->i4_avg_poc = ps_pps->i4_avg_poc;
  442|   138k|    ps_dec->ps_cur_pic->u4_time_stamp = ps_dec->u4_pts;
  443|       |
  444|   138k|    ps_dec->s_cur_pic = *(ps_dec->ps_cur_pic);
  445|   138k|    if(u1_field_pic_flag && u1_bottom_field_flag)
  ------------------
  |  Branch (445:8): [True: 0, False: 138k]
  |  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|   138k|    ps_cur_slice->u1_mbaff_frame_flag = ps_seq->u1_mb_aff_flag && (!u1_field_pic_flag);
  ------------------
  |  Branch (462:41): [True: 0, False: 138k]
  |  Branch (462:67): [True: 0, False: 0]
  ------------------
  463|   138k|    ps_dec->ps_cur_pic->u1_picturetype |= (ps_cur_slice->u1_mbaff_frame_flag << 2);
  464|       |
  465|   138k|    ps_dec->ps_cur_mb_row = ps_dec->ps_nbr_mb_row;
  466|   138k|    ps_dec->ps_cur_mb_row += 2;
  467|   138k|    ps_dec->ps_top_mb_row = ps_dec->ps_nbr_mb_row;
  468|   138k|    ps_dec->ps_top_mb_row +=
  469|   138k|        ((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|   138k|    ps_dec->ps_top_mb_row += 2;
  472|   138k|    ps_dec->ps_mv_cur = ps_dec->s_cur_pic.ps_mv;
  473|   138k|    ps_dec->ps_mv_top = ps_dec->ps_mv_top_p[0];
  474|   138k|    ps_dec->u1_mv_top_p = 0;
  475|   138k|    ps_dec->u4_mb_idx = 0;
  476|   138k|    ps_dec->ps_mv_left = ps_dec->s_cur_pic.ps_mv;
  477|   138k|    ps_dec->u4_total_mbs_coded = 0;
  478|   138k|    ps_dec->i4_submb_ofst = -(SUB_BLK_SIZE);
  ------------------
  |  |  562|   138k|#define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|   138k|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  |  |               #define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|   138k|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  ------------------
  479|   138k|    ps_dec->u4_pred_info_idx = 0;
  480|   138k|    ps_dec->u4_pred_info_pkd_idx = 0;
  481|   138k|    ps_dec->u4_dma_buf_idx = 0;
  482|   138k|    ps_dec->ps_mv = ps_dec->s_cur_pic.ps_mv;
  483|   138k|    ps_dec->ps_mv_bank_cur = ps_dec->s_cur_pic.ps_mv;
  484|   138k|    ps_dec->pu1_col_zero_flag = ps_dec->s_cur_pic.pu1_col_zero_flag;
  485|   138k|    ps_dec->ps_part = ps_dec->ps_parse_part_params;
  486|   138k|    ps_dec->i2_prev_slice_mbx = -1;
  487|   138k|    ps_dec->i2_prev_slice_mby = 0;
  488|   138k|    ps_dec->u2_mv_2mb[0] = 0;
  489|   138k|    ps_dec->u2_mv_2mb[1] = 0;
  490|   138k|    ps_dec->u1_last_pic_not_decoded = 0;
  491|       |
  492|   138k|    ps_dec->u2_cur_slice_num_dec_thread = 0;
  493|   138k|    ps_dec->u2_cur_slice_num_bs = 0;
  494|   138k|    ps_dec->u4_intra_pred_line_ofst = 0;
  495|   138k|    ps_dec->pu1_cur_y_intra_pred_line = ps_dec->pu1_y_intra_pred_line;
  496|   138k|    ps_dec->pu1_cur_u_intra_pred_line = ps_dec->pu1_u_intra_pred_line;
  497|   138k|    ps_dec->pu1_cur_v_intra_pred_line = ps_dec->pu1_v_intra_pred_line;
  498|       |
  499|   138k|    ps_dec->pu1_cur_y_intra_pred_line_base = ps_dec->pu1_y_intra_pred_line;
  500|   138k|    ps_dec->pu1_cur_u_intra_pred_line_base = ps_dec->pu1_u_intra_pred_line;
  501|   138k|    ps_dec->pu1_cur_v_intra_pred_line_base = ps_dec->pu1_v_intra_pred_line;
  502|       |
  503|   138k|    ps_dec->pu1_prev_y_intra_pred_line =
  504|   138k|        ps_dec->pu1_y_intra_pred_line + (ps_dec->u2_frm_wd_in_mbs * MB_SIZE);
  ------------------
  |  |  554|   138k|#define MB_SIZE             16
  ------------------
  505|       |
  506|   138k|    ps_dec->pu1_prev_u_intra_pred_line =
  507|   138k|        ps_dec->pu1_u_intra_pred_line + ps_dec->u2_frm_wd_in_mbs * BLK8x8SIZE * YUV420SP_FACTOR;
  ------------------
  |  |  555|   138k|#define BLK8x8SIZE          8
  ------------------
                      ps_dec->pu1_u_intra_pred_line + ps_dec->u2_frm_wd_in_mbs * BLK8x8SIZE * YUV420SP_FACTOR;
  ------------------
  |  |  119|   138k|#define YUV420SP_FACTOR 2
  ------------------
  508|   138k|    ps_dec->pu1_prev_v_intra_pred_line =
  509|   138k|        ps_dec->pu1_v_intra_pred_line + ps_dec->u2_frm_wd_in_mbs * BLK8x8SIZE;
  ------------------
  |  |  555|   138k|#define BLK8x8SIZE          8
  ------------------
  510|       |
  511|   138k|    ps_dec->ps_deblk_mbn = ps_dec->ps_deblk_pic;
  512|       |    /* Initialize The Function Pointer Depending Upon the Entropy and MbAff Flag
  513|       |     */
  514|   138k|    {
  515|   138k|        if(ps_cur_slice->u1_mbaff_frame_flag)
  ------------------
  |  Branch (515:12): [True: 0, False: 138k]
  ------------------
  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|   138k|        else
  522|   138k|        {
  523|   138k|            ps_dec->pf_compute_bs = ih264d_compute_bs_non_mbaff;
  524|   138k|            ps_svc_lyr_dec->pf_svc_compute_bs = isvcd_compute_bs_non_mbaff;
  525|   138k|            ps_dec->u1_cur_mb_fld_dec_flag = ps_cur_slice->u1_field_pic_flag;
  526|       |
  527|   138k|            if((ps_svc_lyr_dec->u1_layer_identifier == TARGET_LAYER) &&
  ------------------
  |  |  110|   138k|#define TARGET_LAYER 2
  ------------------
  |  Branch (527:16): [True: 92.2k, False: 46.6k]
  ------------------
  528|  92.2k|               (0 == ps_svc_lyr_dec->u1_base_res_flag))
  ------------------
  |  Branch (528:16): [True: 35.2k, False: 56.9k]
  ------------------
  529|  35.2k|            {
  530|  35.2k|                ps_svc_lyr_dec->pf_svc_compute_bs = isvcd_compute_bs_non_mbaff_target_lyr;
  531|  35.2k|            }
  532|       |
  533|   138k|            if((ps_svc_lyr_dec->u1_layer_identifier == TARGET_LAYER) &&
  ------------------
  |  |  110|   138k|#define TARGET_LAYER 2
  ------------------
  |  Branch (533:16): [True: 92.2k, False: 46.6k]
  ------------------
  534|  92.2k|               (1 == ps_svc_lyr_dec->u1_base_res_flag))
  ------------------
  |  Branch (534:16): [True: 56.9k, False: 35.2k]
  ------------------
  535|  56.9k|            {
  536|  56.9k|                ps_svc_lyr_dec->pf_svc_compute_bs =
  537|  56.9k|                    isvcd_compute_bs_non_mbaff_target_lyr_no_inter_layer;
  538|  56.9k|            }
  539|       |
  540|   138k|            if((ps_svc_lyr_dec->u1_layer_identifier == MEDIAL_ENHANCEMENT_LAYER) &&
  ------------------
  |  |  109|   138k|#define MEDIAL_ENHANCEMENT_LAYER 1
  ------------------
  |  Branch (540:16): [True: 0, False: 138k]
  ------------------
  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|   138k|        }
  546|   138k|    }
  547|       |    /* Set up the Parameter for DMA transfer */
  548|   138k|    {
  549|   138k|        UWORD8 u1_field_pic_flag = ps_dec->ps_cur_slice->u1_field_pic_flag;
  550|   138k|        UWORD8 u1_mbaff = ps_cur_slice->u1_mbaff_frame_flag;
  551|   138k|        UWORD16 uc_lastmbs = (((ps_dec->u2_pic_wd) >> 4) % (ps_dec->u4_recon_mb_grp >> u1_mbaff));
  552|   138k|        UWORD16 ui16_lastmbs_widthY =
  553|   138k|            (uc_lastmbs ? (uc_lastmbs << 4) : ((ps_dec->u4_recon_mb_grp >> u1_mbaff) << 4));
  ------------------
  |  Branch (553:14): [True: 0, False: 138k]
  ------------------
  554|   138k|        UWORD16 ui16_lastmbs_widthUV =
  555|   138k|            uc_lastmbs ? (uc_lastmbs << 3) : ((ps_dec->u4_recon_mb_grp >> u1_mbaff) << 3);
  ------------------
  |  Branch (555:13): [True: 0, False: 138k]
  ------------------
  556|       |
  557|   138k|        ps_dec->s_tran_addrecon.pu1_dest_y = ps_dec->s_cur_pic.pu1_buf1;
  558|   138k|        ps_dec->s_tran_addrecon.pu1_dest_u = ps_dec->s_cur_pic.pu1_buf2;
  559|   138k|        ps_dec->s_tran_addrecon.pu1_dest_v = ps_dec->s_cur_pic.pu1_buf3;
  560|       |
  561|   138k|        ps_dec->s_tran_addrecon.u2_frm_wd_y = ps_dec->u2_frm_wd_y << u1_field_pic_flag;
  562|   138k|        ps_dec->s_tran_addrecon.u2_frm_wd_uv = ps_dec->u2_frm_wd_uv << u1_field_pic_flag;
  563|       |
  564|   138k|        if(u1_field_pic_flag)
  ------------------
  |  Branch (564:12): [True: 0, False: 138k]
  ------------------
  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|   138k|        ps_dec->s_tran_addrecon.u4_inc_y[0] = ((ps_dec->u4_recon_mb_grp << 4) >> u1_mbaff);
  572|   138k|        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|   138k|        ps_dec->s_tran_addrecon.u4_inc_y[1] =
  576|   138k|            (ui16_lastmbs_widthY + (PAD_LEN_Y_H << 1) +
  ------------------
  |  |  571|   138k|#define PAD_LEN_Y_H                   32
  ------------------
  577|   138k|             ps_dec->s_tran_addrecon.u2_frm_wd_y * ((15 << u1_mbaff) + u1_mbaff));
  578|   138k|        ps_dec->s_tran_addrecon.u4_inc_uv[1] =
  579|   138k|            (ui16_lastmbs_widthUV + (PAD_LEN_UV_H << 2) +
  ------------------
  |  |  573|   138k|#define PAD_LEN_UV_H                  16
  ------------------
  580|   138k|             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|   138k|        ih264d_assign_pic_num(ps_dec);
  585|   138k|        ps_dec->s_tran_addrecon.u2_mv_top_left_inc =
  586|   138k|            (ps_dec->u4_recon_mb_grp << 2) - 1 - (u1_mbaff << 2);
  587|   138k|        ps_dec->s_tran_addrecon.u2_mv_left_inc = ((ps_dec->u4_recon_mb_grp >> u1_mbaff) - 1)
  588|   138k|                                                 << (4 + u1_mbaff);
  589|   138k|    }
  590|       |    /**********************************************************************/
  591|       |    /* High profile related initialization at pictrue level               */
  592|       |    /**********************************************************************/
  593|   138k|    if((ps_seq->u1_profile_idc == HIGH_PROFILE_IDC) ||
  ------------------
  |  |  278|   138k|#define HIGH_PROFILE_IDC   100
  ------------------
  |  Branch (593:8): [True: 8.15k, False: 130k]
  ------------------
  594|   130k|       (ps_seq->u1_profile_idc == SCALABLE_HIGH_PROFILE_IDC) ||
  ------------------
  |  |   60|   130k|#define SCALABLE_HIGH_PROFILE_IDC 86
  ------------------
  |  Branch (594:8): [True: 2.46k, False: 128k]
  ------------------
  595|   128k|       (ps_seq->u1_profile_idc == SCALABLE_BASELINE_PROFILE_IDC))
  ------------------
  |  |   59|   128k|#define SCALABLE_BASELINE_PROFILE_IDC 83
  ------------------
  |  Branch (595:8): [True: 3.80k, False: 124k]
  ------------------
  596|  14.4k|    {
  597|  14.4k|        if((ps_seq->i4_seq_scaling_matrix_present_flag) ||
  ------------------
  |  Branch (597:12): [True: 9.45k, False: 4.97k]
  ------------------
  598|  4.97k|           (ps_pps->i4_pic_scaling_matrix_present_flag))
  ------------------
  |  Branch (598:12): [True: 1.13k, False: 3.84k]
  ------------------
  599|  10.5k|        {
  600|  10.5k|            ret = ih264d_form_scaling_matrix_picture(ps_seq, ps_pps, ps_dec);
  601|  10.5k|            ps_dec->s_high_profile.u1_scaling_present = 1;
  602|  10.5k|        }
  603|  3.84k|        else
  604|  3.84k|        {
  605|  3.84k|            ret = ih264d_form_default_scaling_matrix(ps_dec);
  606|  3.84k|        }
  607|       |
  608|  14.4k|        if(ps_pps->i4_transform_8x8_mode_flag)
  ------------------
  |  Branch (608:12): [True: 8.25k, False: 6.17k]
  ------------------
  609|  8.25k|        {
  610|  8.25k|            ps_dec->s_high_profile.u1_transform8x8_present = 1;
  611|  8.25k|        }
  612|  14.4k|    }
  613|   124k|    else
  614|   124k|    {
  615|   124k|        ret = ih264d_form_default_scaling_matrix(ps_dec);
  616|   124k|    }
  617|       |
  618|   138k|    if(ret != OK) return ret;
  ------------------
  |  |  114|   138k|#define OK        0
  ------------------
  |  Branch (618:8): [True: 0, False: 138k]
  ------------------
  619|       |
  620|       |    /* required while reading the transform_size_8x8 u4_flag */
  621|   138k|    ps_dec->s_high_profile.u1_direct_8x8_inference_flag = ps_seq->u1_direct_8x8_inference_flag;
  622|   138k|    ps_dec->s_high_profile.s_cavlc_ctxt = ps_dec->s_cavlc_ctxt;
  623|       |
  624|   138k|    ps_dec->i1_recon_in_thread3_flag = 1;
  625|   138k|    ps_dec->ps_frame_buf_ip_recon = &ps_dec->s_tran_addrecon;
  626|   138k|    if(ps_dec->u1_separate_parse)
  ------------------
  |  Branch (626:8): [True: 53.1k, False: 85.7k]
  ------------------
  627|  53.1k|    {
  628|  53.1k|        memcpy(&ps_dec->s_tran_addrecon_parse, &ps_dec->s_tran_addrecon, sizeof(tfr_ctxt_t));
  629|  53.1k|    }
  630|       |
  631|   138k|    ih264d_init_deblk_tfr_ctxt(ps_dec, &(ps_dec->s_pad_mgr), &(ps_dec->s_tran_addrecon),
  632|   138k|                               ps_dec->u2_frm_wd_in_mbs, 0);
  633|       |
  634|   138k|    ps_dec->ps_cur_deblk_mb = ps_dec->ps_deblk_pic;
  635|   138k|    ps_dec->u4_cur_deblk_mb_num = 0;
  636|   138k|    ps_dec->u4_deblk_mb_x = 0;
  637|   138k|    ps_dec->u4_deblk_mb_y = 0;
  638|   138k|    ps_dec->pu4_wt_ofsts = ps_dec->pu4_wts_ofsts_mat;
  639|       |
  640|   138k|    ps_dec->u4_first_slice_in_pic = 0;
  641|   138k|    H264_MUTEX_UNLOCK(&ps_dec->process_disp_mutex);
  642|   138k|    return OK;
  ------------------
  |  |  114|   138k|#define OK        0
  ------------------
  643|   138k|}
isvcd_parse_decode_slice_ext_nal:
  657|  39.3k|{
  658|  39.3k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
  659|  39.3k|    dec_bit_stream_t *ps_bitstrm = ps_dec->ps_bitstrm;
  660|  39.3k|    dec_pic_params_t *ps_pps;
  661|  39.3k|    dec_seq_params_t *ps_seq;
  662|  39.3k|    dec_svc_seq_params_t *ps_subset_seq;
  663|  39.3k|    dec_slice_params_t *ps_cur_slice = NULL;
  664|  39.3k|    dec_slice_svc_ext_params_t *ps_svc_slice_params = NULL;
  665|       |
  666|  39.3k|    pocstruct_t s_tmp_poc = {0};
  667|  39.3k|    WORD32 i_delta_poc[2] = {0};
  668|  39.3k|    WORD32 i4_poc = 0;
  669|  39.3k|    UWORD16 u2_first_mb_in_slice, u2_frame_num;
  670|  39.3k|    UWORD8 u1_field_pic_flag, u1_redundant_pic_cnt = 0, u1_slice_type;
  671|  39.3k|    UWORD32 u4_idr_pic_id = 0;
  672|  39.3k|    UWORD8 u1_bottom_field_flag, u1_pic_order_cnt_type;
  673|       |
  674|  39.3k|    UWORD8 u1_nal_unit_type;
  675|  39.3k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
  676|  39.3k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
  677|  39.3k|    WORD8 i1_is_end_of_poc;
  678|  39.3k|    WORD32 ret;
  679|  39.3k|    WORD32 prev_slice_err, num_mb_skipped;
  680|  39.3k|    UWORD8 u1_mbaff;
  681|  39.3k|    pocstruct_t *ps_cur_poc;
  682|  39.3k|    UWORD32 u4_temp;
  683|  39.3k|    WORD32 i_temp;
  684|  39.3k|    svc_dec_ctxt_t *psvcd_dec_ctxt;
  685|  39.3k|    dec_struct_t *ps_dec_cur_lyr_minus_1;
  686|  39.3k|    svc_dec_lyr_struct_t *ps_svc_cur_lyr_dec_minus_1;
  687|       |
  688|  39.3k|    ps_cur_slice = ps_dec->ps_cur_slice;
  689|  39.3k|    ps_svc_slice_params = &ps_svc_lyr_dec->s_svc_slice_params;
  690|       |
  691|       |    /* read FirstMbInSlice  and slice type*/
  692|  39.3k|    ps_dec->ps_dpb_cmds->u1_dpb_commands_read_slc = 0;
  693|  39.3k|    u2_first_mb_in_slice = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  694|  39.3k|    if(u2_first_mb_in_slice > (ps_dec->u2_frm_ht_in_mbs * ps_dec->u2_frm_wd_in_mbs))
  ------------------
  |  Branch (694:8): [True: 174, False: 39.1k]
  ------------------
  695|    174|    {
  696|    174|        return ERROR_CORRUPTED_SLICE;
  697|    174|    }
  698|       |
  699|       |    /*we currently don not support ASO*/
  700|  39.1k|    if(((u2_first_mb_in_slice << ps_cur_slice->u1_mbaff_frame_flag) <= ps_dec->u4_cur_mb_addr) &&
  ------------------
  |  Branch (700:8): [True: 38.3k, False: 846]
  ------------------
  701|  38.3k|       (ps_dec->u4_first_slice_in_pic == 0))
  ------------------
  |  Branch (701:8): [True: 89, False: 38.2k]
  ------------------
  702|     89|    {
  703|     89|        return ERROR_CORRUPTED_SLICE;
  704|     89|    }
  705|       |
  706|  39.1k|    if(ps_dec->u4_first_slice_in_pic == 1)
  ------------------
  |  Branch (706:8): [True: 38.3k, False: 759]
  ------------------
  707|  38.3k|    {
  708|  38.3k|        if(u2_first_mb_in_slice != 0)
  ------------------
  |  Branch (708:12): [True: 87, False: 38.2k]
  ------------------
  709|     87|        {
  710|     87|            return ERROR_CORRUPTED_SLICE;
  711|     87|        }
  712|  38.3k|    }
  713|       |
  714|  39.0k|    COPYTHECONTEXT("Slice Header SVC ext: first_mb_in_slice", u2_first_mb_in_slice);
  715|       |
  716|  39.0k|    u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  717|       |
  718|  39.0k|    if(u4_temp > 9) return ERROR_INV_SLC_TYPE_T;
  ------------------
  |  Branch (718:8): [True: 70, False: 38.9k]
  ------------------
  719|       |
  720|  38.9k|    u1_slice_type = u4_temp;
  721|  38.9k|    COPYTHECONTEXT("Slice Header SVC ext: slice_type", (u1_slice_type));
  722|       |    /* Find Out the Slice Type is 5 to 9 or not then Set the Flag   */
  723|       |    /* u1_sl_typ_5_9 = 1 .Which tells that all the slices in the Pic*/
  724|       |    /* will be of same type of current                            */
  725|  38.9k|    if(u1_slice_type > 4)
  ------------------
  |  Branch (725:8): [True: 237, False: 38.7k]
  ------------------
  726|    237|    {
  727|    237|        u1_slice_type -= 5;
  728|    237|    }
  729|       |
  730|  38.9k|    u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  731|  38.9k|    if(u4_temp & MASK_ERR_PIC_SET_ID) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  |  527|  38.9k|#define MASK_ERR_PIC_SET_ID   (0xFFFFFF00)
  ------------------
  |  Branch (731:8): [True: 83, False: 38.8k]
  ------------------
  732|       |    /* discard slice if pic param is invalid */
  733|  38.8k|    COPYTHECONTEXT("Slice Header SVC ext: pic_parameter_set_id", u4_temp);
  734|  38.8k|    ps_pps = &ps_dec->ps_pps[u4_temp];
  735|  38.8k|    if(FALSE == ps_pps->u1_is_valid)
  ------------------
  |  |  592|  38.8k|#define FALSE   0
  ------------------
  |  Branch (735:8): [True: 81, False: 38.7k]
  ------------------
  736|     81|    {
  737|     81|        return ERROR_INV_SLICE_HDR_T;
  738|     81|    }
  739|       |    /* slices in a layer should have same PPS id*/
  740|  38.7k|    if(UINT32_MAX == ps_svc_lyr_dec->u4_pps_id_for_layer)
  ------------------
  |  Branch (740:8): [True: 38.0k, False: 759]
  ------------------
  741|  38.0k|    {
  742|  38.0k|        ps_svc_lyr_dec->u4_pps_id_for_layer = u4_temp;
  743|  38.0k|    }
  744|    759|    else if(u4_temp != ps_svc_lyr_dec->u4_pps_id_for_layer)
  ------------------
  |  Branch (744:13): [True: 66, False: 693]
  ------------------
  745|     66|    {
  746|     66|        return ERROR_INV_SLICE_HDR_T;
  747|     66|    }
  748|  38.7k|    ps_seq = ps_pps->ps_sps;
  749|  38.7k|    ps_seq += MAX_NUM_SEQ_PARAMS;
  ------------------
  |  |  521|  38.7k|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
  750|  38.7k|    ps_subset_seq =
  751|  38.7k|        &ps_svc_lyr_dec->ps_subset_sps[MAX_NUM_SEQ_PARAMS + ps_seq->u1_seq_parameter_set_id];
  ------------------
  |  |  521|  38.7k|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
  752|       |
  753|  38.7k|    ps_dec->ps_cur_sps = ps_seq;
  754|  38.7k|    ps_svc_lyr_dec->ps_cur_subset_sps = ps_subset_seq;
  755|       |
  756|  38.7k|    if(!ps_seq) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (756:8): [True: 0, False: 38.7k]
  ------------------
  757|  38.7k|    if(FALSE == ps_seq->u1_is_valid) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  |  592|  38.7k|#define FALSE   0
  ------------------
  |  Branch (757:8): [True: 260, False: 38.4k]
  ------------------
  758|  38.4k|    if(ps_seq->u1_mb_aff_flag) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (758:8): [True: 66, False: 38.3k]
  ------------------
  759|  38.3k|    if(ps_seq->u1_level_idc > H264_LEVEL_4_2) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  |  303|  38.3k|#define H264_LEVEL_4_2     42
  ------------------
  |  Branch (759:8): [True: 77, False: 38.3k]
  ------------------
  760|  38.3k|    if(!ps_seq->u1_frame_mbs_only_flag) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (760:8): [True: 66, False: 38.2k]
  ------------------
  761|  38.2k|    if(OK != isvcd_verify_level(ps_seq->u1_level_idc)) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  |  114|  38.2k|#define OK        0
  ------------------
  |  Branch (761:8): [True: 67, False: 38.1k]
  ------------------
  762|       |
  763|  38.1k|    if(ps_dec->u1_init_dec_flag == 1)
  ------------------
  |  Branch (763:8): [True: 30.5k, False: 7.66k]
  ------------------
  764|  30.5k|    {
  765|  30.5k|        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: 69, False: 30.4k]
  ------------------
  766|  30.4k|        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: 86, False: 30.3k]
  ------------------
  767|  30.4k|    }
  768|       |
  769|  38.0k|    if(ps_dec->u1_init_dec_flag == 1)
  ------------------
  |  Branch (769:8): [True: 30.3k, False: 7.66k]
  ------------------
  770|  30.3k|    {
  771|  30.3k|        if(ps_dec->u2_disp_height != ps_subset_seq->u2_disp_height) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (771:12): [True: 73, False: 30.2k]
  ------------------
  772|  30.2k|        if(ps_dec->u2_disp_width != ps_subset_seq->u2_disp_width) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (772:12): [True: 66, False: 30.2k]
  ------------------
  773|  30.2k|    }
  774|       |
  775|  37.8k|    ps_dec->i4_reorder_depth = ps_subset_seq->i4_reorder_depth;
  776|       |
  777|  37.8k|    ps_dec->u2_disp_height = ps_subset_seq->u2_disp_height;
  778|  37.8k|    ps_dec->u2_disp_width = ps_subset_seq->u2_disp_width;
  779|       |
  780|  37.8k|    if(ps_svc_lyr_dec->u1_layer_id > 0)
  ------------------
  |  Branch (780:8): [True: 37.8k, False: 0]
  ------------------
  781|  37.8k|    {
  782|  37.8k|        psvcd_dec_ctxt = ps_svc_lyr_dec->ps_svcd_ctxt;
  783|  37.8k|        ps_svc_cur_lyr_dec_minus_1 =
  784|  37.8k|            &psvcd_dec_ctxt->ps_svc_dec_lyr[ps_svc_lyr_dec->u1_layer_id - 1];
  785|       |
  786|  37.8k|        ps_dec_cur_lyr_minus_1 = &ps_svc_cur_lyr_dec_minus_1->s_dec;
  787|       |
  788|  37.8k|        if((ps_dec_cur_lyr_minus_1->u2_pic_wd > ps_subset_seq->u2_pic_wd) ||
  ------------------
  |  Branch (788:12): [True: 67, False: 37.8k]
  ------------------
  789|  37.8k|           (ps_dec_cur_lyr_minus_1->u2_pic_ht > ps_subset_seq->u2_pic_ht))
  ------------------
  |  Branch (789:12): [True: 82, False: 37.7k]
  ------------------
  790|    149|        {
  791|    149|            return ERROR_CORRUPTED_SLICE;
  792|    149|        }
  793|  37.8k|    }
  794|       |
  795|  37.7k|    ps_dec->u2_pic_wd = ps_subset_seq->u2_pic_wd;
  796|  37.7k|    ps_dec->u2_pic_ht = ps_subset_seq->u2_pic_ht;
  797|  37.7k|    ps_dec->u4_total_mbs = ps_seq->u4_total_num_of_mbs << (1 - ps_seq->u1_frame_mbs_only_flag);
  798|       |
  799|       |    /* Determining the Width and Height of Frame from that of Picture */
  800|  37.7k|    ps_dec->u2_frm_wd_y = ps_subset_seq->u2_frm_wd_y;
  801|  37.7k|    ps_dec->u2_frm_ht_y = ps_subset_seq->u2_frm_ht_y;
  802|       |
  803|  37.7k|    ps_dec->u2_frm_wd_uv = ps_subset_seq->u2_frm_wd_uv;
  804|  37.7k|    ps_dec->u2_frm_ht_uv = ps_subset_seq->u2_frm_ht_uv;
  805|       |
  806|  37.7k|    ps_dec->s_pad_mgr.u1_pad_len_y_v = ps_subset_seq->u1_pad_len_y_v;
  807|  37.7k|    ps_dec->s_pad_mgr.u1_pad_len_cr_v = ps_subset_seq->u1_pad_len_cr_v;
  808|       |
  809|  37.7k|    ps_dec->u2_frm_wd_in_mbs = ps_seq->u2_frm_wd_in_mbs;
  810|  37.7k|    ps_dec->u2_frm_ht_in_mbs = ps_seq->u2_frm_ht_in_mbs;
  811|       |
  812|  37.7k|    ps_dec->u2_crop_offset_y = ps_subset_seq->u2_crop_offset_y;
  813|  37.7k|    ps_dec->u2_crop_offset_uv = ps_subset_seq->u2_crop_offset_uv;
  814|       |
  815|       |    /* Get the frame num */
  816|  37.7k|    u2_frame_num = ih264d_get_bits_h264(ps_bitstrm, ps_seq->u1_bits_in_frm_num);
  817|       |
  818|  37.7k|    COPYTHECONTEXT("Slice Header SVC ext: frame_num", u2_frame_num);
  819|  37.7k|    if(!ps_dec->u1_first_slice_in_stream && ps_dec->u4_first_slice_in_pic)
  ------------------
  |  Branch (819:8): [True: 23.8k, False: 13.8k]
  |  Branch (819:45): [True: 23.1k, False: 693]
  ------------------
  820|  23.1k|    {
  821|  23.1k|        pocstruct_t *ps_prev_poc = &ps_dec->s_prev_pic_poc;
  822|  23.1k|        pocstruct_t *ps_cur_poc = &ps_dec->s_cur_pic_poc;
  823|       |
  824|  23.1k|        ps_dec->u2_mbx = 0xffff;
  825|  23.1k|        ps_dec->u2_mby = 0;
  826|       |
  827|  23.1k|        if((0 == u1_is_idr_slice) && ps_cur_slice->u1_nal_ref_idc)
  ------------------
  |  Branch (827:12): [True: 1.85k, False: 21.3k]
  |  Branch (827:38): [True: 1.67k, False: 178]
  ------------------
  828|  1.67k|            ps_dec->u2_prev_ref_frame_num = ps_cur_slice->u2_frame_num;
  829|       |
  830|  23.1k|        if(u1_is_idr_slice || ps_cur_slice->u1_mmco_equalto5) ps_dec->u2_prev_ref_frame_num = 0;
  ------------------
  |  Branch (830:12): [True: 21.3k, False: 1.85k]
  |  Branch (830:31): [True: 286, False: 1.57k]
  ------------------
  831|       |
  832|  23.1k|        if(ps_dec->ps_cur_sps->u1_gaps_in_frame_num_value_allowed_flag)
  ------------------
  |  Branch (832:12): [True: 0, False: 23.1k]
  ------------------
  833|      0|        {
  834|      0|            isvcd_decode_gaps_in_frame_num(ps_dec, u2_frame_num);
  835|      0|        }
  836|       |
  837|  23.1k|        ps_prev_poc->i4_prev_frame_num_ofst = ps_cur_poc->i4_prev_frame_num_ofst;
  838|  23.1k|        ps_prev_poc->u2_frame_num = ps_cur_poc->u2_frame_num;
  839|  23.1k|        ps_prev_poc->u1_mmco_equalto5 = ps_cur_slice->u1_mmco_equalto5;
  840|  23.1k|        if(ps_cur_slice->u1_nal_ref_idc)
  ------------------
  |  Branch (840:12): [True: 19.1k, False: 3.99k]
  ------------------
  841|  19.1k|        {
  842|  19.1k|            ps_prev_poc->i4_pic_order_cnt_lsb = ps_cur_poc->i4_pic_order_cnt_lsb;
  843|  19.1k|            ps_prev_poc->i4_pic_order_cnt_msb = ps_cur_poc->i4_pic_order_cnt_msb;
  844|  19.1k|            ps_prev_poc->i4_delta_pic_order_cnt_bottom = ps_cur_poc->i4_delta_pic_order_cnt_bottom;
  845|  19.1k|            ps_prev_poc->i4_delta_pic_order_cnt[0] = ps_cur_poc->i4_delta_pic_order_cnt[0];
  846|  19.1k|            ps_prev_poc->i4_delta_pic_order_cnt[1] = ps_cur_poc->i4_delta_pic_order_cnt[1];
  847|  19.1k|            ps_prev_poc->u1_bot_field = ps_cur_poc->u1_bot_field;
  848|  19.1k|        }
  849|       |
  850|  23.1k|        ps_dec->u4_total_mbs_coded = 0;
  851|  23.1k|    }
  852|       |    /* Get the field related flags  */
  853|  37.7k|    if(!ps_seq->u1_frame_mbs_only_flag)
  ------------------
  |  Branch (853:8): [True: 0, False: 37.7k]
  ------------------
  854|      0|    {
  855|      0|        u1_field_pic_flag = ih264d_get_bit_h264(ps_bitstrm);
  856|      0|        COPYTHECONTEXT("Slice Header SVC ext: field_pic_flag", u1_field_pic_flag);
  857|      0|        u1_bottom_field_flag = 0;
  858|       |
  859|      0|        if(u1_field_pic_flag)
  ------------------
  |  Branch (859:12): [True: 0, False: 0]
  ------------------
  860|      0|        {
  861|      0|            ps_dec->pu1_inv_scan = (UWORD8 *) gau1_ih264d_inv_scan_fld;
  862|      0|            u1_bottom_field_flag = ih264d_get_bit_h264(ps_bitstrm);
  863|      0|            COPYTHECONTEXT("Slice Header SVC ext: bottom_field_flag", u1_bottom_field_flag);
  864|      0|        }
  865|      0|        else
  866|      0|        {
  867|      0|            ps_dec->pu1_inv_scan = (UWORD8 *) gau1_ih264d_inv_scan;
  868|      0|        }
  869|      0|    }
  870|  37.7k|    else
  871|  37.7k|    {
  872|  37.7k|        u1_field_pic_flag = 0;
  873|  37.7k|        u1_bottom_field_flag = 0;
  874|  37.7k|        ps_dec->pu1_inv_scan = (UWORD8 *) gau1_ih264d_inv_scan;
  875|  37.7k|    }
  876|       |
  877|  37.7k|    u1_nal_unit_type = SLICE_NAL;
  ------------------
  |  |  324|  37.7k|#define SLICE_NAL                       1
  ------------------
  878|  37.7k|    if(u1_is_idr_slice)
  ------------------
  |  Branch (878:8): [True: 33.8k, False: 3.89k]
  ------------------
  879|  33.8k|    {
  880|  33.8k|        u1_nal_unit_type = IDR_SLICE_NAL;
  ------------------
  |  |  328|  33.8k|#define IDR_SLICE_NAL                   5
  ------------------
  881|  33.8k|        u4_idr_pic_id = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  882|  33.8k|        if(u4_idr_pic_id > 65535) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (882:12): [True: 376, False: 33.4k]
  ------------------
  883|  33.4k|        COPYTHECONTEXT("Slice Header SVC ext:  ", u4_idr_pic_id);
  884|  33.4k|    }
  885|       |
  886|       |    /* read delta pic order count information*/
  887|  37.3k|    i_delta_poc[0] = i_delta_poc[1] = 0;
  888|  37.3k|    s_tmp_poc.i4_pic_order_cnt_lsb = 0;
  889|  37.3k|    s_tmp_poc.i4_delta_pic_order_cnt_bottom = 0;
  890|  37.3k|    u1_pic_order_cnt_type = ps_seq->u1_pic_order_cnt_type;
  891|  37.3k|    if(u1_pic_order_cnt_type == 0)
  ------------------
  |  Branch (891:8): [True: 35.3k, False: 2.00k]
  ------------------
  892|  35.3k|    {
  893|  35.3k|        i_temp = ih264d_get_bits_h264(ps_bitstrm, ps_seq->u1_log2_max_pic_order_cnt_lsb_minus);
  894|  35.3k|        if(i_temp < 0 || i_temp >= ps_seq->i4_max_pic_order_cntLsb) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (894:12): [True: 0, False: 35.3k]
  |  Branch (894:26): [True: 0, False: 35.3k]
  ------------------
  895|  35.3k|        s_tmp_poc.i4_pic_order_cnt_lsb = i_temp;
  896|  35.3k|        COPYTHECONTEXT("Slice Header SVC ext: pic_order_cnt_lsb", s_tmp_poc.i4_pic_order_cnt_lsb);
  897|       |
  898|  35.3k|        if((ps_pps->u1_pic_order_present_flag == 1) && (!u1_field_pic_flag))
  ------------------
  |  Branch (898:12): [True: 3.83k, False: 31.5k]
  |  Branch (898:56): [True: 3.83k, False: 0]
  ------------------
  899|  3.83k|        {
  900|  3.83k|            s_tmp_poc.i4_delta_pic_order_cnt_bottom = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  901|  3.83k|            COPYTHECONTEXT("Slice Header SVC ext: delta_pic_order_cnt_bottom",
  902|  3.83k|                           s_tmp_poc.i4_delta_pic_order_cnt_bottom);
  903|  3.83k|        }
  904|  35.3k|    }
  905|       |
  906|  37.3k|    s_tmp_poc.i4_delta_pic_order_cnt[0] = 0;
  907|  37.3k|    s_tmp_poc.i4_delta_pic_order_cnt[1] = 0;
  908|  37.3k|    if(u1_pic_order_cnt_type == 1 && (!ps_seq->u1_delta_pic_order_always_zero_flag))
  ------------------
  |  Branch (908:8): [True: 1.54k, False: 35.8k]
  |  Branch (908:38): [True: 954, False: 595]
  ------------------
  909|    954|    {
  910|    954|        s_tmp_poc.i4_delta_pic_order_cnt[0] = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  911|    954|        COPYTHECONTEXT("Slice Header SVC ext: delta_pic_order_cnt[0]",
  912|    954|                       s_tmp_poc.i4_delta_pic_order_cnt[0]);
  913|       |
  914|    954|        if(ps_pps->u1_pic_order_present_flag && !u1_field_pic_flag)
  ------------------
  |  Branch (914:12): [True: 442, False: 512]
  |  Branch (914:49): [True: 442, False: 0]
  ------------------
  915|    442|        {
  916|    442|            s_tmp_poc.i4_delta_pic_order_cnt[1] = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  917|    442|            COPYTHECONTEXT("Slice Header SVC ext: delta_pic_order_cnt[1]",
  918|    442|                           s_tmp_poc.i4_delta_pic_order_cnt[1]);
  919|    442|        }
  920|    954|    }
  921|       |
  922|  37.3k|    if(ps_pps->u1_redundant_pic_cnt_present_flag)
  ------------------
  |  Branch (922:8): [True: 13.0k, False: 24.3k]
  ------------------
  923|  13.0k|    {
  924|  13.0k|        u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  925|  13.0k|        if(u4_temp > MAX_REDUNDANT_PIC_CNT) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  |  611|  13.0k|#define MAX_REDUNDANT_PIC_CNT       127
  ------------------
  |  Branch (925:12): [True: 159, False: 12.8k]
  ------------------
  926|  12.8k|        u1_redundant_pic_cnt = u4_temp;
  927|  12.8k|        COPYTHECONTEXT("Slice Header SVC ext: redundant_pic_cnt", u1_redundant_pic_cnt);
  928|  12.8k|    }
  929|       |
  930|       |    /*--------------------------------------------------------------------*/
  931|       |    /* Check if the slice is part of new picture                          */
  932|       |    /*--------------------------------------------------------------------*/
  933|       |    /* First slice of a picture is always considered as part of new picture */
  934|  37.2k|    i1_is_end_of_poc = 1;
  935|  37.2k|    ps_dec->ps_dec_err_status->u1_err_flag &= MASK_REJECT_CUR_PIC;
  ------------------
  |  |  604|  37.2k|#define MASK_REJECT_CUR_PIC (0xFE)
  ------------------
  936|       |
  937|  37.2k|    if(ps_dec->u4_first_slice_in_pic == 0)
  ------------------
  |  Branch (937:8): [True: 692, False: 36.5k]
  ------------------
  938|    692|    {
  939|    692|        i1_is_end_of_poc =
  940|    692|            ih264d_is_end_of_pic(u2_frame_num, u1_nal_ref_idc, &s_tmp_poc, &ps_dec->s_cur_pic_poc,
  941|    692|                                 ps_cur_slice, u1_pic_order_cnt_type, u1_nal_unit_type,
  942|    692|                                 u4_idr_pic_id, u1_field_pic_flag, u1_bottom_field_flag);
  943|    692|        if(i1_is_end_of_poc)
  ------------------
  |  Branch (943:12): [True: 82, False: 610]
  ------------------
  944|     82|        {
  945|     82|            ps_dec->u1_first_slice_in_stream = 0;
  946|     82|            return ERROR_INCOMPLETE_FRAME;
  947|     82|        }
  948|    692|    }
  949|       |
  950|       |    /*--------------------------------------------------------------------*/
  951|       |    /* Check for error in slice and parse the missing/corrupted MB's      */
  952|       |    /* as skip-MB's in an inserted P-slice                                */
  953|       |    /*--------------------------------------------------------------------*/
  954|  37.1k|    u1_mbaff = ps_seq->u1_mb_aff_flag && (!u1_field_pic_flag);
  ------------------
  |  Branch (954:16): [True: 0, False: 37.1k]
  |  Branch (954:42): [True: 0, False: 0]
  ------------------
  955|  37.1k|    prev_slice_err = 0;
  956|       |
  957|  37.1k|    if(i1_is_end_of_poc || ps_dec->u1_first_slice_in_stream)
  ------------------
  |  Branch (957:8): [True: 36.5k, False: 610]
  |  Branch (957:28): [True: 0, False: 610]
  ------------------
  958|  36.5k|    {
  959|       |        /* If the current slice is not a field or frame number of the current
  960|       |         * slice doesn't match with previous slice, and decoder is expecting
  961|       |         * to decode a field i.e. ps_dec->u1_top_bottom_decoded is not 0 and
  962|       |         * is not (TOP_FIELD_ONLY | BOT_FIELD_ONLY), treat it as a dangling
  963|       |         * field */
  964|  36.5k|        if((u1_field_pic_flag == 0 || u2_frame_num != ps_dec->u2_prv_frame_num) &&
  ------------------
  |  Branch (964:13): [True: 36.5k, False: 0]
  |  Branch (964:39): [True: 0, False: 0]
  ------------------
  965|  36.5k|           ps_dec->u1_top_bottom_decoded != 0 &&
  ------------------
  |  Branch (965:12): [True: 0, False: 36.5k]
  ------------------
  966|      0|           ps_dec->u1_top_bottom_decoded != (TOP_FIELD_ONLY | BOT_FIELD_ONLY))
  ------------------
  |  |   64|      0|#define TOP_FIELD_ONLY      0x02
  ------------------
                         ps_dec->u1_top_bottom_decoded != (TOP_FIELD_ONLY | BOT_FIELD_ONLY))
  ------------------
  |  |   65|      0|#define BOT_FIELD_ONLY      0x01
  ------------------
  |  Branch (966:12): [True: 0, False: 0]
  ------------------
  967|      0|        {
  968|      0|            ps_dec->u1_dangling_field = 1;
  969|      0|            if(ps_dec->u4_first_slice_in_pic)
  ------------------
  |  Branch (969:16): [True: 0, False: 0]
  ------------------
  970|      0|            {
  971|       |                // first slice - dangling field
  972|      0|                prev_slice_err = 1;
  973|      0|            }
  974|      0|            else
  975|      0|            {
  976|       |                // last slice - dangling field
  977|      0|                prev_slice_err = 2;
  978|      0|            }
  979|       |
  980|      0|            if(ps_dec->u1_top_bottom_decoded == TOP_FIELD_ONLY)
  ------------------
  |  |   64|      0|#define TOP_FIELD_ONLY      0x02
  ------------------
  |  Branch (980:16): [True: 0, False: 0]
  ------------------
  981|      0|                ps_cur_slice->u1_bottom_field_flag = 1;
  982|      0|            else
  983|      0|                ps_cur_slice->u1_bottom_field_flag = 0;
  984|       |
  985|      0|            num_mb_skipped =
  986|      0|                (ps_dec->u2_frm_ht_in_mbs * ps_dec->u2_frm_wd_in_mbs) - ps_dec->u4_total_mbs_coded;
  987|      0|            ps_cur_poc = &ps_dec->s_cur_pic_poc;
  988|       |
  989|      0|            u1_is_idr_slice = ps_cur_slice->u1_nal_unit_type == IDR_SLICE_NAL;
  ------------------
  |  |  328|      0|#define IDR_SLICE_NAL                   5
  ------------------
  990|      0|        }
  991|  36.5k|        else if(ps_dec->u4_first_slice_in_pic)
  ------------------
  |  Branch (991:17): [True: 36.5k, False: 0]
  ------------------
  992|  36.5k|        {
  993|  36.5k|            if(u2_first_mb_in_slice > 0)
  ------------------
  |  Branch (993:16): [True: 0, False: 36.5k]
  ------------------
  994|      0|            {
  995|       |                // first slice - missing/header corruption
  996|      0|                prev_slice_err = 1;
  997|      0|                num_mb_skipped = u2_first_mb_in_slice << u1_mbaff;
  998|      0|                ps_cur_poc = &s_tmp_poc;
  999|       |
 1000|       |                // initializing slice parameters
 1001|      0|                ps_cur_slice->u4_idr_pic_id = u4_idr_pic_id;
 1002|      0|                ps_cur_slice->u1_field_pic_flag = u1_field_pic_flag;
 1003|      0|                ps_cur_slice->u1_bottom_field_flag = u1_bottom_field_flag;
 1004|      0|                ps_cur_slice->i4_pic_order_cnt_lsb = s_tmp_poc.i4_pic_order_cnt_lsb;
 1005|      0|                ps_cur_slice->u1_nal_unit_type = u1_nal_unit_type;
 1006|      0|                ps_cur_slice->u1_redundant_pic_cnt = u1_redundant_pic_cnt;
 1007|      0|                ps_cur_slice->u1_nal_ref_idc = u1_nal_ref_idc;
 1008|      0|                ps_cur_slice->u1_pic_order_cnt_type = u1_pic_order_cnt_type;
 1009|      0|                ps_cur_slice->u1_mbaff_frame_flag = ps_seq->u1_mb_aff_flag && (!u1_field_pic_flag);
  ------------------
  |  Branch (1009:53): [True: 0, False: 0]
  |  Branch (1009:79): [True: 0, False: 0]
  ------------------
 1010|      0|            }
 1011|  36.5k|        }
 1012|      0|        else
 1013|      0|        {
 1014|       |            /* since i1_is_end_of_poc is set ,means new frame num is encountered. so
 1015|       |             * conceal the current frame completely */
 1016|      0|            prev_slice_err = 2;
 1017|      0|            num_mb_skipped =
 1018|      0|                (ps_dec->u2_frm_ht_in_mbs * ps_dec->u2_frm_wd_in_mbs) - ps_dec->u4_total_mbs_coded;
 1019|      0|            ps_cur_poc = &s_tmp_poc;
 1020|      0|        }
 1021|  36.5k|    }
 1022|    610|    else
 1023|    610|    {
 1024|    610|        if((u2_first_mb_in_slice << u1_mbaff) > ps_dec->u4_total_mbs_coded)
  ------------------
  |  Branch (1024:12): [True: 115, False: 495]
  ------------------
 1025|    115|        {
 1026|       |            // previous slice - missing/corruption
 1027|    115|            prev_slice_err = 2;
 1028|    115|            num_mb_skipped = (u2_first_mb_in_slice << u1_mbaff) - ps_dec->u4_total_mbs_coded;
 1029|    115|            ps_cur_poc = &s_tmp_poc;
 1030|    115|        }
 1031|    495|        else if((u2_first_mb_in_slice << u1_mbaff) < ps_dec->u4_total_mbs_coded)
  ------------------
  |  Branch (1031:17): [True: 0, False: 495]
  ------------------
 1032|      0|        {
 1033|      0|            return ERROR_CORRUPTED_SLICE;
 1034|      0|        }
 1035|    610|    }
 1036|  37.1k|    if(prev_slice_err)
  ------------------
  |  Branch (1036:8): [True: 115, False: 37.0k]
  ------------------
 1037|    115|    {
 1038|    115|        ret = isvcd_mark_err_slice_skip((svc_dec_lyr_struct_t *) ps_dec, num_mb_skipped,
 1039|    115|                                        u1_is_idr_slice, u2_frame_num, ps_cur_poc, prev_slice_err);
 1040|       |
 1041|    115|        if(ps_dec->u1_dangling_field == 1)
  ------------------
  |  Branch (1041:12): [True: 0, False: 115]
  ------------------
 1042|      0|        {
 1043|      0|            ps_dec->u1_second_field = 1 - ps_dec->u1_second_field;
 1044|      0|            ps_dec->u1_first_slice_in_stream = 0;
 1045|      0|            ps_dec->u1_top_bottom_decoded = TOP_FIELD_ONLY | BOT_FIELD_ONLY;
  ------------------
  |  |   64|      0|#define TOP_FIELD_ONLY      0x02
  ------------------
                          ps_dec->u1_top_bottom_decoded = TOP_FIELD_ONLY | BOT_FIELD_ONLY;
  ------------------
  |  |   65|      0|#define BOT_FIELD_ONLY      0x01
  ------------------
 1046|      0|            return ERROR_DANGLING_FIELD_IN_PIC;
 1047|      0|        }
 1048|       |
 1049|    115|        if(prev_slice_err == 2)
  ------------------
  |  Branch (1049:12): [True: 115, False: 0]
  ------------------
 1050|    115|        {
 1051|    115|            ps_dec->u1_first_slice_in_stream = 0;
 1052|    115|            return ERROR_INCOMPLETE_FRAME;
 1053|    115|        }
 1054|       |
 1055|      0|        if(ps_dec->u4_total_mbs_coded >= ps_dec->u2_frm_ht_in_mbs * ps_dec->u2_frm_wd_in_mbs)
  ------------------
  |  Branch (1055:12): [True: 0, False: 0]
  ------------------
 1056|      0|        {
 1057|       |            /* return if all MBs in frame are parsed*/
 1058|      0|            ps_dec->u1_first_slice_in_stream = 0;
 1059|      0|            return ERROR_IN_LAST_SLICE_OF_PIC;
 1060|      0|        }
 1061|       |
 1062|      0|        if(ps_dec->ps_dec_err_status->u1_err_flag & REJECT_CUR_PIC)
  ------------------
  |  |  601|      0|#define REJECT_CUR_PIC    (0x01)
  ------------------
  |  Branch (1062:12): [True: 0, False: 0]
  ------------------
 1063|      0|        {
 1064|      0|            ih264d_err_pic_dispbuf_mgr(ps_dec);
 1065|      0|            return ERROR_NEW_FRAME_EXPECTED;
 1066|      0|        }
 1067|       |
 1068|      0|        if(ret != OK) return ret;
  ------------------
  |  |  114|      0|#define OK        0
  ------------------
  |  Branch (1068:12): [True: 0, False: 0]
  ------------------
 1069|       |
 1070|      0|        i1_is_end_of_poc = 0;
 1071|      0|    }
 1072|       |
 1073|  37.0k|    if(u1_field_pic_flag)
  ------------------
  |  Branch (1073:8): [True: 0, False: 37.0k]
  ------------------
 1074|      0|    {
 1075|      0|        ps_dec->u2_prv_frame_num = u2_frame_num;
 1076|      0|    }
 1077|       |
 1078|  37.0k|    if(ps_cur_slice->u1_mmco_equalto5)
  ------------------
  |  Branch (1078:8): [True: 654, False: 36.3k]
  ------------------
 1079|    654|    {
 1080|    654|        WORD32 i4_temp_poc;
 1081|    654|        WORD32 i4_top_field_order_poc, i4_bot_field_order_poc;
 1082|    654|        WORD64 i8_result;
 1083|    654|        if(!ps_cur_slice->u1_field_pic_flag)  // or a complementary field pair
  ------------------
  |  Branch (1083:12): [True: 654, False: 0]
  ------------------
 1084|    654|        {
 1085|    654|            i4_top_field_order_poc = ps_dec->ps_cur_pic->i4_top_field_order_cnt;
 1086|    654|            i4_bot_field_order_poc = ps_dec->ps_cur_pic->i4_bottom_field_order_cnt;
 1087|    654|            i4_temp_poc = MIN(i4_top_field_order_poc, i4_bot_field_order_poc);
  ------------------
  |  |   61|    654|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 201, False: 453]
  |  |  ------------------
  ------------------
 1088|    654|        }
 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|    654|        i8_result = (WORD64) i4_temp_poc - ps_dec->ps_cur_pic->i4_top_field_order_cnt;
 1095|    654|        if(IS_OUT_OF_RANGE_S32(i8_result))
  ------------------
  |  |   58|    654|#define IS_OUT_OF_RANGE_S32(a) (((a) < INT32_MIN) || ((a) > INT32_MAX))
  |  |  ------------------
  |  |  |  Branch (58:33): [True: 0, False: 654]
  |  |  |  Branch (58:54): [True: 0, False: 654]
  |  |  ------------------
  ------------------
 1096|      0|        {
 1097|      0|            return ERROR_INV_POC;
 1098|      0|        }
 1099|    654|        ps_dec->ps_cur_pic->i4_top_field_order_cnt = (WORD32) i8_result;
 1100|    654|        i8_result = (WORD64) i4_temp_poc - ps_dec->ps_cur_pic->i4_bottom_field_order_cnt;
 1101|    654|        if(IS_OUT_OF_RANGE_S32(i8_result))
  ------------------
  |  |   58|    654|#define IS_OUT_OF_RANGE_S32(a) (((a) < INT32_MIN) || ((a) > INT32_MAX))
  |  |  ------------------
  |  |  |  Branch (58:33): [True: 0, False: 654]
  |  |  |  Branch (58:54): [True: 0, False: 654]
  |  |  ------------------
  ------------------
 1102|      0|        {
 1103|      0|            return ERROR_INV_POC;
 1104|      0|        }
 1105|    654|        ps_dec->ps_cur_pic->i4_bottom_field_order_cnt = (WORD32) i8_result;
 1106|    654|        ps_dec->ps_cur_pic->i4_poc = i4_temp_poc;
 1107|    654|        ps_dec->ps_cur_pic->i4_avg_poc = i4_temp_poc;
 1108|    654|    }
 1109|  37.0k|    if(ps_dec->u4_first_slice_in_pic)
  ------------------
  |  Branch (1109:8): [True: 36.5k, False: 495]
  ------------------
 1110|  36.5k|    {
 1111|  36.5k|        ret = isvcd_decode_pic_order_cnt(u1_is_idr_slice, u2_frame_num, &ps_dec->s_prev_pic_poc,
 1112|  36.5k|                                         &s_tmp_poc, ps_cur_slice, ps_pps, u1_nal_ref_idc,
 1113|  36.5k|                                         u1_bottom_field_flag, u1_field_pic_flag, &i4_poc, ps_dec);
 1114|  36.5k|        if(ret != OK) return ret;
  ------------------
  |  |  114|  36.5k|#define OK        0
  ------------------
  |  Branch (1114:12): [True: 109, False: 36.4k]
  ------------------
 1115|       |        /* Display seq no calculations */
 1116|  36.4k|        if(i4_poc >= ps_dec->i4_max_poc) ps_dec->i4_max_poc = i4_poc;
  ------------------
  |  Branch (1116:12): [True: 15.7k, False: 20.6k]
  ------------------
 1117|       |        /* IDR Picture or POC wrap around */
 1118|  36.4k|        if(i4_poc == 0)
  ------------------
  |  Branch (1118:12): [True: 4.99k, False: 31.4k]
  ------------------
 1119|  4.99k|        {
 1120|  4.99k|            WORD64 i8_temp;
 1121|  4.99k|            i8_temp = (WORD64) ps_dec->i4_prev_max_display_seq + ps_dec->i4_max_poc +
 1122|  4.99k|                      ps_dec->u1_max_dec_frame_buffering + 1;
 1123|       |            /*If i4_prev_max_display_seq overflows integer range, reset it */
 1124|  4.99k|            ps_dec->i4_prev_max_display_seq = IS_OUT_OF_RANGE_S32(i8_temp) ? 0 : i8_temp;
  ------------------
  |  |   58|  4.99k|#define IS_OUT_OF_RANGE_S32(a) (((a) < INT32_MIN) || ((a) > INT32_MAX))
  |  |  ------------------
  |  |  |  Branch (58:33): [True: 0, False: 4.99k]
  |  |  |  Branch (58:54): [True: 47, False: 4.95k]
  |  |  ------------------
  ------------------
 1125|  4.99k|            ps_dec->i4_max_poc = 0;
 1126|  4.99k|        }
 1127|  36.4k|    }
 1128|       |
 1129|       |    /* Increment only if the current slice has atleast 1 more MB */
 1130|  36.9k|    if(ps_dec->u4_first_slice_in_pic == 0 &&
  ------------------
  |  Branch (1130:8): [True: 495, False: 36.4k]
  ------------------
 1131|    495|       (ps_dec->ps_parse_cur_slice->u4_first_mb_in_slice <
  ------------------
  |  Branch (1131:8): [True: 495, False: 0]
  ------------------
 1132|    495|        (UWORD32) (ps_dec->u4_total_mbs_coded >> ps_dec->ps_cur_slice->u1_mbaff_frame_flag)))
 1133|    495|    {
 1134|    495|        ps_dec->ps_parse_cur_slice++;
 1135|    495|        ps_dec->u2_cur_slice_num++;
 1136|       |        // in the case of single core increment ps_decode_cur_slice
 1137|    495|        if(ps_dec->u1_separate_parse == 0)
  ------------------
  |  Branch (1137:12): [True: 332, False: 163]
  ------------------
 1138|    332|        {
 1139|    332|            ps_dec->ps_decode_cur_slice++;
 1140|    332|        }
 1141|    495|    }
 1142|       |
 1143|  36.9k|    ps_dec->u1_slice_header_done = 0;
 1144|       |
 1145|       |    /*--------------------------------------------------------------------*/
 1146|       |    /* Copy the values read from the bitstream to the slice header and then*/
 1147|       |    /* If the slice is first slice in picture, then do Start of Picture   */
 1148|       |    /* processing.                                                        */
 1149|       |    /*--------------------------------------------------------------------*/
 1150|  36.9k|    ps_cur_slice->i4_delta_pic_order_cnt[0] = i_delta_poc[0];
 1151|  36.9k|    ps_cur_slice->i4_delta_pic_order_cnt[1] = i_delta_poc[1];
 1152|  36.9k|    ps_cur_slice->u4_idr_pic_id = u4_idr_pic_id;
 1153|  36.9k|    ps_cur_slice->u2_first_mb_in_slice = u2_first_mb_in_slice;
 1154|  36.9k|    ps_cur_slice->u1_field_pic_flag = u1_field_pic_flag;
 1155|  36.9k|    ps_cur_slice->u1_bottom_field_flag = u1_bottom_field_flag;
 1156|  36.9k|    ps_cur_slice->u1_slice_type = u1_slice_type;
 1157|  36.9k|    ps_cur_slice->i4_pic_order_cnt_lsb = s_tmp_poc.i4_pic_order_cnt_lsb;
 1158|       |
 1159|  36.9k|    ps_cur_slice->u1_nal_unit_type = u1_nal_unit_type;
 1160|  36.9k|    ps_cur_slice->u1_redundant_pic_cnt = u1_redundant_pic_cnt;
 1161|  36.9k|    ps_cur_slice->u1_nal_ref_idc = u1_nal_ref_idc;
 1162|  36.9k|    ps_cur_slice->u1_pic_order_cnt_type = u1_pic_order_cnt_type;
 1163|       |
 1164|  36.9k|    if(ps_seq->u1_frame_mbs_only_flag)
  ------------------
  |  Branch (1164:8): [True: 36.9k, False: 0]
  ------------------
 1165|  36.9k|        ps_cur_slice->u1_direct_8x8_inference_flag = ps_seq->u1_direct_8x8_inference_flag;
 1166|      0|    else
 1167|      0|        ps_cur_slice->u1_direct_8x8_inference_flag = 1;
 1168|       |
 1169|  36.9k|    if(0 == ps_svc_lyr_dec->ps_nal_svc_ext->u1_quality_id)
  ------------------
  |  Branch (1169:8): [True: 36.9k, False: 0]
  ------------------
 1170|  36.9k|    {
 1171|  36.9k|        if(B_SLICE == u1_slice_type)
  ------------------
  |  |  369|  36.9k|#define B_SLICE  1
  ------------------
  |  Branch (1171:12): [True: 14.0k, False: 22.8k]
  ------------------
 1172|  14.0k|        {
 1173|  14.0k|            ps_cur_slice->u1_direct_spatial_mv_pred_flag = ih264d_get_bit_h264(ps_bitstrm);
 1174|  14.0k|            COPYTHECONTEXT("Slice Header SVC ext: direct_spatial_mv_pred_flag",
 1175|  14.0k|                           ps_cur_slice->u1_direct_spatial_mv_pred_flag);
 1176|       |
 1177|  14.0k|            if(ps_cur_slice->u1_direct_spatial_mv_pred_flag)
  ------------------
  |  Branch (1177:16): [True: 5.00k, False: 9.02k]
  ------------------
 1178|  5.00k|                ps_cur_slice->pf_decodeDirect = isvcd_decode_spatial_direct;
 1179|  9.02k|            else
 1180|  9.02k|                ps_cur_slice->pf_decodeDirect = ih264d_decode_temporal_direct;
 1181|  14.0k|            if(!((ps_seq->u1_mb_aff_flag) && (!u1_field_pic_flag)))
  ------------------
  |  Branch (1181:18): [True: 0, False: 14.0k]
  |  Branch (1181:46): [True: 0, False: 0]
  ------------------
 1182|  14.0k|                ps_dec->pf_mvpred = ih264d_mvpred_nonmbaffB;
 1183|  14.0k|        }
 1184|  22.8k|        else
 1185|  22.8k|        {
 1186|  22.8k|            if(!((ps_seq->u1_mb_aff_flag) && (!u1_field_pic_flag))) /*check if this is valid here */
  ------------------
  |  Branch (1186:18): [True: 0, False: 22.8k]
  |  Branch (1186:46): [True: 0, False: 0]
  ------------------
 1187|  22.8k|                ps_dec->pf_mvpred = ih264d_mvpred_nonmbaff;
 1188|  22.8k|        }
 1189|  36.9k|    }
 1190|       |
 1191|  36.9k|    if(ps_dec->u4_first_slice_in_pic)
  ------------------
  |  Branch (1191:8): [True: 36.4k, False: 495]
  ------------------
 1192|  36.4k|    {
 1193|  36.4k|        if(u2_first_mb_in_slice == 0)
  ------------------
  |  Branch (1193:12): [True: 36.4k, False: 0]
  ------------------
 1194|  36.4k|        {
 1195|  36.4k|            ret = isvcd_start_of_pic(ps_svc_lyr_dec, i4_poc, &s_tmp_poc, u2_frame_num, ps_pps);
 1196|  36.4k|            if(ret != OK) return ret;
  ------------------
  |  |  114|  36.4k|#define OK        0
  ------------------
  |  Branch (1196:16): [True: 1.14k, False: 35.2k]
  ------------------
 1197|       |            /*inter layer buffer intialization */
 1198|  35.2k|            ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb =
 1199|  35.2k|                ps_svc_lyr_dec->ps_inter_lyr_mb_prms_frm_start;
 1200|  35.2k|            ps_svc_lyr_dec->ps_il_pred_mv_bank_buf_cur_mb =
 1201|  35.2k|                ps_svc_lyr_dec->ps_il_pred_mv_bank_buf_base;
 1202|  35.2k|        }
 1203|       |
 1204|  35.2k|        ps_dec->u4_output_present = 0;
 1205|       |
 1206|  35.2k|        {
 1207|  35.2k|            ih264d_get_next_display_field(ps_dec, ps_dec->ps_out_buffer, &(ps_dec->s_disp_op));
 1208|       |            /* If error code is non-zero then there is no buffer available for
 1209|       |            display, hence avoid format conversion */
 1210|       |
 1211|  35.2k|            if(0 != ps_dec->s_disp_op.u4_error_code)
  ------------------
  |  Branch (1211:16): [True: 11.6k, False: 23.5k]
  ------------------
 1212|  11.6k|            {
 1213|  11.6k|                ps_dec->u4_output_present = 0;
 1214|  11.6k|                ps_dec->u4_fmt_conv_cur_row = ps_dec->s_disp_frame_info.u4_y_ht;
 1215|  11.6k|            }
 1216|  23.5k|            else
 1217|  23.5k|                ps_dec->u4_output_present = 1;
 1218|  35.2k|        }
 1219|  35.2k|        ret = isvcd_parse_interlayer_resamp_func_init(ps_svc_lyr_dec, u2_first_mb_in_slice);
 1220|  35.2k|        if(ret != OK)
  ------------------
  |  |  114|  35.2k|#define OK        0
  ------------------
  |  Branch (1220:12): [True: 514, False: 34.7k]
  ------------------
 1221|    514|        {
 1222|    514|            return ERROR_CORRUPTED_SLICE;
 1223|    514|        }
 1224|  34.7k|        if((ps_dec->u1_separate_parse == 1) &&
  ------------------
  |  Branch (1224:12): [True: 21.3k, False: 13.4k]
  ------------------
 1225|  21.3k|           (ps_svc_lyr_dec->u1_layer_identifier == TARGET_LAYER) && (ps_svc_lyr_dec->u1_res_init_done == 1))
  ------------------
  |  |  110|  21.3k|#define TARGET_LAYER 2
  ------------------
  |  Branch (1225:12): [True: 21.3k, False: 0]
  |  Branch (1225:69): [True: 21.3k, False: 0]
  ------------------
 1226|  21.3k|        {
 1227|  21.3k|            if(ps_dec->u4_dec_thread_created == 0)
  ------------------
  |  Branch (1227:16): [True: 21.3k, False: 0]
  ------------------
 1228|  21.3k|            {
 1229|  21.3k|                ithread_create(ps_dec->pv_dec_thread_handle, NULL,
 1230|  21.3k|                               (void *) isvcd_decode_picture_thread, (void *) ps_dec);
 1231|       |
 1232|  21.3k|                ps_dec->u4_dec_thread_created = 1;
 1233|  21.3k|            }
 1234|       |#ifdef KEEP_THREADS_ACTIVE
 1235|       |            ret = ithread_mutex_lock(ps_dec->apv_proc_start_mutex[0]);
 1236|       |            RETURN_IF((ret != IV_SUCCESS), ret);
 1237|       |
 1238|       |            ps_dec->ai4_process_start[0] = PROC_START;
 1239|       |            ret = ithread_cond_signal(ps_dec->apv_proc_start_condition[0]);
 1240|       |            RETURN_IF((ret != IV_SUCCESS), ret);
 1241|       |
 1242|       |            ret = ithread_mutex_unlock(ps_dec->apv_proc_start_mutex[0]);
 1243|       |            RETURN_IF((ret != IV_SUCCESS), ret);
 1244|       |#endif
 1245|       |#ifdef KEEP_THREADS_ACTIVE
 1246|       |            if(ps_dec->u4_bs_deblk_thread_created)
 1247|       |            {
 1248|       |                ret = ithread_mutex_lock(ps_dec->apv_proc_start_mutex[1]);
 1249|       |                RETURN_IF((ret != IV_SUCCESS), ret);
 1250|       |
 1251|       |                ps_dec->ai4_process_start[1] = PROC_START;
 1252|       |                ret = ithread_cond_signal(ps_dec->apv_proc_start_condition[1]);
 1253|       |                RETURN_IF((ret != IV_SUCCESS), ret);
 1254|       |
 1255|       |                ret = ithread_mutex_unlock(ps_dec->apv_proc_start_mutex[1]);
 1256|       |                RETURN_IF((ret != IV_SUCCESS), ret);
 1257|       |            }
 1258|       |#endif
 1259|  21.3k|        }
 1260|  34.7k|    }
 1261|       |
 1262|       |    /* INITIALIZATION of fn ptrs for MC and formMbPartInfo functions */
 1263|  35.2k|    {
 1264|  35.2k|        UWORD8 uc_nofield_nombaff;
 1265|       |
 1266|  35.2k|        uc_nofield_nombaff =
 1267|  35.2k|            ((ps_dec->ps_cur_slice->u1_field_pic_flag == 0) &&
  ------------------
  |  Branch (1267:14): [True: 35.2k, False: 0]
  ------------------
 1268|  35.2k|             (ps_dec->ps_cur_slice->u1_mbaff_frame_flag == 0) && (u1_slice_type != B_SLICE) &&
  ------------------
  |  |  369|  35.2k|#define B_SLICE  1
  ------------------
  |  Branch (1268:14): [True: 35.2k, False: 0]
  |  Branch (1268:66): [True: 21.7k, False: 13.4k]
  ------------------
 1269|  21.7k|             (ps_dec->ps_cur_pps->u1_wted_pred_flag == 0));
  ------------------
  |  Branch (1269:14): [True: 18.2k, False: 3.45k]
  ------------------
 1270|       |
 1271|       |        /* Initialise MC and formMbPartInfo fn ptrs one time based on profile_idc */
 1272|       |
 1273|  35.2k|        if(uc_nofield_nombaff)
  ------------------
  |  Branch (1273:12): [True: 18.2k, False: 16.9k]
  ------------------
 1274|  18.2k|        {
 1275|  18.2k|            ps_dec->p_form_mb_part_info = ih264d_form_mb_part_info_bp;
 1276|  18.2k|            ps_dec->p_motion_compensate = ih264d_motion_compensate_bp;
 1277|  18.2k|        }
 1278|  16.9k|        else
 1279|  16.9k|        {
 1280|  16.9k|            ps_dec->p_form_mb_part_info = ih264d_form_mb_part_info_mp;
 1281|  16.9k|            ps_dec->p_motion_compensate = ih264d_motion_compensate_mp;
 1282|  16.9k|        }
 1283|  35.2k|    }
 1284|       |
 1285|       |    /*
 1286|       |     * Decide whether to decode the current picture or not
 1287|       |     */
 1288|  35.2k|    {
 1289|  35.2k|        dec_err_status_t *ps_err = ps_dec->ps_dec_err_status;
 1290|  35.2k|        if(ps_err->u4_frm_sei_sync == u2_frame_num)
  ------------------
  |  Branch (1290:12): [True: 0, False: 35.2k]
  ------------------
 1291|      0|        {
 1292|      0|            ps_err->u1_err_flag = ACCEPT_ALL_PICS;
  ------------------
  |  |  600|      0|#define ACCEPT_ALL_PICS   (0x00)
  ------------------
 1293|      0|            ps_err->u4_frm_sei_sync = SYNC_FRM_DEFAULT;
  ------------------
  |  |  609|      0|#define SYNC_FRM_DEFAULT  (0xFFFFFFFF)
  ------------------
 1294|      0|        }
 1295|  35.2k|        ps_err->u4_cur_frm = u2_frame_num;
 1296|  35.2k|    }
 1297|       |
 1298|       |    /* Decision for decoding if the picture is to be skipped */
 1299|  35.2k|    {
 1300|  35.2k|        WORD32 i4_skip_b_pic, i4_skip_p_pic;
 1301|       |
 1302|  35.2k|        i4_skip_b_pic = (ps_dec->u4_skip_frm_mask & B_SLC_BIT) && (B_SLICE == u1_slice_type) &&
  ------------------
  |  |  378|  35.2k|#define B_SLC_BIT  (0x4)
  ------------------
                      i4_skip_b_pic = (ps_dec->u4_skip_frm_mask & B_SLC_BIT) && (B_SLICE == u1_slice_type) &&
  ------------------
  |  |  369|      0|#define B_SLICE  1
  ------------------
  |  Branch (1302:25): [True: 0, False: 35.2k]
  |  Branch (1302:67): [True: 0, False: 0]
  ------------------
 1303|      0|                        (0 == u1_nal_ref_idc);
  ------------------
  |  Branch (1303:25): [True: 0, False: 0]
  ------------------
 1304|       |
 1305|  35.2k|        i4_skip_p_pic = (ps_dec->u4_skip_frm_mask & P_SLC_BIT) && (P_SLICE == u1_slice_type) &&
  ------------------
  |  |  377|  35.2k|#define P_SLC_BIT  (0x2)
  ------------------
                      i4_skip_p_pic = (ps_dec->u4_skip_frm_mask & P_SLC_BIT) && (P_SLICE == u1_slice_type) &&
  ------------------
  |  |  368|      0|#define P_SLICE  0
  ------------------
  |  Branch (1305:25): [True: 0, False: 35.2k]
  |  Branch (1305:67): [True: 0, False: 0]
  ------------------
 1306|      0|                        (0 == u1_nal_ref_idc);
  ------------------
  |  Branch (1306:25): [True: 0, False: 0]
  ------------------
 1307|       |
 1308|       |        /**************************************************************/
 1309|       |        /* Skip the B picture if skip mask is set for B picture and   */
 1310|       |        /* Current B picture is a non reference B picture or there is */
 1311|       |        /* no user for reference B picture                            */
 1312|       |        /**************************************************************/
 1313|  35.2k|        if(i4_skip_b_pic)
  ------------------
  |  Branch (1313:12): [True: 0, False: 35.2k]
  ------------------
 1314|      0|        {
 1315|      0|            ps_dec->ps_cur_pic->u4_pack_slc_typ |= B_SLC_BIT;
  ------------------
  |  |  378|      0|#define B_SLC_BIT  (0x4)
  ------------------
 1316|       |            /* Don't decode the picture in SKIP-B mode if that picture is B */
 1317|       |            /* and also it is not to be used as a reference picture         */
 1318|      0|            ps_dec->u1_last_pic_not_decoded = 1;
 1319|       |
 1320|      0|            return OK;
  ------------------
  |  |  114|      0|#define OK        0
  ------------------
 1321|      0|        }
 1322|       |        /**************************************************************/
 1323|       |        /* Skip the P picture if skip mask is set for P picture and   */
 1324|       |        /* Current P picture is a non reference P picture or there is */
 1325|       |        /* no user for reference P picture                            */
 1326|       |        /**************************************************************/
 1327|  35.2k|        if(i4_skip_p_pic)
  ------------------
  |  Branch (1327:12): [True: 0, False: 35.2k]
  ------------------
 1328|      0|        {
 1329|      0|            ps_dec->ps_cur_pic->u4_pack_slc_typ |= P_SLC_BIT;
  ------------------
  |  |  377|      0|#define P_SLC_BIT  (0x2)
  ------------------
 1330|       |            /* Don't decode the picture in SKIP-P mode if that picture is P */
 1331|       |            /* and also it is not to be used as a reference picture         */
 1332|      0|            ps_dec->u1_last_pic_not_decoded = 1;
 1333|       |
 1334|      0|            return OK;
  ------------------
  |  |  114|      0|#define OK        0
  ------------------
 1335|      0|        }
 1336|  35.2k|    }
 1337|       |
 1338|  35.2k|    {
 1339|  35.2k|        UWORD16 u2_mb_x, u2_mb_y;
 1340|       |
 1341|  35.2k|        ps_dec->i4_submb_ofst =
 1342|  35.2k|            ((u2_first_mb_in_slice << ps_cur_slice->u1_mbaff_frame_flag) * SUB_BLK_SIZE) -
  ------------------
  |  |  562|  35.2k|#define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|  35.2k|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  |  |               #define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|  35.2k|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  ------------------
 1343|  35.2k|            SUB_BLK_SIZE;
  ------------------
  |  |  562|  35.2k|#define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|  35.2k|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  |  |               #define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|  35.2k|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  ------------------
 1344|  35.2k|        if(u2_first_mb_in_slice)
  ------------------
  |  Branch (1344:12): [True: 495, False: 34.7k]
  ------------------
 1345|    495|        {
 1346|    495|            UWORD8 u1_mb_aff;
 1347|    495|            UWORD8 u1_field_pic;
 1348|    495|            UWORD16 u2_frm_wd_in_mbs;
 1349|    495|            u2_frm_wd_in_mbs = ps_seq->u2_frm_wd_in_mbs;
 1350|    495|            u1_mb_aff = ps_cur_slice->u1_mbaff_frame_flag;
 1351|    495|            u1_field_pic = ps_cur_slice->u1_field_pic_flag;
 1352|       |
 1353|    495|            {
 1354|    495|                UWORD32 x_offset;
 1355|    495|                UWORD32 y_offset;
 1356|    495|                UWORD32 u4_frame_stride;
 1357|    495|                tfr_ctxt_t *ps_trns_addr;  // = &ps_dec->s_tran_addrecon_parse;
 1358|       |
 1359|    495|                if(ps_dec->u1_separate_parse)
  ------------------
  |  Branch (1359:20): [True: 163, False: 332]
  ------------------
 1360|    163|                {
 1361|    163|                    ps_trns_addr = &ps_dec->s_tran_addrecon_parse;
 1362|    163|                }
 1363|    332|                else
 1364|    332|                {
 1365|    332|                    ps_trns_addr = &ps_dec->s_tran_addrecon;
 1366|    332|                }
 1367|    495|                u2_mb_x = MOD(u2_first_mb_in_slice, u2_frm_wd_in_mbs);
  ------------------
  |  |   64|    495|#define MOD(x,y) ((x)%(y))
  ------------------
 1368|    495|                u2_mb_y = DIV(u2_first_mb_in_slice, u2_frm_wd_in_mbs);
  ------------------
  |  |   65|    495|#define DIV(x,y) ((x)/(y))
  ------------------
 1369|       |
 1370|    495|                u2_mb_y <<= u1_mb_aff;
 1371|       |
 1372|    495|                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: 495]
  |  Branch (1372:56): [True: 0, False: 495]
  ------------------
 1373|      0|                {
 1374|      0|                    return ERROR_CORRUPTED_SLICE;
 1375|      0|                }
 1376|       |
 1377|    495|                u4_frame_stride = ps_dec->u2_frm_wd_y << u1_field_pic;
 1378|    495|                x_offset = u2_mb_x << 4;
 1379|    495|                y_offset = (u2_mb_y * u4_frame_stride) << 4;
 1380|       |
 1381|    495|                ps_trns_addr->pu1_dest_y = ps_dec->s_cur_pic.pu1_buf1 + x_offset + y_offset;
 1382|       |
 1383|    495|                u4_frame_stride = ps_dec->u2_frm_wd_uv << u1_field_pic;
 1384|    495|                x_offset >>= 1;
 1385|    495|                y_offset = (u2_mb_y * u4_frame_stride) << 3;
 1386|       |
 1387|    495|                x_offset *= YUV420SP_FACTOR;
  ------------------
  |  |  119|    495|#define YUV420SP_FACTOR 2
  ------------------
 1388|       |
 1389|    495|                ps_trns_addr->pu1_dest_u = ps_dec->s_cur_pic.pu1_buf2 + x_offset + y_offset;
 1390|    495|                ps_trns_addr->pu1_dest_v = ps_dec->s_cur_pic.pu1_buf3 + x_offset + y_offset;
 1391|       |
 1392|    495|                ps_trns_addr->pu1_mb_y = ps_trns_addr->pu1_dest_y;
 1393|    495|                ps_trns_addr->pu1_mb_u = ps_trns_addr->pu1_dest_u;
 1394|    495|                ps_trns_addr->pu1_mb_v = ps_trns_addr->pu1_dest_v;
 1395|       |
 1396|       |                // assign the deblock structure pointers to start of slice
 1397|    495|                if(ps_dec->u1_separate_parse == 1)
  ------------------
  |  Branch (1397:20): [True: 163, False: 332]
  ------------------
 1398|    163|                {
 1399|    163|                    ps_dec->ps_deblk_mbn =
 1400|    163|                        ps_dec->ps_deblk_pic + (u2_first_mb_in_slice << u1_mb_aff);
 1401|    163|                }
 1402|    332|                else
 1403|    332|                {
 1404|    332|                    ps_dec->ps_deblk_mbn =
 1405|    332|                        ps_dec->ps_deblk_pic + (u2_first_mb_in_slice << u1_mb_aff);
 1406|    332|                }
 1407|       |
 1408|    495|                ps_dec->u4_cur_mb_addr = (u2_first_mb_in_slice << u1_mb_aff);
 1409|       |
 1410|    495|                ps_dec->ps_mv_cur =
 1411|    495|                    ps_dec->s_cur_pic.ps_mv + ((u2_first_mb_in_slice << u1_mb_aff) << 4);
 1412|    495|            }
 1413|    495|        }
 1414|  34.7k|        else
 1415|  34.7k|        {
 1416|  34.7k|            tfr_ctxt_t *ps_trns_addr;
 1417|       |
 1418|  34.7k|            if(ps_dec->u1_separate_parse)
  ------------------
  |  Branch (1418:16): [True: 21.3k, False: 13.4k]
  ------------------
 1419|  21.3k|            {
 1420|  21.3k|                ps_trns_addr = &ps_dec->s_tran_addrecon_parse;
 1421|  21.3k|            }
 1422|  13.4k|            else
 1423|  13.4k|            {
 1424|  13.4k|                ps_trns_addr = &ps_dec->s_tran_addrecon;
 1425|  13.4k|            }
 1426|       |
 1427|  34.7k|            u2_mb_x = 0xffff;
 1428|  34.7k|            u2_mb_y = 0;
 1429|       |            // assign the deblock structure pointers to start of slice
 1430|  34.7k|            ps_dec->u4_cur_mb_addr = 0;
 1431|  34.7k|            ps_dec->ps_deblk_mbn = ps_dec->ps_deblk_pic;
 1432|  34.7k|            ps_dec->ps_mv_cur = ps_dec->s_cur_pic.ps_mv;
 1433|  34.7k|            ps_trns_addr->pu1_dest_y = ps_dec->s_cur_pic.pu1_buf1;
 1434|  34.7k|            ps_trns_addr->pu1_dest_u = ps_dec->s_cur_pic.pu1_buf2;
 1435|  34.7k|            ps_trns_addr->pu1_dest_v = ps_dec->s_cur_pic.pu1_buf3;
 1436|       |
 1437|  34.7k|            ps_trns_addr->pu1_mb_y = ps_trns_addr->pu1_dest_y;
 1438|  34.7k|            ps_trns_addr->pu1_mb_u = ps_trns_addr->pu1_dest_u;
 1439|  34.7k|            ps_trns_addr->pu1_mb_v = ps_trns_addr->pu1_dest_v;
 1440|  34.7k|        }
 1441|       |
 1442|  35.2k|        ps_dec->ps_part = ps_dec->ps_parse_part_params;
 1443|       |
 1444|  35.2k|        ps_dec->u2_mbx = (MOD(u2_first_mb_in_slice - 1, ps_seq->u2_frm_wd_in_mbs));
  ------------------
  |  |   64|  35.2k|#define MOD(x,y) ((x)%(y))
  ------------------
 1445|  35.2k|        ps_dec->u2_mby = (DIV(u2_first_mb_in_slice - 1, ps_seq->u2_frm_wd_in_mbs));
  ------------------
  |  |   65|  35.2k|#define DIV(x,y) ((x)/(y))
  ------------------
 1446|  35.2k|        ps_dec->u2_mby <<= ps_cur_slice->u1_mbaff_frame_flag;
 1447|  35.2k|        ps_dec->i2_prev_slice_mbx = ps_dec->u2_mbx;
 1448|  35.2k|        ps_dec->i2_prev_slice_mby = ps_dec->u2_mby;
 1449|  35.2k|    }
 1450|       |
 1451|       |    /* RBSP stop bit is used for CABAC decoding*/
 1452|      0|    ps_bitstrm->u4_max_ofst += ps_dec->ps_cur_pps->u1_entropy_coding_mode;
 1453|       |
 1454|  35.2k|    ps_dec->u1_B = (u1_slice_type == B_SLICE);
  ------------------
  |  |  369|  35.2k|#define B_SLICE  1
  ------------------
 1455|  35.2k|    ps_dec->u4_next_mb_skip = 0;
 1456|       |
 1457|  35.2k|    ps_dec->ps_parse_cur_slice->u4_first_mb_in_slice = ps_dec->ps_cur_slice->u2_first_mb_in_slice;
 1458|  35.2k|    ps_dec->ps_parse_cur_slice->slice_type = ps_dec->ps_cur_slice->u1_slice_type;
 1459|       |
 1460|  35.2k|    ps_dec->u4_start_recon_deblk = 1;
 1461|  35.2k|    {
 1462|  35.2k|        WORD32 num_entries;
 1463|  35.2k|        WORD32 size;
 1464|  35.2k|        UWORD8 *pu1_buf;
 1465|       |
 1466|  35.2k|        num_entries = MAX_FRAMES;
  ------------------
  |  |  600|  35.2k|#define MAX_FRAMES              16
  ------------------
 1467|  35.2k|        if((1 >= ps_dec->ps_cur_sps->u1_num_ref_frames) && (0 == ps_dec->i4_display_delay))
  ------------------
  |  Branch (1467:12): [True: 24.2k, False: 10.9k]
  |  Branch (1467:60): [True: 0, False: 24.2k]
  ------------------
 1468|      0|        {
 1469|      0|            num_entries = 1;
 1470|      0|        }
 1471|  35.2k|        num_entries = ((2 * num_entries) + 1);
 1472|  35.2k|        num_entries *= 2;
 1473|       |
 1474|  35.2k|        size = num_entries * sizeof(void *);
 1475|  35.2k|        size += PAD_MAP_IDX_POC * sizeof(void *);
  ------------------
  |  |  100|  35.2k|#define PAD_MAP_IDX_POC             (1)
  ------------------
 1476|       |
 1477|  35.2k|        pu1_buf = (UWORD8 *) ps_dec->pv_map_ref_idx_to_poc_buf;
 1478|  35.2k|        pu1_buf += size * ps_dec->u2_cur_slice_num;
 1479|  35.2k|        ps_dec->ps_parse_cur_slice->ppv_map_ref_idx_to_poc = (void *) pu1_buf;
 1480|  35.2k|    }
 1481|       |
 1482|  35.2k|    if(ps_dec->u1_separate_parse)
  ------------------
  |  Branch (1482:8): [True: 21.4k, False: 13.7k]
  ------------------
 1483|  21.4k|    {
 1484|  21.4k|        ps_dec->ps_parse_cur_slice->pv_tu_coeff_data_start = ps_dec->pv_parse_tu_coeff_data;
 1485|  21.4k|    }
 1486|  13.7k|    else
 1487|  13.7k|    {
 1488|  13.7k|        ps_dec->pv_proc_tu_coeff_data = ps_dec->pv_parse_tu_coeff_data;
 1489|  13.7k|    }
 1490|       |
 1491|  35.2k|    ret = ih264d_fix_error_in_dpb(ps_dec);
 1492|  35.2k|    if(ret < 0) return ERROR_DBP_MANAGER_T;
  ------------------
  |  Branch (1492:8): [True: 0, False: 35.2k]
  ------------------
 1493|       |
 1494|       |    /*Default initializing default values for some parameters*/
 1495|  35.2k|    ps_svc_slice_params->u1_slice_skip_flag = 0;
 1496|  35.2k|    ps_svc_slice_params->u1_adaptive_base_mode_flag = 0;
 1497|  35.2k|    ps_svc_slice_params->u1_default_base_mode_flag = 0;
 1498|  35.2k|    ps_svc_slice_params->u1_adaptive_motion_prediction_flag = 0;
 1499|  35.2k|    ps_svc_slice_params->u1_default_motion_prediction_flag = 0;
 1500|  35.2k|    ps_svc_slice_params->u1_adaptive_residual_prediction_flag = 0;
 1501|  35.2k|    ps_svc_slice_params->u1_default_residual_prediction_flag = 0;
 1502|       |
 1503|  35.2k|    if(u1_slice_type == I_SLICE)
  ------------------
  |  |  370|  35.2k|#define I_SLICE  2
  ------------------
  |  Branch (1503:8): [True: 6.38k, False: 28.8k]
  ------------------
 1504|  6.38k|    {
 1505|  6.38k|        ps_dec->ps_cur_pic->u4_pack_slc_typ |= I_SLC_BIT;
  ------------------
  |  |  376|  6.38k|#define I_SLC_BIT  (0x1)
  ------------------
 1506|       |
 1507|  6.38k|        ret = isvcd_parse_eislice(ps_svc_lyr_dec, u2_first_mb_in_slice);
 1508|  6.38k|        ps_dec->u1_pr_sl_type = u1_slice_type;
 1509|  6.38k|        if(ps_dec->i4_pic_type != B_SLICE && ps_dec->i4_pic_type != P_SLICE)
  ------------------
  |  |  369|  12.7k|#define B_SLICE  1
  ------------------
                      if(ps_dec->i4_pic_type != B_SLICE && ps_dec->i4_pic_type != P_SLICE)
  ------------------
  |  |  368|  6.21k|#define P_SLICE  0
  ------------------
  |  Branch (1509:12): [True: 6.21k, False: 162]
  |  Branch (1509:46): [True: 6.14k, False: 73]
  ------------------
 1510|  6.14k|            ps_dec->i4_pic_type = I_SLICE;
  ------------------
  |  |  370|  6.14k|#define I_SLICE  2
  ------------------
 1511|  6.38k|    }
 1512|  28.8k|    else if(u1_slice_type == P_SLICE)
  ------------------
  |  |  368|  28.8k|#define P_SLICE  0
  ------------------
  |  Branch (1512:13): [True: 15.2k, False: 13.5k]
  ------------------
 1513|  15.2k|    {
 1514|  15.2k|        ps_dec->ps_cur_pic->u4_pack_slc_typ |= P_SLC_BIT;
  ------------------
  |  |  377|  15.2k|#define P_SLC_BIT  (0x2)
  ------------------
 1515|  15.2k|        ret = isvcd_parse_epslice(ps_svc_lyr_dec, u2_first_mb_in_slice);
 1516|  15.2k|        ps_dec->u1_pr_sl_type = u1_slice_type;
 1517|  15.2k|        if(ps_dec->i4_pic_type != B_SLICE) ps_dec->i4_pic_type = P_SLICE;
  ------------------
  |  |  369|  15.2k|#define B_SLICE  1
  ------------------
                      if(ps_dec->i4_pic_type != B_SLICE) ps_dec->i4_pic_type = P_SLICE;
  ------------------
  |  |  368|  15.2k|#define P_SLICE  0
  ------------------
  |  Branch (1517:12): [True: 15.2k, False: 66]
  ------------------
 1518|  15.2k|    }
 1519|  13.5k|    else if(u1_slice_type == B_SLICE)
  ------------------
  |  |  369|  13.5k|#define B_SLICE  1
  ------------------
  |  Branch (1519:13): [True: 13.4k, False: 73]
  ------------------
 1520|  13.4k|    {
 1521|  13.4k|        ps_dec->ps_cur_pic->u4_pack_slc_typ |= B_SLC_BIT;
  ------------------
  |  |  378|  13.4k|#define B_SLC_BIT  (0x4)
  ------------------
 1522|  13.4k|        ret = isvcd_parse_ebslice(ps_svc_lyr_dec, u2_first_mb_in_slice);
 1523|  13.4k|        ps_dec->u1_pr_sl_type = u1_slice_type;
 1524|  13.4k|        ps_dec->i4_pic_type = B_SLICE;
  ------------------
  |  |  369|  13.4k|#define B_SLICE  1
  ------------------
 1525|  13.4k|    }
 1526|     73|    else
 1527|     73|        return ERROR_INV_SLC_TYPE_T;
 1528|       |
 1529|  35.1k|    if(ps_dec->u1_slice_header_done)
  ------------------
  |  Branch (1529:8): [True: 25.6k, False: 9.48k]
  ------------------
 1530|  25.6k|    {
 1531|       |        /* set to zero to indicate a valid slice has been decoded */
 1532|  25.6k|        ps_dec->u1_first_slice_in_stream = 0;
 1533|  25.6k|    }
 1534|       |
 1535|  35.1k|    if(ret != OK) return ret;
  ------------------
  |  |  114|  35.1k|#define OK        0
  ------------------
  |  Branch (1535:8): [True: 22.8k, False: 12.3k]
  ------------------
 1536|       |
 1537|  12.3k|    if(u1_nal_ref_idc != 0)
  ------------------
  |  Branch (1537:8): [True: 11.1k, False: 1.24k]
  ------------------
 1538|  11.1k|    {
 1539|  11.1k|        if(!ps_dec->ps_dpb_cmds->u1_dpb_commands_read)
  ------------------
  |  Branch (1539:12): [True: 10.8k, False: 232]
  ------------------
 1540|  10.8k|        {
 1541|  10.8k|            memcpy((void *) ps_dec->ps_dpb_cmds, (void *) (&(ps_dec->s_dpb_cmds_scratch)),
 1542|  10.8k|                   sizeof(dpb_commands_t));
 1543|  10.8k|        }
 1544|  11.1k|    }
 1545|       |
 1546|       |    /* storing last Mb X and MbY of the slice */
 1547|  12.3k|    ps_dec->i2_prev_slice_mbx = ps_dec->u2_mbx;
 1548|  12.3k|    ps_dec->i2_prev_slice_mby = ps_dec->u2_mby;
 1549|       |
 1550|       |    /* End of Picture detection */
 1551|  12.3k|    if(ps_dec->u4_total_mbs_coded >= (ps_seq->u4_max_mb_addr + 1))
  ------------------
  |  Branch (1551:8): [True: 7.85k, False: 4.50k]
  ------------------
 1552|  7.85k|    {
 1553|  7.85k|        ps_dec->u1_pic_decode_done = 1;
 1554|  7.85k|    }
 1555|       |
 1556|  12.3k|    {
 1557|  12.3k|        dec_err_status_t *ps_err = ps_dec->ps_dec_err_status;
 1558|  12.3k|        if((ps_err->u1_err_flag & REJECT_PB_PICS) && (ps_err->u1_cur_pic_type == PIC_TYPE_I))
  ------------------
  |  |  602|  12.3k|#define REJECT_PB_PICS    (0x02)
  ------------------
                      if((ps_err->u1_err_flag & REJECT_PB_PICS) && (ps_err->u1_cur_pic_type == PIC_TYPE_I))
  ------------------
  |  |  608|      0|#define PIC_TYPE_I        (0x00)
  ------------------
  |  Branch (1558:12): [True: 0, False: 12.3k]
  |  Branch (1558:54): [True: 0, False: 0]
  ------------------
 1559|      0|        {
 1560|      0|            ps_err->u1_err_flag = ACCEPT_ALL_PICS;
  ------------------
  |  |  600|      0|#define ACCEPT_ALL_PICS   (0x00)
  ------------------
 1561|      0|        }
 1562|  12.3k|    }
 1563|       |
 1564|  12.3k|    PRINT_BIN_BIT_RATIO(ps_dec)
 1565|       |
 1566|  12.3k|    return ret;
 1567|  35.1k|}
isvcd_set_default_slice_header_ext:
 1581|  27.8k|{
 1582|  27.8k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
 1583|  27.8k|    WORD32 i_status = OK;
  ------------------
  |  |  114|  27.8k|#define OK        0
  ------------------
 1584|  27.8k|    dec_pic_params_t *ps_pps = ps_dec->ps_cur_pps;
 1585|  27.8k|    dec_seq_params_t *ps_seq;
 1586|  27.8k|    dec_svc_seq_params_t *ps_subset_seq;
 1587|  27.8k|    dec_slice_svc_ext_params_t *ps_svc_slice_params = NULL;
 1588|  27.8k|    dec_subset_seq_params_t *ps_sps_svc_ext = NULL;
 1589|  27.8k|    ps_seq = ps_pps->ps_sps;
 1590|  27.8k|    ps_seq += MAX_NUM_SEQ_PARAMS;
  ------------------
  |  |  521|  27.8k|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
 1591|  27.8k|    ps_subset_seq =
 1592|  27.8k|        &ps_svc_lyr_dec->ps_subset_sps[MAX_NUM_SEQ_PARAMS + ps_seq->u1_seq_parameter_set_id];
  ------------------
  |  |  521|  27.8k|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
 1593|  27.8k|    ps_sps_svc_ext = &ps_subset_seq->s_sps_svc_ext;
 1594|  27.8k|    ps_svc_slice_params = &ps_svc_lyr_dec->s_svc_slice_params;
 1595|       |
 1596|  27.8k|    if(0 == ps_svc_lyr_dec->ps_nal_svc_ext->u1_quality_id)
  ------------------
  |  Branch (1596:8): [True: 27.8k, False: 0]
  ------------------
 1597|  27.8k|    {
 1598|  27.8k|        ps_svc_slice_params->u1_ref_layer_chroma_phase_y_plus1 =
 1599|  27.8k|            ps_sps_svc_ext->u1_seq_ref_layer_chroma_phase_y_plus1;
 1600|       |
 1601|  27.8k|        ps_svc_slice_params->u1_ref_layer_chroma_phase_x_plus1_flag =
 1602|  27.8k|            ps_sps_svc_ext->u1_seq_ref_layer_chroma_phase_x_plus1_flag;
 1603|  27.8k|    }
 1604|       |
 1605|  27.8k|    ps_svc_slice_params->u4_ref_layer_dq_id = UINT32_MAX;
 1606|  27.8k|    ps_svc_slice_params->u4_disable_inter_layer_deblk_filter_idc = 0;
 1607|  27.8k|    ps_svc_slice_params->u1_scan_idx_start = 0;
 1608|  27.8k|    ps_svc_slice_params->u1_scan_idx_end = 15;
 1609|  27.8k|    ps_svc_slice_params->i4_inter_layer_slice_alpha_c0_offset_div2 = 0;
 1610|  27.8k|    ps_svc_slice_params->i4_inter_layer_slice_beta_offset_div2 = 0;
 1611|  27.8k|    ps_svc_slice_params->u1_constrained_intra_resampling_flag = 0;
 1612|       |
 1613|  27.8k|    return i_status;
 1614|  27.8k|}
isvcd_parse_slice_header:
 1628|  27.8k|{
 1629|  27.8k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
 1630|  27.8k|    dec_pic_params_t *ps_pps = ps_dec->ps_cur_pps;
 1631|  27.8k|    dec_bit_stream_t *ps_bitstrm = ps_dec->ps_bitstrm;
 1632|  27.8k|    dec_seq_params_t *ps_seq;
 1633|  27.8k|    dec_svc_seq_params_t *ps_subset_seq;
 1634|  27.8k|    dec_slice_svc_ext_params_t *ps_svc_slice_params = NULL;
 1635|  27.8k|    dec_subset_seq_params_t *ps_sps_svc_ext = NULL;
 1636|  27.8k|    svc_dec_ctxt_t *ps_svcd_ctxt;
 1637|  27.8k|    UWORD32 *pu4_bitstrm_buf = ps_dec->ps_bitstrm->pu4_buffer;
 1638|  27.8k|    UWORD32 *pu4_bitstrm_ofst = &ps_dec->ps_bitstrm->u4_ofst;
 1639|  27.8k|    ps_svcd_ctxt = ps_svc_lyr_dec->ps_svcd_ctxt;
 1640|  27.8k|    ps_seq = ps_pps->ps_sps;
 1641|  27.8k|    ps_seq += MAX_NUM_SEQ_PARAMS;
  ------------------
  |  |  521|  27.8k|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
 1642|  27.8k|    ps_subset_seq =
 1643|  27.8k|        &ps_svc_lyr_dec->ps_subset_sps[MAX_NUM_SEQ_PARAMS + ps_seq->u1_seq_parameter_set_id];
  ------------------
  |  |  521|  27.8k|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
 1644|  27.8k|    ps_sps_svc_ext = &ps_subset_seq->s_sps_svc_ext;
 1645|  27.8k|    ps_svc_slice_params = &ps_svc_lyr_dec->s_svc_slice_params;
 1646|       |
 1647|  27.8k|    if(!ps_svc_lyr_dec->ps_nal_svc_ext->u1_no_inter_layer_pred_flag &&
  ------------------
  |  Branch (1647:8): [True: 27.8k, False: 0]
  ------------------
 1648|  27.8k|       (0 == ps_svc_lyr_dec->ps_nal_svc_ext->u1_quality_id))
  ------------------
  |  Branch (1648:8): [True: 27.8k, False: 0]
  ------------------
 1649|  27.8k|    {
 1650|  27.8k|        ps_svc_slice_params->u4_ref_layer_dq_id = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1651|  27.8k|        COPYTHECONTEXT("Slice Header SVC ext: u4_ref_layer_dq_id",
 1652|  27.8k|                       ps_svc_slice_params->u4_ref_layer_dq_id);
 1653|  27.8k|        if(ps_svc_slice_params->u4_ref_layer_dq_id > MAX_REF_DEP_ID)
  ------------------
  |  |  106|  27.8k|#define MAX_REF_DEP_ID ((MAX_DEPENDENCY_ID << 4) | MAX_QUALITY_ID)
  |  |  ------------------
  |  |  |  |  103|  27.8k|#define MAX_DEPENDENCY_ID 4
  |  |  ------------------
  |  |               #define MAX_REF_DEP_ID ((MAX_DEPENDENCY_ID << 4) | MAX_QUALITY_ID)
  |  |  ------------------
  |  |  |  |  102|  27.8k|#define MAX_QUALITY_ID 0
  |  |  ------------------
  ------------------
  |  Branch (1653:12): [True: 506, False: 27.3k]
  ------------------
 1654|    506|        {
 1655|    506|            return ERROR_INV_SLICE_HDR_T;
 1656|    506|        }
 1657|       |        /* Reference layer id update is taken care during resolution init */
 1658|       |        /*
 1659|       |        ps_svc_lyr_dec->u1_ref_layer_id = ps_svc_slice_params->u4_ref_layer_dq_id >> 4;
 1660|       |        if(ps_svc_lyr_dec->u1_ref_layer_id >= ps_svc_lyr_dec->u1_layer_id)
 1661|       |        {
 1662|       |            return ERROR_INV_SLICE_HDR_T;
 1663|       |        }
 1664|       |        */
 1665|  27.3k|        ps_svc_lyr_dec->ps_dec_svc_ref_layer =
 1666|  27.3k|            &ps_svcd_ctxt->ps_svc_dec_lyr[ps_svc_lyr_dec->u1_ref_layer_id];
 1667|       |
 1668|  27.3k|        if(ps_sps_svc_ext->u1_inter_layer_deblocking_filter_control_present_flag)
  ------------------
  |  Branch (1668:12): [True: 1.74k, False: 25.5k]
  ------------------
 1669|  1.74k|        {
 1670|  1.74k|            ps_svc_slice_params->u4_disable_inter_layer_deblk_filter_idc =
 1671|  1.74k|                ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1672|  1.74k|            COPYTHECONTEXT("Slice Header SVC ext: u4_disable_inter_layer_deblk_filter_idc",
 1673|  1.74k|                           ps_svc_slice_params->u4_disable_inter_layer_deblk_filter_idc);
 1674|       |
 1675|  1.74k|            if(ps_svc_slice_params->u4_disable_inter_layer_deblk_filter_idc > 6)
  ------------------
  |  Branch (1675:16): [True: 85, False: 1.66k]
  ------------------
 1676|     85|            {
 1677|     85|                return ERROR_INV_SLICE_HDR_T;
 1678|     85|            }
 1679|       |
 1680|  1.66k|            if(1 != ps_svc_slice_params->u4_disable_inter_layer_deblk_filter_idc)
  ------------------
  |  Branch (1680:16): [True: 1.31k, False: 347]
  ------------------
 1681|  1.31k|            {
 1682|  1.31k|                ps_svc_slice_params->i4_inter_layer_slice_alpha_c0_offset_div2 =
 1683|  1.31k|                    ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1684|  1.31k|                COPYTHECONTEXT("Slice Header SVC ext: i4_inter_layer_slice_alpha_c0_offset_div2",
 1685|  1.31k|                               ps_svc_slice_params->i4_inter_layer_slice_alpha_c0_offset_div2);
 1686|       |
 1687|  1.31k|                if(ps_svc_slice_params->i4_inter_layer_slice_alpha_c0_offset_div2 > 6 ||
  ------------------
  |  Branch (1687:20): [True: 122, False: 1.19k]
  ------------------
 1688|  1.19k|                   ps_svc_slice_params->i4_inter_layer_slice_alpha_c0_offset_div2 < -6)
  ------------------
  |  Branch (1688:20): [True: 125, False: 1.06k]
  ------------------
 1689|    247|                {
 1690|    247|                    return ERROR_INV_SLICE_HDR_T;
 1691|    247|                }
 1692|       |
 1693|  1.06k|                ps_svc_slice_params->i4_inter_layer_slice_beta_offset_div2 =
 1694|  1.06k|                    ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1695|  1.06k|                COPYTHECONTEXT("Slice Header SVC ext: i4_inter_layer_slice_beta_offset_div2",
 1696|  1.06k|                               ps_svc_slice_params->i4_inter_layer_slice_beta_offset_div2);
 1697|       |
 1698|  1.06k|                if(ps_svc_slice_params->i4_inter_layer_slice_beta_offset_div2 > 6 ||
  ------------------
  |  Branch (1698:20): [True: 116, False: 952]
  ------------------
 1699|    952|                   ps_svc_slice_params->i4_inter_layer_slice_beta_offset_div2 < -6)
  ------------------
  |  Branch (1699:20): [True: 124, False: 828]
  ------------------
 1700|    240|                {
 1701|    240|                    return ERROR_INV_SLICE_HDR_T;
 1702|    240|                }
 1703|  1.06k|            }
 1704|  1.66k|        }
 1705|       |
 1706|  26.7k|        ps_svc_slice_params->u1_constrained_intra_resampling_flag = ih264d_get_bit_h264(ps_bitstrm);
 1707|  26.7k|        COPYTHECONTEXT("Slice Header SVC ext: u1_constrained_intra_resampling_flag",
 1708|  26.7k|                       ps_svc_slice_params->u1_constrained_intra_resampling_flag);
 1709|       |
 1710|  26.7k|        ps_svc_lyr_dec->s_res_prms.i1_constrained_intra_rsmpl_flag =
 1711|  26.7k|            ps_svc_lyr_dec->s_svc_slice_params.u1_constrained_intra_resampling_flag;
 1712|  26.7k|        isvcd_intra_resamp_res_init_update_flags(ps_svc_lyr_dec);
 1713|       |
 1714|  26.7k|        if(2 == ps_sps_svc_ext->u1_extended_spatial_scalability_idc)
  ------------------
  |  Branch (1714:12): [True: 0, False: 26.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|  26.7k|        else
 1800|  26.7k|        {
 1801|  26.7k|            ps_svc_slice_params->i4_scaled_ref_layer_left_offset =
 1802|  26.7k|                ps_sps_svc_ext->i4_seq_scaled_ref_layer_left_offset;
 1803|  26.7k|            ps_svc_slice_params->i4_scaled_ref_layer_top_offset =
 1804|  26.7k|                ps_sps_svc_ext->i4_seq_scaled_ref_layer_top_offset;
 1805|  26.7k|            ps_svc_slice_params->i4_scaled_ref_layer_right_offset =
 1806|  26.7k|                ps_sps_svc_ext->i4_seq_scaled_ref_layer_right_offset;
 1807|  26.7k|            ps_svc_slice_params->i4_scaled_ref_layer_bottom_offset =
 1808|  26.7k|                ps_sps_svc_ext->i4_seq_scaled_ref_layer_bottom_offset;
 1809|  26.7k|        }
 1810|  26.7k|    }
 1811|       |
 1812|  26.7k|    if(!ps_svc_lyr_dec->ps_nal_svc_ext->u1_no_inter_layer_pred_flag)
  ------------------
  |  Branch (1812:8): [True: 26.7k, False: 0]
  ------------------
 1813|  26.7k|    {
 1814|  26.7k|        ps_svc_slice_params->u1_slice_skip_flag = ih264d_get_bit_h264(ps_bitstrm);
 1815|  26.7k|        COPYTHECONTEXT("Slice Header SVC ext: u1_slice_skip_flag",
 1816|  26.7k|                       ps_svc_slice_params->u1_slice_skip_flag);
 1817|       |
 1818|  26.7k|        if(ps_svc_slice_params->u1_slice_skip_flag)
  ------------------
  |  Branch (1818:12): [True: 1.00k, False: 25.7k]
  ------------------
 1819|  1.00k|        {
 1820|  1.00k|            ps_svc_slice_params->u4_num_mbs_in_slice_minus1 =
 1821|  1.00k|                ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1822|  1.00k|            COPYTHECONTEXT("Slice Header SVC ext: u4_num_mbs_in_slice_minus1",
 1823|  1.00k|                           ps_svc_slice_params->u4_num_mbs_in_slice_minus1);
 1824|  1.00k|        }
 1825|  25.7k|        else
 1826|  25.7k|        {
 1827|  25.7k|            ps_svc_slice_params->u1_adaptive_base_mode_flag = ih264d_get_bit_h264(ps_bitstrm);
 1828|  25.7k|            COPYTHECONTEXT("Slice Header SVC ext: u1_adaptive_base_mode_flag",
 1829|  25.7k|                           ps_svc_slice_params->u1_adaptive_base_mode_flag);
 1830|       |
 1831|  25.7k|            if(!ps_svc_slice_params->u1_adaptive_base_mode_flag)
  ------------------
  |  Branch (1831:16): [True: 14.1k, False: 11.5k]
  ------------------
 1832|  14.1k|            {
 1833|  14.1k|                ps_svc_slice_params->u1_default_base_mode_flag = ih264d_get_bit_h264(ps_bitstrm);
 1834|  14.1k|                COPYTHECONTEXT("Slice Header SVC ext: u1_default_base_mode_flag",
 1835|  14.1k|                               ps_svc_slice_params->u1_default_base_mode_flag);
 1836|  14.1k|            }
 1837|  25.7k|            if(!ps_svc_slice_params->u1_default_base_mode_flag)
  ------------------
  |  Branch (1837:16): [True: 19.4k, False: 6.24k]
  ------------------
 1838|  19.4k|            {
 1839|  19.4k|                ps_svc_slice_params->u1_adaptive_motion_prediction_flag =
 1840|  19.4k|                    ih264d_get_bit_h264(ps_bitstrm);
 1841|  19.4k|                COPYTHECONTEXT("Slice Header SVC ext: u1_adaptive_motion_prediction_flag",
 1842|  19.4k|                               ps_svc_slice_params->u1_adaptive_motion_prediction_flag);
 1843|       |
 1844|  19.4k|                if(!ps_svc_slice_params->u1_adaptive_motion_prediction_flag)
  ------------------
  |  Branch (1844:20): [True: 12.9k, False: 6.56k]
  ------------------
 1845|  12.9k|                {
 1846|  12.9k|                    ps_svc_slice_params->u1_default_motion_prediction_flag =
 1847|  12.9k|                        ih264d_get_bit_h264(ps_bitstrm);
 1848|  12.9k|                    COPYTHECONTEXT("Slice Header SVC ext: u1_default_motion_prediction_flag",
 1849|  12.9k|                                   ps_svc_slice_params->u1_default_motion_prediction_flag);
 1850|  12.9k|                }
 1851|  19.4k|            }
 1852|  25.7k|            ps_svc_slice_params->u1_adaptive_residual_prediction_flag =
 1853|  25.7k|                ih264d_get_bit_h264(ps_bitstrm);
 1854|  25.7k|            COPYTHECONTEXT("Slice Header SVC ext: u1_adaptive_residual_prediction_flag",
 1855|  25.7k|                           ps_svc_slice_params->u1_adaptive_residual_prediction_flag);
 1856|       |
 1857|  25.7k|            if(!ps_svc_slice_params->u1_adaptive_residual_prediction_flag)
  ------------------
  |  Branch (1857:16): [True: 17.6k, False: 8.12k]
  ------------------
 1858|  17.6k|            {
 1859|  17.6k|                ps_svc_slice_params->u1_default_residual_prediction_flag =
 1860|  17.6k|                    ih264d_get_bit_h264(ps_bitstrm);
 1861|  17.6k|                COPYTHECONTEXT("Slice Header SVC ext: u1_default_residual_prediction_flag",
 1862|  17.6k|                               ps_svc_slice_params->u1_default_residual_prediction_flag);
 1863|  17.6k|            }
 1864|  25.7k|        }
 1865|       |
 1866|  26.7k|        if(ps_sps_svc_ext->u1_adaptive_tcoeff_level_prediction_flag)
  ------------------
  |  Branch (1866:12): [True: 1.35k, False: 25.3k]
  ------------------
 1867|  1.35k|        {
 1868|  1.35k|            ps_svc_slice_params->u1_tcoeff_level_prediction_flag = ih264d_get_bit_h264(ps_bitstrm);
 1869|  1.35k|            COPYTHECONTEXT("Slice Header SVC ext: u1_tcoeff_level_prediction_flag",
 1870|  1.35k|                           ps_svc_slice_params->u1_tcoeff_level_prediction_flag);
 1871|       |
 1872|  1.35k|            if(ps_svc_slice_params->u1_tcoeff_level_prediction_flag != 0)
  ------------------
  |  Branch (1872:16): [True: 222, False: 1.12k]
  ------------------
 1873|    222|            {
 1874|    222|                return ERROR_INV_SPS_PPS_T;
 1875|    222|            }
 1876|  1.35k|        }
 1877|  26.7k|    }
 1878|       |
 1879|  26.5k|    if(!ps_sps_svc_ext->u1_slice_header_restriction_flag &&
  ------------------
  |  Branch (1879:8): [True: 22.0k, False: 4.43k]
  ------------------
 1880|  22.0k|       !ps_svc_slice_params->u1_slice_skip_flag)
  ------------------
  |  Branch (1880:8): [True: 21.3k, False: 724]
  ------------------
 1881|  21.3k|    {
 1882|  21.3k|        ps_svc_slice_params->u1_scan_idx_start = ih264d_get_bits_h264(ps_bitstrm, 4);
 1883|  21.3k|        COPYTHECONTEXT("Slice Header SVC ext: u1_scan_idx_start",
 1884|  21.3k|                       ps_svc_slice_params->u1_scan_idx_start);
 1885|  21.3k|        ps_svc_slice_params->u1_scan_idx_end = ih264d_get_bits_h264(ps_bitstrm, 4);
 1886|  21.3k|        COPYTHECONTEXT("Slice Header SVC ext: u1_scan_idx_end",
 1887|  21.3k|                       ps_svc_slice_params->u1_scan_idx_end);
 1888|       |
 1889|  21.3k|        if(0 != ps_svc_slice_params->u1_scan_idx_start &&
  ------------------
  |  Branch (1889:12): [True: 12.2k, False: 9.08k]
  ------------------
 1890|  12.2k|           15 != ps_svc_slice_params->u1_scan_idx_end)
  ------------------
  |  Branch (1890:12): [True: 837, False: 11.4k]
  ------------------
 1891|    837|            return ERROR_SVC_INV_SCAN_IDX;
 1892|  21.3k|    }
 1893|  25.6k|    return OK;
  ------------------
  |  |  114|  25.6k|#define OK        0
  ------------------
 1894|  26.5k|}
isvcd_parse_decode_slice:
 1911|   136k|{
 1912|   136k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
 1913|   136k|    dec_bit_stream_t *ps_bitstrm = ps_dec->ps_bitstrm;
 1914|   136k|    dec_pic_params_t *ps_pps;
 1915|   136k|    dec_seq_params_t *ps_seq;
 1916|   136k|    dec_svc_seq_params_t *ps_subset_seq;
 1917|   136k|    dec_slice_params_t *ps_cur_slice = ps_dec->ps_cur_slice;
 1918|   136k|    pocstruct_t s_tmp_poc = {0};
 1919|   136k|    WORD32 i_delta_poc[2] = {0};
 1920|   136k|    WORD32 i4_poc = 0;
 1921|   136k|    UWORD16 u2_first_mb_in_slice, u2_frame_num;
 1922|   136k|    UWORD8 u1_field_pic_flag, u1_redundant_pic_cnt = 0, u1_slice_type;
 1923|   136k|    UWORD32 u4_idr_pic_id = 0;
 1924|   136k|    UWORD8 u1_bottom_field_flag, u1_pic_order_cnt_type;
 1925|   136k|    UWORD8 u1_nal_unit_type;
 1926|   136k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
 1927|   136k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
 1928|   136k|    WORD8 i1_is_end_of_poc;
 1929|       |
 1930|   136k|    WORD32 ret;
 1931|   136k|    WORD32 prev_slice_err, num_mb_skipped;
 1932|   136k|    UWORD32 u4_mbaff;
 1933|   136k|    pocstruct_t *ps_cur_poc;
 1934|       |
 1935|   136k|    UWORD32 u4_temp;
 1936|   136k|    WORD32 i_temp;
 1937|   136k|    svc_dec_ctxt_t *psvcd_dec_ctxt;
 1938|   136k|    dec_struct_t *ps_dec_cur_lyr_minus_1;
 1939|   136k|    svc_dec_lyr_struct_t *ps_svc_cur_lyr_dec_minus_1;
 1940|       |
 1941|       |    /* read FirstMbInSlice  and slice type*/
 1942|   136k|    ps_dec->ps_dpb_cmds->u1_dpb_commands_read_slc = 0;
 1943|   136k|    u2_first_mb_in_slice = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1944|   136k|    if(u2_first_mb_in_slice > (ps_dec->u2_frm_ht_in_mbs * ps_dec->u2_frm_wd_in_mbs))
  ------------------
  |  Branch (1944:8): [True: 14.6k, False: 121k]
  ------------------
 1945|  14.6k|    {
 1946|  14.6k|        return ERROR_CORRUPTED_SLICE;
 1947|  14.6k|    }
 1948|       |
 1949|       |    /*we currently don not support ASO*/
 1950|   121k|    if(((u2_first_mb_in_slice << ps_cur_slice->u1_mbaff_frame_flag) <= ps_dec->u4_cur_mb_addr) &&
  ------------------
  |  Branch (1950:8): [True: 113k, False: 7.83k]
  ------------------
 1951|   113k|       (ps_dec->u4_first_slice_in_pic == 0))
  ------------------
  |  Branch (1951:8): [True: 850, False: 113k]
  ------------------
 1952|    850|    {
 1953|    850|        return ERROR_CORRUPTED_SLICE;
 1954|    850|    }
 1955|       |
 1956|   120k|    if(ps_dec->u4_first_slice_in_pic == 1)
  ------------------
  |  Branch (1956:8): [True: 117k, False: 3.29k]
  ------------------
 1957|   117k|    {
 1958|   117k|        if(u2_first_mb_in_slice != 0)
  ------------------
  |  Branch (1958:12): [True: 4.53k, False: 113k]
  ------------------
 1959|  4.53k|        {
 1960|  4.53k|            return ERROR_CORRUPTED_SLICE;
 1961|  4.53k|        }
 1962|   117k|    }
 1963|       |
 1964|   116k|    COPYTHECONTEXT("SH: first_mb_in_slice", u2_first_mb_in_slice);
 1965|       |
 1966|   116k|    u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1967|   116k|    if(u4_temp > 9) return ERROR_INV_SLC_TYPE_T;
  ------------------
  |  Branch (1967:8): [True: 928, False: 115k]
  ------------------
 1968|       |
 1969|   115k|    u1_slice_type = u4_temp;
 1970|   115k|    COPYTHECONTEXT("SH: slice_type", (u1_slice_type));
 1971|       |    /* Find Out the Slice Type is 5 to 9 or not then Set the Flag   */
 1972|       |    /* u1_sl_typ_5_9 = 1 .Which tells that all the slices in the Pic*/
 1973|       |    /* will be of same type of current                            */
 1974|   115k|    if(u1_slice_type > 4)
  ------------------
  |  Branch (1974:8): [True: 4.16k, False: 111k]
  ------------------
 1975|  4.16k|    {
 1976|  4.16k|        u1_slice_type -= 5;
 1977|  4.16k|    }
 1978|       |
 1979|   115k|    u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1980|   115k|    if(u4_temp & MASK_ERR_PIC_SET_ID) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  |  527|   115k|#define MASK_ERR_PIC_SET_ID   (0xFFFFFF00)
  ------------------
  |  Branch (1980:8): [True: 150, False: 115k]
  ------------------
 1981|       |    /* discard slice if pic param is invalid */
 1982|   115k|    COPYTHECONTEXT("SH: pic_parameter_set_id", u4_temp);
 1983|   115k|    ps_pps = &ps_dec->ps_pps[u4_temp];
 1984|   115k|    if(FALSE == ps_pps->u1_is_valid)
  ------------------
  |  |  592|   115k|#define FALSE   0
  ------------------
  |  Branch (1984:8): [True: 2.90k, False: 112k]
  ------------------
 1985|  2.90k|    {
 1986|  2.90k|        return ERROR_INV_SLICE_HDR_T;
 1987|  2.90k|    }
 1988|       |    /* slices in a layer should have same PPS id*/
 1989|   112k|    if(UINT32_MAX == ps_svc_lyr_dec->u4_pps_id_for_layer)
  ------------------
  |  Branch (1989:8): [True: 109k, False: 3.29k]
  ------------------
 1990|   109k|    {
 1991|   109k|        ps_svc_lyr_dec->u4_pps_id_for_layer = u4_temp;
 1992|   109k|    }
 1993|  3.29k|    else if(u4_temp != ps_svc_lyr_dec->u4_pps_id_for_layer)
  ------------------
  |  Branch (1993:13): [True: 66, False: 3.22k]
  ------------------
 1994|     66|    {
 1995|     66|        return ERROR_INV_SLICE_HDR_T;
 1996|     66|    }
 1997|   112k|    ps_seq = ps_pps->ps_sps;
 1998|   112k|    ps_dec->ps_cur_sps = ps_seq;
 1999|   112k|    ps_subset_seq = &ps_svc_lyr_dec->ps_subset_sps[ps_seq->u1_seq_parameter_set_id];
 2000|   112k|    ps_svc_lyr_dec->ps_cur_subset_sps = ps_subset_seq;
 2001|   112k|    if(!ps_seq) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (2001:8): [True: 0, False: 112k]
  ------------------
 2002|   112k|    if(FALSE == ps_seq->u1_is_valid) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  |  592|   112k|#define FALSE   0
  ------------------
  |  Branch (2002:8): [True: 485, False: 111k]
  ------------------
 2003|   111k|    if(ps_seq->u1_mb_aff_flag) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (2003:8): [True: 99, False: 111k]
  ------------------
 2004|   111k|    if(ps_seq->u1_level_idc > H264_LEVEL_4_2) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  |  303|   111k|#define H264_LEVEL_4_2     42
  ------------------
  |  Branch (2004:8): [True: 278, False: 111k]
  ------------------
 2005|   111k|    if(!ps_seq->u1_frame_mbs_only_flag) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (2005:8): [True: 198, False: 111k]
  ------------------
 2006|   111k|    if(OK != isvcd_verify_level(ps_seq->u1_level_idc)) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  |  114|   111k|#define OK        0
  ------------------
  |  Branch (2006:8): [True: 244, False: 111k]
  ------------------
 2007|   111k|    if(ps_dec->u1_init_dec_flag == 1)
  ------------------
  |  Branch (2007:8): [True: 91.3k, False: 19.7k]
  ------------------
 2008|  91.3k|    {
 2009|  91.3k|        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: 169, False: 91.1k]
  ------------------
 2010|  91.1k|        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: 70, False: 91.1k]
  ------------------
 2011|  91.1k|    }
 2012|       |
 2013|   110k|    if(ps_dec->u1_init_dec_flag == 1)
  ------------------
  |  Branch (2013:8): [True: 91.1k, False: 19.7k]
  ------------------
 2014|  91.1k|    {
 2015|  91.1k|        if(ps_dec->u2_disp_height != ps_subset_seq->u2_disp_height) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (2015:12): [True: 70, False: 91.0k]
  ------------------
 2016|  91.0k|        if(ps_dec->u2_disp_width != ps_subset_seq->u2_disp_width) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (2016:12): [True: 141, False: 90.8k]
  ------------------
 2017|  91.0k|    }
 2018|       |
 2019|   110k|    if(ps_seq->u1_profile_idc == BASE_PROFILE_IDC)
  ------------------
  |  |  275|   110k|#define BASE_PROFILE_IDC    66
  ------------------
  |  Branch (2019:8): [True: 19.6k, False: 90.9k]
  ------------------
 2020|  19.6k|    {
 2021|  19.6k|        if(ps_pps->u1_entropy_coding_mode != 0)
  ------------------
  |  Branch (2021:12): [True: 139, False: 19.4k]
  ------------------
 2022|    139|        {
 2023|    139|            return ERROR_INV_SPS_PPS_T;
 2024|    139|        }
 2025|  19.6k|    }
 2026|       |
 2027|   110k|    ps_dec->i4_reorder_depth = ps_subset_seq->i4_reorder_depth;
 2028|   110k|    ps_dec->u2_disp_height = ps_subset_seq->u2_disp_height;
 2029|   110k|    ps_dec->u2_disp_width = ps_subset_seq->u2_disp_width;
 2030|       |
 2031|   110k|    if(ps_svc_lyr_dec->u1_layer_id > 0)
  ------------------
  |  Branch (2031:8): [True: 0, False: 110k]
  ------------------
 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|   110k|    ps_dec->u2_pic_wd = ps_subset_seq->u2_pic_wd;
 2047|   110k|    ps_dec->u2_pic_ht = ps_subset_seq->u2_pic_ht;
 2048|   110k|    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|   110k|    ps_dec->u2_frm_wd_y = ps_subset_seq->u2_frm_wd_y;
 2052|   110k|    ps_dec->u2_frm_ht_y = ps_subset_seq->u2_frm_ht_y;
 2053|       |
 2054|   110k|    ps_dec->u2_frm_wd_uv = ps_subset_seq->u2_frm_wd_uv;
 2055|   110k|    ps_dec->u2_frm_ht_uv = ps_subset_seq->u2_frm_ht_uv;
 2056|       |
 2057|   110k|    ps_dec->s_pad_mgr.u1_pad_len_y_v = ps_subset_seq->u1_pad_len_y_v;
 2058|   110k|    ps_dec->s_pad_mgr.u1_pad_len_cr_v = ps_subset_seq->u1_pad_len_cr_v;
 2059|   110k|    ps_dec->u2_frm_wd_in_mbs = ps_seq->u2_frm_wd_in_mbs;
 2060|   110k|    ps_dec->u2_frm_ht_in_mbs = ps_seq->u2_frm_ht_in_mbs;
 2061|       |
 2062|   110k|    ps_dec->u2_crop_offset_y = ps_subset_seq->u2_crop_offset_y;
 2063|   110k|    ps_dec->u2_crop_offset_uv = ps_subset_seq->u2_crop_offset_uv;
 2064|       |
 2065|       |    /* Get the frame num */
 2066|   110k|    u2_frame_num = ih264d_get_bits_h264(ps_bitstrm, ps_seq->u1_bits_in_frm_num);
 2067|   110k|    COPYTHECONTEXT("SH: frame_num", u2_frame_num);
 2068|       |
 2069|   110k|    if(!ps_dec->u1_first_slice_in_stream && ps_dec->u4_first_slice_in_pic)
  ------------------
  |  Branch (2069:8): [True: 83.9k, False: 26.5k]
  |  Branch (2069:45): [True: 80.7k, False: 3.22k]
  ------------------
 2070|  80.7k|    {
 2071|  80.7k|        pocstruct_t *ps_prev_poc = &ps_dec->s_prev_pic_poc;
 2072|  80.7k|        pocstruct_t *ps_cur_poc = &ps_dec->s_cur_pic_poc;
 2073|       |
 2074|  80.7k|        ps_dec->u2_mbx = 0xffff;
 2075|  80.7k|        ps_dec->u2_mby = 0;
 2076|       |
 2077|  80.7k|        if((0 == u1_is_idr_slice) && ps_cur_slice->u1_nal_ref_idc)
  ------------------
  |  Branch (2077:12): [True: 17.8k, False: 62.8k]
  |  Branch (2077:38): [True: 10.3k, False: 7.48k]
  ------------------
 2078|  10.3k|            ps_dec->u2_prev_ref_frame_num = ps_cur_slice->u2_frame_num;
 2079|       |
 2080|  80.7k|        if(u1_is_idr_slice || ps_cur_slice->u1_mmco_equalto5) ps_dec->u2_prev_ref_frame_num = 0;
  ------------------
  |  Branch (2080:12): [True: 62.8k, False: 17.8k]
  |  Branch (2080:31): [True: 1.31k, False: 16.5k]
  ------------------
 2081|       |
 2082|  80.7k|        if(ps_dec->ps_cur_sps->u1_gaps_in_frame_num_value_allowed_flag)
  ------------------
  |  Branch (2082:12): [True: 0, False: 80.7k]
  ------------------
 2083|      0|        {
 2084|      0|            isvcd_decode_gaps_in_frame_num(ps_dec, u2_frame_num);
 2085|      0|        }
 2086|       |
 2087|  80.7k|        ps_prev_poc->i4_prev_frame_num_ofst = ps_cur_poc->i4_prev_frame_num_ofst;
 2088|  80.7k|        ps_prev_poc->u2_frame_num = ps_cur_poc->u2_frame_num;
 2089|  80.7k|        ps_prev_poc->u1_mmco_equalto5 = ps_cur_slice->u1_mmco_equalto5;
 2090|  80.7k|        if(ps_cur_slice->u1_nal_ref_idc)
  ------------------
  |  Branch (2090:12): [True: 71.1k, False: 9.52k]
  ------------------
 2091|  71.1k|        {
 2092|  71.1k|            ps_prev_poc->i4_pic_order_cnt_lsb = ps_cur_poc->i4_pic_order_cnt_lsb;
 2093|  71.1k|            ps_prev_poc->i4_pic_order_cnt_msb = ps_cur_poc->i4_pic_order_cnt_msb;
 2094|  71.1k|            ps_prev_poc->i4_delta_pic_order_cnt_bottom = ps_cur_poc->i4_delta_pic_order_cnt_bottom;
 2095|  71.1k|            ps_prev_poc->i4_delta_pic_order_cnt[0] = ps_cur_poc->i4_delta_pic_order_cnt[0];
 2096|  71.1k|            ps_prev_poc->i4_delta_pic_order_cnt[1] = ps_cur_poc->i4_delta_pic_order_cnt[1];
 2097|  71.1k|            ps_prev_poc->u1_bot_field = ps_cur_poc->u1_bot_field;
 2098|  71.1k|        }
 2099|       |
 2100|  80.7k|        ps_dec->u4_total_mbs_coded = 0;
 2101|  80.7k|    }
 2102|       |    /* Get the field related flags  */
 2103|   110k|    if(!ps_seq->u1_frame_mbs_only_flag)
  ------------------
  |  Branch (2103:8): [True: 0, False: 110k]
  ------------------
 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|   110k|    else
 2121|   110k|    {
 2122|   110k|        u1_field_pic_flag = 0;
 2123|   110k|        u1_bottom_field_flag = 0;
 2124|       |
 2125|   110k|        ps_dec->pu1_inv_scan = (UWORD8 *) gau1_ih264d_inv_scan;
 2126|   110k|    }
 2127|       |
 2128|   110k|    u1_nal_unit_type = SLICE_NAL;
  ------------------
  |  |  324|   110k|#define SLICE_NAL                       1
  ------------------
 2129|   110k|    if(u1_is_idr_slice)
  ------------------
  |  Branch (2129:8): [True: 87.9k, False: 22.5k]
  ------------------
 2130|  87.9k|    {
 2131|  87.9k|        u1_nal_unit_type = IDR_SLICE_NAL;
  ------------------
  |  |  328|  87.9k|#define IDR_SLICE_NAL                   5
  ------------------
 2132|  87.9k|        u4_idr_pic_id = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 2133|  87.9k|        if(u4_idr_pic_id > 65535) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (2133:12): [True: 909, False: 87.0k]
  ------------------
 2134|  87.0k|        COPYTHECONTEXT("SH:  ", u4_idr_pic_id);
 2135|  87.0k|    }
 2136|       |
 2137|       |    /* read delta pic order count information*/
 2138|   109k|    i_delta_poc[0] = i_delta_poc[1] = 0;
 2139|   109k|    s_tmp_poc.i4_pic_order_cnt_lsb = 0;
 2140|   109k|    s_tmp_poc.i4_delta_pic_order_cnt_bottom = 0;
 2141|   109k|    u1_pic_order_cnt_type = ps_seq->u1_pic_order_cnt_type;
 2142|   109k|    if(u1_pic_order_cnt_type == 0)
  ------------------
  |  Branch (2142:8): [True: 82.2k, False: 27.3k]
  ------------------
 2143|  82.2k|    {
 2144|  82.2k|        i_temp = ih264d_get_bits_h264(ps_bitstrm, ps_seq->u1_log2_max_pic_order_cnt_lsb_minus);
 2145|  82.2k|        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: 82.2k]
  |  Branch (2145:26): [True: 0, False: 82.2k]
  ------------------
 2146|  82.2k|        s_tmp_poc.i4_pic_order_cnt_lsb = i_temp;
 2147|  82.2k|        COPYTHECONTEXT("SH: pic_order_cnt_lsb", s_tmp_poc.i4_pic_order_cnt_lsb);
 2148|       |
 2149|  82.2k|        if((ps_pps->u1_pic_order_present_flag == 1) && (!u1_field_pic_flag))
  ------------------
  |  Branch (2149:12): [True: 34.7k, False: 47.4k]
  |  Branch (2149:56): [True: 34.7k, False: 0]
  ------------------
 2150|  34.7k|        {
 2151|  34.7k|            s_tmp_poc.i4_delta_pic_order_cnt_bottom = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 2152|  34.7k|            COPYTHECONTEXT("SH: delta_pic_order_cnt_bottom",
 2153|  34.7k|                           s_tmp_poc.i4_delta_pic_order_cnt_bottom);
 2154|  34.7k|        }
 2155|  82.2k|    }
 2156|       |
 2157|   109k|    s_tmp_poc.i4_delta_pic_order_cnt[0] = 0;
 2158|   109k|    s_tmp_poc.i4_delta_pic_order_cnt[1] = 0;
 2159|   109k|    if(u1_pic_order_cnt_type == 1 && (!ps_seq->u1_delta_pic_order_always_zero_flag))
  ------------------
  |  Branch (2159:8): [True: 24.1k, False: 85.3k]
  |  Branch (2159:38): [True: 22.9k, False: 1.27k]
  ------------------
 2160|  22.9k|    {
 2161|  22.9k|        s_tmp_poc.i4_delta_pic_order_cnt[0] = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 2162|  22.9k|        COPYTHECONTEXT("SH: delta_pic_order_cnt[0]", s_tmp_poc.i4_delta_pic_order_cnt[0]);
 2163|       |
 2164|  22.9k|        if(ps_pps->u1_pic_order_present_flag && !u1_field_pic_flag)
  ------------------
  |  Branch (2164:12): [True: 20.3k, False: 2.52k]
  |  Branch (2164:49): [True: 20.3k, False: 0]
  ------------------
 2165|  20.3k|        {
 2166|  20.3k|            s_tmp_poc.i4_delta_pic_order_cnt[1] = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 2167|  20.3k|            COPYTHECONTEXT("SH: delta_pic_order_cnt[1]", s_tmp_poc.i4_delta_pic_order_cnt[1]);
 2168|  20.3k|        }
 2169|  22.9k|    }
 2170|       |
 2171|   109k|    if(ps_pps->u1_redundant_pic_cnt_present_flag)
  ------------------
  |  Branch (2171:8): [True: 31.6k, False: 77.9k]
  ------------------
 2172|  31.6k|    {
 2173|  31.6k|        u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 2174|  31.6k|        if(u4_temp > MAX_REDUNDANT_PIC_CNT) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  |  611|  31.6k|#define MAX_REDUNDANT_PIC_CNT       127
  ------------------
  |  Branch (2174:12): [True: 605, False: 31.0k]
  ------------------
 2175|  31.0k|        u1_redundant_pic_cnt = u4_temp;
 2176|  31.0k|        COPYTHECONTEXT("SH: redundant_pic_cnt", u1_redundant_pic_cnt);
 2177|  31.0k|    }
 2178|       |
 2179|       |    /*--------------------------------------------------------------------*/
 2180|       |    /* Check if the slice is part of new picture                          */
 2181|       |    /*--------------------------------------------------------------------*/
 2182|       |    /* First slice of a picture is always considered as part of new picture */
 2183|   108k|    i1_is_end_of_poc = 1;
 2184|   108k|    ps_dec->ps_dec_err_status->u1_err_flag &= MASK_REJECT_CUR_PIC;
  ------------------
  |  |  604|   108k|#define MASK_REJECT_CUR_PIC (0xFE)
  ------------------
 2185|       |
 2186|   108k|    if(ps_dec->u4_first_slice_in_pic == 0)
  ------------------
  |  Branch (2186:8): [True: 3.22k, False: 105k]
  ------------------
 2187|  3.22k|    {
 2188|  3.22k|        i1_is_end_of_poc =
 2189|  3.22k|            ih264d_is_end_of_pic(u2_frame_num, u1_nal_ref_idc, &s_tmp_poc, &ps_dec->s_cur_pic_poc,
 2190|  3.22k|                                 ps_cur_slice, u1_pic_order_cnt_type, u1_nal_unit_type,
 2191|  3.22k|                                 u4_idr_pic_id, u1_field_pic_flag, u1_bottom_field_flag);
 2192|  3.22k|        if(i1_is_end_of_poc)
  ------------------
  |  Branch (2192:12): [True: 167, False: 3.06k]
  ------------------
 2193|    167|        {
 2194|    167|            ps_dec->u1_first_slice_in_stream = 0;
 2195|    167|            return ERROR_INCOMPLETE_FRAME;
 2196|    167|        }
 2197|  3.22k|    }
 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|   108k|    u4_mbaff = ps_seq->u1_mb_aff_flag && (!u1_field_pic_flag);
  ------------------
  |  Branch (2203:16): [True: 0, False: 108k]
  |  Branch (2203:42): [True: 0, False: 0]
  ------------------
 2204|   108k|    prev_slice_err = 0;
 2205|       |
 2206|   108k|    if(i1_is_end_of_poc || ps_dec->u1_first_slice_in_stream)
  ------------------
  |  Branch (2206:8): [True: 105k, False: 3.06k]
  |  Branch (2206:28): [True: 0, False: 3.06k]
  ------------------
 2207|   105k|    {
 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|   105k|        if((u1_field_pic_flag == 0 || u2_frame_num != ps_dec->u2_prv_frame_num) &&
  ------------------
  |  Branch (2213:13): [True: 105k, False: 0]
  |  Branch (2213:39): [True: 0, False: 0]
  ------------------
 2214|   105k|           ps_dec->u1_top_bottom_decoded != 0 &&
  ------------------
  |  Branch (2214:12): [True: 0, False: 105k]
  ------------------
 2215|      0|           ps_dec->u1_top_bottom_decoded != (TOP_FIELD_ONLY | BOT_FIELD_ONLY))
  ------------------
  |  |   64|      0|#define TOP_FIELD_ONLY      0x02
  ------------------
                         ps_dec->u1_top_bottom_decoded != (TOP_FIELD_ONLY | BOT_FIELD_ONLY))
  ------------------
  |  |   65|      0|#define BOT_FIELD_ONLY      0x01
  ------------------
  |  Branch (2215:12): [True: 0, False: 0]
  ------------------
 2216|      0|        {
 2217|      0|            ps_dec->u1_dangling_field = 1;
 2218|      0|            if(ps_dec->u4_first_slice_in_pic)
  ------------------
  |  Branch (2218:16): [True: 0, False: 0]
  ------------------
 2219|      0|            {
 2220|       |                // first slice - dangling field
 2221|      0|                prev_slice_err = 1;
 2222|      0|            }
 2223|      0|            else
 2224|      0|            {
 2225|       |                // last slice - dangling field
 2226|      0|                prev_slice_err = 2;
 2227|      0|            }
 2228|       |
 2229|      0|            if(ps_dec->u1_top_bottom_decoded == TOP_FIELD_ONLY)
  ------------------
  |  |   64|      0|#define TOP_FIELD_ONLY      0x02
  ------------------
  |  Branch (2229:16): [True: 0, False: 0]
  ------------------
 2230|      0|                ps_cur_slice->u1_bottom_field_flag = 1;
 2231|      0|            else
 2232|      0|                ps_cur_slice->u1_bottom_field_flag = 0;
 2233|       |
 2234|      0|            num_mb_skipped =
 2235|      0|                (ps_dec->u2_frm_ht_in_mbs * ps_dec->u2_frm_wd_in_mbs) - ps_dec->u4_total_mbs_coded;
 2236|      0|            ps_cur_poc = &ps_dec->s_cur_pic_poc;
 2237|       |
 2238|      0|            u1_is_idr_slice = ps_cur_slice->u1_nal_unit_type == IDR_SLICE_NAL;
  ------------------
  |  |  328|      0|#define IDR_SLICE_NAL                   5
  ------------------
 2239|      0|        }
 2240|   105k|        else if(ps_dec->u4_first_slice_in_pic)
  ------------------
  |  Branch (2240:17): [True: 105k, False: 0]
  ------------------
 2241|   105k|        {
 2242|   105k|            if(u2_first_mb_in_slice > 0)
  ------------------
  |  Branch (2242:16): [True: 0, False: 105k]
  ------------------
 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|   105k|        }
 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|   105k|    }
 2271|  3.06k|    else
 2272|  3.06k|    {
 2273|  3.06k|        if((u2_first_mb_in_slice << u4_mbaff) > ps_dec->u4_total_mbs_coded)
  ------------------
  |  Branch (2273:12): [True: 125, False: 2.93k]
  ------------------
 2274|    125|        {
 2275|       |            // previous slice - missing/corruption
 2276|    125|            prev_slice_err = 2;
 2277|    125|            num_mb_skipped = (u2_first_mb_in_slice << u4_mbaff) - ps_dec->u4_total_mbs_coded;
 2278|    125|            ps_cur_poc = &s_tmp_poc;
 2279|    125|        }
 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.06k|    }
 2285|   108k|    if(prev_slice_err)
  ------------------
  |  Branch (2285:8): [True: 125, False: 108k]
  ------------------
 2286|    125|    {
 2287|    125|        ret = isvcd_mark_err_slice_skip((svc_dec_lyr_struct_t *) ps_dec, num_mb_skipped,
 2288|    125|                                        u1_is_idr_slice, u2_frame_num, ps_cur_poc, prev_slice_err);
 2289|       |
 2290|    125|        if(ps_dec->u1_dangling_field == 1)
  ------------------
  |  Branch (2290:12): [True: 0, False: 125]
  ------------------
 2291|      0|        {
 2292|      0|            ps_dec->u1_second_field = 1 - ps_dec->u1_second_field;
 2293|      0|            ps_dec->u1_first_slice_in_stream = 0;
 2294|      0|            ps_dec->u1_top_bottom_decoded = TOP_FIELD_ONLY | BOT_FIELD_ONLY;
  ------------------
  |  |   64|      0|#define TOP_FIELD_ONLY      0x02
  ------------------
                          ps_dec->u1_top_bottom_decoded = TOP_FIELD_ONLY | BOT_FIELD_ONLY;
  ------------------
  |  |   65|      0|#define BOT_FIELD_ONLY      0x01
  ------------------
 2295|      0|            return ERROR_DANGLING_FIELD_IN_PIC;
 2296|      0|        }
 2297|       |
 2298|    125|        if(prev_slice_err == 2)
  ------------------
  |  Branch (2298:12): [True: 125, False: 0]
  ------------------
 2299|    125|        {
 2300|    125|            ps_dec->u1_first_slice_in_stream = 0;
 2301|    125|            return ERROR_INCOMPLETE_FRAME;
 2302|    125|        }
 2303|       |
 2304|      0|        if(ps_dec->u4_total_mbs_coded >= ps_dec->u2_frm_ht_in_mbs * ps_dec->u2_frm_wd_in_mbs)
  ------------------
  |  Branch (2304:12): [True: 0, False: 0]
  ------------------
 2305|      0|        {
 2306|       |            /* return if all MBs in frame are parsed*/
 2307|      0|            ps_dec->u1_first_slice_in_stream = 0;
 2308|      0|            return ERROR_IN_LAST_SLICE_OF_PIC;
 2309|      0|        }
 2310|       |
 2311|      0|        if(ps_dec->ps_dec_err_status->u1_err_flag & REJECT_CUR_PIC)
  ------------------
  |  |  601|      0|#define REJECT_CUR_PIC    (0x01)
  ------------------
  |  Branch (2311:12): [True: 0, False: 0]
  ------------------
 2312|      0|        {
 2313|      0|            ih264d_err_pic_dispbuf_mgr(ps_dec);
 2314|      0|            return ERROR_NEW_FRAME_EXPECTED;
 2315|      0|        }
 2316|       |
 2317|      0|        if(ret != OK) return ret;
  ------------------
  |  |  114|      0|#define OK        0
  ------------------
  |  Branch (2317:12): [True: 0, False: 0]
  ------------------
 2318|       |
 2319|      0|        i1_is_end_of_poc = 0;
 2320|      0|    }
 2321|       |
 2322|   108k|    if(u1_field_pic_flag)
  ------------------
  |  Branch (2322:8): [True: 0, False: 108k]
  ------------------
 2323|      0|    {
 2324|      0|        ps_dec->u2_prv_frame_num = u2_frame_num;
 2325|      0|    }
 2326|       |
 2327|   108k|    if(ps_cur_slice->u1_mmco_equalto5 && NULL != ps_dec->ps_cur_pic)
  ------------------
  |  Branch (2327:8): [True: 2.24k, False: 106k]
  |  Branch (2327:42): [True: 2.13k, False: 114]
  ------------------
 2328|  2.13k|    {
 2329|  2.13k|        WORD32 i4_temp_poc;
 2330|  2.13k|        WORD32 i4_top_field_order_poc, i4_bot_field_order_poc;
 2331|  2.13k|        WORD64 i8_result;
 2332|  2.13k|        if(!ps_cur_slice->u1_field_pic_flag)
  ------------------
  |  Branch (2332:12): [True: 2.13k, False: 0]
  ------------------
 2333|  2.13k|        {
 2334|  2.13k|            i4_top_field_order_poc = ps_dec->ps_cur_pic->i4_top_field_order_cnt;
 2335|  2.13k|            i4_bot_field_order_poc = ps_dec->ps_cur_pic->i4_bottom_field_order_cnt;
 2336|  2.13k|            i4_temp_poc = MIN(i4_top_field_order_poc, i4_bot_field_order_poc);
  ------------------
  |  |   61|  2.13k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 964, False: 1.17k]
  |  |  ------------------
  ------------------
 2337|  2.13k|        }
 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.13k|        i8_result = (WORD64) i4_temp_poc - ps_dec->ps_cur_pic->i4_top_field_order_cnt;
 2344|  2.13k|        if(IS_OUT_OF_RANGE_S32(i8_result))
  ------------------
  |  |   58|  2.13k|#define IS_OUT_OF_RANGE_S32(a) (((a) < INT32_MIN) || ((a) > INT32_MAX))
  |  |  ------------------
  |  |  |  Branch (58:33): [True: 67, False: 2.06k]
  |  |  |  Branch (58:54): [True: 0, False: 2.06k]
  |  |  ------------------
  ------------------
 2345|     67|        {
 2346|     67|            return ERROR_INV_POC;
 2347|     67|        }
 2348|  2.06k|        ps_dec->ps_cur_pic->i4_top_field_order_cnt = (WORD32) i8_result;
 2349|  2.06k|        i8_result = (WORD64) i4_temp_poc - ps_dec->ps_cur_pic->i4_bottom_field_order_cnt;
 2350|  2.06k|        if(IS_OUT_OF_RANGE_S32(i8_result))
  ------------------
  |  |   58|  2.06k|#define IS_OUT_OF_RANGE_S32(a) (((a) < INT32_MIN) || ((a) > INT32_MAX))
  |  |  ------------------
  |  |  |  Branch (58:33): [True: 76, False: 1.99k]
  |  |  |  Branch (58:54): [True: 0, False: 1.99k]
  |  |  ------------------
  ------------------
 2351|     76|        {
 2352|     76|            return ERROR_INV_POC;
 2353|     76|        }
 2354|  1.99k|        ps_dec->ps_cur_pic->i4_bottom_field_order_cnt = (WORD32) i8_result;
 2355|  1.99k|        ps_dec->ps_cur_pic->i4_poc = i4_temp_poc;
 2356|  1.99k|        ps_dec->ps_cur_pic->i4_avg_poc = i4_temp_poc;
 2357|  1.99k|    }
 2358|   108k|    if(ps_dec->u4_first_slice_in_pic)
  ------------------
  |  Branch (2358:8): [True: 105k, False: 2.93k]
  ------------------
 2359|   105k|    {
 2360|   105k|        ret = isvcd_decode_pic_order_cnt(u1_is_idr_slice, u2_frame_num, &ps_dec->s_prev_pic_poc,
 2361|   105k|                                         &s_tmp_poc, ps_cur_slice, ps_pps, u1_nal_ref_idc,
 2362|   105k|                                         u1_bottom_field_flag, u1_field_pic_flag, &i4_poc, ps_dec);
 2363|   105k|        if(ret != OK) return ret;
  ------------------
  |  |  114|   105k|#define OK        0
  ------------------
  |  Branch (2363:12): [True: 938, False: 104k]
  ------------------
 2364|       |        /* Display seq no calculations */
 2365|   104k|        if(i4_poc >= ps_dec->i4_max_poc) ps_dec->i4_max_poc = i4_poc;
  ------------------
  |  Branch (2365:12): [True: 53.5k, False: 51.0k]
  ------------------
 2366|       |        /* IDR Picture or POC wrap around */
 2367|   104k|        if(i4_poc == 0)
  ------------------
  |  Branch (2367:12): [True: 23.3k, False: 81.2k]
  ------------------
 2368|  23.3k|        {
 2369|  23.3k|            WORD64 i8_temp;
 2370|  23.3k|            i8_temp = (WORD64) ps_dec->i4_prev_max_display_seq + ps_dec->i4_max_poc +
 2371|  23.3k|                      ps_dec->u1_max_dec_frame_buffering + 1;
 2372|       |            /*If i4_prev_max_display_seq overflows integer range, reset it */
 2373|  23.3k|            ps_dec->i4_prev_max_display_seq = IS_OUT_OF_RANGE_S32(i8_temp) ? 0 : i8_temp;
  ------------------
  |  |   58|  23.3k|#define IS_OUT_OF_RANGE_S32(a) (((a) < INT32_MIN) || ((a) > INT32_MAX))
  |  |  ------------------
  |  |  |  Branch (58:33): [True: 0, False: 23.3k]
  |  |  |  Branch (58:54): [True: 127, False: 23.2k]
  |  |  ------------------
  ------------------
 2374|  23.3k|            ps_dec->i4_max_poc = 0;
 2375|  23.3k|        }
 2376|   104k|    }
 2377|       |
 2378|       |    /* Increment only if the current slice has atleast 1 more MB */
 2379|   107k|    if(ps_dec->u4_first_slice_in_pic == 0 &&
  ------------------
  |  Branch (2379:8): [True: 2.93k, False: 104k]
  ------------------
 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.47k, False: 1.45k]
  ------------------
 2387|  1.47k|        {
 2388|  1.47k|            ps_dec->ps_decode_cur_slice++;
 2389|  1.47k|        }
 2390|  2.93k|    }
 2391|       |
 2392|   107k|    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|   107k|    ps_cur_slice->i4_delta_pic_order_cnt[0] = i_delta_poc[0];
 2400|   107k|    ps_cur_slice->i4_delta_pic_order_cnt[1] = i_delta_poc[1];
 2401|   107k|    ps_cur_slice->u4_idr_pic_id = u4_idr_pic_id;
 2402|   107k|    ps_cur_slice->u2_first_mb_in_slice = u2_first_mb_in_slice;
 2403|   107k|    ps_cur_slice->u1_field_pic_flag = u1_field_pic_flag;
 2404|   107k|    ps_cur_slice->u1_bottom_field_flag = u1_bottom_field_flag;
 2405|   107k|    ps_cur_slice->u1_slice_type = u1_slice_type;
 2406|   107k|    ps_cur_slice->i4_pic_order_cnt_lsb = s_tmp_poc.i4_pic_order_cnt_lsb;
 2407|       |
 2408|   107k|    ps_cur_slice->u1_nal_unit_type = u1_nal_unit_type;
 2409|   107k|    ps_cur_slice->u1_redundant_pic_cnt = u1_redundant_pic_cnt;
 2410|   107k|    ps_cur_slice->u1_nal_ref_idc = u1_nal_ref_idc;
 2411|   107k|    ps_cur_slice->u1_pic_order_cnt_type = u1_pic_order_cnt_type;
 2412|       |
 2413|   107k|    if(ps_seq->u1_frame_mbs_only_flag)
  ------------------
  |  Branch (2413:8): [True: 107k, False: 0]
  ------------------
 2414|   107k|        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|   107k|    if(u1_slice_type == B_SLICE)
  ------------------
  |  |  369|   107k|#define B_SLICE  1
  ------------------
  |  Branch (2418:8): [True: 31.3k, False: 76.1k]
  ------------------
 2419|  31.3k|    {
 2420|  31.3k|        ps_cur_slice->u1_direct_spatial_mv_pred_flag = ih264d_get_bit_h264(ps_bitstrm);
 2421|  31.3k|        COPYTHECONTEXT("SH: direct_spatial_mv_pred_flag",
 2422|  31.3k|                       ps_cur_slice->u1_direct_spatial_mv_pred_flag);
 2423|       |
 2424|  31.3k|        if(ps_cur_slice->u1_direct_spatial_mv_pred_flag)
  ------------------
  |  Branch (2424:12): [True: 16.9k, False: 14.4k]
  ------------------
 2425|  16.9k|            ps_cur_slice->pf_decodeDirect = ih264d_decode_spatial_direct;
 2426|  14.4k|        else
 2427|  14.4k|            ps_cur_slice->pf_decodeDirect = ih264d_decode_temporal_direct;
 2428|  31.3k|        if(!((ps_seq->u1_mb_aff_flag) && (!u1_field_pic_flag)))
  ------------------
  |  Branch (2428:14): [True: 0, False: 31.3k]
  |  Branch (2428:42): [True: 0, False: 0]
  ------------------
 2429|  31.3k|            ps_dec->pf_mvpred = ih264d_mvpred_nonmbaffB;
 2430|  31.3k|    }
 2431|  76.1k|    else
 2432|  76.1k|    {
 2433|  76.1k|        if(!((ps_seq->u1_mb_aff_flag) && (!u1_field_pic_flag)))
  ------------------
  |  Branch (2433:14): [True: 0, False: 76.1k]
  |  Branch (2433:42): [True: 0, False: 0]
  ------------------
 2434|  76.1k|            ps_dec->pf_mvpred = ih264d_mvpred_nonmbaff;
 2435|  76.1k|    }
 2436|       |
 2437|   107k|    if(ps_dec->u4_first_slice_in_pic)
  ------------------
  |  Branch (2437:8): [True: 104k, False: 2.93k]
  ------------------
 2438|   104k|    {
 2439|   104k|        if(u2_first_mb_in_slice == 0)
  ------------------
  |  Branch (2439:12): [True: 104k, False: 0]
  ------------------
 2440|   104k|        {
 2441|   104k|            ret = isvcd_start_of_pic(ps_svc_lyr_dec, i4_poc, &s_tmp_poc, u2_frame_num, ps_pps);
 2442|   104k|            if(ret != OK) return ret;
  ------------------
  |  |  114|   104k|#define OK        0
  ------------------
  |  Branch (2442:16): [True: 1.01k, False: 103k]
  ------------------
 2443|       |            /*inter layer buffer intialization */
 2444|   103k|            ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb =
 2445|   103k|                ps_svc_lyr_dec->ps_inter_lyr_mb_prms_frm_start;
 2446|   103k|            ps_svc_lyr_dec->ps_il_pred_mv_bank_buf_cur_mb =
 2447|   103k|                ps_svc_lyr_dec->ps_il_pred_mv_bank_buf_base;
 2448|   103k|        }
 2449|       |
 2450|   103k|        ps_dec->u4_output_present = 0;
 2451|       |
 2452|   103k|        {
 2453|   103k|            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|   103k|            if(0 != ps_dec->s_disp_op.u4_error_code)
  ------------------
  |  Branch (2457:16): [True: 43.5k, False: 60.1k]
  ------------------
 2458|  43.5k|            {
 2459|  43.5k|                ps_dec->u4_output_present = 0;
 2460|  43.5k|                ps_dec->u4_fmt_conv_cur_row = ps_dec->s_disp_frame_info.u4_y_ht;
 2461|  43.5k|            }
 2462|  60.1k|            else
 2463|  60.1k|                ps_dec->u4_output_present = 1;
 2464|   103k|        }
 2465|   103k|        ret = isvcd_parse_interlayer_resamp_func_init(ps_svc_lyr_dec, u2_first_mb_in_slice);
 2466|   103k|        if(ret != OK)
  ------------------
  |  |  114|   103k|#define OK        0
  ------------------
  |  Branch (2466:12): [True: 0, False: 103k]
  ------------------
 2467|      0|        {
 2468|      0|            return ERROR_CORRUPTED_SLICE;
 2469|      0|        }
 2470|   103k|        if((ps_dec->u1_separate_parse == 1) && (ps_svc_lyr_dec->u1_res_init_done == 1))
  ------------------
  |  Branch (2470:12): [True: 31.5k, False: 72.0k]
  |  Branch (2470:48): [True: 31.5k, False: 0]
  ------------------
 2471|  31.5k|        {
 2472|  31.5k|            if(ps_dec->u4_dec_thread_created == 0)
  ------------------
  |  Branch (2472:16): [True: 31.5k, False: 0]
  ------------------
 2473|  31.5k|            {
 2474|  31.5k|                if(ps_svc_lyr_dec->u1_layer_identifier != TARGET_LAYER)
  ------------------
  |  |  110|  31.5k|#define TARGET_LAYER 2
  ------------------
  |  Branch (2474:20): [True: 0, False: 31.5k]
  ------------------
 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|  31.5k|                else
 2482|  31.5k|                {
 2483|  31.5k|                    ithread_create(ps_dec->pv_dec_thread_handle, NULL,
 2484|  31.5k|                                   (void *) ih264d_decode_picture_thread, (void *) ps_dec);
 2485|       |
 2486|  31.5k|                    ps_dec->u4_dec_thread_created = 1;
 2487|  31.5k|                }
 2488|  31.5k|            }
 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|  31.5k|        }
 2515|   103k|    }
 2516|       |
 2517|       |    /* INITIALIZATION of fn ptrs for MC and formMbPartInfo functions */
 2518|   106k|    {
 2519|   106k|        UWORD8 uc_nofield_nombaff;
 2520|       |
 2521|   106k|        uc_nofield_nombaff =
 2522|   106k|            ((ps_dec->ps_cur_slice->u1_field_pic_flag == 0) &&
  ------------------
  |  Branch (2522:14): [True: 106k, False: 0]
  ------------------
 2523|   106k|             (ps_dec->ps_cur_slice->u1_mbaff_frame_flag == 0) && (u1_slice_type != B_SLICE) &&
  ------------------
  |  |  369|   106k|#define B_SLICE  1
  ------------------
  |  Branch (2523:14): [True: 106k, False: 0]
  |  Branch (2523:66): [True: 75.6k, False: 30.9k]
  ------------------
 2524|  75.6k|             (ps_dec->ps_cur_pps->u1_wted_pred_flag == 0));
  ------------------
  |  Branch (2524:14): [True: 53.0k, False: 22.5k]
  ------------------
 2525|       |
 2526|       |        /* Initialise MC and formMbPartInfo fn ptrs one time based on profile_idc */
 2527|       |
 2528|   106k|        if(uc_nofield_nombaff)
  ------------------
  |  Branch (2528:12): [True: 53.0k, False: 53.4k]
  ------------------
 2529|  53.0k|        {
 2530|  53.0k|            ps_dec->p_form_mb_part_info = ih264d_form_mb_part_info_bp;
 2531|  53.0k|            ps_dec->p_motion_compensate = ih264d_motion_compensate_bp;
 2532|  53.0k|        }
 2533|  53.4k|        else
 2534|  53.4k|        {
 2535|  53.4k|            ps_dec->p_form_mb_part_info = ih264d_form_mb_part_info_mp;
 2536|  53.4k|            ps_dec->p_motion_compensate = ih264d_motion_compensate_mp;
 2537|  53.4k|        }
 2538|   106k|    }
 2539|       |
 2540|       |    /*
 2541|       |     * Decide whether to decode the current picture or not
 2542|       |     */
 2543|   106k|    {
 2544|   106k|        dec_err_status_t *ps_err = ps_dec->ps_dec_err_status;
 2545|   106k|        if(ps_err->u4_frm_sei_sync == u2_frame_num)
  ------------------
  |  Branch (2545:12): [True: 68, False: 106k]
  ------------------
 2546|     68|        {
 2547|     68|            ps_err->u1_err_flag = ACCEPT_ALL_PICS;
  ------------------
  |  |  600|     68|#define ACCEPT_ALL_PICS   (0x00)
  ------------------
 2548|     68|            ps_err->u4_frm_sei_sync = SYNC_FRM_DEFAULT;
  ------------------
  |  |  609|     68|#define SYNC_FRM_DEFAULT  (0xFFFFFFFF)
  ------------------
 2549|     68|        }
 2550|   106k|        ps_err->u4_cur_frm = u2_frame_num;
 2551|   106k|    }
 2552|       |
 2553|       |    /* Decision for decoding if the picture is to be skipped */
 2554|   106k|    {
 2555|   106k|        WORD32 i4_skip_b_pic, i4_skip_p_pic;
 2556|       |
 2557|   106k|        i4_skip_b_pic = (ps_dec->u4_skip_frm_mask & B_SLC_BIT) && (B_SLICE == u1_slice_type) &&
  ------------------
  |  |  378|   106k|#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: 106k]
  |  Branch (2557:67): [True: 0, False: 0]
  ------------------
 2558|      0|                        (0 == u1_nal_ref_idc);
  ------------------
  |  Branch (2558:25): [True: 0, False: 0]
  ------------------
 2559|       |
 2560|   106k|        i4_skip_p_pic = (ps_dec->u4_skip_frm_mask & P_SLC_BIT) && (P_SLICE == u1_slice_type) &&
  ------------------
  |  |  377|   106k|#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: 106k]
  |  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|   106k|        if(i4_skip_b_pic)
  ------------------
  |  Branch (2568:12): [True: 0, False: 106k]
  ------------------
 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|   106k|        if(i4_skip_p_pic)
  ------------------
  |  Branch (2582:12): [True: 0, False: 106k]
  ------------------
 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|   106k|    }
 2592|       |
 2593|   106k|    {
 2594|   106k|        UWORD16 u2_mb_x, u2_mb_y;
 2595|       |
 2596|   106k|        ps_dec->i4_submb_ofst =
 2597|   106k|            ((u2_first_mb_in_slice << ps_cur_slice->u1_mbaff_frame_flag) * SUB_BLK_SIZE) -
  ------------------
  |  |  562|   106k|#define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|   106k|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  |  |               #define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|   106k|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  ------------------
 2598|   106k|            SUB_BLK_SIZE;
  ------------------
  |  |  562|   106k|#define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|   106k|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  |  |               #define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|   106k|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  ------------------
 2599|   106k|        if(u2_first_mb_in_slice)
  ------------------
  |  Branch (2599:12): [True: 2.93k, False: 103k]
  ------------------
 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.45k, False: 1.47k]
  ------------------
 2615|  1.45k|                {
 2616|  1.45k|                    ps_trns_addr = &ps_dec->s_tran_addrecon_parse;
 2617|  1.45k|                }
 2618|  1.47k|                else
 2619|  1.47k|                {
 2620|  1.47k|                    ps_trns_addr = &ps_dec->s_tran_addrecon;
 2621|  1.47k|                }
 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: 73, False: 2.86k]
  ------------------
 2628|     73|                {
 2629|     73|                    return ERROR_CORRUPTED_SLICE;
 2630|     73|                }
 2631|       |
 2632|  2.86k|                u4_frame_stride = ps_dec->u2_frm_wd_y << u1_field_pic;
 2633|  2.86k|                x_offset = u2_mb_x << 4;
 2634|  2.86k|                y_offset = (u2_mb_y * u4_frame_stride) << 4;
 2635|       |
 2636|  2.86k|                ps_trns_addr->pu1_dest_y = ps_dec->s_cur_pic.pu1_buf1 + x_offset + y_offset;
 2637|       |
 2638|  2.86k|                u4_frame_stride = ps_dec->u2_frm_wd_uv << u1_field_pic;
 2639|  2.86k|                x_offset >>= 1;
 2640|  2.86k|                y_offset = (u2_mb_y * u4_frame_stride) << 3;
 2641|       |
 2642|  2.86k|                x_offset *= YUV420SP_FACTOR;
  ------------------
  |  |  119|  2.86k|#define YUV420SP_FACTOR 2
  ------------------
 2643|       |
 2644|  2.86k|                ps_trns_addr->pu1_dest_u = ps_dec->s_cur_pic.pu1_buf2 + x_offset + y_offset;
 2645|  2.86k|                ps_trns_addr->pu1_dest_v = ps_dec->s_cur_pic.pu1_buf3 + x_offset + y_offset;
 2646|       |
 2647|  2.86k|                ps_trns_addr->pu1_mb_y = ps_trns_addr->pu1_dest_y;
 2648|  2.86k|                ps_trns_addr->pu1_mb_u = ps_trns_addr->pu1_dest_u;
 2649|  2.86k|                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.86k|                if(ps_dec->u1_separate_parse == 1)
  ------------------
  |  Branch (2652:20): [True: 1.39k, False: 1.47k]
  ------------------
 2653|  1.39k|                {
 2654|  1.39k|                    ps_dec->ps_deblk_mbn =
 2655|  1.39k|                        ps_dec->ps_deblk_pic + (u2_first_mb_in_slice << u1_mb_aff);
 2656|  1.39k|                }
 2657|  1.47k|                else
 2658|  1.47k|                {
 2659|  1.47k|                    ps_dec->ps_deblk_mbn =
 2660|  1.47k|                        ps_dec->ps_deblk_pic + (u2_first_mb_in_slice << u1_mb_aff);
 2661|  1.47k|                }
 2662|       |
 2663|  2.86k|                ps_dec->u4_cur_mb_addr = (u2_first_mb_in_slice << u1_mb_aff);
 2664|       |
 2665|  2.86k|                ps_dec->ps_mv_cur =
 2666|  2.86k|                    ps_dec->s_cur_pic.ps_mv + ((u2_first_mb_in_slice << u1_mb_aff) << 4);
 2667|  2.86k|            }
 2668|  2.86k|        }
 2669|   103k|        else
 2670|   103k|        {
 2671|   103k|            tfr_ctxt_t *ps_trns_addr;
 2672|       |
 2673|   103k|            if(ps_dec->u1_separate_parse)
  ------------------
  |  Branch (2673:16): [True: 31.5k, False: 72.0k]
  ------------------
 2674|  31.5k|            {
 2675|  31.5k|                ps_trns_addr = &ps_dec->s_tran_addrecon_parse;
 2676|  31.5k|            }
 2677|  72.0k|            else
 2678|  72.0k|            {
 2679|  72.0k|                ps_trns_addr = &ps_dec->s_tran_addrecon;
 2680|  72.0k|            }
 2681|       |
 2682|   103k|            u2_mb_x = 0xffff;
 2683|   103k|            u2_mb_y = 0;
 2684|       |            // assign the deblock structure pointers to start of slice
 2685|   103k|            ps_dec->u4_cur_mb_addr = 0;
 2686|   103k|            ps_dec->ps_deblk_mbn = ps_dec->ps_deblk_pic;
 2687|   103k|            ps_dec->ps_mv_cur = ps_dec->s_cur_pic.ps_mv;
 2688|   103k|            ps_trns_addr->pu1_dest_y = ps_dec->s_cur_pic.pu1_buf1;
 2689|   103k|            ps_trns_addr->pu1_dest_u = ps_dec->s_cur_pic.pu1_buf2;
 2690|   103k|            ps_trns_addr->pu1_dest_v = ps_dec->s_cur_pic.pu1_buf3;
 2691|       |
 2692|   103k|            ps_trns_addr->pu1_mb_y = ps_trns_addr->pu1_dest_y;
 2693|   103k|            ps_trns_addr->pu1_mb_u = ps_trns_addr->pu1_dest_u;
 2694|   103k|            ps_trns_addr->pu1_mb_v = ps_trns_addr->pu1_dest_v;
 2695|   103k|        }
 2696|       |
 2697|   106k|        ps_dec->ps_part = ps_dec->ps_parse_part_params;
 2698|       |
 2699|   106k|        ps_dec->u2_mbx = (MOD(u2_first_mb_in_slice - 1, ps_seq->u2_frm_wd_in_mbs));
  ------------------
  |  |   64|   106k|#define MOD(x,y) ((x)%(y))
  ------------------
 2700|   106k|        ps_dec->u2_mby = (DIV(u2_first_mb_in_slice - 1, ps_seq->u2_frm_wd_in_mbs));
  ------------------
  |  |   65|   106k|#define DIV(x,y) ((x)/(y))
  ------------------
 2701|   106k|        ps_dec->u2_mby <<= ps_cur_slice->u1_mbaff_frame_flag;
 2702|   106k|        ps_dec->i2_prev_slice_mbx = (WORD16) ps_dec->u2_mbx;
 2703|   106k|        ps_dec->i2_prev_slice_mby = (WORD16) ps_dec->u2_mby;
 2704|   106k|    }
 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|   106k|    ps_dec->u1_B = (u1_slice_type == B_SLICE);
  ------------------
  |  |  369|   106k|#define B_SLICE  1
  ------------------
 2710|   106k|    ps_dec->u4_next_mb_skip = 0;
 2711|       |
 2712|   106k|    ps_dec->ps_parse_cur_slice->u4_first_mb_in_slice = ps_dec->ps_cur_slice->u2_first_mb_in_slice;
 2713|   106k|    ps_dec->ps_parse_cur_slice->slice_type = ps_dec->ps_cur_slice->u1_slice_type;
 2714|       |
 2715|   106k|    ps_dec->u4_start_recon_deblk = 1;
 2716|   106k|    {
 2717|   106k|        WORD32 num_entries;
 2718|   106k|        WORD32 size;
 2719|   106k|        UWORD8 *pu1_buf;
 2720|       |
 2721|   106k|        num_entries = MAX_FRAMES;
  ------------------
  |  |  600|   106k|#define MAX_FRAMES              16
  ------------------
 2722|   106k|        if((1 >= ps_dec->ps_cur_sps->u1_num_ref_frames) && (0 == ps_dec->i4_display_delay))
  ------------------
  |  Branch (2722:12): [True: 86.3k, False: 20.1k]
  |  Branch (2722:60): [True: 0, False: 86.3k]
  ------------------
 2723|      0|        {
 2724|      0|            num_entries = 1;
 2725|      0|        }
 2726|   106k|        num_entries = ((2 * num_entries) + 1);
 2727|   106k|        num_entries *= 2;
 2728|       |
 2729|   106k|        size = num_entries * sizeof(void *);
 2730|   106k|        size += PAD_MAP_IDX_POC * sizeof(void *);
  ------------------
  |  |  100|   106k|#define PAD_MAP_IDX_POC             (1)
  ------------------
 2731|       |
 2732|   106k|        pu1_buf = (UWORD8 *) ps_dec->pv_map_ref_idx_to_poc_buf;
 2733|   106k|        pu1_buf += size * ps_dec->u2_cur_slice_num;
 2734|   106k|        ps_dec->ps_parse_cur_slice->ppv_map_ref_idx_to_poc = (void *) pu1_buf;
 2735|   106k|    }
 2736|       |
 2737|   106k|    if(ps_dec->u1_separate_parse)
  ------------------
  |  Branch (2737:8): [True: 32.9k, False: 73.5k]
  ------------------
 2738|  32.9k|    {
 2739|  32.9k|        ps_dec->ps_parse_cur_slice->pv_tu_coeff_data_start = ps_dec->pv_parse_tu_coeff_data;
 2740|  32.9k|    }
 2741|  73.5k|    else
 2742|  73.5k|    {
 2743|  73.5k|        ps_dec->pv_proc_tu_coeff_data = ps_dec->pv_parse_tu_coeff_data;
 2744|  73.5k|    }
 2745|       |
 2746|   106k|    ret = ih264d_fix_error_in_dpb(ps_dec);
 2747|   106k|    if(ret < 0) return ERROR_DBP_MANAGER_T;
  ------------------
  |  Branch (2747:8): [True: 0, False: 106k]
  ------------------
 2748|       |
 2749|   106k|    if(u1_slice_type == I_SLICE)
  ------------------
  |  |  370|   106k|#define I_SLICE  2
  ------------------
  |  Branch (2749:8): [True: 8.00k, False: 98.5k]
  ------------------
 2750|  8.00k|    {
 2751|  8.00k|        ps_dec->ps_cur_pic->u4_pack_slc_typ |= I_SLC_BIT;
  ------------------
  |  |  376|  8.00k|#define I_SLC_BIT  (0x1)
  ------------------
 2752|       |
 2753|  8.00k|        ret = isvcd_parse_islice(ps_svc_lyr_dec, u2_first_mb_in_slice);
 2754|  8.00k|        ps_dec->u1_pr_sl_type = u1_slice_type;
 2755|  8.00k|        if(ps_dec->i4_pic_type != B_SLICE && ps_dec->i4_pic_type != P_SLICE)
  ------------------
  |  |  369|  16.0k|#define B_SLICE  1
  ------------------
                      if(ps_dec->i4_pic_type != B_SLICE && ps_dec->i4_pic_type != P_SLICE)
  ------------------
  |  |  368|  7.89k|#define P_SLICE  0
  ------------------
  |  Branch (2755:12): [True: 7.89k, False: 106]
  |  Branch (2755:46): [True: 7.03k, False: 863]
  ------------------
 2756|  7.03k|            ps_dec->i4_pic_type = I_SLICE;
  ------------------
  |  |  370|  7.03k|#define I_SLICE  2
  ------------------
 2757|  8.00k|    }
 2758|  98.5k|    else if(u1_slice_type == P_SLICE)
  ------------------
  |  |  368|  98.5k|#define P_SLICE  0
  ------------------
  |  Branch (2758:13): [True: 67.1k, False: 31.3k]
  ------------------
 2759|  67.1k|    {
 2760|  67.1k|        ps_dec->ps_cur_pic->u4_pack_slc_typ |= P_SLC_BIT;
  ------------------
  |  |  377|  67.1k|#define P_SLC_BIT  (0x2)
  ------------------
 2761|  67.1k|        ret = isvcd_parse_pslice(ps_svc_lyr_dec, u2_first_mb_in_slice);
 2762|  67.1k|        ps_dec->u1_pr_sl_type = u1_slice_type;
 2763|  67.1k|        if(ps_dec->i4_pic_type != B_SLICE) ps_dec->i4_pic_type = P_SLICE;
  ------------------
  |  |  369|  67.1k|#define B_SLICE  1
  ------------------
                      if(ps_dec->i4_pic_type != B_SLICE) ps_dec->i4_pic_type = P_SLICE;
  ------------------
  |  |  368|  66.9k|#define P_SLICE  0
  ------------------
  |  Branch (2763:12): [True: 66.9k, False: 223]
  ------------------
 2764|  67.1k|    }
 2765|  31.3k|    else if(u1_slice_type == B_SLICE)
  ------------------
  |  |  369|  31.3k|#define B_SLICE  1
  ------------------
  |  Branch (2765:13): [True: 30.8k, False: 451]
  ------------------
 2766|  30.8k|    {
 2767|  30.8k|        ps_dec->ps_cur_pic->u4_pack_slc_typ |= B_SLC_BIT;
  ------------------
  |  |  378|  30.8k|#define B_SLC_BIT  (0x4)
  ------------------
 2768|  30.8k|        ret = isvcd_parse_bslice(ps_svc_lyr_dec, u2_first_mb_in_slice);
 2769|  30.8k|        ps_dec->u1_pr_sl_type = u1_slice_type;
 2770|  30.8k|        ps_dec->i4_pic_type = B_SLICE;
  ------------------
  |  |  369|  30.8k|#define B_SLICE  1
  ------------------
 2771|  30.8k|    }
 2772|    451|    else
 2773|    451|        return ERROR_INV_SLC_TYPE_T;
 2774|       |
 2775|   106k|    if(ps_dec->u1_slice_header_done)
  ------------------
  |  Branch (2775:8): [True: 83.3k, False: 22.7k]
  ------------------
 2776|  83.3k|    {
 2777|       |        /* set to zero to indicate a valid slice has been decoded */
 2778|  83.3k|        ps_dec->u1_first_slice_in_stream = 0;
 2779|  83.3k|    }
 2780|       |
 2781|   106k|    if(ret != OK) return ret;
  ------------------
  |  |  114|   106k|#define OK        0
  ------------------
  |  Branch (2781:8): [True: 50.6k, False: 55.4k]
  ------------------
 2782|       |
 2783|  55.4k|    if(u1_nal_ref_idc != 0)
  ------------------
  |  Branch (2783:8): [True: 49.7k, False: 5.70k]
  ------------------
 2784|  49.7k|    {
 2785|  49.7k|        if(!ps_dec->ps_dpb_cmds->u1_dpb_commands_read)
  ------------------
  |  Branch (2785:12): [True: 49.0k, False: 707]
  ------------------
 2786|  49.0k|        {
 2787|  49.0k|            memcpy((void *) ps_dec->ps_dpb_cmds, (void *) (&(ps_dec->s_dpb_cmds_scratch)),
 2788|  49.0k|                   sizeof(dpb_commands_t));
 2789|  49.0k|        }
 2790|  49.7k|    }
 2791|       |
 2792|       |    /* storing last Mb X and MbY of the slice */
 2793|  55.4k|    ps_dec->i2_prev_slice_mbx = ps_dec->u2_mbx;
 2794|  55.4k|    ps_dec->i2_prev_slice_mby = ps_dec->u2_mby;
 2795|       |
 2796|       |    /* End of Picture detection */
 2797|       |
 2798|  55.4k|    if(ps_dec->u4_total_mbs_coded >= (ps_seq->u4_max_mb_addr + 1))
  ------------------
  |  Branch (2798:8): [True: 26.3k, False: 29.1k]
  ------------------
 2799|  26.3k|    {
 2800|  26.3k|        ps_dec->u1_pic_decode_done = 1;
 2801|  26.3k|    }
 2802|       |
 2803|  55.4k|    {
 2804|  55.4k|        dec_err_status_t *ps_err = ps_dec->ps_dec_err_status;
 2805|  55.4k|        if((ps_err->u1_err_flag & REJECT_PB_PICS) && (ps_err->u1_cur_pic_type == PIC_TYPE_I))
  ------------------
  |  |  602|  55.4k|#define REJECT_PB_PICS    (0x02)
  ------------------
                      if((ps_err->u1_err_flag & REJECT_PB_PICS) && (ps_err->u1_cur_pic_type == PIC_TYPE_I))
  ------------------
  |  |  608|      0|#define PIC_TYPE_I        (0x00)
  ------------------
  |  Branch (2805:12): [True: 0, False: 55.4k]
  |  Branch (2805:54): [True: 0, False: 0]
  ------------------
 2806|      0|        {
 2807|      0|            ps_err->u1_err_flag = ACCEPT_ALL_PICS;
  ------------------
  |  |  600|      0|#define ACCEPT_ALL_PICS   (0x00)
  ------------------
 2808|      0|        }
 2809|  55.4k|    }
 2810|       |
 2811|  55.4k|    PRINT_BIN_BIT_RATIO(ps_dec)
 2812|       |
 2813|  55.4k|    return ret;
 2814|   106k|}

isvcd_pred_residual_recon_chroma_8x8:
   88|   159k|{
   89|   159k|    UWORD8 *pu1_pred_ptr = pu1_pred;
   90|   159k|    WORD16 *pi2_rsd_ptr = pi2_rsd;
   91|   159k|    UWORD8 *pu1_out_ptr = pu1_out;
   92|   159k|    WORD16 i, j;
   93|   159k|    WORD16 i_macro;
   94|       |
   95|  1.43M|    for(i = 0; i < 8; i++)
  ------------------
  |  Branch (95:16): [True: 1.27M, False: 159k]
  ------------------
   96|  1.27M|    {
   97|  1.27M|        pu1_pred_ptr = pu1_pred;
   98|  1.27M|        pi2_rsd_ptr = pi2_rsd;
   99|  1.27M|        pu1_out = pu1_out_ptr;
  100|       |
  101|  11.4M|        for(j = 0; j < 8; j++)
  ------------------
  |  Branch (101:20): [True: 10.1M, False: 1.27M]
  ------------------
  102|  10.1M|        {
  103|  10.1M|            i_macro = *pu1_pred_ptr + *pi2_rsd_ptr;
  104|  10.1M|            *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|  10.1M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  10.1M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 135k, False: 10.0M]
  |  |  |  |  |  Branch (77:54): [True: 2.06k, False: 10.0M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  105|  10.1M|            pu1_pred_ptr += pred_strd;
  106|  10.1M|            pi2_rsd_ptr += rsd_strd;
  107|  10.1M|            pu1_out += out_strd;
  108|  10.1M|        }
  109|       |
  110|  1.27M|        pu1_out_ptr += 2;  // Interleaved store for output
  111|  1.27M|        pu1_pred += 2;     // Interleaved load for pred buffer
  112|  1.27M|        pi2_rsd += 2;
  113|  1.27M|    }
  114|   159k|}
isvcd_pred_residual_recon_chroma_4x4:
  190|  18.4k|{
  191|  18.4k|    UWORD8 *pu1_pred_ptr = pu1_pred;
  192|  18.4k|    WORD16 *pi2_rsd_ptr = pi2_rsd;
  193|  18.4k|    UWORD8 *pu1_out_ptr = pu1_out;
  194|  18.4k|    WORD16 i, j;
  195|  18.4k|    WORD16 i_macro;
  196|       |
  197|  92.3k|    for(i = 0; i < 4; i++)
  ------------------
  |  Branch (197:16): [True: 73.8k, False: 18.4k]
  ------------------
  198|  73.8k|    {
  199|  73.8k|        pu1_pred_ptr = pu1_pred;
  200|  73.8k|        pi2_rsd_ptr = pi2_rsd;
  201|  73.8k|        pu1_out = pu1_out_ptr;
  202|       |
  203|   369k|        for(j = 0; j < 4; j++)
  ------------------
  |  Branch (203:20): [True: 295k, False: 73.8k]
  ------------------
  204|   295k|        {
  205|   295k|            i_macro = *pu1_pred_ptr + *pi2_rsd_ptr;
  206|   295k|            *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   295k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   295k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 5.67k, False: 289k]
  |  |  |  |  |  Branch (77:54): [True: 80, False: 289k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  207|   295k|            pu1_pred_ptr += pred_strd;
  208|   295k|            pi2_rsd_ptr += rsd_strd;
  209|   295k|            pu1_out += out_strd;
  210|   295k|        }
  211|       |
  212|  73.8k|        pu1_out_ptr += 2;  // Interleaved store for output
  213|  73.8k|        pu1_pred += 2;     // Interleaved load for pred buffer
  214|  73.8k|        pi2_rsd += 2;
  215|  73.8k|    }
  216|  18.4k|}
isvcd_pred_residual_recon_16x16:
  242|  72.8k|{
  243|  72.8k|    WORD32 i4_nnz = 0, i4_nnz_blk[4][4] = {0};
  244|  72.8k|    UWORD8 *pu1_pred_ptr = pu1_pred;
  245|  72.8k|    WORD16 *pi2_rsd_ptr = pi2_rsd;
  246|  72.8k|    UWORD8 *pu1_out_ptr = pu1_out;
  247|  72.8k|    WORD16 i, j;
  248|  72.8k|    WORD16 i_macro;
  249|       |
  250|  1.23M|    for(i = 0; i < 16; i++)
  ------------------
  |  Branch (250:16): [True: 1.16M, False: 72.8k]
  ------------------
  251|  1.16M|    {
  252|  1.16M|        pu1_pred_ptr = pu1_pred;
  253|  1.16M|        pi2_rsd_ptr = pi2_rsd;
  254|  1.16M|        pu1_out = pu1_out_ptr;
  255|       |
  256|  19.8M|        for(j = 0; j < 16; j++)
  ------------------
  |  Branch (256:20): [True: 18.6M, False: 1.16M]
  ------------------
  257|  18.6M|        {
  258|  18.6M|            i_macro = *pi2_rsd_ptr;
  259|  18.6M|            i4_nnz_blk[j >> 2][i >> 2] |= !!i_macro;
  260|  18.6M|            i_macro += *pu1_pred_ptr;
  261|  18.6M|            *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|  18.6M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  18.6M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 70.2k, False: 18.5M]
  |  |  |  |  |  Branch (77:54): [True: 12.9k, False: 18.5M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  262|  18.6M|            pu1_pred_ptr += pred_strd;
  263|  18.6M|            pi2_rsd_ptr += rsd_strd;
  264|  18.6M|            pu1_out += out_strd;
  265|  18.6M|        }
  266|       |
  267|  1.16M|        pu1_out_ptr++;
  268|  1.16M|        pi2_rsd++;
  269|  1.16M|        pu1_pred++;
  270|  1.16M|    }
  271|       |
  272|   364k|    for(i = 0; i < 4; i++)
  ------------------
  |  Branch (272:16): [True: 291k, False: 72.8k]
  ------------------
  273|   291k|    {
  274|  1.45M|        for(j = 0; j < 4; j++)
  ------------------
  |  Branch (274:20): [True: 1.16M, False: 291k]
  ------------------
  275|  1.16M|        {
  276|  1.16M|            i4_nnz |= (i4_nnz_blk[j][i]) << (i + (j << 2));
  277|  1.16M|        }
  278|   291k|    }
  279|       |
  280|  72.8k|    return i4_nnz;
  281|  72.8k|}
isvcd_pred_residual_recon_4x4:
  307|  89.0k|{
  308|  89.0k|    WORD32 i4_nnz_blk[4][4] = {0};
  309|  89.0k|    UWORD8 *pu1_pred_ptr = pu1_pred;
  310|  89.0k|    WORD16 *pi2_rsd_ptr = pi2_rsd;
  311|  89.0k|    UWORD8 *pu1_out_ptr = pu1_out;
  312|  89.0k|    WORD16 i, j;
  313|  89.0k|    WORD16 i_macro;
  314|       |
  315|   445k|    for(i = 0; i < 4; i++)
  ------------------
  |  Branch (315:16): [True: 356k, False: 89.0k]
  ------------------
  316|   356k|    {
  317|   356k|        pu1_pred_ptr = pu1_pred;
  318|   356k|        pi2_rsd_ptr = pi2_rsd;
  319|   356k|        pu1_out = pu1_out_ptr;
  320|       |
  321|  1.78M|        for(j = 0; j < 4; j++)
  ------------------
  |  Branch (321:20): [True: 1.42M, False: 356k]
  ------------------
  322|  1.42M|        {
  323|  1.42M|            i_macro = *pi2_rsd_ptr;
  324|  1.42M|            i4_nnz_blk[j >> 2][i >> 2] |= !!i_macro;
  325|  1.42M|            i_macro += *pu1_pred_ptr;
  326|  1.42M|            *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|  1.42M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  1.42M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 14.0k, False: 1.41M]
  |  |  |  |  |  Branch (77:54): [True: 2.09k, False: 1.40M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  327|  1.42M|            pu1_pred_ptr += pred_strd;
  328|  1.42M|            pi2_rsd_ptr += rsd_strd;
  329|  1.42M|            pu1_out += out_strd;
  330|  1.42M|        }
  331|       |
  332|   356k|        pu1_out_ptr++;
  333|   356k|        pi2_rsd++;
  334|   356k|        pu1_pred++;
  335|   356k|    }
  336|       |
  337|  89.0k|    return i4_nnz_blk[0][0];
  338|  89.0k|}
isvcd_pred_residual_recon_8x8:
  364|  10.3k|{
  365|  10.3k|    WORD32 i4_nnz = 0, i4_nnz_blk[4][4] = {0};
  366|  10.3k|    UWORD8 *pu1_pred_ptr = pu1_pred;
  367|  10.3k|    WORD16 *pi2_rsd_ptr = pi2_rsd;
  368|  10.3k|    UWORD8 *pu1_out_ptr = pu1_out;
  369|  10.3k|    WORD16 i, j;
  370|  10.3k|    WORD16 i_macro;
  371|       |
  372|  93.5k|    for(i = 0; i < 8; i++)
  ------------------
  |  Branch (372:16): [True: 83.1k, False: 10.3k]
  ------------------
  373|  83.1k|    {
  374|  83.1k|        pu1_pred_ptr = pu1_pred;
  375|  83.1k|        pi2_rsd_ptr = pi2_rsd;
  376|  83.1k|        pu1_out = pu1_out_ptr;
  377|       |
  378|   748k|        for(j = 0; j < 8; j++)
  ------------------
  |  Branch (378:20): [True: 665k, False: 83.1k]
  ------------------
  379|   665k|        {
  380|   665k|            i_macro = *pi2_rsd_ptr;
  381|   665k|            i4_nnz_blk[j >> 2][i >> 2] |= !!i_macro;
  382|   665k|            i_macro += *pu1_pred_ptr;
  383|   665k|            *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   665k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   665k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 15.7k, False: 649k]
  |  |  |  |  |  Branch (77:54): [True: 845, False: 648k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  384|   665k|            pu1_pred_ptr += pred_strd;
  385|   665k|            pi2_rsd_ptr += rsd_strd;
  386|   665k|            pu1_out += out_strd;
  387|   665k|        }
  388|       |
  389|  83.1k|        pu1_out_ptr++;
  390|  83.1k|        pi2_rsd++;
  391|  83.1k|        pu1_pred++;
  392|  83.1k|    }
  393|       |
  394|  10.3k|    i4_nnz = i4_nnz_blk[0][0] | (i4_nnz_blk[1][0] << 4);
  395|  10.3k|    i4_nnz |= (i4_nnz_blk[0][1] << 1) | (i4_nnz_blk[1][1] << 5);
  396|       |
  397|  10.3k|    return i4_nnz;
  398|  10.3k|}

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

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

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

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

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

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

isvcd_parse_vui_ext_parametres:
   68|  1.41k|{
   69|  1.41k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
   70|  1.41k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
   71|  1.41k|    WORD32 ret;
   72|  1.41k|    UWORD32 u4_i;
   73|       |
   74|  1.41k|    ps_svc_vui_ext->u4_vui_ext_num_entries_minus1 = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
   75|  1.41k|    if(ps_svc_vui_ext->u4_vui_ext_num_entries_minus1 > 1023)
  ------------------
  |  Branch (75:8): [True: 174, False: 1.24k]
  ------------------
   76|    174|    {
   77|    174|        return ERROR_INV_SPS_PPS_T;
   78|    174|    }
   79|       |
   80|  17.0k|    for(u4_i = 0; u4_i <= ps_svc_vui_ext->u4_vui_ext_num_entries_minus1; u4_i++)
  ------------------
  |  Branch (80:19): [True: 15.9k, False: 1.08k]
  ------------------
   81|  15.9k|    {
   82|  15.9k|        ps_svc_vui_ext->u1_vui_ext_dependency_id[u4_i] = ih264d_get_bits_h264(ps_bitstrm, 3);
   83|  15.9k|        ps_svc_vui_ext->u1_vui_ext_quality_id[u4_i] = ih264d_get_bits_h264(ps_bitstrm, 4);
   84|  15.9k|        ps_svc_vui_ext->u1_vui_ext_temporal_id[u4_i] = ih264d_get_bits_h264(ps_bitstrm, 3);
   85|  15.9k|        ps_svc_vui_ext->u1_vui_ext_timing_info_present_flag[u4_i] = ih264d_get_bit_h264(ps_bitstrm);
   86|       |
   87|  15.9k|        if(1 == ps_svc_vui_ext->u1_vui_ext_timing_info_present_flag[u4_i])
  ------------------
  |  Branch (87:12): [True: 1.17k, False: 14.7k]
  ------------------
   88|  1.17k|        {
   89|  1.17k|            ps_svc_vui_ext->u4_vui_ext_num_units_in_tick[u4_i] =
   90|  1.17k|                ih264d_get_bits_h264(ps_bitstrm, 32);
   91|  1.17k|            ps_svc_vui_ext->u4_vui_ext_time_scale[u4_i] = ih264d_get_bits_h264(ps_bitstrm, 32);
   92|  1.17k|            ps_svc_vui_ext->u1_vui_ext_fixed_frame_rate_flag[u4_i] =
   93|  1.17k|                ih264d_get_bit_h264(ps_bitstrm);
   94|  1.17k|        }
   95|       |
   96|  15.9k|        ps_svc_vui_ext->u1_vui_ext_nal_hrd_params_present_flag[u4_i] =
   97|  15.9k|            ih264d_get_bit_h264(ps_bitstrm);
   98|  15.9k|        if(ps_svc_vui_ext->u1_vui_ext_nal_hrd_params_present_flag[u4_i])
  ------------------
  |  Branch (98:12): [True: 1.38k, False: 14.5k]
  ------------------
   99|  1.38k|        {
  100|  1.38k|            ret = ih264d_parse_hrd_parametres(&ps_svc_vui_ext->s_nal_hrd[u4_i], ps_bitstrm);
  101|  1.38k|            if(ret != OK) return ret;
  ------------------
  |  |  114|  1.38k|#define OK        0
  ------------------
  |  Branch (101:16): [True: 68, False: 1.31k]
  ------------------
  102|  1.38k|        }
  103|  15.9k|        ps_svc_vui_ext->u1_vui_ext_vcl_hrd_params_present_flag[u4_i] =
  104|  15.9k|            ih264d_get_bit_h264(ps_bitstrm);
  105|  15.9k|        if(ps_svc_vui_ext->u1_vui_ext_vcl_hrd_params_present_flag[u4_i])
  ------------------
  |  Branch (105:12): [True: 1.21k, False: 14.6k]
  ------------------
  106|  1.21k|        {
  107|  1.21k|            ret = ih264d_parse_hrd_parametres(&ps_svc_vui_ext->s_vcl_hrd[u4_i], ps_bitstrm);
  108|  1.21k|            if(ret != OK) return ret;
  ------------------
  |  |  114|  1.21k|#define OK        0
  ------------------
  |  Branch (108:16): [True: 87, False: 1.12k]
  ------------------
  109|  1.21k|        }
  110|  15.8k|        if(ps_svc_vui_ext->u1_vui_ext_nal_hrd_params_present_flag[u4_i] ||
  ------------------
  |  Branch (110:12): [True: 1.23k, False: 14.5k]
  ------------------
  111|  14.5k|           ps_svc_vui_ext->u1_vui_ext_vcl_hrd_params_present_flag[u4_i])
  ------------------
  |  Branch (111:12): [True: 551, False: 14.0k]
  ------------------
  112|  1.78k|        {
  113|  1.78k|            ps_svc_vui_ext->u1_vui_ext_low_delay_hrd_flag[u4_i] = ih264d_get_bit_h264(ps_bitstrm);
  114|  1.78k|        }
  115|  15.8k|        ps_svc_vui_ext->u1_vui_ext_pic_struct_present_flag[u4_i] = ih264d_get_bit_h264(ps_bitstrm);
  116|  15.8k|    }
  117|  1.08k|    return OK;
  ------------------
  |  |  114|  1.08k|#define OK        0
  ------------------
  118|  1.24k|}

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

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

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

isvcd_init_function_ptr:
   69|   155k|{
   70|   155k|    isvcd_init_function_ptr_generic(ps_svc_lyr_dec);
   71|   155k|    switch(ps_svc_lyr_dec->s_dec.e_processor_arch)
   72|   155k|    {
   73|  26.3k|        case ARCH_X86_GENERIC:
  ------------------
  |  Branch (73:9): [True: 26.3k, False: 129k]
  ------------------
   74|  26.3k|            isvcd_init_function_ptr_generic(ps_svc_lyr_dec);
   75|  26.3k|            break;
   76|  7.57k|        case ARCH_X86_SSSE3:
  ------------------
  |  Branch (76:9): [True: 7.57k, False: 148k]
  ------------------
   77|  7.57k|            ih264d_init_function_ptr_ssse3(&ps_svc_lyr_dec->s_dec);
   78|  7.57k|            break;
   79|  91.9k|        case ARCH_X86_SSE42:
  ------------------
  |  Branch (79:9): [True: 91.9k, False: 63.6k]
  ------------------
   80|   121k|        default:
  ------------------
  |  Branch (80:9): [True: 29.7k, False: 125k]
  ------------------
   81|   121k|            ih264d_init_function_ptr_ssse3(&ps_svc_lyr_dec->s_dec);
   82|   121k|            isvcd_init_function_ptr_sse42(ps_svc_lyr_dec);
   83|   121k|            break;
   84|   155k|    }
   85|   155k|}

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

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

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

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

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

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

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

