• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *  Copyright (c) 2011 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 MODULES_AUDIO_CODING_CODECS_PCM16B_PCM16B_H_
12 #define MODULES_AUDIO_CODING_CODECS_PCM16B_PCM16B_H_
13 /*
14  * Define the fixpoint numeric formats
15  */
16 
17 #include <stddef.h>
18 #include <stdint.h>
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
24 /****************************************************************************
25  * WebRtcPcm16b_Encode(...)
26  *
27  * "Encode" a sample vector to 16 bit linear (Encoded standard is big endian)
28  *
29  * Input:
30  *              - speech        : Input speech vector
31  *              - len           : Number of samples in speech vector
32  *
33  * Output:
34  *              - encoded       : Encoded data vector (big endian 16 bit)
35  *
36  * Returned value               : Length (in bytes) of coded data.
37  *                                Always equal to twice the len input parameter.
38  */
39 
40 size_t WebRtcPcm16b_Encode(const int16_t* speech, size_t len, uint8_t* encoded);
41 
42 /****************************************************************************
43  * WebRtcPcm16b_Decode(...)
44  *
45  * "Decode" a vector to 16 bit linear (Encoded standard is big endian)
46  *
47  * Input:
48  *              - encoded       : Encoded data vector (big endian 16 bit)
49  *              - len           : Number of bytes in encoded
50  *
51  * Output:
52  *              - speech        : Decoded speech vector
53  *
54  * Returned value               : Samples in speech
55  */
56 
57 size_t WebRtcPcm16b_Decode(const uint8_t* encoded, size_t len, int16_t* speech);
58 
59 #ifdef __cplusplus
60 }
61 #endif
62 
63 #endif /* MODULES_AUDIO_CODING_CODECS_PCM16B_PCM16B_H_ */
64