mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-13 14:34:33 +02:00
WebPReportProgress: use non-encoder specific params
Take picture and percent value storage location instead of VP8Encoder. This will allow reuse by the lossless encoder. Change-Id: Ic49dbc800cc3e2df60d20f4ebac277f68ed6031b
This commit is contained in:
@ -303,7 +303,7 @@ static void StoreStats(VP8Encoder* const enc) {
|
||||
stats->block_count[i] = enc->block_count_[i];
|
||||
}
|
||||
}
|
||||
WebPReportProgress(enc, 100); // done!
|
||||
WebPReportProgress(enc->pic_, 100, &enc->percent_); // done!
|
||||
}
|
||||
|
||||
int WebPEncodingSetError(const WebPPicture* const pic,
|
||||
@ -314,10 +314,10 @@ int WebPEncodingSetError(const WebPPicture* const pic,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int WebPReportProgress(VP8Encoder* const enc, int percent) {
|
||||
if (percent != enc->percent_) {
|
||||
WebPPicture* const pic = enc->pic_;
|
||||
enc->percent_ = percent;
|
||||
int WebPReportProgress(const WebPPicture* const pic,
|
||||
int percent, int* const percent_store) {
|
||||
if (percent_store != NULL && percent != *percent_store) {
|
||||
*percent_store = percent;
|
||||
if (pic->progress_hook && !pic->progress_hook(percent, pic)) {
|
||||
// user abort requested
|
||||
WebPEncodingSetError(pic, VP8_ENC_ERROR_USER_ABORT);
|
||||
|
Reference in New Issue
Block a user