Skip to content

Commit

Permalink
avcodec/snowenc: add FF_MPV_COMMON_OPTS
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
michaelni committed Oct 18, 2014
1 parent 25f4e93 commit bf30125
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libavcodec/mpegvideo.h
Original file line number Diff line number Diff line change
Expand Up @@ -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" },\
Expand Down
2 changes: 2 additions & 0 deletions libavcodec/snow.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 2 additions & 0 deletions libavcodec/snowenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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 },
Expand Down

0 comments on commit bf30125

Please sign in to comment.