Merge commit 'ebfe622bb1ca57cecb932e42926745cba7161913'
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 9 Jan 2014 13:12:19 +0000 (14:12 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 9 Jan 2014 13:19:24 +0000 (14:19 +0100)
* commit 'ebfe622bb1ca57cecb932e42926745cba7161913':
  mpegvideo: drop support for real (non-emulated) edges

Conflicts:
libavcodec/mpegvideo.c
libavcodec/mpegvideo_motion.c
libavcodec/wmv2.c

If this is slower on a major platform then it should be investigated
and potentially reverted.

See: 8fc52a5ef94712d900fc8fe7503cf9c9ba635143
See: 3969b4b861ce8152e3195e8f8c3437abd273b90a
Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavcodec/mpegvideo.c
libavcodec/mpegvideo.h
libavcodec/mpegvideo_enc.c
libavcodec/mpegvideo_motion.c
libavcodec/mss2.c
libavcodec/rv34.c
libavcodec/svq3.c
libavcodec/vc1dec.c
libavcodec/wmv2.c

@@@ -1852,32 -1823,16 +1852,6 @@@ int ff_MPV_frame_start(MpegEncContext *
  /* called after a frame has been decoded. */
  void ff_MPV_frame_end(MpegEncContext *s)
  {
-     if ((s->er.error_count || !(s->avctx->codec->capabilities&CODEC_CAP_DRAW_HORIZ_BAND)) &&
-         !s->avctx->hwaccel &&
-         !(s->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU) &&
-         s->unrestricted_mv &&
-         s->current_picture.reference &&
-         !s->intra_only &&
-         !(s->flags & CODEC_FLAG_EMU_EDGE) &&
-         !s->avctx->lowres
-        ) {
-         const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(s->avctx->pix_fmt);
-         int hshift = desc->log2_chroma_w;
-         int vshift = desc->log2_chroma_h;
-         s->dsp.draw_edges(s->current_picture.f.data[0], s->current_picture.f.linesize[0],
-                           s->h_edge_pos, s->v_edge_pos,
-                           EDGE_WIDTH, EDGE_WIDTH,
-                           EDGE_TOP | EDGE_BOTTOM);
-         s->dsp.draw_edges(s->current_picture.f.data[1], s->current_picture.f.linesize[1],
-                           s->h_edge_pos >> hshift, s->v_edge_pos >> vshift,
-                           EDGE_WIDTH >> hshift, EDGE_WIDTH >> vshift,
-                           EDGE_TOP | EDGE_BOTTOM);
-         s->dsp.draw_edges(s->current_picture.f.data[2], s->current_picture.f.linesize[2],
-                           s->h_edge_pos >> hshift, s->v_edge_pos >> vshift,
-                           EDGE_WIDTH >> hshift, EDGE_WIDTH >> vshift,
-                           EDGE_TOP | EDGE_BOTTOM);
-     }
 -#if FF_API_XVMC
 -FF_DISABLE_DEPRECATION_WARNINGS
 -    /* redraw edges for the frame if decoding didn't complete */
 -    // just to make sure that all data is rendered.
 -    if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration) {
 -        ff_xvmc_field_end(s);
 -    } else
 -FF_ENABLE_DEPRECATION_WARNINGS
 -#endif /* FF_API_XVMC */
--
      emms_c();
  
      if (s->current_picture.reference)
@@@ -3106,10 -2346,9 +3055,9 @@@ void ff_draw_horiz_band(AVCodecContext 
  
  void ff_mpeg_draw_horiz_band(MpegEncContext *s, int y, int h)
  {
-     int draw_edges = s->unrestricted_mv && !s->intra_only;
 -    ff_draw_horiz_band(s->avctx, &s->dsp, &s->current_picture,
 -                       &s->last_picture, y, h, s->picture_structure,
 +    ff_draw_horiz_band(s->avctx, &s->dsp, s->current_picture_ptr,
 +                       s->last_picture_ptr, y, h, s->picture_structure,
-                        s->first_field, draw_edges, s->low_delay,
+                        s->first_field, s->low_delay,
                         s->v_edge_pos, s->h_edge_pos);
  }
  
Simple merge
Simple merge
@@@ -209,7 -208,7 +209,6 @@@ static inline int hpel_motion(MpegEncCo
          dxy |= (motion_y & 1) << 1;
      src += src_y * s->linesize + src_x;
  
-     if (s->flags & CODEC_FLAG_EMU_EDGE) {
 -    if (s->unrestricted_mv) {
          if ((unsigned)src_x > FFMAX(s->h_edge_pos - (motion_x & 1) - 8, 0) ||
              (unsigned)src_y > FFMAX(s->v_edge_pos - (motion_y & 1) - 8, 0)) {
              s->vdsp.emulated_edge_mc(s->edge_emu_buffer, src,
              src = s->edge_emu_buffer;
              emu = 1;
          }
--    }
      pix_op[dxy](dest, src, s->linesize, 8);
      return emu;
  }
Simple merge
Simple merge
Simple merge
@@@ -5608,21 -5598,9 +5608,19 @@@ static av_cold int vc1_decode_init(AVCo
          avctx->pix_fmt = AV_PIX_FMT_GRAY8;
      avctx->hwaccel = ff_find_hwaccel(avctx);
      v->s.avctx = avctx;
-     avctx->flags |= CODEC_FLAG_EMU_EDGE;
-     v->s.flags   |= CODEC_FLAG_EMU_EDGE;
  
 -    if (ff_vc1_init_common(v) < 0)
 -        return -1;
 +    if ((ret = ff_vc1_init_common(v)) < 0)
 +        return ret;
 +    // ensure static VLC tables are initialized
 +    if ((ret = ff_msmpeg4_decode_init(avctx)) < 0)
 +        return ret;
 +    if ((ret = ff_vc1_decode_init_alloc_tables(v)) < 0)
 +        return ret;
 +    // Hack to ensure the above functions will be called
 +    // again once we know all necessary settings.
 +    // That this is necessary might indicate a bug.
 +    ff_vc1_decode_end(avctx);
 +
      ff_h264chroma_init(&v->h264chroma, 8);
      ff_vc1dsp_init(&v->vc1dsp);
  
Simple merge