Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
0b6c5321
提交
0b6c5321
authored
5月 29, 2013
作者:
Steve Underwood
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Moves towards colour FAX
上级
26d5a6eb
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
238 行增加
和
162 行删除
+238
-162
image_translate.c
libs/spandsp/src/image_translate.c
+0
-1
expose.h
libs/spandsp/src/spandsp/expose.h
+2
-0
t30.h
libs/spandsp/src/spandsp/private/t30.h
+5
-1
t30_dis_dtc_dcs_bits.h
libs/spandsp/src/spandsp/private/t30_dis_dtc_dcs_bits.h
+8
-0
t42.h
libs/spandsp/src/spandsp/private/t42.h
+55
-2
t43.h
libs/spandsp/src/spandsp/private/t43.h
+13
-4
t4_rx.h
libs/spandsp/src/spandsp/private/t4_rx.h
+7
-9
t4_tx.h
libs/spandsp/src/spandsp/private/t4_tx.h
+16
-13
t30.c
libs/spandsp/src/t30.c
+22
-22
t43.c
libs/spandsp/src/t43.c
+3
-3
t4_rx.c
libs/spandsp/src/t4_rx.c
+43
-43
t4_t6_decode.c
libs/spandsp/src/t4_t6_decode.c
+1
-1
t4_tx.c
libs/spandsp/src/t4_tx.c
+63
-63
没有找到文件。
libs/spandsp/src/image_translate.c
浏览文件 @
0b6c5321
...
...
@@ -48,7 +48,6 @@
#include <math.h>
#endif
#include "floating_fudge.h"
#include <jpeglib.h>
#include <tiffio.h>
#include <assert.h>
...
...
libs/spandsp/src/spandsp/expose.h
浏览文件 @
0b6c5321
...
...
@@ -31,6 +31,8 @@
#if !defined(_SPANDSP_EXPOSE_H_)
#define _SPANDSP_EXPOSE_H_
#include <jpeglib.h>
#include <spandsp/private/logging.h>
#include <spandsp/private/schedule.h>
#include <spandsp/private/bitstream.h>
...
...
libs/spandsp/src/spandsp/private/t30.h
浏览文件 @
0b6c5321
...
...
@@ -231,7 +231,11 @@ struct t30_state_s
/*! \brief The common group of supported image sizes. */
int
mutual_image_sizes
;
/*! \brief The image coding being used on the line. */
int
line_encoding
;
int
line_compression
;
/*! \brief The image type being used on the line. */
int
line_image_type
;
/*! \brief The width code for the image on the line. */
int
line_width_code
;
/*! \brief The current DCS message minimum scan time code. */
uint8_t
min_scan_time_code
;
/*! \brief The X direction resolution of the current image, in pixels per metre. */
...
...
libs/spandsp/src/spandsp/private/t30_dis_dtc_dcs_bits.h
浏览文件 @
0b6c5321
...
...
@@ -70,6 +70,14 @@
#define T30_DCS_BIT_RECEIVE_FAX_DOCUMENT 10
/* Bits 11, 12, 13, 14 - modem type */
#define T30_DIS_BIT_MODEM_TYPE_1 11
#define T30_DCS_BIT_MODEM_TYPE_1 11
#define T30_DIS_BIT_MODEM_TYPE_2 12
#define T30_DCS_BIT_MODEM_TYPE_2 12
#define T30_DIS_BIT_MODEM_TYPE_3 13
#define T30_DCS_BIT_MODEM_TYPE_3 13
#define T30_DIS_BIT_MODEM_TYPE_4 14
#define T30_DCS_BIT_MODEM_TYPE_4 14
#define T30_DIS_BIT_200_200_CAPABLE 15
#define T30_DCS_BIT_200_200 15
...
...
libs/spandsp/src/spandsp/private/t42.h
浏览文件 @
0b6c5321
...
...
@@ -26,6 +26,9 @@
#if !defined(_SPANDSP_PRIVATE_T42_H_)
#define _SPANDSP_PRIVATE_T42_H_
#include <setjmp.h>
#include <jpeglib.h>
struct
lab_params_s
{
/* Lab gamut */
...
...
@@ -50,11 +53,39 @@ struct t42_encode_state_s
t4_row_read_handler_t
row_read_handler
;
/*! \brief Opaque pointer passed to row_read_handler. */
void
*
row_read_user_data
;
uint32_t
image_width
;
uint32_t
image_length
;
uint16_t
samples_per_pixel
;
int
image_type
;
int
no_subsampling
;
int
itu_ycc
;
int
quality
;
/* The X or Y direction resolution, in pixels per inch */
int
spatial_resolution
;
lab_params_t
lab_params
;
lab_params_t
lab
;
uint8_t
illuminant_code
[
4
];
int
illuminant_colour_temperature
;
/*! \brief The size of the compressed image, in bytes. */
int
compressed_image_size
;
int
compressed_image_ptr
;
int
buf_size
;
uint8_t
*
compressed_buf
;
FILE
*
out
;
#if defined(HAVE_OPEN_MEMSTREAM)
size_t
outsize
;
#endif
jmp_buf
escape
;
char
error_message
[
JMSG_LENGTH_MAX
];
struct
jpeg_compress_struct
compressor
;
JSAMPROW
scan_line_out
;
JSAMPROW
scan_line_in
;
/*! \brief Error and flow logging control */
logging_state_t
logging
;
...
...
@@ -73,8 +104,19 @@ struct t42_decode_state_s
void
*
comment_user_data
;
/*! The maximum length of comment to be passed to the comment handler */
uint32_t
max_comment_len
;
uint32_t
image_width
;
uint32_t
image_length
;
uint16_t
samples_per_pixel
;
int
image_type
;
int
itu_ycc
;
/* The X or Y direction resolution, in pixels per inch */
int
spatial_resolution
;
lab_params_t
lab
;
lab_params_t
lab_params
;
uint8_t
illuminant_code
[
4
];
int
illuminant_colour_temperature
;
/*! The contents for a COMMENT marker segment, to be added to the
image at the next opportunity. This is set to NULL when nothing is
...
...
@@ -89,6 +131,17 @@ struct t42_decode_state_s
int
buf_size
;
uint8_t
*
compressed_buf
;
FILE
*
in
;
jmp_buf
escape
;
char
error_message
[
JMSG_LENGTH_MAX
];
struct
jpeg_decompress_struct
decompressor
;
/*! Flag that the data to be decoded has run out. */
int
end_of_data
;
JSAMPROW
scan_line_out
;
JSAMPROW
scan_line_in
;
/*! \brief Error and flow logging control */
logging_state_t
logging
;
};
...
...
libs/spandsp/src/spandsp/private/t43.h
浏览文件 @
0b6c5321
...
...
@@ -37,17 +37,21 @@ struct t43_encode_state_s
struct
lab_params_s
lab
;
struct
t85_encode_state_s
t85
;
int
image_type
;
int
bit_planes
[
4
];
int
colour_map_entries
;
uint8_t
colour_map
[
3
*
256
];
uint8_t
illuminant_code
[
4
];
int
illuminant_colour_temperature
;
/*! The width of the full image, in pixels */
uint32_t
xd
;
/*! The height of the full image, in pixels */
uint32_t
yd
;
int
x_resolution
;
int
y
_resolution
;
/* The X or Y direction resolution, in pixels per inch */
int
spatial
_resolution
;
/*! \brief Error and flow logging control */
logging_state_t
logging
;
...
...
@@ -64,6 +68,7 @@ struct t43_decode_state_s
struct
lab_params_s
lab
;
struct
t85_decode_state_s
t85
;
int
image_type
;
int
bit_planes
[
4
];
uint8_t
bit_plane_mask
;
int
current_bit_plane
;
...
...
@@ -72,8 +77,12 @@ struct t43_decode_state_s
int
colour_map_entries
;
uint8_t
colour_map
[
3
*
256
];
int
x_resolution
;
int
y_resolution
;
uint8_t
illuminant_code
[
4
];
int
illuminant_colour_temperature
;
/* The X or Y direction resolution, in pixels per inch */
int
spatial_resolution
;
int
samples_per_pixel
;
uint8_t
*
buf
;
int
ptr
;
...
...
libs/spandsp/src/spandsp/private/t4_rx.h
浏览文件 @
0b6c5321
...
...
@@ -39,7 +39,7 @@ typedef struct
/*! Image type - bilevel, gray, colour */
int
image_type
;
/*! \brief The compression type for output to the TIFF file. */
int
output_encoding
;
int
compression
;
/*! \brief The TIFF photometric setting for the current page. */
uint16_t
photo_metric
;
/*! \brief The TIFF fill order setting for the current page. */
...
...
@@ -65,6 +65,12 @@ typedef struct
*/
typedef
struct
{
/*! \brief The type of compression used on the wire. */
int
compression
;
/*! \brief The width of the current page, in pixels. */
uint32_t
image_width
;
/*! \brief The length of the current page, in pixels. */
uint32_t
image_length
;
/*! \brief Column-to-column (X) resolution in pixels per metre. */
int
x_resolution
;
/*! \brief Row-to-row (Y) resolution in pixels per metre. */
...
...
@@ -104,14 +110,6 @@ struct t4_rx_state_s
/*! \brief The size of the compressed image on the line side, in bits. */
int
line_image_size
;
/*! \brief The type of compression used between the FAX machines. */
int
line_encoding
;
/*! \brief The width of the current page, in pixels. */
uint32_t
image_width
;
/*! \brief The length of the current page, in pixels. */
uint32_t
image_length
;
union
{
t4_t6_decode_state_t
t4_t6
;
...
...
libs/spandsp/src/spandsp/private/t4_tx.h
浏览文件 @
0b6c5321
...
...
@@ -58,13 +58,15 @@ typedef struct
int
row
;
/*! \brief Width of the image in the file. */
in
t
image_width
;
uint32_
t
image_width
;
/*! \brief Length of the image in the file. */
in
t
image_length
;
uint32_
t
image_length
;
/*! \brief Column-to-column (X) resolution in pixels per metre of the image in the file. */
int
image_x_resolution
;
/*! \brief Row-to-row (Y) resolution in pixels per metre of the image in the file. */
int
image_y_resolution
;
/*! \brief Code for the combined X and Y resolution of the image in the file. */
int
resolution_code
;
/*! \brief Row counter used when the image is resized or dithered flat. */
int
raw_row
;
...
...
@@ -78,14 +80,23 @@ typedef struct
*/
typedef
struct
{
/*! \brief The type of compression used on the wire. */
int
compression
;
/*! \brief Image type - bi-level, gray, colour, etc. */
int
image_type
;
/*! \brief The width code for the image on the line side. */
int
width_code
;
/*! \brief The width of the current page on the wire, in pixels. */
uint32_t
image_width
;
/*! \brief The length of the current page on the wire, in pixels. */
uint32_t
image_length
;
/*! \brief Column-to-column (X) resolution in pixels per metre on the wire. */
int
x_resolution
;
/*! \brief Row-to-row (Y) resolution in pixels per metre on the wire. */
int
y_resolution
;
/*! \brief Code for the combined X and Y resolution o
f the image in the fil
e. */
/*! \brief Code for the combined X and Y resolution o
n the wir
e. */
int
resolution_code
;
/*! \brief Image type - bi-level, gray, colour, etc. */
int
image_type
;
}
t4_tx_metadata_t
;
/*!
...
...
@@ -99,19 +110,11 @@ struct t4_tx_state_s
/*! \brief Opaque pointer passed to row_read_handler. */
void
*
row_handler_user_data
;
/*! \brief The type of compression used between the FAX machines. */
int
line_encoding
;
/*! \brief When superfine and fine resolution images need to be squahed vertically
to a lower resolution, this value sets the number of source rows which
must be squashed to form each row on the wire. */
int
row_squashing_ratio
;
/*! \brief The width of the current page, in pixels. */
uint32_t
image_width
;
/*! \brief The length of the current page, in pixels. */
uint32_t
image_length
;
/*! \brief The size of the compressed image on the line side, in bits. */
int
line_image_size
;
...
...
libs/spandsp/src/t30.c
浏览文件 @
0b6c5321
...
...
@@ -525,7 +525,7 @@ static int rx_start_page(t30_state_t *s)
t4_rx_set_vendor
(
&
s
->
t4
.
rx
,
s
->
vendor
);
t4_rx_set_model
(
&
s
->
t4
.
rx
,
s
->
model
);
t4_rx_set_rx_encoding
(
&
s
->
t4
.
rx
,
s
->
line_
encoding
);
t4_rx_set_rx_encoding
(
&
s
->
t4
.
rx
,
s
->
line_
compression
);
t4_rx_set_x_resolution
(
&
s
->
t4
.
rx
,
s
->
x_resolution
);
t4_rx_set_y_resolution
(
&
s
->
t4
.
rx
,
s
->
y_resolution
);
...
...
@@ -1455,7 +1455,7 @@ static int build_dcs(t30_state_t *s)
/* Select the compression to use. */
use_bilevel
=
TRUE
;
switch
(
s
->
line_
encoding
)
switch
(
s
->
line_
compression
)
{
case
T4_COMPRESSION_T4_1D
:
/* There is nothing to set to select this encoding. */
...
...
@@ -2053,7 +2053,7 @@ static int analyze_rx_dcs(t30_state_t *s, const uint8_t *msg, int len)
s
->
x_resolution
=
-
1
;
s
->
y_resolution
=
-
1
;
s
->
current_page_resolution
=
0
;
s
->
line_
encoding
=
-
1
;
s
->
line_
compression
=
-
1
;
x
=
-
1
;
if
(
test_ctrl_bit
(
dcs_frame
,
T30_DCS_BIT_T81_MODE
)
||
...
...
@@ -2157,22 +2157,22 @@ static int analyze_rx_dcs(t30_state_t *s, const uint8_t *msg, int len)
if
(
test_ctrl_bit
(
dcs_frame
,
T30_DCS_BIT_T81_MODE
))
{
if
((
s
->
supported_compressions
&
T4_SUPPORT_COMPRESSION_T42_T81
))
s
->
line_
encoding
=
T4_COMPRESSION_T42_T81
;
s
->
line_
compression
=
T4_COMPRESSION_T42_T81
;
}
else
if
(
test_ctrl_bit
(
dcs_frame
,
T30_DCS_BIT_T43_MODE
))
{
if
((
s
->
supported_compressions
&
T4_SUPPORT_COMPRESSION_T43
))
s
->
line_
encoding
=
T4_COMPRESSION_T43
;
s
->
line_
compression
=
T4_COMPRESSION_T43
;
}
else
if
(
test_ctrl_bit
(
dcs_frame
,
T30_DCS_BIT_T45_MODE
))
{
if
((
s
->
supported_compressions
&
T4_SUPPORT_COMPRESSION_T45
))
s
->
line_
encoding
=
T4_COMPRESSION_T45
;
s
->
line_
compression
=
T4_COMPRESSION_T45
;
}
else
if
(
test_ctrl_bit
(
dcs_frame
,
T30_DCS_BIT_SYCC_T81_MODE
))
{
if
((
s
->
supported_compressions
&
T4_SUPPORT_COMPRESSION_SYCC_T81
))
s
->
line_
encoding
=
T4_COMPRESSION_SYCC_T81
;
s
->
line_
compression
=
T4_COMPRESSION_SYCC_T81
;
}
}
else
...
...
@@ -2333,41 +2333,41 @@ static int analyze_rx_dcs(t30_state_t *s, const uint8_t *msg, int len)
test_ctrl_bit
(
dcs_frame
,
T30_DCS_BIT_T88_MODE_3
))
{
if
((
s
->
supported_compressions
&
T4_SUPPORT_COMPRESSION_T88
))
s
->
line_
encoding
=
T4_COMPRESSION_T88
;
s
->
line_
compression
=
T4_COMPRESSION_T88
;
}
if
(
test_ctrl_bit
(
dcs_frame
,
T30_DCS_BIT_T85_L0_MODE
))
{
if
((
s
->
supported_compressions
&
T4_SUPPORT_COMPRESSION_T85_L0
))
s
->
line_
encoding
=
T4_COMPRESSION_T85_L0
;
s
->
line_
compression
=
T4_COMPRESSION_T85_L0
;
}
else
if
(
test_ctrl_bit
(
dcs_frame
,
T30_DCS_BIT_T85_MODE
))
{
if
((
s
->
supported_compressions
&
T4_SUPPORT_COMPRESSION_T85
))
s
->
line_
encoding
=
T4_COMPRESSION_T85
;
s
->
line_
compression
=
T4_COMPRESSION_T85
;
}
else
if
(
test_ctrl_bit
(
dcs_frame
,
T30_DCS_BIT_T6_MODE
))
{
if
((
s
->
supported_compressions
&
T4_SUPPORT_COMPRESSION_T6
))
s
->
line_
encoding
=
T4_COMPRESSION_T6
;
s
->
line_
compression
=
T4_COMPRESSION_T6
;
}
else
if
(
test_ctrl_bit
(
dcs_frame
,
T30_DCS_BIT_2D_MODE
))
{
if
((
s
->
supported_compressions
&
T4_SUPPORT_COMPRESSION_T4_2D
))
s
->
line_
encoding
=
T4_COMPRESSION_T4_2D
;
s
->
line_
compression
=
T4_COMPRESSION_T4_2D
;
}
else
{
if
((
s
->
supported_compressions
&
T4_SUPPORT_COMPRESSION_T4_1D
))
s
->
line_
encoding
=
T4_COMPRESSION_T4_1D
;
s
->
line_
compression
=
T4_COMPRESSION_T4_1D
;
}
}
if
(
s
->
line_
encoding
==
-
1
)
if
(
s
->
line_
compression
==
-
1
)
{
t30_set_status
(
s
,
T30_ERR_INCOMPATIBLE
);
return
-
1
;
}
span_log
(
&
s
->
logging
,
SPAN_LOG_FLOW
,
"Far end selected compression %s (%d)
\n
"
,
t4_encoding_to_str
(
s
->
line_
encoding
),
s
->
line_encoding
);
span_log
(
&
s
->
logging
,
SPAN_LOG_FLOW
,
"Far end selected compression %s (%d)
\n
"
,
t4_encoding_to_str
(
s
->
line_
compression
),
s
->
line_compression
);
if
(
x
<
0
)
{
...
...
@@ -2678,7 +2678,7 @@ static int start_sending_document(t30_state_t *s)
}
s
->
operation_in_progress
=
OPERATION_IN_PROGRESS_T4_TX
;
t4_tx_get_pages_in_file
(
&
s
->
t4
.
tx
);
t4_tx_set_tx_encoding
(
&
s
->
t4
.
tx
,
s
->
line_
encoding
);
t4_tx_set_tx_encoding
(
&
s
->
t4
.
tx
,
s
->
line_
compression
);
t4_tx_set_local_ident
(
&
s
->
t4
.
tx
,
s
->
tx_info
.
ident
);
t4_tx_set_header_info
(
&
s
->
t4
.
tx
,
s
->
header_info
);
if
(
s
->
use_own_tz
)
...
...
@@ -2778,17 +2778,17 @@ static int process_rx_dis_dtc(t30_state_t *s, const uint8_t *msg, int len)
/* Choose a compression scheme from amongst those mutually available */
if
((
s
->
mutual_compressions
&
T4_SUPPORT_COMPRESSION_T85_L0
))
s
->
line_
encoding
=
T4_COMPRESSION_T85_L0
;
s
->
line_
compression
=
T4_COMPRESSION_T85_L0
;
else
if
((
s
->
mutual_compressions
&
T4_SUPPORT_COMPRESSION_T85
))
s
->
line_
encoding
=
T4_COMPRESSION_T85
;
s
->
line_
compression
=
T4_COMPRESSION_T85
;
else
if
((
s
->
mutual_compressions
&
T4_SUPPORT_COMPRESSION_T6
))
s
->
line_
encoding
=
T4_COMPRESSION_T6
;
s
->
line_
compression
=
T4_COMPRESSION_T6
;
else
if
((
s
->
mutual_compressions
&
T4_SUPPORT_COMPRESSION_T4_2D
))
s
->
line_
encoding
=
T4_COMPRESSION_T4_2D
;
s
->
line_
compression
=
T4_COMPRESSION_T4_2D
;
else
s
->
line_
encoding
=
T4_COMPRESSION_T4_1D
;
s
->
line_
compression
=
T4_COMPRESSION_T4_1D
;
span_log
(
&
s
->
logging
,
SPAN_LOG_FLOW
,
"Choose compression %s (%d)
\n
"
,
t4_encoding_to_str
(
s
->
line_
encoding
),
s
->
line_encoding
);
span_log
(
&
s
->
logging
,
SPAN_LOG_FLOW
,
"Choose compression %s (%d)
\n
"
,
t4_encoding_to_str
(
s
->
line_
compression
),
s
->
line_compression
);
if
(
s
->
phase_b_handler
)
{
...
...
libs/spandsp/src/t43.c
浏览文件 @
0b6c5321
...
...
@@ -146,7 +146,7 @@ SPAN_DECLARE(int) t43_create_header(t43_decode_state_t *s, uint8_t data[], size_
pos
+=
6
;
unpack_16
(
&
data
[
pos
],
1997
);
pos
+=
2
;
unpack_16
(
&
data
[
pos
],
s
->
x
_resolution
);
unpack_16
(
&
data
[
pos
],
s
->
spatial
_resolution
);
pos
+=
2
;
/* JBIG coding method (0) is the only possible value here */
data
[
pos
]
=
0
;
...
...
@@ -523,7 +523,7 @@ static int t43_analyse_header(t43_decode_state_t *s, const uint8_t data[], size_
if
(
seg
>=
6
+
10
)
{
val
[
0
]
=
pack_16
(
&
data
[
pos
+
6
+
0
]);
s
->
x
_resolution
=
pack_16
(
&
data
[
pos
+
6
+
2
]);
s
->
spatial
_resolution
=
pack_16
(
&
data
[
pos
+
6
+
2
]);
val
[
2
]
=
data
[
pos
+
6
+
4
];
val
[
3
]
=
data
[
pos
+
6
+
5
];
s
->
bit_planes
[
0
]
=
data
[
pos
+
6
+
6
];
...
...
@@ -534,7 +534,7 @@ static int t43_analyse_header(t43_decode_state_t *s, const uint8_t data[], size_
SPAN_LOG_FLOW
,
"Version %d, resolution %.2fdpi, coding method %d, type %s (%d), bit planes %d,%d,%d,%d
\n
"
,
val
[
0
],
s
->
x
_resolution
/
100
.
0
f
,
s
->
spatial
_resolution
/
100
.
0
f
,
val
[
2
],
t43_image_type_to_str
(
val
[
3
]),
val
[
3
],
...
...
libs/spandsp/src/t4_rx.c
浏览文件 @
0b6c5321
差异被折叠。
点击展开。
libs/spandsp/src/t4_t6_decode.c
浏览文件 @
0b6c5321
...
...
@@ -60,8 +60,8 @@
#include "config.h"
#endif
#include <stdlib.h>
#include <inttypes.h>
#include <stdlib.h>
#include <limits.h>
#include <stdio.h>
#include <fcntl.h>
...
...
libs/spandsp/src/t4_tx.c
浏览文件 @
0b6c5321
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论