Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
d825b1a5
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,发现更多精彩内容 >>
提交
d825b1a5
编写于
7月 08, 2016
作者:
M
Martin Storsjö
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
libopenh264: Support building with the 1.6 release
Signed-off-by:
N
Martin Storsjö
<
martin@martin.st
>
上级
4f7723cb
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
26 addition
and
2 deletion
+26
-2
libavcodec/libopenh264dec.c
libavcodec/libopenh264dec.c
+2
-0
libavcodec/libopenh264enc.c
libavcodec/libopenh264enc.c
+24
-2
未找到文件。
libavcodec/libopenh264dec.c
浏览文件 @
d825b1a5
...
...
@@ -90,7 +90,9 @@ static av_cold int svc_decode_init(AVCodecContext *avctx)
(
*
s
->
decoder
)
->
SetOption
(
s
->
decoder
,
DECODER_OPTION_TRACE_CALLBACK
,
(
void
*
)
&
callback_function
);
(
*
s
->
decoder
)
->
SetOption
(
s
->
decoder
,
DECODER_OPTION_TRACE_CALLBACK_CONTEXT
,
(
void
*
)
&
avctx
);
#if !OPENH264_VER_AT_LEAST(1, 6)
param
.
eOutputColorFormat
=
videoFormatI420
;
#endif
param
.
eEcActiveIdc
=
ERROR_CON_DISABLE
;
param
.
sVideoProperty
.
eVideoBsType
=
VIDEO_BITSTREAM_DEFAULT
;
...
...
libavcodec/libopenh264enc.c
浏览文件 @
d825b1a5
...
...
@@ -33,6 +33,10 @@
#include "internal.h"
#include "libopenh264.h"
#if !OPENH264_VER_AT_LEAST(1, 6)
#define SM_SIZELIMITED_SLICE SM_DYN_SLICE
#endif
typedef
struct
SVCContext
{
const
AVClass
*
av_class
;
ISVCEncoder
*
encoder
;
...
...
@@ -48,11 +52,20 @@ typedef struct SVCContext {
#define OFFSET(x) offsetof(SVCContext, x)
#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
static
const
AVOption
options
[]
=
{
#if OPENH264_VER_AT_LEAST(1, 6)
{
"slice_mode"
,
"Slice mode"
,
OFFSET
(
slice_mode
),
AV_OPT_TYPE_INT
,
{
.
i64
=
SM_FIXEDSLCNUM_SLICE
},
SM_SINGLE_SLICE
,
SM_RESERVED
,
VE
,
"slice_mode"
},
#else
{
"slice_mode"
,
"Slice mode"
,
OFFSET
(
slice_mode
),
AV_OPT_TYPE_INT
,
{
.
i64
=
SM_AUTO_SLICE
},
SM_SINGLE_SLICE
,
SM_RESERVED
,
VE
,
"slice_mode"
},
#endif
{
"fixed"
,
"A fixed number of slices"
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
SM_FIXEDSLCNUM_SLICE
},
0
,
0
,
VE
,
"slice_mode"
},
#if OPENH264_VER_AT_LEAST(1, 6)
{
"dyn"
,
"Size limited (compatibility name)"
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
SM_SIZELIMITED_SLICE
},
0
,
0
,
VE
,
"slice_mode"
},
{
"sizelimited"
,
"Size limited"
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
SM_SIZELIMITED_SLICE
},
0
,
0
,
VE
,
"slice_mode"
},
#else
{
"rowmb"
,
"One slice per row of macroblocks"
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
SM_ROWMB_SLICE
},
0
,
0
,
VE
,
"slice_mode"
},
{
"auto"
,
"Automatic number of slices according to number of threads"
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
SM_AUTO_SLICE
},
0
,
0
,
VE
,
"slice_mode"
},
{
"dyn"
,
"Dynamic slicing"
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
SM_DYN_SLICE
},
0
,
0
,
VE
,
"slice_mode"
},
#endif
{
"loopfilter"
,
"Enable loop filter"
,
OFFSET
(
loopfilter
),
AV_OPT_TYPE_INT
,
{
.
i64
=
1
},
0
,
1
,
VE
},
{
"profile"
,
"Set profile restrictions"
,
OFFSET
(
profile
),
AV_OPT_TYPE_STRING
,
{
.
str
=
NULL
},
0
,
0
,
VE
},
{
"max_nal_size"
,
"Set maximum NAL size in bytes"
,
OFFSET
(
max_nal_size
),
AV_OPT_TYPE_INT
,
{
.
i64
=
0
},
0
,
INT_MAX
,
VE
},
...
...
@@ -161,15 +174,24 @@ FF_ENABLE_DEPRECATION_WARNINGS
s
->
slice_mode
=
SM_FIXEDSLCNUM_SLICE
;
if
(
s
->
max_nal_size
)
s
->
slice_mode
=
SM_
DYN
_SLICE
;
s
->
slice_mode
=
SM_
SIZELIMITED
_SLICE
;
#if OPENH264_VER_AT_LEAST(1, 6)
param
.
sSpatialLayers
[
0
].
sSliceArgument
.
uiSliceMode
=
s
->
slice_mode
;
param
.
sSpatialLayers
[
0
].
sSliceArgument
.
uiSliceNum
=
avctx
->
slices
;
#else
param
.
sSpatialLayers
[
0
].
sSliceCfg
.
uiSliceMode
=
s
->
slice_mode
;
param
.
sSpatialLayers
[
0
].
sSliceCfg
.
sSliceArgument
.
uiSliceNum
=
avctx
->
slices
;
#endif
if
(
s
->
slice_mode
==
SM_
DYN
_SLICE
)
{
if
(
s
->
slice_mode
==
SM_
SIZELIMITED
_SLICE
)
{
if
(
s
->
max_nal_size
){
param
.
uiMaxNalSize
=
s
->
max_nal_size
;
#if OPENH264_VER_AT_LEAST(1, 6)
param
.
sSpatialLayers
[
0
].
sSliceArgument
.
uiSliceSizeConstraint
=
s
->
max_nal_size
;
#else
param
.
sSpatialLayers
[
0
].
sSliceCfg
.
sSliceArgument
.
uiSliceSizeConstraint
=
s
->
max_nal_size
;
#endif
}
else
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Invalid -max_nal_size, "
"specify a valid max_nal_size to use -slice_mode dyn
\n
"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录