diff options
author | Anton Khirnov <anton@khirnov.net> | 2011-08-27 10:26:14 +0400 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2011-08-31 15:19:14 +0400 |
commit | 297d9cb3dc6850b83ba4e95789143833cecdfd87 (patch) | |
tree | 102aa9f94dd1fe2e4e44d044fa6fd3a4c44417a0 /libavcodec/mpeg12enc.c | |
parent | d2f119a1f2d2d72b0001fcdf2cc051b022bf6528 (diff) |
mpeg12enc: add intra_vlc private option.
Deprecate CODEC_FLAG2_INTRA_VLC.
Diffstat (limited to 'libavcodec/mpeg12enc.c')
-rw-r--r-- | libavcodec/mpeg12enc.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c index 6602d81f6c..eca57d0df7 100644 --- a/libavcodec/mpeg12enc.c +++ b/libavcodec/mpeg12enc.c @@ -33,6 +33,8 @@ #include "mpeg12data.h" #include "bytestream.h" +#include "libavutil/log.h" +#include "libavutil/opt.h" static const uint8_t inv_non_linear_qscale[13] = { 0, 2, 4, 6, 8, @@ -925,6 +927,24 @@ static void mpeg1_encode_block(MpegEncContext *s, put_bits(&s->pb, table_vlc[112][1], table_vlc[112][0]); } +#define OFFSET(x) offsetof(MpegEncContext, x) +#define VE AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_VIDEO_PARAM +static const AVOption options[] = { + { "intra_vlc", "Use MPEG-2 intra VLC table.", OFFSET(intra_vlc_format), FF_OPT_TYPE_INT, { 0 }, 0, 1, VE }, + { NULL }, +}; + +#define mpeg12_class(x)\ +static const AVClass mpeg## x ##_class = {\ + .class_name = "mpeg" #x "video encoder",\ + .item_name = av_default_item_name,\ + .option = options,\ + .version = LIBAVUTIL_VERSION_INT,\ +}; + +mpeg12_class(1) +mpeg12_class(2) + AVCodec ff_mpeg1video_encoder = { .name = "mpeg1video", .type = AVMEDIA_TYPE_VIDEO, @@ -937,6 +957,7 @@ AVCodec ff_mpeg1video_encoder = { .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, .capabilities= CODEC_CAP_DELAY | CODEC_CAP_SLICE_THREADS, .long_name= NULL_IF_CONFIG_SMALL("MPEG-1 video"), + .priv_class = &mpeg1_class, }; AVCodec ff_mpeg2video_encoder = { @@ -951,4 +972,5 @@ AVCodec ff_mpeg2video_encoder = { .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_NONE}, .capabilities= CODEC_CAP_DELAY | CODEC_CAP_SLICE_THREADS, .long_name= NULL_IF_CONFIG_SMALL("MPEG-2 video"), + .priv_class = &mpeg2_class, }; |