diff options
Diffstat (limited to 'src/libfaad/ic_predict.c')
-rw-r--r-- | src/libfaad/ic_predict.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/libfaad/ic_predict.c b/src/libfaad/ic_predict.c index 82753a9f2..70027ba2f 100644 --- a/src/libfaad/ic_predict.c +++ b/src/libfaad/ic_predict.c @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by @@ -19,10 +19,13 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** +** The "appropriate copyright message" mentioned in section 2c of the GPLv2 +** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com" +** ** Commercial non-GPL licensing of this software is possible. -** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. +** For more info contact Nero AG through Mpeg4AAClicense@nero.com. ** -** $Id: ic_predict.c,v 1.7 2005/10/29 23:57:06 tmmm Exp $ +** $Id: ic_predict.c,v 1.28 2007/11/01 12:33:31 menno Exp $ **/ #include "common.h" @@ -81,7 +84,8 @@ static void ic_predict(pred_state *state, real_t input, real_t *output, uint8_t { uint16_t tmp; int16_t i, j; - real_t dr1, predictedvalue; + real_t dr1; + float32_t predictedvalue; real_t e0, e1; real_t k1, k2; @@ -114,7 +118,7 @@ static void ic_predict(pred_state *state, real_t input, real_t *output, uint8_t #define B 0.953125 real_t c = COR[0]; real_t v = VAR[0]; - real_t tmp; + float32_t tmp; if (c == 0 || v <= 1) { k1 = 0; @@ -144,7 +148,7 @@ static void ic_predict(pred_state *state, real_t input, real_t *output, uint8_t #define B 0.953125 real_t c = COR[1]; real_t v = VAR[1]; - real_t tmp; + float32_t tmp; if (c == 0 || v <= 1) { k2 = 0; @@ -209,7 +213,7 @@ void pns_reset_pred_state(ic_stream *ics, pred_state *state) if (is_noise(ics, g, sfb)) { offs = ics->swb_offset[sfb]; - offs2 = ics->swb_offset[sfb+1]; + offs2 = min(ics->swb_offset[sfb+1], ics->swb_offset_max); for (i = offs; i < offs2; i++) reset_pred_state(&state[i]); @@ -241,7 +245,7 @@ void ic_prediction(ic_stream *ics, real_t *spec, pred_state *state, for (sfb = 0; sfb < max_pred_sfb(sf_index); sfb++) { uint16_t low = ics->swb_offset[sfb]; - uint16_t high = ics->swb_offset[sfb+1]; + uint16_t high = min(ics->swb_offset[sfb+1], ics->swb_offset_max); for (bin = low; bin < high; bin++) { |