Ignore:
Timestamp:
Jun 14, 2006 8:04:04 PM (18 years ago)
Author:
bennylp
Message:

Standardise clearing and copying frame with pjmedia_zero_samples() and pjmedia_copy_samples()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/include/pjmedia/types.h

    r438 r506  
    116116/** 
    117117 * This is a general purpose function set PCM samples to zero. 
    118  * Since this function is needed by many parts of the library, it is important 
    119  * that the library should select the best performance for this. 
     118 * Since this function is needed by many parts of the library,  
     119 * by putting this functionality in one place, it enables some. 
     120 * clever people to optimize this function. 
    120121 * 
    121122 * @param samples       The 16bit PCM samples. 
     
    130131 
    131132 
     133/** 
     134 * This is a general purpose function to copy samples from/to buffers with 
     135 * equal size. Since this function is needed by many parts of the library,  
     136 * by putting this functionality in one place, it enables some. 
     137 * clever people to optimize this function. 
     138 */ 
     139PJ_INLINE(void) pjmedia_copy_samples(pj_int16_t *dst, const pj_int16_t *src, 
     140                                     unsigned count) 
     141{ 
     142    unsigned i; 
     143    for (i=0; i<count; ++i) 
     144        dst[i] = src[i]; 
     145} 
     146 
     147 
    132148#endif  /* __PJMEDIA_TYPES_H__ */ 
    133149 
Note: See TracChangeset for help on using the changeset viewer.