Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Mark Harris
Opus
Commits
66b7fe0a
Commit
66b7fe0a
authored
Dec 09, 2013
by
Jean-Marc Valin
Browse files
Using celt_inner_prod() for input sanity check.
parent
57cd849c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/opus_encoder.c
View file @
66b7fe0a
...
...
@@ -38,6 +38,7 @@
#include
"float_cast.h"
#include
"opus.h"
#include
"arch.h"
#include
"pitch.h"
#include
"opus_private.h"
#include
"os_support.h"
#include
"cpu_support.h"
...
...
@@ -1447,9 +1448,8 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_
#ifndef FIXED_POINT
if
(
float_api
)
{
opus_val32
sum
=
0
;
for
(
i
=
0
;
i
<
frame_size
*
st
->
channels
;
i
++
)
sum
+=
pcm_buf
[
total_buffer
*
st
->
channels
+
i
]
*
pcm_buf
[
total_buffer
*
st
->
channels
+
i
];
opus_val32
sum
;
sum
=
celt_inner_prod
(
&
pcm_buf
[
total_buffer
*
st
->
channels
],
&
pcm_buf
[
total_buffer
*
st
->
channels
],
frame_size
*
st
->
channels
);
/* This should filter out both NaNs and ridiculous signals that could
cause NaNs further down. */
if
(
!
(
sum
<
1e9
))
...
...
Write
Preview
Supports
Markdown
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