static int ivi_mc(ivi_mc_func mc, int16_t *buf, const int16_t *ref_buf,

                  int offs, int mv_x, int mv_y, uint32_t pitch,

                  int mc_type)

{

    int ref_offs = offs + mv_y * pitch + mv_x;



    if (offs < 0 || ref_offs < 0 || !ref_buf)

        return AVERROR_INVALIDDATA;



    mc(buf + offs, ref_buf + ref_offs, pitch, mc_type);



    return 0;

}

static int ivi_mc(ivi_mc_func mc, int16_t *buf, const int16_t *ref_buf,

                  int offs, int mv_x, int mv_y, uint32_t pitch,

                  int mc_type)

{

    int ref_offs = offs + mv_y * pitch + mv_x;



    if (offs < 0 || ref_offs < 0 || !ref_buf)

        return AVERROR_INVALIDDATA;



    mc(buf + offs, ref_buf + ref_offs, pitch, mc_type);



    return 0;

}

static int FUNC_0(ivi_mc_func VAR_0, int16_t *VAR_1, const int16_t *VAR_2,

                  int VAR_3, int VAR_4, int VAR_5, uint32_t VAR_6,

                  int VAR_7)

{

    int VAR_8 = VAR_3 + VAR_5 * VAR_6 + VAR_4;



    if (VAR_3 < 0 || VAR_8 < 0 || !VAR_2)

        return AVERROR_INVALIDDATA;



    VAR_0(VAR_1 + VAR_3, VAR_2 + VAR_8, VAR_6, VAR_7);



    return 0;

}

static int FUNC_0(ivi_mc_func VAR_0, int16_t *VAR_1, const int16_t *VAR_2,
int VAR_3, int VAR_4, int VAR_5, uint32_t VAR_6,
int VAR_7)
{ int VAR_8 = VAR_3 + VAR_5 * VAR_6 + VAR_4; if (VAR_3 < 0 || VAR_8 < 0 || !VAR_2)
return AVERROR_INVALIDDATA; VAR_0(VAR_1 + VAR_3, VAR_2 + VAR_8, VAR_6, VAR_7); return 0; }