From 6506d4ad84eac67e69437def2c8ee69fcfc14ed5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= Date: Thu, 28 Apr 2011 09:36:00 +0200 Subject: cleanup: remove more warnings --- libmpcodecs/vd_xvid4.c | 2 +- libmpcodecs/vf_bmovl.c | 7 +++---- libmpcodecs/vf_divtc.c | 2 +- libmpcodecs/vf_sab.c | 29 +---------------------------- libmpcodecs/vf_smartblur.c | 29 +---------------------------- libmpcodecs/vf_tfields.c | 22 ++++++++-------------- 6 files changed, 15 insertions(+), 76 deletions(-) (limited to 'libmpcodecs') diff --git a/libmpcodecs/vd_xvid4.c b/libmpcodecs/vd_xvid4.c index 779baef105..c5e25cd1d6 100644 --- a/libmpcodecs/vd_xvid4.c +++ b/libmpcodecs/vd_xvid4.c @@ -287,7 +287,7 @@ static mp_image_t* decode(sh_video_t *sh, void* data, int len, int flags) } /* Don't forget to update buffer position and buffer length */ - dec.bitstream += consumed; + dec.bitstream = (char *)dec.bitstream + consumed; dec.length -= consumed; } while ((stats.type == XVID_TYPE_VOL || stats.type == XVID_TYPE_NOTHING) && dec.length > 0); diff --git a/libmpcodecs/vf_bmovl.c b/libmpcodecs/vf_bmovl.c index b6b9940832..da5dc97f50 100644 --- a/libmpcodecs/vf_bmovl.c +++ b/libmpcodecs/vf_bmovl.c @@ -219,7 +219,6 @@ put_image(struct vf_instance *vf, mp_image_t* mpi, double pts){ int have, got, want; int xpos=0, ypos=0, pos=0; unsigned char red=0, green=0, blue=0; - int alpha; mp_image_t* dmpi; dmpi = vf_get_image(vf->next, mpi->imgfmt, MP_IMGTYPE_TEMP, @@ -349,6 +348,8 @@ put_image(struct vf_instance *vf, mp_image_t* mpi, double pts){ for( buf_y=0 ; (buf_y < imgh) && (buf_y < (vf->priv->h-imgy)) ; buf_y++ ) { for( buf_x=0 ; (buf_x < (imgw*pxsz)) && (buf_x < ((vf->priv->w+imgx)*pxsz)) ; buf_x += pxsz ) { + int alpha = 0xff; + if(command & IS_RAWIMG) buf_pos = (buf_y * imgw * pxsz) + buf_x; pos = ((buf_y+imgy) * vf->priv->w) + ((buf_x/pxsz)+imgx); @@ -369,13 +370,11 @@ put_image(struct vf_instance *vf, mp_image_t* mpi, double pts){ red = buffer[buf_pos+0]; green = buffer[buf_pos+1]; blue = buffer[buf_pos+2]; - alpha = 0xFF; break; case IMG_BGR24: blue = buffer[buf_pos+0]; green = buffer[buf_pos+1]; red = buffer[buf_pos+2]; - alpha = 0xFF; break; case CMD_ALPHA: vf->priv->bitmap.a[pos] = INRANGE((vf->priv->bitmap.oa[pos]+imgalpha),0,255); @@ -423,7 +422,7 @@ put_image(struct vf_instance *vf, mp_image_t* mpi, double pts){ for ( xpos=vf->priv->x1 ; xpos < vf->priv->x2 ; xpos++ ) { pos = (ypos * dmpi->stride[0]) + xpos; - alpha = vf->priv->bitmap.a[pos]; + int alpha = vf->priv->bitmap.a[pos]; if (alpha == 0) continue; // Completly transparent pixel diff --git a/libmpcodecs/vf_divtc.c b/libmpcodecs/vf_divtc.c index b3d84d200f..3a4f2169ab 100644 --- a/libmpcodecs/vf_divtc.c +++ b/libmpcodecs/vf_divtc.c @@ -156,7 +156,7 @@ static unsigned int checksum_plane(unsigned char *p, unsigned char *z, for(sum=0; h; h--, p+=s-w) { - for(shift=0, e=p+w; (int)p&(sizeof(wsum_t)-1) && ppriv->luma, width, height); - getSubSampleFactors(&sw, &sh, outfmt); + mp_get_chroma_shift(outfmt, &sw, &sh); allocStuff(&vf->priv->chroma, width>>sw, height>>sh); return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt); diff --git a/libmpcodecs/vf_smartblur.c b/libmpcodecs/vf_smartblur.c index f0b7f36b3c..4083dfbda0 100644 --- a/libmpcodecs/vf_smartblur.c +++ b/libmpcodecs/vf_smartblur.c @@ -50,33 +50,6 @@ struct vf_priv_s { /***************************************************************************/ -//FIXME stupid code duplication -static void getSubSampleFactors(int *h, int *v, int format){ - switch(format){ - case IMGFMT_YV12: - case IMGFMT_I420: - *h=1; - *v=1; - break; - case IMGFMT_YVU9: - *h=2; - *v=2; - break; - case IMGFMT_444P: - *h=0; - *v=0; - break; - case IMGFMT_422P: - *h=1; - *v=0; - break; - case IMGFMT_411P: - *h=2; - *v=0; - break; - } -} - static int allocStuff(FilterParam *f, int width, int height){ SwsVector *vec; SwsFilter swsF; @@ -102,7 +75,7 @@ static int config(struct vf_instance *vf, allocStuff(&vf->priv->luma, width, height); - getSubSampleFactors(&sw, &sh, outfmt); + mp_get_chroma_shift(outfmt, &sw, &sh); allocStuff(&vf->priv->chroma, width>>sw, height>>sh); return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt); diff --git a/libmpcodecs/vf_tfields.c b/libmpcodecs/vf_tfields.c index 52cd0b5684..4823ef463c 100644 --- a/libmpcodecs/vf_tfields.c +++ b/libmpcodecs/vf_tfields.c @@ -343,7 +343,7 @@ static int continue_buffered_image(struct vf_instance *vf) mp_image_t *mpi = vf->priv->buffered_mpi; int ret=0; mp_image_t *dmpi; - void (*qpel)(unsigned char *, unsigned char *, int, int, int, int, int); + void (*qpel)(unsigned char *, unsigned char *, int, int, int, int, int) = NULL; int bpp=1; int tff; @@ -360,19 +360,6 @@ static int continue_buffered_image(struct vf_instance *vf) } else tff = (vf->priv->parity&1)^1; - switch (vf->priv->mode) { - case 2: - qpel = qpel_li; - break; - case 3: - // TODO: add 3tap filter - qpel = qpel_4tap; - break; - case 4: - qpel = qpel_4tap; - break; - } - switch (vf->priv->mode) { case 0: for (; i<2; i++) { @@ -419,8 +406,15 @@ static int continue_buffered_image(struct vf_instance *vf) } break; case 2: + qpel = qpel_li; case 3: + // TODO: add 3tap filter + if (!qpel) + qpel = qpel_4tap; case 4: + if (!qpel) + qpel = qpel_4tap; + for (; i<2; i++) { dmpi = vf_get_image(vf->next, mpi->imgfmt, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, -- cgit v1.2.3