mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-13 21:17:06 +00:00
add mod_avmd for win
This commit is contained in:
1 parent
e00d2af95e
commit
df4bd93545
7 files changed
+408
-27
No files matched your search
@@ -2,7 +2,9 @@
|
||||
#define __SMA_BUFFER_H__
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#ifndef _MSC_VER
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include "buffer.h"
|
||||
@@ -16,7 +18,7 @@ typedef struct {
|
||||
} sma_buffer_t;
|
||||
|
||||
#define INIT_SMA_BUFFER(b, l, s) \
|
||||
do{ \
|
||||
{ \
|
||||
(void)memset((b), 0, sizeof(sma_buffer_t)); \
|
||||
(b)->len = (l); \
|
||||
(b)->data = (BUFF_TYPE *)switch_core_session_alloc((s), sizeof(BUFF_TYPE) * (l)); \
|
||||
@@ -25,31 +27,31 @@ typedef struct {
|
||||
(b)->sma = 0.0; \
|
||||
(b)->pos = 0; \
|
||||
(b)->lpos = 0; \
|
||||
}while(0)
|
||||
}
|
||||
|
||||
#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 GET_CURRENT_SMA_POS(b) ((b)->lpos)
|
||||
|
||||
#define INC_SMA_POS(b) \
|
||||
do { \
|
||||
{ \
|
||||
(b)->lpos++; \
|
||||
(b)->pos = (b)->lpos % (b)->len; \
|
||||
}while(0)
|
||||
}
|
||||
|
||||
#define APPEND_SMA_VAL(b, v) \
|
||||
do{ \
|
||||
{ \
|
||||
INC_SMA_POS(b); \
|
||||
(b)->sma -= ((b)->data[(b)->pos] / (BUFF_TYPE)(b)->len); \
|
||||
(b)->data[(b)->pos] = (v); \
|
||||
(b)->sma += ((b)->data[(b)->pos] / (BUFF_TYPE)(b)->len); \
|
||||
}while(0)
|
||||
}
|
||||
|
||||
#define RESET_SMA_BUFFER(b) \
|
||||
do{ \
|
||||
{ \
|
||||
(b)->sma = 0.0; \
|
||||
(void)memset((b)->data, 0, sizeof(BUFF_TYPE) * (b)->len); \
|
||||
}while(0)
|
||||
}
|
||||
|
||||
/*
|
||||
#define DESTROY_SMA_BUFFER(b) \
|
||||
|
||||
Reference in new issue
Block a user