added svn keywords, tabs changed into 4 whitespaces, re #2

This commit is contained in:
tipok 2008-11-05 13:02:24 +00:00
parent c8260ff827
commit d606610431
2 changed files with 96 additions and 95 deletions

View File

@ -98,9 +98,8 @@ aacPlusEncoder :: open ( void )
InitIIR21_Resampler(&(IIR21_reSampler[0])); InitIIR21_Resampler(&(IIR21_reSampler[0]));
InitIIR21_Resampler(&(IIR21_reSampler[1])); InitIIR21_Resampler(&(IIR21_reSampler[1]));
if(IIR21_reSampler[0].delay > MAX_DS_FILTER_DELAY){ if(IIR21_reSampler[0].delay > MAX_DS_FILTER_DELAY)
throw Exception(__FILE__, __LINE__, "IIR21 resampler delay is bigger then MAX_DS_FILTER_DELAY"); throw Exception(__FILE__, __LINE__, "IIR21 resampler delay is bigger then MAX_DS_FILTER_DELAY");
}
writeOffset += IIR21_reSampler[0].delay*MAX_CHANNELS; writeOffset += IIR21_reSampler[0].delay*MAX_CHANNELS;
} }
@ -111,9 +110,8 @@ aacPlusEncoder :: open ( void )
config.bandWidth=bandwidth; config.bandWidth=bandwidth;
/* set up SBR configuration */ /* set up SBR configuration */
if(!IsSbrSettingAvail (bitrate, nChannelsAAC, sampleRateAAC, &sampleRateAAC)) { if(!IsSbrSettingAvail(bitrate, nChannelsAAC, sampleRateAAC, &sampleRateAAC))
throw Exception(__FILE__, __LINE__, "No valid SBR configuration found"); throw Exception(__FILE__, __LINE__, "No valid SBR configuration found");
}
InitializeSbrDefaults (&sbrConfig); InitializeSbrDefaults (&sbrConfig);
sbrConfig.usePs = useParametricStereo; sbrConfig.usePs = useParametricStereo;
@ -182,10 +180,12 @@ aacPlusEncoder :: write ( const void * buf,
reportEvent(10, "converting short to float"); reportEvent(10, "converting short to float");
short *TimeDataPcm = (short *) buf; short *TimeDataPcm = (short *) buf;
for (i=0; i<samples; i++) for (i=0; i<samples; i++)
inBuf[i+writeOffset+writtenSamples] = (float) TimeDataPcm[i]; inBuf[i+writeOffset+writtenSamples] = (float) TimeDataPcm[i];
writtenSamples+=samples; writtenSamples+=samples;
reportEvent(10, "writtenSamples", writtenSamples); reportEvent(10, "writtenSamples", writtenSamples);
if (writtenSamples < inSamples) if (writtenSamples < inSamples)
return samples; return samples;
@ -201,16 +201,17 @@ aacPlusEncoder :: write ( const void * buf,
reportEvent(10, "numAncDataBytes=", numAncDataBytes); reportEvent(10, "numAncDataBytes=", numAncDataBytes);
/* 2:1 downsampling for AAC core */ /* 2:1 downsampling for AAC core */
if (!useParametricStereo){ if (!useParametricStereo) {
reportEvent(10, "2:1 downsampling for AAC core"); reportEvent(10, "2:1 downsampling for AAC core");
for( ch=0; ch<nChannelsAAC; ch++ ) for( ch=0; ch<nChannelsAAC; ch++ )
IIR21_Downsample( &(IIR21_reSampler[ch]), IIR21_Downsample( &(IIR21_reSampler[ch]),
inBuf+writeOffset+ch, inBuf + writeOffset+ch,
writtenSamples/getInChannel(), writtenSamples/getInChannel(),
MAX_CHANNELS, MAX_CHANNELS,
inBuf+ch, inBuf+ch,
&outSamples, &outSamples,
MAX_CHANNELS); MAX_CHANNELS);
reportEvent(10, "outSamples=", outSamples); reportEvent(10, "outSamples=", outSamples);
} }
@ -224,14 +225,13 @@ aacPlusEncoder :: write ( const void * buf,
&numAncDataBytes, &numAncDataBytes,
(unsigned *) (outBuf+ADTS_HEADER_SIZE), (unsigned *) (outBuf+ADTS_HEADER_SIZE),
&numOutBytes); &numOutBytes);
if(hEnvEnc) if(hEnvEnc)
memcpy( inBuf,inBuf+AACENC_BLOCKSIZE,CORE_INPUT_OFFSET_PS*sizeof(float)); memcpy( inBuf,inBuf+AACENC_BLOCKSIZE,CORE_INPUT_OFFSET_PS*sizeof(float));
} else { } else {
reportEvent(10, "encode one AAC frame"); reportEvent(10, "encode one AAC frame");
AacEncEncode( aacEnc, AacEncEncode( aacEnc,
inBuf+coreReadOffset, inBuf + coreReadOffset,
MAX_CHANNELS, MAX_CHANNELS,
ancDataBytes, ancDataBytes,
&numAncDataBytes, &numAncDataBytes,
@ -249,6 +249,7 @@ aacPlusEncoder :: write ( const void * buf,
adts_hdr_up(outBuf, numOutBytes); adts_hdr_up(outBuf, numOutBytes);
sink->write(outBuf, numOutBytes+ADTS_HEADER_SIZE); sink->write(outBuf, numOutBytes+ADTS_HEADER_SIZE);
} }
writtenSamples=0; writtenSamples=0;
return samples; return samples;

View File

@ -78,8 +78,8 @@ extern "C" {
/** /**
* A class representing aacplus AAC+ encoder. * A class representing aacplus AAC+ encoder.
* *
* @author $Author: tipok $ * @author $Author$
* @version $Revision: 1 $ * @version $Revision$
*/ */
#define CORE_DELAY (1600) #define CORE_DELAY (1600)