OSDN Git Service

Merge commit '68127e1bf8037a6e0acd6401cc8c5da950e3fa0a'
authorDerek Buitenhuis <derek.buitenhuis@gmail.com>
Sun, 24 Apr 2016 11:19:53 +0000 (12:19 +0100)
committerDerek Buitenhuis <derek.buitenhuis@gmail.com>
Sun, 24 Apr 2016 11:19:53 +0000 (12:19 +0100)
* commit '68127e1bf8037a6e0acd6401cc8c5da950e3fa0a':
  intrax8: Keep a reference to the context idctdsp

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
1  2 
configure
libavcodec/intrax8.c
libavcodec/intrax8.h
libavcodec/vc1dec.c
libavcodec/wmv2dec.c

diff --cc configure
+++ b/configure
@@@ -2260,8 -1863,9 +2260,9 @@@ error_resilience_select="me_cmp
  faandct_deps="faan fdctdsp"
  faanidct_deps="faan idctdsp"
  h264dsp_select="startcode"
 +frame_thread_encoder_deps="encoders threads"
+ intrax8_select="idctdsp"
  mdct_select="fft"
 -rdft_select="fft"
  me_cmp_select="fdctdsp idctdsp pixblockdsp"
  mpeg_er_select="error_resilience"
  mpegaudio_select="mpegaudiodsp"
@@@ -488,7 -492,7 +488,7 @@@ static void x8_ac_compensation(IntraX8C
  {
      MpegEncContext *const s = w->s;
      int t;
- #define B(x,y)  s->block[0][w->idct_permutation[(x)+(y)*8]]
 -#define B(x, y) s->block[0][w->idsp.idct_permutation[(x) + (y) * 8]]
++#define B(x,y)  s->block[0][w->idct_permutation[(x) + (y) * 8]]
  #define T(x)  ((x) * dc_level + 0x8000) >> 16;
      switch (direction) {
      case 0:
@@@ -745,9 -750,10 +746,10 @@@ av_cold int ff_intrax8_common_init(Intr
      if (ret < 0)
          return ret;
  
+     w->idsp = *idsp;
      w->s = s;
  
 -    // two rows, 2 blocks per cannon mb
 +    //two rows, 2 blocks per cannon mb
      w->prediction_table = av_mallocz(s->mb_width * 2 * 2);
      if (!w->prediction_table)
          return AVERROR(ENOMEM);
@@@ -21,8 -21,8 +21,9 @@@
  
  #include "get_bits.h"
  #include "mpegvideo.h"
+ #include "idctdsp.h"
  #include "intrax8dsp.h"
 +#include "wmv2dsp.h"
  
  typedef struct IntraX8Context {
      VLC *j_ac_vlc[4]; // they point to the static j_mb_vlc
      // set by ff_intrax8_common_init
      uint8_t *prediction_table; // 2 * (mb_w * 2)
      ScanTable scantable[3];
 +    WMV2DSPContext wdsp;
 +    uint8_t idct_permutation[64];
  
 -    // set by the caller codec
 -    MpegEncContext *s;
 +    //set by the caller codec
 +    MpegEncContext * s;
      IntraX8DSPContext dsp;
+     IDCTDSPContext idsp;
      int quant;
      int dquant;
      int qsum;
@@@ -382,12 -372,14 +382,12 @@@ av_cold int ff_vc1_decode_init_alloc_ta
      v->mv_f_next[1]     = v->mv_f_next[0] + (s->b8_stride * (mb_height * 2 + 1) + s->mb_stride * (mb_height + 1) * 2);
  
      if (s->avctx->codec_id == AV_CODEC_ID_WMV3IMAGE || s->avctx->codec_id == AV_CODEC_ID_VC1IMAGE) {
 -        for (i = 0; i < 4; i++) {
 -            v->sr_rows[i >> 1][i & 1] = av_malloc(v->output_width);
 -            if (!v->sr_rows[i >> 1][i & 1])
 -                goto error;
 -        }
 +        for (i = 0; i < 4; i++)
 +            if (!(v->sr_rows[i >> 1][i & 1] = av_malloc(v->output_width)))
 +                return AVERROR(ENOMEM);
      }
  
-     ret = ff_intrax8_common_init(&v->x8, s);
+     ret = ff_intrax8_common_init(&v->x8, &s->idsp, s);
      if (ret < 0)
          goto error;
  
Simple merge