Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
9629701c
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,发现更多精彩内容 >>
提交
9629701c
编写于
4月 12, 2016
作者:
M
Mark Thompson
提交者:
Anton Khirnov
4月 15, 2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
vaapi_h264: Add -qp option, use it to replace use of -global_quality
Signed-off-by:
N
Anton Khirnov
<
anton@khirnov.net
>
上级
69b06ed4
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
18 addition
and
3 deletion
+18
-3
libavcodec/vaapi_encode_h264.c
libavcodec/vaapi_encode_h264.c
+18
-3
未找到文件。
libavcodec/vaapi_encode_h264.c
浏览文件 @
9629701c
...
@@ -115,6 +115,10 @@ typedef struct VAAPIEncodeH264Context {
...
@@ -115,6 +115,10 @@ typedef struct VAAPIEncodeH264Context {
}
hrd_params
;
}
hrd_params
;
}
VAAPIEncodeH264Context
;
}
VAAPIEncodeH264Context
;
typedef
struct
VAAPIEncodeH264Options
{
int
qp
;
}
VAAPIEncodeH264Options
;
#define vseq_var(name) vseq->name, name
#define vseq_var(name) vseq->name, name
#define vseq_field(name) vseq->seq_fields.bits.name, name
#define vseq_field(name) vseq->seq_fields.bits.name, name
...
@@ -765,8 +769,9 @@ static av_cold int vaapi_encode_h264_init_fixed_qp(AVCodecContext *avctx)
...
@@ -765,8 +769,9 @@ static av_cold int vaapi_encode_h264_init_fixed_qp(AVCodecContext *avctx)
{
{
VAAPIEncodeContext
*
ctx
=
avctx
->
priv_data
;
VAAPIEncodeContext
*
ctx
=
avctx
->
priv_data
;
VAAPIEncodeH264Context
*
priv
=
ctx
->
priv_data
;
VAAPIEncodeH264Context
*
priv
=
ctx
->
priv_data
;
VAAPIEncodeH264Options
*
opt
=
ctx
->
codec_options
;
priv
->
fixed_qp_p
=
avctx
->
global_quality
;
priv
->
fixed_qp_p
=
opt
->
qp
;
if
(
avctx
->
i_quant_factor
>
0
.
0
)
if
(
avctx
->
i_quant_factor
>
0
.
0
)
priv
->
fixed_qp_idr
=
(
int
)((
priv
->
fixed_qp_p
*
avctx
->
i_quant_factor
+
priv
->
fixed_qp_idr
=
(
int
)((
priv
->
fixed_qp_p
*
avctx
->
i_quant_factor
+
avctx
->
i_quant_offset
)
+
0
.
5
);
avctx
->
i_quant_offset
)
+
0
.
5
);
...
@@ -895,13 +900,21 @@ static av_cold int vaapi_encode_h264_init(AVCodecContext *avctx)
...
@@ -895,13 +900,21 @@ static av_cold int vaapi_encode_h264_init(AVCodecContext *avctx)
return
ff_vaapi_encode_init
(
avctx
,
&
vaapi_encode_type_h264
);
return
ff_vaapi_encode_init
(
avctx
,
&
vaapi_encode_type_h264
);
}
}
#define OFFSET(x) (offsetof(VAAPIEncodeContext, codec_options_data) + \
offsetof(VAAPIEncodeH264Options, x))
#define FLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM)
static
const
AVOption
vaapi_encode_h264_options
[]
=
{
{
"qp"
,
"Constant QP (for P frames; scaled by qfactor/qoffset for I/B)"
,
OFFSET
(
qp
),
AV_OPT_TYPE_INT
,
{
.
i64
=
20
},
0
,
52
,
FLAGS
},
{
NULL
},
};
static
const
AVCodecDefault
vaapi_encode_h264_defaults
[]
=
{
static
const
AVCodecDefault
vaapi_encode_h264_defaults
[]
=
{
{
"profile"
,
"100"
},
{
"profile"
,
"100"
},
{
"level"
,
"51"
},
{
"level"
,
"51"
},
{
"b"
,
"0"
},
{
"b"
,
"0"
},
{
"bf"
,
"2"
},
{
"bf"
,
"2"
},
{
"g"
,
"120"
},
{
"g"
,
"120"
},
{
"global_quality"
,
"20"
},
{
"i_qfactor"
,
"1.0"
},
{
"i_qfactor"
,
"1.0"
},
{
"i_qoffset"
,
"0.0"
},
{
"i_qoffset"
,
"0.0"
},
{
"b_qfactor"
,
"1.2"
},
{
"b_qfactor"
,
"1.2"
},
...
@@ -912,6 +925,7 @@ static const AVCodecDefault vaapi_encode_h264_defaults[] = {
...
@@ -912,6 +925,7 @@ static const AVCodecDefault vaapi_encode_h264_defaults[] = {
static
const
AVClass
vaapi_encode_h264_class
=
{
static
const
AVClass
vaapi_encode_h264_class
=
{
.
class_name
=
"h264_vaapi"
,
.
class_name
=
"h264_vaapi"
,
.
item_name
=
av_default_item_name
,
.
item_name
=
av_default_item_name
,
.
option
=
vaapi_encode_h264_options
,
.
version
=
LIBAVUTIL_VERSION_INT
,
.
version
=
LIBAVUTIL_VERSION_INT
,
};
};
...
@@ -920,7 +934,8 @@ AVCodec ff_h264_vaapi_encoder = {
...
@@ -920,7 +934,8 @@ AVCodec ff_h264_vaapi_encoder = {
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"H.264/AVC (VAAPI)"
),
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"H.264/AVC (VAAPI)"
),
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
id
=
AV_CODEC_ID_H264
,
.
id
=
AV_CODEC_ID_H264
,
.
priv_data_size
=
sizeof
(
VAAPIEncodeContext
),
.
priv_data_size
=
(
sizeof
(
VAAPIEncodeContext
)
+
sizeof
(
VAAPIEncodeH264Options
)),
.
init
=
&
vaapi_encode_h264_init
,
.
init
=
&
vaapi_encode_h264_init
,
.
encode2
=
&
ff_vaapi_encode2
,
.
encode2
=
&
ff_vaapi_encode2
,
.
close
=
&
ff_vaapi_encode_close
,
.
close
=
&
ff_vaapi_encode_close
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录