spandsp 0.0.6

private/t4_t6_encode.h
1/*
2 * SpanDSP - a series of DSP components for telephony
3 *
4 * private/t4_t6_encode.h - definitions for T.4/T.6 fax compression
5 *
6 * Written by Steve Underwood <steveu@coppice.org>
7 *
8 * Copyright (C) 2003 Steve Underwood
9 *
10 * All rights reserved.
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 2.1,
14 * as published by the Free Software Foundation.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License for more details.
20 *
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with this program; if not, write to the Free Software
23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 */
25
26#if !defined(_SPANDSP_PRIVATE_T4_T6_ENCODE_H_)
27#define _SPANDSP_PRIVATE_T4_T6_ENCODE_H_
28
29/*!
30 T.4 1D, T4 2D and T6 compressor state.
31*/
32 struct t4_t6_encode_state_s
33{
34 /*! \brief The minimum number of encoded bits per row. This is a timing thing
35 for hardware FAX machines. */
36 int min_bits_per_row;
37 /*! \brief The current maximum contiguous rows that may be 2D encoded. */
38 int max_rows_to_next_1d_row;
39
40 /*! \brief Number of rows left that can be 2D encoded, before a 1D encoded row
41 must be used. */
42 int rows_to_next_1d_row;
43
44 /*! \brief The number of runs currently in the reference row. */
45 int ref_steps;
46
47 /*! \brief Pointer to the byte containing the next image bit to transmit. */
48 int bit_pos;
49 /*! \brief Pointer to the bit within the byte containing the next image bit to transmit. */
50 int bit_ptr;
51
52 /*! \brief Callback function to read a row of pixels from the image source. */
53 t4_row_read_handler_t row_read_handler;
54 /*! \brief Opaque pointer passed to row_read_handler. */
55 void *row_read_user_data;
56};
57
58#endif
59/*- End of file ------------------------------------------------------------*/
t4_t6_encode_state_s
Definition private/t4_t6_encode.h:33
t4_t6_encode_state_s::min_bits_per_row
int min_bits_per_row
The minimum number of encoded bits per row. This is a timing thing for hardware FAX machines.
Definition private/t4_t6_encode.h:36
t4_t6_encode_state_s::rows_to_next_1d_row
int rows_to_next_1d_row
Number of rows left that can be 2D encoded, before a 1D encoded row must be used.
Definition private/t4_t6_encode.h:42
t4_t6_encode_state_s::row_read_user_data
void * row_read_user_data
Opaque pointer passed to row_read_handler.
Definition private/t4_t6_encode.h:55
t4_t6_encode_state_s::max_rows_to_next_1d_row
int max_rows_to_next_1d_row
The current maximum contiguous rows that may be 2D encoded.
Definition private/t4_t6_encode.h:38
t4_t6_encode_state_s::bit_pos
int bit_pos
Pointer to the byte containing the next image bit to transmit.
Definition private/t4_t6_encode.h:48
t4_t6_encode_state_s::ref_steps
int ref_steps
The number of runs currently in the reference row.
Definition private/t4_t6_encode.h:45
t4_t6_encode_state_s::row_read_handler
t4_row_read_handler_t row_read_handler
Callback function to read a row of pixels from the image source.
Definition private/t4_t6_encode.h:53
t4_t6_encode_state_s::bit_ptr
int bit_ptr
Pointer to the bit within the byte containing the next image bit to transmit.
Definition private/t4_t6_encode.h:50
t4_row_read_handler_t
int(* t4_row_read_handler_t)(void *user_data, uint8_t buf[], size_t len)
Definition t4_tx.h:36