diff options
author | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2003-12-30 02:00:10 +0000 |
---|---|---|
committer | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2003-12-30 02:00:10 +0000 |
commit | f260c2ac3661143bfdfbcc4c7a3574acdd831894 (patch) | |
tree | 644ed0104c63c64b7346681ca5e212a81876458c /src/libfaad/drc.c | |
parent | 33f6c0d77b5dfafcbafd09fc05d700fb66c9cb47 (diff) | |
download | xine-lib-f260c2ac3661143bfdfbcc4c7a3574acdd831894.tar.gz xine-lib-f260c2ac3661143bfdfbcc4c7a3574acdd831894.tar.bz2 |
- update to libfaad 2.0 rc3
- some fixes to xine_decoder.c
CVS patchset: 5959
CVS date: 2003/12/30 02:00:10
Diffstat (limited to 'src/libfaad/drc.c')
-rw-r--r-- | src/libfaad/drc.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/libfaad/drc.c b/src/libfaad/drc.c index 14f3a2b1f..9482d984f 100644 --- a/src/libfaad/drc.c +++ b/src/libfaad/drc.c @@ -1,6 +1,6 @@ /* -** FAAD - Freeware Advanced Audio Decoder -** Copyright (C) 2002 M. Bakker +** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding +** Copyright (C) 2003 M. Bakker, Ahead Software 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 @@ -16,7 +16,13 @@ ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** -** $Id: drc.c,v 1.2 2002/12/16 19:00:00 miguelfreitas Exp $ +** Any non-GPL usage of this software or parts of this software is strictly +** forbidden. +** +** Commercial non-GPL licensing of this software is possible. +** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. +** +** $Id: drc.c,v 1.3 2003/12/30 02:00:10 miguelfreitas Exp $ **/ #include "common.h" @@ -29,7 +35,7 @@ drc_info *drc_init(real_t cut, real_t boost) { - drc_info *drc = (drc_info*)malloc(sizeof(drc_info)); + drc_info *drc = (drc_info*)faad_malloc(sizeof(drc_info)); memset(drc, 0, sizeof(drc_info)); drc->ctrl1 = cut; @@ -45,7 +51,7 @@ drc_info *drc_init(real_t cut, real_t boost) void drc_end(drc_info *drc) { - if (drc) free(drc); + if (drc) faad_free(drc); } #ifdef FIXED_POINT @@ -121,9 +127,9 @@ void drc_decode(drc_info *drc, real_t *spec) #ifndef FIXED_POINT /* Decode DRC gain factor */ if (drc->dyn_rng_sgn[bd]) /* compress */ - exp = -drc->ctrl1 * (drc->dyn_rng_ctl[bd] - (DRC_REF_LEVEL - drc->prog_ref_level))/24.0; + exp = -drc->ctrl1 * (drc->dyn_rng_ctl[bd] - (DRC_REF_LEVEL - drc->prog_ref_level))/REAL_CONST(24.0); else /* boost */ - exp = drc->ctrl2 * (drc->dyn_rng_ctl[bd] - (DRC_REF_LEVEL - drc->prog_ref_level))/24.0; + exp = drc->ctrl2 * (drc->dyn_rng_ctl[bd] - (DRC_REF_LEVEL - drc->prog_ref_level))/REAL_CONST(24.0); factor = (real_t)pow(2.0, exp); /* Apply gain factor */ @@ -147,14 +153,14 @@ void drc_decode(drc_info *drc, real_t *spec) { spec[i] >>= -exp; if (frac) - spec[i] = MUL(spec[i],drc_pow2_table[frac+23]); + spec[i] = MUL_R(spec[i],drc_pow2_table[frac+23]); } } else { for (i = bottom; i < top; i++) { spec[i] <<= exp; if (frac) - spec[i] = MUL(spec[i],drc_pow2_table[frac+23]); + spec[i] = MUL_R(spec[i],drc_pow2_table[frac+23]); } } #endif |