1 /*****************************************************************************
2 * exponent.c: A52 exponent calculations
3 *****************************************************************************
4 * Copyright (C) 1999-2001 VideoLAN
5 * $Id: exponent.c,v 1.1 2002/08/04 17:23:42 sam Exp $
7 * Authors: Michel Kaempf <maxx@via.ecp.fr>
8 * Michel Lespinasse <walken@zoy.org>
9 * Aaron Holtzman <aholtzma@engr.uvic.ca>
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
24 *****************************************************************************/
26 /*****************************************************************************
28 *****************************************************************************/
29 #include <string.h> /* memcpy(), memset() */
32 #include <vlc/decoder.h>
42 int exponent_unpack (a52dec_t * p_a52dec)
46 for (i = 0; i < p_a52dec->bsi.nfchans; i++)
48 if (exp_unpack_ch (p_a52dec, UNPACK_FBW, p_a52dec->audblk.chexpstr[i],
49 p_a52dec->audblk.nchgrps[i],
50 p_a52dec->audblk.exps[i][0],
51 &p_a52dec->audblk.exps[i][1],
52 p_a52dec->audblk.fbw_exp[i]))
58 if (p_a52dec->audblk.cplinu)
60 if (exp_unpack_ch (p_a52dec, UNPACK_CPL, p_a52dec->audblk.cplexpstr,
61 p_a52dec->audblk.ncplgrps,
62 p_a52dec->audblk.cplabsexp << 1,
63 p_a52dec->audblk.cplexps,
64 &p_a52dec->audblk.cpl_exp[p_a52dec->audblk.cplstrtmant]))
70 if (p_a52dec->bsi.lfeon)
72 if (exp_unpack_ch (p_a52dec, UNPACK_LFE, p_a52dec->audblk.lfeexpstr,
73 2, p_a52dec->audblk.lfeexps[0],
74 &p_a52dec->audblk.lfeexps[1],
75 p_a52dec->audblk.lfe_exp))