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