Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
134a48a8
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,体验更适合开发者的 AI 搜索 >>
提交
134a48a8
编写于
7月 25, 2020
作者:
J
James Almer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
tests/imgutils: test the output of av_image_fill_* functions
Signed-off-by:
N
James Almer
<
jamrial@gmail.com
>
上级
be3c10d5
变更
2
展开全部
隐藏空白更改
内联
并排
Showing
2 changed file
with
221 addition
and
0 deletion
+221
-0
libavutil/tests/imgutils.c
libavutil/tests/imgutils.c
+38
-0
tests/ref/fate/imgutils
tests/ref/fate/imgutils
+183
-0
未找到文件。
libavutil/tests/imgutils.c
浏览文件 @
134a48a8
...
...
@@ -22,6 +22,7 @@
int
main
(
void
)
{
const
AVPixFmtDescriptor
*
desc
=
NULL
;
int64_t
x
,
y
;
for
(
y
=
-
1
;
y
<
UINT_MAX
;
y
+=
y
/
2
+
1
)
{
...
...
@@ -31,6 +32,43 @@ int main(void)
}
printf
(
"
\n
"
);
}
printf
(
"
\n
"
);
while
(
desc
=
av_pix_fmt_desc_next
(
desc
))
{
uint8_t
*
data
[
4
];
size_t
sizes
[
4
];
ptrdiff_t
linesizes1
[
4
],
offsets
[
3
]
=
{
0
};
int
i
,
total_size
,
w
=
64
,
h
=
48
,
linesizes
[
4
];
enum
AVPixelFormat
pix_fmt
=
av_pix_fmt_desc_get_id
(
desc
);
if
(
av_image_fill_linesizes
(
linesizes
,
pix_fmt
,
w
)
<
0
)
continue
;
for
(
i
=
0
;
i
<
4
;
i
++
)
linesizes1
[
i
]
=
linesizes
[
i
];
if
(
av_image_fill_plane_sizes
(
sizes
,
pix_fmt
,
h
,
linesizes1
)
<
0
)
continue
;
total_size
=
av_image_fill_pointers
(
data
,
pix_fmt
,
h
,
(
void
*
)
1
,
linesizes
);
if
(
total_size
<
0
)
continue
;
printf
(
"%-16s"
,
desc
->
name
);
for
(
i
=
0
;
i
<
4
&&
data
[
i
];
i
++
);
printf
(
"planes: %d"
,
i
);
// Test the output of av_image_fill_linesizes()
printf
(
", linesizes:"
);
for
(
i
=
0
;
i
<
4
;
i
++
)
printf
(
" %3d"
,
linesizes
[
i
]);
// Test the output of av_image_fill_plane_sizes()
printf
(
", plane_sizes:"
);
for
(
i
=
0
;
i
<
4
;
i
++
)
printf
(
" %5"
SIZE_SPECIFIER
,
sizes
[
i
]);
// Test the output of av_image_fill_pointers()
for
(
i
=
0
;
i
<
3
&&
data
[
i
+
1
];
i
++
)
offsets
[
i
]
=
data
[
i
+
1
]
-
data
[
i
];
printf
(
", plane_offsets:"
);
for
(
i
=
0
;
i
<
3
;
i
++
)
printf
(
" %5"
PTRDIFF_SPECIFIER
,
offsets
[
i
]);
printf
(
", total_size: %d
\n
"
,
total_size
);
}
return
0
;
}
tests/ref/fate/imgutils
浏览文件 @
134a48a8
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录