]> git.sesse.net Git - ffmpeg/commitdiff
Merge commit '4b6b1082a73907c7c3de2646c6398bc61320f2c6'
authorMichael Niedermayer <michael@niedermayer.cc>
Mon, 27 Jul 2015 19:03:20 +0000 (21:03 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Mon, 27 Jul 2015 19:03:20 +0000 (21:03 +0200)
* commit '4b6b1082a73907c7c3de2646c6398bc61320f2c6':
  lavc: Deprecate avctx.me_method

Conflicts:
doc/encoders.texi
libavcodec/avcodec.h
libavcodec/libx264.c
libavcodec/motion_est.c
libavcodec/options_table.h
libavcodec/version.h

Merged-by: Michael Niedermayer <michael@niedermayer.cc>
13 files changed:
1  2 
libavcodec/avcodec.h
libavcodec/libx264.c
libavcodec/libxavs.c
libavcodec/libxvid.c
libavcodec/motion_est.c
libavcodec/motion_est.h
libavcodec/mpegvideo.h
libavcodec/mpegvideo_enc.c
libavcodec/options_table.h
libavcodec/svq1enc.c
libavcodec/svq1enc.h
libavcodec/version.h
libavcodec/wmv2enc.c

index af30ff012d61ac5182d0af11fd3295524f7a95d2,6fb3c0fc35351d487215035ef44948e77c3ab10c..a89de523640a75c46cc621f0a4946104e3386131
@@@ -656,8 -561,8 +658,9 @@@ enum Motion_Est_ID 
      ME_HEX,         ///< hexagon based search
      ME_UMH,         ///< uneven multi-hexagon search
      ME_TESA,        ///< transformed exhaustive search algorithm
 +    ME_ITER=50,     ///< iterative search
  };
