michael@0: /* Copyright (c) 2007-2008 CSIRO michael@0: Copyright (c) 2007-2009 Xiph.Org Foundation michael@0: Copyright (c) 2008 Gregory Maxwell michael@0: Written by Jean-Marc Valin and Gregory Maxwell */ michael@0: /* michael@0: Redistribution and use in source and binary forms, with or without michael@0: modification, are permitted provided that the following conditions michael@0: are met: michael@0: michael@0: - Redistributions of source code must retain the above copyright michael@0: notice, this list of conditions and the following disclaimer. michael@0: michael@0: - Redistributions in binary form must reproduce the above copyright michael@0: notice, this list of conditions and the following disclaimer in the michael@0: documentation and/or other materials provided with the distribution. michael@0: michael@0: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS michael@0: ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT michael@0: LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR michael@0: A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER michael@0: OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, michael@0: EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, michael@0: PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR michael@0: PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF michael@0: LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING michael@0: NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS michael@0: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. michael@0: */ michael@0: michael@0: #ifndef MODES_H michael@0: #define MODES_H michael@0: michael@0: #include "opus_types.h" michael@0: #include "celt.h" michael@0: #include "arch.h" michael@0: #include "mdct.h" michael@0: #include "entenc.h" michael@0: #include "entdec.h" michael@0: michael@0: #define MAX_PERIOD 1024 michael@0: michael@0: #ifndef OVERLAP michael@0: #define OVERLAP(mode) ((mode)->overlap) michael@0: #endif michael@0: michael@0: #ifndef FRAMESIZE michael@0: #define FRAMESIZE(mode) ((mode)->mdctSize) michael@0: #endif michael@0: michael@0: typedef struct { michael@0: int size; michael@0: const opus_int16 *index; michael@0: const unsigned char *bits; michael@0: const unsigned char *caps; michael@0: } PulseCache; michael@0: michael@0: /** Mode definition (opaque) michael@0: @brief Mode definition michael@0: */ michael@0: struct OpusCustomMode { michael@0: opus_int32 Fs; michael@0: int overlap; michael@0: michael@0: int nbEBands; michael@0: int effEBands; michael@0: opus_val16 preemph[4]; michael@0: const opus_int16 *eBands; /**< Definition for each "pseudo-critical band" */ michael@0: michael@0: int maxLM; michael@0: int nbShortMdcts; michael@0: int shortMdctSize; michael@0: michael@0: int nbAllocVectors; /**< Number of lines in the matrix below */ michael@0: const unsigned char *allocVectors; /**< Number of bits in each band for several rates */ michael@0: const opus_int16 *logN; michael@0: michael@0: const opus_val16 *window; michael@0: mdct_lookup mdct; michael@0: PulseCache cache; michael@0: }; michael@0: michael@0: michael@0: #endif