• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 COMMON_AUDIO_SIGNAL_PROCESSING_DOT_PRODUCT_WITH_SCALE_H_
12 #define COMMON_AUDIO_SIGNAL_PROCESSING_DOT_PRODUCT_WITH_SCALE_H_
13 
14 #include <stdint.h>
15 #include <string.h>
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 // Calculates the dot product between two (int16_t) vectors.
22 //
23 // Input:
24 //      - vector1       : Vector 1
25 //      - vector2       : Vector 2
26 //      - vector_length : Number of samples used in the dot product
27 //      - scaling       : The number of right bit shifts to apply on each term
28 //                        during calculation to avoid overflow, i.e., the
29 //                        output will be in Q(-|scaling|)
30 //
31 // Return value         : The dot product in Q(-scaling)
32 int32_t WebRtcSpl_DotProductWithScale(const int16_t* vector1,
33                                       const int16_t* vector2,
34                                       size_t length,
35                                       int scaling);
36 
37 #ifdef __cplusplus
38 }
39 #endif  // __cplusplus
40 #endif  // COMMON_AUDIO_SIGNAL_PROCESSING_DOT_PRODUCT_WITH_SCALE_H_
41