summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
authorClément Bœsch <ubitux@gmail.com>2011-04-28 09:36:00 +0200
committerUoti Urpala <uau@mplayer2.org>2011-05-02 00:46:48 +0300
commit6506d4ad84eac67e69437def2c8ee69fcfc14ed5 (patch)
tree255e7f58b809a9bc7377047533cfb19399ce4ffd /libmpcodecs
parent7e65428712beacd416dc3410c52f22ebfd3b4c53 (diff)
downloadmpv-6506d4ad84eac67e69437def2c8ee69fcfc14ed5.tar.bz2
mpv-6506d4ad84eac67e69437def2c8ee69fcfc14ed5.tar.xz
cleanup: remove more warnings
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/vd_xvid4.c2
-rw-r--r--libmpcodecs/vf_bmovl.c7
-rw-r--r--libmpcodecs/vf_divtc.c2
-rw-r--r--libmpcodecs/vf_sab.c29
-rw-r--r--libmpcodecs/vf_smartblur.c29
-rw-r--r--libmpcodecs/vf_tfields.c22
6 files changed, 15 insertions, 76 deletions
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) && p<e;)
+ for(shift=0, e=p+w; (size_t)p&(sizeof(wsum_t)-1) && p<e;)
sum^=*p++<<(shift=(shift-8)&31);
for(wsum=0, e2=e-sizeof(wsum_t)+1; p<e2; p+=sizeof(wsum_t))
diff --git a/libmpcodecs/vf_sab.c b/libmpcodecs/vf_sab.c
index 7ab76ffbe9..7f05af9249 100644
--- a/libmpcodecs/vf_sab.c
+++ b/libmpcodecs/vf_sab.c
@@ -63,33 +63,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){
int stride= (width+7)&~7;
SwsVector *vec;
@@ -143,7 +116,7 @@ static int config(struct vf_instance *vf,
//__asm__ volatile("emms\n\t");
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_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;
@@ -361,19 +361,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++) {
dmpi = vf_get_image(vf->next, mpi->imgfmt,
@@ -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,