Commit a53c4f36 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/ffv1: Simplify update_vlc_state()

About 0.5% faster
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 5d0139d5
...@@ -174,19 +174,13 @@ static inline void update_vlc_state(VlcState *const state, const int v) ...@@ -174,19 +174,13 @@ static inline void update_vlc_state(VlcState *const state, const int v)
count++; count++;
if (drift <= -count) { if (drift <= -count) {
if (state->bias > -128) state->bias = FFMAX(state->bias - 1, -128);
state->bias--;
drift += count; drift = FFMAX(drift + count, -count + 1);
if (drift <= -count)
drift = -count + 1;
} else if (drift > 0) { } else if (drift > 0) {
if (state->bias < 127) state->bias = FFMIN(state->bias + 1, 127);
state->bias++;
drift -= count; drift = FFMIN(drift - count, 0);
if (drift > 0)
drift = 0;
} }
state->drift = drift; state->drift = drift;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment