/* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** ** $Id$ **/ #ifndef __DECODER_H__ #define __DECODER_H__ #ifdef __cplusplus extern "C" { #endif #ifdef _WIN32 #pragma pack(push, 8) #ifndef NEAACDECAPI #define NEAACDECAPI __cdecl #endif #else #ifndef NEAACDECAPI #define NEAACDECAPI #endif #endif /* library output formats */ #define FAAD_FMT_16BIT 1 #define FAAD_FMT_24BIT 2 #define FAAD_FMT_32BIT 3 #define FAAD_FMT_FLOAT 4 #define FAAD_FMT_FIXED FAAD_FMT_FLOAT #define FAAD_FMT_DOUBLE 5 #define LC_DEC_CAP (1<<0) #define MAIN_DEC_CAP (1<<1) #define LTP_DEC_CAP (1<<2) #define LD_DEC_CAP (1<<3) #define ERROR_RESILIENCE_CAP (1<<4) #define FIXED_POINT_CAP (1<<5) #define FRONT_CHANNEL_CENTER (1) #define FRONT_CHANNEL_LEFT (2) #define FRONT_CHANNEL_RIGHT (3) #define SIDE_CHANNEL_LEFT (4) #define SIDE_CHANNEL_RIGHT (5) #define BACK_CHANNEL_LEFT (6) #define BACK_CHANNEL_RIGHT (7) #define BACK_CHANNEL_CENTER (8) #define LFE_CHANNEL (9) #define UNKNOWN_CHANNEL (0) char* NEAACDECAPI NeAACDecGetErrorMessage(uint8_t errcode); uint32_t NEAACDECAPI NeAACDecGetCapabilities(void); NeAACDecHandle NEAACDECAPI NeAACDecOpen(void); NeAACDecConfigurationPtr NEAACDECAPI NeAACDecGetCurrentConfiguration(NeAACDecHandle hDecoder); uint8_t NEAACDECAPI NeAACDecSetConfiguration(NeAACDecHandle hDecoder, NeAACDecConfigurationPtr config); /* Init the library based on info from the AAC file (ADTS/ADIF) */ int32_t NEAACDECAPI NeAACDecInit(NeAACDecHandle hDecoder, uint8_t *buffer, uint32_t buffer_size, uint32_t *samplerate, uint8_t *channels); /* Init the library using a DecoderSpecificInfo */ int8_t NEAACDECAPI NeAACDecInit2(NeAACDecHandle hDecoder, uint8_t *pBuffer, uint32_t SizeOfDecoderSpecificInfo, uint32_t *samplerate, uint8_t *channels); /* Init the library for DRM */ int8_t NEAACDECAPI NeAACDecInitDRM(NeAACDecHandle *hDecoder, uint32_t samplerate, uint8_t channels); void NEAACDECAPI NeAACDecClose(NeAACDecHandle hDecoder); void NEAACDECAPI NeAACDecPostSeekReset(NeAACDecHandle hDecoder, int32_t frame); void* NEAACDECAPI NeAACDecDecode(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo, uint8_t *buffer, uint32_t buffer_size); void* NEAACDECAPI NeAACDecDecode2(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo, uint8_t *buffer, uint32_t buffer_size, void **sample_buffer, uint32_t sample_buffer_size); #ifdef _WIN32 #pragma pack(pop) #endif #ifdef __cplusplus } #endif #endif 7' href='#n27'>27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2005 by Michiel van der Kolk
*
* All files in this archive are subject to the GNU General Public License.
* See the file COPYING in the source tree root for full license agreement.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#include "databox.h"
#include "edittoken.h"
#include "editparser.h"
struct token *currenttoken,*lasttoken,*tokenstream;
int currentindex;
int lparencount,acceptedmask;
int tokensleft;
int invalid;
int invalid_mode;
void check_accepted(struct token *tstream, int count) {
parse_stream(tstream,count+1,INVALID_EXPERT);
}
void parse_stream(struct token *tstream, int count, int inv_mode) {
invalid_mode=inv_mode;
acceptedmask=0;
lparencount=0;
tokensleft=count;
currentindex=0;
invalid=0;
tokenstream=tstream;
currenttoken=&tokenstream[currentindex];
parseMExpr();
}
int check_tokenstream(struct token *tstream, int inv_mode) {
int inval=0;
int i;
parse_stream(tstream,-1,inv_mode);
inval=invalid;
while( (inv_mode==INVALID_STRIP||inv_mode==INVALID_MARK) && invalid)
parse_stream(tstream,-1,inv_mode);
i=0;
while(tstream[i].kind!=TOKEN_EOF)
if(tstream[i++].kind==TOKEN_INVALID) {
inval=1;
break;
}
return inval==0;
}
void parse_accept_rparen(void) {
if(!tokensleft) return;
if(lparencount) {
acceptedmask|=ACCEPT_RPAREN;
}
}
void parse_accept(int bitmask) {