From 297d9cb3dc6850b83ba4e95789143833cecdfd87 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sat, 27 Aug 2011 08:26:14 +0200 Subject: mpeg12enc: add intra_vlc private option. Deprecate CODEC_FLAG2_INTRA_VLC. --- libavcodec/mpeg12enc.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'libavcodec/mpeg12enc.c') 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, }; -- cgit v1.2.3