diff options
author | Benny Prijono <bennylp@teluu.com> | 2006-06-16 15:54:43 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2006-06-16 15:54:43 +0000 |
commit | b7898cf10e4e9048d28d858ccffcdf3937703752 (patch) | |
tree | acfb27e0e91a4011aa50ccf03dab8c8041283322 /pjmedia/include | |
parent | 5e067048948f7b9da5e0ae58212507239db54258 (diff) |
Optimizations mostly in the conference bridge (gained more than 3x faster)
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@513 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjmedia/include')
-rw-r--r-- | pjmedia/include/pjmedia/conference.h | 3 | ||||
-rw-r--r-- | pjmedia/include/pjmedia/types.h | 27 |
2 files changed, 24 insertions, 6 deletions
diff --git a/pjmedia/include/pjmedia/conference.h b/pjmedia/include/pjmedia/conference.h index 208a8743..7346f7c1 100644 --- a/pjmedia/include/pjmedia/conference.h +++ b/pjmedia/include/pjmedia/conference.h @@ -44,7 +44,8 @@ typedef struct pjmedia_conf_port_info pj_str_t name; /**< Port name. */ pjmedia_port_op tx_setting; /**< Transmit settings. */ pjmedia_port_op rx_setting; /**< Receive settings. */ - pj_bool_t *listener; /**< Array of listeners. */ + unsigned listener_cnt; /**< Number of listeners. */ + unsigned *listener_slots; /**< Array of listeners. */ unsigned clock_rate; /**< Clock rate of the port. */ unsigned channel_count; /**< Number of channels. */ unsigned samples_per_frame; /**< Samples per frame */ diff --git a/pjmedia/include/pjmedia/types.h b/pjmedia/include/pjmedia/types.h index 90f90b50..02edd9ff 100644 --- a/pjmedia/include/pjmedia/types.h +++ b/pjmedia/include/pjmedia/types.h @@ -20,7 +20,9 @@ #define __PJMEDIA_TYPES_H__ #include <pjmedia/config.h> -#include <pj/sock.h> +#include <pj/sock.h> /* pjmedia_sock_info */ +#include <pj/string.h> /* pj_memcpy(), pj_memset() */ + /** * Top most media type. @@ -124,9 +126,16 @@ typedef struct pjmedia_sock_info */ PJ_INLINE(void) pjmedia_zero_samples(pj_int16_t *samples, unsigned count) { +#if 1 + pj_memset(samples, 0, count*sizeof(pj_int16_t)); +#elif 0 + unsigned i; + for (i=0; i<count; ++i) samples[i] = 0; +#else unsigned i; - for (i=0; i<count; ++i) - samples[i] = 0; + count >>= 1; + for (i=0; i<count; ++i) ((pj_int32_t*)samples)[i] = (pj_int32_t)0; +#endif } @@ -139,9 +148,17 @@ PJ_INLINE(void) pjmedia_zero_samples(pj_int16_t *samples, unsigned count) PJ_INLINE(void) pjmedia_copy_samples(pj_int16_t *dst, const pj_int16_t *src, unsigned count) { +#if 1 + pj_memcpy(dst, src, count*sizeof(pj_int16_t)); +#elif 0 + unsigned i; + for (i=0; i<count; ++i) dst[i] = src[i]; +#else unsigned i; - for (i=0; i<count; ++i) - dst[i] = src[i]; + count >>= 1; + for (i=0; i<count; ++i) + ((pj_int32_t*)dst)[i] = ((pj_int32_t*)src)[i]; +#endif } |