/* called when all pixels up to row y are complete  */
static void vp3_draw_horiz_band(Vp3DecodeContext *s, int y)
/* called when all pixels up to row y are complete  */
static void vp3_draw_horiz_band(Vp3DecodeContext *s, int y)
{
    int h, cy;
    int offset[4];
    if(s->avctx->draw_horiz_band==NULL)
        return;
    h= y - s->last_slice_end;
    y -= h;
    if (!s->flipped_image) {
        if (y == 0)
            h -= s->height - s->avctx->height;
        y = s->height - y - h;
    }
    cy = y >> 1;
    offset[0] = s->current_frame.linesize[0]*y;
    offset[1] = s->current_frame.linesize[1]*cy;
    offset[2] = s->current_frame.linesize[2]*cy;
    offset[3] = 0;
    emms_c();
    s->avctx->draw_horiz_band(s->avctx, &s->current_frame, offset, y, 3, h);
    s->last_slice_end= y + h;
}