Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
fce7cfee
提交
fce7cfee
authored
3月 19, 2016
作者:
Piotr Gregor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-8960 Set buffer position to beginning on reset
Now buffer position is reset to 0.
上级
4d180b1a
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
14 行增加
和
24 行删除
+14
-24
buffer.h
src/mod/applications/mod_avmd/buffer.h
+4
-3
mod_avmd.c
src/mod/applications/mod_avmd/mod_avmd.c
+6
-20
sma_buf.h
src/mod/applications/mod_avmd/sma_buf.h
+4
-1
没有找到文件。
src/mod/applications/mod_avmd/buffer.h
浏览文件 @
fce7cfee
...
@@ -92,13 +92,14 @@ extern size_t next_power_of_2(size_t v);
...
@@ -92,13 +92,14 @@ extern size_t next_power_of_2(size_t v);
//#define DESTROY_CIRC_BUFFER(b) free((b)->buf)
//#define DESTROY_CIRC_BUFFER(b) free((b)->buf)
#define GET_BACKLOG_POS(b) ((b)->lpos - (b)->backlog)
#define GET_BACKLOG_POS(b) ((b)->lpos - (b)->backlog)
#define GET_CURRENT_POS(b) ((b)->lpos)
#define GET_CURRENT_POS(b) ((b)->pos)
#define GET_CURRENT_SAMPLE(b) GET_SAMPLE((b), GET_CURRENT_POS((b)))
#define GET_CURRENT_LPOS(b) ((b)->lpos)
#define GET_CURRENT_SAMPLE(b) GET_SAMPLE((b), GET_CURRENT_LPOS((b)))
#define ADD_SAMPLE(b, s) \
#define ADD_SAMPLE(b, s) \
do { \
do { \
INC_POS((b)); \
INC_POS((b)); \
SET_SAMPLE((b), GET_CURRENT_POS((b)), (s)); \
SET_SAMPLE((b), GET_CURRENT_
L
POS((b)), (s)); \
} while (0)
} while (0)
#endif
#endif
...
...
src/mod/applications/mod_avmd/mod_avmd.c
浏览文件 @
fce7cfee
...
@@ -25,22 +25,9 @@
...
@@ -25,22 +25,9 @@
*
*
* This module detects voicemail beeps using a generalized approach.
* This module detects voicemail beeps using a generalized approach.
*
*
* Mofdifications:
* Modifications:
*
* Piotr Gregor <piotrek.gregor@gmail.com>:
* Piotr Gregor <piotrek.gregor@gmail.com>
* FS-8808, FS-8809, FS-8810, FS-8852, FS-8853, FS-8854, FS-8855
* FS-8808 : code refactor
* FS-8809 : fix MAP_POPULATE undeclared
* FS-8810 : fix float-int-float fast arc cosine
* mapping construction (reuse)
* FS-8852 : use predefined table length instead
* of hardcoded computation
* FS-8853 : enable change of resolution (and size)
* of fast arc cos table
* FS-8854 : initialize circular buffer
* FS-8855 : fix APPEND_SMA_VAL macro and avmd_process
* callback so that the variance of tone's
* frequency estimation is correctly
* calculated
*/
*/
#include <switch.h>
#include <switch.h>
...
@@ -91,7 +78,7 @@
...
@@ -91,7 +78,7 @@
/*! Maximum frequency as digital normalized frequency */
/*! Maximum frequency as digital normalized frequency */
#define MAX_FREQUENCY_R(r) ((2.0 * M_PI * MAX_FREQUENCY) / (r))
#define MAX_FREQUENCY_R(r) ((2.0 * M_PI * MAX_FREQUENCY) / (r))
/* decrease this value to eliminate false positives */
/* decrease this value to eliminate false positives */
#define VARIANCE_THRESHOLD (0.001)
#define VARIANCE_THRESHOLD (0.00
0
1)
#include "amplitude.h"
#include "amplitude.h"
#include "buffer.h"
#include "buffer.h"
...
@@ -233,7 +220,7 @@ static switch_bool_t avmd_callback(switch_media_bug_t * bug, void *user_data, sw
...
@@ -233,7 +220,7 @@ static switch_bool_t avmd_callback(switch_media_bug_t * bug, void *user_data, sw
/*! \brief FreeSWITCH module loading function.
/*! \brief FreeSWITCH module loading function.
*
*
* @author Eric des Courtis
* @author Eric des Courtis
* @par
Changes: Piotr Gregor, 07 Feb 2016 (FS-8809, FS-8810)
* @par
Modifications: Piotr Gregor
* @return On success SWITCH_STATUS_SUCCES,
* @return On success SWITCH_STATUS_SUCCES,
* on failure SWITCH_STATUS_TERM.
* on failure SWITCH_STATUS_TERM.
*/
*/
...
@@ -587,8 +574,7 @@ end:
...
@@ -587,8 +574,7 @@ end:
/*! \brief Process one frame of data with avmd algorithm.
/*! \brief Process one frame of data with avmd algorithm.
* @author Eric des Courtis
* @author Eric des Courtis
* @par Modifications: Piotr Gregor (FS-8852, FS-8853, FS-8854, FS-8855)
* @par Modifications: Piotr Gregor
* (improved variance estimation calculation)
* @param session An avmd session.
* @param session An avmd session.
* @param frame An audio frame.
* @param frame An audio frame.
*/
*/
...
...
src/mod/applications/mod_avmd/sma_buf.h
浏览文件 @
fce7cfee
...
@@ -31,7 +31,8 @@ typedef struct {
...
@@ -31,7 +31,8 @@ typedef struct {
#define GET_SMA_SAMPLE(b, p) ((b)->data[(p) % (b)->len])
#define GET_SMA_SAMPLE(b, p) ((b)->data[(p) % (b)->len])
#define SET_SMA_SAMPLE(b, p, v) ((b)->data[(p) % (b)->len] = (v))
#define SET_SMA_SAMPLE(b, p, v) ((b)->data[(p) % (b)->len] = (v))
#define GET_CURRENT_SMA_POS(b) ((b)->lpos)
#define GET_CURRENT_SMA_POS(b) ((b)->pos)
#define GET_CURRENT_SMA_LPOS(b) ((b)->lpos)
#define INC_SMA_POS(b) \
#define INC_SMA_POS(b) \
{ \
{ \
...
@@ -52,6 +53,8 @@ typedef struct {
...
@@ -52,6 +53,8 @@ typedef struct {
{ \
{ \
(b)->sma = 0.0; \
(b)->sma = 0.0; \
(void)memset((b)->data, 0, sizeof(BUFF_TYPE) * (b)->len); \
(void)memset((b)->data, 0, sizeof(BUFF_TYPE) * (b)->len); \
(b)->pos = 0; \
(b)->lpos = 0; \
}
}
/*
/*
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论