Merge commit 'f7d77b9a5dd42bf0f5dffecf590466b4c4239437'
authorDerek Buitenhuis <derek.buitenhuis@gmail.com>
Tue, 16 Feb 2016 19:40:06 +0000 (19:40 +0000)
committerDerek Buitenhuis <derek.buitenhuis@gmail.com>
Tue, 16 Feb 2016 19:41:55 +0000 (19:41 +0000)
* commit 'f7d77b9a5dd42bf0f5dffecf590466b4c4239437':
  eatqi: Remove MpegEncContext dependency

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
1  2 
configure
libavcodec/Makefile
libavcodec/eatqi.c

diff --cc configure
+++ b/configure
@@@ -2283,9 -1941,9 +2283,9 @@@ dxv_decoder_select="lzf texturedsp
  eac3_decoder_select="ac3_decoder"
  eac3_encoder_select="ac3_encoder"
  eamad_decoder_select="aandcttables blockdsp bswapdsp idctdsp mpegvideo"
 -eatgq_decoder_select="aandcttables idctdsp"
 +eatgq_decoder_select="aandcttables"
- eatqi_decoder_select="aandcttables blockdsp bswapdsp idctdsp mpeg1video_decoder"
+ eatqi_decoder_select="aandcttables blockdsp bswapdsp idctdsp"
 -exr_decoder_deps="zlib"
 +exr_decoder_select="zlib"
  ffv1_decoder_select="golomb rangecoder"
  ffv1_encoder_select="rangecoder"
  ffvhuff_decoder_select="huffyuv_decoder"
Simple merge
  #include "idctdsp.h"
  #include "internal.h"
  #include "mpeg12.h"
- #include "mpegvideo.h"
  
  typedef struct TqiContext {
-     MpegEncContext s;
+     GetBitContext gb;
+     BlockDSPContext bdsp;
      BswapDSPContext bsdsp;
+     IDCTDSPContext idsp;
+     ScanTable intra_scantable;
      void *bitstream_buf;
      unsigned int bitstream_buf_size;
+     int mb_x, mb_y;
+     uint16_t intra_matrix[64];
+     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)
      return 0;
  }
  
- static int tqi_decode_mb(MpegEncContext *s, int16_t (*block)[64])
+ static int tqi_decode_mb(TqiContext *t, int16_t (*block)[64])
  {
      int n;
-     s->bdsp.clear_blocks(block[0]);
+     t->bdsp.clear_blocks(block[0]);
      for (n = 0; n < 6; n++) {
-         int ret = ff_mpeg1_decode_block_intra(&s->gb,
-                                               s->intra_matrix,
-                                               s->intra_scantable.permutated,
-                                               s->last_dc, block[n], n, 1, s->block_last_index);
+         int ret = ff_mpeg1_decode_block_intra(&t->gb,
+                                               t->intra_matrix,
+                                               t->intra_scantable.permutated,
 -                                              t->last_dc, block[n], n, 1);
++                                              t->last_dc, block[n], n, 1, t->block_last_index);
          if (ret < 0)
              return -1;
      }
@@@ -135,17 -147,18 +146,19 @@@ static int tqi_decode_frame(AVCodecCont
          return AVERROR(ENOMEM);
      t->bsdsp.bswap_buf(t->bitstream_buf, (const uint32_t *) buf,
                         (buf_end - buf) / 4);
-     init_get_bits(&s->gb, t->bitstream_buf, 8*(buf_end-buf));
-     s->last_dc[0] = s->last_dc[1] = s->last_dc[2] = 0;
-     for (s->mb_y=0; s->mb_y<(avctx->height+15)/16; s->mb_y++)
-     for (s->mb_x=0; s->mb_x<(avctx->width+15)/16; s->mb_x++)
-     {
-         if (tqi_decode_mb(s, t->block) < 0)
-             goto end;
-         tqi_idct_put(t, frame, t->block);
+     init_get_bits(&t->gb, t->bitstream_buf, 8 * (buf_end - buf));
+     t->last_dc[0] =
+     t->last_dc[1] =
+     t->last_dc[2] = 0;
+     for (t->mb_y = 0; t->mb_y < (h + 15) / 16; t->mb_y++) {
+         for (t->mb_x = 0; t->mb_x < (w + 15) / 16; t->mb_x++) {
+             if (tqi_decode_mb(t, t->block) < 0)
 -                break;
++                goto end;
+             tqi_idct_put(avctx, frame, t->block);
+         }
      }
 +    end:
  
      *got_frame = 1;
      return buf_size;