private/t4_tx.h

00001 /*
00002  * SpanDSP - a series of DSP components for telephony
00003  *
00004  * private/t4_tx.h - definitions for T.4 FAX transmit processing
00005  *
00006  * Written by Steve Underwood <steveu@coppice.org>
00007  *
00008  * Copyright (C) 2003 Steve Underwood
00009  *
00010  * All rights reserved.
00011  *
00012  * This program is free software; you can redistribute it and/or modify
00013  * it under the terms of the GNU Lesser General Public License version 2.1,
00014  * as published by the Free Software Foundation.
00015  *
00016  * This program is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  * GNU Lesser General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU Lesser General Public
00022  * License along with this program; if not, write to the Free Software
00023  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00024  */
00025 
00026 #if !defined(_SPANDSP_PRIVATE_T4_TX_H_)
00027 #define _SPANDSP_PRIVATE_T4_TX_H_
00028 
00029 /*!
00030     T.4 FAX compression/decompression descriptor. This defines the working state
00031     for a single instance of a T.4 FAX compression or decompression channel.
00032 */
00033 struct t4_state_s
00034 {
00035     /*! \brief The same structure is used for T.4 transmit and receive. This variable
00036                records which mode is in progress. */
00037     int rx;
00038 
00039     /*! \brief The type of compression used between the FAX machines. */
00040     int line_encoding;
00041 
00042     /*! \brief The time at which handling of the current page began. */
00043     time_t page_start_time;
00044 
00045     /*! \brief The text which will be used in FAX page header. No text results
00046                in no header line. */
00047     const char *header_info;
00048     /*! \brief Optional per instance time zone for the FAX pager header timestamp. */
00049     struct tz_s *tz;
00050 
00051     /*! \brief The size of the compressed image on the line side, in bits. */
00052     int line_image_size;
00053 
00054     /*! \brief The current number of bytes per row of uncompressed image data. */
00055     int bytes_per_row;
00056     /*! \brief The size of the image in the image buffer, in bytes. */
00057     int image_size;
00058     /*! \brief The current size of the image buffer. */
00059     int image_buffer_size;
00060     /*! \brief A point to the image buffer. */
00061     uint8_t *image_buffer;
00062 
00063     /*! \brief The number of pages transferred to date. */
00064     int current_page;
00065     /*! \brief Column-to-column (X) resolution in pixels per metre. */
00066     int x_resolution;
00067     /*! \brief Row-to-row (Y) resolution in pixels per metre. */
00068     int y_resolution;
00069     /*! \brief Width of the current page, in pixels. */
00070     int image_width;
00071     /*! \brief Length of the current page, in pixels. */
00072     int image_length;
00073     /*! \brief Current pixel row number. */
00074     int row;
00075 
00076     /*! \brief This variable is set if we are treating the current row as a 2D encoded
00077                one. */
00078     int row_is_2d;
00079     /*! \brief The current length of the current row. */
00080     int row_len;
00081 
00082     /*! \brief Black and white run-lengths for the current row. */
00083     uint32_t *cur_runs;
00084     /*! \brief Black and white run-lengths for the reference row. */
00085     uint32_t *ref_runs;
00086     /*! \brief Pointer to the buffer for the current pixel row. */
00087     uint8_t *row_buf;
00088 
00089     /*! \brief Encoded data bits buffer. */
00090     uint32_t tx_bitstream;
00091     /*! \brief The number of bits currently in tx_bitstream. */
00092     int tx_bits;
00093 
00094     /*! \brief The current number of bits in the current encoded row. */
00095     int row_bits;
00096     /*! \brief The minimum bits in any row of the current page. For monitoring only. */
00097     int min_row_bits;
00098     /*! \brief The maximum bits in any row of the current page. For monitoring only. */
00099     int max_row_bits;
00100 
00101     /*! \brief Error and flow logging control */
00102     logging_state_t logging;
00103 
00104     /*! \brief All TIFF file specific state information for the T.4 context. */
00105     t4_tiff_state_t tiff;
00106     t4_t6_decode_state_t t4_t6_rx;
00107     t4_t6_encode_state_t t4_t6_tx;
00108 };
00109 
00110 #endif
00111 /*- End of file ------------------------------------------------------------*/

Generated on 25 Jan 2012 for spandsp by  doxygen 1.6.1