Little code cleanup near "AacEncEncode", re #2

This commit is contained in:
tipok 2008-11-06 20:46:51 +00:00
parent 0b0e568cd7
commit ebee08d10e
2 changed files with 11 additions and 26 deletions

View File

@ -216,30 +216,17 @@ aacPlusEncoder :: write ( const void * buf,
}
/* encode one AAC frame */
if (hEnvEnc && useParametricStereo) {
reportEvent(10, "Parametric Stereo encode one AAC frame");
AacEncEncode( aacEnc,
inBuf,
1, /* stride (step) */
ancDataBytes,
&numAncDataBytes,
(unsigned *) (outBuf+ADTS_HEADER_SIZE),
&numOutBytes);
if(hEnvEnc)
memcpy( inBuf,inBuf+AACENC_BLOCKSIZE,CORE_INPUT_OFFSET_PS*sizeof(float));
} else {
reportEvent(10, "encode one AAC frame");
AacEncEncode( aacEnc,
inBuf + coreReadOffset,
MAX_CHANNELS,
inBuf,
useParametricStereo ? 1 : MAX_CHANNELS, /* stride (step) */
ancDataBytes,
&numAncDataBytes,
(unsigned *) (outBuf+ADTS_HEADER_SIZE),
&numOutBytes);
reportEvent(10, "done AAC=", numOutBytes);
if(hEnvEnc)
if (useParametricStereo) {
memcpy( inBuf,inBuf+AACENC_BLOCKSIZE,CORE_INPUT_OFFSET_PS*sizeof(float));
} else {
memmove( inBuf,inBuf+AACENC_BLOCKSIZE*2*MAX_CHANNELS,writeOffset*sizeof(float));
}

View File

@ -118,7 +118,6 @@ class aacPlusEncoder : public AudioEncoder, public virtual Reporter
bool useParametricStereo;
int coreWriteOffset;
int coreReadOffset;
int envReadOffset;
int writeOffset;
struct AAC_ENCODER *aacEnc;
@ -168,7 +167,6 @@ class aacPlusEncoder : public AudioEncoder, public virtual Reporter
useParametricStereo = 0;
numAncDataBytes=0;
coreWriteOffset = 0;
coreReadOffset = 0;
envReadOffset = 0;
writeOffset = INPUT_DELAY*MAX_CHANNELS;
writtenSamples = 0;