summaryrefslogtreecommitdiff
path: root/pjmedia/include
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2006-06-14 20:04:04 +0000
committerBenny Prijono <bennylp@teluu.com>2006-06-14 20:04:04 +0000
commitf81429bfe9cc30624e606eff2aa45082ff8008da (patch)
tree06886d637ea9bfcabb31ff823f66521962a09d19 /pjmedia/include
parent9e09525cc5f7078a43b2564d7354f218787fe34d (diff)
Standardise clearing and copying frame with pjmedia_zero_samples() and pjmedia_copy_samples()
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@506 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjmedia/include')
-rw-r--r--pjmedia/include/pjmedia/types.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/pjmedia/include/pjmedia/types.h b/pjmedia/include/pjmedia/types.h
index f41edeb9..90f90b50 100644
--- a/pjmedia/include/pjmedia/types.h
+++ b/pjmedia/include/pjmedia/types.h
@@ -115,8 +115,9 @@ typedef struct pjmedia_sock_info
/**
* This is a general purpose function set PCM samples to zero.
- * Since this function is needed by many parts of the library, it is important
- * that the library should select the best performance for this.
+ * Since this function is needed by many parts of the library,
+ * by putting this functionality in one place, it enables some.
+ * clever people to optimize this function.
*
* @param samples The 16bit PCM samples.
* @param count Number of samples.
@@ -129,5 +130,20 @@ PJ_INLINE(void) pjmedia_zero_samples(pj_int16_t *samples, unsigned count)
}
+/**
+ * This is a general purpose function to copy samples from/to buffers with
+ * equal size. Since this function is needed by many parts of the library,
+ * by putting this functionality in one place, it enables some.
+ * clever people to optimize this function.
+ */
+PJ_INLINE(void) pjmedia_copy_samples(pj_int16_t *dst, const pj_int16_t *src,
+ unsigned count)
+{
+ unsigned i;
+ for (i=0; i<count; ++i)
+ dst[i] = src[i];
+}
+
+
#endif /* __PJMEDIA_TYPES_H__ */