Changeset 1941
- Timestamp:
- Apr 23, 2008 4:07:37 PM (16 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/include/pj/config_site_sample.h
r1911 r1941 27 27 # undef PJMEDIA_RESAMPLE_IMP 28 28 # define PJMEDIA_RESAMPLE_IMP PJMEDIA_RESAMPLE_LIBRESAMPLE 29 # define PJMEDIA_WSOLA_IMP PJMEDIA_WSOLA_IMP_NULL 29 30 #endif 30 31 … … 50 51 # define PJMEDIA_RESAMPLE_IMP PJMEDIA_RESAMPLE_NONE 51 52 # define PJMEDIA_HAS_SPEEX_AEC 0 53 # define PJMEDIA_WSOLA_IMP PJMEDIA_WSOLA_IMP_NULL 52 54 53 55 /* Disable all codecs but G.711 and GSM, for now */ -
pjproject/trunk/pjmedia/include/pjmedia/config.h
r1860 r1941 104 104 #ifndef PJMEDIA_SOUND_USE_DELAYBUF 105 105 # define PJMEDIA_SOUND_USE_DELAYBUF 0 106 #endif 107 108 109 /* 110 * Types of WSOLA backend algorithm. 111 */ 112 113 /** 114 * This denotes implementation of WSOLA using null algorithm. Expansion 115 * will generate zero frames, and compression will just discard some 116 * samples from the input. 117 * 118 * This type of implementation may be used as it requires the least 119 * processing power. 120 */ 121 #define PJMEDIA_WSOLA_IMP_NULL 0 122 123 /** 124 * This denotes implementation of WSOLA using fixed or floating point WSOLA 125 * algorithm. This implementation provides the best quality of the result, 126 * at the expense of one frame delay and intensive processing power 127 * requirement. 128 */ 129 #define PJMEDIA_WSOLA_IMP_WSOLA 1 130 131 132 /** 133 * Specify type of Waveform based Similarity Overlap and Add (WSOLA) backend 134 * implementation to be used. WSOLA is an algorithm to expand and/or compress 135 * audio frames without changing the pitch, and used by the delaybuf and as PLC 136 * backend algorithm. 137 * 138 * Default is PJMEDIA_WSOLA_IMP_WSOLA 139 */ 140 #ifndef PJMEDIA_WSOLA_IMP 141 # define PJMEDIA_WSOLA_IMP PJMEDIA_WSOLA_IMP_WSOLA 106 142 #endif 107 143 -
pjproject/trunk/pjmedia/src/pjmedia/wsola.c
r1875 r1941 23 23 #include <pj/pool.h> 24 24 25 /* 26 * This file contains implementation of WSOLA using PJMEDIA_WSOLA_IMP_WSOLA 27 * or PJMEDIA_WSOLA_IMP_NULL 28 */ 25 29 #define THIS_FILE "wsola.c" 26 30 27 //#undef PJ_HAS_FLOATING_POINT 31 32 #if PJMEDIA_WSOLA_IMP==PJMEDIA_WSOLA_IMP_WSOLA 33 /* 34 * WSOLA implementation using WSOLA 35 */ 28 36 29 37 /* History size, in percentage of samples_per_frame */ … … 721 729 722 730 731 #elif PJMEDIA_WSOLA_IMP==PJMEDIA_WSOLA_IMP_NULL 732 /* 733 * WSOLA implementation using NULL 734 */ 735 736 struct pjmedia_wsola 737 { 738 unsigned samples_per_frame; 739 }; 740 741 742 PJ_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 764 PJ_DEF(pj_status_t) pjmedia_wsola_destroy(pjmedia_wsola *wsola) 765 { 766 PJ_UNUSED_ARG(wsola); 767 return PJ_SUCCESS; 768 } 769 770 771 PJ_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 781 PJ_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 793 PJ_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 801 PJ_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.