Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
13fbaf7e
提交
13fbaf7e
authored
3月 29, 2012
作者:
Steve Underwood
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Tweaks for spandsp
上级
7c7967fb
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
382 行增加
和
601 行删除
+382
-601
t38_terminal.h
libs/spandsp/src/spandsp/private/t38_terminal.h
+2
-2
v22bis.h
libs/spandsp/src/spandsp/private/v22bis.h
+23
-56
v22bis.h
libs/spandsp/src/spandsp/v22bis.h
+2
-4
t38_terminal.c
libs/spandsp/src/t38_terminal.c
+116
-88
v22bis_rx.c
libs/spandsp/src/v22bis_rx.c
+69
-171
v22bis_tx.c
libs/spandsp/src/v22bis_tx.c
+58
-105
v29rx.c
libs/spandsp/src/v29rx.c
+14
-8
v29tx_constellation_maps.h
libs/spandsp/src/v29tx_constellation_maps.h
+28
-36
v8.c
libs/spandsp/src/v8.c
+1
-1
Makefile.am
libs/spandsp/tests/Makefile.am
+1
-1
fax_tester.c
libs/spandsp/tests/fax_tester.c
+1
-3
fax_tests.sh
libs/spandsp/tests/fax_tests.sh
+67
-126
没有找到文件。
libs/spandsp/src/spandsp/private/t38_terminal.h
浏览文件 @
13fbaf7e
...
...
@@ -32,8 +32,8 @@ typedef struct
{
/*! \brief Internet Aware FAX mode bit mask. */
int
iaf
;
/*! \brief Required time between T.38 transmissions, in mi
lli
seconds. */
int
m
s_per_tx_chunk
;
/*! \brief Required time between T.38 transmissions, in mi
cro
seconds. */
int
u
s_per_tx_chunk
;
/*! \brief Bit fields controlling the way data is packed into chunked for transmission. */
int
chunking_modes
;
...
...
libs/spandsp/src/spandsp/private/v22bis.h
浏览文件 @
13fbaf7e
...
...
@@ -26,10 +26,10 @@
#if !defined(_SPANDSP_PRIVATE_V22BIS_H_)
#define _SPANDSP_PRIVATE_V22BIS_H_
/*! The
length of the equalizer buffer
*/
#define V22BIS_EQUALIZER_LEN
1
7
/*!
Samples before the target position in the equalizer buffer
*/
#define V22BIS_EQUALIZER_
PRE_LEN 8
/*! The
number of steps to the left and to the right of the target position in the equalizer buffer.
*/
#define V22BIS_EQUALIZER_LEN 7
/*!
One less than a power of 2 >= (2*V22BIS_EQUALIZER_LEN + 1)
*/
#define V22BIS_EQUALIZER_
MASK 15
/*! The number of taps in the transmit pulse shaping filter */
#define V22BIS_TX_FILTER_STEPS 9
...
...
@@ -65,12 +65,6 @@ enum
V22BIS_TX_TRAINING_STAGE_PARKED
};
#if defined(SPANDSP_USE_FIXED_POINT)
extern
const
complexi16_t
v22bis_constellation
[
16
];
#else
extern
const
complexf_t
v22bis_constellation
[
16
];
#endif
/*!
V.22bis modem descriptor. This defines the working state for a single instance
of a V.22bis modem.
...
...
@@ -99,15 +93,10 @@ struct v22bis_state_s
/* Receive section */
struct
{
#if defined(SPANDSP_USE_FIXED_POINT)
/*! \brief The scaling factor accessed by the AGC algorithm. */
int16_t
agc_scaling
;
/*! \brief The root raised cosine (RRC) pulse shaping filter buffer. */
/*! \brief The route raised cosine (RRC) pulse shaping filter buffer. */
#if defined(SPANDSP_USE_FIXED_POINTx)
int16_t
rrc_filter
[
V22BIS_RX_FILTER_STEPS
];
#else
/*! \brief The scaling factor accessed by the AGC algorithm. */
float
agc_scaling
;
/*! \brief The root raised cosine (RRC) pulse shaping filter buffer. */
float
rrc_filter
[
V22BIS_RX_FILTER_STEPS
];
#endif
/*! \brief Current offset into the RRC pulse shaping filter buffer. */
...
...
@@ -127,27 +116,19 @@ struct v22bis_state_s
/*! \brief >0 if a signal above the minimum is present. It may or may not be a V.22bis signal. */
int
signal_present
;
/*! \brief A measure of how much mismatch there is between the real constellation,
and the decoded symbol positions. */
float
training_error
;
/*! \brief The current phase of the carrier (i.e. the DDS parameter). */
uint32_t
carrier_phase
;
/*! \brief The update rate for the phase of the carrier (i.e. the DDS increment). */
int32_t
carrier_phase_rate
;
#if defined(SPANDSP_USE_FIXED_POINT)
/*! \brief A measure of how much mismatch there is between the real constellation,
and the decoded symbol positions. */
int32_t
training_error
;
/*! \brief The proportional part of the carrier tracking filter. */
int32_t
carrier_track_p
;
/*! \brief The integral part of the carrier tracking filter. */
int32_t
carrier_track_i
;
#else
/*! \brief A measure of how much mismatch there is between the real constellation,
and the decoded symbol positions. */
float
training_error
;
/*! \brief The proportional part of the carrier tracking filter. */
float
carrier_track_p
;
/*! \brief The integral part of the carrier tracking filter. */
float
carrier_track_i
;
#endif
/*! \brief A callback function which may be enabled to report every symbol's
constellation position. */
...
...
@@ -162,23 +143,21 @@ struct v22bis_state_s
int32_t
carrier_on_power
;
/*! \brief The power meter level at which carrier off is declared. */
int32_t
carrier_off_power
;
/*! \brief The scaling factor accessed by the AGC algorithm. */
float
agc_scaling
;
int
constellation_state
;
#if defined(SPANDSP_USE_FIXED_POINT)
/*! \brief The current delta factor for updating the equalizer coefficients. */
int16_t
eq_delta
;
/*! \brief The adaptive equalizer coefficients. */
complexi16_t
eq_coeff
[
V22BIS_EQUALIZER_LEN
];
/*! \brief The equalizer signal buffer. */
complexi16_t
eq_buf
[
V22BIS_EQUALIZER_LEN
];
#else
/*! \brief The current delta factor for updating the equalizer coefficients. */
float
eq_delta
;
#if defined(SPANDSP_USE_FIXED_POINTx)
/*! \brief The adaptive equalizer coefficients. */
complex
f_t
eq_coeff
[
V22BIS_EQUALIZER_LEN
];
complex
i_t
eq_coeff
[
2
*
V22BIS_EQUALIZER_LEN
+
1
];
/*! \brief The equalizer signal buffer. */
complexf_t
eq_buf
[
V22BIS_EQUALIZER_LEN
];
complexi_t
eq_buf
[
V22BIS_EQUALIZER_MASK
+
1
];
#else
complexf_t
eq_coeff
[
2
*
V22BIS_EQUALIZER_LEN
+
1
];
complexf_t
eq_buf
[
V22BIS_EQUALIZER_MASK
+
1
];
#endif
/*! \brief Current offset into the equalizer buffer. */
int
eq_step
;
...
...
@@ -204,24 +183,11 @@ struct v22bis_state_s
/* Transmit section */
struct
{
#if defined(SPANDSP_USE_FIXED_POINT)
/*! \brief The guard tone level. */
int16_t
guard_tone_gain
;
/*! \brief The gain factor needed to achieve the specified output power. */
int16_t
gain
;
/*! \brief The root raised cosine (RRC) pulse shaping filter buffer. */
int16_t
rrc_filter_re
[
V22BIS_TX_FILTER_STEPS
];
int16_t
rrc_filter_im
[
V22BIS_TX_FILTER_STEPS
];
#else
/*! \brief The guard tone level. */
float
guard_tone_gain
;
/*! \brief The gain factor needed to achieve the specified output power. */
float
gain
;
/*! \brief The root raised cosine (RRC) pulse shaping filter buffer. */
float
rrc_filter_re
[
V22BIS_TX_FILTER_STEPS
];
float
rrc_filter_im
[
V22BIS_TX_FILTER_STEPS
];
#endif
/*! \brief The route raised cosine (RRC) pulse shaping filter buffer. */
complexf_t
rrc_filter
[
2
*
V22BIS_TX_FILTER_STEPS
];
/*! \brief Current offset into the RRC pulse shaping filter buffer. */
int
rrc_filter_step
;
...
...
@@ -243,6 +209,7 @@ struct v22bis_state_s
uint32_t
guard_phase
;
/*! \brief The update rate for the phase of the guard tone (i.e. the DDS increment). */
int32_t
guard_phase_rate
;
float
guard_level
;
/*! \brief The current fractional phase of the baud timing. */
int
baud_phase
;
/*! \brief The code number for the current position in the constellation. */
...
...
libs/spandsp/src/spandsp/v22bis.h
浏览文件 @
13fbaf7e
...
...
@@ -61,6 +61,8 @@ enum
*/
typedef
struct
v22bis_state_s
v22bis_state_t
;
extern
const
complexf_t
v22bis_constellation
[
16
];
#if defined(__cplusplus)
extern
"C"
{
...
...
@@ -86,11 +88,7 @@ SPAN_DECLARE_NONSTD(int) v22bis_rx_fillin(v22bis_state_t *s, int len);
\brief Get a snapshot of the current equalizer coefficients.
\param coeffs The vector of complex coefficients.
\return The number of coefficients in the vector. */
#if defined(SPANDSP_USE_FIXED_POINT)
SPAN_DECLARE
(
int
)
v22bis_rx_equalizer_state
(
v22bis_state_t
*
s
,
complexi16_t
**
coeffs
);
#else
SPAN_DECLARE
(
int
)
v22bis_rx_equalizer_state
(
v22bis_state_t
*
s
,
complexf_t
**
coeffs
);
#endif
/*! Get the current received carrier frequency.
\param s The modem context.
...
...
libs/spandsp/src/t38_terminal.c
浏览文件 @
13fbaf7e
差异被折叠。
点击展开。
libs/spandsp/src/v22bis_rx.c
浏览文件 @
13fbaf7e
差异被折叠。
点击展开。
libs/spandsp/src/v22bis_tx.c
浏览文件 @
13fbaf7e
差异被折叠。
点击展开。
libs/spandsp/src/v29rx.c
浏览文件 @
13fbaf7e
...
...
@@ -230,13 +230,17 @@ static void equalizer_reset(v29_rx_state_t *s)
{
/* Start with an equalizer based on everything being perfect */
#if defined(SPANDSP_USE_FIXED_POINT)
static
const
complexi16_t
x
=
{
3
*
FP_FACTOR
,
0
*
FP_FACTOR
};
cvec_zeroi16
(
s
->
eq_coeff
,
V29_EQUALIZER_LEN
);
s
->
eq_coeff
[
V29_EQUALIZER_PRE_LEN
]
=
complex_seti16
(
3
*
FP_FACTOR
,
0
*
FP_FACTOR
)
;
s
->
eq_coeff
[
V29_EQUALIZER_PRE_LEN
]
=
x
;
cvec_zeroi16
(
s
->
eq_buf
,
V29_EQUALIZER_LEN
);
s
->
eq_delta
=
32768
.
0
f
*
EQUALIZER_DELTA
/
V29_EQUALIZER_LEN
;
#else
static
const
complexf_t
x
=
{
3
.
0
f
,
0
.
0
f
};
cvec_zerof
(
s
->
eq_coeff
,
V29_EQUALIZER_LEN
);
s
->
eq_coeff
[
V29_EQUALIZER_PRE_LEN
]
=
complex_setf
(
3
.
0
f
,
0
.
0
f
)
;
s
->
eq_coeff
[
V29_EQUALIZER_PRE_LEN
]
=
x
;
cvec_zerof
(
s
->
eq_buf
,
V29_EQUALIZER_LEN
);
s
->
eq_delta
=
EQUALIZER_DELTA
/
V29_EQUALIZER_LEN
;
#endif
...
...
@@ -538,7 +542,7 @@ static __inline__ void symbol_sync(v29_rx_state_t *s)
i
=
(
v
>
1000
.
0
f
)
?
5
:
1
;
if
(
s
->
baud_phase
<
0
.
0
f
)
i
=
-
i
;
//printf("v = %10.5f %5d - %f %f %d
%d
\n", v, i, p, s->baud_phase, s->total_baud_timing_correction);
//printf("v = %10.5f %5d - %f %f %d\n", v, i, p, s->baud_phase, s->total_baud_timing_correction);
s
->
eq_put_step
+=
i
;
s
->
total_baud_timing_correction
+=
i
;
}
...
...
@@ -645,8 +649,7 @@ static void process_half_baud(v29_rx_state_t *s, complexf_t *sample)
if
(
i
)
{
j
=
i
&
0xF
;
ang
=
(
s
->
angles
[
j
]
-
s
->
start_angles
[
0
])
/
i
+
(
s
->
angles
[
j
|
0x1
]
-
s
->
start_angles
[
1
])
/
i
;
ang
=
(
s
->
angles
[
j
]
-
s
->
start_angles
[
0
])
/
i
+
(
s
->
angles
[
j
|
0x1
]
-
s
->
start_angles
[
1
])
/
i
;
s
->
carrier_phase_rate
+=
3
*
(
ang
/
20
);
}
span_log
(
&
s
->
logging
,
SPAN_LOG_FLOW
,
"Coarse carrier frequency %7.2f
\n
"
,
dds_frequencyf
(
s
->
carrier_phase_rate
));
...
...
@@ -719,11 +722,12 @@ static void process_half_baud(v29_rx_state_t *s, complexf_t *sample)
if
(
++
s
->
training_count
>=
V29_TRAINING_SEG_3_LEN
-
48
)
{
s
->
training_stage
=
TRAINING_STAGE_TRAIN_ON_CDCD_AND_TEST
;
s
->
training_error
=
0
.
0
f
;
#if defined(SPANDSP_USE_FIXED_POINT)
s
->
training_error
=
0
;
s
->
carrier_track_i
=
200
;
s
->
carrier_track_p
=
1000000
;
#else
s
->
training_error
=
0
.
0
f
;
s
->
carrier_track_i
=
200
.
0
f
;
s
->
carrier_track_p
=
1000000
.
0
f
;
#endif
...
...
@@ -946,10 +950,12 @@ SPAN_DECLARE_NONSTD(int) v29_rx(v29_rx_state_t *s, const int16_t amp[], int len)
parked, after training failure. */
s
->
eq_put_step
-=
RX_PULSESHAPER_COEFF_SETS
;
step
=
-
s
->
eq_put_step
;
if
(
step
>
RX_PULSESHAPER_COEFF_SETS
-
1
)
step
=
RX_PULSESHAPER_COEFF_SETS
-
1
;
if
(
step
<
0
)
step
+=
RX_PULSESHAPER_COEFF_SETS
;
if
(
step
<
0
)
step
=
0
;
else
if
(
step
>
RX_PULSESHAPER_COEFF_SETS
-
1
)
step
=
RX_PULSESHAPER_COEFF_SETS
-
1
;
#if defined(SPANDSP_USE_FIXED_POINT)
v
=
vec_circular_dot_prodi16
(
s
->
rrc_filter
,
rx_pulseshaper_re
[
step
],
V29_RX_FILTER_STEPS
,
s
->
rrc_filter_step
);
sample
.
re
=
(
v
*
s
->
agc_scaling
)
>>
15
;
...
...
libs/spandsp/src/v29tx_constellation_maps.h
浏览文件 @
13fbaf7e
...
...
@@ -24,26 +24,18 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#if !defined(FP_SCALE)
#if defined(SPANDSP_USE_FIXED_POINT)
#define FP_SCALE(x) ((int16_t) x)
#else
#define FP_SCALE(x) (x)
#endif
#endif
#if defined(SPANDSP_USE_FIXED_POINT)
static
const
complexi16_t
v29_abab_constellation
[
6
]
=
#else
static
const
complexf_t
v29_abab_constellation
[
6
]
=
#endif
{
{
FP_SCALE
(
3
.
0
f
),
FP_SCALE
(
-
3
.
0
f
)},
/* 315deg high 9600 */
{
FP_SCALE
(
-
3
.
0
f
),
FP_SCALE
(
0
.
0
f
)},
/* 180deg low */
{
FP_SCALE
(
1
.
0
f
),
FP_SCALE
(
-
1
.
0
f
)},
/* 315deg low 7200 */
{
FP_SCALE
(
-
3
.
0
f
),
FP_SCALE
(
0
.
0
f
)},
/* 180deg low */
{
FP_SCALE
(
0
.
0
f
),
FP_SCALE
(
-
3
.
0
f
)},
/* 270deg low 4800 */
{
FP_SCALE
(
-
3
.
0
f
),
FP_SCALE
(
0
.
0
f
)}
/* 180deg low */
{
3
,
-
3
},
/* 315deg high 9600 */
{
-
3
,
0
},
/* 180deg low */
{
1
,
-
1
},
/* 315deg low 7200 */
{
-
3
,
0
},
/* 180deg low */
{
0
,
-
3
},
/* 270deg low 4800 */
{
-
3
,
0
}
/* 180deg low */
};
#if defined(SPANDSP_USE_FIXED_POINT)
...
...
@@ -52,12 +44,12 @@ static const complexi16_t v29_cdcd_constellation[6] =
static
const
complexf_t
v29_cdcd_constellation
[
6
]
=
#endif
{
{
FP_SCALE
(
3
.
0
f
),
FP_SCALE
(
0
.
0
f
)},
/* 0deg low 9600 */
{
FP_SCALE
(
-
3
.
0
f
),
FP_SCALE
(
3
.
0
f
)},
/* 135deg high */
{
FP_SCALE
(
3
.
0
f
),
FP_SCALE
(
0
.
0
f
)},
/* 0deg low 7200 */
{
FP_SCALE
(
-
1
.
0
f
),
FP_SCALE
(
1
.
0
f
)},
/* 135deg low */
{
FP_SCALE
(
3
.
0
f
),
FP_SCALE
(
0
.
0
f
)},
/* 0deg low 4800 */
{
FP_SCALE
(
0
.
0
f
),
FP_SCALE
(
3
.
0
f
)}
/* 90deg low */
{
3
,
0
},
/* 0deg low 9600 */
{
-
3
,
3
},
/* 135deg high */
{
3
,
0
},
/* 0deg low 7200 */
{
-
1
,
1
},
/* 135deg low */
{
3
,
0
},
/* 0deg low 4800 */
{
0
,
3
}
/* 90deg low */
};
#if defined(SPANDSP_USE_FIXED_POINT)
...
...
@@ -66,22 +58,22 @@ static const complexi16_t v29_9600_constellation[16] =
static
const
complexf_t
v29_9600_constellation
[
16
]
=
#endif
{
{
FP_SCALE
(
3
.
0
f
),
FP_SCALE
(
0
.
0
f
)},
/* 0deg low */
{
FP_SCALE
(
1
.
0
f
),
FP_SCALE
(
1
.
0
f
)},
/* 45deg low */
{
FP_SCALE
(
0
.
0
f
),
FP_SCALE
(
3
.
0
f
)},
/* 90deg low */
{
FP_SCALE
(
-
1
.
0
f
),
FP_SCALE
(
1
.
0
f
)},
/* 135deg low */
{
FP_SCALE
(
-
3
.
0
f
),
FP_SCALE
(
0
.
0
f
)},
/* 180deg low */
{
FP_SCALE
(
-
1
.
0
f
),
FP_SCALE
(
-
1
.
0
f
)},
/* 225deg low */
{
FP_SCALE
(
0
.
0
f
),
FP_SCALE
(
-
3
.
0
f
)},
/* 270deg low */
{
FP_SCALE
(
1
.
0
f
),
FP_SCALE
(
-
1
.
0
f
)},
/* 315deg low */
{
FP_SCALE
(
5
.
0
f
),
FP_SCALE
(
0
.
0
f
)},
/* 0deg high */
{
FP_SCALE
(
3
.
0
f
),
FP_SCALE
(
3
.
0
f
)},
/* 45deg high */
{
FP_SCALE
(
0
.
0
f
),
FP_SCALE
(
5
.
0
f
)},
/* 90deg high */
{
FP_SCALE
(
-
3
.
0
f
),
FP_SCALE
(
3
.
0
f
)},
/* 135deg high */
{
FP_SCALE
(
-
5
.
0
f
),
FP_SCALE
(
0
.
0
f
)},
/* 180deg high */
{
FP_SCALE
(
-
3
.
0
f
),
FP_SCALE
(
-
3
.
0
f
)},
/* 225deg high */
{
FP_SCALE
(
0
.
0
f
),
FP_SCALE
(
-
5
.
0
f
)},
/* 270deg high */
{
FP_SCALE
(
3
.
0
f
),
FP_SCALE
(
-
3
.
0
f
)}
/* 315deg high */
{
3
,
0
},
/* 0deg low */
{
1
,
1
},
/* 45deg low */
{
0
,
3
},
/* 90deg low */
{
-
1
,
1
},
/* 135deg low */
{
-
3
,
0
},
/* 180deg low */
{
-
1
,
-
1
},
/* 225deg low */
{
0
,
-
3
},
/* 270deg low */
{
1
,
-
1
},
/* 315deg low */
{
5
,
0
},
/* 0deg high */
{
3
,
3
},
/* 45deg high */
{
0
,
5
},
/* 90deg high */
{
-
3
,
3
},
/* 135deg high */
{
-
5
,
0
},
/* 180deg high */
{
-
3
,
-
3
},
/* 225deg high */
{
0
,
-
5
},
/* 270deg high */
{
3
,
-
3
}
/* 315deg high */
};
/*- End of file ------------------------------------------------------------*/
libs/spandsp/src/v8.c
浏览文件 @
13fbaf7e
...
...
@@ -1024,9 +1024,9 @@ SPAN_DECLARE(int) v8_restart(v8_state_t *s, int calling_party, v8_parms_t *parms
{
/* Send the ANSam or ANSam/ tone */
s
->
state
=
V8_CM_WAIT
;
s
->
negotiation_timer
=
ms_to_samples
(
200
+
5000
);
v8_decode_init
(
s
);
modem_connect_tones_tx_init
(
&
s
->
ansam_tx
,
s
->
parms
.
modem_connect_tone
);
s
->
negotiation_timer
=
ms_to_samples
(
200
+
5000
);
s
->
modem_connect_tone_tx_on
=
ms_to_samples
(
75
)
+
1
;
}
...
...
libs/spandsp/tests/Makefile.am
浏览文件 @
13fbaf7e
...
...
@@ -300,7 +300,7 @@ t38_core_tests_SOURCES = t38_core_tests.c
t38_core_tests_LDADD
=
$(LIBDIR)
-lspandsp
t38_decode_SOURCES
=
t38_decode.c fax_utils.c pcap_parse.c udptl.c
t38_decode_LDADD
=
-L
$(top_builddir)
/spandsp-sim
-lspandsp-sim
$(LIBDIR)
-lspandsp
-lpcap
t38_decode_LDADD
=
-L
$(top_builddir)
/spandsp-sim
-lspandsp-sim
$(LIBDIR)
-lspandsp
t38_non_ecm_buffer_tests_SOURCES
=
t38_non_ecm_buffer_tests.c
t38_non_ecm_buffer_tests_LDADD
=
$(LIBDIR)
-lspandsp
...
...
libs/spandsp/tests/fax_tester.c
浏览文件 @
13fbaf7e
...
...
@@ -287,7 +287,7 @@ static void hdlc_rx_status(void *user_data, int status)
faxtester_state_t
*
s
;
s
=
(
faxtester_state_t
*
)
user_data
;
fprintf
(
stderr
,
"HDLC carrier status is %s (%d)
\n
"
,
signal_status_to_str
(
status
),
status
);
span_log
(
&
s
->
logging
,
SPAN_LOG_FLOW
,
"HDLC carrier status is %s (%d)
\n
"
,
signal_status_to_str
(
status
),
status
);
switch
(
status
)
{
case
SIG_STATUS_TRAINING_FAILED
:
...
...
@@ -409,9 +409,7 @@ int faxtester_rx(faxtester_state_t *s, int16_t *amp, int len)
int
faxtester_tx
(
faxtester_state_t
*
s
,
int16_t
*
amp
,
int
max_len
)
{
int
len
;
int
required_len
;
required_len
=
max_len
;
len
=
0
;
if
(
s
->
transmit
)
{
...
...
libs/spandsp/tests/fax_tests.sh
浏览文件 @
13fbaf7e
...
...
@@ -18,8 +18,8 @@
run_fax_test
()
{
rm
-f
fax_tests_1.tif
echo
-i
${
FILE
}
${
OPTS
}
./fax_tests
-i
${
FILE
}
${
OPTS
}
>
xyzzy 2>xyzzy2
echo
-i
${
FILE
}
${
OPTS
}
-i
${
FILE
}
./fax_tests
${
OPTS
}
-i
${
FILE
}
>
xyzzy 2>xyzzy2
RETVAL
=
$?
if
[
$RETVAL
!=
0
]
then
...
...
@@ -28,7 +28,7 @@ run_fax_test()
fi
# Now use tiffcmp to check the results. It will return non-zero if any page images differ. The -t
# option means the normal differences in tags will be ignored.
tiffcmp
-t
${
FILE
}
fax_tests
_1
.tif
#>/dev/null
tiffcmp
-t
${
FILE
}
fax_tests.tif
#>/dev/null
RETVAL
=
$?
if
[
$RETVAL
!=
0
]
then
...
...
@@ -39,165 +39,106 @@ run_fax_test()
echo
tested
${
FILE
}
}
OPTS
=
"-e"
ITUTESTS_DIR
=
../test-data/itu/fax
FILE
=
"../itutests/fax/R8_385_A4.tif"
run_fax_test
for
OPTS
in
"-p AA"
"-p AA -e"
"-p TT"
"-p TT -e"
"-p GG"
"-p GG -e"
"-p TG"
"-p TG -e"
"-p GT"
"-p GT -e"
do
FILE
=
"
${
ITUTESTS_DIR
}
/R8_385_A4.tif"
run_fax_test
FILE
=
"../itutests/fax
/R8_385_B4.tif"
run_fax_test
FILE
=
"
${
ITUTESTS_DIR
}
/R8_385_B4.tif"
run_fax_test
FILE
=
"../itutests/fax
/R8_385_A3.tif"
run_fax_test
FILE
=
"
${
ITUTESTS_DIR
}
/R8_385_A3.tif"
run_fax_test
FILE
=
"../itutests/fax
/R8_77_A4.tif"
run_fax_test
FILE
=
"
${
ITUTESTS_DIR
}
/R8_77_A4.tif"
run_fax_test
FILE
=
"../itutests/fax
/R8_77_B4.tif"
run_fax_test
FILE
=
"
${
ITUTESTS_DIR
}
/R8_77_B4.tif"
run_fax_test
FILE
=
"../itutests/fax
/R8_77_A3.tif"
run_fax_test
FILE
=
"
${
ITUTESTS_DIR
}
/R8_77_A3.tif"
run_fax_test
FILE
=
"../itutests/fax
/R8_154_A4.tif"
run_fax_test
FILE
=
"
${
ITUTESTS_DIR
}
/R8_154_A4.tif"
run_fax_test
FILE
=
"../itutests/fax
/R8_154_B4.tif"
run_fax_test
FILE
=
"
${
ITUTESTS_DIR
}
/R8_154_B4.tif"
run_fax_test
FILE
=
"../itutests/fax
/R8_154_A3.tif"
run_fax_test
FILE
=
"
${
ITUTESTS_DIR
}
/R8_154_A3.tif"
run_fax_test
FILE
=
"../itutests/fax
/R300_300_A4.tif"
run_fax_test
FILE
=
"
${
ITUTESTS_DIR
}
/R300_300_A4.tif"
run_fax_test
FILE
=
"../itutests/fax
/R300_300_B4.tif"
run_fax_test
FILE
=
"
${
ITUTESTS_DIR
}
/R300_300_B4.tif"
run_fax_test
FILE
=
"../itutests/fax
/R300_300_A3.tif"
run_fax_test
FILE
=
"
${
ITUTESTS_DIR
}
/R300_300_A3.tif"
run_fax_test
FILE
=
"../itutests/fax
/R300_600_A4.tif"
run_fax_test
FILE
=
"
${
ITUTESTS_DIR
}
/R300_600_A4.tif"
run_fax_test
FILE
=
"../itutests/fax
/R300_600_B4.tif"
run_fax_test
FILE
=
"
${
ITUTESTS_DIR
}
/R300_600_B4.tif"
run_fax_test
FILE
=
"../itutests/fax
/R300_600_A3.tif"
run_fax_test
FILE
=
"
${
ITUTESTS_DIR
}
/R300_600_A3.tif"
run_fax_test
FILE
=
"../itutests/fax
/R16_154_A4.tif"
run_fax_test
FILE
=
"
${
ITUTESTS_DIR
}
/R16_154_A4.tif"
run_fax_test
FILE
=
"../itutests/fax
/R16_154_B4.tif"
run_fax_test
FILE
=
"
${
ITUTESTS_DIR
}
/R16_154_B4.tif"
run_fax_test
FILE
=
"../itutests/fax
/R16_154_A3.tif"
run_fax_test
FILE
=
"
${
ITUTESTS_DIR
}
/R16_154_A3.tif"
run_fax_test
FILE
=
"../itutests/fax
/R16_800_A4.tif"
run_fax_test
FILE
=
"
${
ITUTESTS_DIR
}
/R16_800_A4.tif"
run_fax_test
FILE
=
"../itutests/fax
/R16_800_B4.tif"
run_fax_test
FILE
=
"
${
ITUTESTS_DIR
}
/R16_800_B4.tif"
run_fax_test
FILE
=
"../itutests/fax
/R16_800_A3.tif"
run_fax_test
FILE
=
"
${
ITUTESTS_DIR
}
/R16_800_A3.tif"
run_fax_test
FILE
=
"../itutests/fax
/R600_600_A4.tif"
run_fax_test
FILE
=
"
${
ITUTESTS_DIR
}
/R600_600_A4.tif"
run_fax_test
FILE
=
"../itutests/fax
/R600_600_B4.tif"
run_fax_test
FILE
=
"
${
ITUTESTS_DIR
}
/R600_600_B4.tif"
run_fax_test
FILE
=
"../itutests/fax
/R600_600_A3.tif"
run_fax_test
FILE
=
"
${
ITUTESTS_DIR
}
/R600_600_A3.tif"
run_fax_test
FILE
=
"../itutests/fax
/R600_1200_A4.tif"
run_fax_test
FILE
=
"
${
ITUTESTS_DIR
}
/R600_1200_A4.tif"
run_fax_test
FILE
=
"../itutests/fax
/R600_1200_B4.tif"
run_fax_test
FILE
=
"
${
ITUTESTS_DIR
}
/R600_1200_B4.tif"
run_fax_test
FILE
=
"../itutests/fax
/R600_1200_A3.tif"
run_fax_test
FILE
=
"
${
ITUTESTS_DIR
}
/R600_1200_A3.tif"
run_fax_test
FILE
=
"../itutests/fax
/R1200_1200_A4.tif"
run_fax_test
FILE
=
"
${
ITUTESTS_DIR
}
/R1200_1200_A4.tif"
run_fax_test
FILE
=
"../itutests/fax
/R1200_1200_B4.tif"
run_fax_test
FILE
=
"
${
ITUTESTS_DIR
}
/R1200_1200_B4.tif"
run_fax_test
FILE
=
"../itutests/fax/R1200_1200_A3.tif"
run_fax_test
OPTS
=
""
FILE
=
"../itutests/fax/R8_385_A4.tif"
run_fax_test
FILE
=
"../itutests/fax/R8_385_B4.tif"
run_fax_test
FILE
=
"../itutests/fax/R8_385_A3.tif"
run_fax_test
FILE
=
"../itutests/fax/R8_77_A4.tif"
run_fax_test
FILE
=
"../itutests/fax/R8_77_B4.tif"
run_fax_test
FILE
=
"../itutests/fax/R8_77_A3.tif"
run_fax_test
FILE
=
"../itutests/fax/R8_154_A4.tif"
run_fax_test
FILE
=
"../itutests/fax/R8_154_B4.tif"
run_fax_test
FILE
=
"../itutests/fax/R8_154_A3.tif"
run_fax_test
FILE
=
"../itutests/fax/R16_385_A4.tif"
#run_fax_test
FILE
=
"../itutests/fax/R16_385_B4.tif"
#run_fax_test
FILE
=
"../itutests/fax/R16_385_A3.tif"
#run_fax_test
FILE
=
"../itutests/fax/R16_77_A4.tif"
#run_fax_test
FILE
=
"../itutests/fax/R16_77_B4.tif"
#run_fax_test
FILE
=
"../itutests/fax/R16_77_A3.tif"
#run_fax_test
FILE
=
"../itutests/fax/R16_154_A4.tif"
run_fax_test
FILE
=
"../itutests/fax/R16_154_B4.tif"
run_fax_test
FILE
=
"../itutests/fax/R16_154_A3.tif"
run_fax_test
FILE
=
"
${
ITUTESTS_DIR
}
/R1200_1200_A3.tif"
run_fax_test
done
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论