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
1e40b2c2
Commit
1e40b2c2
authored
Oct 25, 2011
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rematrix: add type for coefficients
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
9f9b2ab1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
rematrix.c
libswresample/rematrix.c
+3
-0
rematrix_template.c
libswresample/rematrix_template.c
+2
-2
No files found.
libswresample/rematrix.c
View file @
1e40b2c2
...
...
@@ -25,16 +25,19 @@
#define ONE (1.0)
#define R(x) x
#define SAMPLE float
#define COEFF float
#define RENAME(x) x ## _float
#include "rematrix_template.c"
#undef SAMPLE
#undef RENAME
#undef R
#undef ONE
#undef COEFF
#define ONE (-32768)
#define R(x) (((x) + 16384)>>15)
#define SAMPLE int16_t
#define COEFF int
#define RENAME(x) x ## _s16
#include "rematrix_template.c"
...
...
libswresample/rematrix_template.c
View file @
1e40b2c2
...
...
@@ -19,14 +19,14 @@
*/
static
void
RENAME
(
sum2
)(
SAMPLE
*
out
,
const
SAMPLE
*
in1
,
const
SAMPLE
*
in2
,
SAMPLE
coeff1
,
SAMPLE
coeff2
,
int
len
){
static
void
RENAME
(
sum2
)(
SAMPLE
*
out
,
const
SAMPLE
*
in1
,
const
SAMPLE
*
in2
,
COEFF
coeff1
,
COEFF
coeff2
,
int
len
){
int
i
;
for
(
i
=
0
;
i
<
len
;
i
++
)
out
[
i
]
=
R
(
coeff1
*
in1
[
i
]
+
coeff2
*
in2
[
i
]);
}
static
void
RENAME
(
copy
)(
SAMPLE
*
out
,
const
SAMPLE
*
in
,
SAMPLE
coeff
,
int
len
){
static
void
RENAME
(
copy
)(
SAMPLE
*
out
,
const
SAMPLE
*
in
,
COEFF
coeff
,
int
len
){
if
(
coeff
==
ONE
){
memcpy
(
out
,
in
,
sizeof
(
SAMPLE
)
*
len
);
}
else
{
...
...
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