Fix ticket20

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2011-04-06 21:17:32 +02:00
parent 1265395b5b
commit 6b1c886b65
1 changed files with 6 additions and 7 deletions

View File

@ -1381,26 +1381,25 @@ static void print_report(AVFormatContext **output_files,
ti1 = 1e10; ti1 = 1e10;
vid = 0; vid = 0;
for(i=0;i<nb_ostreams;i++) { for(i=0;i<nb_ostreams;i++) {
float q= -1;
ost = ost_table[i]; ost = ost_table[i];
enc = ost->st->codec; enc = ost->st->codec;
if(!ost->st->stream_copy && enc->coded_frame)
q= enc->coded_frame->quality/(float)FF_QP2LAMBDA;
if (vid && enc->codec_type == AVMEDIA_TYPE_VIDEO) { if (vid && enc->codec_type == AVMEDIA_TYPE_VIDEO) {
snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "q=%2.1f ", snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "q=%2.1f ", q);
!ost->st->stream_copy ?
enc->coded_frame->quality/(float)FF_QP2LAMBDA : -1);
} }
if (!vid && enc->codec_type == AVMEDIA_TYPE_VIDEO) { if (!vid && enc->codec_type == AVMEDIA_TYPE_VIDEO) {
float t = (av_gettime()-timer_start) / 1000000.0; float t = (av_gettime()-timer_start) / 1000000.0;
frame_number = ost->frame_number; frame_number = ost->frame_number;
snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "frame=%5d fps=%3d q=%3.1f ", snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "frame=%5d fps=%3d q=%3.1f ",
frame_number, (t>1)?(int)(frame_number/t+0.5) : 0, frame_number, (t>1)?(int)(frame_number/t+0.5) : 0, q);
!ost->st->stream_copy ?
enc->coded_frame->quality/(float)FF_QP2LAMBDA : -1);
if(is_last_report) if(is_last_report)
snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "L"); snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "L");
if(qp_hist){ if(qp_hist){
int j; int j;
int qp= lrintf(enc->coded_frame->quality/(float)FF_QP2LAMBDA); int qp= lrintf(q);
if(qp>=0 && qp<FF_ARRAY_ELEMS(qp_histogram)) if(qp>=0 && qp<FF_ARRAY_ELEMS(qp_histogram))
qp_histogram[qp]++; qp_histogram[qp]++;
for(j=0; j<32; j++) for(j=0; j<32; j++)