Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
2ff6327c
提交
2ff6327c
authored
9月 06, 2012
作者:
Steve Underwood
提交者:
Ken Rice
9月 11, 2012
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Some tweaks to spandsp tests. Make spandsp write TIFF files more like the
TIFF/FX spec says, even though no software seems to care.
上级
35aaa693
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
36 行增加
和
25 行删除
+36
-25
t31.c
libs/spandsp/src/t31.c
+17
-17
t4_rx.c
libs/spandsp/src/t4_rx.c
+8
-4
generate_etsi_300_242_pages.c
.../spandsp/test-data/etsi/fax/generate_etsi_300_242_pages.c
+4
-2
generate_dithered_tif.c
libs/spandsp/test-data/itu/fax/generate_dithered_tif.c
+1
-0
generate_sized_pages.c
libs/spandsp/test-data/itu/fax/generate_sized_pages.c
+1
-0
generate_striped_pages.c
libs/spandsp/test-data/itu/fax/generate_striped_pages.c
+1
-0
t42_tests.c
libs/spandsp/tests/t42_tests.c
+4
-2
没有找到文件。
libs/spandsp/src/t31.c
浏览文件 @
2ff6327c
...
@@ -1689,6 +1689,16 @@ static int restart_modem(t31_state_t *s, int new_modem)
...
@@ -1689,6 +1689,16 @@ static int restart_modem(t31_state_t *s, int new_modem)
}
}
s
->
at_state
.
transmit
=
TRUE
;
s
->
at_state
.
transmit
=
TRUE
;
break
;
break
;
case
FAX_MODEM_V21_RX
:
if
(
s
->
t38_mode
)
{
}
else
{
t31_v21_rx
(
s
);
fax_modems_set_rx_handler
(
t
,
(
span_rx_handler_t
)
&
fsk_rx
,
&
t
->
v21_rx
,
(
span_rx_fillin_handler_t
)
&
fsk_rx_fillin
,
&
t
->
v21_rx
);
}
break
;
case
FAX_MODEM_V21_TX
:
case
FAX_MODEM_V21_TX
:
if
(
s
->
t38_mode
)
if
(
s
->
t38_mode
)
{
{
...
@@ -1712,15 +1722,16 @@ static int restart_modem(t31_state_t *s, int new_modem)
...
@@ -1712,15 +1722,16 @@ static int restart_modem(t31_state_t *s, int new_modem)
s
->
dled
=
FALSE
;
s
->
dled
=
FALSE
;
s
->
at_state
.
transmit
=
TRUE
;
s
->
at_state
.
transmit
=
TRUE
;
break
;
break
;
case
FAX_MODEM_V21_RX
:
case
FAX_MODEM_V17_RX
:
if
(
s
->
t38_mode
)
case
FAX_MODEM_V27TER_RX
:
{
case
FAX_MODEM_V29_RX
:
}
if
(
!
s
->
t38_mode
)
else
{
{
fax_modems_start_fast_modem
(
t
,
s
->
modem
,
s
->
bit_rate
,
s
->
short_train
,
use_hdlc
);
/* Allow for +FCERROR/+FRH:3 */
t31_v21_rx
(
s
);
t31_v21_rx
(
s
);
fax_modems_set_rx_handler
(
t
,
(
span_rx_handler_t
)
&
fsk_rx
,
&
t
->
v21_rx
,
(
span_rx_fillin_handler_t
)
&
fsk_rx_fillin
,
&
t
->
v21_rx
);
}
}
s
->
at_state
.
transmit
=
FALSE
;
break
;
break
;
case
FAX_MODEM_V17_TX
:
case
FAX_MODEM_V17_TX
:
if
(
s
->
t38_mode
)
if
(
s
->
t38_mode
)
...
@@ -1755,17 +1766,6 @@ static int restart_modem(t31_state_t *s, int new_modem)
...
@@ -1755,17 +1766,6 @@ static int restart_modem(t31_state_t *s, int new_modem)
s
->
tx
.
data_started
=
FALSE
;
s
->
tx
.
data_started
=
FALSE
;
s
->
at_state
.
transmit
=
TRUE
;
s
->
at_state
.
transmit
=
TRUE
;
break
;
break
;
case
FAX_MODEM_V17_RX
:
case
FAX_MODEM_V27TER_RX
:
case
FAX_MODEM_V29_RX
:
if
(
!
s
->
t38_mode
)
{
fax_modems_start_fast_modem
(
t
,
s
->
modem
,
s
->
bit_rate
,
s
->
short_train
,
use_hdlc
);
/* Allow for +FCERROR/+FRH:3 */
t31_v21_rx
(
s
);
}
s
->
at_state
.
transmit
=
FALSE
;
break
;
case
FAX_MODEM_V27TER_TX
:
case
FAX_MODEM_V27TER_TX
:
if
(
s
->
t38_mode
)
if
(
s
->
t38_mode
)
{
{
...
...
libs/spandsp/src/t4_rx.c
浏览文件 @
2ff6327c
...
@@ -172,7 +172,7 @@ static int set_tiff_directory_info(t4_rx_state_t *s)
...
@@ -172,7 +172,7 @@ static int set_tiff_directory_info(t4_rx_state_t *s)
}
}
#if defined(SPANDSP_SUPPORT_TIFF_FX)
#if defined(SPANDSP_SUPPORT_TIFF_FX)
TIFFSetField
(
t
->
tiff_file
,
TIFFTAG_PROFILETYPE
,
PROFILETYPE_G3_FAX
);
TIFFSetField
(
t
->
tiff_file
,
TIFFTAG_PROFILETYPE
,
PROFILETYPE_G3_FAX
);
TIFFSetField
(
t
->
tiff_file
,
TIFFTAG_FAXPROFILE
,
FAXPROFILE_
S
);
TIFFSetField
(
t
->
tiff_file
,
TIFFTAG_FAXPROFILE
,
FAXPROFILE_
F
);
TIFFSetField
(
t
->
tiff_file
,
TIFFTAG_CODINGMETHODS
,
CODINGMETHODS_T4_1D
|
CODINGMETHODS_T4_2D
|
CODINGMETHODS_T6
);
TIFFSetField
(
t
->
tiff_file
,
TIFFTAG_CODINGMETHODS
,
CODINGMETHODS_T4_1D
|
CODINGMETHODS_T4_2D
|
CODINGMETHODS_T6
);
TIFFSetField
(
t
->
tiff_file
,
TIFFTAG_VERSIONYEAR
,
"1998"
);
TIFFSetField
(
t
->
tiff_file
,
TIFFTAG_VERSIONYEAR
,
"1998"
);
/* TIFFSetField(t->tiff_file, TIFFTAG_MODENUMBER, 0); */
/* TIFFSetField(t->tiff_file, TIFFTAG_MODENUMBER, 0); */
...
@@ -304,10 +304,14 @@ static int write_tiff_image(t4_rx_state_t *s)
...
@@ -304,10 +304,14 @@ static int write_tiff_image(t4_rx_state_t *s)
return
-
1
;
return
-
1
;
/* Set up the TIFF directory info... */
/* Set up the TIFF directory info... */
set_tiff_directory_info
(
s
);
set_tiff_directory_info
(
s
);
/* ...and then write the image... */
/* ...Put the directory in the file before the image data, to get them in the order specified
for TIFF/F files... */
if
(
!
TIFFCheckpointDirectory
(
t
->
tiff_file
))
span_log
(
&
s
->
logging
,
SPAN_LOG_WARNING
,
"%s: Failed to checkpoint directory for page %d.
\n
"
,
t
->
file
,
s
->
current_page
);
/* ...and write out the image... */
if
(
TIFFWriteEncodedStrip
(
t
->
tiff_file
,
0
,
t
->
image_buffer
,
t
->
image_size
)
<
0
)
if
(
TIFFWriteEncodedStrip
(
t
->
tiff_file
,
0
,
t
->
image_buffer
,
t
->
image_size
)
<
0
)
span_log
(
&
s
->
logging
,
SPAN_LOG_WARNING
,
"%s: Error writing TIFF strip.
\n
"
,
t
->
file
);
span_log
(
&
s
->
logging
,
SPAN_LOG_WARNING
,
"%s: Error writing TIFF strip.
\n
"
,
t
->
file
);
/* ...then the directory entry, and libtiff is happy. */
/* ...then
finalise
the directory entry, and libtiff is happy. */
if
(
!
TIFFWriteDirectory
(
t
->
tiff_file
))
if
(
!
TIFFWriteDirectory
(
t
->
tiff_file
))
span_log
(
&
s
->
logging
,
SPAN_LOG_WARNING
,
"%s: Failed to write directory for page %d.
\n
"
,
t
->
file
,
s
->
current_page
);
span_log
(
&
s
->
logging
,
SPAN_LOG_WARNING
,
"%s: Failed to write directory for page %d.
\n
"
,
t
->
file
,
s
->
current_page
);
#if defined(SPANDSP_SUPPORT_TIFF_FX)
#if defined(SPANDSP_SUPPORT_TIFF_FX)
...
@@ -316,7 +320,7 @@ static int write_tiff_image(t4_rx_state_t *s)
...
@@ -316,7 +320,7 @@ static int write_tiff_image(t4_rx_state_t *s)
if
(
!
TIFFCreateCustomDirectory
(
t
->
tiff_file
,
&
tiff_fx_field_array
))
if
(
!
TIFFCreateCustomDirectory
(
t
->
tiff_file
,
&
tiff_fx_field_array
))
{
{
TIFFSetField
(
t
->
tiff_file
,
TIFFTAG_FAXPROFILE
,
PROFILETYPE_G3_FAX
);
TIFFSetField
(
t
->
tiff_file
,
TIFFTAG_FAXPROFILE
,
PROFILETYPE_G3_FAX
);
TIFFSetField
(
t
->
tiff_file
,
TIFFTAG_PROFILETYPE
,
FAXPROFILE_
S
);
TIFFSetField
(
t
->
tiff_file
,
TIFFTAG_PROFILETYPE
,
FAXPROFILE_
F
);
TIFFSetField
(
t
->
tiff_file
,
TIFFTAG_VERSIONYEAR
,
"1998"
);
TIFFSetField
(
t
->
tiff_file
,
TIFFTAG_VERSIONYEAR
,
"1998"
);
offset
=
0
;
offset
=
0
;
...
...
libs/spandsp/test-data/etsi/fax/generate_etsi_300_242_pages.c
浏览文件 @
2ff6327c
...
@@ -623,6 +623,10 @@ int main(int argc, char *argv[])
...
@@ -623,6 +623,10 @@ int main(int argc, char *argv[])
tm
->
tm_sec
);
tm
->
tm_sec
);
TIFFSetField
(
tiff_file
,
TIFFTAG_DATETIME
,
buf
);
TIFFSetField
(
tiff_file
,
TIFFTAG_DATETIME
,
buf
);
image_length
=
sequence
[
i
].
length
;
image_length
=
sequence
[
i
].
length
;
TIFFSetField
(
tiff_file
,
TIFFTAG_PAGENUMBER
,
0
,
1
);
TIFFSetField
(
tiff_file
,
TIFFTAG_CLEANFAXDATA
,
CLEANFAXDATA_CLEAN
);
TIFFSetField
(
tiff_file
,
TIFFTAG_IMAGELENGTH
,
image_length
);
TIFFCheckpointDirectory
(
tiff_file
);
/* Write the image first.... */
/* Write the image first.... */
switch
(
sequence
[
i
].
type
)
switch
(
sequence
[
i
].
type
)
...
@@ -662,8 +666,6 @@ int main(int argc, char *argv[])
...
@@ -662,8 +666,6 @@ int main(int argc, char *argv[])
}
}
/* ....then the directory entry, and libtiff is happy. */
/* ....then the directory entry, and libtiff is happy. */
TIFFSetField
(
tiff_file
,
TIFFTAG_IMAGELENGTH
,
image_length
);
TIFFSetField
(
tiff_file
,
TIFFTAG_IMAGELENGTH
,
image_length
);
TIFFSetField
(
tiff_file
,
TIFFTAG_PAGENUMBER
,
0
,
1
);
TIFFSetField
(
tiff_file
,
TIFFTAG_CLEANFAXDATA
,
CLEANFAXDATA_CLEAN
);
TIFFWriteDirectory
(
tiff_file
);
TIFFWriteDirectory
(
tiff_file
);
}
}
...
...
libs/spandsp/test-data/itu/fax/generate_dithered_tif.c
浏览文件 @
2ff6327c
...
@@ -137,6 +137,7 @@ int main(int argc, char *argv[])
...
@@ -137,6 +137,7 @@ int main(int argc, char *argv[])
TIFFSetField
(
tiff_file
,
TIFFTAG_PAGENUMBER
,
0
,
1
);
TIFFSetField
(
tiff_file
,
TIFFTAG_PAGENUMBER
,
0
,
1
);
TIFFSetField
(
tiff_file
,
TIFFTAG_CLEANFAXDATA
,
CLEANFAXDATA_CLEAN
);
TIFFSetField
(
tiff_file
,
TIFFTAG_CLEANFAXDATA
,
CLEANFAXDATA_CLEAN
);
TIFFSetField
(
tiff_file
,
TIFFTAG_IMAGEWIDTH
,
image_width
);
TIFFSetField
(
tiff_file
,
TIFFTAG_IMAGEWIDTH
,
image_width
);
TIFFCheckpointDirectory
(
tiff_file
);
/* Write the image first.... */
/* Write the image first.... */
for
(
row
=
0
;
row
<
image_length
;
row
++
)
for
(
row
=
0
;
row
<
image_length
;
row
++
)
...
...
libs/spandsp/test-data/itu/fax/generate_sized_pages.c
浏览文件 @
2ff6327c
...
@@ -367,6 +367,7 @@ int main(int argc, char *argv[])
...
@@ -367,6 +367,7 @@ int main(int argc, char *argv[])
TIFFSetField
(
tiff_file
,
TIFFTAG_PAGENUMBER
,
0
,
1
);
TIFFSetField
(
tiff_file
,
TIFFTAG_PAGENUMBER
,
0
,
1
);
TIFFSetField
(
tiff_file
,
TIFFTAG_CLEANFAXDATA
,
CLEANFAXDATA_CLEAN
);
TIFFSetField
(
tiff_file
,
TIFFTAG_CLEANFAXDATA
,
CLEANFAXDATA_CLEAN
);
TIFFSetField
(
tiff_file
,
TIFFTAG_IMAGEWIDTH
,
sequence
[
i
].
width
);
TIFFSetField
(
tiff_file
,
TIFFTAG_IMAGEWIDTH
,
sequence
[
i
].
width
);
TIFFCheckpointDirectory
(
tiff_file
);
/* Write the image first.... */
/* Write the image first.... */
for
(
row
=
0
;
row
<
sequence
[
i
].
length
;
row
++
)
for
(
row
=
0
;
row
<
sequence
[
i
].
length
;
row
++
)
...
...
libs/spandsp/test-data/itu/fax/generate_striped_pages.c
浏览文件 @
2ff6327c
...
@@ -103,6 +103,7 @@ int main(int argc, char *argv[])
...
@@ -103,6 +103,7 @@ int main(int argc, char *argv[])
TIFFSetField
(
tiff_file
,
TIFFTAG_IMAGEWIDTH
,
IMAGE_WIDTH
);
TIFFSetField
(
tiff_file
,
TIFFTAG_IMAGEWIDTH
,
IMAGE_WIDTH
);
TIFFSetField
(
tiff_file
,
TIFFTAG_IMAGELENGTH
,
IMAGE_LENGTH
);
TIFFSetField
(
tiff_file
,
TIFFTAG_IMAGELENGTH
,
IMAGE_LENGTH
);
TIFFSetField
(
tiff_file
,
TIFFTAG_PAGENUMBER
,
0
,
1
);
TIFFSetField
(
tiff_file
,
TIFFTAG_PAGENUMBER
,
0
,
1
);
TIFFCheckpointDirectory
(
tiff_file
);
image_size
=
IMAGE_WIDTH
*
ROWS_PER_STRIPE
/
8
;
image_size
=
IMAGE_WIDTH
*
ROWS_PER_STRIPE
/
8
;
memset
(
image_buffer
,
0x18
,
image_size
);
memset
(
image_buffer
,
0x18
,
image_size
);
...
...
libs/spandsp/tests/t42_tests.c
浏览文件 @
2ff6327c
...
@@ -46,7 +46,7 @@
...
@@ -46,7 +46,7 @@
#include "spandsp.h"
#include "spandsp.h"
#if defined(SPANDSP_SUPPORT_TIFF_FX)
#if defined(SPANDSP_SUPPORT_TIFF_FX)
//
#include <tif_dir.h>
#include <tif_dir.h>
#endif
#endif
//#define IN_FILE_NAME "../test-data/itu/t24/F21_200.TIF"
//#define IN_FILE_NAME "../test-data/itu/t24/F21_200.TIF"
...
@@ -156,7 +156,9 @@ int main(int argc, char *argv[])
...
@@ -156,7 +156,9 @@ int main(int argc, char *argv[])
logging
=
span_log_init
(
NULL
,
SPAN_LOG_FLOW
,
"T.42"
);
logging
=
span_log_init
(
NULL
,
SPAN_LOG_FLOW
,
"T.42"
);
#if defined(SPANDSP_SUPPORT_TIFF_FX)
TIFF_FX_init
();
TIFF_FX_init
();
#endif
set_lab_illuminant
(
&
lab_param
,
0
.
9638
f
,
1
.
0
f
,
0
.
8245
f
);
set_lab_illuminant
(
&
lab_param
,
0
.
9638
f
,
1
.
0
f
,
0
.
8245
f
);
set_lab_gamut
(
&
lab_param
,
0
,
100
,
-
85
,
85
,
-
75
,
125
,
FALSE
);
set_lab_gamut
(
&
lab_param
,
0
,
100
,
-
85
,
85
,
-
75
,
125
,
FALSE
);
...
@@ -189,7 +191,7 @@ int main(int argc, char *argv[])
...
@@ -189,7 +191,7 @@ int main(int argc, char *argv[])
YCbCrSubsampleHoriz
=
0
;
YCbCrSubsampleHoriz
=
0
;
YCbCrSubsampleVert
=
0
;
YCbCrSubsampleVert
=
0
;
TIFFGetField
(
tif
,
TIFFTAG_YCBCRSUBSAMPLING
,
&
YCbCrSubsampleHoriz
,
&
YCbCrSubsampleVert
);
TIFFGetField
(
tif
,
TIFFTAG_YCBCRSUBSAMPLING
,
&
YCbCrSubsampleHoriz
,
&
YCbCrSubsampleVert
);
planar_config
=
0
;
planar_config
=
PLANARCONFIG_CONTIG
;
TIFFGetField
(
tif
,
TIFFTAG_PLANARCONFIG
,
&
planar_config
);
TIFFGetField
(
tif
,
TIFFTAG_PLANARCONFIG
,
&
planar_config
);
off
=
0
;
off
=
0
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论