diff options
-rw-r--r-- | vp9/encoder/vp9_encoder.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c index 583435e61..976ba020d 100644 --- a/vp9/encoder/vp9_encoder.c +++ b/vp9/encoder/vp9_encoder.c @@ -6140,16 +6140,12 @@ static void max_heap_push(FEATURE_SCORE_LOC **heap, int *size, ++*size; c = *size - 1; p = c >> 1; - while (c > 0) { - if (heap[c]->feature_score > heap[p]->feature_score) { - tmp = heap[p]; - heap[p] = heap[c]; - heap[c] = tmp; - c = p; - p = c >> 1; - } else { - break; - } + while (c > 0 && heap[c]->feature_score > heap[p]->feature_score) { + tmp = heap[p]; + heap[p] = heap[c]; + heap[c] = tmp; + c = p; + p >>= 1; } } |