2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
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.
11 #ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_PCM16B_MAIN_INTERFACE_PCM16B_H_
12 #define WEBRTC_MODULES_AUDIO_CODING_CODECS_PCM16B_MAIN_INTERFACE_PCM16B_H_
14 * Define the fixpoint numeric formats
17 #include "webrtc/typedefs.h"
23 /****************************************************************************
24 * WebRtcPcm16b_EncodeW16(...)
26 * "Encode" a sample vector to 16 bit linear (Encoded standard is big endian)
29 * - speechIn16b : Input speech vector
30 * - length_samples : Number of samples in speech vector
33 * - speechOut16b : Encoded data vector (big endian 16 bit)
35 * Returned value : Size in bytes of speechOut16b
38 int16_t WebRtcPcm16b_EncodeW16(const int16_t* speechIn16b,
39 int16_t length_samples,
40 int16_t* speechOut16b);
42 /****************************************************************************
43 * WebRtcPcm16b_Encode(...)
45 * "Encode" a sample vector to 16 bit linear (Encoded standard is big endian)
48 * - speech16b : Input speech vector
49 * - len : Number of samples in speech vector
52 * - speech8b : Encoded data vector (big endian 16 bit)
54 * Returned value : Size in bytes of speech8b
57 int16_t WebRtcPcm16b_Encode(int16_t *speech16b,
59 unsigned char *speech8b);
61 /****************************************************************************
62 * WebRtcPcm16b_DecodeW16(...)
64 * "Decode" a vector to 16 bit linear (Encoded standard is big endian)
67 * - speechIn16b : Encoded data vector (big endian 16 bit)
68 * - length_bytes : Number of bytes in speechIn16b
71 * - speechOut16b : Decoded speech vector
73 * Returned value : Samples in speechOut16b
76 int16_t WebRtcPcm16b_DecodeW16(int16_t *speechIn16b,
78 int16_t *speechOut16b,
81 /****************************************************************************
82 * WebRtcPcm16b_Decode(...)
84 * "Decode" a vector to 16 bit linear (Encoded standard is big endian)
87 * - speech8b : Encoded data vector (big endian 16 bit)
88 * - len : Number of bytes in speech8b
91 * - speech16b : Decoded speech vector
93 * Returned value : Samples in speech16b
97 int16_t WebRtcPcm16b_Decode(unsigned char *speech8b,