[Mplayer-cvslog] CVS: main/libmpcodecs ve_lavc.c,1.59,1.60

Rémi Guyomarch CVS rguyom at mplayerhq.hu
Mon Apr 7 15:49:20 CEST 2003


Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var/tmp.root/cvs-serv6869/libmpcodecs

Modified Files:
	ve_lavc.c 
Log Message:

Fix serious breakage, 10000l !


Index: ve_lavc.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/ve_lavc.c,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -r1.59 -r1.60
--- ve_lavc.c	6 Apr 2003 23:37:56 -0000	1.59
+++ ve_lavc.c	7 Apr 2003 13:48:51 -0000	1.60
@@ -529,6 +529,7 @@
         AVFrame *pic= lavc_venc_context->coded_frame;
         double f= lavc_venc_context->width*lavc_venc_context->height*255.0*255.0;
 	double quality=0.0;
+	int8_t *q;
 
         if(!fvstats) {
             time_t today2;
@@ -546,18 +547,19 @@
         }
 	
 	// average MB quantizer
-	{
+	q = lavc_venc_context->coded_frame->qscale_table;
+	if(q) {
 	    int x, y;
 	    int w = (lavc_venc_context->width+15) >> 4;
 	    int h = (lavc_venc_context->height+15) >> 4;
-	    int8_t *q = lavc_venc_context->coded_frame->qscale_table;
 	    for( y = 0; y < h; y++ ) {
 		for( x = 0; x < w; x++ )
 		    quality += (double)*(q+x);
 		q += lavc_venc_context->coded_frame->qstride;
 	    }
 	    quality /= w * h;
-	}
+	} else 
+	    quality = lavc_venc_context->coded_frame->quality;
 
         fprintf(fvstats, "%6d, %2.2f, %6d, %2.2f, %2.2f, %2.2f, %2.2f %c\n",
             lavc_venc_context->coded_frame->coded_picture_number,



More information about the MPlayer-cvslog mailing list