Revision 890972be ffmpeg.c

View differences:

ffmpeg.c
764 764
            frame_number = ost->frame_number;
765 765
            sprintf(buf + strlen(buf), "frame=%5d q=%2.1f ",
766 766
                    frame_number, enc->coded_frame ? enc->coded_frame->quality/(float)FF_QP2LAMBDA : 0);
767
            if (enc->flags&CODEC_FLAG_PSNR)
768
                sprintf(buf + strlen(buf), "PSNR= %6.2f ", psnr(enc->coded_frame->error[0]/(enc->width*enc->height*255.0*255.0)));
767
            if(is_last_report)
768
                sprintf(buf + strlen(buf), "L");
769
            if (enc->flags&CODEC_FLAG_PSNR){
770
                int j;
771
                double error, error_sum=0;
772
                double scale, scale_sum=0;
773
                char type[3]= {'Y','U','V'};
774
                sprintf(buf + strlen(buf), "PSNR=");
775
                for(j=0; j<3; j++){
776
                    if(is_last_report){
777
                        error= enc->error[j];
778
                        scale= enc->width*enc->height*255.0*255.0*frame_number;
779
                    }else{
780
                        error= enc->coded_frame->error[j];
781
                        scale= enc->width*enc->height*255.0*255.0;
782
                    }
783
                    if(j) scale/=4;
784
                    error_sum += error;
785
                    scale_sum += scale;
786
                    sprintf(buf + strlen(buf), "%c:%2.2f ", type[j], psnr(error/scale));
787
                }
788
                sprintf(buf + strlen(buf), "*:%2.2f ", psnr(error_sum/scale_sum));
789
            }
769 790
            vid = 1;
770 791
        }
771 792
        /* compute min output value */

Also available in: Unified diff