Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
acf7c407
提交
acf7c407
authored
8月 26, 2012
作者:
Steve Underwood
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
More tweaks
上级
3b9dac02
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
116 行增加
和
22 行删除
+116
-22
bell_r2_mf.c
libs/spandsp/src/bell_r2_mf.c
+0
-1
g726.c
libs/spandsp/src/g726.c
+0
-1
lpc10_analyse.c
libs/spandsp/src/lpc10_analyse.c
+0
-1
lpc10_decode.c
libs/spandsp/src/lpc10_decode.c
+0
-1
lpc10_encode.c
libs/spandsp/src/lpc10_encode.c
+0
-1
lpc10_placev.c
libs/spandsp/src/lpc10_placev.c
+0
-1
lpc10_voicing.c
libs/spandsp/src/lpc10_voicing.c
+0
-1
sig_tone.c
libs/spandsp/src/sig_tone.c
+0
-1
t4_tx.h
libs/spandsp/src/spandsp/private/t4_tx.h
+5
-1
t4_tx.c
libs/spandsp/src/t4_tx.c
+111
-12
tone_generate.c
libs/spandsp/src/tone_generate.c
+0
-1
没有找到文件。
libs/spandsp/src/bell_r2_mf.c
浏览文件 @
acf7c407
...
...
@@ -46,7 +46,6 @@
#include "spandsp/logging.h"
#include "spandsp/fast_convert.h"
#include "spandsp/queue.h"
#include "spandsp/dc_restore.h"
#include "spandsp/complex.h"
#include "spandsp/dds.h"
#include "spandsp/tone_detect.h"
...
...
libs/spandsp/src/g726.c
浏览文件 @
acf7c407
...
...
@@ -67,7 +67,6 @@
#include "floating_fudge.h"
#include "spandsp/telephony.h"
#include "spandsp/dc_restore.h"
#include "spandsp/bitstream.h"
#include "spandsp/bit_operations.h"
#include "spandsp/g711.h"
...
...
libs/spandsp/src/lpc10_analyse.c
浏览文件 @
acf7c407
...
...
@@ -44,7 +44,6 @@
#include "floating_fudge.h"
#include "spandsp/telephony.h"
#include "spandsp/dc_restore.h"
#include "spandsp/lpc10.h"
#include "spandsp/private/lpc10.h"
...
...
libs/spandsp/src/lpc10_decode.c
浏览文件 @
acf7c407
...
...
@@ -45,7 +45,6 @@
#include "spandsp/telephony.h"
#include "spandsp/fast_convert.h"
#include "spandsp/dc_restore.h"
#include "spandsp/lpc10.h"
#include "spandsp/private/lpc10.h"
...
...
libs/spandsp/src/lpc10_encode.c
浏览文件 @
acf7c407
...
...
@@ -44,7 +44,6 @@
#include "floating_fudge.h"
#include "spandsp/telephony.h"
#include "spandsp/dc_restore.h"
#include "spandsp/lpc10.h"
#include "spandsp/private/lpc10.h"
...
...
libs/spandsp/src/lpc10_placev.c
浏览文件 @
acf7c407
...
...
@@ -44,7 +44,6 @@
#include "floating_fudge.h"
#include "spandsp/telephony.h"
#include "spandsp/dc_restore.h"
#include "spandsp/lpc10.h"
#include "lpc10_encdecs.h"
...
...
libs/spandsp/src/lpc10_voicing.c
浏览文件 @
acf7c407
...
...
@@ -45,7 +45,6 @@
#include "spandsp/telephony.h"
#include "spandsp/fast_convert.h"
#include "spandsp/dc_restore.h"
#include "spandsp/lpc10.h"
#include "spandsp/private/lpc10.h"
...
...
libs/spandsp/src/sig_tone.c
浏览文件 @
acf7c407
...
...
@@ -45,7 +45,6 @@
#include "spandsp/telephony.h"
#include "spandsp/fast_convert.h"
#include "spandsp/dc_restore.h"
#include "spandsp/saturated.h"
#include "spandsp/vector_int.h"
#include "spandsp/complex.h"
...
...
libs/spandsp/src/spandsp/private/t4_tx.h
浏览文件 @
acf7c407
...
...
@@ -36,7 +36,9 @@ typedef struct
/*! \brief The libtiff context for the current TIFF file */
TIFF
*
tiff_file
;
/*! Image type - bilevel, gray, colour */
/*! \brief The compression type used in the TIFF file */
uint16_t
compression
;
/*! \brief Image type - bilevel, gray, colour */
int
image_type
;
/*! \brief The TIFF photometric setting for the current page. */
uint16_t
photo_metric
;
...
...
@@ -144,6 +146,8 @@ struct t4_tx_state_s
int
apply_lab
;
lab_params_t
lab_params
;
uint8_t
*
colour_map
;
int
colour_map_entries
;
/* Supporting information, like resolutions, which the backend may want. */
t4_tx_metadata_t
metadata
;
...
...
libs/spandsp/src/t4_tx.c
浏览文件 @
acf7c407
...
...
@@ -79,6 +79,12 @@
#include "faxfont.h"
#if 0
#if defined(SPANDSP_SUPPORT_TIFF_FX)
#include <tif_dir.h>
#endif
#endif
/*! The number of centimetres in one inch */
#define CM_PER_INCH 2.54f
...
...
@@ -93,13 +99,33 @@ static const TIFFFieldInfo tiff_fx_tiff_field_info[] =
{
TIFFTAG_CODINGMETHODS
,
1
,
1
,
TIFF_LONG
,
FIELD_CUSTOM
,
FALSE
,
FALSE
,
(
char
*
)
"CodingMethods"
},
{
TIFFTAG_VERSIONYEAR
,
4
,
4
,
TIFF_BYTE
,
FIELD_CUSTOM
,
FALSE
,
FALSE
,
(
char
*
)
"VersionYear"
},
{
TIFFTAG_MODENUMBER
,
1
,
1
,
TIFF_BYTE
,
FIELD_CUSTOM
,
FALSE
,
FALSE
,
(
char
*
)
"ModeNumber"
},
{
TIFFTAG_DECODE
,
TIFF_VARIABLE
,
TIFF_VARIABLE
,
TIFF_SRATIONAL
,
FIELD_CUSTOM
,
FALSE
,
FALS
E
,
(
char
*
)
"Decode"
},
{
TIFFTAG_IMAGEBASECOLOR
,
TIFF_
SPP
,
TIFF_SPP
,
TIFF_SHORT
,
FIELD_CUSTOM
,
FALSE
,
FALS
E
,
(
char
*
)
"ImageBaseColor"
},
{
TIFFTAG_DECODE
,
TIFF_VARIABLE
,
TIFF_VARIABLE
,
TIFF_SRATIONAL
,
FIELD_CUSTOM
,
FALSE
,
TRU
E
,
(
char
*
)
"Decode"
},
{
TIFFTAG_IMAGEBASECOLOR
,
TIFF_
VARIABLE
,
TIFF_VARIABLE
,
TIFF_SHORT
,
FIELD_CUSTOM
,
FALSE
,
TRU
E
,
(
char
*
)
"ImageBaseColor"
},
{
TIFFTAG_T82OPTIONS
,
1
,
1
,
TIFF_LONG
,
FIELD_CUSTOM
,
FALSE
,
FALSE
,
(
char
*
)
"T82Options"
},
{
TIFFTAG_STRIPROWCOUNTS
,
TIFF_VARIABLE
,
TIFF_VARIABLE
,
TIFF_LONG
,
FIELD_CUSTOM
,
FALSE
,
TRUE
,
(
char
*
)
"StripRowCounts"
},
{
TIFFTAG_IMAGELAYER
,
2
,
2
,
TIFF_LONG
,
FIELD_CUSTOM
,
FALSE
,
FALSE
,
(
char
*
)
"ImageLayer"
},
};
#if 0
static TIFFField tiff_fx_tiff_fields[] =
{
{ TIFFTAG_INDEXED, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, (char *) "Indexed" },
{ TIFFTAG_GLOBALPARAMETERSIFD, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, (char *) "GlobalParametersIFD", NULL },
{ TIFFTAG_PROFILETYPE, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, (char *) "ProfileType", NULL },
{ TIFFTAG_FAXPROFILE, 1, 1, TIFF_BYTE, 0, TIFF_SETGET_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, (char *) "FaxProfile", NULL },
{ TIFFTAG_CODINGMETHODS, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, (char *) "CodingMethods", NULL },
{ TIFFTAG_VERSIONYEAR, 4, 4, TIFF_BYTE, 0, TIFF_SETGET_C0_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, (char *) "VersionYear", NULL },
{ TIFFTAG_MODENUMBER, 1, 1, TIFF_BYTE, 0, TIFF_SETGET_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, (char *) "ModeNumber", NULL },
{ TIFFTAG_DECODE, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, (char *) "Decode", NULL },
{ TIFFTAG_IMAGEBASECOLOR, -1, -1, TIFF_SHORT, 0, TIFF_SETGET_C16_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, (char *) "ImageBaseColor", NULL },
{ TIFFTAG_T82OPTIONS, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, (char *) "T82Options", NULL },
{ TIFFTAG_STRIPROWCOUNTS, -1, -1, TIFF_LONG, 0, TIFF_SETGET_C16_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, (char *) "StripRowCounts", NULL },
{ TIFFTAG_IMAGELAYER, 2, 2, TIFF_LONG, 0, TIFF_SETGET_C0_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, (char *) "ImageLayer", NULL },
};
TIFFFieldArray tiff_fx_field_array = { tfiatOther, 0, 12, tiff_fx_tiff_fields };
#endif
static
void
t4_tx_set_image_length
(
t4_tx_state_t
*
s
,
int
image_length
);
static
TIFFExtendProc
_ParentExtender
=
NULL
;
...
...
@@ -107,7 +133,7 @@ static TIFFExtendProc _ParentExtender = NULL;
static
void
TIFFFXDefaultDirectory
(
TIFF
*
tif
)
{
/* Install the extended tag field info */
TIFFMergeFieldInfo
(
tif
,
tiff_fx_tiff_field_info
,
1
1
);
TIFFMergeFieldInfo
(
tif
,
tiff_fx_tiff_field_info
,
1
2
);
/* Since we may have overriddden another directory method, we call it now to
allow it to set up the rest of its own methods. */
...
...
@@ -138,6 +164,50 @@ static int test_resolution(int res_unit, float actual, float expected)
}
/*- End of function --------------------------------------------------------*/
static
int
read_colour_map
(
t4_tx_state_t
*
s
,
int
bits_per_sample
)
{
int
i
;
uint16_t
*
map_L
;
uint16_t
*
map_a
;
uint16_t
*
map_b
;
uint16_t
*
map_z
;
map_L
=
NULL
;
map_a
=
NULL
;
map_b
=
NULL
;
map_z
=
NULL
;
if
(
!
TIFFGetField
(
s
->
tiff
.
tiff_file
,
TIFFTAG_COLORMAP
,
&
map_L
,
&
map_a
,
&
map_b
,
&
map_z
))
return
-
1
;
/* TODO: This only allows for 8 bit deep maps */
if
((
s
->
colour_map
=
realloc
(
s
->
colour_map
,
3
*
256
))
==
NULL
)
return
-
1
;
span_log
(
&
s
->
logging
,
SPAN_LOG_FLOW
,
"Got a colour map
\n
"
);
#if 0
/* Sweep the colormap in the proper order */
for (i = 0; i < (1 << bits_per_sample); i++)
{
s->colour_map[3*i] = (map_L[i] >> 8) & 0xFF;
s->colour_map[3*i + 1] = (map_a[i] >> 8) & 0xFF;
s->colour_map[3*i + 2] = (map_b[i] >> 8) & 0xFF;
span_log(&s->logging, SPAN_LOG_FLOW, "Map %3d - %5d %5d %5d\n", i, s->colour_map[3*i], s->colour_map[3*i + 1], s->colour_map[3*i + 2]);
}
#else
/* Sweep the colormap in the order that seems to work for l04x_02x.tif */
for
(
i
=
0
;
i
<
(
1
<<
bits_per_sample
);
i
++
)
{
s
->
colour_map
[
i
]
=
(
map_L
[
i
]
>>
8
)
&
0xFF
;
s
->
colour_map
[
256
+
i
]
=
(
map_a
[
i
]
>>
8
)
&
0xFF
;
s
->
colour_map
[
2
*
256
+
i
]
=
(
map_b
[
i
]
>>
8
)
&
0xFF
;
}
#endif
lab_to_srgb
(
&
s
->
lab_params
,
s
->
colour_map
,
s
->
colour_map
,
256
);
for
(
i
=
0
;
i
<
(
1
<<
bits_per_sample
);
i
++
)
span_log
(
&
s
->
logging
,
SPAN_LOG_FLOW
,
"Map %3d - %5d %5d %5d
\n
"
,
i
,
s
->
colour_map
[
3
*
i
],
s
->
colour_map
[
3
*
i
+
1
],
s
->
colour_map
[
3
*
i
+
2
]);
return
0
;
}
/*- End of function --------------------------------------------------------*/
static
int
get_tiff_directory_info
(
t4_tx_state_t
*
s
)
{
static
const
struct
...
...
@@ -232,8 +302,12 @@ static int get_tiff_directory_info(t4_tx_state_t *s)
TIFFGetField
(
t
->
tiff_file
,
TIFFTAG_RESOLUTIONUNIT
,
&
res_unit
);
t
->
photo_metric
=
PHOTOMETRIC_MINISWHITE
;
TIFFGetField
(
t
->
tiff_file
,
TIFFTAG_PHOTOMETRIC
,
&
t
->
photo_metric
);
/* TIFFGetField(t->tiff_file, TIFFTAG_COMPRESSION, &t->????); */
set_lab_illuminant
(
&
s
->
lab_params
,
0
.
9638
f
,
1
.
0
f
,
0
.
8245
f
);
set_lab_gamut
(
&
s
->
lab_params
,
0
,
100
,
-
85
,
85
,
-
75
,
125
,
FALSE
);
t
->
compression
=
-
1
;
TIFFGetField
(
t
->
tiff_file
,
TIFFTAG_COMPRESSION
,
&
t
->
compression
);
t
->
fill_order
=
FILLORDER_LSB2MSB
;
/* Allow a little range for the X resolution in centimeters. The spec doesn't pin down the
...
...
@@ -314,22 +388,42 @@ static int test_tiff_directory_info(t4_tx_state_t *s)
{
-
1
.
00
f
,
-
1
}
};
uint16_t
res_unit
;
uint16_t
parm16
;
uint32_t
parm32
;
float
x_resolution
;
float
y_resolution
;
uint16_t
bits_per_sample
;
uint16_t
samples_per_pixel
;
int
image_type
;
int
i
;
t4_tx_tiff_state_t
*
t
;
t
=
&
s
->
tiff
;
parm16
=
1
;
TIFFGetField
(
t
->
tiff_file
,
TIFFTAG_BITSPERSAMPLE
,
&
parm16
);
if
(
parm16
!=
1
)
return
-
1
;
parm16
=
1
;
TIFFGetField
(
t
->
tiff_file
,
TIFFTAG_SAMPLESPERPIXEL
,
&
parm16
);
if
(
parm16
!=
1
)
bits_per_sample
=
1
;
TIFFGetField
(
t
->
tiff_file
,
TIFFTAG_BITSPERSAMPLE
,
&
bits_per_sample
);
samples_per_pixel
=
1
;
TIFFGetField
(
t
->
tiff_file
,
TIFFTAG_SAMPLESPERPIXEL
,
&
samples_per_pixel
);
if
(
samples_per_pixel
==
1
&&
bits_per_sample
==
1
)
image_type
=
T4_IMAGE_TYPE_BILEVEL
;
else
if
(
samples_per_pixel
==
3
&&
bits_per_sample
==
1
)
image_type
=
T4_IMAGE_TYPE_COLOUR_BILEVEL
;
else
if
(
samples_per_pixel
==
1
&&
bits_per_sample
==
8
)
image_type
=
T4_IMAGE_TYPE_GRAY_8BIT
;
else
if
(
samples_per_pixel
==
1
&&
bits_per_sample
>
8
)
image_type
=
T4_IMAGE_TYPE_GRAY_12BIT
;
else
if
(
samples_per_pixel
==
3
&&
bits_per_sample
==
8
)
image_type
=
T4_IMAGE_TYPE_COLOUR_8BIT
;
else
if
(
samples_per_pixel
==
3
&&
bits_per_sample
>
8
)
image_type
=
T4_IMAGE_TYPE_COLOUR_12BIT
;
else
image_type
=
-
1
;
#if 0
/* Limit ourselves to plain black and white pages */
if (t->image_type != T4_IMAGE_TYPE_BILEVEL)
return -1;
#endif
if
(
s
->
tiff
.
image_type
!=
image_type
)
return
1
;
parm32
=
0
;
TIFFGetField
(
t
->
tiff_file
,
TIFFTAG_IMAGEWIDTH
,
&
parm32
);
if
(
s
->
image_width
!=
(
int
)
parm32
)
...
...
@@ -1082,6 +1176,11 @@ SPAN_DECLARE(int) t4_tx_release(t4_tx_state_t *s)
free
(
s
->
header_text
);
s
->
header_text
=
NULL
;
}
if
(
s
->
colour_map
)
{
free
(
s
->
colour_map
);
s
->
colour_map
=
NULL
;
}
switch
(
s
->
line_encoding
)
{
case
T4_COMPRESSION_ITU_T4_1D
:
...
...
libs/spandsp/src/tone_generate.c
浏览文件 @
acf7c407
...
...
@@ -45,7 +45,6 @@
#include "spandsp/telephony.h"
#include "spandsp/fast_convert.h"
#include "spandsp/dc_restore.h"
#include "spandsp/complex.h"
#include "spandsp/dds.h"
#include "spandsp/tone_generate.h"
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论