1
--- a/libavcodec/options.c
2
+++ b/libavcodec/options.c
3
@@ -122,6 +122,7 @@ static const AVOption options[]={
4
{"b_qfactor", "qp factor between p and b frames", OFFSET(b_quant_factor), FF_OPT_TYPE_FLOAT, 1.25, -FLT_MAX, FLT_MAX, V|E},
5
{"rc_strategy", "ratecontrol method", OFFSET(rc_strategy), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E},
6
{"b_strategy", "strategy to choose between I/P/B-frames", OFFSET(b_frame_strategy), FF_OPT_TYPE_INT, 0, INT_MIN, INT_MAX, V|E},
7
+{"wpredp", "weighted prediction analysis method", OFFSET(weighted_p_pred), FF_OPT_TYPE_INT, 0, INT_MIN, INT_MAX, V|E},
8
{"hurry_up", NULL, OFFSET(hurry_up), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|D},
9
{"ps", "rtp payload size in bits", OFFSET(rtp_payload_size), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E},
10
{"mv_bits", NULL, OFFSET(mv_bits), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
11
@@ -388,6 +389,7 @@ static const AVOption options[]={
12
{"request_channels", "set desired number of audio channels", OFFSET(request_channels), FF_OPT_TYPE_INT, DEFAULT, 0, INT_MAX, A|D},
13
{"drc_scale", "percentage of dynamic range compression to apply", OFFSET(drc_scale), FF_OPT_TYPE_FLOAT, 1.0, 0.0, 1.0, A|D},
14
{"reservoir", "use bit reservoir", 0, FF_OPT_TYPE_CONST, CODEC_FLAG2_BIT_RESERVOIR, INT_MIN, INT_MAX, A|E, "flags2"},
15
+{"mbtree", "use macroblock tree ratecontrol (x264 only)", 0, FF_OPT_TYPE_CONST, CODEC_FLAG2_MBTREE, INT_MIN, INT_MAX, V|E, "flags2"},
16
{"bits_per_raw_sample", NULL, OFFSET(bits_per_raw_sample), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
17
{"channel_layout", NULL, OFFSET(channel_layout), FF_OPT_TYPE_INT64, DEFAULT, 0, INT64_MAX, A|E|D, "channel_layout"},
18
{"request_channel_layout", NULL, OFFSET(request_channel_layout), FF_OPT_TYPE_INT64, DEFAULT, 0, INT64_MAX, A|D, "request_channel_layout"},
19
--- a/libavcodec/libx264.c
20
+++ b/libavcodec/libx264.c
24
typedef struct X264Context {
25
- x264_param_t params;
29
+ x264_param_t params;
38
-X264_log(void *p, int level, const char *fmt, va_list args)
39
+static void X264_log(void *p, int level, const char *fmt, va_list args)
41
static const int level_map[] = {
42
[X264_LOG_ERROR] = AV_LOG_ERROR,
43
@@ -43,31 +44,75 @@ X264_log(void *p, int level, const char
44
[X264_LOG_DEBUG] = AV_LOG_DEBUG
47
- if(level < 0 || level > X264_LOG_DEBUG)
48
+ if (level < 0 || level > X264_LOG_DEBUG)
51
av_vlog(p, level_map[level], fmt, args);
56
-encode_nals(uint8_t *buf, int size, x264_nal_t *nals, int nnal)
58
+static int encode_nals(AVCodecContext *ctx, uint8_t *buf, int size,
59
+ x264_nal_t *nals, int nnal, int skip_sei)
61
+ X264Context *x4 = ctx->priv_data;
65
- for(i = 0; i < nnal; i++){
66
- int s = x264_nal_encode(p, &size, 1, nals + i);
68
+ /* Write the SEI as part of the first frame. */
69
+ if (x4->sei_size > 0 && nnal > 0) {
70
+ memcpy(p, x4->sei, x4->sei_size);
75
+ for (i = 0; i < nnal; i++){
76
+ /* Don't put the SEI in extradata. */
77
+ if (skip_sei && nals[i].i_type == NAL_SEI) {
78
+ x4->sei_size = nals[i].i_payload;
79
+ x4->sei = av_malloc(x4->sei_size);
80
+ memcpy(x4->sei, nals[i].p_payload, nals[i].i_payload);
83
+ memcpy(p, nals[i].p_payload, nals[i].i_payload);
84
+ p += nals[i].i_payload;
90
+static int encode_nals(AVCodecContext *ctx, uint8_t *buf, int size, x264_nal_t *nals, int nnal, int skip_sei)
92
+ X264Context *x4 = ctx->priv_data;
96
+ /* Write the SEI as part of the first frame. */
97
+ if (x4->sei_size > 0 && nnal > 0) {
98
+ memcpy(p, x4->sei, x4->sei_size);
103
+ for (i = 0; i < nnal; i++) {
104
+ /* Don't put the SEI in extradata. */
105
+ if (skip_sei && nals[i].i_type == NAL_SEI) {
106
+ x4->sei = av_malloc( 5 + nals[i].i_payload * 4 / 3 );
107
+ if(x264_nal_encode(x4->sei, &x4->sei_size, 1, nals + i) < 0)
111
+ s = x264_nal_encode(p, &size, 1, nals + i);
122
-X264_frame(AVCodecContext *ctx, uint8_t *buf, int bufsize, void *data)
123
+static int X264_frame(AVCodecContext *ctx, uint8_t *buf,
124
+ int bufsize, void *data)
126
X264Context *x4 = ctx->priv_data;
127
AVFrame *frame = data;
128
@@ -75,31 +120,30 @@ X264_frame(AVCodecContext *ctx, uint8_t
130
x264_picture_t pic_out;
132
- x4->pic.img.i_csp = X264_CSP_I420;
133
+ x4->pic.img.i_csp = X264_CSP_I420;
134
x4->pic.img.i_plane = 3;
137
- for(i = 0; i < 3; i++){
138
- x4->pic.img.plane[i] = frame->data[i];
139
+ for (i = 0; i < 3; i++) {
140
+ x4->pic.img.plane[i] = frame->data[i];
141
x4->pic.img.i_stride[i] = frame->linesize[i];
144
- x4->pic.i_pts = frame->pts;
145
+ x4->pic.i_pts = frame->pts;
146
x4->pic.i_type = X264_TYPE_AUTO;
149
- if(x264_encoder_encode(x4->enc, &nal, &nnal, frame? &x4->pic: NULL,
151
+ if (x264_encoder_encode(x4->enc, &nal, &nnal, frame? &x4->pic: NULL, &pic_out) < 0)
154
- bufsize = encode_nals(buf, bufsize, nal, nnal);
156
+ bufsize = encode_nals(ctx, buf, bufsize, nal, nnal, 0);
161
+ /* FIXME: libx264 now provides DTS, but AVFrame doesn't have a field for it. */
162
x4->out_pic.pts = pic_out.i_pts;
164
- switch(pic_out.i_type){
165
+ switch (pic_out.i_type) {
168
x4->out_pic.pict_type = FF_I_TYPE;
169
@@ -113,166 +157,194 @@ X264_frame(AVCodecContext *ctx, uint8_t
174
x4->out_pic.key_frame = pic_out.i_type == X264_TYPE_IDR;
175
- x4->out_pic.quality = (pic_out.i_qpplus1 - 1) * FF_QP2LAMBDA;
177
+ x4->out_pic.key_frame = pic_out.b_keyframe;
179
+ x4->out_pic.quality = (pic_out.i_qpplus1 - 1) * FF_QP2LAMBDA;
185
-X264_close(AVCodecContext *avctx)
186
+static av_cold int X264_close(AVCodecContext *avctx)
188
X264Context *x4 = avctx->priv_data;
190
av_freep(&avctx->extradata);
195
x264_encoder_close(x4->enc);
201
-X264_init(AVCodecContext *avctx)
202
+static av_cold int X264_init(AVCodecContext *avctx)
204
X264Context *x4 = avctx->priv_data;
207
x264_param_default(&x4->params);
209
- x4->params.pf_log = X264_log;
210
- x4->params.p_log_private = avctx;
211
+ x4->params.pf_log = X264_log;
212
+ x4->params.p_log_private = avctx;
214
- x4->params.i_keyint_max = avctx->gop_size;
215
- x4->params.rc.i_bitrate = avctx->bit_rate / 1000;
216
+ x4->params.i_keyint_max = avctx->gop_size;
217
+ x4->params.rc.i_bitrate = avctx->bit_rate / 1000;
218
x4->params.rc.i_vbv_buffer_size = avctx->rc_buffer_size / 1000;
219
- x4->params.rc.i_vbv_max_bitrate = avctx->rc_max_rate / 1000;
220
- x4->params.rc.b_stat_write = avctx->flags & CODEC_FLAG_PASS1;
221
- if(avctx->flags & CODEC_FLAG_PASS2) x4->params.rc.b_stat_read = 1;
224
- x4->params.rc.i_rc_method = X264_RC_CRF;
225
+ x4->params.rc.i_vbv_max_bitrate = avctx->rc_max_rate / 1000;
226
+ x4->params.rc.b_stat_write = avctx->flags & CODEC_FLAG_PASS1;
227
+ if (avctx->flags & CODEC_FLAG_PASS2) {
228
+ x4->params.rc.b_stat_read = 1;
231
+ x4->params.rc.i_rc_method = X264_RC_CRF;
232
x4->params.rc.f_rf_constant = avctx->crf;
233
- }else if(avctx->cqp > -1){
234
- x4->params.rc.i_rc_method = X264_RC_CQP;
235
+ } else if (avctx->cqp > -1) {
236
+ x4->params.rc.i_rc_method = X264_RC_CQP;
237
x4->params.rc.i_qp_constant = avctx->cqp;
241
// if neither crf nor cqp modes are selected we have to enable the RC
242
// we do it this way because we cannot check if the bitrate has been set
243
- if(!(avctx->crf || (avctx->cqp > -1))) x4->params.rc.i_rc_method = X264_RC_ABR;
244
+ if (!(avctx->crf || (avctx->cqp > -1)))
245
+ x4->params.rc.i_rc_method = X264_RC_ABR;
247
- x4->params.i_bframe = avctx->max_b_frames;
248
- x4->params.b_cabac = avctx->coder_type == FF_CODER_TYPE_AC;
249
+ x4->params.i_bframe = avctx->max_b_frames;
250
+ x4->params.b_cabac = avctx->coder_type == FF_CODER_TYPE_AC;
251
x4->params.i_bframe_adaptive = avctx->b_frame_strategy;
252
- x4->params.i_bframe_bias = avctx->bframebias;
253
- x4->params.b_bframe_pyramid = avctx->flags2 & CODEC_FLAG2_BPYRAMID;
254
- avctx->has_b_frames= avctx->flags2 & CODEC_FLAG2_BPYRAMID ? 2 : !!avctx->max_b_frames;
255
+ x4->params.i_bframe_bias = avctx->bframebias;
256
+#if X264_BUILD >= 78
257
+ x4->params.i_bframe_pyramid = avctx->flags2 & CODEC_FLAG2_BPYRAMID ? X264_B_PYRAMID_NORMAL : X264_B_PYRAMID_NONE;
259
+ x4->params.b_bframe_pyramid = avctx->flags2 & CODEC_FLAG2_BPYRAMID;
261
+ avctx->has_b_frames = avctx->flags2 & CODEC_FLAG2_BPYRAMID ? 2 : !!avctx->max_b_frames;
263
x4->params.i_keyint_min = avctx->keyint_min;
264
- if(x4->params.i_keyint_min > x4->params.i_keyint_max)
265
+ if (x4->params.i_keyint_min > x4->params.i_keyint_max)
266
x4->params.i_keyint_min = x4->params.i_keyint_max;
268
- x4->params.i_scenecut_threshold = avctx->scenechange_threshold;
269
+ x4->params.i_scenecut_threshold = avctx->scenechange_threshold;
271
- x4->params.b_deblocking_filter = avctx->flags & CODEC_FLAG_LOOP_FILTER;
272
+ x4->params.b_deblocking_filter = avctx->flags & CODEC_FLAG_LOOP_FILTER;
273
x4->params.i_deblocking_filter_alphac0 = avctx->deblockalpha;
274
- x4->params.i_deblocking_filter_beta = avctx->deblockbeta;
275
+ x4->params.i_deblocking_filter_beta = avctx->deblockbeta;
277
- x4->params.rc.i_qp_min = avctx->qmin;
278
- x4->params.rc.i_qp_max = avctx->qmax;
279
- x4->params.rc.i_qp_step = avctx->max_qdiff;
280
+ x4->params.rc.i_qp_min = avctx->qmin;
281
+ x4->params.rc.i_qp_max = avctx->qmax;
282
+ x4->params.rc.i_qp_step = avctx->max_qdiff;
284
- x4->params.rc.f_qcompress = avctx->qcompress; /* 0.0 => cbr, 1.0 => constant qp */
285
- x4->params.rc.f_qblur = avctx->qblur; /* temporally blur quants */
286
+ x4->params.rc.f_qcompress = avctx->qcompress; /* 0.0 => cbr, 1.0 => constant qp */
287
+ x4->params.rc.f_qblur = avctx->qblur; /* temporally blur quants */
288
x4->params.rc.f_complexity_blur = avctx->complexityblur;
290
- x4->params.i_frame_reference = avctx->refs;
291
+ x4->params.i_frame_reference = avctx->refs;
293
- x4->params.i_width = avctx->width;
294
- x4->params.i_height = avctx->height;
295
- x4->params.vui.i_sar_width = avctx->sample_aspect_ratio.num;
296
- x4->params.vui.i_sar_height = avctx->sample_aspect_ratio.den;
297
- x4->params.i_fps_num = avctx->time_base.den;
298
- x4->params.i_fps_den = avctx->time_base.num;
300
- x4->params.analyse.inter = 0;
301
- if(avctx->partitions){
302
- if(avctx->partitions & X264_PART_I4X4)
303
+ x4->params.i_width = avctx->width;
304
+ x4->params.i_height = avctx->height;
305
+ x4->params.vui.i_sar_width = avctx->sample_aspect_ratio.num;
306
+ x4->params.vui.i_sar_height = avctx->sample_aspect_ratio.den;
307
+#if X264_BUILD >= 81
308
+ x4->params.i_fps_num = x4->params.i_timebase_den = avctx->time_base.den;
309
+ x4->params.i_fps_den = x4->params.i_timebase_num = avctx->time_base.num;
312
+ x4->params.analyse.inter = 0;
313
+ if (avctx->partitions) {
314
+ if (avctx->partitions & X264_PART_I4X4)
315
x4->params.analyse.inter |= X264_ANALYSE_I4x4;
316
- if(avctx->partitions & X264_PART_I8X8)
317
+ if (avctx->partitions & X264_PART_I8X8)
318
x4->params.analyse.inter |= X264_ANALYSE_I8x8;
319
- if(avctx->partitions & X264_PART_P8X8)
320
+ if (avctx->partitions & X264_PART_P8X8)
321
x4->params.analyse.inter |= X264_ANALYSE_PSUB16x16;
322
- if(avctx->partitions & X264_PART_P4X4)
323
+ if (avctx->partitions & X264_PART_P4X4)
324
x4->params.analyse.inter |= X264_ANALYSE_PSUB8x8;
325
- if(avctx->partitions & X264_PART_B8X8)
326
+ if (avctx->partitions & X264_PART_B8X8)
327
x4->params.analyse.inter |= X264_ANALYSE_BSUB16x16;
330
- x4->params.analyse.i_direct_mv_pred = avctx->directpred;
331
+ x4->params.analyse.i_direct_mv_pred = avctx->directpred;
333
x4->params.analyse.b_weighted_bipred = avctx->flags2 & CODEC_FLAG2_WPRED;
334
+#if X264_BUILD >= 79
335
+ x4->params.analyse.i_weighted_pred = avctx->weighted_p_pred;
338
- if(avctx->me_method == ME_EPZS)
339
+ if (avctx->me_method == ME_EPZS)
340
x4->params.analyse.i_me_method = X264_ME_DIA;
341
- else if(avctx->me_method == ME_HEX)
342
+ else if (avctx->me_method == ME_HEX)
343
x4->params.analyse.i_me_method = X264_ME_HEX;
344
- else if(avctx->me_method == ME_UMH)
345
+ else if (avctx->me_method == ME_UMH)
346
x4->params.analyse.i_me_method = X264_ME_UMH;
347
- else if(avctx->me_method == ME_FULL)
348
+ else if (avctx->me_method == ME_FULL)
349
x4->params.analyse.i_me_method = X264_ME_ESA;
350
- else if(avctx->me_method == ME_TESA)
351
+ else if (avctx->me_method == ME_TESA)
352
x4->params.analyse.i_me_method = X264_ME_TESA;
353
else x4->params.analyse.i_me_method = X264_ME_HEX;
355
- x4->params.analyse.i_me_range = avctx->me_range;
356
- x4->params.analyse.i_subpel_refine = avctx->me_subpel_quality;
357
+ x4->params.analyse.i_me_range = avctx->me_range;
358
+ x4->params.analyse.i_subpel_refine = avctx->me_subpel_quality;
360
- x4->params.analyse.b_mixed_references =
361
- avctx->flags2 & CODEC_FLAG2_MIXED_REFS;
362
- x4->params.analyse.b_chroma_me = avctx->me_cmp & FF_CMP_CHROMA;
363
- x4->params.analyse.b_transform_8x8 = avctx->flags2 & CODEC_FLAG2_8X8DCT;
364
- x4->params.analyse.b_fast_pskip = avctx->flags2 & CODEC_FLAG2_FASTPSKIP;
365
+ x4->params.analyse.b_mixed_references = avctx->flags2 & CODEC_FLAG2_MIXED_REFS;
366
+ x4->params.analyse.b_chroma_me = avctx->me_cmp & FF_CMP_CHROMA;
367
+ x4->params.analyse.b_transform_8x8 = avctx->flags2 & CODEC_FLAG2_8X8DCT;
368
+ x4->params.analyse.b_fast_pskip = avctx->flags2 & CODEC_FLAG2_FASTPSKIP;
370
- x4->params.analyse.i_trellis = avctx->trellis;
371
- x4->params.analyse.i_noise_reduction = avctx->noise_reduction;
372
+ x4->params.analyse.i_trellis = avctx->trellis;
373
+ x4->params.analyse.i_noise_reduction = avctx->noise_reduction;
375
- if(avctx->level > 0) x4->params.i_level_idc = avctx->level;
376
+ if (avctx->level > 0)
377
+ x4->params.i_level_idc = avctx->level;
379
x4->params.rc.f_rate_tolerance =
380
(float)avctx->bit_rate_tolerance/avctx->bit_rate;
382
- if((avctx->rc_buffer_size != 0) &&
383
- (avctx->rc_initial_buffer_occupancy <= avctx->rc_buffer_size)){
384
+ if ((avctx->rc_buffer_size != 0) &&
385
+ (avctx->rc_initial_buffer_occupancy <= avctx->rc_buffer_size)) {
386
x4->params.rc.f_vbv_buffer_init =
387
- (float)avctx->rc_initial_buffer_occupancy/avctx->rc_buffer_size;
389
- else x4->params.rc.f_vbv_buffer_init = 0.9;
391
- x4->params.rc.f_ip_factor = 1/fabs(avctx->i_quant_factor);
392
- x4->params.rc.f_pb_factor = avctx->b_quant_factor;
393
+ (float)avctx->rc_initial_buffer_occupancy / avctx->rc_buffer_size;
395
+ x4->params.rc.f_vbv_buffer_init = 0.9;
397
+#if X264_BUILD >= 69
398
+ x4->params.rc.b_mb_tree = !!(avctx->flags2 & CODEC_FLAG2_MBTREE);
400
+ x4->params.rc.f_ip_factor = 1 / fabs(avctx->i_quant_factor);
401
+ x4->params.rc.f_pb_factor = avctx->b_quant_factor;
402
x4->params.analyse.i_chroma_qp_offset = avctx->chromaoffset;
404
x4->params.analyse.b_psnr = avctx->flags & CODEC_FLAG_PSNR;
405
- x4->params.i_log_level = X264_LOG_DEBUG;
406
+ x4->params.i_log_level = X264_LOG_DEBUG;
408
- x4->params.b_aud = avctx->flags2 & CODEC_FLAG2_AUD;
409
+ x4->params.b_aud = avctx->flags2 & CODEC_FLAG2_AUD;
411
- x4->params.i_threads = avctx->thread_count;
412
+ x4->params.i_threads = avctx->thread_count;
414
- x4->params.b_interlaced = avctx->flags & CODEC_FLAG_INTERLACED_DCT;
415
+ x4->params.b_interlaced = avctx->flags & CODEC_FLAG_INTERLACED_DCT;
417
- if(avctx->flags & CODEC_FLAG_GLOBAL_HEADER){
418
+ if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER)
419
x4->params.b_repeat_headers = 0;
422
x4->enc = x264_encoder_open(&x4->params);
427
avctx->coded_frame = &x4->out_pic;
429
+#if X264_BUILD >= 76
430
+ if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER) {
434
+ s = x264_encoder_headers(x4->enc, &nal, &nnal);
436
+ avctx->extradata = av_malloc(s);
437
+ avctx->extradata_size = encode_nals(avctx, avctx->extradata, s, nal, nnal, 1);
440
if(avctx->flags & CODEC_FLAG_GLOBAL_HEADER){
443
@@ -284,21 +356,22 @@ X264_init(AVCodecContext *avctx)
444
s += 5 + nal[i].i_payload * 4 / 3;
446
avctx->extradata = av_malloc(s);
447
- avctx->extradata_size = encode_nals(avctx->extradata, s, nal, nnal);
448
+ avctx->extradata_size = encode_nals(avctx, avctx->extradata, s, nal, nnal, 1);
455
AVCodec libx264_encoder = {
457
- .type = CODEC_TYPE_VIDEO,
458
- .id = CODEC_ID_H264,
460
+ .type = CODEC_TYPE_VIDEO,
461
+ .id = CODEC_ID_H264,
462
.priv_data_size = sizeof(X264Context),
464
- .encode = X264_frame,
465
- .close = X264_close,
466
- .capabilities = CODEC_CAP_DELAY,
467
- .pix_fmts = (enum PixelFormat[]) { PIX_FMT_YUV420P, PIX_FMT_NONE },
468
- .long_name = NULL_IF_CONFIG_SMALL("libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"),
470
+ .encode = X264_frame,
471
+ .close = X264_close,
472
+ .capabilities = CODEC_CAP_DELAY,
473
+ .pix_fmts = (const enum PixelFormat[]) { PIX_FMT_YUV420P, PIX_FMT_NONE },
474
+ .long_name = NULL_IF_CONFIG_SMALL("libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"),
476
--- a/libavcodec/avcodec.h
477
+++ b/libavcodec/avcodec.h
478
@@ -501,6 +501,7 @@ typedef struct RcOverride{
479
#define CODEC_FLAG2_CHUNKS 0x00008000 ///< Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries.
480
#define CODEC_FLAG2_NON_LINEAR_QUANT 0x00010000 ///< Use MPEG-2 nonlinear quantizer.
481
#define CODEC_FLAG2_BIT_RESERVOIR 0x00020000 ///< Use a bit reservoir when encoding if possible
482
+#define CODEC_FLAG2_MBTREE 0x00040000 ///< Use macroblock tree ratecontrol (x264 only)
484
/* Unsupported options :
485
* Syntax Arithmetic coding (SAC)
486
@@ -2332,6 +2333,16 @@ typedef struct AVCodecContext {
487
* Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it to 2.
492
+ * explicit P-frame weighted prediction analysis method
494
+ * 1: fast blind weighting (one reference duplicate with -1 offset)
495
+ * 2: smart weighting (full fade detection analysis)
496
+ * - encoding: Set by user.
497
+ * - decoding: unused
499
+ int weighted_p_pred;
503
--- a/ffpresets/libx264-lossless_slow.ffpreset
504
+++ b/ffpresets/libx264-lossless_slow.ffpreset
505
@@ -16,5 +16,6 @@ qmax=51
509
-flags2=+dct8x8+fastpskip
510
+flags2=+dct8x8+fastpskip+mbtree
513
--- a/ffpresets/libx264-lossless_max.ffpreset
514
+++ b/ffpresets/libx264-lossless_max.ffpreset
515
@@ -16,5 +16,6 @@ qmax=51
519
-flags2=+mixed_refs+dct8x8+fastpskip
520
+flags2=+mixed_refs+dct8x8+fastpskip+mbtree
523
--- a/ffpresets/libx264-ipod320.ffpreset
524
+++ b/ffpresets/libx264-ipod320.ffpreset
528
-flags2=-wpred-dct8x8
529
+flags2=-wpred-dct8x8+mbtree
534
--- a/ffpresets/libx264-baseline.ffpreset
535
+++ b/ffpresets/libx264-baseline.ffpreset
539
-flags2=-wpred-dct8x8
540
+flags2=-wpred-dct8x8+mbtree
542
--- a/ffpresets/libx264-slowfirstpass.ffpreset
543
+++ b/ffpresets/libx264-slowfirstpass.ffpreset
544
@@ -14,8 +14,9 @@ qcomp=0.6
553
-flags2=+bpyramid+wpred+dct8x8+fastpskip
554
+flags2=+wpred+dct8x8+fastpskip+mbtree
556
--- a/ffpresets/libx264-default.ffpreset
557
+++ b/ffpresets/libx264-default.ffpreset
558
@@ -3,7 +3,7 @@ flags=+loop
560
partitions=+parti8x8+parti4x4+partp8x8+partb8x8
567
@@ -14,5 +14,9 @@ qcomp=0.6
576
+flags2=+mixed_refs+wpred+dct8x8+fastpskip+mbtree
578
--- a/ffpresets/libx264-lossless_fast.ffpreset
579
+++ b/ffpresets/libx264-lossless_fast.ffpreset
580
@@ -15,5 +15,6 @@ qmin=10
585
+flags2=+fastpskip+mbtree
588
--- a/ffpresets/libx264-main.ffpreset
589
+++ b/ffpresets/libx264-main.ffpreset
592
+flags2=-dct8x8+mbtree
593
--- a/ffpresets/libx264-ipod640.ffpreset
594
+++ b/ffpresets/libx264-ipod640.ffpreset
599
-flags2=-wpred-dct8x8
600
+flags2=-wpred-dct8x8+mbtree
605
--- a/ffpresets/libx264-max.ffpreset
606
+++ b/ffpresets/libx264-max.ffpreset
607
@@ -3,8 +3,8 @@ flags=+loop
609
partitions=+parti8x8+parti4x4+partp8x8+partp4x4+partb8x8
618
@@ -14,8 +14,9 @@ qcomp=0.6
627
-flags2=+bpyramid+wpred+mixed_refs+dct8x8-fastpskip
628
+flags2=+wpred+mixed_refs+dct8x8-fastpskip+mbtree
630
--- a/ffpresets/libx264-normal.ffpreset
631
+++ b/ffpresets/libx264-normal.ffpreset
632
@@ -14,8 +14,9 @@ qcomp=0.6
641
-flags2=+bpyramid+wpred+dct8x8+fastpskip
642
+flags2=+wpred+dct8x8+fastpskip+mbtree
644
--- a/ffpresets/libx264-fastfirstpass.ffpreset
645
+++ b/ffpresets/libx264-fastfirstpass.ffpreset
646
@@ -3,7 +3,7 @@ flags=+loop
648
partitions=-parti8x8-parti4x4-partp8x8-partp4x4-partb8x8
655
@@ -14,8 +14,9 @@ qcomp=0.6
664
-flags2=-bpyramid-wpred-mixed_refs-dct8x8+fastpskip
665
+flags2=-bpyramid-wpred-mixed_refs-dct8x8+fastpskip+mbtree
667
--- a/ffpresets/libx264-lossless_ultrafast.ffpreset
668
+++ b/ffpresets/libx264-lossless_ultrafast.ffpreset
669
@@ -15,5 +15,5 @@ qmin=10
674
+flags2=+fastpskip+mbtree
676
--- a/ffpresets/libx264-lossless_slower.ffpreset
677
+++ b/ffpresets/libx264-lossless_slower.ffpreset
678
@@ -16,5 +16,6 @@ qmax=51
682
-flags2=+mixed_refs+dct8x8+fastpskip
683
+flags2=+mixed_refs+dct8x8+fastpskip+mbtree
686
--- a/ffpresets/libx264-lossless_medium.ffpreset
687
+++ b/ffpresets/libx264-lossless_medium.ffpreset
688
@@ -15,5 +15,6 @@ qmin=10
693
+flags2=+fastpskip+mbtree
696
--- a/ffpresets/libx264-hq.ffpreset
697
+++ b/ffpresets/libx264-hq.ffpreset
698
@@ -14,8 +14,9 @@ qcomp=0.6
707
-flags2=+bpyramid+wpred+mixed_refs+dct8x8+fastpskip
708
+flags2=+wpred+mixed_refs+dct8x8+fastpskip+mbtree
712
@@ -2011,7 +2011,7 @@ enabled libschroedinger && add_cflags $(
713
enabled libspeex && require libspeex speex/speex.h speex_decoder_init -lspeex
714
enabled libtheora && require libtheora theora/theora.h theora_info_init -ltheora -logg
715
enabled libvorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbisenc -lvorbis -logg
716
-enabled libx264 && require libx264 x264.h x264_encoder_open -lx264 -lm &&
717
+enabled libx264 && require libx264 x264.h x264_encoder_encode -lx264 -lm &&
718
{ check_cpp_condition x264.h "X264_BUILD >= 65" ||
719
die "ERROR: libx264 version must be >= 0.65."; }
720
enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore