Changeset 1941 for pjproject/trunk/pjmedia/src/pjmedia/wsola.c
- Timestamp:
- Apr 23, 2008 4:07:37 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.