Ignore:
Timestamp:
Apr 23, 2008 4:07:37 PM (16 years ago)
Author:
bennylp
Message:

More ticket #497: added configuration to disable WSOLA and set default to disabled on WinCE and Symbian

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia/wsola.c

    r1875 r1941  
    2323#include <pj/pool.h> 
    2424 
     25/* 
     26 * This file contains implementation of WSOLA using PJMEDIA_WSOLA_IMP_WSOLA 
     27 * or PJMEDIA_WSOLA_IMP_NULL 
     28 */ 
    2529#define THIS_FILE   "wsola.c" 
    2630 
    27 //#undef PJ_HAS_FLOATING_POINT 
     31 
     32#if PJMEDIA_WSOLA_IMP==PJMEDIA_WSOLA_IMP_WSOLA 
     33/* 
     34 * WSOLA implementation using WSOLA 
     35 */ 
    2836 
    2937/* History size, in percentage of samples_per_frame */ 
     
    721729 
    722730 
     731#elif PJMEDIA_WSOLA_IMP==PJMEDIA_WSOLA_IMP_NULL 
     732/* 
     733 * WSOLA implementation using NULL 
     734 */ 
     735 
     736struct pjmedia_wsola 
     737{ 
     738    unsigned samples_per_frame; 
     739}; 
     740 
     741 
     742PJ_DEF(pj_status_t) pjmedia_wsola_create( pj_pool_t *pool,  
     743                                          unsigned clock_rate, 
     744                                          unsigned samples_per_frame, 
     745                                          unsigned channel_count, 
     746                                          unsigned options, 
     747                                          pjmedia_wsola **p_wsola) 
     748{ 
     749    pjmedia_wsola *wsola; 
     750 
     751    wsola = PJ_POOL_ZALLOC_T(pool, struct pjmedia_wsola); 
     752    wsola->samples_per_frame = samples_per_frame; 
     753 
     754    PJ_UNUSED_ARG(clock_rate); 
     755    PJ_UNUSED_ARG(channel_count); 
     756    PJ_UNUSED_ARG(options); 
     757 
     758    *p_wsola = wsola; 
     759 
     760    return PJ_SUCCESS; 
     761} 
     762 
     763 
     764PJ_DEF(pj_status_t) pjmedia_wsola_destroy(pjmedia_wsola *wsola) 
     765{ 
     766    PJ_UNUSED_ARG(wsola); 
     767    return PJ_SUCCESS; 
     768} 
     769 
     770 
     771PJ_DEF(pj_status_t) pjmedia_wsola_reset( pjmedia_wsola *wsola, 
     772                                         unsigned options) 
     773{ 
     774    PJ_UNUSED_ARG(wsola); 
     775    PJ_UNUSED_ARG(options); 
     776 
     777    return PJ_SUCCESS; 
     778} 
     779 
     780 
     781PJ_DEF(pj_status_t) pjmedia_wsola_save( pjmedia_wsola *wsola,  
     782                                        short frm[],  
     783                                        pj_bool_t prev_lost) 
     784{ 
     785    PJ_UNUSED_ARG(wsola); 
     786    PJ_UNUSED_ARG(frm); 
     787    PJ_UNUSED_ARG(prev_lost); 
     788 
     789    return PJ_SUCCESS; 
     790} 
     791 
     792 
     793PJ_DEF(pj_status_t) pjmedia_wsola_generate( pjmedia_wsola *wsola,  
     794                                            short frm[]) 
     795{ 
     796    pjmedia_zero_samples(frm, wsola->samples_per_frame); 
     797    return PJ_SUCCESS; 
     798} 
     799 
     800 
     801PJ_DEF(pj_status_t) pjmedia_wsola_discard( pjmedia_wsola *wsola,  
     802                                           short buf1[], 
     803                                           unsigned buf1_cnt,  
     804                                           short buf2[], 
     805                                           unsigned buf2_cnt, 
     806                                           unsigned *del_cnt) 
     807{ 
     808    pj_assert(buf1_cnt + buf2_cnt >= wsola->samples_per_frame); 
     809 
     810    PJ_UNUSED_ARG(buf1); 
     811    PJ_UNUSED_ARG(buf1_cnt); 
     812    PJ_UNUSED_ARG(buf2); 
     813    PJ_UNUSED_ARG(buf2_cnt); 
     814 
     815    *del_cnt = wsola->samples_per_frame; 
     816 
     817    return PJ_SUCCESS; 
     818} 
     819 
     820 
     821#endif  /* #if PJMEDIA_WSOLA_IMP.. */ 
     822 
     823 
Note: See TracChangeset for help on using the changeset viewer.