static void filter_edges_16bit(void *dst1, void *prev1, void *cur1, void *next1,

                               int w, int prefs, int mrefs, int parity, int mode)

{

    uint16_t *dst  = dst1;

    uint16_t *prev = prev1;

    uint16_t *cur  = cur1;

    uint16_t *next = next1;

    int x;

    uint16_t *prev2 = parity ? prev : cur ;

    uint16_t *next2 = parity ? cur  : next;

    mrefs /= 2;

    prefs /= 2;



    FILTER(0, 3, 0)



    dst   = (uint16_t*)dst1  + w - 3;

    prev  = (uint16_t*)prev1 + w - 3;

    cur   = (uint16_t*)cur1  + w - 3;

    next  = (uint16_t*)next1 + w - 3;

    prev2 = (uint16_t*)(parity ? prev : cur);

    next2 = (uint16_t*)(parity ? cur  : next);



    FILTER(w - 3, w, 0)

}

static void filter_edges_16bit(void *dst1, void *prev1, void *cur1, void *next1,

                               int w, int prefs, int mrefs, int parity, int mode)

{

    uint16_t *dst  = dst1;

    uint16_t *prev = prev1;

    uint16_t *cur  = cur1;

    uint16_t *next = next1;

    int x;

    uint16_t *prev2 = parity ? prev : cur ;

    uint16_t *next2 = parity ? cur  : next;

    mrefs /= 2;

    prefs /= 2;



    FILTER(0, 3, 0)



    dst   = (uint16_t*)dst1  + w - 3;

    prev  = (uint16_t*)prev1 + w - 3;

    cur   = (uint16_t*)cur1  + w - 3;

    next  = (uint16_t*)next1 + w - 3;

    prev2 = (uint16_t*)(parity ? prev : cur);

    next2 = (uint16_t*)(parity ? cur  : next);



    FILTER(w - 3, w, 0)

}

    dst   = (uint16_t*)dst1  + w - 3;     prev  = (uint16_t*)prev1 + w - 3;     cur   = (uint16_t*)cur1  + w - 3;     next  = (uint16_t*)next1 + w - 3;
static void FUNC_0(void *VAR_0, void *VAR_1, void *VAR_2, void *VAR_3,

                               int VAR_4, int VAR_5, int VAR_6, int VAR_7, int VAR_8)

{

    uint16_t *dst  = VAR_0;

    uint16_t *prev = VAR_1;

    uint16_t *cur  = VAR_2;

    uint16_t *next = VAR_3;

    int VAR_9;

    uint16_t *prev2 = VAR_7 ? prev : cur ;

    uint16_t *next2 = VAR_7 ? cur  : next;

    VAR_6 /= 2;

    VAR_5 /= 2;



    FILTER(0, 3, 0)



    dst   = (uint16_t*)VAR_0  + VAR_4 - 3;

    prev  = (uint16_t*)VAR_1 + VAR_4 - 3;

    cur   = (uint16_t*)VAR_2  + VAR_4 - 3;

    next  = (uint16_t*)VAR_3 + VAR_4 - 3;

    prev2 = (uint16_t*)(VAR_7 ? prev : cur);

    next2 = (uint16_t*)(VAR_7 ? cur  : next);



    FILTER(VAR_4 - 3, VAR_4, 0)

}

static void FUNC_0(void *VAR_0, void *VAR_1, void *VAR_2, void *VAR_3,
int VAR_4, int VAR_5, int VAR_6, int VAR_7, int VAR_8)
{ uint16_t *dst  = VAR_0; uint16_t *prev = VAR_1; uint16_t *cur  = VAR_2; uint16_t *next = VAR_3; int VAR_9; uint16_t *prev2 = VAR_7 ? prev : cur ; uint16_t *next2 = VAR_7 ? cur  : next; VAR_6 /= 2; VAR_5 /= 2; FILTER(0, 3, 0)
dst   = (uint16_t*)VAR_0  + VAR_4 - 3; prev  = (uint16_t*)VAR_1 + VAR_4 - 3; cur   = (uint16_t*)VAR_2  + VAR_4 - 3; next  = (uint16_t*)VAR_3 + VAR_4 - 3; prev2 = (uint16_t*)(VAR_7 ? prev : cur); next2 = (uint16_t*)(VAR_7 ? cur  : next); FILTER(VAR_4 - 3, VAR_4, 0)
}