[Mplayer-cvslog] CVS: main/libmpcodecs vd_divx4.c,1.9,1.10 vd.h,1.7,1.8 vf.c,1.37,1.38 vf_format.c,1.5,1.6 vf_scale.c,1.17,1.18
Alex Beregszaszi
alex at mplayerhq.hu
Thu Jul 11 21:16:33 CEST 2002
Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var/tmp.root/cvs-serv20665
Modified Files:
vd_divx4.c vd.h vf.c vf_format.c vf_scale.c
Log Message:
support for external pp by divx4. some fixes/cosmetics?
Index: vd_divx4.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vd_divx4.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- vd_divx4.c 10 Jul 2002 20:56:57 -0000 1.9
+++ vd_divx4.c 11 Jul 2002 19:16:30 -0000 1.10
@@ -33,9 +33,12 @@
#include <decore.h>
#endif
+#define USE_DIVX_BUILTIN_PP
+
// to set/get/query special features/parameters
static int control(sh_video_t *sh,int cmd,void* arg,...){
switch(cmd){
+#ifdef USE_DIVX_BUILTIN_PP
case VDCTRL_QUERY_MAX_PP_LEVEL:
return 9; // for divx4linux
case VDCTRL_SET_PP_LEVEL: {
@@ -46,6 +49,7 @@
decore(0x123,DEC_OPT_SETPP,&dec_set,NULL);
return CONTROL_OK;
}
+#endif
#ifdef DECORE_VERSION
#if DECORE_VERSION >= 20011010
case VDCTRL_SET_EQUALIZER: {
@@ -127,8 +131,10 @@
dec_param.y_dim = sh->disp_h;
decore(0x123, DEC_OPT_INIT, &dec_param, NULL);
+#ifdef USE_DIVX_BUILTIN_PP
dec_set.postproc_level = divx_quality;
decore(0x123, DEC_OPT_SETPP, &dec_set, NULL);
+#endif
mp_msg(MSGT_DECVIDEO,MSGL_V,"INFO: DivX4Linux video codec init OK!\n");
@@ -146,12 +152,15 @@
static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){
mp_image_t* mpi;
DEC_FRAME dec_frame;
+#ifndef USE_DIVX_BUILTIN_PP
+ DEC_FRAME_INFO frameinfo;
+#endif
if(len<=0) return NULL; // skipped frame
dec_frame.length = len;
dec_frame.bitstream = data;
- dec_frame.render_flag = (flags&3)?0:1;
+ dec_frame.render_flag = (flags&VDFLAGS_DROPFRAME)?0:1;
mpi=mpcodecs_get_image(sh, MP_IMGTYPE_TEMP, MP_IMGFLAG_PRESERVE | MP_IMGFLAG_ACCEPT_WIDTH,
sh->disp_w, sh->disp_h);
@@ -159,16 +168,27 @@
dec_frame.bmp=mpi->planes[0];
dec_frame.stride=mpi->width;
-
+
+ decore(0x123,
#ifndef DEC_OPT_FRAME_311
- decore(0x123, DEC_OPT_FRAME, &dec_frame, NULL);
+ DEC_OPT_FRAME,
#else
- decore(0x123, (sh->format==mmioFOURCC('D','I','V','3'))?DEC_OPT_FRAME_311:DEC_OPT_FRAME, &dec_frame, NULL);
+ (sh->format==mmioFOURCC('D','I','V','3'))?DEC_OPT_FRAME_311:DEC_OPT_FRAME,
+#endif
+ &dec_frame,
+#ifndef USE_DIVX_BUILTIN_PP
+ &frameinfo
+#else
+ NULL
+#endif
+ );
+
+#ifndef USE_DIVX_BUILTIN_PP
+ mpi->qscale = frameinfo.quant_store;
+ mpi->qstride = frameinfo.quant_stride;
#endif
return mpi;
}
-
#endif
#endif
-
Index: vd.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vd.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- vd.h 4 Apr 2002 00:00:23 -0000 1.7
+++ vd.h 11 Jul 2002 19:16:30 -0000 1.8
@@ -26,3 +26,4 @@
int mpcodecs_config_vo(sh_video_t *sh, int w, int h, unsigned int preferred_outfmt);
mp_image_t* mpcodecs_get_image(sh_video_t *sh, int mp_imgtype, int mp_imgflag, int w, int h);
+#define VDFLAGS_DROPFRAME 3
Index: vf.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vf.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- vf.c 23 Jun 2002 21:08:31 -0000 1.37
+++ vf.c 11 Jul 2002 19:16:30 -0000 1.38
@@ -200,7 +200,7 @@
(mpi->type==MP_IMGTYPE_EXPORT)?"Exporting":
((mpi->flags&MP_IMGFLAG_DIRECT)?"Direct Rendering":"Allocating"),
mpi->width,mpi->height,mpi->bpp,
- (mpi->flags&MP_IMGFLAG_YUV)?"YUV":"RGB",
+ (mpi->flags&MP_IMGFLAG_YUV)?"YUV":((mpi->flags&MP_IMGFLAG_SWAPPED)?"BGR":"RGB"),
(mpi->flags&MP_IMGFLAG_PLANAR)?"planar":"packed",
mpi->bpp*mpi->width*mpi->height/8);
mp_msg(MSGT_DECVIDEO,MSGL_DBG2,"(imgfmt: %x, planes: %x,%x,%x strides: %d,%d,%d, chroma: %dx%d, shift: h:%d,v:%d)\n",
Index: vf_format.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vf_format.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- vf_format.c 23 Jun 2002 15:15:31 -0000 1.5
+++ vf_format.c 11 Jul 2002 19:16:30 -0000 1.6
@@ -40,6 +40,11 @@
if(!strcasecmp(args,"bgr16")) vf->priv->fmt=IMGFMT_BGR16; else
if(!strcasecmp(args,"bgr15")) vf->priv->fmt=IMGFMT_BGR15; else
if(!strcasecmp(args,"bgr8")) vf->priv->fmt=IMGFMT_BGR8; else
+ if(!strcasecmp(args,"rgb24")) vf->priv->fmt=IMGFMT_RGB24; else
+ if(!strcasecmp(args,"rgb32")) vf->priv->fmt=IMGFMT_RGB32; else
+ if(!strcasecmp(args,"rgb16")) vf->priv->fmt=IMGFMT_RGB16; else
+ if(!strcasecmp(args,"rgb15")) vf->priv->fmt=IMGFMT_RGB15; else
+ if(!strcasecmp(args,"rgb8")) vf->priv->fmt=IMGFMT_RGB8; else
{ printf("Unknown format name: '%s'\n",args);return 0;}
} else
vf->priv->fmt=IMGFMT_YUY2;
Index: vf_scale.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vf_scale.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- vf_scale.c 4 Jul 2002 13:08:37 -0000 1.17
+++ vf_scale.c 11 Jul 2002 19:16:30 -0000 1.18
@@ -58,8 +58,8 @@
while(*p){
int ret=vf_next_query_format(vf,*p);
mp_msg(MSGT_VFILTER,MSGL_V,"scale: query(%s) -> %d\n",vo_format_name(*p),ret&3);
- if(ret&2){ best=*p; break;} // no conversion -> bingo!
- if(ret&1 && !best) best=*p; // best with conversion
+ if(ret&VFCAP_CSP_SUPPORTED_BY_HW){ best=*p; break;} // no conversion -> bingo!
+ if(ret&VFCAP_CSP_SUPPORTED && !best) best=*p; // best with conversion
++p;
}
return best;
More information about the MPlayer-cvslog
mailing list