static void vc1_put_signed_blocks_clamped(VC1Context *v)

{

    MpegEncContext *s = &v->s;

    int topleft_mb_pos, top_mb_pos;

    int stride_y, fieldtx;

    int v_dist;



    /* The put pixels loop is always one MB row behind the decoding loop,

     * because we can only put pixels when overlap filtering is done, and

     * for filtering of the bottom edge of a MB, we need the next MB row

     * present as well.

     * Within the row, the put pixels loop is also one MB col behind the

     * decoding loop. The reason for this is again, because for filtering

     * of the right MB edge, we need the next MB present. */

    if (!s->first_slice_line) {

        if (s->mb_x) {

            topleft_mb_pos = (s->mb_y - 1) * s->mb_stride + s->mb_x - 1;

            fieldtx        = v->fieldtx_plane[topleft_mb_pos];

            stride_y       = s->linesize << fieldtx;

            v_dist         = (16 - fieldtx) >> (fieldtx == 0);

            s->dsp.put_signed_pixels_clamped(v->block[v->topleft_blk_idx][0],

                                             s->dest[0] - 16 * s->linesize - 16,

                                             stride_y);

            s->dsp.put_signed_pixels_clamped(v->block[v->topleft_blk_idx][1],

                                             s->dest[0] - 16 * s->linesize - 8,

                                             stride_y);

            s->dsp.put_signed_pixels_clamped(v->block[v->topleft_blk_idx][2],

                                             s->dest[0] - v_dist * s->linesize - 16,

                                             stride_y);

            s->dsp.put_signed_pixels_clamped(v->block[v->topleft_blk_idx][3],

                                             s->dest[0] - v_dist * s->linesize - 8,

                                             stride_y);

            s->dsp.put_signed_pixels_clamped(v->block[v->topleft_blk_idx][4],

                                             s->dest[1] - 8 * s->uvlinesize - 8,

                                             s->uvlinesize);

            s->dsp.put_signed_pixels_clamped(v->block[v->topleft_blk_idx][5],

                                             s->dest[2] - 8 * s->uvlinesize - 8,

                                             s->uvlinesize);

        }

        if (s->mb_x == s->mb_width - 1) {

            top_mb_pos = (s->mb_y - 1) * s->mb_stride + s->mb_x;

            fieldtx    = v->fieldtx_plane[top_mb_pos];

            stride_y   = s->linesize << fieldtx;

            v_dist     = fieldtx ? 15 : 8;

            s->dsp.put_signed_pixels_clamped(v->block[v->top_blk_idx][0],

                                             s->dest[0] - 16 * s->linesize,

                                             stride_y);

            s->dsp.put_signed_pixels_clamped(v->block[v->top_blk_idx][1],

                                             s->dest[0] - 16 * s->linesize + 8,

                                             stride_y);

            s->dsp.put_signed_pixels_clamped(v->block[v->top_blk_idx][2],

                                             s->dest[0] - v_dist * s->linesize,

                                             stride_y);

            s->dsp.put_signed_pixels_clamped(v->block[v->top_blk_idx][3],

                                             s->dest[0] - v_dist * s->linesize + 8,

                                             stride_y);

            s->dsp.put_signed_pixels_clamped(v->block[v->top_blk_idx][4],

                                             s->dest[1] - 8 * s->uvlinesize,

                                             s->uvlinesize);

            s->dsp.put_signed_pixels_clamped(v->block[v->top_blk_idx][5],

                                             s->dest[2] - 8 * s->uvlinesize,

                                             s->uvlinesize);

        }

    }



#define inc_blk_idx(idx) do { \

        idx++; \

        if (idx >= v->n_allocated_blks) \

            idx = 0; \

    } while (0)



    inc_blk_idx(v->topleft_blk_idx);

    inc_blk_idx(v->top_blk_idx);

    inc_blk_idx(v->left_blk_idx);

    inc_blk_idx(v->cur_blk_idx);

}

static void vc1_put_signed_blocks_clamped(VC1Context *v)

