pcm16b.h 1.9 KB

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