]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/ffv1.h
avcodec/mpeg4_unpack_bframes_bsf: Use avpriv_find_start_code
[ffmpeg] / libavcodec / ffv1.h
index 7c29d01f51cc02c4388bab45d5f07c1cbc2d0fd5..f0bb19350a8992a928e98b68c9e4acf5a5fc7d57 100644 (file)
@@ -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;