summaryrefslogtreecommitdiff
path: root/src/libfaad/decoder.h
diff options
context:
space:
mode:
authorMiguel Freitas <miguelfreitas@users.sourceforge.net>2002-07-14 23:43:01 +0000
committerMiguel Freitas <miguelfreitas@users.sourceforge.net>2002-07-14 23:43:01 +0000
commit53c5ec96b87ef2bb61c7d3188d549623495d4500 (patch)
treea1b4904418281d23a2ab750b70be88db40062aa3 /src/libfaad/decoder.h
parent0ee981a355115c35cc9b6aa5066d6b7271c4b28a (diff)
downloadxine-lib-53c5ec96b87ef2bb61c7d3188d549623495d4500.tar.gz
xine-lib-53c5ec96b87ef2bb61c7d3188d549623495d4500.tar.bz2
merge FAAD2 - the GPL AAC decoder library.
xine_decoder.c is working, but demux_qt must send some needed initialization data. currently it's hardcoded to play my test stream, so it's not usable yet. CVS patchset: 2267 CVS date: 2002/07/14 23:43:01
Diffstat (limited to 'src/libfaad/decoder.h')
-rw-r--r--src/libfaad/decoder.h146
1 files changed, 146 insertions, 0 deletions
diff --git a/src/libfaad/decoder.h b/src/libfaad/decoder.h
new file mode 100644
index 000000000..fb9f8c8c4
--- /dev/null
+++ b/src/libfaad/decoder.h
@@ -0,0 +1,146 @@
+/*
+** FAAD - Freeware Advanced Audio Decoder
+** Copyright (C) 2002 M. Bakker
+**
+** 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.
+**
+** $Id: decoder.h,v 1.1 2002/07/14 23:43:01 miguelfreitas Exp $
+**/
+
+#ifndef __DECODER_H__
+#define __DECODER_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef _WIN32
+ #pragma pack(push, 8)
+ #ifndef FAADAPI
+ #define FAADAPI __cdecl
+ #endif
+#else
+ #ifndef FAADAPI
+ #define FAADAPI
+ #endif
+#endif
+
+#include "bits.h"
+#include "syntax.h"
+#include "specrec.h"
+#include "filtbank.h"
+#include "ic_predict.h"
+
+
+#define FAAD_FMT_16BIT 1
+#define FAAD_FMT_24BIT 2
+#define FAAD_FMT_32BIT 3
+#define FAAD_FMT_FLOAT 4
+
+typedef struct faacDecConfiguration
+{
+ uint8_t defObjectType;
+ uint32_t defSampleRate;
+ uint8_t outputFormat;
+} faacDecConfiguration, *faacDecConfigurationPtr;
+
+typedef struct faacDecFrameInfo
+{
+ uint32_t bytesconsumed;
+ uint32_t samples;
+ uint8_t channels;
+ uint8_t error;
+} faacDecFrameInfo;
+
+typedef struct
+{
+ uint8_t adts_header_present;
+ uint8_t adif_header_present;
+ uint8_t sf_index;
+ uint8_t object_type;
+ uint8_t channelConfiguration;
+ uint8_t aacSectionDataResilienceFlag;
+ uint8_t aacScalefactorDataResilienceFlag;
+ uint8_t aacSpectralDataResilienceFlag;
+ uint16_t frameLength;
+
+ uint32_t frame;
+
+ void *sample_buffer;
+
+ uint8_t window_shape_prev[MAX_CHANNELS];
+#ifdef LTP_DEC
+ uint16_t ltp_lag[MAX_CHANNELS];
+#endif
+ fb_info fb;
+ drc_info drc;
+
+ real_t *time_state[MAX_CHANNELS];
+ real_t *time_out[MAX_CHANNELS];
+
+#ifdef MAIN_DEC
+ pred_state *pred_stat[MAX_CHANNELS];
+#endif
+#ifdef LTP_DEC
+ real_t *lt_pred_stat[MAX_CHANNELS];
+#endif
+
+ real_t exp_table[256];
+ real_t mnt_table[128];
+
+ real_t iq_table[IQ_TABLE_SIZE];
+#if POW_TABLE_SIZE
+ real_t pow2_table[POW_TABLE_SIZE];
+#endif
+
+ /* Configuration data */
+ faacDecConfiguration config;
+} faacDecStruct, *faacDecHandle;
+
+
+uint8_t* FAADAPI faacDecGetErrorMessage(uint8_t errcode);
+
+faacDecHandle FAADAPI faacDecOpen();
+
+faacDecConfigurationPtr FAADAPI faacDecGetCurrentConfiguration(faacDecHandle hDecoder);
+
+uint8_t FAADAPI faacDecSetConfiguration(faacDecHandle hDecoder,
+ faacDecConfigurationPtr config);
+
+/* Init the library based on info from the AAC file (ADTS/ADIF) */
+int32_t FAADAPI faacDecInit(faacDecHandle hDecoder,
+ uint8_t *buffer,
+ uint32_t *samplerate,
+ uint8_t *channels);
+
+/* Init the library using a DecoderSpecificInfo */
+int8_t FAADAPI faacDecInit2(faacDecHandle hDecoder, uint8_t *pBuffer,
+ uint32_t SizeOfDecoderSpecificInfo,
+ uint32_t *samplerate, uint8_t *channels);
+
+void FAADAPI faacDecClose(faacDecHandle hDecoder);
+
+void* FAADAPI faacDecDecode(faacDecHandle hDecoder,
+ faacDecFrameInfo *hInfo,
+ uint8_t *buffer);
+
+#ifdef _WIN32
+ #pragma pack(pop)
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+#endif