diff options
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" ); } - |