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
edf93047
Commit
edf93047
authored
Jun 15, 2014
by
Ronald S. Bultje
Committed by
Michael Niedermayer
Jun 15, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swr: reindent.
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
20c7baf8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
64 deletions
+64
-64
resample_template.c
libswresample/resample_template.c
+64
-64
No files found.
libswresample/resample_template.c
View file @
edf93047
...
...
@@ -123,42 +123,42 @@ int RENAME(swri_resample_common)(ResampleContext *c,
DELEM
*
dst
,
const
DELEM
*
src
,
int
n
,
int
update_ctx
)
{
int
dst_index
;
int
index
=
c
->
index
;
int
frac
=
c
->
frac
;
int
dst_incr_frac
=
c
->
dst_incr
%
c
->
src_incr
;
int
dst_incr
=
c
->
dst_incr
/
c
->
src_incr
;
int
sample_index
=
index
>>
c
->
phase_shift
;
int
dst_index
;
int
index
=
c
->
index
;
int
frac
=
c
->
frac
;
int
dst_incr_frac
=
c
->
dst_incr
%
c
->
src_incr
;
int
dst_incr
=
c
->
dst_incr
/
c
->
src_incr
;
int
sample_index
=
index
>>
c
->
phase_shift
;
index
&=
c
->
phase_mask
;
for
(
dst_index
=
0
;
dst_index
<
n
;
dst_index
++
)
{
FELEM
*
filter
=
((
FELEM
*
)
c
->
filter_bank
)
+
c
->
filter_alloc
*
index
;
index
&=
c
->
phase_mask
;
for
(
dst_index
=
0
;
dst_index
<
n
;
dst_index
++
)
{
FELEM
*
filter
=
((
FELEM
*
)
c
->
filter_bank
)
+
c
->
filter_alloc
*
index
;
#ifdef COMMON_CORE
COMMON_CORE
COMMON_CORE
#else
FELEM2
val
=
0
;
int
i
;
for
(
i
=
0
;
i
<
c
->
filter_length
;
i
++
)
{
val
+=
src
[
sample_index
+
i
]
*
(
FELEM2
)
filter
[
i
];
}
OUT
(
dst
[
dst_index
],
val
);
FELEM2
val
=
0
;
int
i
;
for
(
i
=
0
;
i
<
c
->
filter_length
;
i
++
)
{
val
+=
src
[
sample_index
+
i
]
*
(
FELEM2
)
filter
[
i
];
}
OUT
(
dst
[
dst_index
],
val
);
#endif
frac
+=
dst_incr_frac
;
index
+=
dst_incr
;
if
(
frac
>=
c
->
src_incr
)
{
frac
-=
c
->
src_incr
;
index
++
;
}
sample_index
+=
index
>>
c
->
phase_shift
;
index
&=
c
->
phase_mask
;
}
if
(
update_ctx
){
c
->
frac
=
frac
;
c
->
index
=
index
;
}
frac
+=
dst_incr_frac
;
index
+=
dst_incr
;
if
(
frac
>=
c
->
src_incr
)
{
frac
-=
c
->
src_incr
;
index
++
;
}
sample_index
+=
index
>>
c
->
phase_shift
;
index
&=
c
->
phase_mask
;
}
if
(
update_ctx
){
c
->
frac
=
frac
;
c
->
index
=
index
;
}
return
sample_index
;
}
...
...
@@ -167,44 +167,44 @@ int RENAME(swri_resample_linear)(ResampleContext *c,
DELEM
*
dst
,
const
DELEM
*
src
,
int
n
,
int
update_ctx
)
{
int
dst_index
;
int
index
=
c
->
index
;
int
frac
=
c
->
frac
;
int
dst_incr_frac
=
c
->
dst_incr
%
c
->
src_incr
;
int
dst_incr
=
c
->
dst_incr
/
c
->
src_incr
;
int
sample_index
=
index
>>
c
->
phase_shift
;
index
&=
c
->
phase_mask
;
for
(
dst_index
=
0
;
dst_index
<
n
;
dst_index
++
)
{
FELEM
*
filter
=
((
FELEM
*
)
c
->
filter_bank
)
+
c
->
filter_alloc
*
index
;
FELEM2
val
=
0
,
v2
=
0
;
int
dst_index
;
int
index
=
c
->
index
;
int
frac
=
c
->
frac
;
int
dst_incr_frac
=
c
->
dst_incr
%
c
->
src_incr
;
int
dst_incr
=
c
->
dst_incr
/
c
->
src_incr
;
int
sample_index
=
index
>>
c
->
phase_shift
;
index
&=
c
->
phase_mask
;
for
(
dst_index
=
0
;
dst_index
<
n
;
dst_index
++
)
{
FELEM
*
filter
=
((
FELEM
*
)
c
->
filter_bank
)
+
c
->
filter_alloc
*
index
;
FELEM2
val
=
0
,
v2
=
0
;
#ifdef LINEAR_CORE
LINEAR_CORE
LINEAR_CORE
#else
int
i
;
for
(
i
=
0
;
i
<
c
->
filter_length
;
i
++
)
{
val
+=
src
[
sample_index
+
i
]
*
(
FELEM2
)
filter
[
i
];
v2
+=
src
[
sample_index
+
i
]
*
(
FELEM2
)
filter
[
i
+
c
->
filter_alloc
];
}
int
i
;
for
(
i
=
0
;
i
<
c
->
filter_length
;
i
++
)
{
val
+=
src
[
sample_index
+
i
]
*
(
FELEM2
)
filter
[
i
];
v2
+=
src
[
sample_index
+
i
]
*
(
FELEM2
)
filter
[
i
+
c
->
filter_alloc
];
}
#endif
val
+=
(
v2
-
val
)
*
(
FELEML
)
frac
/
c
->
src_incr
;
OUT
(
dst
[
dst_index
],
val
);
frac
+=
dst_incr_frac
;
index
+=
dst_incr
;
if
(
frac
>=
c
->
src_incr
)
{
frac
-=
c
->
src_incr
;
index
++
;
}
sample_index
+=
index
>>
c
->
phase_shift
;
index
&=
c
->
phase_mask
;
}
if
(
update_ctx
){
c
->
frac
=
frac
;
c
->
index
=
index
;
}
val
+=
(
v2
-
val
)
*
(
FELEML
)
frac
/
c
->
src_incr
;
OUT
(
dst
[
dst_index
],
val
);
frac
+=
dst_incr_frac
;
index
+=
dst_incr
;
if
(
frac
>=
c
->
src_incr
)
{
frac
-=
c
->
src_incr
;
index
++
;
}
sample_index
+=
index
>>
c
->
phase_shift
;
index
&=
c
->
phase_mask
;
}
if
(
update_ctx
){
c
->
frac
=
frac
;
c
->
index
=
index
;
}
return
sample_index
;
}
...
...
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