]> git.sesse.net Git - ffmpeg/commitdiff
Merge commit 'be00ec832c519427cd92218abac77dafdc1d5487'
authorHendrik Leppkes <h.leppkes@gmail.com>
Fri, 18 Dec 2015 13:27:41 +0000 (14:27 +0100)
committerHendrik Leppkes <h.leppkes@gmail.com>
Fri, 18 Dec 2015 13:27:41 +0000 (14:27 +0100)
* commit 'be00ec832c519427cd92218abac77dafdc1d5487':
  lavc: Deprecate coder_type and its symbols

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
1  2 
libavcodec/avcodec.h
libavcodec/ffv1enc.c
libavcodec/libopenh264enc.c
libavcodec/libschroedingerenc.c
libavcodec/libx264.c
libavcodec/options_table.h
libavcodec/sgienc.c
libavcodec/sunrastenc.c
libavcodec/targaenc.c
libavcodec/version.h

Simple merge
index e4482127980f16f846ec6505f099c847098fe66b,0158605b91bad886e8ad0283722077ca79e34ace..6b5c4b24f3aed0bf143e3412fcb22bf925f6e115
@@@ -695,15 -578,24 +695,20 @@@ static av_cold int encode_init(AVCodecC
          s->ec = (s->version >= 3);
      }
  
 -    if (s->version >= 2 &&
 -        avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) {
 -        av_log(avctx, AV_LOG_ERROR,
 -               "Version %d requested, please set -strict experimental in "
 -               "order to enable it\n",
 -               s->version);
 -        return AVERROR(ENOSYS);
 +    if ((s->version == 2 || s->version>3) && avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) {
 +        av_log(avctx, AV_LOG_ERROR, "Version 2 needed for requested features but version 2 is experimental and not enabled\n");
 +        return AVERROR_INVALIDDATA;
      }
  
-     s->ac = avctx->coder_type > 0 ? AC_RANGE_CUSTOM_TAB : AC_GOLOMB_RICE;
+ #if FF_API_CODER_TYPE
+ FF_DISABLE_DEPRECATION_WARNINGS
+     if (avctx->coder_type != -1)
+         s->ac = avctx->coder_type > 0 ? AC_RANGE_CUSTOM_TAB : AC_GOLOMB_RICE;
+ FF_ENABLE_DEPRECATION_WARNINGS
+ #endif
  
      s->plane_count = 3;
 -    switch (avctx->pix_fmt) {
 +    switch(avctx->pix_fmt) {
      case AV_PIX_FMT_YUV444P9:
      case AV_PIX_FMT_YUV422P9:
      case AV_PIX_FMT_YUV420P9:
@@@ -1345,7 -1071,17 +1350,16 @@@ static av_cold int encode_close(AVCodec
  #define OFFSET(x) offsetof(FFV1Context, x)
  #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
  static const AVOption options[] = {
 -    { "slicecrc", "Protect slices with CRCs", OFFSET(ec), AV_OPT_TYPE_INT,
 -             { .i64 = -1 }, -1, 1, VE },
 +    { "slicecrc", "Protect slices with CRCs", OFFSET(ec), AV_OPT_TYPE_BOOL, { .i64 = -1 }, -1, 1, VE },
+     { "coder", "Coder type", OFFSET(ac), AV_OPT_TYPE_INT,
+             { .i64 = AC_GOLOMB_RICE }, 0, 2, VE, "coder" },
+         { "rice", "Golomb rice", 0, AV_OPT_TYPE_CONST,
+             { .i64 = AC_GOLOMB_RICE }, INT_MIN, INT_MAX, VE, "coder" },
+         { "range_def", "Range with default table", 0, AV_OPT_TYPE_CONST,
+             { .i64 = AC_RANGE_DEFAULT_TAB }, INT_MIN, INT_MAX, VE, "coder" },
+         { "range_tab", "Range with custom table", 0, AV_OPT_TYPE_CONST,
+             { .i64 = AC_RANGE_CUSTOM_TAB }, INT_MIN, INT_MAX, VE, "coder" },
      { NULL }
  };
  
@@@ -1385,6 -1122,8 +1401,8 @@@ AVCodec ff_ffv1_encoder = 
          AV_PIX_FMT_NONE
  
      },
+ #if FF_API_CODER_TYPE
      .defaults       = ffv1_defaults,
 -    .priv_class     = &class,
+ #endif
 +    .priv_class     = &ffv1_class,
  };
index 8f87645a670a648d53dafb35c4b96040430b14e3,7369c12a5389476c41acb23fa9d649cf64868185..4e8fe78540a1473bd35df75622fdf2b0d1fdf8e8
@@@ -49,15 -50,16 +50,16 @@@ typedef struct SVCContext 
  #define OFFSET(x) offsetof(SVCContext, x)
  #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
  static const AVOption options[] = {
 -    { "slice_mode", "Slice mode", OFFSET(slice_mode), AV_OPT_TYPE_INT, { .i64 = SM_AUTO_SLICE }, SM_SINGLE_SLICE, SM_RESERVED, VE, "slice_mode" },
 -    { "fixed", "A fixed number of slices", 0, AV_OPT_TYPE_CONST, { .i64 = SM_FIXEDSLCNUM_SLICE }, 0, 0, VE, "slice_mode" },
 -    { "rowmb", "One slice per row of macroblocks", 0, AV_OPT_TYPE_CONST, { .i64 = SM_ROWMB_SLICE }, 0, 0, VE, "slice_mode" },
 -    { "auto", "Automatic number of slices according to number of threads", 0, AV_OPT_TYPE_CONST, { .i64 = SM_AUTO_SLICE }, 0, 0, VE, "slice_mode" },
 -    { "dyn", "Dynamic slicing", 0, AV_OPT_TYPE_CONST, { .i64 = SM_DYN_SLICE }, 0, 0, VE, "slice_mode" },
 -    { "loopfilter", "Enable loop filter", OFFSET(loopfilter), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, VE },
 -    { "profile", "Set profile restrictions", OFFSET(profile), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, VE },
 -    { "max_nal_size", "Set maximum NAL size in bytes", OFFSET(max_nal_size), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },
 -    { "allow_skip_frames", "Allow skipping frames to hit the target bitrate", OFFSET(skip_frames), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE },
 +    { "slice_mode", "set slice mode", OFFSET(slice_mode), AV_OPT_TYPE_INT, { .i64 = SM_AUTO_SLICE }, SM_SINGLE_SLICE, SM_RESERVED, VE, "slice_mode" },
 +        { "fixed", "a fixed number of slices", 0, AV_OPT_TYPE_CONST, { .i64 = SM_FIXEDSLCNUM_SLICE }, 0, 0, VE, "slice_mode" },
 +        { "rowmb", "one slice per row of macroblocks", 0, AV_OPT_TYPE_CONST, { .i64 = SM_ROWMB_SLICE }, 0, 0, VE, "slice_mode" },
 +        { "auto", "automatic number of slices according to number of threads", 0, AV_OPT_TYPE_CONST, { .i64 = SM_AUTO_SLICE }, 0, 0, VE, "slice_mode" },
 +        { "dyn", "Dynamic slicing", 0, AV_OPT_TYPE_CONST, { .i64 = SM_DYN_SLICE }, 0, 0, VE, "slice_mode" },
 +    { "loopfilter", "enable loop filter", OFFSET(loopfilter), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, VE },
 +    { "profile", "set profile restrictions", OFFSET(profile), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, VE },
 +    { "max_nal_size", "set maximum NAL size in bytes", OFFSET(max_nal_size), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },
 +    { "allow_skip_frames", "allow skipping frames to hit the target bitrate", OFFSET(skip_frames), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE },
+     { "cabac", "Enable cabac", OFFSET(cabac), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE },
      { NULL }
  };
  
@@@ -139,7 -141,14 +141,14 @@@ static av_cold int svc_encode_init(AVCo
  
      (*s->encoder)->GetDefaultParams(s->encoder, &param);
  
 -    param.fMaxFrameRate              = avctx->time_base.den / avctx->time_base.num;
+ #if FF_API_CODER_TYPE
+ FF_DISABLE_DEPRECATION_WARNINGS
+     if (!s->cabac)
+         s->cabac = avctx->coder_type == FF_CODER_TYPE_AC;
+ FF_ENABLE_DEPRECATION_WARNINGS
+ #endif
 +    param.fMaxFrameRate              = 1/av_q2d(avctx->time_base);
      param.iPicWidth                  = avctx->width;
      param.iPicHeight                 = avctx->height;
      param.iTargetBitrate             = avctx->bit_rate;
index c5d6e764c78c827b5742a1f5c61a0009fc1c9a9a,e7c158aeafb736c4822226e855370505a06fcba4..98f6bc94969383de653762efec2b7ffeb95918f8
@@@ -32,8 -32,8 +32,9 @@@
  #include <schroedinger/schrovideoformat.h>
  
  #include "libavutil/attributes.h"
 +#include "libavutil/avassert.h"
  #include "libavutil/imgutils.h"
+ #include "libavutil/opt.h"
  
  #include "avcodec.h"
  #include "internal.h"
index c97ae3871fdd206d863bad4cd80ee7f975ea04f3,fe0247f9a3cda86c4613105fd933d7ce8a67082d..4dc531a168b90639ef3dd6a5f909d4e94ea8f92c
@@@ -81,10 -76,10 +81,12 @@@ typedef struct X264Context 
      int slice_max_size;
      char *stats;
      int nal_hrd;
 +    int avcintra_class;
      int motion_est;
      int forced_idr;
+     int coder;
 +    int a53_cc;
      char *x264_params;
  } X264Context;
  
@@@ -701,14 -524,12 +707,17 @@@ FF_ENABLE_DEPRECATION_WARNING
  #endif
      }
  
+     if (x4->coder >= 0)
+         x4->params.b_cabac = x4->coder;
      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);
          }
  
