Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
88262ca8
F
Ffmpeg
项目概览
小白菜888
/
Ffmpeg
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
Ffmpeg
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
88262ca8
编写于
8月 27, 2011
作者:
A
Anton Khirnov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
mpeg2enc: add 'non_linear_quant' private option
Deprecate CODEC_FLAG2_NON_LINEAR_QUANT
上级
2c5e1efc
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
18 addition
and
5 deletion
+18
-5
libavcodec/avcodec.h
libavcodec/avcodec.h
+2
-0
libavcodec/mpeg12enc.c
libavcodec/mpeg12enc.c
+12
-3
libavcodec/mpegvideo_enc.c
libavcodec/mpegvideo_enc.c
+3
-1
libavcodec/options.c
libavcodec/options.c
+1
-1
未找到文件。
libavcodec/avcodec.h
浏览文件 @
88262ca8
...
...
@@ -625,7 +625,9 @@ typedef struct RcOverride{
#endif
#define CODEC_FLAG2_SKIP_RD 0x00004000 ///< RD optimal MB level residual skipping
#define CODEC_FLAG2_CHUNKS 0x00008000 ///< Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries.
#if FF_API_MPEGVIDEO_GLOBAL_OPTS
#define CODEC_FLAG2_NON_LINEAR_QUANT 0x00010000 ///< Use MPEG-2 nonlinear quantizer.
#endif
#define CODEC_FLAG2_BIT_RESERVOIR 0x00020000 ///< Use a bit reservoir when encoding if possible
#define CODEC_FLAG2_MBTREE 0x00040000 ///< Use macroblock tree ratecontrol (x264 only)
#define CODEC_FLAG2_PSY 0x00080000 ///< Use psycho visual optimizations.
...
...
libavcodec/mpeg12enc.c
浏览文件 @
88262ca8
...
...
@@ -934,9 +934,18 @@ static void mpeg1_encode_block(MpegEncContext *s,
#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
},
#define COMMON_OPTS\
{ "intra_vlc", "Use MPEG-2 intra VLC table.", OFFSET(intra_vlc_format), FF_OPT_TYPE_INT, { 0 }, 0, 1, VE },
\
{ "drop_frame_timecode", "Timecode is in drop frame format.", OFFSET(drop_frame_timecode), FF_OPT_TYPE_INT, { 0 }, 0, 1, VE},
static
const
AVOption
mpeg1_options
[]
=
{
COMMON_OPTS
{
NULL
},
};
static
const
AVOption
mpeg2_options
[]
=
{
COMMON_OPTS
{
"non_linear_quant"
,
"Use nonlinear quantizer."
,
OFFSET
(
q_scale_type
),
FF_OPT_TYPE_INT
,
{
0
},
0
,
1
,
VE
},
{
NULL
},
};
...
...
@@ -944,7 +953,7 @@ static const AVOption options[] = {
static const AVClass mpeg## x ##_class = {\
.class_name = "mpeg" #x "video encoder",\
.item_name = av_default_item_name,\
.option = options,\
.option =
mpeg## x ##_
options,\
.version = LIBAVUTIL_VERSION_INT,\
};
...
...
libavcodec/mpegvideo_enc.c
浏览文件 @
88262ca8
...
...
@@ -338,8 +338,8 @@ av_cold int MPV_encode_init(AVCodecContext *avctx)
s
->
alternate_scan
=
!!
(
s
->
flags
&
CODEC_FLAG_ALT_SCAN
);
#if FF_API_MPEGVIDEO_GLOBAL_OPTS
s
->
intra_vlc_format
=
!!
(
s
->
flags2
&
CODEC_FLAG2_INTRA_VLC
);
#endif
s
->
q_scale_type
=
!!
(
s
->
flags2
&
CODEC_FLAG2_NON_LINEAR_QUANT
);
#endif
if
(
avctx
->
rc_max_rate
&&
!
avctx
->
rc_buffer_size
){
av_log
(
avctx
,
AV_LOG_ERROR
,
"a vbv buffer size is needed, for encoding with a maximum bitrate
\n
"
);
...
...
@@ -463,10 +463,12 @@ av_cold int MPV_encode_init(AVCodecContext *avctx)
}
if
(
s
->
q_scale_type
==
1
){
#if FF_API_MPEGVIDEO_GLOBAL_OPTS
if
(
s
->
codec_id
!=
CODEC_ID_MPEG2VIDEO
){
av_log
(
avctx
,
AV_LOG_ERROR
,
"non linear quant is only available for mpeg2
\n
"
);
return
-
1
;
}
#endif
if
(
avctx
->
qmax
>
12
){
av_log
(
avctx
,
AV_LOG_ERROR
,
"non linear quant only supports qmax <= 12 currently
\n
"
);
return
-
1
;
...
...
libavcodec/options.c
浏览文件 @
88262ca8
...
...
@@ -423,8 +423,8 @@ static const AVOption options[]={
{
"timecode_frame_start"
,
"GOP timecode frame start number, in non drop frame format"
,
OFFSET
(
timecode_frame_start
),
FF_OPT_TYPE_INT64
,
{.
dbl
=
0
},
0
,
INT64_MAX
,
V
|
E
},
#if FF_API_MPEGVIDEO_GLOBAL_OPTS
{
"drop_frame_timecode"
,
NULL
,
0
,
FF_OPT_TYPE_CONST
,
{.
dbl
=
CODEC_FLAG2_DROP_FRAME_TIMECODE
},
INT_MIN
,
INT_MAX
,
V
|
E
,
"flags2"
},
#endif
{
"non_linear_q"
,
"use non linear quantizer"
,
0
,
FF_OPT_TYPE_CONST
,
{.
dbl
=
CODEC_FLAG2_NON_LINEAR_QUANT
},
INT_MIN
,
INT_MAX
,
V
|
E
,
"flags2"
},
#endif
#if FF_API_REQUEST_CHANNELS
{
"request_channels"
,
"set desired number of audio channels"
,
OFFSET
(
request_channels
),
FF_OPT_TYPE_INT
,
{.
dbl
=
DEFAULT
},
0
,
INT_MAX
,
A
|
D
},
#endif
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录