+ #endif
  
  /**
   * @ingroup lavc_decoding
index 7b17a8863c6ef13602128e5fd570ca7fe356fd20,531d8970d773dc00dab3d68751db5b7aa2488be0..1deadf49a4207b6326fe42124d372c31b3433de5
@@@ -80,7 -76,7 +80,8 @@@ typedef struct X264Context 
      int slice_max_size;
      char *stats;
      int nal_hrd;
 +    int avcintra_class;
+     int motion_est;
      char *x264_params;
  } X264Context;
  
@@@ -461,26 -390,11 +462,15 @@@ static av_cold int X264_init(AVCodecCon
              (float)avctx->rc_initial_buffer_occupancy / avctx->rc_buffer_size;
      }
  
 +    OPT_STR("level", x4->level);
 +
      if (avctx->i_quant_factor > 0)
          x4->params.rc.f_ip_factor         = 1 / fabs(avctx->i_quant_factor);
 -    x4->params.rc.f_pb_factor             = avctx->b_quant_factor;
 -    x4->params.analyse.i_chroma_qp_offset = avctx->chromaoffset;
 +    if (avctx->b_quant_factor > 0)
 +        x4->params.rc.f_pb_factor         = avctx->b_quant_factor;
 +    if (avctx->chromaoffset)
 +        x4->params.analyse.i_chroma_qp_offset = avctx->chromaoffset;
  
-     if (avctx->me_method == ME_EPZS)
-         x4->params.analyse.i_me_method = X264_ME_DIA;
-     else if (avctx->me_method == ME_HEX)
-         x4->params.analyse.i_me_method = X264_ME_HEX;
-     else if (avctx->me_method == ME_UMH)
-         x4->params.analyse.i_me_method = X264_ME_UMH;
-     else if (avctx->me_method == ME_FULL)
-         x4->params.analyse.i_me_method = X264_ME_ESA;
-     else if (avctx->me_method == ME_TESA)
-         x4->params.analyse.i_me_method = X264_ME_TESA;
      if (avctx->gop_size >= 0)
          x4->params.i_keyint_max         = avctx->gop_size;
      if (avctx->max_b_frames >= 0)
      if (x4->nal_hrd >= 0)
          x4->params.i_nal_hrd = x4->nal_hrd;
  
+     if (x4->motion_est >= 0) {
+         x4->params.analyse.i_me_method = x4->motion_est;
+ #if FF_API_MOTION_EST
+ FF_DISABLE_DEPRECATION_WARNINGS
+     } else {
+         if (avctx->me_method == ME_EPZS)
+             x4->params.analyse.i_me_method = X264_ME_DIA;
+         else if (avctx->me_method == ME_HEX)
+             x4->params.analyse.i_me_method = X264_ME_HEX;
+         else if (avctx->me_method == ME_UMH)
+             x4->params.analyse.i_me_method = X264_ME_UMH;
+         else if (avctx->me_method == ME_FULL)
+             x4->params.analyse.i_me_method = X264_ME_ESA;
+         else if (avctx->me_method == ME_TESA)
+             x4->params.analyse.i_me_method = X264_ME_TESA;
+ FF_ENABLE_DEPRECATION_WARNINGS
+ #endif
+     }
      if (x4->profile)
          if (x264_param_apply_profile(&x4->params, x4->profile) < 0) {
 +            int i;
              av_log(avctx, AV_LOG_ERROR, "Error setting profile %s.\n", x4->profile);
 +            av_log(avctx, AV_LOG_INFO, "Possible profiles:");
 +            for (i = 0; x264_profile_names[i]; i++)
 +                av_log(avctx, AV_LOG_INFO, " %s", x264_profile_names[i]);
 +            av_log(avctx, AV_LOG_INFO, "\n");
              return AVERROR(EINVAL);
          }
  
@@@ -853,7 -684,12 +862,13 @@@ static const AVOption options[] = 
      { "none",          NULL, 0, AV_OPT_TYPE_CONST, {.i64 = X264_NAL_HRD_NONE}, INT_MIN, INT_MAX, VE, "nal-hrd" },
      { "vbr",           NULL, 0, AV_OPT_TYPE_CONST, {.i64 = X264_NAL_HRD_VBR},  INT_MIN, INT_MAX, VE, "nal-hrd" },
      { "cbr",           NULL, 0, AV_OPT_TYPE_CONST, {.i64 = X264_NAL_HRD_CBR},  INT_MIN, INT_MAX, VE, "nal-hrd" },
 +    { "avcintra-class","AVC-Intra class 50/100/200",                      OFFSET(avcintra_class),AV_OPT_TYPE_INT,     { .i64 = -1 }, -1, 200   , VE},
+     { "motion-est",   "Set motion estimation method",                     OFFSET(motion_est),    AV_OPT_TYPE_INT,    { .i64 = -1 }, -1, X264_ME_TESA, VE, "motion-est"},
+     { "dia",           NULL, 0, AV_OPT_TYPE_CONST, { .i64 = X264_ME_DIA },  INT_MIN, INT_MAX, VE, "motion-est" },
+     { "hex",           NULL, 0, AV_OPT_TYPE_CONST, { .i64 = X264_ME_HEX },  INT_MIN, INT_MAX, VE, "motion-est" },
+     { "umh",           NULL, 0, AV_OPT_TYPE_CONST, { .i64 = X264_ME_UMH },  INT_MIN, INT_MAX, VE, "motion-est" },
+     { "esa",           NULL, 0, AV_OPT_TYPE_CONST, { .i64 = X264_ME_ESA },  INT_MIN, INT_MAX, VE, "motion-est" },
+     { "tesa",          NULL, 0, AV_OPT_TYPE_CONST, { .i64 = X264_ME_TESA }, INT_MIN, INT_MAX, VE, "motion-est" },
      { "x264-params",  "Override the x264 configuration using a :-separated list of key=value parameters", OFFSET(x264_params), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE },
      { NULL },
  };
Simple merge
Simple merge
index 477a6827cee82754ce73196c46239171a5041ccf,83d7b39e91ab164c906cc4899f88e6e14a4605b8..5ec16ad62d019330f216be73979467869114571d
@@@ -312,11 -309,25 +312,26 @@@ int ff_init_me(MpegEncContext *s)
          av_log(s->avctx, AV_LOG_ERROR, "ME_MAP size is too small for SAB diamond\n");
          return -1;
      }
-     if(s->me_method!=ME_ZERO && s->me_method!=ME_EPZS && s->me_method!=ME_X1 && s->avctx->codec_id != AV_CODEC_ID_SNOW){
-         av_log(s->avctx, AV_LOG_ERROR, "me_method is only allowed to be set to zero and epzs; for hex,umh,full and others see dia_size\n");
-         return -1;
+ #if FF_API_MOTION_EST
 +    //special case of snow is needed because snow uses its own iterative ME code
 -        else {
+ FF_DISABLE_DEPRECATION_WARNINGS
+     if (s->motion_est == FF_ME_EPZS) {
+         if (s->me_method == ME_ZERO)
+             s->motion_est = FF_ME_ZERO;
+         else if (s->me_method == ME_EPZS)
+             s->motion_est = FF_ME_EPZS;
+         else if (s->me_method == ME_X1)
+             s->motion_est = FF_ME_XONE;
++        else if (s->avctx->codec_id != AV_CODEC_ID_SNOW) {
+             av_log(s->avctx, AV_LOG_ERROR,
+                    "me_method is only allowed to be set to zero and epzs; "
+                    "for hex,umh,full and others see dia_size\n");
+             return -1;
+         }
      }
+ FF_ENABLE_DEPRECATION_WARNINGS
+ #endif
  
      c->avctx= s->avctx;
  
index 199ae8da9055cd61a6647d120cd42b17b0c48aef,a5c662f8c5357c8e4c4ec2c54feb51b2cde36126..e09f705eeec6c87ae5bf6b4630c6f0d1ed674854
  
  struct MpegEncContext;
  
 -#define MAX_MV 2048
 +#define MAX_MV 4096
  
+ #define FF_ME_ZERO 0
+ #define FF_ME_EPZS 1
+ #define FF_ME_XONE 2
  /**
   * Motion estimation context.
   */
