static void filter_mb(VP8Context *s, uint8_t *dst[3], VP8Macroblock *mb, int mb_x, int mb_y)

{

    int filter_level, inner_limit, hev_thresh, mbedge_lim, bedge_lim;



    filter_level_for_mb(s, mb, &filter_level, &inner_limit, &hev_thresh);

    if (!filter_level)

        return;



    mbedge_lim = 2*(filter_level+2) + inner_limit;

     bedge_lim = 2* filter_level    + inner_limit;



    if (mb_x) {

        s->vp8dsp.vp8_h_loop_filter16(dst[0], s->linesize,   mbedge_lim, inner_limit, hev_thresh);

        s->vp8dsp.vp8_h_loop_filter8 (dst[1], s->uvlinesize, mbedge_lim, inner_limit, hev_thresh);

        s->vp8dsp.vp8_h_loop_filter8 (dst[2], s->uvlinesize, mbedge_lim, inner_limit, hev_thresh);

    }



    if (!mb->skip || mb->mode == MODE_I4x4 || mb->mode == VP8_MVMODE_SPLIT) {

        s->vp8dsp.vp8_h_loop_filter16_inner(dst[0]+ 4, s->linesize,   bedge_lim, inner_limit, hev_thresh);

        s->vp8dsp.vp8_h_loop_filter16_inner(dst[0]+ 8, s->linesize,   bedge_lim, inner_limit, hev_thresh);

        s->vp8dsp.vp8_h_loop_filter16_inner(dst[0]+12, s->linesize,   bedge_lim, inner_limit, hev_thresh);

        s->vp8dsp.vp8_h_loop_filter8_inner (dst[1]+ 4, s->uvlinesize, bedge_lim, inner_limit, hev_thresh);

        s->vp8dsp.vp8_h_loop_filter8_inner (dst[2]+ 4, s->uvlinesize, bedge_lim, inner_limit, hev_thresh);

    }



    if (mb_y) {

        s->vp8dsp.vp8_v_loop_filter16(dst[0], s->linesize,   mbedge_lim, inner_limit, hev_thresh);

        s->vp8dsp.vp8_v_loop_filter8 (dst[1], s->uvlinesize, mbedge_lim, inner_limit, hev_thresh);

        s->vp8dsp.vp8_v_loop_filter8 (dst[2], s->uvlinesize, mbedge_lim, inner_limit, hev_thresh);

    }



    if (!mb->skip || mb->mode == MODE_I4x4 || mb->mode == VP8_MVMODE_SPLIT) {

        s->vp8dsp.vp8_v_loop_filter16_inner(dst[0]+ 4*s->linesize,   s->linesize,   bedge_lim, inner_limit, hev_thresh);

        s->vp8dsp.vp8_v_loop_filter16_inner(dst[0]+ 8*s->linesize,   s->linesize,   bedge_lim, inner_limit, hev_thresh);

        s->vp8dsp.vp8_v_loop_filter16_inner(dst[0]+12*s->linesize,   s->linesize,   bedge_lim, inner_limit, hev_thresh);

        s->vp8dsp.vp8_v_loop_filter8_inner (dst[1]+ 4*s->uvlinesize, s->uvlinesize, bedge_lim, inner_limit, hev_thresh);

        s->vp8dsp.vp8_v_loop_filter8_inner (dst[2]+ 4*s->uvlinesize, s->uvlinesize, bedge_lim, inner_limit, hev_thresh);

    }

}

static void filter_mb(VP8Context *s, uint8_t *dst[3], VP8Macroblock *mb, int mb_x, int mb_y)

