diff options
author | Nanang Izzuddin <nanang@teluu.com> | 2010-06-11 13:38:42 +0000 |
---|---|---|
committer | Nanang Izzuddin <nanang@teluu.com> | 2010-06-11 13:38:42 +0000 |
commit | 478d7fed9b2d5713500c91dd296356b7ea939502 (patch) | |
tree | 8e2b057e5f4838a51e5ab954cf3e683f830ebb69 /pjmedia/src/pjmedia-codec/g722 | |
parent | f58cd5dab31fb33928ff092f534b4145873c8dad (diff) |
Close #1072:
- Added API pjmedia_codec_g722_set_pcm_shift() to enable configurable level-adjusment setting.
- Also added macro PJMEDIA_G722_DEFAULT_PCM_SHIFT (default value is 2) to accomplish 14-16 bit PCM conversion for G722 input/output.
- Added a feature in G722 to stop level-adjusment/PCM-shifting when clipping occured, compile-time configurable via PJMEDIA_G722_STOP_PCM_SHIFT_ON_CLIPPING macro.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3202 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjmedia/src/pjmedia-codec/g722')
-rw-r--r-- | pjmedia/src/pjmedia-codec/g722/g722_dec.c | 5 | ||||
-rw-r--r-- | pjmedia/src/pjmedia-codec/g722/g722_enc.c | 2 |
2 files changed, 2 insertions, 5 deletions
diff --git a/pjmedia/src/pjmedia-codec/g722/g722_dec.c b/pjmedia/src/pjmedia-codec/g722/g722_dec.c index 887fcb93..1579d06e 100644 --- a/pjmedia/src/pjmedia-codec/g722/g722_dec.c +++ b/pjmedia/src/pjmedia-codec/g722/g722_dec.c @@ -504,7 +504,6 @@ PJ_DEF(pj_status_t) g722_dec_decode( g722_dec_t *dec, unsigned i; int ilowr, ylow, rlow, dlowt; int ihigh, rhigh, dhigh; - int pcm1, pcm2; pj_uint8_t *in_ = (pj_uint8_t*) in; PJ_ASSERT_RETURN(dec && in && in_size && out && nsamples, PJ_EINVAL); @@ -529,9 +528,7 @@ PJ_DEF(pj_status_t) g722_dec_decode( g722_dec_t *dec, dec->shigh = block4h (dec, dhigh) ; /* rhigh <= output high band pcm */ - rx_qmf(dec, rlow, rhigh, &pcm1, &pcm2); - out[i*2] = (pj_int16_t)(pcm1 << 2); - out[i*2+1] = (pj_int16_t)(pcm2 << 2); + rx_qmf(dec, rlow, rhigh, &out[i*2], &out[i*2+1]); } *nsamples = in_size << 1; diff --git a/pjmedia/src/pjmedia-codec/g722/g722_enc.c b/pjmedia/src/pjmedia-codec/g722/g722_enc.c index b4ca63ce..d4b5ab87 100644 --- a/pjmedia/src/pjmedia-codec/g722/g722_enc.c +++ b/pjmedia/src/pjmedia-codec/g722/g722_enc.c @@ -543,7 +543,7 @@ PJ_DEF(pj_status_t) g722_enc_encode( g722_enc_t *enc, PJ_ASSERT_RETURN(*out_size >= (nsamples >> 1), PJ_ETOOSMALL); for(i = 0; i < nsamples; i += 2) { - tx_qmf(enc, in[i]>>2, in[i+1]>>2, &xlow, &xhigh); + tx_qmf(enc, in[i], in[i+1], &xlow, &xhigh); /* low band encoder */ ilow = block1l (xlow, enc->slow, enc->detlow) ; |