1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/media/libopus/celt/modes.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,83 @@ 1.4 +/* Copyright (c) 2007-2008 CSIRO 1.5 + Copyright (c) 2007-2009 Xiph.Org Foundation 1.6 + Copyright (c) 2008 Gregory Maxwell 1.7 + Written by Jean-Marc Valin and Gregory Maxwell */ 1.8 +/* 1.9 + Redistribution and use in source and binary forms, with or without 1.10 + modification, are permitted provided that the following conditions 1.11 + are met: 1.12 + 1.13 + - Redistributions of source code must retain the above copyright 1.14 + notice, this list of conditions and the following disclaimer. 1.15 + 1.16 + - Redistributions in binary form must reproduce the above copyright 1.17 + notice, this list of conditions and the following disclaimer in the 1.18 + documentation and/or other materials provided with the distribution. 1.19 + 1.20 + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 1.21 + ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 1.22 + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 1.23 + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 1.24 + OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 1.25 + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 1.26 + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 1.27 + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 1.28 + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 1.29 + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 1.30 + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 1.31 +*/ 1.32 + 1.33 +#ifndef MODES_H 1.34 +#define MODES_H 1.35 + 1.36 +#include "opus_types.h" 1.37 +#include "celt.h" 1.38 +#include "arch.h" 1.39 +#include "mdct.h" 1.40 +#include "entenc.h" 1.41 +#include "entdec.h" 1.42 + 1.43 +#define MAX_PERIOD 1024 1.44 + 1.45 +#ifndef OVERLAP 1.46 +#define OVERLAP(mode) ((mode)->overlap) 1.47 +#endif 1.48 + 1.49 +#ifndef FRAMESIZE 1.50 +#define FRAMESIZE(mode) ((mode)->mdctSize) 1.51 +#endif 1.52 + 1.53 +typedef struct { 1.54 + int size; 1.55 + const opus_int16 *index; 1.56 + const unsigned char *bits; 1.57 + const unsigned char *caps; 1.58 +} PulseCache; 1.59 + 1.60 +/** Mode definition (opaque) 1.61 + @brief Mode definition 1.62 + */ 1.63 +struct OpusCustomMode { 1.64 + opus_int32 Fs; 1.65 + int overlap; 1.66 + 1.67 + int nbEBands; 1.68 + int effEBands; 1.69 + opus_val16 preemph[4]; 1.70 + const opus_int16 *eBands; /**< Definition for each "pseudo-critical band" */ 1.71 + 1.72 + int maxLM; 1.73 + int nbShortMdcts; 1.74 + int shortMdctSize; 1.75 + 1.76 + int nbAllocVectors; /**< Number of lines in the matrix below */ 1.77 + const unsigned char *allocVectors; /**< Number of bits in each band for several rates */ 1.78 + const opus_int16 *logN; 1.79 + 1.80 + const opus_val16 *window; 1.81 + mdct_lookup mdct; 1.82 + PulseCache cache; 1.83 +}; 1.84 + 1.85 + 1.86 +#endif