diff --git a/examples/cwebp.c b/examples/cwebp.c index b5373df4..164b57fe 100644 --- a/examples/cwebp.c +++ b/examples/cwebp.c @@ -187,7 +187,8 @@ static void PrintExtraInfoLossless(const WebPPicture* const pic, } else { fprintf(stderr, "File: %s\n", file_name); fprintf(stderr, "Dimension: %d x %d\n", pic->width, pic->height); - fprintf(stderr, "Output: %d bytes\n", stats->coded_size); + fprintf(stderr, "Output: %d bytes (%.2f bpp)\n", stats->coded_size, + 1.f * stats->coded_size / pic->width / pic->height); PrintFullLosslessInfo(stats, "ARGB"); } } @@ -208,9 +209,11 @@ static void PrintExtraInfoLossy(const WebPPicture* const pic, int short_output, pic->width, pic->height, stats->alpha_data_size ? " (with alpha)" : ""); fprintf(stderr, "Output: " - "%d bytes Y-U-V-All-PSNR %2.2f %2.2f %2.2f %2.2f dB\n", + "%d bytes Y-U-V-All-PSNR %2.2f %2.2f %2.2f %2.2f dB\n" + " (%.2f bpp)\n", stats->coded_size, - stats->PSNR[0], stats->PSNR[1], stats->PSNR[2], stats->PSNR[3]); + stats->PSNR[0], stats->PSNR[1], stats->PSNR[2], stats->PSNR[3], + 1.f * stats->coded_size / pic->width / pic->height); if (total > 0) { int totals[4] = { 0, 0, 0, 0 }; fprintf(stderr, "block count: intra4: %6d (%.2f%%)\n" diff --git a/extras/get_disto.c b/extras/get_disto.c index 1d45af7f..23914f2b 100644 --- a/extras/get_disto.c +++ b/extras/get_disto.c @@ -290,9 +290,10 @@ int main(int argc, const char *argv[]) { fprintf(stderr, "Error while computing the distortion.\n"); goto End; } - printf("%u %.2f %.2f %.2f %.2f %.2f\n", + printf("%u %.2f %.2f %.2f %.2f %.2f [ %.2f bpp ]\n", (unsigned int)size1, - disto[4], disto[0], disto[1], disto[2], disto[3]); + disto[4], disto[0], disto[1], disto[2], disto[3], + 1.f * size1 / pic1.width / pic1.height); if (output != NULL) { uint8_t* data = NULL;