+
+#define FF_LAMBDA_SHIFT 7
+#define FF_LAMBDA_SCALE (1<<FF_LAMBDA_SHIFT)
+#define FF_QP2LAMBDA 118 ///< factor to convert from H.263 QP to lambda
+#define FF_LAMBDA_MAX (256*128-1)
+
+#define FF_QUALITY_SCALE FF_LAMBDA_SCALE //FIXME maybe remove
+ /**
+ * global quality for codecs which cannot change it per frame.
+ * this should be proportional to MPEG1/2/4 qscale.
+ * - encoding: set by user.
+ * - decoding: unused
+ */
+ int global_quality;
+
+#define FF_CODER_TYPE_VLC 0
+#define FF_CODER_TYPE_AC 1
+ /**
+ * coder type
+ * - encoding: set by user.
+ * - decoding: unused
+ */
+ int coder_type;
+
+ /**
+ * context model
+ * - encoding: set by user.
+ * - decoding: unused
+ */
+ int context_model;
+
+ /**
+ * slice flags
+ * - encoding: unused
+ * - decoding: set by user.
+ */
+ int slice_flags;
+#define SLICE_FLAG_CODED_ORDER 0x0001 ///< draw_horiz_band() is called in coded order instead of display
+#define SLICE_FLAG_ALLOW_FIELD 0x0002 ///< allow draw_horiz_band() with field slices (MPEG2 field pics)
+#define SLICE_FLAG_ALLOW_PLANE 0x0004 ///< allow draw_horiz_band() with 1 component at a time (SVQ1)
+
+ /**
+ * XVideo Motion Acceleration
+ * - encoding: forbidden
+ * - decoding: set by decoder
+ */
+ int xvmc_acceleration;
+
+ /**
+ * macroblock decision mode
+ * - encoding: set by user.
+ * - decoding: unused
+ */
+ int mb_decision;
+#define FF_MB_DECISION_SIMPLE 0 ///< uses mb_cmp
+#define FF_MB_DECISION_BITS 1 ///< chooses the one which needs the fewest bits
+#define FF_MB_DECISION_RD 2 ///< rate distoration
+
+ /**
+ * custom intra quantization matrix
+ * - encoding: set by user, can be NULL
+ * - decoding: set by lavc
+ */
+ uint16_t *intra_matrix;
+
+ /**
+ * custom inter quantization matrix
+ * - encoding: set by user, can be NULL
+ * - decoding: set by lavc
+ */
+ uint16_t *inter_matrix;
+
+ /**
+ * fourcc from the AVI stream header (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
+ * this is used to workaround some encoder bugs
+ * - encoding: unused
+ * - decoding: set by user, will be converted to upper case by lavc during init
+ */
+ unsigned int stream_codec_tag;
+
+ /**
+ * scene change detection threshold.
+ * 0 is default, larger means fewer detected scene changes
+ * - encoding: set by user.
+ * - decoding: unused
+ */
+ int scenechange_threshold;
+
+ /**
+ * minimum lagrange multipler
+ * - encoding: set by user.
+ * - decoding: unused
+ */
+ int lmin;
+
+ /**
+ * maximum lagrange multipler
+ * - encoding: set by user.
+ * - decoding: unused
+ */
+ int lmax;
+
+ /**
+ * Palette control structure
+ * - encoding: ??? (no palette-enabled encoder yet)
+ * - decoding: set by user.
+ */
+ struct AVPaletteControl *palctrl;
+
+ /**
+ * noise reduction strength
+ * - encoding: set by user.
+ * - decoding: unused
+ */
+ int noise_reduction;
+
+ /**
+ * called at the beginning of a frame to get cr buffer for it.
+ * buffer type (size, hints) must be the same. lavc won't check it.
+ * lavc will pass previous buffer in pic, function should return
+ * same buffer or new buffer with old frame "painted" into it.
+ * if pic.data[0] == NULL must behave like get_buffer().
+ * - encoding: unused
+ * - decoding: set by lavc, user can override
+ */
+ int (*reget_buffer)(struct AVCodecContext *c, AVFrame *pic);
+
+ /**
+ * number of bits which should be loaded into the rc buffer before decoding starts
+ * - encoding: set by user.
+ * - decoding: unused
+ */
+ int rc_initial_buffer_occupancy;
+
+ /**
+ *
+ * - encoding: set by user.
+ * - decoding: unused
+ */
+ int inter_threshold;
+
+ /**
+ * CODEC_FLAG2_*.
+ * - encoding: set by user.
+ * - decoding: set by user.
+ */
+ int flags2;
+
+ /**
+ * simulates errors in the bitstream to test error concealment.
+ * - encoding: set by user.
+ * - decoding: unused.
+ */
+ int error_rate;
+
+ /**
+ * MP3 antialias algorithm, see FF_AA_* below.
+ * - encoding: unused
+ * - decoding: set by user
+ */
+ int antialias_algo;
+#define FF_AA_AUTO 0
+#define FF_AA_FASTINT 1 //not implemented yet
+#define FF_AA_INT 2
+#define FF_AA_FLOAT 3
+ /**
+ * Quantizer noise shaping.
+ * - encoding: set by user
+ * - decoding: unused
+ */
+ int quantizer_noise_shaping;
+
+ /**
+ * Thread count.
+ * is used to decide how many independant tasks should be passed to execute()
+ * - encoding: set by user
+ * - decoding: set by user
+ */
+ int thread_count;
+
+ /**
+ * the codec may call this to execute several independant things. it will return only after
+ * finishing all tasks, the user may replace this with some multithreaded implementation, the
+ * default implementation will execute the parts serially
+ * @param count the number of things to execute
+ * - encoding: set by lavc, user can override
+ * - decoding: set by lavc, user can override
+ */
+ int (*execute)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg), void **arg2, int *ret, int count);
+
+ /**
+ * Thread opaque.
+ * can be used by execute() to store some per AVCodecContext stuff.
+ * - encoding: set by execute()
+ * - decoding: set by execute()
+ */
+ void *thread_opaque;