mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-13 14:34:33 +02:00
WebPEncode: clear stats at the start of encode
also relocate user_data from WebPAuxStats to the WebPPicture struct to make clearing easier while placing it closer to the progress hook with which it's used. prior to this change some spurious lossless data could be reported in the lossy (sans alpha) encoding case. additionally user_data could be lost during lossless encoding. Change-Id: I929fae3dfde4d445ff81bbaad51445ea586dd80b
This commit is contained in:
@ -779,7 +779,7 @@ static int DumpPicture(const WebPPicture* const picture, const char* PGM_name) {
|
||||
|
||||
static int ProgressReport(int percent, const WebPPicture* const picture) {
|
||||
printf("[%s]: %3d %% \r",
|
||||
(char*)picture->stats->user_data, percent);
|
||||
(char*)picture->user_data, percent);
|
||||
fflush(stdout);
|
||||
return 1; // all ok
|
||||
}
|
||||
@ -1125,7 +1125,7 @@ int main(int argc, const char *argv[]) {
|
||||
}
|
||||
if (!quiet) {
|
||||
picture.stats = &stats;
|
||||
stats.user_data = (void*)in_file;
|
||||
picture.user_data = (void*)in_file;
|
||||
}
|
||||
|
||||
// Compress
|
||||
|
Reference in New Issue
Block a user