Merge commit 'cf1e0786ed64e69614760bfb4ecd7adbde8e6094'
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 27 Jan 2015 13:56:52 +0000 (14:56 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 27 Jan 2015 13:56:52 +0000 (14:56 +0100)
* commit 'cf1e0786ed64e69614760bfb4ecd7adbde8e6094':
  error_resilience: move the MECmpContext initialization into ER code

Conflicts:
libavcodec/error_resilience.c
libavcodec/h264.c
libavcodec/h264.h
libavcodec/h264_slice.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavcodec/error_resilience.c
libavcodec/error_resilience.h
libavcodec/h264.c
libavcodec/h264.h
libavcodec/h264_slice.c
libavcodec/mpegvideo.c

@@@ -736,12 -714,11 +737,12 @@@ static int is_intra_more_likely(ERConte
                  } else {
                      ff_thread_await_progress(s->last_pic.tf, mb_y, 0);
                  }
-                 is_intra_likely += s->mecc->sad[0](NULL, last_mb_ptr, mb_ptr,
-                                                    linesize[0], 16);
+                 is_intra_likely += s->mecc.sad[0](NULL, last_mb_ptr, mb_ptr,
+                                                   linesize[0], 16);
 +                // FIXME need await_progress() here
-                 is_intra_likely -= s->mecc->sad[0](NULL, last_mb_ptr,
-                                                    last_mb_ptr + linesize[0] * 16,
-                                                    linesize[0], 16);
+                 is_intra_likely -= s->mecc.sad[0](NULL, last_mb_ptr,
+                                                   last_mb_ptr + linesize[0] * 16,
+                                                   linesize[0], 16);
              } else {
                  if (IS_INTRA(s->cur_pic.mb_type[mb_xy]))
                     is_intra_likely++;
Simple merge
@@@ -649,11 -616,8 +648,9 @@@ av_cold int ff_h264_decode_init(AVCodec
      ff_h264_pred_init(&h->hpc, h->avctx->codec_id, 8, 1);
  
      h->dequant_coeff_pps = -1;
 +    h->current_sps_id = -1;
  
      /* needed so that IDCT permutation is known early */
-     if (CONFIG_ERROR_RESILIENCE)
-         ff_me_cmp_init(&h->mecc, h->avctx);
      ff_videodsp_init(&h->vdsp, 8);
  
      memset(h->pps.scaling_matrix4, 16, 6 * 16 * sizeof(uint8_t));
@@@ -1271,9 -1228,6 +1268,7 @@@ int ff_h264_set_parameter_from_sps(H264
              ff_h264qpel_init(&h->h264qpel, h->sps.bit_depth_luma);
              ff_h264_pred_init(&h->hpc, h->avctx->codec_id, h->sps.bit_depth_luma,
                                h->sps.chroma_format_idc);
-             if (CONFIG_ERROR_RESILIENCE)
-                 ff_me_cmp_init(&h->mecc, h->avctx);
 +
              ff_videodsp_init(&h->vdsp, h->sps.bit_depth_luma);
          } else {
              av_log(h->avctx, AV_LOG_ERROR, "Unsupported bit depth %d\n",
@@@ -36,8 -36,6 +36,7 @@@
  #include "h264dsp.h"
  #include "h264pred.h"
  #include "h264qpel.h"
- #include "me_cmp.h"
 +#include "internal.h" // for avpriv_find_start_code()
  #include "mpegutils.h"
  #include "parser.h"
  #include "qpeldsp.h"
@@@ -338,9 -300,7 +337,8 @@@ typedef struct H264Picture 
   * H264Context
   */
  typedef struct H264Context {
 +    AVClass *av_class;
      AVCodecContext *avctx;
-     MECmpContext mecc;
      VideoDSPContext vdsp;
      H264DSPContext h264dsp;
      H264ChromaContext h264chroma;
@@@ -1202,14 -1109,9 +1202,11 @@@ static int h264_slice_header_init(H264C
          for (i = 1; i < h->slice_context_count; i++) {
              H264Context *c;
              c                    = h->thread_context[i] = av_mallocz(sizeof(H264Context));
 -            if (!c)
 -                return AVERROR(ENOMEM);
 +            if (!c) {
 +                ret = AVERROR(ENOMEM);
 +                goto fail;
 +            }
              c->avctx             = h->avctx;
-             if (CONFIG_ERROR_RESILIENCE) {
-                 c->mecc              = h->mecc;
-             }
              c->vdsp              = h->vdsp;
              c->h264dsp           = h->h264dsp;
              c->h264qpel          = h->h264qpel;
@@@ -382,9 -380,7 +382,8 @@@ static void gray8(uint8_t *dst, const u
  static av_cold int dct_init(MpegEncContext *s)
  {
      ff_blockdsp_init(&s->bdsp, s->avctx);
 +    ff_h264chroma_init(&s->h264chroma, 8); //for lowres
      ff_hpeldsp_init(&s->hdsp, s->avctx->flags);
-     ff_me_cmp_init(&s->mecc, s->avctx);
      ff_mpegvideodsp_init(&s->mdsp);
      ff_videodsp_init(&s->vdsp, s->avctx->bits_per_raw_sample);