summaryrefslogtreecommitdiff
path: root/libavcodec/libx264.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-10-01 16:19:45 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-10-01 16:39:19 +0200
commit0a7afedc4819167a50516a4402a4638c7439df6e (patch)
treec8b39736191ac0cbb5c5eb625855a545bdc17594 /libavcodec/libx264.c
parent23f0e2edec3d9a87e3cc39f5d9a9384cb53b81bd (diff)
avcodec/libx264: add avcintra-class
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/libx264.c')
-rw-r--r--libavcodec/libx264.c7
1 files changed, 7 insertions, 0 deletions
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 },
};