Commit 9bb2d1a3 authored by Anton Khirnov's avatar Anton Khirnov

h263p encoder: add 'umv' private option.

Deprecate CODEC_FLAG_H263P_UMV
parent 0e5d3730
......@@ -599,7 +599,9 @@ typedef struct RcOverride{
#define CODEC_FLAG_BITEXACT 0x00800000 ///< Use only bitexact stuff (except (I)DCT).
/* Fx : Flag for h263+ extra options */
#define CODEC_FLAG_AC_PRED 0x01000000 ///< H.263 advanced intra coding / MPEG-4 AC prediction
#if FF_API_MPEGVIDEO_GLOBAL_OPTS
#define CODEC_FLAG_H263P_UMV 0x02000000 ///< unlimited motion vector
#endif
#define CODEC_FLAG_CBP_RD 0x04000000 ///< Use rate distortion optimization for cbp.
#define CODEC_FLAG_QP_RD 0x08000000 ///< Use rate distortion optimization for qp selectioon.
#define CODEC_FLAG_H263P_AIV 0x00000008 ///< H.263 alternative inter VLC
......
......@@ -29,6 +29,7 @@
#include "libavutil/intmath.h"
#include "libavutil/mathematics.h"
#include "libavutil/opt.h"
#include "avcodec.h"
#include "dsputil.h"
#include "mpegvideo.h"
......@@ -605,7 +606,10 @@ av_cold int MPV_encode_init(AVCodecContext *avctx)
s->out_format = FMT_H263;
s->h263_plus = 1;
/* Fx */
s->umvplus = (avctx->flags & CODEC_FLAG_H263P_UMV) ? 1:0;
#if FF_API_MPEGVIDEO_GLOBAL_OPTS
if (avctx->flags & CODEC_FLAG_H263P_UMV)
s->umvplus = 1;
#endif
s->h263_aic= (avctx->flags & CODEC_FLAG_AC_PRED) ? 1:0;
s->modified_quant= s->h263_aic;
s->alt_inter_vlc= (avctx->flags & CODEC_FLAG_H263P_AIV) ? 1:0;
......@@ -3790,6 +3794,19 @@ AVCodec ff_h263_encoder = {
.long_name= NULL_IF_CONFIG_SMALL("H.263 / H.263-1996"),
};
#define OFFSET(x) offsetof(MpegEncContext, x)
#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
static const AVOption options[] = {
{ "umv", "Use unlimited motion vectors.", OFFSET(umvplus), FF_OPT_TYPE_INT, { 0 }, 0, 1, VE },
{ NULL },
};
static const AVClass h263p_class = {
.class_name = "H.263p encoder",
.item_name = av_default_item_name,
.option = options,
.version = LIBAVUTIL_VERSION_INT,
};
AVCodec ff_h263p_encoder = {
.name = "h263p",
.type = AVMEDIA_TYPE_VIDEO,
......@@ -3801,6 +3818,7 @@ AVCodec ff_h263p_encoder = {
.capabilities = CODEC_CAP_SLICE_THREADS,
.pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE},
.long_name= NULL_IF_CONFIG_SMALL("H.263+ / H.263-1998 / H.263 version 2"),
.priv_class = &h263p_class,
};
AVCodec ff_msmpeg4v2_encoder = {
......
......@@ -103,7 +103,9 @@ static const AVOption options[]={
{"global_header", "place global headers in extradata instead of every keyframe", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_GLOBAL_HEADER }, INT_MIN, INT_MAX, V|A|E, "flags"},
{"bitexact", "use only bitexact stuff (except (i)dct)", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_BITEXACT }, INT_MIN, INT_MAX, A|V|S|D|E, "flags"},
{"aic", "h263 advanced intra coding / mpeg4 ac prediction", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_AC_PRED }, INT_MIN, INT_MAX, V|E, "flags"},
#if FF_API_MPEGVIDEO_GLOBAL_OPTS
{"umv", "use unlimited motion vectors", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_H263P_UMV }, INT_MIN, INT_MAX, V|E, "flags"},
#endif
{"cbp", "use rate distortion optimization for cbp", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_CBP_RD }, INT_MIN, INT_MAX, V|E, "flags"},
{"qprd", "use rate distortion optimization for qp selection", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_QP_RD }, INT_MIN, INT_MAX, V|E, "flags"},
{"aiv", "h263 alternative inter vlc", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_H263P_AIV }, INT_MIN, INT_MAX, V|E, "flags"},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment