mirror of
https://github.com/xenia-project/FFmpeg.git
synced 2024-11-27 21:40:34 +00:00
avcodec/ffv1: Simplify update_vlc_state()
About 0.5% faster Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
5d0139d5f0
commit
a53c4f3689
@ -174,19 +174,13 @@ static inline void update_vlc_state(VlcState *const state, const int v)
|
||||
count++;
|
||||
|
||||
if (drift <= -count) {
|
||||
if (state->bias > -128)
|
||||
state->bias--;
|
||||
state->bias = FFMAX(state->bias - 1, -128);
|
||||
|
||||
drift += count;
|
||||
if (drift <= -count)
|
||||
drift = -count + 1;
|
||||
drift = FFMAX(drift + count, -count + 1);
|
||||
} else if (drift > 0) {
|
||||
if (state->bias < 127)
|
||||
state->bias++;
|
||||
state->bias = FFMIN(state->bias + 1, 127);
|
||||
|
||||
drift -= count;
|
||||
if (drift > 0)
|
||||
drift = 0;
|
||||
drift = FFMIN(drift - count, 0);
|
||||
}
|
||||
|
||||
state->drift = drift;
|
||||
|
Loading…
Reference in New Issue
Block a user