# HG changeset patch # User michael # Date 1147002487 0 # Node ID f1bcb9ae510bb189a93f5bdeba77f1eebe9864d2 # Parent 1fd5fce70e6657b77397571b1da9da5943dca36e make zero motion vector threshold user setable diff -r 1fd5fce70e66 -r f1bcb9ae510b avcodec.h --- a/avcodec.h Sat May 06 10:57:38 2006 +0000 +++ b/avcodec.h Sun May 07 11:48:07 2006 +0000 @@ -1967,6 +1967,14 @@ * - decoding: unused */ int scenechange_factor; + + /** + * + * note: value depends upon the compare functin used for fullpel ME + * - encoding: set by user. + * - decoding: unused + */ + int mv0_threshold; } AVCodecContext; /** diff -r 1fd5fce70e66 -r f1bcb9ae510b motion_est_template.c --- a/motion_est_template.c Sat May 06 10:57:38 2006 +0000 +++ b/motion_est_template.c Sun May 07 11:48:07 2006 +0000 @@ -896,7 +896,8 @@ CHECK_CLIPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16, (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16) }else{ - if(dminavctx->mv0_threshold)>>8) + && ( P_LEFT[0] |P_LEFT[1] |P_TOP[0] |P_TOP[1] |P_TOPRIGHT[0]|P_TOPRIGHT[1])==0){ *mx_ptr= 0; diff -r 1fd5fce70e66 -r f1bcb9ae510b utils.c --- a/utils.c Sat May 06 10:57:38 2006 +0000 +++ b/utils.c Sun May 07 11:48:07 2006 +0000 @@ -739,6 +739,7 @@ {"partp8x8", NULL, 0, FF_OPT_TYPE_CONST, X264_PART_P8X8, INT_MIN, INT_MAX, V|E, "partitions"}, {"partb8x8", NULL, 0, FF_OPT_TYPE_CONST, X264_PART_B8X8, INT_MIN, INT_MAX, V|E, "partitions"}, {"sc_factor", NULL, OFFSET(scenechange_factor), FF_OPT_TYPE_INT, 6, 0, INT_MAX, V|E}, +{"mv0_threshold", NULL, OFFSET(mv0_threshold), FF_OPT_TYPE_INT, 256, 0, INT_MAX, V|E}, {NULL}, }; @@ -793,6 +794,7 @@ s->frame_skip_cmp= FF_CMP_DCTMAX; s->nsse_weight= 8; s->sample_fmt= SAMPLE_FMT_S16; // FIXME: set to NONE + s->mv0_threshold= 256; s->intra_quant_bias= FF_DEFAULT_QUANT_BIAS; s->inter_quant_bias= FF_DEFAULT_QUANT_BIAS;