{

    MpegEncContext *s = &v->s;

    int topleft_mb_pos, top_mb_pos;

    int stride_y, fieldtx;

    int v_dist;



    













    if (!s->first_slice_line) {

        if (s->mb_x) {

            topleft_mb_pos = (s->mb_y - 1) * s->mb_stride + s->mb_x - 1;

            fieldtx        = v->fieldtx_plane[topleft_mb_pos];

            stride_y       = s->linesize << fieldtx;

            v_dist         = (16 - fieldtx) >> (fieldtx == 0);

            s->dsp.put_signed_pixels_clamped(v->block[v->topleft_blk_idx][0],

                                             s->dest[0] - 16 * s->linesize - 16,

                                             stride_y);

            s->dsp.put_signed_pixels_clamped(v->block[v->topleft_blk_idx][1],

                                             s->dest[0] - 16 * s->linesize - 8,

                                             stride_y);

            s->dsp.put_signed_pixels_clamped(v->block[v->topleft_blk_idx][2],

                                             s->dest[0] - v_dist * s->linesize - 16,

                                             stride_y);

            s->dsp.put_signed_pixels_clamped(v->block[v->topleft_blk_idx][3],

                                             s->dest[0] - v_dist * s->linesize - 8,

                                             stride_y);

            s->dsp.put_signed_pixels_clamped(v->block[v->topleft_blk_idx][4],

                                             s->dest[1] - 8 * s->uvlinesize - 8,

                                             s->uvlinesize);

            s->dsp.put_signed_pixels_clamped(v->block[v->topleft_blk_idx][5],

                                             s->dest[2] - 8 * s->uvlinesize - 8,

                                             s->uvlinesize);

        }

        if (s->mb_x == s->mb_width - 1) {

            top_mb_pos = (s->mb_y - 1) * s->mb_stride + s->mb_x;

            fieldtx    = v->fieldtx_plane[top_mb_pos];

            stride_y   = s->linesize << fieldtx;

            v_dist     = fieldtx ? 15 : 8;

            s->dsp.put_signed_pixels_clamped(v->block[v->top_blk_idx][0],

                                             s->dest[0] - 16 * s->linesize,

                                             stride_y);

            s->dsp.put_signed_pixels_clamped(v->block[v->top_blk_idx][1],

                                             s->dest[0] - 16 * s->linesize + 8,

                                             stride_y);

            s->dsp.put_signed_pixels_clamped(v->block[v->top_blk_idx][2],

                                             s->dest[0] - v_dist * s->linesize,

                                             stride_y);

            s->dsp.put_signed_pixels_clamped(v->block[v->top_blk_idx][3],

                                             s->dest[0] - v_dist * s->linesize + 8,

                                             stride_y);

            s->dsp.put_signed_pixels_clamped(v->block[v->top_blk_idx][4],

                                             s->dest[1] - 8 * s->uvlinesize,

                                             s->uvlinesize);

            s->dsp.put_signed_pixels_clamped(v->block[v->top_blk_idx][5],

                                             s->dest[2] - 8 * s->uvlinesize,

                                             s->uvlinesize);

        }

    }



#define inc_blk_idx(idx) do { \

        idx++; \

        if (idx >= v->n_allocated_blks) \

            idx = 0; \

    } while (0)



    inc_blk_idx(v->topleft_blk_idx);

    inc_blk_idx(v->top_blk_idx);

    inc_blk_idx(v->left_blk_idx);

    inc_blk_idx(v->cur_blk_idx);

}

static void FUNC_0(VC1Context *VAR_0)

{

    MpegEncContext *s = &VAR_0->s;

    int VAR_1, VAR_2;

    int VAR_3, VAR_4;

    int VAR_5;



    













    if (!s->first_slice_line) {

        if (s->mb_x) {

            VAR_1 = (s->mb_y - 1) * s->mb_stride + s->mb_x - 1;

            VAR_4        = VAR_0->fieldtx_plane[VAR_1];

            VAR_3       = s->linesize << VAR_4;

            VAR_5         = (16 - VAR_4) >> (VAR_4 == 0);

            s->dsp.put_signed_pixels_clamped(VAR_0->block[VAR_0->topleft_blk_idx][0],

                                             s->dest[0] - 16 * s->linesize - 16,

                                             VAR_3);

            s->dsp.put_signed_pixels_clamped(VAR_0->block[VAR_0->topleft_blk_idx][1],

                                             s->dest[0] - 16 * s->linesize - 8,

                                             VAR_3);

            s->dsp.put_signed_pixels_clamped(VAR_0->block[VAR_0->topleft_blk_idx][2],

                                             s->dest[0] - VAR_5 * s->linesize - 16,

                                             VAR_3);

            s->dsp.put_signed_pixels_clamped(VAR_0->block[VAR_0->topleft_blk_idx][3],

                                             s->dest[0] - VAR_5 * s->linesize - 8,

                                             VAR_3);

            s->dsp.put_signed_pixels_clamped(VAR_0->block[VAR_0->topleft_blk_idx][4],

                                             s->dest[1] - 8 * s->uvlinesize - 8,

                                             s->uvlinesize);

            s->dsp.put_signed_pixels_clamped(VAR_0->block[VAR_0->topleft_blk_idx][5],

                                             s->dest[2] - 8 * s->uvlinesize - 8,

                                             s->uvlinesize);

        }

        if (s->mb_x == s->mb_width - 1) {

            VAR_2 = (s->mb_y - 1) * s->mb_stride + s->mb_x;

            VAR_4    = VAR_0->fieldtx_plane[VAR_2];

            VAR_3   = s->linesize << VAR_4;

            VAR_5     = VAR_4 ? 15 : 8;

            s->dsp.put_signed_pixels_clamped(VAR_0->block[VAR_0->top_blk_idx][0],

                                             s->dest[0] - 16 * s->linesize,

                                             VAR_3);

            s->dsp.put_signed_pixels_clamped(VAR_0->block[VAR_0->top_blk_idx][1],

                                             s->dest[0] - 16 * s->linesize + 8,

                                             VAR_3);

            s->dsp.put_signed_pixels_clamped(VAR_0->block[VAR_0->top_blk_idx][2],

                                             s->dest[0] - VAR_5 * s->linesize,

                                             VAR_3);

            s->dsp.put_signed_pixels_clamped(VAR_0->block[VAR_0->top_blk_idx][3],

                                             s->dest[0] - VAR_5 * s->linesize + 8,

                                             VAR_3);

            s->dsp.put_signed_pixels_clamped(VAR_0->block[VAR_0->top_blk_idx][4],

                                             s->dest[1] - 8 * s->uvlinesize,

                                             s->uvlinesize);

            s->dsp.put_signed_pixels_clamped(VAR_0->block[VAR_0->top_blk_idx][5],

                                             s->dest[2] - 8 * s->uvlinesize,

                                             s->uvlinesize);

        }

    }



#define inc_blk_idx(idx) do { \

        idx++; \

        if (idx >= VAR_0->n_allocated_blks) \

            idx = 0; \

    } while (0)



    inc_blk_idx(VAR_0->topleft_blk_idx);

    inc_blk_idx(VAR_0->top_blk_idx);

    inc_blk_idx(VAR_0->left_blk_idx);

    inc_blk_idx(VAR_0->cur_blk_idx);

}