{

    int filter_level, inner_limit, hev_thresh, mbedge_lim, bedge_lim;



    filter_level_for_mb(s, mb, &filter_level, &inner_limit, &hev_thresh);

    if (!filter_level)

        return;



    mbedge_lim = 2*(filter_level+2) + inner_limit;

     bedge_lim = 2* filter_level    + inner_limit;



    if (mb_x) {

        s->vp8dsp.vp8_h_loop_filter16(dst[0], s->linesize,   mbedge_lim, inner_limit, hev_thresh);

        s->vp8dsp.vp8_h_loop_filter8 (dst[1], s->uvlinesize, mbedge_lim, inner_limit, hev_thresh);

        s->vp8dsp.vp8_h_loop_filter8 (dst[2], s->uvlinesize, mbedge_lim, inner_limit, hev_thresh);

    }



    if (!mb->skip || mb->mode == MODE_I4x4 || mb->mode == VP8_MVMODE_SPLIT) {

        s->vp8dsp.vp8_h_loop_filter16_inner(dst[0]+ 4, s->linesize,   bedge_lim, inner_limit, hev_thresh);

        s->vp8dsp.vp8_h_loop_filter16_inner(dst[0]+ 8, s->linesize,   bedge_lim, inner_limit, hev_thresh);

        s->vp8dsp.vp8_h_loop_filter16_inner(dst[0]+12, s->linesize,   bedge_lim, inner_limit, hev_thresh);

        s->vp8dsp.vp8_h_loop_filter8_inner (dst[1]+ 4, s->uvlinesize, bedge_lim, inner_limit, hev_thresh);

        s->vp8dsp.vp8_h_loop_filter8_inner (dst[2]+ 4, s->uvlinesize, bedge_lim, inner_limit, hev_thresh);

    }



    if (mb_y) {

        s->vp8dsp.vp8_v_loop_filter16(dst[0], s->linesize,   mbedge_lim, inner_limit, hev_thresh);

        s->vp8dsp.vp8_v_loop_filter8 (dst[1], s->uvlinesize, mbedge_lim, inner_limit, hev_thresh);

        s->vp8dsp.vp8_v_loop_filter8 (dst[2], s->uvlinesize, mbedge_lim, inner_limit, hev_thresh);

    }



    if (!mb->skip || mb->mode == MODE_I4x4 || mb->mode == VP8_MVMODE_SPLIT) {

        s->vp8dsp.vp8_v_loop_filter16_inner(dst[0]+ 4*s->linesize,   s->linesize,   bedge_lim, inner_limit, hev_thresh);

        s->vp8dsp.vp8_v_loop_filter16_inner(dst[0]+ 8*s->linesize,   s->linesize,   bedge_lim, inner_limit, hev_thresh);

        s->vp8dsp.vp8_v_loop_filter16_inner(dst[0]+12*s->linesize,   s->linesize,   bedge_lim, inner_limit, hev_thresh);

        s->vp8dsp.vp8_v_loop_filter8_inner (dst[1]+ 4*s->uvlinesize, s->uvlinesize, bedge_lim, inner_limit, hev_thresh);

        s->vp8dsp.vp8_v_loop_filter8_inner (dst[2]+ 4*s->uvlinesize, s->uvlinesize, bedge_lim, inner_limit, hev_thresh);

    }

}

static void FUNC_0(VP8Context *VAR_0, uint8_t *VAR_1[3], VP8Macroblock *VAR_2, int VAR_3, int VAR_4)

{

    int VAR_5, VAR_6, VAR_7, VAR_8, VAR_9;



    filter_level_for_mb(VAR_0, VAR_2, &VAR_5, &VAR_6, &VAR_7);

    if (!VAR_5)

        return;



    VAR_8 = 2*(VAR_5+2) + VAR_6;

     VAR_9 = 2* VAR_5    + VAR_6;



    if (VAR_3) {

        VAR_0->vp8dsp.vp8_h_loop_filter16(VAR_1[0], VAR_0->linesize,   VAR_8, VAR_6, VAR_7);

        VAR_0->vp8dsp.vp8_h_loop_filter8 (VAR_1[1], VAR_0->uvlinesize, VAR_8, VAR_6, VAR_7);

        VAR_0->vp8dsp.vp8_h_loop_filter8 (VAR_1[2], VAR_0->uvlinesize, VAR_8, VAR_6, VAR_7);

    }



    if (!VAR_2->skip || VAR_2->mode == MODE_I4x4 || VAR_2->mode == VP8_MVMODE_SPLIT) {

        VAR_0->vp8dsp.vp8_h_loop_filter16_inner(VAR_1[0]+ 4, VAR_0->linesize,   VAR_9, VAR_6, VAR_7);

        VAR_0->vp8dsp.vp8_h_loop_filter16_inner(VAR_1[0]+ 8, VAR_0->linesize,   VAR_9, VAR_6, VAR_7);

        VAR_0->vp8dsp.vp8_h_loop_filter16_inner(VAR_1[0]+12, VAR_0->linesize,   VAR_9, VAR_6, VAR_7);

        VAR_0->vp8dsp.vp8_h_loop_filter8_inner (VAR_1[1]+ 4, VAR_0->uvlinesize, VAR_9, VAR_6, VAR_7);

        VAR_0->vp8dsp.vp8_h_loop_filter8_inner (VAR_1[2]+ 4, VAR_0->uvlinesize, VAR_9, VAR_6, VAR_7);

    }



    if (VAR_4) {

        VAR_0->vp8dsp.vp8_v_loop_filter16(VAR_1[0], VAR_0->linesize,   VAR_8, VAR_6, VAR_7);

        VAR_0->vp8dsp.vp8_v_loop_filter8 (VAR_1[1], VAR_0->uvlinesize, VAR_8, VAR_6, VAR_7);

        VAR_0->vp8dsp.vp8_v_loop_filter8 (VAR_1[2], VAR_0->uvlinesize, VAR_8, VAR_6, VAR_7);

    }



    if (!VAR_2->skip || VAR_2->mode == MODE_I4x4 || VAR_2->mode == VP8_MVMODE_SPLIT) {

        VAR_0->vp8dsp.vp8_v_loop_filter16_inner(VAR_1[0]+ 4*VAR_0->linesize,   VAR_0->linesize,   VAR_9, VAR_6, VAR_7);

        VAR_0->vp8dsp.vp8_v_loop_filter16_inner(VAR_1[0]+ 8*VAR_0->linesize,   VAR_0->linesize,   VAR_9, VAR_6, VAR_7);

        VAR_0->vp8dsp.vp8_v_loop_filter16_inner(VAR_1[0]+12*VAR_0->linesize,   VAR_0->linesize,   VAR_9, VAR_6, VAR_7);

        VAR_0->vp8dsp.vp8_v_loop_filter8_inner (VAR_1[1]+ 4*VAR_0->uvlinesize, VAR_0->uvlinesize, VAR_9, VAR_6, VAR_7);

        VAR_0->vp8dsp.vp8_v_loop_filter8_inner (VAR_1[2]+ 4*VAR_0->uvlinesize, VAR_0->uvlinesize, VAR_9, VAR_6, VAR_7);

    }

}

