param->analyse.i_subpel_refine = 5;
param->analyse.b_chroma_me = 1;
param->analyse.i_mv_range = -1; // set from level_idc
+ param->analyse.i_direct_8x8_inference = -1; // set from level_idc
param->analyse.i_chroma_qp_offset = 0;
param->analyse.b_fast_pskip = 1;
param->analyse.b_dct_decimate = 1;
p->analyse.b_weighted_bipred = atobool(value);
OPT("direct")
b_error |= parse_enum( value, x264_direct_pred_names, &p->analyse.i_direct_mv_pred );
+ OPT("direct-8x8")
+ p->analyse.i_direct_8x8_inference = atoi(value);
OPT("chroma-qp-offset")
p->analyse.i_chroma_qp_offset = atoi(value);
OPT("me")
h->param.analyse.i_mv_range = l->mv_range;
else
h->param.analyse.i_mv_range = x264_clip3(h->param.analyse.i_mv_range, 32, 2048);
+ if( h->param.analyse.i_direct_8x8_inference < 0 )
+ h->param.analyse.i_direct_8x8_inference = l->direct8x8;
}
if( h->param.rc.f_qblur < 0 )
BOOLIFY( b_deblocking_filter );
BOOLIFY( b_interlaced );
BOOLIFY( analyse.b_transform_8x8 );
+ BOOLIFY( analyse.i_direct_8x8_inference );
BOOLIFY( analyse.b_bidir_me );
BOOLIFY( analyse.b_chroma_me );
BOOLIFY( analyse.b_fast_pskip );
sps->i_mb_height = ( sps->i_mb_height + 1 ) & ~1;
sps->b_frame_mbs_only = ! param->b_interlaced;
sps->b_mb_adaptive_frame_field = param->b_interlaced;
- sps->b_direct8x8_inference = 0;
- if( ! sps->b_frame_mbs_only ||
- !(param->analyse.inter & X264_ANALYSE_PSUB8x8) )
- {
- sps->b_direct8x8_inference = 1;
- }
+ sps->b_direct8x8_inference = param->analyse.i_direct_8x8_inference
+ || ! sps->b_frame_mbs_only
+ || !(param->analyse.inter & X264_ANALYSE_PSUB8x8);
sps->crop.i_left = 0;
sps->crop.i_top = 0;
if( h->param.i_fps_den > 0 )
CHECK( "MB rate", l->mbps, (int64_t)mbs * h->param.i_fps_num / h->param.i_fps_den );
+ if( h->sps->b_direct8x8_inference < l->direct8x8 )
+ x264_log( h, X264_LOG_WARNING, "direct 8x8 inference (0) < level requirement (1)\n" );
/* TODO check the rest of the limits */
}
H0( " --direct <string> Direct MV prediction mode [\"%s\"]\n"
" - none, spatial, temporal, auto\n",
strtable_lookup( x264_direct_pred_names, defaults->analyse.i_direct_mv_pred ) );
+ H1( " --direct-8x8 <-1|0|1> Direct prediction size [%d]\n"
+ " - 0: 4x4\n"
+ " - 1: 8x8\n"
+ " - -1: smallest possible according to level\n",
+ defaults->analyse.i_direct_8x8_inference );
H0( " -w, --weightb Weighted prediction for B-frames\n" );
H0( " --me <string> Integer pixel motion estimation method [\"%s\"]\n",
strtable_lookup( x264_motion_est_names, defaults->analyse.i_me_method ) );
{ "output", required_argument, NULL, 'o' },
{ "analyse", required_argument, NULL, 'A' },
{ "direct", required_argument, NULL, 0 },
+ { "direct-8x8", required_argument, NULL, 0 },
{ "weightb", no_argument, NULL, 'w' },
{ "me", required_argument, NULL, 0 },
{ "merange", required_argument, NULL, 0 },
#include <stdarg.h>
-#define X264_BUILD 51
+#define X264_BUILD 52
/* x264_t:
* opaque handler for decoder and encoder */
int b_transform_8x8;
int b_weighted_bipred; /* implicit weighting for B-frames */
int i_direct_mv_pred; /* spatial vs temporal mv prediction */
+ int i_direct_8x8_inference; /* forbid 4x4 direct partitions. -1 = auto, based on level */
int i_chroma_qp_offset;
int i_me_method; /* motion estimation algorithm to use (X264_ME_*) */
int i_me_range; /* integer pixel motion estimation search range (from predicted mv) */
- int i_mv_range; /* maximum length of a mv (in pixels) */
+ int i_mv_range; /* maximum length of a mv (in pixels). -1 = auto, based on level */
int i_subpel_refine; /* subpixel motion estimation quality */
int b_bidir_me; /* jointly optimize both MVs in B-frames */
int b_chroma_me; /* chroma ME for subpel and mode decision in P-frames */