blob: 0e3a5e204ecc33b437f9e090a25b085fb75dfb56 [file] [log] [blame]
Jean-Marc Valin8b2ff0d2009-10-17 21:40:10 -04001/* Copyright (c) 2007-2008 CSIRO
2 Copyright (c) 2007-2009 Xiph.Org Foundation
3 Written by Jean-Marc Valin */
Jean-Marc Valin8b0137a2007-12-06 07:51:53 +11004/*
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions
7 are met:
8
9 - Redistributions of source code must retain the above copyright
10 notice, this list of conditions and the following disclaimer.
11
12 - Redistributions in binary form must reproduce the above copyright
13 notice, this list of conditions and the following disclaimer in the
14 documentation and/or other materials provided with the distribution.
15
16 - Neither the name of the Xiph.org Foundation nor the names of its
17 contributors may be used to endorse or promote products derived from
18 this software without specific prior written permission.
19
20 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
24 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31*/
32
33#ifndef QUANT_BANDS
34#define QUANT_BANDS
35
Jean-Marc Valine901fe32008-02-26 14:46:26 +110036#include "arch.h"
Jean-Marc Valin8b0137a2007-12-06 07:51:53 +110037#include "modes.h"
Jean-Marc Valin8143be32007-12-07 16:40:39 +110038#include "entenc.h"
39#include "entdec.h"
Jean-Marc Valin24c25a22009-06-09 11:56:59 -040040#include "mathops.h"
41
Jean-Marc Valin504fb3c2010-08-06 15:56:22 -040042void amp2Log2(const CELTMode *m, int effEnd, int end,
43 celt_ener *bandE, celt_word16 *bandLogE, int _C);
Jean-Marc Valin24c25a22009-06-09 11:56:59 -040044
Jean-Marc Valinbc272de2010-08-02 09:41:31 -040045void log2Amp(const CELTMode *m, int start, int end,
46 celt_ener *eBands, celt_word16 *oldEBands, int _C);
Jean-Marc Valin8b0137a2007-12-06 07:51:53 +110047
Timothy B. Terriberryef2e6502010-11-09 01:43:18 -080048unsigned char *quant_prob_alloc(const CELTMode *m);
Jean-Marc Valinbb528812010-08-25 22:12:18 -040049void quant_prob_free(const celt_int16 *freq);
Jean-Marc Valin8b0137a2007-12-06 07:51:53 +110050
Jean-Marc Valin5e7f02d2010-08-08 09:48:22 -040051void quant_coarse_energy(const CELTMode *m, int start, int end, int effEnd,
52 const celt_word16 *eBands, celt_word16 *oldEBands, int budget,
Timothy B. Terriberryef2e6502010-11-09 01:43:18 -080053 celt_word16 *error, ec_enc *enc, int _C, int LM,
Jean-Marc Valin1b36d6c2010-08-31 17:21:52 -040054 int nbAvailableBytes, int force_intra, int *delayedIntra, int two_pass);
Jean-Marc Valinc890b582008-08-01 22:26:49 -040055
Jean-Marc Valin525d7cf2010-07-13 14:14:16 -040056void quant_fine_energy(const CELTMode *m, int start, int end, celt_ener *eBands, celt_word16 *oldEBands, celt_word16 *error, int *fine_quant, ec_enc *enc, int _C);
Jean-Marc Valinc890b582008-08-01 22:26:49 -040057
Jean-Marc Valin525d7cf2010-07-13 14:14:16 -040058void quant_energy_finalise(const CELTMode *m, int start, int end, celt_ener *eBands, celt_word16 *oldEBands, celt_word16 *error, int *fine_quant, int *fine_priority, int bits_left, ec_enc *enc, int _C);
Jean-Marc Valin39710532009-06-09 00:10:32 -040059
Timothy B. Terriberryef2e6502010-11-09 01:43:18 -080060void unquant_coarse_energy(const CELTMode *m, int start, int end, celt_ener *eBands, celt_word16 *oldEBands, int intra, ec_dec *dec, int _C, int LM);
Jean-Marc Valinc890b582008-08-01 22:26:49 -040061
Jean-Marc Valin525d7cf2010-07-13 14:14:16 -040062void unquant_fine_energy(const CELTMode *m, int start, int end, celt_ener *eBands, celt_word16 *oldEBands, int *fine_quant, ec_dec *dec, int _C);
Jean-Marc Valin8b0137a2007-12-06 07:51:53 +110063
Jean-Marc Valin525d7cf2010-07-13 14:14:16 -040064void unquant_energy_finalise(const CELTMode *m, int start, int end, celt_ener *eBands, celt_word16 *oldEBands, int *fine_quant, int *fine_priority, int bits_left, ec_dec *dec, int _C);
Jean-Marc Valin39710532009-06-09 00:10:32 -040065
Jean-Marc Valin8b0137a2007-12-06 07:51:53 +110066#endif /* QUANT_BANDS */