Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
75df2edb
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,发现更多精彩内容 >>
提交
75df2edb
编写于
10月 15, 2009
作者:
R
Reimar Döffinger
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add support for hardcoded ff_sin_* tables.
Originally committed as revision 20244 to
svn://svn.ffmpeg.org/ffmpeg/trunk
上级
4ee726b6
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
24 addition
and
8 deletion
+24
-8
libavcodec/Makefile
libavcodec/Makefile
+5
-1
libavcodec/costablegen.c
libavcodec/costablegen.c
+10
-4
libavcodec/dsputil.h
libavcodec/dsputil.h
+4
-2
libavcodec/rdft.c
libavcodec/rdft.c
+5
-1
未找到文件。
libavcodec/Makefile
浏览文件 @
75df2edb
...
@@ -31,7 +31,8 @@ FFT-OBJS-$(CONFIG_HARDCODED_TABLES) += cos_tables.o
...
@@ -31,7 +31,8 @@ FFT-OBJS-$(CONFIG_HARDCODED_TABLES) += cos_tables.o
OBJS-$(CONFIG_FFT)
+=
fft.o
$
(
FFT-OBJS-yes
)
OBJS-$(CONFIG_FFT)
+=
fft.o
$
(
FFT-OBJS-yes
)
OBJS-$(CONFIG_GOLOMB)
+=
golomb.o
OBJS-$(CONFIG_GOLOMB)
+=
golomb.o
OBJS-$(CONFIG_MDCT)
+=
mdct.o
OBJS-$(CONFIG_MDCT)
+=
mdct.o
OBJS-$(CONFIG_RDFT)
+=
rdft.o
RDFT-OBJS-$(CONFIG_HARDCODED_TABLES)
+=
sin_tables.o
OBJS-$(CONFIG_RDFT)
+=
rdft.o
$
(
RDFT-OBJS-yes
)
OBJS-$(CONFIG_VAAPI)
+=
vaapi.o
OBJS-$(CONFIG_VAAPI)
+=
vaapi.o
OBJS-$(CONFIG_VDPAU)
+=
vdpau.o
OBJS-$(CONFIG_VDPAU)
+=
vdpau.o
...
@@ -583,3 +584,6 @@ $(SUBDIR)costablegen$(HOSTEXESUF): $(SUBDIR)costablegen.c
...
@@ -583,3 +584,6 @@ $(SUBDIR)costablegen$(HOSTEXESUF): $(SUBDIR)costablegen.c
$(SUBDIR)cos_tables.c
:
$(SUBDIR)costablegen$(HOSTEXESUF)
$(SUBDIR)cos_tables.c
:
$(SUBDIR)costablegen$(HOSTEXESUF)
./
$<
>
$@
./
$<
>
$@
$(SUBDIR)sin_tables.c
:
$(SUBDIR)costablegen$(HOSTEXESUF)
./
$<
sin
>
$@
libavcodec/costablegen.c
浏览文件 @
75df2edb
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
*/
*/
#include <stdio.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <math.h>
#ifndef M_PI
#ifndef M_PI
...
@@ -29,22 +30,27 @@
...
@@ -29,22 +30,27 @@
#define BITS 16
#define BITS 16
#define FLOATFMT "%.18e"
#define FLOATFMT "%.18e"
int
main
(
void
)
int
main
(
int
argc
,
char
*
argv
[]
)
{
{
int
i
,
j
;
int
i
,
j
;
int
do_sin
=
argc
==
2
&&
!
strcmp
(
argv
[
1
],
"sin"
);
double
(
*
func
)(
double
)
=
do_sin
?
sin
:
cos
;
printf
(
"/* This file was generated by libavcodec/costablegen */
\n
"
);
printf
(
"/* This file was generated by libavcodec/costablegen */
\n
"
);
printf
(
"#include
\"
dsputil.h
\"\n
"
);
printf
(
"#include
\"
dsputil.h
\"\n
"
);
for
(
i
=
4
;
i
<=
BITS
;
i
++
)
{
for
(
i
=
4
;
i
<=
BITS
;
i
++
)
{
int
m
=
1
<<
i
;
int
m
=
1
<<
i
;
double
freq
=
2
*
M_PI
/
m
;
double
freq
=
2
*
M_PI
/
m
;
printf
(
"
COSTABLE(%i) = {
\n
"
,
m
);
printf
(
"
%s(%i) = {
\n
"
,
do_sin
?
"SINTABLE"
:
"COSTABLE
"
,
m
);
for
(
j
=
0
;
j
<
m
/
2
-
1
;
j
++
)
{
for
(
j
=
0
;
j
<
m
/
2
-
1
;
j
++
)
{
int
idx
=
j
>
m
/
4
?
m
/
2
-
j
:
j
;
int
idx
=
j
>
m
/
4
?
m
/
2
-
j
:
j
;
printf
(
" "
FLOATFMT
","
,
cos
(
idx
*
freq
));
if
(
do_sin
&&
j
>=
m
/
4
)
idx
=
m
/
4
-
j
;
printf
(
" "
FLOATFMT
","
,
func
(
idx
*
freq
));
if
((
j
&
3
)
==
3
)
if
((
j
&
3
)
==
3
)
printf
(
"
\n
"
);
printf
(
"
\n
"
);
}
}
printf
(
" "
FLOATFMT
"
\n
};
\n
"
,
cos
(
freq
));
printf
(
" "
FLOATFMT
"
\n
};
\n
"
,
func
(
do_sin
?
-
(
m
/
4
-
1
)
*
freq
:
freq
));
}
}
return
0
;
return
0
;
}
}
libavcodec/dsputil.h
浏览文件 @
75df2edb
...
@@ -744,14 +744,16 @@ typedef struct FFTContext {
...
@@ -744,14 +744,16 @@ typedef struct FFTContext {
#if CONFIG_HARDCODED_TABLES
#if CONFIG_HARDCODED_TABLES
#define COSTABLE_CONST const
#define COSTABLE_CONST const
#define SINTABLE_CONST const
#else
#else
#define COSTABLE_CONST
#define COSTABLE_CONST
#define SINTABLE_CONST
#endif
#endif
#define COSTABLE(size) \
#define COSTABLE(size) \
COSTABLE_CONST DECLARE_ALIGNED_16(FFTSample, ff_cos_##size[size/2])
COSTABLE_CONST DECLARE_ALIGNED_16(FFTSample, ff_cos_##size[size/2])
#define SINTABLE(size) \
#define SINTABLE(size) \
DECLARE_ALIGNED_16(FFTSample, ff_sin_##size[size/2])
SINTABLE_CONST
DECLARE_ALIGNED_16(FFTSample, ff_sin_##size[size/2])
extern
COSTABLE
(
16
);
extern
COSTABLE
(
16
);
extern
COSTABLE
(
32
);
extern
COSTABLE
(
32
);
extern
COSTABLE
(
64
);
extern
COSTABLE
(
64
);
...
@@ -874,7 +876,7 @@ typedef struct {
...
@@ -874,7 +876,7 @@ typedef struct {
/* pre/post rotation tables */
/* pre/post rotation tables */
const
FFTSample
*
tcos
;
const
FFTSample
*
tcos
;
FFTSample
*
tsin
;
SINTABLE_CONST
FFTSample
*
tsin
;
FFTContext
fft
;
FFTContext
fft
;
}
RDFTContext
;
}
RDFTContext
;
...
...
libavcodec/rdft.c
浏览文件 @
75df2edb
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
*/
*/
/* sin(2*pi*x/n) for 0<=x<n/4, followed by n/2<=x<3n/4 */
/* sin(2*pi*x/n) for 0<=x<n/4, followed by n/2<=x<3n/4 */
#if !CONFIG_HARDCODED_TABLES
SINTABLE
(
16
);
SINTABLE
(
16
);
SINTABLE
(
32
);
SINTABLE
(
32
);
SINTABLE
(
64
);
SINTABLE
(
64
);
...
@@ -40,7 +41,8 @@ SINTABLE(8192);
...
@@ -40,7 +41,8 @@ SINTABLE(8192);
SINTABLE
(
16384
);
SINTABLE
(
16384
);
SINTABLE
(
32768
);
SINTABLE
(
32768
);
SINTABLE
(
65536
);
SINTABLE
(
65536
);
FFTSample
*
const
ff_sin_tabs
[]
=
{
#endif
SINTABLE_CONST
FFTSample
*
const
ff_sin_tabs
[]
=
{
ff_sin_16
,
ff_sin_32
,
ff_sin_64
,
ff_sin_128
,
ff_sin_256
,
ff_sin_512
,
ff_sin_1024
,
ff_sin_16
,
ff_sin_32
,
ff_sin_64
,
ff_sin_128
,
ff_sin_256
,
ff_sin_512
,
ff_sin_1024
,
ff_sin_2048
,
ff_sin_4096
,
ff_sin_8192
,
ff_sin_16384
,
ff_sin_32768
,
ff_sin_65536
,
ff_sin_2048
,
ff_sin_4096
,
ff_sin_8192
,
ff_sin_16384
,
ff_sin_32768
,
ff_sin_65536
,
};
};
...
@@ -63,9 +65,11 @@ av_cold int ff_rdft_init(RDFTContext *s, int nbits, enum RDFTransformType trans)
...
@@ -63,9 +65,11 @@ av_cold int ff_rdft_init(RDFTContext *s, int nbits, enum RDFTransformType trans)
s
->
tcos
=
ff_cos_tabs
[
nbits
-
4
];
s
->
tcos
=
ff_cos_tabs
[
nbits
-
4
];
s
->
tsin
=
ff_sin_tabs
[
nbits
-
4
]
+
(
trans
==
RDFT
||
trans
==
IRIDFT
)
*
(
n
>>
2
);
s
->
tsin
=
ff_sin_tabs
[
nbits
-
4
]
+
(
trans
==
RDFT
||
trans
==
IRIDFT
)
*
(
n
>>
2
);
#if !CONFIG_HARDCODED_TABLES
for
(
i
=
0
;
i
<
(
n
>>
2
);
i
++
)
{
for
(
i
=
0
;
i
<
(
n
>>
2
);
i
++
)
{
s
->
tsin
[
i
]
=
sin
(
i
*
theta
);
s
->
tsin
[
i
]
=
sin
(
i
*
theta
);
}
}
#endif
return
0
;
return
0
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录