]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/eatqi.c
Merge commit 'd4066a702407352a0648af882c34ea81a404fa2b'
[ffmpeg] / libavcodec / eatqi.c
index 8688f59193811bafe280f2f426e96fb421c4e33e..8fd5cdb17f670d3ece2acada1dbaba3d2ae95389 100644 (file)
@@ -37,6 +37,7 @@
 #include "mpeg12.h"
 
 typedef struct TqiContext {
+    AVCodecContext *avctx;
     GetBitContext gb;
     BlockDSPContext bdsp;
     BswapDSPContext bsdsp;
@@ -51,7 +52,6 @@ typedef struct TqiContext {
     int last_dc[3];
 
     DECLARE_ALIGNED(16, int16_t, block)[6][64];
-    int block_last_index[12];
 } TqiContext;
 
 static av_cold int tqi_decode_init(AVCodecContext *avctx)
@@ -79,9 +79,12 @@ static int tqi_decode_mb(TqiContext *t, int16_t (*block)[64])
         int ret = ff_mpeg1_decode_block_intra(&t->gb,
                                               t->intra_matrix,
                                               t->intra_scantable.permutated,
-                                              t->last_dc, block[n], n, 1, t->block_last_index);
-        if (ret < 0)
+                                              t->last_dc, block[n], n, 1);
+        if (ret < 0) {
+            av_log(t->avctx, AV_LOG_ERROR, "ac-tex damaged at %d %d\n",
+                   t->mb_x, t->mb_y);
             return -1;
+        }
     }
 
     return 0;
@@ -128,6 +131,8 @@ static int tqi_decode_frame(AVCodecContext *avctx,
     AVFrame *frame = data;
     int ret, w, h;
 
+    t->avctx = avctx;
+
     w = AV_RL16(&buf[0]);
     h = AV_RL16(&buf[2]);
     tqi_calculate_qtable(t, buf[4]);