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
a82c6238
Commit
a82c6238
authored
Mar 17, 2011
by
Mohamed Naufal Basheer
Committed by
Michael Niedermayer
Sep 29, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add dot_product function for use by the G.723.1 decoder
parent
bcc67dff
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
0 deletions
+23
-0
celp_math.c
libavcodec/celp_math.c
+12
-0
celp_math.h
libavcodec/celp_math.h
+11
-0
No files found.
libavcodec/celp_math.c
View file @
a82c6238
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
#include <assert.h>
#include <assert.h>
#include "avcodec.h"
#include "avcodec.h"
#include "mathops.h"
#include "celp_math.h"
#include "celp_math.h"
#ifdef G729_BITEXACT
#ifdef G729_BITEXACT
...
@@ -196,6 +197,17 @@ int ff_log2(uint32_t value)
...
@@ -196,6 +197,17 @@ int ff_log2(uint32_t value)
return
(
power_int
<<
15
)
+
value
;
return
(
power_int
<<
15
)
+
value
;
}
}
int
ff_dot_product
(
const
int16_t
*
a
,
const
int16_t
*
b
,
int
length
,
int
shift
)
{
int
i
,
sum
=
0
;
for
(
i
=
0
;
i
<
length
;
i
++
)
{
int64_t
prod
=
av_clipl_int32
(
MUL64
(
a
[
i
],
b
[
i
])
<<
shift
);
sum
=
av_clipl_int32
(
sum
+
prod
);
}
return
sum
;
}
float
ff_dot_productf
(
const
float
*
a
,
const
float
*
b
,
int
length
)
float
ff_dot_productf
(
const
float
*
a
,
const
float
*
b
,
int
length
)
{
{
float
sum
=
0
;
float
sum
=
0
;
...
...
libavcodec/celp_math.h
View file @
a82c6238
...
@@ -63,6 +63,17 @@ static inline int bidir_sal(int value, int offset)
...
@@ -63,6 +63,17 @@ static inline int bidir_sal(int value, int offset)
else
return
value
<<
offset
;
else
return
value
<<
offset
;
}
}
/**
* returns the dot product of 2 int16_t vectors.
* @param a input data array
* @param b input data array
* @param length number of elements
* @param shift the result is scaled by 2^shift
*
* @return dot product = sum of elementwise products
*/
int
ff_dot_product
(
const
int16_t
*
a
,
const
int16_t
*
b
,
int
length
,
int
shift
);
/**
/**
* returns the dot product.
* returns the dot product.
* @param a input data array
* @param a input data array
...
...
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