Changeset 2117
- Timestamp:
- Jul 10, 2008 7:26:03 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/wsola.c
r2115 r2117 40 40 41 41 /* Buffer size including history, in frames */ 42 #define FRAME_CNT 542 #define FRAME_CNT 6 43 43 44 44 /* Number of history frames in buffer */ … … 53 53 /* Number of frames in erase buffer */ 54 54 #define ERASE_CNT ((unsigned)3) 55 56 /* Minimum distance from template for find_pitch() of expansion, in frames */ 57 #define EXP_MIN_DIST 0.5 58 59 /* Maximum distance from template for find_pitch() of expansion, in frames */ 60 #define EXP_MAX_DIST HIST_CNT 55 61 56 62 … … 114 120 pj_uint16_t min_extra; /* Minimum extra (const) */ 115 121 pj_uint16_t expand_cnt; /* Consecutive expansion count */ 122 pj_uint16_t expand_sr_min_dist;/* Minimum distance from template 123 for find_pitch() on expansion 124 (const) */ 125 pj_uint16_t expand_sr_max_dist;/* Maximum distance from template 126 for find_pitch() on expansion 127 (const) */ 116 128 117 129 #if defined(PJ_HAS_FLOATING_POINT) && PJ_HAS_FLOATING_POINT!=0 … … 480 492 if ((options & PJMEDIA_WSOLA_NO_PLC) == 0) { 481 493 wsola->min_extra = wsola->hanning_size; 494 wsola->expand_sr_min_dist = (pj_uint16_t) 495 (EXP_MIN_DIST * wsola->samples_per_frame); 496 wsola->expand_sr_max_dist = (pj_uint16_t) 497 (EXP_MAX_DIST * wsola->samples_per_frame); 482 498 } 483 499 … … 539 555 for (rep=1;; ++rep) { 540 556 pj_int16_t *start, *templ; 541 unsigned min_dist, max_dist,dist;557 unsigned dist; 542 558 543 559 templ = reg1 + reg1_len - wsola->hanning_size; 544 560 CHECK_(templ - reg1 >= wsola->hist_size); 545 561 546 max_dist = wsola->hist_size;547 min_dist = wsola->hanning_size >> 1;548 549 start = find_pitch(templ, templ - max_dist, templ - min_dist,550 wsola->templ_size,1);562 start = find_pitch(templ, 563 templ - wsola->expand_sr_max_dist, 564 templ - wsola->expand_sr_min_dist, 565 wsola->templ_size, 566 1); 551 567 552 568 /* Should we make sure that "start" is really aligned to
Note: See TracChangeset
for help on using the changeset viewer.