static void interpolate_refplane(DiracContext *s, DiracFrame *ref, int plane, int width, int height)

{

    /* chroma allocates an edge of 8 when subsampled

       which for 4:2:2 means an h edge of 16 and v edge of 8

       just use 8 for everything for the moment */

    int i, edge = EDGE_WIDTH/2;



    ref->hpel[plane][0] = ref->avframe->data[plane];

    s->mpvencdsp.draw_edges(ref->hpel[plane][0], ref->avframe->linesize[plane], width, height, edge, edge, EDGE_TOP | EDGE_BOTTOM); /* EDGE_TOP | EDGE_BOTTOM values just copied to make it build, this needs to be ensured */



    /* no need for hpel if we only have fpel vectors */

    if (!s->mv_precision)

        return;



    for (i = 1; i < 4; i++) {

        if (!ref->hpel_base[plane][i])

            ref->hpel_base[plane][i] = av_malloc((height+2*edge) * ref->avframe->linesize[plane] + 32);

        /* we need to be 16-byte aligned even for chroma */

        ref->hpel[plane][i] = ref->hpel_base[plane][i] + edge*ref->avframe->linesize[plane] + 16;

    }



    if (!ref->interpolated[plane]) {

        s->diracdsp.dirac_hpel_filter(ref->hpel[plane][1], ref->hpel[plane][2],

                                      ref->hpel[plane][3], ref->hpel[plane][0],

                                      ref->avframe->linesize[plane], width, height);

        s->mpvencdsp.draw_edges(ref->hpel[plane][1], ref->avframe->linesize[plane], width, height, edge, edge, EDGE_TOP | EDGE_BOTTOM);

        s->mpvencdsp.draw_edges(ref->hpel[plane][2], ref->avframe->linesize[plane], width, height, edge, edge, EDGE_TOP | EDGE_BOTTOM);

        s->mpvencdsp.draw_edges(ref->hpel[plane][3], ref->avframe->linesize[plane], width, height, edge, edge, EDGE_TOP | EDGE_BOTTOM);

    }

    ref->interpolated[plane] = 1;

}

static void interpolate_refplane(DiracContext *s, DiracFrame *ref, int plane, int width, int height)

{

    





    int i, edge = EDGE_WIDTH/2;



    ref->hpel[plane][0] = ref->avframe->data[plane];

    s->mpvencdsp.draw_edges(ref->hpel[plane][0], ref->avframe->linesize[plane], width, height, edge, edge, EDGE_TOP | EDGE_BOTTOM); 



    

    if (!s->mv_precision)

        return;



    for (i = 1; i < 4; i++) {

        if (!ref->hpel_base[plane][i])

            ref->hpel_base[plane][i] = av_malloc((height+2*edge) * ref->avframe->linesize[plane] + 32);

        

        ref->hpel[plane][i] = ref->hpel_base[plane][i] + edge*ref->avframe->linesize[plane] + 16;

    }



    if (!ref->interpolated[plane]) {

        s->diracdsp.dirac_hpel_filter(ref->hpel[plane][1], ref->hpel[plane][2],

                                      ref->hpel[plane][3], ref->hpel[plane][0],

                                      ref->avframe->linesize[plane], width, height);

        s->mpvencdsp.draw_edges(ref->hpel[plane][1], ref->avframe->linesize[plane], width, height, edge, edge, EDGE_TOP | EDGE_BOTTOM);

        s->mpvencdsp.draw_edges(ref->hpel[plane][2], ref->avframe->linesize[plane], width, height, edge, edge, EDGE_TOP | EDGE_BOTTOM);

        s->mpvencdsp.draw_edges(ref->hpel[plane][3], ref->avframe->linesize[plane], width, height, edge, edge, EDGE_TOP | EDGE_BOTTOM);

    }

    ref->interpolated[plane] = 1;

}

static void interpolate_refplane(DiracContext *s, DiracFrame *ref, int plane, int width, int height)
static void FUNC_0(DiracContext *VAR_0, DiracFrame *VAR_1, int VAR_2, int VAR_3, int VAR_4)

