search for: mult16_16

Displaying 20 results from an estimated 37 matches for "mult16_16".

2007 Aug 24
1
Speex on ARM7
...nately the encoding speed is about 5 times slower then necessary for real time. ARM7 is slow for 16/8 bits operations. The sequence: static inline spx_word32_t compute_pitch_error(spx_word16_t *C, spx_word16_t *g, spx_word16_t pitch_control) { spx_word32_t sum = 0; sum = ADD32(sum,MULT16_16(MULT16_16_16(g[0],pitch_control),C[0])); sum = ADD32(sum,MULT16_16(MULT16_16_16(g[1],pitch_control),C[1])); sum = ADD32(sum,MULT16_16(MULT16_16_16(g[2],pitch_control),C[2])); sum = SUB32(sum,MULT16_16(MULT16_16_16(g[0],g[1]),C[3])); sum = SUB32(sum,MULT16_16(MULT16_16_16(g[2],g[1]),...
2007 Nov 05
2
[patch] speex_preprocess_ctl
...peex/preprocess.c (arbetskopia) > > @@ -1126,16 +1126,16 @@ > > break; > > > > case SPEEX_PREPROCESS_SET_PROB_START: > > - *(spx_int32_t*)ptr = MIN32(Q15_ONE,MAX32(0, *(spx_int32_t*) > > ptr)); > > - st->speech_prob_start = DIV32_16(MULT16_16(32767,* > > (spx_int32_t*)ptr), 100); > > + *(spx_int32_t*)ptr = MIN32(100,MAX32(0, *(spx_int32_t*)ptr)); > > + st->speech_prob_start = DIV32_16(MULT16_16(Q15ONE,* > > (spx_int32_t*)ptr), 100); > > break; > > case SPEEX_PREPROCESS_GET_PR...
2007 Oct 29
1
[patch] speex_preprocess_ctl
...================== --- libspeex/preprocess.c (revision 13983) +++ libspeex/preprocess.c (arbetskopia) @@ -1126,16 +1126,16 @@ break; case SPEEX_PREPROCESS_SET_PROB_START: - *(spx_int32_t*)ptr = MIN32(Q15_ONE,MAX32(0, *(spx_int32_t*)ptr)); - st->speech_prob_start = DIV32_16(MULT16_16(32767,*(spx_int32_t*)ptr), 100); + *(spx_int32_t*)ptr = MIN32(100,MAX32(0, *(spx_int32_t*)ptr)); + st->speech_prob_start = DIV32_16(MULT16_16(Q15ONE,*(spx_int32_t*)ptr), 100); break; case SPEEX_PREPROCESS_GET_PROB_START: (*(spx_int32_t*)ptr) = MULT16_16_Q15(st->spe...
2008 May 03
2
Resampler (no api)
...= (spx_int32_t)*out_len)) { - int j; - spx_word32_t sum=0; - - /* We already have all the filter coefficients pre-computed in the table */ - const spx_word16_t *ptr; - /* Do the memory part */ - for (j=0;last_sample-N+1+j < 0;j++) - { - sum += MULT16_16(mem[last_sample+j],st->sinc_table[samp_frac_num*st->filt_len+j]); + const spx_word16_t *sinc = & sinc_table[samp_frac_num*N]; + const spx_word16_t *iptr = & in[last_sample]; + +#ifndef OVERRIDE_INNER_PRODUCT_SINGLE + float accum[4] = {0,0,0,0}; + + for(j=0;j<N;j...
2008 May 03
0
Resampler, memory only variant
...= (spx_int32_t)*out_len)) { - int j; - spx_word32_t sum=0; - - /* We already have all the filter coefficients pre-computed in the table */ - const spx_word16_t *ptr; - /* Do the memory part */ - for (j=0;last_sample-N+1+j < 0;j++) - { - sum += MULT16_16(mem[last_sample+j],st->sinc_table[samp_frac_num*st->filt_len+j]); + const spx_word16_t *sinc = & sinc_table[samp_frac_num*N]; + const spx_word16_t *iptr = & in[last_sample]; + +#ifndef OVERRIDE_INNER_PRODUCT_SINGLE + float accum[4] = {0,0,0,0}; + + for(j=0;j<N;j...
2005 Dec 12
2
More floating point errors
Hi! It seems that using a different compiler (I assume the development is done with MSC) uncovers various issues with the floating point. Here is the second one I'm seeing - DOMAIN error from sqrt(). In the open_loop_nbest_pitch(), this line: g = DIV32(corr[i-start], 10+SHR32(MULT16_16(spx_sqrt(e0),spx_sqrt(energy[i-start]) ),6)); The values are: e0 is 7.2 i is 142, start is 17 energy [i-start] is -2.1004911E-015 Hope this information is enough to go on. Tia, .a -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/sp...
2008 Feb 02
0
Patch to make analysis data available.
..._GET_WEIGHTS: + { + spx_int32_t *w = (spx_int32_t *)ptr; + int N = st->window_size; + int n = st->frame_size; + int M = st->M; + int i, j; + spx_word32_t t1, t2, t3; + for(i=0;i<M;i++) { + w[i*n] = 0; + w[(i+1)*n-1] = 0; + for(j=1;j<n-1;j++) { + t1 = MULT16_16(SHR32(st->W[i*N+j*2],16), SHR32(st->W[i*N+j*2],15)); + t2 = MULT16_16(SHR32(st->W[i*N+j*2-1],16), SHR32(st->W[i*N+j*2-1],15)); + t3 = MULT16_16(100,spx_sqrt(ADD32(t1,t2))); + w[i*n+j] = SHR32(t3, WEIGHT_SHIFT); + } + } + } + break; default: speex_warn...
2005 May 25
3
Speex on TI C6x, Problem with TI C5x Patch
...fine SATURATE32(x,a) (x) #define PSHR(a,shift) (a) #define SHR(a,shift) (a) #define SHL(a,shift) (a) #define SATURATE(x,a) (x) #define ADD16(a,b) ((a)+(b)) #define SUB16(a,b) ((a)-(b)) #define ADD32(a,b) ((a)+(b)) #define SUB32(a,b) ((a)-(b)) #define ADD64(a,b) ((a)+(b)) #define MULT16_16_16(a,b) ((a)*(b)) #define MULT16_16(a,b) ((spx_word32_t)(a)*(spx_word32_t)(b)) #define MAC16_16(c,a,b) ((c)+(spx_word32_t)(a)*(spx_word32_t)(b)) #define MULT16_32_Q11(a,b) ((a)*(b)) #define MULT16_32_Q13(a,b) ((a)*(b)) #define MULT16_32_Q14(a,b) ((a)*(b)) #define MULT16_32_...
2007 Nov 05
0
[patch] speex_preprocess_ctl
...rbetskopia) >>> @@ -1126,16 +1126,16 @@ >>> break; >>> >>> case SPEEX_PREPROCESS_SET_PROB_START: >>> - *(spx_int32_t*)ptr = MIN32(Q15_ONE,MAX32(0, *(spx_int32_t*) >>> ptr)); >>> - st->speech_prob_start = DIV32_16(MULT16_16(32767,* >>> (spx_int32_t*)ptr), 100); >>> + *(spx_int32_t*)ptr = MIN32(100,MAX32(0, *(spx_int32_t*)ptr)); >>> + st->speech_prob_start = DIV32_16(MULT16_16(Q15ONE,* >>> (spx_int32_t*)ptr), 100); >>> break; >>> case SPEEX_P...
2013 Dec 09
1
incorrect use of MAX16
...6bit. Changing the default definition to take advantage of this hardware changes the result of that computation. Please consider the change below for inclusion in the opus code base. /* *tf_estimate = 1 + MIN16(1, sqrt(MAX16(0, tf_max-30))/20); */ - *tf_estimate = celt_sqrt(MAX16(0, SHL32(MULT16_16(QCONST16(0.0069,14),MIN16(163,tf_max)),14)-QCONST32(0.139,28))); + *tf_estimate = celt_sqrt(MAX32(0, SHL32(MULT16_16(QCONST16(0.0069,14),MIN16(163,tf_max)),14)-QCONST32(0.139,28))); /*printf("%d %f\n", tf_max, mask_metric);*/ --
2015 Nov 16
0
[Fast Int64 2/4] Add OPUS_FAST_INT64 flavors of celt/fixed_generic.h macros.
--- celt/fixed_generic.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/celt/fixed_generic.h b/celt/fixed_generic.h index ac67d37..1cfd6d6 100644 --- a/celt/fixed_generic.h +++ b/celt/fixed_generic.h @@ -37,16 +37,32 @@ #define MULT16_16SU(a,b) ((opus_val32)(opus_val16)(a)*(opus_val32)(opus_uint16)(b)) /** 16x32 multiplication, followed by a 16-bit shift right. Results fits in 32 bits */ +#if OPUS_FAST_INT64 +#define MULT16_32_Q16(a,b) ((opus_val32)SHR((opus_int64)((opus_val16)(a))*(b),16)) +#else #define MULT16_32_Q16(a,b) ADD...
2005 Nov 05
2
Noisy sound quality with Blackfin in WB-mode
Hello Jean-Marc, > Got any luck with the Blackfin stuff? One thing I forgot mentioning that > would probably help a lot in narrowing down the bug is to simply disable > assembly functions one by one and see which one breaks Speex. sorry that I didn't reply for some days. Unfortunately I had some other serious problems with my software which are not related to Speex. I hope to solve
2015 Nov 16
3
[Fast Int64 1/4] Move OPUS_FAST_INT64 definition to celt/arch.h.
--- celt/arch.h | 5 +++++ silk/macros.h | 4 +--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/celt/arch.h b/celt/arch.h index 9f74ddd..670527b 100644 --- a/celt/arch.h +++ b/celt/arch.h @@ -78,6 +78,11 @@ static OPUS_INLINE void _celt_fatal(const char *str, const char *file, int line) #define UADD32(a,b) ((a)+(b)) #define USUB32(a,b) ((a)-(b)) +/* Set this if opus_int64
2007 Aug 29
2
high-pass filter issues
...23f}, {0.98645f, -1.97277f, 0.98645f}, {0.88000f, -1.76000f, 0.88000f}}; #endif const spx_word16_t *den, *num; if (filtID>4) filtID=4; den = Pcoef[filtID]; num = Zcoef[filtID]; /*return;*/ for (i=0;i<len;i++) { spx_word16_t yi; spx_word32_t vout = ADD32(MULT16_16(num[0], x[i]),mem[0]); yi = EXTRACT16(SATURATE(PSHR32(vout,14),32767)); mem[0] = ADD32(MAC16_16(mem[1], num[1],x[i]), SHL32(MULT16_32_Q15(-den[1],vout),1)); mem[1] = ADD32(MULT16_16(num[2],x[i]), SHL32(MULT16_32_Q15(-den[2],vout),1)); y[i] = yi; } } I can step into th...
2013 May 21
0
[PATCH] 02-
...ndif } +#ifndef OVERRIDE_CELT_FIR void celt_fir(const opus_val16 *x, const opus_val16 *num, opus_val16 *y, @@ -101,7 +106,7 @@ void celt_fir(const opus_val16 *x, opus_val32 sum = SHL32(EXTEND32(x[i]), SIG_SHIFT); for (j=0;j<ord;j++) { - sum += MULT16_16(num[j],mem[j]); + sum = MAC16_16(sum, num[j], mem[j]); } for (j=ord-1;j>=1;j--) { @@ -111,6 +116,7 @@ void celt_fir(const opus_val16 *x, y[i] = ROUND16(sum, SIG_SHIFT); } } +#endif void celt_iir(const opus_val32 *x, const opus_val16 *den, @@...
2005 Nov 09
0
Noisy sound quality with Blackfin in WB-mode
...;, "I0", "I1", "L0", "L1", "B0", "B1", "memory" ); + + + for ( i=1; i<lag; i++ ) + { + ac[i]=SHR32(ac32[i+(10-(lag-1))], ac_shift); + } + + d=0; for (j=0;j<n;j++) { d = ADD32(d,SHR32(MULT16_16(x[j],x[j]), shift)); } - ac32[0] = d; - - for (i=0;i<lag;i++) - { - d=0; - for (j=i;j<lag_1;j++) - { - d = ADD32(d,SHR32(MULT16_16(x[j],x[j-i]), shift)); - } - if (i) - ac32[i] += d; - ac[i] = SHR32(ac32[i], ac_shift); - } + ac[0] =...
2006 Feb 14
0
Bug in vbr_analysis
...> done with MSC) uncovers various issues with the floating point. No, all development is done on gcc/Linux. > Here is the second one I'm seeing - DOMAIN error from sqrt(). > > In the open_loop_nbest_pitch(), this line: > > g = DIV32(corr[i-start], 10 > +SHR32(MULT16_16(spx_sqrt(e0),spx_sqrt(energy[i-start])), 6)); change that to: g = DIV32(corr[i-start], 10+SHR32(MULT16_16(spx_sqrt(e0),spx_sqrt(1 +energy[i-start])),6)); (note the "1+" in the spx_sqrt) As for this appearing only on some version/compiler configurations, the only explanation is sheer l...
2007 Oct 08
2
Floating point implementation
Hi, I'm fairly new to Speex, so please forgive me if this question has an obvious answer. I'm currently studying the source code to understand how Speex works and wondered, is there still a floating-point implementation I could look at as the fixed-point stuff makes it a little difficult to see what the code is doing. Regards, Matt.
2008 Feb 13
1
Fixed-point scaling of mdf impulse response
...gt;wtmp2[i] = EXTRACT16(PSHR32(st->W[j*N+i],16+NORMALIZE_SCALEDOWN)); spx_ifft(st->fft_table, st->wtmp2, st->wtmp); #else spx_ifft(st->fft_table, &st->W[j*N], st->wtmp); #endif for(i=0;i<n;i++) - filt[j*n+i] = PSHR32(MULT16_16(32767,st->wtmp[i]), WEIGHT_SHIFT); + filt[j*n+i] = PSHR32(MULT16_16(32767,st->wtmp[i]), WEIGHT_SHIFT-NORMALIZE_SCALEDOWN); } } break;
2013 May 21
2
[PATCH] 02-Add CELT filter optimizations
...ndif } +#ifndef OVERRIDE_CELT_FIR void celt_fir(const opus_val16 *x, const opus_val16 *num, opus_val16 *y, @@ -101,7 +106,7 @@ void celt_fir(const opus_val16 *x, opus_val32 sum = SHL32(EXTEND32(x[i]), SIG_SHIFT); for (j=0;j<ord;j++) { - sum += MULT16_16(num[j],mem[j]); + sum = MAC16_16(sum, num[j], mem[j]); } for (j=ord-1;j>=1;j--) { @@ -111,6 +116,7 @@ void celt_fir(const opus_val16 *x, y[i] = ROUND16(sum, SIG_SHIFT); } } +#endif void celt_iir(const opus_val32 *x, const opus_val16 *den, @@...