1 --- a/libavcodec/libx264.c 2017-12-10 14:35:08.000000000 -0700
2 +++ b/libavcodec/libx264.c 2018-02-08 16:57:46.028108824 -0700
5 x264_picture_init( &x4->pic );
6 x4->pic.img.i_csp = x4->params.i_csp;
8 + if (x4->params.i_bitdepth > 8)
10 if (x264_bit_depth > 8)
12 x4->pic.img.i_csp |= X264_CSP_HIGH_DEPTH;
13 x4->pic.img.i_plane = avfmt2_num_planes(ctx->pix_fmt);
16 x4->params.p_log_private = avctx;
17 x4->params.i_log_level = X264_LOG_DEBUG;
18 x4->params.i_csp = convert_pix_fmt(avctx->pix_fmt);
19 +#if X264_BUILD >= 153
20 + x4->params.i_bitdepth = av_pix_fmt_desc_get(avctx->pix_fmt)->comp[0].depth;
23 PARSE_X264_OPT("weightp", wpredp);
27 x4->params.i_nal_hrd = x4->nal_hrd;
29 - if (x4->motion_est >= 0) {
30 + if (x4->motion_est >= 0)
31 x4->params.analyse.i_me_method = x4->motion_est;
32 -#if FF_API_MOTION_EST
33 -FF_DISABLE_DEPRECATION_WARNINGS
35 - if (avctx->me_method == ME_EPZS)
36 - x4->params.analyse.i_me_method = X264_ME_DIA;
37 - else if (avctx->me_method == ME_HEX)
38 - x4->params.analyse.i_me_method = X264_ME_HEX;
39 - else if (avctx->me_method == ME_UMH)
40 - x4->params.analyse.i_me_method = X264_ME_UMH;
41 - else if (avctx->me_method == ME_FULL)
42 - x4->params.analyse.i_me_method = X264_ME_ESA;
43 - else if (avctx->me_method == ME_TESA)
44 - x4->params.analyse.i_me_method = X264_ME_TESA;
45 -FF_ENABLE_DEPRECATION_WARNINGS
50 x4->params.b_cabac = x4->coder;
55 +static const enum AVPixelFormat pix_fmts_all[] = {
57 + AV_PIX_FMT_YUVJ420P,
59 + AV_PIX_FMT_YUVJ422P,
61 + AV_PIX_FMT_YUVJ444P,
67 + AV_PIX_FMT_YUV420P10,
68 + AV_PIX_FMT_YUV422P10,
69 + AV_PIX_FMT_YUV444P10,
73 #if CONFIG_LIBX264RGB_ENCODER
74 static const enum AVPixelFormat pix_fmts_8bit_rgb[] = {
78 static av_cold void X264_init_static(AVCodec *codec)
81 if (x264_bit_depth == 8)
82 codec->pix_fmts = pix_fmts_8bit;
83 else if (x264_bit_depth == 9)
84 codec->pix_fmts = pix_fmts_9bit;
85 else if (x264_bit_depth == 10)
86 codec->pix_fmts = pix_fmts_10bit;
88 + codec->pix_fmts = pix_fmts_all;
92 #define OFFSET(x) offsetof(X264Context, x)
94 { "vbr", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = X264_NAL_HRD_VBR}, INT_MIN, INT_MAX, VE, "nal-hrd" },
95 { "cbr", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = X264_NAL_HRD_CBR}, INT_MIN, INT_MAX, VE, "nal-hrd" },
96 { "avcintra-class","AVC-Intra class 50/100/200", OFFSET(avcintra_class),AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 200 , VE},
97 + { "me_method", "Set motion estimation method", OFFSET(motion_est), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, X264_ME_TESA, VE, "motion-est"},
98 { "motion-est", "Set motion estimation method", OFFSET(motion_est), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, X264_ME_TESA, VE, "motion-est"},
99 { "dia", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = X264_ME_DIA }, INT_MIN, INT_MAX, VE, "motion-est" },
100 { "hex", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = X264_ME_HEX }, INT_MIN, INT_MAX, VE, "motion-est" },
101 @@ -1002,9 +1016,6 @@
104 { "me_range", "-1" },
105 -#if FF_API_MOTION_EST
106 - { "me_method", "-1" },
109 #if FF_API_PRIVATE_OPT
110 { "b_strategy", "-1" },