Revision 8955a9d7

View differences:

libavcodec/acelp_filters.c
114 114
    }
115 115
}
116 116

  
117
void ff_acelp_apply_order_2_transfer_function(float *buf,
117
void ff_acelp_apply_order_2_transfer_function(float *out, const float *in,
118 118
                                              const float zero_coeffs[2],
119 119
                                              const float pole_coeffs[2],
120 120
                                              float gain, float mem[2], int n)
......
123 123
    float tmp;
124 124

  
125 125
    for (i = 0; i < n; i++) {
126
        tmp = gain * buf[i] - pole_coeffs[0] * mem[0] - pole_coeffs[1] * mem[1];
127
        buf[i] =        tmp + zero_coeffs[0] * mem[0] + zero_coeffs[1] * mem[1];
126
        tmp = gain * in[i] - pole_coeffs[0] * mem[0] - pole_coeffs[1] * mem[1];
127
        out[i] =       tmp + zero_coeffs[0] * mem[0] + zero_coeffs[1] * mem[1];
128 128

  
129 129
        mem[1] = mem[0];
130 130
        mem[0] = tmp;
libavcodec/acelp_filters.h
92 92
/**
93 93
 * Apply an order 2 rational transfer function in-place.
94 94
 *
95
 * @param samples [in/out]
95
 * @param out output buffer for filtered speech samples
96
 * @param in input buffer containing speech data (may be the same as out)
96 97
 * @param zero_coeffs z^-1 and z^-2 coefficients of the numerator
97 98
 * @param pole_coeffs z^-1 and z^-2 coefficients of the denominator
98 99
 * @param gain scale factor for final output
99 100
 * @param mem intermediate values used by filter (should be 0 initially)
100 101
 * @param n number of samples
101 102
 */
102
void ff_acelp_apply_order_2_transfer_function(float *samples,
103
void ff_acelp_apply_order_2_transfer_function(float *out, const float *in,
103 104
                                              const float zero_coeffs[2],
104 105
                                              const float pole_coeffs[2],
105 106
                                              float gain,
libavcodec/amrnbdec.c
1044 1044
        update_state(p);
1045 1045
    }
1046 1046

  
1047
    ff_acelp_apply_order_2_transfer_function(buf_out, highpass_zeros,
1047
    ff_acelp_apply_order_2_transfer_function(buf_out, buf_out, highpass_zeros,
1048 1048
                                             highpass_poles, highpass_gain,
1049 1049
                                             p->high_pass_mem, AMR_BLOCK_SIZE);
1050 1050

  
libavcodec/sipr.c
490 490
    memcpy(ctx->excitation, excitation - PITCH_DELAY_MAX - L_INTERPOL,
491 491
           (PITCH_DELAY_MAX + L_INTERPOL) * sizeof(float));
492 492

  
493
    ff_acelp_apply_order_2_transfer_function(synth,
493
    ff_acelp_apply_order_2_transfer_function(out_data, synth,
494 494
                                             (const float[2]) {-1.99997   , 1.000000000},
495 495
                                             (const float[2]) {-1.93307352, 0.935891986},
496 496
                                             0.939805806,
497 497
                                             ctx->highpass_filt_mem,
498 498
                                             frame_size);
499 499

  
500
    ctx->dsp.vector_clipf(out_data, synth, -1, 32767./(1<<15), frame_size);
500
    ctx->dsp.vector_clipf(out_data, out_data, -1, 32767./(1<<15), frame_size);
501 501

  
502 502
}
503 503

  

Also available in: Unified diff