summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--DOCS/tech/libavc-options.txt7
-rw-r--r--libmpcodecs/ve_lavc.c13
2 files changed, 20 insertions, 0 deletions
diff --git a/DOCS/tech/libavc-options.txt b/DOCS/tech/libavc-options.txt
index 26b7c002a9..143c225319 100644
--- a/DOCS/tech/libavc-options.txt
+++ b/DOCS/tech/libavc-options.txt
@@ -276,6 +276,7 @@ pred (for huffyuv)
qpel use quarter pel motion compensation
Tip: this seems only usefull for high bitrate encodings
+precmp comparission function for motion estimation pre pass
cmp comparission function for full pel motion estimation
subcmp comparission function for sub pel motion estimation
0 SAD (sum of absolute differences) (default)
@@ -289,6 +290,7 @@ subcmp comparission function for sub pel motion estimation
Tip2: when using SATD for full pel search u should use a larger diamond
something like dia=2 or dia=4
+predia (-99 - 6) diamond type & size for motion estimation pre pass
dia (-99 - 6) diamond type & size for motion estimation
...
-3 shape adaptive diamond with size 3
@@ -318,6 +320,7 @@ trell trellis quantization
lambda is a qp dependant constant
bits is the amount of bits needed to encode the block
error is simple the sum of squared errors of the quantization
+ Tip: this
last_pred (0-99) amount of motion predictors from the previous frame
0 (default)
@@ -327,6 +330,10 @@ preme (0-2) Motion estimation pre-pass
0 disabled
1 only after I frames (default)
2 allways
+
+subq (1-8) subpel refinement quality (for qpel)
+ 8 (default)
+ Note: this has a significant effect on the speed
lavdopts: (decoder options)
---------------------------
diff --git a/libmpcodecs/ve_lavc.c b/libmpcodecs/ve_lavc.c
index aa8f508a95..991b1267bc 100644
--- a/libmpcodecs/ve_lavc.c
+++ b/libmpcodecs/ve_lavc.c
@@ -107,14 +107,17 @@ static int lavc_param_prediction_method= FF_PRED_LEFT;
static char *lavc_param_format="YV12";
static int lavc_param_debug= 0;
static int lavc_param_psnr= 0;
+static int lavc_param_me_pre_cmp= 0;
static int lavc_param_me_cmp= 0;
static int lavc_param_me_sub_cmp= 0;
static int lavc_param_mb_cmp= 0;
+static int lavc_param_pre_dia_size= 0;
static int lavc_param_dia_size= 0;
static int lavc_param_qpel= 0;
static int lavc_param_trell= 0;
static int lavc_param_last_pred= 0;
static int lavc_param_pre_me= 1;
+static int lavc_param_me_subpel_quality= 8;
#include "cfgparser.h"
@@ -178,9 +181,11 @@ struct config lavcopts_conf[]={
#if LIBAVCODEC_BUILD >= 4643
{"psnr", &lavc_param_psnr, CONF_TYPE_FLAG, 0, 0, CODEC_FLAG_PSNR, NULL},
#endif
+ {"precmp", &lavc_param_me_pre_cmp, CONF_TYPE_INT, CONF_RANGE, 0, 2000, NULL},
{"cmp", &lavc_param_me_cmp, CONF_TYPE_INT, CONF_RANGE, 0, 2000, NULL},
{"subcmp", &lavc_param_me_sub_cmp, CONF_TYPE_INT, CONF_RANGE, 0, 2000, NULL},
{"mbcmp", &lavc_param_mb_cmp, CONF_TYPE_INT, CONF_RANGE, 0, 2000, NULL},
+ {"predia", &lavc_param_pre_dia_size, CONF_TYPE_INT, CONF_RANGE, -2000, 2000, NULL},
{"dia", &lavc_param_dia_size, CONF_TYPE_INT, CONF_RANGE, -2000, 2000, NULL},
{"qpel", &lavc_param_qpel, CONF_TYPE_FLAG, 0, 0, CODEC_FLAG_QPEL, NULL},
#if LIBAVCODEC_BUILD >= 4648
@@ -188,6 +193,7 @@ struct config lavcopts_conf[]={
#endif
{"last_pred", &lavc_param_last_pred, CONF_TYPE_INT, CONF_RANGE, 0, 2000, NULL},
{"preme", &lavc_param_pre_me, CONF_TYPE_INT, CONF_RANGE, 0, 2000, NULL},
+ {"subq", &lavc_param_me_subpel_quality, CONF_TYPE_INT, CONF_RANGE, 0, 8, NULL},
{NULL, NULL, 0, 0, 0, 0, NULL}
};
#endif
@@ -267,6 +273,13 @@ static int config(struct vf_instance_s* vf,
#if LIBAVCODEC_BUILD >= 4650
lavc_venc_context->pre_me= lavc_param_pre_me;
#endif
+#if LIBAVCODEC_BUILD >= 4651
+ lavc_venc_context->me_pre_cmp= lavc_param_me_pre_cmp;
+ lavc_venc_context->pre_dia_size= lavc_param_pre_dia_size;
+#endif
+#if LIBAVCODEC_BUILD >= 4652
+ lavc_venc_context->me_subpel_quality= lavc_param_me_subpel_quality;
+#endif
p= lavc_param_rc_override_string;
for(i=0; p; i++){