niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 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 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 11 | #ifndef MODULES_AUDIO_CODING_CODECS_PCM16B_PCM16B_H_ |
| 12 | #define MODULES_AUDIO_CODING_CODECS_PCM16B_PCM16B_H_ |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 13 | /* |
| 14 | * Define the fixpoint numeric formats |
| 15 | */ |
| 16 | |
Peter Kasting | dce40cf | 2015-08-24 14:52:23 -0700 | [diff] [blame] | 17 | #include <stddef.h> |
| 18 | |
Mirko Bonadei | 7120742 | 2017-09-15 13:58:09 +0200 | [diff] [blame] | 19 | #include "typedefs.h" // NOLINT(build/include) |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 20 | |
| 21 | #ifdef __cplusplus |
| 22 | extern "C" { |
| 23 | #endif |
| 24 | |
| 25 | /**************************************************************************** |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 26 | * WebRtcPcm16b_Encode(...) |
| 27 | * |
| 28 | * "Encode" a sample vector to 16 bit linear (Encoded standard is big endian) |
| 29 | * |
| 30 | * Input: |
kwiberg@webrtc.org | 648f5d6 | 2015-02-10 09:18:28 +0000 | [diff] [blame] | 31 | * - speech : Input speech vector |
| 32 | * - len : Number of samples in speech vector |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 33 | * |
| 34 | * Output: |
kwiberg@webrtc.org | 648f5d6 | 2015-02-10 09:18:28 +0000 | [diff] [blame] | 35 | * - encoded : Encoded data vector (big endian 16 bit) |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 36 | * |
jmarusic@webrtc.org | 2acec4c | 2015-02-23 15:27:52 +0000 | [diff] [blame] | 37 | * Returned value : Length (in bytes) of coded data. |
| 38 | * Always equal to twice the len input parameter. |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 39 | */ |
| 40 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame^] | 41 | size_t WebRtcPcm16b_Encode(const int16_t* speech, size_t len, uint8_t* encoded); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 42 | |
| 43 | /**************************************************************************** |
| 44 | * WebRtcPcm16b_Decode(...) |
| 45 | * |
| 46 | * "Decode" a vector to 16 bit linear (Encoded standard is big endian) |
| 47 | * |
| 48 | * Input: |
kwiberg@webrtc.org | 648f5d6 | 2015-02-10 09:18:28 +0000 | [diff] [blame] | 49 | * - encoded : Encoded data vector (big endian 16 bit) |
| 50 | * - len : Number of bytes in encoded |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 51 | * |
| 52 | * Output: |
kwiberg@webrtc.org | 648f5d6 | 2015-02-10 09:18:28 +0000 | [diff] [blame] | 53 | * - speech : Decoded speech vector |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 54 | * |
kwiberg@webrtc.org | 648f5d6 | 2015-02-10 09:18:28 +0000 | [diff] [blame] | 55 | * Returned value : Samples in speech |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 56 | */ |
| 57 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame^] | 58 | size_t WebRtcPcm16b_Decode(const uint8_t* encoded, size_t len, int16_t* speech); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 59 | |
| 60 | #ifdef __cplusplus |
| 61 | } |
| 62 | #endif |
| 63 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 64 | #endif /* MODULES_AUDIO_CODING_CODECS_PCM16B_PCM16B_H_ */ |