comparison libmpcodecs/ve_lavc.c @ 9868:98ae45a0d03a

Fix serious breakage, 10000l !
author rguyom
date Mon, 07 Apr 2003 13:48:51 +0000
parents 30893b593947
children 6e7f3643bee6
comparison
equal deleted inserted replaced
9867:9e0e6579f46d 9868:98ae45a0d03a
527 static int frame_number=0; 527 static int frame_number=0;
528 static double all_frametime=0.0; 528 static double all_frametime=0.0;
529 AVFrame *pic= lavc_venc_context->coded_frame; 529 AVFrame *pic= lavc_venc_context->coded_frame;
530 double f= lavc_venc_context->width*lavc_venc_context->height*255.0*255.0; 530 double f= lavc_venc_context->width*lavc_venc_context->height*255.0*255.0;
531 double quality=0.0; 531 double quality=0.0;
532 int8_t *q;
532 533
533 if(!fvstats) { 534 if(!fvstats) {
534 time_t today2; 535 time_t today2;
535 struct tm *today; 536 struct tm *today;
536 today2 = time(NULL); 537 today2 = time(NULL);
544 /*exit(1);*/ 545 /*exit(1);*/
545 } 546 }
546 } 547 }
547 548
548 // average MB quantizer 549 // average MB quantizer
549 { 550 q = lavc_venc_context->coded_frame->qscale_table;
551 if(q) {
550 int x, y; 552 int x, y;
551 int w = (lavc_venc_context->width+15) >> 4; 553 int w = (lavc_venc_context->width+15) >> 4;
552 int h = (lavc_venc_context->height+15) >> 4; 554 int h = (lavc_venc_context->height+15) >> 4;
553 int8_t *q = lavc_venc_context->coded_frame->qscale_table;
554 for( y = 0; y < h; y++ ) { 555 for( y = 0; y < h; y++ ) {
555 for( x = 0; x < w; x++ ) 556 for( x = 0; x < w; x++ )
556 quality += (double)*(q+x); 557 quality += (double)*(q+x);
557 q += lavc_venc_context->coded_frame->qstride; 558 q += lavc_venc_context->coded_frame->qstride;
558 } 559 }
559 quality /= w * h; 560 quality /= w * h;
560 } 561 } else
562 quality = lavc_venc_context->coded_frame->quality;
561 563
562 fprintf(fvstats, "%6d, %2.2f, %6d, %2.2f, %2.2f, %2.2f, %2.2f %c\n", 564 fprintf(fvstats, "%6d, %2.2f, %6d, %2.2f, %2.2f, %2.2f, %2.2f %c\n",
563 lavc_venc_context->coded_frame->coded_picture_number, 565 lavc_venc_context->coded_frame->coded_picture_number,
564 quality, 566 quality,
565 out_size, 567 out_size,