[MPlayer-dev-eng] Re: xvid patch

Marco "elcabesa" Belli elcabesa at inwind.it
Sat Dec 14 18:12:59 CET 2002


tell me if you like this=)


--- main/libmpcodecs/vd_xvid.c	2002-08-30 23:44:20.000000000 +0200
+++ MPlayer-0.90rc1/libmpcodecs/vd_xvid.c	2002-12-14 14:48:14.000000000 +0100
@@ -165,6 +165,10 @@

   dec.bitstream = data;
   dec.length = len;
+  dec.general |= XVID_DEC_LOWDELAY;
+  dec.general |= XVID_DEC_DEBLOCKY;
+  dec.general |= XVID_DEC_DEBLOCKUV;
+
   switch(p->cs) {
   case XVID_CSP_USER:
     dec.image = &d4_pic;




and




--- ve_xvid.c	2002-11-22 09:19:08.000000000 +0100
+++ MPlayer-0.90rc1/libmpcodecs/ve_xvid.c	2002-12-14 18:08:52.000000000 +0100
@@ -29,11 +29,11 @@
 static int const divx4_motion_presets[7] = {
         0,
 	PMV_QUICKSTOP16,
-	PMV_EARLYSTOP16,
-	PMV_EARLYSTOP16 | PMV_EARLYSTOP8,
-        PMV_EARLYSTOP16 | PMV_HALFPELREFINE16 | PMV_EARLYSTOP8 | 
PMV_HALFPELDIAMOND8,
-        PMV_EARLYSTOP16 | PMV_HALFPELREFINE16 | PMV_EARLYSTOP8 | 
PMV_HALFPELDIAMOND8 | PMV_ADVANCEDDIAMOND16,
-	PMV_EARLYSTOP16 | PMV_HALFPELREFINE16 | PMV_EXTSEARCH16 | PMV_EARLYSTOP8 | 
PMV_HALFPELREFINE8 |
+	PMV_EXTSEARCH16,
+	PMV_EXTSEARCH16 | PMV_EXTSEARCH8,
+        PMV_EXTSEARCH16 | PMV_HALFPELREFINE16 | PMV_EXTSEARCH8 | 
PMV_HALFPELDIAMOND8,
+        PMV_EXTSEARCH16 | PMV_HALFPELREFINE16 | PMV_EXTSEARCH8 | 
PMV_HALFPELDIAMOND8 | PMV_ADVANCEDDIAMOND16,
+	PMV_EXTSEARCH16 | PMV_QUARTERPELREFINE16 | PMV_EXTSEARCH16 | PMV_EXTSEARCH8 
| PMV_QUARTERPELREFINE8 |
 	PMV_HALFPELDIAMOND8 | PMV_USESQUARES16
 
 };
@@ -46,7 +46,7 @@
 	XVID_H263QUANT | XVID_HALFPEL,
 	XVID_H263QUANT | XVID_INTER4V | XVID_HALFPEL,
 	XVID_H263QUANT | XVID_INTER4V | XVID_HALFPEL,
-	XVID_H263QUANT | XVID_INTER4V | XVID_HALFPEL
+	XVID_H263QUANT | XVID_INTER4V | XVID_QUARTERPEL
 };

 extern char* passtmpfile;
@@ -71,6 +71,12 @@
 static int xvidenc_debug = 0;
 static int xvidenc_hintedme = 0;
 static char* xvidenc_hintfile = "xvid_hint_me.dat";
+static int xvidenc_max_bframes=-1;
+static int xvidenc_bquant_ratio=200;
+static int xvidenc_gmc = 0;
+static int xvidenc_me_colour=0;
+static int xvidenc_reduced=0;
+static int xvidenc_bquant_offset=0;
 
 struct config xvidencopts_conf[] = {
     { "pass", &xvidenc_pass, CONF_TYPE_INT, CONF_RANGE, 0, 2, NULL},
@@ -93,6 +99,12 @@
     { "debug", &xvidenc_debug, CONF_TYPE_FLAG, 0, 0, 1, NULL},
     { "hintedme", &xvidenc_hintedme, CONF_TYPE_FLAG, 0, 0, 1, NULL},
     { "hintfile", &xvidenc_hintfile, CONF_TYPE_STRING, 0, 0, 0, NULL},
+    { "max_bframe", &xvidenc_max_bframes, CONF_TYPE_INT, 0, 0, 0, NULL}, /* 
for xvid B_frame */
+    { "bquant_ratio", &xvidenc_bquant_ratio, CONF_TYPE_INT, 0, 0, 0, NULL}, 
/* for Xvid Bframe compression ratio */
+    { "bquant_offset", &xvidenc_bquant_offset, CONF_TYPE_INT, 0, 0, 0, NULL}, 
/* for xvid B_frame */
+    { "reduced", &xvidenc_reduced, CONF_TYPE_FLAG, 0, 0, 1, NULL}, /*for rr 
*/
+    { "gmc", &xvidenc_gmc, CONF_TYPE_FLAG, 0, 0, 1, NULL},   /* global Motion 
cntrol*/
+    { "me_colour", &xvidenc_me_colour, CONF_TYPE_FLAG, 0, 0, 1, NULL}, 
/*motion estimation colour*/
     { NULL, NULL, 0, 0, 0, 0, NULL}
 };

@@ -148,6 +160,16 @@
 	enc_param.rc_bitrate = xvidenc_bitrate * 1000;
     else
 	enc_param.rc_bitrate = -1;
+
+    enc_param.max_bframes=xvidenc_max_bframes;
+    enc_param.bquant_ratio=xvidenc_bquant_ratio;
+    enc_param.bquant_offset=xvidenc_bquant_offset;
+
+    if(xvidenc_reduced==1)
+    {
+       enc_param.global=XVID_GLOBAL_REDUCED;
+    }
+
     enc_param.rc_reaction_delay_factor = xvidenc_rc_reaction_delay_factor;
     enc_param.rc_averaging_period = xvidenc_rc_averaging_period;
     enc_param.rc_buffer = xvidenc_rc_buffer;
@@ -179,6 +201,13 @@
     }
     if (xvidenc_lumi_mask)
 	fp->enc_frame.general |= XVID_LUMIMASKING;
+    if (xvidenc_gmc)
+	fp->enc_frame.general |= XVID_GMC;
+    if (xvidenc_me_colour)
+	fp->enc_frame.general |= XVID_ME_COLOUR;
+    if(xvidenc_reduced==1)
+        fp->enc_frame.general |= XVID_REDUCED;
+

     switch (outfmt) {
     case IMGFMT_YV12:




More information about the MPlayer-dev-eng mailing list