static void FUNC_0(VC1Context *VAR_0)
{ MpegEncContext *s = &VAR_0->s; int VAR_1, VAR_2; int VAR_3, VAR_4; int VAR_5; if (!s->first_slice_line) { if (s->mb_x) { VAR_1 = (s->mb_y - 1) * s->mb_stride + s->mb_x - 1; VAR_4        = VAR_0->fieldtx_plane[VAR_1]; VAR_3       = s->linesize << VAR_4; VAR_5         = (16 - VAR_4) >> (VAR_4 == 0); s->dsp.put_signed_pixels_clamped(VAR_0->block[VAR_0->topleft_blk_idx][0],
s->dest[0] - 16 * s->linesize - 16,
VAR_3); s->dsp.put_signed_pixels_clamped(VAR_0->block[VAR_0->topleft_blk_idx][1],
s->dest[0] - 16 * s->linesize - 8,
VAR_3); s->dsp.put_signed_pixels_clamped(VAR_0->block[VAR_0->topleft_blk_idx][2],
s->dest[0] - VAR_5 * s->linesize - 16,
VAR_3); s->dsp.put_signed_pixels_clamped(VAR_0->block[VAR_0->topleft_blk_idx][3],
s->dest[0] - VAR_5 * s->linesize - 8,
VAR_3); s->dsp.put_signed_pixels_clamped(VAR_0->block[VAR_0->topleft_blk_idx][4],
s->dest[1] - 8 * s->uvlinesize - 8,
s->uvlinesize); s->dsp.put_signed_pixels_clamped(VAR_0->block[VAR_0->topleft_blk_idx][5],
s->dest[2] - 8 * s->uvlinesize - 8,
s->uvlinesize); } if (s->mb_x == s->mb_width - 1) { VAR_2 = (s->mb_y - 1) * s->mb_stride + s->mb_x; VAR_4    = VAR_0->fieldtx_plane[VAR_2]; VAR_3   = s->linesize << VAR_4; VAR_5     = VAR_4 ? 15 : 8; s->dsp.put_signed_pixels_clamped(VAR_0->block[VAR_0->top_blk_idx][0],
s->dest[0] - 16 * s->linesize,
VAR_3); s->dsp.put_signed_pixels_clamped(VAR_0->block[VAR_0->top_blk_idx][1],
s->dest[0] - 16 * s->linesize + 8,
VAR_3); s->dsp.put_signed_pixels_clamped(VAR_0->block[VAR_0->top_blk_idx][2],
s->dest[0] - VAR_5 * s->linesize,
VAR_3); s->dsp.put_signed_pixels_clamped(VAR_0->block[VAR_0->top_blk_idx][3],
s->dest[0] - VAR_5 * s->linesize + 8,
VAR_3); s->dsp.put_signed_pixels_clamped(VAR_0->block[VAR_0->top_blk_idx][4],
s->dest[1] - 8 * s->uvlinesize,
s->uvlinesize); s->dsp.put_signed_pixels_clamped(VAR_0->block[VAR_0->top_blk_idx][5],
s->dest[2] - 8 * s->uvlinesize,
s->uvlinesize); } } #define inc_blk_idx(idx) do { \ idx++; \ if (idx >= VAR_0->n_allocated_blks) \
idx = 0; \ } while (0) inc_blk_idx(VAR_0->topleft_blk_idx); inc_blk_idx(VAR_0->top_blk_idx); inc_blk_idx(VAR_0->left_blk_idx); inc_blk_idx(VAR_0->cur_blk_idx); }