[Mplayer-cvslog] CVS: main/libmpcodecs vd_vfw.c,1.7,1.8 vf_palette.c,1.2,1.3
Arpi of Ize
arpi at mplayerhq.hu
Thu May 30 02:26:26 CEST 2002
Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var/tmp.root/cvs-serv23543
Modified Files:
vd_vfw.c vf_palette.c
Log Message:
grayscaled palette support
Index: vd_vfw.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vd_vfw.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- vd_vfw.c 16 May 2002 23:24:47 -0000 1.7
+++ vd_vfw.c 30 May 2002 00:26:23 -0000 1.8
@@ -94,7 +94,11 @@
if(mpi->imgfmt==IMGFMT_RGB8 || mpi->imgfmt==IMGFMT_BGR8){
// export palette:
- mpi->planes[1]=((unsigned char*)&sh->o_bih)+40;
+// FIXME: sh->o_bih is cutted down to 40 bytes!!!
+// if(sh->o_bih->biSize>40)
+// mpi->planes[1]=((unsigned char*)&sh->o_bih)+40;
+// else
+ mpi->planes[1]=NULL;
}
return mpi;
Index: vf_palette.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vf_palette.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- vf_palette.c 25 May 2002 13:22:28 -0000 1.2
+++ vf_palette.c 30 May 2002 00:26:23 -0000 1.3
@@ -29,6 +29,8 @@
0
};
+static unsigned int gray_pal[256];
+
static unsigned int find_best(struct vf_instance_s* vf, unsigned int fmt){
unsigned int best=0;
int ret;
@@ -73,6 +75,8 @@
MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
mpi->w, mpi->h);
+ if(!mpi->planes[1]) mpi->planes[1]=gray_pal;
+
if(mpi->w==mpi->stride[0] && dmpi->w*(dmpi->bpp>>3)==dmpi->stride[0]){
// no stride conversion needed
switch(dmpi->imgfmt&255){
@@ -119,10 +123,12 @@
}
static int open(vf_instance_t *vf, char* args){
+ unsigned int i;
vf->config=config;
vf->put_image=put_image;
vf->query_format=query_format;
vf->priv=malloc(sizeof(struct vf_priv_s));
+ for(i=0;i<256;i++) gray_pal[i]=0x01010101*i;
return 1;
}
More information about the MPlayer-cvslog
mailing list