Only print PSNR if some frames were encoded.

This commit is contained in:
Arttu Ylä-Outinen 2015-07-06 13:39:47 +03:00
parent 089ff895ad
commit cc580ac861

View file

@ -248,9 +248,16 @@ int main(int argc, char *argv[])
// Coding finished // Coding finished
// Print statistics of the coding // Print statistics of the coding
fprintf(stderr, " Processed %d frames, %10llu bits AVG PSNR: %2.4f %2.4f %2.4f\n", fprintf(stderr, " Processed %d frames, %10llu bits",
frames_done, (long long unsigned int)bitstream_length * 8, frames_done,
psnr_sum[0] / frames_done, psnr_sum[1] / frames_done, psnr_sum[2] / frames_done); (long long unsigned int)bitstream_length * 8);
if (frames_done > 0) {
fprintf(stderr, " AVG PSNR: %2.4f %2.4f %2.4f",
psnr_sum[0] / frames_done,
psnr_sum[1] / frames_done,
psnr_sum[2] / frames_done);
}
fprintf(stderr, "\n");
fprintf(stderr, " Total CPU time: %.3f s.\n", ((float)(clock() - start_time)) / CLOCKS_PER_SEC); fprintf(stderr, " Total CPU time: %.3f s.\n", ((float)(clock() - start_time)) / CLOCKS_PER_SEC);
{ {