]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/lagarithrac.h
hevc: 16x16 NEON idct: Use the right element size for loads/stores
[ffmpeg] / libavcodec / lagarithrac.h
index b9421993a414fb5643ecdec47de80541facdc202..3b30b15e12c7f5bd26ff57d20f4604c6f663c593 100644 (file)
 #define AVCODEC_LAGARITHRAC_H
 
 #include <stdint.h>
+
 #include "libavutil/common.h"
 #include "libavutil/intreadwrite.h"
+
 #include "avcodec.h"
-#include "get_bits.h"
+#include "bitstream.h"
 
 typedef struct lag_rac {
     AVCodecContext *avctx;
@@ -51,7 +53,7 @@ typedef struct lag_rac {
     uint8_t  range_hash[256];   /**< Hash table mapping upper byte to approximate symbol. */
 } lag_rac;
 
-void lag_rac_init(lag_rac *l, GetBitContext *gb, int length);
+void ff_lag_rac_init(lag_rac *l, BitstreamContext *bc, int length);
 
 /* TODO: Optimize */
 static inline void lag_rac_refill(lag_rac *l)
@@ -107,6 +109,9 @@ static inline uint8_t lag_get_rac(lag_rac *l)
         l->range -= range_scaled * l->prob[255];
     }
 
+    if (!l->range)
+        l->range = 0x80;
+
     l->low -= range_scaled * l->prob[val];
 
     return val;