Ignore:
Timestamp:
Feb 28, 2008 8:22:16 PM (11 years ago)
Author:
bennylp
Message:

Modify WSOLA discard to support erasing frame from non-contiguous buffer

File:
1 edited

Legend:

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

    r1734 r1827  
    191191{ 
    192192#if 1 
    193     pj_bzero(samples, count*sizeof(pj_int16_t)); 
     193    pj_bzero(samples, (count<<1)); 
    194194#elif 0 
    195195    unsigned i; 
     
    213213{ 
    214214#if 1 
    215     pj_memcpy(dst, src, count*sizeof(pj_int16_t)); 
     215    pj_memcpy(dst, src, (count<<1)); 
    216216#elif 0 
    217217    unsigned i; 
     
    227227 
    228228/** 
     229 * This is a general purpose function to copy samples from/to buffers with 
     230 * equal size. Since this function is needed by many parts of the library,  
     231 * by putting this functionality in one place, it enables some. 
     232 * clever people to optimize this function. 
     233 */ 
     234PJ_INLINE(void) pjmedia_move_samples(pj_int16_t *dst, const pj_int16_t *src, 
     235                                     unsigned count) 
     236{ 
     237#if 1 
     238    pj_memmove(dst, src, (count<<1)); 
     239#elif 0 
     240    unsigned i; 
     241    for (i=0; i<count; ++i) dst[i] = src[i]; 
     242#else 
     243    unsigned i; 
     244    count >>= 1; 
     245    for (i=0; i<count; ++i)  
     246        ((pj_int32_t*)dst)[i] = ((pj_int32_t*)src)[i]; 
     247#endif 
     248} 
     249 
     250/** 
    229251 * @} 
    230252 */ 
Note: See TracChangeset for help on using the changeset viewer.