blob: 75d1efda3b08ecf09c4cea9173ec1ce784c03097 [file] [log] [blame]
niklase@google.com470e71d2011-07-07 08:21:25 +00001/*
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
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020011#ifndef MODULES_AUDIO_CODING_CODECS_PCM16B_PCM16B_H_
12#define MODULES_AUDIO_CODING_CODECS_PCM16B_PCM16B_H_
niklase@google.com470e71d2011-07-07 08:21:25 +000013/*
14 * Define the fixpoint numeric formats
15 */
16
Peter Kastingdce40cf2015-08-24 14:52:23 -070017#include <stddef.h>
Niels Möllera12c42a2018-07-25 16:05:48 +020018#include <stdint.h>
niklase@google.com470e71d2011-07-07 08:21:25 +000019
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24/****************************************************************************
niklase@google.com470e71d2011-07-07 08:21:25 +000025 * WebRtcPcm16b_Encode(...)
26 *
27 * "Encode" a sample vector to 16 bit linear (Encoded standard is big endian)
28 *
29 * Input:
kwiberg@webrtc.org648f5d62015-02-10 09:18:28 +000030 * - speech : Input speech vector
31 * - len : Number of samples in speech vector
niklase@google.com470e71d2011-07-07 08:21:25 +000032 *
33 * Output:
kwiberg@webrtc.org648f5d62015-02-10 09:18:28 +000034 * - encoded : Encoded data vector (big endian 16 bit)
niklase@google.com470e71d2011-07-07 08:21:25 +000035 *
jmarusic@webrtc.org2acec4c2015-02-23 15:27:52 +000036 * Returned value : Length (in bytes) of coded data.
37 * Always equal to twice the len input parameter.
niklase@google.com470e71d2011-07-07 08:21:25 +000038 */
39
Yves Gerey665174f2018-06-19 15:03:05 +020040size_t WebRtcPcm16b_Encode(const int16_t* speech, size_t len, uint8_t* encoded);
niklase@google.com470e71d2011-07-07 08:21:25 +000041
42/****************************************************************************
43 * WebRtcPcm16b_Decode(...)
44 *
45 * "Decode" a vector to 16 bit linear (Encoded standard is big endian)
46 *
47 * Input:
kwiberg@webrtc.org648f5d62015-02-10 09:18:28 +000048 * - encoded : Encoded data vector (big endian 16 bit)
49 * - len : Number of bytes in encoded
niklase@google.com470e71d2011-07-07 08:21:25 +000050 *
51 * Output:
kwiberg@webrtc.org648f5d62015-02-10 09:18:28 +000052 * - speech : Decoded speech vector
niklase@google.com470e71d2011-07-07 08:21:25 +000053 *
kwiberg@webrtc.org648f5d62015-02-10 09:18:28 +000054 * Returned value : Samples in speech
niklase@google.com470e71d2011-07-07 08:21:25 +000055 */
56
Yves Gerey665174f2018-06-19 15:03:05 +020057size_t WebRtcPcm16b_Decode(const uint8_t* encoded, size_t len, int16_t* speech);
niklase@google.com470e71d2011-07-07 08:21:25 +000058
59#ifdef __cplusplus
60}
61#endif
62
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020063#endif /* MODULES_AUDIO_CODING_CODECS_PCM16B_PCM16B_H_ */