[xiph-cvs] cvs commit: speex/libspeex ltp.c testenc.c
Jean-Marc Valin
jm at xiph.org
Tue Nov 25 08:40:26 PST 2003
jm 03/11/25 11:40:26
Modified: libspeex ltp.c testenc.c
Log:
...
Revision Changes Path
1.100 +12 -4 speex/libspeex/ltp.c
Index: ltp.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/ltp.c,v
retrieving revision 1.99
retrieving revision 1.100
diff -u -r1.99 -r1.100
--- ltp.c 25 Nov 2003 06:58:10 -0000 1.99
+++ ltp.c 25 Nov 2003 16:40:25 -0000 1.100
@@ -515,6 +515,9 @@
signed char *gain_cdbk;
int gain_cdbk_size;
ltp_params *params;
+#ifdef FIXED_POINT
+ spx_word16_t sgain[3];
+#endif
params = (ltp_params*) par;
gain_cdbk_size = 1<<params->gain_bits;
gain_cdbk = params->gain_cdbk + 3*gain_cdbk_size*cdbk_offset;
@@ -523,9 +526,18 @@
pitch += start;
gain_index = speex_bits_unpack_unsigned(bits, params->gain_bits);
/*printf ("decode pitch: %d %d\n", pitch, gain_index);*/
+#ifdef FIXED_POINT
+ sgain[0] = 32+(spx_word16_t)gain_cdbk[gain_index*3];
+ sgain[1] = 32+(spx_word16_t)gain_cdbk[gain_index*3+1];
+ sgain[2] = 32+(spx_word16_t)gain_cdbk[gain_index*3+2];
+ gain[0] = 0.015625*sgain[0];
+ gain[1] = 0.015625*sgain[1];
+ gain[2] = 0.015625*sgain[2];
+#else
gain[0] = 0.015625*gain_cdbk[gain_index*3]+.5;
gain[1] = 0.015625*gain_cdbk[gain_index*3+1]+.5;
gain[2] = 0.015625*gain_cdbk[gain_index*3+2]+.5;
+#endif
if (count_lost && pitch > subframe_offset)
{
@@ -611,10 +623,6 @@
#ifdef FIXED_POINT
{
- spx_word16_t sgain[3];
- sgain[0] = 64*gain[0];
- sgain[1] = 64*gain[1];
- sgain[2] = 64*gain[2];
for (i=0;i<nsf;i++)
exc[i]=MULT16_32_Q13(SHL(sgain[0],7),e[2][i])+MULT16_32_Q13(SHL(sgain[1],7),e[1][i])+MULT16_32_Q13(SHL(sgain[2],7),e[0][i]);
}
<p><p>1.54 +1 -1 speex/libspeex/testenc.c
Index: testenc.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/testenc.c,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- testenc.c 25 Nov 2003 06:58:10 -0000 1.53
+++ testenc.c 25 Nov 2003 16:40:25 -0000 1.54
@@ -49,7 +49,7 @@
speex_decoder_ctl(dec, SPEEX_SET_ENH, &tmp);
tmp=0;
speex_encoder_ctl(st, SPEEX_SET_VBR, &tmp);
- tmp=1;
+ tmp=4;
speex_encoder_ctl(st, SPEEX_SET_QUALITY, &tmp);
tmp=5;
speex_encoder_ctl(st, SPEEX_SET_COMPLEXITY, &tmp);
<p><p>--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
More information about the commits
mailing list