Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
165e9df1
Commit
165e9df1
authored
Jul 23, 2014
by
Diego Biurrun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fft-test: Pass the right struct members instead of casting
parent
58e65e44
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
16 deletions
+12
-16
fft-test.c
libavcodec/fft-test.c
+12
-16
No files found.
libavcodec/fft-test.c
View file @
165e9df1
...
@@ -361,15 +361,13 @@ int main(int argc, char **argv)
...
@@ -361,15 +361,13 @@ int main(int argc, char **argv)
#if CONFIG_MDCT
#if CONFIG_MDCT
case
TRANSFORM_MDCT
:
case
TRANSFORM_MDCT
:
if
(
do_inverse
)
{
if
(
do_inverse
)
{
imdct_ref
(
(
FFTSample
*
)
tab_ref
,
(
FFTSample
*
)
tab1
,
fft_nbits
);
imdct_ref
(
&
tab_ref
->
re
,
&
tab1
->
re
,
fft_nbits
);
m
.
imdct_calc
(
&
m
,
tab2
,
(
FFTSample
*
)
tab1
);
m
.
imdct_calc
(
&
m
,
tab2
,
&
tab1
->
re
);
err
=
check_diff
(
(
FFTSample
*
)
tab_ref
,
tab2
,
fft_size
,
scale
);
err
=
check_diff
(
&
tab_ref
->
re
,
tab2
,
fft_size
,
scale
);
}
else
{
}
else
{
mdct_ref
((
FFTSample
*
)
tab_ref
,
(
FFTSample
*
)
tab1
,
fft_nbits
);
mdct_ref
(
&
tab_ref
->
re
,
&
tab1
->
re
,
fft_nbits
);
m
.
mdct_calc
(
&
m
,
tab2
,
&
tab1
->
re
);
m
.
mdct_calc
(
&
m
,
tab2
,
(
FFTSample
*
)
tab1
);
err
=
check_diff
(
&
tab_ref
->
re
,
tab2
,
fft_size
/
2
,
scale
);
err
=
check_diff
((
FFTSample
*
)
tab_ref
,
tab2
,
fft_size
/
2
,
scale
);
}
}
break
;
break
;
#endif
/* CONFIG_MDCT */
#endif
/* CONFIG_MDCT */
...
@@ -379,8 +377,7 @@ int main(int argc, char **argv)
...
@@ -379,8 +377,7 @@ int main(int argc, char **argv)
s
.
fft_calc
(
&
s
,
tab
);
s
.
fft_calc
(
&
s
,
tab
);
fft_ref
(
tab_ref
,
tab1
,
fft_nbits
);
fft_ref
(
tab_ref
,
tab1
,
fft_nbits
);
err
=
check_diff
((
FFTSample
*
)
tab_ref
,
(
FFTSample
*
)
tab
,
err
=
check_diff
(
&
tab_ref
->
re
,
&
tab
->
re
,
fft_size
*
2
,
1
.
0
);
fft_size
*
2
,
1
.
0
);
break
;
break
;
#if FFT_FLOAT
#if FFT_FLOAT
#if CONFIG_RDFT
#if CONFIG_RDFT
...
@@ -404,8 +401,7 @@ int main(int argc, char **argv)
...
@@ -404,8 +401,7 @@ int main(int argc, char **argv)
tab
[
i
].
re
=
tab2
[
i
];
tab
[
i
].
re
=
tab2
[
i
];
tab
[
i
].
im
=
0
;
tab
[
i
].
im
=
0
;
}
}
err
=
check_diff
((
float
*
)
tab_ref
,
(
float
*
)
tab
,
err
=
check_diff
(
&
tab_ref
->
re
,
&
tab
->
re
,
fft_size
*
2
,
0
.
5
);
fft_size
*
2
,
0
.
5
);
}
else
{
}
else
{
for
(
i
=
0
;
i
<
fft_size
;
i
++
)
{
for
(
i
=
0
;
i
<
fft_size
;
i
++
)
{
tab2
[
i
]
=
tab1
[
i
].
re
;
tab2
[
i
]
=
tab1
[
i
].
re
;
...
@@ -414,7 +410,7 @@ int main(int argc, char **argv)
...
@@ -414,7 +410,7 @@ int main(int argc, char **argv)
r
.
rdft_calc
(
&
r
,
tab2
);
r
.
rdft_calc
(
&
r
,
tab2
);
fft_ref
(
tab_ref
,
tab1
,
fft_nbits
);
fft_ref
(
tab_ref
,
tab1
,
fft_nbits
);
tab_ref
[
0
].
im
=
tab_ref
[
fft_size_2
].
re
;
tab_ref
[
0
].
im
=
tab_ref
[
fft_size_2
].
re
;
err
=
check_diff
(
(
float
*
)
tab_ref
,
(
float
*
)
tab2
,
fft_size
,
1
.
0
);
err
=
check_diff
(
&
tab_ref
->
re
,
tab2
,
fft_size
,
1
.
0
);
}
}
break
;
break
;
}
}
...
@@ -427,7 +423,7 @@ int main(int argc, char **argv)
...
@@ -427,7 +423,7 @@ int main(int argc, char **argv)
idct_ref
(
&
tab_ref
->
re
,
&
tab1
->
re
,
fft_nbits
);
idct_ref
(
&
tab_ref
->
re
,
&
tab1
->
re
,
fft_nbits
);
else
else
dct_ref
(
&
tab_ref
->
re
,
&
tab1
->
re
,
fft_nbits
);
dct_ref
(
&
tab_ref
->
re
,
&
tab1
->
re
,
fft_nbits
);
err
=
check_diff
(
(
float
*
)
tab_ref
,
(
float
*
)
tab
,
fft_size
,
1
.
0
);
err
=
check_diff
(
&
tab_ref
->
re
,
&
tab
->
re
,
fft_size
,
1
.
0
);
break
;
break
;
#endif
/* CONFIG_DCT */
#endif
/* CONFIG_DCT */
#endif
/* FFT_FLOAT */
#endif
/* FFT_FLOAT */
...
@@ -448,9 +444,9 @@ int main(int argc, char **argv)
...
@@ -448,9 +444,9 @@ int main(int argc, char **argv)
switch
(
transform
)
{
switch
(
transform
)
{
case
TRANSFORM_MDCT
:
case
TRANSFORM_MDCT
:
if
(
do_inverse
)
if
(
do_inverse
)
m
.
imdct_calc
(
&
m
,
(
FFTSample
*
)
tab
,
(
FFTSample
*
)
tab1
);
m
.
imdct_calc
(
&
m
,
&
tab
->
re
,
&
tab1
->
re
);
else
else
m
.
mdct_calc
(
&
m
,
(
FFTSample
*
)
tab
,
(
FFTSample
*
)
tab1
);
m
.
mdct_calc
(
&
m
,
&
tab
->
re
,
&
tab1
->
re
);
break
;
break
;
case
TRANSFORM_FFT
:
case
TRANSFORM_FFT
:
memcpy
(
tab
,
tab1
,
fft_size
*
sizeof
(
FFTComplex
));
memcpy
(
tab
,
tab1
,
fft_size
*
sizeof
(
FFTComplex
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment