]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/vp56.h
avformat/dashenc: Remove deprecated min_seg_duration option
[ffmpeg] / libavcodec / vp56.h
index 9b3036895c3242e83665867ace292239b1bf1272..46090f25c93c2eaaf33213db64e6f3ecb5782e5e 100644 (file)
@@ -26,6 +26,8 @@
 #ifndef AVCODEC_VP56_H
 #define AVCODEC_VP56_H
 
+#include "libavutil/mem_internal.h"
+
 #include "avcodec.h"
 #include "get_bits.h"
 #include "hpeldsp.h"
@@ -89,6 +91,7 @@ typedef struct VP56RangeCoder {
     const uint8_t *buffer;
     const uint8_t *end;
     unsigned int code_word;
+    int end_reached;
 } VP56RangeCoder;
 
 typedef struct VP56RefDc {
@@ -105,6 +108,7 @@ typedef struct VP56Macroblock {
 typedef struct VP56Model {
     uint8_t coeff_reorder[64];       /* used in vp6 only */
     uint8_t coeff_index_to_pos[64];  /* used in vp6 only */
+    uint8_t coeff_index_to_idct_selector[64]; /* used in vp6 only */
     uint8_t vector_sig[2];           /* delta sign */
     uint8_t vector_dct[2];           /* delta coding types */
     uint8_t vector_pdi[2][2];        /* predefined delta init */
@@ -157,6 +161,7 @@ struct vp56_context {
     VP56mb mb_type;
     VP56Macroblock *macroblocks;
     DECLARE_ALIGNED(16, int16_t, block_coeff)[6][64];
+    int idct_selector[6];
 
     /* motion vectors */
     VP56mv mv[6];  /* vectors for each block in MB */
@@ -233,7 +238,9 @@ int ff_vp56_init_range_decoder(VP56RangeCoder *c, const uint8_t *buf, int buf_si
  */
 static av_always_inline int vpX_rac_is_end(VP56RangeCoder *c)
 {
-    return c->end <= c->buffer && c->bits >= 0;
+    if (c->end <= c->buffer && c->bits >= 0)
+        c->end_reached ++;
+    return c->end_reached > 10;
 }
 
 static av_always_inline unsigned int vp56_rac_renorm(VP56RangeCoder *c)