It's technically an ABI break, but we are going to bump major soon anyway.
Signed-off-by: Vittorio Giovara <[email protected]>
---
doc/APIchanges | 3 +++
libavcodec/avcodec.h | 17 ++++++++++++++++-
libavcodec/libx264.c | 10 +++++-----
libavcodec/libxavs.c | 18 +++++++++---------
libavcodec/libxvid.c | 12 ++++++------
libavcodec/motion_est.c | 20 ++++++++++----------
libavcodec/options_table.h | 24 ++++++++++++------------
libavcodec/version.h | 7 +++++--
8 files changed, 66 insertions(+), 45 deletions(-)
diff --git a/doc/APIchanges b/doc/APIchanges
index a2c5eb05..fd8c40e 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -13,6 +13,9 @@ libavutil: 2014-08-09
API changes, most recent first:
+2015-xx-xx - xxxxxxx - lavc 56.32.0 - avcodec.h
+ Introduce AVMotionEst, in place of the deprecated Motion_Est_ID enum.
+
2015-xx-xx - xxxxxxx - lavu 56.15.0
Add av_version_info().
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index e8be196..4591253 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -549,6 +549,20 @@ typedef struct AVCodecDescriptor {
* @ingroup lavc_encoding
* motion estimation type.
*/
+enum AVMotionEst {
+ AV_ME_ZERO = 1, ///< no search, use 0,0 vector whenever one is needed
+ AV_ME_FULL,
+ AV_ME_LOG,
+ AV_ME_PHODS,
+ AV_ME_EPZS, ///< enhanced predictive zonal search
+ AV_ME_X1, ///< reserved for experiments
+ AV_ME_HEX, ///< hexagon based search
+ AV_ME_UMH, ///< uneven multi-hexagon search
+ AV_ME_TESA, ///< transformed exhaustive search algorithm
+};
+
+#if FF_API_MOTION_EST_ID
+/** @deprecated use AVMotionEst instead */
enum Motion_Est_ID {
ME_ZERO = 1, ///< no search, that is use 0,0 vector whenever one is
needed
ME_FULL,
@@ -560,6 +574,7 @@ enum Motion_Est_ID {
ME_UMH, ///< uneven multi-hexagon search
ME_TESA, ///< transformed exhaustive search algorithm
};
+#endif
/**
* @ingroup lavc_decoding
@@ -1281,7 +1296,7 @@ typedef struct AVCodecContext {
* - encoding: MUST be set by user.
* - decoding: unused
*/
- int me_method;
+ enum AVMotionEst me_method;
/**
* If non NULL, 'draw_horiz_band' is called by the libavcodec
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 7c502fd..2536f77 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -374,15 +374,15 @@ static av_cold int X264_init(AVCodecContext *avctx)
x4->params.rc.f_pb_factor = avctx->b_quant_factor;
x4->params.analyse.i_chroma_qp_offset = avctx->chromaoffset;
- if (avctx->me_method == ME_EPZS)
+ if (avctx->me_method == AV_ME_EPZS)
x4->params.analyse.i_me_method = X264_ME_DIA;
- else if (avctx->me_method == ME_HEX)
+ else if (avctx->me_method == AV_ME_HEX)
x4->params.analyse.i_me_method = X264_ME_HEX;
- else if (avctx->me_method == ME_UMH)
+ else if (avctx->me_method == AV_ME_UMH)
x4->params.analyse.i_me_method = X264_ME_UMH;
- else if (avctx->me_method == ME_FULL)
+ else if (avctx->me_method == AV_ME_FULL)
x4->params.analyse.i_me_method = X264_ME_ESA;
- else if (avctx->me_method == ME_TESA)
+ else if (avctx->me_method == AV_ME_TESA)
x4->params.analyse.i_me_method = X264_ME_TESA;
if (avctx->gop_size >= 0)
diff --git a/libavcodec/libxavs.c b/libavcodec/libxavs.c
index 7a74e36..d58384e 100644
--- a/libavcodec/libxavs.c
+++ b/libavcodec/libxavs.c
@@ -295,23 +295,23 @@ static av_cold int XAVS_init(AVCodecContext *avctx)
x4->params.analyse.inter = XAVS_ANALYSE_I8x8
|XAVS_ANALYSE_PSUB16x16| XAVS_ANALYSE_BSUB16x16;
switch (avctx->me_method) {
- case ME_EPZS:
+ case AV_ME_EPZS:
x4->params.analyse.i_me_method = XAVS_ME_DIA;
break;
- case ME_HEX:
- x4->params.analyse.i_me_method = XAVS_ME_HEX;
+ case AV_ME_HEX:
+ x4->params.analyse.i_me_method = XAVS_AV_ME_HEX;
break;
- case ME_UMH:
- x4->params.analyse.i_me_method = XAVS_ME_UMH;
+ case AV_ME_UMH:
+ x4->params.analyse.i_me_method = XAVS_AV_ME_UMH;
break;
- case ME_FULL:
+ case AV_ME_FULL:
x4->params.analyse.i_me_method = XAVS_ME_ESA;
break;
- case ME_TESA:
- x4->params.analyse.i_me_method = XAVS_ME_TESA;
+ case AV_ME_TESA:
+ x4->params.analyse.i_me_method = XAVS_AV_ME_TESA;
break;
default:
- x4->params.analyse.i_me_method = XAVS_ME_HEX;
+ x4->params.analyse.i_me_method = XAVS_AV_ME_HEX;
}
x4->params.analyse.i_me_range = avctx->me_range;
diff --git a/libavcodec/libxvid.c b/libavcodec/libxvid.c
index 97ff95b..6a2514a 100644
--- a/libavcodec/libxvid.c
+++ b/libavcodec/libxvid.c
@@ -380,23 +380,23 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx)
/* Decide which ME quality setting to use */
x->me_flags = 0;
switch (avctx->me_method) {
- case ME_FULL: /* Quality 6 */
+ case AV_ME_FULL: /* Quality 6 */
x->me_flags |= XVID_ME_EXTSEARCH16 |
XVID_ME_EXTSEARCH8;
- case ME_EPZS: /* Quality 4 */
+ case AV_ME_EPZS: /* Quality 4 */
x->me_flags |= XVID_ME_ADVANCEDDIAMOND8 |
XVID_ME_HALFPELREFINE8 |
XVID_ME_CHROMA_PVOP |
XVID_ME_CHROMA_BVOP;
- case ME_LOG: /* Quality 2 */
- case ME_PHODS:
- case ME_X1:
+ case AV_ME_LOG: /* Quality 2 */
+ case AV_ME_PHODS:
+ case AV_ME_X1:
x->me_flags |= XVID_ME_ADVANCEDDIAMOND16 |
XVID_ME_HALFPELREFINE16;
- case ME_ZERO: /* Quality 0 */
+ case AV_ME_ZERO: /* Quality 0 */
default:
break;
}
diff --git a/libavcodec/motion_est.c b/libavcodec/motion_est.c
index d0c0439..f80acc3 100644
--- a/libavcodec/motion_est.c
+++ b/libavcodec/motion_est.c
@@ -309,9 +309,9 @@ int ff_init_me(MpegEncContext *s){
av_log(s->avctx, AV_LOG_ERROR, "ME_MAP size is too small for SAB
diamond\n");
return -1;
}
- if (s->me_method != ME_ZERO &&
- s->me_method != ME_EPZS &&
- s->me_method != ME_X1) {
+ if (s->me_method != AV_ME_ZERO &&
+ s->me_method != AV_ME_EPZS &&
+ s->me_method != AV_ME_X1) {
av_log(s->avctx, AV_LOG_ERROR, "me_method is only allowed to be set to
zero and epzs; for hex,umh,full and others see dia_size\n");
return -1;
}
@@ -896,14 +896,14 @@ void ff_estimate_p_frame_motion(MpegEncContext * s,
c->mb_var_sum_temp += (varc+128)>>8;
switch(s->me_method) {
- case ME_ZERO:
+ case AV_ME_ZERO:
default:
mx = 0;
my = 0;
dmin = 0;
break;
- case ME_X1:
- case ME_EPZS:
+ case AV_ME_X1:
+ case AV_ME_EPZS:
{
const int mot_stride = s->b8_stride;
const int mot_xy = s->block_index[0];
@@ -1116,14 +1116,14 @@ static int estimate_motion_b(MpegEncContext *s, int
mb_x, int mb_y,
get_limits(s, 16*mb_x, 16*mb_y);
switch(s->me_method) {
- case ME_ZERO:
+ case AV_ME_ZERO:
default:
mx = 0;
my = 0;
dmin = 0;
break;
- case ME_X1:
- case ME_EPZS:
+ case AV_ME_X1:
+ case AV_ME_EPZS:
P_LEFT[0] = mv_table[mot_xy - 1][0];
P_LEFT[1] = mv_table[mot_xy - 1][1];
@@ -1592,7 +1592,7 @@ void ff_estimate_b_frame_motion(MpegEncContext * s,
/* find best f_code for ME which do unlimited searches */
int ff_get_best_fcode(MpegEncContext * s, int16_t (*mv_table)[2], int type)
{
- if(s->me_method>=ME_EPZS){
+ if (s->me_method >= AV_ME_EPZS) {
int score[8];
int i, y, range= s->avctx->me_range ? s->avctx->me_range : (INT_MAX/2);
uint8_t * fcode_tab= s->fcode_tab;
diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index 4fc59ff..5702f8c 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -84,18 +84,18 @@ static const AVOption avcodec_options[] = {
{"noout", "skip bitstream encoding", 0, AV_OPT_TYPE_CONST, {.i64 =
CODEC_FLAG2_NO_OUTPUT }, INT_MIN, INT_MAX, V|E, "flags2"},
{"ignorecrop", "ignore cropping information from sps", 1, AV_OPT_TYPE_CONST,
{.i64 = CODEC_FLAG2_IGNORE_CROP }, INT_MIN, INT_MAX, V|D, "flags2"},
{"local_header", "place global headers at every keyframe instead of in
extradata", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_LOCAL_HEADER }, INT_MIN,
INT_MAX, V|E, "flags2"},
-{"me_method", "set motion estimation method", OFFSET(me_method),
AV_OPT_TYPE_INT, {.i64 = ME_EPZS }, INT_MIN, INT_MAX, V|E, "me_method"},
-{"zero", "zero motion estimation (fastest)", 0, AV_OPT_TYPE_CONST, {.i64 =
ME_ZERO }, INT_MIN, INT_MAX, V|E, "me_method" },
-{"full", "full motion estimation (slowest)", 0, AV_OPT_TYPE_CONST, {.i64 =
ME_FULL }, INT_MIN, INT_MAX, V|E, "me_method" },
-{"epzs", "EPZS motion estimation (default)", 0, AV_OPT_TYPE_CONST, {.i64 =
ME_EPZS }, INT_MIN, INT_MAX, V|E, "me_method" },
-{"esa", "esa motion estimation (alias for full)", 0, AV_OPT_TYPE_CONST, {.i64
= ME_FULL }, INT_MIN, INT_MAX, V|E, "me_method" },
-{"tesa", "tesa motion estimation", 0, AV_OPT_TYPE_CONST, {.i64 = ME_TESA },
INT_MIN, INT_MAX, V|E, "me_method" },
-{"dia", "diamond motion estimation (alias for EPZS)", 0, AV_OPT_TYPE_CONST,
{.i64 = ME_EPZS }, INT_MIN, INT_MAX, V|E, "me_method" },
-{"log", "log motion estimation", 0, AV_OPT_TYPE_CONST, {.i64 = ME_LOG },
INT_MIN, INT_MAX, V|E, "me_method" },
-{"phods", "phods motion estimation", 0, AV_OPT_TYPE_CONST, {.i64 = ME_PHODS },
INT_MIN, INT_MAX, V|E, "me_method" },
-{"x1", "X1 motion estimation", 0, AV_OPT_TYPE_CONST, {.i64 = ME_X1 }, INT_MIN,
INT_MAX, V|E, "me_method" },
-{"hex", "hex motion estimation", 0, AV_OPT_TYPE_CONST, {.i64 = ME_HEX },
INT_MIN, INT_MAX, V|E, "me_method" },
-{"umh", "umh motion estimation", 0, AV_OPT_TYPE_CONST, {.i64 = ME_UMH },
INT_MIN, INT_MAX, V|E, "me_method" },
+{"me_method", "set motion estimation method", OFFSET(me_method),
AV_OPT_TYPE_INT, {.i64 = AV_ME_EPZS }, INT_MIN, INT_MAX, V|E, "me_method"},
+{"zero", "zero motion estimation (fastest)", 0, AV_OPT_TYPE_CONST, {.i64 =
AV_ME_ZERO }, INT_MIN, INT_MAX, V|E, "me_method" },
+{"full", "full motion estimation (slowest)", 0, AV_OPT_TYPE_CONST, {.i64 =
AV_ME_FULL }, INT_MIN, INT_MAX, V|E, "me_method" },
+{"epzs", "EPZS motion estimation (default)", 0, AV_OPT_TYPE_CONST, {.i64 =
AV_ME_EPZS }, INT_MIN, INT_MAX, V|E, "me_method" },
+{"esa", "esa motion estimation (alias for full)", 0, AV_OPT_TYPE_CONST, {.i64
= AV_ME_FULL }, INT_MIN, INT_MAX, V|E, "me_method" },
+{"tesa", "tesa motion estimation", 0, AV_OPT_TYPE_CONST, {.i64 = AV_ME_TESA },
INT_MIN, INT_MAX, V|E, "me_method" },
+{"dia", "diamond motion estimation (alias for EPZS)", 0, AV_OPT_TYPE_CONST,
{.i64 = AV_ME_EPZS }, INT_MIN, INT_MAX, V|E, "me_method" },
+{"log", "log motion estimation", 0, AV_OPT_TYPE_CONST, {.i64 = AV_ME_LOG },
INT_MIN, INT_MAX, V|E, "me_method" },
+{"phods", "phods motion estimation", 0, AV_OPT_TYPE_CONST, {.i64 = AV_ME_PHODS
}, INT_MIN, INT_MAX, V|E, "me_method" },
+{"x1", "X1 motion estimation", 0, AV_OPT_TYPE_CONST, {.i64 = AV_ME_X1 },
INT_MIN, INT_MAX, V|E, "me_method" },
+{"hex", "hex motion estimation", 0, AV_OPT_TYPE_CONST, {.i64 = AV_ME_HEX },
INT_MIN, INT_MAX, V|E, "me_method" },
+{"umh", "umh motion estimation", 0, AV_OPT_TYPE_CONST, {.i64 = AV_ME_UMH },
INT_MIN, INT_MAX, V|E, "me_method" },
{"extradata_size", NULL, OFFSET(extradata_size), AV_OPT_TYPE_INT, {.i64 =
DEFAULT }, INT_MIN, INT_MAX},
{"time_base", NULL, OFFSET(time_base), AV_OPT_TYPE_RATIONAL, {.dbl = 0},
INT_MIN, INT_MAX},
{"g", "set the group of picture (GOP) size", OFFSET(gop_size),
AV_OPT_TYPE_INT, {.i64 = 12 }, INT_MIN, INT_MAX, V|E},
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 0ea5ada..44c82a0 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,8 +29,8 @@
#include "libavutil/version.h"
#define LIBAVCODEC_VERSION_MAJOR 56
-#define LIBAVCODEC_VERSION_MINOR 31
-#define LIBAVCODEC_VERSION_MICRO 2
+#define LIBAVCODEC_VERSION_MINOR 32
+#define LIBAVCODEC_VERSION_MICRO 0
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
@@ -171,5 +171,8 @@
#ifndef FF_API_RC_STRATEGY
#define FF_API_RC_STRATEGY (LIBAVCODEC_VERSION_MAJOR < 59)
#endif
+#ifndef FF_API_MOTION_EST_ID
+#define FF_API_MOTION_EST_ID (LIBAVCODEC_VERSION_MAJOR < 59)
+#endif
#endif /* AVCODEC_VERSION_H */
--
1.9.5 (Apple Git-50.3)
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel