mirror of
https://github.com/webmproject/libwebp.git
synced 2025-08-28 06:42:27 +02:00
Set prev_candidate_undecided in anim_enc
When the next frame is forced to be a keyframe by setting enc->best_delta to DELTA_INFINITY, setting enc->keyframe to NONE means the current frame will never be converted from a candidate keyframe to a subframe. So enc->prev_candidate_undecided should be set to 0. This is a no-op change because enc->prev_candidate_undecided is only used to update prev_rect and dispose method, which is of no value when the next frame is a key frame. Change-Id: Ie51c7e3b6ba797b75af5e06439e8568d8185693f
This commit is contained in:
@@ -1262,10 +1262,13 @@ static int CacheFrame(WebPAnimEncoder* const enc,
|
||||
// Note: We need '>=' below because when kmin and kmax are both zero,
|
||||
// count_since_key_frame will always be > kmax.
|
||||
if (enc->count_since_key_frame >= enc->options.kmax) {
|
||||
// Force the next frame to be a key frame.
|
||||
enc->best_delta = DELTA_INFINITY;
|
||||
// Flush all encoded frames.
|
||||
enc->flush_count = enc->count - 1;
|
||||
enc->count_since_key_frame = 0;
|
||||
enc->prev_candidate_undecided = 0;
|
||||
enc->keyframe = KEYFRAME_NONE;
|
||||
enc->best_delta = DELTA_INFINITY;
|
||||
}
|
||||
if (!enc->prev_candidate_undecided) {
|
||||
enc->prev_rect =
|
||||
|
Reference in New Issue
Block a user