changeset 9868:98ae45a0d03a

Fix serious breakage, 10000l !
author rguyom
date Mon, 07 Apr 2003 13:48:51 +0000
parents 9e0e6579f46d
children 49f639c73367
files libmpcodecs/ve_lavc.c
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/ve_lavc.c	Mon Apr 07 10:14:06 2003 +0000
+++ b/libmpcodecs/ve_lavc.c	Mon Apr 07 13:48:51 2003 +0000
@@ -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,