Simple merge
Simple merge
index 140df709ac1654213fb8bf1ca94df7bf12a1c16b,c5b2f76659ea67df5ef6c4f9c7ba7762659d74d1..2b0a0464e06b22792f17b6d0a38f3fdd8598eb68
@@@ -84,12 -82,9 +84,13 @@@ static const AVOption avcodec_options[
  {"output_corrupt", "Output even potentially corrupted frames", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_OUTPUT_CORRUPT }, INT_MIN, INT_MAX, V|D, "flags"},
  {"fast", "allow non-spec-compliant speedup tricks", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_FAST }, INT_MIN, INT_MAX, V|E, "flags2"},
  {"noout", "skip bitstream encoding", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_NO_OUTPUT }, INT_MIN, INT_MAX, V|E, "flags2"},
 -{"ignorecrop", "ignore cropping information from sps", 1, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_IGNORE_CROP }, INT_MIN, INT_MAX, V|D, "flags2"},
 +{"ignorecrop", "ignore cropping information from sps", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_IGNORE_CROP }, INT_MIN, INT_MAX, V|D, "flags2"},
  {"local_header", "place global headers at every keyframe instead of in extradata", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_LOCAL_HEADER }, INT_MIN, INT_MAX, V|E, "flags2"},
 +{"chunks", "Frame data might be split into multiple chunks", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_CHUNKS }, INT_MIN, INT_MAX, V|D, "flags2"},
 +{"showall", "Show all frames before the first keyframe", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_SHOW_ALL }, INT_MIN, INT_MAX, V|D, "flags2"},
 +{"export_mvs", "export motion vectors through frame side data", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_EXPORT_MVS}, INT_MIN, INT_MAX, V|D, "flags2"},
 +{"skip_manual", "do not skip samples and export skip information as frame side data", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_SKIP_MANUAL}, INT_MIN, INT_MAX, V|D, "flags2"},
