[FFmpeg-devel] [RFC] Specifying KEYINT (-g) has no effect in libx264

Etienne Buira etienne.buira.lists at free.fr
Fri May 27 12:54:47 CEST 2011


Hi Baptiste.

On Thu, May 26, 2011 at 05:54:03PM -0700, Baptiste Coudurier wrote:
> > +    av_free(x4->trellis);
> > +    av_free(x4->nr);
> > +    av_free(x4->ip_factor);
> > +    av_free(x4->pb_factor);
> > +    av_free(x4->chromaoffset);
> > +    av_free(x4->slices);
> 
> I believe it is possible to parse the options array and if AVOption type
> is OPT_STRING, free the offset, that should work.

You believe right :)

> Same, where did this go ? It seems it went under #if 0 ?
> Please make sure it works :)

Sorry, I thought you were looking for a draft for comment.
Put back at their original place, diff didn't see that for some of them.

upa.
-------------- next part --------------
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index b0cca65..8490a9d 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -20,6 +20,7 @@
  */
 
 #include "libavutil/opt.h"
+#include "libavutil/avstring.h"
 #include "avcodec.h"
 #include <x264.h>
 #include <math.h>
@@ -43,8 +44,58 @@ typedef struct X264Context {
     char *stats;
     char *weightp;
     char *x264opts;
+    char *keyint_max;
+    char *bframes;
+    char *cabac;
+    char *badapt;
+    char *bbias;
+    char *keyintmin;
+    char *scenecut;
+    char *deblockalpha;
+    char *deblockbeta;
+    char *qpmin;
+    char *qpmax;
+    char *qpstep;
+    char *qcomp;
+    char *qblur;
+    char *cplxblur;
+    char *ref;
+    char *partitions;
+    char *directpred;
+    char *me_method;
+    char *aqmode;
+    char *aqstrength;
+    char *rc_lookahead;
+    char *psy_rd;
+    char *psy_trellis;
+    char *me_range;
+    char *subq;
+    char *chroma_me;
+    char *trellis;
+    char *nr;
+    char *ip_factor;
+    char *pb_factor;
+    char *chromaoffset;
+    char *slices;
+    char *flags, *flags2;
+    char *psnr;
+    char *b_pyramid;
+    char *wpred;
+    char *psy;
+    char *mixed_refs;
+    char *dct8x8;
+    char *fast_pskip;
+    char *mb_tree;
+    char *intra_refresh;
+    char *ssim;
+    char *aud;
+    char *interlaced;
+    char *opengop;
+    char *repeatheaders;
 } X264Context;
 
