00001 /* 00002 * SpanDSP - a series of DSP components for telephony 00003 * 00004 * private/t38_non_ecm_buffer.h - A rate adapting buffer for T.38 non-ECM image 00005 * and TCF data 00006 * 00007 * Written by Steve Underwood <steveu@coppice.org> 00008 * 00009 * Copyright (C) 2005, 2006, 2007, 2008 Steve Underwood 00010 * 00011 * All rights reserved. 00012 * 00013 * This program is free software; you can redistribute it and/or modify 00014 * it under the terms of the GNU Lesser General Public License version 2.1, 00015 * as published by the Free Software Foundation. 00016 * 00017 * This program is distributed in the hope that it will be useful, 00018 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00020 * GNU Lesser General Public License for more details. 00021 * 00022 * You should have received a copy of the GNU Lesser General Public 00023 * License along with this program; if not, write to the Free Software 00024 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00025 */ 00026 00027 #if !defined(_SPANDSP_PRIVATE_T38_NON_ECM_BUFFER_H_) 00028 #define _SPANDSP_PRIVATE_T38_NON_ECM_BUFFER_H_ 00029 00030 /*! \brief A flow controlled non-ECM image data buffer, for buffering T.38 to analogue 00031 modem data. 00032 */ 00033 struct t38_non_ecm_buffer_state_s 00034 { 00035 /*! \brief Minimum number of bits per row, used when fill bits are being deleted on the 00036 link, and restored at the emitting gateway. */ 00037 int min_bits_per_row; 00038 00039 /*! \brief non-ECM modem transmit data buffer. */ 00040 uint8_t data[T38_NON_ECM_TX_BUF_LEN]; 00041 /*! \brief The current write point in the buffer. */ 00042 int in_ptr; 00043 /*! \brief The current read point in the buffer. */ 00044 int out_ptr; 00045 /*! \brief The location of the most recent EOL marker in the buffer. */ 00046 int latest_eol_ptr; 00047 /*! \brief The number of bits to date in the current row, used when min_row_bits is 00048 to be applied. */ 00049 int row_bits; 00050 00051 /*! \brief The bit stream entering the buffer, used to detect EOLs */ 00052 unsigned int bit_stream; 00053 /*! \brief The non-ECM flow control fill octet (0xFF before the first data, and 0x00 00054 once data has started). */ 00055 uint8_t flow_control_fill_octet; 00056 /*! \brief A code for the phase of input buffering, from initial all ones to completion. */ 00057 int input_phase; 00058 /*! \brief TRUE is the end of non-ECM data indication has been received. */ 00059 int data_finished; 00060 /*! \brief The current octet being transmitted from the buffer. */ 00061 unsigned int octet; 00062 /*! \brief The current bit number in the current non-ECM octet. */ 00063 int bit_no; 00064 /*! \brief TRUE if in image data mode, as opposed to TCF mode. */ 00065 int image_data_mode; 00066 00067 /*! \brief The number of octets input to the buffer. */ 00068 int in_octets; 00069 /*! \brief The number of rows input to the buffer. */ 00070 int in_rows; 00071 /*! \brief The number of non-ECM fill octets generated for minimum row bits 00072 purposes. */ 00073 int min_row_bits_fill_octets; 00074 /*! \brief The number of octets output from the buffer. */ 00075 int out_octets; 00076 /*! \brief The number of rows output from the buffer. */ 00077 int out_rows; 00078 /*! \brief The number of non-ECM fill octets generated for flow control 00079 purposes. */ 00080 int flow_control_fill_octets; 00081 }; 00082 00083 #endif 00084 /*- End of file ------------------------------------------------------------*/