g192_bit_stream.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. * broadvoice - a library for the BroadVoice 16 and 32 codecs
  3. *
  4. * g192_bit_stream.h
  5. *
  6. * Copyright 2008-2009 Steve Underwood <steveu@coppice.org>
  7. *
  8. * All rights reserved.
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU Lesser General Public License version 2.1,
  12. * as published by the Free Software Foundation.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU Lesser General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Lesser General Public
  20. * License along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  22. */
  23. /*! \file */
  24. #if !defined(_G192_BIT_STREAM_H_)
  25. #define _G192_BIT_STREAM_H_
  26. /*! \page g192_bit_stream_page ITU G.192 codec bit stream handling
  27. \section g192_bit_stream_page_sec_1 What does it do?
  28. \section g192_bit_stream_page_sec_2 How does it work?
  29. */
  30. enum
  31. {
  32. ITU_CODEC_BITSTREAM_PACKED = 0,
  33. ITU_CODEC_BITSTREAM_G192 = 1
  34. };
  35. #if defined(__cplusplus)
  36. extern "C"
  37. {
  38. #endif
  39. /*! \brief Write a frame of data to an output file.
  40. \param out_data The buffer for the data to be written.
  41. \param number_of_bits The number of bits to be written.
  42. \param mode 0 = continuous, 1 = ITU G.192 codec bitstream format.
  43. \param fp_bitstream The file context to be written to.
  44. \return The number of words written. */
  45. int itu_codec_bitstream_write(const uint8_t out_data[],
  46. int number_of_bits,
  47. int mode,
  48. FILE *fp_bitstream);
  49. /*! \brief Read a frame of data from an input file.
  50. \param in_data The buffer for the data to be read.
  51. \param p_erasure Set to TRUE if there is a frame erasure, else set to FALSE.
  52. \param number_of_bits The number of bits to be read.
  53. \param mode 0 = continuous, 1 = ITU G.192 codec bitstream format.
  54. \param fp_bitstream The file context to be read from.
  55. \return The number of words read. */
  56. int itu_codec_bitstream_read(uint8_t in_data[],
  57. int16_t *p_erasure,
  58. int number_of_bits,
  59. int mode,
  60. FILE *fp_bitstream);
  61. #if defined(__cplusplus)
  62. }
  63. #endif
  64. #endif
  65. /*- End of file ------------------------------------------------------------*/