{

    





    int VAR_5, VAR_6 = EDGE_WIDTH/2;



    VAR_1->hpel[VAR_2][0] = VAR_1->avframe->data[VAR_2];

    VAR_0->mpvencdsp.draw_edges(VAR_1->hpel[VAR_2][0], VAR_1->avframe->linesize[VAR_2], VAR_3, VAR_4, VAR_6, VAR_6, EDGE_TOP | EDGE_BOTTOM); 



    

    if (!VAR_0->mv_precision)

        return;



    for (VAR_5 = 1; VAR_5 < 4; VAR_5++) {

        if (!VAR_1->hpel_base[VAR_2][VAR_5])

            VAR_1->hpel_base[VAR_2][VAR_5] = av_malloc((VAR_4+2*VAR_6) * VAR_1->avframe->linesize[VAR_2] + 32);

        

        VAR_1->hpel[VAR_2][VAR_5] = VAR_1->hpel_base[VAR_2][VAR_5] + VAR_6*VAR_1->avframe->linesize[VAR_2] + 16;

    }



    if (!VAR_1->interpolated[VAR_2]) {

        VAR_0->diracdsp.dirac_hpel_filter(VAR_1->hpel[VAR_2][1], VAR_1->hpel[VAR_2][2],

                                      VAR_1->hpel[VAR_2][3], VAR_1->hpel[VAR_2][0],

                                      VAR_1->avframe->linesize[VAR_2], VAR_3, VAR_4);

        VAR_0->mpvencdsp.draw_edges(VAR_1->hpel[VAR_2][1], VAR_1->avframe->linesize[VAR_2], VAR_3, VAR_4, VAR_6, VAR_6, EDGE_TOP | EDGE_BOTTOM);

        VAR_0->mpvencdsp.draw_edges(VAR_1->hpel[VAR_2][2], VAR_1->avframe->linesize[VAR_2], VAR_3, VAR_4, VAR_6, VAR_6, EDGE_TOP | EDGE_BOTTOM);

        VAR_0->mpvencdsp.draw_edges(VAR_1->hpel[VAR_2][3], VAR_1->avframe->linesize[VAR_2], VAR_3, VAR_4, VAR_6, VAR_6, EDGE_TOP | EDGE_BOTTOM);

    }

    VAR_1->interpolated[VAR_2] = 1;

}

static void FUNC_0(DiracContext *VAR_0, DiracFrame *VAR_1, int VAR_2, int VAR_3, int VAR_4)
{ int VAR_5, VAR_6 = EDGE_WIDTH/2; VAR_1->hpel[VAR_2][0] = VAR_1->avframe->data[VAR_2]; VAR_0->mpvencdsp.draw_edges(VAR_1->hpel[VAR_2][0], VAR_1->avframe->linesize[VAR_2], VAR_3, VAR_4, VAR_6, VAR_6, EDGE_TOP | EDGE_BOTTOM); if (!VAR_0->mv_precision)
return; for (VAR_5 = 1; VAR_5 < 4; VAR_5++) { if (!VAR_1->hpel_base[VAR_2][VAR_5])
VAR_1->hpel_base[VAR_2][VAR_5] = av_malloc((VAR_4+2*VAR_6) * VAR_1->avframe->linesize[VAR_2] + 32); VAR_1->hpel[VAR_2][VAR_5] = VAR_1->hpel_base[VAR_2][VAR_5] + VAR_6*VAR_1->avframe->linesize[VAR_2] + 16; } if (!VAR_1->interpolated[VAR_2]) { VAR_0->diracdsp.dirac_hpel_filter(VAR_1->hpel[VAR_2][1], VAR_1->hpel[VAR_2][2],
VAR_1->hpel[VAR_2][3], VAR_1->hpel[VAR_2][0],
VAR_1->avframe->linesize[VAR_2], VAR_3, VAR_4); VAR_0->mpvencdsp.draw_edges(VAR_1->hpel[VAR_2][1], VAR_1->avframe->linesize[VAR_2], VAR_3, VAR_4, VAR_6, VAR_6, EDGE_TOP | EDGE_BOTTOM); VAR_0->mpvencdsp.draw_edges(VAR_1->hpel[VAR_2][2], VAR_1->avframe->linesize[VAR_2], VAR_3, VAR_4, VAR_6, VAR_6, EDGE_TOP | EDGE_BOTTOM); VAR_0->mpvencdsp.draw_edges(VAR_1->hpel[VAR_2][3], VAR_1->avframe->linesize[VAR_2], VAR_3, VAR_4, VAR_6, VAR_6, EDGE_TOP | EDGE_BOTTOM); } VAR_1->interpolated[VAR_2] = 1; }