mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-26 13:48:21 +01:00
Print relevant lossless encoding stats in cwebp.
Change-Id: Ib8dfab498b1a05e49734bba2d3e72810343e8b0a
This commit is contained in:
parent
e3302cfd73
commit
c4ccab6463
@ -530,8 +530,21 @@ static void PrintValues(const int values[4]) {
|
||||
fprintf(stderr, "|\n");
|
||||
}
|
||||
|
||||
static void PrintExtraInfo(const WebPPicture* const pic, int short_output,
|
||||
const char* const file_name) {
|
||||
static void PrintExtraInfoLossless(const WebPPicture* const pic,
|
||||
int short_output,
|
||||
const char* const file_name) {
|
||||
const WebPAuxStats* const stats = pic->stats;
|
||||
if (short_output) {
|
||||
fprintf(stderr, "%7d %2.2f\n", stats->coded_size, stats->PSNR[3]);
|
||||
} 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);
|
||||
}
|
||||
}
|
||||
|
||||
static void PrintExtraInfoLossy(const WebPPicture* const pic, int short_output,
|
||||
const char* const file_name) {
|
||||
const WebPAuxStats* const stats = pic->stats;
|
||||
if (short_output) {
|
||||
fprintf(stderr, "%7d %2.2f\n", stats->coded_size, stats->PSNR[3]);
|
||||
@ -1011,7 +1024,11 @@ int main(int argc, const char *argv[]) {
|
||||
}
|
||||
|
||||
if (!quiet) {
|
||||
PrintExtraInfo(&picture, short_output, in_file);
|
||||
if (config.lossless) {
|
||||
PrintExtraInfoLossless(&picture, short_output, in_file);
|
||||
} else {
|
||||
PrintExtraInfoLossy(&picture, short_output, in_file);
|
||||
}
|
||||
}
|
||||
if (!quiet && !short_output && print_distortion > 0) { // print distortion
|
||||
float values[5];
|
||||
|
Loading…
Reference in New Issue
Block a user