comparison ra288.c @ 9026:19bbd1457372 libavcodec

Do not reimplement ff_celp_lp_synthesis_filterf().
author vitor
date Tue, 24 Feb 2009 18:11:42 +0000
parents 36671e6689c7
children 54bc8a2727b0
comparison
equal deleted inserted replaced
9025:b7c69cee2e92 9026:19bbd1457372
23 #define ALT_BITSTREAM_READER_LE 23 #define ALT_BITSTREAM_READER_LE
24 #include "bitstream.h" 24 #include "bitstream.h"
25 #include "ra288.h" 25 #include "ra288.h"
26 #include "lpc.h" 26 #include "lpc.h"
27 #include "celp_math.h" 27 #include "celp_math.h"
28 #include "celp_filters.h"
28 29
29 typedef struct { 30 typedef struct {
30 float sp_lpc[36]; ///< LPC coefficients for speech data (spec: A) 31 float sp_lpc[36]; ///< LPC coefficients for speech data (spec: A)
31 float gain_lpc[10]; ///< LPC coefficients for gain (spec: GB) 32 float gain_lpc[10]; ///< LPC coefficients for gain (spec: GB)
32 33
66 67
67 } 68 }
68 69
69 static void decode(RA288Context *ractx, float gain, int cb_coef) 70 static void decode(RA288Context *ractx, float gain, int cb_coef)
70 { 71 {
71 int i, j; 72 int i;
72 double sumsum; 73 double sumsum;
73 float sum, buffer[5]; 74 float sum, buffer[5];
74 float *block = ractx->sp_hist + 70 + 36; // current block 75 float *block = ractx->sp_hist + 70 + 36; // current block
75 float *gain_block = ractx->gain_hist + 28; 76 float *gain_block = ractx->gain_hist + 28;
76 77
98 /* shift and store */ 99 /* shift and store */
99 memmove(gain_block, gain_block + 1, 9 * sizeof(*gain_block)); 100 memmove(gain_block, gain_block + 1, 9 * sizeof(*gain_block));
100 101
101 gain_block[9] = 10 * log10(sum) - 32; 102 gain_block[9] = 10 * log10(sum) - 32;
102 103
103 for (i=0; i < 5; i++) { 104 ff_celp_lp_synthesis_filterf(block, ractx->sp_lpc, buffer, 5, 36);
104 block[i] = buffer[i];
105 for (j=0; j < 36; j++)
106 block[i] -= block[i-1-j]*ractx->sp_lpc[j];
107 }
108 105
109 /* output */ 106 /* output */
110 for (i=0; i < 5; i++) 107 for (i=0; i < 5; i++)
111 block[i] = av_clipf(block[i], -4095./4096., 4095./4096.); 108 block[i] = av_clipf(block[i], -4095./4096., 4095./4096.);
112 } 109 }