1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/media/libopus/celt/vq.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,70 @@ 1.4 +/* Copyright (c) 2007-2008 CSIRO 1.5 + Copyright (c) 2007-2009 Xiph.Org Foundation 1.6 + Written by Jean-Marc Valin */ 1.7 +/** 1.8 + @file vq.h 1.9 + @brief Vector quantisation of the residual 1.10 + */ 1.11 +/* 1.12 + Redistribution and use in source and binary forms, with or without 1.13 + modification, are permitted provided that the following conditions 1.14 + are met: 1.15 + 1.16 + - Redistributions of source code must retain the above copyright 1.17 + notice, this list of conditions and the following disclaimer. 1.18 + 1.19 + - Redistributions in binary form must reproduce the above copyright 1.20 + notice, this list of conditions and the following disclaimer in the 1.21 + documentation and/or other materials provided with the distribution. 1.22 + 1.23 + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 1.24 + ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 1.25 + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 1.26 + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 1.27 + OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 1.28 + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 1.29 + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 1.30 + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 1.31 + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 1.32 + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 1.33 + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 1.34 +*/ 1.35 + 1.36 +#ifndef VQ_H 1.37 +#define VQ_H 1.38 + 1.39 +#include "entenc.h" 1.40 +#include "entdec.h" 1.41 +#include "modes.h" 1.42 + 1.43 +/** Algebraic pulse-vector quantiser. The signal x is replaced by the sum of 1.44 + * the pitch and a combination of pulses such that its norm is still equal 1.45 + * to 1. This is the function that will typically require the most CPU. 1.46 + * @param X Residual signal to quantise/encode (returns quantised version) 1.47 + * @param N Number of samples to encode 1.48 + * @param K Number of pulses to use 1.49 + * @param enc Entropy encoder state 1.50 + * @ret A mask indicating which blocks in the band received pulses 1.51 +*/ 1.52 +unsigned alg_quant(celt_norm *X, int N, int K, int spread, int B, 1.53 + ec_enc *enc 1.54 +#ifdef RESYNTH 1.55 + , opus_val16 gain 1.56 +#endif 1.57 + ); 1.58 + 1.59 +/** Algebraic pulse decoder 1.60 + * @param X Decoded normalised spectrum (returned) 1.61 + * @param N Number of samples to decode 1.62 + * @param K Number of pulses to use 1.63 + * @param dec Entropy decoder state 1.64 + * @ret A mask indicating which blocks in the band received pulses 1.65 + */ 1.66 +unsigned alg_unquant(celt_norm *X, int N, int K, int spread, int B, 1.67 + ec_dec *dec, opus_val16 gain); 1.68 + 1.69 +void renormalise_vector(celt_norm *X, int N, opus_val16 gain); 1.70 + 1.71 +int stereo_itheta(celt_norm *X, celt_norm *Y, int stereo, int N); 1.72 + 1.73 +#endif /* VQ_H */