+static const AVOption options[];
+
 static void X264_log(void *p, int level, const char *fmt, va_list args)
 {
     static const int level_map[] = {
@@ -163,6 +214,7 @@ static int X264_frame(AVCodecContext *ctx, uint8_t *buf,
 static av_cold int X264_close(AVCodecContext *avctx)
 {
     X264Context *x4 = avctx->priv_data;
+    AVOption const * o;
 
     av_freep(&avctx->extradata);
     av_free(x4->sei);
@@ -170,13 +222,9 @@ static av_cold int X264_close(AVCodecContext *avctx)
     if (x4->enc)
         x264_encoder_close(x4->enc);
 
-    av_free(x4->preset);
-    av_free(x4->tune);
-    av_free(x4->profile);
-    av_free(x4->level);
-    av_free(x4->stats);
-    av_free(x4->weightp);
-    av_free(x4->x264opts);
+    for (o = options; o->name; o++)
+        if (o->type == FF_OPT_TYPE_STRING)
+            av_free(*(char **) (((uint8_t*)x4)+o->offset));
 
     return 0;
 }
@@ -215,6 +263,18 @@ static void check_default_settings(AVCodecContext *avctx)
         }                                                               \
     } while (0);                                                        \
 
+static struct {
+    const char *name;
+    unsigned int partitionflag;
+} x264partitions[] = {
+    {"i4x4", X264_ANALYSE_I4x4},
+    {"i8x8", X264_ANALYSE_I8x8},
+    {"p8x8", X264_ANALYSE_PSUB16x16},
+    {"p4x4", X264_ANALYSE_PSUB8x8},
+    {"b8x8", X264_ANALYSE_BSUB16x16},
+    {NULL},
+};
+
 static av_cold int X264_init(AVCodecContext *avctx)
 {
     X264Context *x4 = avctx->priv_data;
@@ -222,87 +282,8 @@ static av_cold int X264_init(AVCodecContext *avctx)
     x4->sei_size = 0;
     x264_param_default(&x4->params);
 
-    x4->params.i_keyint_max         = avctx->gop_size;
-
-    x4->params.i_bframe          = avctx->max_b_frames;
-    x4->params.b_cabac           = avctx->coder_type == FF_CODER_TYPE_AC;
-    x4->params.i_bframe_adaptive = avctx->b_frame_strategy;
-    x4->params.i_bframe_bias     = avctx->bframebias;
-    x4->params.i_bframe_pyramid  = avctx->flags2 & CODEC_FLAG2_BPYRAMID ? X264_B_PYRAMID_NORMAL : X264_B_PYRAMID_NONE;
-
-    x4->params.i_keyint_min = avctx->keyint_min;
-    if (x4->params.i_keyint_min > x4->params.i_keyint_max)
-        x4->params.i_keyint_min = x4->params.i_keyint_max;
-
-    x4->params.i_scenecut_threshold        = avctx->scenechange_threshold;
-
-    x4->params.b_deblocking_filter         = avctx->flags & CODEC_FLAG_LOOP_FILTER;
-    x4->params.i_deblocking_filter_alphac0 = avctx->deblockalpha;
-    x4->params.i_deblocking_filter_beta    = avctx->deblockbeta;
-
-    x4->params.rc.i_qp_min                 = avctx->qmin;
-    x4->params.rc.i_qp_max                 = avctx->qmax;
-    x4->params.rc.i_qp_step                = avctx->max_qdiff;
-
-    x4->params.rc.f_qcompress       = avctx->qcompress; /* 0.0 => cbr, 1.0 => constant qp */
-    x4->params.rc.f_qblur           = avctx->qblur;     /* temporally blur quants */
-    x4->params.rc.f_complexity_blur = avctx->complexityblur;
-
-    x4->params.i_frame_reference    = avctx->refs;
-
-    x4->params.analyse.inter    = 0;
-    if (avctx->partitions) {
-        if (avctx->partitions & X264_PART_I4X4)
-            x4->params.analyse.inter |= X264_ANALYSE_I4x4;
-        if (avctx->partitions & X264_PART_I8X8)
-            x4->params.analyse.inter |= X264_ANALYSE_I8x8;
-        if (avctx->partitions & X264_PART_P8X8)
-            x4->params.analyse.inter |= X264_ANALYSE_PSUB16x16;
-        if (avctx->partitions & X264_PART_P4X4)
-            x4->params.analyse.inter |= X264_ANALYSE_PSUB8x8;
-        if (avctx->partitions & X264_PART_B8X8)
-            x4->params.analyse.inter |= X264_ANALYSE_BSUB16x16;
-    }
-
-    x4->params.analyse.i_direct_mv_pred  = avctx->directpred;
-
-    x4->params.analyse.b_weighted_bipred = avctx->flags2 & CODEC_FLAG2_WPRED;
-
-    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;
-    else x4->params.analyse.i_me_method = X264_ME_HEX;
-
-    x4->params.rc.i_aq_mode               = avctx->aq_mode;
-    x4->params.rc.f_aq_strength           = avctx->aq_strength;
-    x4->params.rc.i_lookahead             = avctx->rc_lookahead;
-
-    x4->params.analyse.b_psy              = avctx->flags2 & CODEC_FLAG2_PSY;
-    x4->params.analyse.f_psy_rd           = avctx->psy_rd;
-    x4->params.analyse.f_psy_trellis      = avctx->psy_trellis;
-
-    x4->params.analyse.i_me_range         = avctx->me_range;
-    x4->params.analyse.i_subpel_refine    = avctx->me_subpel_quality;
-
-    x4->params.analyse.b_mixed_references = avctx->flags2 & CODEC_FLAG2_MIXED_REFS;
-    x4->params.analyse.b_chroma_me        = avctx->me_cmp & FF_CMP_CHROMA;
-    x4->params.analyse.b_transform_8x8    = avctx->flags2 & CODEC_FLAG2_8X8DCT;
-    x4->params.analyse.b_fast_pskip       = avctx->flags2 & CODEC_FLAG2_FASTPSKIP;
 
-    x4->params.analyse.i_trellis          = avctx->trellis;
-    x4->params.analyse.i_noise_reduction  = avctx->noise_reduction;
-
-    x4->params.rc.b_mb_tree               = !!(avctx->flags2 & CODEC_FLAG2_MBTREE);
-    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;
+    /* FIXME: grep for CODEC_FLAG */
 
     if (!x4->preset)
         check_default_settings(avctx);
@@ -317,7 +298,108 @@ static av_cold int X264_init(AVCodecContext *avctx)
     x4->params.i_log_level          = X264_LOG_DEBUG;
 
     OPT_STR("weightp", x4->weightp);
-
+    OPT_STR("keyint", x4->keyint_max);
+    OPT_STR("bframes", x4->bframes);
+    if (x4->cabac) {
+        if (!strcmp(x4->cabac, "ac") || !strcmp(x4->cabac, "1")) {
+            OPT_STR("cabac", "1");
+        } else {
+            OPT_STR("cabac", "0");
+        }
+    }
+    OPT_STR("b-adapt", x4->badapt);
+    OPT_STR("b-bias", x4->bbias);
+    x4->params.i_bframe_pyramid  = avctx->flags2 & CODEC_FLAG2_BPYRAMID ? X264_B_PYRAMID_NORMAL : X264_B_PYRAMID_NONE;
+    OPT_STR("keyint-min", x4->keyintmin);
+    OPT_STR("scenecut", x4->scenecut);
+    x4->params.b_deblocking_filter         = avctx->flags & CODEC_FLAG_LOOP_FILTER;
+    OPT_STR("deblock", x4->deblockalpha);
+    if (x4->deblockbeta) {
+        if (sscanf(x4->deblockbeta, "%d", &x4->params.i_deblocking_filter_beta) != 1) {
+            av_log(avctx, AV_LOG_ERROR, "Bad value for deblockbeta (should be an int)\n");
+            return -1;
+        }
+    }
+    OPT_STR("qpmin", x4->qpmin);
+    OPT_STR("qpmax", x4->qpmax);
+    OPT_STR("qpstep", x4->qpstep);
+    OPT_STR("qcomp", x4->qcomp);    /* 0.0 => cbr, 1.0 => constant qp */
+    OPT_STR("qblur", x4->qblur);    /* temporally blur quants */
+    OPT_STR("cplxblur", x4->cplxblur);
+    OPT_STR("ref", x4->ref);
+    if (x4->partitions) {
+        const char *p = x4->partitions;
+        while (*p) {
+            int i;
+            char sign = *(p++);
+            for (i=0; x264partitions[i].name && !av_strstart(p, x264partitions[i].name, &p); i++);
+            if (!x264partitions[i].name) {
+                av_log(avctx, AV_LOG_ERROR, "Unable to parse partitions (unknown partition name)\n");
+                return -1;
+            }
+            switch(sign) {
+            case '+': x4->params.analyse.inter |= x264partitions[i].partitionflag; break;
+            case '-': x4->params.analyse.inter &= ~x264partitions[i].partitionflag; break;
+            default:  av_log(avctx, AV_LOG_ERROR, "Unable to parse partitions (sign not found)\n");
+                      return -1;
+            }
+            if (*p == ',') p++;
+        }
+    }
+    if (x4->directpred) {
+        if (isdigit(x4->directpred[0])) {
+            int i, v = atoi(x4->directpred);
+            for (i=0 ; x264_direct_pred_names[i] && i<v ; i++);
+            if (i==v) {
+                OPT_STR("direct-pred", x264_direct_pred_names[i]);
+            } else {
+                av_log(avctx, AV_LOG_ERROR, "Wrong value for directpred\n");
+                return -1;
+            }
+        } else
+            OPT_STR("direct-pred", x4->directpred);
+    }
+    x4->params.analyse.b_weighted_bipred = avctx->flags2 & CODEC_FLAG2_WPRED;
+    if (x4->me_method) {
+        if (!strcmp(x4->me_method, "epzs")) {
+            OPT_STR("me", "dia");
+        } else if (!strcmp(x4->me_method, "full")) {
+            OPT_STR("me", "esa");
+        } else
+            OPT_STR("me", x4->me_method);
+    }
+    OPT_STR("aq-mode", x4->aqmode);
+    OPT_STR("aq-strength", x4->aqstrength);
+    OPT_STR("rc-lookahead", x4->rc_lookahead);
+    x4->params.analyse.b_psy              = avctx->flags2 & CODEC_FLAG2_PSY;
+    OPT_STR("psy-rd", x4->psy_rd);
+    if (x4->psy_trellis) {
+        if (sscanf(x4->psy_trellis, "%f", &x4->params.analyse.f_psy_trellis) != 1) {
+            av_log(avctx, AV_LOG_ERROR, "Bad value for psy_trellis (should be a float)\n");
+            return -1;
+        }
+    }
+    OPT_STR("me-range", x4->me_range);
+    OPT_STR("subq", x4->subq);
+    x4->params.analyse.b_mixed_references = avctx->flags2 & CODEC_FLAG2_MIXED_REFS;
+    OPT_STR("chroma-me", x4->chroma_me);
+    x4->params.analyse.b_transform_8x8    = avctx->flags2 & CODEC_FLAG2_8X8DCT;
+    x4->params.analyse.b_fast_pskip       = avctx->flags2 & CODEC_FLAG2_FASTPSKIP;
+    OPT_STR("trellis", x4->trellis);
+    OPT_STR("nr", x4->nr);
+    x4->params.rc.b_mb_tree               = !!(avctx->flags2 & CODEC_FLAG2_MBTREE);
+    if (x4->ip_factor) {
+        float f;
+        char param[255];
+        if (sscanf(x4->ip_factor, "%f", &f) != 1) {
+            av_log(avctx, AV_LOG_ERROR, "Invalid i_qfactor\n");
+            return -1;
+        }
+        snprintf(param, 254, "%f", 1/fabs(f));
+        OPT_STR("ip-factor", param);
+    }
+    OPT_STR("pb-factor", x4->pb_factor);
+    OPT_STR("chroma-qp-offset", x4->chromaoffset);
     x4->params.b_intra_refresh      = avctx->flags2 & CODEC_FLAG2_INTRA_REFRESH;
     x4->params.rc.i_bitrate         = avctx->bit_rate       / 1000;
     x4->params.rc.i_vbv_buffer_size = avctx->rc_buffer_size / 1000;
@@ -387,7 +469,7 @@ static av_cold int X264_init(AVCodecContext *avctx)
 
     x4->params.b_open_gop     = !(avctx->flags & CODEC_FLAG_CLOSED_GOP);
 
-    x4->params.i_slice_count  = avctx->slices;
+    OPT_STR("slices", x4->slices);
 
     x4->params.vui.b_fullrange = avctx->pix_fmt == PIX_FMT_YUVJ420P;
 
@@ -406,7 +488,7 @@ static av_cold int X264_init(AVCodecContext *avctx)
 
     avctx->coded_frame = &x4->out_pic;
 
-    if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER) {
+    if (!x4->params.b_repeat_headers) {
         x264_nal_t *nal;
         int nnal, s, i;
 
@@ -435,6 +517,39 @@ static const AVOption options[] = {
     {"passlogfile", "Filename for 2 pass stats", OFFSET(stats), FF_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
     {"wpredp", "Weighted prediction for P-frames", OFFSET(weightp), FF_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
     {"x264opts", "x264 options", OFFSET(x264opts), FF_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
+    {"g", "Set the group of picture (GOP) size (int)", OFFSET(keyint_max), FF_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
+    {"bf", "use 'frames' B frame (int)", OFFSET(bframes), FF_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
+    {"coder", "use cabac (1|ac)|0", OFFSET(cabac), FF_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
+    {"b_strategy", "strategy to choose between I/P/B-frames (see x264 --fullhelp) (int 0..2)", OFFSET(badapt), FF_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
+    {"bframebias", "influences how often B-frames are used (int)", OFFSET(bbias), FF_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
+    {"keyint_min", "minimum interval between IDR-frames (int)", OFFSET(keyintmin), FF_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
+    {"sc_threshold", "scene change threshold (int)", OFFSET(scenecut), FF_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
+    {"deblockalpha", "in-loop deblocking filter alphac0 parameter (int)", OFFSET(deblockalpha), FF_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
+    {"deblockbeta", "in-loop deblocking filter beta parameter (int)", OFFSET(deblockbeta), FF_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
+    {"qmin", "min video quantizer scale (VBR) (int)", OFFSET(qpmin), FF_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
+    {"qmax", "max video quantizer scale (VBR) (int)", OFFSET(qpmax), FF_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
+    {"qdiff", "max difference between the quantizer scale (VBR) (int)", OFFSET(qpstep), FF_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
+    {"qcomp", "video quantizer scale compression (VBR) (float)", OFFSET(qcomp), FF_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
+    {"qblur", "video quantizer scale blur (VBR) (float)", OFFSET(qblur), FF_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
+    {"complexityblur", "reduce fluctuations in qp (before curve compression) (float)", OFFSET(cplxblur), FF_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
+    {"refs", "reference frames to consider for motion compensation (int)", OFFSET(ref), FF_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
+    {"partitions", "macroblock subpartition sizes to consider, list of (+|-)(i4x4|i8x8|p8x8|p4x4|b8x8)", OFFSET(partitions), FF_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
+    {"directpred", "direct mv prediction mode - (0|none)|(1|spatial)|(2|temporal)|(3|auto)", OFFSET(directpred), FF_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
+    {"me_method", "set motion estimation method (epzs|dia)|hex|umh|(full|esa)|tesa", OFFSET(me_method), FF_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
+    {"aq_mode", "specify aq method (int)", OFFSET(aqmode), FF_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
+    {"aq_strength", "specify aq strength (float)", OFFSET(aqstrength), FF_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
+    {"rc_lookahead", "specify number of frames to look ahead for frametype (int)", OFFSET(rc_lookahead), FF_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
+    {"psy_rd", "specify psycho visual strength (float)", OFFSET(psy_rd), FF_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
+    {"psy_trellis", "specify psycho visual trellis (float)", OFFSET(psy_trellis), FF_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
+    {"me_range", "limit motion vectors range (int)", OFFSET(me_range), FF_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
+    {"subq", "sub pel motion estimation quality (int)", OFFSET(subq), FF_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
+    {"cmp", "full pel me compare function (bool)", OFFSET(chroma_me), FF_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
+    {"trellis", "rate-distortion optimal quantization (int)", OFFSET(trellis), FF_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
+    {"nr", "noise reduction (int)", OFFSET(nr), FF_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
+    {"i_qfactor", "qp factor between P and I frames (float)", OFFSET(ip_factor), FF_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
+    {"b_qfactor", "qp factor between p and b frames (float)", OFFSET(pb_factor), FF_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
+    {"chromaoffset", "chroma qp offset from luma (int)", OFFSET(chromaoffset), FF_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
+    {"slices", "number of slices, used in parallelized decoding (int)", OFFSET(slices), FF_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
     { NULL },
 };
 
diff --git a/libavcodec/options.c b/libavcodec/options.c
index 78a7bc8..3235c1f 100644
--- a/libavcodec/options.c
+++ b/libavcodec/options.c
@@ -120,7 +120,6 @@ static const AVOption options[]={
 {"b_qfactor", "qp factor between p and b frames", OFFSET(b_quant_factor), FF_OPT_TYPE_FLOAT, {.dbl = 1.25 }, -FLT_MAX, FLT_MAX, V|E},
 {"rc_strategy", "ratecontrol method", OFFSET(rc_strategy), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E},
 {"b_strategy", "strategy to choose between I/P/B-frames", OFFSET(b_frame_strategy), FF_OPT_TYPE_INT, {.dbl = 0 }, INT_MIN, INT_MAX, V|E},
-{"wpredp", "weighted prediction analysis method", OFFSET(weighted_p_pred), FF_OPT_TYPE_INT, {.dbl = 0 }, INT_MIN, INT_MAX, V|E},
 {"ps", "rtp payload size in bytes", OFFSET(rtp_payload_size), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E},
 {"mv_bits", NULL, OFFSET(mv_bits), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX},
 {"header_bits", NULL, OFFSET(header_bits), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX},
@@ -358,7 +357,6 @@ static const AVOption options[]={
 {"chromaoffset", "chroma qp offset from luma", OFFSET(chromaoffset), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E},
 {"bframebias", "influences how often B-frames are used", OFFSET(bframebias), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E},
 {"trellis", "rate-distortion optimal quantization", OFFSET(trellis), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|A|E},
-{"directpred", "direct mv prediction mode - 0 (none), 1 (spatial), 2 (temporal), 3 (auto)", OFFSET(directpred), FF_OPT_TYPE_INT, {.dbl = 2 }, INT_MIN, INT_MAX, V|E},
 {"bpyramid", "allows B-frames to be used as references for predicting", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_BPYRAMID }, INT_MIN, INT_MAX, V|E, "flags2"},
 {"wpred", "weighted biprediction for b-frames (H.264)", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_WPRED }, INT_MIN, INT_MAX, V|E, "flags2"},
 {"mixed_refs", "one reference per partition, as opposed to one reference per macroblock", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_MIXED_REFS }, INT_MIN, INT_MAX, V|E, "flags2"},
@@ -367,8 +365,6 @@ static const AVOption options[]={
 {"aud", "access unit delimiters (H.264)", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_AUD }, INT_MIN, INT_MAX, V|E, "flags2"},
 {"skiprd", "RD optimal MB level residual skipping", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_SKIP_RD }, INT_MIN, INT_MAX, V|E, "flags2"},
 {"complexityblur", "reduce fluctuations in qp (before curve compression)", OFFSET(complexityblur), FF_OPT_TYPE_FLOAT, {.dbl = 20.0 }, FLT_MIN, FLT_MAX, V|E},
-{"deblockalpha", "in-loop deblocking filter alphac0 parameter", OFFSET(deblockalpha), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, -6, 6, V|E},
-{"deblockbeta", "in-loop deblocking filter beta parameter", OFFSET(deblockbeta), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, -6, 6, V|E},
 {"partitions", "macroblock subpartition sizes to consider", OFFSET(partitions), FF_OPT_TYPE_FLAGS, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E, "partitions"},
 {"parti4x4", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = X264_PART_I4X4 }, INT_MIN, INT_MAX, V|E, "partitions"},
 {"parti8x8", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = X264_PART_I8X8 }, INT_MIN, INT_MAX, V|E, "partitions"},
@@ -409,11 +405,6 @@ static const AVOption options[]={
 {"color_range", NULL, OFFSET(color_range), FF_OPT_TYPE_INT, {.dbl = AVCOL_RANGE_UNSPECIFIED }, 0, AVCOL_RANGE_NB-1, V|E|D},
 {"chroma_sample_location", NULL, OFFSET(chroma_sample_location), FF_OPT_TYPE_INT, {.dbl = AVCHROMA_LOC_UNSPECIFIED }, 0, AVCHROMA_LOC_NB-1, V|E|D},
 {"psy", "use psycho visual optimization", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_PSY }, INT_MIN, INT_MAX, V|E, "flags2"},
-{"psy_rd", "specify psycho visual strength", OFFSET(psy_rd), FF_OPT_TYPE_FLOAT, {.dbl = 1.0 }, 0, FLT_MAX, V|E},
-{"psy_trellis", "specify psycho visual trellis", OFFSET(psy_trellis), FF_OPT_TYPE_FLOAT, {.dbl = 0 }, 0, FLT_MAX, V|E},
-{"aq_mode", "specify aq method", OFFSET(aq_mode), FF_OPT_TYPE_INT, {.dbl = 1 }, 0, INT_MAX, V|E},
-{"aq_strength", "specify aq strength", OFFSET(aq_strength), FF_OPT_TYPE_FLOAT, {.dbl = 1.0 }, 0, FLT_MAX, V|E},
-{"rc_lookahead", "specify number of frames to look ahead for frametype", OFFSET(rc_lookahead), FF_OPT_TYPE_INT, {.dbl = 40 }, 0, INT_MAX, V|E},
 {"ssim", "ssim will be calculated during encoding", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_SSIM }, INT_MIN, INT_MAX, V|E, "flags2"},
 {"intra_refresh", "use periodic insertion of intra blocks instead of keyframes", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_INTRA_REFRESH }, INT_MIN, INT_MAX, V|E, "flags2"},
 {"crf_max", "in crf mode, prevents vbv from lowering quality beyond this point", OFFSET(crf_max), FF_OPT_TYPE_FLOAT, {.dbl = DEFAULT }, 0, 51, V|E},


More information about the ffmpeg-devel mailing list