diff options
author | Benny Prijono <bennylp@teluu.com> | 2007-04-07 16:17:33 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2007-04-07 16:17:33 +0000 |
commit | ff909fc7306b566d21558a510eaad4c85fe02412 (patch) | |
tree | 947f0b764b7b91513a8115315ec95665813482c3 | |
parent | 84b4b77d0eaf6533df04f173789bba881e11ba74 (diff) |
mv resample.c resample_resample.c
git-svn-id: http://svn.pjsip.org/repos/pjproject/branches/split-3rd-party@1174 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r-- | pjmedia/src/pjmedia/resample_resample.c (renamed from pjmedia/src/pjmedia/resample.c) | 7 | ||||
-rw-r--r-- | pjmedia/src/pjmedia/resample_speex.c | 30 |
2 files changed, 8 insertions, 29 deletions
diff --git a/pjmedia/src/pjmedia/resample.c b/pjmedia/src/pjmedia/resample_resample.c index 355e9993..fbb4a727 100644 --- a/pjmedia/src/pjmedia/resample.c +++ b/pjmedia/src/pjmedia/resample_resample.c @@ -477,6 +477,7 @@ struct pjmedia_resample PJ_DEF(pj_status_t) pjmedia_resample_create( pj_pool_t *pool, pj_bool_t high_quality, pj_bool_t large_filter, + unsigned channel_count, unsigned rate_in, unsigned rate_out, unsigned samples_per_frame, @@ -490,6 +491,8 @@ PJ_DEF(pj_status_t) pjmedia_resample_create( pj_pool_t *pool, resample = pj_pool_alloc(pool, sizeof(pjmedia_resample)); PJ_ASSERT_RETURN(resample, PJ_ENOMEM); + PJ_UNUSED_ARG(channel_count); + /* * If we're downsampling, always use the fast algorithm since it seems * to yield the same quality. @@ -702,3 +705,7 @@ PJ_DEF(unsigned) pjmedia_resample_get_input_size(pjmedia_resample *resample) return resample->frame_size; } +PJ_DEF(void) pjmedia_resample_destroy(pjmedia_resample *resample) +{ + PJ_UNUSED_ARG(resample); +} diff --git a/pjmedia/src/pjmedia/resample_speex.c b/pjmedia/src/pjmedia/resample_speex.c index 85849466..447d3f6a 100644 --- a/pjmedia/src/pjmedia/resample_speex.c +++ b/pjmedia/src/pjmedia/resample_speex.c @@ -31,10 +31,6 @@ struct pjmedia_resample { SpeexResamplerState *state; -#if defined(PJ_HAS_FLOATING_POINT) && PJ_HAS_FLOATING_POINT != 0 - float *in_buffer; - float *out_buffer; -#endif unsigned in_samples_per_frame; unsigned out_samples_per_frame; }; @@ -61,7 +57,7 @@ PJ_DEF(pj_status_t) pjmedia_resample_create( pj_pool_t *pool, if (high_quality) { if (large_filter) - quality = 8; + quality = 10; else quality = 7; } else { @@ -75,12 +71,6 @@ PJ_DEF(pj_status_t) pjmedia_resample_create( pj_pool_t *pool, if (resample->state == NULL || err != RESAMPLER_ERR_SUCCESS) return PJ_ENOMEM; -#if defined(PJ_HAS_FLOATING_POINT) && PJ_HAS_FLOATING_POINT != 0 - resample->in_buffer = pj_pool_calloc(pool, resample->in_samples_per_frame, - sizeof(float)); - resample->out_buffer=pj_pool_calloc(pool, resample->out_samples_per_frame, - sizeof(float)); -#endif *p_resample = resample; @@ -96,33 +86,15 @@ PJ_DEF(void) pjmedia_resample_run( pjmedia_resample *resample, pj_int16_t *output ) { spx_uint32_t in_length, out_length; - float *fp; - unsigned i; PJ_ASSERT_ON_FAIL(resample, return); in_length = resample->in_samples_per_frame; out_length = resample->out_samples_per_frame; -#if defined(PJ_HAS_FLOATING_POINT) && PJ_HAS_FLOATING_POINT != 0 - fp = resample->in_buffer; - for (i=0; i<in_length; ++i) { - fp[i] = input[i]; - } - speex_resampler_process_interleaved_float(resample->state, - resample->in_buffer, &in_length, - resample->out_buffer, &out_length); - fp = resample->out_buffer; - for (i=0; i<out_length; ++i) { - output[i] = (pj_int16_t)fp[i]; - } -#else - PJ_UNUSED_ARG(dst); - PJ_UNUSED_ARG(i); speex_resampler_process_interleaved_int(resample->state, (const __int16 *)input, &in_length, (__int16 *)output, &out_length); -#endif pj_assert(in_length == resample->in_samples_per_frame); pj_assert(out_length == resample->out_samples_per_frame); |