diff options
author | Anton Khirnov <anton@khirnov.net> | 2012-02-27 12:12:19 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2012-02-29 07:09:29 +0100 |
commit | ed019b8e5bfefe59e307ce01f2860777e037b94b (patch) | |
tree | 1496ddd98dcb258a887f2456fa9b389d754b773f /libavcodec/mpegvideo.h | |
parent | 956fb91e0333634aa25dcb5632c6e4e3769d05ee (diff) | |
download | ffmpeg-ed019b8e5bfefe59e307ce01f2860777e037b94b.tar.gz |
lavc: add -mpv_flags to mpegvideo_enc-based encoders.
Deprecate CODEC_FLAG2_SKIP_RD in favor of the corresponding mpv_flags
flag.
Diffstat (limited to 'libavcodec/mpegvideo.h')
-rw-r--r-- | libavcodec/mpegvideo.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h index 9753d1064c..7e157fdfff 100644 --- a/libavcodec/mpegvideo.h +++ b/libavcodec/mpegvideo.h @@ -37,6 +37,8 @@ #include "mpeg12data.h" #include "rl.h" +#include "libavutil/opt.h" + #define FRAME_SKIPPED 100 ///< return value for header parsers if frame is not coded enum OutputFormat { @@ -687,6 +689,8 @@ typedef struct MpegEncContext { int (*dct_quantize)(struct MpegEncContext *s, DCTELEM *block/*align 16*/, int n, int qscale, int *overflow); int (*fast_dct_quantize)(struct MpegEncContext *s, DCTELEM *block/*align 16*/, int n, int qscale, int *overflow); void (*denoise_dct)(struct MpegEncContext *s, DCTELEM *block); + + int mpv_flags; ///< flags set by private options } MpegEncContext; #define REBASE_PICTURE(pic, new_ctx, old_ctx) (pic ? \ @@ -694,6 +698,25 @@ typedef struct MpegEncContext { &new_ctx->picture[pic - old_ctx->picture] : pic - (Picture*)old_ctx + (Picture*)new_ctx)\ : NULL) +/* mpegvideo_enc common options */ +#define FF_MPV_FLAG_SKIP_RD 0x0001 + +#define FF_MPV_OFFSET(x) offsetof(MpegEncContext, x) +#define FF_MPV_OPT_FLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM) +#define FF_MPV_COMMON_OPTS \ +{ "mpv_flags", "Flags common for all mpegvideo-based encoders.", FF_MPV_OFFSET(mpv_flags), AV_OPT_TYPE_FLAGS, { 0 }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS, "mpv_flags" },\ +{ "skip_rd", "RD optimal MB level residual skipping", 0, AV_OPT_TYPE_CONST, { FF_MPV_FLAG_SKIP_RD }, 0, 0, FF_MPV_OPT_FLAGS, "mpv_flags" },\ + +extern const AVOption ff_mpv_generic_options[]; + +#define FF_MPV_GENERIC_CLASS(name) \ +static const AVClass name ## _class = {\ + .class_name = #name " encoder",\ + .item_name = av_default_item_name,\ + .option = ff_mpv_generic_options,\ + .version = LIBAVUTIL_VERSION_INT,\ +}; + void ff_MPV_decode_defaults(MpegEncContext *s); int ff_MPV_common_init(MpegEncContext *s); void ff_MPV_common_end(MpegEncContext *s); |