]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/snow.h
idct_sse2_xvid: remove libavutil/internal.h include
[ffmpeg] / libavcodec / snow.h
index c5d6492a9f73bfc76c0bc8988fff83ae989cc31d..6d6b0869077f78f61cf40c0794586b60ba3587b4 100644 (file)
@@ -135,6 +135,7 @@ typedef struct SnowContext{
     DWTELEM *temp_dwt_buffer;
     IDWTELEM *spatial_idwt_buffer;
     IDWTELEM *temp_idwt_buffer;
+    int *run_buffer;
     int colorspace_type;
     int chroma_h_shift;
     int chroma_v_shift;
@@ -165,7 +166,7 @@ typedef struct SnowContext{
     MpegEncContext m; // needed for motion estimation, should not be used for anything else, the idea is to eventually make the motion estimation independent of MpegEncContext, so this will be removed then (FIXME/XXX)
 
     uint8_t *scratchbuf;
-    int *runs;
+    uint8_t *emu_edge_buffer;
 }SnowContext;
 
 /* Tables */
@@ -581,7 +582,7 @@ static inline int get_symbol2(RangeCoder *c, uint8_t *state, int log2){
 
     av_assert2(log2>=-4);
 
-    while(get_rac(c, state+4+log2)){
+    while(log2<28 && get_rac(c, state+4+log2)){
         v+= r;
         log2++;
         if(log2>0) r+=r;
@@ -663,11 +664,13 @@ static inline void unpack_coeffs(SnowContext *s, SubBand *b, SubBand * parent, i
                     int max_run;
                     run--;
                     v=0;
-
+                    av_assert2(run >= 0);
                     if(y) max_run= FFMIN(run, prev_xc->x - x - 2);
                     else  max_run= FFMIN(run, w-x-1);
                     if(parent_xc)
                         max_run= FFMIN(max_run, 2*parent_xc->x - x - 1);
+                    av_assert2(max_run >= 0 && max_run <= run);
+
                     x+= max_run;
                     run-= max_run;
                 }