191 lines
4.8 KiB
Diff
191 lines
4.8 KiB
Diff
|
diff -Nupr src.p8/aacenc.c src.p9/aacenc.c
|
||
|
--- src.p8/aacenc.c 2010-10-21 13:06:37.000000000 +0300
|
||
|
+++ src.p9/aacenc.c 2010-10-21 13:06:37.000000000 +0300
|
||
|
@@ -10,39 +10,7 @@
|
||
|
|
||
|
/* the 3GPP instrumenting tool */
|
||
|
|
||
|
-struct AAC_ENCODER {
|
||
|
|
||
|
- AACENC_CONFIG config;
|
||
|
-
|
||
|
- ELEMENT_INFO elInfo;
|
||
|
-
|
||
|
- QC_STATE qcKernel;
|
||
|
- QC_OUT qcOut;
|
||
|
-
|
||
|
- PSY_OUT psyOut;
|
||
|
- PSY_KERNEL psyKernel;
|
||
|
-
|
||
|
- struct BITSTREAMENCODER_INIT bseInit;
|
||
|
-
|
||
|
- struct STEREO_PREPRO stereoPrePro;
|
||
|
-
|
||
|
- struct BIT_BUF bitStream;
|
||
|
- HANDLE_BIT_BUF hBitStream;
|
||
|
-
|
||
|
- /* lifetime vars */
|
||
|
- int downmix;
|
||
|
- int downmixFac;
|
||
|
- int dualMono;
|
||
|
- int bandwidth90dB;
|
||
|
-};
|
||
|
-
|
||
|
-
|
||
|
-/*
|
||
|
- static AAC encoder instance for one encoder
|
||
|
- all other major static and dynamic memory areas are located
|
||
|
- in module aac_ram.c and aac_rom.c
|
||
|
-*/
|
||
|
-static struct AAC_ENCODER aacEncoder;
|
||
|
|
||
|
|
||
|
/*-----------------------------------------------------------------------------
|
||
|
diff -Nupr src.p8/aacenc.h src.p9/aacenc.h
|
||
|
--- src.p8/aacenc.h 2010-10-21 13:06:37.000000000 +0300
|
||
|
+++ src.p9/aacenc.h 2010-10-21 13:06:37.000000000 +0300
|
||
|
@@ -5,38 +5,36 @@
|
||
|
#ifndef _aacenc_h_
|
||
|
#define _aacenc_h_
|
||
|
|
||
|
-/* here we distinguish between stereo and the mono only encoder */
|
||
|
-#ifdef MONO_ONLY
|
||
|
-#define MAX_CHANNELS 1
|
||
|
-#else
|
||
|
-#define MAX_CHANNELS 2
|
||
|
-#endif
|
||
|
-
|
||
|
-#define AACENC_BLOCKSIZE 1024 /*! encoder only takes BLOCKSIZE samples at a time */
|
||
|
-#define AACENC_TRANS_FAC 8 /*! encoder short long ratio */
|
||
|
-#define AACENC_PCM_LEVEL 1.0 /*! encoder pcm 0db refernence */
|
||
|
-
|
||
|
-
|
||
|
-/*-------------------------- defines --------------------------------------*/
|
||
|
-
|
||
|
-#define BUFFERSIZE 1024 /* anc data */
|
||
|
-
|
||
|
-/*-------------------- structure definitions ------------------------------*/
|
||
|
-
|
||
|
-typedef struct {
|
||
|
- int sampleRate; /* audio file sample rate */
|
||
|
- int bitRate; /* encoder bit rate in bits/sec */
|
||
|
- int nChannelsIn; /* number of channels on input (1,2) */
|
||
|
- int nChannelsOut; /* number of channels on output (1,2) */
|
||
|
- int bandWidth; /* core coder audio bandwidth in Hz */
|
||
|
-} AACENC_CONFIG;
|
||
|
-
|
||
|
-struct AAC_ENCODER;
|
||
|
-
|
||
|
-/*
|
||
|
- * p u b l i c a n c i l l a r y
|
||
|
- *
|
||
|
- */
|
||
|
+struct AAC_ENCODER {
|
||
|
+//#ifdef _FFTW3
|
||
|
+ FFTWFContext_t *fftctx;
|
||
|
+//#endif
|
||
|
+
|
||
|
+ aacplusEncConfiguration *config;
|
||
|
+ AACRam_t *aac_ram;
|
||
|
+ SBRRam_t *sbr_ram;
|
||
|
+
|
||
|
+ ELEMENT_INFO elInfo;
|
||
|
+
|
||
|
+ QC_STATE qcKernel;
|
||
|
+ QC_OUT qcOut;
|
||
|
+
|
||
|
+ PSY_OUT psyOut;
|
||
|
+ PSY_KERNEL psyKernel;
|
||
|
+
|
||
|
+ struct BITSTREAMENCODER_INIT bseInit;
|
||
|
+
|
||
|
+ struct STEREO_PREPRO stereoPrePro;
|
||
|
+
|
||
|
+ struct BIT_BUF bitStream;
|
||
|
+ HANDLE_BIT_BUF hBitStream;
|
||
|
+
|
||
|
+ /* lifetime vars */
|
||
|
+ int downmix;
|
||
|
+ int downmixFac;
|
||
|
+ int dualMono;
|
||
|
+ int bandwidth90dB;
|
||
|
+};
|
||
|
|
||
|
|
||
|
/*-----------------------------------------------------------------------------
|
||
|
diff -Nupr src.p8/sbr_main.c src.p9/sbr_main.c
|
||
|
--- src.p8/sbr_main.c 2010-10-21 13:06:37.000000000 +0300
|
||
|
+++ src.p9/sbr_main.c 2010-10-21 13:06:37.000000000 +0300
|
||
|
@@ -72,28 +72,6 @@ static const struct
|
||
|
};
|
||
|
|
||
|
|
||
|
-struct SBR_ENCODER
|
||
|
-{
|
||
|
-
|
||
|
- struct SBR_CONFIG_DATA sbrConfigData;
|
||
|
- struct SBR_HEADER_DATA sbrHeaderData;
|
||
|
- struct SBR_BITSTREAM_DATA sbrBitstreamData;
|
||
|
- struct ENV_CHANNEL* hEnvChannel[MAX_CHANNELS];
|
||
|
- struct COMMON_DATA CmonData;
|
||
|
- struct PS_ENC *hPsEnc;
|
||
|
- SBR_QMF_FILTER_BANK *hSynthesisQmfBank;
|
||
|
- unsigned int sbrPayloadPrevious[MAX_PAYLOAD_SIZE/(sizeof(int))];
|
||
|
- unsigned int sbrPayload[MAX_PAYLOAD_SIZE/(sizeof(int))];
|
||
|
- int sbrPayloadSize;
|
||
|
-} ;
|
||
|
-
|
||
|
-
|
||
|
-static struct ENV_CHANNEL EnvChannel[MAX_CHANNELS];
|
||
|
-static struct SBR_ENCODER sbrEncoder;
|
||
|
-static SBR_QMF_FILTER_BANK SynthesisQmfBank;
|
||
|
-static struct PS_ENC psEncoder;
|
||
|
-
|
||
|
-
|
||
|
/***************************************************************************/
|
||
|
/*!
|
||
|
|
||
|
@@ -804,21 +782,18 @@ createEnvChannel (int chan,
|
||
|
|
||
|
*****************************************************************************/
|
||
|
int
|
||
|
-EnvOpen (HANDLE_SBR_ENCODER * hEnvEncoder,
|
||
|
+EnvOpen (HANDLE_SBR_ENCODER hEnvEnc,
|
||
|
float *pCoreBuffer,
|
||
|
sbrConfigurationPtr params,
|
||
|
int *coreBandWith)
|
||
|
{
|
||
|
- HANDLE_SBR_ENCODER hEnvEnc ;
|
||
|
int ch;
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
- *hEnvEncoder=0;
|
||
|
|
||
|
|
||
|
- hEnvEnc = &sbrEncoder;
|
||
|
|
||
|
/* hEnvEnc->hEnvChannel[]
|
||
|
EnvChannel[]
|
||
|
@@ -1085,7 +1060,6 @@ EnvOpen (HANDLE_SBR_ENCODER * hEnvEncode
|
||
|
hEnvEnc->sbrPayloadSize = 0;
|
||
|
|
||
|
|
||
|
- *hEnvEncoder = hEnvEnc;
|
||
|
*coreBandWith = hEnvEnc->sbrConfigData.xOverFreq;
|
||
|
|
||
|
|
||
|
diff -Nupr src.p8/sbr_main.h src.p9/sbr_main.h
|
||
|
--- src.p8/sbr_main.h 2010-10-21 13:06:37.000000000 +0300
|
||
|
+++ src.p9/sbr_main.h 2010-10-21 13:06:37.000000000 +0300
|
||
|
@@ -102,7 +102,7 @@ typedef struct SBR_ENCODER *HANDLE_SBR_E
|
||
|
|
||
|
|
||
|
int
|
||
|
-EnvOpen (HANDLE_SBR_ENCODER* hEnvEncoder,
|
||
|
+EnvOpen (HANDLE_SBR_ENCODER hEnvEnc,
|
||
|
float *pCoreBuffer,
|
||
|
sbrConfigurationPtr params,
|
||
|
int *coreBandWith
|