Revision 70c99adb

View differences:

libavcodec/aacdec.c
1231 1231
    return pun.f;
1232 1232
}
1233 1233

  
1234
static av_always_inline void predict(AACContext *ac, PredictorState *ps, float *coef,
1234
static av_always_inline void predict(PredictorState *ps, float *coef,
1235
                                     float sf_scale, float inv_sf_scale,
1235 1236
                    int output_enable)
1236 1237
{
1237 1238
    const float a     = 0.953125; // 61.0 / 64
......
1245 1246

  
1246 1247
    pv = flt16_round(k1 * ps->r0 + k2 * ps->r1);
1247 1248
    if (output_enable)
1248
        *coef += pv * ac->sf_scale;
1249
        *coef += pv * sf_scale;
1249 1250

  
1250
    e0 = *coef / ac->sf_scale;
1251
    e0 = *coef * inv_sf_scale;
1251 1252
    e1 = e0 - k1 * ps->r0;
1252 1253

  
1253 1254
    ps->cor1 = flt16_trunc(alpha * ps->cor1 + ps->r1 * e1);
......
1265 1266
static void apply_prediction(AACContext *ac, SingleChannelElement *sce)
1266 1267
{
1267 1268
    int sfb, k;
1269
    float sf_scale = ac->sf_scale, inv_sf_scale = 1 / ac->sf_scale;
1268 1270

  
1269 1271
    if (!sce->ics.predictor_initialized) {
1270 1272
        reset_all_predictors(sce->predictor_state);
......
1274 1276
    if (sce->ics.window_sequence[0] != EIGHT_SHORT_SEQUENCE) {
1275 1277
        for (sfb = 0; sfb < ff_aac_pred_sfb_max[ac->m4ac.sampling_index]; sfb++) {
1276 1278
            for (k = sce->ics.swb_offset[sfb]; k < sce->ics.swb_offset[sfb + 1]; k++) {
1277
                predict(ac, &sce->predictor_state[k], &sce->coeffs[k],
1279
                predict(&sce->predictor_state[k], &sce->coeffs[k],
1280
                        sf_scale, inv_sf_scale,
1278 1281
                        sce->ics.predictor_present && sce->ics.prediction_used[sfb]);
1279 1282
            }
1280 1283
        }

Also available in: Unified diff