Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / webrtc / modules / audio_coding / codecs / pcm16b / include / pcm16b.h
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 WEBRTC_MODULES_AUDIO_CODING_CODECS_PCM16B_MAIN_INTERFACE_PCM16B_H_
12 #define WEBRTC_MODULES_AUDIO_CODING_CODECS_PCM16B_MAIN_INTERFACE_PCM16B_H_
13 /*
14  * Define the fixpoint numeric formats
15  */
16
17 #include "webrtc/typedefs.h"
18
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22
23 /****************************************************************************
24  * WebRtcPcm16b_EncodeW16(...)
25  *
26  * "Encode" a sample vector to 16 bit linear (Encoded standard is big endian)
27  *
28  * Input:
29  *    - speechIn16b    : Input speech vector
30  *    - length_samples : Number of samples in speech vector
31  *
32  * Output:
33  *    - speechOut16b   : Encoded data vector (big endian 16 bit)
34  *
35  * Returned value      : Size in bytes of speechOut16b
36  */
37
38 int16_t WebRtcPcm16b_EncodeW16(const int16_t* speechIn16b,
39                                int16_t length_samples,
40                                int16_t* speechOut16b);
41
42 /****************************************************************************
43  * WebRtcPcm16b_Encode(...)
44  *
45  * "Encode" a sample vector to 16 bit linear (Encoded standard is big endian)
46  *
47  * Input:
48  *              - speech16b             : Input speech vector
49  *              - len                   : Number of samples in speech vector
50  *
51  * Output:
52  *              - speech8b              : Encoded data vector (big endian 16 bit)
53  *
54  * Returned value               : Size in bytes of speech8b
55  */
56
57 int16_t WebRtcPcm16b_Encode(int16_t *speech16b,
58                             int16_t len,
59                             unsigned char *speech8b);
60
61 /****************************************************************************
62  * WebRtcPcm16b_DecodeW16(...)
63  *
64  * "Decode" a vector to 16 bit linear (Encoded standard is big endian)
65  *
66  * Input:
67  *    - speechIn16b  : Encoded data vector (big endian 16 bit)
68  *    - length_bytes : Number of bytes in speechIn16b
69  *
70  * Output:
71  *    - speechOut16b : Decoded speech vector
72  *
73  * Returned value    : Samples in speechOut16b
74  */
75
76 int16_t WebRtcPcm16b_DecodeW16(int16_t *speechIn16b,
77                                int16_t length_bytes,
78                                int16_t *speechOut16b,
79                                int16_t* speechType);
80
81 /****************************************************************************
82  * WebRtcPcm16b_Decode(...)
83  *
84  * "Decode" a vector to 16 bit linear (Encoded standard is big endian)
85  *
86  * Input:
87  *              - speech8b              : Encoded data vector (big endian 16 bit)
88  *              - len                   : Number of bytes in speech8b
89  *
90  * Output:
91  *              - speech16b             : Decoded speech vector
92  *
93  * Returned value               : Samples in speech16b
94  */
95
96
97 int16_t WebRtcPcm16b_Decode(unsigned char *speech8b,
98                             int16_t len,
99                             int16_t *speech16b);
100
101 #ifdef __cplusplus
102 }
103 #endif
104
105 #endif /* PCM16B */