diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-10-01 16:19:45 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-10-01 16:39:19 +0200 |
commit | 0a7afedc4819167a50516a4402a4638c7439df6e (patch) | |
tree | c8b39736191ac0cbb5c5eb625855a545bdc17594 | |
parent | 23f0e2edec3d9a87e3cc39f5d9a9384cb53b81bd (diff) | |
download | ffmpeg-0a7afedc4819167a50516a4402a4638c7439df6e.tar.gz |
avcodec/libx264: add avcintra-class
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | doc/encoders.texi | 4 | ||||
-rw-r--r-- | libavcodec/libx264.c | 7 |
2 files changed, 11 insertions, 0 deletions
diff --git a/doc/encoders.texi b/doc/encoders.texi index 44b49ce4b5..d67bf8908d 100644 --- a/doc/encoders.texi +++ b/doc/encoders.texi @@ -1745,6 +1745,10 @@ Enable calculation and printing SSIM stats after the encoding. Enable the use of Periodic Intra Refresh instead of IDR frames when set to 1. +@item avcintra-class (@emph{class}) +Configure the encoder to generate AVC-Intra. +Valid values are 50,100 and 200 + @item bluray-compat (@emph{bluray-compat}) Configure the encoder to be compatible with the bluray standard. It is a shorthand for setting "bluray-compat=1 force-cfr=1". diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c index add3d987df..7839248590 100644 --- a/libavcodec/libx264.c +++ b/libavcodec/libx264.c @@ -80,6 +80,7 @@ typedef struct X264Context { int slice_max_size; char *stats; int nal_hrd; + int avcintra_class; char *x264_params; } X264Context; @@ -183,6 +184,8 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame, frame->pict_type == AV_PICTURE_TYPE_P ? X264_TYPE_P : frame->pict_type == AV_PICTURE_TYPE_B ? X264_TYPE_B : X264_TYPE_AUTO; + + if (x4->avcintra_class < 0) { if (x4->params.b_interlaced && x4->params.b_tff != frame->top_field_first) { x4->params.b_tff = frame->top_field_first; x264_encoder_reconfig(x4->enc, &x4->params); @@ -226,6 +229,7 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame, x4->params.rc.f_rf_constant_max = x4->crf_max; x264_encoder_reconfig(x4->enc, &x4->params); } + } side_data = av_frame_get_side_data(frame, AV_FRAME_DATA_STEREO3D); if (side_data) { @@ -528,6 +532,8 @@ static av_cold int X264_init(AVCodecContext *avctx) x4->params.b_bluray_compat = x4->bluray_compat; x4->params.b_vfr_input = 0; } + if (x4->avcintra_class >= 0) + x4->params.i_avcintra_class = x4->avcintra_class; if (x4->b_bias != INT_MIN) x4->params.i_bframe_bias = x4->b_bias; if (x4->b_pyramid >= 0) @@ -805,6 +811,7 @@ 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}, { "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 }, }; |