diff options
Diffstat (limited to 'libfaad2/pns.c')
-rw-r--r-- | libfaad2/pns.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/libfaad2/pns.c b/libfaad2/pns.c index ff262bb3a2..ff50178d13 100644 --- a/libfaad2/pns.c +++ b/libfaad2/pns.c @@ -23,7 +23,7 @@ ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** ** Initially modified for use with MPlayer by Arpad Gereöffy on 2003/08/30 -** $Id: pns.c,v 1.3 2004/06/02 22:59:03 diego Exp $ +** $Id: pns.c,v 1.4 2004/06/23 13:50:51 diego Exp $ ** detailed CVS changelog at http://www.mplayerhq.hu/cgi-bin/cvsweb.cgi/main/ **/ @@ -72,9 +72,6 @@ real_t fp_sqrt(real_t value) static real_t pow2_table[] = { - COEF_CONST(0.59460355750136), - COEF_CONST(0.70710678118655), - COEF_CONST(0.84089641525371), COEF_CONST(1.0), COEF_CONST(1.18920711500272), COEF_CONST(1.41421356237310), @@ -133,8 +130,8 @@ static INLINE void gen_rand_vector(real_t *spec, int16_t scale_factor, uint16_t { scale = DIV(REAL_CONST(1),energy); - exp = scale_factor / 4; - frac = scale_factor % 4; + exp = scale_factor >> 2; + frac = scale_factor & 3; /* IMDCT pre-scaling */ exp -= sub; @@ -145,7 +142,7 @@ static INLINE void gen_rand_vector(real_t *spec, int16_t scale_factor, uint16_t scale <<= exp; if (frac) - scale = MUL_C(scale, pow2_table[frac + 3]); + scale = MUL_C(scale, pow2_table[frac]); for (i = 0; i < size; i++) { @@ -189,6 +186,7 @@ void pns_decode(ic_stream *ics_left, ic_stream *ics_right, { if (is_noise(ics_left, g, sfb)) { +#ifdef LTP_DEC /* Simultaneous use of LTP and PNS is not prevented in the syntax. If both LTP, and PNS are enabled on the same scalefactor band, PNS takes precedence, and no prediction @@ -196,11 +194,14 @@ void pns_decode(ic_stream *ics_left, ic_stream *ics_right, */ ics_left->ltp.long_used[sfb] = 0; ics_left->ltp2.long_used[sfb] = 0; +#endif +#ifdef MAIN_DEC /* For scalefactor bands coded using PNS the corresponding predictors are switched to "off". */ ics_left->pred.prediction_used[sfb] = 0; +#endif offs = ics_left->swb_offset[sfb]; size = ics_left->swb_offset[sfb+1] - offs; @@ -242,9 +243,13 @@ void pns_decode(ic_stream *ics_left, ic_stream *ics_right, spec_left[(group*nshort) + offs + c]; } } else /*if (ics_left->ms_mask_present == 0)*/ { +#ifdef LTP_DEC ics_right->ltp.long_used[sfb] = 0; ics_right->ltp2.long_used[sfb] = 0; +#endif +#ifdef MAIN_DEC ics_right->pred.prediction_used[sfb] = 0; +#endif offs = ics_right->swb_offset[sfb]; size = ics_right->swb_offset[sfb+1] - offs; |