Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
e030d3c6
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,发现更多精彩内容 >>
提交
e030d3c6
编写于
8月 25, 2015
作者:
P
Paul B Mahol
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
avfilter/vf_blend: use the name 's' for the pointer to the private context
Signed-off-by:
N
Paul B Mahol
<
onemda@gmail.com
>
上级
4c39892b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
39 addition
and
39 deletion
+39
-39
libavfilter/vf_blend.c
libavfilter/vf_blend.c
+39
-39
未找到文件。
libavfilter/vf_blend.c
浏览文件 @
e030d3c6
...
...
@@ -352,7 +352,7 @@ static int filter_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
static
AVFrame
*
blend_frame
(
AVFilterContext
*
ctx
,
AVFrame
*
top_buf
,
const
AVFrame
*
bottom_buf
)
{
BlendContext
*
b
=
ctx
->
priv
;
BlendContext
*
s
=
ctx
->
priv
;
AVFilterLink
*
inlink
=
ctx
->
inputs
[
0
];
AVFilterLink
*
outlink
=
ctx
->
outputs
[
0
];
AVFrame
*
dst_buf
;
...
...
@@ -363,12 +363,12 @@ static AVFrame *blend_frame(AVFilterContext *ctx, AVFrame *top_buf,
return
top_buf
;
av_frame_copy_props
(
dst_buf
,
top_buf
);
for
(
plane
=
0
;
plane
<
b
->
nb_planes
;
plane
++
)
{
int
hsub
=
plane
==
1
||
plane
==
2
?
b
->
hsub
:
0
;
int
vsub
=
plane
==
1
||
plane
==
2
?
b
->
vsub
:
0
;
for
(
plane
=
0
;
plane
<
s
->
nb_planes
;
plane
++
)
{
int
hsub
=
plane
==
1
||
plane
==
2
?
s
->
hsub
:
0
;
int
vsub
=
plane
==
1
||
plane
==
2
?
s
->
vsub
:
0
;
int
outw
=
FF_CEIL_RSHIFT
(
dst_buf
->
width
,
hsub
);
int
outh
=
FF_CEIL_RSHIFT
(
dst_buf
->
height
,
vsub
);
FilterParams
*
param
=
&
b
->
params
[
plane
];
FilterParams
*
param
=
&
s
->
params
[
plane
];
ThreadData
td
=
{
.
top
=
top_buf
,
.
bottom
=
bottom_buf
,
.
dst
=
dst_buf
,
.
w
=
outw
,
.
h
=
outh
,
.
param
=
param
,
.
plane
=
plane
,
.
inlink
=
inlink
};
...
...
@@ -376,7 +376,7 @@ static AVFrame *blend_frame(AVFilterContext *ctx, AVFrame *top_buf,
ctx
->
internal
->
execute
(
ctx
,
filter_slice
,
&
td
,
NULL
,
FFMIN
(
outh
,
ctx
->
graph
->
nb_threads
));
}
if
(
!
b
->
tblend
)
if
(
!
s
->
tblend
)
av_frame_free
(
&
top_buf
);
return
dst_buf
;
...
...
@@ -384,11 +384,11 @@ static AVFrame *blend_frame(AVFilterContext *ctx, AVFrame *top_buf,
static
av_cold
int
init
(
AVFilterContext
*
ctx
)
{
BlendContext
*
b
=
ctx
->
priv
;
BlendContext
*
s
=
ctx
->
priv
;
b
->
tblend
=
!
strcmp
(
ctx
->
filter
->
name
,
"tblend"
);
s
->
tblend
=
!
strcmp
(
ctx
->
filter
->
name
,
"tblend"
);
b
->
dinput
.
process
=
blend_frame
;
s
->
dinput
.
process
=
blend_frame
;
return
0
;
}
...
...
@@ -413,25 +413,25 @@ static int query_formats(AVFilterContext *ctx)
static
av_cold
void
uninit
(
AVFilterContext
*
ctx
)
{
BlendContext
*
b
=
ctx
->
priv
;
BlendContext
*
s
=
ctx
->
priv
;
int
i
;
ff_dualinput_uninit
(
&
b
->
dinput
);
av_frame_free
(
&
b
->
prev_frame
);
ff_dualinput_uninit
(
&
s
->
dinput
);
av_frame_free
(
&
s
->
prev_frame
);
for
(
i
=
0
;
i
<
FF_ARRAY_ELEMS
(
b
->
params
);
i
++
)
av_expr_free
(
b
->
params
[
i
].
e
);
for
(
i
=
0
;
i
<
FF_ARRAY_ELEMS
(
s
->
params
);
i
++
)
av_expr_free
(
s
->
params
[
i
].
e
);
}
static
int
config_output
(
AVFilterLink
*
outlink
)
{
AVFilterContext
*
ctx
=
outlink
->
src
;
AVFilterLink
*
toplink
=
ctx
->
inputs
[
TOP
];
BlendContext
*
b
=
ctx
->
priv
;
BlendContext
*
s
=
ctx
->
priv
;
const
AVPixFmtDescriptor
*
pix_desc
=
av_pix_fmt_desc_get
(
toplink
->
format
);
int
ret
,
plane
,
is_16bit
;
if
(
!
b
->
tblend
)
{
if
(
!
s
->
tblend
)
{
AVFilterLink
*
bottomlink
=
ctx
->
inputs
[
BOTTOM
];
if
(
toplink
->
format
!=
bottomlink
->
format
)
{
...
...
@@ -461,24 +461,24 @@ static int config_output(AVFilterLink *outlink)
outlink
->
sample_aspect_ratio
=
toplink
->
sample_aspect_ratio
;
outlink
->
frame_rate
=
toplink
->
frame_rate
;
b
->
hsub
=
pix_desc
->
log2_chroma_w
;
b
->
vsub
=
pix_desc
->
log2_chroma_h
;
s
->
hsub
=
pix_desc
->
log2_chroma_w
;
s
->
vsub
=
pix_desc
->
log2_chroma_h
;
is_16bit
=
pix_desc
->
comp
[
0
].
depth_minus1
==
15
;
b
->
nb_planes
=
av_pix_fmt_count_planes
(
toplink
->
format
);
s
->
nb_planes
=
av_pix_fmt_count_planes
(
toplink
->
format
);
if
(
b
->
tblend
)
if
(
s
->
tblend
)
outlink
->
flags
|=
FF_LINK_FLAG_REQUEST_LOOP
;
else
if
((
ret
=
ff_dualinput_init
(
ctx
,
&
b
->
dinput
))
<
0
)
else
if
((
ret
=
ff_dualinput_init
(
ctx
,
&
s
->
dinput
))
<
0
)
return
ret
;
for
(
plane
=
0
;
plane
<
FF_ARRAY_ELEMS
(
b
->
params
);
plane
++
)
{
FilterParams
*
param
=
&
b
->
params
[
plane
];
for
(
plane
=
0
;
plane
<
FF_ARRAY_ELEMS
(
s
->
params
);
plane
++
)
{
FilterParams
*
param
=
&
s
->
params
[
plane
];
if
(
b
->
all_mode
>=
0
)
param
->
mode
=
b
->
all_mode
;
if
(
b
->
all_opacity
<
1
)
param
->
opacity
=
b
->
all_opacity
;
if
(
s
->
all_mode
>=
0
)
param
->
mode
=
s
->
all_mode
;
if
(
s
->
all_opacity
<
1
)
param
->
opacity
=
s
->
all_opacity
;
switch
(
param
->
mode
)
{
case
BLEND_ADDITION
:
param
->
blend
=
is_16bit
?
blend_addition_16bit
:
blend_addition_8bit
;
break
;
...
...
@@ -511,8 +511,8 @@ static int config_output(AVFilterLink *outlink)
case
BLEND_XOR
:
param
->
blend
=
is_16bit
?
blend_xor_16bit
:
blend_xor_8bit
;
break
;
}
if
(
b
->
all_expr
&&
!
param
->
expr_str
)
{
param
->
expr_str
=
av_strdup
(
b
->
all_expr
);
if
(
s
->
all_expr
&&
!
param
->
expr_str
)
{
param
->
expr_str
=
av_strdup
(
s
->
all_expr
);
if
(
!
param
->
expr_str
)
return
AVERROR
(
ENOMEM
);
}
...
...
@@ -532,14 +532,14 @@ static int config_output(AVFilterLink *outlink)
static
int
request_frame
(
AVFilterLink
*
outlink
)
{
BlendContext
*
b
=
outlink
->
src
->
priv
;
return
ff_dualinput_request_frame
(
&
b
->
dinput
,
outlink
);
BlendContext
*
s
=
outlink
->
src
->
priv
;
return
ff_dualinput_request_frame
(
&
s
->
dinput
,
outlink
);
}
static
int
filter_frame
(
AVFilterLink
*
inlink
,
AVFrame
*
buf
)
{
BlendContext
*
b
=
inlink
->
dst
->
priv
;
return
ff_dualinput_filter_frame
(
&
b
->
dinput
,
inlink
,
buf
);
BlendContext
*
s
=
inlink
->
dst
->
priv
;
return
ff_dualinput_filter_frame
(
&
s
->
dinput
,
inlink
,
buf
);
}
static
const
AVFilterPad
blend_inputs
[]
=
{
...
...
@@ -584,16 +584,16 @@ AVFilter ff_vf_blend = {
static
int
tblend_filter_frame
(
AVFilterLink
*
inlink
,
AVFrame
*
frame
)
{
BlendContext
*
b
=
inlink
->
dst
->
priv
;
BlendContext
*
s
=
inlink
->
dst
->
priv
;
AVFilterLink
*
outlink
=
inlink
->
dst
->
outputs
[
0
];
if
(
b
->
prev_frame
)
{
AVFrame
*
out
=
blend_frame
(
inlink
->
dst
,
frame
,
b
->
prev_frame
);
av_frame_free
(
&
b
->
prev_frame
);
b
->
prev_frame
=
frame
;
if
(
s
->
prev_frame
)
{
AVFrame
*
out
=
blend_frame
(
inlink
->
dst
,
frame
,
s
->
prev_frame
);
av_frame_free
(
&
s
->
prev_frame
);
s
->
prev_frame
=
frame
;
return
ff_filter_frame
(
outlink
,
out
);
}
b
->
prev_frame
=
frame
;
s
->
prev_frame
=
frame
;
return
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录