Little code cleanup near "AacEncEncode", re #2
This commit is contained in:
parent
0b0e568cd7
commit
ebee08d10e
|
@ -216,30 +216,17 @@ aacPlusEncoder :: write ( const void * buf,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* encode one AAC frame */
|
/* 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");
|
reportEvent(10, "encode one AAC frame");
|
||||||
AacEncEncode( aacEnc,
|
AacEncEncode( aacEnc,
|
||||||
inBuf + coreReadOffset,
|
inBuf,
|
||||||
MAX_CHANNELS,
|
useParametricStereo ? 1 : MAX_CHANNELS, /* stride (step) */
|
||||||
ancDataBytes,
|
ancDataBytes,
|
||||||
&numAncDataBytes,
|
&numAncDataBytes,
|
||||||
(unsigned *) (outBuf+ADTS_HEADER_SIZE),
|
(unsigned *) (outBuf+ADTS_HEADER_SIZE),
|
||||||
&numOutBytes);
|
&numOutBytes);
|
||||||
|
if (useParametricStereo) {
|
||||||
reportEvent(10, "done AAC=", numOutBytes);
|
memcpy( inBuf,inBuf+AACENC_BLOCKSIZE,CORE_INPUT_OFFSET_PS*sizeof(float));
|
||||||
if(hEnvEnc)
|
} else {
|
||||||
memmove( inBuf,inBuf+AACENC_BLOCKSIZE*2*MAX_CHANNELS,writeOffset*sizeof(float));
|
memmove( inBuf,inBuf+AACENC_BLOCKSIZE*2*MAX_CHANNELS,writeOffset*sizeof(float));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -118,7 +118,6 @@ class aacPlusEncoder : public AudioEncoder, public virtual Reporter
|
||||||
|
|
||||||
bool useParametricStereo;
|
bool useParametricStereo;
|
||||||
int coreWriteOffset;
|
int coreWriteOffset;
|
||||||
int coreReadOffset;
|
|
||||||
int envReadOffset;
|
int envReadOffset;
|
||||||
int writeOffset;
|
int writeOffset;
|
||||||
struct AAC_ENCODER *aacEnc;
|
struct AAC_ENCODER *aacEnc;
|
||||||
|
@ -168,7 +167,6 @@ class aacPlusEncoder : public AudioEncoder, public virtual Reporter
|
||||||
useParametricStereo = 0;
|
useParametricStereo = 0;
|
||||||
numAncDataBytes=0;
|
numAncDataBytes=0;
|
||||||
coreWriteOffset = 0;
|
coreWriteOffset = 0;
|
||||||
coreReadOffset = 0;
|
|
||||||
envReadOffset = 0;
|
envReadOffset = 0;
|
||||||
writeOffset = INPUT_DELAY*MAX_CHANNELS;
|
writeOffset = INPUT_DELAY*MAX_CHANNELS;
|
||||||
writtenSamples = 0;
|
writtenSamples = 0;
|
||||||
|
|
Loading…
Reference in New Issue