Revision 23940f14 libavcodec/lpc.c

View differences:

libavcodec/lpc.c
165 165
int ff_lpc_calc_coefs(DSPContext *s,
166 166
                      const int32_t *samples, int blocksize, int min_order,
167 167
                      int max_order, int precision,
168
                      int32_t coefs[][MAX_LPC_ORDER], int *shift, int use_lpc,
168
                      int32_t coefs[][MAX_LPC_ORDER], int *shift,
169
                      enum AVLPCType lpc_type, int lpc_passes,
169 170
                      int omethod, int max_shift, int zero_shift)
170 171
{
171 172
    double autoc[MAX_LPC_ORDER+1];
......
174 175
    int i, j, pass;
175 176
    int opt_order;
176 177

  
177
    assert(max_order >= MIN_LPC_ORDER && max_order <= MAX_LPC_ORDER && use_lpc > 0);
178
    assert(max_order >= MIN_LPC_ORDER && max_order <= MAX_LPC_ORDER &&
179
           lpc_type > AV_LPC_TYPE_FIXED);
178 180

  
179
    if(use_lpc == 1){
181
    if (lpc_type == AV_LPC_TYPE_LEVINSON) {
180 182
        s->lpc_compute_autocorr(samples, blocksize, max_order, autoc);
181 183

  
182 184
        compute_lpc_coefs(autoc, max_order, &lpc[0][0], MAX_LPC_ORDER, 0, 1);
183 185

  
184 186
        for(i=0; i<max_order; i++)
185 187
            ref[i] = fabs(lpc[i][i]);
186
    }else{
188
    } else if (lpc_type == AV_LPC_TYPE_CHOLESKY) {
187 189
        LLSModel m[2];
188 190
        double var[MAX_LPC_ORDER+1], av_uninit(weight);
189 191

  
190
        for(pass=0; pass<use_lpc-1; pass++){
192
        for(pass=0; pass<lpc_passes; pass++){
191 193
            av_init_lls(&m[pass&1], max_order);
192 194

  
193 195
            weight=0;

Also available in: Unified diff