- Timestamp:
- Apr 7, 2007 4:17:33 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.