summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Buitenhuis <derek.buitenhuis@gmail.com>2016-02-03 16:54:20 +0000
committerDerek Buitenhuis <derek.buitenhuis@gmail.com>2016-02-03 16:54:20 +0000
commit730d2aabacd679fd44f770959877b3c6a5d80f0e (patch)
tree941c1c5021576538835d7f84ad13268d64fbdd71
parent43c0298208ad6fe36a4dbf03824842d89c3ed143 (diff)
parent0e9c4fe254073b209970df3e3cb84531bc388e99 (diff)
Merge commit '0e9c4fe254073b209970df3e3cb84531bc388e99'
* commit '0e9c4fe254073b209970df3e3cb84531bc388e99': lavc: Move pre_me to codec private options Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
-rw-r--r--libavcodec/avcodec.h9
-rw-r--r--libavcodec/mpegvideo.h2
-rw-r--r--libavcodec/mpegvideo_enc.c5
-rw-r--r--libavcodec/options_table.h2
4 files changed, 12 insertions, 6 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index d7de4ff319..d8497655b0 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -1989,12 +1989,11 @@ typedef struct AVCodecContext {
*/
int last_predictor_count;
- /**
- * prepass for motion estimation
- * - encoding: Set by user.
- * - decoding: unused
- */
+#if FF_API_PRIVATE_OPT
+ /** @deprecated use encoder private options instead */
+ attribute_deprecated
int pre_me;
+#endif
/**
* motion estimation prepass comparison function
diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h
index 8f4dfa1ec3..df5e4bf5d2 100644
--- a/libavcodec/mpegvideo.h
+++ b/libavcodec/mpegvideo.h
@@ -257,6 +257,7 @@ typedef struct MpegEncContext {
#endif
int motion_est; ///< ME algorithm
int me_penalty_compensation;
+ int me_pre; ///< prepass for motion estimation
int mv_dir;
#define MV_DIR_FORWARD 1
#define MV_DIR_BACKWARD 2
@@ -651,6 +652,7 @@ FF_MPV_OPT_CMP_FUNC, \
{"mpeg_quant", "Use MPEG quantizers instead of H.263", FF_MPV_OFFSET(mpeg_quant), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, 1, FF_MPV_OPT_FLAGS }, \
{"ps", "RTP payload size in bytes", FF_MPV_OFFSET(rtp_payload_size), AV_OPT_TYPE_INT, {.i64 = 0 }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS }, \
{"mepc", "Motion estimation bitrate penalty compensation (1.0 = 256)", FF_MPV_OFFSET(me_penalty_compensation), AV_OPT_TYPE_INT, {.i64 = 256 }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS }, \
+{"mepre", "pre motion estimation", FF_MPV_OFFSET(me_pre), AV_OPT_TYPE_INT, {.i64 = 0 }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS }, \
extern const AVOption ff_mpv_generic_options[];
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 1e0d33d266..297ff78840 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -355,6 +355,8 @@ FF_DISABLE_DEPRECATION_WARNINGS
s->rtp_payload_size = avctx->rtp_payload_size;
if (avctx->me_penalty_compensation)
s->me_penalty_compensation = avctx->me_penalty_compensation;
+ if (avctx->pre_me)
+ s->me_pre = avctx->pre_me;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
@@ -3734,7 +3736,8 @@ static int encode_picture(MpegEncContext *s, int picture_number)
s->lambda = (s->lambda * s->me_penalty_compensation + 128) >> 8;
s->lambda2 = (s->lambda2 * (int64_t) s->me_penalty_compensation + 128) >> 8;
if (s->pict_type != AV_PICTURE_TYPE_B) {
- if((s->avctx->pre_me && s->last_non_b_pict_type==AV_PICTURE_TYPE_I) || s->avctx->pre_me==2){
+ if ((s->me_pre && s->last_non_b_pict_type == AV_PICTURE_TYPE_I) ||
+ s->me_pre == 2) {
s->avctx->execute(s->avctx, pre_estimate_motion_thread, &s->thread_context[0], NULL, context_count, sizeof(void*));
}
}
diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index 1987dc4850..75fb09372a 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -289,7 +289,9 @@ static const AVOption avcodec_options[] = {
{"ildctcmp", "interlaced DCT compare function", OFFSET(ildct_cmp), AV_OPT_TYPE_INT, {.i64 = FF_CMP_VSAD }, INT_MIN, INT_MAX, V|E, "cmp_func"},
{"dia_size", "diamond type & size for motion estimation", OFFSET(dia_size), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
{"last_pred", "amount of motion predictors from the previous frame", OFFSET(last_predictor_count), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
+#if FF_API_PRIVATE_OPT
{"preme", "pre motion estimation", OFFSET(pre_me), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
+#endif
{"precmp", "pre motion estimation compare function", OFFSET(me_pre_cmp), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E, "cmp_func"},
{"sad", "sum of absolute differences, fast", 0, AV_OPT_TYPE_CONST, {.i64 = FF_CMP_SAD }, INT_MIN, INT_MAX, V|E, "cmp_func"},
{"sse", "sum of squared errors", 0, AV_OPT_TYPE_CONST, {.i64 = FF_CMP_SSE }, INT_MIN, INT_MAX, V|E, "cmp_func"},