@@@ -939,7 -725,12 +948,12 @@@ static const AVOption options[] = 
      { "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" },
 -    { "forced-idr",   "If forwarding iframes, require them to be IDR frames.", OFFSET(forced_idr),  AV_OPT_TYPE_INT,    { .i64 = 0 }, 0, 1, VE },
 +    { "forced-idr",   "If forcing keyframes, force them as IDR frames.",                                  OFFSET(forced_idr),  AV_OPT_TYPE_BOOL,   { .i64 = -1 }, -1, 1, VE },
+     { "coder",    "Coder type",                                           OFFSET(coder), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE, "coder" },
+     { "default",          NULL, 0, AV_OPT_TYPE_CONST, { .i64 = -1 }, INT_MIN, INT_MAX, VE, "coder" },
+     { "cavlc",            NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0 },  INT_MIN, INT_MAX, VE, "coder" },
+     { "cabac",            NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 1 },  INT_MIN, INT_MAX, VE, "coder" },
      { "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 d83a42dd0f0a7c9f9abca04a243aa56b19980f9a,411d184a1468d7feddc2f42b9f583270b92845d7..05db5cfb49d0b5c6ca3870c3b085d885926d9ff9
@@@ -147,7 -156,18 +151,12 @@@ FF_DISABLE_DEPRECATION_WARNING
          av_log(avctx, AV_LOG_ERROR, "invalid coder_type\n");
          return AVERROR(EINVAL);
      }
