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 * $Id: t38_non_ecm_buffer.h,v 1.2 2008/10/13 14:19:18 steveu Exp $ 00027 */ 00028 00029 #if !defined(_SPANDSP_PRIVATE_T38_NON_ECM_BUFFER_H_) 00030 #define _SPANDSP_PRIVATE_T38_NON_ECM_BUFFER_H_ 00031 00032 /*! \brief A flow controlled non-ECM image data buffer, for buffering T.38 to analogue 00033 modem data. 00034 */ 00035 struct t38_non_ecm_buffer_state_s 00036 { 00037 /*! \brief Minimum number of bits per row, used when fill bits are being deleted on the 00038 link, and restored at the emitting gateway. */ 00039 int min_row_bits; 00040 00041 /*! \brief non-ECM modem transmit data buffer. */ 00042 uint8_t data[T38_NON_ECM_TX_BUF_LEN]; 00043 /*! \brief The current write point in the buffer. */ 00044 int in_ptr; 00045 /*! \brief The current read point in the buffer. */ 00046 int out_ptr; 00047 /*! \brief The location of the most recent EOL marker in the buffer. */ 00048 int latest_eol_ptr; 00049 /*! \brief The number of bits to date in the current row, used when min_row_bits is 00050 to be applied. */ 00051 int row_bits; 00052 00053 /*! \brief The bit stream entering the buffer, used to detect EOLs */ 00054 unsigned int bit_stream; 00055 /*! \brief The non-ECM flow control fill octet (0xFF before the first data, and 0x00 00056 once data has started). */ 00057 uint8_t flow_control_fill_octet; 00058 /*! \brief TRUE if we are in the initial all ones part of non-ECM transmission. */ 00059 int at_initial_all_ones; 00060 /*! \brief TRUE is the end of non-ECM data indication has been received. */ 00061 int data_finished; 00062 /*! \brief The current octet being transmitted from the buffer. */ 00063 unsigned int octet; 00064 /*! \brief The current bit number in the current non-ECM octet. */ 00065 int bit_no; 00066 /*! \brief TRUE if in image data mode, as opposed to TCF mode. */ 00067 int image_data_mode; 00068 00069 /*! \brief The number of octets input to the buffer. */ 00070 int in_octets; 00071 /*! \brief The number of rows input to the buffer. */ 00072 int in_rows; 00073 /*! \brief The number of non-ECM fill octets generated for minimum row bits 00074 purposes. */ 00075 int min_row_bits_fill_octets; 00076 /*! \brief The number of octets output from the buffer. */ 00077 int out_octets; 00078 /*! \brief The number of rows output from the buffer. */ 00079 int out_rows; 00080 /*! \brief The number of non-ECM fill octets generated for flow control 00081 purposes. */ 00082 int flow_control_fill_octets; 00083 }; 00084 00085 #endif 00086 /*- End of file ------------------------------------------------------------*/