Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(227)

Side by Side Diff: webrtc/common_audio/signal_processing/dot_product_with_scale.h

Issue 2717123004: Avoid overflow in WebRtcSpl_DotProductWithScale (Closed)
Patch Set: Move to separate target Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 /*
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11 #ifndef WEBRTC_COMMON_AUDIO_SIGNAL_PROCESSING_DOT_PRODUCT_WITH_SCALE_H_
12 #define WEBRTC_COMMON_AUDIO_SIGNAL_PROCESSING_DOT_PRODUCT_WITH_SCALE_H_
13
14 #include <string.h>
15
16 #include "webrtc/typedefs.h"
17
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21
22 // Calculates the dot product between two (int16_t) vectors.
23 //
24 // Input:
25 // - vector1 : Vector 1
26 // - vector2 : Vector 2
27 // - vector_length : Number of samples used in the dot product
28 // - scaling : The number of right bit shifts to apply on each term
29 // during calculation to avoid overflow, i.e., the
30 // output will be in Q(-|scaling|)
31 //
32 // Return value : The dot product in Q(-scaling)
33 int32_t WebRtcSpl_DotProductWithScale(const int16_t* vector1,
34 const int16_t* vector2,
35 size_t length,
36 int scaling);
37
38 #ifdef __cplusplus
39 }
40 #endif // __cplusplus
41 #endif // WEBRTC_COMMON_AUDIO_SIGNAL_PROCESSING_DOT_PRODUCT_WITH_SCALE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698