+ FF_ENABLE_DEPRECATION_WARNINGS
+     if (s->type != RT_BYTE_ENCODED && s->type != RT_STANDARD)
+ #endif
+     // adjust boolean option to RT equivalent
+     s->type++;
  
 -#if FF_API_CODED_FRAME
 -FF_DISABLE_DEPRECATION_WARNINGS
 -    avctx->coded_frame->key_frame = 1;
 -    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
 -FF_ENABLE_DEPRECATION_WARNINGS
 -#endif
      s->maptype                    = RMT_NONE;
      s->maplength                  = 0;
  
index ae93d48a5ad9add3f0c30e394fc22b8ed5780345,204ecfeac7a8ff9234b3b18d81537002bbfc0715..66bc55c3974c129547d28f697ce4f93e713154e9
@@@ -78,7 -85,8 +85,8 @@@ static int targa_encode_normal(uint8_t 
  static int targa_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
                                const AVFrame *p, int *got_packet)
  {
 -    int bpp, picsize, datasize = -1, ret;
+     TargaContext *s = avctx->priv_data;
 +    int bpp, picsize, datasize = -1, ret, i;
      uint8_t *out;
  
      if(avctx->width > 0xffff || avctx->height > 0xffff) {
      }
      bpp = pkt->data[16] >> 3;
  
 -    out = pkt->data + 18;  /* skip past the header we just output */
+ #if FF_API_CODER_TYPE
+ FF_DISABLE_DEPRECATION_WARNINGS
+     if (avctx->coder_type == FF_CODER_TYPE_RAW)
+         s->rle = 0;
+ FF_ENABLE_DEPRECATION_WARNINGS
+ #endif
      /* try RLE compression */
-     if (avctx->coder_type != FF_CODER_TYPE_RAW)
+     if (s->rle)
          datasize = targa_encode_rle(out, picsize, p, bpp, avctx->width, avctx->height);
  
      /* if that worked well, mark the picture as RLE compressed */
Simple merge