summaryrefslogtreecommitdiff
path: root/libavcodec/snow.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-08-31 23:44:21 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-09-01 00:01:21 +0200
commit0ed7bc49a3f7accc4952372b914eb584b1201c86 (patch)
tree48bd1d573e6acc909a9a5c26e94701da489e3184 /libavcodec/snow.c
parenta9c69362ea930b15cc42fa9f25c5201d370ff156 (diff)
parent5d06f15235c2fa1b6ed2c5af3bc0e3750df4291c (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: (31 commits) libx264: set default thread count to 0 (auto) lavc: cosmetics, group deprecated codec flags mpeg12: add 'scan_offset' private option. h263/p encoder: add 'structured_slices' private option. h263/p encoder: add 'obmc' private option. h263p encoder: add 'aiv' private option. h263p encoder: add 'umv' private option. mpeg12enc/mpeg4videoenc: add 'alternate_scan' private option. mjpegdec: add 'extern_huff' private option. mpeg4enc: add 'data_partitioning' private option. snow: add 'memc_only' private option. libx264: add 'mbtree' private option. libx264: add 'psy' private option. libmp3lame: add 'reservoir' private option. mpeg2enc: add 'non_linear_quant' private option mpeg12enc: add drop_frame_timecode private option. mpeg12enc: add intra_vlc private option. VC1: Support dynamic dimension changes mjpeg: treat external huffman table setup failure as codec init failure if external huffman table use requested lavc: deprecate CODEC_FLAG2_BRDO ... Conflicts: avconv.c libavcodec/libmp3lame.c libavcodec/libx264.c libavcodec/mjpegdec.c libavcodec/mpeg12enc.c libavcodec/mpegvideo.h libavcodec/vc1.c libavcodec/vc1dec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/snow.c')
-rw-r--r--libavcodec/snow.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/libavcodec/snow.c b/libavcodec/snow.c
index f20fe1d53f..b866c8f8d8 100644
--- a/libavcodec/snow.c
+++ b/libavcodec/snow.c
@@ -19,6 +19,8 @@
*/
#include "libavutil/intmath.h"
+#include "libavutil/log.h"
+#include "libavutil/opt.h"
#include "avcodec.h"
#include "dsputil.h"
#include "dwt.h"
@@ -199,7 +201,7 @@ typedef struct Plane{
}Plane;
typedef struct SnowContext{
-
+ AVClass *class;
AVCodecContext *avctx;
RangeCoder c;
DSPContext dsp;
@@ -252,6 +254,7 @@ typedef struct SnowContext{
int me_cache[ME_CACHE_SIZE];
int me_cache_generation;
slice_buffer sb;
+ int memc_only;
MpegEncContext m; // needed for motion estimation, should not be used for anything else, the idea is to eventually make the motion estimation independent of MpegEncContext, so this will be removed then (FIXME/XXX)
@@ -3518,7 +3521,7 @@ redo_frame:
int x, y;
// int bits= put_bits_count(&s->c.pb);
- if(!(avctx->flags2 & CODEC_FLAG2_MEMC_ONLY)){
+ if (!s->memc_only) {
//FIXME optimize
if(pict->data[plane_index]) //FIXME gray hack
for(y=0; y<h; y++){
@@ -3676,6 +3679,20 @@ static av_cold int encode_end(AVCodecContext *avctx)
return 0;
}
+#define OFFSET(x) offsetof(SnowContext, x)
+#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
+static const AVOption options[] = {
+ { "memc_only", "Only do ME/MC (I frames -> ref, P frame -> ME+MC).", OFFSET(memc_only), FF_OPT_TYPE_INT, { 0 }, 0, 1, VE },
+ { NULL },
+};
+
+static const AVClass snowenc_class = {
+ .class_name = "snow encoder",
+ .item_name = av_default_item_name,
+ .option = options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
AVCodec ff_snow_encoder = {
.name = "snow",
.type = AVMEDIA_TYPE_VIDEO,
@@ -3685,6 +3702,7 @@ AVCodec ff_snow_encoder = {
.encode = encode_frame,
.close = encode_end,
.long_name = NULL_IF_CONFIG_SMALL("Snow"),
+ .priv_class = &snowenc_class,
};
#endif