diff options
author | Benny Prijono <bennylp@teluu.com> | 2006-07-26 17:04:54 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2006-07-26 17:04:54 +0000 |
commit | 2fa99a7ade8748fae314aeab2fea83e9bc88c36c (patch) | |
tree | 689c1cb15f7e7304b955e296748c800ce430542d /pjmedia/src/pjmedia-codec/speex/cb_search_bfin.h | |
parent | d80219f36636faa876c84b586e7b4b4815767be3 (diff) |
- Bring speex codec up to date with their SVN trunk
- Speex codec should work in FIXED_POINT mode when PJ_HAS_FLOATING_POINT is set to zero.
- ulaw2linear will return zero if zero is given (this would make the VAD works better, and it also fixed click noise when call is established/hangup).
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@628 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjmedia/src/pjmedia-codec/speex/cb_search_bfin.h')
-rw-r--r-- | pjmedia/src/pjmedia-codec/speex/cb_search_bfin.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/pjmedia/src/pjmedia-codec/speex/cb_search_bfin.h b/pjmedia/src/pjmedia-codec/speex/cb_search_bfin.h index 7d476a36..52cc4b3b 100644 --- a/pjmedia/src/pjmedia-codec/speex/cb_search_bfin.h +++ b/pjmedia/src/pjmedia-codec/speex/cb_search_bfin.h @@ -61,7 +61,7 @@ void compute_weighted_codebook(const signed char *shape_cb, const spx_word16_t * "A0 += R0.L*R1.L (IS) || R0 = B[P4++] (X) || R1.L = W[I1--];\n\t" "LOOP_END inner%=;\n\t" "R0 = A0;\n\t" - "R0 >>>= 11;\n\t" + "R0 >>>= 13;\n\t" "A1 += R0.L*R0.L (IS);\n\t" "W[P3++] = R0;\n\t" "P0 += 1;\n\t" @@ -72,7 +72,8 @@ void compute_weighted_codebook(const signed char *shape_cb, const spx_word16_t * "[P4] = R1;\n\t" : : "m" (subvect_size), "m" (shape_cb), "m" (r), "m" (resp), "m" (E) - : "A0", "P0", "P1", "P2", "P3", "P4", "R0", "R1", "R2", "I0", "I1", "L0", "L1", "A0", "A1", "memory" + : "A0", "P0", "P1", "P2", "P3", "P4", "R0", "R1", "R2", "I0", "I1", "L0", + "L1", "A0", "A1", "memory", "LC0", "LC1" ); shape_cb += subvect_size; resp += subvect_size; @@ -83,23 +84,26 @@ void compute_weighted_codebook(const signed char *shape_cb, const spx_word16_t * #define OVERRIDE_TARGET_UPDATE static inline void target_update(spx_word16_t *t, spx_word16_t g, spx_word16_t *r, int len) { + if (!len) + return; __asm__ __volatile__ ( "I0 = %0;\n\t" "I1 = %1;\n\t" "L0 = 0;\n\t" "L1 = 0;\n\t" + "R2 = 4096;\n\t" "LOOP tupdate%= LC0 = %3;\n\t" "LOOP_BEGIN tupdate%=;\n\t" "R0.L = W[I0] || R1.L = W[I1++];\n\t" "R1 = (A1 = R1.L*%2.L) (IS);\n\t" - "R1 >>>= 11;\n\t" + "R1 = R1 + R2;\n\t" + "R1 >>>= 13;\n\t" "R0.L = R0.L - R1.L;\n\t" "W[I0++] = R0.L;\n\t" "LOOP_END tupdate%=;\n\t" : : "a" (t), "a" (r), "d" (g), "a" (len) - : "R0", "R1", "A1", "I0", "I1", "L0", "L1" + : "R0", "R1", "R2", "A1", "I0", "I1", "L0", "L1" ); } - |