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
5e68bf9b
Commit
5e68bf9b
authored
Nov 14, 2012
by
Clément Bœsch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swr/rematrix: move templating parameters to template itself.
parent
8ea88339
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
33 deletions
+38
-33
rematrix.c
libswresample/rematrix.c
+8
-33
rematrix_template.c
libswresample/rematrix_template.c
+30
-0
No files found.
libswresample/rematrix.c
View file @
5e68bf9b
...
@@ -22,42 +22,17 @@
...
@@ -22,42 +22,17 @@
#include "libavutil/avassert.h"
#include "libavutil/avassert.h"
#include "libavutil/channel_layout.h"
#include "libavutil/channel_layout.h"
#define ONE (1.0)
#define TEMPLATE_REMATRIX_FLT
#define R(x) x
#define SAMPLE float
#define COEFF float
#define INTER float
#define RENAME(x) x ## _float
#include "rematrix_template.c"
#include "rematrix_template.c"
#undef SAMPLE
#undef TEMPLATE_REMATRIX_FLT
#undef RENAME
#undef R
#define TEMPLATE_REMATRIX_DBL
#undef ONE
#undef COEFF
#undef INTER
#define ONE (1.0)
#define R(x) x
#define SAMPLE double
#define COEFF double
#define INTER double
#define RENAME(x) x ## _double
#include "rematrix_template.c"
#undef SAMPLE
#undef RENAME
#undef R
#undef ONE
#undef COEFF
#undef INTER
#define ONE (-32768)
#define R(x) (((x) + 16384)>>15)
#define SAMPLE int16_t
#define COEFF int
#define INTER int
#define RENAME(x) x ## _s16
#include "rematrix_template.c"
#include "rematrix_template.c"
#undef TEMPLATE_REMATRIX_DBL
#define TEMPLATE_REMATRIX_S16
#include "rematrix_template.c"
#undef TEMPLATE_REMATRIX_S16
#define FRONT_LEFT 0
#define FRONT_LEFT 0
#define FRONT_RIGHT 1
#define FRONT_RIGHT 1
...
...
libswresample/rematrix_template.c
View file @
5e68bf9b
...
@@ -18,6 +18,29 @@
...
@@ -18,6 +18,29 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
*/
#if defined(TEMPLATE_REMATRIX_FLT)
# define ONE (1.0)
# define R(x) x
# define SAMPLE float
# define COEFF float
# define INTER float
# define RENAME(x) x ## _float
#elif defined(TEMPLATE_REMATRIX_DBL)
# define ONE (1.0)
# define R(x) x
# define SAMPLE double
# define COEFF double
# define INTER double
# define RENAME(x) x ## _double
#elif defined(TEMPLATE_REMATRIX_S16)
# define ONE (-32768)
# define R(x) (((x) + 16384)>>15)
# define SAMPLE int16_t
# define COEFF int
# define INTER int
# define RENAME(x) x ## _s16
#endif
typedef
void
(
RENAME
(
mix_any_func_type
))(
SAMPLE
**
out
,
const
SAMPLE
**
in1
,
COEFF
*
coeffp
,
integer
len
);
typedef
void
(
RENAME
(
mix_any_func_type
))(
SAMPLE
**
out
,
const
SAMPLE
**
in1
,
COEFF
*
coeffp
,
integer
len
);
static
void
RENAME
(
sum2
)(
SAMPLE
*
out
,
const
SAMPLE
*
in1
,
const
SAMPLE
*
in2
,
COEFF
*
coeffp
,
integer
index1
,
integer
index2
,
integer
len
){
static
void
RENAME
(
sum2
)(
SAMPLE
*
out
,
const
SAMPLE
*
in1
,
const
SAMPLE
*
in2
,
COEFF
*
coeffp
,
integer
index1
,
integer
index2
,
integer
len
){
...
@@ -72,3 +95,10 @@ static RENAME(mix_any_func_type) *RENAME(get_mix_any_func)(SwrContext *s){
...
@@ -72,3 +95,10 @@ static RENAME(mix_any_func_type) *RENAME(get_mix_any_func)(SwrContext *s){
return
NULL
;
return
NULL
;
}
}
#undef ONE
#undef R
#undef SAMPLE
#undef COEFF
#undef INTER
#undef RENAME
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