100l in my 100l fix! :(

it's finally right now (i hope!)


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10028 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
rfelker 2003-04-30 18:24:04 +00:00
parent c36a1c25ba
commit 9d0b5a9eaf
1 changed files with 17 additions and 7 deletions

View File

@ -107,20 +107,30 @@ static void start_slice(struct vf_instance_s* vf, mp_image_t *mpi){
static void draw_slice(struct vf_instance_s* vf,
unsigned char** src, int* stride, int w,int h, int x, int y){
unsigned char *src2[3];
src2[0] = src[0] + vf->priv->crop_y*stride[0] + vf->priv->crop_x;
src2[0] = src[0];
if (vf->priv->dmpi->flags & MP_IMGFLAG_PLANAR) {
src2[1] = src[1] + (vf->priv->crop_y>>vf->priv->dmpi->chroma_y_shift)*stride[1]
+ (vf->priv->crop_x>>vf->priv->dmpi->chroma_x_shift);
src2[2] = src[2] + (vf->priv->crop_y>>vf->priv->dmpi->chroma_y_shift)*stride[2]
+ (vf->priv->crop_x>>vf->priv->dmpi->chroma_x_shift);
src2[1] = src[1];
src2[2] = src[2];
}
//mp_msg(MSGT_VFILTER, MSGL_V, "crop slice %d %d %d %d ->", w,h,x,y);
if ((x -= vf->priv->crop_x) < 0) {
w += x;
x = -x;
src2[0] += x;
if (vf->priv->dmpi->flags & MP_IMGFLAG_PLANAR) {
src2[1] += x>>vf->priv->dmpi->chroma_x_shift;
src2[2] += x>>vf->priv->dmpi->chroma_x_shift;
}
w -= x;
x = 0;
}
if ((y -= vf->priv->crop_y) < 0) {
h += y;
y = -y;
src2[0] += y*stride[0];
if (vf->priv->dmpi->flags & MP_IMGFLAG_PLANAR) {
src2[1] += (y>>vf->priv->dmpi->chroma_y_shift)*stride[1];
src2[2] += (y>>vf->priv->dmpi->chroma_y_shift)*stride[2];
}
h -= y;
y = 0;
}
if (x+w > vf->priv->crop_w) w = vf->priv->crop_w-x;