[MPlayer-dev-eng] [PATCH] added some missing #ifdef's to ve_xvid.c

Andreas Hess jaska at gmx.net
Fri Apr 4 16:36:23 CEST 2003


Hi,

I've added some #ifdef's to ve_xvid.c, so it's possible to compile
mplayer with old xvid api.


Andreas
-------------- next part --------------
Index: libmpcodecs/ve_xvid.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/ve_xvid.c,v
retrieving revision 1.21
diff -u -r1.21 ve_xvid.c
--- libmpcodecs/ve_xvid.c	4 Apr 2003 05:47:27 -0000	1.21
+++ libmpcodecs/ve_xvid.c	4 Apr 2003 14:50:58 -0000
@@ -239,9 +239,9 @@
 	fp->nb_frames = 0;
 	xvid_error[0] = xvid_error[1] = xvid_error[2] = 0;
     }
-#endif
     if (xvidenc_greyscale)
 	enc_param.global |= XVID_GREYSCALE;
+#endif
     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;
@@ -269,8 +269,10 @@
     fp->enc_frame.general = XVID_HALFPEL | (xvidenc_mpeg_quant ? XVID_MPEGQUANT : XVID_H263QUANT);
     if (xvidenc_4mv)
 	fp->enc_frame.general |= XVID_INTER4V;
+#ifdef XVID_API_UNSTABLE
     if (xvidenc_lumi_mask)
 	fp->enc_frame.general |= XVID_LUMIMASKING;
+#endif
     if (xvidenc_interlacing)
 	fp->enc_frame.general |= XVID_INTERLACING;
 #ifdef XVID_API_UNSTABLE
@@ -387,6 +389,7 @@
 {
     struct vf_priv_s *fp = vf->priv;
 
+#ifdef XVID_API_UNSTABLE
     if (xvidenc_psnr) {
 	double p = (double)fp->pixels * (double)fp->nb_frames;
         printf ("PSNR: Y:%2.2f, Cb:%2.2f, Cr:%2.2f, All:%2.2f\n", 
@@ -395,6 +398,7 @@
 		sse_to_PSNR(xvid_error[2], p/4), 
 		sse_to_PSNR(xvid_error[0] + xvid_error[1] + xvid_error[2], p*1.5));
     }
+#endif
     vbrFinish(&fp->vbr_state);
 }
 
@@ -474,6 +478,7 @@
 	break;
     }
 
+#ifdef XVID_API_UNSTABLE
     if (xvidenc_psnr) {
         static FILE *fvstats = NULL;
         char filename[20];
@@ -508,6 +513,7 @@
 
 	fp->nb_frames++;
     }
+#endif
     
     // write output
     muxer_write_chunk(fp->mux, fp->enc_frame.length, fp->enc_frame.intra==1 ? 0x10 : 0);


More information about the MPlayer-dev-eng mailing list