- Timestamp:
- Apr 7, 2007 4:17:33 PM (18 years ago)
- Location:
- pjproject/branches/split-3rd-party/pjmedia/src/pjmedia
- Files:
-
- 1 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/split-3rd-party/pjmedia/src/pjmedia/resample_resample.c
r1173 r1174 478 478 pj_bool_t high_quality, 479 479 pj_bool_t large_filter, 480 unsigned channel_count, 480 481 unsigned rate_in, 481 482 unsigned rate_out, … … 490 491 resample = pj_pool_alloc(pool, sizeof(pjmedia_resample)); 491 492 PJ_ASSERT_RETURN(resample, PJ_ENOMEM); 493 494 PJ_UNUSED_ARG(channel_count); 492 495 493 496 /* … … 703 706 } 704 707 708 PJ_DEF(void) pjmedia_resample_destroy(pjmedia_resample *resample) 709 { 710 PJ_UNUSED_ARG(resample); 711 } -
pjproject/branches/split-3rd-party/pjmedia/src/pjmedia/resample_speex.c
r1172 r1174 32 32 { 33 33 SpeexResamplerState *state; 34 #if defined(PJ_HAS_FLOATING_POINT) && PJ_HAS_FLOATING_POINT != 035 float *in_buffer;36 float *out_buffer;37 #endif38 34 unsigned in_samples_per_frame; 39 35 unsigned out_samples_per_frame; … … 62 58 if (high_quality) { 63 59 if (large_filter) 64 quality = 8;60 quality = 10; 65 61 else 66 62 quality = 7; … … 76 72 return PJ_ENOMEM; 77 73 78 #if defined(PJ_HAS_FLOATING_POINT) && PJ_HAS_FLOATING_POINT != 079 resample->in_buffer = pj_pool_calloc(pool, resample->in_samples_per_frame,80 sizeof(float));81 resample->out_buffer=pj_pool_calloc(pool, resample->out_samples_per_frame,82 sizeof(float));83 #endif84 74 85 75 *p_resample = resample; … … 97 87 { 98 88 spx_uint32_t in_length, out_length; 99 float *fp;100 unsigned i;101 89 102 90 PJ_ASSERT_ON_FAIL(resample, return); … … 105 93 out_length = resample->out_samples_per_frame; 106 94 107 #if defined(PJ_HAS_FLOATING_POINT) && PJ_HAS_FLOATING_POINT != 0108 fp = resample->in_buffer;109 for (i=0; i<in_length; ++i) {110 fp[i] = input[i];111 }112 speex_resampler_process_interleaved_float(resample->state,113 resample->in_buffer, &in_length,114 resample->out_buffer, &out_length);115 fp = resample->out_buffer;116 for (i=0; i<out_length; ++i) {117 output[i] = (pj_int16_t)fp[i];118 }119 #else120 PJ_UNUSED_ARG(dst);121 PJ_UNUSED_ARG(i);122 95 speex_resampler_process_interleaved_int(resample->state, 123 96 (const __int16 *)input, &in_length, 124 97 (__int16 *)output, &out_length); 125 #endif126 98 127 99 pj_assert(in_length == resample->in_samples_per_frame);
Note: See TracChangeset
for help on using the changeset viewer.