Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
efaa3a6d
提交
efaa3a6d
authored
3月 15, 2013
作者:
Steve Underwood
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Small cleanup of image handling
上级
69bd8edf
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
112 行增加
和
57 行删除
+112
-57
spandsp.h
libs/spandsp/src/msvc/spandsp.h
+0
-1
t42.h
libs/spandsp/src/spandsp/t42.h
+51
-2
t85.h
libs/spandsp/src/spandsp/t85.h
+55
-42
t42.c
libs/spandsp/src/t42.c
+0
-6
t85_encode.c
libs/spandsp/src/t85_encode.c
+6
-6
没有找到文件。
libs/spandsp/src/msvc/spandsp.h
浏览文件 @
efaa3a6d
...
...
@@ -98,7 +98,6 @@
#include <spandsp/v29tx.h>
#include <spandsp/v17rx.h>
#include <spandsp/v17tx.h>
/*#include <spandsp/v32bis.h> not sure why this is here I cant find it in the filesystem */
#include <spandsp/v22bis.h>
#include <spandsp/v27ter_rx.h>
#include <spandsp/v27ter_tx.h>
...
...
libs/spandsp/src/spandsp/t42.h
浏览文件 @
efaa3a6d
...
...
@@ -104,26 +104,60 @@ SPAN_DECLARE(int) t42_encode_set_row_read_handler(t42_encode_state_t *s,
\return A pointer to the logging context */
SPAN_DECLARE
(
logging_state_t
*
)
t42_encode_get_logging_state
(
t42_encode_state_t
*
s
);
/*! \brief Restart a T.42 encode context.
\param s The T.42 context.
\param image image_width The image width, in pixels.
\param image image_width The image length, in pixels.
\return 0 for success, otherwise -1. */
SPAN_DECLARE
(
int
)
t42_encode_restart
(
t42_encode_state_t
*
s
,
uint32_t
image_width
,
uint32_t
image_length
);
/*! \brief Prepare to encode an image in T.42 format.
\param s The T.42 context.
\param image_width Image width, in pixels.
\param image_length Image length, in pixels.
\param handler A callback routine to handle encoded image rows.
\param user_data An opaque pointer passed to handler.
\return A pointer to the context, or NULL if there was a problem. */
SPAN_DECLARE
(
t42_encode_state_t
*
)
t42_encode_init
(
t42_encode_state_t
*
s
,
uint32_t
image_width
,
uint32_t
image_length
,
t4_row_read_handler_t
handler
,
void
*
user_data
);
/*! \brief Release a T.42 encode context.
\param s The T.42 encode context.
\return 0 for OK, else -1. */
SPAN_DECLARE
(
int
)
t42_encode_release
(
t42_encode_state_t
*
s
);
/*! \brief Free a T.42 encode context.
\param s The T.42 encode context.
\return 0 for OK, else -1. */
SPAN_DECLARE
(
int
)
t42_encode_free
(
t42_encode_state_t
*
s
);
SPAN_DECLARE
(
void
)
t42_decode_rx_status
(
t42_decode_state_t
*
s
,
int
status
);
/*! \brief Decode a chunk of T.42 data.
\param s The T.42 context.
\param data The data to be decoded.
\param len The length of the data to be decoded.
\return 0 for OK. */
SPAN_DECLARE
(
int
)
t42_decode_put
(
t42_decode_state_t
*
s
,
const
uint8_t
data
[],
size_t
len
);
/*! \brief Set the row handler routine.
\param s The T.42 context.
\param handler A callback routine to handle decoded image rows.
\param user_data An opaque pointer passed to handler.
\return 0 for OK. */
SPAN_DECLARE
(
int
)
t42_decode_set_row_write_handler
(
t42_decode_state_t
*
s
,
t4_row_write_handler_t
handler
,
void
*
user_data
);
/*! \brief Set the comment handler routine.
\param s The T.42 context.
\param max_comment_len The maximum length of comment to be passed to the handler.
\param handler A callback routine to handle decoded comment.
\param user_data An opaque pointer passed to handler.
\return 0 for OK. */
SPAN_DECLARE
(
int
)
t42_decode_set_comment_handler
(
t42_decode_state_t
*
s
,
uint32_t
max_comment_len
,
t4_row_write_handler_t
handler
,
...
...
@@ -133,14 +167,18 @@ SPAN_DECLARE(int) t42_decode_set_image_size_constraints(t42_decode_state_t *s,
uint32_t
max_xd
,
uint32_t
max_yd
);
/*! \brief Get the width of the image.
\param s The T.42 context.
\return The width of the image, in pixels. */
SPAN_DECLARE
(
uint32_t
)
t42_decode_get_image_width
(
t42_decode_state_t
*
s
);
/*! \brief Get the length of the image.
\param s The T.42 context.
\return The length of the image, in pixels. */
SPAN_DECLARE
(
uint32_t
)
t42_decode_get_image_length
(
t42_decode_state_t
*
s
);
SPAN_DECLARE
(
int
)
t42_decode_get_compressed_image_size
(
t42_decode_state_t
*
s
);
SPAN_DECLARE
(
int
)
t42_decode_new_plane
(
t42_decode_state_t
*
s
);
/*! Get the logging context associated with a T.42 decode context.
\brief Get the logging context associated with a T.42 decode context.
\param s The T.42 decode context.
...
...
@@ -149,12 +187,23 @@ SPAN_DECLARE(logging_state_t *) t42_decode_get_logging_state(t42_decode_state_t
SPAN_DECLARE
(
int
)
t42_decode_restart
(
t42_decode_state_t
*
s
);
/*! \brief Prepare to decode an image in T.42 format.
\param s The T.42 context.
\param handler A callback routine to handle decoded image rows.
\param user_data An opaque pointer passed to handler.
\return A pointer to the context, or NULL if there was a problem. */
SPAN_DECLARE
(
t42_decode_state_t
*
)
t42_decode_init
(
t42_decode_state_t
*
s
,
t4_row_write_handler_t
handler
,
void
*
user_data
);
/*! \brief Release a T.42 decode context.
\param s The T.42 decode context.
\return 0 for OK, else -1. */
SPAN_DECLARE
(
int
)
t42_decode_release
(
t42_decode_state_t
*
s
);
/*! \brief Free a T.42 decode context.
\param s The T.42 decode context.
\return 0 for OK, else -1. */
SPAN_DECLARE
(
int
)
t42_decode_free
(
t42_decode_state_t
*
s
);
#if defined(__cplusplus)
...
...
libs/spandsp/src/spandsp/t85.h
浏览文件 @
efaa3a6d
...
...
@@ -93,31 +93,6 @@ SPAN_DECLARE(int) t85_encode_set_row_read_handler(t85_encode_state_t *s,
\return A pointer to the logging context */
SPAN_DECLARE
(
logging_state_t
*
)
t85_encode_get_logging_state
(
t85_encode_state_t
*
s
);
/*! \brief Prepare to encode an image in T.85 format.
\param s The T.85 context.
\param image_width Image width, in pixels.
\param image_length Image length, in pixels.
\param handler A callback routine to handle encoded image rows.
\param user_data An opaque pointer passed to handler.
\return A pointer to the context, or NULL if there was a problem. */
SPAN_DECLARE
(
t85_encode_state_t
*
)
t85_encode_init
(
t85_encode_state_t
*
s
,
uint32_t
image_width
,
uint32_t
image_length
,
t4_row_read_handler_t
handler
,
void
*
user_data
);
/*! \brief Restart a T.85 encode context.
\param s The T.85 context.
\param image width The image width, in pixels.
\return 0 for success, otherwise -1. */
SPAN_DECLARE
(
int
)
t85_encode_restart
(
t85_encode_state_t
*
s
,
uint32_t
image_width
,
uint32_t
image_length
);
SPAN_DECLARE
(
int
)
t85_encode_release
(
t85_encode_state_t
*
s
);
SPAN_DECLARE
(
int
)
t85_encode_free
(
t85_encode_state_t
*
s
);
/*! \brief Set the T.85 options
\param s The T.85 context.
\brief l0 ???
...
...
@@ -138,7 +113,7 @@ SPAN_DECLARE(void) t85_encode_comment(t85_encode_state_t *s,
/*! \brief Set the image width.
\param s The T.85 context.
\param width The width of the image.
\param
image_
width The width of the image.
\return 0 for success, otherwise -1. */
SPAN_DECLARE
(
int
)
t85_encode_set_image_width
(
t85_encode_state_t
*
s
,
uint32_t
image_width
);
...
...
@@ -147,9 +122,9 @@ SPAN_DECLARE(int) t85_encode_set_image_width(t85_encode_state_t *s, uint32_t ima
will be silently adjusted to the current length. Therefore, adjust the length to 1
will make the currently encoded length the final length.
\param s The T.85 context.
\param length The new image length, in pixels.
\param
image_
length The new image length, in pixels.
\return 0 if OK, or -1 if the request was not valid. */
SPAN_DECLARE
(
int
)
t85_encode_set_image_length
(
t85_encode_state_t
*
s
,
uint32_t
length
);
SPAN_DECLARE
(
int
)
t85_encode_set_image_length
(
t85_encode_state_t
*
s
,
uint32_t
image_
length
);
/*! \brief Get the width of the image.
\param s The T.85 context.
...
...
@@ -170,28 +145,43 @@ SPAN_DECLARE(int) t85_encode_get_compressed_image_size(t85_encode_state_t *s);
\param s The T.85 context. */
SPAN_DECLARE
(
void
)
t85_encode_abort
(
t85_encode_state_t
*
s
);
/*! Get the logging context associated with a T.85 decode context.
\brief Get the logging context associated with a T.85 decode context.
\param s The T.85 decode context.
\return A pointer to the logging context */
SPAN_DECLARE
(
logging_state_t
*
)
t85_decode_get_logging_state
(
t85_decode_state_t
*
s
);
/*! \brief Restart a T.85 encode context.
\param s The T.85 context.
\param image_width The image width, in pixels.
\param image_length The image length, in pixels.
\return 0 for success, otherwise -1. */
SPAN_DECLARE
(
int
)
t85_encode_restart
(
t85_encode_state_t
*
s
,
uint32_t
image_width
,
uint32_t
image_length
);
/*! \brief Prepare to
de
code an image in T.85 format.
/*! \brief Prepare to
en
code an image in T.85 format.
\param s The T.85 context.
\param handler A callback routine to handle decoded image rows.
\param image_width The image width, in pixels.
\param image_length The image length, in pixels.
\param handler A callback routine to handle encoded image rows.
\param user_data An opaque pointer passed to handler.
\return A pointer to the context, or NULL if there was a problem. */
SPAN_DECLARE
(
t85_decode_state_t
*
)
t85_decode_init
(
t85_decode_state_t
*
s
,
t4_row_write_handler_t
handler
,
SPAN_DECLARE
(
t85_encode_state_t
*
)
t85_encode_init
(
t85_encode_state_t
*
s
,
uint32_t
image_width
,
uint32_t
image_length
,
t4_row_read_handler_t
handler
,
void
*
user_data
);
SPAN_DECLARE
(
int
)
t85_decode_new_plane
(
t85_decode_state_t
*
s
);
SPAN_DECLARE
(
int
)
t85_decode_restart
(
t85_decode_state_t
*
s
);
/*! \brief Release a T.85 encode context.
\param s The T.85 encode context.
\return 0 for OK, else -1. */
SPAN_DECLARE
(
int
)
t85_encode_release
(
t85_encode_state_t
*
s
);
SPAN_DECLARE
(
int
)
t85_decode_release
(
t85_decode_state_t
*
s
);
/*! \brief Free a T.85 encode context.
\param s The T.85 encode context.
\return 0 for OK, else -1. */
SPAN_DECLARE
(
int
)
t85_encode_free
(
t85_encode_state_t
*
s
);
SPAN_DECLARE
(
int
)
t85_decode_free
(
t85_decode_state_t
*
s
);
/*! Get the logging context associated with a T.85 decode context.
\brief Get the logging context associated with a T.85 decode context.
\param s The T.85 decode context.
\return A pointer to the logging context */
SPAN_DECLARE
(
logging_state_t
*
)
t85_decode_get_logging_state
(
t85_decode_state_t
*
s
);
/*! \brief Get the width of the image.
\param s The T.85 context.
...
...
@@ -208,6 +198,8 @@ SPAN_DECLARE(uint32_t) t85_decode_get_image_length(t85_decode_state_t *s);
\return The size of the compressed image, in bits. */
SPAN_DECLARE
(
int
)
t85_decode_get_compressed_image_size
(
t85_decode_state_t
*
s
);
SPAN_DECLARE
(
int
)
t85_decode_new_plane
(
t85_decode_state_t
*
s
);
/*! \brief Set the row handler routine.
\param s The T.85 context.
\param handler A callback routine to handle decoded image rows.
...
...
@@ -263,6 +255,27 @@ SPAN_DECLARE(void) t85_decode_rx_status(t85_decode_state_t *s, int status);
\return 0 for OK. */
SPAN_DECLARE
(
int
)
t85_decode_put
(
t85_decode_state_t
*
s
,
const
uint8_t
data
[],
size_t
len
);
SPAN_DECLARE
(
int
)
t85_decode_restart
(
t85_decode_state_t
*
s
);
/*! \brief Prepare to decode an image in T.85 format.
\param s The T.85 context.
\param handler A callback routine to handle decoded image rows.
\param user_data An opaque pointer passed to handler.
\return A pointer to the context, or NULL if there was a problem. */
SPAN_DECLARE
(
t85_decode_state_t
*
)
t85_decode_init
(
t85_decode_state_t
*
s
,
t4_row_write_handler_t
handler
,
void
*
user_data
);
/*! \brief Release a T.85 decode context.
\param s The T.85 decode context.
\return 0 for OK, else -1. */
SPAN_DECLARE
(
int
)
t85_decode_release
(
t85_decode_state_t
*
s
);
/*! \brief Free a T.85 decode context.
\param s The T.85 decode context.
\return 0 for OK, else -1. */
SPAN_DECLARE
(
int
)
t85_decode_free
(
t85_decode_state_t
*
s
);
#if defined(__cplusplus)
}
#endif
...
...
libs/spandsp/src/t42.c
浏览文件 @
efaa3a6d
...
...
@@ -1361,12 +1361,6 @@ SPAN_DECLARE(int) t42_decode_get_compressed_image_size(t42_decode_state_t *s)
}
/*- End of function --------------------------------------------------------*/
SPAN_DECLARE
(
int
)
t42_decode_new_plane
(
t42_decode_state_t
*
s
)
{
return
0
;
}
/*- End of function --------------------------------------------------------*/
SPAN_DECLARE
(
logging_state_t
*
)
t42_decode_get_logging_state
(
t42_decode_state_t
*
s
)
{
return
&
s
->
logging
;
...
...
libs/spandsp/src/t85_encode.c
浏览文件 @
efaa3a6d
...
...
@@ -529,13 +529,13 @@ SPAN_DECLARE(int) t85_encode_set_image_width(t85_encode_state_t *s, uint32_t ima
}
/*- End of function --------------------------------------------------------*/
SPAN_DECLARE
(
int
)
t85_encode_set_image_length
(
t85_encode_state_t
*
s
,
uint32_t
length
)
SPAN_DECLARE
(
int
)
t85_encode_set_image_length
(
t85_encode_state_t
*
s
,
uint32_t
image_
length
)
{
/* We must have variable length enabled.
We do not allow the length to be changed multiple times.
We only allow an image to be shrunk, and not stretched.
We do not allow the length to become zero. */
if
(
!
(
s
->
options
&
T85_VLENGTH
)
||
s
->
newlen
==
NEWLEN_HANDLED
||
length
>=
s
->
yd
||
length
<
1
)
if
(
!
(
s
->
options
&
T85_VLENGTH
)
||
s
->
newlen
==
NEWLEN_HANDLED
||
image_length
>=
s
->
yd
||
image_
length
<
1
)
{
/* Invalid parameter */
return
-
1
;
...
...
@@ -544,12 +544,12 @@ SPAN_DECLARE(int) t85_encode_set_image_length(t85_encode_state_t *s, uint32_t le
{
/* TODO: If we are already beyond the new length, we scale back the new length silently.
Is there any downside to this? */
if
(
length
<
s
->
y
)
length
=
s
->
y
;
if
(
s
->
yd
!=
length
)
if
(
image_
length
<
s
->
y
)
image_
length
=
s
->
y
;
if
(
s
->
yd
!=
image_
length
)
s
->
newlen
=
NEWLEN_PENDING
;
}
s
->
yd
=
length
;
s
->
yd
=
image_
length
;
if
(
s
->
y
==
s
->
yd
)
{
/* We are already at the end of the image, so finish it off. */
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论