Revision 0143ec2a libavcodec/ra288.c

View differences:

libavcodec/ra288.c
27 27
typedef struct {
28 28
    float history[8];
29 29
    float output[40];
30
    float pr1[36];
31
    float pr2[10];
30
    float sp_lpc[36];   ///< LPC coefficients for speech data (spec: A)
31
    float gain_lpc[10]; ///< LPC coefficients for gain (spec: GB)
32 32
    int   phase;
33 33

  
34 34
    float sp_hist[111]; ///< Speech data history (spec: SB)
......
72 72
    memmove(ractx->sb + 5, ractx->sb, 36 * sizeof(*ractx->sb));
73 73

  
74 74
    for (x=4; x >= 0; x--)
75
        ractx->sb[x] = -scalar_product_float(ractx->sb + x + 1, ractx->pr1, 36);
75
        ractx->sb[x] = -scalar_product_float(ractx->sb + x + 1,
76
                                             ractx->sp_lpc, 36);
76 77

  
77 78
    /* convert log and do rms */
78
    sum = 32. - scalar_product_float(ractx->pr2, ractx->lhist, 10);
79
    sum = 32. - scalar_product_float(ractx->gain_lpc, ractx->lhist, 10);
79 80

  
80 81
    sum = av_clipf(sum, 0, 60);
81 82

  
......
95 96

  
96 97
    for (x=1; x < 5; x++)
97 98
        for (y=x-1; y >= 0; y--)
98
            buffer[x] -= ractx->pr1[x-y-1] * buffer[y];
99
            buffer[x] -= ractx->sp_lpc[x-y-1] * buffer[y];
99 100

  
100 101
    /* output */
101 102
    for (x=0; x < 5; x++) {
......
195 196
 */
196 197
static void backward_filter(RA288Context *ractx)
197 198
{
198
    float temp1[37];
199
    float temp2[11];
199
    float temp1[37]; // RTMP in the spec
200
    float temp2[11]; // GPTPMP in the spec
200 201

  
201
    do_hybrid_window(36, 40, 35, ractx->output, temp1, ractx->sp_hist, ractx->sp_rec,
202
                     syn_window);
202
    do_hybrid_window(36, 40, 35, ractx->output, temp1, ractx->sp_hist,
203
                     ractx->sp_rec, syn_window);
203 204

  
204
    if (!eval_lpc_coeffs(temp1, ractx->pr1, 36))
205
        colmult(ractx->pr1, ractx->pr1, syn_bw_tab, 36);
205
    if (!eval_lpc_coeffs(temp1, ractx->sp_lpc, 36))
206
        colmult(ractx->sp_lpc, ractx->sp_lpc, syn_bw_tab, 36);
206 207

  
207
    do_hybrid_window(10, 8, 20, ractx->history, temp2, ractx->gain_hist, ractx->gain_rec,
208
                     gain_window);
208
    do_hybrid_window(10, 8, 20, ractx->history, temp2, ractx->gain_hist,
209
                     ractx->gain_rec, gain_window);
209 210

  
210
    if (!eval_lpc_coeffs(temp2, ractx->pr2, 10))
211
        colmult(ractx->pr2, ractx->pr2, gain_bw_tab, 10);
211
    if (!eval_lpc_coeffs(temp2, ractx->gain_lpc, 10))
212
        colmult(ractx->gain_lpc, ractx->gain_lpc, gain_bw_tab, 10);
212 213
}
213 214

  
214 215
/* Decode a block (celp) */

Also available in: Unified diff