void ff_hevc_luma_mv_merge_mode(HEVCContext *s, int x0, int y0, int nPbW,

                                int nPbH, int log2_cb_size, int part_idx,

                                int merge_idx, MvField *mv)

{

    int singleMCLFlag = 0;

    int nCS = 1 << log2_cb_size;

    LOCAL_ALIGNED(4, MvField, mergecand_list, [MRG_MAX_NUM_CANDS]);

    int nPbW2 = nPbW;

    int nPbH2 = nPbH;

    HEVCLocalContext *lc = &s->HEVClc;



    memset(mergecand_list, 0, MRG_MAX_NUM_CANDS * sizeof(*mergecand_list));



    if (s->pps->log2_parallel_merge_level > 2 && nCS == 8) {

        singleMCLFlag = 1;

        x0            = lc->cu.x;

        y0            = lc->cu.y;

        nPbW          = nCS;

        nPbH          = nCS;

        part_idx      = 0;

    }



    ff_hevc_set_neighbour_available(s, x0, y0, nPbW, nPbH);

    derive_spatial_merge_candidates(s, x0, y0, nPbW, nPbH, log2_cb_size,

                                    singleMCLFlag, part_idx,

                                    merge_idx, mergecand_list);



    if (mergecand_list[merge_idx].pred_flag[0] == 1 &&

        mergecand_list[merge_idx].pred_flag[1] == 1 &&

        (nPbW2 + nPbH2) == 12) {

        mergecand_list[merge_idx].ref_idx[1]   = -1;

        mergecand_list[merge_idx].pred_flag[1] = 0;

    }



    *mv = mergecand_list[merge_idx];

}

void ff_hevc_luma_mv_merge_mode(HEVCContext *s, int x0, int y0, int nPbW,

                                int nPbH, int log2_cb_size, int part_idx,

                                int merge_idx, MvField *mv)

{

    int singleMCLFlag = 0;

    int nCS = 1 << log2_cb_size;

    LOCAL_ALIGNED(4, MvField, mergecand_list, [MRG_MAX_NUM_CANDS]);

    int nPbW2 = nPbW;

    int nPbH2 = nPbH;

    HEVCLocalContext *lc = &s->HEVClc;



    memset(mergecand_list, 0, MRG_MAX_NUM_CANDS * sizeof(*mergecand_list));



    if (s->pps->log2_parallel_merge_level > 2 && nCS == 8) {

        singleMCLFlag = 1;

        x0            = lc->cu.x;

        y0            = lc->cu.y;

        nPbW          = nCS;

        nPbH          = nCS;

        part_idx      = 0;

    }



    ff_hevc_set_neighbour_available(s, x0, y0, nPbW, nPbH);

    derive_spatial_merge_candidates(s, x0, y0, nPbW, nPbH, log2_cb_size,

                                    singleMCLFlag, part_idx,

                                    merge_idx, mergecand_list);



    if (mergecand_list[merge_idx].pred_flag[0] == 1 &&

        mergecand_list[merge_idx].pred_flag[1] == 1 &&

        (nPbW2 + nPbH2) == 12) {

        mergecand_list[merge_idx].ref_idx[1]   = -1;

        mergecand_list[merge_idx].pred_flag[1] = 0;

    }



    *mv = mergecand_list[merge_idx];

}

    memset(mergecand_list, 0, MRG_MAX_NUM_CANDS * sizeof(*mergecand_list));
void FUNC_0(HEVCContext *VAR_0, int VAR_1, int VAR_2, int VAR_3,

                                int VAR_4, int VAR_5, int VAR_6,

                                int VAR_7, MvField *VAR_8)

{

    int VAR_9 = 0;

    int VAR_10 = 1 << VAR_5;

    LOCAL_ALIGNED(4, MvField, mergecand_list, [MRG_MAX_NUM_CANDS]);

    int VAR_11 = VAR_3;

    int VAR_12 = VAR_4;

    HEVCLocalContext *lc = &VAR_0->HEVClc;



    memset(mergecand_list, 0, MRG_MAX_NUM_CANDS * sizeof(*mergecand_list));



    if (VAR_0->pps->log2_parallel_merge_level > 2 && VAR_10 == 8) {

        VAR_9 = 1;

        VAR_1            = lc->cu.x;

        VAR_2            = lc->cu.y;

        VAR_3          = VAR_10;

        VAR_4          = VAR_10;

        VAR_6      = 0;

    }



    ff_hevc_set_neighbour_available(VAR_0, VAR_1, VAR_2, VAR_3, VAR_4);

    derive_spatial_merge_candidates(VAR_0, VAR_1, VAR_2, VAR_3, VAR_4, VAR_5,

                                    VAR_9, VAR_6,

                                    VAR_7, mergecand_list);



    if (mergecand_list[VAR_7].pred_flag[0] == 1 &&

        mergecand_list[VAR_7].pred_flag[1] == 1 &&

        (VAR_11 + VAR_12) == 12) {

        mergecand_list[VAR_7].ref_idx[1]   = -1;

        mergecand_list[VAR_7].pred_flag[1] = 0;

    }



    *VAR_8 = mergecand_list[VAR_7];

}

void FUNC_0(HEVCContext *VAR_0, int VAR_1, int VAR_2, int VAR_3,
int VAR_4, int VAR_5, int VAR_6,
int VAR_7, MvField *VAR_8)
{ int VAR_9 = 0; int VAR_10 = 1 << VAR_5; LOCAL_ALIGNED(4, MvField, mergecand_list, [MRG_MAX_NUM_CANDS]); int VAR_11 = VAR_3; int VAR_12 = VAR_4; HEVCLocalContext *lc = &VAR_0->HEVClc; memset(mergecand_list, 0, MRG_MAX_NUM_CANDS * sizeof(*mergecand_list)); if (VAR_0->pps->log2_parallel_merge_level > 2 && VAR_10 == 8) { VAR_9 = 1; VAR_1            = lc->cu.x; VAR_2            = lc->cu.y; VAR_3          = VAR_10; VAR_4          = VAR_10; VAR_6      = 0; } ff_hevc_set_neighbour_available(VAR_0, VAR_1, VAR_2, VAR_3, VAR_4); derive_spatial_merge_candidates(VAR_0, VAR_1, VAR_2, VAR_3, VAR_4, VAR_5,
VAR_9, VAR_6,
VAR_7, mergecand_list); if (mergecand_list[VAR_7].pred_flag[0] == 1 &&
mergecand_list[VAR_7].pred_flag[1] == 1 &&
(VAR_11 + VAR_12) == 12) { mergecand_list[VAR_7].ref_idx[1]   = -1; mergecand_list[VAR_7].pred_flag[1] = 0; } *VAR_8 = mergecand_list[VAR_7]; }