Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
489e6add
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,发现更多精彩内容 >>
提交
489e6add
编写于
12月 08, 2015
作者:
J
Janne Grunau
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
checkasm: add fmtconvert tests
上级
568a4323
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
110 addition
and
0 deletion
+110
-0
tests/checkasm/Makefile
tests/checkasm/Makefile
+1
-0
tests/checkasm/checkasm.c
tests/checkasm/checkasm.c
+3
-0
tests/checkasm/checkasm.h
tests/checkasm/checkasm.h
+1
-0
tests/checkasm/fmtconvert.c
tests/checkasm/fmtconvert.c
+105
-0
未找到文件。
tests/checkasm/Makefile
浏览文件 @
489e6add
# libavcodec tests
AVCODECOBJS-$(CONFIG_BSWAPDSP)
+=
bswapdsp.o
AVCODECOBJS-$(CONFIG_DCA_DECODER)
+=
dcadsp.o synth_filter.o
AVCODECOBJS-$(CONFIG_FMTCONVERT)
+=
fmtconvert.o
AVCODECOBJS-$(CONFIG_H264PRED)
+=
h264pred.o
AVCODECOBJS-$(CONFIG_H264QPEL)
+=
h264qpel.o
AVCODECOBJS-$(CONFIG_HEVC_DECODER)
+=
hevc_mc.o
...
...
tests/checkasm/checkasm.c
浏览文件 @
489e6add
...
...
@@ -65,6 +65,9 @@ static const struct {
{
"dcadsp"
,
checkasm_check_dcadsp
},
{
"synth_filter"
,
checkasm_check_synth_filter
},
#endif
#if CONFIG_FMTCONVERT
{
"fmtconvert"
,
checkasm_check_fmtconvert
},
#endif
#if CONFIG_H264PRED
{
"h264pred"
,
checkasm_check_h264pred
},
#endif
...
...
tests/checkasm/checkasm.h
浏览文件 @
489e6add
...
...
@@ -32,6 +32,7 @@
void
checkasm_check_bswapdsp
(
void
);
void
checkasm_check_dcadsp
(
void
);
void
checkasm_check_fmtconvert
(
void
);
void
checkasm_check_h264pred
(
void
);
void
checkasm_check_h264qpel
(
void
);
void
checkasm_check_hevc_mc
(
void
);
...
...
tests/checkasm/fmtconvert.c
0 → 100644
浏览文件 @
489e6add
/*
* Copyright (c) 2015 Janne Grunau
*
* This file is part of Libav.
*
* Libav is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* Libav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with Libav; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <math.h>
#include <stdint.h>
#include <string.h>
#include "libavutil/internal.h"
#include "libavutil/common.h"
#include "libavcodec/fmtconvert.h"
#include "checkasm.h"
#define BUF_SIZE 1024
#define randomize_input(len) \
do { \
int k; \
for (k = 0; k < len; k++) { \
in[k] = rnd() - INT32_MAX; \
} \
for ( ; k < BUF_SIZE; k++) { \
in[k] = INT32_MAX; \
} \
} while (0)
void
checkasm_check_fmtconvert
(
void
)
{
FmtConvertContext
c
;
LOCAL_ALIGNED
(
32
,
float
,
dst0
,
[
BUF_SIZE
]);
LOCAL_ALIGNED
(
32
,
float
,
dst1
,
[
BUF_SIZE
]);
LOCAL_ALIGNED
(
32
,
int32_t
,
in
,
[
BUF_SIZE
]);
float
scale_arr
[
128
];
int
length
[]
=
{
8
,
16
,
24
,
56
,
72
,
128
,
512
,
520
,
656
,
768
,
992
};
int
i
,
j
;
for
(
i
=
0
;
i
<
FF_ARRAY_ELEMS
(
scale_arr
);
i
++
)
scale_arr
[
i
]
=
(
FF_ARRAY_ELEMS
(
scale_arr
)
-
FF_ARRAY_ELEMS
(
scale_arr
)
/
2
)
/
13
;
ff_fmt_convert_init
(
&
c
,
NULL
);
memset
(
dst0
,
0
,
sizeof
(
*
dst0
)
*
BUF_SIZE
);
memset
(
dst1
,
0
,
sizeof
(
*
dst1
)
*
BUF_SIZE
);
if
(
check_func
(
c
.
int32_to_float_fmul_scalar
,
"int32_to_float_fmul_scalar"
))
{
declare_func
(
void
,
float
*
,
const
int32_t
*
,
float
,
int
);
for
(
i
=
0
;
i
<
FF_ARRAY_ELEMS
(
scale_arr
);
i
++
)
{
for
(
j
=
0
;
j
<
FF_ARRAY_ELEMS
(
length
);
j
++
)
{
randomize_input
(
length
[
j
]);
call_ref
(
dst0
,
in
,
scale_arr
[
i
],
length
[
j
]);
call_new
(
dst1
,
in
,
scale_arr
[
i
],
length
[
j
]);
if
(
!
float_near_ulp_array
(
dst0
,
dst1
,
3
,
length
[
j
]))
{
fail
();
break
;
}
bench_new
(
dst1
,
in
,
scale_arr
[
i
],
length
[
j
]);
}
}
}
if
(
check_func
(
c
.
int32_to_float_fmul_array8
,
"int32_to_float_fmul_array8"
))
{
declare_func
(
void
,
FmtConvertContext
*
,
float
*
,
const
int32_t
*
,
const
float
*
,
int
);
for
(
i
=
0
;
i
<
4
;
i
++
)
{
for
(
j
=
0
;
j
<
FF_ARRAY_ELEMS
(
length
);
j
++
)
{
randomize_input
(
length
[
j
]);
call_ref
(
&
c
,
dst0
,
in
,
scale_arr
,
length
[
j
]);
call_new
(
&
c
,
dst1
,
in
,
scale_arr
,
length
[
j
]);
if
(
!
float_near_ulp_array
(
dst0
,
dst1
,
3
,
length
[
j
]))
{
fail
();
fprintf
(
stderr
,
"int32_to_float_fmul_array8: len: %d
\n
"
,
length
[
j
]);
break
;
}
bench_new
(
&
c
,
dst1
,
in
,
scale_arr
,
length
[
j
]);
}
}
}
report
(
"fmtconvert"
);
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录