[FFmpeg-cvslog] avcodec/snowenc: add FF_MPV_COMMON_OPTS
Michael Niedermayer
git at videolan.org
Sat Oct 18 20:12:49 CEST 2014
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Oct 18 19:41:48 2014 +0200| [bf301258b49ff6f700a096c5752864e789c6e6b3] | committer: Michael Niedermayer
avcodec/snowenc: add FF_MPV_COMMON_OPTS
This fixes the ratecontrol code with snow
adding FF_MPV_COMMON_OPTS is needed as the generic rate control options
are currently in the (unrelated) MpegEncContext
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bf301258b49ff6f700a096c5752864e789c6e6b3
---
libavcodec/mpegvideo.h | 2 ++
libavcodec/snow.h | 2 ++
libavcodec/snowenc.c | 2 ++
3 files changed, 6 insertions(+)
diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h
index 286954f..6946c60 100644
--- a/libavcodec/mpegvideo.h
+++ b/libavcodec/mpegvideo.h
@@ -694,7 +694,9 @@ typedef struct MpegEncContext {
#define FF_MPV_FLAG_NAQ 0x0010
#define FF_MPV_FLAG_MV0 0x0020
+#ifndef FF_MPV_OFFSET
#define FF_MPV_OFFSET(x) offsetof(MpegEncContext, x)
+#endif
#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, { .i64 = 0 }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS, "mpv_flags" },\
diff --git a/libavcodec/snow.h b/libavcodec/snow.h
index 6a3e763..6f1fca3 100644
--- a/libavcodec/snow.h
+++ b/libavcodec/snow.h
@@ -29,6 +29,8 @@
#include "rangecoder.h"
#include "mathops.h"
+
+#define FF_MPV_OFFSET(x) (offsetof(MpegEncContext, x) + offsetof(SnowContext, m))
#include "mpegvideo.h"
#include "h264qpel.h"
diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c
index eaeafa9..30b1ef6 100644
--- a/libavcodec/snowenc.c
+++ b/libavcodec/snowenc.c
@@ -29,6 +29,7 @@
#include "rangecoder.h"
#include "mathops.h"
+#define FF_MPV_OFFSET(x) (offsetof(MpegEncContext, x) + offsetof(SnowContext, m))
#include "mpegvideo.h"
#include "h263.h"
@@ -1870,6 +1871,7 @@ static av_cold int encode_end(AVCodecContext *avctx)
#define OFFSET(x) offsetof(SnowContext, x)
#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
static const AVOption options[] = {
+ FF_MPV_COMMON_OPTS
{ "memc_only", "Only do ME/MC (I frames -> ref, P frame -> ME+MC).", OFFSET(memc_only), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE },
{ "no_bitstream", "Skip final bitstream writeout.", OFFSET(no_bitstream), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE },
{ NULL },
More information about the ffmpeg-cvslog
mailing list