audio wave icons, viewer wave image, 7 lib updates, tweak file size
[goodguy/history.git] / cinelerra-5.1 / thirdparty / src / ffmpeg-3.4.1.patch4
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
3 @@ -279,7 +279,11 @@
4  
5      x264_picture_init( &x4->pic );
6      x4->pic.img.i_csp   = x4->params.i_csp;
7 +#if X264_BUILD >= 153
8 +    if (x4->params.i_bitdepth > 8)
9 +#else
10      if (x264_bit_depth > 8)
11 +#endif
12          x4->pic.img.i_csp |= X264_CSP_HIGH_DEPTH;
13      x4->pic.img.i_plane = avfmt2_num_planes(ctx->pix_fmt);
14  
15 @@ -490,6 +494,9 @@
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;
21 +#endif
22  
23      PARSE_X264_OPT("weightp", wpredp);
24  
25 @@ -701,24 +708,8 @@
26      if (x4->nal_hrd >= 0)
27          x4->params.i_nal_hrd = x4->nal_hrd;
28  
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
34 -    } else {
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
46 -#endif
47 -    }
48  
49      if (x4->coder >= 0)
50          x4->params.b_cabac = x4->coder;
51 @@ -878,6 +869,24 @@
52      AV_PIX_FMT_NV20,
53      AV_PIX_FMT_NONE
54  };
55 +static const enum AVPixelFormat pix_fmts_all[] = {
56 +    AV_PIX_FMT_YUV420P,
57 +    AV_PIX_FMT_YUVJ420P,
58 +    AV_PIX_FMT_YUV422P,
59 +    AV_PIX_FMT_YUVJ422P,
60 +    AV_PIX_FMT_YUV444P,
61 +    AV_PIX_FMT_YUVJ444P,
62 +    AV_PIX_FMT_NV12,
63 +    AV_PIX_FMT_NV16,
64 +#ifdef X264_CSP_NV21
65 +    AV_PIX_FMT_NV21,
66 +#endif
67 +    AV_PIX_FMT_YUV420P10,
68 +    AV_PIX_FMT_YUV422P10,
69 +    AV_PIX_FMT_YUV444P10,
70 +    AV_PIX_FMT_NV20,
71 +    AV_PIX_FMT_NONE
72 +};
73  #if CONFIG_LIBX264RGB_ENCODER
74  static const enum AVPixelFormat pix_fmts_8bit_rgb[] = {
75      AV_PIX_FMT_BGR0,
76 @@ -889,12 +898,16 @@
77  
78  static av_cold void X264_init_static(AVCodec *codec)
79  {
80 +#if X264_BUILD < 153
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;
87 +#else
88 +    codec->pix_fmts = pix_fmts_all;
89 +#endif
90  }
91  
92  #define OFFSET(x) offsetof(X264Context, x)
93 @@ -958,6 +971,7 @@
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 @@
102      { "nr",               "-1" },
103  #endif
104      { "me_range",         "-1" },
105 -#if FF_API_MOTION_EST
106 -    { "me_method",        "-1" },
107 -#endif
108      { "subq",             "-1" },
109  #if FF_API_PRIVATE_OPT
110      { "b_strategy",       "-1" },