libg722_1 0.0.1
g192_bit_stream.h
Go to the documentation of this file.
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
24/*! \file */
25
26#if !defined(_G192_BIT_STREAM_H_)
27#define _G192_BIT_STREAM_H_
28
29/*! \page g192_bit_stream_page ITU G.192 codec bit stream handling
30\section g192_bit_stream_page_sec_1 What does it do?
31
32\section g192_bit_stream_page_sec_2 How does it work?
33*/
34
35enum
36{
37 ITU_CODEC_BITSTREAM_PACKED = 0,
38 ITU_CODEC_BITSTREAM_G192 = 1
39};
40
41#if defined(__cplusplus)
42extern "C"
43{
44#endif
45
46/*! \brief Write a frame of data to an output file.
47 \param out_data The buffer for the data to be written.
48 \param number_of_bits The number of bits to be written.
49 \param mode 0 = continuous, 1 = ITU G.192 codec bitstream format.
50 \param fp_bitstream The file context to be written to.
51 \return The number of words written. */
52int itu_codec_bitstream_write(const uint8_t out_data[],
53 int number_of_bits,
54 int mode,
55 FILE *fp_bitstream);
56
57/*! \brief Read a frame of data from an input file.
58 \param in_data The buffer for the data to be read.
59 \param p_erasure Set to TRUE if there is a frame erasure, else set to FALSE.
60 \param number_of_bits The number of bits to be read.
61 \param mode 0 = continuous, 1 = ITU G.192 codec bitstream format.
62 \param fp_bitstream The file context to be read from.
63 \return The number of words read. */
64int itu_codec_bitstream_read(uint8_t in_data[],
65 int16_t *p_erasure,
66 int number_of_bits,
67 int mode,
68 FILE *fp_bitstream);
69
70#if defined(__cplusplus)
71}
72#endif
73
74#endif
75/*- End of file ------------------------------------------------------------*/
int itu_codec_bitstream_read(uint8_t in_data[], int16_t *p_erasure, int number_of_bits, int mode, FILE *fp_bitstream)
Read a frame of data from an input file.
Definition g192_bit_stream.c:98
int itu_codec_bitstream_write(const uint8_t out_data[], int number_of_bits, int mode, FILE *fp_bitstream)
Write a frame of data to an output file.
Definition g192_bit_stream.c:67