mirror of
https://github.com/webmproject/libwebp.git
synced 2025-02-13 23:42:53 +01:00
AnimEncoder: Correctly skip a frame when sub-rectangle is empty.
Change-Id: I0d288bd9561b48cf5a1eae92a1b7106ba44c664e
This commit is contained in:
parent
ea72cd60cb
commit
1cc79e92ac
@ -1066,6 +1066,8 @@ static WebPEncodingError SetFrame(WebPAnimEncoder* const enc,
|
|||||||
const WebPPicture* const prev_canvas = &enc->prev_canvas_;
|
const WebPPicture* const prev_canvas = &enc->prev_canvas_;
|
||||||
Candidate candidates[CANDIDATE_COUNT];
|
Candidate candidates[CANDIDATE_COUNT];
|
||||||
const int is_lossless = config->lossless;
|
const int is_lossless = config->lossless;
|
||||||
|
const int consider_lossless = is_lossless || enc->options_.allow_mixed;
|
||||||
|
const int consider_lossy = !is_lossless || enc->options_.allow_mixed;
|
||||||
const int is_first_frame = enc->is_first_frame_;
|
const int is_first_frame = enc->is_first_frame_;
|
||||||
|
|
||||||
// First frame cannot be skipped as there is no 'previous frame' to merge it
|
// First frame cannot be skipped as there is no 'previous frame' to merge it
|
||||||
@ -1114,8 +1116,8 @@ static WebPEncodingError SetFrame(WebPAnimEncoder* const enc,
|
|||||||
goto Err;
|
goto Err;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((is_lossless && IsEmptyRect(&dispose_none_params.rect_ll_)) ||
|
if ((consider_lossless && IsEmptyRect(&dispose_none_params.rect_ll_)) ||
|
||||||
(!is_lossless && IsEmptyRect(&dispose_none_params.rect_lossy_))) {
|
(consider_lossy && IsEmptyRect(&dispose_none_params.rect_lossy_))) {
|
||||||
// Don't encode the frame at all. Instead, the duration of the previous
|
// Don't encode the frame at all. Instead, the duration of the previous
|
||||||
// frame will be increased later.
|
// frame will be increased later.
|
||||||
assert(empty_rect_allowed_none);
|
assert(empty_rect_allowed_none);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user