]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/4xm.c
Merge commit 'a5e8c41c28f907d98d2a739db08f7aef4cbfcf3a'
[ffmpeg] / libavcodec / 4xm.c
index 600cf81ccde3201ee54af6e78c0135a13dc6c7da..05669c42214cc4fa8ea46436dd65580f09270fe8 100644 (file)
@@ -30,8 +30,7 @@
 #include "dsputil.h"
 #include "get_bits.h"
 
-//#undef NDEBUG
-//#include <assert.h>
+#include "libavutil/avassert.h"
 
 #define BLOCK_TYPE_VLC_BITS 5
 #define ACDC_VLC_BITS 9
@@ -240,15 +239,18 @@ static void idct(DCTELEM block[64])
 
 static av_cold void init_vlcs(FourXContext *f)
 {
-    static VLC_TYPE table[8][32][2];
-    int i;
-
-    for (i = 0; i < 8; i++) {
-        block_type_vlc[0][i].table           = table[i];
-        block_type_vlc[0][i].table_allocated = 32;
-        init_vlc(&block_type_vlc[0][i], BLOCK_TYPE_VLC_BITS, 7,
-                 &block_type_tab[0][i][0][1], 2, 1,
-                 &block_type_tab[0][i][0][0], 2, 1, INIT_VLC_USE_NEW_STATIC);
+    static VLC_TYPE table[2][4][32][2];
+    int i, j;
+
+    for (i = 0; i < 2; i++) {
+        for (j = 0; j < 4; j++) {
+            block_type_vlc[i][j].table           = table[i][j];
+            block_type_vlc[i][j].table_allocated = 32;
+            init_vlc(&block_type_vlc[i][j], BLOCK_TYPE_VLC_BITS, 7,
+                     &block_type_tab[i][j][0][1], 2, 1,
+                     &block_type_tab[i][j][0][0], 2, 1,
+                     INIT_VLC_USE_NEW_STATIC);
+        }
     }
 }
 
@@ -325,7 +327,7 @@ static inline void mcdc(uint16_t *dst, const uint16_t *src, int log2w,
         }
         break;
     default:
-        assert(0);
+        av_assert2(0);
     }
 }
 
@@ -340,7 +342,7 @@ static void decode_p_block(FourXContext *f, uint16_t *dst, uint16_t *src,
     uint16_t *start = (uint16_t *)f->last_picture.data[0];
     uint16_t *end   = start + stride * (f->avctx->height - h + 1) - (1 << log2w);
 
-    assert(code >= 0 && code <= 6);
+    av_assert2(code >= 0 && code <= 6);
 
     if (code == 0) {
         if (f->g.buffer_end - f->g.buffer < 1) {