static void FUNC_0(VP8Context *VAR_0, uint8_t *VAR_1[3], VP8Macroblock *VAR_2, int VAR_3, int VAR_4)
{ int VAR_5, VAR_6, VAR_7, VAR_8, VAR_9; filter_level_for_mb(VAR_0, VAR_2, &VAR_5, &VAR_6, &VAR_7); if (!VAR_5)
return; VAR_8 = 2*(VAR_5+2) + VAR_6; VAR_9 = 2* VAR_5    + VAR_6; if (VAR_3) { VAR_0->vp8dsp.vp8_h_loop_filter16(VAR_1[0], VAR_0->linesize,   VAR_8, VAR_6, VAR_7); VAR_0->vp8dsp.vp8_h_loop_filter8 (VAR_1[1], VAR_0->uvlinesize, VAR_8, VAR_6, VAR_7); VAR_0->vp8dsp.vp8_h_loop_filter8 (VAR_1[2], VAR_0->uvlinesize, VAR_8, VAR_6, VAR_7); } if (!VAR_2->skip || VAR_2->mode == MODE_I4x4 || VAR_2->mode == VP8_MVMODE_SPLIT) { VAR_0->vp8dsp.vp8_h_loop_filter16_inner(VAR_1[0]+ 4, VAR_0->linesize,   VAR_9, VAR_6, VAR_7); VAR_0->vp8dsp.vp8_h_loop_filter16_inner(VAR_1[0]+ 8, VAR_0->linesize,   VAR_9, VAR_6, VAR_7); VAR_0->vp8dsp.vp8_h_loop_filter16_inner(VAR_1[0]+12, VAR_0->linesize,   VAR_9, VAR_6, VAR_7); VAR_0->vp8dsp.vp8_h_loop_filter8_inner (VAR_1[1]+ 4, VAR_0->uvlinesize, VAR_9, VAR_6, VAR_7); VAR_0->vp8dsp.vp8_h_loop_filter8_inner (VAR_1[2]+ 4, VAR_0->uvlinesize, VAR_9, VAR_6, VAR_7); } if (VAR_4) { VAR_0->vp8dsp.vp8_v_loop_filter16(VAR_1[0], VAR_0->linesize,   VAR_8, VAR_6, VAR_7); VAR_0->vp8dsp.vp8_v_loop_filter8 (VAR_1[1], VAR_0->uvlinesize, VAR_8, VAR_6, VAR_7); VAR_0->vp8dsp.vp8_v_loop_filter8 (VAR_1[2], VAR_0->uvlinesize, VAR_8, VAR_6, VAR_7); } if (!VAR_2->skip || VAR_2->mode == MODE_I4x4 || VAR_2->mode == VP8_MVMODE_SPLIT) { VAR_0->vp8dsp.vp8_v_loop_filter16_inner(VAR_1[0]+ 4*VAR_0->linesize,   VAR_0->linesize,   VAR_9, VAR_6, VAR_7); VAR_0->vp8dsp.vp8_v_loop_filter16_inner(VAR_1[0]+ 8*VAR_0->linesize,   VAR_0->linesize,   VAR_9, VAR_6, VAR_7); VAR_0->vp8dsp.vp8_v_loop_filter16_inner(VAR_1[0]+12*VAR_0->linesize,   VAR_0->linesize,   VAR_9, VAR_6, VAR_7); VAR_0->vp8dsp.vp8_v_loop_filter8_inner (VAR_1[1]+ 4*VAR_0->uvlinesize, VAR_0->uvlinesize, VAR_9, VAR_6, VAR_7); VAR_0->vp8dsp.vp8_v_loop_filter8_inner (VAR_1[2]+ 4*VAR_0->uvlinesize, VAR_0->uvlinesize, VAR_9, VAR_6, VAR_7); } }