+ #if FF_API_MOTION_EST
  {"me_method", "set motion estimation method", OFFSET(me_method), AV_OPT_TYPE_INT, {.i64 = ME_EPZS }, INT_MIN, INT_MAX, V|E, "me_method"},
  {"zero", "zero motion estimation (fastest)", 0, AV_OPT_TYPE_CONST, {.i64 = ME_ZERO }, INT_MIN, INT_MAX, V|E, "me_method" },
  {"full", "full motion estimation (slowest)", 0, AV_OPT_TYPE_CONST, {.i64 = ME_FULL }, INT_MIN, INT_MAX, V|E, "me_method" },
  {"x1", "X1 motion estimation", 0, AV_OPT_TYPE_CONST, {.i64 = ME_X1 }, INT_MIN, INT_MAX, V|E, "me_method" },
  {"hex", "hex motion estimation", 0, AV_OPT_TYPE_CONST, {.i64 = ME_HEX }, INT_MIN, INT_MAX, V|E, "me_method" },
  {"umh", "umh motion estimation", 0, AV_OPT_TYPE_CONST, {.i64 = ME_UMH }, INT_MIN, INT_MAX, V|E, "me_method" },
 -{"extradata_size", NULL, OFFSET(extradata_size), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
 +{"iter", "iter motion estimation", 0, AV_OPT_TYPE_CONST, {.i64 = ME_ITER }, INT_MIN, INT_MAX, V|E, "me_method" },
+ #endif
  {"time_base", NULL, OFFSET(time_base), AV_OPT_TYPE_RATIONAL, {.dbl = 0}, INT_MIN, INT_MAX},
  {"g", "set the group of picture (GOP) size", OFFSET(gop_size), AV_OPT_TYPE_INT, {.i64 = 12 }, INT_MIN, INT_MAX, V|E},
 -{"ar", "set audio sampling rate (in Hz)", OFFSET(sample_rate), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, A|D|E},
 -{"ac", "set number of audio channels", OFFSET(channels), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, A|D|E},
 +{"ar", "set audio sampling rate (in Hz)", OFFSET(sample_rate), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 0, INT_MAX, A|D|E},
 +{"ac", "set number of audio channels", OFFSET(channels), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 0, INT_MAX, A|D|E},
  {"cutoff", "set cutoff bandwidth", OFFSET(cutoff), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, A|E},
  {"frame_size", NULL, OFFSET(frame_size), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, A|E},
  {"frame_number", NULL, OFFSET(frame_number), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
Simple merge
index 68afaea13b8c628a022b21cac527a6f5e3f5101a,62e8bb2699f3dc4f47ea8459651d0049ac473b9c..37f05a0460b8adfaed6cdf3bce3d3db10205ce77
@@@ -74,8 -72,10 +74,10 @@@ typedef struct SVQ1EncContext 
  
      uint8_t *scratchbuf;
  
+     int motion_est;
      int (*ssd_int8_vs_int16)(const int8_t *pix1, const int16_t *pix2,
 -                             int size);
 +                             intptr_t size);
  } SVQ1EncContext;
  
  void ff_svq1enc_init_ppc(SVQ1EncContext *c);
index 75061e47daa8e53817a8bc1da180cab5de87bd40,28a28097fc3589b585d6c01a1e8b54c05da8f0af..c29b4a45981798ff8075910b74f79660b9e2eef5
@@@ -29,8 -29,8 +29,8 @@@
  #include "libavutil/version.h"
  
  #define LIBAVCODEC_VERSION_MAJOR 56
 -#define LIBAVCODEC_VERSION_MINOR 34
 -#define LIBAVCODEC_VERSION_MICRO  1
 +#define LIBAVCODEC_VERSION_MINOR  55
- #define LIBAVCODEC_VERSION_MICRO 100
++#define LIBAVCODEC_VERSION_MICRO 101
  
  #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
                                                 LIBAVCODEC_VERSION_MINOR, \
Simple merge