jmac-1.74/0000755000175000017500000000000010451145164012316 5ustar twernertwernerjmac-1.74/build/0000755000175000017500000000000010451144640013413 5ustar twernertwernerjmac-1.74/build/build-core.xml0000644000175000017500000000556410131471135016171 0ustar twernertwerner jmac-1.74/build/build-spi.xml0000644000175000017500000000775010131471135016033 0ustar twernertwerner jmac-1.74/build/build-spi15.xml0000644000175000017500000000570210131471135016174 0ustar twernertwerner jmac-1.74/changelog.txt0000644000175000017500000000575710451145121015015 0ustar twernertwernerJMAC Changelog =================== version 1.0 (March 4, 2004) ------------- Initial version It supports the MAC format up to 3.97 version. version 1.01 (March 8, 2004) ------------- Small bug fixes with Player and file openings. version 1.1 (March 14, 2004) ------------- Support of playing/converting audio from stream (any InputStream) implemented. Java Sound SPI for APE audio implemented. version 1.11 (March 15, 2004) ------------- Small performance improvements version 1.12 (March 22, 2004) ------------- The class CircularBuffer removed. Performance improvements. version 1.13 (March 25, 2004) ------------- Fixed bug with playing local files using jmacp. version 1.14 (March 26, 2004) ------------- Performance and reliability improvements. version 1.15 (March 27, 2004) ------------- More performance improvements. version 1.16 (March 27, 2004) ------------- Cleanup and bugfixing. version 1.2 (April 2, 2004) ------------- Java Sound SPI (based on Tritonus) for APE audio implemented. version 1.3 (April 24, 2004) ------------- The MAC format up to 3.98 version now supported. The ability to edit APE Tag info implemented. version 1.4 (April 29, 2004) ------------- The JNI wrapper around of original MAC library implemented. Now only Windows platform supported. Please, read readme.txt file for more details. version 1.41 (April 30, 2004) ------------- MD5 checking during file verification added. version 1.5 (May 7, 2004) ------------- The MAC format up to 3.99 version now supported. version 1.6 (May 13, 2004) ------------- The APE encoder (3.99) implemented, JNI wrapper updated and a lot of bug fixes. version 1.61 (May 13, 2004) ------------- Small bug fix in Tritonus based SPI. version 1.62 (May 18, 2004) ------------- Major bug fixing (generally in JNI wrapper). Small improvements. version 1.63 (May 24, 2004) ------------- Small improvements. Also, the ability to run jmac.jar as simple APE utility added. version 1.64 (June 5, 2004) ------------- The JNI wrapper around of original MAC library implemented (linux version). version 1.65 (Jule 5, 2004) ------------- Bug with compressing/decompressing of 24-bit audio fixed. There are several other small bug fixes. version 1.70 (October 7, 2004) ------------- Bug in compressing algorithm fixed (thanks to Dan). Also, the support of new features of JDK1.5 implemented. version 1.71 (October 8, 2004) ------------- The support both the JDK1.3 and JDK1.5 implemented. Code cleanup. version 1.72 (January 16, 2005) ------------- Some problems with closing output/input streams during compression where fixed (thanks again to Dan Rollo). version 1.73 (November 8, 2005) ------------- Some problems with correct identification of MAC format in SPI were fixed. Thanks to javazoom. version 1.74 (June 30, 2005) ------------- The SPI can freeze up in getAudioFileFormat if the target file represented as URL. Fixed. JNI wrapper recompiled under MSVS 2005. jmac-1.74/core/0000755000175000017500000000000010451144761013250 5ustar twernertwernerjmac-1.74/core/nativesrc/0000755000175000017500000000000010451144641015243 5ustar twernertwernerjmac-1.74/core/nativesrc/include/0000755000175000017500000000000010451144641016666 5ustar twernertwernerjmac-1.74/core/nativesrc/jmac/0000755000175000017500000000000010451144715016157 5ustar twernertwernerjmac-1.74/core/nativesrc/jmac/APEDecompressJMAC.cpp0000644000175000017500000003475410131230056021752 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ #include #include #include "APEDecompressJMAC.h" #include "UnBitArrayJMAC.h" #include #include #include #include #define DECODE_BLOCK_SIZE 4096 CAPEDecompressJMAC::CAPEDecompressJMAC(JNIEnv* aenv, jobject athisObject, jobject aioObject, int nVersion, int nCompressionLevel, int nStartBlock, int nFinishBlock, int nTotalBlocks, int nBlockAlign, int nBlocksPerFrame, int nSampleRate, int nBitsPerSample, int nChannels) { SetRefs(aenv, athisObject, aioObject); m_nVersion = nVersion; m_nCompressionLevel = nCompressionLevel; m_nBlockAlign = nBlockAlign; m_nBlocksPerFrame = nBlocksPerFrame; m_nBitsPerSample = nBitsPerSample; FillWaveFormatEx(&m_wfeInput, nSampleRate, nBitsPerSample, nChannels); // initialize other stuff m_bDecompressorInitialized = FALSE; m_nCurrentFrame = 0; m_nRealFrame = 0; m_nCurrentBlock = 0; m_nCurrentFrameBufferBlock = 0; m_nFrameBufferFinishedBlocks = 0; m_bErrorDecodingCurrentFrame = FALSE; // set the "real" start and finish blocks m_nStartBlock = (nStartBlock < 0) ? 0 : min(nStartBlock, nTotalBlocks); m_nFinishBlock = (nFinishBlock < 0) ? nTotalBlocks : min(nFinishBlock, nTotalBlocks); m_bIsRanged = (m_nStartBlock != 0) || (m_nFinishBlock != nTotalBlocks); } CAPEDecompressJMAC::~CAPEDecompressJMAC() { } int CAPEDecompressJMAC::GetData(char* pBuffer, int nBlocks, int* pBlocksRetrieved) { int nRetVal = ERROR_SUCCESS; if (pBlocksRetrieved) *pBlocksRetrieved = 0; // make sure we're initialized RETURN_ON_ERROR(InitializeDecompressor()) // cap int nBlocksUntilFinish = m_nFinishBlock - m_nCurrentBlock; const int nBlocksToRetrieve = min(nBlocks, nBlocksUntilFinish); // get the data unsigned char * pOutputBuffer = (unsigned char *) pBuffer; int nBlocksLeft = nBlocksToRetrieve; int nBlocksThisPass = 1; while ((nBlocksLeft > 0) && (nBlocksThisPass > 0)) { // fill up the frame buffer int nDecodeRetVal = FillFrameBuffer(); if (nDecodeRetVal != ERROR_SUCCESS) nRetVal = nDecodeRetVal; // analyze how much to remove from the buffer const int nFrameBufferBlocks = m_nFrameBufferFinishedBlocks; nBlocksThisPass = min(nBlocksLeft, nFrameBufferBlocks); // remove as much as possible if (nBlocksThisPass > 0) { m_cbFrameBuffer.Get(pOutputBuffer, nBlocksThisPass * m_nBlockAlign); pOutputBuffer += nBlocksThisPass * m_nBlockAlign; nBlocksLeft -= nBlocksThisPass; m_nFrameBufferFinishedBlocks -= nBlocksThisPass; } } // calculate the blocks retrieved int nBlocksRetrieved = nBlocksToRetrieve - nBlocksLeft; // update position m_nCurrentBlock += nBlocksRetrieved; if (pBlocksRetrieved) *pBlocksRetrieved = nBlocksRetrieved; return nRetVal; } int CAPEDecompressJMAC::Seek(int nBlockOffset) { RETURN_ON_ERROR(InitializeDecompressor()) // use the offset nBlockOffset += m_nStartBlock; // cap (to prevent seeking too far) if (nBlockOffset >= m_nFinishBlock) nBlockOffset = m_nFinishBlock - 1; if (nBlockOffset < m_nStartBlock) nBlockOffset = m_nStartBlock; // seek to the perfect location int nBaseFrame = nBlockOffset / m_nBlocksPerFrame; int nBlocksToSkip = nBlockOffset % m_nBlocksPerFrame; int nBytesToSkip = nBlocksToSkip* m_nBlockAlign; m_nCurrentBlock = nBaseFrame * m_nBlocksPerFrame; m_nCurrentFrameBufferBlock = nBaseFrame * m_nBlocksPerFrame; m_nCurrentFrame = nBaseFrame; m_nFrameBufferFinishedBlocks = 0; m_cbFrameBuffer.Empty(); RETURN_ON_ERROR(SeekToFrame(m_nCurrentFrame)); // skip necessary blocks CSmartPtr spTempBuffer(new char [nBytesToSkip], TRUE); if (spTempBuffer == NULL) return ERROR_INSUFFICIENT_MEMORY; int nBlocksRetrieved = 0; GetData(spTempBuffer, nBlocksToSkip, &nBlocksRetrieved); if (nBlocksRetrieved != nBlocksToSkip) return ERROR_UNDEFINED; return ERROR_SUCCESS; } int CAPEDecompressJMAC::InitializeDecompressor() { // check if we have anything to do if (m_bDecompressorInitialized) return ERROR_SUCCESS; // update the initialized flag m_bDecompressorInitialized = TRUE; // create a frame buffer m_cbFrameBuffer.CreateBuffer((m_nBlocksPerFrame + DECODE_BLOCK_SIZE) * m_nBlockAlign, m_nBlockAlign * 64); // create decoding components m_spUnBitArray.Assign((CUnBitArrayBase *) new CUnBitArrayJMAC(this, m_nVersion)); if (m_nVersion >= 3950) { m_spNewPredictorX.Assign(new CPredictorDecompress3950toCurrent(m_nCompressionLevel, m_nVersion)); m_spNewPredictorY.Assign(new CPredictorDecompress3950toCurrent(m_nCompressionLevel, m_nVersion)); } else { m_spNewPredictorX.Assign(new CPredictorDecompressNormal3930to3950(m_nCompressionLevel, m_nVersion)); m_spNewPredictorY.Assign(new CPredictorDecompressNormal3930to3950(m_nCompressionLevel, m_nVersion)); } // seek to the beginning return Seek(-1); } /***************************************************************************************** Decodes blocks of data *****************************************************************************************/ int CAPEDecompressJMAC::FillFrameBuffer() { int nRetVal = ERROR_SUCCESS; // determine the maximum blocks we can decode // note that we won't do end capping because we can't use data // until EndFrame(...) successfully handles the frame // that means we may decode a little extra in end capping cases // but this allows robust error handling of bad frames int nMaxBlocks = m_cbFrameBuffer.MaxAdd() / m_nBlockAlign; // loop and decode data int nBlocksLeft = nMaxBlocks; while (nBlocksLeft > 0) { int nFrameBlocks = getApeInfoFrameBlocks(m_nCurrentFrame); if (nFrameBlocks < 0) break; int nFrameOffsetBlocks = m_nCurrentFrameBufferBlock % m_nBlocksPerFrame; int nFrameBlocksLeft = nFrameBlocks - nFrameOffsetBlocks; int nBlocksThisPass = min(nFrameBlocksLeft, nBlocksLeft); // start the frame if we need to if (nFrameOffsetBlocks == 0) StartFrame(); // store the frame buffer bytes before we start int nFrameBufferBytes = m_cbFrameBuffer.MaxGet(); // decode data DecodeBlocksToFrameBuffer(nBlocksThisPass); // end the frame if we need to if ((nFrameOffsetBlocks + nBlocksThisPass) >= nFrameBlocks) { EndFrame(); if (m_bErrorDecodingCurrentFrame) { // remove any decoded data from the buffer m_cbFrameBuffer.RemoveTail(m_cbFrameBuffer.MaxGet() - nFrameBufferBytes); // add silence unsigned char cSilence = (m_nBitsPerSample == 8) ? 127 : 0; for (int z = 0; z < nFrameBlocks*m_nBlockAlign; z++) { *m_cbFrameBuffer.GetDirectWritePointer() = cSilence; m_cbFrameBuffer.UpdateAfterDirectWrite(1); } // seek to try to synchronize after an error SeekToFrame(m_nCurrentFrame); // save the return value nRetVal = ERROR_INVALID_CHECKSUM; } } nBlocksLeft -= nBlocksThisPass; } return nRetVal; } void CAPEDecompressJMAC::DecodeBlocksToFrameBuffer(int nBlocks) { // decode the samples int nBlocksProcessed = 0; try { if (m_wfeInput.nChannels == 2) { if ((m_nSpecialCodes & SPECIAL_FRAME_LEFT_SILENCE) && (m_nSpecialCodes & SPECIAL_FRAME_RIGHT_SILENCE)) for (nBlocksProcessed = 0; nBlocksProcessed < nBlocks; nBlocksProcessed++) { m_Prepare.Unprepare(0, 0, &m_wfeInput, m_cbFrameBuffer.GetDirectWritePointer(), &m_nCRC); m_cbFrameBuffer.UpdateAfterDirectWrite(m_nBlockAlign); } else if (m_nSpecialCodes & SPECIAL_FRAME_PSEUDO_STEREO) for (nBlocksProcessed = 0; nBlocksProcessed < nBlocks; nBlocksProcessed++) { int X = m_spNewPredictorX->DecompressValue(m_spUnBitArray->DecodeValueRange(m_BitArrayStateX)); m_Prepare.Unprepare(X, 0, &m_wfeInput, m_cbFrameBuffer.GetDirectWritePointer(), &m_nCRC); m_cbFrameBuffer.UpdateAfterDirectWrite(m_nBlockAlign); } else { if (m_nVersion >= 3950) for (nBlocksProcessed = 0; nBlocksProcessed < nBlocks; nBlocksProcessed++) { int nY = m_spUnBitArray->DecodeValueRange(m_BitArrayStateY); int nX = m_spUnBitArray->DecodeValueRange(m_BitArrayStateX); int Y = m_spNewPredictorY->DecompressValue(nY, m_nLastX); int X = m_spNewPredictorX->DecompressValue(nX, Y); m_nLastX = X; m_Prepare.Unprepare(X, Y, &m_wfeInput, m_cbFrameBuffer.GetDirectWritePointer(), &m_nCRC); m_cbFrameBuffer.UpdateAfterDirectWrite(m_nBlockAlign); } else for (nBlocksProcessed = 0; nBlocksProcessed < nBlocks; nBlocksProcessed++) { int X = m_spNewPredictorX->DecompressValue(m_spUnBitArray->DecodeValueRange(m_BitArrayStateX)); int Y = m_spNewPredictorY->DecompressValue(m_spUnBitArray->DecodeValueRange(m_BitArrayStateY)); m_Prepare.Unprepare(X, Y, &m_wfeInput, m_cbFrameBuffer.GetDirectWritePointer(), &m_nCRC); m_cbFrameBuffer.UpdateAfterDirectWrite(m_nBlockAlign); } } } else { if (m_nSpecialCodes & SPECIAL_FRAME_MONO_SILENCE) for (nBlocksProcessed = 0; nBlocksProcessed < nBlocks; nBlocksProcessed++) { m_Prepare.Unprepare(0, 0, &m_wfeInput, m_cbFrameBuffer.GetDirectWritePointer(), &m_nCRC); m_cbFrameBuffer.UpdateAfterDirectWrite(m_nBlockAlign); } else for (nBlocksProcessed = 0; nBlocksProcessed < nBlocks; nBlocksProcessed++) { int X = m_spNewPredictorX->DecompressValue(m_spUnBitArray->DecodeValueRange(m_BitArrayStateX)); m_Prepare.Unprepare(X, 0, &m_wfeInput, m_cbFrameBuffer.GetDirectWritePointer(), &m_nCRC); m_cbFrameBuffer.UpdateAfterDirectWrite(m_nBlockAlign); } } } catch (...) { m_bErrorDecodingCurrentFrame = TRUE; } m_nCurrentFrameBufferBlock += nBlocks; } void CAPEDecompressJMAC::StartFrame() { m_nCRC = 0xFFFFFFFF; // get the frame header m_nStoredCRC = m_spUnBitArray->DecodeValue(DECODE_VALUE_METHOD_UNSIGNED_INT); m_bErrorDecodingCurrentFrame = FALSE; // get any 'special' codes if the file uses them (for silence, FALSE stereo, etc.) m_nSpecialCodes = 0; if (m_nVersion > 3820) { if (m_nStoredCRC & 0x80000000) m_nSpecialCodes = m_spUnBitArray->DecodeValue(DECODE_VALUE_METHOD_UNSIGNED_INT); m_nStoredCRC &= 0x7FFFFFFF; } m_spNewPredictorX->Flush(); m_spNewPredictorY->Flush(); m_spUnBitArray->FlushState(m_BitArrayStateX); m_spUnBitArray->FlushState(m_BitArrayStateY); m_spUnBitArray->FlushBitArray(); m_nLastX = 0; } void CAPEDecompressJMAC::EndFrame() { m_nFrameBufferFinishedBlocks += getApeInfoFrameBlocks(m_nCurrentFrame); m_nCurrentFrame++; // finalize m_spUnBitArray->Finalize(); // check the CRC m_nCRC = m_nCRC ^ 0xFFFFFFFF; m_nCRC >>= 1; if (m_nCRC != m_nStoredCRC) m_bErrorDecodingCurrentFrame = TRUE; } int CAPEDecompressJMAC::getApeInfoFrameBlocks(int nFrameIndex) { jclass clazz = env->GetObjectClass(thisObject); jmethodID method = env->GetMethodID(clazz, "getApeInfoFrameBlocks", "(I)I"); if (method == NULL) { if (env->ExceptionOccurred()) { env->ExceptionDescribe(); env->ExceptionClear(); } env->DeleteLocalRef(clazz); return -1; } env->DeleteLocalRef(clazz); return env->CallIntMethod(thisObject, method, (jint) nFrameIndex); } int CAPEDecompressJMAC::getApeInfoSeekByte(int nFrameIndex) { jclass clazz = env->GetObjectClass(thisObject); jmethodID method = env->GetMethodID(clazz, "getApeInfoSeekByte", "(I)I"); if (method == NULL) { if (env->ExceptionOccurred()) { env->ExceptionDescribe(); env->ExceptionClear(); } env->DeleteLocalRef(clazz); return -1; } env->DeleteLocalRef(clazz); return env->CallIntMethod(thisObject, method, (jint) nFrameIndex); } int CAPEDecompressJMAC::SeekToFrame(int nFrameIndex) { int nSeekRemainder = (getApeInfoSeekByte(nFrameIndex) - getApeInfoSeekByte(0)) % 4; int retVal = m_spUnBitArray->FillAndResetBitArray(m_nRealFrame == nFrameIndex ? -1 : getApeInfoSeekByte(nFrameIndex) - nSeekRemainder, nSeekRemainder * 8); m_nRealFrame = nFrameIndex; return retVal; } int CAPEDecompressJMAC::GetInfo(APE_DECOMPRESS_FIELDS Field, int nParam1, int nParam2) { return -1; } jmac-1.74/core/nativesrc/jmac/APEDecompressJMAC.h0000644000175000017500000000664110131230056021411 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ #ifndef JMAC_APEDECOMPRESS_H #define JMAC_APEDECOMPRESS_H class CUnBitArray; class CPrepare; class CAPEInfo; class IPredictorDecompress; #include #include #include #include #include "UnBitArrayJMAC.h" class CAPEDecompressJMAC : public IAPEDecompress { public: CAPEDecompressJMAC(JNIEnv* aenv, jobject athisObject, jobject aioObject, int nVersion, int nCompressionLevel, int nStartBlock, int nFinishBlock, int nTotalBlocks, int nBlockAlign, int nBlocksPerFrame, int nSampleRate, int nBitsPerSample, int nChannels); ~CAPEDecompressJMAC(); inline void SetRefs(JNIEnv* aenv, jobject athisObject, jobject aioObject) { env = aenv; thisObject = athisObject; ioObject = aioObject; } int getApeInfoFrameBlocks(int nFrameIndex); int getApeInfoSeekByte(int nFrameIndex); int GetData(char* pBuffer, int nBlocks, int* pBlocksRetrieved); int Seek(int nBlockOffset); int GetInfo(APE_DECOMPRESS_FIELDS Field, int nParam1 = 0, int nParam2 = 0); protected: // file info int m_nBlockAlign; int m_nCurrentFrame; int m_nRealFrame; // start / finish information int m_nStartBlock; int m_nFinishBlock; int m_nCurrentBlock; BOOL m_bIsRanged; BOOL m_bDecompressorInitialized; // decoding tools CPrepare m_Prepare; WAVEFORMATEX m_wfeInput; unsigned int m_nCRC; unsigned int m_nStoredCRC; int m_nSpecialCodes; int SeekToFrame(int nFrameIndex); void DecodeBlocksToFrameBuffer(int nBlocks); int FillFrameBuffer(); void StartFrame(); void EndFrame(); int InitializeDecompressor(); // more decoding components CSmartPtr m_spAPEInfo; CSmartPtr m_spUnBitArray; UNBIT_ARRAY_STATE m_BitArrayStateX; UNBIT_ARRAY_STATE m_BitArrayStateY; CSmartPtr m_spNewPredictorX; CSmartPtr m_spNewPredictorY; int m_nLastX; // decoding buffer BOOL m_bErrorDecodingCurrentFrame; int m_nCurrentFrameBufferBlock; int m_nFrameBufferFinishedBlocks; CCircleBuffer m_cbFrameBuffer; int m_nVersion; int m_nCompressionLevel; int m_nBlocksPerFrame; int m_nBitsPerSample; friend class CUnBitArrayJMAC; JNIEnv* env; jobject ioObject; jobject thisObject; }; #endif // #ifndef JMAC_APEDECOMPRESS_H jmac-1.74/core/nativesrc/jmac/jmac.cpp0000644000175000017500000001216610131230056017570 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ // jmac.cpp // #include #include #include "jmac.h" #include "APEDecompressJMAC.h" #define MAX_DECODERS 1024 CAPEDecompressJMAC* decoders[MAX_DECODERS]; typedef struct MAC_ERROR { int nErrorCode; char* spErrorExplanation; } MAC_ERROR; #define NUM_MAC_ERRORS 23 MAC_ERROR MAC_ERRORS[NUM_MAC_ERRORS] = { ERROR_EXPLANATION }; void ThrowError(JNIEnv* env, int nErrorCode) { char* errorMessage = "Error Undefined"; for (int i = 0; i < NUM_MAC_ERRORS; i++) { if (MAC_ERRORS[i].nErrorCode == nErrorCode) { errorMessage = MAC_ERRORS[i].spErrorExplanation; break; } } jclass clazz = env->FindClass("davaguine/jmac/tools/JMACException"); if (clazz == NULL) { if (env->ExceptionOccurred()) { env->ExceptionDescribe(); env->ExceptionClear(); } } else env->ThrowNew(clazz, errorMessage); env->DeleteLocalRef(clazz); } JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void* reserved) { memset(decoders, 0, sizeof(decoders)); return JNI_VERSION_1_4; } JNIEXPORT void JNICALL JNI_OnUnload(JavaVM* vm, void* reserved) { for (jint i = 0; i < MAX_DECODERS; i++) { if (decoders[i]) { delete decoders[i]; decoders[i] = NULL; } } } JNIEXPORT jint JNICALL Java_davaguine_jmac_decoder_APEDecompressNative_registerDecoder(JNIEnv* env, jobject athisObject, jobject aioObject, jint nVersion, jint nCompressionLevel, jint nStartBlock, jint nFinishBlock, jint nTotalBlocks, jint nBlockAlign, jint nBlocksPerFrame, jint nSampleRate, jint nBitsPerSample, jint nChannels) { for (jint i = 0; i < MAX_DECODERS; i++) { if (!decoders[i]) { decoders[i] = new CAPEDecompressJMAC(env, athisObject, aioObject, nVersion, nCompressionLevel, nStartBlock, nFinishBlock, nTotalBlocks, nBlockAlign, nBlocksPerFrame, nSampleRate, nBitsPerSample, nChannels); return i; } } return -1; } JNIEXPORT jint JNICALL Java_davaguine_jmac_decoder_APEDecompressNative_GetData(JNIEnv* env, jobject athisObject, jint ID, jobject aioObject, jbyteArray pBuffer, jint nBlocks) { if (decoders[ID] != NULL) { decoders[ID]->SetRefs(env, athisObject, aioObject); jbyte* elements = env->GetByteArrayElements(pBuffer, NULL); if (elements != NULL) { int nBlocksRetrieved; int retValue = decoders[ID]->GetData((char*) elements, nBlocks, &nBlocksRetrieved); env->ReleaseByteArrayElements(pBuffer, elements, 0); if (retValue != ERROR_SUCCESS) ThrowError(env, retValue); return nBlocksRetrieved; } } ThrowError(env, ERROR_UNDEFINED); return -1; }; JNIEXPORT void JNICALL Java_davaguine_jmac_decoder_APEDecompressNative_Seek(JNIEnv* env, jobject athisObject, jint ID, jobject aioObject, jint nBlockOffset) { if (decoders[ID] != NULL) { decoders[ID]->SetRefs(env, athisObject, aioObject); int retValue = decoders[ID]->Seek(nBlockOffset); if (retValue != ERROR_SUCCESS) ThrowError(env, retValue); return; } ThrowError(env, ERROR_UNDEFINED); }; JNIEXPORT void JNICALL Java_davaguine_jmac_decoder_APEDecompressNative_finalize(JNIEnv* env, jobject athisObject, jint ID, jobject aioObject) { if (decoders[ID] != NULL) { decoders[ID]->SetRefs(env, athisObject, aioObject); delete decoders[ID]; decoders[ID] = NULL; return; } ThrowError(env, ERROR_UNDEFINED); }; jmac-1.74/core/nativesrc/jmac/jmac.def0000644000175000017500000000060610131230056017540 0ustar twernertwerner; jmac.def : Declares the module parameters for the DLL. LIBRARY "jmac" EXPORTS ; Explicit exports can go here JNI_OnLoad JNI_OnUnload Java_davaguine_jmac_decoder_APEDecompressNative_registerDecoder Java_davaguine_jmac_decoder_APEDecompressNative_GetData Java_davaguine_jmac_decoder_APEDecompressNative_Seek Java_davaguine_jmac_decoder_APEDecompressNative_finalize jmac-1.74/core/nativesrc/jmac/jmac.h0000644000175000017500000000543110131230056017232 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ #ifndef _JMAC_H #define _JMAC_H #ifdef __cplusplus extern "C" { #endif JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void* reserved); JNIEXPORT void JNICALL JNI_OnUnload(JavaVM* vm, void* reserved); JNIEXPORT jint JNICALL Java_davaguine_jmac_decoder_APEDecompressNative_registerDecoder(JNIEnv* env, jobject athisObject, jobject aioObject, jint nVersion, jint nCompressionLevel, jint nStartBlock, jint nFinishBlock, jint nTotalBlocks, jint nBlockAlign, jint nBlocksPerFrame, jint nSampleRate, jint nBitsPerSample, jint nChannels); JNIEXPORT jint JNICALL Java_davaguine_jmac_decoder_APEDecompressNative_GetData(JNIEnv* env, jobject athisObject, jint ID, jobject aioObject, jbyteArray pBuffer, jint nBlocks); JNIEXPORT void JNICALL Java_davaguine_jmac_decoder_APEDecompressNative_Seek(JNIEnv* env, jobject athisObject, jint ID, jobject aioObject, jint nBlockOffset); JNIEXPORT void JNICALL Java_davaguine_jmac_decoder_APEDecompressNative_finalize(JNIEnv* env, jobject athisObject, jint ID, jobject aioObject); #ifdef __cplusplus } #endif #endif //_JMAC_H jmac-1.74/core/nativesrc/jmac/jmac.sln0000644000175000017500000000154310451140437017607 0ustar twernertwernerMicrosoft Visual Studio Solution File, Format Version 9.00 # Visual Studio 2005 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jmac", "jmac.vcproj", "{E5C18EDC-7E7B-4EED-A810-4CC86D5D25F4}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 Release|Win32 = Release|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {E5C18EDC-7E7B-4EED-A810-4CC86D5D25F4}.Debug|Win32.ActiveCfg = Debug|Win32 {E5C18EDC-7E7B-4EED-A810-4CC86D5D25F4}.Debug|Win32.Build.0 = Debug|Win32 {E5C18EDC-7E7B-4EED-A810-4CC86D5D25F4}.Release|Win32.ActiveCfg = Release|Win32 {E5C18EDC-7E7B-4EED-A810-4CC86D5D25F4}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal jmac-1.74/core/nativesrc/jmac/jmac.vcproj0000644000175000017500000001262610451144232020317 0ustar twernertwerner jmac-1.74/core/nativesrc/jmac/Makefile0000644000175000017500000000141010131230056017600 0ustar twernertwernerTARGET = jmac INCLUDES = -I/usr/local/java/include -I/usr/local/java/include/linux -I../mac/Source/MACLib -I../mac/Source/Shared CPPOPT = -s -O3 -D__GNUC_IA32__ -DBUILD_CROSS_PLATFORM COMPILER = gcc SOURCEFILES = \ APEDecompressJMAC.o \ jmac.o \ UnBitArrayJMAC.o \ ../mac/Shared/libmac.a $(TARGET): $(SOURCEFILES) $(COMPILER) -lstdc++ -shared $(CPPOPT) $(INCLUDES) -o lib$(TARGET).so $(SOURCEFILES) APEDecompressJMAC.o: APEDecompressJMAC.cpp $(COMPILER) -c $(CPPOPT) $(INCLUDES) -o APEDecompressJMAC.o APEDecompressJMAC.cpp jmac.o: jmac.cpp $(COMPILER) -c $(CPPOPT) $(INCLUDES) -o jmac.o jmac.cpp UnBitArrayJMAC.o: UnBitArrayJMAC.cpp $(COMPILER) -c $(CPPOPT) $(INCLUDES) -o UnBitArrayJMAC.o UnBitArrayJMAC.cpp jmac-1.74/core/nativesrc/jmac/NULLIO.h0000644000175000017500000000375510131230056017331 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ #ifndef JMAC_NULLIO_H #define JMAC_NULLIO_H class CNULLIO : public CIO { public: // construction / destruction CNULLIO() { }; ~CNULLIO() { }; // open / close int Open(const wchar_t* pName) { return 0; }; int Close() { return 0; }; // read / write int Read(void* pBuffer, unsigned int nBytesToRead, unsigned int* pBytesRead) { return 0; }; int Write(const void* pBuffer, unsigned int nBytesToWrite, unsigned int* pBytesWritten) { return 0; }; // seek int Seek(int nDistance, unsigned int nMoveMode) { return 0; }; // other functions int SetEOF() { return 0; }; // creation / destruction int Create(const wchar_t* pName) { return 0; }; int Delete() { return 0; }; // attributes int GetPosition() { return 0; }; int GetSize() { return 0; }; int GetName(wchar_t* pBuffer) { return 0; }; }; #endif //JMAC_NULLIO_H jmac-1.74/core/nativesrc/jmac/UnBitArrayJMAC.cpp0000644000175000017500000001130610131230056021324 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ #include #include #include #include "UnBitArrayJMAC.h" #include "APEDecompressJMAC.h" #include "NULLIO.h" CNULLIO m_IO; /*********************************************************************************** Construction ***********************************************************************************/ CUnBitArrayJMAC::CUnBitArrayJMAC(CAPEDecompressJMAC* decoder, int nVersion) : CUnBitArray(&m_IO, nVersion) { m_APEDecompress = decoder; JNIEnv* env = m_APEDecompress->env; jbyteArray ba = env->NewByteArray(m_nBytes); if (ba != NULL) { byteArray = (jbyteArray) env->NewGlobalRef(ba); env->DeleteLocalRef(ba); } else byteArray = NULL; } CUnBitArrayJMAC::~CUnBitArrayJMAC() { if (byteArray != NULL) m_APEDecompress->env->DeleteGlobalRef(byteArray); } int CUnBitArrayJMAC::Seek(int nDistance) { JNIEnv* env = m_APEDecompress->env; jclass clazz = env->GetObjectClass(m_APEDecompress->ioObject); jmethodID method = env->GetMethodID(clazz, "seek", "(J)V"); if (method == NULL) { if (env->ExceptionOccurred()) { env->ExceptionDescribe(); env->ExceptionClear(); } env->DeleteLocalRef(clazz); return ERROR_IO_READ; } env->DeleteLocalRef(clazz); env->CallVoidMethod(m_APEDecompress->ioObject, method, (jlong) nDistance); if (env->ExceptionOccurred()) { env->ExceptionClear(); return ERROR_IO_READ; } return ERROR_SUCCESS; } int CUnBitArrayJMAC::Read(void* pBuffer, unsigned int nBytesToRead, unsigned int* pBytesRead) { JNIEnv* env = m_APEDecompress->env; jclass clazz = env->GetObjectClass(m_APEDecompress->ioObject); jmethodID method = env->GetMethodID(clazz, "read", "([BII)I"); if (method == NULL) { if (env->ExceptionOccurred()) { env->ExceptionDescribe(); env->ExceptionClear(); } env->DeleteLocalRef(clazz); return ERROR_IO_READ; } env->DeleteLocalRef(clazz); *pBytesRead = env->CallIntMethod(m_APEDecompress->ioObject, method, byteArray, 0, nBytesToRead); if (env->ExceptionOccurred()) { env->ExceptionClear(); return ERROR_IO_READ; } void* elements = env->GetPrimitiveArrayCritical(byteArray, NULL); if (elements == NULL) { if (env->ExceptionOccurred()) env->ExceptionClear(); return ERROR_IO_READ; } memcpy(pBuffer, elements, nBytesToRead); env->ReleasePrimitiveArrayCritical(byteArray, elements, 0); return ERROR_SUCCESS; } int CUnBitArrayJMAC::FillAndResetBitArray(int nFileLocation, int nNewBitIndex) { // reset the bit index m_nCurrentBitIndex = nNewBitIndex; // seek if necessary if (nFileLocation != -1) { if (Seek(nFileLocation) != 0) return ERROR_IO_READ; } // read the new data into the bit array unsigned int nBytesRead = 0; if (Read(((unsigned char *) m_pBitArray), m_nBytes, &nBytesRead) != ERROR_SUCCESS) return ERROR_IO_READ; return ERROR_SUCCESS; } int CUnBitArrayJMAC::FillBitArray() { // get the bit array index uint32 nBitArrayIndex = m_nCurrentBitIndex >> 5; // move the remaining data to the front memmove((void *) (m_pBitArray), (const void *) (m_pBitArray + nBitArrayIndex), m_nBytes - (nBitArrayIndex * 4)); // read the new data int nBytesToRead = nBitArrayIndex * 4; unsigned int nBytesRead = 0; int nRetVal = Read((unsigned char*) (m_pBitArray + m_nElements - nBitArrayIndex), nBytesToRead, &nBytesRead); // adjust the m_Bit pointer m_nCurrentBitIndex = m_nCurrentBitIndex & 31; // return return (nRetVal == ERROR_SUCCESS) ? ERROR_SUCCESS : ERROR_IO_READ; } jmac-1.74/core/nativesrc/jmac/UnBitArrayJMAC.h0000644000175000017500000000317010131230056020771 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ #ifndef JMAC_UNBITARRAY_H #define JMAC_UNBITARRAY_H #include #include "UnBitArrayJMAC.h" class CAPEDecompressJMAC; class CUnBitArrayJMAC : public CUnBitArray { public: // construction/destruction CUnBitArrayJMAC(CAPEDecompressJMAC* decoder, int nVersion); ~CUnBitArrayJMAC(); virtual int FillBitArray(); virtual int FillAndResetBitArray(int nFileLocation = -1, int nNewBitIndex = 0); private: int Seek(int nDistance); int Read(void* pBuffer, unsigned int nBytesToRead, unsigned int* pBytesRead); CAPEDecompressJMAC* m_APEDecompress; jbyteArray byteArray; friend class CAPEDecompressJMAC; }; #endif // #ifndef JMAC_UNBITARRAY_H jmac-1.74/core/nativesrc/mac/0000755000175000017500000000000010451144641016003 5ustar twernertwernerjmac-1.74/core/nativesrc/mac/Shared/0000755000175000017500000000000010451144641017211 5ustar twernertwernerjmac-1.74/core/nativesrc/mac/Shared/MACLib.lib0000644000175000017500000124556210131230056020736 0ustar twernertwerner! / 1084342683 0 24022 ` 1¼&¼&¼&¼&¼&¼&¼&¼&¼&¼&¼&¼&¼&¼&¼&¼&¼&¼&¼&Ú®Ú®Ú®Ú®Ú®Ú®Ú®Ú®Ú®Ú®Ú®Ú®Ú®Ú®Ú®Ú®Ú®Ú®Ú®Ú®Ú®Ú®Ú®Ú®Ú®Ú®Ú®Ú®Ú®Ú®Ú®Ú®Ú®Ú®Ú®Ú®Ú®Ú®Ú®Ú®Ú®Ú®Ú®Ú®Ú®Ú®Ú®Ú®111111111111111111111111NRNRNRišišišxÎxÎxÎxÎxÎxÎxÎx΃ZƒZƒZ‰‰‰‰‰‰‰‰‰‰‰“ “ “ “ “ “ ›f›f›f›f›f›f›f›f›f›f›f›f›f›f›f›f›f›f›f›f›f¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾N¾NAðAðAðAðAðAðAðAð[è[è[è[è[è[è[è[è[è[è[è[è[è[è[è[è[è[è[è[è[è[è[è[è[è[è[è›2›2›2›2›2›2›2›2›2›2›2›2›2µàµàµàµàµàµàµàµàµàµàµàµàÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈîÎîÎîÎîÎîÎîÎîÎîÎîÎîÎîÎîÎîÎîÎîÎîÎîΔ””””'²'²'²2V2V2V2V2V2V2V2V2V2V2V2V2V2V\r\ra0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0ˆ<ˆ<ˆ<ˆ<ˆ<ˆ<ˆ<ˆ<ˆ<ˆ<ˆ<ˆ<ˆ<ˆ<ˆ<ˆ<ˆ<ˆ<ˆ<ˆ<ˆ<ˆ<ˆ<ˆ<ˆ<ˆ<ˆ<ˆ<¿â¿â¿â¿â¿â¿âËúËúËúËúËúËúËúËúËúËúËúËúËúËúóBóBóBóBóBóBóBóBóBóBóBóBóBóBóBóBóBóBóBóBóBóBóBóBóB9Î9Î9Î9Î9Î9Î9Î9Î9Î9Î9Î9Î9ÎUÌUÌUÌUÌUÌUÌUÌUÌUÌUÌUÌUÌUÌUÌUÌUÌUÌUÌUÌUÌUÌŨPƒPƒPƒPƒPƒPƒPƒPƒPƒPƒPƒPƒPƒPƒPƒPƒPƒPƒPƒPƒPƒPƒPƒPƒPƒP¯¬¯¬¯¬¯¬¯¬¯¬¯¬¯¬¯¬¯¬¯¬¯¬¯¬¯¬¯¬¯¬¯¬¯¬¯¬¯¬¯¬¯¬¯¬¯¬¯¬Õ<Õ<Õ<Õ<Õ<Õ<Õ<æÔæÔæÔæÔæÔæÔæÔæÔæÔæÔæÔæÔæÔæÔæÔæÔæÔæÔæÔæÔæÔæÔæÔæÔæÔæÔæÔæÔæÔæÔæÔæÔæÔæÔæÔæÔæÔæÔæÔæÔHHHHHH??0?$CRollBuffer@F@@QAE@XZ??0CNNFilter@@QAE@HHH@Z??1?$CRollBuffer@F@@QAE@XZ??1CNNFilter@@QAE@XZ??A?$CRollBuffer@F@@QBEAAFH@Z??_R0H@8?AdaptNoMMX@CNNFilter@@AAEXPAF0HH@Z?CalculateDotProductNoMMX@CNNFilter@@AAEHPAF0H@Z?Compress@CNNFilter@@QAEHH@Z?Create@?$CRollBuffer@F@@QAEHHH@Z?Decompress@CNNFilter@@QAEHH@Z?Flush@?$CRollBuffer@F@@QAEXXZ?Flush@CNNFilter@@QAEXXZ?GetSaturatedShortFromInt@CNNFilter@@ABEFH@Z?IncrementSafe@?$CRollBuffer@F@@QAEXXZ?Roll@?$CRollBuffer@F@@QAEXXZ__CT??_R0H@84__CTA1H__TI1H??0?$CRollBufferFast@H$0CAA@$07@@QAE@XZ??0?$CRollBufferFast@H$0CAA@$08@@QAE@XZ??0?$CRollBufferFast@H$0CAA@$09@@QAE@XZ??0CPredictorCompressNormal@@QAE@H@Z??0CPredictorDecompress3950toCurrent@@QAE@HH@Z??0CPredictorDecompressNormal3930to3950@@QAE@HH@Z??0IPredictorCompress@@QAE@H@Z??0IPredictorDecompress@@QAE@HH@Z??1?$CRollBufferFast@H$0CAA@$07@@QAE@XZ??1?$CRollBufferFast@H$0CAA@$08@@QAE@XZ??1?$CRollBufferFast@H$0CAA@$09@@QAE@XZ??1CPredictorCompressNormal@@UAE@XZ??1CPredictorDecompress3950toCurrent@@UAE@XZ??1CPredictorDecompressNormal3930to3950@@UAE@XZ??1IPredictorCompress@@UAE@XZ??1IPredictorDecompress@@UAE@XZ??A?$CRollBufferFast@H$0CAA@$07@@QBEAAHH@Z??A?$CRollBufferFast@H$0CAA@$08@@QBEAAHH@Z??A?$CRollBufferFast@H$0CAA@$09@@QBEAAHH@Z??_7CPredictorCompressNormal@@6B@??_7CPredictorDecompress3950toCurrent@@6B@??_7CPredictorDecompressNormal3930to3950@@6B@??_7IPredictorCompress@@6B@??_7IPredictorDecompress@@6B@??_GCNNFilter@@QAEPAXI@Z??_GCPredictorCompressNormal@@UAEPAXI@Z??_GCPredictorDecompress3950toCurrent@@UAEPAXI@Z??_GCPredictorDecompressNormal3930to3950@@UAEPAXI@Z??_GIPredictorCompress@@UAEPAXI@Z??_GIPredictorDecompress@@UAEPAXI@Z?Compress@?$CScaledFirstOrderFilter@$0BP@$04@@QAEHH@Z?CompressValue@CPredictorCompressNormal@@UAEHHH@Z?Decompress@?$CScaledFirstOrderFilter@$0BP@$04@@QAEHH@Z?DecompressValue@CPredictorDecompress3950toCurrent@@UAEHHH@Z?DecompressValue@CPredictorDecompressNormal3930to3950@@UAEHHH@Z?Flush@?$CRollBufferFast@H$0CAA@$07@@QAEXXZ?Flush@?$CRollBufferFast@H$0CAA@$08@@QAEXXZ?Flush@?$CRollBufferFast@H$0CAA@$09@@QAEXXZ?Flush@?$CScaledFirstOrderFilter@$0BP@$04@@QAEXXZ?Flush@CPredictorCompressNormal@@UAEHXZ?Flush@CPredictorDecompress3950toCurrent@@UAEHXZ?Flush@CPredictorDecompressNormal3930to3950@@UAEHXZ?IncrementFast@?$CRollBufferFast@H$0CAA@$07@@QAEXXZ?IncrementFast@?$CRollBufferFast@H$0CAA@$08@@QAEXXZ?IncrementFast@?$CRollBufferFast@H$0CAA@$09@@QAEXXZ?Roll@?$CRollBufferFast@H$0CAA@$07@@QAEXXZ?Roll@?$CRollBufferFast@H$0CAA@$08@@QAEXXZ?Roll@?$CRollBufferFast@H$0CAA@$09@@QAEXXZ??0?$CSmartPtr@G@@QAE@PAGHH@Z??0CIO@@QAE@XZ??0CWinFileIO@@QAE@XZ??1?$CSmartPtr@G@@QAE@XZ??1CIO@@UAE@XZ??1CWinFileIO@@UAE@XZ??B?$CSmartPtr@G@@QBEPAGXZ??_7CIO@@6B@??_7CWinFileIO@@6B@??_GCIO@@UAEPAXI@Z??_GCWinFileIO@@UAEPAXI@Z?Assign@?$CSmartPtr@G@@QAEXPAGHH@Z?Close@CWinFileIO@@UAEHXZ?Create@CWinFileIO@@UAEHPBG@Z?Delete@?$CSmartPtr@G@@QAEXXZ?Delete@CWinFileIO@@UAEHXZ?GetName@CWinFileIO@@UAEHPAG@Z?GetPosition@CWinFileIO@@UAEHXZ?GetSize@CWinFileIO@@UAEHXZ?Open@CWinFileIO@@UAEHPBG@Z?Read@CWinFileIO@@UAEHPAXIPAI@Z?Seek@CWinFileIO@@UAEHHI@Z?SetEOF@CWinFileIO@@UAEHXZ?Write@CWinFileIO@@UAEHPBXIPAI@Z?Prepare@CPrepare@@QAEHPBEHPBUtWAVEFORMATEX@@PAH2PAI22@Z?Unprepare@CPrepare@@QAEXHHPBUtWAVEFORMATEX@@PAEPAI@Z?UnprepareOld@CPrepare@@QAEHPAH0HPBUtWAVEFORMATEX@@PAEPAI0H@Z?MD5Final@@YAXQAEPAUMD5_CTX@@@Z?MD5Init@@YAXPAUMD5_CTX@@@Z?MD5Update@@YAXPAUMD5_CTX@@PBEI@Z??0CMACProgressHelper@@QAE@HPAHP6GXH@Z0@Z??1CMACProgressHelper@@UAE@XZ??_7CMACProgressHelper@@6B@??_GCMACProgressHelper@@UAEPAXI@Z?ProcessKillFlag@CMACProgressHelper@@QAEHH@Z?UpdateProgress@CMACProgressHelper@@QAEXHH@Z__real@00000000__real@47c35000?FileExists@@YAHPAG@Z?ReadSafe@@YAHPAVCIO@@PAXH@Z?WriteSafe@@YAHPAVCIO@@PAXH@Z??0CCircleBuffer@@QAE@XZ??1CCircleBuffer@@UAE@XZ??_7CCircleBuffer@@6B@??_GCCircleBuffer@@UAEPAXI@Z?CreateBuffer@CCircleBuffer@@QAEXHH@Z?Empty@CCircleBuffer@@QAEXXZ?Get@CCircleBuffer@@QAEHPAEH@Z?MaxAdd@CCircleBuffer@@QAEHXZ?MaxGet@CCircleBuffer@@QAEHXZ?RemoveHead@CCircleBuffer@@QAEHH@Z?RemoveTail@CCircleBuffer@@QAEHH@Z?GetANSIFromUTF16@@YAPADPBG@Z?GetANSIFromUTF8@@YAPADPBE@Z?GetUTF16FromANSI@@YAPAGPBD@Z?GetUTF16FromUTF8@@YAPAGPBE@Z?GetUTF8FromANSI@@YAPAEPBD@Z?GetUTF8FromUTF16@@YAPAEPBG@Z??0?$CSmartPtr@VCIO@@@@QAE@XZ??0CInputSource@@QAE@PAVCIO@@PAUtWAVEFORMATEX@@PAH222@Z??0CInputSource@@QAE@PBGPAUtWAVEFORMATEX@@PAH222@Z??0CWAVInputSource@@QAE@PAVCIO@@PAUtWAVEFORMATEX@@PAH222@Z??0CWAVInputSource@@QAE@PBGPAUtWAVEFORMATEX@@PAH222@Z??1?$CSmartPtr@VCIO@@@@QAE@XZ??1CInputSource@@UAE@XZ??1CWAVInputSource@@UAE@XZ??B?$CSmartPtr@VCIO@@@@QBEPAVCIO@@XZ??C?$CSmartPtr@VCIO@@@@QBEPAVCIO@@XZ??_7CInputSource@@6B@??_7CWAVInputSource@@6B@??_GCInputSource@@UAEPAXI@Z??_GCWAVInputSource@@UAEPAXI@Z?AnalyzeSource@CWAVInputSource@@AAEHXZ?Assign@?$CSmartPtr@VCIO@@@@QAEXPAVCIO@@HH@Z?CreateInputSource@@YAPAVCInputSource@@PBGPAUtWAVEFORMATEX@@PAH222@Z?Delete@?$CSmartPtr@VCIO@@@@QAEXXZ?GetData@CWAVInputSource@@UAEHPAEHPAH@Z?GetHeaderData@CWAVInputSource@@UAEHPAE@Z?GetTerminatingData@CWAVInputSource@@UAEHPAE@Z??0?$CSmartPtr@D@@QAE@PADHH@Z??0?$CSmartPtr@D@@QAE@XZ??0?$CSmartPtr@E@@QAE@PAEHH@Z??0?$CSmartPtr@G@@QAE@XZ??0APE_TAG_FOOTER@@QAE@HH@Z??0CAPETag@@QAE@PAVCIO@@H@Z??0CAPETag@@QAE@PBGH@Z??0CAPETagField@@QAE@PBGPBXHH@Z??1?$CSmartPtr@D@@QAE@XZ??1?$CSmartPtr@E@@QAE@XZ??1CAPETag@@QAE@XZ??1CAPETagField@@QAE@XZ??B?$CSmartPtr@D@@QBEPADXZ??B?$CSmartPtr@E@@QBEPAEXZ??_C@_08GDHGJGOG@APETAGEX?$AA@??_GCAPETagField@@QAEPAXI@Z?Analyze@CAPETag@@AAEHXZ?Assign@?$CSmartPtr@D@@QAEXPADHH@Z?Assign@?$CSmartPtr@E@@QAEXPAEHH@Z?ClearFields@CAPETag@@QAEHXZ?CompareFields@CAPETag@@CAHPBX0@Z?CreateID3Tag@CAPETag@@QAEHPAUID3_TAG@@@Z?Delete@?$CSmartPtr@D@@QAEXXZ?Delete@?$CSmartPtr@E@@QAEXXZ?GetFieldBinary@CAPETag@@QAEHPBGPAXPAH@Z?GetFieldBytes@APE_TAG_FOOTER@@QAEHXZ?GetFieldFlags@CAPETagField@@QAEHXZ?GetFieldID3String@CAPETag@@AAEHPBGPADH@Z?GetFieldName@CAPETagField@@QAEPBGXZ?GetFieldSize@CAPETagField@@QAEHXZ?GetFieldString@CAPETag@@QAEHPBGPADPAHH@Z?GetFieldString@CAPETag@@QAEHPBGPAGPAH@Z?GetFieldValue@CAPETagField@@QAEPBDXZ?GetFieldValueSize@CAPETagField@@QAEHXZ?GetFieldsOffset@APE_TAG_FOOTER@@QAEHXZ?GetHasHeader@APE_TAG_FOOTER@@QAEHXZ?GetIsHeader@APE_TAG_FOOTER@@QAEHXZ?GetIsReadOnly@CAPETagField@@QAEHXZ?GetIsUTF8Text@CAPETagField@@QAEHXZ?GetIsValid@APE_TAG_FOOTER@@QAEHH@Z?GetNumberFields@APE_TAG_FOOTER@@QAEHXZ?GetPtr@?$CSmartPtr@D@@QBEPADXZ?GetPtr@?$CSmartPtr@E@@QBEPAEXZ?GetPtr@?$CSmartPtr@G@@QBEPAGXZ?GetTagBytes@CAPETag@@QAEHXZ?GetTagField@CAPETag@@QAEPAVCAPETagField@@H@Z?GetTagField@CAPETag@@QAEPAVCAPETagField@@PBG@Z?GetTagFieldIndex@CAPETag@@AAEHPBG@Z?GetTotalTagBytes@APE_TAG_FOOTER@@QAEHXZ?GetVersion@APE_TAG_FOOTER@@QAEHXZ?LoadField@CAPETag@@AAEHPBDHPAH@Z?Remove@CAPETag@@QAEHH@Z?RemoveField@CAPETag@@QAEHH@Z?RemoveField@CAPETag@@QAEHPBG@Z?Save@CAPETag@@QAEHH@Z?SaveField@CAPETagField@@QAEHPAD@Z?SetFieldBinary@CAPETag@@QAEHPBGPBXHH@Z?SetFieldID3String@CAPETag@@AAEHPBGPBDH@Z?SetFieldString@CAPETag@@QAEHPBG0@Z?SetFieldString@CAPETag@@QAEHPBGPBDH@Z?SortFields@CAPETag@@AAEHXZ?WriteBufferToEndOfIO@CAPETag@@AAEHPAXH@Z??0CAPELink@@QAE@PBDPBG@Z??0CAPELink@@QAE@PBG@Z??1CAPELink@@QAE@XZ?GetFinishBlock@CAPELink@@QAEHXZ?GetImageFilename@CAPELink@@QAEPBGXZ?GetIsLinkFile@CAPELink@@QAEHXZ?GetStartBlock@CAPELink@@QAEHXZ?ParseData@CAPELink@@IAEXPBDPBG@Z??0?$CSmartPtr@E@@QAE@XZ??0?$CSmartPtr@I@@QAE@XZ??0?$CSmartPtr@UAPE_DESCRIPTOR@@@@QAE@XZ??0?$CSmartPtr@VCAPETag@@@@QAE@XZ??0APE_FILE_INFO@@QAE@XZ??0CAPEInfo@@QAE@PAHPAVCIO@@PAVCAPETag@@@Z??0CAPEInfo@@QAE@PAHPBGPAVCAPETag@@@Z??1?$CSmartPtr@I@@QAE@XZ??1?$CSmartPtr@UAPE_DESCRIPTOR@@@@QAE@XZ??1?$CSmartPtr@VCAPETag@@@@QAE@XZ??1APE_FILE_INFO@@QAE@XZ??1CAPEInfo@@UAE@XZ??B?$CSmartPtr@I@@QBEPAIXZ??C?$CSmartPtr@VCAPETag@@@@QBEPAVCAPETag@@XZ??_7CAPEInfo@@6B@??_ECAPETag@@QAEPAXI@Z??_GCAPEInfo@@UAEPAXI@Z??_GCAPETag@@QAEPAXI@Z?Assign@?$CSmartPtr@VCAPETag@@@@QAEXPAVCAPETag@@HH@Z?CloseFile@CAPEInfo@@AAEHXZ?Delete@?$CSmartPtr@I@@QAEXXZ?Delete@?$CSmartPtr@UAPE_DESCRIPTOR@@@@QAEXXZ?Delete@?$CSmartPtr@VCAPETag@@@@QAEXXZ?GetFileInformation@CAPEInfo@@AAEHH@Z?GetInfo@CAPEInfo@@QAEHW4APE_DECOMPRESS_FIELDS@@HH@Z?GetPtr@?$CSmartPtr@VCAPETag@@@@QBEPAVCAPETag@@XZ?GetPtr@?$CSmartPtr@VCIO@@@@QBEPAVCIO@@XZ??0CAPEHeader@@QAE@PAVCIO@@@Z??1CAPEHeader@@QAE@XZ??B?$CSmartPtr@UAPE_DESCRIPTOR@@@@QBEPAUAPE_DESCRIPTOR@@XZ??C?$CSmartPtr@UAPE_DESCRIPTOR@@@@QBEPAUAPE_DESCRIPTOR@@XZ?Analyze@CAPEHeader@@QAEHPAUAPE_FILE_INFO@@@Z?AnalyzeCurrent@CAPEHeader@@IAEHPAUAPE_FILE_INFO@@@Z?AnalyzeOld@CAPEHeader@@IAEHPAUAPE_FILE_INFO@@@Z?Assign@?$CSmartPtr@I@@QAEXPAIHH@Z?Assign@?$CSmartPtr@UAPE_DESCRIPTOR@@@@QAEXPAUAPE_DESCRIPTOR@@HH@Z?FindDescriptor@CAPEHeader@@IAEHH@Z?GetPtr@?$CSmartPtr@I@@QBEPAIXZ__real@4020000000000000__real@408f400000000000??0CUnMAC@@QAE@XZ??1CUnMAC@@QAE@XZ??_GCAPEDecompressCore@@QAEPAXI@Z?CalculateOldChecksum@CUnMAC@@AAEIPAH0HH@Z?DecompressFrame@CUnMAC@@QAEHPAEHH@Z?DecompressFrameOld@CUnMAC@@AAEHPAEHH@Z?GetDataX@CAPEDecompressCore@@QAEPAHXZ?GetDataY@CAPEDecompressCore@@QAEPAHXZ?GetUnBitArrray@CAPEDecompressCore@@QAEPAVCUnBitArrayBase@@XZ?Initialize@CUnMAC@@QAEHPAVIAPEDecompress@@@Z?SeekToFrame@CUnMAC@@QAEHH@Z?Uninitialize@CUnMAC@@QAEHXZ??0CUnBitArrayBase@@QAE@XZ??0CUnBitArrayOld@@QAE@PAVIAPEDecompress@@H@Z??1CUnBitArrayBase@@UAE@XZ??1CUnBitArrayOld@@UAE@XZ??_7CUnBitArrayBase@@6B@??_7CUnBitArrayOld@@6B@??_GCUnBitArrayBase@@UAEPAXI@Z??_GCUnBitArrayOld@@UAEPAXI@Z?DecodeValue@CUnBitArrayBase@@UAEIW4DECODE_VALUE_METHOD@@HH@Z?DecodeValue@CUnBitArrayOld@@UAEIW4DECODE_VALUE_METHOD@@HH@Z?DecodeValueNew@CUnBitArrayOld@@AAEHH@Z?DecodeValueRange@CUnBitArrayBase@@UAEHAAUUNBIT_ARRAY_STATE@@@Z?DecodeValueRiceUnsigned@CUnBitArrayOld@@AAEII@Z?Finalize@CUnBitArrayBase@@UAEXXZ?FlushBitArray@CUnBitArrayBase@@UAEXXZ?FlushState@CUnBitArrayBase@@UAEXAAUUNBIT_ARRAY_STATE@@@Z?GenerateArray@CUnBitArrayBase@@UAEXPAHHH@Z?GenerateArray@CUnBitArrayOld@@UAEXPAHHH@Z?GenerateArrayOld@CUnBitArrayOld@@AAEXPAHIH@Z?GenerateArrayRice@CUnBitArrayOld@@AAEXPAHIH@Z?GetBitsRemaining@CUnBitArrayOld@@AAEIXZ?Get_K@CUnBitArrayOld@@AAEII@Z??0?$CSmartPtr@VCAPEInfo@@@@QAE@XZ??0CAPEDecompressOld@@QAE@PAHPAVCAPEInfo@@HH@Z??0IAPEDecompress@@QAE@XZ??1?$CSmartPtr@VCAPEInfo@@@@QAE@XZ??1CAPEDecompressOld@@UAE@XZ??1IAPEDecompress@@UAE@XZ??C?$CSmartPtr@VCAPEInfo@@@@QBEPAVCAPEInfo@@XZ??_7CAPEDecompressOld@@6B@??_7IAPEDecompress@@6B@??_GCAPEDecompressOld@@UAEPAXI@Z??_GIAPEDecompress@@UAEPAXI@Z?Assign@?$CSmartPtr@VCAPEInfo@@@@QAEXPAVCAPEInfo@@HH@Z?Delete@?$CSmartPtr@VCAPEInfo@@@@QAEXXZ?GetData@CAPEDecompressOld@@UAEHPADHPAH@Z?GetInfo@CAPEDecompressOld@@UAEHW4APE_DECOMPRESS_FIELDS@@HH@Z?InitializeDecompressor@CAPEDecompressOld@@IAEHXZ?Seek@CAPEDecompressOld@@UAEHH@Z??0CAPEDecompressCore@@QAE@PAVCIO@@PAVIAPEDecompress@@@Z??1CAPEDecompressCore@@QAE@XZ??_GCAntiPredictor@@QAEPAXI@Z?GenerateDecodedArray@CAPEDecompressCore@@QAEXPAHIHPAVCAntiPredictor@@H@Z?GenerateDecodedArrays@CAPEDecompressCore@@QAEXHHHH@Z?AntiPredict@CAntiPredictorNormal0000To3320@@UAEXPAH0H@Z?AntiPredict@CAntiPredictorNormal3320To3800@@UAEXPAH0H@Z?AntiPredict@CAntiPredictorNormal3800ToCurrent@@UAEXPAH0H@Z??0CAntiPredictorNormal0000To3320@@QAE@XZ??0CAntiPredictorNormal3320To3800@@QAE@XZ??0CAntiPredictorOffset@@QAE@XZ??1CAntiPredictorNormal0000To3320@@QAE@XZ??1CAntiPredictorNormal3320To3800@@QAE@XZ??1CAntiPredictorOffset@@QAE@XZ??_7CAntiPredictorNormal0000To3320@@6B@??_7CAntiPredictorNormal3320To3800@@6B@??_7CAntiPredictorOffset@@6B@?AntiPredict@CAntiPredictorHigh0000To3320@@UAEXPAH0H@Z?AntiPredict@CAntiPredictorHigh3320To3600@@UAEXPAH0H@Z?AntiPredict@CAntiPredictorHigh3600To3700@@UAEXPAH0H@Z?AntiPredict@CAntiPredictorHigh3700To3800@@UAEXPAH0H@Z?AntiPredict@CAntiPredictorHigh3800ToCurrent@@UAEXPAH0H@Z?AntiPredict@CAntiPredictorFast0000To3320@@UAEXPAH0H@Z?AntiPredict@CAntiPredictorFast3320ToCurrent@@UAEXPAH0H@Z??0CAntiPredictorHigh0000To3320@@QAE@XZ??0CAntiPredictorHigh3600To3700@@QAE@XZ??0CAntiPredictorHigh3700To3800@@QAE@XZ??1CAntiPredictorHigh0000To3320@@QAE@XZ??1CAntiPredictorHigh3600To3700@@QAE@XZ??1CAntiPredictorHigh3700To3800@@QAE@XZ??_7CAntiPredictorHigh0000To3320@@6B@??_7CAntiPredictorHigh3600To3700@@6B@??_7CAntiPredictorHigh3700To3800@@6B@?AntiPredict@CAntiPredictorExtraHigh0000To3320@@QAEXPAH0HHPAI1@Z?AntiPredict@CAntiPredictorExtraHigh3320To3600@@QAEXPAH0HHPAI1@Z?AntiPredict@CAntiPredictorExtraHigh3600To3700@@QAEXPAH0HHPAI1@Z?AntiPredict@CAntiPredictorExtraHigh3700To3800@@QAEXPAH0HHPAI1@Z?AntiPredict@CAntiPredictorExtraHigh3800ToCurrent@@QAEXPAH0HHHH@Z?AntiPredictorOffset@CAntiPredictorExtraHigh0000To3320@@AAEXPAH0HHHH@Z?AntiPredictorOffset@CAntiPredictorExtraHigh3320To3600@@AAEXPAH0HHHH@Z?AntiPredictorOffset@CAntiPredictorExtraHigh3600To3700@@AAEXPAH0HHHH@Z?AntiPredictorOffset@CAntiPredictorExtraHigh3700To3800@@AAEXPAH0HHHH@Z??0CAntiPredictor@@QAE@XZ??0CAntiPredictorExtraHigh0000To3320@@QAE@XZ??0CAntiPredictorExtraHigh3320To3600@@QAE@XZ??0CAntiPredictorExtraHigh3600To3700@@QAE@XZ??0CAntiPredictorExtraHigh3700To3800@@QAE@XZ??0CAntiPredictorExtraHigh3800ToCurrent@@QAE@XZ??0CAntiPredictorFast0000To3320@@QAE@XZ??0CAntiPredictorFast3320ToCurrent@@QAE@XZ??0CAntiPredictorHigh3320To3600@@QAE@XZ??0CAntiPredictorHigh3800ToCurrent@@QAE@XZ??0CAntiPredictorNormal3800ToCurrent@@QAE@XZ??1CAntiPredictor@@QAE@XZ??_7CAntiPredictor@@6B@??_7CAntiPredictorExtraHigh0000To3320@@6B@??_7CAntiPredictorExtraHigh3320To3600@@6B@??_7CAntiPredictorExtraHigh3600To3700@@6B@??_7CAntiPredictorExtraHigh3700To3800@@6B@??_7CAntiPredictorExtraHigh3800ToCurrent@@6B@??_7CAntiPredictorFast0000To3320@@6B@??_7CAntiPredictorFast3320ToCurrent@@6B@??_7CAntiPredictorHigh3320To3600@@6B@??_7CAntiPredictorHigh3800ToCurrent@@6B@??_7CAntiPredictorNormal3800ToCurrent@@6B@?AntiPredict@CAntiPredictor@@UAEXPAH0H@Z?AntiPredict@CAntiPredictorOffset@@QAEXPAH0HHH@Z?ConventionalDotProduct@CAntiPredictorExtraHighHelper@@QAEHPAF00HH@Z?CreateAntiPredictor@@YAPAVCAntiPredictor@@HH@Z?MMXDotProduct@CAntiPredictorExtraHighHelper@@QAEHPAF00HH@Z?AdvanceToByteBoundary@CUnBitArrayBase@@UAEXXZ?CreateHelper@CUnBitArrayBase@@MAEHPAVCIO@@HH@Z?CreateUnBitArray@@YAPAVCUnBitArrayBase@@PAVIAPEDecompress@@H@Z?DecodeValueXBits@CUnBitArrayBase@@MAEII@Z?FillAndResetBitArray@CUnBitArrayBase@@UAEHHH@Z?FillBitArray@CUnBitArrayBase@@UAEHXZ??0CUnBitArray@@QAE@PAVCIO@@H@Z??1CUnBitArray@@UAE@XZ??_7CUnBitArray@@6B@??_GCUnBitArray@@UAEPAXI@Z?DecodeValue@CUnBitArray@@UAEIW4DECODE_VALUE_METHOD@@HH@Z?DecodeValueRange@CUnBitArray@@UAEHAAUUNBIT_ARRAY_STATE@@@Z?Finalize@CUnBitArray@@UAEXXZ?FlushBitArray@CUnBitArray@@UAEXXZ?FlushState@CUnBitArray@@UAEXAAUUNBIT_ARRAY_STATE@@@Z?GenerateArray@CUnBitArray@@UAEXPAHHH@Z?GenerateArrayRange@CUnBitArray@@AAEXPAHH@Z?GetC@CUnBitArray@@AAEEXZ?RangeDecodeFast@CUnBitArray@@AAEHH@Z?RangeDecodeFastWithUpdate@CUnBitArray@@AAEHH@Z??0?$CSmartPtr@VCUnBitArrayBase@@@@QAE@XZ??0?$CSmartPtr@VIPredictorDecompress@@@@QAE@XZ??0CAPEDecompress@@QAE@PAHPAVCAPEInfo@@HH@Z??1?$CSmartPtr@VCUnBitArrayBase@@@@QAE@XZ??1?$CSmartPtr@VIPredictorDecompress@@@@QAE@XZ??1CAPEDecompress@@UAE@XZ??C?$CSmartPtr@VCUnBitArrayBase@@@@QBEPAVCUnBitArrayBase@@XZ??C?$CSmartPtr@VIPredictorDecompress@@@@QBEPAVIPredictorDecompress@@XZ??_7CAPEDecompress@@6B@??_GCAPEDecompress@@UAEPAXI@Z?Assign@?$CSmartPtr@VCUnBitArrayBase@@@@QAEXPAVCUnBitArrayBase@@HH@Z?Assign@?$CSmartPtr@VIPredictorDecompress@@@@QAEXPAVIPredictorDecompress@@HH@Z?DecodeBlocksToFrameBuffer@CAPEDecompress@@IAEXH@Z?Delete@?$CSmartPtr@VCUnBitArrayBase@@@@QAEXXZ?Delete@?$CSmartPtr@VIPredictorDecompress@@@@QAEXXZ?EndFrame@CAPEDecompress@@IAEXXZ?FillFrameBuffer@CAPEDecompress@@IAEHXZ?GetData@CAPEDecompress@@UAEHPADHPAH@Z?GetDirectWritePointer@CCircleBuffer@@QAEPAEXZ?GetInfo@CAPEDecompress@@UAEHW4APE_DECOMPRESS_FIELDS@@HH@Z?InitializeDecompressor@CAPEDecompress@@IAEHXZ?Seek@CAPEDecompress@@UAEHH@Z?SeekToFrame@CAPEDecompress@@IAEHH@Z?StartFrame@CAPEDecompress@@IAEXXZ?UpdateAfterDirectWrite@CCircleBuffer@@QAEXH@Z??0CBitArray@@QAE@PAVCIO@@@Z??0CMD5Helper@@QAE@H@Z??1CBitArray@@QAE@XZ?AddData@CMD5Helper@@QAEXPBXH@Z?AdvanceToByteBoundary@CBitArray@@QAEXXZ?EncodeBits@CBitArray@@QAEHIH@Z?EncodeUnsignedLong@CBitArray@@QAEHI@Z?EncodeValue@CBitArray@@QAEHHAAUBIT_ARRAY_STATE@@@Z?Finalize@CBitArray@@QAEXXZ?FlushBitArray@CBitArray@@QAEXXZ?FlushState@CBitArray@@QAEXAAUBIT_ARRAY_STATE@@@Z?Initialize@CMD5Helper@@QAEHXZ?OutputBitArray@CBitArray@@QAEHH@Z??0?$CSmartPtr@VCAPECompressCore@@@@QAE@XZ??0CAPECompressCreate@@QAE@XZ??1?$CSmartPtr@VCAPECompressCore@@@@QAE@XZ??1CAPECompressCreate@@QAE@XZ??C?$CSmartPtr@VCAPECompressCore@@@@QBEPAVCAPECompressCore@@XZ??_ECAPECompressCore@@QAEPAXI@Z??_GCAPECompressCore@@QAEPAXI@Z?Assign@?$CSmartPtr@VCAPECompressCore@@@@QAEXPAVCAPECompressCore@@HH@Z?Delete@?$CSmartPtr@VCAPECompressCore@@@@QAEXXZ?EncodeFrame@CAPECompressCreate@@QAEHPBXH@Z?FinalizeFile@CAPECompressCreate@@QAEHPAVCIO@@HHPBXHHH@Z?Finish@CAPECompressCreate@@QAEHPBXHH@Z?GetBitArray@CAPECompressCore@@QAEPAVCBitArray@@XZ?GetCurrentBitIndex@CBitArray@@QAEIXZ?GetFullFrameBytes@CAPECompressCreate@@QAEHXZ?GetMD5Helper@CBitArray@@QAEAAVCMD5Helper@@XZ?GetPeakLevel@CAPECompressCore@@QAEHXZ?GetPtr@?$CSmartPtr@VCBitArray@@@@QBEPAVCBitArray@@XZ?GetResult@CMD5Helper@@QAEHQAE@Z?InitializeFile@CAPECompressCreate@@QAEHPAVCIO@@PBUtWAVEFORMATEX@@HHPBXH@Z?SetSeekByte@CAPECompressCreate@@QAEHHH@Z?Start@CAPECompressCreate@@QAEHPAVCIO@@PBUtWAVEFORMATEX@@HHPBXH@Z??0?$CSmartPtr@H@@QAE@XZ??0?$CSmartPtr@VCBitArray@@@@QAE@XZ??0?$CSmartPtr@VCPrepare@@@@QAE@XZ??0?$CSmartPtr@VIPredictorCompress@@@@QAE@XZ??0CAPECompressCore@@QAE@PAVCIO@@PBUtWAVEFORMATEX@@HH@Z??1?$CSmartPtr@H@@QAE@XZ??1?$CSmartPtr@VCBitArray@@@@QAE@XZ??1?$CSmartPtr@VCPrepare@@@@QAE@XZ??1?$CSmartPtr@VIPredictorCompress@@@@QAE@XZ??1CAPECompressCore@@QAE@XZ??B?$CSmartPtr@H@@QBEPAHXZ??C?$CSmartPtr@VCBitArray@@@@QBEPAVCBitArray@@XZ??C?$CSmartPtr@VCPrepare@@@@QBEPAVCPrepare@@XZ??C?$CSmartPtr@VIPredictorCompress@@@@QBEPAVIPredictorCompress@@XZ??_ECBitArray@@QAEPAXI@Z??_GCBitArray@@QAEPAXI@Z?Assign@?$CSmartPtr@H@@QAEXPAHHH@Z?Assign@?$CSmartPtr@VCBitArray@@@@QAEXPAVCBitArray@@HH@Z?Assign@?$CSmartPtr@VCPrepare@@@@QAEXPAVCPrepare@@HH@Z?Assign@?$CSmartPtr@VIPredictorCompress@@@@QAEXPAVIPredictorCompress@@HH@Z?Delete@?$CSmartPtr@H@@QAEXXZ?Delete@?$CSmartPtr@VCBitArray@@@@QAEXXZ?Delete@?$CSmartPtr@VCPrepare@@@@QAEXXZ?Delete@?$CSmartPtr@VIPredictorCompress@@@@QAEXXZ?EncodeFrame@CAPECompressCore@@QAEHPBXH@Z?Prepare@CAPECompressCore@@AAEHPBXHPAH@Z??0?$CSmartPtr@VCAPECompressCreate@@@@QAE@XZ??0CAPECompress@@QAE@XZ??0IAPECompress@@QAE@XZ??1?$CSmartPtr@VCAPECompressCreate@@@@QAE@XZ??1CAPECompress@@UAE@XZ??1IAPECompress@@UAE@XZ??C?$CSmartPtr@VCAPECompressCreate@@@@QBEPAVCAPECompressCreate@@XZ??_7CAPECompress@@6B@??_7IAPECompress@@6B@??_ECAPECompressCreate@@QAEPAXI@Z??_GCAPECompress@@UAEPAXI@Z??_GCAPECompressCreate@@QAEPAXI@Z??_GIAPECompress@@UAEPAXI@Z?AddData@CAPECompress@@UAEHPAEH@Z?AddDataFromInputSource@CAPECompress@@UAEHPAVCInputSource@@HPAH@Z?Assign@?$CSmartPtr@VCAPECompressCreate@@@@QAEXPAVCAPECompressCreate@@HH@Z?Delete@?$CSmartPtr@VCAPECompressCreate@@@@QAEXXZ?Finish@CAPECompress@@UAEHPAEHH@Z?GetBufferBytesAvailable@CAPECompress@@UAEHXZ?Kill@CAPECompress@@UAEHXZ?LockBuffer@CAPECompress@@UAEPAEPAH@Z?ProcessBuffer@CAPECompress@@AAEHH@Z?Start@CAPECompress@@UAEHPBGPBUtWAVEFORMATEX@@HHPBXH@Z?StartEx@CAPECompress@@UAEHPAVCIO@@PBUtWAVEFORMATEX@@HHPBXH@Z?UnlockBuffer@CAPECompress@@UAEHHH@Z?CreateIAPEDecompressCore@@YAPAVIAPEDecompress@@PAVCAPEInfo@@HHPAH@Z_CreateIAPECompress@4_CreateIAPEDecompress@8_CreateIAPEDecompressEx2@16_CreateIAPEDecompressEx@8_FillWaveFormatEx@16_FillWaveHeader@16??0?$CSmartPtr@VCInputSource@@@@QAE@PAVCInputSource@@HH@Z??0?$CSmartPtr@VCMACProgressHelper@@@@QAE@XZ??0?$CSmartPtr@VCWinFileIO@@@@QAE@XZ??0?$CSmartPtr@VIAPECompress@@@@QAE@XZ??0?$CSmartPtr@VIAPEDecompress@@@@QAE@XZ??1?$CSmartPtr@VCInputSource@@@@QAE@XZ??1?$CSmartPtr@VCMACProgressHelper@@@@QAE@XZ??1?$CSmartPtr@VCWinFileIO@@@@QAE@XZ??1?$CSmartPtr@VIAPECompress@@@@QAE@XZ??1?$CSmartPtr@VIAPEDecompress@@@@QAE@XZ??B?$CSmartPtr@VCInputSource@@@@QBEPAVCInputSource@@XZ??B?$CSmartPtr@VCWinFileIO@@@@QBEPAVCWinFileIO@@XZ??B?$CSmartPtr@VIAPECompress@@@@QBEPAVIAPECompress@@XZ??B?$CSmartPtr@VIAPEDecompress@@@@QBEPAVIAPEDecompress@@XZ??C?$CSmartPtr@VCInputSource@@@@QBEPAVCInputSource@@XZ??C?$CSmartPtr@VCMACProgressHelper@@@@QBEPAVCMACProgressHelper@@XZ??C?$CSmartPtr@VCWinFileIO@@@@QBEPAVCWinFileIO@@XZ??C?$CSmartPtr@VIAPECompress@@@@QBEPAVIAPECompress@@XZ??C?$CSmartPtr@VIAPEDecompress@@@@QBEPAVIAPEDecompress@@XZ?Assign@?$CSmartPtr@VCInputSource@@@@QAEXPAVCInputSource@@HH@Z?Assign@?$CSmartPtr@VCMACProgressHelper@@@@QAEXPAVCMACProgressHelper@@HH@Z?Assign@?$CSmartPtr@VCWinFileIO@@@@QAEXPAVCWinFileIO@@HH@Z?Assign@?$CSmartPtr@VIAPECompress@@@@QAEXPAVIAPECompress@@HH@Z?Assign@?$CSmartPtr@VIAPEDecompress@@@@QAEXPAVIAPEDecompress@@HH@Z?DecompressCore@@YAHPBG0HHPAHP6GXH@Z1@Z?Delete@?$CSmartPtr@VCInputSource@@@@QAEXXZ?Delete@?$CSmartPtr@VCMACProgressHelper@@@@QAEXXZ?Delete@?$CSmartPtr@VCWinFileIO@@@@QAEXXZ?Delete@?$CSmartPtr@VIAPECompress@@@@QAEXXZ?Delete@?$CSmartPtr@VIAPEDecompress@@@@QAEXXZ?GetPtr@?$CSmartPtr@VCInputSource@@@@QBEPAVCInputSource@@XZ?UpdateProgressComplete@CMACProgressHelper@@QAEXXZ?VerifyFile@@YGHPBDPAHP6GXH@Z1H@Z_CompressFile@24_CompressFileW@24_ConvertFile@24_ConvertFileW@24_DecompressFile@20_DecompressFileW@20_VerifyFileW@20AdaptCalculateDotProductGetMMXAvailable_Adapt_CalculateDotProduct_GetMMXAvailable/ 1084342683 0 23040 ` "&¼®Ú1"LRNšiÎxZƒ‰ “f›N¾ðAè[2›àµÈÎ'V2r\0a<ˆâ¿úËBóÎ9ÌUPƒ¬¯<ÕÔæH1   !!!!!       !!!!!      !!!! !!!!!            !!!!!    !  !!!!!         !         !! """""!!!! !! "!??0?$CRollBuffer@F@@QAE@XZ??0?$CRollBufferFast@H$0CAA@$07@@QAE@XZ??0?$CRollBufferFast@H$0CAA@$08@@QAE@XZ??0?$CRollBufferFast@H$0CAA@$09@@QAE@XZ??0?$CSmartPtr@D@@QAE@PADHH@Z??0?$CSmartPtr@D@@QAE@XZ??0?$CSmartPtr@E@@QAE@PAEHH@Z??0?$CSmartPtr@E@@QAE@XZ??0?$CSmartPtr@G@@QAE@PAGHH@Z??0?$CSmartPtr@G@@QAE@XZ??0?$CSmartPtr@H@@QAE@XZ??0?$CSmartPtr@I@@QAE@XZ??0?$CSmartPtr@UAPE_DESCRIPTOR@@@@QAE@XZ??0?$CSmartPtr@VCAPECompressCore@@@@QAE@XZ??0?$CSmartPtr@VCAPECompressCreate@@@@QAE@XZ??0?$CSmartPtr@VCAPEInfo@@@@QAE@XZ??0?$CSmartPtr@VCAPETag@@@@QAE@XZ??0?$CSmartPtr@VCBitArray@@@@QAE@XZ??0?$CSmartPtr@VCIO@@@@QAE@XZ??0?$CSmartPtr@VCInputSource@@@@QAE@PAVCInputSource@@HH@Z??0?$CSmartPtr@VCMACProgressHelper@@@@QAE@XZ??0?$CSmartPtr@VCPrepare@@@@QAE@XZ??0?$CSmartPtr@VCUnBitArrayBase@@@@QAE@XZ??0?$CSmartPtr@VCWinFileIO@@@@QAE@XZ??0?$CSmartPtr@VIAPECompress@@@@QAE@XZ??0?$CSmartPtr@VIAPEDecompress@@@@QAE@XZ??0?$CSmartPtr@VIPredictorCompress@@@@QAE@XZ??0?$CSmartPtr@VIPredictorDecompress@@@@QAE@XZ??0APE_FILE_INFO@@QAE@XZ??0APE_TAG_FOOTER@@QAE@HH@Z??0CAPECompress@@QAE@XZ??0CAPECompressCore@@QAE@PAVCIO@@PBUtWAVEFORMATEX@@HH@Z??0CAPECompressCreate@@QAE@XZ??0CAPEDecompress@@QAE@PAHPAVCAPEInfo@@HH@Z??0CAPEDecompressCore@@QAE@PAVCIO@@PAVIAPEDecompress@@@Z??0CAPEDecompressOld@@QAE@PAHPAVCAPEInfo@@HH@Z??0CAPEHeader@@QAE@PAVCIO@@@Z??0CAPEInfo@@QAE@PAHPAVCIO@@PAVCAPETag@@@Z??0CAPEInfo@@QAE@PAHPBGPAVCAPETag@@@Z??0CAPELink@@QAE@PBDPBG@Z??0CAPELink@@QAE@PBG@Z??0CAPETag@@QAE@PAVCIO@@H@Z??0CAPETag@@QAE@PBGH@Z??0CAPETagField@@QAE@PBGPBXHH@Z??0CAntiPredictor@@QAE@XZ??0CAntiPredictorExtraHigh0000To3320@@QAE@XZ??0CAntiPredictorExtraHigh3320To3600@@QAE@XZ??0CAntiPredictorExtraHigh3600To3700@@QAE@XZ??0CAntiPredictorExtraHigh3700To3800@@QAE@XZ??0CAntiPredictorExtraHigh3800ToCurrent@@QAE@XZ??0CAntiPredictorFast0000To3320@@QAE@XZ??0CAntiPredictorFast3320ToCurrent@@QAE@XZ??0CAntiPredictorHigh0000To3320@@QAE@XZ??0CAntiPredictorHigh3320To3600@@QAE@XZ??0CAntiPredictorHigh3600To3700@@QAE@XZ??0CAntiPredictorHigh3700To3800@@QAE@XZ??0CAntiPredictorHigh3800ToCurrent@@QAE@XZ??0CAntiPredictorNormal0000To3320@@QAE@XZ??0CAntiPredictorNormal3320To3800@@QAE@XZ??0CAntiPredictorNormal3800ToCurrent@@QAE@XZ??0CAntiPredictorOffset@@QAE@XZ??0CBitArray@@QAE@PAVCIO@@@Z??0CCircleBuffer@@QAE@XZ??0CIO@@QAE@XZ??0CInputSource@@QAE@PAVCIO@@PAUtWAVEFORMATEX@@PAH222@Z??0CInputSource@@QAE@PBGPAUtWAVEFORMATEX@@PAH222@Z??0CMACProgressHelper@@QAE@HPAHP6GXH@Z0@Z??0CMD5Helper@@QAE@H@Z??0CNNFilter@@QAE@HHH@Z??0CPredictorCompressNormal@@QAE@H@Z??0CPredictorDecompress3950toCurrent@@QAE@HH@Z??0CPredictorDecompressNormal3930to3950@@QAE@HH@Z??0CUnBitArray@@QAE@PAVCIO@@H@Z??0CUnBitArrayBase@@QAE@XZ??0CUnBitArrayOld@@QAE@PAVIAPEDecompress@@H@Z??0CUnMAC@@QAE@XZ??0CWAVInputSource@@QAE@PAVCIO@@PAUtWAVEFORMATEX@@PAH222@Z??0CWAVInputSource@@QAE@PBGPAUtWAVEFORMATEX@@PAH222@Z??0CWinFileIO@@QAE@XZ??0IAPECompress@@QAE@XZ??0IAPEDecompress@@QAE@XZ??0IPredictorCompress@@QAE@H@Z??0IPredictorDecompress@@QAE@HH@Z??1?$CRollBuffer@F@@QAE@XZ??1?$CRollBufferFast@H$0CAA@$07@@QAE@XZ??1?$CRollBufferFast@H$0CAA@$08@@QAE@XZ??1?$CRollBufferFast@H$0CAA@$09@@QAE@XZ??1?$CSmartPtr@D@@QAE@XZ??1?$CSmartPtr@E@@QAE@XZ??1?$CSmartPtr@G@@QAE@XZ??1?$CSmartPtr@H@@QAE@XZ??1?$CSmartPtr@I@@QAE@XZ??1?$CSmartPtr@UAPE_DESCRIPTOR@@@@QAE@XZ??1?$CSmartPtr@VCAPECompressCore@@@@QAE@XZ??1?$CSmartPtr@VCAPECompressCreate@@@@QAE@XZ??1?$CSmartPtr@VCAPEInfo@@@@QAE@XZ??1?$CSmartPtr@VCAPETag@@@@QAE@XZ??1?$CSmartPtr@VCBitArray@@@@QAE@XZ??1?$CSmartPtr@VCIO@@@@QAE@XZ??1?$CSmartPtr@VCInputSource@@@@QAE@XZ??1?$CSmartPtr@VCMACProgressHelper@@@@QAE@XZ??1?$CSmartPtr@VCPrepare@@@@QAE@XZ??1?$CSmartPtr@VCUnBitArrayBase@@@@QAE@XZ??1?$CSmartPtr@VCWinFileIO@@@@QAE@XZ??1?$CSmartPtr@VIAPECompress@@@@QAE@XZ??1?$CSmartPtr@VIAPEDecompress@@@@QAE@XZ??1?$CSmartPtr@VIPredictorCompress@@@@QAE@XZ??1?$CSmartPtr@VIPredictorDecompress@@@@QAE@XZ??1APE_FILE_INFO@@QAE@XZ??1CAPECompress@@UAE@XZ??1CAPECompressCore@@QAE@XZ??1CAPECompressCreate@@QAE@XZ??1CAPEDecompress@@UAE@XZ??1CAPEDecompressCore@@QAE@XZ??1CAPEDecompressOld@@UAE@XZ??1CAPEHeader@@QAE@XZ??1CAPEInfo@@UAE@XZ??1CAPELink@@QAE@XZ??1CAPETag@@QAE@XZ??1CAPETagField@@QAE@XZ??1CAntiPredictor@@QAE@XZ??1CAntiPredictorHigh0000To3320@@QAE@XZ??1CAntiPredictorHigh3600To3700@@QAE@XZ??1CAntiPredictorHigh3700To3800@@QAE@XZ??1CAntiPredictorNormal0000To3320@@QAE@XZ??1CAntiPredictorNormal3320To3800@@QAE@XZ??1CAntiPredictorOffset@@QAE@XZ??1CBitArray@@QAE@XZ??1CCircleBuffer@@UAE@XZ??1CIO@@UAE@XZ??1CInputSource@@UAE@XZ??1CMACProgressHelper@@UAE@XZ??1CNNFilter@@QAE@XZ??1CPredictorCompressNormal@@UAE@XZ??1CPredictorDecompress3950toCurrent@@UAE@XZ??1CPredictorDecompressNormal3930to3950@@UAE@XZ??1CUnBitArray@@UAE@XZ??1CUnBitArrayBase@@UAE@XZ??1CUnBitArrayOld@@UAE@XZ??1CUnMAC@@QAE@XZ??1CWAVInputSource@@UAE@XZ??1CWinFileIO@@UAE@XZ??1IAPECompress@@UAE@XZ??1IAPEDecompress@@UAE@XZ??1IPredictorCompress@@UAE@XZ??1IPredictorDecompress@@UAE@XZ??A?$CRollBuffer@F@@QBEAAFH@Z??A?$CRollBufferFast@H$0CAA@$07@@QBEAAHH@Z??A?$CRollBufferFast@H$0CAA@$08@@QBEAAHH@Z??A?$CRollBufferFast@H$0CAA@$09@@QBEAAHH@Z??B?$CSmartPtr@D@@QBEPADXZ??B?$CSmartPtr@E@@QBEPAEXZ??B?$CSmartPtr@G@@QBEPAGXZ??B?$CSmartPtr@H@@QBEPAHXZ??B?$CSmartPtr@I@@QBEPAIXZ??B?$CSmartPtr@UAPE_DESCRIPTOR@@@@QBEPAUAPE_DESCRIPTOR@@XZ??B?$CSmartPtr@VCIO@@@@QBEPAVCIO@@XZ??B?$CSmartPtr@VCInputSource@@@@QBEPAVCInputSource@@XZ??B?$CSmartPtr@VCWinFileIO@@@@QBEPAVCWinFileIO@@XZ??B?$CSmartPtr@VIAPECompress@@@@QBEPAVIAPECompress@@XZ??B?$CSmartPtr@VIAPEDecompress@@@@QBEPAVIAPEDecompress@@XZ??C?$CSmartPtr@UAPE_DESCRIPTOR@@@@QBEPAUAPE_DESCRIPTOR@@XZ??C?$CSmartPtr@VCAPECompressCore@@@@QBEPAVCAPECompressCore@@XZ??C?$CSmartPtr@VCAPECompressCreate@@@@QBEPAVCAPECompressCreate@@XZ??C?$CSmartPtr@VCAPEInfo@@@@QBEPAVCAPEInfo@@XZ??C?$CSmartPtr@VCAPETag@@@@QBEPAVCAPETag@@XZ??C?$CSmartPtr@VCBitArray@@@@QBEPAVCBitArray@@XZ??C?$CSmartPtr@VCIO@@@@QBEPAVCIO@@XZ??C?$CSmartPtr@VCInputSource@@@@QBEPAVCInputSource@@XZ??C?$CSmartPtr@VCMACProgressHelper@@@@QBEPAVCMACProgressHelper@@XZ??C?$CSmartPtr@VCPrepare@@@@QBEPAVCPrepare@@XZ??C?$CSmartPtr@VCUnBitArrayBase@@@@QBEPAVCUnBitArrayBase@@XZ??C?$CSmartPtr@VCWinFileIO@@@@QBEPAVCWinFileIO@@XZ??C?$CSmartPtr@VIAPECompress@@@@QBEPAVIAPECompress@@XZ??C?$CSmartPtr@VIAPEDecompress@@@@QBEPAVIAPEDecompress@@XZ??C?$CSmartPtr@VIPredictorCompress@@@@QBEPAVIPredictorCompress@@XZ??C?$CSmartPtr@VIPredictorDecompress@@@@QBEPAVIPredictorDecompress@@XZ??_7CAPECompress@@6B@??_7CAPEDecompress@@6B@??_7CAPEDecompressOld@@6B@??_7CAPEInfo@@6B@??_7CAntiPredictor@@6B@??_7CAntiPredictorExtraHigh0000To3320@@6B@??_7CAntiPredictorExtraHigh3320To3600@@6B@??_7CAntiPredictorExtraHigh3600To3700@@6B@??_7CAntiPredictorExtraHigh3700To3800@@6B@??_7CAntiPredictorExtraHigh3800ToCurrent@@6B@??_7CAntiPredictorFast0000To3320@@6B@??_7CAntiPredictorFast3320ToCurrent@@6B@??_7CAntiPredictorHigh0000To3320@@6B@??_7CAntiPredictorHigh3320To3600@@6B@??_7CAntiPredictorHigh3600To3700@@6B@??_7CAntiPredictorHigh3700To3800@@6B@??_7CAntiPredictorHigh3800ToCurrent@@6B@??_7CAntiPredictorNormal0000To3320@@6B@??_7CAntiPredictorNormal3320To3800@@6B@??_7CAntiPredictorNormal3800ToCurrent@@6B@??_7CAntiPredictorOffset@@6B@??_7CCircleBuffer@@6B@??_7CIO@@6B@??_7CInputSource@@6B@??_7CMACProgressHelper@@6B@??_7CPredictorCompressNormal@@6B@??_7CPredictorDecompress3950toCurrent@@6B@??_7CPredictorDecompressNormal3930to3950@@6B@??_7CUnBitArray@@6B@??_7CUnBitArrayBase@@6B@??_7CUnBitArrayOld@@6B@??_7CWAVInputSource@@6B@??_7CWinFileIO@@6B@??_7IAPECompress@@6B@??_7IAPEDecompress@@6B@??_7IPredictorCompress@@6B@??_7IPredictorDecompress@@6B@??_C@_08GDHGJGOG@APETAGEX?$AA@??_ECAPECompressCore@@QAEPAXI@Z??_ECAPECompressCreate@@QAEPAXI@Z??_ECAPETag@@QAEPAXI@Z??_ECBitArray@@QAEPAXI@Z??_GCAPECompress@@UAEPAXI@Z??_GCAPECompressCore@@QAEPAXI@Z??_GCAPECompressCreate@@QAEPAXI@Z??_GCAPEDecompress@@UAEPAXI@Z??_GCAPEDecompressCore@@QAEPAXI@Z??_GCAPEDecompressOld@@UAEPAXI@Z??_GCAPEInfo@@UAEPAXI@Z??_GCAPETag@@QAEPAXI@Z??_GCAPETagField@@QAEPAXI@Z??_GCAntiPredictor@@QAEPAXI@Z??_GCBitArray@@QAEPAXI@Z??_GCCircleBuffer@@UAEPAXI@Z??_GCIO@@UAEPAXI@Z??_GCInputSource@@UAEPAXI@Z??_GCMACProgressHelper@@UAEPAXI@Z??_GCNNFilter@@QAEPAXI@Z??_GCPredictorCompressNormal@@UAEPAXI@Z??_GCPredictorDecompress3950toCurrent@@UAEPAXI@Z??_GCPredictorDecompressNormal3930to3950@@UAEPAXI@Z??_GCUnBitArray@@UAEPAXI@Z??_GCUnBitArrayBase@@UAEPAXI@Z??_GCUnBitArrayOld@@UAEPAXI@Z??_GCWAVInputSource@@UAEPAXI@Z??_GCWinFileIO@@UAEPAXI@Z??_GIAPECompress@@UAEPAXI@Z??_GIAPEDecompress@@UAEPAXI@Z??_GIPredictorCompress@@UAEPAXI@Z??_GIPredictorDecompress@@UAEPAXI@Z??_R0H@8?AdaptNoMMX@CNNFilter@@AAEXPAF0HH@Z?AddData@CAPECompress@@UAEHPAEH@Z?AddData@CMD5Helper@@QAEXPBXH@Z?AddDataFromInputSource@CAPECompress@@UAEHPAVCInputSource@@HPAH@Z?AdvanceToByteBoundary@CBitArray@@QAEXXZ?AdvanceToByteBoundary@CUnBitArrayBase@@UAEXXZ?Analyze@CAPEHeader@@QAEHPAUAPE_FILE_INFO@@@Z?Analyze@CAPETag@@AAEHXZ?AnalyzeCurrent@CAPEHeader@@IAEHPAUAPE_FILE_INFO@@@Z?AnalyzeOld@CAPEHeader@@IAEHPAUAPE_FILE_INFO@@@Z?AnalyzeSource@CWAVInputSource@@AAEHXZ?AntiPredict@CAntiPredictor@@UAEXPAH0H@Z?AntiPredict@CAntiPredictorExtraHigh0000To3320@@QAEXPAH0HHPAI1@Z?AntiPredict@CAntiPredictorExtraHigh3320To3600@@QAEXPAH0HHPAI1@Z?AntiPredict@CAntiPredictorExtraHigh3600To3700@@QAEXPAH0HHPAI1@Z?AntiPredict@CAntiPredictorExtraHigh3700To3800@@QAEXPAH0HHPAI1@Z?AntiPredict@CAntiPredictorExtraHigh3800ToCurrent@@QAEXPAH0HHHH@Z?AntiPredict@CAntiPredictorFast0000To3320@@UAEXPAH0H@Z?AntiPredict@CAntiPredictorFast3320ToCurrent@@UAEXPAH0H@Z?AntiPredict@CAntiPredictorHigh0000To3320@@UAEXPAH0H@Z?AntiPredict@CAntiPredictorHigh3320To3600@@UAEXPAH0H@Z?AntiPredict@CAntiPredictorHigh3600To3700@@UAEXPAH0H@Z?AntiPredict@CAntiPredictorHigh3700To3800@@UAEXPAH0H@Z?AntiPredict@CAntiPredictorHigh3800ToCurrent@@UAEXPAH0H@Z?AntiPredict@CAntiPredictorNormal0000To3320@@UAEXPAH0H@Z?AntiPredict@CAntiPredictorNormal3320To3800@@UAEXPAH0H@Z?AntiPredict@CAntiPredictorNormal3800ToCurrent@@UAEXPAH0H@Z?AntiPredict@CAntiPredictorOffset@@QAEXPAH0HHH@Z?AntiPredictorOffset@CAntiPredictorExtraHigh0000To3320@@AAEXPAH0HHHH@Z?AntiPredictorOffset@CAntiPredictorExtraHigh3320To3600@@AAEXPAH0HHHH@Z?AntiPredictorOffset@CAntiPredictorExtraHigh3600To3700@@AAEXPAH0HHHH@Z?AntiPredictorOffset@CAntiPredictorExtraHigh3700To3800@@AAEXPAH0HHHH@Z?Assign@?$CSmartPtr@D@@QAEXPADHH@Z?Assign@?$CSmartPtr@E@@QAEXPAEHH@Z?Assign@?$CSmartPtr@G@@QAEXPAGHH@Z?Assign@?$CSmartPtr@H@@QAEXPAHHH@Z?Assign@?$CSmartPtr@I@@QAEXPAIHH@Z?Assign@?$CSmartPtr@UAPE_DESCRIPTOR@@@@QAEXPAUAPE_DESCRIPTOR@@HH@Z?Assign@?$CSmartPtr@VCAPECompressCore@@@@QAEXPAVCAPECompressCore@@HH@Z?Assign@?$CSmartPtr@VCAPECompressCreate@@@@QAEXPAVCAPECompressCreate@@HH@Z?Assign@?$CSmartPtr@VCAPEInfo@@@@QAEXPAVCAPEInfo@@HH@Z?Assign@?$CSmartPtr@VCAPETag@@@@QAEXPAVCAPETag@@HH@Z?Assign@?$CSmartPtr@VCBitArray@@@@QAEXPAVCBitArray@@HH@Z?Assign@?$CSmartPtr@VCIO@@@@QAEXPAVCIO@@HH@Z?Assign@?$CSmartPtr@VCInputSource@@@@QAEXPAVCInputSource@@HH@Z?Assign@?$CSmartPtr@VCMACProgressHelper@@@@QAEXPAVCMACProgressHelper@@HH@Z?Assign@?$CSmartPtr@VCPrepare@@@@QAEXPAVCPrepare@@HH@Z?Assign@?$CSmartPtr@VCUnBitArrayBase@@@@QAEXPAVCUnBitArrayBase@@HH@Z?Assign@?$CSmartPtr@VCWinFileIO@@@@QAEXPAVCWinFileIO@@HH@Z?Assign@?$CSmartPtr@VIAPECompress@@@@QAEXPAVIAPECompress@@HH@Z?Assign@?$CSmartPtr@VIAPEDecompress@@@@QAEXPAVIAPEDecompress@@HH@Z?Assign@?$CSmartPtr@VIPredictorCompress@@@@QAEXPAVIPredictorCompress@@HH@Z?Assign@?$CSmartPtr@VIPredictorDecompress@@@@QAEXPAVIPredictorDecompress@@HH@Z?CalculateDotProductNoMMX@CNNFilter@@AAEHPAF0H@Z?CalculateOldChecksum@CUnMAC@@AAEIPAH0HH@Z?ClearFields@CAPETag@@QAEHXZ?Close@CWinFileIO@@UAEHXZ?CloseFile@CAPEInfo@@AAEHXZ?CompareFields@CAPETag@@CAHPBX0@Z?Compress@?$CScaledFirstOrderFilter@$0BP@$04@@QAEHH@Z?Compress@CNNFilter@@QAEHH@Z?CompressValue@CPredictorCompressNormal@@UAEHHH@Z?ConventionalDotProduct@CAntiPredictorExtraHighHelper@@QAEHPAF00HH@Z?Create@?$CRollBuffer@F@@QAEHHH@Z?Create@CWinFileIO@@UAEHPBG@Z?CreateAntiPredictor@@YAPAVCAntiPredictor@@HH@Z?CreateBuffer@CCircleBuffer@@QAEXHH@Z?CreateHelper@CUnBitArrayBase@@MAEHPAVCIO@@HH@Z?CreateIAPEDecompressCore@@YAPAVIAPEDecompress@@PAVCAPEInfo@@HHPAH@Z?CreateID3Tag@CAPETag@@QAEHPAUID3_TAG@@@Z?CreateInputSource@@YAPAVCInputSource@@PBGPAUtWAVEFORMATEX@@PAH222@Z?CreateUnBitArray@@YAPAVCUnBitArrayBase@@PAVIAPEDecompress@@H@Z?DecodeBlocksToFrameBuffer@CAPEDecompress@@IAEXH@Z?DecodeValue@CUnBitArray@@UAEIW4DECODE_VALUE_METHOD@@HH@Z?DecodeValue@CUnBitArrayBase@@UAEIW4DECODE_VALUE_METHOD@@HH@Z?DecodeValue@CUnBitArrayOld@@UAEIW4DECODE_VALUE_METHOD@@HH@Z?DecodeValueNew@CUnBitArrayOld@@AAEHH@Z?DecodeValueRange@CUnBitArray@@UAEHAAUUNBIT_ARRAY_STATE@@@Z?DecodeValueRange@CUnBitArrayBase@@UAEHAAUUNBIT_ARRAY_STATE@@@Z?DecodeValueRiceUnsigned@CUnBitArrayOld@@AAEII@Z?DecodeValueXBits@CUnBitArrayBase@@MAEII@Z?Decompress@?$CScaledFirstOrderFilter@$0BP@$04@@QAEHH@Z?Decompress@CNNFilter@@QAEHH@Z?DecompressCore@@YAHPBG0HHPAHP6GXH@Z1@Z?DecompressFrame@CUnMAC@@QAEHPAEHH@Z?DecompressFrameOld@CUnMAC@@AAEHPAEHH@Z?DecompressValue@CPredictorDecompress3950toCurrent@@UAEHHH@Z?DecompressValue@CPredictorDecompressNormal3930to3950@@UAEHHH@Z?Delete@?$CSmartPtr@D@@QAEXXZ?Delete@?$CSmartPtr@E@@QAEXXZ?Delete@?$CSmartPtr@G@@QAEXXZ?Delete@?$CSmartPtr@H@@QAEXXZ?Delete@?$CSmartPtr@I@@QAEXXZ?Delete@?$CSmartPtr@UAPE_DESCRIPTOR@@@@QAEXXZ?Delete@?$CSmartPtr@VCAPECompressCore@@@@QAEXXZ?Delete@?$CSmartPtr@VCAPECompressCreate@@@@QAEXXZ?Delete@?$CSmartPtr@VCAPEInfo@@@@QAEXXZ?Delete@?$CSmartPtr@VCAPETag@@@@QAEXXZ?Delete@?$CSmartPtr@VCBitArray@@@@QAEXXZ?Delete@?$CSmartPtr@VCIO@@@@QAEXXZ?Delete@?$CSmartPtr@VCInputSource@@@@QAEXXZ?Delete@?$CSmartPtr@VCMACProgressHelper@@@@QAEXXZ?Delete@?$CSmartPtr@VCPrepare@@@@QAEXXZ?Delete@?$CSmartPtr@VCUnBitArrayBase@@@@QAEXXZ?Delete@?$CSmartPtr@VCWinFileIO@@@@QAEXXZ?Delete@?$CSmartPtr@VIAPECompress@@@@QAEXXZ?Delete@?$CSmartPtr@VIAPEDecompress@@@@QAEXXZ?Delete@?$CSmartPtr@VIPredictorCompress@@@@QAEXXZ?Delete@?$CSmartPtr@VIPredictorDecompress@@@@QAEXXZ?Delete@CWinFileIO@@UAEHXZ?Empty@CCircleBuffer@@QAEXXZ?EncodeBits@CBitArray@@QAEHIH@Z?EncodeFrame@CAPECompressCore@@QAEHPBXH@Z?EncodeFrame@CAPECompressCreate@@QAEHPBXH@Z?EncodeUnsignedLong@CBitArray@@QAEHI@Z?EncodeValue@CBitArray@@QAEHHAAUBIT_ARRAY_STATE@@@Z?EndFrame@CAPEDecompress@@IAEXXZ?FileExists@@YAHPAG@Z?FillAndResetBitArray@CUnBitArrayBase@@UAEHHH@Z?FillBitArray@CUnBitArrayBase@@UAEHXZ?FillFrameBuffer@CAPEDecompress@@IAEHXZ?Finalize@CBitArray@@QAEXXZ?Finalize@CUnBitArray@@UAEXXZ?Finalize@CUnBitArrayBase@@UAEXXZ?FinalizeFile@CAPECompressCreate@@QAEHPAVCIO@@HHPBXHHH@Z?FindDescriptor@CAPEHeader@@IAEHH@Z?Finish@CAPECompress@@UAEHPAEHH@Z?Finish@CAPECompressCreate@@QAEHPBXHH@Z?Flush@?$CRollBuffer@F@@QAEXXZ?Flush@?$CRollBufferFast@H$0CAA@$07@@QAEXXZ?Flush@?$CRollBufferFast@H$0CAA@$08@@QAEXXZ?Flush@?$CRollBufferFast@H$0CAA@$09@@QAEXXZ?Flush@?$CScaledFirstOrderFilter@$0BP@$04@@QAEXXZ?Flush@CNNFilter@@QAEXXZ?Flush@CPredictorCompressNormal@@UAEHXZ?Flush@CPredictorDecompress3950toCurrent@@UAEHXZ?Flush@CPredictorDecompressNormal3930to3950@@UAEHXZ?FlushBitArray@CBitArray@@QAEXXZ?FlushBitArray@CUnBitArray@@UAEXXZ?FlushBitArray@CUnBitArrayBase@@UAEXXZ?FlushState@CBitArray@@QAEXAAUBIT_ARRAY_STATE@@@Z?FlushState@CUnBitArray@@UAEXAAUUNBIT_ARRAY_STATE@@@Z?FlushState@CUnBitArrayBase@@UAEXAAUUNBIT_ARRAY_STATE@@@Z?GenerateArray@CUnBitArray@@UAEXPAHHH@Z?GenerateArray@CUnBitArrayBase@@UAEXPAHHH@Z?GenerateArray@CUnBitArrayOld@@UAEXPAHHH@Z?GenerateArrayOld@CUnBitArrayOld@@AAEXPAHIH@Z?GenerateArrayRange@CUnBitArray@@AAEXPAHH@Z?GenerateArrayRice@CUnBitArrayOld@@AAEXPAHIH@Z?GenerateDecodedArray@CAPEDecompressCore@@QAEXPAHIHPAVCAntiPredictor@@H@Z?GenerateDecodedArrays@CAPEDecompressCore@@QAEXHHHH@Z?Get@CCircleBuffer@@QAEHPAEH@Z?GetANSIFromUTF16@@YAPADPBG@Z?GetANSIFromUTF8@@YAPADPBE@Z?GetBitArray@CAPECompressCore@@QAEPAVCBitArray@@XZ?GetBitsRemaining@CUnBitArrayOld@@AAEIXZ?GetBufferBytesAvailable@CAPECompress@@UAEHXZ?GetC@CUnBitArray@@AAEEXZ?GetCurrentBitIndex@CBitArray@@QAEIXZ?GetData@CAPEDecompress@@UAEHPADHPAH@Z?GetData@CAPEDecompressOld@@UAEHPADHPAH@Z?GetData@CWAVInputSource@@UAEHPAEHPAH@Z?GetDataX@CAPEDecompressCore@@QAEPAHXZ?GetDataY@CAPEDecompressCore@@QAEPAHXZ?GetDirectWritePointer@CCircleBuffer@@QAEPAEXZ?GetFieldBinary@CAPETag@@QAEHPBGPAXPAH@Z?GetFieldBytes@APE_TAG_FOOTER@@QAEHXZ?GetFieldFlags@CAPETagField@@QAEHXZ?GetFieldID3String@CAPETag@@AAEHPBGPADH@Z?GetFieldName@CAPETagField@@QAEPBGXZ?GetFieldSize@CAPETagField@@QAEHXZ?GetFieldString@CAPETag@@QAEHPBGPADPAHH@Z?GetFieldString@CAPETag@@QAEHPBGPAGPAH@Z?GetFieldValue@CAPETagField@@QAEPBDXZ?GetFieldValueSize@CAPETagField@@QAEHXZ?GetFieldsOffset@APE_TAG_FOOTER@@QAEHXZ?GetFileInformation@CAPEInfo@@AAEHH@Z?GetFinishBlock@CAPELink@@QAEHXZ?GetFullFrameBytes@CAPECompressCreate@@QAEHXZ?GetHasHeader@APE_TAG_FOOTER@@QAEHXZ?GetHeaderData@CWAVInputSource@@UAEHPAE@Z?GetImageFilename@CAPELink@@QAEPBGXZ?GetInfo@CAPEDecompress@@UAEHW4APE_DECOMPRESS_FIELDS@@HH@Z?GetInfo@CAPEDecompressOld@@UAEHW4APE_DECOMPRESS_FIELDS@@HH@Z?GetInfo@CAPEInfo@@QAEHW4APE_DECOMPRESS_FIELDS@@HH@Z?GetIsHeader@APE_TAG_FOOTER@@QAEHXZ?GetIsLinkFile@CAPELink@@QAEHXZ?GetIsReadOnly@CAPETagField@@QAEHXZ?GetIsUTF8Text@CAPETagField@@QAEHXZ?GetIsValid@APE_TAG_FOOTER@@QAEHH@Z?GetMD5Helper@CBitArray@@QAEAAVCMD5Helper@@XZ?GetName@CWinFileIO@@UAEHPAG@Z?GetNumberFields@APE_TAG_FOOTER@@QAEHXZ?GetPeakLevel@CAPECompressCore@@QAEHXZ?GetPosition@CWinFileIO@@UAEHXZ?GetPtr@?$CSmartPtr@D@@QBEPADXZ?GetPtr@?$CSmartPtr@E@@QBEPAEXZ?GetPtr@?$CSmartPtr@G@@QBEPAGXZ?GetPtr@?$CSmartPtr@I@@QBEPAIXZ?GetPtr@?$CSmartPtr@VCAPETag@@@@QBEPAVCAPETag@@XZ?GetPtr@?$CSmartPtr@VCBitArray@@@@QBEPAVCBitArray@@XZ?GetPtr@?$CSmartPtr@VCIO@@@@QBEPAVCIO@@XZ?GetPtr@?$CSmartPtr@VCInputSource@@@@QBEPAVCInputSource@@XZ?GetResult@CMD5Helper@@QAEHQAE@Z?GetSaturatedShortFromInt@CNNFilter@@ABEFH@Z?GetSize@CWinFileIO@@UAEHXZ?GetStartBlock@CAPELink@@QAEHXZ?GetTagBytes@CAPETag@@QAEHXZ?GetTagField@CAPETag@@QAEPAVCAPETagField@@H@Z?GetTagField@CAPETag@@QAEPAVCAPETagField@@PBG@Z?GetTagFieldIndex@CAPETag@@AAEHPBG@Z?GetTerminatingData@CWAVInputSource@@UAEHPAE@Z?GetTotalTagBytes@APE_TAG_FOOTER@@QAEHXZ?GetUTF16FromANSI@@YAPAGPBD@Z?GetUTF16FromUTF8@@YAPAGPBE@Z?GetUTF8FromANSI@@YAPAEPBD@Z?GetUTF8FromUTF16@@YAPAEPBG@Z?GetUnBitArrray@CAPEDecompressCore@@QAEPAVCUnBitArrayBase@@XZ?GetVersion@APE_TAG_FOOTER@@QAEHXZ?Get_K@CUnBitArrayOld@@AAEII@Z?IncrementFast@?$CRollBufferFast@H$0CAA@$07@@QAEXXZ?IncrementFast@?$CRollBufferFast@H$0CAA@$08@@QAEXXZ?IncrementFast@?$CRollBufferFast@H$0CAA@$09@@QAEXXZ?IncrementSafe@?$CRollBuffer@F@@QAEXXZ?Initialize@CMD5Helper@@QAEHXZ?Initialize@CUnMAC@@QAEHPAVIAPEDecompress@@@Z?InitializeDecompressor@CAPEDecompress@@IAEHXZ?InitializeDecompressor@CAPEDecompressOld@@IAEHXZ?InitializeFile@CAPECompressCreate@@QAEHPAVCIO@@PBUtWAVEFORMATEX@@HHPBXH@Z?Kill@CAPECompress@@UAEHXZ?LoadField@CAPETag@@AAEHPBDHPAH@Z?LockBuffer@CAPECompress@@UAEPAEPAH@Z?MD5Final@@YAXQAEPAUMD5_CTX@@@Z?MD5Init@@YAXPAUMD5_CTX@@@Z?MD5Update@@YAXPAUMD5_CTX@@PBEI@Z?MMXDotProduct@CAntiPredictorExtraHighHelper@@QAEHPAF00HH@Z?MaxAdd@CCircleBuffer@@QAEHXZ?MaxGet@CCircleBuffer@@QAEHXZ?Open@CWinFileIO@@UAEHPBG@Z?OutputBitArray@CBitArray@@QAEHH@Z?ParseData@CAPELink@@IAEXPBDPBG@Z?Prepare@CAPECompressCore@@AAEHPBXHPAH@Z?Prepare@CPrepare@@QAEHPBEHPBUtWAVEFORMATEX@@PAH2PAI22@Z?ProcessBuffer@CAPECompress@@AAEHH@Z?ProcessKillFlag@CMACProgressHelper@@QAEHH@Z?RangeDecodeFast@CUnBitArray@@AAEHH@Z?RangeDecodeFastWithUpdate@CUnBitArray@@AAEHH@Z?Read@CWinFileIO@@UAEHPAXIPAI@Z?ReadSafe@@YAHPAVCIO@@PAXH@Z?Remove@CAPETag@@QAEHH@Z?RemoveField@CAPETag@@QAEHH@Z?RemoveField@CAPETag@@QAEHPBG@Z?RemoveHead@CCircleBuffer@@QAEHH@Z?RemoveTail@CCircleBuffer@@QAEHH@Z?Roll@?$CRollBuffer@F@@QAEXXZ?Roll@?$CRollBufferFast@H$0CAA@$07@@QAEXXZ?Roll@?$CRollBufferFast@H$0CAA@$08@@QAEXXZ?Roll@?$CRollBufferFast@H$0CAA@$09@@QAEXXZ?Save@CAPETag@@QAEHH@Z?SaveField@CAPETagField@@QAEHPAD@Z?Seek@CAPEDecompress@@UAEHH@Z?Seek@CAPEDecompressOld@@UAEHH@Z?Seek@CWinFileIO@@UAEHHI@Z?SeekToFrame@CAPEDecompress@@IAEHH@Z?SeekToFrame@CUnMAC@@QAEHH@Z?SetEOF@CWinFileIO@@UAEHXZ?SetFieldBinary@CAPETag@@QAEHPBGPBXHH@Z?SetFieldID3String@CAPETag@@AAEHPBGPBDH@Z?SetFieldString@CAPETag@@QAEHPBG0@Z?SetFieldString@CAPETag@@QAEHPBGPBDH@Z?SetSeekByte@CAPECompressCreate@@QAEHHH@Z?SortFields@CAPETag@@AAEHXZ?Start@CAPECompress@@UAEHPBGPBUtWAVEFORMATEX@@HHPBXH@Z?Start@CAPECompressCreate@@QAEHPAVCIO@@PBUtWAVEFORMATEX@@HHPBXH@Z?StartEx@CAPECompress@@UAEHPAVCIO@@PBUtWAVEFORMATEX@@HHPBXH@Z?StartFrame@CAPEDecompress@@IAEXXZ?Uninitialize@CUnMAC@@QAEHXZ?UnlockBuffer@CAPECompress@@UAEHHH@Z?Unprepare@CPrepare@@QAEXHHPBUtWAVEFORMATEX@@PAEPAI@Z?UnprepareOld@CPrepare@@QAEHPAH0HPBUtWAVEFORMATEX@@PAEPAI0H@Z?UpdateAfterDirectWrite@CCircleBuffer@@QAEXH@Z?UpdateProgress@CMACProgressHelper@@QAEXHH@Z?UpdateProgressComplete@CMACProgressHelper@@QAEXXZ?VerifyFile@@YGHPBDPAHP6GXH@Z1H@Z?Write@CWinFileIO@@UAEHPBXIPAI@Z?WriteBufferToEndOfIO@CAPETag@@AAEHPAXH@Z?WriteSafe@@YAHPAVCIO@@PAXH@ZAdaptCalculateDotProductGetMMXAvailable_Adapt_CalculateDotProduct_CompressFile@24_CompressFileW@24_ConvertFile@24_ConvertFileW@24_CreateIAPECompress@4_CreateIAPEDecompress@8_CreateIAPEDecompressEx2@16_CreateIAPEDecompressEx@8_DecompressFile@20_DecompressFileW@20_FillWaveFormatEx@16_FillWaveHeader@16_GetMMXAvailable_VerifyFileW@20__CT??_R0H@84__CTA1H__TI1H__real@00000000__real@4020000000000000__real@408f400000000000__real@47c35000// 1084342683 0 915 ` .\Release\NNFilter.obj.\Release\NewPredictor.obj.\Release\WinFileIO.obj.\Release\StdLibFileIO.obj.\Release\Prepare.obj.\Release\MD5.obj.\Release\MACProgressHelper.obj.\Release\GlobalFunctions.obj.\Release\CircleBuffer.obj.\Release\CharacterHelper.obj.\Release\WAVInputSource.obj.\Release\APETag.obj.\Release\APELink.obj.\Release\APEInfo.obj.\Release\APEHeader.obj.\Release\UnMAC.obj.\Release\UnBitArrayOld.obj.\Release\APEDecompressOld.obj.\Release\APEDecompressCore.obj.\Release\AntiPredictorNormal.obj.\Release\AntiPredictorHigh.obj.\Release\AntiPredictorFast.obj.\Release\AntiPredictorExtraHigh.obj.\Release\Anti-Predictor.obj.\Release\UnBitArrayBase.obj.\Release\UnBitArray.obj.\Release\APEDecompress.obj.\Release\BitArray.obj.\Release\APECompressCreate.obj.\Release\APECompressCore.obj.\Release\APECompress.obj.\Release\MACLib.obj.\Release\APESimple.obj.\Assembly\Assembly.obj /0 1084342672 100666 7756 ` LÁ¡@+i.drectveZì .debug$SzF@B.textÀ P`.debug$FÖæ@B.textð P`.debug$F @B.textZ# P`.debug$F} @B.text— P`.debug$F§ · @B.textÁ Û  P`.debug$Få õ @B.text+ÿ P`.debug$F* : @B.text D P`.debug$FQ a @B.text,k P`.debug$F— § @B.textt± % P`.text$x@_ P`.xdata$xX¯@0@.sxdataC0.debug$FPK›@B.textoÍ< P`.debug$FP`@B.text@j P`.debug$Fªº@B.data ÄÏ@0À.xdata$xÙõ@0@.xdata$xÿ@0@.xdata$x!@0@/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" : „t3e:\Mac_sdk_399_4\Source\MACLib\Release\NNFilter.obj8   !Microsoft (R) Optimizing Compiler‹D$¿È;ÁtÁø5ÿ ‹D$‹L$ Áø…ÉVû…À„ù‹L$ ‹Ð‹D$f‹1f0f‹qfpƒÁf‹qƒÀfpƒÁf‹qƒÀfpƒÁf‹qƒÀfpƒÁf‹qƒÀfpƒÁf‹qƒÀfpƒÁf‹qƒÀfpƒÁf‹qƒÀfpƒÁf‹qƒÀfpƒÁf‹qƒÀfpƒÁf‹qƒÀfpƒÁf‹qƒÀfpƒÁf‹qƒÀfpƒÁf‹qƒÀfpƒÁf‹qƒÀfpƒÁƒÀƒÁƒÀJ…ÿÿÿ^ÂŽ…À„ø‹L$ ‹Ð‹D$ë¤$f‹1f)0f‹qf)pƒÁf‹qƒÀf)pƒÁf‹qƒÀf)pƒÁf‹qƒÀf)pƒÁf‹qƒÀf)pƒÁf‹qƒÀf)pƒÁf‹qƒÀf)pƒÁf‹qƒÀf)pƒÁf‹qƒÀf)pƒÁf‹qƒÀf)pƒÁf‹qƒÀf)pƒÁf‹qƒÀf)pƒÁf‹qƒÀf)pƒÁf‹qƒÀf)pƒÁf‹qƒÀf)pƒÁƒÀƒÁƒÀJ…ÿÿÿ^ÂV‹t$Áþ3À…ö„D‹L$ ‹T$SWd$¿¿:¯û¿YÇ¿z¯ûǃÁ¿YƒÂ¿z¯ûǃÁ¿YƒÂ¿z¯ûƒÁ¿YƒÂÇ¿z¯ûƒÁ¿YƒÂÇ¿z¯ûƒÁ¿YƒÂÇ¿z¯ûƒÁ¿YƒÂÇ¿z¯ûƒÁ¿YƒÂÇ¿z¯ûƒÁ¿YƒÂÇ¿z¯ûƒÁ¿YƒÂÇ¿zƒÁ¯û¿YƒÂÇ¿zƒÁ¯û¿YƒÂÇ¿zƒÁ¯û¿YƒÂƒÁƒÂÇ¿:¯û¿YÇ¿zƒÁ¯û¿YƒÂÇ¿zƒÁ¯ûƒÂǃÁƒÂN…Ìþÿÿ_[^ Z‹ÁÇÇ@ÃV‹ñ‹…ÀtPèƒÄÇ^à ‹Ñ‹JL V‹ñW‹:Áé3Àó«‹Îƒáóª‹B‹ A_‰B^Ã+$‹A‹L$H )‹Á‹HÑáV‹p+ñ‹ÑW‹8Áéó¥‹Êƒáó¤‹H‹ J_‰H^Ã,.jÿhd¡Pd‰%QSV‹ñ‰t$‹F43Û;ÃÇD$t PèƒÄ‰^4‹F$;È\$t PèƒÄ‰^$‹F;ÃÇD$ÿÿÿÿt PèƒÄ‰^‹L$ ^[d‰ ƒÄÃÌ̋ы ÑáV‹ñÁéW‹z43Àó«‹Îƒáóª‹J‹zL ‹ñÁé3Àó«‹Îƒáóª‹J‹BA‰B‹J,‹z$L ‹ñÁé3Àó«‹Îƒáóª‹J,‹B$ H_‰J(ÇB^ÃÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌjÿhd¡Pd‰%QSV‹ñW~3ɉt$ ‰‰O^$‰L$‰ ‰K‹D$ ;ÁºˆT$~m‹Èá€yIƒÉðAu\‹T$$‰‹D$(‰V‰Fè‹Qh‹Ï‰F è‹Rh‹Ëè‹ÑàPè‹L$ƒÄ‰F4_‹Æ^[d‰ ƒÄ hL$$Q‰T$(èÌÌÌÌÌÌÌÌÌÌSUV‹t$¿Æ;ðW‹Ù‹ÆtÁø5ÿ‹Kf‰‹C ‹S4‹K…À‹PRtÀ+ÈQèƒÄ ë À+ÈQ‹Ëè‹SJÿ¿Óç‹Ê‹îø‹C Óÿ‹K(+ï…À‹Pt‹Õ÷ÚR‹S4À+ÈQRèƒÄë‹S4ÀU+ÈQR‹Ëè‹Æ™‹ø‹C3ú+ú @;ù~‹S(Áþƒæ@ƒî f‰2ëG …¸VUUU÷é‹ÂÁèÂ;ø~‹K(Áþƒæ ƒîf‰1ë…ÿ~‹S(Áþƒæƒîf‰2ë‹C(fÇ‹K‹Ç+Á™ƒâÂÁøÁ‰C‹C(fÑxþ‹C(fÑxü‹C(fÑxð‹C‹K ‹{º‹ð‰C‹CÈ O;ñu +ñ‹ÁÁéó¥‹Èƒáó¤‹K‹C H‰K‹s(‹C,‹{$ò‹S0Ð W;ñ‰s(u +ñ‹ÑÁéó¥‹Êƒáó¤‹C,‹K$A‰S(_^‹Å][ÂÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌS‹Ù‹C ‹K4UV…À‹WP‹CQt +ÂPèƒÄ ë +ÂP‹Ëè‹t$‹ø‹C …À‹P‹C(t‹Î÷ÙQ‹K4+ÂPQèƒÄë‹K4V+ÂPQ‹Ëè‹CHÿ½Óå‹ÈïÓýî¿Õ;ê‹ÅtÁø5ÿ‹Kf‰{ŒŒ–‹Å™‹È‹C3Ê+Ê@;Ê~‹S(‹ÅÁøƒà@ƒè f‰ëK…¸VUUU÷ê‹ÂÁèÂ;È~‹C(‹ÕÁúƒâ ƒêf‰ë…É~‹C(‹ÕÁúƒâƒêf‰ë‹S(fÇ‹s‹Á+Æ™ƒâÂÁøƉC‹C(fÑxþ‹C(fÑxüë …íu3Àë ‹ÅÁøƒàƒè‹K(f‰‹C(fÑxø‹C(fÑxð‹C‹K ‹{º‹ð‰C‹CÈ O;ñu +ñ‹ÁÁéó¥‹Èƒáó¤‹K‹C H‰K‹s(‹C,‹{$ò‹S0Ð W;ñ‰s(u +ñ‹ÑÁéó¥‹Êƒáó¤‹C,‹K$A‰S(_^‹Å][Â8 >>1Hcv>a >>h`zF‰F“G©>´_ÂdgPff®g½äfø‹MðƒÁé‹MðƒÁ$é¸é‹MðƒÁé‹MðƒÁ$é¸é<9'27b<9ÿÿÿÿ “ÿÿÿÿ “7 6=0[8ZDc8a~qÇ$±ä3C O0e@hV‹ñ‹…ÀWtPèƒÄÇ‹D$ ‹L$‰F ÁÑàP‰Nè‹øƒÄ…ÿ‰>u _¸Ð^‹NL ‹ÑÁé3Àó«‹Êƒáóª‹F‹A_‰V3À^ -GoF‹Á‹H‹P ƒÁV‹ñ‰H‹HW‹8ÑW;òuÉ+ñ‹ÑÁéó¥‹Êƒáó¤‹H‹ J‰H_^Ã@L.HPÿÿÿÿSV Y.fileþÿg.\NNFilter.cpp@comp.id `ÿÿ@feat.00ÿÿ.drectveZ.debug$Sz.text*EžT .debug$F.text˜T¤1 .debug$F.textZŽ]—U .debug$F.text ÿÎ21† .debug$F  .text ÁÉû¬¡ ¼ .debug$F  .text +ÅùXÉ .debug$F .text ÍÅ è .debug$F.text,¬,÷¨ .debug$F.texttóV#$ .text$x@«h.Þ$L74827  $L74826 9 Z .xdata$xXžÃÂw$T74845$T74848m.sxdata®Ø²Õ.debug$FP{€ .texto‚to” ¶ .debug$F.text@kQ½Ã .debug$Fê .data ç®s ??_R0H@8.xdata$xMG»–.xdata$xžªÌ__CTA1H$L74876+ $L74875  $L74889Æ.xdata$x__TI1H# 46 $T74886<$T74890,X nÐ _Adapt ‹   ¿?GetSaturatedShortFromInt@CNNFilter@@ABEFH@Z?AdaptNoMMX@CNNFilter@@AAEXPAF0HH@Z?CalculateDotProductNoMMX@CNNFilter@@AAEHPAF0H@Z??0?$CRollBuffer@F@@QAE@XZ??1?$CRollBuffer@F@@QAE@XZ??3@YAXPAX@Z?Flush@?$CRollBuffer@F@@QAEXXZ??A?$CRollBuffer@F@@QBEAAFH@Z?Roll@?$CRollBuffer@F@@QAEXXZ??1CNNFilter@@QAE@XZ__ehhandler$??1CNNFilter@@QAE@XZ___CxxFrameHandler__except_list?Flush@CNNFilter@@QAEXXZ?Create@?$CRollBuffer@F@@QAEHHH@Z??2@YAPAXI@Z?IncrementSafe@?$CRollBuffer@F@@QAEXXZ??0CNNFilter@@QAE@HHH@Z??_7type_info@@6B@__CT??_R0H@84_GetMMXAvailable__ehhandler$??0CNNFilter@@QAE@HHH@Z__CxxThrowException@8?Compress@CNNFilter@@QAEHH@Z_CalculateDotProduct?Decompress@CNNFilter@@QAEHH@Z/23 1084342673 100666 22042 ` LN‘Á¡@+5).drectveZD .debug$S~ž @B.text  '  P`.rdata 1 = @0@.debug$F[ k @B.textu |  P`.debug$F† – @B.text  ¿  P`.debug$FÓ ã @B.text í ø  P`.rdata @0@.debug$F,<@B.textFM P`.debug$FWg@B.textq P`.debug$F¤´@B.text¾Ü P`.debug$Fð@B.text¶ À!| P`.data ˜&£&@0À.xdata$x­&É&@0@.xdata$xÓ&Û&@0@.text$x¶å&›(0 P`.xdata$x{*‹*@0@.rdata •*¡*@0@.xdata$xÈ¿*‡,*@0@.sxdata+.0.debug$FÀC./ @B.text{/•/ P`.debug$FŸ/¯/@B.text¹/ P`.debug$FÑ/á/@B.textë/ P`.debug$F 00@B.text#0 P`.debug$F(080@B.text B0 P`.debug$FO0_0@B.texti0ƒ0 P`.debug$F00@B.text*§0 P`.debug$FÑ0á0@B.textë0 P`.debug$F 11@B.text#1 P`.debug$F(181@B.text B1 P`.debug$FO1_1@B.texti1 P`.debug$Fp1€1@B.textŠ1 P`.debug$F¡1±1@B.text»1 P`.debug$FÎ1Þ1@B.textè12 P`.debug$F 22@B.text'&2 P`.debug$FM2]2@B.textg2 P`.debug$F…2•2@B.textŸ2 P`.debug$F¤2´2@B.text ¾2 P`.debug$FË2Û2@B.rdata å2ñ2@0@.text3-3 P`.debug$FA3Q3@B.rdata [3g3@0@.text+…3°3 P`.debug$Fº3Ê3@B.text=Ô34 P`.debug$F4+4@B.text:54o4 P`.debug$Fy4‰4@B.text“4±4 P`.debug$FÅ4Õ4@B.textß4ý4 P`.debug$F5!5@B/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" > „t7e:\Mac_sdk_399_4\Source\MACLib\Release\NewPredictor.obj8   !Microsoft (R) Optimizing Compiler‹ÁÇ    ÇÃöD$V‹ñÇt VèƒÄ‹Æ^  ‹ÁÇÂ($   "ÇÃ(-öD$V‹ñÇt VèƒÄ‹Æ^ (#V‹ñèöD$t VèƒÄ‹Æ^Â87jÿhd¡Pd‰%QSV‹ñ‰t$3Ûh ‰\$Çè‰F‹D$ ƒÄ=èu‰^4‰^8‹Æ^[‹L$d‰ ƒÄÂ=Ðu_j8èƒÄ‰D$;ÃÆD$t+‹L$ Qj j‹Èè‰F4‰^8‹Æ^[‹L$d‰ ƒÄÂ3À‰F4‰^8‹Æ^[‹L$d‰ ƒÄÂ=¸ u)j8èƒÄ‰D$;ÃÆD$tÅ‹T$ Rj j@‹Èèëµ= uvWj8èƒÄ‰D$ ;Ë|$$ÆD$tWj h‹Èèë3Àj8ˆ\$‰F4èƒÄ‰D$$;ÃÆD$tWj j ‹Èèë3À‹L$‰F8_‹Æ^[d‰ ƒÄÂhD$$PÇD$(èÌÌÌÌÌÌjÿhd¡Pd‰%QSV‹ñW‰t$ Ç‹~43Û;û‰\$t‹ÏèWèƒÄ‰^4‹~8;ût‹ÏèWèƒÄ‰^8‹F;Ãt PèƒÄ‰^‹L$_Ç^[d‰ ƒÄÃÌÌÌÌÌÌV‹ñ‹N4…Étè‹N8…Étè‹N3À‰‰A‰A‰A ‰A‰A‰A‰A‰A 3ÒF‹È‰‰Q‰Q‰Q ‰Q‰Q‰Q‰Q‹VƒÂ ÇhÇF =ÇF“ÿÿÿÇFb‰V(ÇF0ÇF,3À^ÃÌÌQSU‹Ù{,VWu ‹{·¹ó¥‹CƒÀ ‰C(ÇC,‹K8…Ét‹T$Rè‰D$‹K4…Ét‹D$Pè‰D$‹{(‹Wü‹wø‹Gô‹oð‹Ê+Î+ð+Å‹k‰D$¯ê‹C ¯Áè‹C¯D$è‹C¯Æè‹D$Áý è…À‰/~R‹kÁúƒâ¸+ÂèÁùƒá‰k‹k º+ÑêÁþƒæ‰k ‹k¸+Æè‹D$Áøƒà¹+ÈKë?}@‹{‹D$‹kÁúƒâJúÁùƒáIÁþ‰{‹{ ù‹KƒæÁøNƒàîHȉ{ ‰K‰k‹C0‹K(kÀ‹1‹S,ÁøÆ_B^ƒÁ]‰C0‰S,‰K([YÂjÿhd¡Pd‰%QSV‹ñW‰t$ Ç‹~D3Û;ûÇD$t‹ÏèWèƒÄ‰^D‹~H;ût‹ÏèWèƒÄ‰^H‹~L;ût‹ÏèWèƒÄ‰^L‹F ;ÃÆD$t PèƒÄ‰^ ‹F;È\$t PèƒÄ‰^‹L$_Ç^[d‰ ƒÄÃÌÌÌÌÌÌÌÌÌÌÌÌV‹ñ‹ND…ÉWtè‹NH…Étè‹NL…Étè‹~3À¹ ó«‹F3ɃÀ(‰F‹V ‰ ‰J‰J‰J ‰J‰J‰J‰J‰J ‰J$‹F ƒÀ$‰F‰N‰NV‰ ‰J‰J‰J ‰J‰J‰J‰J‰J ÇFÊ‹Vü¯SÊ‹S¯×ÊÁù È…ÿt ‹÷ÁþƒæNë3ö‹SX‰2‹SH‹Rü…Òt ÁúƒâJë3Ò‹sX‰Vü‹SP‹…Òt ÁúƒâJë3Ò‹s`‰‹SP‹Rü…Òt ÁúƒâJë3Ò…À‹s`‰Vü~f‹CX‹‹{‹s‹k +ú‰{‹Pü‹{+ò‰s‹Pø‹s$+ê‰k ‹@ô‹k(+ø‹C`‰{‹‹{,+ò‰s$‹Pü‹s0+ê‰k(‹Pø+ú‰{,‹Pô+ò‹S4‰s0‹@ð+Ðëf}g‹CX‹‹{‹s‹k ú‰{‹Pü‹{ò‰s‹Pø‹s$ê‰k ‹@ô‹k(ø‹C`‰{‹‹{,ò‰s$‹Pü‹s0ê‰k(‹Pøú‰{,‹Pôò‹S4‰s0‹@ðЉS4‹SdkÒÁú ‰Cd‰Kp‹kH¹é‰kHKPKXK`‹Kl_^A]‰Kl[ÂÌÌÌÌÌÌÌÌÌÌÌÌÌjÿhd¡Pd‰%QUV‹ñW‰t$ 3íh(‰l$Çè‹ø3À‰~¹ ó«‹FƒÀ(‰Fh$ÆD$ è‰F 3ɉ‰H‰H‰H ‰H‰H‰H‰H‰H ‰H$‹V ƒÂ$ƒÄ‰V‹D$ =èÆD$u‰nD‰nH‰nLé©=ÐuEj8èƒÄ‰D$ ;ÅÆD$th–j j‹Èè‰FD‰nH‰nLém3À‰FD‰nH‰nLé]=¸ u5j8èƒÄ‰D$ ;ÅÆD$tÒh–j j@‹Èè‰FD‰nH‰nLé!= uuj8èƒÄ‰D$ ;ÅÆD$th–j h‹Èèë3Àj8ÆD$‰FDèƒÄ‰D$ ;ÅÆD$th–j j ‹Èè‰FH‰nLé²3À‰FH‰nLé¥=ˆ…°j8èƒÄ‰D$ ;ÅÆD$th–jh‹Èèë3Àj8ÆD$‰FDèƒÄ‰D$ ;ÅÆD$th–j h‹Èèë3Àj8ÆD$‰FHèƒÄ‰D$ ;ÅÆD$ th–j j‹Èèë3À‰FL‹L$_‹Æ^]d‰ ƒÄÂhD$$PÇD$(èÌÌÌjÿhd¡Pd‰%QUV‹ñW‰t$ 3íh ‰l$Çè‰FD3ɉ‰H‰H‰H ‰H‰H‰H‰H‰H ‹VDƒÂ ‰VHh ÆD$ è‰FL3ɉ‰H‰H‰H ‰H‰H‰H‰H‰H ‹VLƒÂ ‰VPh ÆD$$è‰FT3ɉ‰H‰H‰H ‰H‰H‰H‰H‰H ‹VTƒÂ ‰VXh ÆD$(è‰F\3ɉ‰H‰H‰H ‰H‰H‰H‰H‰H ‹V\ƒÄƒÂ ‰V`‹D$ =è‹|$$ÆD$‰~tu‰nx‰n|‰®€é«=ÐuGj8èƒÄ‰D$$;ÅÆD$tWj j‹Èè‰Fx‰n|‰®€ép3À‰Fx‰n|‰®€é]=¸ u4j8èƒÄ‰D$$;ÅÆD$tÏWj j@‹Èè‰Fx‰n|‰®€é"= usj8èƒÄ‰D$$;ÅÆD$tWj h‹Èèë3Àj8ÆD$‰FxèƒÄ‰D$$;ÅÆD$tWj j ‹Èè‰F|‰®€é¸3À‰F|‰®€é¨=ˆ…³j8èƒÄ‰D$$;ÅÆD$ th–jh‹Èèë3Àj8ÆD$‰FxèƒÄ‰D$$;ÅÆD$ th–j h‹Èèë3Àj8ÆD$‰F|èƒÄ‰D$$;ÅÆD$ th–j j‹Èèë3À‰†€‹L$_‹Æ^]d‰ ƒÄÂhD$(PÇD$,èÌ[ aa+Z0WVajWŠVŸa¼aÐWðVW$V6WRViatU†b“i™a¡a±ZÅ8Ëß8åø (a+m7míooÔa!a1ÓI8Oc8i}8ƒ›²ÃÌaìmømmÙÙ(ÙCëIaQaaêy8“8™°8¶Ñé  ) (2 aN mZ mi mú o o o3 9 aA a\ Óa W‡ Wá WV-WMViWŒVŸW¿VéW VWBVUWuVŒa—U©b³!¹aÁaÜêáWWOW†WçWV5WQVpWV¢W¾VîWV$WGVZWzV”aŸU±b.H>ÿÿÿÿAD‹Mðé‹EPèYËEPèYËEPèYËEPèYøé‹Mðé¸é‹Mðé‹MðƒÁé‹MðƒÁ é¸é‹Mðé‹MðƒÁDé‹MðƒÁLé‹MðƒÁTé‹MðƒÁ\é¸é‹Mðé‹MðƒÁé‹MðƒÁ é‹EPèYËEPèYËEPèYËEPèYËEPèYËEPèYËEPèYøé‹Mðé‹MðƒÁDé‹MðƒÁLé‹MðƒÁTé‹MðƒÁ\é‹EPèYËEPèYËEPèYËEPèYËEPèYËEPèYËEPèYøé- #.5_:\B-GjL\T_rj‹oÕt\|-‡³’³³¨³­ì²\ºÅrЋÙäïú" '\/-:³E³P³[³doz…›¦­"²\ GInlÿÿÿÿ “ÿÿÿÿ “ÿÿÿÿ “ÿÿÿÿ “ÿÿÿÿ “ ÿÿÿÿ “ Q PON$M0`HhTklÐtÏ|ÎˆÖ ç¨æ°å¸äÀãÌíä ìôü $,8 PX`hpx€ˆ˜ ¨´#[iÔë !‹ŠŽ`į¯ú/³~=g l0n@ÊP×`Øp߀îï ÿ°V‹ñ‹…ÀtPèƒÄÇ^à r‹ÑW‹:3À¹ 󫋃À(‰B_Ãw‹ÁV‹pW‹8ƒî(¹ 󥋃Á(_‰H^Ã|ƒAËA‹L$ˆÂ †V‹ñ‹…ÀtPèƒÄÇ^à ‹‹3À‰‰B‰B‰B ‰B‰B‰B‰B‰B ‰B$‹ƒÀ$‰AÃ*‹ÁV‹pW‹8ƒî$¹ 󥋃Á$_‰H^ÕƒAÚ‹A‹L$ˆÂ ŸÇä‹T$V‹1köÁþ‹Â+Ɖ^©‹‹T$kÀÁø‰Â®V‹ñ‹…ÀtPèƒÄÇ^à ³‹3À‰‰B‰B‰B ‰B‰B‰B‰B‰B ‹ƒÀ ‰AÃ'¸‹ÁV‹pW‹8ƒî ¹ó¥‹ƒÁ _‰H^ýƒAËA‹L$ˆÂ ÇÌØ×V‹ñèöD$t VèƒÄ‹Æ^ÂgHáïîVWh(‹ñè‹ø3À‰>¹ 󫋃ăÀ(‰F_‹Æ^à W+ òVh$‹ñè‰3ɉ‰H‰H‰H ‰H‰H‰H‰H‰H ‰H$‹ƒÂ$ƒÄ‰V‹Æ^à W=÷Vh ‹ñè‰3ɉ‰H‰H‰H ‰H‰H‰H‰H‰H ‹ƒÂ ƒÄ‰V‹Æ^à W:üV‹ñèöD$t VèƒÄ‹Æ^ÂÊËV‹ñèöD$t VèƒÄ‹Æ^Âßà.fileþÿg.\NewPredictor.cpp@comp.id `ÿÿ@feat.00ÿÿ.drectveZ.debug$S~.text ï>\é # . P i .rdata r.debug$F.textªá‹ÀŽ .debug$F.text»Hóš¬ Î .debug$F .text  ãqéEÛ ý ! i#.rdata  E .debug$F  .text ªá‹Àc .debug$F .text»Hóšƒ .debug$F.textN)¬œ§ À .debug$F.text¶|ÞEÕ .data ç®s ??_R0H@8.xdata$xMG»–.xdata$xžªÌ__CTA1H( \ iH.text$x¶06òÎ5$L75651) $L75650 $L75649 $L75648 $L75647 $L75661Š.xdata$x__TI1H ¨ .rdata µã4 ! .xdata$xÈ*º„™;$T75658($T756624B .sxdataˆvߟ.debug$FÀ X $L75674> ˆF $T75687L$T75690DÄ  ø ° Q .textÁÉû¬p .debug$F.textäÖ&0˜ .debug$F .text!­ö¹Ä! .debug$F"!.text#È æ´ï# .debug$F$#.text% Ëàˆz#% .debug$F&%.text'ÁÉû¬N' .debug$F('.text)*íjsv) .debug$F*).text+ŒÍ¢+ .debug$F,+.text-È æ´Í- .debug$F.-.text/ Ëàˆz/ .debug$F0/.text1ªá‹À,1 .debug$F21.text3ùtÚ¸^3 .debug$F43.text5}j)>”5 .debug$F65.text7ÁÉû¬Ì7 .debug$F87.text9'¢~ô9 .debug$F:9.text;?n„W ; .debug$F<;.text=È æ´K= .debug$F>=.text? Ëàˆz? .debug$F@?ª Î ö iË$L75750c $L75749X $L75748P .rdataA A@n $T75781€$T75784hpà ˜ Ê .textBN)¬œçB .debug$FCB @ H y ià$L75950¡ $L75949– $L75948‹ $L75947€ $L75946x .rdataD ª DÕ ¬ $T75995Ä$T75998œ @  ? p  .textE+Yu8| E .debug$FFE.textG=xÛ“³¤ G .debug$FHG.textI:§¸ÍcÌ I .debug$FJIô 0  $L76273 $L76272  $L76271 $L76270õ $L76269ê $L76268ß $L76267Ô $L76266É $L76265¾ $L76264¶ $L76302­ ! $T763000$T76303à.textKN)¬œJ K .debug$FLKr ° $L76348¡ $L76347– $L76346‹ $L76345€ $L76344u $L76343j $L76342_ $L76341T $L76340I $L76339> $L763383 $L76337+ $L76399µ¡ ¬ $T76397¬$T76400L.textMN)¬œÜ M .debug$FNM ??0IPredictorCompress@@QAE@H@Z__purecall??_GIPredictorCompress@@UAEPAXI@Z??_EIPredictorCompress@@UAEPAXI@Z??_7IPredictorCompress@@6B@??1IPredictorCompress@@UAE@XZ??_GIPredictorCompress@@UAEPAXI@Z??3@YAXPAX@Z??0IPredictorDecompress@@QAE@HH@Z??_GIPredictorDecompress@@UAEPAXI@Z??_EIPredictorDecompress@@UAEPAXI@Z??_7IPredictorDecompress@@6B@??1IPredictorDecompress@@UAE@XZ??_GIPredictorDecompress@@UAEPAXI@Z??_GCNNFilter@@QAEPAXI@Z??1CNNFilter@@QAE@XZ??0CPredictorDecompressNormal3930to3950@@QAE@HH@Z??_7type_info@@6B@__CT??_R0H@84??_GCPredictorDecompressNormal3930to3950@@UAEPAXI@Z??_ECPredictorDecompressNormal3930to3950@@UAEPAXI@Z??0CNNFilter@@QAE@HHH@Z??2@YAPAXI@Z??_7CPredictorDecompressNormal3930to3950@@6B@__ehhandler$??0CPredictorDecompressNormal3930to3950@@QAE@HH@Z___CxxFrameHandler__except_list__CxxThrowException@8??1CPredictorDecompressNormal3930to3950@@UAE@XZ__ehhandler$??1CPredictorDecompressNormal3930to3950@@UAE@XZ?Flush@CPredictorDecompressNormal3930to3950@@UAEHXZ?Flush@CNNFilter@@QAEXXZ?DecompressValue@CPredictorDecompressNormal3930to3950@@UAEHHH@Z?Decompress@CNNFilter@@QAEHH@Z??1?$CRollBufferFast@H$0CAA@$09@@QAE@XZ?Flush@?$CRollBufferFast@H$0CAA@$09@@QAEXXZ?Roll@?$CRollBufferFast@H$0CAA@$09@@QAEXXZ?IncrementFast@?$CRollBufferFast@H$0CAA@$09@@QAEXXZ??A?$CRollBufferFast@H$0CAA@$09@@QBEAAHH@Z??1?$CRollBufferFast@H$0CAA@$08@@QAE@XZ?Flush@?$CRollBufferFast@H$0CAA@$08@@QAEXXZ?Roll@?$CRollBufferFast@H$0CAA@$08@@QAEXXZ?IncrementFast@?$CRollBufferFast@H$0CAA@$08@@QAEXXZ??A?$CRollBufferFast@H$0CAA@$08@@QBEAAHH@Z?Flush@?$CScaledFirstOrderFilter@$0BP@$04@@QAEXXZ?Compress@?$CScaledFirstOrderFilter@$0BP@$04@@QAEHH@Z?Decompress@?$CScaledFirstOrderFilter@$0BP@$04@@QAEHH@Z??1?$CRollBufferFast@H$0CAA@$07@@QAE@XZ?Flush@?$CRollBufferFast@H$0CAA@$07@@QAEXXZ?Roll@?$CRollBufferFast@H$0CAA@$07@@QAEXXZ?IncrementFast@?$CRollBufferFast@H$0CAA@$07@@QAEXXZ??A?$CRollBufferFast@H$0CAA@$07@@QBEAAHH@Z??1CPredictorCompressNormal@@UAE@XZ??_GCPredictorCompressNormal@@UAEPAXI@Z??_ECPredictorCompressNormal@@UAEPAXI@Z??_7CPredictorCompressNormal@@6B@__ehhandler$??1CPredictorCompressNormal@@UAE@XZ?Flush@CPredictorCompressNormal@@UAEHXZ?CompressValue@CPredictorCompressNormal@@UAEHHH@Z?Compress@CNNFilter@@QAEHH@Z??_GCPredictorDecompressNormal3930to3950@@UAEPAXI@Z??1CPredictorDecompress3950toCurrent@@UAE@XZ??_GCPredictorDecompress3950toCurrent@@UAEPAXI@Z??_ECPredictorDecompress3950toCurrent@@UAEPAXI@Z??_7CPredictorDecompress3950toCurrent@@6B@__ehhandler$??1CPredictorDecompress3950toCurrent@@UAE@XZ?Flush@CPredictorDecompress3950toCurrent@@UAEHXZ?DecompressValue@CPredictorDecompress3950toCurrent@@UAEHHH@Z??0?$CRollBufferFast@H$0CAA@$09@@QAE@XZ??0?$CRollBufferFast@H$0CAA@$08@@QAE@XZ??0?$CRollBufferFast@H$0CAA@$07@@QAE@XZ??0CPredictorCompressNormal@@QAE@H@Z__ehhandler$??0CPredictorCompressNormal@@QAE@H@Z??_GCPredictorCompressNormal@@UAEPAXI@Z??0CPredictorDecompress3950toCurrent@@QAE@HH@Z__ehhandler$??0CPredictorDecompress3950toCurrent@@QAE@HH@Z??_GCPredictorDecompress3950toCurrent@@UAEPAXI@Z/50 1084342673 100666 6881 ` L‘Á¡@o.drectveZL .debug$S{¦@B.text !* P`.rdata04d @0@.debug$FÜì@B.textöý P`.debug$F@B.text!@ P`.debug$FTd@B.text;n©  P`.rdata0· ç @0@.debug$FÐ_ / @B.text± P`.debug$F´ Ä @B.text$Î ò  P`.debug$Fü @B.text$ :  P`.debug$FD T @B.text:^ ˜  P`.debug$F¢ ² @B.text¼ Ú  P`.debug$Fî þ @B.text P`.debug$F!1@B.text$x$;_ P`.xdata$xH›ã@0@.sxdata 0/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ; „t4e:\Mac_sdk_399_4\Source\MACLib\Release\WinFileIO.obj8   !Microsoft (R) Optimizing Compiler‹ÁÇà        $ ( ,   ÇÃöD$V‹ñÇt VèƒÄ‹Æ^ ‹ÑW3À¹AzÇÇBÿÿÿÿ󫉂‹Â_ÃÌÌÌÌÌÌÌÌÌÌV‹ñ‹FƒøÿtPÿÇFÿÿÿÿ3À^ÃÌÌÌQS‹\$…ÛUVW‹|$ ¸‹éÇD$‹ó‰~7ƒ?v2…Àt.‹D$‹MjW+ÆVÃPQÿƒøu‹‹T$+ñщT$…öÉ‹T$3É…À•Á‰_^][Iáè‹ÁY ÌÌÌÌÌÌÌ‹D$‹IV‹t$W‹|$jVWPQÿ…Àt 9>u_3À^ _¸é^ ÌÌÌÌÌÌÌÌÌÌ‹D$‹T$P‹AjRPÿ3ÀÂÌÌÌÌÌ‹APÿ÷ØÀ÷ØHÃÌÌÌÌÌÌÌÌÌÌÌÌÌÌ‹AjjjPÿÃÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌ‹AjPÿÃÌÌÌ‹D$ƒÁQPèƒÄ3ÀÂÌÌÌÌÌÌÌÌÌÌV‹ñ‹FƒøÿÇtPÿÇFÿÿÿÿÇ^ÃÌÌÌÌÌÌÌÌÌd¡jÿhPd‰%ƒì SV‹ñ‹WÿP‹|$(‹jh€jjjhÀWÿÓƒøÿ‰Fu?jh€jjjh€WÿÓƒøÿ‰Fu_^ À[‹L$ d‰ ƒÄÂdžë džWƒÆVè‹L$ ƒÄ_^3À[d‰ ƒÄÂÌÌÌÌÌÌÌÌÌÌÌd¡jÿhPd‰%ƒì V‹ñ‹WÿP‹|$$jh€jjjhÀWÿƒøÿ‰Fu_ À^‹L$ d‰ ƒÄÂdžWƒÆVè‹L$ƒÄ_3À^d‰ ƒÄÂÌÌÌÌÌÌÌÌÌV‹ñ‹ÿPFPÿ÷ØÀ÷ØH^Ã)>-/é1"365\3x8Š:«)´-ÁÒeÙ_áeø^Beh:{e’e™j¡eÊ^áeû: e.n%Z, .02hm 4$6(7,9&y6  'µ‡#, .00@2P4`6p7€9E Z°hÀm‹Ã=V‹ñ‹F…Àt‹…Àt‹NPèƒÄÇ^Ã$BV‹ñ‹F…Àt‹…Àt‹NPèƒÄÇ^Ã$HV‹ñ‹F…Àt‹…Àt‹NPèƒÄÇ‹D$‹L$ ‹T$‰F‰N‰^ :MV‹ñèöD$t VèƒÄ‹Æ^ÂE$‹T$‹Á‹L$ ‰H‹L$‰P‰ WMèé¸éMèé¸éH c`Hk `ÿÿÿÿ “ÿÿÿÿ “]d(i4l_j.fileþÿg\Mac_sdk_399_4\Source\Shared\WinFileIO.cpp@comp.id `ÿÿ@feat.00ÿÿ.drectveZ.debug$S{.text 4ëÛY   1 i.rdata0 D.debug$F.textªá‹ÀQ .debug$F.text»Hóš` s .debug$F .text ;ãv¡Ó€ – ° i$.rdata 0 Ê .debug$F Ð Þ0 ø P -@Ð au ©0 ÄÚP úp +€ _wcscpy .text *VöJ .debug$F .text$&.OÖe .debug$Fƒ  .text$&.OÖ™ .debug$F.text:¼’V² .debug$F.textN)¬œÕ .debug$F.textJh qï .debug$F Ð .text$x$þƒ*7$L74902 )? g .xdata$xH]…1$T74984$T74987z.sxdata ö؈ $L74992 ¦ $T75069,$T75071$Ð  ë??0CIO@@QAE@XZ__purecall??_GCIO@@UAEPAXI@Z??_ECIO@@UAEPAXI@Z??_7CIO@@6B@??1CIO@@UAE@XZ??_GCIO@@UAEPAXI@Z??3@YAXPAX@Z??0CWinFileIO@@QAE@XZ??_GCWinFileIO@@UAEPAXI@Z??_ECWinFileIO@@UAEPAXI@Z??_7CWinFileIO@@6B@?Close@CWinFileIO@@UAEHXZ__imp__CloseHandle@4?Read@CWinFileIO@@UAEHPAXIPAI@Z__imp__ReadFile@20?Write@CWinFileIO@@UAEHPBXIPAI@Z__imp__WriteFile@20?Seek@CWinFileIO@@UAEHHI@Z__imp__SetFilePointer@16?SetEOF@CWinFileIO@@UAEHXZ__imp__SetEndOfFile@4?GetPosition@CWinFileIO@@UAEHXZ?GetSize@CWinFileIO@@UAEHXZ__imp__GetFileSize@8?GetName@CWinFileIO@@UAEHPAG@Z??B?$CSmartPtr@G@@QBEPAGXZ?Delete@?$CSmartPtr@G@@QAEXXZ??1CWinFileIO@@UAE@XZ??1?$CSmartPtr@G@@QAE@XZ?Assign@?$CSmartPtr@G@@QAEXPAGHH@Z??_GCWinFileIO@@UAEPAXI@Z??0?$CSmartPtr@G@@QAE@PAGHH@Z?Open@CWinFileIO@@UAEHPBG@Z__imp__CreateFileW@28__ehhandler$?Open@CWinFileIO@@UAEHPBG@Z___CxxFrameHandler__except_list?Create@CWinFileIO@@UAEHPBG@Z__ehhandler$?Create@CWinFileIO@@UAEHPBG@Z?Delete@CWinFileIO@@UAEHXZ__imp__DeleteFileW@4 /74 1084342673 100666 500 ` L‘Á¡@< .drectveZd .debug$S~¾@B/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" > „t7e:\Mac_sdk_399_4\Source\MACLib\Release\StdLibFileIO.obj8   !Microsoft (R) Optimizing Compiler.fileþÿg\Mac_sdk_399_4\Source\Shared\StdLibFileIO.cpp@comp.id `ÿÿ@feat.00ÿÿ.drectveZ.debug$S~/101 1084342674 100666 6923 ` L ’Á¡@Ä!.drectveZ| .debug$SyÖ@B.rdataO@@@.textrOÁ; P`.debug$F0?@B.data ]h@0À.xdata$xrŽ@0@.xdata$x˜ @0@.xdata$xªº@0@/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" 9 „t2e:\Mac_sdk_399_4\Source\MACLib\Release\Prepare.obj8   !Microsoft (R) Optimizing Compiler–0w,aîºQ ™Ämôjp5¥c飕dž2ˆÛ¤¸ÜyéÕàˆÙÒ—+L¶ ½|±~-¸ç‘¿d·ò °jHq¹óÞA¾„}ÔÚëäÝmQµÔôÇ…ÓƒV˜lÀ¨kdzùbýìÉeŠO\Ùlcc=úõ È n;^iLäA`Õrqg¢Ñäjm ¨Zjz Ïäÿ “'® ±ž}D“ðÒ£‡hòþÂi]Wb÷Ëge€q6lçknvÔþà+Ó‰ZzÚÌJÝgoß¹ùùホC¾·Õް`è£ÖÖ~“Ñ¡ÄÂØ8RòßOñg»ÑgW¼¦Ýµ?K6²HÚ+ ØL ¯öJ6`zAÃï`ßUßg¨ïŽn1y¾iFŒ³a˃f¼ Òo%6âhR•w ÌG »¹"/&U¾;ºÅ( ½²’Z´+j³\§ÿ×Â1Ïе‹žÙ,®Þ[°Âd›&òc윣ju “m© œ?6ë…grW‚J¿•z¸â®+±{8¶ ›ŽÒ’ ¾Õå·ïÜ|!ßÛ ÔÒÓ†BâÔñø³ÝhnƒÚ;[&¹öáw°owG·æZˆpjÿÊ;f\ ÿžei®bøÓÿkaEÏlxâ  îÒ ×TƒN³9a&g§÷`ÐMGiIÛwn>JjÑ®ÜZÖÙf ß@ð;Ø7S®¼©Åž»ÞϲGéÿµ0ò½½ŠÂºÊ0“³S¦£´$6к“×Í)WÞT¿gÙ#.zf³¸JaÄh]”+o*7¾ ´¡Ž ÃßZï-Q‹L$…ÉW„r‹|$…ÿ„f‹D$ ‹T$$Çÿÿÿÿ‹D$ÇS·_ ™÷ûUVƒÎÿ‹Øf‹Gf=f‹… fƒÿ…©…ÛŽ÷‹l$$‹D$(+ʼnD$$‰\$(¶¶y‹Öâÿ3ÐX€‹•¶QÁî3ðï€A‹Æ%ÿ3‹…Áî3ò‹Ç™3Â+‹T$4A;~‰‹Ã™3Â+‹T$4;~‰‹T$$‹Ç+É*™+ÂÑøÉE‹D$(ƒÅH‰D$(…vÿÿÿéVfƒÿ…L3í…ÛŽB›¶‹Öâÿ3Ðx€‹•Áî3ð‹Ç™3Â+‹T$4A;~‰‹D$$‰<¨E;ë|Æéýf=…fƒÿ…]…ÛŽá‹D$$‹T$(+Ћè‰T$$‰\$(¶‹Öâÿ3Ћ<•¶QÁî3÷A‹úÁç Ç‹þçÿ3ú‹½¶QÁî3óA‹úÁç Ç‹þçÿ3ú‹½Áî3óA©€‹Öt %ÿÿ-€ë%ÿÿ‹òæÿ‹Ø¶3ð‹<µ¶qÁê3×A‹þÁç Ç‹úçÿ3þ‹4½Áê3Ö¶qA‹þÁç Ç‹úçÿ3þ‹4½Áê3ÖA©€‹òt %ÿÿ-€ë%ÿÿ‹ø™3Â+‹T$4;~‰‹Ã™3Â+‹T$4;~‰‹T$$‹Ç+É*™+ÂÑøÉE‹D$(ƒÅH‰D$(…ÅþÿÿéŒfƒÿ…‚3í…ÛŽx¶‹Öâÿ3Ћ<•¶QÁî3÷A‹úÁç Ç‹þçÿ3ú‹½Áî3ò¶QA‹úÁç Ç‹þçÿ3ú‹½Áî3òA©€t %ÿÿ-€ë%ÿÿ‹ø™3Â+‹T$4;~‰‹D$$‰<¨E;ëŒiÿÿÿéÜfƒÿ…P3Ò3À…Û‰T$‰D$ ŽÝ‹l$$‹D$(+ʼnD$$‰\$¶¿9‹Öâÿ3Ћ•¶AÁî3óA‹Öâÿ3Ћ•¶AÁî3ó¿YA‹Öâÿ3Ћ•Áî3ð¶AA‹Öâÿ3Ћ•Áî3ð‹Ã™3Â+‹T$A;Â~‰D$‹Ç™3Â+Â;D$ ~‰D$ ‹T$$‹Ã+lj*™+ÂÑøljE‹D$ƒÅH‰D$…Cÿÿÿ‹D$‹Ð…À‹D$ u‹L$0ƒ …À‹\$0uƒ ;ЋÊ‹È‹|$4;~;Ð~‹Â‰‹|$(‹3É…À…§‹D$™ƒâÂÁøA;Èt ƒ<tõ銃 é‚fƒÿu|3í…Û‰l$(~]›¶¿9‹Æ%ÿ3‹…Áî3ò¶QA‹Æ%ÿ3‹…Áî3ò‹Ç™3Â+ÂA;Å~‹è‹D$(‹T$$‰<‚@;ÉD$(|©‹D$4;(~‰(…íu‹D$0ƒ‹D$0‹÷ÖÑî…Ét΀‹L$,‰1^][3À_Y ¸ˆ_Y ÌÌÌÌÌÌ‹D$ f‹HfƒùSVW…{f‹@f=U…á‹L$‹Á™+‹ЋD$Ñú+Â=€ÿÿ4Œ©=ÿžþ€ÿÿŒ’þÿ†‹T$$‹L$ f‰¶‹‹øçÿÁè3û3½‰¶Y‹øAÁèçÿ3û3½‰f‰q‹2¶yA‹Æ%ÿ3Ç‹…Áî3Ɖ¶I‹ðæÿ3΋4Áè3Ɖ]_^[ÂhT$RÇD$ÿÿÿÿèf=ug‹\$‹t$ ‹Ã™+‹T$$‹ÈŠD$Ñù*Á€ˆ‹ ‹ù¶èçÿ3ý‹,½Áé3͉ FŠËȈ‹‹ð¶Éæÿ3ñ‹ µ]_Áè3Á^‰[Âf=…kÿÿÿ‹L$‹Á™+‹T$Ñø+Ð< y €ʀ‹D$$‹L$ ˆ‹0‹ÞãÿÁî¶ê3Ý34‰0‹ÚÁëˆY‹0A‹î¶Ûåÿ3ë‹­Áî3ó‰0ÁêAˆ‹0‹Þãÿ¶Ò3Ú‹,Áî3õA…ÿ‰0}—€Ê€ë‹×ˆ‹0‹þçÿ¶Ú3û‹½Áî3ó‰0‹ÚÁëˆY‹0A‹þ¶Ûçÿ3û‹½Áî3ó‰0AÁꈋ‹ñ¶Òæÿ3ò‹µ]_Áé3Ê^‰[Âfƒù…Nþÿÿf‹@f=uN‹T$‹t$ f‹D$f‰‹¶:‹Á%ÿ3Ç‹…Áé3Á‰¶J‹Ðâÿ3Ê‹Áè3Â_‰^[Âf=u4ŠL$‹D$‹T$ €Á€ˆ‹‹ð¶Éæÿ3ñ‹ µ_Áè3Á^‰[Âf=…²ýÿÿ‹T$…Ò} €ʀ‹L$ ‹t$ˆ‹‹øçÿ¶Ú3û‹½Áè3ÉF‹ÚÁ눋‹ø¶Ûçÿ3û‹½Áè3ÉFÁꈋ‹ð¶Òæÿ3ò‹µ_Áè3Â^‰[ÂÌ‹T$f‹BSUVƒÉÿf=W…:f‹Rfƒú…Æ‹|$‹D$‹t$$‡;ø‰D$ƒÏ‹\$+ß‹;™+‹Ðf‹Ñúf+Âf‰‹Ñâÿ¶è3Õ‹,•Áé3ͶnF‹Ñâÿ3Õ‹,•f‹;fÐÁé3ÍFf‰‹Á%ÿ¶Ò3‹…Áé3ʶVF‹Á%ÿ3‹…‹D$Áé3ʃÇF;ø‚lÿÿÿ‹D$(_^÷Ñ]‰3À[ fƒú…‹D$0‹t$$=ö‹D$Ž‚…ÀŽû‹|$‹l$+ï‰D$‹™+‹Њ/Ñú*€¶Øˆ‹Ñâÿ3Ó‹•ŠÐÁé3ˈV‹Á¶Ò%ÿ3‹…‹D$Áé3ʃǃÆH‰D$u¥‹D$(_^÷Ñ]‰3À[ …ÀŽy‹|$‹l$+ï‰D$‹™+‹Њ/Ñú*¶؈‹Ñâÿ3Ó‹•ŠÐÁé3ˈV‹Á¶Ò%ÿ3‹…‹D$Áé3ʃǃÆH‰D$u§‹D$(_^÷Ñ]‰3À[ fƒú…÷‹D$…À‹t$$Žç‹l$‹\$+ë‰l$‰D$ë‹l$‹;‹Ç™+‹+Ñø+Ð<y €ʀ‹Á%ÿˆ¶ê3Å‹,…Áé3Í‹ÂÁèˆFF‹é¶Àåÿ3è‹­Áé3ÈÁêFˆ‹Ááÿ¶Ò3Ê‹,Áè3ÅF…ÿ}€É€ë‹Ï‹Ðâÿˆ¶ù3׋<•Áè3Ç‹ÑÁêˆVF‹ø¶Òçÿ3ú‹,½Áè3ÅÁéFˆ‹Ð¶Éâÿ3Ñ‹,•Áè3ŋȋD$FƒÃH‰D$…üþÿÿ‹D$(_^÷Ñ]‰3À[ f=…´f‹Rfƒú…ª|$0ö‹t$~O3À…öŽŽ‹|$$‹\$ëIŠƒ€Â€ˆ8‹é¶Òåÿ3ê‹­Áé3Ê@;Æ|Ù‹D$(_^÷Ñ]‰3À[ 3À…öŽ?‹|$$‹\$›Šƒˆ8‹é¶Òåÿ3ê‹­Áé3Ê@;Æ|Ü‹D$(_^÷Ñ]‰3À[ fƒú‹D$$…˜‹|$3ö…ÿŽà‹T$‹²…Ò} €ʀ‹Ùãÿˆ¶ê3Ý‹,Áé3Í‹ÚÁëˆX@‹é¶Ûåÿ3ë‹­Áé3ËÁê@ˆ‹Ùãÿ¶Ò3Ú‹Áé3Ê@F;÷|‡‹D$(_^÷Ñ]‰3À[ ‹t$3Ò…ö~L‹|$¤$f‹—f‰¶(‹Ùãÿ3Ý‹,Áé3Ͷh@‹Ùãÿ3Ý‹,Áé3Í@B;Ö|¿‹D$(_^÷Ñ]‰3À[Â Ž ® 3   Â ä  < ^ ô  8 Ã Þ ý     3 P l ‘Ì ð M n ‘ Å ë  U q « ö  > » Ö ù  – µ  5  ä  3 U t ù F ª Ì ë 7 R Š¿"  .Hÿÿÿÿ .fileþÿg.\Prepare.cpp@comp.id `ÿÿ@feat.00ÿÿ.drectveZ.debug$Sy.rdata=1z€.textr;Y·’@ .debug$F0J €.data ç®s ??_R0H@8.xdata$xMG»–“.xdata$xžªÌ__CTA1H$L74899O .xdata$x __TI1H ¡ ·P  õ_CRC32_TABLE?Prepare@CPrepare@@QAEHPBEHPBUtWAVEFORMATEX@@PAH2PAI22@Z?Unprepare@CPrepare@@QAEXHHPBUtWAVEFORMATEX@@PAEPAI@Z??_7type_info@@6B@__CT??_R0H@84__CxxThrowException@8?UnprepareOld@CPrepare@@QAEHPAH0HPBUtWAVEFORMATEX@@PAEPAI0H@Z /123 1084342674 100666 3831 ` L’Á¡@ì .drectveZÜ .debug$Su6@B.text «H  P`.debug$F@„ Ä @B.bss@€@À/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" 5 „t.e:\Mac_sdk_399_4\Source\MACLib\Release\MD5.obj8   !Microsoft (R) Optimizing Compiler‹D$3ɉH‰HÇ#EgÇ@‰«ÍïÇ@þܺ˜Ç@ vT2ÃÌÌÌÌÌÌÌÌ숅ɋ„$ŒS‹Z U‹j‰l$„ V‰L$W¨t‹ð¹|$Xó¥D$X‹z‹‹ó3÷#õ3óñ‹Î‹2´x¤j׋ÎÁæÁé ΋pÍ‹ß3Ý#Ù3ßÞ‹ó‹Z œ3V·Çè‹óÁã Áî ó‹Ý3Ùñ#Þ3ÝXœÛp $‹ûÁãÁï û‹X þ‹î3é#ï3éë‹\$¬+îνÁ‹ÝÁí Áã Ýß‹î3ï#ë3î‰\$hŒ)¯|õ‹ÙÁáÁë Ù‹L$Ù‹ï3é‹H#ë3ïé´.*ƇG‹ÎÁéÁæ ΋t$Ë‹î3ë#é3îh¼/F0¨‹÷ÁçÁî ÷‹xñ‹é3ë#î3ëï‹|$¬/•Fý‹ýÁí Áç ýþ‹é3î#ï3é‰|$‹x ïœ+ؘ€i‰|$$‹ûÁã‹îÁï û‹\$3ëû‹X$#ï3îëŒ)¯÷D‹‹ÙÁá Áë Ù‹L$‹é3ïß#ë3éh(´.±[ÿÿ‹ÎÁæÁé ΋p,‹ë3ïË#é3ïî‹t$¬.¾×\‰‹õÁæÁí õñ‰t$‹ë3é#î3ëh0¼/"k‹÷ÁîÁç ÷‹|$÷‹é3ï‹x4#î3éï‹x8œ+“q˜ý‹ëÁã Áí ëî‰|$‹|$‹ß3Þ#Ý3ß\$ŒŽCy¦‹ùÁá‹Ý3ÞÁï ù‹H<ý#ß3ÞÙ‹L$œ!´I‹ËÁë Áá Ëωl$‹ß3Ù#Ý‹h3ßÝ‹h´b%ö‹ÞÁæÁë ÞÙ‹ñ3ó#÷3ñõ‹l$¬.@³@À‹õÁîÁå õó‰t$3ó‹h,#ñ3óõ¼7QZ^&‹÷ÁîÁç ÷‹|$÷‹ï3î#ë3ï(Œ)ªÇ¶é‹l$‹ùÁé Áç ùþ‹Î3Ï#Í‹h3ÎÍ‹h(œ ]/Ö‹ËÁãÁé ËÏ‹ß3Ù#Þ3ßÝ‹l$¬+SD‹ÝÁå Áë ÝÙ‹ë3é#ï3éh<´.æ¡Ø‹îÁæÁí îë‰l$‹ó3õ‹h#ñ3óõ¼7ÈûÓç‹÷Áï Áæ ÷‹|$÷‹ï3î#ë3ïh$Œ)æÍá!‹l$‹ùÁáÁï ùþ‹Î3Ï#Í‹h83ÎÍœ Ö7Ëh ‹ËÁã Áé ËÏ‹Ù3ß#Þ3ßÝ‹l$¬+‡ Õô‹ÝÁåÁë ÝÙ‹é3ë#ï3é‰\$h ´.íZE‹ÞÁî Áã Þ‹t$Þ‹î3ë#é3îh4¼/éã©‹÷ÁçÁî ÷‹|$ó‹ë3î#ï‹x3ëïŒ)ø£ïü‹h‰|$T‹ùÁá Áï ùþ‹Ï3Î#Ë3ÎÍ‹l$¬)Ùog‹ÍÁéÁå ÍÏ‹ï3é‰L$‹H0‰l$#î3ïéœ+ŠL*‹h‹ËÁë Áá ËL$‹\$3ÙÝ´B9úÿ‹ÞÁæÁë Þ‹t$3ñÙ3ó‰l$Dp ¼7öq‡‹p,‹ïÁç Áí ïë‰t$H‹ý3ù3ûþ‹t$´>"am‹þÁæÁï þý‹õ3÷‰t$3óp8‰|$Œ1 8åý‹ñÁé Áæ ñ‹L$÷‹x3ÎÏœ D꾤‹ËÁãÁé Ë‹\$‰|$<‹xÎ3Þ3Ù‰|$@߬+©ÏÞK‹ýÁå ‹XÁï ýù‰\$,‹ï3î3éë‹\$¬+`K»ö‹ÝÁåÁë Ý߉\$‹ï3ë‹X(‰l$3éë‰\$ œ.p¼¿¾‹h4‹óÁë Áæ ót$‹\$3ÞÝœÆ~›(‰l$8‹l$‹Ë3îÁãÁé Ë‹Î3éë¼/ú'¡ê‰\$L‹ßÁç Áë ß‹x Ù‹ë3î3éï‰|$4‹|$¬/…0ïÔ‹ýÁïÁå ýû‹ë3ï‰|$‹x‰l$3éï‰|$0¼.ˆ‹÷‹h$Áï Áæ ÷t$‹|$3þý¼99ÐÔÙ‹ÏÁéÁç Ï‹x0΋@<‰l$P‹l$3î3éïœ+å™Ûæ‰|$‹ûÁã Áï ûù‹l$T‹ß3Þ3Ù؉D$(‹D$„ø|¢‹ØÁàÁë Øß‹Ç3Ã3ÁÅ´eV¬Ä‹ÆÁî Áà Æ‹÷÷Öà ð3ót$LŒ1D")ô‹ñÁáÁî ñð‹Ë÷Ñ Î3ÈL$,¼—ÿ*C‹ÏÁç Áé Ï‹ø÷×Î ù3þ|$œ;§#”«‹ûÁãÁï ûù‹Þ÷Ó ß3Ù\$Dœ9 “ü‹ÃÁë Áà ÃÇ‹Ù÷Ó Ø3ß\$œÃY[e‹óÁãÁî óð‹ß÷Ó Þ3Ø\$4œ’Ì ‹ËÁã Áé Ë΋Ø÷Ó Ù3Þ\$ œ}ôïÿ‹ûÁãÁï ûù‹Þ÷Ó ß3Ù\$<œÑ]„…‹ÃÁë Áà ËÙ÷ÓÇ Ø3ß\$$œO~¨o‹óÁãÁî ó‹ß÷Óð Þ3Ø\$(œàæ,þ‹ËÁéÁã Ë΋Ø÷Ó Ù3Þ\$0œC£‹ûÁãÁï ûù‹Þ÷Ó ß3Ù\$8œ¡N‹ÃÁë Áà ÃÇ‹Ù÷Ó Ø3ß\$@œ‚~S÷‹óÁãÁî óð‹ß÷Ó Þ3Ø\$HŒ5ò:½‹ÙÁá Áë ÙÞ‹È÷Ñ Ë3ÎÍ‹l$P¼»Ò×*‹ÏÁçÁé Ï‹þ÷×Ë ù3ûý‹*î„8‘Ó†ë‹z ‹ðÁæÁè ð‹B‰*rñÁ‹îû‰l$‰j‰B‰z ‹„$œ‹L$ƒÀ@I‹ß‰„$œ‰L$…ûöÿÿ_^][ĈÃÌÌÌÌÌÌÌÌÌ‹T$‹JSU‹l$‹ÁVÁè é4íƒà?;ÎW‰JsÿB‹z‹ÍÁé»@ù+Ø;ë‰zrH‹t$|‹Ë‹ÁÁéó¥‹Èƒáó¤JQ¹è‹D$‹õ +óÁîQ‹ÎèÁæƒÄó3Àë3ö‹|$‹Í+Î÷|‹ÑÁéó¥‹Êƒáó¤_^][ÃÌ̃ìW‹|$‹GÁèÆ€‹O‹W‰L$3Ƀà?ƒø8Á‰T$IƒáÀƒÁx+ÈQhWèjT$RWè‹L$(‹Ç‹‰‹P‰Q‹P‰Q‹@ ‰A ƒÄ¹3Àó«_ƒÄÃÕ ë 0 Y _ l (7 "®#}   0.fileþÿg.\MD5.cpp@comp.id `ÿÿ@feat.00ÿÿ.drectveZ.debug$Su.text ös[÷ .debug$F@ 0 >p  `  .bss@€µ?MD5Init@@YAXPAUMD5_CTX@@@Z?__MD5Transform@@YAXQAIPBEH@Z?MD5Update@@YAXPAUMD5_CTX@@PBEI@Z?MD5Final@@YAXQAEPAUMD5_CTX@@@Z?finalBlock@?1??MD5Final@@YAXQAEPAUMD5_CTX@@@Z@4PAEA /141 1084342674 100666 2640 ` L ’Á¡@µ).drectveZ| .debug$SƒÖ@B.text#Y| P`.rdataêî@0@.debug$F@ø8@B.rdata`@0@.rdatad@0@.texth‡ P`.debug$F›«@B/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" C „tt P`.debug$F’¢@B/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" > „t7e:\Mac_sdk_399_4\Source\MACLib\Release\CircleBuffer.obj8   !Microsoft (R) Optimizing Compiler‹Á3ÉljH‰H‰H‰H‰H ‰HÃÌÌÌV‹ñ‹F…ÀÇtPèƒÄÇF^ÃÌÌÌÌÌÌÌÌÌÌÌÌÌÌV‹ñ‹F…ÀtPèƒÄÇF‹D$ ‹L$‰FDP‰Fè‹VƒÄ‰FÇFÇF‰V ^‹Q‹A;Ð|V‹q+q+òDÿ^Ã+ÂHÃÌÌÌ‹QV‹q;Ö|+Ö‹Â^ËA +ÆÂ^ÃÌÌÌÌÌÌ3À‰A‰A‹A‰A ÃÌS‹YVW‹y‹×+Ó;û|‹òë‹q ò‹D$;ð} ;û|‹Âë‹A ‹Y‹q Ø‹Ó;Ö‰Y|+Ö‰Q_^[ÂÌÌÌÌÌS‹YVW‹y‹×+Ó;û|‹òë‹q ò‹D$;ð} ;û|‹Âë‹A ‹Q+ЉQy‹q ò‰q_^[ÂÌÌÌÌÌÌÌÌÌSW‹|$ 3À…ÿ‹Ùtc‹L$…É~[‹S U‹k+Õ;ÑV|‹Ñ‹s‹Áõ‹Ê‹éÁéó¥‹Íƒá+Â…Àó¤‹ò~‹|$‹s‹È‹éÁéúó¥‹Íƒáó¤4‹D$P‹Ëè‹Æ^]_[Â*2\~ù"PKGv   0@P`p€#V‹ñ‹F…ÀÇtPèƒÄÇFöD$t VèƒÄ‹Æ^ )6 .fileþÿg\Mac_sdk_399_4\Source\Shared\CircleBuffer.cpp@comp.id `ÿÿ@feat.00ÿÿ.drectveZ.debug$S~.text5ýí  : i .rdataW.debug$F n  ‡ ”P º Ç  åÀ à  ð C@ .text6bÛf .debug$Fƒ ¢??0CCircleBuffer@@QAE@XZ??_GCCircleBuffer@@UAEPAXI@Z??_ECCircleBuffer@@UAEPAXI@Z??_7CCircleBuffer@@6B@??1CCircleBuffer@@UAE@XZ??3@YAXPAX@Z?CreateBuffer@CCircleBuffer@@QAEXHH@Z??2@YAPAXI@Z?MaxAdd@CCircleBuffer@@QAEHXZ?MaxGet@CCircleBuffer@@QAEHXZ?Empty@CCircleBuffer@@QAEXXZ?RemoveHead@CCircleBuffer@@QAEHH@Z?RemoveTail@CCircleBuffer@@QAEHH@Z??_GCCircleBuffer@@UAEPAXI@Z?Get@CCircleBuffer@@QAEHPAEH@Z/230 1084342675 100666 2057 ` L“Á¡@;.drectveZ´ .debug$S@B.text„ P`.debug$F`Ÿÿ@B/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" A „t:e:\Mac_sdk_399_4\Source\MACLib\Release\CharacterHelper.obj8   !Microsoft (R) Optimizing CompilerSU‹l$ …íVWt UèƒÄë3À{Wè‹Ï‹Ñ‹ðÁé3À‹þó«‹ÊƒáƒÄ…íóªtjjSVjÿUjjÿ_‹Æ^][ÃÌÌÌÌSU‹l$ …íVt‹ÅPŠ@„Éuù+‹Øë3ÛW|Wè‹Ï‹Ñ‹ðÁé3À‹þó«‹ÊƒáƒÄ…íóª_tSVjÿUjjÿ‹Æ^][ÃÌÌÌUV‹t$ Š3Ò„ÀWt ‹ÎŠ„ÀxAë$à<àuƒÁëƒÁŠB„ÀuâDPè‹èŠƒÄ3É3ÿ„ÀteŠ1„Òx f¶Òf‰T}AëJŠÂ$à<àŠD1u$$?f¶Òf¶ÀÁâ ŠT1€â?f¶ÒÁà ƒÁë€â?$?f¶Òf¶ÀÁâ ƒÁf‰D}Š1G„Àu›fÇD}_^‹Å]ÃÌÌÌÌÌÌUVW‹|$Wè‹èƒÄ3Ò3É…í~&›f‹Of=€sBëf=sƒÂëƒÂA;Í|àBRèƒÄ3É3Ò…í‹ð~Nf‹Wf=€së9f=s 3Àf‹WÁè Àëf‹WfÁè àˆ13Àf‹WAÁè$? €ˆ1ŠW$?A €ˆ1AB;Õ|²_Æ1‹Æ^]ÃÌÌÌÌ‹D$VWPè‹ðVèV‹øèƒÄ ‹Ç_^ÃÌÌÌÌÌÌÌÌÌÌÌÌ‹D$VWPè‹ðVèV‹øèƒÄ ‹Ç_^Ã!Q †³õ‰Ã8@ Hhpx\ ] º ¬$$  0@P.fileþÿg\Mac_sdk_399_4\Source\Shared\CharacterHelper.cpp@comp.id `ÿÿ@feat.00ÿÿ.drectveZ.debug$S.text„²çuü "@ _wcslen .debug$F`M` k‰À §€ Å0 â ï`  ?GetANSIFromUTF16@@YAPADPBG@Z__imp__WideCharToMultiByte@32??2@YAPAXI@Z?GetUTF16FromANSI@@YAPAGPBD@Z__imp__MultiByteToWideChar@24?GetUTF16FromUTF8@@YAPAGPBE@Z?GetUTF8FromUTF16@@YAPAEPBG@Z?GetANSIFromUTF8@@YAPADPBE@Z??3@YAXPAX@Z?GetUTF8FromANSI@@YAPAEPBD@Z /260 1084342675 100666 8875 ` L “Á¡@Š~.drectveZ .debug$S€n@B.rdata î@0@.text ø P`.rdata @0@.debug$FEU@B.text _j P`.debug$Ft„@B.textŽ• P`.debug$FŸ¯@B.text¹Ø P`.debug$Fìü@B.text P`.debug$F&@B.textN0~ P`.debug$Fˆ˜@B.text¢ P`.debug$F¥µ@B.text¿ P`.debug$FÂÒ@B.text'Ü, P`.debug$Fp»+@B.textqv P`.debug$F€@B.text šº P`.debug$FÄÔ@B.text$xlÞJ P`.rdataàð@0@.xdata$x¨À @0@.sxdata.0.text>\ P`.debug$Fp€@B/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" @ „t9e:\Mac_sdk_399_4\Source\MACLib\Release\WAVInputSource.obj8   !Microsoft (R) Optimizing Compiler.wav‹ÁÇ  ‹ÁÇ ÇÃöD$V‹ñÇt VèƒÄ‹Æ^ %‹ÁÇ@ÇÃ*V‹ñ‹F…ÀtB‹…Ét<‹F…Àt)‹Qü…ÒAüt‹jÿÇ^ÃPèƒÄÇ^ËjÿÇ^Ã1%N/‹Ã4‹Ã9U‹ìƒäøƒì$SVW‹ñ‹N‹jjÿP‹N‹ÿR(jL$‰F0‹FQPèƒÄ …À…߀|$R…Ï€|$I…ÄŠL$°F:È…¶8D$…¬‹FjT$RPèƒÄ …À…–‹D$ taƒj‰a‘a§ZÜióh/(/C>ËaãoéañaÿZ/!a2a9vAaUufu‚ ˆt iÐdÛaüaa`pvþ U I÷AD E0P@dPm`ré/HV‹ñè‹D$‹L$ ‹T$‰F‰N‰^ / M‹Mðé‹MðƒÁé¸é‹Mðé‹MðƒÁé‹EPèYøé‹Mðé¸é‹EPèYøéH_\!,H5%<kA\INpS\\%cwh\RAD Eÿÿÿÿ “ÿÿÿÿ “ÿÿÿÿ “ÿÿÿÿ “W V`0g8f@eLldnpqˆs”x[jovV‹ñèöD$t VèƒÄ‹Æ^Âm%Q.fileþÿg.\WAVInputSource.cpp@comp.id `ÿÿ@feat.00ÿÿ.drectveZ.debug$S€.rdata Uˆýz$SG74990.text ²c+ < G c i.rdata.debug$F.text ²c+• .debug$F.text ªá‹ÀÈ .debug$F  .text »Hóšà ü .debug$F  .text ..~í  .debug$F .textN³z`' .debug$F.text*VöJ .debug$F.text*Vöo .debug$F.text',¨­” » Ð í0 .debug$Fp ? .text®¥Ä%n .debug$F.text ‚µNËŒ .debug$F¹€ ô  iQ.text$xlYTzð$L75402 $L75401 .rdata2K ’ .xdata$x¨ ƒmµ$T75417$T75422¥.sxdataç*x³€ $L754310 $L75430% $L75429 é ÿ  ; $T75448D$T75453,Nà $L75455E iM $T75464h$T75466`0 $L75472W _wcsicmp _wcslen Õb $T75474Œ$T75478„.textN)¬œ& .debug$F E??0CInputSource@@QAE@PAVCIO@@PAUtWAVEFORMATEX@@PAH222@Z__purecall??_GCInputSource@@UAEPAXI@Z??_ECInputSource@@UAEPAXI@Z??_7CInputSource@@6B@??0CInputSource@@QAE@PBGPAUtWAVEFORMATEX@@PAH222@Z??1CInputSource@@UAE@XZ??_GCInputSource@@UAEPAXI@Z??3@YAXPAX@Z??0?$CSmartPtr@VCIO@@@@QAE@XZ?Delete@?$CSmartPtr@VCIO@@@@QAEXXZ??B?$CSmartPtr@VCIO@@@@QBEPAVCIO@@XZ??C?$CSmartPtr@VCIO@@@@QBEPAVCIO@@XZ?AnalyzeSource@CWAVInputSource@@AAEHXZ_FillWaveFormatEx@16?ReadSafe@@YAHPAVCIO@@PAXH@Z?GetData@CWAVInputSource@@UAEHPAEHPAH@Z?GetHeaderData@CWAVInputSource@@UAEHPAE@Z?GetTerminatingData@CWAVInputSource@@UAEHPAE@Z??1?$CSmartPtr@VCIO@@@@QAE@XZ?Assign@?$CSmartPtr@VCIO@@@@QAEXPAVCIO@@HH@Z??0CWAVInputSource@@QAE@PAVCIO@@PAUtWAVEFORMATEX@@PAH222@Z??_GCWAVInputSource@@UAEPAXI@Z??_ECWAVInputSource@@UAEPAXI@Z??_7CWAVInputSource@@6B@__ehhandler$??0CWAVInputSource@@QAE@PAVCIO@@PAUtWAVEFORMATEX@@PAH222@Z___CxxFrameHandler__except_list??0CWAVInputSource@@QAE@PBGPAUtWAVEFORMATEX@@PAH222@Z??0CWinFileIO@@QAE@XZ??2@YAPAXI@Z__ehhandler$??0CWAVInputSource@@QAE@PBGPAUtWAVEFORMATEX@@PAH222@Z??1CWAVInputSource@@UAE@XZ__ehhandler$??1CWAVInputSource@@UAE@XZ?CreateInputSource@@YAPAVCInputSource@@PBGPAUtWAVEFORMATEX@@PAH222@Z__ehhandler$?CreateInputSource@@YAPAVCInputSource@@PBGPAUtWAVEFORMATEX@@PAH222@Z??_GCWAVInputSource@@UAEPAXI@Z /289 1084342676 100666 33637 ` LS”Á¡@TTè.drectveZ .debug$Sxf @B.rdataÞ ö”@@@.text?¾!ý! P`.rdata "@0@.debug$F"*"@B.text4" P`.debug$F;"K"@B.textU" P`.debug$FY"i"@B.texts" P`.debug$F‚"’"@B.text œ" P`.debug$F¦"¶"@B.textÀ" P`.debug$FÄ"Ô"@B.text[Þ"9# P`.debug$FM#]#@B.textg# P`.debug$Fn#~#@B.text ˆ# P`.debug$F“#£#@B.text^­# <Õ P`.debug$F]D]F @B.textG P`.debug$F­G½G@B.textÇG P`.debug$FÊGÚG@B.textäG P`.debug$FçG÷G@B.textH P`.debug$FH!H@B.text+H P`.debug$F.H>H@B.textHH P`.debug$FKH[H@B.texteH P`.debug$FuH…H@B.textH P`.debug$F’H¢H@B.text¬H P`.debug$F¯H¿H@B.textÉH P`.debug$FÌHÜH@B.text$æH I P`.debug$FI$I@B.text$.IRI P`.debug$F\IlI@B.textNvIÄI P`.debug$FÎIÞI@B.text$èI J P`.debug$FJ&J@B.text0J P`.debug$FEJUJ@B.text_J P`.debug$FoJJ@B.text$‰J­J P`.debug$F·JÇJ@B.text:ÑJ K P`.debug$FK%K@B.text$/KSK P`.debug$F]KmK@B.text:wK±K P`.debug$F»KËK@B.textÕKÚK P`.debug$FäKôK@B.text þKL P`.debug$F(L8L@B.text$BLfL P`.debug$FpL€L@B.text:ŠLÄL P`.debug$FÎLÞL@B.text$x+èLN. P`.xdata$xßO÷Q @0@.sxdata87S0.textoSS P`.debug$F¡S±S@B.text»S P`.debug$FÔSäS@B.textîS P`.debug$FTT@B.text!T P`.debug$F:TJT@B/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" 8 „t1e:\Mac_sdk_399_4\Source\MACLib\Release\APETag.obj8   !Microsoft (R) Optimizing CompilerBluesClassic RockCountryDanceDiscoFunkGrungeHip-HopJazzMetalNew AgeOldiesOtherPopR&BRapReggaeRockTechnoIndustrialAlternativeSkaDeath MetalPranksSoundtrackEuro-TechnoAmbientTrip-HopVocalJazz+FunkFusionTranceClassicalInstrumentalAcidHouseGameSound ClipGospelNoiseAlternRockBassSoulPunkSpaceMeditativeInstrumental PopInstrumental RockEthnicGothicDarkwaveTechno-IndustrialElectronicPop-FolkEurodanceDreamSouthern RockComedyCultGangstaTop 40Christian RapPop/FunkJungleNative AmericanCabaretNew WavePsychadelicRaveShowtunesTrailerLo-FiTribalAcid PunkAcid JazzPolkaRetroMusicalRock & RollHard RockFolkFolk-RockNational FolkSwingFast FusionBebopLatinRevivalCelticBluegrassAvantgardeGothic RockProgressive RockPsychedelic RockSymphonic RockSlow RockBig BandChorusEasy ListeningAcousticHumourSpeechChansonOperaChamber MusicSonataSymphonyBooty BassPrimusPorn GrooveSatireSlow JamClubTangoSambaFolkloreBalladPower BalladRhythmic SoulFreestyleDuetPunk RockDrum SoloAcapellaEuro-HouseDance HallGoaDrum & BassClub HouseHardcoreTerrorIndieBritPopBlack PunkPolsk PunkBeatChristian GangstaHeavy MetalBlack MetalCrossoverContemporary CChristian RockMerengueSalsaThrash MetalAnimeJPopSynthPopArtistAlbumTitleCommentYear%dTrackUndefinedGenreGenreArtistAlbumTitleCommentYearTrackGenreTAGè °ì ¯ð ®ô ­ø ¬ü « ª © ¨ § ¦ ¥ ¤ £ ¢$ ¡(  , Ÿ0 ž4 8 œ< ›@ šD ™H ˜L —P –T •X ”\ “` ’d ‘h l p Žt x Œ| ‹€ Š„ ‰ˆ ˆŒ ‡ †” …˜ „œ ƒ  ‚¤ ¨ €¬ ° ~´ }¸ |¼ {À zÄ yÈ xÌ wÐ vÔ uØ tÜ sà rä qè pì oð nô mø lü k j i h g f e d c b$ a( `, _0 ^4 ]8 \< [@ ZD YH XL WP VT UX T\ S` Rd Qh Pl Op Nt Mx L| K€ J„ Iˆ HŒ G F” E˜ Dœ C  B¤ A¨ @¬ ?° >´ =¸ <¼ ;À :Ä 9È 8Ì 7Ð 6Ô 5Ø 4Ü 3à 2ä 1è 0ì /ð .ô -ø ,ü + * ) ( ' & % $ # "$ !( , 0 4 ‹Á‹ ‰‹‰P3ÉP‰ ‰J‹T$‹L$ƒÂ ‰HÇ@@‰P Ç@ж ¶APETAGEX?³‹A ƒè û‹AÃÀ‹A%€÷ØÀ÷ØÃÅ‹AÁèƒàà Ê‹AÃÏVj‹ñhVèƒÄ …Àu5~Ð,~#‹F ƒè =‹L$…ɸu ÷F t3À3É…À•Á^‹Á¶ Õ[Ô‹AƒàÃÚ‹A$öØÀ@à ß‹AÃÌÌÌÌÌÌÌÌÌÌÌÌ‹AÃÌÌÌÌÌÌÌÌÌÌÌÌ‹ÃÌÌÌÌÌÌÌÌÌÌÌÌÌ‹A ÃÌÌÌÌÌÌÌÌÌÌÌÌQSV‹ñ‹‹WÿP$‹jÇD$‹j‹øÿR‹‹T$ R‹T$R‹T$RÿP‹j‹Ø‹WÿP_^‹Ã[YÂÌÌÌjÿhd¡Pd‰%QSU‹éV»3ÀW‰l$‰]‰E‰D$‰]‰E ‹t$$Vˆ\$ èDPè‹ø‹EƒÄ…Àt‹E…Àt‹MPèƒÄÇEV‰]‰]‰}èL‹D$0‹ÑÁéó¥‹Êƒáó¤3É…ÀžÁI#Á‰EƒÀPè‹ð‹EƒÄ…Àt‹E …Àt‹MPèƒÄÇE ‰]‰]‰u ‹MƒÁ‹ÑÁé3À‹þó«‹Êƒáóª‹M…É~‹} ‹t$(‹ÁÁéó¥‹Èƒáó¤‹L$0‰Më‹T$0‰U‹L$_^‹Å][d‰ ƒÄÂÌÌÌÌÌÌjÿhd¡Pd‰%QV‹ñ‰t$‹F…ÀÇD$t‹F …Àt‹NPèƒÄÇF ‹F…ÀÇD$ÿÿÿÿt‹…Àt‹NPèƒÄÇ‹L$^d‰ ƒÄÃÌÌÌU‹l$…íV‹ñ|R;n}MS‹\®…ÛW|®t‹ËèSèƒÄǸÿ+ÅÁàPL®QWè‹FƒÄ _H[‰F^3À]Â^ƒÈÿ]ÂÌÌÌÌÌÌÌÌÌÌ‹D$VP‹ñèP‹Îè^ÂÌÌÌÌÌÌÌV‹ñ‹WPè‹ÈƒÄyŠA„Òuù‹V+Ï…Àt t PèƒÄ_‹Æ^ÃÌÌÌÌÌÌÌÌÌÌjÿhd¡Pd‰%ƒì SUV‹t$(‹Ù‹C‰‹KƒÆ‰‹WPƒÆè‹è¸ƒÄ‰D$‰D$‰l$‹þÇD$$‹Å+ý‹ÿŠˆ @„Éuö‹ÅPŠ@„Éuù‹K+‹Ñ|‹s Áéó¥‹Êƒáó¤‹Pè‹ð‹ÎƒÄyŠA„Àuù‹C+Ï…ö| t VèƒÄ…íÇD$$ÿÿÿÿt UèƒÄ‹L$‹Ç_^][d‰ ƒÄÂÌÌÌÌS‹Ù‹CU3í;Å~:VW{‹7…öt‹ÎèVèƒÄÇ‹CEƒÇ;è|Ù_^]ÇC3À[Ék]3À[ÃÌd¡jÿhPd‰%SUVW‹ù‹G …Àuè‹\$ …Ût<‹D$$…Àt ‹D$(…À~3íë½S‹Ïè‹ðƒþÿtm‹‡$…Àu"‹D·ö@tƒÈÿ‹L$d‰ _^][ƒÄ ‹\·…Ût‹ËèSèƒÄÇD·…ít,V‹Ïè‹L$d‰ _^][ƒÄ Â…íuH‹wN‰Oë‹\$ j èƒÄ‰D$ …ÀÇD$t‹T$,‹L$(R‹T$(QRS‹Èèë3À‰D·‹L$_^]3Àd‰ [ƒÄ ÂÌÌÌÌÌÌÌÌÌ‹D$‹L$‹ V‹0Wè‹Î‹øè+Ç_^ÃÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌjÿhd¡Pd‰%QV‹ñ‰t$ÇD$è‹ÎÇD$ÿÿÿÿè‹L$^d‰ ƒÄÃÌÌÌÌÌÌÌjÿhd¡Pd‰%ƒì4‹D$L…À‰L$ tÇ‹T$D‹B‹ ‰D$‹D$H+ÁVƒè3ö…ÀW‰L$¿~9ƒÿu¾L…Ét+ƒù |ƒù~~3ÿF;ð|á…ÿu_ƒÈÿ^‹L$4d‰ ƒÄ@ r‹ÆHŠ@„ÒuùS+ÁU‹è}Wè‹Ø¸‰D$,‰D$(‰\$$‹Ï‹ÑÁé‹ûó¥‹Êƒáó¤u SÇD$T‰t$`蹉D$ ‰L$<‰L$8‰D$4‹D$PˆL$Xè‹è¸ƒÄ ‰D$@‰D$<‰l$8‹D$‹T$Tò‹È‹ÑÁé‹ýó¥‹Ê‹T$\ƒáó¤‹L$XÈ…ÒÆD$Lt‰ ‹L$‹t$Q‹L$ PUVè…í‹øÆD$Lt UèƒÄ…öÆD$Lt VèƒÄ…ÛÇD$Lÿÿÿÿt SèƒÄ‹L$D][‹Ç_^d‰ ƒÄ@ ÌÌÌÌÌÌÌÌÌÌÌÌÌd¡jÿhPd‰%ƒì VW‹ù‹L$(…ɄċÁpIŠ@„Òuù+ƉD$(„©‹D$,…ÀunQè‹ð¸ƒÄ‰D$‰D$ ‰t$‹ÆÇD$PŠ@„Éuùj+ÂP‹D$,VP‹Ïè…ö‹øÇD$ÿÿÿÿt VèƒÄ‹Ç_^‹L$ d‰ ƒÄ ‹Áp‹ÿŠ@„Òuùj+ÆPQ‹L$0Q‹Ïè_^‹L$ d‰ ƒÄ ‹T$$R‹ÏèP‹Ïè‹L$_^d‰ ƒÄ ÌÌÌÌÌÌÌÌÌÌÌÌÌjÿhd¡Pd‰%ƒì SUV‹t$0FWP‹éè‹Ø¸ƒÄ‰D$‰D$‰\$‹Î‹Ñ3‹t$0Á鯋ûó¥‹ÊƒáÇD$$󤊀ù t„Éu ;ÃrÆHëë‹D$,jSP‹Íè…ÛÇD$$ÿÿÿÿt SèƒÄ‹L$_^]3À[d‰ ƒÄ ÌÌÌÌÌÌÌÌÌÌÌ‹AhjPƒÁQèƒÄ3ÀÃÌÌÌÌÌÌd¡jÿhPd‰%ƒì V‹t$$…öW‹ùtkVèƒÄ…Àv^Vè‹ð¸ƒÄ‰D$‰D$ ‰t$P‹D$(VP‹ÏÇD$(è…ö‹øÇD$ÿÿÿÿt VèƒÄ‹Ç_^‹L$ d‰ ƒÄ‹L$$Q‹ÏèP‹Ïè‹L$_^d‰ ƒÄÂÌÌÌÌÌÌÌÌÌÌjÿhd¡Pd‰%ìÀSUVW‹ñè‹3í»‰n‰^ ‹ÿP$‹j‰® ‰®džÿÿÿÿ‹j€‰D$$ÿR‹‹T$R¿€WT$XRÿP 9|$u';Åu#€|$PTu€|$QAu€|$RGu‹Fljž ‰F9® „ÖjD$uPh‹ÎèjŒ$“Qh‹ÎèjT$WRh‹Îèj„$µPh‹ÎèjŒ$±Qh‹Îè¶”$ÎRD$DhPèƒÄ UL$DQh‹Îèf‹„$΀üÿt€ü”s¶Ô‹•Phë hh‹Îè9® …]‹ ‹3À‰L$ ‹‰D$8¿ j‰T$(‰D$@‰l$4ÇD$8@‰|$0ÇD$,ЋjàÿR‹‹T$RWT$(RÿP 9|$…û;Å…óUL$$è…À„á‹L$4‹D$(á€÷ÙÉ#Ï‹~‰†‹D$,‰žÈXàùS‰~è‹ø¸ƒÄ‰D$H‰D$D‰|$@‹D$,‹‹j÷ØP‰¬$àÿR‹‹D$PSWÿR ;ÅuS;\$uM‹D$0…ÀÇD$~;IL$Q‹Ã+ÅP/R‹ÎÇD$ è…Àu‹D$‹L$0è‹D$@;Á‰D$|È3í;ýÇ„$Øÿÿÿÿt WèƒÄ‹6‹L$‹UQ‹ÎÿP‹Œ$Ð_^]3À[d‰ ÄÌÃÌÌÌÌS‹Ù‹C …ÀUuè‹l$ …íu]ƒÈÿ[‹CV3ö…ÀW~"{‹ÿ‹‹UPèƒÄ…Àt‹CFƒÇ;ð|ã_^]ƒÈÿ[Â_‹Æ^][‹D$VP‹ñèƒøÿt‹D†^Â3À^ÂSVW‹ù‹G …Àuè‹t$‹ƒËÿ…À~5‹D$P‹Ïèƒøÿt‹T‡…Òu$‹‹|$‹ÑÁé3Àó«‹ÊƒáóªÇ_^‹Ã[ ‹B‹;Á‹|$~U‹é3ÀÁéó«‹Íƒáóª‹B]_‰^‹Ã[ ‰‹r ‹È‹ÑÁéó¥‹Êƒáó¤_^3À[ ÌÌÌÌÌÌÌÌÌÌÌ̃ì0SUV‹ñ‹3í‰l$‹WÿP$¿‰D$‹ß‰l$…ÿu…Û„ˆ‹‹3ÿ3ÛÿR(=€~g‹‹jj€ÿP‹‹D$PjD$PÿR …ÀuEƒ|$u>jL$hQèƒÄ …Àu&‹‹jj€ÿR‹‹ÿP …Àt ½‰l$ë¿‹‹ÿR(ƒø Žkÿÿÿ…í…cÿÿÿ‹ ¡3Ò‰T$8‰L$$‹j‰D$$‰T$@‰T$4ÇD$8@ÇD$0 ÇD$,ЋjàÿP‹‹D$Pj D$(PÿR …À…ÿÿÿƒ|$ …ùþÿÿjL$$hQèƒÄ …À…Ýþÿÿ|$(ÐÏþÿÿ|$0Áþÿÿ‹D$,Pàú®þÿÿ‹l$4‹‹å€÷Ýíƒå èj÷ÝUÿR‹‹ÿP …Àt ½évþÿÿ‹l$»élþÿÿ‹‹D$‹jPÿR‹D$D…Àt …íu‹Îè_‹Å^÷Ø]À[ƒÄ0ÂÌÌÌÌÌÌjÿhd¡Pd‰%ƒìSV‹ñ3ÛW‰t$ ÇF‰h‰\$ èƒÄ‰D$;ÃÆD$t ‹Èè‹øë3ÿ‹Îˆ\$è‹L$$ÇF‰^‰>‹Q‹ÏÿP9\$(‰^ ‰^‰^‰ž$t‹Îè‹L$_‹Æ^[d‰ ƒÄÂÌÌÌÌjÿhd¡Pd‰%QV‹ñW3ÿ‰t$ÇF‰>‰|$è‹D$‰9|$ ‰~‰~‰~ ‰~‰~t‹Îè‹L$ _‹Æ^d‰ ƒÄÂÌÌÌÌÌÌÌV‹ñ‹F …Àuè‹F^ÃÌÌÌÌÌÌÌÌÌÌÌÌV‹ñ‹F …Àuè‹D$…À| ;F}‹D†^Â3À^ÂÌÌÌÌÌÌjÿd¡hPd‰%ƒì SUV‹Ù‹C W3ÿ;Çuè‹t$4‹ƒÍÿ;ÇŽ,‹D$,P‹Ëèƒøÿt‹Dƒ;Çu#‹‹|$0Ñá‹ÑÁé3Àó«‹ÊƒáóªÇéðö@¹Ðt\9‹|T‹‹T$0Ñá‹éÁé3À‹úó«‹Íƒáóª‹LþD$0P‰L$4‹L$0RQ‹Ëè‹T$0Ñê_B‰^][‹L$ d‰ ƒÄ ÇD$‰|$9‹‹@ jj‰|$,P|èëèƒÄL$Pè‹\$S苃Ä@;Á‰‹|$0 ‹ÁÁé‹óó¥‹Èƒáó¤3í‹D$…ÀÇD$$ÿÿÿÿt…Ût ‹D$SèƒÄ‹L$_^‹Å][d‰ ƒÄ U‹ìƒäøìSVW‹Ñ3ÀfÇD$¹|$ó«f«D$ P‹EL$QP‹ÊÇD$ÿèL$Qè‹U‹} ‹Ê‹Ù‹ðÁé3Àó«R‹U ‹ËƒáVRóªèƒÄ…öt VèƒÄ_^3À[‹å] ÌÌS‹\$UV‹3WD6P‹ùè‹L$ƒÄ‹èSUQ‹ÏfÇEè‹ø…ÿ…ƒ‹D$ …ÀUtèëèƒÄ‹ØPŠ@„Éuù+Â;Æ~%‹|$‹Î‹ÑÁé3Àó«‹Êƒáóª‹D$ǃÏÿë'‹T$‹Ã+ÓŠˆ @„Éuö‹ÃPŠ@„Éuù‹L$+‰…Ût SèƒÄUèƒÄ‹Ç_^][ÂÌÌU‹ìƒäøìSV‹u…öW‹Ùt‹C …Àuè‹C…Àu ƒÈÿ_^[‹å]Â3À¹ ‹þó«jF!Ph‹ËÆTÆFAÆFGèjN?Qh‹ËèjVRh‹ËèjFaPh‹ËèjN]Qh‹Ëè3ÀfÇD$¹|$ó«f«T$ RD$P¿ÿh‹Ë‰|$èL$QèƒÄT$ ˆF~RD$Ph‹ËfÇD$‰|$è3ÛÆFÿ3ÿ…ÿu*‹ QT$RèƒÄ…Àuˆ^¿Cû”|Ò_^3À[‹å]ÂÌÌd¡jÿhPd‰%ì´UV3öV‹éè…ÀtƒÈÿ鲋E;Æu3Àé¤9´$ÌSW…r;Ɖt$‰t$~R]‹3‹Pè‹ÈƒÄyŠA„Òuù‹V+Ï…Àt t PèƒÄ‹|$‹D$‹Mþ@ƒÃ;Á‰|$‰D$|´3ö‹MhjEQPè‹E‹‹ ‰D$8‹D$ ‰T$(3ÒƒÀ ‰T$@P‰L$0‰T$HÇD$@@‰D$8ÇD$4Ðè‹Ø¸ƒÄ‰D$@‰D$<‰\$8‹E3ÿ…À‰´$Ì~+E‰D$‹L$‹ Pè‹L$ð‹EGƒÁ;ø‰L$|Ü<¹t$ó¥‹M‹ÿR$‹Mj‹ðÇD$‹jÿP‹M‹D$P‹D$(PSÿR‹m‹UjV‹Í‹øÿR…ÛÇ„$Ìÿÿÿÿt*SèƒÄëD$DP‹Íèh€L$HQ‹Íè‹ø‹Ç_[‹Œ$¼^]d‰ ÄÀ“k™q¡qÑjÛi÷j<iXÀqÓvÙqáq0Eqrtx—ÉÄÑ~è‘ #”)q1qV‘µ‘Ùîq+t1bqišqqƒ¾¬ÄÕqîtô ~q:idd|qŸ¨Ã ÉqÑqæ—õ'q¨q!qq´iî§im˜~¥¹qÒqÙ®áq­Y˜mq¥˜²qÄÄÌ~Ùqó³ùq q iu «‡ › q´ À ·Ò qÙ »á qö j º/ «C U qg Äo ~| q“ Á™ q¡ q² —G N ±] d ±p w ±†  ±œ £ ±µ » ÀÉ Ð «ì ò ù þ  ¸ ¶ ¶… ÔÄ i9 £k ‘ q¬ ¾× Å Ä-¾FÄC IÕ”¶™¶¶ Õ¦¾ÃÍÉqÑqöi Ì'R¾bqsÒyqqž'À¾Ïqë¾ ¾4q9ÚAqX¾uÄîÇq1§8ÙECOj’¦qð×ú‘Þ,Rik׃ºŠ‘õþ0¾YkÝv}݈ݚ¡Ý¬ ³ÝÝ è×òâ ×,7ábqiåqqƒÈÆ‘è·'¶-¶di ’*à;;QqM:'}f 6ì!O'!I³"µ&¶" 3!` ¤ê ¬#i *€Îþ0"äç 90:@;Pd`tp~€€ ’°—À˜Ðàžð£«± ¶0¸@¾PÄ`ÆpÇ€ÈɠаÕÀÖÐ×àßðã‹ÁÇ@ÇÃê‹Ãï‹Ãô‹ÁÇ@ÇÃù‹Ãþ‹Ã‹ÁÇ@ÇËà ‹Ã‹ÃV‹ñ‹F…Àt‹…Àt‹NPèƒÄÇ^Ã$V‹ñ‹F…Àt‹…Àt‹NPèƒÄÇ^Ã$"V‹ñ‹F…ÀtB‹…Ét<‹F…Àt)‹Qü…ÒAüt‹jÿÇ^ÃPèƒÄÇ^ËjÿÇ^Ã1N'V‹ñ‹F…Àt‹…Àt‹NPèƒÄÇ^Ã$,‹A‹Q %€÷ØÀƒà ÂÃ1‹A%€÷ØÀƒà Ã6V‹ñ‹F…Àt‹…Àt‹NPèƒÄÇ^Ã$>V‹ñ‹F…Àt‹…Àt‹NPèƒÄÇ‹D$‹L$ ‹T$‰F‰N‰^ :CV‹ñ‹F…Àt‹…Àt‹NPèƒÄÇ^Ã$HV‹ñ‹F…Àt‹…Àt‹NPèƒÄÇ‹D$‹L$ ‹T$‰F‰N‰^ :Mé'RV‹ñè‹D$‹L$ ‹T$‰F‰N‰^ ' WV‹ñ‹F…Àt‹…Àt‹NPèƒÄÇ^Ã$\V‹ñ‹F…Àt‹…Àt‹NPèƒÄÇ‹D$‹L$ ‹T$‰F‰N‰^ :a‹Mðé‹MðƒÁ é¸é‹Mðé¸éMèé¸é‹EPèYøé‹Mðé¸éMÐéMÜéMèé¸éMèé¸éMèé¸éMèé¸édÿÿÿé¸é‹Mìé‹EðPèYøé‹Mðé¸éMèé¸éhÿÿÿé¸é>Hol!>&w+l3H8•=lFM›RlZR_¡dll\t>|H©†lŽH“¯˜l H¥´ªl²\·¼¼lÇHÌÂÑlÙRâéÎîlöRûÓl> ÛlH"æ'lÿÿÿÿ “ÿÿÿÿ “ÿÿÿÿ “ÿÿÿÿ “ÿÿÿÿ “ÿÿÿÿ “ÿÿÿÿ “ÿÿÿÿ “ÿÿÿÿ “ÿÿÿÿ “ÿÿÿÿ “ÿÿÿÿ “ÿÿÿÿ “ÿÿÿÿ “h gp0u<xT“`–x™„œœŸ¨¢À¦È¥Фܪô¬°²$µ<¹H½`¿lÄˌʘϰѼÔÔØàÜøäçkv”𠍮³»ÁÍÒÚåV‹ñèöD$t VèƒÄ‹Æ^Ât{‹T$‹Á‹L$ ‰H‹L$‰P‰ ƒ‹T$‹Á‹L$ ‰H‹L$‰P‰ ˆ‹T$‹Á‹L$ ‰H‹L$‰P‰ .fileþÿg.\APETag.cpp@comp.id `ÿÿ@feat.00ÿÿ.drectveZ.debug$Sx.rdata”TeCÑ$SG75438$SG75286$SG75284ü $SG75281ð $SG75280à $SG75279Ô $SG75278È $SG75277¸ $SG75159¬ $SG75157  $SG75156Œ $SG75153€ $SG75152| $SG75150p $SG75149` $SG75148T $SG75147H $SG751468 è $SG74593Ô $SG74592È $SG74591¼ $SG74590  $SG74589” $SG74588€ $SG74587` $SG74586@ $SG74585, $SG74584 $SG74583ü $SG74582Ø $SG74581Ì $SG74580´ $SG74579œ $SG74578Œ $SG74577€ $SG74576p $SG74575\ $SG74574D $SG74573, $SG74572$ $SG74571 $SG74570ô$SG74569à$SG74568Ì$SG74567¸$SG74566¬$SG74565˜$SG74564|$SG74563`$SG74562P$SG74561<$SG745600$SG74559$$SG74558$SG74557$SG74556ô$SG74555Ü$SG74554Ì$SG74553´$SG74552 $SG74551$SG74550t$SG74549h$SG74548X$SG74547H$SG745468$SG74545$$SG74544$SG74543ô$SG74542à$SG74541Ì$SG74540¬$SG74539ˆ$SG74538d$SG74537L$SG745364$SG74535 $SG74534$SG74533$SG74532ô$SG74531è$SG74530Ð$SG74529Ä$SG74528¨$SG74527”$SG74526ˆ$SG74525t$SG74524\$SG74523L$SG74522@$SG745214$SG74520 $SG74519 $SG74518ü$SG74517ð$SG74516à$SG74515Ì$SG74514À$SG74513¨$SG74512”$SG74511„$SG74510d$SG74509T$SG74508@$SG74507$$SG74506$SG74505$SG74504ø$SG74503è$SG74502Ì$SG74501À$SG74500¬$SG74499˜$SG74498€$SG74497\$SG74496H$SG744958$SG74494($SG74493$SG74492à$SG74491È$SG74490¼$SG74489°$SG74488¤$SG74487˜$SG74486€$SG74485t$SG74484d$SG74483L$SG74482@$SG744814$SG74480($SG74479 $SG74478ø$SG74477è$SG74476Ø$SG74475Ä$SG74474¸$SG74473¤$SG74472”$SG74471|$SG74470d$SG74469T$SG74468<$SG744674$SG74466$SG74465$SG74464ô$SG74463è$SG74462Ø$SG74461Ð$SG74460È$SG74459À$SG74458´$SG74457¤$SG74456”$SG74455ˆ$SG74454|$SG74453l$SG74452\$SG74451P$SG74450D$SG744498$SG74448($SG74447 $SG74446.text?)[÷ý .rdata ·}€z,.debug$F.text¥¥DK .debug$F.text –W¯q .debug$F  .text tÎ.™ .debug$F  .text  ¾ïˆj¾ .debug$F .textÏÏ´â .debug$F.text[àåpÊ _strncmp .debug$F.text¼ÐýS) .debug$F.text ÷3¡²M .debug$F.text^Õ©¼”eq .debug$F ™ .text..~í½ .debug$F.text*VöÖ .debug$F.text*Vöö .debug$F.text..~í .debug$F .text!*Vö*! .debug$F"!.text#*VöJ# .debug$F$#.text%..~íe% .debug$F&%.text'*Vöƒ' .debug$F('.text)*Vö¨) .debug$F*).text+*VöÈ+ .debug$F,+.text-$&.OÖã-  .debug$F.-.text/$&.OÖ/ .debug$F0/.text1N³z`,1 .debug$F21.text3$&.OÖO3 .debug$F43.text5Ö/Àjm5 .debug$F65.text7-]î–7 .debug$F87¾  ã0  @ .text9$&.OÖ39 .debug$F:9.text;:¼’VL; .debug$F<;.text=$&.OÖo= .debug$F>=.text?:¼’Vˆ? .debug$F@?.textA®¥Ä%«A .debug$FBA.textC ‚µNËÉC .debug$FDC.textE$&.OÖöE .debug$FFE.textG:¼’VG .debug$FHG2 .text$xI+.9¡G÷$L75891I $L75890I R _wcslen _I ‹ .xdata$xJ Ís#‹$T75955J$T75960Jž.sxdataK8ÂV.¬Ð $L75963I Ä%I $T760074J$T76009,J.textLN)¬œèL .debug$FMLP _memmove "À .textNJh qBN .debug$FON.textPJh q`P .debug$FQP.textRJh q~R .debug$FSRœà ¿ Ý  $L76168/I 7I $T76328XJ$T76336PJ/ L` $L76362AI tLI $T76489|J$T76495tJ¨ ÊÀ $L76498VI Ý^I $T76503 J$T76505˜Jü $L76512xI $L76511pI $L76510hI  <€I $T76686ÔJ$T76695¼JjÐ $L76698ŠI ‘ ®’I $T76772øJ$T76778ðJáð $L76782œI  ¤I $T76851J$T76856JA °  _qsort ] Ð  $L76860®I  Ÿ ¶I $T76931@J$T769348JÏ  $L76937ÀI _sprintf è ËI $T77067dJ$T77078\J    _wcsicmp 2  b  ‹ Ð ¤ À $L77219ÝI $L77218ÕI » Ñ èI $T77231J$T77234€Jô p $L77236òI  úI $T77244´J$T77247¬J8 à U  ƒ 0 $L77252I ¬ Ê I $T77312ØJ$T77319ÐJÿ ° _strncpy ) @ S  } __wtoi ‡ ` $L77462I ž !I $T77663üJ$T77673ôJÁ _g_ID3Genre??0APE_TAG_FOOTER@@QAE@HH@Z??_C@_08GDHGJGOG@APETAGEX?$AA@?GetFieldBytes@APE_TAG_FOOTER@@QAEHXZ?GetNumberFields@APE_TAG_FOOTER@@QAEHXZ?GetHasHeader@APE_TAG_FOOTER@@QAEHXZ?GetIsHeader@APE_TAG_FOOTER@@QAEHXZ?GetVersion@APE_TAG_FOOTER@@QAEHXZ?GetIsValid@APE_TAG_FOOTER@@QAEHH@Z?GetIsReadOnly@CAPETagField@@QAEHXZ?GetIsUTF8Text@CAPETagField@@QAEHXZ?GetFieldValueSize@CAPETagField@@QAEHXZ?GetFieldFlags@CAPETagField@@QAEHXZ??0?$CSmartPtr@G@@QAE@XZ?GetPtr@?$CSmartPtr@G@@QBEPAGXZ??B?$CSmartPtr@G@@QBEPAGXZ??0?$CSmartPtr@D@@QAE@XZ?GetPtr@?$CSmartPtr@D@@QBEPADXZ??B?$CSmartPtr@D@@QBEPADXZ??0?$CSmartPtr@VCIO@@@@QAE@XZ??C?$CSmartPtr@VCIO@@@@QBEPAVCIO@@XZ?GetPtr@?$CSmartPtr@E@@QBEPAEXZ??B?$CSmartPtr@E@@QBEPAEXZ?Delete@?$CSmartPtr@G@@QAEXXZ??3@YAXPAX@Z?Delete@?$CSmartPtr@D@@QAEXXZ?Delete@?$CSmartPtr@VCIO@@@@QAEXXZ?Delete@?$CSmartPtr@E@@QAEXXZ?GetTotalTagBytes@APE_TAG_FOOTER@@QAEHXZ?GetFieldsOffset@APE_TAG_FOOTER@@QAEHXZ?GetFieldName@CAPETagField@@QAEPBGXZ?GetFieldValue@CAPETagField@@QAEPBDXZ?WriteBufferToEndOfIO@CAPETag@@AAEHPAXH@Z??1?$CSmartPtr@G@@QAE@XZ?Assign@?$CSmartPtr@G@@QAEXPAGHH@Z??1?$CSmartPtr@D@@QAE@XZ?Assign@?$CSmartPtr@D@@QAEXPADHH@Z??1?$CSmartPtr@VCIO@@@@QAE@XZ?Assign@?$CSmartPtr@VCIO@@@@QAEXPAVCIO@@HH@Z??1?$CSmartPtr@E@@QAE@XZ?Assign@?$CSmartPtr@E@@QAEXPAEHH@Z??0CAPETagField@@QAE@PBGPBXHH@Z??2@YAPAXI@Z__ehhandler$??0CAPETagField@@QAE@PBGPBXHH@Z___CxxFrameHandler__except_list??1CAPETagField@@QAE@XZ__ehhandler$??1CAPETagField@@QAE@XZ??_GCAPETagField@@QAEPAXI@Z?RemoveField@CAPETag@@QAEHH@Z?RemoveField@CAPETag@@QAEHPBG@Z??0?$CSmartPtr@G@@QAE@PAGHH@Z??0?$CSmartPtr@D@@QAE@PADHH@Z??0?$CSmartPtr@E@@QAE@PAEHH@Z?GetFieldSize@CAPETagField@@QAEHXZ?GetANSIFromUTF16@@YAPADPBG@Z?SaveField@CAPETagField@@QAEHPAD@Z__ehhandler$?SaveField@CAPETagField@@QAEHPAD@Z?ClearFields@CAPETag@@QAEHXZ?SetFieldBinary@CAPETag@@QAEHPBGPBXHH@Z__ehhandler$?SetFieldBinary@CAPETag@@QAEHPBGPBXHH@Z?CompareFields@CAPETag@@CAHPBX0@Z??1CAPETag@@QAE@XZ__ehhandler$??1CAPETag@@QAE@XZ?LoadField@CAPETag@@AAEHPBDHPAH@Z?GetUTF16FromUTF8@@YAPAGPBE@Z__ehhandler$?LoadField@CAPETag@@AAEHPBDHPAH@Z?SetFieldString@CAPETag@@QAEHPBGPBDH@Z?GetUTF8FromANSI@@YAPAEPBD@Z__ehhandler$?SetFieldString@CAPETag@@QAEHPBGPBDH@Z?SetFieldID3String@CAPETag@@AAEHPBGPBDH@Z__ehhandler$?SetFieldID3String@CAPETag@@AAEHPBGPBDH@Z?SortFields@CAPETag@@AAEHXZ?SetFieldString@CAPETag@@QAEHPBG0@Z?GetUTF8FromUTF16@@YAPAEPBG@Z__ehhandler$?SetFieldString@CAPETag@@QAEHPBG0@Z?Analyze@CAPETag@@AAEHXZ__ehhandler$?Analyze@CAPETag@@AAEHXZ?GetTagFieldIndex@CAPETag@@AAEHPBG@Z?GetTagField@CAPETag@@QAEPAVCAPETagField@@PBG@Z?GetFieldBinary@CAPETag@@QAEHPBGPAXPAH@Z?Remove@CAPETag@@QAEHH@Z??0CAPETag@@QAE@PBGH@Z??0CWinFileIO@@QAE@XZ__ehhandler$??0CAPETag@@QAE@PBGH@Z??0CAPETag@@QAE@PAVCIO@@H@Z__ehhandler$??0CAPETag@@QAE@PAVCIO@@H@Z?GetTagBytes@CAPETag@@QAEHXZ?GetTagField@CAPETag@@QAEPAVCAPETagField@@H@Z?GetFieldString@CAPETag@@QAEHPBGPAGPAH@Z?GetUTF16FromANSI@@YAPAGPBD@Z__ehhandler$?GetFieldString@CAPETag@@QAEHPBGPAGPAH@Z?GetFieldID3String@CAPETag@@AAEHPBGPADH@Z?GetFieldString@CAPETag@@QAEHPBGPADPAHH@Z?CreateID3Tag@CAPETag@@QAEHPAUID3_TAG@@@Z__wcsicmp?Save@CAPETag@@QAEHH@Z__ehhandler$?Save@CAPETag@@QAEHH@Z /310 1084342676 100666 6588 ` L”Á¡@Ún.drectveZÄ .debug$Sy@B.rdataž—@0@.text*5_ & P`.debug$F€Û [ @B.text« P`.debug$F® ¾ @B.textÈ P`.debug$FË Û @B.textå P`.debug$Fè ø @B.text$ &  P`.debug$F0 @ @B.text$J n  P`.debug$Fx ˆ @B.text$’ ¶  P`.debug$FÀ Ð @B.text$Ú þ  P`.debug$F  @B.text:" \  P`.debug$Ff v @B.text:€ º  P`.debug$FÄ Ô @B.textÞ P`.debug$F÷ @B.text P`.debug$F*:@B.text$x Dd P`.xdata$x,Œ¸@0@.sxdataÖ0/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" 9 „t2e:\Mac_sdk_399_4\Source\MACLib\Release\APELink.obj8   !Microsoft (R) Optimizing Compiler[Monkey's Audio Image Link File]Image File=Start Block=Finish Block=[Monkey's Audio Image Link File]Image File=Start Block=Finish Block=ÃÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌ‹AÃÌÌÌÌÌÌÌÌÌÌÌÌ‹AÃÌÌÌÌÌÌÌÌÌÌÌÌA ÃÌÌÌÌÌÌÌÌÌÌÌÌ‹ÃÌÌÌÌÌÌÌÌÌÌÌÌÌì$3ÀV‹´$,;ðW‹ù‰‰G‰Gf‰G „”SUhVèhV‰D$ èhV‹èèhV‹Øè‹ð‹D$0ƒÄ …À„K…í„C…Û„;…ö„3j hPèƒÄ …À…j hUèƒÄ …À…j hSèƒÄ …À…ëj hVèƒÄ …À…Ӄà SèƒÆ V‰GèM ‰GŠƒÄ3Ò„Àtt$ +ñ< t< t ˆŠABA„ÀuìD$ PÆD$è‹ð»j\V‰\$(‰\$$‰t$ èƒÄ …ÀuJ‹Œ$<Q”$,RèƒÄV„$,j\PèƒÀƒÄPèŒ$0QG PèƒÄë G VPèƒÄL$‰è][_^Ä$ÂÌÌÌÌÌÌÌÌÌÌjÿhd¡Pd‰%ì$SU3ÛW‹ùL$‰‰_‰_f‰_ 苬$@UL$ ‰œ$<è…ÀueVhè‹ð¸ƒÄ‰D$‰D$‰t$ˆ„$<D$PhÿVL$,‰\$è‹L$Uˆ1V‹Ïè;óˆœ$<t VèƒÄ^L$Ç„$8ÿÿÿÿ苌$0‹Ç_][d‰ Ä0ÂÌÌÌÌÌÌÌÌ‹D$V‹ñ‹L$PQ‹Îè‹Æ^Âz€Y…Y”œY¡©YÙ ßXñ ÷X  X! 'X;WGWVœU¸TËU×TèT÷T7#d)j1jSckbza¯`¿SÐ-è_ûj SÆÉèŒ" 0@PS`Zpm‹Ã‹Ã"‹Ã'V‹ñ‹F…Àt‹…Àt‹NPèƒÄÇ^Ã-$,V‹ñ‹F…Àt‹…Àt‹NPèƒÄÇ^Ã-$2V‹ñ‹F…Àt‹…Àt‹NPèƒÄÇ^Ã-$7V‹ñ‹F…Àt‹…Àt‹NPèƒÄÇ^Ã-$<V‹ñ‹F…Àt‹…Àt‹NPèƒÄÇ‹D$‹L$ ‹T$‰F‰N‰^ -:AV‹ñ‹F…Àt‹…Àt‹NPèƒÄÇ‹D$‹L$ ‹T$‰F‰N‰^ -:F‹T$‹Á‹L$ ‰H‹L$‰P‰ K‹T$‹Á‹L$ ‰H‹L$‰P‰ PàýÿÿéÔýÿÿé¸é_<heÿÿÿÿ “^ ]id.fileþÿg.\APELink.cpp@comp.id `ÿÿ@feat.00ÿÿ.drectveZ.debug$Sy.rdatažüÑßë$SG75412$SG75411€$SG75410t$SG75409P$SG75406@$SG754040$SG75402$$SG75400.text*&Ç} .debug$F€ 8  Y0 ~@ .text*Vöž .debug$F.text*Vö¹ .debug$F .text *VöÙ .debug$F  .text $&.OÖô  .debug$F  .text$&.OÖ .debug$F.text$&.OÖ= .debug$F.text$&.OÖV .debug$F.text:¼’Vo .debug$F.text:¼’V’ .debug$F.textJh qµ .debug$F.textJh qÓ .debug$FñP _wcscpy _wcsrchr  _atoi 1 _strstr <  .text$x Œeö“$L75755  $L75754 S i ‰ – ² È ë .xdata$x,ÜÅG$T75820$T75825þ.sxdataT`D´  &??1CAPELink@@QAE@XZ?GetStartBlock@CAPELink@@QAEHXZ?GetFinishBlock@CAPELink@@QAEHXZ?GetImageFilename@CAPELink@@QAEPBGXZ?GetIsLinkFile@CAPELink@@QAEHXZ??B?$CSmartPtr@G@@QBEPAGXZ?GetPtr@?$CSmartPtr@D@@QBEPADXZ??B?$CSmartPtr@D@@QBEPADXZ?Delete@?$CSmartPtr@G@@QAEXXZ??3@YAXPAX@Z?Delete@?$CSmartPtr@D@@QAEXXZ??1?$CSmartPtr@G@@QAE@XZ??1?$CSmartPtr@D@@QAE@XZ?Assign@?$CSmartPtr@G@@QAEXPAGHH@Z?Assign@?$CSmartPtr@D@@QAEXPADHH@Z??0?$CSmartPtr@G@@QAE@PAGHH@Z??0?$CSmartPtr@D@@QAE@PADHH@Z?ParseData@CAPELink@@IAEXPBDPBG@Z?GetUTF16FromUTF8@@YAPAGPBE@Z__strnicmp??0CAPELink@@QAE@PBG@Z??1CWinFileIO@@UAE@XZ?Read@CWinFileIO@@UAEHPAXIPAI@Z??2@YAPAXI@Z?Open@CWinFileIO@@UAEHPBG@Z??0CWinFileIO@@QAE@XZ__ehhandler$??0CAPELink@@QAE@PBG@Z___CxxFrameHandler__except_list??0CAPELink@@QAE@PBDPBG@Z/332 1084342677 100666 16142 ` LE•Á¡@%.drectveZÜ .debug$Sy6 @B.rdata ¯ @0@.textÏ P`.debug$Fß ï @B.textNù G  P`.debug$FQ a @B.textk P`.debug$Fn ~ @B.textˆ P`.debug$F‹ › @B.text¥ P`.debug$F¨ ¸ @B.text P`.debug$FÒ â @B.text$ì   P`.debug$F * @B.text4 P`.debug$F7 G @B.textQ P`.debug$Fa q @B.text${ Ÿ  P`.debug$F© ¹ @B.textà P`.debug$FÆ Ö @B.textà P`.debug$Fð @B.text$ . P`.debug$F8H@B.textR P`.debug$Fbr@B.text| P`.debug$F@B.text™ P`.debug$Fœ¬@B.textW¶  P`.debug$F?O@B.textYw P`.debug$F‹›@B.textz ¥e P`.text$x´Å P`.xdata$xØ—o@0@.sxdata 0.debug$F`- @B.textÉ Î  P`.debug$FØ è @B.text ò ! P`.debug$F!,!@B.text$6!Z! P`.debug$Fd!t!@B.text$~!¢! P`.debug$F¬!¼!@B.text$Æ!ê! P`.debug$Fô!"@B.text\"j" P`.debug$Fœ"¬"@B.text%¶" P`.debug$FÛ"ë"@B.text¾õ"³# P`.text$x+$.$ P`.xdata$x4`$”$@0@.debug$F¼$Ì$@B.textÖ$Û$ P`.debug$Få$õ$@B.text ÿ$% P`.debug$F)%9%@B.rdataC%G%@0@.textQ%o% P`.debug$Fƒ%“%@B/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" 9 „t2e:\Mac_sdk_399_4\Source\MACLib\Release\APEInfo.obj8   !Microsoft (R) Optimizing Compilerhttp://m01p://‹ÁÇ@ÇÃV‹ñ‹F…ÀtB‹…Ét<‹F…Àt)‹Qü…ÒAüt‹jÿÇ^ÃPèƒÄÇ^ËjÿÇ^Ã1N‹Ã‹Ã‹Ã#‹ÁÇ@ÇÃ(V‹ñ‹F…Àt‹…Àt‹NPèƒÄÇ^Ã$-‹Ã2‹ÁÇ@ÇÃ7V‹ñ‹F…Àt‹…Àt‹NPèƒÄÇ^Ã$<‹ÃA‹ÁÇ@ÇÃFV‹ñ‹F…Àt‹…Àt‹NPèƒÄÇ^Ã$K‹ÁÇ@ÇÃP‹ÃU‹ÃZSŠ\$öÃV‹ñt.‹FüWh~üPh(VèöÃt WèƒÄ‹Ç_^[‹ÎèöÃt VèƒÄ‹Æ^[Âa!`,>aIW _V‹ñèöD$t VèƒÄ‹Æ^Âafjÿhd¡Pd‰%QV‹ñ‹F…ÀuƒÈÿ^‹L$d‰ ƒÄ‹N…Ét3À^‹L$d‰ ƒÄÂWPL$ èF PL$ ÇD$è‹ø…ÿuÇFL$ÇD$ÿÿÿÿè‹L$ ‹Ç_^d‰ ƒÄÂÌÌÌÌÌÌÌÌÌÌÌÌÌ‹D$ƒì@SUVWƒÏÿ=¸ ‹ñÜ„Óüÿÿƒø‡Èÿ$…‹~ ‹Ç_^][ƒÄ@ ‹~$‹Ç_^][ƒÄ@ ‹~(‹Ç_^][ƒÄ@ ‹~<‹Ç_^][ƒÄ@ ‹~@‹Ç_^][ƒÄ@ ‹~D‹Ç_^][ƒÄ@ ‹~8‹Ç_^][ƒÄ@ ‹~H‹Ç_^][ƒÄ@ ‹~,‹Ç_^][ƒÄ@ ‹~L‹Ç_^][ƒÄ@ ‹~T‹Ç_^][ƒÄ@ ‹~P‹Ç_^][ƒÄ@ ‹~X‹Ç_^][ƒÄ@ ‹~\‹Ç_^][ƒÄ@ ‹~`‹Ç_^][ƒÄ@ ‹~d‹Ç_^][ƒÄ@ ‹~h‹Ç_^][ƒÄ@ ‹\$X3ÿWSh‹ÎèWSh‹Î‹èè…펖…ÀŽŽ‹v<…öŽƒiÀè™÷þ‹È…É„pí™÷ù‹ø_^][ƒÄ@ ‹~l‹Ç_^][ƒÄ@ jjhè‹Îè=Ø•‹D$X…ÀŒ‰;F,€‹Ž„¶<‹Ç_^][ƒÄ@ ‹D$X…À|b;F,}]‹Vx‹<‚~p‹Ç_^][ƒÄ@ öF( ‹D$\tLƒø,r}jD$Ph‹Îè‹NT‹FPQT$RPL$0Qè‹|$X¹ t$$ó¥3ÿ‹Ç_^][ƒÄ@ ‹NL;È/‹¶‹|$X‹ÑÁéó¥‹Êƒáó¤3ÿ‹Ç_^][ƒÄ@ ‹FT;D$\~ƒÏÿ‹Ç_^][ƒÄ@ …À~M‹N‹ÿP$‹~‹NÇD$\‹/j‹ØèFT÷ØP‹ÏÿU‹N‹D$\P‹FTP‹D$`PÿR ‹N‹jSÿR3ÿ‹Ç_^][ƒÄ@ ‹F8‹N@‹V;0( .text?®¥Ä%/? .debug$F@?.textA ‚µNËQA .debug$FBA†ð( ¬ Ä iß$L76227>) $L762263) $L76225() $L76224) $L76223) Ü ø   .rdataC%C7I) $T76285L*$T76289$*iÐ( $L76298t) $L76297i) $L76296^) $L76295S) ”) $T76352ˆ*$T76356h*Ë ( $L76360Ÿ) $L76359”) $L76358‰) ߪ) $T76368¼*$T76370¤*.textDN)¬œÿD .debug$FED??0?$CSmartPtr@VCIO@@@@QAE@XZ?Delete@?$CSmartPtr@VCIO@@@@QAEXXZ??3@YAXPAX@Z?GetPtr@?$CSmartPtr@VCIO@@@@QBEPAVCIO@@XZ??B?$CSmartPtr@VCIO@@@@QBEPAVCIO@@XZ??C?$CSmartPtr@VCIO@@@@QBEPAVCIO@@XZ??0?$CSmartPtr@I@@QAE@XZ?Delete@?$CSmartPtr@I@@QAEXXZ??B?$CSmartPtr@I@@QBEPAIXZ??0?$CSmartPtr@E@@QAE@XZ?Delete@?$CSmartPtr@E@@QAEXXZ??B?$CSmartPtr@E@@QBEPAEXZ??0?$CSmartPtr@UAPE_DESCRIPTOR@@@@QAE@XZ?Delete@?$CSmartPtr@UAPE_DESCRIPTOR@@@@QAEXXZ??0?$CSmartPtr@VCAPETag@@@@QAE@XZ?GetPtr@?$CSmartPtr@VCAPETag@@@@QBEPAVCAPETag@@XZ??C?$CSmartPtr@VCAPETag@@@@QBEPAVCAPETag@@XZ??_ECAPETag@@QAEPAXI@Z??_M@YGXPAXIHP6EX0@Z@Z??1CAPETag@@QAE@XZ??_GCAPETag@@QAEPAXI@Z?GetFileInformation@CAPEInfo@@AAEHH@Z??1CAPEHeader@@QAE@XZ?Analyze@CAPEHeader@@QAEHPAUAPE_FILE_INFO@@@Z??0CAPEHeader@@QAE@PAVCIO@@@Z__ehhandler$?GetFileInformation@CAPEInfo@@AAEHH@Z___CxxFrameHandler__except_list?GetInfo@CAPEInfo@@QAEHW4APE_DECOMPRESS_FIELDS@@HH@Z_FillWaveFormatEx@16?GetTagBytes@CAPETag@@QAEHXZ_FillWaveHeader@16??1?$CSmartPtr@VCIO@@@@QAE@XZ?Assign@?$CSmartPtr@VCIO@@@@QAEXPAVCIO@@HH@Z??1?$CSmartPtr@I@@QAE@XZ??1?$CSmartPtr@E@@QAE@XZ??1?$CSmartPtr@UAPE_DESCRIPTOR@@@@QAE@XZ?Delete@?$CSmartPtr@VCAPETag@@@@QAEXXZ??0APE_FILE_INFO@@QAE@XZ??1APE_FILE_INFO@@QAE@XZ__ehhandler$??1APE_FILE_INFO@@QAE@XZ?CloseFile@CAPEInfo@@AAEHXZ??1?$CSmartPtr@VCAPETag@@@@QAE@XZ?Assign@?$CSmartPtr@VCAPETag@@@@QAEXPAVCAPETag@@HH@Z??0CAPEInfo@@QAE@PAHPBGPAVCAPETag@@@Z??_GCAPEInfo@@UAEPAXI@Z??_ECAPEInfo@@UAEPAXI@Z??0CAPETag@@QAE@PAVCIO@@H@Z_wcsnicmp??0CWinFileIO@@QAE@XZ??2@YAPAXI@Z??_7CAPEInfo@@6B@__ehhandler$??0CAPEInfo@@QAE@PAHPBGPAVCAPETag@@@Z??0CAPEInfo@@QAE@PAHPAVCIO@@PAVCAPETag@@@Z__ehhandler$??0CAPEInfo@@QAE@PAHPAVCIO@@PAVCAPETag@@@Z??1CAPEInfo@@UAE@XZ__ehhandler$??1CAPEInfo@@UAE@XZ??_GCAPEInfo@@UAEPAXI@Z/354 1084342677 100666 6769 ` L•Á¡@˜S.drectveZt .debug$S{Î@B.text:Iƒ  P`.debug$F`iÉ@B.text P`.debug$F@B.text" P`.debug$F%5@B.text? P`.debug$FBR@B.text\ P`.debug$F_o@B.texty P`.debug$F|Œ@B.text$–º P`.debug$FÄÔ@B.text$Þ P`.debug$F @B.text$&J P`.debug$FTd@B.text:n¨ P`.debug$F²Â@B.text:Ì P`.debug$F @B.text:*d P`.debug$Fn~@B.rdataˆ@@@.rdata@@@/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ; „t4e:\Mac_sdk_399_4\Source\MACLib\Release\APEHeader.obj8   !Microsoft (R) Optimizing Compiler‹Á‹L$‰ÂÌÌÌÌÌÃÌÌÌÌÌÌÌÌÌÌÌÌÌÌ̃ìUV‹ñ‹‹WÿP$‹‹jj‰D$ ÿR‹T$R3ÿj T$$‰|$‹RÿP €|$I…³€|$D…¨€|$3…‹D$"3Ɋȶăà3ÒŠT$$ƒáÁáÈ3ÀŠD$%ÁáƒâÊÁá3íƒàÁöD$!t ½xëx ‹‹jWÿR…íuG‹T$R½UT$ÆD$‹RÿP ŠD$„Àu(9l$u"‹‹T$RUT$RGÿP ŠD$„Àtß뽋‹jWÿP‹D$PjD$ÇD$‹PÿR …À…£ƒ|$…˜‹D$‰l$3í=MAC tLƒ|$u;ý}3‹‹D$PjD$PÿR ¶D$‹L$ÁàÁé ÁGE=MAC ‰D$uÀë =MAC tƒÏÿ‹D$,…Àtƒÿÿt‹‹jWÿR‹Ç_^]ƒÄ‹‹T$‹jRÿP‹Ç_^]ƒÄÂ_^ƒÈÿ]ƒÄÂÌÌÌÌÌÌÌÌÌ̃ì SUVW3íj4‹Ù‰l$è‹t$8‹ø‹†„ƒÄ;Åt‹F|;Åt‹Ž€PèƒÄ‰n|3Àdž„‰®€‰~|¹ ó«‹ ‰D$‰D$‰D$ ‰D$$‰D$(‰D$,‹FP‹UPÿR‹ ‹D$P‹F|j4PÿR ‹N|‹A+D$t ‹ ‹jPÿR‹ ‹T$RjT$ RÿP ‹F|‹@ +D$t ‹ ‹jPÿR‹~|·G·T$·L$‹l$$‰‹D$ ‰F·D$(‰V‹T$,‰F ‰V™‰N‹L$ƒâ‰N·L$*Áø‰F$¯Á…í‰n ‰N‰F(u3Éë‹T$ Mÿ¯L$ÊöD$ ‰N@º,u‹W¯Á‰V,‹ ‰F0‹×‰~4‰F8‹ ‹ÿP(‹~ÛF@‰|$4‰D$‰F<Ü Út$4è…À‰D$4‰FD3ÀëÛD$Ü Út$4è‹N(¯Ï‰FHÁá¸ÓMb÷éÁú‹ÊÁéÊ‹V|‰NL‹BÁè‰FTÁàPè‹ø‹F`ƒÄ…Àt‹FX…Àt‹N\PèƒÄÇFX½‹Ç…À‰n`‰n\‰~XtY‹ ‹|$W‹~TÁçWPÿR öD$ u\‹F,Pè‹ø‹FxƒÄ…Àt‹Fp…Àt‹NtPèƒÄÇFp‹Ç…À‰nx‰nt‰~pu _^]ƒÈÿ[ƒÄ ‹v,‹ ‹|$WVPÿR _^]3À[ƒÄ ÂÌÌÌÌÌÌÌÌÌÌ̃ì,UV‹t$8‹VPW‹é‹MjÇD$‹RÿP‹M‹T$ Rj T$ RÿP ‹|$0…ÿu _^ƒÈÿ]ƒÄ,ÂöD$ ÇD$<ÿÿÿÿt‹M‹T$ RjT$DRÿP ‹|$0öD$ t‹M‹|$ WFTjPÿR ‹|$0ë‰~Tf‹L$fù<f‹T$·Á‰·Â‰F·D$ S‹\$8‰F‰~ ‰^sfùØrfú tº$ëº fùn‰VrÇF€¨·L$&‹T$(‰N‰Vt¸ëƒàƒÈ‰F ™ƒâÂÁø‰F$¯Á…ÿ‰F(u3Éë Oÿ¯NËŠT$$³ „Ó‰N@º,u‹T$,‹|$0¯Á‰F0ÂljV,‰~4‰F8‹M‹ÿP(‹~ÛF@‰|$‰D$‰F<Ü Út$è…À‰D$‰FD3ÀëÛD$Ü Út$è‹N(¯ÏÁá‰FH¸ÓMb÷éŠD$$Áú‹ÊÁéʄÉNLud‹T$,Rè‹ø‹FxƒÄ…Àt‹Fp…Àt‹NtPèƒÄÇFp¸‰Fx‰Ft‹Ç…À‰~pu [_^ƒÈÿ]ƒÄ,‹M‹|$W‹|$0WPÿR ‹FT~TÁàPè‹Ø‹F`ƒÄ…Àt‹FX…Àt‹N\PèƒÄÇFX¸‰F`‰F\‹Ã…À‰^Xt—‹M‹\$S‹ÁãSPÿR f|$ Øw5‹PèƒÄjjƒÆdP‹Îè‹6…ö„Vÿÿÿ‹M‹D$P‹PVÿR [_^3À]ƒÄ,ÂÌ̃ìV‹ñƒ>W„‹|$…ÿ„jÇD$è…À‰GP|`‹3À‰D$f‰D$ ‹D$PjD$PÿR €|$Mu;€|$ Au4€|$ Cu-€|$ u&f|$ Œ‹ÎWr è_^ƒÄÂè_^ƒÄÂ_ƒÈÿ^ƒÄÂ_¸W^ƒÄÂN8+„MP¦J¯PäN+BN^+,M5PNJWP‰N¥+òN+QNc?· GQ Ö¥ Þ ª   0G@QPR‹Ã‹Ã‹Ã‹Ã ‹Ã%V‹ñ‹F…Àt‹…Àt‹NPèƒÄÇ^Ã+$*V‹ñ‹F…Àt‹…Àt‹NPèƒÄÇ^Ã+$0V‹ñ‹F…Àt‹…Àt‹NPèƒÄÇ^Ã+$5V‹ñ‹F…Àt‹…Àt‹NPèƒÄÇ‹D$‹L$ ‹T$‰F‰N‰^ +::V‹ñ‹F…Àt‹…Àt‹NPèƒÄÇ‹D$‹L$ ‹T$‰F‰N‰^ +:?V‹ñ‹F…Àt‹…Àt‹NPèƒÄÇ‹D$‹L$ ‹T$‰F‰N‰^ +:D @@@.fileþÿg.\APEHeader.cpp@comp.id `ÿÿ@feat.00ÿÿ.drectveZ.debug$S{.text:c¼~È .debug$F`" 8  .text*Vö\ .debug$F.text*Vö| .debug$F.text *Vö— .debug$F  .text *Vö² .debug$F  .text *Vöí .debug$F .text$&.OÖ( F .debug$F.text$&.OÖS .debug$F.text$&.OÖq .debug$F.text:¼’VŸ .debug$F.text:¼’V .debug$F.text:¼’Vå .debug$F( .rdata2eXã].rdataÔH]ºu š __ftol2 ¤° Õ ??0CAPEHeader@@QAE@PAVCIO@@@Z??1CAPEHeader@@QAE@XZ?FindDescriptor@CAPEHeader@@IAEHH@Z?GetPtr@?$CSmartPtr@I@@QBEPAIXZ??B?$CSmartPtr@I@@QBEPAIXZ??B?$CSmartPtr@E@@QBEPAEXZ??B?$CSmartPtr@UAPE_DESCRIPTOR@@@@QBEPAUAPE_DESCRIPTOR@@XZ??C?$CSmartPtr@UAPE_DESCRIPTOR@@@@QBEPAUAPE_DESCRIPTOR@@XZ?Delete@?$CSmartPtr@I@@QAEXXZ??3@YAXPAX@Z?Delete@?$CSmartPtr@E@@QAEXXZ?Delete@?$CSmartPtr@UAPE_DESCRIPTOR@@@@QAEXXZ?Assign@?$CSmartPtr@I@@QAEXPAIHH@Z?Assign@?$CSmartPtr@E@@QAEXPAEHH@Z?Assign@?$CSmartPtr@UAPE_DESCRIPTOR@@@@QAEXPAUAPE_DESCRIPTOR@@HH@Z?AnalyzeCurrent@CAPEHeader@@IAEHPAUAPE_FILE_INFO@@@Z__real@4020000000000000__real@408f400000000000??2@YAPAXI@Z__fltused?AnalyzeOld@CAPEHeader@@IAEHPAUAPE_FILE_INFO@@@Z?Analyze@CAPEHeader@@QAEHPAUAPE_FILE_INFO@@@Z /378 1084342677 100666 4723 ` L•Á¡@i :.drectveZl .debug$SwÆ@B.text= P`.debug$FAQ@B.text[ P`.debug$F_o@B.texty P`.debug$F}@B.textu—  P`.debug$F€Þ ^ @B.text® Ì  P`.debug$Fà ð @B.text$xú   P`.xdata$x$- Q @0@.sxdatae 0/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" 7 „t0e:\Mac_sdk_399_4\Source\MACLib\Release\UnMAC.obj8   !Microsoft (R) Optimizing Compiler‹Aà ‹AËAËÁ3ɉÇ@ÿÿÿÿ‰H‰H‰H ‰H‰HÃÌÌÌSUVWj‹ñ‹N‹jhèÿP =Ø‹FŽŠƒøÿ‹l$tMÿ;Èu‹V‹J‹ÿP_^]3À[‹N‹jUhÿ‹ùÿR jj‹Ø‹hÿ‹ÏÿP +Ø‹ûç€yOƒÏüG‹N‹Y‹N‹‹3ýRjUhÿÿP +ÇP‹ËÿV_^]3À[ƒøÿ‹\$tKÿ;Èt0‹V‹N‹z‹‹/jShþ‹ñÿP ‹PjShÿ‹ÎÿR P‹ÏÿU_^]3À[ÂÌÌÌÌÌÌÌÌ‹D$ SV3ÛƒøWuR‹D$…À~l‹t$U‹l$+î‰D$ ‹>‹ .‹Ç™+ÂÑø+È™‹ø3ú+ú‹Á™3Â+ÂÃ8‹D$ ƒÆH‰D$ uÎ]_^‹Ã[ƒøu‹t$3É…ö~‹|$‹™3Â+ÂØA;Î|ñ_^‹Ã[ÂÌÌÌÌÌÌV‹ñƒ>tKW‹~…ÿt‹ÏèWèƒÄÇF‹F …À_tPèƒÄÇF ÇFÇFÿÿÿÿÇ3À^ÃÌÌÌÌÌÌÌÌ̃ì SUV3ÛS‹ñ‹N‹ShòÿP ‹l$4;è| ^]3À[ƒÄ  ‹N‹WSShòÿR MS;È‹NS| ‹hñÿR ë ‹hðÿP ‹ø;û„àU‹Îè…À…ЋNSS‰\$‹hêÿR ¨‹F‹H‹SujjÿR;ÉD$uOÇD$ëESSÿR‹NSS‰D$‰\$‹hèÿP =ì~"‹D$…Ày‹N‹I‹SSSÿR‰D$d$ÿÿÿ‹NSSÇD$ ÿÿÿÿ‹hîÿP ƒøug‹L$<‹T$Q‹NURWè‹N‹ST$ RhÿP ‹F‹N‹X‹h‹jjhèÿP P‹D$8L$QT$ RPL$,Q‹N WSUè‹l$8ës‹N‹SShîÿR ƒøu_‹D$<‹L$PUQ‹NWè‹N‹SD$ PhÿR ‹N‹Y‹N‹jjhèÿR ‹T$4PD$PL$ Q‹N RD$,PWjSè‹N‹jjhèÿR =ì~Ñl$‹N‹jjhêÿP ¨u8‹F‹N‹‹X‹hWjjhîÿR PSU‹Îè;D$t$_^]ƒÈÿ[ƒÄ  ‹D$9D$t_^]ƒÈÿ[ƒÄ  ‹l$8‹Ç_‰n^][ƒÄ  ÌéÌÌÌÌÌÌÌÌÌÌÌd¡jÿhPd‰%SV‹ñƒ>Wtè‹|$…ÿu ‹Îè¸ó‹L$ d‰ _^[ƒÄ Âj4‰~ÇFÿÿÿÿè‹ØƒÄ‰\$3À;؉D$t‹WPPh‹ÏÿR P‹ËèjÇD$ÿÿÿÿ‰Fè‹NƒÄ‰F Ç‹jƒÆ VhÿP ‹L$ _^3Àd‰ [ƒÄ ÂÌÌéà Éá|#2('­(ø'N$‘%¢6©0±6À%Ï%ß6ù/#.5/c6q&øŠ W Î# $0%@&P)`*p9V‹ñèöD$t VèƒÄ‹Æ^ ‹EPèYøé 41ÿÿÿÿ “-50.fileþÿg.\Old\UnMAC.cpp@comp.id `ÿÿ@feat.00ÿÿ.drectveZ.debug$Sw.textÀ- .debug$F.textÏÏ´+ .debug$F.text’’ÃgR .debug$F.text u¯ßê¼ .debug$F €.text N)¬œ¢ Ä Ñ .debug$F  ï    7° T | º ð   .text$x RÐn$L76725 0 i v ° .xdata$x$ù¡Iö$T76729$T76732Ã.sxdata¡ø+ðÑp ö?GetDataX@CAPEDecompressCore@@QAEPAHXZ?GetDataY@CAPEDecompressCore@@QAEPAHXZ?GetUnBitArrray@CAPEDecompressCore@@QAEPAVCUnBitArrayBase@@XZ??0CUnMAC@@QAE@XZ??_GCAPEDecompressCore@@QAEPAXI@Z??3@YAXPAX@Z??1CAPEDecompressCore@@QAE@XZ?SeekToFrame@CUnMAC@@QAEHH@Z?CalculateOldChecksum@CUnMAC@@AAEIPAH0HH@Z?Uninitialize@CUnMAC@@QAEHXZ?DecompressFrameOld@CUnMAC@@AAEHPAEHH@Z?UnprepareOld@CPrepare@@QAEHPAH0HPBUtWAVEFORMATEX@@PAEPAI0H@Z?GenerateDecodedArrays@CAPEDecompressCore@@QAEXHHHH@Z??1CUnMAC@@QAE@XZ?Initialize@CUnMAC@@QAEHPAVIAPEDecompress@@@Z??0CAPEDecompressCore@@QAE@PAVCIO@@PAVIAPEDecompress@@@Z??2@YAPAXI@Z__ehhandler$?Initialize@CUnMAC@@QAEHPAVIAPEDecompress@@@Z___CxxFrameHandler__except_list?DecompressFrame@CUnMAC@@QAEHPAEHH@Z /398 1084342678 100666 9730 ` L"–Á¡@>|.drectveZd .debug$S¾@B.rdataˆ=@@@.textÅ Ì  P`.rdata0Ö  @0@.debug$F~ Ž @B.text˜ P`.debug$F› « @B.textµ P`.debug$Fº Ê @B.textÔ P`.debug$FÙ é @B.textó P`.debug$Fö  @B.text P`.debug$F ! @B.text+ P`.debug$F, < @B.textF e  P`.debug$Fy ‰ @B.text “ œ  P`.debug$F¦ ¶ @B.textÀ Î P`.text$x$2 P`.rdata0nž @0@.xdata$xH^@0@.sxdata†0.debug$F€Ž@B.text^} P`.debug$F‡—@B.text¡° P`.debug$FØè@B.textò P`.debug$F$4@B/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ? „t8e:\Mac_sdk_399_4\Source\MACLib\Release\UnBitArrayOld.obj8   !Microsoft (R) Optimizing Compiler€ @€ @€ @€€ @€ @€ @€ @€ @€ @€ @€€@ €@ €@ €@ ÿÿÿÿÿÿÿÿÿÿ?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ?ÿÿÿÿÿÿ? @€ @€ @€ @€ @€ @€ @€ @€Çà $).3 8$=(, $3À )3ÀÂ.Â3Ã8Ã=öD$V‹ñÇt VèƒÄ‹Æ^ C‹ÁÇà Hjÿhd¡Pd‰%QV‹ñ‰t$Ç‹F…ÀÇD$tPèƒÄÇF‹L$Ç^d‰ ƒÄÃÌÌÌÌÌÌÌÌ‹A‹QÁà+ÂÃÌÌÌÌVS‹Ñ‹r‹JWëI‹B‹ø‹ØÁï‹<¹ƒã…<@‰Btá‹L$_+ÆH…É[tÓàQ‹Ê‹ð‹ÿP, Æ^ÂÌÌ‹D$ƒèt%HtHt3À ‹T$‹RÿP, ‹D$Pè ‹j ÿR, ÌÌÌÌÌÌÌ̃ì SUVW‹|$$‹ñ‹L$(‹ÇkÀ2…É~Í ‹N‹^Áá+Ë;Áv‹‹ÎÿRƒÿ‹Çr¸‹\$ 3ÿ…À‰D$vO‹F‹N‰D$(ëI‹F‹ÐÁê‹‘‹èƒå…­@‰Ftá+D$(HÁà ‹è‹j ‹ÎÿP, ʼn»‹D$G;ør±‹L$$ƒùw- ‹;ك׋¨tÑø@ëÑø÷؉ƒÃ;Ùrè_^][ƒÄ  ‹S ‹k‹C‹{ê‹èïê¸ÍÌÌÌ÷åÁê3À;Љl$ t ‹<…@;×sôƒù@‰D$(‹Ár¸@ƒø‰D$ÇD$†•‹N‹V‰L$ ëI‹F‹ÈÁé‹ Š‹øƒç… ½@‰Ftá‹T$ ‹L$(+ÂH…Ét‹ÓàQ‹Î‹øÿR, Ç‹|$艻G3Ò‹Å÷÷Ñè…Àu‰D$(ë3É›‹A;Âsô‰L$(;|$‰|$‚sÿÿÿ‹L$$‰l$ ƒù@w- ‹;Ùƒµ‹¨tÑø@ëÑø÷؉ƒÃ;Ùrè_^][ƒÄ  Áí…ít3À‹ …@;ésô‹è‹­‹ ­‹T$$‰D$‰L$ “ƒ;Á‰l$(‰\$‰L$$ƒ ‹N‹Fd$‹V‹úÁï‹<¸‹Úƒã…<R‰Vtá…íu+ÑJ‹ÂëT‹Â+ÁH‹ÍÓà‹Ú‹ÊÕ‰Vƒá‹<º +Ñ‹NÁë#<™+Õ…Ò|‹ÊÓï Çë‹n‹\‹l$(J Óë‹Ê÷ÙÓç ß Ã‹|$‹T$ ‰‡‹+ÁЋÁ%€‰T$ yHƒÈþ@tÑùAëÑù÷Ù;T$‰ri;T$r)I‹­E;Ðsô‹ ­‹­‰l$(‰L$‰T$‹D$$ƒÇ‰|$Ç;ø‚÷þÿÿ‹L$‹T$$;Ês0ëI‹¨tÑø@ëëI‹­üÿÿÿM;ÐrôëžÑø÷؉ƒÁ;ÊrÕ_^][ƒÄ  ÌÌÌÌÌÌÌÌÌÌÌjÿhd¡Pd‰%QSV‹ñW‰t$ ‹\$$û(‹|$ ÇD$ǹ:‹jjhð‹ÏÿP kÀ2™ƒâÂÁø¹;Á~Ñá;È|úù¹ë û2¹‹SQjjh‹ÏÿR P‹Îè~( ‹F -‰F(ë ‹N é‰N(‹L$_‹Æ^[d‰ ƒÄÂÌÌÌÌÌSV‹t$ W‹ù(ÇG ÇG$@(‹D$†;ós:ëIj‹Ï艃Æ;órî_^[ ‹L$Ž;ósj‹Ï艃Æ;órî_^[ ÌÌÌÌÌ‹A=}é=2é W ]]V4CHP]“çcsS£c’ &s£r©]±]×V?q]µmØmûjz‹Mðé¸é‹Mðé¸é [Xs XO {i.3 8$=(,ÿÿÿÿ “ÿÿÿÿ “S\(q4tWrX N8• Ûk Mb c0i@jPp`zp{‹L$3À…Ét›‹…@;ÊsôÂfSUV‹ñ‹F;F(Wv‹‹ÎÿR‹N‹FëI‹V‹ú‹ÚÁï‹<¸ƒã…<R‰Vtá‹Â+Á‹L$H…Étƒø|‹~ ‹ÈÁé‹Ù÷ÛÁã ÉN ‹n …ítW‹ÍÓà‹ú‹ÊՋ؃Ḡ+ʼnV‹+Á‹NÁï#¹…À‰\$|‹ÈÓê Úë‹^‹|»‹\$H Óï‹È÷ÙÓâ ú ßë‹Ø‹F$HÁé+ÁÉF$;­sMë ;­rE‰n öÃt _Ñë^C]‹Ã[Â_Ñë^÷Û]‹Ã[Â3‹ Û ç mV‹ñèöD$t VèƒÄ‹Æ^ÂMCN.fileþÿg.\Old\UnBitArrayOld.cpp@comp.id `ÿÿ@feat.00ÿÿ.drectveZ.debug$S.rdataˆÄK¬ˆ,N€fu€.textªá‹À¥ À ë  J z   ¿ i.rdata0 Þ.debug$F.text" ž>÷ .debug$F.text r!R®# .debug$F  .text z«‹fa .debug$F  .text *‡Gö¡ .debug$F .text “mÛ .debug$F.text “m .debug$F.text»Hóš$ C .debug$F.text 4ëÛYP .debug$F.text {C‚k … £ iN.text$x$ÿw¿$L75862 .rdata0 ÁÙ ÿ .xdata$xH]…1$T75869$T75873.sxdataÈ’Õž.debug$F€ ` Ip .textÍ*¡z .debug$F™À Ö .textMœóI .debug$F ,  $L76002 Z $T76007,$T76012$.text!N)¬œ”! .debug$F"!²€ áð  _K_SUM_MAX_BOUNDARY_K_SUM_MIN_BOUNDARY_Powers_of_Two_Minus_One_Reversed_Powers_of_Two_Reversed_Powers_of_Two_K_SUM_MAX_BOUNDARY_OLD_K_SUM_MIN_BOUNDARY_OLD??1CUnBitArrayBase@@UAE@XZ?DecodeValueXBits@CUnBitArrayBase@@MAEII@Z?CreateHelper@CUnBitArrayBase@@MAEHPAVCIO@@HH@Z?AdvanceToByteBoundary@CUnBitArrayBase@@UAEXXZ?FillAndResetBitArray@CUnBitArrayBase@@UAEHHH@Z?FillBitArray@CUnBitArrayBase@@UAEHXZ??_GCUnBitArrayBase@@UAEPAXI@Z??_ECUnBitArrayBase@@UAEPAXI@Z??_7CUnBitArrayBase@@6B@?GenerateArray@CUnBitArrayBase@@UAEXPAHHH@Z?DecodeValue@CUnBitArrayBase@@UAEIW4DECODE_VALUE_METHOD@@HH@Z?DecodeValueRange@CUnBitArrayBase@@UAEHAAUUNBIT_ARRAY_STATE@@@Z?FlushState@CUnBitArrayBase@@UAEXAAUUNBIT_ARRAY_STATE@@@Z?FlushBitArray@CUnBitArrayBase@@UAEXXZ?Finalize@CUnBitArrayBase@@UAEXXZ??_GCUnBitArrayBase@@UAEPAXI@Z??3@YAXPAX@Z??0CUnBitArrayBase@@QAE@XZ??1CUnBitArrayOld@@UAE@XZ??_GCUnBitArrayOld@@UAEPAXI@Z??_ECUnBitArrayOld@@UAEPAXI@Z??_7CUnBitArrayOld@@6B@__ehhandler$??1CUnBitArrayOld@@UAE@XZ___CxxFrameHandler__except_list?GetBitsRemaining@CUnBitArrayOld@@AAEIXZ?DecodeValueRiceUnsigned@CUnBitArrayOld@@AAEII@Z?Get_K@CUnBitArrayOld@@AAEII@Z?DecodeValue@CUnBitArrayOld@@UAEIW4DECODE_VALUE_METHOD@@HH@Z?GenerateArrayOld@CUnBitArrayOld@@AAEXPAHIH@Z?DecodeValueNew@CUnBitArrayOld@@AAEHH@Z??0CUnBitArrayOld@@QAE@PAVIAPEDecompress@@H@Z__ehhandler$??0CUnBitArrayOld@@QAE@PAVIAPEDecompress@@H@Z??_GCUnBitArrayOld@@UAEPAXI@Z?GenerateArrayRice@CUnBitArrayOld@@AAEXPAHIH@Z?GenerateArray@CUnBitArrayOld@@UAEXPAHHH@Z/426 1084342678 100666 9866 ` L&–Á¡@â–.drectveZ .debug$S‚^@B.textàç P`.rdatañ@0@.debug$F)9@B.textCb P`.debug$Fv†@B.text ™ P`.debug$F£³@B.text½ P`.debug$FÍÝ@B.textç P`.debug$Fêú@B.text P`.debug$F$@B.text. P`.debug$F1A@B.textNK™ P`.debug$F£³@B.text$½á P`.debug$Fëû@B.text× Ü8 P`.rdata @@@.debug$F`t@B.text°µ P`.debug$F¿Ï@B.text Ùù P`.debug$F@B.text$A P`.debug$FK[@B.text:eŸ P`.debug$F©¹@B.text$x[à P`.rdataŒœ@0@.xdata$xpÄ4 @0@.sxdataŽ0.text–´ P`.debug$FÈØ@B/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" B „t;e:\Mac_sdk_399_4\Source\MACLib\Release\APEDecompressOld.obj8   !Microsoft (R) Optimizing CompilerÇà    öD$V‹ñÇt VèƒÄ‹Æ^  ‹ÁÇà ‹ÁÇ@ÇÃ"‹Ã'‹ÁÇ@ÇÃ,‹Ã1V‹ñ‹F…ÀtB‹…Ét<‹F…Àt)‹Qü…ÒAüt‹jÿÇ^ÃPèƒÄÇ^ËjÿÇ^Ã1N6V‹ñ‹F…Àt‹…Àt‹NPèƒÄÇ^Ã$;ƒìL‹T$PSV3Û‚0øÿÿƒøW‹ñ‰\$ ‡üÿ$…‹F$‹N_+Á^‰D$[ƒÄL ‹N`SShëè;ÉD$dŽÛF$Ü Út$dè_^‰D$[ƒÄL ‹F ‹N_+Á^‰D$[ƒÄL ‹N`SShëè;ÉD$`Ž@‹N‹F +Á‰D$dÛD$dÜ Út$`è_^‰D$[ƒÄL ‹F‹SPhû‹ÎÿR _^‰D$[ƒÄL 9^(‹Î„‹USShðÿR ‹ø‹F™÷ÿj‹Î‹è‹F D8ÿ™÷ÿ‹Uh‹ØÿR ‹È‹F™÷ÿ¯Ê‹Á™÷ÿ;݉D$ht#‹jSh‹ÎÿR ‹È‹F ™÷ÿ¯Ê‹Á™÷ÿD$h‹jjhò‹ÎÿR };û‰D$d}$;|$d}‹jWh‹ÎÿP ‹T$hÐG;û‰T$h|Ü‹N ‹n‹+͉L$dÛD$djjhëÜ ‹ÎÝ\$ ÿR ‰D$dÛD$dÜ|$è‹È…É]„ù‹D$dÁà™÷ù_^[‰$ƒÄL ‹SShúÿP _^‰D$[ƒÄL 9^(„¨‚ üÿÿƒø‡™¶ˆÿ$_ÇD$,‹D$^[ƒÄL ƒ|$d,s_ÇD$ÿÿÿÿ‹D$^[ƒÄL ‹SD$Ph‹ÎÿR ‹SL$QSShï‹ÎÿR ‹V‹N +ʯÁPT$8Rè‹|$`¹ t$,ó¥_^‰\$‹Ã[ƒÄL ‹D$d‹L$`‹v`PQR‹Îè‰D$ ‹D$ _^[ƒÄL ÌÌÌÌÌjÿhd¡Pd‰%QSUVW‹ù‰|$3íÇ»‰l$‰_ ‰oO,ˆ\$èw`‰^‰.‹D$$‹ÎÆD$‰(è‹L$(UUhè‰^‰n‰è=P~‹T$$Çÿÿÿÿé¡‹UUhïè‹\$,;݉G‰o‰ol‰o‰o$}3Àë$‹UUhøè;Ø}‹Ãë‹UUhøè‹‹\$0UUhø‰Gè;Ý|;Ø}‹Ãë‹UUhøè‰G 9ou‹6UUhø‹Îè9G t½‰o(‹L$‹Ç_^][d‰ ƒÄÂÌÌÌÌÌÌÌÌÌÌÌÌÌjÿhd¡Pd‰%QV‹ñ‰t$ÇN`ÇD$èN,ÆD$è‹F …ÀÆD$t‹F…Àt‹NPèƒÄÇF‹L$Ç^d‰ ƒÄÃÌÌÌÌV‹ñ‹Fl…Àt3À^ÃVN,è…Àuy‹jjhð‹ÎÿP ¯FD =}¸WPè‹ø‹F ƒÄ…Àt‹F…Àt‹NPèƒÄÇF‹Ï…ɸ‰~‰F ‰F_u¸Ð^Ëj‹Î‰FlÿR^ÃÌÌÌÌÌÌÌÌÌÌQ‹D$…ÀS‹ÙtÇ‹Ëè…À…ù‹C ‹L$V+C$;È|‹ÈUW‹{¯ù…ÿ‹÷‰|$‰t$¸Žª…ÀŽ¢‹k;õ}‹î…í~Q‹T$‹D$‹s+úø‹Í‹ÁÁéó¥‹Èƒáó¤‹C+Å…À~‹KP)RQèƒÄ ‹L$‹C‹|$+Í+ʼnL$‰C‹ñ…ö~@‹C‹SH‰K‹KjÑPRK,èƒøÿt‹K‹S¯ÈщSéaÿÿÿ_]^ƒÈÿ[Y ‹Ç+Æ™÷{‹s$‹L$ ð…ɉs$t‰_]3À^[Y ÌQS‹Ùè…À…‹C‹K V‹t$ð;ñ‰t$|I‰L$‹ñ;ð}‰D$‹ð‹UWjjhð‹ËÇCÿP ‹È‹Æ™÷ù‹jjhð‹Ë‰D$ÿR ‹È‹Æ™÷ù‹sjjhð‹Ë¯ò‹ÿR ¯CxWè‹è‹Ï‹ÑÁé3À‹ýó«‹Êƒáóª‹D$ƒÄjHP‰KUK,èƒøÿu _]^ À[Y‹S‹{¯Ð‹C+Öø‹Ê‹ÁÁéõó¥‹Èƒáó¤‹sòU‰sè‹L$ƒÄ_]‰K$3À^[YÂ$RHO]NfT—O¹NÂTÅNßT8G?F¬CßOôQøPüKJIH EBDA3z9€A€Tyov‰6¡OÅOîOOO3OKOi€ƒ‡‰€‘€Ÿy¯6¼rØìô€ŒB‹^µŠ8tŽÅŠQ‹€Ž¿@@+C |– @k ƒ0Š@Pé6YV‹ñè‹D$‹L$ ‹T$‰F‰N‰^ 6 ^V‹ñ‹F…Àt‹…Àt‹NPèƒÄÇ^Ã$cV‹ñ‹F…Àt‹…Àt‹NPèƒÄÇ‹D$‹L$ ‹T$‰F‰N‰^ :h‹Mðé‹MðƒÁé‹MðƒÁ,é‹MðƒÁ`é¸é‹Mðé‹MðƒÁé‹MðƒÁ,é¸é cr%Y*~/{7 BcMrRˆW{m @ÿÿÿÿ “ÿÿÿÿ “u tsq(@†H…P„\‰z‡V‹ñèöD$t VèƒÄ‹Æ^ƒl.fileþÿg.\Old\APEDecompressOld.cpp@comp.id `ÿÿ@feat.00ÿÿ.drectveZ.debug$S‚.textªá‹À  ) G i .rdatae.debug$F.text»Hóš} › .debug$F.text 4ëÛY¨ .debug$F .text ..~í .debug$F  .text *Vöå .debug$F  .text..~í .debug$F.text*Vö- .debug$F.textN³z`H .debug$F.text$&.OÖp .debug$F.text×8»~ Ž $L75947Î$L75946¿Ì $L75934X$L75932C$L76179 $L76172$L75911ñ$L75910Ó$L75907Œ$L75906w.rdataÔH]ºß÷ $L75903=$L75902($L76178ô, __ftol2 .debug$F`.text®¥Ä%6 .debug$F.text ‚µNËY .debug$F.text$&.OÖ .debug$F.text:¼’V© .debug$F Ì0 û  il.text$x![ ‰Fb“$L76223! = $L76222! $L76221! $L76220! O .rdata"a"|)! · .xdata$x#p §“Òæ$T76762 #$T76798#Ê.sxdata$ÚMØ€ $L76803F! $L76802;! $L768013! õQ! $T76833T#$T76837<# P ] ‹  µ _memmove ÚÀ .text%N)¬œû% .debug$F&%??1IAPEDecompress@@UAE@XZ__purecall??_GIAPEDecompress@@UAEPAXI@Z??_EIAPEDecompress@@UAEPAXI@Z??_7IAPEDecompress@@6B@??_GIAPEDecompress@@UAEPAXI@Z??3@YAXPAX@Z??0IAPEDecompress@@QAE@XZ??0?$CSmartPtr@VCAPEInfo@@@@QAE@XZ??C?$CSmartPtr@VCAPEInfo@@@@QBEPAVCAPEInfo@@XZ??0?$CSmartPtr@D@@QAE@XZ??B?$CSmartPtr@D@@QBEPADXZ?Delete@?$CSmartPtr@VCAPEInfo@@@@QAEXXZ?Delete@?$CSmartPtr@D@@QAEXXZ?GetInfo@CAPEDecompressOld@@UAEHW4APE_DECOMPRESS_FIELDS@@HH@Z_FillWaveHeader@16__real@408f400000000000?GetInfo@CAPEInfo@@QAEHW4APE_DECOMPRESS_FIELDS@@HH@Z__fltused??1?$CSmartPtr@VCAPEInfo@@@@QAE@XZ?Assign@?$CSmartPtr@VCAPEInfo@@@@QAEXPAVCAPEInfo@@HH@Z??1?$CSmartPtr@D@@QAE@XZ?Assign@?$CSmartPtr@D@@QAEXPADHH@Z??0CAPEDecompressOld@@QAE@PAHPAVCAPEInfo@@HH@Z??_GCAPEDecompressOld@@UAEPAXI@Z??_ECAPEDecompressOld@@UAEPAXI@Z??1CUnMAC@@QAE@XZ??0CUnMAC@@QAE@XZ??_7CAPEDecompressOld@@6B@__ehhandler$??0CAPEDecompressOld@@QAE@PAHPAVCAPEInfo@@HH@Z___CxxFrameHandler__except_list??1CAPEDecompressOld@@UAE@XZ__ehhandler$??1CAPEDecompressOld@@UAE@XZ?InitializeDecompressor@CAPEDecompressOld@@IAEHXZ??2@YAPAXI@Z?Initialize@CUnMAC@@QAEHPAVIAPEDecompress@@@Z?GetData@CAPEDecompressOld@@UAEHPADHPAH@Z?DecompressFrame@CUnMAC@@QAEHPAEHH@Z?Seek@CAPEDecompressOld@@UAEHH@Z??_GCAPEDecompressOld@@UAEPAXI@Z/457 1084342679 100666 4577 ` L —Á¡@V 0.drectveZ¤ .debug$Sƒþ@B.textÀA  P`.data ; F @0À.xdata$xP l @0@.xdata$xv ~ @0@.xdata$xˆ ˜ @0@.debug$F@¢ â @B.text (  P`.debug$F< L @B/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" C „t(i({(·(.H ÿÿÿÿ / ÷€† ( .0/V‹ñèöD$t VèƒÄ‹Æ^Â%$#.fileþÿg.\Old\APEDecompressCore.cpp@comp.id `ÿÿ@feat.00ÿÿ.drectveZ.debug$Sƒ.textÀð Æ =.data ç®s ??_R0H@8.xdata$xMG»–P.xdata$xžªÌ__CTA1H$L76303/^ o | .xdata$x__TI1H¬ ì .debug$F@.text N)¬œ   - .debug$F  G0 ‘ Ó  U – ×0 õÀ +??0CAPEDecompressCore@@QAE@PAVCIO@@PAVIAPEDecompress@@@Z??_7type_info@@6B@__CT??_R0H@84_GetMMXAvailable??2@YAPAXI@Z?CreateAntiPredictor@@YAPAVCAntiPredictor@@HH@Z?CreateUnBitArray@@YAPAVCUnBitArrayBase@@PAVIAPEDecompress@@H@Z__CxxThrowException@8??_GCAntiPredictor@@QAEPAXI@Z??3@YAXPAX@Z??1CAntiPredictor@@QAE@XZ?GenerateDecodedArray@CAPEDecompressCore@@QAEXPAHIHPAVCAntiPredictor@@H@Z?AntiPredict@CAntiPredictorExtraHigh3800ToCurrent@@QAEXPAH0HHHH@Z?AntiPredict@CAntiPredictorExtraHigh3700To3800@@QAEXPAH0HHPAI1@Z?AntiPredict@CAntiPredictorExtraHigh3600To3700@@QAEXPAH0HHPAI1@Z?AntiPredict@CAntiPredictorExtraHigh3320To3600@@QAEXPAH0HHPAI1@Z?AntiPredict@CAntiPredictorExtraHigh0000To3320@@QAEXPAH0HHPAI1@Z??1CAPEDecompressCore@@QAE@XZ?GenerateDecodedArrays@CAPEDecompressCore@@QAEXHHHH@Z /489 1084342679 100666 2663 ` L—Á¡@•.drectveZ´ .debug$S…@B.text´“ P`.debug$F0Gw@B/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" E „t>e:\Mac_sdk_399_4\Source\MACLib\Release\AntiPredictorNormal.obj8   !Microsoft (R) Optimizing Compiler‹L$ ƒìƒù VW}‹t$(‹|$,ó¥_^ƒÄ ‹T$,S‹\$,B ‰D$0BUj¹‹ó‹ú󥋋u‹z+ñ‹L$84v÷‰D$(‰D$‹ÆiÀ,{ ‹Áø ;ùÇD$0,‰l$‰l$ ‰|$‰L$ƒ|‹L$4‹ï+͉L$$‹L$ ‹ÿ‹/è‹D$$‰,8‹…À~ 3À…öŸÀë }3À…öžÀ‹t$0Åüÿÿÿð‰t$0+)‹D$‹õ‹(4võ‹l$‹Æ¯D$0ƒÅ‰l$‹l$ƒÇÁø ƒÁ;ýrš‹l$C¹‹ò‹ûó¥‹0‹{‹L$8Ñæ+÷‹|$4‰D$‹ÆiÀ¸ ŠÁø ;ùÇD$0¸ ‰L$$sk‹L$‹ï+͉L$8‹L$0ëI‹/è‹D$8‰l8‹…À~3À…öžÀHƒàƒÀôë}3À…öžÀHƒàèƒÀ È‹D$8t-+48‹l$$‹Æ¯ÁƒÇÁø ;ýr®‹l$‹‰‹KÁ‰B‹KÁ‰B‹K Á‰B ‹KÁ‰B‹KÁ‹L$(‰B‹S‹T$‰‹ ‹L$‹ÂiÀ<‰U‹l$Áø ;;<sA‹\$4+ÙëI‹9ø‰< ‹…À~ 3À…ÒŸÀë } 3À…ÒžÀDÿð‹×‹Â¯ÆƒÁÁø ;ÍrÊ][_^ƒÄ ƒìS‹\$$ƒûV‹t$ W‹|$(} ‹Ëó¥_^[ƒÄ ‹Æ‹‹Ï‰‹P‰Q‹P‰Q‹P ‰Q ‹@‰A‹W‹OU‹o ‹Â+Å‹n @Á‹‰D$‹F+Å‹nÁà+Å‹nÁŃûÇD$(ÇD$,@ÇD$‹êŽÉ‹Ï+΃ÃûV‰L$ ‰\$ë‹l$‹ ‹Ý¯\$(ÁûÙ3Í‹L$(~AëI‰L$(‹È¯L$,Áù ˉ\$3Ø‹D$,‰ ~@ëH‹Zü‹jð‹ ‰D$,‹Bø+ËZôÁà+ÃÅ‹l$‹Ý¯\$Áû ÙÁ‹Ë‹\$ ‰ ‹ 3Í‹L$~AëI‹lü‰L$‹ +Í‹lø I͉L$‹L$ƒÂI‰L$…Oÿÿÿ‹\$0‹F‹‰G‹V‰G‹V ‰G ‹V,‰o‹F+V ¾;Þ¹rÇD$(<‰D$~]ë‹L$,d$‹·‹Â¯ÁÁø Ã3Ú~AëI‰L$,‹L$+ыͯL$(Áù ȉ ·‹È3Í‹L$(~AëI‹,·‰D$‹D$0F;ð‰L$(|¥]_^[ƒÄ ÌÌÌ‹L$ ƒì ƒùVW}‹t$,‹|$0ó¥_^ƒÄ  ‹T$0‹L$,‹Á‹8‹ò‰>‹x‰~‹x‰~‹@ ‰F ‹q ‹y¸@S‹Y‰D$‰D$4+ß‹Æ+Çy‹Oø‰|$$‹ü‰L$Ñç+ù‹J Uj‰L$‹ J‹JJ‹JJ ‹L$<ŠÑà;êÇD$4sÇD$äÇD$Þ‰l$$‰T$,ƒv‹L$(+͉L$<ë‹L$<‹)‹l$‰T$(‹Î¯L$8‹Ð¯T$4ʋӯÕÊ‹T$(Áù Ê…Ò~EÁûƒãÁøº+Ó‹\$4êƒàº+ÐÚ‹ÆÁøƒàº+ЋD$8‰l$‰\$4‰D$8ë6}4ÁûƒãÁøT+ÿ‰T$‹T$4ƒàDü‹ÖÁú‰D$4‹D$8ƒâTü‰T$8‹T$¯T$‹D$ ‹ï¯l$+ÆÁ‹Á+ê+ÆÁý ‰t$ ‹ñÑàÍ…ö~+Áÿƒçº+׋|$ú‹T$Áú‰|$‹|$ƒâTÿë+}-‹T$ÁÿƒçT:þ‰T$‹T$Áúƒâ¿+ú‹T$׉T$‹l$< +ý‹l$$‹UükÒÁúщL$‹L$,‰UƒÅ;é‰l$$‚–þÿÿ][_^ƒÄ  `  D   .fileþÿg.\Old\AntiPredictorNormal.cpp@comp.id `ÿÿ@feat.00ÿÿ.drectveZ.debug$S….text´k×± .debug$F0=` vp ²?AntiPredict@CAntiPredictorNormal0000To3320@@UAEXPAH0H@Z?AntiPredict@CAntiPredictorNormal3320To3800@@UAEXPAH0H@Z?AntiPredict@CAntiPredictorNormal3800ToCurrent@@UAEXPAH0H@Z /523 1084342679 100666 10720 ` L—Á¡@) P.drectveZ„ .debug$SƒÞ@B.textas P`.rdata‡‹@0@.debug$F•¥@B.text¯´ P`.debug$F¾Î@B.textØê P`.rdataþ@0@.debug$F @B.text&+ P`.debug$F5E@B.textOa P`.rdatauy@0@.debug$Fƒ“@B.text¢ P`.debug$F¬¼@B.textׯ P`.debug$FP«û@B.text$x,-Y P`.xdata$xPŸï@0@.sxdata! 0/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" C „tLNL^LnL~L‡- *®¿ÍF3#ˆ%J •7: ;0<@IMðé¸éM éMðé¸é DA$2#N(Aÿÿÿÿ “ÿÿÿÿ “?E(K0J<O@M.fileþÿg.\Old\AntiPredictorHigh.cpp@comp.id `ÿÿ@feat.00ÿÿ.drectveZ.debug$Sƒ.textæ­Á . .rdatag .debug$F.text®¥Ä%© Ó .debug$F.textæ­Áí   .rdata 6 .debug$F .text ®¥Ä%T .debug$F  .text æ­Át ž .rdata×.debug$F .text®¥Ä%ÿ .debug$F.text×¢u) .debug$FP`@ —Ð  Ñ  .text$x,âo°$L75176  K .xdata$xPS+å­$T75188$T75201^.sxdata Bã@lÀ $L75205 $L75204 £ Ô" $T752234$T75225$??0CAntiPredictorNormal0000To3320@@QAE@XZ?AntiPredict@CAntiPredictorNormal0000To3320@@UAEXPAH0H@Z??_7CAntiPredictorNormal0000To3320@@6B@??0CAntiPredictor@@QAE@XZ??1CAntiPredictorNormal0000To3320@@QAE@XZ??1CAntiPredictor@@QAE@XZ??0CAntiPredictorOffset@@QAE@XZ?AntiPredict@CAntiPredictor@@UAEXPAH0H@Z??_7CAntiPredictorOffset@@6B@??1CAntiPredictorOffset@@QAE@XZ??0CAntiPredictorNormal3320To3800@@QAE@XZ?AntiPredict@CAntiPredictorNormal3320To3800@@UAEXPAH0H@Z??_7CAntiPredictorNormal3320To3800@@6B@??1CAntiPredictorNormal3320To3800@@QAE@XZ?AntiPredict@CAntiPredictorHigh3600To3700@@UAEXPAH0H@Z?AntiPredict@CAntiPredictorHigh3700To3800@@UAEXPAH0H@Z?AntiPredict@CAntiPredictorHigh3800ToCurrent@@UAEXPAH0H@Z?AntiPredict@CAntiPredictorHigh0000To3320@@UAEXPAH0H@Z__ehhandler$?AntiPredict@CAntiPredictorHigh0000To3320@@UAEXPAH0H@Z___CxxFrameHandler__except_list?AntiPredict@CAntiPredictorHigh3320To3600@@UAEXPAH0H@Z?AntiPredict@CAntiPredictorOffset@@QAEXPAH0HHH@Z__ehhandler$?AntiPredict@CAntiPredictorHigh3320To3600@@UAEXPAH0H@Z/555 1084342679 100666 1154 ` L—Á¡@ÿ.drectveZ´ .debug$Sƒ@B.text:‘ P`.debug$F Ëë@B/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" C „t/ P`.debug$F¤ @B.textþ P`.rdata$(@0@.debug$F2B@B.textLQ P`.debug$F[k@B.textu‡ P`.rdata›Ÿ@0@.debug$F©¹@B.textÃÈ P`.debug$FÒâ@B.text$xHì4 P`.xdata$x¬<@0@.sxdataŒ0/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" H „tAe:\Mac_sdk_399_4\Source\MACLib\Release\AntiPredictorExtraHigh.obj8   !Microsoft (R) Optimizing CompilerV‹ñèÇ‹Æ^à   é‹D$SV…À‹D$W„Ÿ‹\$$;ÃŽ“‹T$‹t$U ‹éÁé‹úó¥‹Íƒáó¤‹L$$…É]~5;Ø}r‹|$‹ó+÷‹|$+ú š4²+Ë‹ÁúÓ‰ƒÆƒÁHuë_^[Â;Ø}=‹|$‹ó+÷‹|$+ú š4²+Ë‹9Áú+Ú‰ƒÆƒÁHuë_^[‹t$‹|$‹Èó¥_^[ÂÌÌÌÌÌÌÌÌÌÌÌÌ‹D$V…À‹D$W„Ë‹T$ ;ÂŽ¿‹|$S‹\$U •‹éÁé‹óó¥‹Íƒáó¤‹L$$…ɽ~G;Ð}<‹|$ ‹ò+÷‹|$4·+û “+‹‹¯ÕÁú Ó‰‹3~ƒÅëƒíƒÆƒÁHuÚ][_^Â;Ð}õ‹|$ ‹ò+÷‹|$4·+û “+ÂI‹‹¯ÕÁú +Ú‰9‹3~ƒíëƒÅƒÆƒÁHuÚ][_^‹t$ ‹|$‹Èó¥_^ÂÌÌ‹D$…ÀS‹\$VW„Ä‹D$ …À„¸‹T$$;Úެ‹t$ •‹ÁÁéU‹l$‹ýó¥‹Èƒá;Ó¸@ó¤‰D$‰D$}t‹L$‹t$$‹|$ ‘‹Ê+Ît‹Ê+Ï‹|$L+ï+Ú‹¯T$‹>¯|$Áú Áÿ +׉(‹3‹T$~BëJ‹8‰T$‹3׋T$~JëBƒÁƒÆƒÀK‰T$u³]_^[‹t$‹|$‹Ëó¥_^[ÂÌÌÌÌÌÌÌ‹D$…ÀS‹\$VW„Ä‹D$ …À„¸‹T$$;Úެ‹t$ •‹ÁÁéU‹l$‹ýó¥‹Èƒá;Ó¸@ó¤‰D$‰D$}t‹L$‹t$$‹|$ ‘‹Ê+Ît‹Ê+Ï‹|$L+ï+Ú‹¯T$‹>¯|$Áú Áÿ +׉(‹3‹T$~BëJ‹8‰T$‹3׋T$~JëBƒÁƒÆƒÀK‰T$u³]_^[‹t$‹|$‹Ëó¥_^[ÂÌÌÌÌÌÌÌì°‹„$ÈS3Û=öÃ3ÉVW‹¼$ÄKƒã€Ã=öÁ3Ò‰\$`ƒÁ =ö‰Œ$¬‹Œ$ȃ ‰”$¸3Ò=öÂJƒâ€Â;Ê}‹´$Àó¥_^[İ‹ʋÁÁéU‹¬$Ä‹õó¥‹Èƒáó¤3À¹€¼$Àó«‹|*ü‹Lø¸@‰D$t‰D$D*‹÷+ñÑæ‰t$h‹tô+ñ ÷‹pø‰D$‹@üÑà‰L$`‹Œ$È+ÆщD$\‰T$p‹Rü¸;ØÇD$LsÇD$PäÇD$@‰|$‰´$¤‰T$H~I‹<‹Tüú‰<@;Ã|ï‹´$ÌjVè‹øjV‰¼$ŒèƒÄ3É…Û‰„$¬~#‹×+ЋtÁþƒæNf‰4f‹tf‰0AƒÀ;Ë|á‹D$d‹Œ$È3Ò3ö‰D$x‹„$Ì9D$p‰T$<‰T$‰T$ ‰T$$‰T$(‰T$,‰T$0‰T$4‰T$8‰´$€‰´$„‰´$ˆ‰´$Œ‰´$‹î‹Þ‹þ‰„$¸ƒ#‹D$+„$ÄÁ‹L$|‰D$l‹D$dA‰D$X‹„$¬+ȉŒ$¨‹L$|‰D$T+Á‰D$pë‹T$<‹„$Ô…À‹Œ$~#‹D$x™÷¼$Ô…Òujÿ‹T$<‹Œ$¼$ØöŒâ‹D$‹‰D$…À‹Â…ˆ‹T$8¯Æ¯×‹T$4¯Ó‹T$0¯Õ‹T$,¯Ñ‹T$(‹÷‹û‹Ý‹é‹Œ$Œ¯Ñ‹T$$‰Œ$‹Œ$ˆ¯Ñ‹T$ ‰Œ$Œ‹Œ$„¯Ñ‰Œ$ˆ‹L$ÂÇ„$„é;ޝÆÁþƒæT2ÿ‰T$<‹T$8¯×‹T$8‹÷ÁÿƒçT:ÿ‰T$8‹T$4¯Ó‹T$4‹ûÁûƒãTÿ‰T$4‹T$0¯Õ‹T$0‹ÝÁýƒåT*ÿ‰T$0‹T$,¯Ñ‹éÁù‹T$,ƒáL ÿ‹T$(‰L$,‹Œ$Œ¯Ñ‰Œ$Áù‹T$(ƒáL ÿ‹T$$‰L$(‹Œ$ˆ¯Ñ‰Œ$ŒÁù‹T$$ƒáL ÿ‹T$ ‰L$$‹Œ$„¯Ñ‰Œ$ˆÁù‹T$ ƒáL ÿé%¯ÆÁþƒæ¹+ÎÑ‹L$8‰T$<‹Ñ¯×‹÷Áÿƒçº+×ʉL$8‹L$4‹Ñ¯Ó‹ûÁûƒãº+ÓʉL$4‹L$0‹Ñ¯Õ‹ÝÁýƒåº+ÕÊ‹¬$‰L$0‹L$,¯ÍÁ‹ÕÁúƒâ¹+Ê‹T$,Ñ‹Œ$Œ‰T$,‹T$(¯Ñ‰Œ$Áùƒáº+Ñ‹L$(Ê‹T$$‰L$(‹Œ$ˆ¯Ñ‰Œ$ŒÁùƒáº+Ñ‹L$$Ê‹T$ ‰L$$‹Œ$„¯Ñ‰Œ$ˆÂÁùƒáº+Ñ‹L$ ʉL$ ‹L$‰Œ$„Áø +È‹D$‰‹D$‹‹D$Xf‹Ñ‰L$‹L$pf‰‹T$‹ ÁùƒáIf‰‹„$Ð…À‹D$tA…Àt=‹T$d‹Œ$¨RP‹D$\RŒ$ÌQPŒ$È苌$°‹Ð‹D$Óú)ë;‹L$d‹”$¨QP‹D$\ Q”$ÌRPŒ$È苌$°‹Ð‹D$Óú)f‹‹D$X‹T$pf‰ ‹L$‹‹L$h¯L$LÁúƒâJf‰‹D$¯D$D‹T$`Á‹L$t¯Ñ‹T$Áø ‹T$l‰‹D$‹…À~K‹D$`Áøƒàº+ЋD$hÊ‹T$LÁøƒà‰L$t¹+ÈщT$L‹T$‹ÂÁøƒà¹+ÈL$DëD}>‹D$`ÁøƒàTÿ‹D$h‹L$LÁøƒà‰T$tTü‹D$‹L$DÁøƒà‰T$LTü‰T$D‹T$‹Œ$¤‹D$l‹+Ê È‰L$`‹È+ÊÑá‰L$h‹L$\‰D$‹D$H¯D$@‰”$¤‹T$P¯Ê+È‹Á‹Œ$¼Óø‹È‹D$l‰‹L$…É~/‹L$\Áùƒáº+Ñ‹L$PÊ‹T$@‰L$P‹L$HÁùƒáL ÿë+}-‹L$\ÁùƒáT þ‹L$HÁù‰T$Pƒáº+Ñ‹L$@ʉL$@‹ +T$H‰L$H‰T$\‹PükÒÁúÑ‹L$ƒÁ‰‹T$T‰L$‹L$xƒÀA‰L$x¹щT$T‹T$XÑ;„$¸‰D$l‰T$X‚úÿÿ‹D$|P苌$°QèƒÄ]_^[İÂÌÌÌÌÌÌÌd¡jÿhPd‰%S‹\$U‹l$VW‹ù‹L$,…É|U‹T$0‹D$4+Â4ŠA‰D$(‰L$,ë‹D$(‹0‹L$ j@jÿPSUQ‹Ïè‹‹D$ j@jRSPU‹Ïè‹D$,ƒîH‰D$,uÃL$,èÇD$,‹L$ SUQL$8ÇD$$èL$,ÇD$ÿÿÿÿè‹L$_^]d‰ [ƒÄ ÂÌd¡jÿhPd‰%S‹\$U‹l$VW‹ù‹L$,…É|U‹T$0‹D$4+Â4ŠA‰D$(‰L$,ë‹D$(‹0‹L$ j jÿPSUQ‹Ïè‹‹D$ j jRSPU‹Ïè‹D$,ƒîH‰D$,uÃL$,èÇD$,‹L$ SUQL$8ÇD$$èL$,ÇD$ÿÿÿÿè‹L$_^]d‰ [ƒÄ ÂÌd¡jÿhPd‰%S‹\$U‹l$V‹t$(…öW‹ù|WëI‹D$4‹ °‹T$0‹²j@Q‹L$(PSUQ‹ÏèNx%‹T$4‹²‹L$0‹±j@P‹D$(RSPU‹ÏèNyºë ‹|$ ‹Ë‹õó¥L$4èÇD$4‹L$ SUQL$@ÇD$$èL$4ÇD$ÿÿÿÿè‹L$_^]d‰ [ƒÄ ÂÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌd¡jÿhPd‰%S‹\$U‹l$V‹t$(…öW‹ù|WëI‹D$4‹ °‹T$0‹²j@Q‹L$(PSUQ‹ÏèNx%‹T$4‹²‹L$0‹±j@P‹D$(RSPU‹ÏèNyºë ‹|$ ‹Ë‹õó¥L$4èÇD$4‹L$ SUQL$@ÇD$$èL$4ÇD$ÿÿÿÿè‹L$_^]d‰ [ƒÄ ÂüB B)A @Ê ?è >õ > M G! Mi ~ •  µ Æ Ô Mâ Mé Rñ M9 N e m … – ¤ M² M¹ WÁ Mü --7?%W"hvM’M™\¡MÜ<ÿ<471HVMÄ î é é i¬Ï#Ï#Ñ)Ñ) -0<@=PC`PpU€ZV‹ñèÇ‹Æ^à %"!é*V‹ñèÇ‹Æ^à 410é9Mé¸éMé¸éMé¸éMé¸é KHS H(*-X2H:9?]DHÿÿÿÿ “ÿÿÿÿ “ÿÿÿÿ “ÿÿÿÿ “FL(Q4TLVXYp[|^GRW\.fileþÿg.\Old\AntiPredictorExtraHigh.cpp@comp.id `ÿÿ@feat.00ÿÿ.drectveZ.debug$Sˆ.textæ­Á , .rdatac‰ .debug$F.text®¥Ä%£ Ë .debug$F.texta/´ÔÁå .debug$F  ,Ð .text æ­Ás › .rdata Ò .debug$F  .text ®¥Ä%ø .debug$F  À .textæ­Ág  .rdataÆ.debug$F.text®¥Ä%ì .debug$F° [  _free  â _calloc -  .text$xH ßSëÅ$L75203 n » .xdata$xÅNŽ$T75215$T75221Î.sxdataÙ€ÿÝÜà  $L75224  $T75234,$T75239$j°  $L75241$ «, $T75251P$T75254Hø $L752566 9> $T75266t$T75269l†??0CAntiPredictorHigh0000To3320@@QAE@XZ?AntiPredict@CAntiPredictorHigh0000To3320@@UAEXPAH0H@Z??_7CAntiPredictorHigh0000To3320@@6B@??0CAntiPredictor@@QAE@XZ??1CAntiPredictorHigh0000To3320@@QAE@XZ??1CAntiPredictor@@QAE@XZ?AntiPredictorOffset@CAntiPredictorExtraHigh0000To3320@@AAEXPAH0HHHH@Z?AntiPredictorOffset@CAntiPredictorExtraHigh3320To3600@@AAEXPAH0HHHH@Z??0CAntiPredictorHigh3600To3700@@QAE@XZ?AntiPredict@CAntiPredictorHigh3600To3700@@UAEXPAH0H@Z??_7CAntiPredictorHigh3600To3700@@6B@??1CAntiPredictorHigh3600To3700@@QAE@XZ?AntiPredictorOffset@CAntiPredictorExtraHigh3600To3700@@AAEXPAH0HHHH@Z??0CAntiPredictorHigh3700To3800@@QAE@XZ?AntiPredict@CAntiPredictorHigh3700To3800@@UAEXPAH0H@Z??_7CAntiPredictorHigh3700To3800@@6B@??1CAntiPredictorHigh3700To3800@@QAE@XZ?AntiPredictorOffset@CAntiPredictorExtraHigh3700To3800@@AAEXPAH0HHHH@Z?AntiPredict@CAntiPredictorExtraHigh3800ToCurrent@@QAEXPAH0HHHH@Z?ConventionalDotProduct@CAntiPredictorExtraHighHelper@@QAEHPAF00HH@Z?MMXDotProduct@CAntiPredictorExtraHighHelper@@QAEHPAF00HH@Z__imp__Sleep@4?AntiPredict@CAntiPredictorExtraHigh0000To3320@@QAEXPAH0HHPAI1@Z__ehhandler$?AntiPredict@CAntiPredictorExtraHigh0000To3320@@QAEXPAH0HHPAI1@Z___CxxFrameHandler__except_list?AntiPredict@CAntiPredictorExtraHigh3320To3600@@QAEXPAH0HHPAI1@Z__ehhandler$?AntiPredict@CAntiPredictorExtraHigh3320To3600@@QAEXPAH0HHPAI1@Z?AntiPredict@CAntiPredictorExtraHigh3600To3700@@QAEXPAH0HHPAI1@Z__ehhandler$?AntiPredict@CAntiPredictorExtraHigh3600To3700@@QAEXPAH0HHPAI1@Z?AntiPredict@CAntiPredictorExtraHigh3700To3800@@QAEXPAH0HHPAI1@Z__ehhandler$?AntiPredict@CAntiPredictorExtraHigh3700To3800@@QAEXPAH0HHPAI1@Z/624 1084342680 100666 14186 ` L2˜Á¡@$š.drectveZä .debug$S€>@B.textô¾² P`.rdataòö@0@.debug$F` ` @B.text œ ¥  P`.rdata¯ ³ @0@.debug$F½ Í @B.text × à  P`.rdataê î @0@.debug$Fø !@B.text !! P`.rdata%!)!@0@.debug$F3!C!@B.text M!V! P`.rdata`!d!@0@.debug$Fn!~!@B.text ˆ!‘! P`.rdata›!Ÿ!@0@.debug$F©!¹!@B.text Ã!Ì! P`.rdataÖ!Ú!@0@.debug$Fä!ô!@B.text þ!" P`.rdata""@0@.debug$F"/"@B.text 9"B" P`.rdataL"P"@0@.debug$FZ"j"@B.text t"}" P`.rdata‡"‹"@0@.debug$F•"¥"@B.text ¯"¸" P`.rdataÂ"Æ"@0@.debug$FÐ"à"@B.text ê"ó" P`.rdataý"#@0@.debug$F ##@B.text %#.# P`.rdata8#<#@0@.debug$FF#V#@B.text `#i# P`.rdatas#w#@0@.debug$F#‘#@B.text ›#¤# P`.rdata®#²#@0@.debug$F¼#Ì#@B.text Ö#ß# P`.rdataé#í#@0@.debug$F÷#$@B/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" @ „t9e:\Mac_sdk_399_4\Source\MACLib\Release\Anti-Predictor.obj8   !Microsoft (R) Optimizing Compiler‹ÁÇÃÌÌÌÌÌÌÌÇÃÌÌÌÌÌÌÌÌÌ ÌÌÌÌÌÌÌÌÌÌÌÌÌ‹T$‹D$S‹\$ÁâUV‹Ê‹éÁéW‹ó‹øó¥‹Íƒáó¤‹t$ <°3Ò;Ïs-‹ó‹\$$+ð‹(¯êÁý ,‰)‹,3(~Óë+ÓƒÁƒÀ;ÏrÜ_^][ÂÌÌÌÌÌ‹L$‹T$SV4Q‹T$3À…ÒW‰t$…y;΃ ‹T$d$¿¿:¯û¿YÇ¿z¯ûǃÁ¿YƒÂ¿z¯ûǃÁ¿YƒÂ¿z¯ûƒÁ¿YƒÂÇ¿z¯ûƒÁ¿YƒÂÇ¿z¯ûƒÁ¿YƒÂÇ¿z¯ûƒÁ¿YƒÂÇ¿z¯ûƒÁ¿YƒÂÇ¿z¯ûƒÁ¿YƒÂÇ¿z¯ûƒÁ¿YƒÂÇ¿zƒÁ¯û¿YƒÂÇ¿zƒÁ¯û¿YƒÂÇ¿zƒÁ¯û¿YƒÂƒÁƒÂÇ¿:¯û¿YÇ¿z¯ûǃÁ¿YƒÂ¿z¯ûǃÁ¿YƒÂ¿z¯ûǃÁ¿YƒÂ¿z¯ûƒÁ¿YƒÂÇ¿z¯ûƒÁ¿YƒÂÇ¿z¯ûƒÁ¿YƒÂÇ¿z¯ûƒÁ¿YƒÂÇ¿z¯ûƒÁ¿YƒÂÇ¿z¯ûƒÁ¿YƒÂÇ¿zƒÁ¯û¿YƒÂÇ¿zƒÁ¯û¿YƒÂÇ¿zƒÁ¯û¿YƒÂÇ¿zƒÁ¯ûƒÂǃÁƒÂ¿¿:¯û¿YÇ¿zƒÁ¯û¿YƒÂÇ¿zƒÁ¯û¿YƒÂÇ¿zƒÁ¯û¿YƒÂÇ¿zƒÁ¯ûƒÂƒÁǃÂ;΂ýÿÿ_^[Â…ÒUŽw;΃•‹t$‹T$f‹9¿¿ï¯ÝÃf‹fßf‰f‹y¿ZƒÁƒÂ¿ï¯ÝÃf‹^fßf‰f‹y¿ZƒÆƒÁƒÂ¿ï¯ÝÃf‹^fßf‰f‹y¿ZƒÆƒÁƒÂ¿ï¯ÝÃf‹^fßf‰f‹y¿ZƒÆƒÁƒÂ¿ï¯ÝÃf‹^fßf‰f‹y¿ZƒÆƒÁƒÂ¿ï¯ÝÃf‹^fßf‰f‹y¿ZƒÆƒÁƒÂ¿ï¯ÝƒÆÃf‹fßf‰f‹y¿ZƒÁƒÂ¿ïƒÆ¯ÝÃf‹fßf‰f‹y¿ZƒÁƒÂ¿ï¯ÝÃf‹^fßf‰f‹y¿ZƒÆƒÁƒÂ¿ï¯ÝÃf‹^fßf‰f‹y¿ZƒÆƒÁƒÂ¿ï¯ÝÃf‹^fßf‰f‹y¿ZƒÆƒÁƒÂ¿ï¯ÝÃf‹^fßf‰f‹y¿ZƒÆƒÁƒÂ¿ï¯ÝÃf‹^fßf‰f‹y¿ZƒÆƒÁƒÂ¿ï¯ÝÃf‹^ƒÆfßf‰f‹y¿ZƒÁƒÂ¿ï¯ÝƒÆÃf‹ƒÂfßf‰f‹y¿ƒÁ¿ï¯ÝÃf‹^fßf‰f‹y¿ZƒÆƒÁƒÂ¿ï¯ÝÃf‹^fßf‰f‹y¿ZƒÆƒÁƒÂ¿ï¯ÝÃf‹^fßf‰f‹y¿ZƒÆƒÁƒÂ¿ï¯ÝÃf‹^fßf‰f‹y¿ZƒÆƒÁƒÂ¿ï¯ÝÃf‹^fßf‰f‹y¿ZƒÆƒÁƒÂ¿ï¯ÝÃf‹^ƒÆfßf‰f‹y¿ZƒÁƒÂ¿ï¯ÝƒÆÃf‹fßf‰f‹yƒÂƒÆƒÁ¿¿ï¯ÝÃf‹fßf‰f‹y¿ZƒÁƒÂ¿ï¯ÝÃf‹^fßf‰f‹y¿ZƒÆƒÁƒÂ¿ï¯ÝÃf‹^fßf‰f‹y¿ZƒÆƒÁƒÂ¿ï¯ÝÃf‹^fßf‰f‹y¿ZƒÆƒÁƒÂ¿ï¯ÝÃf‹^fßf‰f‹y¿ZƒÆƒÁƒÂ¿ï¯ÝÃf‹^fßf‰f‹y¿ZƒÆƒÁƒÂ¿ï¯ÝÃf‹^ƒÆfßf‰f‹y¿ZƒÁƒÂ¿ï¯ÝƒÆÃf‹fßf‰f‹y¿ZƒÁƒÂ¿ï¯ÝÃf‹^ƒÆfßf‰f‹y¿ZƒÁƒÂ¿ï¯ÝƒÆÃf‹fß‹|$f‰ƒÁƒÂƒÆ;Ï‚ ûÿÿ]_^[Â;΃‹t$‹T$¤$f‹9¿¿ïf+>¯Ýf‰9f‹yÿZ¿ïf+~¯Ýf‰yƒÁf‹yƒÂÿZƒÆ¿ïf+~¯Ýf‰yƒÁf‹yƒÂƒÆÃ¿Z¿ïf+~¯ÝƒÁf‰9f‹yƒÂƒÆÃ¿ZƒÁ¿ïf+~¯ÝƒÂf‰9f‹yƒÆÃ¿ZƒÁ¿ïf+~¯ÝƒÂf‰9f‹yƒÆÃ¿ZƒÁƒÂ¿ïf+~¯ÝƒÆf‰9f‹yƒÁÿZƒÂ¿ïf+~¯ÝƒÆf‰9f‹yÃƃÁ¿¿ïf+>¯Ýf‰9f‹yÿZ¿ïf+~¯Ýf‰yƒÁf‹yƒÂÿZƒÆ¿ïf+~¯Ýf‰yƒÁf‹yƒÂƒÆÃ¿Z¿ïf+~¯Ýf‰yƒÁf‹yƒÂƒÆÃ¿ZƒÁ¿ïf+~¯ÝƒÂf‰9f‹yƒÆÃ¿ZƒÁ¿ïf+~¯ÝƒÂf‰9f‹yƒÆÃ¿ZƒÁƒÂ¿ïf+~¯ÝƒÆf‰9f‹yƒÁÿZƒÂ¿ïf+~¯ÝƒÆf‰9f‹yÿZƒÂƒÆƒÁ¿ïf+>¯Ýf‰9f‹yÿZ¿ïf+~¯Ýf‰yƒÁf‹yƒÂÿZƒÆ¿ïf+~¯Ýf‰yƒÁf‹yƒÂƒÆÃ¿Z¿ïf+~¯Ýf‰yƒÁf‹yƒÂƒÆÃ¿ZƒÁ¿ïf+~¯ÝƒÂf‰9f‹yƒÆÃ¿ZƒÁ¿ïf+~¯ÝƒÂf‰9f‹yƒÆÃ¿ZƒÁƒÂ¿ïf+~¯ÝƒÆf‰9f‹yƒÁÿZƒÂ¿ïf+~¯ÝƒÆf‰9f‹yÿZƒÂƒÆƒÁ¿ïf+>¯Ýf‰9f‹yÿZ¿ïf+~¯Ýf‰yƒÁf‹yƒÂÿZƒÆ¿ïf+~¯Ýf‰yƒÁf‹yƒÂƒÆÃ¿ZƒÁ¿ïf+~¯Ýf‰9f‹yƒÂƒÆÃ¿ZƒÁ¿ïf+~¯ÝƒÂf‰9f‹yƒÆÃ¿ZƒÁ¿ïf+~¯ÝƒÂf‰9f‹yƒÆƒÁÿZƒÂ¿ïf+~¯ÝƒÆf‰9f‹yƒÁÿZƒÂ¿ïf+~¯ÝƒÆf‰9‹|$ƒÁÃÆ;Ï‚ñûÿÿ]_^[ÂÌÌÌÌÌÌÌÌÌÌU‹ì‹E™ƒâÂÁø‰E‹E…ÀVWŽùP‹EVW‹u‹} ïÿoƒÆoƒÆoƒÆoƒÇo'ƒÇo/ƒïõÃõÌõÕþøþùþúýƒÀƒÇý 'ƒÀƒÇý(/ƒÀƒÇoƒÆoƒÆoƒÆoƒÇo'ƒÇo/ƒïõÃõÌõÕþøþùþúýƒÀƒÇý 'ƒÀƒÇý(/ƒÀƒÇoƒÆoƒÆoƒÆoƒÇo'ƒÇo/ƒïõÃõÌõÕþøþùþúýƒÀƒÇý 'ƒÀƒÇý(/ƒÀƒÇoƒÆoƒÆoƒÆoƒÇo'ƒÇo/ƒïõÃõÌõÕþøþùþúýƒÀƒÇý 'ƒÀƒÇý(/ƒÀƒÇoƒÆoƒÆoƒÆoƒÇo'ƒÇo/ƒïõÃõÌõÕþøþùþúýƒÀƒÇý 'ƒÀƒÇý(/ƒÀƒÇoƒÆoƒÆoƒÆoƒÇo'ƒÇo/ƒïõÃõÌõÕþøþùþúýƒÀƒÇý 'ƒÀƒÇý(/ƒÀƒÇoƒÆoƒÆoƒÆoƒÇo'ƒÇo/ƒïõÃõÌõÕþøþùþúýƒÀƒÇý 'ƒÀƒÇý(/ƒÀƒÇoƒÆoƒÆoƒÆoƒÇo'ƒÇo/ƒïõÃõÌõÕþøþùþúýƒÀƒÇý 'ƒÀƒÇý(/ƒÀƒÇoƒÆoƒÆoƒÆoƒÇo'ƒÇo/ƒïõÃõÌõÕþøþùþúýƒÀƒÇý 'ƒÀƒÇý(/ƒÀƒÇoƒÆoƒÆoƒÆoƒÇo'ƒÇo/ƒïõÃõÌõÕþøþùþúýƒÀƒÇý 'ƒÀƒÇý(/ƒÀƒÇoƒÆoƒÆoƒÇo'ƒïõÃõÌþøþùýƒÀƒÇý 'ƒÀƒÇƒmƒ}2üÿÿþs× þ÷~u_^Xw‹E_^]ÂP‹EVW‹u‹} ïÿoƒÆoƒÆoƒÆoƒÇo'ƒÇo/ƒïõÃõÌõÕþøþùþúùƒÀƒÇù 'ƒÀƒÇù(/ƒÀƒÇoƒÆoƒÆoƒÆoƒÇo'ƒÇo/ƒïõÃõÌõÕþøþùþúùƒÀƒÇù 'ƒÀƒÇù(/ƒÀƒÇoƒÆoƒÆoƒÆoƒÇo'ƒÇo/ƒïõÃõÌõÕþøþùþúùƒÀƒÇù 'ƒÀƒÇù(/ƒÀƒÇoƒÆoƒÆoƒÆoƒÇo'ƒÇo/ƒïõÃõÌõÕþøþùþúùƒÀƒÇù 'ƒÀƒÇù(/ƒÀƒÇoƒÆoƒÆoƒÆoƒÇo'ƒÇo/ƒïõÃõÌõÕþøþùþúùƒÀƒÇù 'ƒÀƒÇù(/ƒÀƒÇoƒÆoƒÆoƒÆoƒÇo'ƒÇo/ƒïõÃõÌõÕþøþùþúùƒÀƒÇù 'ƒÀƒÇù(/ƒÀƒÇoƒÆoƒÆoƒÆoƒÇo'ƒÇo/ƒïõÃõÌõÕþøþùþúùƒÀƒÇù 'ƒÀƒÇù(/ƒÀƒÇoƒÆoƒÆoƒÆoƒÇo'ƒÇo/ƒïõÃõÌõÕþøþùþúùƒÀƒÇù 'ƒÀƒÇù(/ƒÀƒÇoƒÆoƒÆoƒÆoƒÇo'ƒÇo/ƒïõÃõÌõÕþøþùþúùƒÀƒÇù 'ƒÀƒÇù(/ƒÀƒÇoƒÆoƒÆoƒÆoƒÇo'ƒÇo/ƒïõÃõÌõÕþøþùþúùƒÀƒÇù 'ƒÀƒÇù(/ƒÀƒÇoƒÆoƒÆoƒÇo'ƒïõÃõÌþøþùùƒÀƒÇù 'ƒÀƒÇƒmƒ}2üÿÿþs× þ÷~u_^Xw‹E_^]ÂÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌ‹L$3Àù¸ B„§ùèteùÐ…·‹D$=ø j}èƒÄ…À„˜ÇÃ=Ø}èƒÄ…À„zÇÃèƒÄ…À„cÇÃ|$ø j}èƒÄ…À„@ÇÃèƒÄ…À„)ÇËD$=ø j}èƒÄ…À„ÇÃ=}èƒÄ…À„çÇÃ=t}èƒÄ…À„ÉÇÃ=Ø}èƒÄ…À„«ÇÃèƒÄ…À„”ÇÃù …ƒ‹D$=ø j}èƒÄ…ÀthÇÃ=}èƒÄ…ÀtNÇÃ=t}èƒÄ…Àt4ÇÃ=Ø}èƒÄ…ÀtÇÃèƒÄ…ÀtÇÃ3ÀÃJ™[.h™y7™@¢™³¹™Ê%Ý™îIû™ R™*[7™HdN™_m~™‹u˜™¥}²™¿…Ì™Ùß™ì• kF ä  0@P˜‹ÁÇà ‹ÁÇÃ%" !‹ÁÇÃ.+ *‹ÁÇÃ74 3‹ÁÇÃ@= <‹ÁÇÃIF E‹ÁÇÃRO N‹ÁÇÃ[X W‹ÁÇÃda `‹ÁÇÃmj i‹ÁÇÃu r‹ÁÇÃ} z‹ÁÇÃ… ‚‹ÁÇÃ Š‹ÁÇÕ ’.fileþÿg.\Old\Anti-Predictor.cpp@comp.id `ÿÿ@feat.00ÿÿ.drectveZ.debug$S€.textô ±1†u .rdata.debug$F`6 P  y0 ª  ïð  .text 4ëÛY+ S .rdataŠ.debug$F.text  4ëÛY° Û .rdata  .debug$F  .text  4ëÛY> h .rdata ¡ .debug$F .text 4ëÛYÉ ó .rdata,.debug$F.text 4ëÛYT  .rdata½.debug$F.text 4ëÛYè  .rdataG.debug$F.text 4ëÛYm • .rdataÌ.debug$F.text 4ëÛYò  .rdataQ.debug$F.text 4ëÛYw Ÿ .rdataÖ.debug$F .text! 4ëÛYü! ' .rdata"a".debug$F#!.text$ 4ëÛYŠ$ .rdata%·%.debug$F&$.text' 4ëÛYâ' .rdata((.debug$F)'.text* 4ëÛY:* .rdata+g+.debug$F,*.text- 4ëÛY’- .rdata.¿..debug$F/-.text0 4ëÛYê0 .rdata11.debug$F20H x …??0CAntiPredictor@@QAE@XZ??_7CAntiPredictor@@6B@??1CAntiPredictor@@QAE@XZ?AntiPredict@CAntiPredictor@@UAEXPAH0H@Z?AntiPredict@CAntiPredictorOffset@@QAEXPAH0HHH@Z?ConventionalDotProduct@CAntiPredictorExtraHighHelper@@QAEHPAF00HH@Z?MMXDotProduct@CAntiPredictorExtraHighHelper@@QAEHPAF00HH@Z??0CAntiPredictorFast0000To3320@@QAE@XZ?AntiPredict@CAntiPredictorFast0000To3320@@UAEXPAH0H@Z??_7CAntiPredictorFast0000To3320@@6B@??0CAntiPredictorFast3320ToCurrent@@QAE@XZ?AntiPredict@CAntiPredictorFast3320ToCurrent@@UAEXPAH0H@Z??_7CAntiPredictorFast3320ToCurrent@@6B@??0CAntiPredictorNormal0000To3320@@QAE@XZ?AntiPredict@CAntiPredictorNormal0000To3320@@UAEXPAH0H@Z??_7CAntiPredictorNormal0000To3320@@6B@??0CAntiPredictorNormal3320To3800@@QAE@XZ?AntiPredict@CAntiPredictorNormal3320To3800@@UAEXPAH0H@Z??_7CAntiPredictorNormal3320To3800@@6B@??0CAntiPredictorNormal3800ToCurrent@@QAE@XZ?AntiPredict@CAntiPredictorNormal3800ToCurrent@@UAEXPAH0H@Z??_7CAntiPredictorNormal3800ToCurrent@@6B@??0CAntiPredictorHigh0000To3320@@QAE@XZ?AntiPredict@CAntiPredictorHigh0000To3320@@UAEXPAH0H@Z??_7CAntiPredictorHigh0000To3320@@6B@??0CAntiPredictorHigh3320To3600@@QAE@XZ?AntiPredict@CAntiPredictorHigh3320To3600@@UAEXPAH0H@Z??_7CAntiPredictorHigh3320To3600@@6B@??0CAntiPredictorHigh3600To3700@@QAE@XZ?AntiPredict@CAntiPredictorHigh3600To3700@@UAEXPAH0H@Z??_7CAntiPredictorHigh3600To3700@@6B@??0CAntiPredictorHigh3700To3800@@QAE@XZ?AntiPredict@CAntiPredictorHigh3700To3800@@UAEXPAH0H@Z??_7CAntiPredictorHigh3700To3800@@6B@??0CAntiPredictorHigh3800ToCurrent@@QAE@XZ?AntiPredict@CAntiPredictorHigh3800ToCurrent@@UAEXPAH0H@Z??_7CAntiPredictorHigh3800ToCurrent@@6B@??0CAntiPredictorExtraHigh0000To3320@@QAE@XZ??_7CAntiPredictorExtraHigh0000To3320@@6B@??0CAntiPredictorExtraHigh3320To3600@@QAE@XZ??_7CAntiPredictorExtraHigh3320To3600@@6B@??0CAntiPredictorExtraHigh3600To3700@@QAE@XZ??_7CAntiPredictorExtraHigh3600To3700@@6B@??0CAntiPredictorExtraHigh3700To3800@@QAE@XZ??_7CAntiPredictorExtraHigh3700To3800@@6B@??0CAntiPredictorExtraHigh3800ToCurrent@@QAE@XZ??_7CAntiPredictorExtraHigh3800ToCurrent@@6B@?CreateAntiPredictor@@YAPAVCAntiPredictor@@HH@Z??2@YAPAXI@Z/653 1084342680 100666 3035 ` L˜Á¡@ù(.drectveZT .debug$S€®@B.rdata„.@@@.text‰²; P`.text$x Çç P`.xdata$x,;@0@.sxdataY0.debug$F`]½@B/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" @ „t9e:\Mac_sdk_399_4\Source\MACLib\Release\UnBitArrayBase.obj8   !Microsoft (R) Optimizing Compiler?ÿÿÿÿÿÿÿ?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ?ÿÿÿÿÿÿÿd¡jÿhPd‰%VW‹|$ÿ<|Hj8è‹ðƒÄ‰t$…öÇD$td‹L$‹WjjhÿP P‹Îè‹L$d‰ _^ƒÄ Ãj,èƒÄ‰D$…ÀÇD$t‹L$WQ‹Èè‹L$d‰ _^ƒÄ ËL$_3Àd‰ ^ƒÄ ÃÌÌÌÌÌÌÌÌÌÌ‹A‹Ðƒât+ƒÀ‰AÃÌÌÌÌÌÌÌÌÌÌÌÌÌV‹t$W‹ù‹G‹O Æ;Ár‹‹ÏÿR‹O‹Áƒàº +ЋÁÎÁè;Ö‰O‹Or‹#•‹Ê+Î_Óè^Â<‹G+ò‹•¹ +ÎÓè#‹ÎÓâ_^ ÂÂÌÌÌÌÌÌÌÌÌÌÌ‹D$V‹ñ‰F‹D$ƒøÿt‹N‹jPÿR…Àt ¸è^‹NT$ R‹VR‹VÇD$‹RÿP ÷ØÀ%è^ÂÌÌÌÌÌÌÌÌÌÌÌQSV‹ñ‹N‹FW‹~Áï½+ËQRPè‹NƒÄ T$ R‹V+׋~S—ÇD$‹RÿP ƒf÷Ø_À^%è[YÃÌÌÌV‹ñ‹L$…ÉtU‹D$ …À~M™ƒâÂÁø‰FÁà‰N‹L$ÅP‰F‰V ‰NÇFèƒÄ3Ò…À•‰F^JâЋ ¸ˆ^  &VanŽ™­! ; â&b‹EPèYËEPèYøéÿÿÿÿÿÿÿÿ “ ¶uU]i" #0$@%P'.fileþÿg.\UnBitArrayBase.cpp@comp.id `ÿÿ@feat.00ÿÿ.drectveZ.debug$S€.rdata„å hò.text‰Ýè)t .text$x \.0|$L76108  ] $L76107 j ˜ ¸ Å  .xdata$x,2‘ŒÒ$T76112$T76118$.sxdata&oÎÍ.debug$F`2À aà Œ` ¼À _memmove â  _POWERS_OF_TWO_MINUS_ONE?CreateUnBitArray@@YAPAVCUnBitArrayBase@@PAVIAPEDecompress@@H@Z??3@YAXPAX@Z??0CUnBitArrayOld@@QAE@PAVIAPEDecompress@@H@Z??0CUnBitArray@@QAE@PAVCIO@@H@Z??2@YAPAXI@Z__ehhandler$?CreateUnBitArray@@YAPAVCUnBitArrayBase@@PAVIAPEDecompress@@H@Z___CxxFrameHandler__except_list?AdvanceToByteBoundary@CUnBitArrayBase@@UAEXXZ?DecodeValueXBits@CUnBitArrayBase@@MAEII@Z?FillAndResetBitArray@CUnBitArrayBase@@UAEHHH@Z?FillBitArray@CUnBitArrayBase@@UAEHXZ?CreateHelper@CUnBitArrayBase@@MAEHPAVCIO@@HH@Z /682 1084342680 100666 9996 ` L$˜Á¡@F.drectveZ´ .debug$S|@B.rdataŠ@@@.text !  P`.rdata0+ [ @0@.debug$FÓ ã @B.textí P`.debug$Fð @B.text P`.debug$F  @B.text) P`.debug$F. > @B.textH P`.debug$FK [ @B.texte P`.debug$Ff v @B.text€ P`.debug$F ‘ @B.text› º  P`.debug$FÎ Þ @B.text è ñ  P`.debug$Fû @B.textÂ × P`.text$x$' P`.rdata0c“ @0@.xdata$xH S@0@.sxdata{0.debug$Fƒ @B.text+m P`.debug$F˜¨@B.text†² P`.debug$F8H@B.textŽR P`.debug$Fàð@B.textú P`.debug$F,<@B/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" < „t5e:\Mac_sdk_399_4\Source\MACLib\Release\UnBitArray.obj8   !Microsoft (R) Optimizing Compiler @€ @€ @€ @€è9@n´™ïºêÒ;ãþíÚô*ùÏûnýfþüþUÿ‹ÿªÿ½ÿÈÿÏÿÓÿÕÿÖÿ×ÿØÿÙÿÚÿÛÿÜÿÝÿÞÿßÿàÿáÿâÿãÿäÿåÿæÿçÿèÿéÿêÿëÿìÿíÿîÿïÿðÿñÿòÿóÿôÿõÿöÿ÷ÿøÿùÿúÿûÿüÿýÿþÿÿÿè9X4t+;!ûQà ÜP¥Ÿø–Y6 zL@!½Üãí!÷³ûËýÐþGÿˆÿ§ÿºÿÄÿÊÿÍÿÐÿÒÿÓÿÔÿÕÿÖÿ×ÿØÿÙÿÚÿÛÿÜÿÝÿÞÿßÿàÿáÿâÿãÿäÿåÿæÿçÿèÿéÿêÿëÿìÿíÿîÿïÿðÿñÿòÿóÿôÿõÿöÿ÷ÿøÿùÿúÿûÿüÿýÿþÿÿÿzLÆ@á/âà> ’wA Çà !&+0 5$:(, !3À &3ÀÂ+Â0Ã5Ã:öD$V‹ñÇt VèƒÄ‹Æ^ @‹ÁÇà Ejÿhd¡Pd‰%QV‹ñ‰t$Ç‹F…ÀÇD$tPèƒÄÇF‹L$Ç^d‰ ƒÄÃÌÌÌÌÌÌÌÌ‹D$…Àt3À ‹j ÿP, ÌÌÌÌÌÌÌÌ̃ì SUV‹ñ‹F;F4Wv‹‹ÎÿR~–Œz‹D$ ‹hÁíƒýv‰l$ë ÇD$‹l$3Ûj‹Î‰\$è=zLrd$‹ C;Ásô‰\$‹F,‹ ‹V(¯È+щV(‹¯Ðƒû?‰V,uj‹Îè‹øj‹ÎÁçè ø‰|$‹ßýŒQ3É…í~ A‹ÅÓø…À÷ƒÁð»Óã‹Å™÷û‹È‹F,A=€‰L$w`‹~‹V0‹F‹èƒå¹+Í‹èÁí‹,¯ÓíÁâƒÀ‰F‹F(åÿ ê‹Õ‹ÍÑéáÿÁà ȉN(‹N,Áá‹Á=€‰n0‰N,vª‹L$‹F,3Ò÷ñ‹~(3Ò‹È‹Ç÷ñ‹Ñ‰N,‹è¯Õ+úù€‰l$‰~(w_‹~‹V0‹F‹èƒå¹+Í‹èÁí‹,¯Óí‹N(ƒÀÁâåÿ ê‰F‹Õ‹ÅÑèÁá%ÿ Á‹N,Áá‰F(‹Á=€‰n0‰N,v«‹l$‹F,¯ë3Ò÷ó‹~(3Ò‹\$‹È‹Ç÷ñ‰N,è¯È‹Å‹l$¯Ý+ù‰~(Øéý~,€w_‹~‹V0‹F‹èƒå¹+Í‹èÁí‹,¯Óí‹N(ƒÀÁâåÿ ê‰F‹Õ‹ÅÑèÁá%ÿ Á‹N,Áá‰F(‹Á=€‰n0‰N,v«‹l$‹F,¯Ý3Ò÷õ‹~(3Ò‹È‹Ç÷ñ‰N,¯È+ù‰~(Øëqj‹Îè3ÿ=è9r ‹ ½G;Ásô‹F,‹½‹N(¯Ð+ʉN(‹ ½¯Èƒÿ?‰N,uj‹Îè‹è3ÿëH‹T$ ‹*ƒýs<3íU‹Îè‹Ø‹ÍÓçß‹L$ ‹qC™+ÂVÑøÁê+‹ƉA;•s7Jë>Mƒý~À~F|·j‹Îè‰D$EðP‹Îè‹Ø‹D$Áã Øëœ;•rB‰öÃt_Ñû^C]‹Ã[ƒÄ Â_Ñû^÷Û]‹Ã[ƒÄ ÂÌÌ‹D$Ç Ç@@ÂÌÌÌÌÌÌÌÌÌÌÌÌSV‹ñ‹WÿP‹^‹~ƒÃ‹Ã‹Ó‰^Áê‹—ƒã¹+˃ÀÓê‰F_ÇF,€¶Â‰F0Ñè‰F(‹F -‰F4^[ÃÌÌÌÌÌÌÌÌÌÌÌÌÌ‹Q,¸€;ÐwV‹q,Wº‹yúÁæ;ð‰yvñ_‰q,^ynƒAðÃÌÌÌÌÌÌÌ̃ìSV‹ñ‹WL$ Q‹ÎÿP‹‹ÎÿR ‹\$3ÿ…Û~!U‹l$›‹L$Q‹ÎÿP‰D½G;û|ë]‹‹ÎÿR$_^[ƒÄÂÌÌÌÌÌÌÌÌÌÌjÿhd¡Pd‰%QV‹ñ‰t$‹D$‹L$Ph@Q‹ÎÇD$Çè‹L$ÇF ÇF$‹Æ^d‰ ƒÄÂÌÌÌÌÌÌÌÌÌÌÌÌÌ‹D$‹T$PRè T ZZS4@HPZÑgã ö  l*l$g4 C U il„l±ÎlÝlñCvIZQZxS}™Z»s‹Mðé¸é‹Mðé¸é XUw UL ~_op q$r(,ÿÿÿÿ “ÿÿÿÿ “PY(u4xTvXžS8VcJ_ o0p@qPr`spt€~SV‹Ñ‹rW‹z‹ÆÁ苇‹ÞƒÆƒã_¹+ˉr^Óè[Ã+b‹Áx,€wcUV‹p0W‹x‹P‹êƒå¹+Í‹êÁí‹,¯ÓíÁæƒÂ‰P‹P(åÿ î‹õ‹ÍÑéÁâáÿ Ê‹P,Áâ‰H(‹Êù€‰h0‰P,v©_^]‹P,‹L$Óê‰P,‹@(‹Ê3Ò÷ñ†gV‹ñ~,€Ww]‹~‹V0U‹F‹èƒå¹+Í‹èÁí‹,¯Óí‹N(ƒÀÁâåÿ ê‰F‹Õ‹ÅÑèÁá%ÿ Á‹N,Áá‰F(‹Á=€‰n0‰N,v«]‹~,‹L$ Óï3ҋω~,‹~(‹Ç÷ñ¯È+ù‰~(_^ÂŽlV‹ñèöD$t VèƒÄ‹Æ^ÂJ@K.fileþÿg.\UnBitArray.cpp@comp.id `ÿÿ@feat.00ÿÿ.drectveZ.debug$S|.rdata^̈"ˆ1€@.textªá‹ÀT o š Ê ù ) O n i.rdata0 .debug$F.text" ž>¦ .debug$F.text r!R®Ò .debug$F  .text z«‹f .debug$F  .text *‡GöP .debug$F .text “mŠ .debug$F.text “m± .debug$F.text»HóšÓ ò .debug$F.text 4ëÛYÿ .debug$F.textÂ(q— 1 L iK.text$x$ÿw¿$L75842 .rdata0 g| Ÿ .xdata$xH]…1$T75849$T75853².sxdata|8Ÿ.debug$F À` .text+lPú .debug$F.text†úÄX .debug$F .text!ŽlÌä:! .debug$F"!j€ ¦  Ü@ ÿ  à I@ $L75903 i $T75908,$T75910$.text#N)¬œ•# .debug$F$#°° Ø_RANGE_WIDTH_2_RANGE_TOTAL_2_RANGE_WIDTH_1_RANGE_TOTAL_1_K_SUM_MIN_BOUNDARY??1CUnBitArrayBase@@UAE@XZ?DecodeValueXBits@CUnBitArrayBase@@MAEII@Z?CreateHelper@CUnBitArrayBase@@MAEHPAVCIO@@HH@Z?AdvanceToByteBoundary@CUnBitArrayBase@@UAEXXZ?FillAndResetBitArray@CUnBitArrayBase@@UAEHHH@Z?FillBitArray@CUnBitArrayBase@@UAEHXZ??_GCUnBitArrayBase@@UAEPAXI@Z??_ECUnBitArrayBase@@UAEPAXI@Z??_7CUnBitArrayBase@@6B@?GenerateArray@CUnBitArrayBase@@UAEXPAHHH@Z?DecodeValue@CUnBitArrayBase@@UAEIW4DECODE_VALUE_METHOD@@HH@Z?DecodeValueRange@CUnBitArrayBase@@UAEHAAUUNBIT_ARRAY_STATE@@@Z?FlushState@CUnBitArrayBase@@UAEXAAUUNBIT_ARRAY_STATE@@@Z?FlushBitArray@CUnBitArrayBase@@UAEXXZ?Finalize@CUnBitArrayBase@@UAEXXZ??_GCUnBitArrayBase@@UAEPAXI@Z??3@YAXPAX@Z??0CUnBitArrayBase@@QAE@XZ??1CUnBitArray@@UAE@XZ??_GCUnBitArray@@UAEPAXI@Z??_ECUnBitArray@@UAEPAXI@Z??_7CUnBitArray@@6B@__ehhandler$??1CUnBitArray@@UAE@XZ___CxxFrameHandler__except_list?DecodeValue@CUnBitArray@@UAEIW4DECODE_VALUE_METHOD@@HH@Z?GetC@CUnBitArray@@AAEEXZ?RangeDecodeFast@CUnBitArray@@AAEHH@Z?RangeDecodeFastWithUpdate@CUnBitArray@@AAEHH@Z?DecodeValueRange@CUnBitArray@@UAEHAAUUNBIT_ARRAY_STATE@@@Z?FlushState@CUnBitArray@@UAEXAAUUNBIT_ARRAY_STATE@@@Z?FlushBitArray@CUnBitArray@@UAEXXZ?Finalize@CUnBitArray@@UAEXXZ?GenerateArrayRange@CUnBitArray@@AAEXPAHH@Z??0CUnBitArray@@QAE@PAVCIO@@H@Z__ehhandler$??0CUnBitArray@@QAE@PAVCIO@@H@Z??_GCUnBitArray@@UAEPAXI@Z?GenerateArray@CUnBitArray@@UAEXPAHHH@Z/707 1084342681 100666 18000 ` L>™Á¡@å*ô.drectveZÄ .debug$S @B.text ¤  P`.rdata® ¾ @0@.debug$Fæ ö @B.text   P`.debug$F3 C @B.textM P`.debug$FT d @B.text)n P`.debug$F— § @B.text ± º  P`.debug$FÄ Ô @B.textÞ P`.debug$Fî þ @B.text P`.debug$F  @B.text% P`.debug$F5 E @B.textO P`.debug$FR b @B.textl P`.debug$F| Œ @B.text– P`.debug$F™ © @B.text³ P`.debug$F¶ Æ @B.textNÐ   P`.debug$F( 8 @B.textNB  P`.debug$Fš ª @B.textN´  P`.debug$F @B.text$&J P`.debug$FTd@B.textn g P`.text$xÜ#í# P`.xdata$x@ñ$1&@0@.sxdata!'0.debug$F 5'Õ' @B.rdata9(@@@.textA(F( P`.debug$FP(`(@B.text j(Š( P`.debug$F”(¤(@B.text®(³( P`.debug$F½(Í(@B.text ×(÷( P`.debug$F))@B.text) ) P`.debug$F*):)@B.text D)d) P`.debug$Fn)~)@B.text$ˆ)¬) P`.debug$F¶)Æ)@B.text:Ð) * P`.debug$F*$*@B.rdata.*>*@0@.textf* P`.debug$F**@B.text™*·* P`.debug$FË*Û*@B/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ? „t8e:\Mac_sdk_399_4\Source\MACLib\Release\APEDecompress.obj8   !Microsoft (R) Optimizing CompilerÇà    öD$V‹ñÇt VèƒÄ‹Æ^  ‹AAËD$‹QЋÂV‹q‰Q‹Q+Ö;Â^| ‰A ÇAÂ) "‹ÁÇà '‹ÁÇ@ÇÃ,‹Ã1‹ÁÇ@ÇÃ6‹Ã;‹ÁÇ@ÇÃ@‹ÃE‹ÃJV‹ñ‹F…ÀtB‹…Ét<‹F…Àt)‹Qü…ÒAüt‹jÿÇ^ÃPèƒÄÇ^ËjÿÇ^Ã1NOV‹ñ‹F…ÀtB‹…Ét<‹F…Àt)‹Qü…ÒAüt‹jÿÇ^ÃPèƒÄÇ^ËjÿÇ^Ã1NTV‹ñ‹F…ÀtB‹…Ét<‹F…Àt)‹Qü…ÒAüt‹jÿÇ^ÃPèƒÄÇ^ËjÿÇ^Ã1NYV‹ñ‹F…Àt‹…Àt‹NPèƒÄÇ^Ã$^U‹ìjÿhd¡Pd‰%ƒì SV‹ñ3Ûfƒ~#W‰eð‰uè‰]ü…f‹F<¨tj¨tf3ÿ;}J‹–¤‹Ž¨F4PÊQV!RjjN è‹F‹Ž¤‹ž˜È‹Á‰Ž¤‹Ž”+Ë;Á|‰†œÇ†¤G뜨tëI;]Ý‹NL‹‹~hFXPÿR‹jP‹ÏÿR‹–¨‹¾¤N4Q×RN!QjPN è‹V‹†¤‹Ž”‹¾˜Â+Ï;Á‰†¤|‰†œÇ†¤C놋N@SShèè=nÇE쌵ëI‹Uì;U:‹NL‹V`RÿP‹NLVX‹ø‹RÿP‹–€‹NtR‹Ø‹WÿP‹Nh‹ø‹WSÿP‰†€‹–¨‹ž¤N4QÓRN!QWPN è‹V‹ž¤‹Ž”‹¾˜Ú‹Ã+Ï;Á‰ž¤|‰†œÇ†¤ÿEìéXÿÿÿ뛋Uì;UŠ‹NL‹‹~hVXRÿP‹jP‹ÏÿR‹NL‹~tV`‹Ø‹RÿP‹jP‹ÏÿR‹–¨N4Q–¤RN!QPSN è‹V‹ž¤‹Ž”‹¾˜Ú‹Ã+Ï;Á‰ž¤|‰†œÇ†¤ÿEìédÿÿÿöF<td3ÿ;}鋎¤‹†¨V4RÁPN!QjjN è‹V‹†¤‹Ž”‹ž˜Â+Ë;Á‰†¤|‰†œÇ†¤Gëž;]‡‹NL‹‹~hFXPÿR‹jP‹ÏÿR‹–¨‹¾¤N4Q×RN!QjPN è‹V‹†¤‹Ž”‹¾˜Â+Ï;Á‰†¤|‰†œÇ†¤C놋UèÇ‚„¸Ã‹u苎ˆ‹EÈ‰Žˆ‹Mô_^d‰ [‹å]ÂÌÌÌÌÌÌV‹ñ‹NLjjÇF4ÿÿÿÿ‹jÿP‹N@jjhè‰F8dž„ÇF<è=ì~‹F8…Ày‹NL‹jjjÿR‰F fT fi fƒ f› f¹ rÓ ÎÙ rá rï Ä º Y Y) T6 O@ H rS ÛY ra r~ rµ ÚÊ ÙÙ T Ø> ×V Yl ت ׸ Øò Ö Y ØW Öo Y’ r· á$ u+ à; c¨ à´ ßymѨÞ×í2r9ñArLÑíðøyØ6re®wr‚®“r¸é‹Mðé‹MðƒÁ@é‹MðƒÁLé‹MðƒÁhé‹MðƒÁté‹MðÁé¸é‹Mðé‹MðƒÁ@é‹MðƒÁLé‹MðƒÁhé‹MðƒÁté¸é‹EðPèYËEðPèYËEðPèYËEðPèYøéMèé¸énk $š/¤:¤HºMÆRkZ epš{¤†¤‹Ïk™¤¯ºÁÜÆkήÓòØkÿÿÿÿÿÿÿÿ “ÿÿÿÿ “ÿÿÿÿ “ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ “ÿÿÿÿ “e0p<qDoTÀ\¿d¾l½t¼|»ˆÇ Í¨Ì°Ë¸ÊÀÉÌÐäÕìÔôÓüÒÝ ï,ójÅÎÛñŸOk +s €J«Ñ mux y0z@¶PÈ`ÑpÞ€ìî@@éOV‹ñè‹D$‹L$ ‹T$‰F‰N‰^ O •éTšV‹ñè‹D$‹L$ ‹T$‰F‰N‰^ T ŸéY¤V‹ñè‹D$‹L$ ‹T$‰F‰N‰^ Y ©V‹ñ‹F…Àt‹…Àt‹NPèƒÄÇ^Ã$®V‹ñ‹F…Àt‹…Àt‹NPèƒÄÇ‹D$‹L$ ‹T$‰F‰N‰^ :³¸ìî z‹T$‹Á‹L$ ‰H‹L$‰P‰ äV‹ñèöD$t VèƒÄ‹Æ^ÂÈ·.fileþÿg.\APEDecompress.cpp@comp.id `ÿÿ@feat.00ÿÿ.drectveZ.debug$S.textªá‹À  ) G i .rdatae.debug$F.text»Hóš} › .debug$F.textÄ·«Q¨ .debug$F .text )¢Ù-× .debug$F  .text  4ëÛY .debug$F  .text..~í  .debug$F.text*VöC .debug$F.text..~ír .debug$F.text*Vöœ .debug$F.text..~íÙ .debug$F.text*Vö .debug$F.text*VöO .debug$F.textN³z`j .debug$F.textN³z`’ .debug$F.text N³z`Á .debug$F! .text"$&.OÖõ" .debug$F#".text$g䈨/$ $L76651“$$L76528€$ F { .text$x%Ü®ª—±% ð .xdata$x&@\™ s$T766444&$T76656 &$T76657&$T76655&.sxdata'½†ó¬À$ .debug$F(  4`$ U°$ z $ $L76230î$$L76229ß$µ $L76217x$$L76215c$$L76728,$$L76721<$$L76194$$L76193ó$$L76190¬$$L76189—$.rdata)ÔH]ºÈ)$L76186]$$L76185H$$L76727$à __ftol2 .text*®¥Ä%ê* .debug$F+*.text, ‚µNË , .debug$F-,.text.®¥Ä%D. .debug$F/..text0 ‚µNËn0 .debug$F10.text2®¥Ä%³2 .debug$F32.text4 ‚µNËâ4 .debug$F54.text6$&.OÖ16 .debug$F76.text8:¼’VJ8 .debug$F98mP$ ™ · i·Õ $L76782>% $L767813% $L76780(% $L76779% $L76778% $L76777 % î .rdata::L% $T77393€&$T77432P&WÐ $ $L77438% $L77437t% $L77436i% $L77435^% $L77434V% qŠ% $T77456Ä&$T77458œ&—P $ $L77479µ% $L77478ª% $L77477Ÿ% $L77476”% Æ ø ' 4 t šÀ% $T77502&$T77504à&Õ  $ ý  > .text;Jh q\ ; .debug$F<;.text=N)¬œz = .debug$F>=˜ P$ ¿ Þ 0$ $L77576Ê% ü  Ò% $T77636$&$T77641&C ??1IAPEDecompress@@UAE@XZ__purecall??_GIAPEDecompress@@UAEPAXI@Z??_EIAPEDecompress@@UAEPAXI@Z??_7IAPEDecompress@@6B@??_GIAPEDecompress@@UAEPAXI@Z??3@YAXPAX@Z?GetDirectWritePointer@CCircleBuffer@@QAEPAEXZ?UpdateAfterDirectWrite@CCircleBuffer@@QAEXH@Z??0IAPEDecompress@@QAE@XZ??0?$CSmartPtr@VCAPEInfo@@@@QAE@XZ??C?$CSmartPtr@VCAPEInfo@@@@QBEPAVCAPEInfo@@XZ??0?$CSmartPtr@VCUnBitArrayBase@@@@QAE@XZ??C?$CSmartPtr@VCUnBitArrayBase@@@@QBEPAVCUnBitArrayBase@@XZ??0?$CSmartPtr@VIPredictorDecompress@@@@QAE@XZ??C?$CSmartPtr@VIPredictorDecompress@@@@QBEPAVIPredictorDecompress@@XZ??B?$CSmartPtr@D@@QBEPADXZ?Delete@?$CSmartPtr@VCAPEInfo@@@@QAEXXZ?Delete@?$CSmartPtr@VCUnBitArrayBase@@@@QAEXXZ?Delete@?$CSmartPtr@VIPredictorDecompress@@@@QAEXXZ?Delete@?$CSmartPtr@D@@QAEXXZ?DecodeBlocksToFrameBuffer@CAPEDecompress@@IAEXH@Z?GetInfo@CAPEInfo@@QAEHW4APE_DECOMPRESS_FIELDS@@HH@Z?Unprepare@CPrepare@@QAEXHHPBUtWAVEFORMATEX@@PAEPAI@Z__ehhandler$?DecodeBlocksToFrameBuffer@CAPEDecompress@@IAEXH@Z___CxxFrameHandler__except_list?StartFrame@CAPEDecompress@@IAEXXZ?EndFrame@CAPEDecompress@@IAEXXZ?SeekToFrame@CAPEDecompress@@IAEHH@Z?GetInfo@CAPEDecompress@@UAEHW4APE_DECOMPRESS_FIELDS@@HH@Z_FillWaveHeader@16__real@408f400000000000__fltused??1?$CSmartPtr@VCAPEInfo@@@@QAE@XZ?Assign@?$CSmartPtr@VCAPEInfo@@@@QAEXPAVCAPEInfo@@HH@Z??1?$CSmartPtr@VCUnBitArrayBase@@@@QAE@XZ?Assign@?$CSmartPtr@VCUnBitArrayBase@@@@QAEXPAVCUnBitArrayBase@@HH@Z??1?$CSmartPtr@VIPredictorDecompress@@@@QAE@XZ?Assign@?$CSmartPtr@VIPredictorDecompress@@@@QAEXPAVIPredictorDecompress@@HH@Z??1?$CSmartPtr@D@@QAE@XZ?Assign@?$CSmartPtr@D@@QAEXPADHH@Z??0CAPEDecompress@@QAE@PAHPAVCAPEInfo@@HH@Z??_GCAPEDecompress@@UAEPAXI@Z??_ECAPEDecompress@@UAEPAXI@Z??1CCircleBuffer@@UAE@XZ??0CCircleBuffer@@QAE@XZ??_7CAPEDecompress@@6B@__ehhandler$??0CAPEDecompress@@QAE@PAHPAVCAPEInfo@@HH@Z??1CAPEDecompress@@UAE@XZ__ehhandler$??1CAPEDecompress@@UAE@XZ?InitializeDecompressor@CAPEDecompress@@IAEHXZ??0CPredictorDecompressNormal3930to3950@@QAE@HH@Z??0CPredictorDecompress3950toCurrent@@QAE@HH@Z??2@YAPAXI@Z?CreateUnBitArray@@YAPAVCUnBitArrayBase@@PAVIAPEDecompress@@H@Z?CreateBuffer@CCircleBuffer@@QAEXHH@Z__ehhandler$?InitializeDecompressor@CAPEDecompress@@IAEHXZ?FillFrameBuffer@CAPEDecompress@@IAEHXZ?RemoveTail@CCircleBuffer@@QAEHH@Z?MaxGet@CCircleBuffer@@QAEHXZ?MaxAdd@CCircleBuffer@@QAEHXZ??0?$CSmartPtr@D@@QAE@PADHH@Z??_GCAPEDecompress@@UAEPAXI@Z?GetData@CAPEDecompress@@UAEHPADHPAH@Z?Get@CCircleBuffer@@QAEHPAEH@Z?Seek@CAPEDecompress@@UAEHH@Z?Empty@CCircleBuffer@@QAEXXZ__ehhandler$?Seek@CAPEDecompress@@UAEHH@Z/735 1084342681 100666 7105 ` L ™Á¡@=..drectveZÌ .debug$Sz&@B.rdata€ @@@.text' G P`.debug$FQa@B.text$k P`.debug$F™©@B.text¼³o P`.debug$F ç‡ @B.text.ë P`.debug$F#3@B/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" : „t3e:\Mac_sdk_399_4\Source\MACLib\Release\BitArray.obj8   !Microsoft (R) Optimizing Compiler @€ @€ @€ @€zL@!½Üãí!÷³ûËýÐþGÿˆÿ§ÿºÿÄÿÊÿÍÿÐÿÒÿÓÿÔÿÕÿÖÿ×ÿØÿÙÿÚÿÛÿÜÿÝÿÞÿßÿàÿáÿâÿãÿäÿåÿæÿçÿèÿéÿêÿëÿìÿíÿîÿïÿðÿñÿòÿóÿôÿõÿöÿ÷ÿøÿùÿúÿûÿüÿýÿþÿÿÿzLÆ@á/âà> ’wA V‹ñW3À¹‹þVó«èƒÄ_ÇF\¸^Ã'‹D$VW‹|$W‹ñPVè‹F\ƒÄ Ç_‰F\^Â$ V‹ñ‹…ÀtPèƒÄÇ^ÃÌÌÌÌÌÌQ‹D$SV‹ñW‹~Áï…ÀÇD$ ^t6‹<½WPSè{\‹N‹ƒÄ D$ P‹WPÿR…Àup_‰F^[Y‹ÁçWQSè{\‹N‹ƒÄ D$ P‹WPÿR…Àu>‹N‹Á鋈‰‹VƒâG=ÿ?‰Vr¸ÿ?‹>‹È‹ÑÁéƒÇ3Àó«‹Êƒáóª3À_^[YÂÌÌÌÌÌÌÌÌÌÌÌÌÌÌV‹ñ~€ÿvjè…À…&~€‡üW¿‹ÿ‹F =€su‹F‹‹ÈÁ銃à¹+ȶFÓà ‹V‹NׅɉV‹Ât8›‹‹ÈÁ銃à¹+ȸÿÓà ‹F‹VÇJ‹Ê…ɉF‰Vu΋F ‹ÈÁéˆNëS…ÀyL‹F‹‹ÐƒàÁꑹ+È3ÀŠF@%ÿÓà ‹N‹F͉F‹F ‹ÈÁéÇFˆNëÿF‹N%ÿÿÁàÁá‰F ‹Á=€‰N† ÿÿÿ_‹L$ ‹VÓê‹N ‹Â¯D$ȉV‰N 3À^ÂÌÌÌÌÌÌÌÌÌÌÌV‹ñ~ø?v jè…ÀuI‹N‹T$‹ÁÁèƒáS‹Ù‹u‰ƒF [3À^ÂUW<‹Ë‹êÓí /¹ +ËÓâ‹_]‰TƒF 3À[^ÂÌÌÌÌÌÌÌÌÌÌÌÌŠQ°„Ðt¤$‹QB„ЉQuõÃÌÌÌÌQV‹ñ~€ÿvjè…À…·SUW‹|$…ÿ~|?ÿë÷ßÑç‹L$‹YG™+ÂÑøSÁê+‹ÉA;•sJë ;•rB‰‹Ã™ƒâÂÁøƒø‹È¹‹Ç™÷ù‰L$½‹Ð¯Ñ‹N+úƒø?‰|$ù€‡ð»€‹N ù€sr‹V‹>‹ÊÁé<ƒâ¹+ʶVÓâ ‹~‹Vý…Ò‰~‹Ït5‹>‹ÑÁê—‹ùƒç¹+Ï¿ÿÓç :‹N‹~ÍO‹×…Ò‰N‰~uÌ‹N ‹ÑÁêˆVëO…ÉyH‹V‹>‹ÊÁé<ƒâ¹+Ê3ÒŠVBâÿÓâ ‹NÍV‹N ‹ÑÁêÇFˆVëÿF‹VáÿÿÁáÁâ‰N ‹Ê;ˉV†ÿÿÿ·N‹…¯Ñ‰V‹…éOù€‡÷»€I‹N ù€sv‹V‹>‹ÊÁé<ƒâ¹+ʶVÓâ ‹~‹Vý…Ò‰~‹Ït9ëI‹>‹ÑÁê—‹ùƒç¹+Ï¿ÿÓç :‹N‹~ÍO‹×…Ò‰N‰~uÌ‹N ‹ÑÁêˆVëO…ÉyH‹V‹>‹ÊÁé<ƒâ¹+Ê3ÒŠVBâÿÓâ ‹NÍV‹N ‹ÑÁêÇFˆVëÿF‹VáÿÿÁáÁâ‰N ‹Ê;ˉV†ÿÿÿ·N‹~ ‹ÑiÒÿÿú»€;ˉN‰~ ‡üë ¤$d$‹N ù€ƒr‹V‹>‹ÊÁé<ƒâ¹+ʶVÓâ ‹~‹Vý…Ò‰~‹Ït5‹>‹ÑÁê—‹ùƒç¹+Ï¿ÿÓç :‹N‹~ÍO‹×…Ò‰N‰~uÌ‹N ‹ÑÁêˆVëO…ÉyH‹V‹>‹ÊÁé<ƒâ¹+Ê3ÒŠVBâÿÓâ ‹NÍV‹N ‹ÑÁêÇFˆVëÿF‹VáÿÿÁáÁâ‰N ‹Ê;ˉV†ÿÿÿ·N‹~ ‹ÐÁúâÿÿ¯Ñú;ˉN‰~ ‡ûë ¤$I‹N ù€ƒr‹V‹>‹ÊÁé<ƒâ¹+ʶVÓâ ‹~‹Vý…Ò‰~‹Ït5‹>‹ÑÁê—‹ùƒç¹+Ï¿ÿÓç :‹N‹~ÍO‹×…Ò‰N‰~uÌ‹N ‹ÑÁêˆVëO…ÉyH‹V‹>‹ÊÁé<ƒâ¹+Ê3ÒŠVBâÿÓâ ‹NÍV‹N ‹ÑÁêÇFˆVëÿF‹VáÿÿÁáÁâ‰N ‹Ê;ˉV†ÿÿÿ·N‰N%ÿÿ¯Á‹N È‹D$=‰N Œ‚3Û3É;Ã~ IA‹ÐÓú…Ò÷‹D$ƒÁð¿Óç™÷ÿ‰|$‹ø‹D$™÷|$G‰D$~€‰T$‡ð‹F =€ƒq‹F‹‹ÈÁ銃à¹+ȶFÓà ‹V‹NÕ;ˉV‹Ât4‹ÿ‹‹ÈÁ銃à¹+ȸÿÓà ‹F‹VÅJ‹Ê;ˉF‰Vu΋F ‹ÈÁéˆNëO…ÀyH‹F‹‹ÐƒàÁꑹ+È3ÀŠF@%ÿÓà ‹N‹F͉F‹F ‹ÈÁé‰^ˆNëÿF‹N%ÿÿÁàÁá‰F ‹Á=€‰N†ÿÿÿ‹F3Ò÷÷‹~ ‹Ð¯T$ú=€‰F‰~ ‡ë ¤$d$‹F =€ƒv‹F‹‹ÈÁé‹<ŠŠƒà¹+ȶFÓà ø‰:‹V‹NÕ;ˉV‹Ât4‹‹ÈÁ銃à¹+ȸÿÓà ‹~‹VýJ‹Ê;ˉ~‹Ç‰VuÌ‹F ‹ÈÁéˆNëO…ÀyH‹F‹‹ÐƒàÁꑹ+È3ÀŠF@%ÿÓà ‹N‹~‹F Íú‹ÈÁé‰~‰^ˆNëÿF‹N%ÿÿÁàÁá‰F ‹Á=€‰N† ÿÿÿ‹F3Ò÷t$‹N _][‰F¯D$ȉN 3À^YÂ~€‡¿€¤$‹F =€ƒv‹F‹‹ÐÁê‹‘‘ƒà¹+ȶFÓà Ø‰‹V‹NՅɉV‹Ât4‹‹ÈÁ銃à¹+ȸÿÓà ‹^‹VÝJ‹Ê…ɉ^‹Ã‰VuÌ‹F ‹ÈÁéˆNëS…ÀyL‹F‹‹ÐƒàÁꑹ+È3ÀŠF@%ÿÓà ‹N‹^‹F ÍÚ‹ÈÁé‰^ÇFˆNëÿF‹N%ÿÿÁàÁá‰F ‹Á;ljN† ÿÿÿ‹F3Ò÷t$‹N _][‰F¯D$ȉN 3À^YÂÌÌÌÌÌÌÌÌŠQ°„Ðt¤$‹QB„ЉQuõ3À‰A ÇA€ˆA‰AÃÌÌ‹D$Ç Ç@@ÂÌÌÌÌÌÌÌÌÌÌÌÌU‹Á‹HV½€;ÍW¾‡õ›‹H ù€sv‹P‹8‹ÊÁé<ƒâ¹+ʶPÓâ ‹x‹Pþ…Ò‰x‹Ït9ëI‹8‹ÑÁê—‹ùƒç¹+Ï¿ÿÓç :‹H‹xÎO‹×…Ò‰H‰xuÌ‹H ‹ÑÁêˆPëO…ÉyH‹P‹8‹ÊÁé<ƒâ¹+Ê3ÒŠPBâÿÓâ ‹HÍP‹H ‹ÑÁêÇ@ˆPëÿ@‹PáÿÿÁáÁâ‰H ‹Ê;͉P†ÿÿÿ‹P‹h ‹8‹ÊÁéÁí<ƒâ¹E+ÊýÿvV3ÒŠPBâÿÓâ ‹P‹HօɉP„~‹8‹ÊÁé<ƒâ¹+Ê3ÒÓâ ‹H‹xÎO‰H‹Ñ‹Ï…ɉxuÏëK¶PÓâ ‹P‹HօɉPt4‹8‹ÊÁé<ƒâ¹+ʺÿÓâ ‹H‹xÎO‰H‹Ñ‹Ï…ɉxuÌ‹8‹ÊÁé<ƒâåÿ¹+ÊÓå /‹h‹8î‹Õ‹ÍÁé<ƒâ‰h¹+Ê3ÒÓâ ‹h‹8î‹Õ‹ÍÁé<ƒâ‰h¹+Ê3ÒÓâ ‹h‹8î‹Õ‹ÍÁé<ƒâ¹+ʉh‹/3ÒÓâ ê‰/‹H_Î^‰H]ÃSV‹ñW^3À¹‹ûSó«èh@ÇC\è‹ø3À‰>¹ó«‰F‹D$ƒÄ‰F_‹Æ^[ L~ÿOà" . v ƒ …–- EdØ.pL 0!@"P#`$p%€&,‹D$…ÀV‹ñtW3À¹‹þVó«èƒÄÇF\_‹Æ^Â. ).fileþÿg.\BitArray.cpp@comp.id `ÿÿ@feat.00ÿÿ.drectveZ.debug$Sz.rdata€I*’´€€.text'àCa2 Q .debug$F.text$|Um  .debug$F.text¼ RP’ȯ Ä .debug$F   Ñ  ôð @ ;° dÐ ˜°  ¹à  ë  .text .Å»ž“ .debug$F  p ; H_RANGE_WIDTH_RANGE_TOTAL_K_SUM_MIN_BOUNDARY?Initialize@CMD5Helper@@QAEHXZ?MD5Init@@YAXPAUMD5_CTX@@@Z?AddData@CMD5Helper@@QAEXPBXH@Z?MD5Update@@YAXPAUMD5_CTX@@PBEI@Z??1CBitArray@@QAE@XZ??3@YAXPAX@Z?OutputBitArray@CBitArray@@QAEHH@Z?EncodeBits@CBitArray@@QAEHIH@Z?EncodeUnsignedLong@CBitArray@@QAEHI@Z?AdvanceToByteBoundary@CBitArray@@QAEXXZ?EncodeValue@CBitArray@@QAEHHAAUBIT_ARRAY_STATE@@@Z?FlushBitArray@CBitArray@@QAEXXZ?FlushState@CBitArray@@QAEXAAUBIT_ARRAY_STATE@@@Z?Finalize@CBitArray@@QAEXXZ??0CMD5Helper@@QAE@H@Z??0CBitArray@@QAE@PAVCIO@@@Z??2@YAPAXI@Z /758 1084342681 100666 11592 ` L9™Á¡@¯®.drectveZü .debug$SƒV @B.text$Ù ý  P`.debug$F  @B.text'! H  P`.debug$FR b @B.textl P`.debug$Fp € @B.textŠ P`.debug$FŽ ž @B.text¨ P`.debug$F¬ ¼ @B.textÚÆ   P`.debug$FÌ\ @B.text¶ P`.debug$FÆÖ@B.textà P`.debug$Fãó@B.textý P`.debug$F @B.text' P`.debug$F*:@B.textD P`.debug$FGW@B.texta P`.debug$Fq@B.text‹ P`.debug$FŽž@B.text¨ P`.debug$F«»@B.text$Åé P`.debug$Fó@B.textN [ P`.debug$Feu@B.textTÓ P`.debug$F@B.text= P`.debug$FQa@B.textk P`.debug$Fn~@B.text$ˆ¬ P`.debug$F¶Æ@B.text:Ð  P`.debug$F$@B.text.3 P`.debug$F=M@B.text Ww P`.debug$F‘@B.textY›ô P`.debug$F&6@B.text@E P`.debug$FO_@B.text i‰ P`.debug$F“£@B.text$x2­ß P`.xdata$xP%u@0@.sxdata§0/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" C „t N @B.textX P`.debug$F[ k @B.textu P`.debug$F… • @B.textŸ P`.debug$F¢ ² @B.text¼ P`.debug$FÌ Ü @B.textæ P`.debug$Fé ù @B.textN Q  P`.debug$F[ k @B.text$u ™  P`.debug$F£ ³ @B.text$½ á  P`.debug$Fë û @B.textT Y  P`.debug$F‹ › @B.text¥ à  P`.debug$F× ç @B.text®ñ Ÿ1 P`.debug$F@‰É@B.textñö P`.debug$F@B.text : P`.debug$FDT@B.text$^‚ P`.debug$FŒœ@B.text:¦à P`.debug$Fêú@B.text$( P`.debug$F2B@B.text:L† P`.debug$F @B.textYª P`.debug$F5E@B.textOT P`.debug$F^n@B.text x˜ P`.debug$F¢²@B.text$x¾¼z P`.xdata$x¸Bú@0@.sxdata®0/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" A „t:e:\Mac_sdk_399_4\Source\MACLib\Release\APECompressCore.obj8   !Microsoft (R) Optimizing Compiler‹ÁÇ@Çà ‹Ã‹ÁÇ@ÇËËÁÇ@ÇËÃ$‹ÁÇ@ÇÃ)‹Ã.V‹ñ‹F…ÀtB‹…Ét<‹F…Àt)‹Qü…ÒAüt‹jÿÇ^ÃPèƒÄÇ^ËjÿÇ^Ã14N3V‹ñ‹F…Àt‹…Àt‹NPèƒÄÇ^Ã4$9V‹ñ‹F…Àt‹…Àt‹NPèƒÄÇ^Ã4$>SŠ\$öÃV‹ñt+‹FüWh~üPj|VèöÃt WèƒÄ‹Ç_^[‹ÎèöÃt VèƒÄ‹Æ^[ÂED)4;EF4T CV‹ñèöD$t VèƒÄ‹Æ^ÂE4JSVW‹|$‹ñ^xSWÇ‹F@‹V4‹NX\$ SPR‹T$(FdP‹D$(RPÇD$8è…Àu$‹T$‹Rè…Àu‹?…ÿt ‹Wè…Àu3À_^[ ÌÌÌQS‹\$V‹ñ·Np‹Ã™÷ù‹WÇD$ ‹ø‰|$è‹D$T$ RSP‹Îè…À…Ò‹N ‹UÿR‹N‹ÿP‹^$Sè‹n,Uè‹èf‹Fff=…PŠL$öÁ¿‹Çt öÁt3ÿ3ÀöÁt3À…ÿ„Ø…À„}‹L$3À3ÿ…ÉŽL‹ÿ‹.‹V@‹N‹º‰l$n,U‹)PRÿU‹L$Pè‹F@‹V4‹.‹¸‹N ‹ºSP‰l$ ‹)RÿU‹L$Pè‹F4‹¸‹L$G;ù|¦‹è]_^3À[Y‹D$3í…ÀŽÑ¤$‹F4‹N ‹¨‹‹>SjPÿRP‹Ïè…À…¯‹D$E;è|Ó‹è]_^3À[YÂ…À„„‹D$3Û…ÀŽv‹F@‹N‹˜‹‹>UjPÿRP‹Ïè…Àu_‹D$C;Ø|׋è]_^3À[YÂf=u6öD$u/3í…ÿ~)‹F4‹N ‹¨‹‹>SjPÿRP‹Ïè…Àu‹D$E;è|׋è3À]_^[YÂÌÌÌÌÌjÿhd¡Pd‰%ƒìSUV‹ñW½3ÿ‰t$‰n‰>‰|$ ‰n‰~ ‰n ‰~‰n<‰~4‰nH‰~@‰nT‰~L‰n`‰~Xj|ÆD$$èƒÄ‰D$;ÇÆD$ t‹L$(Q‹Èè‹Øë3Û‹ÎÆD$ 艋\$0ÁãS‰n‰~è‰D$,‹F<ƒÄ;Çt‹F4;Çt‹N8PèƒÄ‰~4‹T$(S‰n<‰n8‰V4è‰D$,‹FHƒÄ;Çt‹F@;Çt‹NDPèƒÄ‰~@‹D$(S‰nH‰nD‰F@è‹Ø‹FTƒÄ;Çt‹FL;Çt‹NPPèƒÄ‰~LU‰nT‰nP‰^Lè‹Ø‹F`ƒÄ;Çt‹FX;Çt‹N\PèƒÄ‰~XjP‰n`‰~\‰^XèƒÄ‰D$(;ÇÆD$ t‹L$4Q‹Èè‰D$(ë‰|$(^ ‹ËÆD$ è‹T$(jP‰k‰{‰èƒÄ‰D$(;ÇÆD$ t‹L$4Q‹Èè‰D$4ë‰|$4^‹ËÆD$ è‹T$4‹L$,‰k‰{‰‹Fd‰‹Q‰P‹Q‰P‹Q ‰P f‹I‰~xf‰H‹L$_‹Æ^][d‰ ƒÄÂÌÌjÿhd¡Pd‰%QSV‹ñ‰t$‹F`3Û;ÃÇD$t‹FX;Ãt‹N\PèƒÄ‰^X9^TÆD$t‹FL;Ãt‹NPPèƒÄ‰^L9^HÆD$t‹F@;Ãt‹NDPèƒÄ‰^@9^<ÆD$t‹F4;Ãt‹N8PèƒÄ‰^4NÆD$èN ˆ\$è‹ÎÇD$ÿÿÿÿè‹L$ ^[d‰ ƒÄÃ;QKP]P”|¦OÊ{Õ{ÜzPywyxÈyàxy0xiy}x“—™¡î– •t1–O4h–†4Ÿ–»4Жì4–”73J–f”3ÄÓ§Ùá 4+4K4k4~3Š3™t¦m  >)ÞOw ‡0 é3VV‹ñè‹D$‹L$ ‹T$‰F‰N‰^ 3 [V‹ñ‹F…Àt‹…Àt‹NPèƒÄÇ^Ã4$`V‹ñ‹F…Àt‹…Àt‹NPèƒÄÇ‹D$‹L$ ‹T$‰F‰N‰^ 4:eV‹ñ‹F…Àt‹…Àt‹NPèƒÄÇ^Ã4$jV‹ñ‹F…Àt‹…Àt‹NPèƒÄÇ‹D$‹L$ ‹T$‰F‰N‰^ 4:oW‹ù‹G…ÀtMV‹7…ötE‹G…Àt(‹FüSh^üPj|VèSèƒÄ[^Ç_ËÎèVèƒÄÇ^_ÃE)D/4CEI4YtétV‹ñè‹D$‹L$ ‹T$‰F‰N‰^ t „‹Mìé‹MìƒÁ é‹MìƒÁé‹MìƒÁ4é‹MìƒÁ@é‹MìƒÁLé‹MìƒÁXé‹EðPèYËEPèYËEPèYøé‹Mðé‹MðƒÁ é‹MðƒÁé‹MðƒÁ4é‹MðƒÁ@é‹MðƒÁLé¸éVV%`0`;`FjO4Z4e4l›q˜y„VVš`¥`°`µ¨º˜ÿÿÿÿ “ ÿÿÿÿ ““ ’‘$,Ž4<ŒD‹LŠXœp¦x¥€¤ˆ£¢˜¡¤©—§.fileþÿg.\APECompressCore.cpp@comp.id `ÿÿ@feat.00ÿÿ.drectveZ.debug$S.text..~í .debug$F.text*Vö( .debug$F.text..~íY .debug$F.text *Vö† .debug$F  .text ..~íÉ .debug$F  .text *Vöâ .debug$F .text..~íý .debug$F.text*Vö  .debug$F.textN³z`O  .debug$F.text$&.OÖŽ .debug$F.text$&.OÖ¬ .debug$F.textTÏ·ƒÔ í  .debug$F.textN)¬œ .debug$F.text®1Ô·„2 [ ‚ .debug$F@.text®¥Ä%» .debug$F .text! ‚µNËè! .debug$F"!.text#$&.OÖ3# .debug$F$#.text%:¼’VL% .debug$F&%.text'$&.OÖo' .debug$F('.text):¼’V’) .debug$F*).text+YÓ.”èÉ+ .debug$F,+òp  8 l  ¿ .text-®¥Ä%è- .debug$F.-.text/ ‚µNË / .debug$F0/E .text$x1¾<\º‰$L76094`1 $L76093U1 $L76092J1 $L76091?1 $L7609041 $L76089)1 $L760881 $L760871 $L760861 $L760851 } ¢ ¿ Ìk1  .xdata$x2¸M€Éµ$T76220P2$T762232#.sxdata3Tœùõ1Ð $L76231©1 $L76230ž1 $L76229“1 $L76228ˆ1 $L76227}1 $L76226u1 M´1 $T76327œ2$T76329l2u??0?$CSmartPtr@VCBitArray@@@@QAE@XZ??C?$CSmartPtr@VCBitArray@@@@QBEPAVCBitArray@@XZ??0?$CSmartPtr@VIPredictorCompress@@@@QAE@XZ??C?$CSmartPtr@VIPredictorCompress@@@@QBEPAVIPredictorCompress@@XZ??0?$CSmartPtr@H@@QAE@XZ??B?$CSmartPtr@H@@QBEPAHXZ??0?$CSmartPtr@VCPrepare@@@@QAE@XZ??C?$CSmartPtr@VCPrepare@@@@QBEPAVCPrepare@@XZ?Delete@?$CSmartPtr@VIPredictorCompress@@@@QAEXXZ??3@YAXPAX@Z?Delete@?$CSmartPtr@H@@QAEXXZ?Delete@?$CSmartPtr@VCPrepare@@@@QAEXXZ??_ECBitArray@@QAEPAXI@Z??_M@YGXPAXIHP6EX0@Z@Z??1CBitArray@@QAE@XZ??_GCBitArray@@QAEPAXI@Z?Prepare@CAPECompressCore@@AAEHPBXHPAH@Z?EncodeUnsignedLong@CBitArray@@QAEHI@Z?Prepare@CPrepare@@QAEHPBEHPBUtWAVEFORMATEX@@PAH2PAI22@Z??1?$CSmartPtr@VIPredictorCompress@@@@QAE@XZ?Assign@?$CSmartPtr@VIPredictorCompress@@@@QAEXPAVIPredictorCompress@@HH@Z??1?$CSmartPtr@H@@QAE@XZ?Assign@?$CSmartPtr@H@@QAEXPAHHH@Z??1?$CSmartPtr@VCPrepare@@@@QAE@XZ?Assign@?$CSmartPtr@VCPrepare@@@@QAEXPAVCPrepare@@HH@Z?Delete@?$CSmartPtr@VCBitArray@@@@QAEXXZ?EncodeFrame@CAPECompressCore@@QAEHPBXH@Z?Finalize@CBitArray@@QAEXXZ?EncodeValue@CBitArray@@QAEHHAAUBIT_ARRAY_STATE@@@Z?FlushBitArray@CBitArray@@QAEXXZ?FlushState@CBitArray@@QAEXAAUBIT_ARRAY_STATE@@@Z?AdvanceToByteBoundary@CBitArray@@QAEXXZ??1?$CSmartPtr@VCBitArray@@@@QAE@XZ?Assign@?$CSmartPtr@VCBitArray@@@@QAEXPAVCBitArray@@HH@Z??0CAPECompressCore@@QAE@PAVCIO@@PBUtWAVEFORMATEX@@HH@Z??0CPredictorCompressNormal@@QAE@H@Z??0CBitArray@@QAE@PAVCIO@@@Z??2@YAPAXI@Z__ehhandler$??0CAPECompressCore@@QAE@PAVCIO@@PBUtWAVEFORMATEX@@HH@Z___CxxFrameHandler__except_list??1CAPECompressCore@@QAE@XZ__ehhandler$??1CAPECompressCore@@QAE@XZ /820 1084342682 100666 9556 ` LšÁ¡@….drectveZì .debug$S}F@B.textÃÊ P`.rdata(Ôü @0@.debug$F`p@B.textz™ P`.debug$F­½@B.text ÇÐ P`.debug$FÚê@B.text0ô$ . P`.debug$F°ð  @B.text P`.debug$F.@B.text8 P`.debug$F;K@B.textTU© P`.debug$FÛë@B.textõ P`.debug$F'7@B.text$xdA¥ P`.xdata$xÔ1 @0@.sxdata‡0.textY—ð P`.debug$F"2@B.text<A P`.debug$FK[@B.text e… P`.debug$FŸ@B.rdata(©Ñ @0@.text5S P`.debug$Fgw@B/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" = „t6e:\Mac_sdk_399_4\Source\MACLib\Release\APECompress.obj8   !Microsoft (R) Optimizing CompilerÇà         $  öD$V‹ñÇt VèƒÄ‹Æ^  ‹ÁÇà ‹A+AÃÌÌÌÌÌÌÌÌÌV‹ñ‹F…Àt‹F …Àt3À^ÂW‹|$ …ÿÇF t ‹‹ÎÿP‰‹F‹N_Á^ÂÌÌ̃ìU‹é‹E…Àu ¸Ð]ƒÄ‹D$SV3ö…ÀW‰t$3À_^[]ƒÄ‹t$›‹EL$Q‹ÍÇD$ÿP…ÀtY‹\$…Û~Q‹L$ +Î;Ù|‹Ù‹T$‹ø‹Ë‹ÁÁéòó¥‹Èƒáó¤‹UjS‹ÍÿR…Àu˜‹D$‹L$ Ã;Á‰D$|_^[3À]ƒÄÂ_^[ƒÈÿ]ƒÄÂÌ3ÀÃÌÌÌÌÌÌÌÌÌÌÌÌÌjÿhd¡Pd‰%QVh‹ñèƒÄ‰D$…ÀÇD$t ‹Èèë3À‹L$‰F$ÇF(‹Q‹ÈÇD$ÿÿÿÿÿR…Àt¸ë^‹L$d‰ ƒÄ‹T$,‹D$(‹L$$W‹|$ R‹T$(P‹F$Q‹NRWPè‹F…ÀtPèƒÄÇF‹NèP‰Fè‰F‹ƒÆ,‰‹W‰V‹G‰F‹O ‰N f‹W‹L$ƒÄf‰V_3À^d‰ ƒÄÂÌÌÌÌÌÌÌÌÌÌÌÌ‹T$‹D$VW‹|$‹ñ‹L$ Q‹L$R‹T$Q‹NRWP‰F$ÇF(è‹F…ÀtPèƒÄÇF‹NèP‰Fè‰F‹ƒÆ,‰‹O‰N‹W‰V‹G ‰F f‹OƒÄ_f‰N3À^ÂÌÌÌÌÌÌU‹ìjÿhd¡Pd‰%QSV‹ñ‹F3Û;ÃW‰eð„¡9]‰]üu ‹Nè‹Ø‹F+F;Ã|?‹Nè‹N+N;Á} ‹Nè‹øë‹ù…ÿt‹V‹F‹NWÐRè…ÀuN~ë·‹N…Ét$‹F+Át‹VPÊQRèƒÄ ‹F)FÇF3À‹Môd‰ _^[‹å]¸ÃÈÿ‹Mô_^d‰ [‹å]ÂÌÌÌÌÌÌÌÌÌÌÌU‹l$VW3ÿ;ï‹ñu _^¸ˆ] ‹D$;Çt‰8‹SL$Q‹Î‰|$ÿP‹Ø;ß„9|$„“‹Nè‹V+VÂ…À~n‹T$…Ò‹L$~;Ê~‹Ê;È~‹È·~8‹Á™÷ÿ…Òt I‹Á™÷ÿ…Òuö‹Á™÷ÿ‹UL$Q‹ÍÇD$PSÿR…Àt [_^¸è] ·~8‹D$¯|$…Àt‰8‹jW‹ÎÿR[_^] [_^¸Ð] ÌÌÌÌÌÌÌÌ‹A …ÀuƒÈÿ‹D$‹QЋD$…À‰QÇA t jè…Àu3ÀÂÌÌÌÌÌÌÌÌVj‹ñè…Àu ‹N^é^ ÌÌÌÌÌjÿhd¡Pd‰%ƒìSUV‹ñW‰t$3í~ljl$ ÇG‰/jLÆD$$‰n‰n‰n‰n ‰n(‰n$èƒÄ‰D$;ÅÆD$ t ‹Èè‹Øë3Û‹ÏÆD$ è‹L$‰o‰ÇG_‰n‹Æ^][d‰ ƒÄÃÌÌÌÌÌÌÌÌÌÌÌjÿhd¡Pd‰%QV‹ñ‰t$Ç‹F…ÀÇD$tPèƒÄÇF‹F(…Àt‹N$…Ét ‹jÿÇF$NÆD$è‹L$Ç^d‰ ƒÄÃ#E)K1K?DYCK¼BÉÛAäDK`BmAˆDÆTÌKÔKúAA A<S`R|KŠPšKýAËOæOóaw KK)vTDks}\K³}¹KÁKÏvä\ (K=¿Šè 8¥"€!$ %0&@=PN`Yp_€`l z‹ÁÇ@ÇÃ)‹Ã.SŠ\$öÃV‹ñt+‹FüWh~üPjLVèöÃt WèƒÄ‹Ç_^[‹ÎèöÃt VèƒÄ‹Æ^[Â54);5FT 3V‹ñèöD$t VèƒÄ‹Æ^Â5:‹EðPèYøé¸é‹Mìé‹MìƒÁé‹EðPèYøé‹Mðé‹MðƒÁé¸é IFUF# .d7>xCFK Vd[~`Fÿÿÿÿ “ÿÿÿÿÿÿÿÿ “ÿÿÿÿ “ÿÿÿÿ “@J@QTW`XhVxr€qˆp”y¬|´{ÀETw}W‹ù‹G…ÀtMV‹7…ötE‹G…Àt(‹FüSh^üPjLVèSèƒÄ[^Ç_ËÎèVèƒÄÇ^_Ã5)4/C5IY\é\dV‹ñè‹D$‹L$ ‹T$‰F‰N‰^ \ in=N %!$_Y `$&V‹ñèöD$t VèƒÄ‹Æ^Âzm.fileþÿg.\APECompress.cpp@comp.id `ÿÿ@feat.00ÿÿ.drectveZ.debug$S}.textªá‹À  ' C i .rdata( _.debug$F.text»Hóšu ‘ .debug$F.text 4ëÛYž .debug$F .text 0.E¬}¶ .debug$F ° ä  P , .text ..~íG .debug$F  .text*Vöt .debug$F.textT“¯Óq· Ù ð .debug$F.textN)¬œ .debug$F0  .text$xdêy×1$L75472 g • × í ú  = .xdata$xÔ Ac°]$T75484$T75487P.sxdataWªšT^0 œÀ $L75509 $L75507‰ _memmove Á í $T75527X$T75533D$T755344$T75532$° .textYÞ,ˆÖ` .debug$F’  ·à Ù .text®¥Ä% .debug$F.text ‚µNË. .debug$Fy ‘ ­ im$L755832 $L75582' $L75581 É .rdata( çý= $T75596Œ$T75598t!° $L75606O $L75605G 9Z $T75614¸$T75616¨.textN)¬œ] .debug$Fy??1IAPECompress@@UAE@XZ__purecall??_GIAPECompress@@UAEPAXI@Z??_EIAPECompress@@UAEPAXI@Z??_7IAPECompress@@6B@??_GIAPECompress@@UAEPAXI@Z??3@YAXPAX@Z??0IAPECompress@@QAE@XZ?GetBufferBytesAvailable@CAPECompress@@UAEHXZ?LockBuffer@CAPECompress@@UAEPAEPAH@Z?AddData@CAPECompress@@UAEHPAEH@Z?Kill@CAPECompress@@UAEHXZ??0?$CSmartPtr@VCAPECompressCreate@@@@QAE@XZ??C?$CSmartPtr@VCAPECompressCreate@@@@QBEPAVCAPECompressCreate@@XZ??_ECAPECompressCreate@@QAEPAXI@Z??_M@YGXPAXIHP6EX0@Z@Z??1CAPECompressCreate@@QAE@XZ??_GCAPECompressCreate@@QAEPAXI@Z?Start@CAPECompress@@UAEHPBGPBUtWAVEFORMATEX@@HHPBXH@Z?GetFullFrameBytes@CAPECompressCreate@@QAEHXZ?Start@CAPECompressCreate@@QAEHPAVCIO@@PBUtWAVEFORMATEX@@HHPBXH@Z??0CWinFileIO@@QAE@XZ??2@YAPAXI@Z__ehhandler$?Start@CAPECompress@@UAEHPBGPBUtWAVEFORMATEX@@HHPBXH@Z___CxxFrameHandler__except_list?StartEx@CAPECompress@@UAEHPAVCIO@@PBUtWAVEFORMATEX@@HHPBXH@Z?ProcessBuffer@CAPECompress@@AAEHH@Z?EncodeFrame@CAPECompressCreate@@QAEHPBXH@Z__ehhandler$?ProcessBuffer@CAPECompress@@AAEHH@Z?AddDataFromInputSource@CAPECompress@@UAEHPAVCInputSource@@HPAH@Z?Delete@?$CSmartPtr@VCAPECompressCreate@@@@QAEXXZ?UnlockBuffer@CAPECompress@@UAEHHH@Z?Finish@CAPECompress@@UAEHPAEHH@Z?Finish@CAPECompressCreate@@QAEHPBXHH@Z??1?$CSmartPtr@VCAPECompressCreate@@@@QAE@XZ?Assign@?$CSmartPtr@VCAPECompressCreate@@@@QAEXPAVCAPECompressCreate@@HH@Z??0CAPECompress@@QAE@XZ??_GCAPECompress@@UAEPAXI@Z??_ECAPECompress@@UAEPAXI@Z??0CAPECompressCreate@@QAE@XZ??_7CAPECompress@@6B@__ehhandler$??0CAPECompress@@QAE@XZ??1CAPECompress@@UAE@XZ__ehhandler$??1CAPECompress@@UAE@XZ??_GCAPECompress@@UAEPAXI@Z/846 1084342682 100666 4443 ` LšÁ¡@Ý >.drectve’T .debug$Sxæ@B.rdataA^@0@.text>ŸÝ& P`.text$x Yy P`.xdata$x`¡ @0@.sxdata= 0.debug$F`A ¡ @B/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" /EXPORT:_FillWaveFormatEx@16 /EXPORT:_FillWaveHeader@16 8 „t1e:\Mac_sdk_399_4\Source\MACLib\Release\MACLib.obj8   !Microsoft (R) Optimizing Compiler.apl.mac.apeRIFFWAVEfmt dataU‹ìjÿhd¡Pd‰%ƒìSV‹u3Û3À;óW‰eð‰Eì„Å‹}9…ºSShè‹Î‰]üè=Z|+h¬è‹ÈƒÄ‰M;ËÆEüt9‹E‹U PRVWèë*jpè‹ÈƒÄ‰M;ËÆEüt‹E‹U PRVWèë3À;È]ü‰EìtC9t?‹j‹Èÿ3À‹Môd‰ _^[‹å]ËMì3Û;Ët ‹jÿ‰]ì‹MÇÿÿÿÿ¸Ã‹Eì‹Mô_^d‰ [‹å]ÃÌÌÌÌÌÌÌìW‹¼$$…ÿ„}WèƒÄ…À„lSUVƒÍÿW‰l$3Û‰l$è4GƒÄ;÷v fƒ>.tƒî;÷wóhVèƒÄ…À…‰WL$èL$è…Àtgh¨è‹ðƒÄ…öt8h(èƒÄ…Àt jW‹Èèë3ÀPL$èPD$P‹Îèë3ÀL$‹ØèL$‹èè‰D$L$èëJhVèƒÄ…ÀthVèƒÄ…Àu*h¨èƒÄ…ÀtjWL$Q‹Èèë3À‹Ø…Ûu ‹„$4…ÀtÇê3À^][_Ä‹D$T$RPUS苌$DƒÄ…ÉtÔ‹T$^][‰_Ä‹„$(…ÀtLj3À_ÄÂQh¨ÇD$ÿÿÿÿèƒÄ…Àt‹L$jQT$R‹Èèë3À $QjÿjÿPè‹L$ƒÄ…Ét‹$‰YÂÌÌÌÌÌÌÌÌÌÌÌÌÌQ‹L$‹T$ $P‹D$ QRPÇD$è‹L$$ƒÄ…Ét‹$‰YÂÌÌÌÌÌÌÌÌÌÌÌ‹D$…ÀtÇj@èƒÄ…Àt ‹ÈèÂ3ÀÂÌÌÌÌÌ‹D$‹L$ ‹T$f‰HfÁéV‹t$f‰pfÇ@‰PfǯÎf‰H ·É¯Ê‰H3À^ÂÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌ‹D$‹L$‹T$V‹t$T$‰PWÇRIFFÇ@WAVEÇ@ fmt Ç@‹>P‰:‹~‰z‹~‰z‹v _‰r Ç@$data‰H(3À^ ''K\{„£É'ð'(4I4ek3€2‰1—ª»0É/Ö.å-ð,ý+ 33-C.~Ïé8û=q;‹EPèYËEPèYøé# ÿÿÿÿÿÿÿÿ “ ,@%L&T$°‡S5+A^*7 90:@<P=.fileþÿg.\MACLib.cpp@comp.id `ÿÿ@feat.00ÿÿ.drectve’.debug$Sx.rdataAµÆúo$SG76299<$SG762984$SG76297,$SG76296$$SG76245$SG76244 $SG76230.text>&»º= .text$x \.0|$L76446  I $L76445 $L76453õ$L76444Ô V … ± ¾ ó D .xdata$x`Lá{$T76450D$T764570$T76458 $T76456W.sxdataÉGze } ‘ ² Ò ø  4 T _wcsicmp _wcslen .debug$F`kÀ … °  Ì` â ú à "?CreateIAPEDecompressCore@@YAPAVIAPEDecompress@@PAVCAPEInfo@@HHPAH@Z??3@YAXPAX@Z??0CAPEDecompressOld@@QAE@PAHPAVCAPEInfo@@HH@Z??0CAPEDecompress@@QAE@PAHPAVCAPEInfo@@HH@Z??2@YAPAXI@Z?GetInfo@CAPEInfo@@QAEHW4APE_DECOMPRESS_FIELDS@@HH@Z__ehhandler$?CreateIAPEDecompressCore@@YAPAVIAPEDecompress@@PAVCAPEInfo@@HHPAH@Z___CxxFrameHandler__except_list_CreateIAPEDecompress@8??1CAPELink@@QAE@XZ?GetFinishBlock@CAPELink@@QAEHXZ?GetStartBlock@CAPELink@@QAEHXZ??0CAPEInfo@@QAE@PAHPBGPAVCAPETag@@@Z?GetImageFilename@CAPELink@@QAEPBGXZ??0CAPETag@@QAE@PBGH@Z?GetIsLinkFile@CAPELink@@QAEHXZ??0CAPELink@@QAE@PBG@Z_CreateIAPEDecompressEx@8??0CAPEInfo@@QAE@PAHPAVCIO@@PAVCAPETag@@@Z_CreateIAPEDecompressEx2@16_CreateIAPECompress@4??0CAPECompress@@QAE@XZ_FillWaveFormatEx@16_FillWaveHeader@16 /867 1084342682 100666 24819 ` LmšÁ¡@x<].drectve  .debug$S{)@B.text ¤° P`.debug$FºÊ@B.text'Ôû P`.debug$F@B.text$C P`.debug$FM]@B.text'gŽ P`.debug$F˜¨@B.text² P`.debug$FµÅ@B.textÏ P`.debug$Fßï@B.text$ù P`.debug$F'7@B.textA P`.debug$FDT@B.text^ P`.debug$Faq@B.text{ P`.debug$F~Ž@B.text˜ P`.debug$F›«@B.textµ P`.debug$FÅÕ@B.textß P`.debug$Fâò@B.textü P`.debug$F @B.text& P`.debug$F)9@B.textC P`.debug$FFV@B.text` P`.debug$Fcs@B.text} P`.debug$F€@B.textš P`.debug$F­@B.text· P`.debug$FÇ×@B.textá P`.debug$Fäô@B.textþ P`.debug$F@B.text P`.debug$F+;@B.textE P`.debug$FHX@B.textb P`.debug$Feu@B.text$£ P`.debug$F­½@B.textNÇ P`.debug$F/@B.textN9‡ P`.debug$F‘¡@B.textN«ù P`.debug$F@B.textNk P`.debug$Fu…@B.textNÝ P`.debug$Fç÷@B.text./ P`.debug$F9I@B.text$Sw P`.debug$F‘@B.text$›¿ P`.debug$FÉÙ@B.text:ã P`.debug$F'7@B.textAF P`.debug$FP`@B.text jŠ P`.debug$F”¤@B.text®³ P`.debug$F½Í@B.text ×÷ P`.debug$F@B.text  P`.debug$F*:@B.textDI P`.debug$FSc@B.text m P`.debug$F—§@B.text±¶ P`.debug$FÀÐ@B.text Úú P`.debug$F@B.text:X P`.debug$Fbr@B.text |œ P`.debug$F¦¶@B.textNÀ/° P`.xdata$xî5 6@0@.xdata$x66@0@.data &616@0À.text$xª;6å6 P`.xdata$xÁ7Ñ7@0@.xdata$xÔÛ7¯9$@0@.sxdata ;0.text#; P`.debug$F<;L;@B.textV; P`.debug$Fo;;@B.text/‰;¸; P`.debug$FÂ;Ò;@B.debug$F`Ü;<<@B/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" /EXPORT:_CompressFileW@24 /EXPORT:_VerifyFileW@20 /EXPORT:_DecompressFileW@20 /EXPORT:_ConvertFileW@24 /EXPORT:_CompressFile@24 /EXPORT:_DecompressFile@20 /EXPORT:_ConvertFile@24 ; „t4e:\Mac_sdk_399_4\Source\MACLib\Release\APESimple.obj8   !Microsoft (R) Optimizing Compiler‹AjPèà  V‹ñW3À¹‹þVó«èƒÄ_ÇF\¸^Ã'‹D$VW‹|$W‹ñPVè‹F\ƒÄ Ç_‰F\^Â$ ‹D$V3Ò‹ð‰‰VQ‰VP‰V èƒÄ¸^Â'‹Ã"‹ÁÇ@ÇÃ'V‹ñ‹F…Àt‹…Àt‹NPèƒÄÇ^Ã-$,‹Ã2‹Ã7‹Ã<‹ÃA‹ÁÇ@ÇÃF‹ÃK‹ÁÇ@ÇÃP‹ÃU‹ÃZ‹Ã_‹Ãd‹Ãi‹ÁÇ@ÇÃn‹Ãs‹Ãx‹ÁÇ@ÇÃ}‹Ã‚‹Ã‡V‹ñ‹F…Àt‹…Àt‹NPèƒÄÇ^Ã-$ŒV‹ñ‹F…ÀtB‹…Ét<‹F…Àt)‹Qü…ÒAüt‹jÿÇ^ÃPèƒÄÇ^ËjÿÇ^Ã1-N‘V‹ñ‹F…ÀtB‹…Ét<‹F…Àt)‹Qü…ÒAüt‹jÿÇ^ÃPèƒÄÇ^ËjÿÇ^Ã1-N–V‹ñ‹F…ÀtB‹…Ét<‹F…Àt)‹Qü…ÒAüt‹jÿÇ^ÃPèƒÄÇ^ËjÿÇ^Ã1-N›V‹ñ‹F…ÀtB‹…Ét<‹F…Àt)‹Qü…ÒAüt‹jÿÇ^ÃPèƒÄÇ^ËjÿÇ^Ã1-N V‹ñ‹F…ÀtB‹…Ét<‹F…Àt)‹Qü…ÒAüt‹jÿÇ^ÃPèƒÄÇ^ËjÿÇ^Ã1-N¥‹D$…ÀV‹ñtW3À¹‹þVó«èƒÄÇF\_‹Æ^Â. ªV‹ñ‹F…Àt‹…Àt‹NPèƒÄÇ^Ã-$¯V‹ñ‹F…Àt‹…Àt‹NPèƒÄÇ^Ã-$´V‹ñ‹F…Àt‹…Àt‹NPèƒÄÇ‹D$‹L$ ‹T$‰F‰N‰^ -:¹é‘¾V‹ñè‹D$‹L$ ‹T$‰F‰N‰^ ‘ Ãé–ÈV‹ñè‹D$‹L$ ‹T$‰F‰N‰^ – Íé›Òé ×V‹ñè‹D$‹L$ ‹T$‰F‰N‰^   Üé¥áV‹ñè‹D$‹L$ ‹T$‰F‰N‰^ ¥ æV‹ñ‹F…Àt‹…Àt‹NPèƒÄÇ‹D$‹L$ ‹T$‰F‰N‰^ -:ëV‹ñè‹D$‹L$ ‹T$‰F‰N‰^ › ðU‹ìjÿhd¡Pd‰%켋ESVW3ÿ;ljeðu¸ô‹Môd‰ _^[‹å]û‰}‰]ȉ}À‰}ü‰]Ô‰}̉]à‰}؉]¼‰}´MQPÆEüè‹ð;÷‰|ÿÿÿ‰½xÿÿÿ‰µtÿÿÿ„O9}…F‹W…8ÿÿÿPh‹ÎÿR ;ÇthMŒQ‰EŒè‹WWhó‹ÎÿR PèƒÄSSPMØè‹]Ø;ßuh…hÿÿÿPÇ…hÿÿÿÐè‹WWhó‹ÎÿR ‹PSh‹ÎÿR ;Çt‰…`ÿÿÿh…`ÿÿÿPè‹Eƒø…–hè‹ÈƒÄ‰Mì;ÏÆEütèë3ÀjWPMÀÆEüè‹}À‹E ‹P‹ÏÿR…ÀthXÿÿÿQ‰…Xÿÿÿè‹jjhó‹ÎÿR PSWèƒÄ …À„܉…Pÿÿÿh…PÿÿÿPèƒø…¼‹WWhè‹ÎÿR =–u.‹WWhé‹ÎÿP ;EuhpÿÿÿQÇ…pÿÿÿ¡èjWWèPMÌè‹WWhó‹ÎÿR jj‹Ø‹hï‹ÎÿP ‹jjhҋ΋øÿR ¯Ç‹MÌ‹S‹]ØS‹]SP…8ÿÿÿP‹E PÿR…ÀthM¤Q‰E¤è‹jjhï‹ÎÿR ÀÁà PèƒÄjjPMØè‹]Ø…ÛuhTÿÿÿQÇ…TÿÿÿÐè‹jjhÒ‹ÎÿR ‹øj ‰}èè‹ÈƒÄ‰Mì…ÉÆEüt%‹E ‹UP‹ERP¸9Žã8÷ïÁú ‹ÂÁèÂPèë3ÀjjPM´ÆEüè‹Eè…À‹}ŽEäPh$ÇEäÿÿÿÿ‹S‹ÎÿR…ÀthMœQÇEœñèƒÿuO‹jjhï‹ÎÿR ¯Eä‹MÀUì‹øRWÇEì‹SÿP…Àu;}ìtSh…lÿÿÿPÇ…lÿÿÿéèƒÿu3‹jjhï‹ÎÿR ¯Eä‹MÌ‹PSÿR …Àt‰E”hE”Pè‹Mä‹Uè‹}´+Ñjjÿ‹Ï‰Uèèj‹Ïè…À„ ÿÿÿh•\ÿÿÿRÇ…\ÿÿÿ èƒÿ…Ú‹jjhô‹ÎÿP …ÀŽH‹jjhô‹ÎÿR PèƒÄWWPMØè‹]Ø…ÛuhE°PÇE°Ðè‹jjhô‹ÎÿR ‹PSh‹ÎÿR …Àt‰…dÿÿÿh…dÿÿÿPè‹jjhô‹ÎÿR ‹MÀUì‹øRWÇEì‹SÿP…Àu ;}ì„›hE„PÇE„éèƒÿ…}‹jjh‹ÎÿR ‹Èè‹‹Ø3À…ÛŸÀjjhô‹Î‰EìÿR <…ÿ‰}èŽWèƒÄjjPMØè‹EØ…ÀuhE€PÇE€Ðè‹WPh‹ÎÿR …Àt‰E¬hE¬Pè‹Eì…À„ƒjjÇEì‹h‹ÎÿR ‹‹Ë÷ÙjQ‹ÈÿR…ÀthU¨R‰E¨è‹jjh‹ÎÿP ‹jjhô‹Î‹øÿR ‹MìQ‹MØÁSP‹ÏÿR …ÀthU R‰E è‹jjhô‹ÎÿP ‹MÌ‹P‹EèP‹EØPÿR …Àt4hM˜Q‰E˜è‹MÌ‹jjjÿR …Àt‰EhEPè‹M´‹QjRèëA‹EhMˆQ‰Eˆè‹…Lÿÿÿ…ÀÇEÿÿÿÿt‰E¸ÃÇEÿÿÿÿ¸Ã‹µtÿÿÿ‹E¼…À‹U‹]À‹}Ì‹M´ÇEü‰UìÆEüt.…Ét*‹E¸…Àt‹Qü…ÒAüt‹jÿëPèƒÄë‹jÿMØÆEüè‹…|ÿÿÿ…ÀÆEüt5…öt1‹…xÿÿÿ…Àt‹Nü…ÉFüt ‹j‹ÎÿëPèƒÄë‹j‹Îÿ‹EÔ…ÀÆEüt2…ÿt.‹EÐ…Àt‹Oü…ÉGüt ‹j‹ÏÿëPèƒÄë‹j‹Ïÿ‹EÈ…ÀÇEüÿÿÿÿtV…ÛtR‹EÄ…ÀtC‹Kü…ÉCüt‹j‹Ëÿ‹Eì‹Môd‰ _^[‹å]ÃPè‹EìƒÄ‹Môd‰ _^[‹å]Ëj‹Ëÿ‹Mô‹Eì_^d‰ [‹å]ÃÌÌÌÌÌÌÌÌÌÌÌÌÌU‹ìjÿhd¡Pd‰%ì€SV3ÛW¾‰eð‰]ì‰uœ‰]”‰]ü‰u‰]ˆ‰u´‰]¬EàPMäQUèR‹UEÜPtÿÿÿQRÆEüÇEàÿÿÿÿ‰]܉]è‰]äè‹øƒÄ‰u¨‰]¤‰} ;ûÆEü„P9]à…GSè‹ð…öÇE´‰]°‰u¬uhEØPÇEØÿÿÿÿè·E€¯E܉E‹Eè…À~PèƒÄjjPMˆè‹]ˆ‹S‹ÏÿR…Àt‰EÔhEÔPè‹Eè‹M‹}‹PSQ‹M W…tÿÿÿPQ‹ÎÿR…ÀthUÐR‰EÐèMˆèj è‹ÈƒÄ‰M…ÉÆEüt‹E‹UP‹ERPWèë3ÀjjPM”ÆEüè‹]¬‹÷…ö~a‹M EPVÇE‹Q‹ËÿR…ÀthUÌR‰EÌè+u‹M”‹Çj+ÆPè‹M”jè…Àt°hMÈQÇEÈ è‹Eä…À~PèƒÄjjPMˆè‹M ‹uˆ‹VÿR …Àt‰EÄhEÄPè‹Eä‹PPV‹ËÿR …Àt‰EÀhEÀPè‹M”‹QjRè‹E¨…ÀÆEüt‹E¤…À‹M ta‹Qü…ÒAütL‹jÿ‹}ì…ÿ‹u¬ÇEüt …öt‹‹ÎÿR$‹E´…ÀÆEüt}…öty‹E°…Àtj‹Nü…ÉFütU‹j‹Îÿë^PèƒÄ믋jÿë§‹EàhM¼Q‰E¼è‹E¸…ÀÇEìÿÿÿÿt‰Eì¸ÃÇEìÿÿÿÿ¸ÃPèƒÄë‹j‹ÎÿMˆÆEüè‹Eœ…ÀÇEüÿÿÿÿt1‹M”…Ét*‹E˜…Àt‹Qü…ÒAüt‹jÿëPèƒÄë‹jÿ‹Mô‹Ç_^d‰ [‹å]ÂÌÌÌÌU‹ìjÿhd¡Pd‰%ì¼SVW‹}3Û;û‰eðu¸ô‹Môd‰ _^[‹å]Â9]„JEìP‰]üWÆEü‰]ìè‹ð;ó‰uÔÇEè‰]ä‰uàt59]ìu0‹SSh¸ ‹ÎÿR 8Œ|9X|u>hE¬PÇE¬öè‹MìhU°R‰M°èÇE¸Ã‹}‹uÔ3Û;óÇEüÿÿÿÿt‹j‹Îÿ9]„¦‰]‰]MQÇEüWÆEüè‹ð;óÇEÀ‰]¼‰u¸„)9]… •8ÿÿÿ3À¹½8ÿÿÿRó«èƒÄSS‰]”‹h‹ÎÿP ‹jjh¸ ‹Î‹ØÿR ‹È9Œ‰MŒ¹‹A|…À„®‹QP‹x‹H ‹p‹úñjW‹Ë÷ÿP+÷‹þW‰}较ĉuè‰uä‰Eà‹MQWP‹ËÆEüÿR …À…F;}…=‹U‹B|‹x‹P ‹Húh@ùèƒÄ‰uЉủEÈ‹ÆÆEü‰E…ÿ~X…ÀvRÿ@¸@‹Ç‹MQP‹EÈP‹ËÿR …ÀthM¨QÇE¨èè‹U‹EÈRP8ÿÿÿè‹E+øë¦…ÿthMÄQÇEÄèè‹U‹EàRP8ÿÿÿèM˜Q8ÿÿÿè‹U‹B|x$¹u˜3Àó§tÇEñMÈÆEüèMàÆEüè‹EÀ…À‹uÇEüÿÿÿÿ„»‹M¸…É„°‹E¼…À„‚‹Qü…ÒAütm‹jÿéhMÜQÇEÜèèhU´RÇE´öè‹EhMØQ‰EØè‹E …ÀÇEÿÿÿÿt‰E¸ÃÇEÿÿÿÿ¸ÃPèƒÄë#‹jÿë‹M‹U‹E QRPjÿSSWèƒÄ‹ð‹Mô_‹Æ^d‰ [‹å]ÂÌÌÌÌÌÌÌÌ‹D$…Àu‹L$‹T$ P‹D$P‹D$ QRPè‹L$‹T$Q‹L$R‹T$ QjÿjPRèƒÄÂÌÌÌÌÌÌÌ‹D$‹L$‹T$P‹D$Q‹L$R‹T$PjQRèƒÄÂÌÌÌÌÌ‹D$SVWPè‹L$Q‹øè‹T$,‹L$$ƒÄR‹T$‹ð‹D$$PQRVWè…ö‹Øt VèƒÄ…ÿt WèƒÄ_^‹Ã[ÂÌÌ̃ì‹D$ SUVW3ÛP‰\$è‹t$8V‹øè¹ƒÄ…ö‰D$0‰L$(‰L$$‰D$ t ‹t$D$ ë3ö‹Ù‰L$ÇD$‰t$D$‹…Àu‹L$@‹T$Œ ” ó= 4 D !\ l ¹ƒ Œ !´ À !È ,Ï ñ  Ã0 < !N X a q !~ Ž ¹¦ ¯ !È Ñ !ß P -e q !‡ <” <› -´ ´è -  N $ H n © ¹ !Á Í !Ù L T ¿ Td!w‡—!ª¹ã´ï´4D!IY!am!ƒKK—-ºõÍ þCõQõiYuY•3¡-®-ÓYßY9CTõt-…-’-¹YÅYäõó--Y4C@-ÿÿÿÿÿø.HüMÀéMÌétÿÿÿéMØéM´é‹EìPèYËEìPèYøéM”éMˆéM¬éM é‹EPèYøéMàéM¸éMàéMÈé¸éá È×´'¾0-;-BGO¾W´_ÈgÒp-w?|„׌ה´œ´¡O¦ ûÿÿÿÿLÿÿÿ “ ÿÿÿÿ¸ÿÿÿ “ÿÿÿÿÿÿÿÿ  “ $4<LÿT d x„Œœ8¤7¬6¼5Ä4ÔÿÜ;ì:A B@$G<FLETDlMtÿ|JŒI R´QÀSÈP>N‹T$‹Á‹L$ ‰H‹L$‰P‰ &‹T$‹Á‹L$ ‰H‹L$‰P‰ +V‹ñÇFÇè‹D$‹L$ ‹T$‰F‰N‰‹Æ^ ›/0I+]å _>TW X0Z@[P\.fileþÿg.\APESimple.cpp@comp.id `ÿÿ@feat.00ÿÿ.drectve .debug$S{.text ßduÿ 7 .debug$F.text'àCad ƒ .debug$F.text$|UŸ ¿ .debug$F.text '-á  .debug$F  .text *Vö" .debug$F  .text ..~í= .debug$F .text$&.OÖV t .debug$F.text*Vö .debug$F.text*Vö¡ .debug$F.text*Vö¼ .debug$F.text*Vö÷ .debug$F.text..~í2 .debug$F.text*Vö_ .debug$F.text..~í¢ .debug$F.text*VöÉ .debug$F .text!*Vö! .debug$F"!.text#*Vö7# .debug$F$#.text%*Vös% .debug$F&%.text'*Vöª' .debug$F('.text)..~íá) .debug$F*).text+*Vö + .debug$F,+.text-*VöE- .debug$F.-.text/..~í€/ .debug$F0/.text1*Vö¥1 .debug$F21.text3*VöØ3 .debug$F43.text5$&.OÖ 5 .debug$F65.text7N³z`)7 .debug$F87.text9N³z`[9 .debug$F:9.text;N³z`‡; .debug$F<;.text=N³z`³= .debug$F>=.text?N³z`á? .debug$F@?.textA.Å»ž“ A .debug$FBA.textC$&.OÖ"C .debug$FDC.textE$&.OÖ;E .debug$FFE.textG:¼’VTG .debug$FHG.textI®¥Ä%wI .debug$FJI.textK ‚µNˤK .debug$FLK.textM®¥Ä%ïM .debug$FNM.textO ‚µNËO .debug$FPO.textQ®¥Ä%UQ .debug$FRQ.textS®¥Ä%|S .debug$FTS.textU ‚µNË¥U .debug$FVU.textW®¥Ä%èW .debug$FXW.textY ‚µNË Y .debug$FZY.text[:¼’VH[ .debug$F\[.text] ‚µNËk] .debug$F^].text_N°uXݪ_ .xdata$x`MG»–Ò`.xdata$xažªÌ__CTA1Haà.datab ç®s ??_R0H@8b.text$xcª«ç®Ù$L769996c $L76998+c $L76997#c $L76996c $L76995c $L76994c $L76993c $L77440s_$L76992 _ $L77435_$L76991ó_ ó  = g } › ± .xdata$xd__TI1Hd¾ Ö Ac  .xdata$xeÔ$Üç$T77428|e$T77443he$T77444He$T77442e + .sxdataf K£‡.textgJh qA g .debug$Fhg.textiJh q_ i .debug$Fji.textk/»ÙâI} k .debug$Flk· €_ $L77520kc $L77519cc $L77518[c $L77517Sc $L77516Kc $L77852 _$L77515Œ _ $L77514u _ $L76082 _É  vc $T77844e$T77854ðe$T77855Ðe$T77853˜e,  _ $L77878˜c $L77877c $L77876ˆc $L77875€c $L78222Ø_$L77874ˆ_ $L77873q_ $L76222ó_$L78217Þ _$L77871Ñ _ <  c $T78212¸e$T78225e$T78227pe$T78226`e$T78224 eX à_ .debug$Fm`l 0_ } `_ Ž ¬ À_ ¿ °_ Ï _ ñ ?UpdateProgressComplete@CMACProgressHelper@@QAEXXZ?UpdateProgress@CMACProgressHelper@@QAEXHH@Z?Initialize@CMD5Helper@@QAEHXZ?MD5Init@@YAXPAUMD5_CTX@@@Z?AddData@CMD5Helper@@QAEXPBXH@Z?MD5Update@@YAXPAUMD5_CTX@@PBEI@Z?GetResult@CMD5Helper@@QAEHQAE@Z?MD5Final@@YAXQAEPAUMD5_CTX@@@Z??B?$CSmartPtr@G@@QBEPAGXZ??0?$CSmartPtr@E@@QAE@XZ?Delete@?$CSmartPtr@E@@QAEXXZ??3@YAXPAX@Z?GetPtr@?$CSmartPtr@E@@QBEPAEXZ??B?$CSmartPtr@E@@QBEPAEXZ??B?$CSmartPtr@UAPE_DESCRIPTOR@@@@QBEPAUAPE_DESCRIPTOR@@XZ??C?$CSmartPtr@UAPE_DESCRIPTOR@@@@QBEPAUAPE_DESCRIPTOR@@XZ??0?$CSmartPtr@VCMACProgressHelper@@@@QAE@XZ??C?$CSmartPtr@VCMACProgressHelper@@@@QBEPAVCMACProgressHelper@@XZ??0?$CSmartPtr@VIAPECompress@@@@QAE@XZ??B?$CSmartPtr@VIAPECompress@@@@QBEPAVIAPECompress@@XZ??C?$CSmartPtr@VIAPECompress@@@@QBEPAVIAPECompress@@XZ?GetPtr@?$CSmartPtr@VCInputSource@@@@QBEPAVCInputSource@@XZ??B?$CSmartPtr@VCInputSource@@@@QBEPAVCInputSource@@XZ??C?$CSmartPtr@VCInputSource@@@@QBEPAVCInputSource@@XZ??0?$CSmartPtr@VIAPEDecompress@@@@QAE@XZ??B?$CSmartPtr@VIAPEDecompress@@@@QBEPAVIAPEDecompress@@XZ??C?$CSmartPtr@VIAPEDecompress@@@@QBEPAVIAPEDecompress@@XZ??0?$CSmartPtr@VCWinFileIO@@@@QAE@XZ??B?$CSmartPtr@VCWinFileIO@@@@QBEPAVCWinFileIO@@XZ??C?$CSmartPtr@VCWinFileIO@@@@QBEPAVCWinFileIO@@XZ?Delete@?$CSmartPtr@G@@QAEXXZ?Delete@?$CSmartPtr@VCMACProgressHelper@@@@QAEXXZ?Delete@?$CSmartPtr@VIAPECompress@@@@QAEXXZ?Delete@?$CSmartPtr@VCInputSource@@@@QAEXXZ?Delete@?$CSmartPtr@VIAPEDecompress@@@@QAEXXZ?Delete@?$CSmartPtr@VCWinFileIO@@@@QAEXXZ??0CMD5Helper@@QAE@H@Z??1?$CSmartPtr@G@@QAE@XZ??1?$CSmartPtr@E@@QAE@XZ?Assign@?$CSmartPtr@E@@QAEXPAEHH@Z??1?$CSmartPtr@VCMACProgressHelper@@@@QAE@XZ?Assign@?$CSmartPtr@VCMACProgressHelper@@@@QAEXPAVCMACProgressHelper@@HH@Z??1?$CSmartPtr@VIAPECompress@@@@QAE@XZ?Assign@?$CSmartPtr@VIAPECompress@@@@QAEXPAVIAPECompress@@HH@Z??1?$CSmartPtr@VCInputSource@@@@QAE@XZ??1?$CSmartPtr@VIAPEDecompress@@@@QAE@XZ?Assign@?$CSmartPtr@VIAPEDecompress@@@@QAEXPAVIAPEDecompress@@HH@Z??1?$CSmartPtr@VCWinFileIO@@@@QAE@XZ?Assign@?$CSmartPtr@VCWinFileIO@@@@QAEXPAVCWinFileIO@@HH@Z?Assign@?$CSmartPtr@G@@QAEXPAGHH@Z?Assign@?$CSmartPtr@VCInputSource@@@@QAEXPAVCInputSource@@HH@Z?DecompressCore@@YAHPBG0HHPAHP6GXH@Z1@Z__CT??_R0H@84??_7type_info@@6B@?GetTagBytes@CAPETag@@QAEHXZ?ProcessKillFlag@CMACProgressHelper@@QAEHH@Z??0CMACProgressHelper@@QAE@HPAHP6GXH@Z0@Z_CreateIAPECompress@4?WriteSafe@@YAHPAVCIO@@PAXH@Z??0CWinFileIO@@QAE@XZ??2@YAPAXI@Z_CreateIAPEDecompress@8__ehhandler$?DecompressCore@@YAHPBG0HHPAHP6GXH@Z1@Z___CxxFrameHandler__except_list__CxxThrowException@8??0?$CSmartPtr@G@@QAE@PAGHH@Z??0?$CSmartPtr@E@@QAE@PAEHH@Z??0?$CSmartPtr@VCInputSource@@@@QAE@PAVCInputSource@@HH@Z_CompressFileW@24?CreateInputSource@@YAPAVCInputSource@@PBGPAUtWAVEFORMATEX@@PAH222@Z__ehhandler$_CompressFileW@24_VerifyFileW@20__ehhandler$_VerifyFileW@20_DecompressFileW@20_ConvertFileW@24_CompressFile@24?GetUTF16FromANSI@@YAPAGPBD@Z_DecompressFile@20_ConvertFile@24?VerifyFile@@YGHPBDPAHP6GXH@Z1H@Z /891 1084342683 100666 818 ` L›Á¡@|.text@<| ``‹D$‹L$‹T$Áêƒ|$ ~NoýoHýIHoPýQPoXýYXƒÀ ƒÁ JuÊwÃt8oùoHùIHoPùQPoXùYXƒÀ ƒÁ JuÊwËD$‹L$‹T$ ÁêïÿoõþøoHõIþùoPõQþúoXõYƒÀ ƒÁ þûJuÍo÷s× þ÷~t$w‹D$Ã`œX‰Á5 PœX9Èt ¸¢÷€a•ÀƒàÃ.fileþÿgAssembly.nas.text@.absolutÿÿ_Adapt Adapt  AdaptSubnp¨(¾=¾loopDotÐQbreturn8end@rAdaptAddLoopAdaptSubLoopAdaptDone_CalculateDotProductCalculateDotProduct_GetMMXAvailableGetMMXAvailablejmac-1.74/core/nativesrc/mac/Source/0000755000175000017500000000000010451144641017243 5ustar twernertwernerjmac-1.74/core/nativesrc/mac/Source/MACLib/0000755000175000017500000000000010451144641020272 5ustar twernertwernerjmac-1.74/core/nativesrc/mac/Source/MACLib/APECompress.h0000644000175000017500000000417110131230056022556 0ustar twernertwerner#ifndef APE_APECOMPRESS_H #define APE_APECOMPRESS_H #include "MACLib.h" class CAPECompressCreate; /************************************************************************************************* CAPECompress - uses the CAPECompressHub to provide a simpler compression interface (with buffering, etc) *************************************************************************************************/ class CAPECompress : public IAPECompress { public: CAPECompress(); ~CAPECompress(); // start encoding int Start(const wchar_t * pOutputFilename, const WAVEFORMATEX * pwfeInput, int nMaxAudioBytes, int nCompressionLevel = COMPRESSION_LEVEL_NORMAL, const void * pHeaderData = NULL, int nHeaderBytes = CREATE_WAV_HEADER_ON_DECOMPRESSION); int StartEx(CIO * pioOutput, const WAVEFORMATEX * pwfeInput, int nMaxAudioBytes, int nCompressionLevel = COMPRESSION_LEVEL_NORMAL, const void * pHeaderData = NULL, int nHeaderBytes = CREATE_WAV_HEADER_ON_DECOMPRESSION); // add data / compress data // allows linear, immediate access to the buffer (fast) int GetBufferBytesAvailable(); int UnlockBuffer(int nBytesAdded, BOOL bProcess = TRUE); unsigned char * LockBuffer(int * pBytesAvailable); // slower, but easier than locking and unlocking (copies data) int AddData(unsigned char * pData, int nBytes); // use a CIO (input source) to add data int AddDataFromInputSource(CInputSource * pInputSource, int nMaxBytes = -1, int * pBytesAdded = NULL); // finish / kill int Finish(unsigned char * pTerminatingData, int nTerminatingBytes, int nWAVTerminatingBytes); int Kill(); private: int ProcessBuffer(BOOL bFinalize = FALSE); CSmartPtr m_spAPECompressCreate; int m_nBufferHead; int m_nBufferTail; int m_nBufferSize; unsigned char * m_pBuffer; BOOL m_bBufferLocked; CIO * m_pioOutput; BOOL m_bOwnsOutputIO; WAVEFORMATEX m_wfeInput; }; #endif // #ifndef APE_APECOMPRESS_H jmac-1.74/core/nativesrc/mac/Source/MACLib/APECompressCore.h0000644000175000017500000000250510131230056023366 0ustar twernertwerner#ifndef APE_APECOMPRESSCORE_H #define APE_APECOMPRESSCORE_H #include "APECompress.h" #include "BitArray.h" class CPrepare; class IPredictorCompress; /************************************************************************************************* CAPECompressCore - manages the core of compression and bitstream output *************************************************************************************************/ class CAPECompressCore { public: CAPECompressCore(CIO * pIO, const WAVEFORMATEX * pwfeInput, int nMaxFrameBlocks, int nCompressionLevel); ~CAPECompressCore(); int EncodeFrame(const void * pInputData, int nInputBytes); CBitArray * GetBitArray() { return m_spBitArray.GetPtr(); } int GetPeakLevel() { return m_nPeakLevel; } private: int Prepare(const void * pInputData, int nInputBytes, int * pSpecialCodes); CSmartPtr m_spBitArray; CSmartPtr m_spPredictorX; CSmartPtr m_spPredictorY; BIT_ARRAY_STATE m_BitArrayStateX; BIT_ARRAY_STATE m_BitArrayStateY; CSmartPtr m_spDataX; CSmartPtr m_spDataY; CSmartPtr m_spTempData; CSmartPtr m_spPrepare; WAVEFORMATEX m_wfeInput; int m_nPeakLevel; }; #endif // #ifndef APE_APECOMPRESSCORE_H jmac-1.74/core/nativesrc/mac/Source/MACLib/APECompressCreate.h0000644000175000017500000000266710131230056023712 0ustar twernertwerner#ifndef APE_APECOMPRESSCREATE_H #define APE_APECOMPRESSCREATE_H #include "APECompress.h" class CAPECompressCore; class CAPECompressCreate { public: CAPECompressCreate(); ~CAPECompressCreate(); int InitializeFile(CIO * pIO, const WAVEFORMATEX * pwfeInput, int nMaxFrames, int nCompressionLevel, const void * pHeaderData, int nHeaderBytes); int FinalizeFile(CIO * pIO, int nNumberOfFrames, int nFinalFrameBlocks, const void * pTerminatingData, int nTerminatingBytes, int nWAVTerminatingBytes, int nPeakLevel); int SetSeekByte(int nFrame, int nByteOffset); int Start(CIO * pioOutput, const WAVEFORMATEX * pwfeInput, int nMaxAudioBytes, int nCompressionLevel = COMPRESSION_LEVEL_NORMAL, const void * pHeaderData = NULL, int nHeaderBytes = CREATE_WAV_HEADER_ON_DECOMPRESSION); int GetFullFrameBytes(); int EncodeFrame(const void * pInputData, int nInputBytes); int Finish(const void * pTerminatingData, int nTerminatingBytes, int nWAVTerminatingBytes); private: CSmartPtr m_spSeekTable; int m_nMaxFrames; CSmartPtr m_spIO; CSmartPtr m_spAPECompressCore; WAVEFORMATEX m_wfeInput; int m_nCompressionLevel; int m_nSamplesPerFrame; int m_nFrameIndex; int m_nLastFrameBlocks; }; #endif // #ifndef APE_APECOMPRESSCREATE_H jmac-1.74/core/nativesrc/mac/Source/MACLib/APEDecompress.h0000644000175000017500000000347210131230056023072 0ustar twernertwerner#ifndef APE_APEDECOMPRESS_H #define APE_APEDECOMPRESS_H #include "APEDecompress.h" class CUnBitArray; class CPrepare; class CAPEInfo; class IPredictorDecompress; #include "UnBitArrayBase.h" #include "MACLib.h" #include "Prepare.h" #include "CircleBuffer.h" class CAPEDecompress : public IAPEDecompress { public: CAPEDecompress(int * pErrorCode, CAPEInfo * pAPEInfo, int nStartBlock = -1, int nFinishBlock = -1); ~CAPEDecompress(); int GetData(char * pBuffer, int nBlocks, int * pBlocksRetrieved); int Seek(int nBlockOffset); int GetInfo(APE_DECOMPRESS_FIELDS Field, int nParam1 = 0, int nParam2 = 0); protected: // file info int m_nBlockAlign; int m_nCurrentFrame; // start / finish information int m_nStartBlock; int m_nFinishBlock; int m_nCurrentBlock; BOOL m_bIsRanged; BOOL m_bDecompressorInitialized; // decoding tools CPrepare m_Prepare; WAVEFORMATEX m_wfeInput; unsigned int m_nCRC; unsigned int m_nStoredCRC; int m_nSpecialCodes; int SeekToFrame(int nFrameIndex); void DecodeBlocksToFrameBuffer(int nBlocks); int FillFrameBuffer(); void StartFrame(); void EndFrame(); int InitializeDecompressor(); // more decoding components CSmartPtr m_spAPEInfo; CSmartPtr m_spUnBitArray; UNBIT_ARRAY_STATE m_BitArrayStateX; UNBIT_ARRAY_STATE m_BitArrayStateY; CSmartPtr m_spNewPredictorX; CSmartPtr m_spNewPredictorY; int m_nLastX; // decoding buffer BOOL m_bErrorDecodingCurrentFrame; int m_nCurrentFrameBufferBlock; int m_nFrameBufferFinishedBlocks; CCircleBuffer m_cbFrameBuffer; }; #endif // #ifndef APE_APEDECOMPRESS_H jmac-1.74/core/nativesrc/mac/Source/MACLib/APEHeader.h0000644000175000017500000000430510131230056022152 0ustar twernertwerner#ifndef APE_HEADER_H #define APE_HEADER_H /***************************************************************************************** APE header that all APE files have in common (old and new) *****************************************************************************************/ struct APE_COMMON_HEADER { char cID[4]; // should equal 'MAC ' uint16 nVersion; // version number * 1000 (3.81 = 3810) }; /***************************************************************************************** APE header structure for old APE files (3.97 and earlier) *****************************************************************************************/ struct APE_HEADER_OLD { char cID[4]; // should equal 'MAC ' uint16 nVersion; // version number * 1000 (3.81 = 3810) uint16 nCompressionLevel; // the compression level uint16 nFormatFlags; // any format flags (for future use) uint16 nChannels; // the number of channels (1 or 2) uint32 nSampleRate; // the sample rate (typically 44100) uint32 nHeaderBytes; // the bytes after the MAC header that compose the WAV header uint32 nTerminatingBytes; // the bytes after that raw data (for extended info) uint32 nTotalFrames; // the number of frames in the file uint32 nFinalFrameBlocks; // the number of samples in the final frame }; struct APE_FILE_INFO; class CIO; /***************************************************************************************** CAPEHeader - makes managing APE headers a little smoother (and the format change as of 3.98) *****************************************************************************************/ class CAPEHeader { public: CAPEHeader(CIO * pIO); ~CAPEHeader(); int Analyze(APE_FILE_INFO * pInfo); protected: int AnalyzeCurrent(APE_FILE_INFO * pInfo); int AnalyzeOld(APE_FILE_INFO * pInfo); int FindDescriptor(BOOL bSeek); CIO * m_pIO; }; #endif // #ifndef APE_HEADER_H jmac-1.74/core/nativesrc/mac/Source/MACLib/APEInfo.h0000644000175000017500000001252510131230056021660 0ustar twernertwerner/***************************************************************************************** APEInfo.h Copyright (C) 2000 by Matthew T. Ashland All Rights Reserved. Simple method for working with APE files... it encapsulates reading, writing and getting file information. Just create a CAPEInfo class, call OpenFile(), and use the class methods to do whatever you need... the destructor will take care of any cleanup Notes: -Most all functions return 0 upon success, and some error code (other than 0) on failure. However, all of the file functions that are wrapped from the Win32 API return 0 on failure and some other number on success. This applies to ReadFile, WriteFile, SetFilePointer, etc... WARNING: -This class driven system for using Monkey's Audio is still in development, so I can't make any guarantees that the classes and libraries won't change before everything gets finalized. Use them at your own risk *****************************************************************************************/ #ifndef APE_APEINFO_H #define APE_APEINFO_H #include "IO.h" #include "APETag.h" #include "MACLib.h" /***************************************************************************************** APE_FILE_INFO - structure which describes most aspects of an APE file (used internally for speed and ease) *****************************************************************************************/ struct APE_FILE_INFO { int nVersion; // file version number * 1000 (3.93 = 3930) int nCompressionLevel; // the compression level int nFormatFlags; // format flags int nTotalFrames; // the total number frames (frames are used internally) int nBlocksPerFrame; // the samples in a frame (frames are used internally) int nFinalFrameBlocks; // the number of samples in the final frame int nChannels; // audio channels int nSampleRate; // audio samples per second int nBitsPerSample; // audio bits per sample int nBytesPerSample; // audio bytes per sample int nBlockAlign; // audio block align (channels * bytes per sample) int nWAVHeaderBytes; // header bytes of the original WAV int nWAVDataBytes; // data bytes of the original WAV int nWAVTerminatingBytes; // terminating bytes of the original WAV int nWAVTotalBytes; // total bytes of the original WAV int nAPETotalBytes; // total bytes of the APE file int nTotalBlocks; // the total number audio blocks int nLengthMS; // the length in milliseconds int nAverageBitrate; // the kbps (i.e. 637 kpbs) int nDecompressedBitrate; // the kbps of the decompressed audio (i.e. 1440 kpbs for CD audio) int nJunkHeaderBytes; // used for ID3v2, etc. int nSeekTableElements; // the number of elements in the seek table(s) CSmartPtr spSeekByteTable; // the seek table (byte) CSmartPtr spSeekBitTable; // the seek table (bits -- legacy) CSmartPtr spWaveHeaderData; // the pre-audio header data CSmartPtr spAPEDescriptor; // the descriptor (only with newer files) }; /***************************************************************************************** Helper macros (sort of hacky) *****************************************************************************************/ #define GET_USES_CRC(APE_INFO) (((APE_INFO)->GetInfo(APE_INFO_FORMAT_FLAGS) & MAC_FORMAT_FLAG_CRC) ? TRUE : FALSE) #define GET_FRAMES_START_ON_BYTES_BOUNDARIES(APE_INFO) (((APE_INFO)->GetInfo(APE_INFO_FILE_VERSION) > 3800) ? TRUE : FALSE) #define GET_USES_SPECIAL_FRAMES(APE_INFO) (((APE_INFO)->GetInfo(APE_INFO_FILE_VERSION) > 3820) ? TRUE : FALSE) #define GET_IO(APE_INFO) ((CIO *) (APE_INFO)->GetInfo(APE_INFO_IO_SOURCE)) #define GET_TAG(APE_INFO) ((CAPETag *) (APE_INFO)->GetInfo(APE_INFO_TAG)) /***************************************************************************************** CAPEInfo - use this for all work with APE files *****************************************************************************************/ class CAPEInfo { public: // construction and destruction CAPEInfo(int * pErrorCode, const wchar_t * pFilename, CAPETag * pTag = NULL); CAPEInfo(int * pErrorCode, CIO * pIO, CAPETag * pTag = NULL); virtual ~CAPEInfo(); // query for information int GetInfo(APE_DECOMPRESS_FIELDS Field, int nParam1 = 0, int nParam2 = 0); private: // internal functions int GetFileInformation(BOOL bGetTagInformation = TRUE); int CloseFile(); // internal variables BOOL m_bHasFileInformationLoaded; CSmartPtr m_spIO; CSmartPtr m_spAPETag; APE_FILE_INFO m_APEFileInfo; }; #endif // #ifndef APE_APEINFO_H jmac-1.74/core/nativesrc/mac/Source/MACLib/APELink.h0000644000175000017500000000114410131230056021655 0ustar twernertwerner#ifndef APE_APELINK_H #define APE_APELINK_H #include "IO.h" #include "APEInfo.h" class CAPELink { public: CAPELink(const str_utf16 * pFilename); CAPELink(const char * pData, const str_utf16 * pFilename); ~CAPELink(); BOOL GetIsLinkFile(); int GetStartBlock(); int GetFinishBlock(); const wchar_t * GetImageFilename(); protected: BOOL m_bIsLinkFile; int m_nStartBlock; int m_nFinishBlock; str_utf16 m_cImageFilename[MAX_PATH]; void ParseData(const char * pData, const str_utf16 * pFilename); }; #endif // #ifndef APE_APELINK_H jmac-1.74/core/nativesrc/mac/Source/MACLib/APETag.h0000644000175000017500000003075110131230056021501 0ustar twernertwerner#ifndef APE_APETAG_H #define APE_APETAG_H class CIO; /***************************************************************************************** APETag version history / supported formats 1.0 (1000) - Original APE tag spec. Fully supported by this code. 2.0 (2000) - Refined APE tag spec (better streaming support, UTF encoding). Fully supported by this code. Notes: - also supports reading of ID3v1.1 tags - all saving done in the APE Tag format using CURRENT_APE_TAG_VERSION *****************************************************************************************/ /***************************************************************************************** APETag layout 1) Header - APE_TAG_FOOTER (optional) (32 bytes) 2) Fields (array): Value Size (4 bytes) Flags (4 bytes) Field Name (? ANSI bytes -- requires NULL terminator -- in range of 0x20 (space) to 0x7E (tilde)) Value ([Value Size] bytes) 3) Footer - APE_TAG_FOOTER (32 bytes) *****************************************************************************************/ /***************************************************************************************** Notes -When saving images, store the filename (no directory -- i.e. Cover.jpg) in UTF-8 followed by a null terminator, followed by the image data. *****************************************************************************************/ /***************************************************************************************** The version of the APE tag *****************************************************************************************/ #define CURRENT_APE_TAG_VERSION 2000 /***************************************************************************************** "Standard" APE tag fields *****************************************************************************************/ #define APE_TAG_FIELD_TITLE L"Title" #define APE_TAG_FIELD_ARTIST L"Artist" #define APE_TAG_FIELD_ALBUM L"Album" #define APE_TAG_FIELD_COMMENT L"Comment" #define APE_TAG_FIELD_YEAR L"Year" #define APE_TAG_FIELD_TRACK L"Track" #define APE_TAG_FIELD_GENRE L"Genre" #define APE_TAG_FIELD_COVER_ART_FRONT L"Cover Art (front)" #define APE_TAG_FIELD_NOTES L"Notes" #define APE_TAG_FIELD_LYRICS L"Lyrics" #define APE_TAG_FIELD_COPYRIGHT L"Copyright" #define APE_TAG_FIELD_BUY_URL L"Buy URL" #define APE_TAG_FIELD_ARTIST_URL L"Artist URL" #define APE_TAG_FIELD_PUBLISHER_URL L"Publisher URL" #define APE_TAG_FIELD_FILE_URL L"File URL" #define APE_TAG_FIELD_COPYRIGHT_URL L"Copyright URL" #define APE_TAG_FIELD_MJ_METADATA L"Media Jukebox Metadata" #define APE_TAG_FIELD_TOOL_NAME L"Tool Name" #define APE_TAG_FIELD_TOOL_VERSION L"Tool Version" #define APE_TAG_FIELD_PEAK_LEVEL L"Peak Level" #define APE_TAG_FIELD_REPLAY_GAIN_RADIO L"Replay Gain (radio)" #define APE_TAG_FIELD_REPLAY_GAIN_ALBUM L"Replay Gain (album)" #define APE_TAG_FIELD_COMPOSER L"Composer" #define APE_TAG_FIELD_KEYWORDS L"Keywords" /***************************************************************************************** Standard APE tag field values *****************************************************************************************/ #define APE_TAG_GENRE_UNDEFINED L"Undefined" /***************************************************************************************** ID3 v1.1 tag *****************************************************************************************/ #define ID3_TAG_BYTES 128 struct ID3_TAG { char Header[3]; // should equal 'TAG' char Title[30]; // title char Artist[30]; // artist char Album[30]; // album char Year[4]; // year char Comment[29]; // comment unsigned char Track; // track unsigned char Genre; // genre }; /***************************************************************************************** Footer (and header) flags *****************************************************************************************/ #define APE_TAG_FLAG_CONTAINS_HEADER (1 << 31) #define APE_TAG_FLAG_CONTAINS_FOOTER (1 << 30) #define APE_TAG_FLAG_IS_HEADER (1 << 29) #define APE_TAG_FLAGS_DEFAULT (APE_TAG_FLAG_CONTAINS_FOOTER) /***************************************************************************************** Tag field flags *****************************************************************************************/ #define TAG_FIELD_FLAG_READ_ONLY (1 << 0) #define TAG_FIELD_FLAG_DATA_TYPE_MASK (6) #define TAG_FIELD_FLAG_DATA_TYPE_TEXT_UTF8 (0 << 1) #define TAG_FIELD_FLAG_DATA_TYPE_BINARY (1 << 1) #define TAG_FIELD_FLAG_DATA_TYPE_EXTERNAL_INFO (2 << 1) #define TAG_FIELD_FLAG_DATA_TYPE_RESERVED (3 << 1) /***************************************************************************************** The footer at the end of APE tagged files (can also optionally be at the front of the tag) *****************************************************************************************/ #define APE_TAG_FOOTER_BYTES 32 class APE_TAG_FOOTER { protected: char m_cID[8]; // should equal 'APETAGEX' int m_nVersion; // equals CURRENT_APE_TAG_VERSION int m_nSize; // the complete size of the tag, including this footer (excludes header) int m_nFields; // the number of fields in the tag int m_nFlags; // the tag flags char m_cReserved[8]; // reserved for later use (must be zero) public: APE_TAG_FOOTER(int nFields = 0, int nFieldBytes = 0) { memcpy(m_cID, "APETAGEX", 8); memset(m_cReserved, 0, 8); m_nFields = nFields; m_nFlags = APE_TAG_FLAGS_DEFAULT; m_nSize = nFieldBytes + APE_TAG_FOOTER_BYTES; m_nVersion = CURRENT_APE_TAG_VERSION; } int GetTotalTagBytes() { return m_nSize + (GetHasHeader() ? APE_TAG_FOOTER_BYTES : 0); } int GetFieldBytes() { return m_nSize - APE_TAG_FOOTER_BYTES; } int GetFieldsOffset() { return GetHasHeader() ? APE_TAG_FOOTER_BYTES : 0; } int GetNumberFields() { return m_nFields; } BOOL GetHasHeader() { return (m_nFlags & APE_TAG_FLAG_CONTAINS_HEADER) ? TRUE : FALSE; } BOOL GetIsHeader() { return (m_nFlags & APE_TAG_FLAG_IS_HEADER) ? TRUE : FALSE; } int GetVersion() { return m_nVersion; } BOOL GetIsValid(BOOL bAllowHeader) { BOOL bValid = (strncmp(m_cID, "APETAGEX", 8) == 0) && (m_nVersion <= CURRENT_APE_TAG_VERSION) && (m_nFields <= 65536) && (GetFieldBytes() <= (1024 * 1024 * 16)); if (bValid && (bAllowHeader == FALSE) && GetIsHeader()) bValid = FALSE; return bValid ? TRUE : FALSE; } }; /***************************************************************************************** CAPETagField class (an APE tag is an array of these) *****************************************************************************************/ class CAPETagField { public: // create a tag field (use nFieldBytes = -1 for null-terminated strings) CAPETagField(const str_utf16 * pFieldName, const void * pFieldValue, int nFieldBytes = -1, int nFlags = 0); // destructor ~CAPETagField(); // gets the size of the entire field in bytes (name, value, and metadata) int GetFieldSize(); // get the name of the field const str_utf16 * GetFieldName(); // get the value of the field const char * GetFieldValue(); // get the size of the value (in bytes) int GetFieldValueSize(); // get any special flags int GetFieldFlags(); // output the entire field to a buffer (GetFieldSize() bytes) int SaveField(char * pBuffer); // checks to see if the field is read-only BOOL GetIsReadOnly() { return (m_nFieldFlags & TAG_FIELD_FLAG_READ_ONLY) ? TRUE : FALSE; } BOOL GetIsUTF8Text() { return ((m_nFieldFlags & TAG_FIELD_FLAG_DATA_TYPE_MASK) == TAG_FIELD_FLAG_DATA_TYPE_TEXT_UTF8) ? TRUE : FALSE; } // set helpers (use with EXTREME caution) void SetFieldFlags(int nFlags) { m_nFieldFlags = nFlags; } private: CSmartPtr m_spFieldNameUTF16; CSmartPtr m_spFieldValue; int m_nFieldFlags; int m_nFieldValueBytes; }; /***************************************************************************************** CAPETag class *****************************************************************************************/ class CAPETag { public: // create an APE tag // bAnalyze determines whether it will analyze immediately or on the first request // be careful with multiple threads / file pointer movement if you don't analyze immediately CAPETag(CIO * pIO, BOOL bAnalyze = TRUE); CAPETag(const str_utf16 * pFilename, BOOL bAnalyze = TRUE); // destructor ~CAPETag(); // save the tag to the I/O source (bUseOldID3 forces it to save as an ID3v1.1 tag instead of an APE tag) int Save(BOOL bUseOldID3 = FALSE); // removes any tags from the file (bUpdate determines whether is should re-analyze after removing the tag) int Remove(BOOL bUpdate = TRUE); // sets the value of a field (use nFieldBytes = -1 for null terminated strings) // note: using NULL or "" for a string type will remove the field int SetFieldString(const str_utf16 * pFieldName, const str_utf16 * pFieldValue); int SetFieldString(const str_utf16 * pFieldName, const char * pFieldValue, BOOL bAlreadyUTF8Encoded); int SetFieldBinary(const str_utf16 * pFieldName, const void * pFieldValue, int nFieldBytes, int nFieldFlags); // gets the value of a field (returns -1 and an empty buffer if the field doesn't exist) int GetFieldBinary(const str_utf16 * pFieldName, void * pBuffer, int * pBufferBytes); int GetFieldString(const str_utf16 * pFieldName, str_utf16 * pBuffer, int * pBufferCharacters); int GetFieldString(const str_utf16 * pFieldName, str_ansi * pBuffer, int * pBufferCharacters, BOOL bUTF8Encode = FALSE); // remove a specific field int RemoveField(const str_utf16 * pFieldName); int RemoveField(int nIndex); // clear all the fields int ClearFields(); // get the total tag bytes in the file from the last analyze // need to call Save() then Analyze() to update any changes int GetTagBytes(); // fills in an ID3_TAG using the current fields (useful for quickly converting the tag) int CreateID3Tag(ID3_TAG * pID3Tag); // see whether the file has an ID3 or APE tag BOOL GetHasID3Tag() { if (m_bAnalyzed == FALSE) { Analyze(); } return m_bHasID3Tag; } BOOL GetHasAPETag() { if (m_bAnalyzed == FALSE) { Analyze(); } return m_bHasAPETag; } int GetAPETagVersion() { return GetHasAPETag() ? m_nAPETagVersion : -1; } // gets a desired tag field (returns NULL if not found) // again, be careful, because this a pointer to the actual field in this class CAPETagField * GetTagField(const str_utf16 * pFieldName); CAPETagField * GetTagField(int nIndex); // options void SetIgnoreReadOnly(BOOL bIgnoreReadOnly) { m_bIgnoreReadOnly = bIgnoreReadOnly; } private: // private functions int Analyze(); int GetTagFieldIndex(const str_utf16 * pFieldName); int WriteBufferToEndOfIO(void * pBuffer, int nBytes); int LoadField(const char * pBuffer, int nMaximumBytes, int * pBytes); int SortFields(); static int CompareFields(const void * pA, const void * pB); // helper set / get field functions int SetFieldID3String(const str_utf16 * pFieldName, const char * pFieldValue, int nBytes); int GetFieldID3String(const str_utf16 * pFieldName, char * pBuffer, int nBytes); // private data CSmartPtr m_spIO; BOOL m_bAnalyzed; int m_nTagBytes; int m_nFields; CAPETagField * m_aryFields[256]; BOOL m_bHasAPETag; int m_nAPETagVersion; BOOL m_bHasID3Tag; BOOL m_bIgnoreReadOnly; }; #endif // #ifndef APE_APETAG_H jmac-1.74/core/nativesrc/mac/Source/MACLib/Assembly/0000755000175000017500000000000010451144641022051 5ustar twernertwernerjmac-1.74/core/nativesrc/mac/Source/MACLib/Assembly/Assembly.h0000644000175000017500000000043510131230056023772 0ustar twernertwerner#ifndef APE_ASSEMBLY_H #define APE_ASSEMBLY_H extern "C" { void Adapt(short * pM, const short * pAdapt, int nDirection, int nOrder); int CalculateDotProduct(const short * pA, const short * pB, int nOrder); BOOL GetMMXAvailable(); }; #endif // #ifndef APE_ASSEMBLY_H jmac-1.74/core/nativesrc/mac/Source/MACLib/BitArray.h0000644000175000017500000000277210131230056022157 0ustar twernertwerner#ifndef APE_BITARRAY_H #define APE_BITARRAY_H #include "IO.h" #include "MD5.h" //#define BUILD_RANGE_TABLE struct RANGE_CODER_STRUCT_COMPRESS { unsigned int low; // low end of interval unsigned int range; // length of interval unsigned int help; // bytes_to_follow resp. intermediate value unsigned char buffer; // buffer for input / output }; struct BIT_ARRAY_STATE { uint32 k; uint32 nKSum; }; class CBitArray { public: // construction / destruction CBitArray(CIO *pIO); ~CBitArray(); // encoding int EncodeUnsignedLong(unsigned int n); int EncodeValue(int nEncode, BIT_ARRAY_STATE & BitArrayState); int EncodeBits(unsigned int nValue, int nBits); // output (saving) int OutputBitArray(BOOL bFinalize = FALSE); // other functions void Finalize(); void AdvanceToByteBoundary(); inline uint32 GetCurrentBitIndex() { return m_nCurrentBitIndex; } void FlushState(BIT_ARRAY_STATE & BitArrayState); void FlushBitArray(); inline CMD5Helper & GetMD5Helper() { return m_MD5; } private: // data members uint32 * m_pBitArray; CIO * m_pIO; uint32 m_nCurrentBitIndex; RANGE_CODER_STRUCT_COMPRESS m_RangeCoderInfo; CMD5Helper m_MD5; #ifdef BUILD_RANGE_TABLE void OutputRangeTable(); #endif }; #endif // #ifndef APE_BITARRAY_H jmac-1.74/core/nativesrc/mac/Source/MACLib/MACLib.h0000644000175000017500000006271010131230056021467 0ustar twernertwerner/***************************************************************************************** Monkey's Audio MACLib.h (include for using MACLib.lib in your projects) Copyright (C) 2000-2003 by Matthew T. Ashland All Rights Reserved. Overview: There are two main interfaces... create one (using CreateIAPExxx) and go to town: IAPECompress - for creating APE files IAPEDecompress - for decompressing and analyzing APE files Note(s): Unless otherwise specified, functions return ERROR_SUCCESS (0) on success and an error code on failure. The terminology "Sample" refers to a single sample value, and "Block" refers to a collection of "Channel" samples. For simplicity, MAC typically uses blocks everywhere so that channel mis-alignment cannot happen. (i.e. on a CD, a sample is 2 bytes and a block is 4 bytes ([2 bytes per sample] * [2 channels] = 4 bytes)) Questions / Suggestions: Please direct questions or comments to the Monkey's Audio developers board: http://www.monkeysaudio.com/cgi-bin/YaBB/YaBB.cgi -> Developers or, if necessary, matt @ monkeysaudio.com *****************************************************************************************/ #ifndef APE_MACLIB_H #define APE_MACLIB_H /************************************************************************************************* APE File Format Overview: (pieces in order -- only valid for the latest version APE files) JUNK - any amount of "junk" before the APE_DESCRIPTOR (so people that put ID3v2 tags on the files aren't hosed) APE_DESCRIPTOR - defines the sizes (and offsets) of all the pieces, as well as the MD5 checksum APE_HEADER - describes all of the necessary information about the APE file SEEK TABLE - the table that represents seek offsets [optional] HEADER DATA - the pre-audio data from the original file [optional] APE FRAMES - the actual compressed audio (broken into frames for seekability) TERMINATING DATA - the post-audio data from the original file [optional] TAG - describes all the properties of the file [optional] Notes: Junk: This block may not be supported in the future, so don't write any software that adds meta data before the APE_DESCRIPTOR. Please use the APE Tag for any meta data. Seek Table: A 32-bit unsigned integer array of offsets from the header to the frame data. May become "delta" values someday to better suit huge files. MD5 Hash: Since the header is the last part written to an APE file, you must calculate the MD5 checksum out of order. So, you first calculate from the tail of the seek table to the end of the terminating data. Then, go back and do from the end of the descriptor to the tail of the seek table. You may wish to just cache the header data when starting and run it last, so you don't need to seek back in the I/O. *************************************************************************************************/ /***************************************************************************************** Defines *****************************************************************************************/ #define COMPRESSION_LEVEL_FAST 1000 #define COMPRESSION_LEVEL_NORMAL 2000 #define COMPRESSION_LEVEL_HIGH 3000 #define COMPRESSION_LEVEL_EXTRA_HIGH 4000 #define COMPRESSION_LEVEL_INSANE 5000 #define MAC_FORMAT_FLAG_8_BIT 1 // is 8-bit [OBSOLETE] #define MAC_FORMAT_FLAG_CRC 2 // uses the new CRC32 error detection [OBSOLETE] #define MAC_FORMAT_FLAG_HAS_PEAK_LEVEL 4 // uint32 nPeakLevel after the header [OBSOLETE] #define MAC_FORMAT_FLAG_24_BIT 8 // is 24-bit [OBSOLETE] #define MAC_FORMAT_FLAG_HAS_SEEK_ELEMENTS 16 // has the number of seek elements after the peak level #define MAC_FORMAT_FLAG_CREATE_WAV_HEADER 32 // create the wave header on decompression (not stored) #define CREATE_WAV_HEADER_ON_DECOMPRESSION -1 #define MAX_AUDIO_BYTES_UNKNOWN -1 typedef void (__stdcall * APE_PROGRESS_CALLBACK) (int); /***************************************************************************************** WAV header structure *****************************************************************************************/ struct WAVE_HEADER { // RIFF header char cRIFFHeader[4]; unsigned int nRIFFBytes; // data type char cDataTypeID[4]; // wave format char cFormatHeader[4]; unsigned int nFormatBytes; unsigned short nFormatTag; unsigned short nChannels; unsigned int nSamplesPerSec; unsigned int nAvgBytesPerSec; unsigned short nBlockAlign; unsigned short nBitsPerSample; // data chunk header char cDataHeader[4]; unsigned int nDataBytes; }; /***************************************************************************************** APE_DESCRIPTOR structure (file header that describes lengths, offsets, etc.) *****************************************************************************************/ struct APE_DESCRIPTOR { char cID[4]; // should equal 'MAC ' uint16 nVersion; // version number * 1000 (3.81 = 3810) uint32 nDescriptorBytes; // the number of descriptor bytes (allows later expansion of this header) uint32 nHeaderBytes; // the number of header APE_HEADER bytes uint32 nSeekTableBytes; // the number of bytes of the seek table uint32 nHeaderDataBytes; // the number of header data bytes (from original file) uint32 nAPEFrameDataBytes; // the number of bytes of APE frame data uint32 nAPEFrameDataBytesHigh; // the high order number of APE frame data bytes uint32 nTerminatingDataBytes; // the terminating data of the file (not including tag data) uint8 cFileMD5[16]; // the MD5 hash of the file (see notes for usage... it's a littly tricky) }; /***************************************************************************************** APE_HEADER structure (describes the format, duration, etc. of the APE file) *****************************************************************************************/ struct APE_HEADER { uint16 nCompressionLevel; // the compression level (see defines I.E. COMPRESSION_LEVEL_FAST) uint16 nFormatFlags; // any format flags (for future use) uint32 nBlocksPerFrame; // the number of audio blocks in one frame uint32 nFinalFrameBlocks; // the number of audio blocks in the final frame uint32 nTotalFrames; // the total number of frames uint16 nBitsPerSample; // the bits per sample (typically 16) uint16 nChannels; // the number of channels (1 or 2) uint32 nSampleRate; // the sample rate (typically 44100) }; /************************************************************************************************* Classes (fully defined elsewhere) *************************************************************************************************/ class CIO; class CInputSource; class CAPEInfo; /************************************************************************************************* IAPEDecompress fields - used when querying for information Note(s): -the distinction between APE_INFO_XXXX and APE_DECOMPRESS_XXXX is that the first is querying the APE information engine, and the other is querying the decompressor, and since the decompressor can be a range of an APE file (for APL), differences will arise. Typically, use the APE_DECOMPRESS_XXXX fields when querying for info about the length, etc. so APL will work properly. (i.e. (APE_INFO_TOTAL_BLOCKS != APE_DECOMPRESS_TOTAL_BLOCKS) for APL files) *************************************************************************************************/ enum APE_DECOMPRESS_FIELDS { APE_INFO_FILE_VERSION = 1000, // version of the APE file * 1000 (3.93 = 3930) [ignored, ignored] APE_INFO_COMPRESSION_LEVEL = 1001, // compression level of the APE file [ignored, ignored] APE_INFO_FORMAT_FLAGS = 1002, // format flags of the APE file [ignored, ignored] APE_INFO_SAMPLE_RATE = 1003, // sample rate (Hz) [ignored, ignored] APE_INFO_BITS_PER_SAMPLE = 1004, // bits per sample [ignored, ignored] APE_INFO_BYTES_PER_SAMPLE = 1005, // number of bytes per sample [ignored, ignored] APE_INFO_CHANNELS = 1006, // channels [ignored, ignored] APE_INFO_BLOCK_ALIGN = 1007, // block alignment [ignored, ignored] APE_INFO_BLOCKS_PER_FRAME = 1008, // number of blocks in a frame (frames are used internally) [ignored, ignored] APE_INFO_FINAL_FRAME_BLOCKS = 1009, // blocks in the final frame (frames are used internally) [ignored, ignored] APE_INFO_TOTAL_FRAMES = 1010, // total number frames (frames are used internally) [ignored, ignored] APE_INFO_WAV_HEADER_BYTES = 1011, // header bytes of the decompressed WAV [ignored, ignored] APE_INFO_WAV_TERMINATING_BYTES = 1012, // terminating bytes of the decompressed WAV [ignored, ignored] APE_INFO_WAV_DATA_BYTES = 1013, // data bytes of the decompressed WAV [ignored, ignored] APE_INFO_WAV_TOTAL_BYTES = 1014, // total bytes of the decompressed WAV [ignored, ignored] APE_INFO_APE_TOTAL_BYTES = 1015, // total bytes of the APE file [ignored, ignored] APE_INFO_TOTAL_BLOCKS = 1016, // total blocks of audio data [ignored, ignored] APE_INFO_LENGTH_MS = 1017, // length in ms (1 sec = 1000 ms) [ignored, ignored] APE_INFO_AVERAGE_BITRATE = 1018, // average bitrate of the APE [ignored, ignored] APE_INFO_FRAME_BITRATE = 1019, // bitrate of specified APE frame [frame index, ignored] APE_INFO_DECOMPRESSED_BITRATE = 1020, // bitrate of the decompressed WAV [ignored, ignored] APE_INFO_PEAK_LEVEL = 1021, // peak audio level (obsolete) (-1 is unknown) [ignored, ignored] APE_INFO_SEEK_BIT = 1022, // bit offset [frame index, ignored] APE_INFO_SEEK_BYTE = 1023, // byte offset [frame index, ignored] APE_INFO_WAV_HEADER_DATA = 1024, // error code [buffer *, max bytes] APE_INFO_WAV_TERMINATING_DATA = 1025, // error code [buffer *, max bytes] APE_INFO_WAVEFORMATEX = 1026, // error code [waveformatex *, ignored] APE_INFO_IO_SOURCE = 1027, // I/O source (CIO *) [ignored, ignored] APE_INFO_FRAME_BYTES = 1028, // bytes (compressed) of the frame [frame index, ignored] APE_INFO_FRAME_BLOCKS = 1029, // blocks in a given frame [frame index, ignored] APE_INFO_TAG = 1030, // point to tag (CAPETag *) [ignored, ignored] APE_DECOMPRESS_CURRENT_BLOCK = 2000, // current block location [ignored, ignored] APE_DECOMPRESS_CURRENT_MS = 2001, // current millisecond location [ignored, ignored] APE_DECOMPRESS_TOTAL_BLOCKS = 2002, // total blocks in the decompressors range [ignored, ignored] APE_DECOMPRESS_LENGTH_MS = 2003, // total blocks in the decompressors range [ignored, ignored] APE_DECOMPRESS_CURRENT_BITRATE = 2004, // current bitrate [ignored, ignored] APE_DECOMPRESS_AVERAGE_BITRATE = 2005, // average bitrate (works with ranges) [ignored, ignored] APE_INTERNAL_INFO = 3000, // for internal use -- don't use (returns APE_FILE_INFO *) [ignored, ignored] }; /************************************************************************************************* IAPEDecompress - interface for working with existing APE files (decoding, seeking, analyzing, etc.) *************************************************************************************************/ class IAPEDecompress { public: // destructor (needed so implementation's destructor will be called) virtual ~IAPEDecompress() {} /********************************************************************************************* * Decompress / Seek *********************************************************************************************/ ////////////////////////////////////////////////////////////////////////////////////////////// // GetData(...) - gets raw decompressed audio // // Parameters: // char * pBuffer // a pointer to a buffer to put the data into // int nBlocks // the number of audio blocks desired (see note at intro about blocks vs. samples) // int * pBlocksRetrieved // the number of blocks actually retrieved (could be less at end of file or on critical failure) ////////////////////////////////////////////////////////////////////////////////////////////// virtual int GetData(char * pBuffer, int nBlocks, int * pBlocksRetrieved) = 0; ////////////////////////////////////////////////////////////////////////////////////////////// // Seek(...) - seeks // // Parameters: // int nBlockOffset // the block to seek to (see note at intro about blocks vs. samples) ////////////////////////////////////////////////////////////////////////////////////////////// virtual int Seek(int nBlockOffset) = 0; /********************************************************************************************* * Get Information *********************************************************************************************/ ////////////////////////////////////////////////////////////////////////////////////////////// // GetInfo(...) - get information about the APE file or the state of the decompressor // // Parameters: // APE_DECOMPRESS_FIELDS Field // the field we're querying (see APE_DECOMPRESS_FIELDS above for more info) // int nParam1 // generic parameter... usage is listed in APE_DECOMPRESS_FIELDS // int nParam2 // generic parameter... usage is listed in APE_DECOMPRESS_FIELDS ////////////////////////////////////////////////////////////////////////////////////////////// virtual int GetInfo(APE_DECOMPRESS_FIELDS Field, int nParam1 = 0, int nParam2 = 0) = 0; }; /************************************************************************************************* IAPECompress - interface for creating APE files Usage: To create an APE file, you Start(...), then add data (in a variety of ways), then Finish(...) *************************************************************************************************/ class IAPECompress { public: // destructor (needed so implementation's destructor will be called) virtual ~IAPECompress() {} /********************************************************************************************* * Start *********************************************************************************************/ ////////////////////////////////////////////////////////////////////////////////////////////// // Start(...) / StartEx(...) - starts encoding // // Parameters: // CIO * pioOutput / const str_utf16 * pFilename // the output... either a filename or an I/O source // WAVEFORMATEX * pwfeInput // format of the audio to encode (use FillWaveFormatEx() if necessary) // int nMaxAudioBytes // the absolute maximum audio bytes that will be encoded... encoding fails with a // ERROR_APE_COMPRESS_TOO_MUCH_DATA if you attempt to encode more than specified here // (if unknown, use MAX_AUDIO_BYTES_UNKNOWN to allocate as much storage in the seek table as // possible... limit is then 2 GB of data (~4 hours of CD music)... this wastes around // 30kb, so only do it if completely necessary) // int nCompressionLevel // the compression level for the APE file (fast - extra high) // (note: extra-high is much slower for little gain) // const void * pHeaderData // a pointer to a buffer containing the WAV header (data before the data block in the WAV) // (note: use NULL for on-the-fly encoding... see next parameter) // int nHeaderBytes // number of bytes in the header data buffer (use CREATE_WAV_HEADER_ON_DECOMPRESSION and // NULL for the pHeaderData and MAC will automatically create the appropriate WAV header // on decompression) ////////////////////////////////////////////////////////////////////////////////////////////// virtual int Start(const str_utf16 * pOutputFilename, const WAVEFORMATEX * pwfeInput, int nMaxAudioBytes = MAX_AUDIO_BYTES_UNKNOWN, int nCompressionLevel = COMPRESSION_LEVEL_NORMAL, const void * pHeaderData = NULL, int nHeaderBytes = CREATE_WAV_HEADER_ON_DECOMPRESSION) = 0; virtual int StartEx(CIO * pioOutput, const WAVEFORMATEX * pwfeInput, int nMaxAudioBytes = MAX_AUDIO_BYTES_UNKNOWN, int nCompressionLevel = COMPRESSION_LEVEL_NORMAL, const void * pHeaderData = NULL, int nHeaderBytes = CREATE_WAV_HEADER_ON_DECOMPRESSION) = 0; /********************************************************************************************* * Add / Compress Data * - there are 3 ways to add data: * 1) simple call AddData(...) * 2) lock MAC's buffer, copy into it, and unlock (LockBuffer(...) / UnlockBuffer(...)) * 3) from an I/O source (AddDataFromInputSource(...)) *********************************************************************************************/ ////////////////////////////////////////////////////////////////////////////////////////////// // AddData(...) - adds data to the encoder // // Parameters: // unsigned char * pData // a pointer to a buffer containing the raw audio data // int nBytes // the number of bytes in the buffer ////////////////////////////////////////////////////////////////////////////////////////////// virtual int AddData(unsigned char * pData, int nBytes) = 0; ////////////////////////////////////////////////////////////////////////////////////////////// // GetBufferBytesAvailable(...) - returns the number of bytes available in the buffer // (helpful when locking) ////////////////////////////////////////////////////////////////////////////////////////////// virtual int GetBufferBytesAvailable() = 0; ////////////////////////////////////////////////////////////////////////////////////////////// // LockBuffer(...) - locks MAC's buffer so we can copy into it // // Parameters: // int * pBytesAvailable // returns the number of bytes available in the buffer (DO NOT COPY MORE THAN THIS IN) // // Return: // pointer to the buffer (add at that location) ////////////////////////////////////////////////////////////////////////////////////////////// virtual unsigned char * LockBuffer(int * pBytesAvailable) = 0; ////////////////////////////////////////////////////////////////////////////////////////////// // UnlockBuffer(...) - releases the buffer // // Parameters: // int nBytesAdded // the number of bytes copied into the buffer // BOOL bProcess // whether MAC should process as much as possible of the buffer ////////////////////////////////////////////////////////////////////////////////////////////// virtual int UnlockBuffer(int nBytesAdded, BOOL bProcess = TRUE) = 0; ////////////////////////////////////////////////////////////////////////////////////////////// // AddDataFromInputSource(...) - use a CInputSource (input source) to add data // // Parameters: // CInputSource * pInputSource // a pointer to the input source // int nMaxBytes // the maximum number of bytes to let MAC add (-1 if MAC can add any amount) // int * pBytesAdded // returns the number of bytes added from the I/O source ////////////////////////////////////////////////////////////////////////////////////////////// virtual int AddDataFromInputSource(CInputSource * pInputSource, int nMaxBytes = -1, int * pBytesAdded = NULL) = 0; /********************************************************************************************* * Finish / Kill *********************************************************************************************/ ////////////////////////////////////////////////////////////////////////////////////////////// // Finish(...) - ends encoding and finalizes the file // // Parameters: // unsigned char * pTerminatingData // a pointer to a buffer containing the information to place at the end of the APE file // (comprised of the WAV terminating data (data after the data block in the WAV) followed // by any tag information) // int nTerminatingBytes // number of bytes in the terminating data buffer // int nWAVTerminatingBytes // the number of bytes of the terminating data buffer that should be appended to a decoded // WAV file (it's basically nTerminatingBytes - the bytes that make up the tag) ////////////////////////////////////////////////////////////////////////////////////////////// virtual int Finish(unsigned char * pTerminatingData, int nTerminatingBytes, int nWAVTerminatingBytes) = 0; ////////////////////////////////////////////////////////////////////////////////////////////// // Kill(...) - stops encoding and deletes the output file // --- NOT CURRENTLY IMPLEMENTED --- ////////////////////////////////////////////////////////////////////////////////////////////// virtual int Kill() = 0; }; /************************************************************************************************* Functions to create the interfaces Usage: Interface creation returns a NULL pointer on failure (and fills error code if it was passed in) Usage example: int nErrorCode; IAPEDecompress * pAPEDecompress = CreateIAPEDecompress("c:\\1.ape", &nErrorCode); if (pAPEDecompress == NULL) { // failure... nErrorCode will have specific code } *************************************************************************************************/ extern "C" { IAPEDecompress * __stdcall CreateIAPEDecompress(const str_utf16 * pFilename, int * pErrorCode = NULL); IAPEDecompress * __stdcall CreateIAPEDecompressEx(CIO * pIO, int * pErrorCode = NULL); IAPEDecompress * __stdcall CreateIAPEDecompressEx2(CAPEInfo * pAPEInfo, int nStartBlock = -1, int nFinishBlock = -1, int * pErrorCode = NULL); IAPECompress * __stdcall CreateIAPECompress(int * pErrorCode = NULL); } /************************************************************************************************* Simple functions - see the SDK sample projects for usage examples *************************************************************************************************/ extern "C" { // process whole files DLLEXPORT int __stdcall CompressFile(const str_ansi * pInputFilename, const str_ansi * pOutputFilename, int nCompressionLevel = COMPRESSION_LEVEL_NORMAL, int * pPercentageDone = NULL, APE_PROGRESS_CALLBACK ProgressCallback = 0, int * pKillFlag = NULL); DLLEXPORT int __stdcall DecompressFile(const str_ansi * pInputFilename, const str_ansi * pOutputFilename, int * pPercentageDone, APE_PROGRESS_CALLBACK ProgressCallback, int * pKillFlag); DLLEXPORT int __stdcall ConvertFile(const str_ansi * pInputFilename, const str_ansi * pOutputFilename, int nCompressionLevel, int * pPercentageDone, APE_PROGRESS_CALLBACK ProgressCallback, int * pKillFlag); DLLEXPORT int __stdcall VerifyFile(const str_ansi * pInputFilename, int * pPercentageDone, APE_PROGRESS_CALLBACK ProgressCallback, int * pKillFlag); DLLEXPORT int __stdcall CompressFileW(const str_utf16 * pInputFilename, const str_utf16 * pOutputFilename, int nCompressionLevel = COMPRESSION_LEVEL_NORMAL, int * pPercentageDone = NULL, APE_PROGRESS_CALLBACK ProgressCallback = 0, int * pKillFlag = NULL); DLLEXPORT int __stdcall DecompressFileW(const str_utf16 * pInputFilename, const str_utf16 * pOutputFilename, int * pPercentageDone, APE_PROGRESS_CALLBACK ProgressCallback, int * pKillFlag); DLLEXPORT int __stdcall ConvertFileW(const str_utf16 * pInputFilename, const str_utf16 * pOutputFilename, int nCompressionLevel, int * pPercentageDone, APE_PROGRESS_CALLBACK ProgressCallback, int * pKillFlag); DLLEXPORT int __stdcall VerifyFileW(const str_utf16 * pInputFilename, int * pPercentageDone, APE_PROGRESS_CALLBACK ProgressCallback, int * pKillFlag, BOOL bQuickVerifyIfPossible = FALSE); // helper functions DLLEXPORT int __stdcall FillWaveFormatEx(WAVEFORMATEX * pWaveFormatEx, int nSampleRate = 44100, int nBitsPerSample = 16, int nChannels = 2); DLLEXPORT int __stdcall FillWaveHeader(WAVE_HEADER * pWAVHeader, int nAudioBytes, WAVEFORMATEX * pWaveFormatEx, int nTerminatingBytes = 0); } #endif // #ifndef APE_MACLIB_H jmac-1.74/core/nativesrc/mac/Source/MACLib/MACProgressHelper.h0000644000175000017500000000207610131230056023724 0ustar twernertwerner#ifndef APE_MACPROGRESSHELPER_H #define APE_MACPROGRESSHELPER_H #define KILL_FLAG_CONTINUE 0 #define KILL_FLAG_PAUSE -1 #define KILL_FLAG_STOP 1 typedef void (__stdcall * APE_PROGRESS_CALLBACK) (int); class CMACProgressHelper { public: CMACProgressHelper(int nTotalSteps, int *pPercentageDone, APE_PROGRESS_CALLBACK ProgressCallback, int *pKillFlag); virtual ~CMACProgressHelper(); void UpdateProgress(int nCurrentStep = -1, BOOL bForceUpdate = FALSE); void UpdateProgressComplete() { UpdateProgress(m_nTotalSteps, TRUE); } int ProcessKillFlag(BOOL bSleep = TRUE); private: BOOL m_bUseCallback; APE_PROGRESS_CALLBACK m_CallbackFunction; int *m_pPercentageDone; int m_nTotalSteps; int m_nCurrentStep; int m_nLastCallbackFiredPercentageDone; int *m_pKillFlag; }; #endif // #ifndef APE_MACPROGRESSHELPER_H jmac-1.74/core/nativesrc/mac/Source/MACLib/MultichannelNNFilter.h0000644000175000017500000000437510131230056024470 0ustar twernertwerner#ifndef APE_MULTICHANNEL_NNFILTER_H #define APE_MULTICHANNEL_NNFILTER_H #include "NNFilter.h" class CMultichannelNNFilter { public: CMultichannelNNFilter(int nOrder1, int nOrder2, int nShift) { m_pNNFilterA = new CNNFilter(nOrder1 + nOrder2, 11, 3980); m_pNNFilterB = new CNNFilter(nOrder1 + nOrder2, 11, 3980); m_rbA.Create(NN_WINDOW_ELEMENTS, nOrder1 + nOrder2 + 1); m_rbB.Create(NN_WINDOW_ELEMENTS, nOrder1 + nOrder2 + 1); m_nShift = nShift; m_nOrder1 = nOrder1; } ~CMultichannelNNFilter() { SAFE_DELETE(m_pNNFilterA) SAFE_DELETE(m_pNNFilterB) } void Flush() { m_pNNFilterA->Flush(); m_pNNFilterB->Flush(); m_rbA.Flush(); m_rbB.Flush(); } inline void Compress(int & nA, int & nB) { if (m_nShift <= 0) return; m_rbA[0] = GetSaturatedShortFromInt(nA); m_rbB[0] = GetSaturatedShortFromInt(nB); m_rbA[-m_nOrder1 - 1] = m_rbB[-1]; m_rbB[-m_nOrder1 - 1] = m_rbA[0]; nA -= (m_pNNFilterA->GetPrediction(&m_rbA[-1]) >> m_nShift); nB -= (m_pNNFilterB->GetPrediction(&m_rbB[-1]) >> m_nShift); m_pNNFilterA->AdaptAfterPrediction(&m_rbA[-1], -m_nOrder1, nA); m_pNNFilterB->AdaptAfterPrediction(&m_rbB[-1], -m_nOrder1, nB); m_rbA.IncrementSafe(); m_rbB.IncrementSafe(); } inline void Decompress(int & nA, int & nB) { if (m_nShift <= 0) return; m_rbA[-m_nOrder1 - 1] = m_rbB[-1]; int nOutputA = nA + (m_pNNFilterA->GetPrediction(&m_rbA[-1]) >> m_nShift); m_rbA[0] = GetSaturatedShortFromInt(nOutputA); m_rbB[-m_nOrder1 - 1] = m_rbA[0]; int nOutputB = nB + (m_pNNFilterB->GetPrediction(&m_rbB[-1]) >> m_nShift); m_rbB[0] = GetSaturatedShortFromInt(nOutputB); m_pNNFilterA->AdaptAfterPrediction(&m_rbA[-1], -m_nOrder1, nA); m_pNNFilterB->AdaptAfterPrediction(&m_rbB[-1], -m_nOrder1, nB); m_rbA.IncrementSafe(); m_rbB.IncrementSafe(); nA = nOutputA; nB = nOutputB; } protected: CNNFilter * m_pNNFilterA; CNNFilter * m_pNNFilterB; int m_nShift; int m_nOrder1; CRollBuffer m_rbA; CRollBuffer m_rbB; inline short GetSaturatedShortFromInt(int nValue) const { return short((nValue == short(nValue)) ? nValue : (nValue >> 31) ^ 0x7FFF); } }; #endif // #ifndef APE_MULTICHANNEL_NNFILTER_H jmac-1.74/core/nativesrc/mac/Source/MACLib/NewPredictor.h0000644000175000017500000000554610131230056023051 0ustar twernertwerner#ifndef APE_NEWPREDICTOR_H #define APE_NEWPREDICTOR_H #include "Predictor.h" #include "RollBuffer.h" #include "NNFilter.h" #include "ScaledFirstOrderFilter.h" /************************************************************************************************* Functions to create the interfaces *************************************************************************************************/ IPredictorCompress * __stdcall CreateIPredictorCompress(); IPredictorDecompress * __stdcall CreateIPredictorDecompress(); #define WINDOW_BLOCKS 512 #define BUFFER_COUNT 1 #define HISTORY_ELEMENTS 8 #define M_COUNT 8 class CPredictorCompressNormal : public IPredictorCompress { public: CPredictorCompressNormal(int nCompressionLevel); virtual ~CPredictorCompressNormal(); int CompressValue(int nA, int nB = 0); int Flush(); protected: // buffer information CRollBufferFast m_rbPrediction; CRollBufferFast m_rbAdapt; CScaledFirstOrderFilter<31, 5> m_Stage1FilterA; CScaledFirstOrderFilter<31, 5> m_Stage1FilterB; // adaption int m_aryM[9]; // other int m_nCurrentIndex; CNNFilter * m_pNNFilter; CNNFilter * m_pNNFilter1; CNNFilter * m_pNNFilter2; }; class CPredictorDecompressNormal3930to3950 : public IPredictorDecompress { public: CPredictorDecompressNormal3930to3950(int nCompressionLevel, int nVersion); virtual ~CPredictorDecompressNormal3930to3950(); int DecompressValue(int nInput, int); int Flush(); protected: // buffer information int * m_pBuffer[BUFFER_COUNT]; // adaption int m_aryM[M_COUNT]; // buffer pointers int * m_pInputBuffer; // other int m_nCurrentIndex; int m_nLastValue; CNNFilter * m_pNNFilter; CNNFilter * m_pNNFilter1; }; class CPredictorDecompress3950toCurrent : public IPredictorDecompress { public: CPredictorDecompress3950toCurrent(int nCompressionLevel, int nVersion); virtual ~CPredictorDecompress3950toCurrent(); int DecompressValue(int nA, int nB = 0); int Flush(); protected: // adaption int m_aryMA[M_COUNT]; int m_aryMB[M_COUNT]; // buffer pointers CRollBufferFast m_rbPredictionA; CRollBufferFast m_rbPredictionB; CRollBufferFast m_rbAdaptA; CRollBufferFast m_rbAdaptB; CScaledFirstOrderFilter<31, 5> m_Stage1FilterA; CScaledFirstOrderFilter<31, 5> m_Stage1FilterB; // other int m_nCurrentIndex; int m_nLastValueA; int m_nVersion; CNNFilter * m_pNNFilter; CNNFilter * m_pNNFilter1; CNNFilter * m_pNNFilter2; }; #endif // #ifndef APE_NEWPREDICTOR_H jmac-1.74/core/nativesrc/mac/Source/MACLib/NNFilter.h0000644000175000017500000000162410131230056022116 0ustar twernertwerner#ifndef APE_NNFILTER_H #define APE_NNFILTER_H #include "RollBuffer.h" #define NN_WINDOW_ELEMENTS 512 //#define NN_TEST_MMX class CNNFilter { public: CNNFilter(int nOrder, int nShift, int nVersion); ~CNNFilter(); int Compress(int nInput); int Decompress(int nInput); void Flush(); private: int m_nOrder; int m_nShift; int m_nVersion; BOOL m_bMMXAvailable; int m_nRunningAverage; CRollBuffer m_rbInput; CRollBuffer m_rbDeltaM; short * m_paryM; inline short GetSaturatedShortFromInt(int nValue) const { return short((nValue == short(nValue)) ? nValue : (nValue >> 31) ^ 0x7FFF); } inline int CalculateDotProductNoMMX(short * pA, short * pB, int nOrder); inline void AdaptNoMMX(short * pM, short * pAdapt, int nDirection, int nOrder); }; #endif // #ifndef APE_NNFILTER_H jmac-1.74/core/nativesrc/mac/Source/MACLib/Old/0000755000175000017500000000000010451144641021010 5ustar twernertwernerjmac-1.74/core/nativesrc/mac/Source/MACLib/Old/Anti-Predictor.h0000644000175000017500000002127210131230056024000 0ustar twernertwerner#ifndef APE_ANTIPREDICTOR_H #define APE_ANTIPREDICTOR_H class CAntiPredictor; CAntiPredictor * CreateAntiPredictor(int nCompressionLevel, int nVersion); /***************************************************************************************** Base class for all anti-predictors *****************************************************************************************/ class CAntiPredictor { public: // construction/destruction CAntiPredictor(); ~CAntiPredictor(); // functions virtual void AntiPredict(int *pInputArray, int *pOutputArray, int NumberOfElements); }; /***************************************************************************************** Offset anti-predictor *****************************************************************************************/ class CAntiPredictorOffset : public CAntiPredictor { public: // functions void AntiPredict(int *pInputArray, int *pOutputArray, int NumberOfElements, int Offset, int DeltaM); }; #ifdef ENABLE_COMPRESSION_MODE_FAST /***************************************************************************************** Fast anti-predictor (from original 'fast' mode...updated for version 3.32) *****************************************************************************************/ class CAntiPredictorFast0000To3320 : public CAntiPredictor { public: // functions void AntiPredict(int *pInputArray, int *pOutputArray, int NumberOfElements); }; /***************************************************************************************** Fast anti-predictor (new 'fast' mode release with version 3.32) *****************************************************************************************/ class CAntiPredictorFast3320ToCurrent : public CAntiPredictor { public: // functions void AntiPredict(int *pInputArray, int *pOutputArray, int NumberOfElements); }; #endif // #ifdef ENABLE_COMPRESSION_MODE_FAST #ifdef ENABLE_COMPRESSION_MODE_NORMAL /***************************************************************************************** Normal anti-predictor *****************************************************************************************/ class CAntiPredictorNormal0000To3320 : public CAntiPredictor { public: // functions void AntiPredict(int *pInputArray, int *pOutputArray, int NumberOfElements); }; /***************************************************************************************** Normal anti-predictor *****************************************************************************************/ class CAntiPredictorNormal3320To3800 : public CAntiPredictor { public: // functions void AntiPredict(int *pInputArray, int *pOutputArray, int NumberOfElements); }; /***************************************************************************************** Normal anti-predictor *****************************************************************************************/ class CAntiPredictorNormal3800ToCurrent : public CAntiPredictor { public: // functions void AntiPredict(int *pInputArray, int *pOutputArray, int NumberOfElements); }; #endif // #ifdef ENABLE_COMPRESSION_MODE_NORMAL #ifdef ENABLE_COMPRESSION_MODE_HIGH /***************************************************************************************** High anti-predictor *****************************************************************************************/ class CAntiPredictorHigh0000To3320 : public CAntiPredictor { public: // functions void AntiPredict(int *pInputArray, int *pOutputArray, int NumberOfElements); }; /***************************************************************************************** High anti-predictor *****************************************************************************************/ class CAntiPredictorHigh3320To3600 : public CAntiPredictor { public: // functions void AntiPredict(int *pInputArray, int *pOutputArray, int NumberOfElements); }; /***************************************************************************************** High anti-predictor *****************************************************************************************/ class CAntiPredictorHigh3600To3700 : public CAntiPredictor { public: // functions void AntiPredict(int *pInputArray, int *pOutputArray, int NumberOfElements); }; /***************************************************************************************** High anti-predictor *****************************************************************************************/ class CAntiPredictorHigh3700To3800 : public CAntiPredictor { public: // functions void AntiPredict(int *pInputArray, int *pOutputArray, int NumberOfElements); }; /***************************************************************************************** High anti-predictor *****************************************************************************************/ class CAntiPredictorHigh3800ToCurrent : public CAntiPredictor { public: // functions void AntiPredict(int *pInputArray, int *pOutputArray, int NumberOfElements); }; #endif // #ifdef ENABLE_COMPRESSION_MODE_HIGH #ifdef ENABLE_COMPRESSION_MODE_EXTRA_HIGH /***************************************************************************************** Extra high helper *****************************************************************************************/ class CAntiPredictorExtraHighHelper { public: int ConventionalDotProduct(short *bip, short *bbm, short *pIPAdaptFactor, int op, int nNumberOfIterations); #ifdef ENABLE_ASSEMBLY int MMXDotProduct(short *bip, short *bbm, short *pIPAdaptFactor, int op, int nNumberOfIterations); #endif // #ifdef ENABLE_ASSEMBLY }; /***************************************************************************************** Extra high anti-predictor *****************************************************************************************/ class CAntiPredictorExtraHigh0000To3320 : public CAntiPredictor { public: // functions void AntiPredict(int *pInputArray, int *pOutputArray, int NumberOfElements, int Iterations, unsigned int *pOffsetValueArrayA, unsigned int *pOffsetValueArrayB); private: void AntiPredictorOffset(int* Input_Array, int* Output_Array, int Number_of_Elements, int g, int dm, int Max_Order); }; /***************************************************************************************** Extra high anti-predictor *****************************************************************************************/ class CAntiPredictorExtraHigh3320To3600 : public CAntiPredictor { public: // functions void AntiPredict(int *pInputArray, int *pOutputArray, int NumberOfElements, int Iterations, unsigned int *pOffsetValueArrayA, unsigned int *pOffsetValueArrayB); private: void AntiPredictorOffset(int* Input_Array, int* Output_Array, int Number_of_Elements, int g, int dm, int Max_Order); }; /***************************************************************************************** Extra high anti-predictor *****************************************************************************************/ class CAntiPredictorExtraHigh3600To3700 : public CAntiPredictor { public: // functions void AntiPredict(int *pInputArray, int *pOutputArray, int NumberOfElements, int Iterations, unsigned int *pOffsetValueArrayA, unsigned int *pOffsetValueArrayB); private: void AntiPredictorOffset(int* Input_Array, int* Output_Array, int Number_of_Elements, int g1, int g2, int Max_Order); }; /***************************************************************************************** Extra high anti-predictor *****************************************************************************************/ class CAntiPredictorExtraHigh3700To3800 : public CAntiPredictor { public: // functions void AntiPredict(int *pInputArray, int *pOutputArray, int NumberOfElements, int Iterations, unsigned int *pOffsetValueArrayA, unsigned int *pOffsetValueArrayB); private: void AntiPredictorOffset(int* Input_Array, int* Output_Array, int Number_of_Elements, int g1, int g2, int Max_Order); }; /***************************************************************************************** Extra high anti-predictor *****************************************************************************************/ class CAntiPredictorExtraHigh3800ToCurrent : public CAntiPredictor { public: // functions void AntiPredict(int *pInputArray, int *pOutputArray, int NumberOfElements, BOOL bMMXAvailable, int CPULoadBalancingFactor, int nVersion); }; #endif // #ifdef ENABLE_COMPRESSION_MODE_EXTRA_HIGH #endif // #ifndef APE_ANTIPREDICTOR_Hjmac-1.74/core/nativesrc/mac/Source/MACLib/Old/APEDecompressCore.h0000644000175000017500000000206510131230056024416 0ustar twernertwerner#ifndef APE_DECOMPRESS_CORE_H #define APE_DECOMPRESS_CORE_H class CAPEDecompressCore { public: CAPEDecompressCore(CIO * pIO, IAPEDecompress * pAPEDecompress); ~CAPEDecompressCore(); void GenerateDecodedArrays(int nBlocks, int nSpecialCodes, int nFrameIndex, int nCPULoadBalancingFactor); void GenerateDecodedArray(int *Input_Array, uint32 Number_of_Elements, int Frame_Index, CAntiPredictor *pAntiPredictor, int CPULoadBalancingFactor = 0); int * GetDataX() { return m_pDataX; } int * GetDataY() { return m_pDataY; } CUnBitArrayBase * GetUnBitArrray() { return m_pUnBitArray; } int * m_pTempData; int * m_pDataX; int * m_pDataY; CAntiPredictor * m_pAntiPredictorX; CAntiPredictor * m_pAntiPredictorY; CUnBitArrayBase * m_pUnBitArray; BIT_ARRAY_STATE m_BitArrayStateX; BIT_ARRAY_STATE m_BitArrayStateY; IAPEDecompress * m_pAPEDecompress; BOOL m_bMMXAvailable; int m_nBlocksProcessed; }; #endif // #ifndef APE_DECOMPRESS_CORE_Hjmac-1.74/core/nativesrc/mac/Source/MACLib/Old/APEDecompressOld.h0000644000175000017500000000175710131230056024253 0ustar twernertwerner#ifndef _apedecompressold_h_ #define _apedecompressold_h_ #include "../APEDecompress.h" #include "UnMAC.h" class CAPEDecompressOld : public IAPEDecompress { public: CAPEDecompressOld(int * pErrorCode, CAPEInfo * pAPEInfo, int nStartBlock = -1, int nFinishBlock = -1); ~CAPEDecompressOld(); int GetData(char * pBuffer, int nBlocks, int * pBlocksRetrieved); int Seek(int nBlockOffset); int GetInfo(APE_DECOMPRESS_FIELDS Field, int nParam1 = 0, int nParam2 = 0); protected: // buffer CSmartPtr m_spBuffer; int m_nBufferTail; // file info int m_nBlockAlign; int m_nCurrentFrame; // start / finish information int m_nStartBlock; int m_nFinishBlock; int m_nCurrentBlock; BOOL m_bIsRanged; // decoding tools CUnMAC m_UnMAC; CSmartPtr m_spAPEInfo; BOOL m_bDecompressorInitialized; int InitializeDecompressor(); }; #endif //_apedecompressold_h_ jmac-1.74/core/nativesrc/mac/Source/MACLib/Old/UnBitArrayOld.h0000644000175000017500000000223210131230056023626 0ustar twernertwerner#ifndef APE_UNBITARRAY_OLD_H #define APE_UNBITARRAY_OLD_H #include "All.h" #ifdef BACKWARDS_COMPATIBILITY #include "../UnBitArrayBase.h" class IAPEDecompress; // decodes 0000 up to and including 3890 class CUnBitArrayOld : public CUnBitArrayBase { public: // construction/destruction CUnBitArrayOld(IAPEDecompress *pAPEDecompress, int nVersion); ~CUnBitArrayOld(); // functions void GenerateArray(int *pOutputArray, int nElements, int nBytesRequired = -1); unsigned int DecodeValue(DECODE_VALUE_METHOD DecodeMethod, int nParam1 = 0, int nParam2 = 0); private: void GenerateArrayOld(int* pOutputArray, uint32 NumberOfElements, int MinimumBitArrayBytes); void GenerateArrayRice(int* pOutputArray, uint32 NumberOfElements, int MinimumBitArrayBytes); uint32 DecodeValueRiceUnsigned(uint32 k); // data uint32 k; uint32 K_Sum; uint32 m_nRefillBitThreshold; // functions __inline int DecodeValueNew(BOOL bCapOverflow); uint32 GetBitsRemaining(); __inline uint32 Get_K(uint32 x); }; #endif #endif // #ifndef APE_UNBITARRAY_OLD_H jmac-1.74/core/nativesrc/mac/Source/MACLib/Old/UnMAC.h0000644000175000017500000000411110131230056022050 0ustar twernertwerner/***************************************************************************************** UnMAC.h Copyright (C) 2000-2001 by Matthew T. Ashland All Rights Reserved. Methods for decompressing or verifying APE files Notes: -none *****************************************************************************************/ #ifndef APE_UNMAC_H #define APE_UNMAC_H #include "../BitArray.h" #include "../UnBitArrayBase.h" class CAntiPredictor; class CPrepare; class CAPEDecompressCore; class CPredictorBase; class IPredictorDecompress; class IAPEDecompress; /***************************************************************************************** CUnMAC class... a class that allows decoding on a frame-by-frame basis *****************************************************************************************/ class CUnMAC { public: // construction/destruction CUnMAC(); ~CUnMAC(); // functions int Initialize(IAPEDecompress *pAPEDecompress); int Uninitialize(); int DecompressFrame(unsigned char *pOutputData, int32 FrameIndex, int CPULoadBalancingFactor = 0); int SeekToFrame(int FrameIndex); private: // data members BOOL m_bInitialized; int m_LastDecodedFrameIndex; IAPEDecompress * m_pAPEDecompress; CPrepare * m_pPrepare; CAPEDecompressCore * m_pAPEDecompressCore; // functions void GenerateDecodedArrays(int nBlocks, int nSpecialCodes, int nFrameIndex, int nCPULoadBalancingFactor); void GenerateDecodedArray(int *Input_Array, uint32 Number_of_Elements, int Frame_Index, CAntiPredictor *pAntiPredictor, int CPULoadBalancingFactor = 0); int CreateAntiPredictors(int nCompressionLevel, int nVersion); int DecompressFrameOld(unsigned char *pOutputData, int32 FrameIndex, int CPULoadBalancingFactor); uint32 CalculateOldChecksum(int *pDataX, int *pDataY, int nChannels, int nBlocks); public: int m_nBlocksProcessed; unsigned int m_nCRC; unsigned int m_nStoredCRC; WAVEFORMATEX m_wfeInput; }; #endif // #ifndef APE_UNMAC_H jmac-1.74/core/nativesrc/mac/Source/MACLib/Predictor.h0000644000175000017500000000211010131230056022357 0ustar twernertwerner#ifndef APE_PREDICTOR_H #define APE_PREDICTOR_H /************************************************************************************************* IPredictorCompress - the interface for compressing (predicting) data *************************************************************************************************/ class IPredictorCompress { public: IPredictorCompress(int nCompressionLevel) {} virtual ~IPredictorCompress() {} virtual int CompressValue(int nA, int nB = 0) = 0; virtual int Flush() = 0; }; /************************************************************************************************* IPredictorDecompress - the interface for decompressing (un-predicting) data *************************************************************************************************/ class IPredictorDecompress { public: IPredictorDecompress(int nCompressionLevel, int nVersion) {} virtual ~IPredictorDecompress() {} virtual int DecompressValue(int nA, int nB = 0) = 0; virtual int Flush() = 0; }; #endif // #ifndef APE_PREDICTOR_H jmac-1.74/core/nativesrc/mac/Source/MACLib/Prepare.h0000644000175000017500000000235110131230056022031 0ustar twernertwerner#ifndef APE_PREPARE_H #define APE_PREPARE_H #define SPECIAL_FRAME_MONO_SILENCE 1 #define SPECIAL_FRAME_LEFT_SILENCE 1 #define SPECIAL_FRAME_RIGHT_SILENCE 2 #define SPECIAL_FRAME_PSEUDO_STEREO 4 /***************************************************************************** Manage the preparation stage of compression and decompression Tasks: 1) convert data to 32-bit 2) convert L,R to X,Y 3) calculate the CRC 4) do simple analysis 5) check for the peak value *****************************************************************************/ class IPredictorDecompress; class CPrepare { public: int Prepare(const unsigned char * pRawData, int nBytes, const WAVEFORMATEX * pWaveFormatEx, int * pOutputX, int * pOutputY, unsigned int * pCRC, int * pSpecialCodes, int * pPeakLevel); void Unprepare(int X, int Y, const WAVEFORMATEX * pWaveFormatEx, unsigned char * pOutput, unsigned int * pCRC); #ifdef BACKWARDS_COMPATIBILITY int UnprepareOld(int * pInputX, int *pInputY, int nBlocks, const WAVEFORMATEX * pWaveFormatEx, unsigned char * pRawData, unsigned int * pCRC, int * pSpecialCodes, int nFileVersion); #endif }; #endif // #ifndef APE_PREPARE_H jmac-1.74/core/nativesrc/mac/Source/MACLib/ScaledFirstOrderFilter.h0000644000175000017500000000124710131230056025003 0ustar twernertwerner#ifndef APE_SCALEDFIRSTORDERFILTER_H #define APE_SCALEDFIRSTORDERFILTER_H template class CScaledFirstOrderFilter { public: __inline void Flush() { m_nLastValue = 0; } __inline int Compress(const int nInput) { int nRetVal = nInput - ((m_nLastValue * MULTIPLY) >> SHIFT); m_nLastValue = nInput; return nRetVal; } __inline int Decompress(const int nInput) { m_nLastValue = nInput + ((m_nLastValue * MULTIPLY) >> SHIFT); return m_nLastValue; } protected: int m_nLastValue; }; #endif // #ifndef APE_SCALEDFIRSTORDERFILTER_H jmac-1.74/core/nativesrc/mac/Source/MACLib/StartFilter.h0000644000175000017500000001172010131230056022676 0ustar twernertwerner#ifndef APE_START_FILTER_H #define APE_START_FILTER_H class CStartFilter { public: CStartFilter() { } ~CStartFilter() { } void Flush() { m_rbInputA.Flush(); m_rbInputB.Flush(); memset(m_aryMA, 0, sizeof(m_aryMA)); memset(m_aryMB, 0, sizeof(m_aryMB)); m_Stage1FilterA1.Flush(); m_Stage1FilterA2.Flush(); m_Stage1FilterA3.Flush(); m_Stage1FilterB1.Flush(); m_Stage1FilterB2.Flush(); m_Stage1FilterB3.Flush(); } void Compress(int & nA, int & nB) { /* nA = m_Stage1FilterA1.Compress(nA); nA = m_Stage1FilterA2.Compress(nA); nA = m_Stage1FilterA3.Compress(nA); nB = m_Stage1FilterB1.Compress(nB); nB = m_Stage1FilterB2.Compress(nB); nB = m_Stage1FilterB3.Compress(nB); return; //*/ nA = m_Stage1FilterA1.Compress(nA); nA = m_Stage1FilterA2.Compress(nA); // nA = m_Stage1FilterA3.Compress(nA); nB = m_Stage1FilterB1.Compress(nB); nB = m_Stage1FilterB2.Compress(nB); //int nTemp = nA; nA = nB; nB = nTemp; // nB = m_Stage1FilterB3.Compress(nB); // nA = nA - nB; // nB = nB + (nA / 2); // return; m_rbInputA[0] = nA; m_rbInputB[0] = nB; { int nPrediction1 = m_rbInputA[-1]; int nPrediction2 = m_rbInputA[-2]; int nPrediction3 = m_rbInputA[-1] - m_rbInputA[-2]; int nPrediction4 = m_rbInputB[-1]; int nTotalPrediction = (nPrediction1 * m_aryMA[0]) + (nPrediction2 * m_aryMA[1]) + (nPrediction3 * m_aryMA[2]) + (nPrediction4 * m_aryMA[3]); int nOutput = nA - (nTotalPrediction >> 13); if (nOutput > 0) { m_aryMA[0] -= 2*((nPrediction1) ? ((nPrediction1 >> 30) & 2) - 1 : 0); m_aryMA[1] -= (nPrediction2) ? ((nPrediction2 >> 30) & 2) - 1 : 0; m_aryMA[2] -= (nPrediction3) ? ((nPrediction3 >> 30) & 2) - 1 : 0; m_aryMA[3] -= 1*((nPrediction4) ? ((nPrediction4 >> 30) & 2) - 1 : 0); } else if (nOutput < 0) { m_aryMA[0] += 2*((nPrediction1) ? ((nPrediction1 >> 30) & 2) - 1 : 0); m_aryMA[1] += (nPrediction2) ? ((nPrediction2 >> 30) & 2) - 1 : 0; m_aryMA[2] += (nPrediction3) ? ((nPrediction3 >> 30) & 2) - 1 : 0; m_aryMA[3] += 1*((nPrediction4) ? ((nPrediction4 >> 30) & 2) - 1 : 0); } nA = nOutput; } { int nPrediction1 = m_rbInputB[-1]; int nPrediction2 = m_rbInputB[-2]; int nPrediction3 = 0;//m_rbInputB[-1] - m_rbInputB[-2]; int nPrediction4 = m_rbInputA[0]; int nTotalPrediction = (nPrediction1 * m_aryMB[0]) + (nPrediction2 * m_aryMB[1]) + (nPrediction3 * m_aryMB[2]) + (nPrediction4 * m_aryMB[3]); int nOutput = nB - (nTotalPrediction >> 13); if (nOutput > 0) { m_aryMB[0] -= 2*((nPrediction1) ? ((nPrediction1 >> 30) & 2) - 1 : 0); m_aryMB[1] -= (nPrediction2) ? ((nPrediction2 >> 30) & 2) - 1 : 0; m_aryMB[2] -= (nPrediction3) ? ((nPrediction3 >> 30) & 2) - 1 : 0; m_aryMB[3] -= 1*((nPrediction4) ? ((nPrediction4 >> 30) & 2) - 1 : 0); } else if (nOutput < 0) { m_aryMB[0] += 2*((nPrediction1) ? ((nPrediction1 >> 30) & 2) - 1 : 0); m_aryMB[1] += (nPrediction2) ? ((nPrediction2 >> 30) & 2) - 1 : 0; m_aryMB[2] += (nPrediction3) ? ((nPrediction3 >> 30) & 2) - 1 : 0; m_aryMB[3] += 1*((nPrediction4) ? ((nPrediction4 >> 30) & 2) - 1 : 0); } nB = nOutput; } m_rbInputA.IncrementSafe(); m_rbInputB.IncrementSafe(); /* // nInput = m_Filter1.Compress(nInput); m_rbInput[0] = nInput; int nPrediction1 = m_rbInput[-1]; int nPrediction2 = (2 * m_rbInput[-1]) - m_rbInput[-2]; int nPrediction3 = m_rbInput[-1] - m_rbInput[-2]; int nPrediction4 = m_nLastOutput; int nTotalPrediction = ((nPrediction1) * m_aryM[0]) + (nPrediction2 * m_aryM[1]) + ((nPrediction3 >> 1) * m_aryM[2]) + (nPrediction4 * m_aryM[3]); int nOutput = nInput - (nTotalPrediction >> 13); if (nOutput > 0) { m_aryM[0] -= (nPrediction1) ? ((nPrediction1 >> 30) & 2) - 1 : 0; m_aryM[1] -= (nPrediction2) ? ((nPrediction2 >> 30) & 2) - 1 : 0; m_aryM[2] -= (nPrediction3) ? ((nPrediction3 >> 30) & 2) - 1 : 0; m_aryM[3] -= (nPrediction4) ? ((nPrediction4 >> 30) & 2) - 1 : 0; } else if (nOutput < 0) { m_aryM[0] += (nPrediction1) ? ((nPrediction1 >> 30) & 2) - 1 : 0; m_aryM[1] += (nPrediction2) ? ((nPrediction2 >> 30) & 2) - 1 : 0; m_aryM[2] += (nPrediction3) ? ((nPrediction3 >> 30) & 2) - 1 : 0; m_aryM[3] += (nPrediction4) ? ((nPrediction4 >> 30) & 2) - 1 : 0; } m_nLastOutput = nOutput; m_rbInput.IncrementSafe(); return nOutput; //*/ } protected: CScaledFirstOrderFilter<31, 5> m_Stage1FilterA1; CScaledFirstOrderFilter<24, 5> m_Stage1FilterA2; CScaledFirstOrderFilter<7, 5> m_Stage1FilterA3; CScaledFirstOrderFilter<31, 5> m_Stage1FilterB1; CScaledFirstOrderFilter<24, 5> m_Stage1FilterB2; CScaledFirstOrderFilter<7, 5> m_Stage1FilterB3; CRollBufferFast m_rbInputA; CRollBufferFast m_rbInputB; int m_aryMA[8]; int m_aryMB[8]; }; #endif // #ifndef APE_START_FILTER_H jmac-1.74/core/nativesrc/mac/Source/MACLib/UnBitArray.h0000644000175000017500000000242410131230056022454 0ustar twernertwerner#ifndef APE_UNBITARRAY_H #define APE_UNBITARRAY_H #include "UnBitArrayBase.h" class IAPEDecompress; struct RANGE_CODER_STRUCT_DECOMPRESS { unsigned int low; // low end of interval unsigned int range; // length of interval unsigned int buffer; // buffer for input/output }; class CUnBitArray : public CUnBitArrayBase { public: // construction/destruction CUnBitArray(CIO * pIO, int nVersion); ~CUnBitArray(); unsigned int DecodeValue(DECODE_VALUE_METHOD DecodeMethod, int nParam1 = 0, int nParam2 = 0); void GenerateArray(int * pOutputArray, int nElements, int nBytesRequired = -1); int DecodeValueRange(UNBIT_ARRAY_STATE & BitArrayState); void FlushState(UNBIT_ARRAY_STATE & BitArrayState); void FlushBitArray(); void Finalize(); private: void GenerateArrayRange(int * pOutputArray, int nElements); // data int m_nFlushCounter; int m_nFinalizeCounter; RANGE_CODER_STRUCT_DECOMPRESS m_RangeCoderInfo; uint32 m_nRefillBitThreshold; // functions inline int RangeDecodeFast(int nShift); inline int RangeDecodeFastWithUpdate(int nShift); inline unsigned char GetC(); }; #endif // #ifndef APE_UNBITARRAY_H jmac-1.74/core/nativesrc/mac/Source/MACLib/UnBitArrayBase.h0000644000175000017500000000273610131230056023255 0ustar twernertwerner#ifndef APE_UNBITARRAYBASE_H #define APE_UNBITARRAYBASE_H class IAPEDecompress; class CIO; struct UNBIT_ARRAY_STATE { uint32 k; uint32 nKSum; }; enum DECODE_VALUE_METHOD { DECODE_VALUE_METHOD_UNSIGNED_INT, DECODE_VALUE_METHOD_UNSIGNED_RICE, DECODE_VALUE_METHOD_X_BITS }; class CUnBitArrayBase { public: // virtual destructor virtual ~CUnBitArrayBase() {} // functions virtual int FillBitArray(); virtual int FillAndResetBitArray(int nFileLocation = -1, int nNewBitIndex = 0); virtual void GenerateArray(int * pOutputArray, int nElements, int nBytesRequired = -1) {} virtual unsigned int DecodeValue(DECODE_VALUE_METHOD DecodeMethod, int nParam1 = 0, int nParam2 = 0) { return 0; } virtual void AdvanceToByteBoundary(); virtual int DecodeValueRange(UNBIT_ARRAY_STATE & BitArrayState) { return 0; } virtual void FlushState(UNBIT_ARRAY_STATE & BitArrayState) {} virtual void FlushBitArray() {} virtual void Finalize() {} protected: virtual int CreateHelper(CIO * pIO, int nBytes, int nVersion); virtual uint32 DecodeValueXBits(uint32 nBits); uint32 m_nElements; uint32 m_nBytes; uint32 m_nBits; int m_nVersion; CIO * m_pIO; uint32 m_nCurrentBitIndex; uint32 * m_pBitArray; }; CUnBitArrayBase * CreateUnBitArray(IAPEDecompress * pAPEDecompress, int nVersion); #endif // #ifndef APE_UNBITARRAYBASE_H jmac-1.74/core/nativesrc/mac/Source/MACLib/WAVInputSource.h0000644000175000017500000000512410131230056023272 0ustar twernertwerner#ifndef APE_WAVINPUTSOURCE_H #define APE_WAVINPUTSOURCE_H #include "IO.h" /************************************************************************************* CInputSource - base input format class (allows multiple format support) *************************************************************************************/ class CInputSource { public: // construction / destruction CInputSource(CIO * pIO, WAVEFORMATEX * pwfeSource, int * pTotalBlocks, int * pHeaderBytes, int * pTerminatingBytes, int * pErrorCode = NULL) { } CInputSource(const wchar_t * pSourceName, WAVEFORMATEX * pwfeSource, int * pTotalBlocks, int * pHeaderBytes, int * pTerminatingBytes, int * pErrorCode = NULL) { } virtual ~CInputSource() { } // get data virtual int GetData(unsigned char * pBuffer, int nBlocks, int * pBlocksRetrieved) = 0; // get header / terminating data virtual int GetHeaderData(unsigned char * pBuffer) = 0; virtual int GetTerminatingData(unsigned char * pBuffer) = 0; }; /************************************************************************************* CWAVInputSource - wraps working with WAV files (could be extended to any format) *************************************************************************************/ class CWAVInputSource : public CInputSource { public: // construction / destruction CWAVInputSource(CIO * pIO, WAVEFORMATEX * pwfeSource, int * pTotalBlocks, int * pHeaderBytes, int * pTerminatingBytes, int * pErrorCode = NULL); CWAVInputSource(const wchar_t * pSourceName, WAVEFORMATEX * pwfeSource, int * pTotalBlocks, int * pHeaderBytes, int * pTerminatingBytes, int * pErrorCode = NULL); ~CWAVInputSource(); // get data int GetData(unsigned char * pBuffer, int nBlocks, int * pBlocksRetrieved); // get header / terminating data int GetHeaderData(unsigned char * pBuffer); int GetTerminatingData(unsigned char * pBuffer); private: int AnalyzeSource(); CSmartPtr m_spIO; WAVEFORMATEX m_wfeSource; int m_nHeaderBytes; int m_nDataBytes; int m_nTerminatingBytes; int m_nFileBytes; BOOL m_bIsValid; }; /************************************************************************************* Input souce creation *************************************************************************************/ CInputSource * CreateInputSource(const wchar_t * pSourceName, WAVEFORMATEX * pwfeSource, int * pTotalBlocks, int * pHeaderBytes, int * pTerminatingBytes, int * pErrorCode = NULL); #endif // #ifndef APE_WAVINPUTSOURCE_H jmac-1.74/core/nativesrc/mac/Source/Shared/0000755000175000017500000000000010451144641020451 5ustar twernertwernerjmac-1.74/core/nativesrc/mac/Source/Shared/All.h0000644000175000017500000004325410131230056021331 0ustar twernertwerner#ifndef APE_ALL_H #define APE_ALL_H /***************************************************************************************** Cross platform building switch *****************************************************************************************/ //#define BUILD_CROSS_PLATFORM /***************************************************************************************** Unicode *****************************************************************************************/ #ifdef _UNICODE #else #endif // #ifdef _UNICODE /***************************************************************************************** Global includes *****************************************************************************************/ #ifndef BUILD_CROSS_PLATFORM #include #endif #ifdef _WIN32 #include #include #else #include #include #include #include #include #include "NoWindows.h" #endif #include #include #include #include #include #include "SmartPtr.h" /***************************************************************************************** Global compiler settings (useful for porting) *****************************************************************************************/ #ifndef BUILD_CROSS_PLATFORM #define ENABLE_ASSEMBLY #endif #define BACKWARDS_COMPATIBILITY #define ENABLE_COMPRESSION_MODE_FAST #define ENABLE_COMPRESSION_MODE_NORMAL #define ENABLE_COMPRESSION_MODE_HIGH #define ENABLE_COMPRESSION_MODE_EXTRA_HIGH #ifdef _WIN32 typedef unsigned __int32 uint32; typedef __int32 int32; typedef unsigned __int16 uint16; typedef __int16 int16; typedef unsigned __int8 uint8; typedef __int8 int8; typedef char str_ansi; typedef unsigned char str_utf8; typedef wchar_t str_utf16; #define IO_USE_WIN_FILE_IO #define IO_HEADER_FILE "WinFileIO.h" #define IO_CLASS_NAME CWinFileIO #define DLLEXPORT __declspec(dllexport) #define SLEEP(MILLISECONDS) ::Sleep(MILLISECONDS) #define MESSAGEBOX(PARENT, TEXT, CAPTION, TYPE) ::MessageBox(PARENT, TEXT, CAPTION, TYPE) #define PUMP_MESSAGE_LOOP { MSG Msg; while (PeekMessage(&Msg, NULL, 0, 0, PM_REMOVE) != 0) { TranslateMessage(&Msg); DispatchMessage(&Msg); } } #define ODS OutputDebugString #define TICK_COUNT_TYPE unsigned long #define TICK_COUNT_READ(VARIABLE) VARIABLE = GetTickCount() #define TICK_COUNT_FREQ 1000 #else #define IO_USE_STD_LIB_FILE_IO #define IO_HEADER_FILE "StdLibFileIO.h" #define IO_CLASS_NAME CStdLibFileIO #define DLLEXPORT #define SLEEP(MILLISECONDS) { struct timespec t; t.tv_sec = (MILLISECONDS) / 1000; t.tv_nsec = (MILLISECONDS) % 1000 * 1000000; nanosleep(&t, NULL); } #define MESSAGEBOX(PARENT, TEXT, CAPTION, TYPE) #define PUMP_MESSAGE_LOOP #define ODS printf #define TICK_COUNT_TYPE unsigned long long #define TICK_COUNT_READ(VARIABLE) { struct timeval t; gettimeofday(&t, NULL); VARIABLE = t.tv_sec * 1000000LLU + t.tv_usec; } #define TICK_COUNT_FREQ 1000000 #endif /***************************************************************************************** Global defines *****************************************************************************************/ #define MAC_VERSION_NUMBER 3990 #define MAC_VERSION_STRING _T("3.99") #define MAC_NAME _T("Monkey's Audio 3.99") #define PLUGIN_NAME "Monkey's Audio Player v3.99" #define MJ_PLUGIN_NAME _T("APE Plugin (v3.99)") #define CONSOLE_NAME "--- Monkey's Audio Console Front End (v 3.99) (c) Matthew T. Ashland ---\n" #define PLUGIN_ABOUT _T("Monkey's Audio Player v3.99\nCopyrighted (c) 2000-2004 by Matthew T. Ashland") #define MAC_DLL_INTERFACE_VERSION_NUMBER 1000 /***************************************************************************************** Byte order *****************************************************************************************/ #define __LITTLE_ENDIAN 1234 #define __BIG_ENDIAN 4321 #define __BYTE_ORDER __LITTLE_ENDIAN /***************************************************************************************** Macros *****************************************************************************************/ #define MB(TEST) MESSAGEBOX(NULL, TEST, _T("Information"), MB_OK); #define MBN(NUMBER) { TCHAR cNumber[16]; _stprintf(cNumber, _T("%d"), NUMBER); MESSAGEBOX(NULL, cNumber, _T("Information"), MB_OK); } #define SAFE_DELETE(POINTER) if (POINTER) { delete POINTER; POINTER = NULL; } #define SAFE_ARRAY_DELETE(POINTER) if (POINTER) { delete [] POINTER; POINTER = NULL; } #define SAFE_VOID_CLASS_DELETE(POINTER, Class) { Class *pClass = (Class *) POINTER; if (pClass) { delete pClass; POINTER = NULL; } } #define SAFE_FILE_CLOSE(HANDLE) if (HANDLE != INVALID_HANDLE_VALUE) { CloseHandle(HANDLE); HANDLE = INVALID_HANDLE_VALUE; } #define ODN(NUMBER) { TCHAR cNumber[16]; _stprintf(cNumber, _T("%d\n"), int(NUMBER)); ODS(cNumber); } #define CATCH_ERRORS(CODE) try { CODE } catch(...) { } #define RETURN_ON_ERROR(FUNCTION) { int nRetVal = FUNCTION; if (nRetVal != 0) { return nRetVal; } } #define RETURN_VALUE_ON_ERROR(FUNCTION, VALUE) { int nRetVal = FUNCTION; if (nRetVal != 0) { return VALUE; } } #define RETURN_ON_EXCEPTION(CODE, VALUE) { try { CODE } catch(...) { return VALUE; } } #define THROW_ON_ERROR(CODE) { int nRetVal = CODE; if (nRetVal != 0) throw(nRetVal); } #define EXPAND_1_TIMES(CODE) CODE #define EXPAND_2_TIMES(CODE) CODE CODE #define EXPAND_3_TIMES(CODE) CODE CODE CODE #define EXPAND_4_TIMES(CODE) CODE CODE CODE CODE #define EXPAND_5_TIMES(CODE) CODE CODE CODE CODE CODE #define EXPAND_6_TIMES(CODE) CODE CODE CODE CODE CODE CODE #define EXPAND_7_TIMES(CODE) CODE CODE CODE CODE CODE CODE CODE #define EXPAND_8_TIMES(CODE) CODE CODE CODE CODE CODE CODE CODE CODE #define EXPAND_9_TIMES(CODE) CODE CODE CODE CODE CODE CODE CODE CODE CODE #define EXPAND_12_TIMES(CODE) CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE #define EXPAND_14_TIMES(CODE) CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE #define EXPAND_15_TIMES(CODE) CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE #define EXPAND_16_TIMES(CODE) CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE #define EXPAND_30_TIMES(CODE) CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE #define EXPAND_31_TIMES(CODE) CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE #define EXPAND_32_TIMES(CODE) CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE #define EXPAND_64_TIMES(CODE) CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE CODE #define EXPAND_N_TIMES(NUMBER, CODE) EXPAND_##NUMBER##_TIMES(CODE) #define UNROLL_4_TIMES(MACRO) MACRO(0) MACRO(1) MACRO(2) MACRO(3) #define UNROLL_8_TIMES(MACRO) MACRO(0) MACRO(1) MACRO(2) MACRO(3) MACRO(4) MACRO(5) MACRO(6) MACRO(7) #define UNROLL_15_TIMES(MACRO) MACRO(0) MACRO(1) MACRO(2) MACRO(3) MACRO(4) MACRO(5) MACRO(6) MACRO(7) MACRO(8) MACRO(9) MACRO(10) MACRO(11) MACRO(12) MACRO(13) MACRO(14) #define UNROLL_16_TIMES(MACRO) MACRO(0) MACRO(1) MACRO(2) MACRO(3) MACRO(4) MACRO(5) MACRO(6) MACRO(7) MACRO(8) MACRO(9) MACRO(10) MACRO(11) MACRO(12) MACRO(13) MACRO(14) MACRO(15) #define UNROLL_64_TIMES(MACRO) MACRO(0) MACRO(1) MACRO(2) MACRO(3) MACRO(4) MACRO(5) MACRO(6) MACRO(7) MACRO(8) MACRO(9) MACRO(10) MACRO(11) MACRO(12) MACRO(13) MACRO(14) MACRO(15) MACRO(16) MACRO(17) MACRO(18) MACRO(19) MACRO(20) MACRO(21) MACRO(22) MACRO(23) MACRO(24) MACRO(25) MACRO(26) MACRO(27) MACRO(28) MACRO(29) MACRO(30) MACRO(31) MACRO(32) MACRO(33) MACRO(34) MACRO(35) MACRO(36) MACRO(37) MACRO(38) MACRO(39) MACRO(40) MACRO(41) MACRO(42) MACRO(43) MACRO(44) MACRO(45) MACRO(46) MACRO(47) MACRO(48) MACRO(49) MACRO(50) MACRO(51) MACRO(52) MACRO(53) MACRO(54) MACRO(55) MACRO(56) MACRO(57) MACRO(58) MACRO(59) MACRO(60) MACRO(61) MACRO(62) MACRO(63) #define UNROLL_128_TIMES(MACRO) MACRO(0) MACRO(1) MACRO(2) MACRO(3) MACRO(4) MACRO(5) MACRO(6) MACRO(7) MACRO(8) MACRO(9) MACRO(10) MACRO(11) MACRO(12) MACRO(13) MACRO(14) MACRO(15) MACRO(16) MACRO(17) MACRO(18) MACRO(19) MACRO(20) MACRO(21) MACRO(22) MACRO(23) MACRO(24) MACRO(25) MACRO(26) MACRO(27) MACRO(28) MACRO(29) MACRO(30) MACRO(31) MACRO(32) MACRO(33) MACRO(34) MACRO(35) MACRO(36) MACRO(37) MACRO(38) MACRO(39) MACRO(40) MACRO(41) MACRO(42) MACRO(43) MACRO(44) MACRO(45) MACRO(46) MACRO(47) MACRO(48) MACRO(49) MACRO(50) MACRO(51) MACRO(52) MACRO(53) MACRO(54) MACRO(55) MACRO(56) MACRO(57) MACRO(58) MACRO(59) MACRO(60) MACRO(61) MACRO(62) MACRO(63) MACRO(64) MACRO(65) MACRO(66) MACRO(67) MACRO(68) MACRO(69) MACRO(70) MACRO(71) MACRO(72) MACRO(73) MACRO(74) MACRO(75) MACRO(76) MACRO(77) MACRO(78) MACRO(79) MACRO(80) MACRO(81) MACRO(82) MACRO(83) MACRO(84) MACRO(85) MACRO(86) MACRO(87) MACRO(88) MACRO(89) MACRO(90) MACRO(91) MACRO(92) MACRO(93) MACRO(94) MACRO(95) MACRO(96) MACRO(97) MACRO(98) MACRO(99) MACRO(100) MACRO(101) MACRO(102) MACRO(103) MACRO(104) MACRO(105) MACRO(106) MACRO(107) MACRO(108) MACRO(109) MACRO(110) MACRO(111) MACRO(112) MACRO(113) MACRO(114) MACRO(115) MACRO(116) MACRO(117) MACRO(118) MACRO(119) MACRO(120) MACRO(121) MACRO(122) MACRO(123) MACRO(124) MACRO(125) MACRO(126) MACRO(127) #define UNROLL_256_TIMES(MACRO) MACRO(0) MACRO(1) MACRO(2) MACRO(3) MACRO(4) MACRO(5) MACRO(6) MACRO(7) MACRO(8) MACRO(9) MACRO(10) MACRO(11) MACRO(12) MACRO(13) MACRO(14) MACRO(15) MACRO(16) MACRO(17) MACRO(18) MACRO(19) MACRO(20) MACRO(21) MACRO(22) MACRO(23) MACRO(24) MACRO(25) MACRO(26) MACRO(27) MACRO(28) MACRO(29) MACRO(30) MACRO(31) MACRO(32) MACRO(33) MACRO(34) MACRO(35) MACRO(36) MACRO(37) MACRO(38) MACRO(39) MACRO(40) MACRO(41) MACRO(42) MACRO(43) MACRO(44) MACRO(45) MACRO(46) MACRO(47) MACRO(48) MACRO(49) MACRO(50) MACRO(51) MACRO(52) MACRO(53) MACRO(54) MACRO(55) MACRO(56) MACRO(57) MACRO(58) MACRO(59) MACRO(60) MACRO(61) MACRO(62) MACRO(63) MACRO(64) MACRO(65) MACRO(66) MACRO(67) MACRO(68) MACRO(69) MACRO(70) MACRO(71) MACRO(72) MACRO(73) MACRO(74) MACRO(75) MACRO(76) MACRO(77) MACRO(78) MACRO(79) MACRO(80) MACRO(81) MACRO(82) MACRO(83) MACRO(84) MACRO(85) MACRO(86) MACRO(87) MACRO(88) MACRO(89) MACRO(90) MACRO(91) MACRO(92) MACRO(93) MACRO(94) MACRO(95) MACRO(96) MACRO(97) MACRO(98) MACRO(99) MACRO(100) MACRO(101) MACRO(102) MACRO(103) MACRO(104) MACRO(105) MACRO(106) MACRO(107) MACRO(108) MACRO(109) MACRO(110) MACRO(111) MACRO(112) MACRO(113) MACRO(114) MACRO(115) MACRO(116) MACRO(117) MACRO(118) MACRO(119) MACRO(120) MACRO(121) MACRO(122) MACRO(123) MACRO(124) MACRO(125) MACRO(126) MACRO(127) \ MACRO(128) MACRO(129) MACRO(130) MACRO(131) MACRO(132) MACRO(133) MACRO(134) MACRO(135) MACRO(136) MACRO(137) MACRO(138) MACRO(139) MACRO(140) MACRO(141) MACRO(142) MACRO(143) MACRO(144) MACRO(145) MACRO(146) MACRO(147) MACRO(148) MACRO(149) MACRO(150) MACRO(151) MACRO(152) MACRO(153) MACRO(154) MACRO(155) MACRO(156) MACRO(157) MACRO(158) MACRO(159) MACRO(160) MACRO(161) MACRO(162) MACRO(163) MACRO(164) MACRO(165) MACRO(166) MACRO(167) MACRO(168) MACRO(169) MACRO(170) MACRO(171) MACRO(172) MACRO(173) MACRO(174) MACRO(175) MACRO(176) MACRO(177) MACRO(178) MACRO(179) MACRO(180) MACRO(181) MACRO(182) MACRO(183) MACRO(184) MACRO(185) MACRO(186) MACRO(187) MACRO(188) MACRO(189) MACRO(190) MACRO(191) MACRO(192) MACRO(193) MACRO(194) MACRO(195) MACRO(196) MACRO(197) MACRO(198) MACRO(199) MACRO(200) MACRO(201) MACRO(202) MACRO(203) MACRO(204) MACRO(205) MACRO(206) MACRO(207) MACRO(208) MACRO(209) MACRO(210) MACRO(211) MACRO(212) MACRO(213) MACRO(214) MACRO(215) MACRO(216) MACRO(217) MACRO(218) MACRO(219) MACRO(220) MACRO(221) MACRO(222) MACRO(223) MACRO(224) MACRO(225) MACRO(226) MACRO(227) MACRO(228) MACRO(229) MACRO(230) MACRO(231) MACRO(232) MACRO(233) MACRO(234) MACRO(235) MACRO(236) MACRO(237) MACRO(238) MACRO(239) MACRO(240) MACRO(241) MACRO(242) MACRO(243) MACRO(244) MACRO(245) MACRO(246) MACRO(247) MACRO(248) MACRO(249) MACRO(250) MACRO(251) MACRO(252) MACRO(253) MACRO(254) MACRO(255) /***************************************************************************************** Error Codes *****************************************************************************************/ // success #ifndef ERROR_SUCCESS #define ERROR_SUCCESS 0 #endif // file and i/o errors (1000's) #define ERROR_IO_READ 1000 #define ERROR_IO_WRITE 1001 #define ERROR_INVALID_INPUT_FILE 1002 #define ERROR_INVALID_OUTPUT_FILE 1003 #define ERROR_INPUT_FILE_TOO_LARGE 1004 #define ERROR_INPUT_FILE_UNSUPPORTED_BIT_DEPTH 1005 #define ERROR_INPUT_FILE_UNSUPPORTED_SAMPLE_RATE 1006 #define ERROR_INPUT_FILE_UNSUPPORTED_CHANNEL_COUNT 1007 #define ERROR_INPUT_FILE_TOO_SMALL 1008 #define ERROR_INVALID_CHECKSUM 1009 #define ERROR_DECOMPRESSING_FRAME 1010 #define ERROR_INITIALIZING_UNMAC 1011 #define ERROR_INVALID_FUNCTION_PARAMETER 1012 #define ERROR_UNSUPPORTED_FILE_TYPE 1013 #define ERROR_UPSUPPORTED_FILE_VERSION 1014 // memory errors (2000's) #define ERROR_INSUFFICIENT_MEMORY 2000 // dll errors (3000's) #define ERROR_LOADINGAPE_DLL 3000 #define ERROR_LOADINGAPE_INFO_DLL 3001 #define ERROR_LOADING_UNMAC_DLL 3002 // general and misc errors #define ERROR_USER_STOPPED_PROCESSING 4000 #define ERROR_SKIPPED 4001 // programmer errors #define ERROR_BAD_PARAMETER 5000 // IAPECompress errors #define ERROR_APE_COMPRESS_TOO_MUCH_DATA 6000 // unknown error #define ERROR_UNDEFINED -1 #define ERROR_EXPLANATION \ { ERROR_IO_READ , "I/O read error" }, \ { ERROR_IO_WRITE , "I/O write error" }, \ { ERROR_INVALID_INPUT_FILE , "invalid input file" }, \ { ERROR_INVALID_OUTPUT_FILE , "invalid output file" }, \ { ERROR_INPUT_FILE_TOO_LARGE , "input file file too large" }, \ { ERROR_INPUT_FILE_UNSUPPORTED_BIT_DEPTH , "input file unsupported bit depth" }, \ { ERROR_INPUT_FILE_UNSUPPORTED_SAMPLE_RATE , "input file unsupported sample rate" }, \ { ERROR_INPUT_FILE_UNSUPPORTED_CHANNEL_COUNT , "input file unsupported channel count" }, \ { ERROR_INPUT_FILE_TOO_SMALL , "input file too small" }, \ { ERROR_INVALID_CHECKSUM , "invalid checksum" }, \ { ERROR_DECOMPRESSING_FRAME , "decompressing frame" }, \ { ERROR_INITIALIZING_UNMAC , "initializing unmac" }, \ { ERROR_INVALID_FUNCTION_PARAMETER , "invalid function parameter" }, \ { ERROR_UNSUPPORTED_FILE_TYPE , "unsupported file type" }, \ { ERROR_INSUFFICIENT_MEMORY , "insufficient memory" }, \ { ERROR_LOADINGAPE_DLL , "loading MAC.dll" }, \ { ERROR_LOADINGAPE_INFO_DLL , "loading MACinfo.dll" }, \ { ERROR_LOADING_UNMAC_DLL , "loading UnMAC.dll" }, \ { ERROR_USER_STOPPED_PROCESSING , "user stopped processing" }, \ { ERROR_SKIPPED , "skipped" }, \ { ERROR_BAD_PARAMETER , "bad parameter" }, \ { ERROR_APE_COMPRESS_TOO_MUCH_DATA , "APE compress too much data" }, \ { ERROR_UNDEFINED , "undefined" }, \ #endif // #ifndef APE_ALL_H jmac-1.74/core/nativesrc/mac/Source/Shared/APEInfoDialog.h0000644000175000017500000000116510131230056023155 0ustar twernertwerner#ifndef APE_APEINFODIALOG_H #define APE_APEINFODIALOG_H BOOL CALLBACK FileInfoDialogProcedureA(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); class CAPEInfoDialog { public: CAPEInfoDialog(); ~CAPEInfoDialog(); int ShowAPEInfoDialog(const str_utf16 * pFilename, HINSTANCE hInstance, const str_utf16 * lpszTemplateName, HWND hWndParent); private: static LRESULT CALLBACK DialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); int FillGenreComboBox(HWND hDlg, int nComboBoxID, char * pSelectedGenre); IAPEDecompress * m_pAPEDecompress; }; #endif // #ifndef APE_APEINFODIALOG_Hjmac-1.74/core/nativesrc/mac/Source/Shared/CharacterHelper.h0000644000175000017500000000121010131230056023637 0ustar twernertwerner/******************************************************************************************* Character set conversion helpers *******************************************************************************************/ #ifndef CHARACTER_HELPER_H #define CHARACTER_HELPER_H str_ansi * GetANSIFromUTF8(const str_utf8 * pUTF8); str_ansi * GetANSIFromUTF16(const str_utf16 * pUTF16); str_utf16 * GetUTF16FromANSI(const str_ansi * pANSI); str_utf16 * GetUTF16FromUTF8(const str_utf8 * pUTF8); str_utf8 * GetUTF8FromANSI(const str_ansi * pANSI); str_utf8 * GetUTF8FromUTF16(const str_utf16 * pUTF16); #endif // #ifndef CHARACTER_HELPER_Hjmac-1.74/core/nativesrc/mac/Source/Shared/CircleBuffer.h0000644000175000017500000000254210131230056023147 0ustar twernertwerner#ifndef APE_CIRCLEBUFFER_H #define APE_CIRCLEBUFFER_H class CCircleBuffer { public: // construction / destruction CCircleBuffer(); virtual ~CCircleBuffer(); // create the buffer void CreateBuffer(int nBytes, int nMaxDirectWriteBytes); // query int MaxAdd(); int MaxGet(); // direct writing inline unsigned char * CCircleBuffer::GetDirectWritePointer() { // return a pointer to the tail -- note that it will always be safe to write // at least m_nMaxDirectWriteBytes since we use an end cap region return &m_pBuffer[m_nTail]; } inline void CCircleBuffer::UpdateAfterDirectWrite(int nBytes) { // update the tail m_nTail += nBytes; // if the tail enters the "end cap" area, set the end cap and loop around if (m_nTail >= (m_nTotal - m_nMaxDirectWriteBytes)) { m_nEndCap = m_nTail; m_nTail = 0; } } // get data int Get(unsigned char * pBuffer, int nBytes); // remove / empty void Empty(); int RemoveHead(int nBytes); int RemoveTail(int nBytes); private: int m_nTotal; int m_nMaxDirectWriteBytes; int m_nEndCap; int m_nHead; int m_nTail; unsigned char * m_pBuffer; }; #endif // #ifndef APE_CIRCLEBUFFER_H jmac-1.74/core/nativesrc/mac/Source/Shared/GlobalFunctions.h0000644000175000017500000000167310131230056023711 0ustar twernertwerner#ifndef APE_GLOBALFUNCTIONS_H #define APE_GLOBALFUNCTIONS_H /************************************************************************************* Definitions *************************************************************************************/ class CIO; /************************************************************************************* Read / Write from an IO source and return failure if the number of bytes specified isn't read or written *************************************************************************************/ int ReadSafe(CIO * pIO, void * pBuffer, int nBytes); int WriteSafe(CIO * pIO, void * pBuffer, int nBytes); /************************************************************************************* Checks for the existence of a file *************************************************************************************/ BOOL FileExists(wchar_t * pFilename); #endif // #ifndef APE_GLOBALFUNCTIONS_H jmac-1.74/core/nativesrc/mac/Source/Shared/ID3Genres.h0000644000175000017500000000413610131230056022340 0ustar twernertwerner#ifndef APE_ID3GENRES_H #define APE_ID3GENRES_H #define GENRE_UNDEFINED 255 #define GENRE_COUNT 148 const LPCWSTR g_ID3Genre[GENRE_COUNT] = { L"Blues", L"Classic Rock", L"Country", L"Dance", L"Disco", L"Funk", L"Grunge", L"Hip-Hop", L"Jazz", L"Metal", L"New Age", L"Oldies", L"Other", L"Pop", L"R&B", L"Rap", L"Reggae", L"Rock", L"Techno", L"Industrial", L"Alternative", L"Ska", L"Death Metal", L"Pranks", L"Soundtrack", L"Euro-Techno", L"Ambient", L"Trip-Hop", L"Vocal", L"Jazz+Funk", L"Fusion", L"Trance", L"Classical", L"Instrumental", L"Acid", L"House", L"Game", L"Sound Clip", L"Gospel", L"Noise", L"AlternRock", L"Bass", L"Soul", L"Punk", L"Space", L"Meditative", L"Instrumental Pop", L"Instrumental Rock", L"Ethnic", L"Gothic", L"Darkwave", L"Techno-Industrial", L"Electronic", L"Pop-Folk", L"Eurodance", L"Dream", L"Southern Rock", L"Comedy", L"Cult", L"Gangsta", L"Top 40", L"Christian Rap", L"Pop/Funk", L"Jungle", L"Native American", L"Cabaret", L"New Wave", L"Psychadelic", L"Rave", L"Showtunes", L"Trailer", L"Lo-Fi", L"Tribal", L"Acid Punk", L"Acid Jazz", L"Polka", L"Retro", L"Musical", L"Rock & Roll", L"Hard Rock", L"Folk", L"Folk-Rock", L"National Folk", L"Swing", L"Fast Fusion", L"Bebop", L"Latin", L"Revival", L"Celtic", L"Bluegrass", L"Avantgarde", L"Gothic Rock", L"Progressive Rock", L"Psychedelic Rock", L"Symphonic Rock", L"Slow Rock", L"Big Band", L"Chorus", L"Easy Listening", L"Acoustic", L"Humour", L"Speech", L"Chanson", L"Opera", L"Chamber Music", L"Sonata", L"Symphony", L"Booty Bass", L"Primus", L"Porn Groove", L"Satire", L"Slow Jam", L"Club", L"Tango", L"Samba", L"Folklore", L"Ballad", L"Power Ballad", L"Rhythmic Soul", L"Freestyle", L"Duet", L"Punk Rock", L"Drum Solo", L"Acapella", L"Euro-House", L"Dance Hall", L"Goa", L"Drum & Bass", L"Club House", L"Hardcore", L"Terror", L"Indie", L"BritPop", L"Black Punk", L"Polsk Punk", L"Beat", L"Christian Gangsta", L"Heavy Metal", L"Black Metal", L"Crossover", L"Contemporary C", L"Christian Rock", L"Merengue", L"Salsa", L"Thrash Metal", L"Anime", L"JPop", L"SynthPop" }; #endif // #ifndef APE_ID3GENRES_H jmac-1.74/core/nativesrc/mac/Source/Shared/IO.h0000644000175000017500000000211110131230056021113 0ustar twernertwerner#ifndef APE_IO_H #define APE_IO_H #ifndef FILE_BEGIN #define FILE_BEGIN 0 #endif #ifndef FILE_CURRENT #define FILE_CURRENT 1 #endif #ifndef FILE_END #define FILE_END 2 #endif class CIO { public: //construction / destruction CIO() { } virtual ~CIO() { }; // open / close virtual int Open(const wchar_t * pName) = 0; virtual int Close() = 0; // read / write virtual int Read(void * pBuffer, unsigned int nBytesToRead, unsigned int * pBytesRead) = 0; virtual int Write(const void * pBuffer, unsigned int nBytesToWrite, unsigned int * pBytesWritten) = 0; // seek virtual int Seek(int nDistance, unsigned int nMoveMode) = 0; // creation / destruction virtual int Create(const wchar_t * pName) = 0; virtual int Delete() = 0; // other functions virtual int SetEOF() = 0; // attributes virtual int GetPosition() = 0; virtual int GetSize() = 0; virtual int GetName(wchar_t * pBuffer) = 0; }; #endif // #ifndef APE_IO_H jmac-1.74/core/nativesrc/mac/Source/Shared/NoWindows.h0000644000175000017500000000407310131230056022544 0ustar twernertwerner#ifndef _WIN32 #ifndef APE_NOWINDOWS_H #define APE_NOWINDOWS_H #define FALSE 0 #define TRUE 1 #define NEAR #define FAR typedef unsigned int uint32; typedef int int32; typedef unsigned short uint16; typedef short int16; typedef unsigned char uint8; typedef char int8; typedef char str_ansi; typedef unsigned char str_utf8; typedef wchar_t str_utf16; typedef unsigned long DWORD; typedef int BOOL; typedef unsigned char BYTE; typedef unsigned short WORD; typedef float FLOAT; typedef void * HANDLE; typedef unsigned int UINT; typedef unsigned int WPARAM; typedef long LPARAM; typedef const char * LPCSTR; typedef char * LPSTR; typedef long LRESULT; #define ZeroMemory(POINTER, BYTES) memset(POINTER, 0, BYTES); #define max(a,b) (((a) > (b)) ? (a) : (b)) #define min(a,b) (((a) < (b)) ? (a) : (b)) #define __stdcall #define CALLBACK #define _stricmp strcasecmp #define _strnicmp strncasecmp #define _FPOSOFF(fp) ((long)(fp).__pos) #define MAX_PATH 260 #ifndef _WAVEFORMATEX_ #define _WAVEFORMATEX_ typedef struct tWAVEFORMATEX { WORD wFormatTag; /* format type */ WORD nChannels; /* number of channels (i.e. mono, stereo...) */ DWORD nSamplesPerSec; /* sample rate */ DWORD nAvgBytesPerSec; /* for buffer estimation */ WORD nBlockAlign; /* block size of data */ WORD wBitsPerSample; /* number of bits per sample of mono data */ WORD cbSize; /* the count in bytes of the size of */ /* extra information (after cbSize) */ } WAVEFORMATEX, *PWAVEFORMATEX, NEAR *NPWAVEFORMATEX, FAR *LPWAVEFORMATEX; typedef const WAVEFORMATEX FAR *LPCWAVEFORMATEX; #endif // #ifndef _WAVEFORMATEX_ #endif // #ifndef APE_NOWINDOWS_H #endif // #ifndef _WIN32 jmac-1.74/core/nativesrc/mac/Source/Shared/RollBuffer.h0000644000175000017500000000500210131230056022650 0ustar twernertwerner#ifndef APE_ROLLBUFFER_H #define APE_ROLLBUFFER_H template class CRollBuffer { public: CRollBuffer() { m_pData = NULL; m_pCurrent = NULL; } ~CRollBuffer() { SAFE_ARRAY_DELETE(m_pData); } int Create(int nWindowElements, int nHistoryElements) { SAFE_ARRAY_DELETE(m_pData) m_nWindowElements = nWindowElements; m_nHistoryElements = nHistoryElements; m_pData = new TYPE[m_nWindowElements + m_nHistoryElements]; if (m_pData == NULL) return ERROR_INSUFFICIENT_MEMORY; Flush(); return 0; } void Flush() { ZeroMemory(m_pData, (m_nHistoryElements + 1) * sizeof(TYPE)); m_pCurrent = &m_pData[m_nHistoryElements]; } void Roll() { memcpy(&m_pData[0], &m_pCurrent[-m_nHistoryElements], m_nHistoryElements * sizeof(TYPE)); m_pCurrent = &m_pData[m_nHistoryElements]; } __inline void IncrementSafe() { m_pCurrent++; if (m_pCurrent == &m_pData[m_nWindowElements + m_nHistoryElements]) Roll(); } __inline void IncrementFast() { m_pCurrent++; } __inline TYPE & operator[](const int nIndex) const { return m_pCurrent[nIndex]; } protected: TYPE * m_pData; TYPE * m_pCurrent; int m_nHistoryElements; int m_nWindowElements; }; template class CRollBufferFast { public: CRollBufferFast() { m_pData = new TYPE[WINDOW_ELEMENTS + HISTORY_ELEMENTS]; Flush(); } ~CRollBufferFast() { SAFE_ARRAY_DELETE(m_pData); } void Flush() { ZeroMemory(m_pData, (HISTORY_ELEMENTS + 1) * sizeof(TYPE)); m_pCurrent = &m_pData[HISTORY_ELEMENTS]; } void Roll() { memcpy(&m_pData[0], &m_pCurrent[-HISTORY_ELEMENTS], HISTORY_ELEMENTS * sizeof(TYPE)); m_pCurrent = &m_pData[HISTORY_ELEMENTS]; } __inline void IncrementSafe() { m_pCurrent++; if (m_pCurrent == &m_pData[WINDOW_ELEMENTS + HISTORY_ELEMENTS]) Roll(); } __inline void IncrementFast() { m_pCurrent++; } __inline TYPE & operator[](const int nIndex) const { return m_pCurrent[nIndex]; } protected: TYPE * m_pData; TYPE * m_pCurrent; }; #endif // #ifndef APE_ROLLBUFFER_H jmac-1.74/core/nativesrc/mac/Source/Shared/SmartPtr.h0000644000175000017500000000411510131230056022366 0ustar twernertwerner#ifndef APE_SMARTPTR_H #define APE_SMARTPTR_H // disable the operator -> on UDT warning #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable : 4284) #endif /************************************************************************************************* CSmartPtr - a simple smart pointer class that can automatically initialize and free memory note: (doesn't do garbage collection / reference counting because of the many pitfalls) *************************************************************************************************/ template class CSmartPtr { public: TYPE * m_pObject; BOOL m_bArray; BOOL m_bDelete; CSmartPtr() { m_bDelete = TRUE; m_pObject = NULL; } CSmartPtr(TYPE * a_pObject, BOOL a_bArray = FALSE, BOOL a_bDelete = TRUE) { m_bDelete = TRUE; m_pObject = NULL; Assign(a_pObject, a_bArray, a_bDelete); } ~CSmartPtr() { Delete(); } void Assign(TYPE * a_pObject, BOOL a_bArray = FALSE, BOOL a_bDelete = TRUE) { Delete(); m_bDelete = a_bDelete; m_bArray = a_bArray; m_pObject = a_pObject; } void Delete() { if (m_bDelete && m_pObject) { if (m_bArray) delete [] m_pObject; else delete m_pObject; m_pObject = NULL; } } void SetDelete(const BOOL a_bDelete) { m_bDelete = a_bDelete; } __inline TYPE * GetPtr() const { return m_pObject; } __inline operator TYPE * () const { return m_pObject; } __inline TYPE * operator ->() const { return m_pObject; } // declare assignment, but don't implement (compiler error if we try to use) // that way we can't carelessly mix smart pointers and regular pointers __inline void * operator =(void *) const; }; #ifdef _MSC_VER #pragma warning(pop) #endif // _MSC_VER #endif // #ifndef APE_SMARTPTR_H jmac-1.74/core/nativesrc/mac/Source/Shared/StdLibFileIO.h0000644000175000017500000000201110131230056023014 0ustar twernertwerner#ifdef IO_USE_STD_LIB_FILE_IO #ifndef APE_STDLIBFILEIO_H #define APE_STDLIBFILEIO_H #include "IO.h" class CStdLibFileIO : public CIO { public: // construction / destruction CStdLibFileIO(); ~CStdLibFileIO(); // open / close int Open(LPCTSTR pName); int Close(); // read / write int Read(void * pBuffer, unsigned int nBytesToRead, unsigned int * pBytesRead); int Write(const void * pBuffer, unsigned int nBytesToWrite, unsigned int * pBytesWritten); // seek int Seek(int nDistance, unsigned int nMoveMode); // other functions int SetEOF(); // creation / destruction int Create(const char * pName); int Delete(); // attributes int GetPosition(); int GetSize(); int GetName(char * pBuffer); int GetHandle(); private: char m_cFileName[MAX_PATH]; BOOL m_bReadOnly; FILE * m_pFile; }; #endif // #ifndef APE_STDLIBFILEIO_H #endif // #ifdef IO_USE_STD_LIB_FILE_IO jmac-1.74/core/nativesrc/mac/Source/Shared/StdString.h0000644000175000017500000025435610131230056022551 0ustar twernertwerner// ============================================================================= // FILE: StdString.h // AUTHOR: Joe O'Leary (with outside help noted in comments) // REMARKS: // This header file declares the CStdStr template. This template derives // the Standard C++ Library basic_string<> template and add to it the // the following conveniences: // - The full MFC CString set of functions (including implicit cast) // - writing to/reading from COM IStream interfaces // - Functional objects for use in STL algorithms // // From this template, we intstantiate two classes: CStdStringA and // CStdStringW. The name "CStdString" is just a #define of one of these, // based upone the _UNICODE macro setting // // This header also declares our own version of the MFC/ATL UNICODE-MBCS // conversion macros. Our version looks exactly like the Microsoft's to // facilitate portability. // // NOTE: // If you you use this in an MFC or ATL build, you should include either // afx.h or atlbase.h first, as appropriate. // // PEOPLE WHO HAVE CONTRIBUTED TO THIS CLASS: // // Several people have helped me iron out problems and othewise improve // this class. OK, this is a long list but in my own defense, this code // has undergone two major rewrites. Many of the improvements became // necessary after I rewrote the code as a template. Others helped me // improve the CString facade. // // Anyway, these people are (in chronological order): // // - Pete the Plumber (???) // - Julian Selman // - Chris (of Melbsys) // - Dave Plummer // - John C Sipos // - Chris Sells // - Nigel Nunn // - Fan Xia // - Matthew Williams // - Carl Engman // - Mark Zeren // - Craig Watson // - Rich Zuris // - Karim Ratib // - Chris Conti // - Baptiste Lepilleur // - Greg Pickles // - Jim Cline // - Jeff Kohn // - Todd Heckel // - Ullrich Pollähne // - Joe Vitaterna // - Joe Woodbury // - Aaron (no last name) // - Joldakowski (???) // - Scott Hathaway // - Eric Nitzche // - Pablo Presedo // // REVISION HISTORY // 2001-APR-27 - StreamLoad was calculating the number of BYTES in one // case, not characters. Thanks to Pablo Presedo for this. // // 2001-FEB-23 - Replace() had a bug which caused infinite loops if the // source string was empty. Fixed thanks to Eric Nitzsche. // // 2001-FEB-23 - Scott Hathaway was a huge help in providing me with the // ability to build CStdString on Sun Unix systems. He // sent me detailed build reports about what works and what // does not. If CStdString compiles on your Unix box, you // can thank Scott for it. // // 2000-DEC-29 - Joldakowski noticed one overload of Insert failed to do // range check as CString's does. Now fixed -- thanks! // // 2000-NOV-07 - Aaron pointed out that I was calling static member // functions of char_traits via a temporary. This was not // technically wrong, but it was unnecessary and caused // problems for poor old buggy VC5. Thanks Aaron! // // 2000-JUL-11 - Joe Woodbury noted that the CString::Find docs don't match // what the CString::Find code really ends up doing. I was // trying to match the docs. Now I match the CString code // - Joe also caught me truncating strings for GetBuffer() calls // when the supplied length was less than the current length. // // 2000-MAY-25 - Better support for STLPORT's Standard library distribution // - Got rid of the NSP macro - it interfered with Koenig lookup // - Thanks to Joe Woodbury for catching a TrimLeft() bug that // I introduced in January. Empty strings were not getting // trimmed // // 2000-APR-17 - Thanks to Joe Vitaterna for pointing out that ReverseFind // is supposed to be a const function. // // 2000-MAR-07 - Thanks to Ullrich Pollähne for catching a range bug in one // of the overloads of assign. // // 2000-FEB-01 - You can now use CStdString on the Mac with CodeWarrior! // Thanks to Todd Heckel for helping out with this. // // 2000-JAN-23 - Thanks to Jim Cline for pointing out how I could make the // Trim() function more efficient. // - Thanks to Jeff Kohn for prompting me to find and fix a typo // in one of the addition operators that takes _bstr_t. // - Got rid of the .CPP file - you only need StdString.h now! // // 1999-DEC-22 - Thanks to Greg Pickles for helping me identify a problem // with my implementation of CStdString::FormatV in which // resulting string might not be properly NULL terminated. // // 1999-DEC-06 - Chris Conti pointed yet another basic_string<> assignment // bug that MS has not fixed. CStdString did nothing to fix // it either but it does now! The bug was: create a string // longer than 31 characters, get a pointer to it (via c_str()) // and then assign that pointer to the original string object. // The resulting string would be empty. Not with CStdString! // // 1999-OCT-06 - BufferSet was erasing the string even when it was merely // supposed to shrink it. Fixed. Thanks to Chris Conti. // - Some of the Q172398 fixes were not checking for assignment- // to-self. Fixed. Thanks to Baptiste Lepilleur. // // 1999-AUG-20 - Improved Load() function to be more efficient by using // SizeOfResource(). Thanks to Rich Zuris for this. // - Corrected resource ID constructor, again thanks to Rich. // - Fixed a bug that occurred with UNICODE characters above // the first 255 ANSI ones. Thanks to Craig Watson. // - Added missing overloads of TrimLeft() and TrimRight(). // Thanks to Karim Ratib for pointing them out // // 1999-JUL-21 - Made all calls to GetBuf() with no args check length first. // // 1999-JUL-10 - Improved MFC/ATL independence of conversion macros // - Added SS_NO_REFCOUNT macro to allow you to disable any // reference-counting your basic_string<> impl. may do. // - Improved ReleaseBuffer() to be as forgiving as CString. // Thanks for Fan Xia for helping me find this and to // Matthew Williams for pointing it out directly. // // 1999-JUL-06 - Thanks to Nigel Nunn for catching a very sneaky bug in // ToLower/ToUpper. They should call GetBuf() instead of // data() in order to ensure the changed string buffer is not // reference-counted (in those implementations that refcount). // // 1999-JUL-01 - Added a true CString facade. Now you can use CStdString as // a drop-in replacement for CString. If you find this useful, // you can thank Chris Sells for finally convincing me to give // in and implement it. // - Changed operators << and >> (for MFC CArchive) to serialize // EXACTLY as CString's do. So now you can send a CString out // to a CArchive and later read it in as a CStdString. I have // no idea why you would want to do this but you can. // // 1999-JUN-21 - Changed the CStdString class into the CStdStr template. // - Fixed FormatV() to correctly decrement the loop counter. // This was harmless bug but a bug nevertheless. Thanks to // Chris (of Melbsys) for pointing it out // - Changed Format() to try a normal stack-based array before // using to _alloca(). // - Updated the text conversion macros to properly use code // pages and to fit in better in MFC/ATL builds. In other // words, I copied Microsoft's conversion stuff again. // - Added equivalents of CString::GetBuffer, GetBufferSetLength // - new sscpy() replacement of CStdString::CopyString() // - a Trim() function that combines TrimRight() and TrimLeft(). // // 1999-MAR-13 - Corrected the "NotSpace" functional object to use _istpace() // instead of _isspace() Thanks to Dave Plummer for this. // // 1999-FEB-26 - Removed errant line (left over from testing) that #defined // _MFC_VER. Thanks to John C Sipos for noticing this. // // 1999-FEB-03 - Fixed a bug in a rarely-used overload of operator+() that // caused infinite recursion and stack overflow // - Added member functions to simplify the process of // persisting CStdStrings to/from DCOM IStream interfaces // - Added functional objects (e.g. StdStringLessNoCase) that // allow CStdStrings to be used as keys STL map objects with // case-insensitive comparison // - Added array indexing operators (i.e. operator[]). I // originally assumed that these were unnecessary and would be // inherited from basic_string. However, without them, Visual // C++ complains about ambiguous overloads when you try to use // them. Thanks to Julian Selman to pointing this out. // // 1998-FEB-?? - Added overloads of assign() function to completely account // for Q172398 bug. Thanks to "Pete the Plumber" for this // // 1998-FEB-?? - Initial submission // // COPYRIGHT: // 1999 Joseph M. O'Leary. This code is free. Use it anywhere you want. // Rewrite it, restructure it, whatever. Please don't blame me if it makes // your $30 billion dollar satellite explode in orbit. If you redistribute // it in any form, I'd appreciate it if you would leave this notice here. // // If you find any bugs, please let me know: // // jmoleary@earthlink.net // http://home.earthlink.net/~jmoleary // ============================================================================= // Avoid multiple inclusion the VC++ way, // Turn off browser references // Turn off unavoidable compiler warnings #if defined(_MSC_VER) && (_MSC_VER > 1100) #pragma once #pragma component(browser, off, references, "CStdString") #pragma warning (disable : 4290) // C++ Exception Specification ignored #pragma warning (disable : 4127) // Conditional expression is constant #pragma warning (disable : 4097) // typedef name used as synonym for class name #endif #ifndef STDSTRING_H #define STDSTRING_H // MACRO: SS_NO_REFCOUNT: // turns off reference counting at the assignment level // I define this by default. comment it out if you don't want it. #define SS_NO_REFCOUNT // In non-Visual C++ and/or non-Win32 builds, we can't use some cool stuff. #if !defined(_MSC_VER) || !defined(_WIN32) #define SS_ANSI #endif // Avoid legacy code screw up: if _UNICODE is defined, UNICODE must be as well #if defined (_UNICODE) && !defined (UNICODE) #define UNICODE #endif #if defined (UNICODE) && !defined (_UNICODE) #define _UNICODE #endif // ----------------------------------------------------------------------------- // MIN and MAX. The Standard C++ template versions go by so many names (at // at least in the MS implementation) that you never know what's available // ----------------------------------------------------------------------------- template inline const Type& SSMIN(const Type& arg1, const Type& arg2) { return arg2 < arg1 ? arg2 : arg1; } template inline const Type& SSMAX(const Type& arg1, const Type& arg2) { return arg2 > arg1 ? arg2 : arg1; } // If they have not #included W32Base.h (part of my W32 utility library) then // we need to define some stuff. Otherwise, this is all defined there. #if !defined(W32BASE_H) // If they want us to use only standard C++ stuff (no Win32 stuff) #ifdef SS_ANSI // On non-Win32 platforms, there is no TCHAR.H so define what we need #ifndef _WIN32 typedef const char* PCSTR; typedef char* PSTR; typedef const wchar_t* PCWSTR; typedef wchar_t* PWSTR; #ifdef UNICODE typedef wchar_t TCHAR; #else typedef char TCHAR; #endif typedef wchar_t OLECHAR; #else #include #include #ifndef STRICT #define STRICT #endif #endif // #ifndef _WIN32 // Make sure ASSERT and verify are defined in an ANSI fashion #ifndef ASSERT #include #define ASSERT(f) assert((f)) #endif #ifndef VERIFY #ifdef _DEBUG #define VERIFY(x) ASSERT((x)) #else #define VERIFY(x) x #endif #endif #else // #ifdef SS_ANSI #include #include #ifndef STRICT #define STRICT #endif // Make sure ASSERT and verify are defined #ifndef ASSERT #include #define ASSERT(f) _ASSERTE((f)) #endif #ifndef VERIFY #ifdef _DEBUG #define VERIFY(x) ASSERT((x)) #else #define VERIFY(x) x #endif #endif #endif // #ifdef SS_ANSI #ifndef UNUSED #define UNUSED(x) x #endif #endif // #ifndef W32BASE_H // Standard headers needed #include // basic_string #include // for_each, etc. #include // for StdStringLessNoCase, et al #include // for various facets // If this is a recent enough version of VC include comdef.h, so we can write // member functions to deal with COM types & compiler support classes e.g. _bstr_t #if defined (_MSC_VER) && (_MSC_VER >= 1100) #include #define SS_INC_COMDEF // signal that we #included MS comdef.h file #define STDSTRING_INC_COMDEF #define SS_NOTHROW __declspec(nothrow) #else #define SS_NOTHROW #endif #ifndef TRACE #define TRACE_DEFINED_HERE #define TRACE #endif // Microsoft defines PCSTR, PCWSTR, etc, but no PCTSTR. I hate to use the // versions with the "L" in front of them because that's a leftover from Win 16 // days, even though it evaluates to the same thing. Therefore, Define a PCSTR // as an LPCTSTR. #if !defined(PCTSTR) && !defined(PCTSTR_DEFINED) typedef const TCHAR* PCTSTR; #define PCTSTR_DEFINED #endif #if !defined(PCOLESTR) && !defined(PCOLESTR_DEFINED) typedef const OLECHAR* PCOLESTR; #define PCOLESTR_DEFINED #endif #if !defined(POLESTR) && !defined(POLESTR_DEFINED) typedef OLECHAR* POLESTR; #define POLESTR_DEFINED #endif #if !defined(PCUSTR) && !defined(PCUSTR_DEFINED) typedef const unsigned char* PCUSTR; typedef unsigned char* PUSTR; #define PCUSTR_DEFINED #endif // SS_USE_FACET macro and why we need it: // // Since I'm a good little Standard C++ programmer, I use locales. Thus, I // need to make use of the use_facet<> template function here. Unfortunately, // this need is complicated by the fact the MS' implementation of the Standard // C++ Library has a non-standard version of use_facet that takes more // arguments than the standard dictates. Since I'm trying to write CStdString // to work with any version of the Standard library, this presents a problem. // // The upshot of this is that I can't do 'use_facet' directly. The MS' docs // tell me that I have to use a macro, _USE() instead. Since _USE obviously // won't be available in other implementations, this means that I have to write // my OWN macro -- SS_USE_FACET -- that evaluates either to _USE or to the // standard, use_facet. // // If you are having trouble with the SS_USE_FACET macro, in your implementation // of the Standard C++ Library, you can define your own version of SS_USE_FACET. #ifndef schMSG #define schSTR(x) #x #define schSTR2(x) schSTR(x) #define schMSG(desc) message(__FILE__ "(" schSTR2(__LINE__) "):" #desc) #endif #ifndef SS_USE_FACET // STLPort #defines a macro (__STL_NO_EXPLICIT_FUNCTION_TMPL_ARGS) for // all MSVC builds, erroneously in my opinion. It causes problems for // my SS_ANSI builds. In my code, I always comment out that line. You'll // find it in \stlport\config\stl_msvc.h #if defined(__SGI_STL_PORT) && (__SGI_STL_PORT >= 0x400 ) #if defined(__STL_NO_EXPLICIT_FUNCTION_TMPL_ARGS) && defined(_MSC_VER) #ifdef SS_ANSI #pragma schMSG(__STL_NO_EXPLICIT_FUNCTION_TMPL_ARGS defined!!) #endif #endif #define SS_USE_FACET(loc, fac) std::use_facet(loc) #elif defined(_MSC_VER ) #define SS_USE_FACET(loc, fac) _USE(loc, fac) // ...and #elif defined(_RWSTD_NO_TEMPLATE_ON_RETURN_TYPE) #define SS_USE_FACET(loc, fac) std::use_facet(loc, (fac*)0) #else #define SS_USE_FACET(loc, fac) std::use_facet(loc) #endif #endif // ============================================================================= // UNICODE/MBCS conversion macros. Made to work just like the MFC/ATL ones. // ============================================================================= // First define the conversion helper functions. We define these regardless of // any preprocessor macro settings since their names won't collide. #ifdef SS_ANSI // Are we doing things the standard, non-Win32 way?... typedef std::codecvt SSCodeCvt; // Not sure if we need all these headers. I believe ANSI says we do. #include #include #include #ifndef va_start #include #endif // StdCodeCvt - made to look like Win32 functions WideCharToMultiByte annd // MultiByteToWideChar but uses locales in SS_ANSI builds inline PWSTR StdCodeCvt(PWSTR pW, PCSTR pA, int nChars, const std::locale& loc=std::locale()) { ASSERT(0 != pA); ASSERT(0 != pW); pW[0] = '\0'; PCSTR pBadA = 0; PWSTR pBadW = 0; SSCodeCvt::result res = SSCodeCvt::ok; const SSCodeCvt& conv = SS_USE_FACET(loc, SSCodeCvt); SSCodeCvt::state_type st= { 0 }; res = conv.in(st, pA, pA + nChars, pBadA, pW, pW + nChars, pBadW); ASSERT(SSCodeCvt::ok == res); return pW; } inline PWSTR StdCodeCvt(PWSTR pW, PCUSTR pA, int nChars, const std::locale& loc=std::locale()) { return StdCodeCvt(pW, (PCSTR)pA, nChars, loc); } inline PSTR StdCodeCvt(PSTR pA, PCWSTR pW, int nChars, const std::locale& loc=std::locale()) { ASSERT(0 != pA); ASSERT(0 != pW); pA[0] = '\0'; PSTR pBadA = 0; PCWSTR pBadW = 0; SSCodeCvt::result res = SSCodeCvt::ok; const SSCodeCvt& conv = SS_USE_FACET(loc, SSCodeCvt); SSCodeCvt::state_type st= { 0 }; res = conv.out(st, pW, pW + nChars, pBadW, pA, pA + nChars, pBadA); ASSERT(SSCodeCvt::ok == res); return pA; } inline PUSTR StdCodeCvt(PUSTR pA, PCWSTR pW, int nChars, const std::locale& loc=std::locale()) { return (PUSTR)StdCodeCvt((PSTR)pA, pW, nChars, loc); } #else // ...or are we doing things assuming win32 and Visual C++? #include // needed for _alloca inline PWSTR StdCodeCvt(PWSTR pW, PCSTR pA, int nChars, UINT acp=CP_ACP) { ASSERT(0 != pA); ASSERT(0 != pW); pW[0] = '\0'; MultiByteToWideChar(acp, 0, pA, -1, pW, nChars); return pW; } inline PWSTR StdCodeCvt(PWSTR pW, PCUSTR pA, int nChars, UINT acp=CP_ACP) { return StdCodeCvt(pW, (PCSTR)pA, nChars, acp); } inline PSTR StdCodeCvt(PSTR pA, PCWSTR pW, int nChars, UINT acp=CP_ACP) { ASSERT(0 != pA); ASSERT(0 != pW); pA[0] = '\0'; WideCharToMultiByte(acp, 0, pW, -1, pA, nChars, 0, 0); return pA; } inline PUSTR StdCodeCvt(PUSTR pA, PCWSTR pW, int nChars, UINT acp=CP_ACP) { return (PUSTR)StdCodeCvt((PSTR)pA, pW, nChars, acp); } // Define our conversion macros to look exactly like Microsoft's to // facilitate using this stuff both with and without MFC/ATL #ifdef _CONVERSION_USES_THREAD_LOCALE #ifndef _DEBUG #define SSCVT int _cvt; _cvt; UINT _acp=GetACP(); \ _acp; PCWSTR _pw; _pw; PCSTR _pa; _pa #else #define SSCVT int _cvt = 0; _cvt; UINT _acp=GetACP();\ _acp; PCWSTR _pw=0; _pw; PCSTR _pa=0; _pa #endif #else #ifndef _DEBUG #define SSCVT int _cvt; _cvt; UINT _acp=CP_ACP; _acp;\ PCWSTR _pw; _pw; PCSTR _pa; _pa #else #define SSCVT int _cvt = 0; _cvt; UINT _acp=CP_ACP; \ _acp; PCWSTR _pw=0; _pw; PCSTR _pa=0; _pa #endif #endif #ifdef _CONVERSION_USES_THREAD_LOCALE #define SSA2W(pa) (\ ((_pa = pa) == 0) ? 0 : (\ _cvt = (strlen(_pa)+1),\ StdCodeCvt((PWSTR) _alloca(_cvt*2), _pa, _cvt, _acp))) #define SSW2A(pw) (\ ((_pw = pw) == 0) ? 0 : (\ _cvt = (wcslen(_pw)+1)*2,\ StdW2AHelper((LPSTR) _alloca(_cvt), _pw, _cvt, _acp))) #else #define SSA2W(pa) (\ ((_pa = pa) == 0) ? 0 : (\ _cvt = (strlen(_pa)+1),\ StdCodeCvt((PWSTR) _alloca(_cvt*2), _pa, _cvt))) #define SSW2A(pw) (\ ((_pw = pw) == 0) ? 0 : (\ _cvt = (wcslen(_pw)+1)*2,\ StdCodeCvt((LPSTR) _alloca(_cvt), _pw, _cvt))) #endif #define SSA2CW(pa) ((PCWSTR)SSA2W((pa))) #define SSW2CA(pw) ((PCSTR)SSW2A((pw))) #ifdef UNICODE #define SST2A SSW2A #define SSA2T SSA2W #define SST2CA SSW2CA #define SSA2CT SSA2CW inline PWSTR SST2W(PTSTR p) { return p; } inline PTSTR SSW2T(PWSTR p) { return p; } inline PCWSTR SST2CW(PCTSTR p) { return p; } inline PCTSTR SSW2CT(PCWSTR p) { return p; } #else #define SST2W SSA2W #define SSW2T SSW2A #define SST2CW SSA2CW #define SSW2CT SSW2CA inline PSTR SST2A(PTSTR p) { return p; } inline PTSTR SSA2T(PSTR p) { return p; } inline PCSTR SST2CA(PCTSTR p) { return p; } inline PCTSTR SSA2CT(PCSTR p) { return p; } #endif // #ifdef UNICODE #if defined(UNICODE) // in these cases the default (TCHAR) is the same as OLECHAR inline PCOLESTR SST2COLE(PCTSTR p) { return p; } inline PCTSTR SSOLE2CT(PCOLESTR p) { return p; } inline POLESTR SST2OLE(PTSTR p) { return p; } inline PTSTR SSOLE2T(POLESTR p) { return p; } #elif defined(OLE2ANSI) // in these cases the default (TCHAR) is the same as OLECHAR inline PCOLESTR SST2COLE(PCTSTR p) { return p; } inline PCTSTR SSOLE2CT(PCOLESTR p) { return p; } inline POLESTR SST2OLE(PTSTR p) { return p; } inline PTSTR SSOLE2T(POLESTR p) { return p; } #else //CharNextW doesn't work on Win95 so we use this #define SST2COLE(pa) SSA2CW((pa)) #define SST2OLE(pa) SSA2W((pa)) #define SSOLE2CT(po) SSW2CA((po)) #define SSOLE2T(po) SSW2A((po)) #endif #ifdef OLE2ANSI #define SSW2OLE SSW2A #define SSOLE2W SSA2W #define SSW2COLE SSW2CA #define SSOLE2CW SSA2CW inline POLESTR SSA2OLE(PSTR p) { return p; } inline PSTR SSOLE2A(POLESTR p) { return p; } inline PCOLESTR SSA2COLE(PCSTR p) { return p; } inline PCSTR SSOLE2CA(PCOLESTR p){ return p; } #else #define SSA2OLE SSA2W #define SSOLE2A SSW2A #define SSA2COLE SSA2CW #define SSOLE2CA SSW2CA inline POLESTR SSW2OLE(PWSTR p) { return p; } inline PWSTR SSOLE2W(POLESTR p) { return p; } inline PCOLESTR SSW2COLE(PCWSTR p) { return p; } inline PCWSTR SSOLE2CW(PCOLESTR p){ return p; } #endif // Above we've defined macros that look like MS' but all have // an 'SS' prefix. Now we need the real macros. We'll either // get them from the macros above or from MFC/ATL. If // SS_NO_CONVERSION is #defined, we'll forgo them #ifndef SS_NO_CONVERSION #if defined (USES_CONVERSION) #define _NO_STDCONVERSION // just to be consistent #else #ifdef _MFC_VER #include #define _NO_STDCONVERSION // just to be consistent #else #define USES_CONVERSION SSCVT #define A2CW SSA2CW #define W2CA SSW2CA #define T2A SST2A #define A2T SSA2T #define T2W SST2W #define W2T SSW2T #define T2CA SST2CA #define A2CT SSA2CT #define T2CW SST2CW #define W2CT SSW2CT #define ocslen sslen #define ocscpy sscpy #define T2COLE SST2COLE #define OLE2CT SSOLE2CT #define T2OLE SST2COLE #define OLE2T SSOLE2CT #define A2OLE SSA2OLE #define OLE2A SSOLE2A #define W2OLE SSW2OLE #define OLE2W SSOLE2W #define A2COLE SSA2COLE #define OLE2CA SSOLE2CA #define W2COLE SSW2COLE #define OLE2CW SSOLE2CW #endif // #ifdef _MFC_VER #endif // #ifndef USES_CONVERSION #endif // #ifndef SS_NO_CONVERSION // Define ostring - generic name for std::basic_string #if !defined(ostring) && !defined(OSTRING_DEFINED) typedef std::basic_string ostring; #define OSTRING_DEFINED #endif #endif // #ifndef SS_ANSI // StdCodeCvt when there's no conversion to be done inline PSTR StdCodeCvt(PSTR pDst, PCSTR pSrc, int nChars) { pDst[0] = '\0'; std::char_traits::copy(pDst, pSrc, nChars); if ( nChars > 0 ) pDst[nChars] = '\0'; return pDst; } inline PSTR StdCodeCvt(PSTR pDst, PCUSTR pSrc, int nChars) { return StdCodeCvt(pDst, (PCSTR)pSrc, nChars); } inline PUSTR StdCodeCvt(PUSTR pDst, PCSTR pSrc, int nChars) { return (PUSTR)StdCodeCvt((PSTR)pDst, pSrc, nChars); } inline PWSTR StdCodeCvt(PWSTR pDst, PCWSTR pSrc, int nChars) { pDst[0] = '\0'; std::char_traits::copy(pDst, pSrc, nChars); if ( nChars > 0 ) pDst[nChars] = '\0'; return pDst; } // Define tstring -- generic name for std::basic_string #if !defined(tstring) && !defined(TSTRING_DEFINED) typedef std::basic_string tstring; #define TSTRING_DEFINED #endif // a very shorthand way of applying the fix for KB problem Q172398 // (basic_string assignment bug) #if defined ( _MSC_VER ) && ( _MSC_VER < 1200 ) #define Q172398(x) (x).erase() #else #define Q172398(x) #endif // ============================================================================= // INLINE FUNCTIONS ON WHICH CSTDSTRING RELIES // // Usually for generic text mapping, we rely on preprocessor macro definitions // to map to string functions. However the CStdStr<> template cannot use // macro-based generic text mappings because its character types do not get // resolved until template processing which comes AFTER macro processing. In // other words, UNICODE is of little help to us in the CStdStr template // // Therefore, to keep the CStdStr declaration simple, we have these inline // functions. The template calls them often. Since they are inline (and NOT // exported when this is built as a DLL), they will probably be resolved away // to nothing. // // Without these functions, the CStdStr<> template would probably have to broken // out into two, almost identical classes. Either that or it would be a huge, // convoluted mess, with tons of "if" statements all over the place checking the // size of template parameter CT. // // In several cases, you will see two versions of each function. One version is // the more portable, standard way of doing things, while the other is the // non-standard, but often significantly faster Visual C++ way. // ============================================================================= // If they defined SS_NO_REFCOUNT, then we must convert all assignments #ifdef SS_NO_REFCOUNT #define SSREF(x) (x).c_str() #else #define SSREF(x) (x) #endif // ----------------------------------------------------------------------------- // sslen: strlen/wcslen wrappers // ----------------------------------------------------------------------------- template inline int sslen(const CT* pT) { return 0 == pT ? 0 : std::char_traits::length(pT); } inline SS_NOTHROW int sslen(const std::string& s) { return s.length(); } inline SS_NOTHROW int sslen(const std::wstring& s) { return s.length(); } // ----------------------------------------------------------------------------- // ssasn: assignment functions -- assign "sSrc" to "sDst" // ----------------------------------------------------------------------------- typedef std::string::size_type SS_SIZETYPE; // just for shorthand, really typedef std::string::pointer SS_PTRTYPE; typedef std::wstring::size_type SW_SIZETYPE; typedef std::wstring::pointer SW_PTRTYPE; inline void ssasn(std::string& sDst, const std::string& sSrc) { if ( sDst.c_str() != sSrc.c_str() ) { sDst.erase(); sDst.assign(SSREF(sSrc)); } } inline void ssasn(std::string& sDst, PCSTR pA) { // Watch out for NULLs, as always. if ( 0 == pA ) { sDst.erase(); } // If pA actually points to part of sDst, we must NOT erase(), but // rather take a substring else if ( pA >= sDst.c_str() && pA <= sDst.c_str() + sDst.size() ) { sDst =sDst.substr(static_cast(pA-sDst.c_str())); } // Otherwise (most cases) apply the assignment bug fix, if applicable // and do the assignment else { Q172398(sDst); sDst.assign(pA); } } inline void ssasn(std::string& sDst, const std::wstring& sSrc) { #ifdef SS_ANSI int nLen = sSrc.size(); sDst.resize(0); sDst.resize(nLen); StdCodeCvt(const_cast(sDst.data()), sSrc.c_str(), nLen); #else SSCVT; sDst.assign(SSW2CA(sSrc.c_str())); #endif } inline void ssasn(std::string& sDst, PCWSTR pW) { #ifdef SS_ANSI int nLen = sslen(pW); sDst.resize(0); sDst.resize(nLen); StdCodeCvt(const_cast(sDst.data()), pW, nLen); #else SSCVT; sDst.assign(pW ? SSW2CA(pW) : ""); #endif } inline void ssasn(std::string& sDst, const int nNull) { UNUSED(nNull); ASSERT(nNull==0); sDst.assign(""); } inline void ssasn(std::wstring& sDst, const std::wstring& sSrc) { if ( sDst.c_str() != sSrc.c_str() ) { sDst.erase(); sDst.assign(SSREF(sSrc)); } } inline void ssasn(std::wstring& sDst, PCWSTR pW) { // Watch out for NULLs, as always. if ( 0 == pW ) { sDst.erase(); } // If pW actually points to part of sDst, we must NOT erase(), but // rather take a substring else if ( pW >= sDst.c_str() && pW <= sDst.c_str() + sDst.size() ) { sDst = sDst.substr(static_cast(pW-sDst.c_str())); } // Otherwise (most cases) apply the assignment bug fix, if applicable // and do the assignment else { Q172398(sDst); sDst.assign(pW); } } #undef StrSizeType inline void ssasn(std::wstring& sDst, const std::string& sSrc) { #ifdef SS_ANSI int nLen = sSrc.size(); sDst.resize(0); sDst.resize(nLen); StdCodeCvt(const_cast(sDst.data()), sSrc.c_str(), nLen); #else SSCVT; sDst.assign(SSA2CW(sSrc.c_str())); #endif } inline void ssasn(std::wstring& sDst, PCSTR pA) { #ifdef SS_ANSI int nLen = sslen(pA); sDst.resize(0); sDst.resize(nLen); StdCodeCvt(const_cast(sDst.data()), pA, nLen); #else SSCVT; sDst.assign(pA ? SSA2CW(pA) : L""); #endif } inline void ssasn(std::wstring& sDst, const int nNull) { UNUSED(nNull); ASSERT(nNull==0); sDst.assign(L""); } // ----------------------------------------------------------------------------- // ssadd: string object concatenation -- add second argument to first // ----------------------------------------------------------------------------- inline void ssadd(std::string& sDst, const std::wstring& sSrc) { #ifdef SS_ANSI int nLen = sSrc.size(); sDst.resize(sDst.size() + nLen); StdCodeCvt(const_cast(sDst.data()+nLen), sSrc.c_str(), nLen); #else SSCVT; sDst.append(SSW2CA(sSrc.c_str())); #endif } inline void ssadd(std::string& sDst, const std::string& sSrc) { sDst.append(sSrc.c_str()); } inline void ssadd(std::string& sDst, PCWSTR pW) { #ifdef SS_ANSI int nLen = sslen(pW); sDst.resize(sDst.size() + nLen); StdCodeCvt(const_cast(sDst.data()+nLen), pW, nLen); #else SSCVT; if ( 0 != pW ) sDst.append(SSW2CA(pW)); #endif } inline void ssadd(std::string& sDst, PCSTR pA) { if ( pA ) sDst.append(pA); } inline void ssadd(std::wstring& sDst, const std::wstring& sSrc) { sDst.append(sSrc.c_str()); } inline void ssadd(std::wstring& sDst, const std::string& sSrc) { #ifdef SS_ANSI int nLen = sSrc.size(); sDst.resize(sDst.size() + nLen); StdCodeCvt(const_cast(sDst.data()+nLen), sSrc.c_str(), nLen); #else SSCVT; sDst.append(SSA2CW(sSrc.c_str())); #endif } inline void ssadd(std::wstring& sDst, PCSTR pA) { #ifdef SS_ANSI int nLen = sslen(pA); sDst.resize(sDst.size() + nLen); StdCodeCvt(const_cast(sDst.data()+nLen), pA, nLen); #else SSCVT; if ( 0 != pA ) sDst.append(SSA2CW(pA)); #endif } inline void ssadd(std::wstring& sDst, PCWSTR pW) { if ( pW ) sDst.append(pW); } // ----------------------------------------------------------------------------- // ssicmp: comparison (case insensitive ) // ----------------------------------------------------------------------------- #ifdef SS_ANSI template inline int ssicmp(const CT* pA1, const CT* pA2) { std::locale loc; const std::ctype& ct = SS_USE_FACET(loc, std::ctype); CT f; CT l; do { f = ct.tolower(*(pA1++)); l = ct.tolower(*(pA2++)); } while ( (f) && (f == l) ); return (int)(f - l); } #else #ifdef _MBCS inline long sscmp(PCSTR pA1, PCSTR pA2) { return _mbscmp((PCUSTR)pA1, (PCUSTR)pA2); } inline long ssicmp(PCSTR pA1, PCSTR pA2) { return _mbsicmp((PCUSTR)pA1, (PCUSTR)pA2); } #else inline long sscmp(PCSTR pA1, PCSTR pA2) { return strcmp(pA1, pA2); } inline long ssicmp(PCSTR pA1, PCSTR pA2) { return _stricmp(pA1, pA2); } #endif inline long sscmp(PCWSTR pW1, PCWSTR pW2) { return wcscmp(pW1, pW2); } inline long ssicmp(PCWSTR pW1, PCWSTR pW2) { return _wcsicmp(pW1, pW2); } #endif // ----------------------------------------------------------------------------- // ssupr/sslwr: Uppercase/Lowercase conversion functions // ----------------------------------------------------------------------------- #ifdef SS_ANSI template inline void sslwr(CT* pT, size_t nLen) { SS_USE_FACET(std::locale(), std::ctype).tolower(pT, pT+nLen); } template inline void ssupr(CT* pT, size_t nLen) { SS_USE_FACET(std::locale(), std::ctype).toupper(pT, pT+nLen); } #else // #else we must be on Win32 #ifdef _MBCS inline void ssupr(PSTR pA, size_t /*nLen*/) { _mbsupr((PUSTR)pA); } inline void sslwr(PSTR pA, size_t /*nLen*/) { _mbslwr((PUSTR)pA); } #else inline void ssupr(PSTR pA, size_t /*nLen*/) { _strupr(pA); } inline void sslwr(PSTR pA, size_t /*nLen*/) { _strlwr(pA); } #endif inline void ssupr(PWSTR pW, size_t /*nLen*/) { _wcsupr(pW); } inline void sslwr(PWSTR pW, size_t /*nLen*/) { _wcslwr(pW); } #endif // #ifdef SS_ANSI // ----------------------------------------------------------------------------- // vsprintf/vswprintf or _vsnprintf/_vsnwprintf equivalents. In standard // builds we can't use _vsnprintf/_vsnwsprintf because they're MS extensions. // ----------------------------------------------------------------------------- #ifdef SS_ANSI inline int ssvsprintf(PSTR pA, size_t /*nCount*/, PCSTR pFmtA, va_list vl) { return vsprintf(pA, pFmtA, vl); } inline int ssvsprintf(PWSTR pW, size_t nCount, PCWSTR pFmtW, va_list vl) { // JMO: It is beginning to seem like Microsoft Visual C++ is the only // CRT distribution whose version of vswprintf takes THREE arguments. // All others seem to take FOUR arguments. Therefore instead of // checking for every possible distro here, I'll assume that unless // I am running with Microsoft's CRT, then vswprintf takes four // arguments. If you get a compilation error here, then you can just // change this code to call the three-argument version. // #if !defined(__MWERKS__) && !defined(__SUNPRO_CC_COMPAT) && !defined(__SUNPRO_CC) #ifndef _MSC_VER return vswprintf(pW, nCount, pFmtW, vl); #else nCount; return vswprintf(pW, pFmtW, vl); #endif } #else inline int ssnprintf(PSTR pA, size_t nCount, PCSTR pFmtA, va_list vl) { return _vsnprintf(pA, nCount, pFmtA, vl); } inline int ssnprintf(PWSTR pW, size_t nCount, PCWSTR pFmtW, va_list vl) { return _vsnwprintf(pW, nCount, pFmtW, vl); } #endif // ----------------------------------------------------------------------------- // ssload: Type safe, overloaded ::LoadString wrappers // There is no equivalent of these in non-Win32-specific builds. However, I'm // thinking that with the message facet, there might eventually be one // ----------------------------------------------------------------------------- #ifdef SS_ANSI #else inline int ssload(HMODULE hInst, UINT uId, PSTR pBuf, int nMax) { return ::LoadStringA(hInst, uId, pBuf, nMax); } inline int ssload(HMODULE hInst, UINT uId, PWSTR pBuf, int nMax) { return ::LoadStringW(hInst, uId, pBuf, nMax); } #endif // ----------------------------------------------------------------------------- // sscoll/ssicoll: Collation wrappers // ----------------------------------------------------------------------------- #ifdef SS_ANSI template inline int sscoll(const CT* sz1, int nLen1, const CT* sz2, int nLen2) { const std::collate& coll = SS_USE_FACET(std::locale(), std::collate); return coll.compare(sz1, sz1+nLen1, sz2, sz2+nLen2); } template inline int ssicoll(const CT* sz1, int nLen1, const CT* sz2, int nLen2) { const std::locale loc; const std::collate& coll = SS_USE_FACET(loc, std::collate); // Some implementations seem to have trouble using the collate<> // facet typedefs so we'll just default to basic_string and hope // that's what the collate facet uses (which it generally should) // std::collate::string_type s1(sz1); // std::collate::string_type s2(sz2); std::basic_string s1(sz1); std::basic_string s2(sz2); sslwr(const_cast(s1.c_str()), nLen1); sslwr(const_cast(s2.c_str()), nLen2); return coll.compare(s1.c_str(), s1.c_str()+nLen1, s2.c_str(), s2.c_str()+nLen2); } #else #ifdef _MBCS inline int sscoll(PCSTR sz1, int /*nLen1*/, PCSTR sz2, int /*nLen2*/) { return _mbscoll((PCUSTR)sz1, (PCUSTR)sz2); } inline int ssicoll(PCSTR sz1, int /*nLen1*/, PCSTR sz2, int /*nLen2*/) { return _mbsicoll((PCUSTR)sz1, (PCUSTR)sz2); } #else inline int sscoll(PCSTR sz1, int /*nLen1*/, PCSTR sz2, int /*nLen2*/) { return strcoll(sz1, sz2); } inline int ssicoll(PCSTR sz1, int /*nLen1*/, PCSTR sz2, int /*nLen2*/) { return _stricoll(sz1, sz2); } #endif inline int sscoll(PCWSTR sz1, int /*nLen1*/, PCWSTR sz2, int /*nLen2*/) { return wcscoll(sz1, sz2); } inline int ssicoll(PCWSTR sz1, int /*nLen1*/, PCWSTR sz2, int /*nLen2*/) { return _wcsicoll(sz1, sz2); } #endif // ----------------------------------------------------------------------------- // ssfmtmsg: FormatMessage equivalents. Needed because I added a CString facade // Again -- no equivalent of these on non-Win32 builds but their might one day // be one if the message facet gets implemented // ----------------------------------------------------------------------------- #ifdef SS_ANSI #else inline DWORD ssfmtmsg(DWORD dwFlags, LPCVOID pSrc, DWORD dwMsgId, DWORD dwLangId, PSTR pBuf, DWORD nSize, va_list* vlArgs) { return FormatMessageA(dwFlags, pSrc, dwMsgId, dwLangId, pBuf, nSize,vlArgs); } inline DWORD ssfmtmsg(DWORD dwFlags, LPCVOID pSrc, DWORD dwMsgId, DWORD dwLangId, PWSTR pBuf, DWORD nSize, va_list* vlArgs) { return FormatMessageW(dwFlags, pSrc, dwMsgId, dwLangId, pBuf, nSize,vlArgs); } #endif // FUNCTION: sscpy. Copies up to 'nMax' characters from pSrc to pDst. // ----------------------------------------------------------------------------- // FUNCTION: sscpy // inline int sscpy(PSTR pDst, PCSTR pSrc, int nMax=-1); // inline int sscpy(PUSTR pDst, PCSTR pSrc, int nMax=-1) // inline int sscpy(PSTR pDst, PCWSTR pSrc, int nMax=-1); // inline int sscpy(PWSTR pDst, PCWSTR pSrc, int nMax=-1); // inline int sscpy(PWSTR pDst, PCSTR pSrc, int nMax=-1); // // DESCRIPTION: // This function is very much (but not exactly) like strcpy. These // overloads simplify copying one C-style string into another by allowing // the caller to specify two different types of strings if necessary. // // The strings must NOT overlap // // "Character" is expressed in terms of the destination string, not // the source. If no 'nMax' argument is supplied, then the number of // characters copied will be sslen(pSrc). A NULL terminator will // also be added so pDst must actually be big enough to hold nMax+1 // characters. The return value is the number of characters copied, // not including the NULL terminator. // // PARAMETERS: // pSrc - the string to be copied FROM. May be a char based string, an // MBCS string (in Win32 builds) or a wide string (wchar_t). // pSrc - the string to be copied TO. Also may be either MBCS or wide // nMax - the maximum number of characters to be copied into szDest. Note // that this is expressed in whatever a "character" means to pDst. // If pDst is a wchar_t type string than this will be the maximum // number of wchar_ts that my be copied. The pDst string must be // large enough to hold least nMaxChars+1 characters. // If the caller supplies no argument for nMax this is a signal to // the routine to copy all the characters in pSrc, regardless of // how long it is. // // RETURN VALUE: none // ----------------------------------------------------------------------------- template inline int sscpycvt(CT1* pDst, const CT2* pSrc, int nChars) { StdCodeCvt(pDst, pSrc, nChars); pDst[SSMAX(nChars, 0)] = '\0'; return nChars; } template inline int sscpy(CT1* pDst, const CT2* pSrc, int nMax, int nLen) { return sscpycvt(pDst, pSrc, SSMIN(nMax, nLen)); } template inline int sscpy(CT1* pDst, const CT2* pSrc, int nMax) { return sscpycvt(pDst, pSrc, SSMIN(nMax, sslen(pSrc))); } template inline int sscpy(CT1* pDst, const CT2* pSrc) { return sscpycvt(pDst, pSrc, sslen(pSrc)); } template inline int sscpy(CT1* pDst, const std::basic_string& sSrc, int nMax) { return sscpycvt(pDst, sSrc.c_str(), SSMIN(nMax, (int)sSrc.length())); } template inline int sscpy(CT1* pDst, const std::basic_string& sSrc) { return sscpycvt(pDst, sSrc.c_str(), (int)sSrc.length()); } #ifdef SS_INC_COMDEF template inline int sscpy(CT1* pDst, const _bstr_t& bs, int nMax) { return sscpycvt(pDst, static_cast(bs), SSMIN(nMax, (int)bs.length())); } template inline int sscpy(CT1* pDst, const _bstr_t& bs) { return sscpy(pDst, bs, bs.length()); } #endif // ----------------------------------------------------------------------------- // Functional objects for changing case. They also let you pass locales // ----------------------------------------------------------------------------- #ifdef SS_ANSI template struct SSToUpper : public std::binary_function { inline CT operator()(const CT& t, const std::locale& loc) const { return std::toupper(t, loc); } }; template struct SSToLower : public std::binary_function { inline CT operator()(const CT& t, const std::locale& loc) const { return std::tolower(t, loc); } }; #endif // This struct is used for TrimRight() and TrimLeft() function implementations. //template //struct NotSpace : public std::unary_function //{ // const std::locale& loc; // inline NotSpace(const std::locale& locArg) : loc(locArg) {} // inline bool operator() (CT t) { return !std::isspace(t, loc); } //}; template struct NotSpace : public std::unary_function { const std::locale& loc; NotSpace(const std::locale& locArg) : loc(locArg) {} // DINKUMWARE BUG: // Note -- using std::isspace in a COM DLL gives us access violations // because it causes the dynamic addition of a function to be called // when the library shuts down. Unfortunately the list is maintained // in DLL memory but the function is in static memory. So the COM DLL // goes away along with the function that was supposed to be called, // and then later when the DLL CRT shuts down it unloads the list and // tries to call the long-gone function. // This is DinkumWare's implementation problem. Until then, we will // use good old isspace and iswspace from the CRT unless they // specify SS_ANSI #ifdef SS_ANSI bool operator() (CT t) const { return !std::isspace(t, loc); } #else bool ssisp(char c) const { return FALSE != ::isspace((int) c); } bool ssisp(wchar_t c) const { return FALSE != ::iswspace((wint_t) c); } bool operator()(CT t) const { return !ssisp(t); } #endif }; // Now we can define the template (finally!) // ============================================================================= // TEMPLATE: CStdStr // template class CStdStr : public std::basic_string // // REMARKS: // This template derives from basic_string and adds some MFC CString- // like functionality // // Basically, this is my attempt to make Standard C++ library strings as // easy to use as the MFC CString class. // // Note that although this is a template, it makes the assumption that the // template argument (CT, the character type) is either char or wchar_t. // ============================================================================= //#define CStdStr _SS // avoid compiler warning 4786 template class CStdStr : public std::basic_string { // Typedefs for shorter names. Using these names also appears to help // us avoid some ambiguities that otherwise arise on some platforms typedef typename std::basic_string MYBASE; // my base class typedef CStdStr MYTYPE; // myself typedef typename MYBASE::const_pointer PCMYSTR; // PCSTR or PCWSTR typedef typename MYBASE::pointer PMYSTR; // PSTR or PWSTR typedef typename MYBASE::iterator MYITER; // my iterator type typedef typename MYBASE::const_iterator MYCITER; // you get the idea... typedef typename MYBASE::reverse_iterator MYRITER; typedef typename MYBASE::size_type MYSIZE; typedef typename MYBASE::value_type MYVAL; typedef typename MYBASE::allocator_type MYALLOC; public: // shorthand conversion from PCTSTR to string resource ID #define _TRES(pctstr) (LOWORD((DWORD)(pctstr))) // CStdStr inline constructors CStdStr() { } CStdStr(const MYTYPE& str) : MYBASE(SSREF(str)) { } CStdStr(const std::string& str) { ssasn(*this, SSREF(str)); } CStdStr(const std::wstring& str) { ssasn(*this, SSREF(str)); } CStdStr(PCMYSTR pT, MYSIZE n) : MYBASE(pT, n) { } CStdStr(PCSTR pA) { #ifdef SS_ANSI *this = pA; #else if ( 0 != HIWORD(pA) ) *this = pA; else if ( 0 != pA && !Load(_TRES(pA)) ) TRACE(_T("Can't load string %u\n"), _TRES(pA)); #endif } CStdStr(PCWSTR pW) { #ifdef SS_ANSI *this = pW; #else if ( 0 != HIWORD(pW) ) *this = pW; else if ( 0 != pW && !Load(_TRES(pW)) ) TRACE(_T("Can't load string %u\n"), _TRES(pW)); #endif } CStdStr(MYCITER first, MYCITER last) : MYBASE(first, last) { } CStdStr(MYSIZE nSize, MYVAL ch, const MYALLOC& al=MYALLOC()) : MYBASE(nSize, ch, al) { } #ifdef SS_INC_COMDEF CStdStr(const _bstr_t& bstr) { if ( bstr.length() > 0 ) append(static_cast(bstr), bstr.length()); } #endif // CStdStr inline assignment operators -- the ssasn function now takes care // of fixing the MSVC assignment bug (see knowledge base article Q172398). MYTYPE& operator=(const MYTYPE& str) { ssasn(*this, str); return *this; } MYTYPE& operator=(const std::string& str) { ssasn(*this, str); return *this; } MYTYPE& operator=(const std::wstring& str) { ssasn(*this, str); return *this; } MYTYPE& operator=(PCSTR pA) { ssasn(*this, pA); return *this; } MYTYPE& operator=(PCWSTR pW) { ssasn(*this, pW); return *this; } MYTYPE& operator=(CT t) { Q172398(*this); MYBASE::assign(1, t); return *this; } #ifdef SS_INC_COMDEF MYTYPE& operator=(const _bstr_t& bstr) { if ( bstr.length() > 0 ) return assign(static_cast(bstr), bstr.length()); else { erase(); return *this; } } #endif // Overloads also needed to fix the MSVC assignment bug (KB: Q172398) // *** Thanks to Pete The Plumber for catching this one *** // They also are compiled if you have explicitly turned off refcounting #if ( defined(_MSC_VER) && ( _MSC_VER < 1200 ) ) || defined(SS_NO_REFCOUNT) MYTYPE& assign(const MYTYPE& str) { ssasn(*this, str); return *this; } MYTYPE& assign(const MYTYPE& str, MYSIZE nStart, MYSIZE nChars) { // This overload of basic_string::assign is supposed to assign up to // or the NULL terminator, whichever comes first. Since we // are about to call a less forgiving overload (in which // must be a valid length), we must adjust the length here to a safe // value. Thanks to Ullrich Pollähne for catching this bug nChars = SSMIN(nChars, str.length() - nStart); // Watch out for assignment to self if ( this == &str ) { MYTYPE strTemp(str.c_str()+nStart, nChars); assign(strTemp); } else { Q172398(*this); MYBASE::assign(str.c_str()+nStart, nChars); } return *this; } MYTYPE& assign(const MYBASE& str) { ssasn(*this, str); return *this; } MYTYPE& assign(const MYBASE& str, MYSIZE nStart, MYSIZE nChars) { // This overload of basic_string::assign is supposed to assign up to // or the NULL terminator, whichever comes first. Since we // are about to call a less forgiving overload (in which // must be a valid length), we must adjust the length here to a safe // value. Thanks to Ullrich Pollähne for catching this bug nChars = SSMIN(nChars, str.length() - nStart); // Watch out for assignment to self if ( this == &str ) // watch out for assignment to self { MYTYPE strTemp(str.c_str() + nStart, nChars); assign(strTemp); } else { Q172398(*this); MYBASE::assign(str.c_str()+nStart, nChars); } return *this; } MYTYPE& assign(const CT* pC, MYSIZE nChars) { // Q172398 only fix -- erase before assigning, but not if we're // assigning from our own buffer #if defined ( _MSC_VER ) && ( _MSC_VER < 1200 ) if ( !empty() && ( pC < data() || pC > data() + capacity() ) ) erase(); #endif Q172398(*this); MYBASE::assign(pC, nChars); return *this; } MYTYPE& assign(MYSIZE nChars, MYVAL val) { Q172398(*this); MYBASE::assign(nChars, val); return *this; } MYTYPE& assign(const CT* pT) { return assign(pT, CStdStr::traits_type::length(pT)); } MYTYPE& assign(MYCITER iterFirst, MYCITER iterLast) { #if defined ( _MSC_VER ) && ( _MSC_VER < 1200 ) // Q172398 fix. don't call erase() if we're assigning from ourself if ( iterFirst < begin() || iterFirst > begin() + size() ) erase() #endif replace(begin(), end(), iterFirst, iterLast); return *this; } #endif // ------------------------------------------------------------------------- // CStdStr inline concatenation. // ------------------------------------------------------------------------- MYTYPE& operator+=(const MYTYPE& str) { ssadd(*this, str); return *this; } MYTYPE& operator+=(const std::string& str) { ssadd(*this, str); return *this; } MYTYPE& operator+=(const std::wstring& str) { ssadd(*this, str); return *this; } MYTYPE& operator+=(PCSTR pA) { ssadd(*this, pA); return *this; } MYTYPE& operator+=(PCWSTR pW) { ssadd(*this, pW); return *this; } MYTYPE& operator+=(CT t) { append(1, t); return *this; } #ifdef SS_INC_COMDEF // if we have _bstr_t, define a += for it too. MYTYPE& operator+=(const _bstr_t& bstr) { return operator+=(static_cast(bstr)); } #endif // addition operators -- global friend functions. friend MYTYPE operator+(const MYTYPE& str1, const MYTYPE& str2); friend MYTYPE operator+(const MYTYPE& str, CT t); friend MYTYPE operator+(const MYTYPE& str, PCSTR sz); friend MYTYPE operator+(const MYTYPE& str, PCWSTR sz); friend MYTYPE operator+(PCSTR pA, const MYTYPE& str); friend MYTYPE operator+(PCWSTR pW, const MYTYPE& str); #ifdef SS_INC_COMDEF friend MYTYPE operator+(const _bstr_t& bstr, const MYTYPE& str); friend MYTYPE operator+(const MYTYPE& str, const _bstr_t& bstr); #endif // ------------------------------------------------------------------------- // Case changing functions // ------------------------------------------------------------------------- // ------------------------------------------------------------------------- MYTYPE& ToUpper() { // Strictly speaking, this would be about the most portable way // std::transform(begin(), // end(), // begin(), // std::bind2nd(SSToUpper(), std::locale())); // But practically speaking, this works faster if ( !empty() ) ssupr(GetBuf(), size()); return *this; } MYTYPE& ToLower() { // Strictly speaking, this would be about the most portable way // std::transform(begin(), // end(), // begin(), // std::bind2nd(SSToLower(), std::locale())); // But practically speaking, this works faster if ( !empty() ) sslwr(GetBuf(), size()); return *this; } MYTYPE& Normalize() { return Trim().ToLower(); } // ------------------------------------------------------------------------- // CStdStr -- Direct access to character buffer. In the MS' implementation, // the at() function that we use here also calls _Freeze() providing us some // protection from multithreading problems associated with ref-counting. // ------------------------------------------------------------------------- CT* GetBuf(int nMinLen=-1) { if ( static_cast(size()) < nMinLen ) resize(static_cast(nMinLen)); return empty() ? const_cast(data()) : &(at(0)); } CT* SetBuf(int nLen) { nLen = ( nLen > 0 ? nLen : 0 ); if ( capacity() < 1 && nLen == 0 ) resize(1); resize(static_cast(nLen)); return const_cast(data()); } void RelBuf(int nNewLen=-1) { resize(static_cast(nNewLen > -1 ? nNewLen : sslen(c_str()))); } void BufferRel() { RelBuf(); } // backwards compatability CT* Buffer() { return GetBuf(); } // backwards compatability CT* BufferSet(int nLen) { return SetBuf(nLen);}// backwards compatability bool Equals(const CT* pT, bool bUseCase=false) const { // get copy, THEN compare (thread safe) return bUseCase ? compare(pT) == 0 : ssicmp(MYTYPE(*this), pT) == 0; } // ------------------------------------------------------------------------- // FUNCTION: CStdStr::Load // REMARKS: // Loads string from resource specified by nID // // PARAMETERS: // nID - resource Identifier. Purely a Win32 thing in this case // // RETURN VALUE: // true if successful, false otherwise // ------------------------------------------------------------------------- #ifndef SS_ANSI bool Load(UINT nId, HMODULE hModule=NULL) { bool bLoaded = false; // set to true of we succeed. #ifdef _MFC_VER // When in Rome... CString strRes; bLoaded = FALSE != strRes.LoadString(nId); if ( bLoaded ) *this = strRes; #else // Get the resource name and module handle if ( NULL == hModule ) hModule = GetResourceHandle(); PCTSTR szName = MAKEINTRESOURCE((nId>>4)+1); // lifted DWORD dwSize = 0; // No sense continuing if we can't find the resource HRSRC hrsrc = ::FindResource(hModule, szName, RT_STRING); if ( NULL == hrsrc ) TRACE(_T("Cannot find resource %d: 0x%X"), nId, ::GetLastError()); else if ( 0 == (dwSize = ::SizeofResource(hModule, hrsrc) / sizeof(CT))) TRACE(_T("Cant get size of resource %d 0x%X\n"),nId,GetLastError()); else { bLoaded = 0 != ssload(hModule, nId, GetBuf(dwSize), dwSize); ReleaseBuffer(); } #endif if ( !bLoaded ) TRACE(_T("String not loaded 0x%X\n"), ::GetLastError()); return bLoaded; } #endif // ------------------------------------------------------------------------- // FUNCTION: CStdStr::Format // void _cdecl Formst(CStdStringA& PCSTR szFormat, ...) // void _cdecl Format(PCSTR szFormat); // // DESCRIPTION: // This function does sprintf/wsprintf style formatting on CStdStringA // objects. It looks a lot like MFC's CString::Format. Some people // might even call this identical. Fortunately, these people are now // dead. // // PARAMETERS: // nId - ID of string resource holding the format string // szFormat - a PCSTR holding the format specifiers // argList - a va_list holding the arguments for the format specifiers. // // RETURN VALUE: None. // ------------------------------------------------------------------------- // formatting (using wsprintf style formatting) #ifndef SS_ANSI void Format(UINT nId, ...) { va_list argList; va_start(argList, nId); va_start(argList, nId); MYTYPE strFmt; if ( strFmt.Load(nId) ) FormatV(strFmt, argList); va_end(argList); } #endif void Format(const CT* szFmt, ...) { va_list argList; va_start(argList, szFmt); FormatV(szFmt, argList); va_end(argList); } void AppendFormat(const CT* szFmt, ...) { va_list argList; va_start(argList, szFmt); AppendFormatV(szFmt, argList); va_end(argList); } #define MAX_FMT_TRIES 5 // #of times we try #define FMT_BLOCK_SIZE 2048 // # of bytes to increment per try #define BUFSIZE_1ST 256 #define BUFSIZE_2ND 512 #define STD_BUF_SIZE 1024 // an efficient way to add formatted characters to the string. You may only // add up to STD_BUF_SIZE characters at a time, though void AppendFormatV(const CT* szFmt, va_list argList) { CT szBuf[STD_BUF_SIZE]; #ifdef SS_ANSI int nLen = ssvsprintf(szBuf, STD_BUF_SIZE-1, szFmt, argList); #else int nLen = ssnprintf(szBuf, STD_BUF_SIZE-1, szFmt, argList); #endif if ( 0 < nLen ) append(szBuf, nLen); } // ------------------------------------------------------------------------- // FUNCTION: FormatV // void FormatV(PCSTR szFormat, va_list, argList); // // DESCRIPTION: // This function formats the string with sprintf style format-specs. // It makes a general guess at required buffer size and then tries // successively larger buffers until it finds one big enough or a // threshold (MAX_FMT_TRIES) is exceeded. // // PARAMETERS: // szFormat - a PCSTR holding the format of the output // argList - a Microsoft specific va_list for variable argument lists // // RETURN VALUE: // ------------------------------------------------------------------------- void FormatV(const CT* szFormat, va_list argList) { #ifdef SS_ANSI int nLen = sslen(szFormat) + STD_BUF_SIZE; ssvsprintf(GetBuffer(nLen), nLen-1, szFormat, argList); ReleaseBuffer(); #else CT* pBuf = NULL; int nChars = 1; int nUsed = 0; size_type nActual = 0; int nTry = 0; do { // Grow more than linearly (e.g. 512, 1536, 3072, etc) nChars += ((nTry+1) * FMT_BLOCK_SIZE); pBuf = reinterpret_cast(_alloca(sizeof(CT)*nChars)); nUsed = ssnprintf(pBuf, nChars-1, szFormat, argList); // Ensure proper NULL termination. nActual = nUsed == -1 ? nChars-1 : SSMIN(nUsed, nChars-1); pBuf[nActual+1]= '\0'; } while ( nUsed < 0 && nTry++ < MAX_FMT_TRIES ); // assign whatever we managed to format assign(pBuf, nActual); #endif } // ------------------------------------------------------------------------- // CString Facade Functions: // // The following methods are intended to allow you to use this class as a // drop-in replacement for CString. // ------------------------------------------------------------------------- #ifndef SS_ANSI BSTR AllocSysString() const { ostring os; ssasn(os, *this); return ::SysAllocString(os.c_str()); } #endif int Collate(PCMYSTR szThat) const { return sscoll(c_str(), length(), szThat, sslen(szThat)); } int CollateNoCase(PCMYSTR szThat) const { return ssicoll(c_str(), length(), szThat, sslen(szThat)); } int Compare(PCMYSTR szThat) const { return MYBASE::compare(szThat); } int CompareNoCase(PCMYSTR szThat) const { return ssicmp(c_str(), szThat); } int Delete(int nIdx, int nCount=1) { if ( nIdx < GetLength() ) erase(static_cast(nIdx), static_cast(nCount)); return GetLength(); } void Empty() { erase(); } int Find(CT ch) const { MYSIZE nIdx = find_first_of(ch); return static_cast(MYBASE::npos == nIdx ? -1 : nIdx); } int Find(PCMYSTR szSub) const { MYSIZE nIdx = find(szSub); return static_cast(MYBASE::npos == nIdx ? -1 : nIdx); } int Find(CT ch, int nStart) const { // CString::Find docs say add 1 to nStart when it's not zero // CString::Find code doesn't do that however. We'll stick // with what the code does MYSIZE nIdx = find_first_of(ch, static_cast(nStart)); return static_cast(MYBASE::npos == nIdx ? -1 : nIdx); } int Find(PCMYSTR szSub, int nStart) const { // CString::Find docs say add 1 to nStart when it's not zero // CString::Find code doesn't do that however. We'll stick // with what the code does MYSIZE nIdx = find(szSub, static_cast(nStart)); return static_cast(MYBASE::npos == nIdx ? -1 : nIdx); } int FindOneOf(PCMYSTR szCharSet) const { MYSIZE nIdx = find_first_of(szCharSet); return static_cast(MYBASE::npos == nIdx ? -1 : nIdx); } #ifndef SS_ANSI void FormatMessage(PCMYSTR szFormat, ...) throw(std::exception) { va_list argList; va_start(argList, szFormat); PMYSTR szTemp; if ( ssfmtmsg(FORMAT_MESSAGE_FROM_STRING|FORMAT_MESSAGE_ALLOCATE_BUFFER, szFormat, 0, 0, reinterpret_cast(&szTemp), 0, &argList) == 0 || szTemp == 0 ) { throw std::runtime_error("out of memory"); } *this = szTemp; LocalFree(szTemp); va_end(argList); } void FormatMessage(UINT nFormatId, ...) throw(std::exception) { MYTYPE sFormat; VERIFY(sFormat.LoadString(nFormatId) != 0); va_list argList; va_start(argList, nFormatId); PMYSTR szTemp; if ( ssfmtmsg(FORMAT_MESSAGE_FROM_STRING|FORMAT_MESSAGE_ALLOCATE_BUFFER, sFormat, 0, 0, reinterpret_cast(&szTemp), 0, &argList) == 0 || szTemp == 0) { throw std::runtime_error("out of memory"); } *this = szTemp; LocalFree(szTemp); va_end(argList); } #endif // ------------------------------------------------------------------------- // GetXXXX -- Direct access to character buffer // ------------------------------------------------------------------------- CT GetAt(int nIdx) const { return at(static_cast(nIdx)); } CT* GetBuffer(int nMinLen=-1) { return GetBuf(nMinLen); } CT* GetBufferSetLength(int nLen) { return BufferSet(nLen); } // GetLength() -- MFC docs say this is the # of BYTES but // in truth it is the number of CHARACTERs (chars or wchar_ts) int GetLength() const { return static_cast(length()); } int Insert(int nIdx, CT ch) { if ( static_cast(nIdx) > size() -1 ) append(1, ch); else insert(static_cast(nIdx), 1, ch); return GetLength(); } int Insert(int nIdx, PCMYSTR sz) { if ( nIdx >= size() ) append(sz, sslen(sz)); else insert(static_cast(nIdx), sz); return GetLength(); } bool IsEmpty() const { return empty(); } MYTYPE Left(int nCount) const { return substr(0, static_cast(nCount)); } #ifndef SS_ANSI bool LoadString(UINT nId) { return this->Load(nId); } #endif void MakeLower() { ToLower(); } void MakeReverse() { std::reverse(begin(), end()); } void MakeUpper() { ToUpper(); } MYTYPE Mid(int nFirst ) const { return substr(static_cast(nFirst)); } MYTYPE Mid(int nFirst, int nCount) const { return substr(static_cast(nFirst), static_cast(nCount)); } void ReleaseBuffer(int nNewLen=-1) { RelBuf(nNewLen); } int Remove(CT ch) { MYSIZE nIdx = 0; int nRemoved = 0; while ( (nIdx=find_first_of(ch)) != MYBASE::npos ) { erase(nIdx, 1); nRemoved++; } return nRemoved; } int Replace(CT chOld, CT chNew) { int nReplaced = 0; for ( MYITER iter=begin(); iter != end(); iter++ ) { if ( *iter == chOld ) { *iter = chNew; nReplaced++; } } return nReplaced; } int Replace(PCMYSTR szOld, PCMYSTR szNew) { int nReplaced = 0; MYSIZE nIdx = 0; MYSIZE nOldLen = sslen(szOld); if ( 0 == nOldLen ) return 0; static const CT ch = CT(0); MYSIZE nNewLen = sslen(szNew); PCMYSTR szRealNew = szNew == 0 ? &ch : szNew; while ( (nIdx=find(szOld, nIdx)) != MYBASE::npos ) { replace(begin()+nIdx, begin()+nIdx+nOldLen, szRealNew); nReplaced++; nIdx += nNewLen; } return nReplaced; } int ReverseFind(CT ch) const { MYSIZE nIdx = find_last_of(ch); return static_cast(MYBASE::npos == nIdx ? -1 : nIdx); } // ReverseFind overload that's not in CString but might be useful int ReverseFind(PCMYSTR szFind, MYSIZE pos=MYBASE::npos) const { MYSIZE nIdx = rfind(0 == szFind ? MYTYPE() : szFind, pos); return static_cast(MYBASE::npos == nIdx ? -1 : nIdx); } MYTYPE Right(int nCount) const { nCount = SSMIN(nCount, static_cast(size())); return substr(size()-static_cast(nCount)); } void SetAt(int nIndex, CT ch) { ASSERT(size() > static_cast(nIndex)); at(static_cast(nIndex)) = ch; } #ifndef SS_ANSI BSTR SetSysString(BSTR* pbstr) const { ostring os; ssasn(os, *this); if ( !::SysReAllocStringLen(pbstr, os.c_str(), os.length()) ) throw std::runtime_error("out of memory"); ASSERT(*pbstr != 0); return *pbstr; } #endif MYTYPE SpanExcluding(PCMYSTR szCharSet) const { return Left(find_first_of(szCharSet)); } MYTYPE SpanIncluding(PCMYSTR szCharSet) const { return Left(find_first_not_of(szCharSet)); } #if !defined(UNICODE) && !defined(SS_ANSI) // CString's OemToAnsi and AnsiToOem functions are available only in // Unicode builds. However since we're a template we also need a // runtime check of CT and a reinterpret_cast to account for the fact // that CStdStringW gets instantiated even in non-Unicode builds. void AnsiToOem() { if ( sizeof(CT) == sizeof(char) && !empty() ) { ::CharToOem(reinterpret_cast(c_str()), reinterpret_cast(GetBuf())); } else { ASSERT(false); } } void OemToAnsi() { if ( sizeof(CT) == sizeof(char) && !empty() ) { ::OemToChar(reinterpret_cast(c_str()), reinterpret_cast(GetBuf())); } else { ASSERT(false); } } #endif // ------------------------------------------------------------------------- // Trim and its variants // ------------------------------------------------------------------------- MYTYPE& Trim() { return TrimLeft().TrimRight(); } MYTYPE& TrimLeft() { erase(begin(), std::find_if(begin(),end(),NotSpace(std::locale()))); return *this; } MYTYPE& TrimLeft(CT tTrim) { erase(0, find_first_not_of(tTrim)); return *this; } MYTYPE& TrimLeft(PCMYSTR szTrimChars) { erase(0, find_first_not_of(szTrimChars)); return *this; } MYTYPE& TrimRight() { std::locale loc; MYRITER it = std::find_if(rbegin(), rend(), NotSpace(loc)); if ( rend() != it ) erase(rend() - it); erase(it != rend() ? find_last_of(*it) + 1 : 0); return *this; } MYTYPE& TrimRight(CT tTrim) { MYSIZE nIdx = find_last_not_of(tTrim); erase(MYBASE::npos == nIdx ? 0 : ++nIdx); return *this; } MYTYPE& TrimRight(PCMYSTR szTrimChars) { MYSIZE nIdx = find_last_not_of(szTrimChars); erase(MYBASE::npos == nIdx ? 0 : ++nIdx); return *this; } void FreeExtra() { MYTYPE mt; swap(mt); if ( !mt.empty() ) assign(mt.c_str(), mt.size()); } // I have intentionally not implemented the following CString // functions. You cannot make them work without taking advantage // of implementation specific behavior. However if you absolutely // MUST have them, uncomment out these lines for "sort-of-like" // their behavior. You're on your own. // CT* LockBuffer() { return GetBuf(); }// won't really lock // void UnlockBuffer(); { } // why have UnlockBuffer w/o LockBuffer? // Array-indexing operators. Required because we defined an implicit cast // to operator const CT* (Thanks to Julian Selman for pointing this out) CT& operator[](int nIdx) { return MYBASE::operator[](static_cast(nIdx)); } const CT& operator[](int nIdx) const { return MYBASE::operator[](static_cast(nIdx)); } CT& operator[](unsigned int nIdx) { return MYBASE::operator[](static_cast(nIdx)); } const CT& operator[](unsigned int nIdx) const { return MYBASE::operator[](static_cast(nIdx)); } operator const CT*() const { return c_str(); } // IStream related functions. Useful in IPersistStream implementations #ifdef SS_INC_COMDEF // struct SSSHDR - useful for non Std C++ persistence schemes. typedef struct SSSHDR { BYTE byCtrl; ULONG nChars; } SSSHDR; // as in "Standard String Stream Header" #define SSSO_UNICODE 0x01 // the string is a wide string #define SSSO_COMPRESS 0x02 // the string is compressed // ------------------------------------------------------------------------- // FUNCTION: StreamSize // REMARKS: // Returns how many bytes it will take to StreamSave() this CStdString // object to an IStream. // ------------------------------------------------------------------------- ULONG StreamSize() const { // Control header plus string ASSERT(size()*sizeof(CT) < 0xffffffffUL - sizeof(SSSHDR)); return (size() * sizeof(CT)) + sizeof(SSSHDR); } // ------------------------------------------------------------------------- // FUNCTION: StreamSave // REMARKS: // Saves this CStdString object to a COM IStream. // ------------------------------------------------------------------------- HRESULT StreamSave(IStream* pStream) const { ASSERT(size()*sizeof(CT) < 0xffffffffUL - sizeof(SSSHDR)); HRESULT hr = E_FAIL; ASSERT(pStream != 0); SSSHDR hdr; hdr.byCtrl = sizeof(CT) == 2 ? SSSO_UNICODE : 0; hdr.nChars = size(); if ( FAILED(hr=pStream->Write(&hdr, sizeof(SSSHDR), 0)) ) TRACE(_T("StreamSave: Cannot write control header, ERR=0x%X\n"),hr); else if ( empty() ) ; // nothing to write else if ( FAILED(hr=pStream->Write(c_str(), size()*sizeof(CT), 0)) ) TRACE(_T("StreamSave: Cannot write string to stream 0x%X\n"), hr); return hr; } // ------------------------------------------------------------------------- // FUNCTION: StreamLoad // REMARKS: // This method loads the object from an IStream. // ------------------------------------------------------------------------- HRESULT StreamLoad(IStream* pStream) { ASSERT(pStream != 0); SSSHDR hdr; HRESULT hr = E_FAIL; if ( FAILED(hr=pStream->Read(&hdr, sizeof(SSSHDR), 0)) ) { TRACE(_T("StreamLoad: Cant read control header, ERR=0x%X\n"), hr); } else if ( hdr.nChars > 0 ) { ULONG nRead = 0; PMYSTR pMyBuf = BufferSet(hdr.nChars); // If our character size matches the character size of the string // we're trying to read, then we can read it directly into our // buffer. Otherwise, we have to read into an intermediate buffer // and convert. if ( (hdr.byCtrl & SSSO_UNICODE) != 0 ) { ULONG nBytes = hdr.nChars * sizeof(wchar_t); if ( sizeof(CT) == sizeof(wchar_t) ) { if ( FAILED(hr=pStream->Read(pMyBuf, nBytes, &nRead)) ) TRACE(_T("StreamLoad: Cannot read string: 0x%X\n"), hr); } else { PWSTR pBufW = reinterpret_cast(_alloca((nBytes)+1)); if ( FAILED(hr=pStream->Read(pBufW, nBytes, &nRead)) ) TRACE(_T("StreamLoad: Cannot read string: 0x%X\n"), hr); else sscpy(pMyBuf, pBufW, hdr.nChars); } } else { ULONG nBytes = hdr.nChars * sizeof(char); if ( sizeof(CT) == sizeof(char) ) { if ( FAILED(hr=pStream->Read(pMyBuf, nBytes, &nRead)) ) TRACE(_T("StreamLoad: Cannot read string: 0x%X\n"), hr); } else { PSTR pBufA = reinterpret_cast(_alloca(nBytes)); if ( FAILED(hr=pStream->Read(pBufA, hdr.nChars, &nRead)) ) TRACE(_T("StreamLoad: Cannot read string: 0x%X\n"), hr); else sscpy(pMyBuf, pBufA, hdr.nChars); } } } else { this->erase(); } return hr; } #endif // #ifdef SS_INC_COMDEF #ifndef SS_ANSI // SetResourceHandle/GetResourceHandle. In MFC builds, these map directly // to AfxSetResourceHandle and AfxGetResourceHandle. In non-MFC builds they // point to a single static HINST so that those who call the member // functions that take resource IDs can provide an alternate HINST of a DLL // to search. This is not exactly the list of HMODULES that MFC provides // but it's better than nothing. #ifdef _MFC_VER static void SetResourceHandle(HMODULE hNew) { AfxSetResourceHandle(hNew); } static HMODULE GetResourceHandle() { return AfxGetResourceHandle(); } #else static void SetResourceHandle(HMODULE hNew) { SSResourceHandle() = hNew; } static HMODULE GetResourceHandle() { return SSResourceHandle(); } #endif #endif }; // ----------------------------------------------------------------------------- // CStdStr friend addition functions defined as inline // ----------------------------------------------------------------------------- template inline CStdStr operator+(const CStdStr& str1, const CStdStr& str2) { CStdStr strRet(SSREF(str1)); strRet.append(str2); return strRet; } template inline CStdStr operator+(const CStdStr& str, CT t) { // this particular overload is needed for disabling reference counting // though it's only an issue from line 1 to line 2 CStdStr strRet(SSREF(str)); // 1 strRet.append(1, t); // 2 return strRet; } template inline CStdStr operator+(const CStdStr& str, PCSTR pA) { return CStdStr(str) + CStdStr(pA); } template inline CStdStr operator+(PCSTR pA, const CStdStr& str) { CStdStr strRet(pA); strRet.append(str); return strRet; } template inline CStdStr operator+(const CStdStr& str, PCWSTR pW) { return CStdStr(SSREF(str)) + CStdStr(pW); } template inline CStdStr operator+(PCWSTR pW, const CStdStr& str) { CStdStr strRet(pW); strRet.append(str); return strRet; } #ifdef SS_INC_COMDEF template inline CStdStr operator+(const _bstr_t& bstr, const CStdStr& str) { return static_cast(bstr) + str; } template inline CStdStr operator+(const CStdStr& str, const _bstr_t& bstr) { return str + static_cast(bstr); } #endif // ----------------------------------------------------------------------------- // These versions of operator+ provided by Scott Hathaway in order to allow // CStdString to build on Sun Unix systems. // ----------------------------------------------------------------------------- #if defined(__SUNPRO_CC_COMPAT) || defined(__SUNPRO_CC) // Made non-template versions due to "undefined" errors on Sun Forte compiler // when linking with friend template functions inline CStdStr operator+(const CStdStr& str1, const CStdStr& str2) { CStdStr strRet(SSREF(str1)); strRet.append(str2); return strRet; } inline CStdStr operator+(const CStdStr& str, wchar_t t) { // this particular overload is needed for disabling reference counting // though it's only an issue from line 1 to line 2 CStdStr strRet(SSREF(str)); // 1 strRet.append(1, t); // 2 return strRet; } inline CStdStr operator+(const CStdStr& str, PCWSTR pW) { return CStdStr(str) + CStdStr(pW); } inline CStdStr operator+(PCWSTR pA, const CStdStr& str) { CStdStr strRet(pA); strRet.append(str); return strRet; } inline CStdStr operator+(const CStdStr& str, PCSTR pW) { return CStdStr(SSREF(str)) + CStdStr(pW); } inline CStdStr operator+(PCSTR pW, const CStdStr& str) { CStdStr strRet(pW); strRet.append(str); return strRet; } inline CStdStr operator+(const CStdStr& str1, const CStdStr& str2) { CStdStr strRet(SSREF(str1)); strRet.append(str2); return strRet; } inline CStdStr operator+(const CStdStr& str, char t) { // this particular overload is needed for disabling reference counting // though it's only an issue from line 1 to line 2 CStdStr strRet(SSREF(str)); // 1 strRet.append(1, t); // 2 return strRet; } inline CStdStr operator+(const CStdStr& str, PCSTR pA) { return CStdStr(str) + CStdStr(pA); } inline CStdStr operator+(PCSTR pA, const CStdStr& str) { CStdStr strRet(pA); strRet.append(str); return strRet; } inline CStdStr operator+(const CStdStr& str, PCWSTR pW) { return CStdStr(SSREF(str)) + CStdStr(pW); } inline CStdStr operator+(PCWSTR pW, const CStdStr& str) { CStdStr strRet(pW); strRet.append(str); return strRet; } #endif // defined(__SUNPRO_CC_COMPAT) || defined(__SUNPRO_CC) // ============================================================================= // END OF CStdStr INLINE FUNCTION DEFINITIONS // ============================================================================= // Now typedef our class names based upon this humongous template typedef CStdStr CStdStringA; // a better std::string typedef CStdStr CStdStringW; // a better std::wstring typedef CStdStr CStdStringO; // almost always CStdStringW #ifndef SS_ANSI // SSResourceHandle: our MFC-like resource handle inline HMODULE& SSResourceHandle() { static HMODULE hModuleSS = GetModuleHandle(0); return hModuleSS; } #endif // In MFC builds, define some global serialization operators // Special operators that allow us to serialize CStdStrings to CArchives. // Note that we use an intermediate CString object in order to ensure that // we use the exact same format. #ifdef _MFC_VER inline CArchive& AFXAPI operator<<(CArchive& ar, const CStdStringA& strA) { CString strTemp = strA; return ar << strTemp; } inline CArchive& AFXAPI operator<<(CArchive& ar, const CStdStringW& strW) { CString strTemp = strW; return ar << strTemp; } inline CArchive& AFXAPI operator>>(CArchive& ar, CStdStringA& strA) { CString strTemp; ar >> strTemp; strA = strTemp; return ar; } inline CArchive& AFXAPI operator>>(CArchive& ar, CStdStringW& strW) { CString strTemp; ar >> strTemp; strW = strTemp; return ar; } #endif // #ifdef _MFC_VER -- (i.e. is this MFC?) // ----------------------------------------------------------------------------- // HOW TO EXPORT CSTDSTRING FROM A DLL // // If you want to export CStdStringA and CStdStringW from a DLL, then all you // need to // 1. make sure that all components link to the same DLL version // of the CRT (not the static one). // 2. Uncomment the 3 lines of code below // 3. #define 2 macros per the instructions in MS KnowledgeBase // article Q168958. The macros are: // // MACRO DEFINTION WHEN EXPORTING DEFINITION WHEN IMPORTING // ----- ------------------------ ------------------------- // SSDLLEXP (nothing, just #define it) extern // SSDLLSPEC __declspec(dllexport) __declspec(dllimport) // // Note that these macros must be available to ALL clients who want to // link to the DLL and use the class. If they // ----------------------------------------------------------------------------- //#pragma warning(disable:4231) // non-standard extension ("extern template") // SSDLLEXP template class SSDLLSPEC CStdStr; // SSDLLEXP template class SSDLLSPEC CStdStr; // ----------------------------------------------------------------------------- // GLOBAL FUNCTION: WUFormat // CStdStringA WUFormat(UINT nId, ...); // CStdStringA WUFormat(PCSTR szFormat, ...); // // REMARKS: // This function allows the caller for format and return a CStdStringA // object with a single line of code. // ----------------------------------------------------------------------------- #ifdef SS_ANSI #else inline CStdStringA WUFormatA(UINT nId, ...) { va_list argList; va_start(argList, nId); CStdStringA strFmt; CStdStringA strOut; if ( strFmt.Load(nId) ) strOut.FormatV(strFmt, argList); va_end(argList); return strOut; } inline CStdStringA WUFormatA(PCSTR szFormat, ...) { va_list argList; va_start(argList, szFormat); CStdStringA strOut; strOut.FormatV(szFormat, argList); va_end(argList); return strOut; } inline CStdStringW WUFormatW(UINT nId, ...) { va_list argList; va_start(argList, nId); CStdStringW strFmt; CStdStringW strOut; if ( strFmt.Load(nId) ) strOut.FormatV(strFmt, argList); va_end(argList); return strOut; } inline CStdStringW WUFormatW(PCWSTR szwFormat, ...) { va_list argList; va_start(argList, szwFormat); CStdStringW strOut; strOut.FormatV(szwFormat, argList); va_end(argList); return strOut; } #endif // #ifdef SS_ANSI #ifdef SS_ANSI #else // ------------------------------------------------------------------------- // FUNCTION: WUSysMessage // CStdStringA WUSysMessageA(DWORD dwError, DWORD dwLangId=SS_DEFLANGID); // CStdStringW WUSysMessageW(DWORD dwError, DWORD dwLangId=SS_DEFLANGID); // // DESCRIPTION: // This function simplifies the process of obtaining a string equivalent // of a system error code returned from GetLastError(). You simply // supply the value returned by GetLastError() to this function and the // corresponding system string is returned in the form of a CStdStringA. // // PARAMETERS: // dwError - a DWORD value representing the error code to be translated // dwLangId - the language id to use. defaults to english. // // RETURN VALUE: // a CStdStringA equivalent of the error code. Currently, this function // only returns either English of the system default language strings. // ------------------------------------------------------------------------- #define SS_DEFLANGID MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT) inline CStdStringA WUSysMessageA(DWORD dwError, DWORD dwLangId=SS_DEFLANGID) { CHAR szBuf[512]; if ( 0 != ::FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwError, dwLangId, szBuf, 511, NULL) ) return WUFormatA("%s (0x%X)", szBuf, dwError); else return WUFormatA("Unknown error (0x%X)", dwError); } inline CStdStringW WUSysMessageW(DWORD dwError, DWORD dwLangId=SS_DEFLANGID) { WCHAR szBuf[512]; if ( 0 != ::FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwError, dwLangId, szBuf, 511, NULL) ) return WUFormatW(L"%s (0x%X)", szBuf, dwError); else return WUFormatW(L"Unknown error (0x%X)", dwError); } #endif // Define TCHAR based friendly names for some of these functions #ifdef UNICODE #define CStdString CStdStringW #define WUSysMessage WUSysMessageW #define WUFormat WUFormatW #else #define CStdString CStdStringA #define WUSysMessage WUSysMessageA #define WUFormat WUFormatA #endif // ...and some shorter names for the space-efficient #define WUSysMsg WUSysMessage #define WUSysMsgA WUSysMessageA #define WUSysMsgW WUSysMessageW #define WUFmtA WUFormatA #define WUFmtW WUFormatW #define WUFmt WUFormat #define WULastErrMsg() WUSysMessage(::GetLastError()) #define WULastErrMsgA() WUSysMessageA(::GetLastError()) #define WULastErrMsgW() WUSysMessageW(::GetLastError()) // ----------------------------------------------------------------------------- // FUNCTIONAL COMPARATORS: // REMARKS: // These structs are derived from the std::binary_function template. They // give us functional classes (which may be used in Standard C++ Library // collections and algorithms) that perform case-insensitive comparisons of // CStdString objects. This is useful for maps in which the key may be the // proper string but in the wrong case. // ----------------------------------------------------------------------------- #define StdStringLessNoCaseW SSLNCW // avoid VC compiler warning 4786 #define StdStringEqualsNoCaseW SSENCW #define StdStringLessNoCaseA SSLNCA #define StdStringEqualsNoCaseA SSENCA #ifdef UNICODE #define StdStringLessNoCase SSLNCW #define StdStringEqualsNoCase SSENCW #else #define StdStringLessNoCase SSLNCA #define StdStringEqualsNoCase SSENCA #endif struct StdStringLessNoCaseW : std::binary_function { inline bool operator()(const CStdStringW& sLeft, const CStdStringW& sRight) const { return ssicmp(sLeft.c_str(), sRight.c_str()) < 0; } }; struct StdStringEqualsNoCaseW : std::binary_function { inline bool operator()(const CStdStringW& sLeft, const CStdStringW& sRight) const { return ssicmp(sLeft.c_str(), sRight.c_str()) == 0; } }; struct StdStringLessNoCaseA : std::binary_function { inline bool operator()(const CStdStringA& sLeft, const CStdStringA& sRight) const { return ssicmp(sLeft.c_str(), sRight.c_str()) < 0; } }; struct StdStringEqualsNoCaseA : std::binary_function { inline bool operator()(const CStdStringA& sLeft, const CStdStringA& sRight) const { return ssicmp(sLeft.c_str(), sRight.c_str()) == 0; } }; // If we had to define our own version of TRACE above, get rid of it now #ifdef TRACE_DEFINED_HERE #undef TRACE #undef TRACE_DEFINED_HERE #endif #endif // #ifndef STDSTRING_Hjmac-1.74/core/nativesrc/mac/Source/Shared/WAVInfoDialog.h0000644000175000017500000000110510131230056023177 0ustar twernertwerner#ifndef APE_WAVINFODIALOG_H #define APE_WAVINFODIALOG_H BOOL CALLBACK FileInfoDialogProcedureA(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); class CWAVInfoDialog { public: CWAVInfoDialog(); ~CWAVInfoDialog(); long ShowWAVInfoDialog(const str_utf16 * pFilename, HINSTANCE hInstance, const str_utf16 * lpTemplateName, HWND hWndParent); private: static LRESULT CALLBACK DialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); long InitDialog(HWND hDlg); TCHAR m_cFileName[MAX_PATH]; }; #endif // #ifndef APE_WAVINFODIALOG_H jmac-1.74/core/nativesrc/mac/Source/Shared/WinFileIO.h0000644000175000017500000000174610131230056022406 0ustar twernertwerner#ifdef IO_USE_WIN_FILE_IO #ifndef _winfileio_h_ #define _winfileio_h_ #include "IO.h" class CWinFileIO : public CIO { public: // construction / destruction CWinFileIO(); ~CWinFileIO(); // open / close int Open(const wchar_t * pName); int Close(); // read / write int Read(void * pBuffer, unsigned int nBytesToRead, unsigned int * pBytesRead); int Write(const void * pBuffer, unsigned int nBytesToWrite, unsigned int * pBytesWritten); // seek int Seek(int nDistance, unsigned int nMoveMode); // other functions int SetEOF(); // creation / destruction int Create(const wchar_t * pName); int Delete(); // attributes int GetPosition(); int GetSize(); int GetName(wchar_t * pBuffer); private: HANDLE m_hFile; wchar_t m_cFileName[MAX_PATH]; BOOL m_bReadOnly; }; #endif //_winfileio_h_ #endif //IO_USE_WIN_FILE_IOjmac-1.74/core/src/0000755000175000017500000000000010451144641014034 5ustar twernertwernerjmac-1.74/core/src/davaguine/0000755000175000017500000000000010451144641015777 5ustar twernertwernerjmac-1.74/core/src/davaguine/jmac/0000755000175000017500000000000010451144641016711 5ustar twernertwernerjmac-1.74/core/src/davaguine/jmac/core/0000755000175000017500000000000010451144641017641 5ustar twernertwernerjmac-1.74/core/src/davaguine/jmac/core/APESimple.java0000644000175000017500000003413410172455471022276 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.core; import davaguine.jmac.decoder.IAPEDecompress; import davaguine.jmac.encoder.IAPECompress; import davaguine.jmac.info.APEFileInfo; import davaguine.jmac.info.InputSource; import davaguine.jmac.info.WaveFormat; import davaguine.jmac.tools.*; import java.io.IOException; import java.io.RandomAccessFile; /** * Author: Dmitry Vaguine * Date: 11.05.2004 * Time: 16:26:19 */ public class APESimple { public final static int UNMAC_DECODER_OUTPUT_APE = 2; public final static int UNMAC_DECODER_OUTPUT_WAV = 1; public final static int UNMAC_DECODER_OUTPUT_NONE = 0; public final static int BLOCKS_PER_DECODE = 9216; public static void VerifyFile(String pInputFilename, ProgressCallback progressor) throws IOException, JMACSkippedException, JMACStoppedByUserException { // error check the function parameters if (pInputFilename == null) throw new JMACException("Bad Parameters"); // see if we can quick verify File file = File.createFile(pInputFilename, "r"); IAPEDecompress spAPEDecompress = null; try { spAPEDecompress = IAPEDecompress.CreateIAPEDecompress(file); APEFileInfo pInfo = spAPEDecompress.getApeInfoInternalInfo(); if ((pInfo.nVersion < 3980) || (pInfo.spAPEDescriptor == null)) DecompressCore(spAPEDecompress, null, UNMAC_DECODER_OUTPUT_NONE, -1, progressor); else { MD5 MD5Helper = new MD5(); File pIO = spAPEDecompress.getApeInfoIoSource(); int nHead = (int) (pInfo.nJunkHeaderBytes + pInfo.spAPEDescriptor.nDescriptorBytes); int nStart = (int) (nHead + pInfo.spAPEDescriptor.nHeaderBytes + pInfo.spAPEDescriptor.nSeekTableBytes); pIO.seek(nHead); int nHeadBytes = nStart - nHead; byte[] spHeadBuffer = new byte[nHeadBytes]; pIO.readFully(spHeadBuffer); int nBytesLeft = (int) (pInfo.spAPEDescriptor.nHeaderDataBytes + pInfo.spAPEDescriptor.nAPEFrameDataBytes + pInfo.spAPEDescriptor.nTerminatingDataBytes); // create the progress helper ProgressHelper spMACProgressHelper = new ProgressHelper(nBytesLeft / 16384, progressor); byte[] spBuffer = new byte[16384]; int nBytesRead = 1; while ((nBytesLeft > 0) && (nBytesRead > 0)) { int nBytesToRead = Math.min(16384, nBytesLeft); nBytesRead = pIO.read(spBuffer, 0, nBytesToRead); MD5Helper.Update(spBuffer, nBytesRead); nBytesLeft -= nBytesRead; spMACProgressHelper.UpdateProgress(); if (spMACProgressHelper.isKillFlag()) throw new JMACStoppedByUserException(); } if (nBytesLeft != 0) throw new JMACException("The File Is Broken"); MD5Helper.Update(spHeadBuffer, nHeadBytes); // fire the "complete" progress notification spMACProgressHelper.UpdateProgressComplete(); byte[] cResult = MD5Helper.Final(); for (int i = 0; i < 16; i++) if (cResult[i] != pInfo.spAPEDescriptor.cFileMD5[i]) throw new JMACException("Invalid Checksum"); } } finally { file.close(); } } /** * ************************************************************************************** * Convert file * *************************************************************************************** */ public static void ConvertFile(String pInputFilename, String pOutputFilename, int nCompressionLevel, ProgressCallback progressor) throws IOException, JMACSkippedException, JMACStoppedByUserException { DecompressCore(pInputFilename, pOutputFilename, UNMAC_DECODER_OUTPUT_APE, nCompressionLevel, progressor); } /** * ************************************************************************************** * Decompress file * *************************************************************************************** */ public static void DecompressFile(String pInputFilename, String pOutputFilename, ProgressCallback progressor) throws IOException, JMACSkippedException, JMACStoppedByUserException { if (pOutputFilename == null) VerifyFile(pInputFilename, progressor); else DecompressCore(pInputFilename, pOutputFilename, UNMAC_DECODER_OUTPUT_WAV, -1, progressor); } public static void DecompressCore(String pInputFilename, String pOutputFilename, int nOutputMode, int nCompressionLevel, ProgressCallback progressor) throws IOException, JMACSkippedException, JMACStoppedByUserException { // error check the function parameters if (pInputFilename == null) throw new JMACException("Bad Parameters"); // variable declares IAPEDecompress spAPEDecompress = null; File file = File.createFile(pInputFilename, "r"); try { spAPEDecompress = IAPEDecompress.CreateIAPEDecompress(file); DecompressCore(spAPEDecompress, pOutputFilename, nOutputMode, nCompressionLevel, progressor); } finally { file.close(); } } public static void DecompressCore(IAPEDecompress spAPEDecompress, String pOutputFilename, int nOutputMode, int nCompressionLevel, ProgressCallback progressor) throws IOException, JMACSkippedException, JMACStoppedByUserException { // variable declares java.io.RandomAccessFile spioOutput = null; IAPECompress spAPECompress = null; try { // create the core WaveFormat wfeInput = spAPEDecompress.getApeInfoWaveFormatEx(); // allocate space for the header byte[] waveHeaderBuffer = spAPEDecompress.getApeInfoWavHeaderData(spAPEDecompress.getApeInfoWavHeaderBytes()); // initialize the output if (nOutputMode == UNMAC_DECODER_OUTPUT_WAV) { // create the file spioOutput = new RandomAccessFile(pOutputFilename, "rw"); // output the header spioOutput.write(waveHeaderBuffer); } else if (nOutputMode == UNMAC_DECODER_OUTPUT_APE) { // quit if there is nothing to do if (spAPEDecompress.getApeInfoFileVersion() == Globals.MAC_VERSION_NUMBER && spAPEDecompress.getApeInfoCompressionLevel() == nCompressionLevel) throw new JMACSkippedException(); // create and start the compressor spAPECompress = IAPECompress.CreateIAPECompress(); spAPECompress.Start(pOutputFilename, wfeInput, spAPEDecompress.getApeInfoDecompressTotalBlocks() * spAPEDecompress.getApeInfoBlockAlign(), nCompressionLevel, waveHeaderBuffer, spAPEDecompress.getApeInfoWavHeaderBytes()); } int blockAlign = spAPEDecompress.getApeInfoBlockAlign(); // allocate space for decompression byte[] spTempBuffer = new byte[blockAlign * BLOCKS_PER_DECODE]; int nBlocksLeft = spAPEDecompress.getApeInfoDecompressTotalBlocks(); // create the progress helper ProgressHelper spMACProgressHelper = new ProgressHelper(nBlocksLeft / BLOCKS_PER_DECODE, progressor); // main decoding loop while (nBlocksLeft > 0) { // decode data int nBlocksDecoded = spAPEDecompress.GetData(spTempBuffer, BLOCKS_PER_DECODE); // handle the output if (nOutputMode == UNMAC_DECODER_OUTPUT_WAV) spioOutput.write(spTempBuffer, 0, nBlocksDecoded * blockAlign); else if (nOutputMode == UNMAC_DECODER_OUTPUT_APE) spAPECompress.AddData(spTempBuffer, nBlocksDecoded * spAPEDecompress.getApeInfoBlockAlign()); // update amount remaining nBlocksLeft -= nBlocksDecoded; // update progress and kill flag spMACProgressHelper.UpdateProgress(); if (spMACProgressHelper.isKillFlag()) throw new JMACStoppedByUserException(); } // terminate the output if (nOutputMode == UNMAC_DECODER_OUTPUT_WAV) { // write any terminating WAV data if (spAPEDecompress.getApeInfoWavTerminatingBytes() > 0) { byte[] termData = spAPEDecompress.getApeInfoWavTerminatingData(spAPEDecompress.getApeInfoWavTerminatingBytes()); int nBytesToWrite = spAPEDecompress.getApeInfoWavTerminatingBytes(); spioOutput.write(termData, 0, nBytesToWrite); } } else if (nOutputMode == UNMAC_DECODER_OUTPUT_APE) { // write the WAV data and any tag int nTagBytes = spAPEDecompress.getApeInfoTag().GetTagBytes(); boolean bHasTag = (nTagBytes > 0); int nTerminatingBytes = nTagBytes; nTerminatingBytes += spAPEDecompress.getApeInfoWavTerminatingBytes(); if (nTerminatingBytes > 0) { spTempBuffer = spAPEDecompress.getApeInfoWavTerminatingData(nTerminatingBytes); if (bHasTag) { spAPEDecompress.getApeInfoIoSource().seek(spAPEDecompress.getApeInfoIoSource().length() - nTagBytes); spAPEDecompress.getApeInfoIoSource().read(spTempBuffer, spAPEDecompress.getApeInfoWavTerminatingBytes(), nTagBytes); } spAPECompress.Finish(spTempBuffer, nTerminatingBytes, spAPEDecompress.getApeInfoWavTerminatingBytes()); } else spAPECompress.Finish(null, 0, 0); } // fire the "complete" progress notification spMACProgressHelper.UpdateProgressComplete(); } finally { if (spioOutput != null) spioOutput.close(); if (spAPECompress != null) spAPECompress.Kill(); } } public static void CompressFile(String pInputFilename, String pOutputFilename, int nCompressionLevel, ProgressCallback progressor) throws IOException, JMACStoppedByUserException { // declare the variables IAPECompress spAPECompress = null; InputSource spInputSource = null; try { byte[] spBuffer = null; WaveFormat WaveFormatEx = new WaveFormat(); // create the input source IntegerPointer nAudioBlocks = new IntegerPointer(); nAudioBlocks.value = 0; IntegerPointer nHeaderBytes = new IntegerPointer(); nHeaderBytes.value = 0; IntegerPointer nTerminatingBytes = new IntegerPointer(); nTerminatingBytes.value = 0; spInputSource = InputSource.CreateInputSource(pInputFilename, WaveFormatEx, nAudioBlocks, nHeaderBytes, nTerminatingBytes); // create the compressor spAPECompress = IAPECompress.CreateIAPECompress(); // figure the audio bytes int nAudioBytes = nAudioBlocks.value * WaveFormatEx.nBlockAlign; // start the encoder if (nHeaderBytes.value > 0) spBuffer = new byte[nHeaderBytes.value]; spInputSource.GetHeaderData(spBuffer); spAPECompress.Start(pOutputFilename, WaveFormatEx, nAudioBytes, nCompressionLevel, spBuffer, nHeaderBytes.value); // set-up the progress ProgressHelper spMACProgressHelper = new ProgressHelper(nAudioBytes, progressor); // master loop int nBytesLeft = nAudioBytes; spMACProgressHelper.UpdateStatus("Process data by compressor"); while (nBytesLeft > 0) { int nBytesAdded = spAPECompress.AddDataFromInputSource(spInputSource, nBytesLeft); nBytesLeft -= nBytesAdded; // update the progress spMACProgressHelper.UpdateProgress(nAudioBytes - nBytesLeft); // process the kill flag if (spMACProgressHelper.isKillFlag()) throw new JMACStoppedByUserException(); } spMACProgressHelper.UpdateStatus("Finishing compression"); // finalize the file if (nTerminatingBytes.value > 0) spBuffer = new byte[nTerminatingBytes.value]; spInputSource.GetTerminatingData(spBuffer); spAPECompress.Finish(spBuffer, nTerminatingBytes.value, nTerminatingBytes.value); // update the progress to 100% spMACProgressHelper.UpdateStatus("Compression finished"); } finally { // kill the compressor if we failed if (spAPECompress != null) spAPECompress.Kill(); if (spInputSource != null) spInputSource.Close(); } } } jmac-1.74/core/src/davaguine/jmac/core/jmacu.java0000644000175000017500000001373710131230056021605 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.core; import davaguine.jmac.info.CompressionLevel; import davaguine.jmac.tools.ProgressCallback; /** * Author: Dmitry Vaguine * Date: 24.05.2004 * Time: 10:50:38 */ public class jmacu extends ProgressCallback { private static long g_nInitialTickCount; public void callback(int persent) { double dProgress = ((double) (pPercentageDone)) / 1000; double dElapsedMS = (System.currentTimeMillis() - g_nInitialTickCount); double dSecondsRemaining = (((dElapsedMS * 100) / dProgress) - dElapsedMS) / 1000; System.out.println("Progress: " + dProgress + " (" + dSecondsRemaining + " seconds remaining)"); } public static void main(String[] args) { try { /////////////////////////////////////////////////////////////////////////////// // error check the command line parameters /////////////////////////////////////////////////////////////////////////////// boolean processed = false; if (args.length >= 2) { if (args[0].equals("d") && args.length == 3) { g_nInitialTickCount = System.currentTimeMillis(); System.out.println("Decompressing '" + args[1] + "'..."); APESimple.DecompressFile(args[1], args[2], new jmacu()); processed = true; } else if (args[0].startsWith("c") && args[0].length() > 1) { int compressionLevel = getCompressionLevel(args[0]); if (compressionLevel > 0) { g_nInitialTickCount = System.currentTimeMillis(); System.out.println("Compressing '" + args[1] + "'..."); // do the verify (call unmac.dll) APESimple.CompressFile(args[1], args[2], compressionLevel, new jmacu()); processed = true; } } else if (args[0].equals("v") && args.length == 2) { g_nInitialTickCount = System.currentTimeMillis(); System.out.println("Verifying '" + args[1] + "'..."); APESimple.VerifyFile(args[1], new jmacu()); processed = true; } else if (args[0].startsWith("t") && args[0].length() > 1) { int compressionLevel = getCompressionLevel(args[0]); if (compressionLevel > 0) { g_nInitialTickCount = System.currentTimeMillis(); System.out.println("Converting '" + args[1] + "'..."); APESimple.ConvertFile(args[1], args[2], compressionLevel, new jmacu()); processed = true; } } } if (!processed) printUsage(); } catch (Exception e) { e.printStackTrace(); } } public static int getCompressionLevel(String command) { int compressionLevel = -1; try { compressionLevel = Integer.parseInt(command.substring(1)); } catch (Exception e) { compressionLevel = -1; } if (compressionLevel > 0 && compressionLevel < 6) { switch (compressionLevel) { case 1: compressionLevel = CompressionLevel.COMPRESSION_LEVEL_FAST; break; case 2: compressionLevel = CompressionLevel.COMPRESSION_LEVEL_NORMAL; break; case 3: compressionLevel = CompressionLevel.COMPRESSION_LEVEL_HIGH; break; case 4: compressionLevel = CompressionLevel.COMPRESSION_LEVEL_EXTRA_HIGH; break; case 5: compressionLevel = CompressionLevel.COMPRESSION_LEVEL_INSANE; break; } } return compressionLevel; } public static void printUsage() { System.out.println("Usage: \n"); System.out.println("Commands:\n"); System.out.println("d - decompress file\n"); System.out.println("cX - compress file"); System.out.println(" X = 1 (Fast compression)"); System.out.println(" X = 2 (Normal compression)"); System.out.println(" X = 3 (High compression)"); System.out.println(" X = 4 (Extra High compression)"); System.out.println(" X = 5 (Insane compression)\n"); System.out.println("v - verify file\n"); System.out.println("tX - convert file"); System.out.println(" X = 1 (Fast compression)"); System.out.println(" X = 2 (Normal compression)"); System.out.println(" X = 3 (High compression)"); System.out.println(" X = 4 (Extra High compression)"); System.out.println(" X = 5 (Insane compression)\n"); } } jmac-1.74/core/src/davaguine/jmac/decoder/0000755000175000017500000000000010451144641020316 5ustar twernertwernerjmac-1.74/core/src/davaguine/jmac/decoder/AntiPredictor.java0000644000175000017500000000700010131230056023714 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.decoder; import davaguine.jmac.info.CompressionLevel; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class AntiPredictor { //construction/destruction public AntiPredictor() { } //functions public void AntiPredict(int[] pInputArray, int[] pOutputArray, int NumberOfElements) { return; } public static AntiPredictor CreateAntiPredictor(int nCompressionLevel, int nVersion) { AntiPredictor pAntiPredictor = null; switch (nCompressionLevel) { case CompressionLevel.COMPRESSION_LEVEL_FAST: if (nVersion < 3320) pAntiPredictor = new AntiPredictorFast0000To3320(); else pAntiPredictor = new AntiPredictorFast3320ToCurrent(); break; case CompressionLevel.COMPRESSION_LEVEL_NORMAL: if (nVersion < 3320) pAntiPredictor = new AntiPredictorNormal0000To3320(); else if (nVersion < 3800) pAntiPredictor = new AntiPredictorNormal3320To3800(); else pAntiPredictor = new AntiPredictorNormal3800ToCurrent(); break; case CompressionLevel.COMPRESSION_LEVEL_HIGH: if (nVersion < 3320) pAntiPredictor = new AntiPredictorHigh0000To3320(); else if (nVersion < 3600) pAntiPredictor = new AntiPredictorHigh3320To3600(); else if (nVersion < 3700) pAntiPredictor = new AntiPredictorHigh3600To3700(); else if (nVersion < 3800) pAntiPredictor = new AntiPredictorHigh3700To3800(); else pAntiPredictor = new AntiPredictorHigh3800ToCurrent(); break; case CompressionLevel.COMPRESSION_LEVEL_EXTRA_HIGH: if (nVersion < 3320) pAntiPredictor = new AntiPredictorExtraHigh0000To3320(); else if (nVersion < 3600) pAntiPredictor = new AntiPredictorExtraHigh3320To3600(); else if (nVersion < 3700) pAntiPredictor = new AntiPredictorExtraHigh3600To3700(); else if (nVersion < 3800) pAntiPredictor = new AntiPredictorExtraHigh3700To3800(); else pAntiPredictor = new AntiPredictorExtraHigh3800ToCurrent(); break; } return pAntiPredictor; } } jmac-1.74/core/src/davaguine/jmac/decoder/AntiPredictorExtraHigh0000To3320.java0000644000175000017500000000473310131230056026645 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.decoder; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class AntiPredictorExtraHigh0000To3320 extends AntiPredictor { public void AntiPredict(int[] pInputArray, int[] pOutputArray, int NumberOfElements, int Iterations, long[] pOffsetValueArrayA, long[] pOffsetValueArrayB) { for (int z = Iterations; z >= 0; z--) { AntiPredictorOffset(pInputArray, pOutputArray, NumberOfElements, (int) pOffsetValueArrayB[z], -1, 64); AntiPredictorOffset(pOutputArray, pInputArray, NumberOfElements, (int) pOffsetValueArrayA[z], 1, 64); } AntiPredictor.AntiPredict(pInputArray, pOutputArray, NumberOfElements); } private AntiPredictorHigh0000To3320 AntiPredictor = new AntiPredictorHigh0000To3320(); protected void AntiPredictorOffset(int[] Input_Array, int[] Output_Array, int Number_of_Elements, int g, int dm, int Max_Order) { int q; if ((g == 0) || (Number_of_Elements <= Max_Order)) { System.arraycopy(Input_Array, 0, Output_Array, 0, Number_of_Elements); return; } System.arraycopy(Input_Array, 0, Output_Array, 0, Max_Order); if (dm > 0) for (q = Max_Order; q < Number_of_Elements; q++) { Output_Array[q] = Input_Array[q] + (Output_Array[q - g] >> 3); } else for (q = Max_Order; q < Number_of_Elements; q++) { Output_Array[q] = Input_Array[q] - (Output_Array[q - g] >> 3); } } } jmac-1.74/core/src/davaguine/jmac/decoder/AntiPredictorExtraHigh3320To3600.java0000644000175000017500000000544710131230056026661 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.decoder; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class AntiPredictorExtraHigh3320To3600 extends AntiPredictor { public void AntiPredict(int[] pInputArray, int[] pOutputArray, int NumberOfElements, int Iterations, long[] pOffsetValueArrayA, long[] pOffsetValueArrayB) { for (int z = Iterations; z >= 0; z--) { AntiPredictorOffset(pInputArray, pOutputArray, NumberOfElements, (int) pOffsetValueArrayB[z], -1, 32); AntiPredictorOffset(pOutputArray, pInputArray, NumberOfElements, (int) pOffsetValueArrayA[z], 1, 32); } AntiPredictor.AntiPredict(pInputArray, pOutputArray, NumberOfElements); } private AntiPredictorHigh0000To3320 AntiPredictor = new AntiPredictorHigh0000To3320(); protected void AntiPredictorOffset(int[] Input_Array, int[] Output_Array, int Number_of_Elements, int g, int dm, int Max_Order) { int q; if ((g == 0) || (Number_of_Elements <= Max_Order)) { System.arraycopy(Input_Array, 0, Output_Array, 0, Number_of_Elements); return; } System.arraycopy(Input_Array, 0, Output_Array, 0, Max_Order); int m = 512; if (dm > 0) for (q = Max_Order; q < Number_of_Elements; q++) { Output_Array[q] = Input_Array[q] + ((Output_Array[q - g] * m) >> 12); if ((Input_Array[q] ^ Output_Array[q - g]) > 0) m += 8; else m -= 8; } else for (q = Max_Order; q < Number_of_Elements; q++) { Output_Array[q] = Input_Array[q] - ((Output_Array[q - g] * m) >> 12); if ((Input_Array[q] ^ Output_Array[q - g]) > 0) m -= 8; else m += 8; } } } jmac-1.74/core/src/davaguine/jmac/decoder/AntiPredictorExtraHigh3600To3700.java0000644000175000017500000000557410131230056026664 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.decoder; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class AntiPredictorExtraHigh3600To3700 extends AntiPredictor { public void AntiPredict(int[] pInputArray, int[] pOutputArray, int NumberOfElements, int Iterations, long[] pOffsetValueArrayA, long[] pOffsetValueArrayB) { for (int z = Iterations; z >= 0;) { AntiPredictorOffset(pInputArray, pOutputArray, NumberOfElements, (int) pOffsetValueArrayA[z], (int) pOffsetValueArrayB[z], 64); z--; if (z >= 0) { AntiPredictorOffset(pOutputArray, pInputArray, NumberOfElements, (int) pOffsetValueArrayA[z], (int) pOffsetValueArrayB[z], 64); z--; } else { System.arraycopy(pOutputArray, 0, pInputArray, 0, NumberOfElements); break; } } AntiPredictor.AntiPredict(pInputArray, pOutputArray, NumberOfElements); } private AntiPredictorHigh3600To3700 AntiPredictor = new AntiPredictorHigh3600To3700(); protected void AntiPredictorOffset(int[] Input_Array, int[] Output_Array, int Number_of_Elements, int g1, int g2, int Max_Order) { int q; if ((g1 == 0) || (g2 == 0) || (Number_of_Elements <= Max_Order)) { System.arraycopy(Input_Array, 0, Output_Array, 0, Number_of_Elements); return; } System.arraycopy(Input_Array, 0, Output_Array, 0, Max_Order); int m = 64; int m2 = 64; for (q = Max_Order; q < Number_of_Elements; q++) { Output_Array[q] = Input_Array[q] + ((Output_Array[q - g1] * m) >> 9) - ((Output_Array[q - g2] * m2) >> 9); if ((Input_Array[q] ^ Output_Array[q - g1]) > 0) m++; else m--; if ((Input_Array[q] ^ Output_Array[q - g2]) > 0) m2--; else m2++; } } } jmac-1.74/core/src/davaguine/jmac/decoder/AntiPredictorExtraHigh3700To3800.java0000644000175000017500000000557410131230056026666 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.decoder; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class AntiPredictorExtraHigh3700To3800 extends AntiPredictor { public void AntiPredict(int[] pInputArray, int[] pOutputArray, int NumberOfElements, int Iterations, long[] pOffsetValueArrayA, long[] pOffsetValueArrayB) { for (int z = Iterations; z >= 0;) { AntiPredictorOffset(pInputArray, pOutputArray, NumberOfElements, (int) pOffsetValueArrayA[z], (int) pOffsetValueArrayB[z], 64); z--; if (z >= 0) { AntiPredictorOffset(pOutputArray, pInputArray, NumberOfElements, (int) pOffsetValueArrayA[z], (int) pOffsetValueArrayB[z], 64); z--; } else { System.arraycopy(pOutputArray, 0, pInputArray, 0, NumberOfElements); break; } } AntiPredictor.AntiPredict(pInputArray, pOutputArray, NumberOfElements); } private AntiPredictorHigh3700To3800 AntiPredictor = new AntiPredictorHigh3700To3800(); protected void AntiPredictorOffset(int[] Input_Array, int[] Output_Array, int Number_of_Elements, int g1, int g2, int Max_Order) { int q; if ((g1 == 0) || (g2 == 0) || (Number_of_Elements <= Max_Order)) { System.arraycopy(Input_Array, 0, Output_Array, 0, Number_of_Elements); return; } System.arraycopy(Input_Array, 0, Output_Array, 0, Max_Order); int m = 64; int m2 = 64; for (q = Max_Order; q < Number_of_Elements; q++) { Output_Array[q] = Input_Array[q] + ((Output_Array[q - g1] * m) >> 9) - ((Output_Array[q - g2] * m2) >> 9); if ((Input_Array[q] ^ Output_Array[q - g1]) > 0) m++; else m--; if ((Input_Array[q] ^ Output_Array[q - g2]) > 0) m2--; else m2++; } } } jmac-1.74/core/src/davaguine/jmac/decoder/AntiPredictorExtraHigh3800ToCurrent.java0000644000175000017500000002212610131230056027707 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.decoder; import java.util.Arrays; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class AntiPredictorExtraHigh3800ToCurrent extends AntiPredictor { private short[] bm = new short[256]; private AntiPredictorExtraHighHelper Helper = new AntiPredictorExtraHighHelper(); private int[] FM = new int[9]; private int[] FP = new int[9]; private short[] IPAdaptFactor = null; private short[] IPShort = null; public void AntiPredict(int[] pInputArray, int[] pOutputArray, int NumberOfElements, int nVersion) { final int nFilterStageElements = (nVersion < 3830) ? 128 : 256; final int nFilterStageShift = (nVersion < 3830) ? 11 : 12; final int nMaxElements = (nVersion < 3830) ? 134 : 262; final int nFirstElement = (nVersion < 3830) ? 128 : 256; final int nStageCShift = (nVersion < 3830) ? 10 : 11; //short frame handling if (NumberOfElements < nMaxElements) { System.arraycopy(pInputArray, 0, pOutputArray, 0, NumberOfElements); return; } //make the first five samples identical in both arrays System.arraycopy(pInputArray, 0, pOutputArray, 0, nFirstElement); //variable declares and initializations Arrays.fill(bm, (short) 0); int m2 = 64, m3 = 115, m4 = 64, m5 = 740, m6 = 0; int p4 = pInputArray[nFirstElement - 1]; int p3 = (pInputArray[nFirstElement - 1] - pInputArray[nFirstElement - 2]) << 1; int p2 = pInputArray[nFirstElement - 1] + ((pInputArray[nFirstElement - 3] - pInputArray[nFirstElement - 2]) << 3); int op = nFirstElement; int ip = nFirstElement; int IPP2 = pInputArray[ip - 2]; int p7 = 2 * pInputArray[ip - 1] - pInputArray[ip - 2]; int opp = pOutputArray[op - 1]; int Original; //undo the initial prediction stuff int q; // loop variable for (q = 1; q < nFirstElement; q++) { pOutputArray[q] += pOutputArray[q - 1]; } //pump the primary loop if (IPAdaptFactor == null || IPAdaptFactor.length < NumberOfElements) IPAdaptFactor = new short[NumberOfElements]; if (IPShort == null || IPShort.length < NumberOfElements) IPShort = new short[NumberOfElements]; for (q = 0; q < nFirstElement; q++) { IPAdaptFactor[q] = (short) (((pInputArray[q] >> 30) & 2) - 1); IPShort[q] = (short) pInputArray[q]; } Arrays.fill(FM, 0); Arrays.fill(FP, 0); for (q = nFirstElement; op < NumberOfElements; op++, ip++, q++) { //CPU load-balancing if (nVersion >= 3830) { int pFP = 8; int pFM = 8; int nDotProduct = 0; FP[0] = pInputArray[ip]; if (FP[0] == 0) { nDotProduct += FP[pFP] * FM[pFM--]; FP[pFP--] = FP[pFP - 1]; nDotProduct += FP[pFP] * FM[pFM--]; FP[pFP--] = FP[pFP - 1]; nDotProduct += FP[pFP] * FM[pFM--]; FP[pFP--] = FP[pFP - 1]; nDotProduct += FP[pFP] * FM[pFM--]; FP[pFP--] = FP[pFP - 1]; nDotProduct += FP[pFP] * FM[pFM--]; FP[pFP--] = FP[pFP - 1]; nDotProduct += FP[pFP] * FM[pFM--]; FP[pFP--] = FP[pFP - 1]; nDotProduct += FP[pFP] * FM[pFM--]; FP[pFP--] = FP[pFP - 1]; nDotProduct += FP[pFP] * FM[pFM--]; FP[pFP--] = FP[pFP - 1]; } else if (FP[0] > 0) { nDotProduct += FP[pFP] * FM[pFM]; FM[pFM--] += ((FP[pFP] >> 30) & 2) - 1; FP[pFP--] = FP[pFP - 1]; nDotProduct += FP[pFP] * FM[pFM]; FM[pFM--] += ((FP[pFP] >> 30) & 2) - 1; FP[pFP--] = FP[pFP - 1]; nDotProduct += FP[pFP] * FM[pFM]; FM[pFM--] += ((FP[pFP] >> 30) & 2) - 1; FP[pFP--] = FP[pFP - 1]; nDotProduct += FP[pFP] * FM[pFM]; FM[pFM--] += ((FP[pFP] >> 30) & 2) - 1; FP[pFP--] = FP[pFP - 1]; nDotProduct += FP[pFP] * FM[pFM]; FM[pFM--] += ((FP[pFP] >> 30) & 2) - 1; FP[pFP--] = FP[pFP - 1]; nDotProduct += FP[pFP] * FM[pFM]; FM[pFM--] += ((FP[pFP] >> 30) & 2) - 1; FP[pFP--] = FP[pFP - 1]; nDotProduct += FP[pFP] * FM[pFM]; FM[pFM--] += ((FP[pFP] >> 30) & 2) - 1; FP[pFP--] = FP[pFP - 1]; nDotProduct += FP[pFP] * FM[pFM]; FM[pFM--] += ((FP[pFP] >> 30) & 2) - 1; FP[pFP--] = FP[pFP - 1]; } else { nDotProduct += FP[pFP] * FM[pFM]; FM[pFM--] -= ((FP[pFP] >> 30) & 2) - 1; FP[pFP--] = FP[pFP - 1]; nDotProduct += FP[pFP] * FM[pFM]; FM[pFM--] -= ((FP[pFP] >> 30) & 2) - 1; FP[pFP--] = FP[pFP - 1]; nDotProduct += FP[pFP] * FM[pFM]; FM[pFM--] -= ((FP[pFP] >> 30) & 2) - 1; FP[pFP--] = FP[pFP - 1]; nDotProduct += FP[pFP] * FM[pFM]; FM[pFM--] -= ((FP[pFP] >> 30) & 2) - 1; FP[pFP--] = FP[pFP - 1]; nDotProduct += FP[pFP] * FM[pFM]; FM[pFM--] -= ((FP[pFP] >> 30) & 2) - 1; FP[pFP--] = FP[pFP - 1]; nDotProduct += FP[pFP] * FM[pFM]; FM[pFM--] -= ((FP[pFP] >> 30) & 2) - 1; FP[pFP--] = FP[pFP - 1]; nDotProduct += FP[pFP] * FM[pFM]; FM[pFM--] -= ((FP[pFP] >> 30) & 2) - 1; FP[pFP--] = FP[pFP - 1]; nDotProduct += FP[pFP] * FM[pFM]; FM[pFM--] -= ((FP[pFP] >> 30) & 2) - 1; FP[pFP--] = FP[pFP - 1]; } pInputArray[ip] -= nDotProduct >> 9; } Original = pInputArray[ip]; IPShort[q] = (short) pInputArray[ip]; IPAdaptFactor[q] = (short) (((pInputArray[ip] >> 30) & 2) - 1); pInputArray[ip] -= (Helper.ConventionalDotProduct(IPShort, q - nFirstElement, bm, 0, IPAdaptFactor, q - nFirstElement, Original, nFilterStageElements) >> nFilterStageShift); IPShort[q] = (short) pInputArray[ip]; IPAdaptFactor[q] = (short) (((pInputArray[ip] >> 30) & 2) - 1); ///////////////////////////////////////////// pOutputArray[op] = pInputArray[ip] + (((p2 * m2) + (p3 * m3) + (p4 * m4)) >> 11); if (pInputArray[ip] > 0) { m2 -= ((p2 >> 30) & 2) - 1; m3 -= ((p3 >> 28) & 8) - 4; m4 -= ((p4 >> 28) & 8) - 4; } else if (pInputArray[ip] < 0) { m2 += ((p2 >> 30) & 2) - 1; m3 += ((p3 >> 28) & 8) - 4; m4 += ((p4 >> 28) & 8) - 4; } p2 = pOutputArray[op] + ((IPP2 - p4) << 3); p3 = (pOutputArray[op] - p4) << 1; IPP2 = p4; p4 = pOutputArray[op]; ///////////////////////////////////////////// pOutputArray[op] += (((p7 * m5) - (opp * m6)) >> nStageCShift); if (p4 > 0) { m5 -= ((p7 >> 29) & 4) - 2; m6 += ((opp >> 30) & 2) - 1; } else if (p4 < 0) { m5 += ((p7 >> 29) & 4) - 2; m6 -= ((opp >> 30) & 2) - 1; } p7 = 2 * pOutputArray[op] - opp; opp = pOutputArray[op]; ///////////////////////////////////////////// pOutputArray[op] += ((pOutputArray[op - 1] * 31) >> 5); } } } jmac-1.74/core/src/davaguine/jmac/decoder/AntiPredictorExtraHighHelper.java0000644000175000017500000002355610131230056026676 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.decoder; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class AntiPredictorExtraHighHelper { int ConventionalDotProduct(short[] bip, int indexbip, short[] bbm, int indexbbm, short[] pIPAdaptFactor, int indexap, int op, int nNumberOfIterations) { //dot product int nDotProduct = 0; int pMaxBBM = nNumberOfIterations; if (op == 0) { int i = indexbbm; int j = indexbip; while (i < (pMaxBBM + indexbbm)) { nDotProduct += bip[j++] * bbm[i++]; nDotProduct += bip[j++] * bbm[i++]; nDotProduct += bip[j++] * bbm[i++]; nDotProduct += bip[j++] * bbm[i++]; nDotProduct += bip[j++] * bbm[i++]; nDotProduct += bip[j++] * bbm[i++]; nDotProduct += bip[j++] * bbm[i++]; nDotProduct += bip[j++] * bbm[i++]; nDotProduct += bip[j++] * bbm[i++]; nDotProduct += bip[j++] * bbm[i++]; nDotProduct += bip[j++] * bbm[i++]; nDotProduct += bip[j++] * bbm[i++]; nDotProduct += bip[j++] * bbm[i++]; nDotProduct += bip[j++] * bbm[i++]; nDotProduct += bip[j++] * bbm[i++]; nDotProduct += bip[j++] * bbm[i++]; nDotProduct += bip[j++] * bbm[i++]; nDotProduct += bip[j++] * bbm[i++]; nDotProduct += bip[j++] * bbm[i++]; nDotProduct += bip[j++] * bbm[i++]; nDotProduct += bip[j++] * bbm[i++]; nDotProduct += bip[j++] * bbm[i++]; nDotProduct += bip[j++] * bbm[i++]; nDotProduct += bip[j++] * bbm[i++]; nDotProduct += bip[j++] * bbm[i++]; nDotProduct += bip[j++] * bbm[i++]; nDotProduct += bip[j++] * bbm[i++]; nDotProduct += bip[j++] * bbm[i++]; nDotProduct += bip[j++] * bbm[i++]; nDotProduct += bip[j++] * bbm[i++]; nDotProduct += bip[j++] * bbm[i++]; nDotProduct += bip[j++] * bbm[i++]; } } else if (op > 0) { int i = indexbbm; int j = indexbip; int k = indexap; while (i < (pMaxBBM + indexbbm)) { nDotProduct += bip[j++] * bbm[i]; bbm[i++] += pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] += pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] += pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] += pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] += pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] += pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] += pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] += pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] += pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] += pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] += pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] += pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] += pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] += pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] += pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] += pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] += pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] += pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] += pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] += pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] += pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] += pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] += pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] += pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] += pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] += pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] += pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] += pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] += pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] += pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] += pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] += pIPAdaptFactor[k++]; } } else { int i = indexbbm; int j = indexbip; int k = indexap; while (i < (pMaxBBM + indexbbm)) { nDotProduct += bip[j++] * bbm[i]; bbm[i++] -= pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] -= pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] -= pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] -= pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] -= pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] -= pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] -= pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] -= pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] -= pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] -= pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] -= pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] -= pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] -= pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] -= pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] -= pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] -= pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] -= pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] -= pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] -= pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] -= pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] -= pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] -= pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] -= pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] -= pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] -= pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] -= pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] -= pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] -= pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] -= pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] -= pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] -= pIPAdaptFactor[k++]; nDotProduct += bip[j++] * bbm[i]; bbm[i++] -= pIPAdaptFactor[k++]; } } //use the dot product return nDotProduct; } } jmac-1.74/core/src/davaguine/jmac/decoder/AntiPredictorFast0000To3320.java0000644000175000017500000000472310131230056025656 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.decoder; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class AntiPredictorFast0000To3320 extends AntiPredictor { public void AntiPredict(int[] pInputArray, int[] pOutputArray, int NumberOfElements) { //short frame handling if (NumberOfElements < 32) { System.arraycopy(pInputArray, 0, pOutputArray, 0, NumberOfElements); return; } //the initial pOutputArray[0] = pInputArray[0]; pOutputArray[1] = pInputArray[1] + pOutputArray[0]; pOutputArray[2] = pInputArray[2] + pOutputArray[1]; pOutputArray[3] = pInputArray[3] + pOutputArray[2]; pOutputArray[4] = pInputArray[4] + pOutputArray[3]; pOutputArray[5] = pInputArray[5] + pOutputArray[4]; pOutputArray[6] = pInputArray[6] + pOutputArray[5]; pOutputArray[7] = pInputArray[7] + pOutputArray[6]; //the rest int p, pw; int m = 4000; int ip, op, op1; op1 = 7; p = (pOutputArray[op1] * 2) - pOutputArray[6]; pw = (p * m) >> 12; for (op = 8, ip = 8; ip < NumberOfElements; ip++, op++, op1++) { pOutputArray[op] = pInputArray[ip] + pw; //adjust m if (pInputArray[ip] > 0) m += (p > 0) ? 4 : -4; else if (pInputArray[ip] < 0) m += (p > 0) ? -4 : 4; p = (pOutputArray[op] * 2) - pOutputArray[op1]; pw = (p * m) >> 12; } } } jmac-1.74/core/src/davaguine/jmac/decoder/AntiPredictorFast3320ToCurrent.java0000644000175000017500000000406210131230056026715 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.decoder; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class AntiPredictorFast3320ToCurrent extends AntiPredictor { public void AntiPredict(int[] pInputArray, int[] pOutputArray, int NumberOfElements) { //short frame handling if (NumberOfElements < 3) { return; } //variable declares int p; int m = 375; int ip; int IP2 = pInputArray[1]; int IP3 = pInputArray[0]; int OP1 = pInputArray[1]; //the decompression loop (order 2 followed by order 1) for (ip = 2; ip < NumberOfElements; ip++) { //make a prediction for order 2 p = IP2 + IP2 - IP3; //rollback the values IP3 = IP2; IP2 = pInputArray[ip] + ((p * m) >> 9); //adjust m for the order 2 if ((pInputArray[ip] ^ p) > 0) m++; else m--; //set the output value pInputArray[ip] = IP2 + OP1; OP1 = pInputArray[ip]; } } } jmac-1.74/core/src/davaguine/jmac/decoder/AntiPredictorHigh0000To3320.java0000644000175000017500000000642710131230056025643 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.decoder; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class AntiPredictorHigh0000To3320 extends AntiPredictor { public void AntiPredict(int[] pInputArray, int[] pOutputArray, int NumberOfElements) { //variable declares int p, pw; int q; int m; //short frame handling if (NumberOfElements < 32) { System.arraycopy(pInputArray, 0, pOutputArray, 0, NumberOfElements); return; } //////////////////////////////////////// //order 5 //////////////////////////////////////// System.arraycopy(pInputArray, 0, pOutputArray, 0, 8); //initialize values m = 0; for (q = 8; q < NumberOfElements; q++) { p = (5 * pOutputArray[q - 1]) - (10 * pOutputArray[q - 2]) + (12 * pOutputArray[q - 3]) - (7 * pOutputArray[q - 4]) + pOutputArray[q - 5]; pw = (p * m) >> 12; pOutputArray[q] = pInputArray[q] + pw; //adjust m if (pInputArray[q] > 0) { if (p > 0) m += 1; else m -= 1; } else if (pInputArray[q] < 0) { if (p > 0) m -= 1; else m += 1; } } /////////////////////////////////////// //order 4 /////////////////////////////////////// System.arraycopy(pOutputArray, 0, pInputArray, 0, 8); m = 0; for (q = 8; q < NumberOfElements; q++) { p = (4 * pInputArray[q - 1]) - (6 * pInputArray[q - 2]) + (4 * pInputArray[q - 3]) - pInputArray[q - 4]; pw = (p * m) >> 12; pInputArray[q] = pOutputArray[q] + pw; //adjust m if (pOutputArray[q] > 0) { if (p > 0) m += 2; else m -= 2; } else if (pOutputArray[q] < 0) { if (p > 0) m -= 2; else m += 2; } } AntiPredictor.AntiPredict(pInputArray, pOutputArray, NumberOfElements); } private AntiPredictorNormal0000To3320 AntiPredictor = new AntiPredictorNormal0000To3320(); } jmac-1.74/core/src/davaguine/jmac/decoder/AntiPredictorHigh3320To3600.java0000644000175000017500000000437610131230056025655 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.decoder; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class AntiPredictorHigh3320To3600 extends AntiPredictor { public void AntiPredict(int[] pInputArray, int[] pOutputArray, int NumberOfElements) { //short frame handling if (NumberOfElements < 8) { System.arraycopy(pInputArray, 0, pOutputArray, 0, NumberOfElements); return; } //do the offset anti-prediction AntiPredictorOffset.AntiPredict(pInputArray, pOutputArray, NumberOfElements, 2, 12); AntiPredictorOffset.AntiPredict(pOutputArray, pInputArray, NumberOfElements, 3, 12); AntiPredictorOffset.AntiPredict(pInputArray, pOutputArray, NumberOfElements, 4, 12); AntiPredictorOffset.AntiPredict(pOutputArray, pInputArray, NumberOfElements, 5, 12); AntiPredictorOffset.AntiPredict(pInputArray, pOutputArray, NumberOfElements, 6, 12); AntiPredictorOffset.AntiPredict(pOutputArray, pInputArray, NumberOfElements, 7, 12); //use the normal mode AntiPredictor.AntiPredict(pInputArray, pOutputArray, NumberOfElements); } private AntiPredictorOffset AntiPredictorOffset = new AntiPredictorOffset(); private AntiPredictorNormal3320To3800 AntiPredictor = new AntiPredictorNormal3320To3800(); } jmac-1.74/core/src/davaguine/jmac/decoder/AntiPredictorHigh3600To3700.java0000644000175000017500000001513510131230056025652 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.decoder; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class AntiPredictorHigh3600To3700 extends AntiPredictor { public void AntiPredict(int[] pInputArray, int[] pOutputArray, int NumberOfElements) { //variable declares int q; //short frame handling if (NumberOfElements < 16) { System.arraycopy(pInputArray, 0, pOutputArray, 0, NumberOfElements); return; } //make the first five samples identical in both arrays System.arraycopy(pInputArray, 0, pOutputArray, 0, 13); //initialize values int bm1 = 0; int bm2 = 0; int bm3 = 0; int bm4 = 0; int bm5 = 0; int bm6 = 0; int bm7 = 0; int bm8 = 0; int bm9 = 0; int bm10 = 0; int bm11 = 0; int bm12 = 0; int bm13 = 0; int m2 = 64; int m3 = 28; int m4 = 16; int OP0; int p4 = pInputArray[12]; int p3 = (pInputArray[12] - pInputArray[11]) << 1; int p2 = pInputArray[12] + ((pInputArray[10] - pInputArray[11]) << 3); int bp1 = pOutputArray[12]; int bp2 = pOutputArray[11]; int bp3 = pOutputArray[10]; int bp4 = pOutputArray[9]; int bp5 = pOutputArray[8]; int bp6 = pOutputArray[7]; int bp7 = pOutputArray[6]; int bp8 = pOutputArray[5]; int bp9 = pOutputArray[4]; int bp10 = pOutputArray[3]; int bp11 = pOutputArray[2]; int bp12 = pOutputArray[1]; int bp13 = pOutputArray[0]; for (q = 13; q < NumberOfElements; q++) { pInputArray[q] = pInputArray[q] - 1; OP0 = (pInputArray[q] - ((bp1 * bm1) >> 8) + ((bp2 * bm2) >> 8) - ((bp3 * bm3) >> 8) - ((bp4 * bm4) >> 8) - ((bp5 * bm5) >> 8) - ((bp6 * bm6) >> 8) - ((bp7 * bm7) >> 8) - ((bp8 * bm8) >> 8) - ((bp9 * bm9) >> 8) + ((bp10 * bm10) >> 8) + ((bp11 * bm11) >> 8) + ((bp12 * bm12) >> 8) + ((bp13 * bm13) >> 8)); if (pInputArray[q] > 0) { bm1 -= bp1 > 0 ? 1 : -1; bm2 += bp2 >= 0 ? 1 : -1; bm3 -= bp3 > 0 ? 1 : -1; bm4 -= bp4 >= 0 ? 1 : -1; bm5 -= bp5 > 0 ? 1 : -1; bm6 -= bp6 >= 0 ? 1 : -1; bm7 -= bp7 > 0 ? 1 : -1; bm8 -= bp8 >= 0 ? 1 : -1; bm9 -= bp9 > 0 ? 1 : -1; bm10 += bp10 >= 0 ? 1 : -1; bm11 += bp11 > 0 ? 1 : -1; bm12 += bp12 >= 0 ? 1 : -1; bm13 += bp13 > 0 ? 1 : -1; } else if (pInputArray[q] < 0) { bm1 -= bp1 <= 0 ? 1 : -1; bm2 += bp2 < 0 ? 1 : -1; bm3 -= bp3 <= 0 ? 1 : -1; bm4 -= bp4 < 0 ? 1 : -1; bm5 -= bp5 <= 0 ? 1 : -1; bm6 -= bp6 < 0 ? 1 : -1; bm7 -= bp7 <= 0 ? 1 : -1; bm8 -= bp8 < 0 ? 1 : -1; bm9 -= bp9 <= 0 ? 1 : -1; bm10 += bp10 < 0 ? 1 : -1; bm11 += bp11 <= 0 ? 1 : -1; bm12 += bp12 < 0 ? 1 : -1; bm13 += bp13 <= 0 ? 1 : -1; } bp13 = bp12; bp12 = bp11; bp11 = bp10; bp10 = bp9; bp9 = bp8; bp8 = bp7; bp7 = bp6; bp6 = bp5; bp5 = bp4; bp4 = bp3; bp3 = bp2; bp2 = bp1; bp1 = OP0; pInputArray[q] = OP0 + ((p2 * m2) >> 11) + ((p3 * m3) >> 9) + ((p4 * m4) >> 9); if (OP0 > 0) { m2 -= p2 > 0 ? -1 : 1; m3 -= p3 > 0 ? -1 : 1; m4 -= p4 > 0 ? -1 : 1; } else if (OP0 < 0) { m2 -= p2 > 0 ? 1 : -1; m3 -= p3 > 0 ? 1 : -1; m4 -= p4 > 0 ? 1 : -1; } p2 = pInputArray[q] + ((pInputArray[q - 2] - pInputArray[q - 1]) << 3); p3 = (pInputArray[q] - pInputArray[q - 1]) << 1; p4 = pInputArray[q]; pOutputArray[q] = pInputArray[q]; } m4 = 370; pOutputArray[1] = pInputArray[1] + pOutputArray[0]; pOutputArray[2] = pInputArray[2] + pOutputArray[1]; pOutputArray[3] = pInputArray[3] + pOutputArray[2]; pOutputArray[4] = pInputArray[4] + pOutputArray[3]; pOutputArray[5] = pInputArray[5] + pOutputArray[4]; pOutputArray[6] = pInputArray[6] + pOutputArray[5]; pOutputArray[7] = pInputArray[7] + pOutputArray[6]; pOutputArray[8] = pInputArray[8] + pOutputArray[7]; pOutputArray[9] = pInputArray[9] + pOutputArray[8]; pOutputArray[10] = pInputArray[10] + pOutputArray[9]; pOutputArray[11] = pInputArray[11] + pOutputArray[10]; pOutputArray[12] = pInputArray[12] + pOutputArray[11]; p4 = (2 * pInputArray[12]) - pInputArray[11]; int p6 = 0; int p5 = pOutputArray[12]; int IP0, IP1; int m6 = 0; IP1 = pInputArray[12]; for (q = 13; q < NumberOfElements; q++) { IP0 = pOutputArray[q] + ((p4 * m4) >> 9) - ((p6 * m6) >> 10); if ((pOutputArray[q] ^ p4) >= 0) m4++; else m4--; if ((pOutputArray[q] ^ p6) >= 0) m6--; else m6++; p4 = (2 * IP0) - IP1; p6 = IP0; pOutputArray[q] = IP0 + ((p5 * 31) >> 5); p5 = pOutputArray[q]; IP1 = IP0; } } } jmac-1.74/core/src/davaguine/jmac/decoder/AntiPredictorHigh3700To3800.java0000644000175000017500000001516410131230056025656 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.decoder; import java.util.Arrays; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class AntiPredictorHigh3700To3800 extends AntiPredictor { private final static int FIRST_ELEMENT = 16; private int[] bm = new int[FIRST_ELEMENT]; public void AntiPredict(int[] pInputArray, int[] pOutputArray, int NumberOfElements) { //the frame to start prediction on //short frame handling if (NumberOfElements < 20) { System.arraycopy(pInputArray, 0, pOutputArray, 0, NumberOfElements); return; } //make the first five samples identical in both arrays System.arraycopy(pInputArray, 0, pOutputArray, 0, FIRST_ELEMENT); //variable declares and initializations Arrays.fill(bm, 0); int m2 = 64, m3 = 115, m4 = 64, m5 = 740, m6 = 0; int p4 = pInputArray[FIRST_ELEMENT - 1]; int p3 = (pInputArray[FIRST_ELEMENT - 1] - pInputArray[FIRST_ELEMENT - 2]) << 1; int p2 = pInputArray[FIRST_ELEMENT - 1] + ((pInputArray[FIRST_ELEMENT - 3] - pInputArray[FIRST_ELEMENT - 2]) << 3); int op = FIRST_ELEMENT; int ip = FIRST_ELEMENT; int IPP2 = pInputArray[ip - 2]; int IPP1 = pInputArray[ip - 1]; int p7 = 2 * pInputArray[ip - 1] - pInputArray[ip - 2]; int opp = pOutputArray[op - 1]; int Original; //undo the initial prediction stuff for (int q = 1; q < FIRST_ELEMENT; q++) { pOutputArray[q] += pOutputArray[q - 1]; } //pump the primary loop for (; op < NumberOfElements; op++, ip++) { Original = pInputArray[ip] - 1; pInputArray[ip] = Original - (((pInputArray[ip - 1] * bm[0]) + (pInputArray[ip - 2] * bm[1]) + (pInputArray[ip - 3] * bm[2]) + (pInputArray[ip - 4] * bm[3]) + (pInputArray[ip - 5] * bm[4]) + (pInputArray[ip - 6] * bm[5]) + (pInputArray[ip - 7] * bm[6]) + (pInputArray[ip - 8] * bm[7]) + (pInputArray[ip - 9] * bm[8]) + (pInputArray[ip - 10] * bm[9]) + (pInputArray[ip - 11] * bm[10]) + (pInputArray[ip - 12] * bm[11]) + (pInputArray[ip - 13] * bm[12]) + (pInputArray[ip - 14] * bm[13]) + (pInputArray[ip - 15] * bm[14]) + (pInputArray[ip - 16] * bm[15])) >> 8); if (Original > 0) { bm[0] -= pInputArray[ip - 1] > 0 ? 1 : -1; bm[1] += (((long) (pInputArray[ip - 2]) >> 30) & 2) - 1; bm[2] -= pInputArray[ip - 3] > 0 ? 1 : -1; bm[3] += (((long) (pInputArray[ip - 4]) >> 30) & 2) - 1; bm[4] -= pInputArray[ip - 5] > 0 ? 1 : -1; bm[5] += (((long) (pInputArray[ip - 6]) >> 30) & 2) - 1; bm[6] -= pInputArray[ip - 7] > 0 ? 1 : -1; bm[7] += (((long) (pInputArray[ip - 8]) >> 30) & 2) - 1; bm[8] -= pInputArray[ip - 9] > 0 ? 1 : -1; bm[9] += (((long) (pInputArray[ip - 10]) >> 30) & 2) - 1; bm[10] -= pInputArray[ip - 11] > 0 ? 1 : -1; bm[11] += (((long) (pInputArray[ip - 12]) >> 30) & 2) - 1; bm[12] -= pInputArray[ip - 13] > 0 ? 1 : -1; bm[13] += (((long) (pInputArray[ip - 14]) >> 30) & 2) - 1; bm[14] -= pInputArray[ip - 15] > 0 ? 1 : -1; bm[15] += (((long) (pInputArray[ip - 16]) >> 30) & 2) - 1; } else if (Original < 0) { bm[0] -= pInputArray[ip - 1] <= 0 ? 1 : -1; bm[1] -= (((long) (pInputArray[ip - 2]) >> 30) & 2) - 1; bm[2] -= pInputArray[ip - 3] <= 0 ? 1 : -1; bm[3] -= (((long) (pInputArray[ip - 4]) >> 30) & 2) - 1; bm[4] -= pInputArray[ip - 5] <= 0 ? 1 : -1; bm[5] -= (((long) (pInputArray[ip - 6]) >> 30) & 2) - 1; bm[6] -= pInputArray[ip - 7] <= 0 ? 1 : -1; bm[7] -= (((long) (pInputArray[ip - 8]) >> 30) & 2) - 1; bm[8] -= pInputArray[ip - 9] <= 0 ? 1 : -1; bm[9] -= (((long) (pInputArray[ip - 10]) >> 30) & 2) - 1; bm[10] -= pInputArray[ip - 11] <= 0 ? 1 : -1; bm[11] -= (((long) (pInputArray[ip - 12]) >> 30) & 2) - 1; bm[12] -= pInputArray[ip - 13] <= 0 ? 1 : -1; bm[13] -= (((long) (pInputArray[ip - 14]) >> 30) & 2) - 1; bm[14] -= pInputArray[ip - 15] <= 0 ? 1 : -1; bm[15] -= (((long) (pInputArray[ip - 16]) >> 30) & 2) - 1; } ///////////////////////////////////////////// pOutputArray[op] = pInputArray[ip] + (((p2 * m2) + (p3 * m3) + (p4 * m4)) >> 11); if (pInputArray[ip] > 0) { m2 -= p2 > 0 ? -1 : 1; m3 -= p3 > 0 ? -4 : 4; m4 -= p4 > 0 ? -4 : 4; } else if (pInputArray[ip] < 0) { m2 -= p2 > 0 ? 1 : -1; m3 -= p3 > 0 ? 4 : -4; m4 -= p4 > 0 ? 4 : -4; } p4 = pOutputArray[op]; p2 = p4 + ((IPP2 - IPP1) << 3); p3 = (p4 - IPP1) << 1; IPP2 = IPP1; IPP1 = p4; ///////////////////////////////////////////// pOutputArray[op] += (((p7 * m5) - (opp * m6)) >> 10); if ((IPP1 ^ p7) >= 0) m5 += 2; else m5 -= 2; if ((IPP1 ^ opp) >= 0) m6--; else m6++; p7 = 2 * pOutputArray[op] - opp; opp = pOutputArray[op]; ///////////////////////////////////////////// pOutputArray[op] += ((pOutputArray[op - 1] * 31) >> 5); } } } jmac-1.74/core/src/davaguine/jmac/decoder/AntiPredictorHigh3800ToCurrent.java0000644000175000017500000002344710131230056026712 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.decoder; import java.util.Arrays; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class AntiPredictorHigh3800ToCurrent extends AntiPredictor { private final static int FIRST_ELEMENT = 16; private int[] bm = new int[FIRST_ELEMENT]; public void AntiPredict(int[] pInputArray, int[] pOutputArray, int NumberOfElements) { //the frame to start prediction on //short frame handling if (NumberOfElements < 20) { System.arraycopy(pInputArray, 0, pOutputArray, 0, NumberOfElements); return; } //make the first five samples identical in both arrays System.arraycopy(pInputArray, 0, pOutputArray, 0, FIRST_ELEMENT); //variable declares and initializations Arrays.fill(bm, 0); int m2 = 64, m3 = 115, m4 = 64, m5 = 740, m6 = 0; int p4 = pInputArray[FIRST_ELEMENT - 1]; int p3 = (pInputArray[FIRST_ELEMENT - 1] - pInputArray[FIRST_ELEMENT - 2]) << 1; int p2 = pInputArray[FIRST_ELEMENT - 1] + ((pInputArray[FIRST_ELEMENT - 3] - pInputArray[FIRST_ELEMENT - 2]) << 3); int op = FIRST_ELEMENT; int ip = FIRST_ELEMENT; int IPP2 = pInputArray[ip - 2]; int p7 = 2 * pInputArray[ip - 1] - pInputArray[ip - 2]; int opp = pOutputArray[op - 1]; //undo the initial prediction stuff for (int q = 1; q < FIRST_ELEMENT; q++) { pOutputArray[q] += pOutputArray[q - 1]; } //pump the primary loop for (; op < NumberOfElements; op++, ip++) { int pip = ip - FIRST_ELEMENT; int pbm = 0; int nDotProduct = 0; if (pInputArray[ip] > 0) { nDotProduct += ((long) pInputArray[pip]) * bm[pbm]; bm[pbm++] += ((((long) pInputArray[pip++]) >> 30) & 2) - 1; nDotProduct += ((long) pInputArray[pip]) * bm[pbm]; bm[pbm++] += ((((long) pInputArray[pip++]) >> 30) & 2) - 1; nDotProduct += ((long) pInputArray[pip]) * bm[pbm]; bm[pbm++] += ((((long) pInputArray[pip++]) >> 30) & 2) - 1; nDotProduct += ((long) pInputArray[pip]) * bm[pbm]; bm[pbm++] += ((((long) pInputArray[pip++]) >> 30) & 2) - 1; nDotProduct += ((long) pInputArray[pip]) * bm[pbm]; bm[pbm++] += ((((long) pInputArray[pip++]) >> 30) & 2) - 1; nDotProduct += ((long) pInputArray[pip]) * bm[pbm]; bm[pbm++] += ((((long) pInputArray[pip++]) >> 30) & 2) - 1; nDotProduct += ((long) pInputArray[pip]) * bm[pbm]; bm[pbm++] += ((((long) pInputArray[pip++]) >> 30) & 2) - 1; nDotProduct += ((long) pInputArray[pip]) * bm[pbm]; bm[pbm++] += ((((long) pInputArray[pip++]) >> 30) & 2) - 1; nDotProduct += ((long) pInputArray[pip]) * bm[pbm]; bm[pbm++] += ((((long) pInputArray[pip++]) >> 30) & 2) - 1; nDotProduct += ((long) pInputArray[pip]) * bm[pbm]; bm[pbm++] += ((((long) pInputArray[pip++]) >> 30) & 2) - 1; nDotProduct += ((long) pInputArray[pip]) * bm[pbm]; bm[pbm++] += ((((long) pInputArray[pip++]) >> 30) & 2) - 1; nDotProduct += ((long) pInputArray[pip]) * bm[pbm]; bm[pbm++] += ((((long) pInputArray[pip++]) >> 30) & 2) - 1; nDotProduct += ((long) pInputArray[pip]) * bm[pbm]; bm[pbm++] += ((((long) pInputArray[pip++]) >> 30) & 2) - 1; nDotProduct += ((long) pInputArray[pip]) * bm[pbm]; bm[pbm++] += ((((long) pInputArray[pip++]) >> 30) & 2) - 1; nDotProduct += ((long) pInputArray[pip]) * bm[pbm]; bm[pbm++] += ((((long) pInputArray[pip++]) >> 30) & 2) - 1; nDotProduct += ((long) pInputArray[pip]) * bm[pbm]; bm[pbm++] += ((((long) pInputArray[pip++]) >> 30) & 2) - 1; } else if (pInputArray[ip] < 0) { nDotProduct += ((long) pInputArray[pip]) * bm[pbm]; bm[pbm++] -= ((((long) pInputArray[pip++]) >> 30) & 2) - 1; nDotProduct += ((long) pInputArray[pip]) * bm[pbm]; bm[pbm++] -= ((((long) pInputArray[pip++]) >> 30) & 2) - 1; nDotProduct += ((long) pInputArray[pip]) * bm[pbm]; bm[pbm++] -= ((((long) pInputArray[pip++]) >> 30) & 2) - 1; nDotProduct += ((long) pInputArray[pip]) * bm[pbm]; bm[pbm++] -= ((((long) pInputArray[pip++]) >> 30) & 2) - 1; nDotProduct += ((long) pInputArray[pip]) * bm[pbm]; bm[pbm++] -= ((((long) pInputArray[pip++]) >> 30) & 2) - 1; nDotProduct += ((long) pInputArray[pip]) * bm[pbm]; bm[pbm++] -= ((((long) pInputArray[pip++]) >> 30) & 2) - 1; nDotProduct += ((long) pInputArray[pip]) * bm[pbm]; bm[pbm++] -= ((((long) pInputArray[pip++]) >> 30) & 2) - 1; nDotProduct += ((long) pInputArray[pip]) * bm[pbm]; bm[pbm++] -= ((((long) pInputArray[pip++]) >> 30) & 2) - 1; nDotProduct += ((long) pInputArray[pip]) * bm[pbm]; bm[pbm++] -= ((((long) pInputArray[pip++]) >> 30) & 2) - 1; nDotProduct += ((long) pInputArray[pip]) * bm[pbm]; bm[pbm++] -= ((((long) pInputArray[pip++]) >> 30) & 2) - 1; nDotProduct += ((long) pInputArray[pip]) * bm[pbm]; bm[pbm++] -= ((((long) pInputArray[pip++]) >> 30) & 2) - 1; nDotProduct += ((long) pInputArray[pip]) * bm[pbm]; bm[pbm++] -= ((((long) pInputArray[pip++]) >> 30) & 2) - 1; nDotProduct += ((long) pInputArray[pip]) * bm[pbm]; bm[pbm++] -= ((((long) pInputArray[pip++]) >> 30) & 2) - 1; nDotProduct += ((long) pInputArray[pip]) * bm[pbm]; bm[pbm++] -= ((((long) pInputArray[pip++]) >> 30) & 2) - 1; nDotProduct += ((long) pInputArray[pip]) * bm[pbm]; bm[pbm++] -= ((((long) pInputArray[pip++]) >> 30) & 2) - 1; nDotProduct += ((long) pInputArray[pip]) * bm[pbm]; bm[pbm++] -= ((((long) pInputArray[pip++]) >> 30) & 2) - 1; } else { nDotProduct += ((long) pInputArray[pip++]) * bm[pbm++]; nDotProduct += ((long) pInputArray[pip++]) * bm[pbm++]; nDotProduct += ((long) pInputArray[pip++]) * bm[pbm++]; nDotProduct += ((long) pInputArray[pip++]) * bm[pbm++]; nDotProduct += ((long) pInputArray[pip++]) * bm[pbm++]; nDotProduct += ((long) pInputArray[pip++]) * bm[pbm++]; nDotProduct += ((long) pInputArray[pip++]) * bm[pbm++]; nDotProduct += ((long) pInputArray[pip++]) * bm[pbm++]; nDotProduct += ((long) pInputArray[pip++]) * bm[pbm++]; nDotProduct += ((long) pInputArray[pip++]) * bm[pbm++]; nDotProduct += ((long) pInputArray[pip++]) * bm[pbm++]; nDotProduct += ((long) pInputArray[pip++]) * bm[pbm++]; nDotProduct += ((long) pInputArray[pip++]) * bm[pbm++]; nDotProduct += ((long) pInputArray[pip++]) * bm[pbm++]; nDotProduct += ((long) pInputArray[pip++]) * bm[pbm++]; nDotProduct += ((long) pInputArray[pip++]) * bm[pbm++]; } pInputArray[ip] -= (nDotProduct >> 9); ///////////////////////////////////////////// pOutputArray[op] = pInputArray[ip] + (((p2 * m2) + (p3 * m3) + (p4 * m4)) >> 11); if (pInputArray[ip] > 0) { m2 -= ((p2 >> 30) & 2) - 1; m3 -= ((p3 >> 28) & 8) - 4; m4 -= ((p4 >> 28) & 8) - 4; } else if (pInputArray[ip] < 0) { m2 += ((p2 >> 30) & 2) - 1; m3 += ((p3 >> 28) & 8) - 4; m4 += ((p4 >> 28) & 8) - 4; } p2 = pOutputArray[op] + ((IPP2 - p4) << 3); p3 = (pOutputArray[op] - p4) << 1; IPP2 = p4; p4 = pOutputArray[op]; ///////////////////////////////////////////// pOutputArray[op] += (((p7 * m5) - (opp * m6)) >> 10); if (p4 > 0) { m5 -= ((p7 >> 29) & 4) - 2; m6 += ((opp >> 30) & 2) - 1; } else if (p4 < 0) { m5 += ((p7 >> 29) & 4) - 2; m6 -= ((opp >> 30) & 2) - 1; } p7 = 2 * pOutputArray[op] - opp; opp = pOutputArray[op]; ///////////////////////////////////////////// pOutputArray[op] += ((pOutputArray[op - 1] * 31) >> 5); } } } jmac-1.74/core/src/davaguine/jmac/decoder/AntiPredictorNormal0000To3320.java0000644000175000017500000001030210131230056026177 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.decoder; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class AntiPredictorNormal0000To3320 extends AntiPredictor { public void AntiPredict(int[] pInputArray, int[] pOutputArray, int NumberOfElements) { //variable declares int ip, op, op1, op2; int p, pw; int m; //short frame handling if (NumberOfElements < 32) { System.arraycopy(pInputArray, 0, pOutputArray, 0, NumberOfElements); return; } //////////////////////////////////////// //order 3 //////////////////////////////////////// System.arraycopy(pInputArray, 0, pOutputArray, 0, 8); //initialize values m = 300; op = 8; op1 = 7; op2 = 6; //make the first prediction p = (pOutputArray[7] * 3) - (pOutputArray[6] * 3) + pOutputArray[5]; pw = (p * m) >> 12; //loop through the array for (ip = 8; ip < NumberOfElements; ip++, op++, op1++, op2++) { //figure the output value pOutputArray[op] = pInputArray[ip] + pw; //adjust m if (pInputArray[ip] > 0) m += (p > 0) ? 4 : -4; else if (pInputArray[ip] < 0) m += (p > 0) ? -4 : 4; //make the next prediction p = (pOutputArray[op] * 3) - (pOutputArray[op1] * 3) + pOutputArray[op2]; pw = (p * m) >> 12; } /////////////////////////////////////// //order 2 /////////////////////////////////////// System.arraycopy(pInputArray, 0, pOutputArray, 0, 8); m = 3000; op1 = 7; p = (pInputArray[op1] * 2) - pInputArray[6]; pw = (p * m) >> 12; for (op = 8, ip = 8; ip < NumberOfElements; ip++, op++, op1++) { pInputArray[op] = pOutputArray[ip] + pw; //adjust m if (pOutputArray[ip] > 0) m += (p > 0) ? 12 : -12; else if (pOutputArray[ip] < 0) m += (p > 0) ? -12 : 12; p = (pInputArray[op] * 2) - pInputArray[op1]; pw = (p * m) >> 12; } /////////////////////////////////////// //order 1 /////////////////////////////////////// pOutputArray[0] = pInputArray[0]; pOutputArray[1] = pInputArray[1] + pOutputArray[0]; pOutputArray[2] = pInputArray[2] + pOutputArray[1]; pOutputArray[3] = pInputArray[3] + pOutputArray[2]; pOutputArray[4] = pInputArray[4] + pOutputArray[3]; pOutputArray[5] = pInputArray[5] + pOutputArray[4]; pOutputArray[6] = pInputArray[6] + pOutputArray[5]; pOutputArray[7] = pInputArray[7] + pOutputArray[6]; m = 3900; p = pOutputArray[7]; pw = (p * m) >> 12; for (op = 8, ip = 8; ip < NumberOfElements; ip++, op++) { pOutputArray[op] = pInputArray[ip] + pw; //adjust m if (pInputArray[ip] > 0) m += (p > 0) ? 1 : -1; else if (pInputArray[ip] < 0) m += (p > 0) ? -1 : 1; p = pOutputArray[op]; pw = (p * m) >> 12; } } } jmac-1.74/core/src/davaguine/jmac/decoder/AntiPredictorNormal3320To3800.java0000644000175000017500000000713010131230056026217 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.decoder; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class AntiPredictorNormal3320To3800 extends AntiPredictor { public void AntiPredict(int[] pInputArray, int[] pOutputArray, int NumberOfElements) { //variable declares int q; //short frame handling if (NumberOfElements < 8) { System.arraycopy(pInputArray, 0, pOutputArray, 0, NumberOfElements); return; } //make the first five samples identical in both arrays System.arraycopy(pInputArray, 0, pOutputArray, 0, 5); //initialize values int m1 = 0; int m2 = 64; int m3 = 28; int OP0; int p3 = (3 * (pOutputArray[4] - pOutputArray[3])) + pOutputArray[2]; int p2 = pInputArray[4] + ((pInputArray[2] - pInputArray[3]) << 3) - pInputArray[1] + pInputArray[0]; int p1 = pOutputArray[4]; for (q = 5; q < NumberOfElements; q++) { OP0 = pInputArray[q] + ((p1 * m1) >> 8); if ((pInputArray[q] ^ p1) > 0) m1++; else m1--; p1 = OP0; pInputArray[q] = OP0 + ((p2 * m2) >> 11); if ((OP0 ^ p2) > 0) m2++; else m2--; p2 = pInputArray[q] + ((pInputArray[q - 2] - pInputArray[q - 1]) << 3) - pInputArray[q - 3] + pInputArray[q - 4]; pOutputArray[q] = pInputArray[q] + ((p3 * m3) >> 9); if ((pInputArray[q] ^ p3) > 0) m3++; else m3--; p3 = (3 * (pOutputArray[q] - pOutputArray[q - 1])) + pOutputArray[q - 2]; } int m4 = 370; int m5 = 3900; //pOutputArray[0] = pInputArray[0]; pOutputArray[1] = pInputArray[1] + pOutputArray[0]; pOutputArray[2] = pInputArray[2] + pOutputArray[1]; pOutputArray[3] = pInputArray[3] + pOutputArray[2]; pOutputArray[4] = pInputArray[4] + pOutputArray[3]; int p4 = (2 * pInputArray[4]) - pInputArray[3]; int p5 = pOutputArray[4]; int IP0, IP1; IP1 = pInputArray[4]; for (q = 5; q < NumberOfElements; q++) { IP0 = pOutputArray[q] + ((p4 * m4) >> 9); if ((pOutputArray[q] ^ p4) > 0) m4++; else m4--; p4 = (2 * IP0) - IP1; pOutputArray[q] = IP0 + ((p5 * m5) >> 12); if ((IP0 ^ p5) > 0) m5++; else m5--; p5 = pOutputArray[q]; IP1 = IP0; } } } jmac-1.74/core/src/davaguine/jmac/decoder/AntiPredictorNormal3800ToCurrent.java0000644000175000017500000000711710131230056027257 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.decoder; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class AntiPredictorNormal3800ToCurrent extends AntiPredictor { private final static int FIRST_ELEMENT = 4; public void AntiPredict(int[] pInputArray, int[] pOutputArray, int NumberOfElements) { //short frame handling if (NumberOfElements < 8) { System.arraycopy(pInputArray, 0, pOutputArray, 0, NumberOfElements); return; } //make the first five samples identical in both arrays System.arraycopy(pInputArray, 0, pOutputArray, 0, FIRST_ELEMENT); //variable declares and initializations int m2 = 64, m3 = 115, m4 = 64, m5 = 740, m6 = 0; int p4 = pInputArray[FIRST_ELEMENT - 1]; int p3 = (pInputArray[FIRST_ELEMENT - 1] - pInputArray[FIRST_ELEMENT - 2]) << 1; int p2 = pInputArray[FIRST_ELEMENT - 1] + ((pInputArray[FIRST_ELEMENT - 3] - pInputArray[FIRST_ELEMENT - 2]) << 3); int op = FIRST_ELEMENT; int ip = FIRST_ELEMENT; int IPP2 = pInputArray[ip - 2]; int p7 = 2 * pInputArray[ip - 1] - pInputArray[ip - 2]; int opp = pOutputArray[op - 1]; //undo the initial prediction stuff for (int q = 1; q < FIRST_ELEMENT; q++) { pOutputArray[q] += pOutputArray[q - 1]; } //pump the primary loop for (; op < NumberOfElements; op++, ip++) { int o = pOutputArray[op], i = pInputArray[ip]; ///////////////////////////////////////////// o = i + (((p2 * m2) + (p3 * m3) + (p4 * m4)) >> 11); if (i > 0) { m2 -= ((p2 >> 30) & 2) - 1; m3 -= ((p3 >> 28) & 8) - 4; m4 -= ((p4 >> 28) & 8) - 4; } else if (i < 0) { m2 += ((p2 >> 30) & 2) - 1; m3 += ((p3 >> 28) & 8) - 4; m4 += ((p4 >> 28) & 8) - 4; } p2 = o + ((IPP2 - p4) << 3); p3 = (o - p4) << 1; IPP2 = p4; p4 = o; ///////////////////////////////////////////// o += (((p7 * m5) - (opp * m6)) >> 10); if (p4 > 0) { m5 -= ((p7 >> 29) & 4) - 2; m6 += ((opp >> 30) & 2) - 1; } else if (p4 < 0) { m5 += ((p7 >> 29) & 4) - 2; m6 -= ((opp >> 30) & 2) - 1; } p7 = 2 * o - opp; opp = o; ///////////////////////////////////////////// pOutputArray[op] = o + ((pOutputArray[op - 1] * 31) >> 5); } } } jmac-1.74/core/src/davaguine/jmac/decoder/AntiPredictorOffset.java0000644000175000017500000000323010131230056025064 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.decoder; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class AntiPredictorOffset extends AntiPredictor { public void AntiPredict(int[] pInputArray, int[] pOutputArray, int NumberOfElements, int Offset, int DeltaM) { System.arraycopy(pInputArray, 0, pOutputArray, 0, Offset); int ip = Offset; int ipo = 0; int op = Offset; int m = 0; for (; op < NumberOfElements; ip++, ipo++, op++) { pOutputArray[op] = pInputArray[ip] + ((pOutputArray[ipo] * m) >> 12); if ((pOutputArray[ipo] ^ pInputArray[ip]) > 0) m += DeltaM; else m -= DeltaM; } } } jmac-1.74/core/src/davaguine/jmac/decoder/APEDecompress.java0000644000175000017500000005403410131230056023610 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.decoder; import davaguine.jmac.info.*; import davaguine.jmac.prediction.IPredictorDecompress; import davaguine.jmac.prediction.PredictorDecompress3950toCurrent; import davaguine.jmac.prediction.PredictorDecompressNormal3930to3950; import davaguine.jmac.tools.*; import java.io.IOException; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class APEDecompress extends IAPEDecompress { private final static int DECODE_BLOCK_SIZE = 4096; public APEDecompress(APEInfo pAPEInfo) { this(pAPEInfo, -1, -1); } public APEDecompress(APEInfo pAPEInfo, int nStartBlock) { this(pAPEInfo, nStartBlock, -1); } public APEDecompress(APEInfo pAPEInfo, int nStartBlock, int nFinishBlock) { // open / analyze the file m_spAPEInfo = pAPEInfo; // version check (this implementation only works with 3.93 and later files) if (m_spAPEInfo.getApeInfoFileVersion() < 3930) throw new JMACException("Unsupported Version"); // get format information m_wfeInput = m_spAPEInfo.getApeInfoWaveFormatEx(); m_nBlockAlign = m_spAPEInfo.getApeInfoBlockAlign(); // initialize other stuff m_bDecompressorInitialized = false; m_nCurrentFrame = 0; m_nRealFrame = 0; m_nCurrentBlock = 0; m_nCurrentFrameBufferBlock = 0; m_nFrameBufferFinishedBlocks = 0; m_bErrorDecodingCurrentFrame = false; // set the "real" start and finish blocks m_nStartBlock = (nStartBlock < 0) ? 0 : Math.min(nStartBlock, m_spAPEInfo.getApeInfoTotalBlocks()); m_nFinishBlock = (nFinishBlock < 0) ? m_spAPEInfo.getApeInfoTotalBlocks() : Math.min(nFinishBlock, m_spAPEInfo.getApeInfoTotalBlocks()); m_bIsRanged = (m_nStartBlock != 0) || (m_nFinishBlock != m_spAPEInfo.getApeInfoTotalBlocks()); } public int GetData(byte[] pBuffer, int nBlocks) throws IOException { InitializeDecompressor(); // cap int nBlocksUntilFinish = m_nFinishBlock - m_nCurrentBlock; int nBlocksToRetrieve = Math.min(nBlocks, nBlocksUntilFinish); // get the data int nBlocksLeft = nBlocksToRetrieve; int nBlocksThisPass = 1; int index = 0; while ((nBlocksLeft > 0) && (nBlocksThisPass > 0)) { // fill up the frame buffer FillFrameBuffer(); // analyze how much to remove from the buffer int nFrameBufferBlocks = m_nFrameBufferFinishedBlocks; nBlocksThisPass = Math.min(nBlocksLeft, nFrameBufferBlocks); // remove as much as possible if (nBlocksThisPass > 0) { m_cbFrameBuffer.Get(pBuffer, index, nBlocksThisPass * m_nBlockAlign); index += nBlocksThisPass * m_nBlockAlign; nBlocksLeft -= nBlocksThisPass; m_nFrameBufferFinishedBlocks -= nBlocksThisPass; } } // calculate the blocks retrieved int nBlocksRetrieved = nBlocksToRetrieve - nBlocksLeft; // update position m_nCurrentBlock += nBlocksRetrieved; return nBlocksRetrieved; } public void Seek(int nBlockOffset) throws IOException { InitializeDecompressor(); // use the offset nBlockOffset += m_nStartBlock; // cap (to prevent seeking too far) if (nBlockOffset >= m_nFinishBlock) nBlockOffset = m_nFinishBlock - 1; if (nBlockOffset < m_nStartBlock) nBlockOffset = m_nStartBlock; // seek to the perfect location int nBaseFrame = nBlockOffset / m_spAPEInfo.getApeInfoBlocksPerFrame(); int nBlocksToSkip = nBlockOffset % m_spAPEInfo.getApeInfoBlocksPerFrame(); int nBytesToSkip = nBlocksToSkip * m_nBlockAlign; m_nCurrentBlock = nBaseFrame * this.getApeInfoBlocksPerFrame(); m_nCurrentFrameBufferBlock = nBaseFrame * this.getApeInfoBlocksPerFrame(); m_nCurrentFrame = nBaseFrame; m_nFrameBufferFinishedBlocks = 0; m_cbFrameBuffer.Empty(); SeekToFrame(m_nCurrentFrame); // skip necessary blocks byte[] spTempBuffer = new byte[nBytesToSkip]; int nBlocksRetrieved = GetData(spTempBuffer, nBlocksToSkip); if (nBlocksRetrieved != nBlocksToSkip) throw new JMACException("Undefined Error"); } public int getApeInfoDecompressCurrentBlock() { return m_nCurrentBlock - m_nStartBlock; } public int getApeInfoDecompressCurrentMS() { int nSampleRate = m_spAPEInfo.getApeInfoSampleRate(); if (nSampleRate > 0) return (int) ((m_nCurrentBlock * 1000L) / nSampleRate); return 0; } public int getApeInfoDecompressTotalBlocks() { return m_nFinishBlock - m_nStartBlock; } public int getApeInfoDecompressLengthMS() { int nSampleRate = m_spAPEInfo.getApeInfoSampleRate(); if (nSampleRate > 0) return (int) (((m_nFinishBlock - m_nStartBlock) * 1000L) / nSampleRate); return 0; } public int getApeInfoDecompressCurrentBitRate() throws IOException { return m_spAPEInfo.getApeInfoFrameBitrate(m_nCurrentFrame); } public int getApeInfoDecompressAverageBitrate() throws IOException { if (m_bIsRanged || !m_spAPEInfo.getApeInfoIoSource().isLocal()) { // figure the frame range int nBlocksPerFrame = m_spAPEInfo.getApeInfoBlocksPerFrame(); int nStartFrame = m_nStartBlock / nBlocksPerFrame; int nFinishFrame = (m_nFinishBlock + nBlocksPerFrame - 1) / nBlocksPerFrame; // get the number of bytes in the first and last frame int nTotalBytes = (m_spAPEInfo.getApeInfoFrameBytes(nStartFrame) * (m_nStartBlock % nBlocksPerFrame)) / nBlocksPerFrame; if (nFinishFrame != nStartFrame) nTotalBytes += (m_spAPEInfo.getApeInfoFrameBytes(nFinishFrame) * (m_nFinishBlock % nBlocksPerFrame)) / nBlocksPerFrame; // get the number of bytes in between int nTotalFrames = m_spAPEInfo.getApeInfoTotalFrames(); for (int nFrame = nStartFrame + 1; (nFrame < nFinishFrame) && (nFrame < nTotalFrames); nFrame++) nTotalBytes += m_spAPEInfo.getApeInfoFrameBytes(nFrame); // figure the bitrate int nTotalMS = (int) (((m_nFinishBlock - m_nStartBlock) * 1000L) / m_spAPEInfo.getApeInfoSampleRate()); if (nTotalMS != 0) return (nTotalBytes * 8) / nTotalMS; } else return m_spAPEInfo.getApeInfoAverageBitrate(); return 0; } public int getApeInfoWavHeaderBytes() { if (m_bIsRanged) return WaveHeader.WAVE_HEADER_BYTES; return m_spAPEInfo.getApeInfoWavHeaderBytes(); } public byte[] getApeInfoWavHeaderData(int nMaxBytes) { if (m_bIsRanged) { if (WaveHeader.WAVE_HEADER_BYTES > nMaxBytes) return null; else { WaveFormat wfeFormat = m_spAPEInfo.getApeInfoWaveFormatEx(); WaveHeader WAVHeader = new WaveHeader(); WaveHeader.FillWaveHeader(WAVHeader, (m_nFinishBlock - m_nStartBlock) * m_spAPEInfo.getApeInfoBlockAlign(), wfeFormat, 0); return WAVHeader.write(); } } return m_spAPEInfo.getApeInfoWavHeaderData(nMaxBytes); } public int getApeInfoWavTerminatingBytes() { if (m_bIsRanged) return 0; else return m_spAPEInfo.getApeInfoWavTerminatingBytes(); } public byte[] getApeInfoWavTerminatingData(int nMaxBytes) throws IOException { if (m_bIsRanged) return null; else return m_spAPEInfo.getApeInfoWavTerminatingData(nMaxBytes); } public WaveFormat getApeInfoWaveFormatEx() { return m_spAPEInfo.getApeInfoWaveFormatEx(); } public File getApeInfoIoSource() { return m_spAPEInfo.getApeInfoIoSource(); } public int getApeInfoBlocksPerFrame() { return m_spAPEInfo.getApeInfoBlocksPerFrame(); } public int getApeInfoFileVersion() { return m_spAPEInfo.getApeInfoFileVersion(); } public int getApeInfoCompressionLevel() { return m_spAPEInfo.getApeInfoCompressionLevel(); } public int getApeInfoFormatFlags() { return m_spAPEInfo.getApeInfoFormatFlags(); } public int getApeInfoSampleRate() { return m_spAPEInfo.getApeInfoSampleRate(); } public int getApeInfoBitsPerSample() { return m_spAPEInfo.getApeInfoBitsPerSample(); } public int getApeInfoBytesPerSample() { return m_spAPEInfo.getApeInfoBytesPerSample(); } public int getApeInfoChannels() { return m_spAPEInfo.getApeInfoChannels(); } public int getApeInfoBlockAlign() { return m_spAPEInfo.getApeInfoBlockAlign(); } public int getApeInfoFinalFrameBlocks() { return m_spAPEInfo.getApeInfoFinalFrameBlocks(); } public int getApeInfoTotalFrames() { return m_spAPEInfo.getApeInfoTotalFrames(); } public int getApeInfoWavDataBytes() { return m_spAPEInfo.getApeInfoWavDataBytes(); } public int getApeInfoWavTotalBytes() { return m_spAPEInfo.getApeInfoWavTotalBytes(); } public int getApeInfoApeTotalBytes() { return m_spAPEInfo.getApeInfoApeTotalBytes(); } public int getApeInfoTotalBlocks() { return m_spAPEInfo.getApeInfoTotalBlocks(); } public int getApeInfoLengthMs() { return m_spAPEInfo.getApeInfoLengthMs(); } public int getApeInfoAverageBitrate() { return m_spAPEInfo.getApeInfoAverageBitrate(); } public int getApeInfoSeekByte(int nFrame) { return m_spAPEInfo.getApeInfoSeekByte(nFrame); } public int getApeInfoFrameBytes(int nFrame) throws IOException { return m_spAPEInfo.getApeInfoFrameBytes(nFrame); } public int getApeInfoFrameBlocks(int nFrame) { return m_spAPEInfo.getApeInfoFrameBlocks(nFrame); } public int getApeInfoFrameBitrate(int nFrame) throws IOException { return m_spAPEInfo.getApeInfoFrameBitrate(nFrame); } public int getApeInfoDecompressedBitrate() { return m_spAPEInfo.getApeInfoDecompressedBitrate(); } public int getApeInfoPeakLevel() { return m_spAPEInfo.getApeInfoPeakLevel(); } public int getApeInfoSeekBit(int nFrame) { return m_spAPEInfo.getApeInfoSeekBit(nFrame); } public APETag getApeInfoTag() { return m_spAPEInfo.getApeInfoTag(); } public APEFileInfo getApeInfoInternalInfo() { return m_spAPEInfo.getApeInfoInternalInfo(); } // file info protected int m_nBlockAlign; protected int m_nCurrentFrame; protected int m_nRealFrame; // start / finish information protected int m_nStartBlock; protected int m_nFinishBlock; protected int m_nCurrentBlock; protected boolean m_bIsRanged; protected boolean m_bDecompressorInitialized; // decoding tools protected Prepare m_Prepare = new Prepare(); protected WaveFormat m_wfeInput; protected Crc32 m_nCRC; protected long m_nStoredCRC; protected int m_nSpecialCodes; public void SeekToFrame(int nFrameIndex) throws IOException { int nSeekRemainder = (m_spAPEInfo.getApeInfoSeekByte(nFrameIndex) - m_spAPEInfo.getApeInfoSeekByte(0)) % 4; m_spUnBitArray.FillAndResetBitArray(nFrameIndex == m_nRealFrame ? -1 : m_spAPEInfo.getApeInfoSeekByte(nFrameIndex) - nSeekRemainder, nSeekRemainder * 8); m_nRealFrame = nFrameIndex; } protected void DecodeBlocksToFrameBuffer(int nBlocks) throws IOException { // decode the samples int nBlocksProcessed = 0; try { if (m_wfeInput.nChannels == 2) { if ((m_nSpecialCodes & SpecialFrame.SPECIAL_FRAME_LEFT_SILENCE) > 0 && (m_nSpecialCodes & SpecialFrame.SPECIAL_FRAME_RIGHT_SILENCE) > 0) { for (nBlocksProcessed = 0; nBlocksProcessed < nBlocks; nBlocksProcessed++) { m_Prepare.unprepare(0, 0, m_wfeInput, m_cbFrameBuffer.GetDirectWritePointer(), m_nCRC); m_cbFrameBuffer.UpdateAfterDirectWrite(m_nBlockAlign); } } else if ((m_nSpecialCodes & SpecialFrame.SPECIAL_FRAME_PSEUDO_STEREO) > 0) { for (nBlocksProcessed = 0; nBlocksProcessed < nBlocks; nBlocksProcessed++) { int X = m_spNewPredictorX.DecompressValue(m_spUnBitArray.DecodeValueRange(m_BitArrayStateX)); m_Prepare.unprepare(X, 0, m_wfeInput, m_cbFrameBuffer.GetDirectWritePointer(), m_nCRC); m_cbFrameBuffer.UpdateAfterDirectWrite(m_nBlockAlign); } } else { if (m_spAPEInfo.getApeInfoFileVersion() >= 3950) { for (nBlocksProcessed = 0; nBlocksProcessed < nBlocks; nBlocksProcessed++) { int nY = m_spUnBitArray.DecodeValueRange(m_BitArrayStateY); int nX = m_spUnBitArray.DecodeValueRange(m_BitArrayStateX); int Y = m_spNewPredictorY.DecompressValue(nY, m_nLastX); int X = m_spNewPredictorX.DecompressValue(nX, Y); m_nLastX = X; m_Prepare.unprepare(X, Y, m_wfeInput, m_cbFrameBuffer.GetDirectWritePointer(), m_nCRC); m_cbFrameBuffer.UpdateAfterDirectWrite(m_nBlockAlign); } } else { for (nBlocksProcessed = 0; nBlocksProcessed < nBlocks; nBlocksProcessed++) { int X = m_spNewPredictorX.DecompressValue(m_spUnBitArray.DecodeValueRange(m_BitArrayStateX)); int Y = m_spNewPredictorY.DecompressValue(m_spUnBitArray.DecodeValueRange(m_BitArrayStateY)); m_Prepare.unprepare(X, Y, m_wfeInput, m_cbFrameBuffer.GetDirectWritePointer(), m_nCRC); m_cbFrameBuffer.UpdateAfterDirectWrite(m_nBlockAlign); } } } } else { if ((m_nSpecialCodes & SpecialFrame.SPECIAL_FRAME_MONO_SILENCE) > 0) { for (nBlocksProcessed = 0; nBlocksProcessed < nBlocks; nBlocksProcessed++) { m_Prepare.unprepare(0, 0, m_wfeInput, m_cbFrameBuffer.GetDirectWritePointer(), m_nCRC); m_cbFrameBuffer.UpdateAfterDirectWrite(m_nBlockAlign); } } else { for (nBlocksProcessed = 0; nBlocksProcessed < nBlocks; nBlocksProcessed++) { int X = m_spNewPredictorX.DecompressValue(m_spUnBitArray.DecodeValueRange(m_BitArrayStateX)); m_Prepare.unprepare(X, 0, m_wfeInput, m_cbFrameBuffer.GetDirectWritePointer(), m_nCRC); m_cbFrameBuffer.UpdateAfterDirectWrite(m_nBlockAlign); } } } } catch (JMACException e) { m_bErrorDecodingCurrentFrame = true; } m_nCurrentFrameBufferBlock += nBlocks; } protected void FillFrameBuffer() throws IOException { // determine the maximum blocks we can decode // note that we won't do end capping because we can't use data // until EndFrame(...) successfully handles the frame // that means we may decode a little extra in end capping cases // but this allows robust error handling of bad frames int nMaxBlocks = m_cbFrameBuffer.MaxAdd() / m_nBlockAlign; boolean invalidChecksum = false; // loop and decode data int nBlocksLeft = nMaxBlocks; while (nBlocksLeft > 0) { int nFrameBlocks = this.getApeInfoFrameBlocks(m_nCurrentFrame); if (nFrameBlocks < 0) break; int nFrameOffsetBlocks = m_nCurrentFrameBufferBlock % this.getApeInfoBlocksPerFrame(); int nFrameBlocksLeft = nFrameBlocks - nFrameOffsetBlocks; int nBlocksThisPass = Math.min(nFrameBlocksLeft, nBlocksLeft); // start the frame if we need to if (nFrameOffsetBlocks == 0) StartFrame(); // store the frame buffer bytes before we start int nFrameBufferBytes = m_cbFrameBuffer.MaxGet(); // decode data DecodeBlocksToFrameBuffer(nBlocksThisPass); // end the frame if we need to if ((nFrameOffsetBlocks + nBlocksThisPass) >= nFrameBlocks) { EndFrame(); if (m_bErrorDecodingCurrentFrame) { // remove any decoded data from the buffer m_cbFrameBuffer.RemoveTail(m_cbFrameBuffer.MaxGet() - nFrameBufferBytes); // add silence byte cSilence = (this.getApeInfoBitsPerSample() == 8) ? (byte) 127 : (byte) 0; for (int z = 0; z < nFrameBlocks * m_nBlockAlign; z++) { m_cbFrameBuffer.GetDirectWritePointer().append(cSilence); m_cbFrameBuffer.UpdateAfterDirectWrite(1); } // seek to try to synchronize after an error SeekToFrame(m_nCurrentFrame); // save the return value invalidChecksum = true; } } nBlocksLeft -= nBlocksThisPass; } if (invalidChecksum) throw new JMACException("Invalid Checksum"); } protected void StartFrame() throws IOException { m_nCRC = new Crc32(); // get the frame header m_nStoredCRC = m_spUnBitArray.DecodeValue(DecodeValueMethod.DECODE_VALUE_METHOD_UNSIGNED_INT); m_bErrorDecodingCurrentFrame = false; //get any 'special' codes if the file uses them (for silence, FALSE stereo, etc.) m_nSpecialCodes = 0; if (m_spAPEInfo.getApeInfoFileVersion() > 3820) { if ((m_nStoredCRC & 0x80000000L) > 0) { m_nSpecialCodes = (int) m_spUnBitArray.DecodeValue(DecodeValueMethod.DECODE_VALUE_METHOD_UNSIGNED_INT); } m_nStoredCRC &= 0x7fffffff; } m_spNewPredictorX.Flush(); m_spNewPredictorY.Flush(); m_spUnBitArray.FlushState(m_BitArrayStateX); m_spUnBitArray.FlushState(m_BitArrayStateY); m_spUnBitArray.FlushBitArray(); m_nLastX = 0; } protected void EndFrame() { m_nFrameBufferFinishedBlocks += this.getApeInfoFrameBlocks(m_nCurrentFrame); m_nCurrentFrame++; // finalize m_spUnBitArray.Finalize(); // check the CRC if (m_nCRC.checksum() != m_nStoredCRC) m_bErrorDecodingCurrentFrame = true; } protected void InitializeDecompressor() throws IOException { // check if we have anything to do if (m_bDecompressorInitialized) return; // update the initialized flag m_bDecompressorInitialized = true; // create a frame buffer m_cbFrameBuffer.CreateBuffer((this.getApeInfoBlocksPerFrame() + DECODE_BLOCK_SIZE) * m_nBlockAlign, m_nBlockAlign * 64); // create decoding components m_spUnBitArray = UnBitArrayBase.CreateUnBitArray(this, m_spAPEInfo.getApeInfoFileVersion()); if (m_spAPEInfo.getApeInfoFileVersion() >= 3950) { m_spNewPredictorX = new PredictorDecompress3950toCurrent(m_spAPEInfo.getApeInfoCompressionLevel(), m_spAPEInfo.getApeInfoFileVersion()); m_spNewPredictorY = new PredictorDecompress3950toCurrent(m_spAPEInfo.getApeInfoCompressionLevel(), m_spAPEInfo.getApeInfoFileVersion()); } else { m_spNewPredictorX = new PredictorDecompressNormal3930to3950(m_spAPEInfo.getApeInfoCompressionLevel(), m_spAPEInfo.getApeInfoFileVersion()); m_spNewPredictorY = new PredictorDecompressNormal3930to3950(m_spAPEInfo.getApeInfoCompressionLevel(), m_spAPEInfo.getApeInfoFileVersion()); } // seek to the beginning Seek(-1); } // more decoding components protected APEInfo m_spAPEInfo; protected UnBitArrayBase m_spUnBitArray; protected UnBitArrayState m_BitArrayStateX = new UnBitArrayState(); protected UnBitArrayState m_BitArrayStateY = new UnBitArrayState(); protected IPredictorDecompress m_spNewPredictorX; protected IPredictorDecompress m_spNewPredictorY; protected int m_nLastX; // decoding buffer protected boolean m_bErrorDecodingCurrentFrame; protected int m_nCurrentFrameBufferBlock; protected int m_nFrameBufferFinishedBlocks; protected CircleBuffer m_cbFrameBuffer = new CircleBuffer(); } jmac-1.74/core/src/davaguine/jmac/decoder/APEDecompressCore.java0000644000175000017500000002235310131230056024420 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.decoder; import davaguine.jmac.info.CompressionLevel; import davaguine.jmac.info.SpecialFrame; import davaguine.jmac.tools.JMACException; import java.io.IOException; import java.util.Arrays; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class APEDecompressCore { public APEDecompressCore(IAPEDecompress pAPEDecompress) { m_pAPEDecompress = pAPEDecompress; //initialize the bit array m_pUnBitArray = UnBitArrayBase.CreateUnBitArray(pAPEDecompress, pAPEDecompress.getApeInfoFileVersion()); if (pAPEDecompress.getApeInfoFileVersion() >= 3930) throw new JMACException("Wrong Version"); m_pAntiPredictorX = AntiPredictor.CreateAntiPredictor(pAPEDecompress.getApeInfoCompressionLevel(), pAPEDecompress.getApeInfoFileVersion()); m_pAntiPredictorY = AntiPredictor.CreateAntiPredictor(pAPEDecompress.getApeInfoCompressionLevel(), pAPEDecompress.getApeInfoFileVersion()); m_pDataX = new int[pAPEDecompress.getApeInfoBlocksPerFrame() + 16]; m_pDataY = new int[pAPEDecompress.getApeInfoBlocksPerFrame() + 16]; m_pTempData = new int[pAPEDecompress.getApeInfoBlocksPerFrame() + 16]; m_nBlocksProcessed = 0; } public void GenerateDecodedArrays(int nBlocks, int nSpecialCodes, int nFrameIndex) throws IOException { if (m_pAPEDecompress.getApeInfoChannels() == 2) { if ((nSpecialCodes & SpecialFrame.SPECIAL_FRAME_LEFT_SILENCE) > 0 && (nSpecialCodes & SpecialFrame.SPECIAL_FRAME_RIGHT_SILENCE) > 0) { Arrays.fill(m_pDataX, 0, nBlocks, 0); Arrays.fill(m_pDataY, 0, nBlocks, 0); } else if ((nSpecialCodes & SpecialFrame.SPECIAL_FRAME_PSEUDO_STEREO) > 0) { GenerateDecodedArray(m_pDataX, nBlocks, nFrameIndex, m_pAntiPredictorX); Arrays.fill(m_pDataY, 0, nBlocks, 0); } else { GenerateDecodedArray(m_pDataX, nBlocks, nFrameIndex, m_pAntiPredictorX); GenerateDecodedArray(m_pDataY, nBlocks, nFrameIndex, m_pAntiPredictorY); } } else { if ((nSpecialCodes & SpecialFrame.SPECIAL_FRAME_LEFT_SILENCE) > 0) Arrays.fill(m_pDataX, 0, nBlocks, 0); else GenerateDecodedArray(m_pDataX, nBlocks, nFrameIndex, m_pAntiPredictorX); } } public void GenerateDecodedArray(int[] Input_Array, int Number_of_Elements, int Frame_Index, AntiPredictor pAntiPredictor) throws IOException { final int nFrameBytes = m_pAPEDecompress.getApeInfoFrameBytes(Frame_Index); //run the prediction sequence switch (m_pAPEDecompress.getApeInfoCompressionLevel()) { case CompressionLevel.COMPRESSION_LEVEL_FAST: if (m_pAPEDecompress.getApeInfoFileVersion() < 3320) { m_pUnBitArray.GenerateArray(m_pTempData, Number_of_Elements, nFrameBytes); pAntiPredictor.AntiPredict(m_pTempData, Input_Array, Number_of_Elements); } else { m_pUnBitArray.GenerateArray(Input_Array, Number_of_Elements, nFrameBytes); pAntiPredictor.AntiPredict(Input_Array, null, Number_of_Elements); } break; case CompressionLevel.COMPRESSION_LEVEL_NORMAL: { //get the array from the bitstream m_pUnBitArray.GenerateArray(m_pTempData, Number_of_Elements, nFrameBytes); pAntiPredictor.AntiPredict(m_pTempData, Input_Array, Number_of_Elements); break; } case CompressionLevel.COMPRESSION_LEVEL_HIGH: //get the array from the bitstream m_pUnBitArray.GenerateArray(m_pTempData, Number_of_Elements, nFrameBytes); pAntiPredictor.AntiPredict(m_pTempData, Input_Array, Number_of_Elements); break; case CompressionLevel.COMPRESSION_LEVEL_EXTRA_HIGH: long nNumberOfCoefficients; if (m_pAPEDecompress.getApeInfoFileVersion() < 3320) { nNumberOfCoefficients = m_pUnBitArray.DecodeValue(DecodeValueMethod.DECODE_VALUE_METHOD_X_BITS, 4); for (int z = 0; z <= nNumberOfCoefficients; z++) { aryCoefficientsA[z] = m_pUnBitArray.DecodeValue(DecodeValueMethod.DECODE_VALUE_METHOD_X_BITS, 6); aryCoefficientsB[z] = m_pUnBitArray.DecodeValue(DecodeValueMethod.DECODE_VALUE_METHOD_X_BITS, 6); } m_pUnBitArray.GenerateArray(m_pTempData, Number_of_Elements, nFrameBytes); ((AntiPredictorExtraHigh0000To3320) pAntiPredictor).AntiPredict(m_pTempData, Input_Array, Number_of_Elements, (int) nNumberOfCoefficients, aryCoefficientsA, aryCoefficientsB); } else if (m_pAPEDecompress.getApeInfoFileVersion() < 3600) { nNumberOfCoefficients = m_pUnBitArray.DecodeValue(DecodeValueMethod.DECODE_VALUE_METHOD_X_BITS, 3); for (int z = 0; z <= nNumberOfCoefficients; z++) { aryCoefficientsA[z] = m_pUnBitArray.DecodeValue(DecodeValueMethod.DECODE_VALUE_METHOD_X_BITS, 5); aryCoefficientsB[z] = m_pUnBitArray.DecodeValue(DecodeValueMethod.DECODE_VALUE_METHOD_X_BITS, 5); } m_pUnBitArray.GenerateArray(m_pTempData, Number_of_Elements, nFrameBytes); ((AntiPredictorExtraHigh3320To3600) pAntiPredictor).AntiPredict(m_pTempData, Input_Array, Number_of_Elements, (int) nNumberOfCoefficients, aryCoefficientsA, aryCoefficientsB); } else if (m_pAPEDecompress.getApeInfoFileVersion() < 3700) { nNumberOfCoefficients = m_pUnBitArray.DecodeValue(DecodeValueMethod.DECODE_VALUE_METHOD_X_BITS, 3); for (int z = 0; z <= nNumberOfCoefficients; z++) { aryCoefficientsA[z] = m_pUnBitArray.DecodeValue(DecodeValueMethod.DECODE_VALUE_METHOD_X_BITS, 6); aryCoefficientsB[z] = m_pUnBitArray.DecodeValue(DecodeValueMethod.DECODE_VALUE_METHOD_X_BITS, 6); } m_pUnBitArray.GenerateArray(m_pTempData, Number_of_Elements, nFrameBytes); ((AntiPredictorExtraHigh3600To3700) pAntiPredictor).AntiPredict(m_pTempData, Input_Array, Number_of_Elements, (int) nNumberOfCoefficients, aryCoefficientsA, aryCoefficientsB); } else if (m_pAPEDecompress.getApeInfoFileVersion() < 3800) { nNumberOfCoefficients = m_pUnBitArray.DecodeValue(DecodeValueMethod.DECODE_VALUE_METHOD_X_BITS, 3); for (int z = 0; z <= nNumberOfCoefficients; z++) { aryCoefficientsA[z] = m_pUnBitArray.DecodeValue(DecodeValueMethod.DECODE_VALUE_METHOD_X_BITS, 6); aryCoefficientsB[z] = m_pUnBitArray.DecodeValue(DecodeValueMethod.DECODE_VALUE_METHOD_X_BITS, 6); } m_pUnBitArray.GenerateArray(m_pTempData, Number_of_Elements, nFrameBytes); ((AntiPredictorExtraHigh3700To3800) pAntiPredictor).AntiPredict(m_pTempData, Input_Array, Number_of_Elements, (int) nNumberOfCoefficients, aryCoefficientsA, aryCoefficientsB); } else { m_pUnBitArray.GenerateArray(m_pTempData, Number_of_Elements, nFrameBytes); ((AntiPredictorExtraHigh3800ToCurrent) pAntiPredictor).AntiPredict(m_pTempData, Input_Array, Number_of_Elements, m_pAPEDecompress.getApeInfoFileVersion()); } break; } } public UnBitArrayBase GetUnBitArrray() { return m_pUnBitArray; } private long[] aryCoefficientsA = new long[64]; private long[] aryCoefficientsB = new long[64]; public int[] m_pTempData; public int[] m_pDataX; public int[] m_pDataY; public AntiPredictor m_pAntiPredictorX; public AntiPredictor m_pAntiPredictorY; public UnBitArrayBase m_pUnBitArray; public UnBitArrayState m_BitArrayStateX = new UnBitArrayState(); public UnBitArrayState m_BitArrayStateY = new UnBitArrayState(); public IAPEDecompress m_pAPEDecompress; public int m_nBlocksProcessed; } jmac-1.74/core/src/davaguine/jmac/decoder/APEDecompressNative.java0000644000175000017500000000606310131230056024756 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.decoder; import davaguine.jmac.info.APEInfo; import davaguine.jmac.tools.File; import davaguine.jmac.tools.JMACException; import java.io.IOException; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class APEDecompressNative extends APEDecompress { private final int ID; private int m_nRealFrame; static { System.loadLibrary("jmac"); } public APEDecompressNative(APEInfo pAPEInfo) { this(pAPEInfo, -1, -1); } public APEDecompressNative(APEInfo pAPEInfo, int nStartBlock) { this(pAPEInfo, nStartBlock, -1); } public APEDecompressNative(APEInfo pAPEInfo, int nStartBlock, int nFinishBlock) { super(pAPEInfo, nStartBlock, nFinishBlock); ID = registerDecoder(this.getApeInfoIoSource(), this.getApeInfoFileVersion(), this.getApeInfoCompressionLevel(), nStartBlock, nFinishBlock, this.getApeInfoTotalBlocks(), this.getApeInfoBlockAlign(), this.getApeInfoBlocksPerFrame(), this.getApeInfoSampleRate(), this.getApeInfoBitsPerSample(), this.getApeInfoChannels()); if (ID < 0) throw new JMACException("The Native APE Decoder Can't Be Instantiated"); m_nRealFrame = 0; } public void finalize() { finalize(ID, this.getApeInfoIoSource()); } public int GetData(byte[] pBuffer, int nBlocks) throws IOException { int nBlocksRetrieved = GetData(ID, this.getApeInfoIoSource(), pBuffer, nBlocks); m_nCurrentBlock += nBlocksRetrieved; return nBlocksRetrieved; } public void Seek(int nBlockOffset) throws IOException { Seek(ID, this.getApeInfoIoSource(), nBlockOffset); } private native int registerDecoder(File io, int nVersion, int nCompressionLevel, int nStartBlock, int nFinishBlock, int nTotalBlocks, int nBlockAlign, int nBlocksPerFrame, int nSampleRate, int nBitsPerSample, int nChannels); private native void finalize(int ID, File io); private native int GetData(int ID, File io, byte[] pBuffer, int nBlocks); private native void Seek(int ID, File io, int nBlockOffset) throws IOException; } jmac-1.74/core/src/davaguine/jmac/decoder/APEDecompressOld.java0000644000175000017500000003203010131230056024237 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.decoder; import davaguine.jmac.info.*; import davaguine.jmac.tools.ByteBuffer; import davaguine.jmac.tools.File; import davaguine.jmac.tools.JMACException; import java.io.IOException; import java.util.Arrays; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class APEDecompressOld extends IAPEDecompress { public APEDecompressOld(APEInfo pAPEInfo) { this(pAPEInfo, -1, -1); } public APEDecompressOld(APEInfo pAPEInfo, int nStartBlock) { this(pAPEInfo, nStartBlock, -1); } public APEDecompressOld(APEInfo pAPEInfo, int nStartBlock, int nFinishBlock) { // open / analyze the file m_spAPEInfo = pAPEInfo; // version check (this implementation only works with 3.92 and earlier files) if (getApeInfoFileVersion() > 3920) throw new JMACException("Wrong Version"); // create the buffer m_nBlockAlign = getApeInfoBlockAlign(); // initialize other stuff m_nBufferTail = 0; m_bDecompressorInitialized = false; m_nCurrentFrame = 0; m_nCurrentBlock = 0; // set the "real" start and finish blocks m_nStartBlock = (nStartBlock < 0) ? 0 : Math.min(nStartBlock, getApeInfoTotalBlocks()); m_nFinishBlock = (nFinishBlock < 0) ? getApeInfoTotalBlocks() : Math.min(nFinishBlock, getApeInfoTotalBlocks()); m_bIsRanged = (m_nStartBlock != 0) || (m_nFinishBlock != getApeInfoTotalBlocks()); } public int GetData(byte[] pBuffer, int nBlocks) throws IOException { InitializeDecompressor(); // cap int nBlocksUntilFinish = m_nFinishBlock - m_nCurrentBlock; nBlocks = Math.min(nBlocks, nBlocksUntilFinish); int nBlocksRetrieved = 0; //fulfill as much of the request as possible int nTotalBytesNeeded = nBlocks * m_nBlockAlign; int nBytesLeft = nTotalBytesNeeded; int nBlocksDecoded = 1; while (nBytesLeft > 0 && nBlocksDecoded > 0) { //empty the buffer int nBytesAvailable = m_nBufferTail; int nIntialBytes = Math.min(nBytesLeft, nBytesAvailable); if (nIntialBytes > 0) { System.arraycopy(m_spBuffer, 0, pBuffer, nTotalBytesNeeded - nBytesLeft, nIntialBytes); if ((m_nBufferTail - nIntialBytes) > 0) System.arraycopy(m_spBuffer, nIntialBytes, m_spBuffer, 0, m_nBufferTail - nIntialBytes); nBytesLeft -= nIntialBytes; m_nBufferTail -= nIntialBytes; } //decode more if (nBytesLeft > 0) { output.reset(m_spBuffer, m_nBufferTail); nBlocksDecoded = m_UnMAC.DecompressFrame(output, m_nCurrentFrame++); m_nBufferTail += (nBlocksDecoded * m_nBlockAlign); } } nBlocksRetrieved = (nTotalBytesNeeded - nBytesLeft) / m_nBlockAlign; // update the position m_nCurrentBlock += nBlocksRetrieved; return nBlocksRetrieved; } public void Seek(int nBlockOffset) throws IOException { InitializeDecompressor(); // use the offset nBlockOffset += m_nStartBlock; // cap (to prevent seeking too far) if (nBlockOffset >= m_nFinishBlock) nBlockOffset = m_nFinishBlock - 1; if (nBlockOffset < m_nStartBlock) nBlockOffset = m_nStartBlock; // flush the buffer m_nBufferTail = 0; // seek to the perfect location int nBaseFrame = nBlockOffset / getApeInfoBlocksPerFrame(); int nBlocksToSkip = nBlockOffset % getApeInfoBlocksPerFrame(); int nBytesToSkip = nBlocksToSkip * m_nBlockAlign; // skip necessary blocks int nMaximumDecompressedFrameBytes = m_nBlockAlign * getApeInfoBlocksPerFrame(); byte[] pTempBuffer = new byte[nMaximumDecompressedFrameBytes + 16]; Arrays.fill(pTempBuffer, (byte) 0); m_nCurrentFrame = nBaseFrame; output.reset(pTempBuffer); int nBlocksDecoded = m_UnMAC.DecompressFrame(output, m_nCurrentFrame++); if (nBlocksDecoded == -1) throw new JMACException("Error While Decoding"); int nBytesToKeep = (nBlocksDecoded * m_nBlockAlign) - nBytesToSkip; System.arraycopy(pTempBuffer, nBytesToSkip, m_spBuffer, m_nBufferTail, nBytesToKeep); m_nBufferTail += nBytesToKeep; m_nCurrentBlock = nBlockOffset; } // buffer protected byte[] m_spBuffer; protected int m_nBufferTail; protected ByteBuffer output = new ByteBuffer(); // file info protected int m_nBlockAlign; protected int m_nCurrentFrame; // start / finish information protected int m_nStartBlock; protected int m_nFinishBlock; protected int m_nCurrentBlock; protected boolean m_bIsRanged; // decoding tools protected UnMAC m_UnMAC = new UnMAC(); protected APEInfo m_spAPEInfo; protected boolean m_bDecompressorInitialized; protected void InitializeDecompressor() throws IOException { // check if we have anything to do if (m_bDecompressorInitialized) return; // initialize the core m_UnMAC.Initialize(this); int nMaximumDecompressedFrameBytes = m_nBlockAlign * getApeInfoBlocksPerFrame(); int nTotalBufferBytes = Math.max(65536, (nMaximumDecompressedFrameBytes + 16) * 2); m_spBuffer = new byte[nTotalBufferBytes]; // update the initialized flag m_bDecompressorInitialized = true; // seek to the beginning Seek(0); } public int getApeInfoDecompressCurrentBlock() { return m_nCurrentBlock - m_nStartBlock; } public int getApeInfoDecompressCurrentMS() { int nSampleRate = m_spAPEInfo.getApeInfoSampleRate(); if (nSampleRate > 0) return (int) ((m_nCurrentBlock * 1000L) / nSampleRate); return 0; } public int getApeInfoDecompressTotalBlocks() { return m_nFinishBlock - m_nStartBlock; } public int getApeInfoDecompressLengthMS() { int nSampleRate = m_spAPEInfo.getApeInfoSampleRate(); if (nSampleRate > 0) return (int) (((m_nFinishBlock - m_nStartBlock) * 1000L) / nSampleRate); return 0; } public int getApeInfoDecompressCurrentBitRate() throws IOException { return m_spAPEInfo.getApeInfoFrameBitrate(m_nCurrentFrame); } public int getApeInfoDecompressAverageBitrate() throws IOException { if (m_bIsRanged) { // figure the frame range int nBlocksPerFrame = m_spAPEInfo.getApeInfoBlocksPerFrame(); int nStartFrame = m_nStartBlock / nBlocksPerFrame; int nFinishFrame = (m_nFinishBlock + nBlocksPerFrame - 1) / nBlocksPerFrame; // get the number of bytes in the first and last frame int nTotalBytes = (m_spAPEInfo.getApeInfoFrameBytes(nStartFrame) * (m_nStartBlock % nBlocksPerFrame)) / nBlocksPerFrame; if (nFinishFrame != nStartFrame) nTotalBytes += (m_spAPEInfo.getApeInfoFrameBytes(nFinishFrame) * (m_nFinishBlock % nBlocksPerFrame)) / nBlocksPerFrame; // get the number of bytes in between int nTotalFrames = m_spAPEInfo.getApeInfoTotalFrames(); for (int nFrame = nStartFrame + 1; (nFrame < nFinishFrame) && (nFrame < nTotalFrames); nFrame++) nTotalBytes += m_spAPEInfo.getApeInfoFrameBytes(nFrame); // figure the bitrate int nTotalMS = (int) (((m_nFinishBlock - m_nStartBlock) * 1000L) / m_spAPEInfo.getApeInfoSampleRate()); if (nTotalMS != 0) return (nTotalBytes * 8) / nTotalMS; } else { return m_spAPEInfo.getApeInfoAverageBitrate(); } return 0; } public int getApeInfoWavHeaderBytes() { if (m_bIsRanged) return WaveHeader.WAVE_HEADER_BYTES; return m_spAPEInfo.getApeInfoWavHeaderBytes(); } public byte[] getApeInfoWavHeaderData(int nMaxBytes) { if (m_bIsRanged) { if (WaveHeader.WAVE_HEADER_BYTES > nMaxBytes) return null; else { WaveFormat wfeFormat = m_spAPEInfo.getApeInfoWaveFormatEx(); WaveHeader WAVHeader = new WaveHeader(); WaveHeader.FillWaveHeader(WAVHeader, (m_nFinishBlock - m_nStartBlock) * m_spAPEInfo.getApeInfoBlockAlign(), wfeFormat, 0); return WAVHeader.write(); } } return m_spAPEInfo.getApeInfoWavHeaderData(nMaxBytes); } public int getApeInfoWavTerminatingBytes() { if (m_bIsRanged) return 0; else return m_spAPEInfo.getApeInfoWavTerminatingBytes(); } public byte[] getApeInfoWavTerminatingData(int nMaxBytes) throws IOException { if (m_bIsRanged) return null; else return m_spAPEInfo.getApeInfoWavTerminatingData(nMaxBytes); } public WaveFormat getApeInfoWaveFormatEx() { return m_spAPEInfo.getApeInfoWaveFormatEx(); } public File getApeInfoIoSource() { return m_spAPEInfo.getApeInfoIoSource(); } public int getApeInfoBlocksPerFrame() { return m_spAPEInfo.getApeInfoBlocksPerFrame(); } public int getApeInfoFileVersion() { return m_spAPEInfo.getApeInfoFileVersion(); } public int getApeInfoCompressionLevel() { return m_spAPEInfo.getApeInfoCompressionLevel(); } public int getApeInfoFormatFlags() { return m_spAPEInfo.getApeInfoFormatFlags(); } public int getApeInfoSampleRate() { return m_spAPEInfo.getApeInfoSampleRate(); } public int getApeInfoBitsPerSample() { return m_spAPEInfo.getApeInfoBitsPerSample(); } public int getApeInfoBytesPerSample() { return m_spAPEInfo.getApeInfoBytesPerSample(); } public int getApeInfoChannels() { return m_spAPEInfo.getApeInfoChannels(); } public int getApeInfoBlockAlign() { return m_spAPEInfo.getApeInfoBlockAlign(); } public int getApeInfoFinalFrameBlocks() { return m_spAPEInfo.getApeInfoFinalFrameBlocks(); } public int getApeInfoTotalFrames() { return m_spAPEInfo.getApeInfoTotalFrames(); } public int getApeInfoWavDataBytes() { return m_spAPEInfo.getApeInfoWavDataBytes(); } public int getApeInfoWavTotalBytes() { return m_spAPEInfo.getApeInfoWavTotalBytes(); } public int getApeInfoApeTotalBytes() { return m_spAPEInfo.getApeInfoApeTotalBytes(); } public int getApeInfoTotalBlocks() { return m_spAPEInfo.getApeInfoTotalBlocks(); } public int getApeInfoLengthMs() { return m_spAPEInfo.getApeInfoLengthMs(); } public int getApeInfoAverageBitrate() { return m_spAPEInfo.getApeInfoAverageBitrate(); } public int getApeInfoSeekByte(int nFrame) { return m_spAPEInfo.getApeInfoSeekByte(nFrame); } public int getApeInfoFrameBytes(int nFrame) throws IOException { return m_spAPEInfo.getApeInfoFrameBytes(nFrame); } public int getApeInfoFrameBlocks(int nFrame) { return m_spAPEInfo.getApeInfoFrameBlocks(nFrame); } public int getApeInfoFrameBitrate(int nFrame) throws IOException { return m_spAPEInfo.getApeInfoFrameBitrate(nFrame); } public int getApeInfoDecompressedBitrate() { return m_spAPEInfo.getApeInfoDecompressedBitrate(); } public int getApeInfoPeakLevel() { return m_spAPEInfo.getApeInfoPeakLevel(); } public int getApeInfoSeekBit(int nFrame) { return m_spAPEInfo.getApeInfoSeekBit(nFrame); } public APETag getApeInfoTag() { return m_spAPEInfo.getApeInfoTag(); } public APEFileInfo getApeInfoInternalInfo() { return m_spAPEInfo.getApeInfoInternalInfo(); } } jmac-1.74/core/src/davaguine/jmac/decoder/DecodeValueMethod.java0000644000175000017500000000237310131230056024476 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.decoder; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class DecodeValueMethod { public final static int DECODE_VALUE_METHOD_UNSIGNED_INT = 0; public final static int DECODE_VALUE_METHOD_UNSIGNED_RICE = 1; public final static int DECODE_VALUE_METHOD_X_BITS = 2; } jmac-1.74/core/src/davaguine/jmac/decoder/IAPEDecompress.java0000644000175000017500000002015410131230056023715 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.decoder; import davaguine.jmac.info.*; import davaguine.jmac.tools.File; import davaguine.jmac.tools.Globals; import davaguine.jmac.tools.JMACException; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public abstract class IAPEDecompress { ////////////////////////////////////////////////////////////////////////////////////////////// // GetData(...) - gets raw decompressed audio // // Parameters: // char * pBuffer // a pointer to a buffer to put the data into // int nBlocks // the number of audio blocks desired (see note at intro about blocks vs. samples) // int * pBlocksRetrieved // the number of blocks actually retrieved (could be less at end of file or on critical failure) ////////////////////////////////////////////////////////////////////////////////////////////// public abstract int GetData(byte[] pBuffer, int nBlocks) throws IOException; ////////////////////////////////////////////////////////////////////////////////////////////// // Seek(...) - seeks // // Parameters: // int nBlockOffset // the block to seek to (see note at intro about blocks vs. samples) ////////////////////////////////////////////////////////////////////////////////////////////// public abstract void Seek(int nBlockOffset) throws IOException; /** * ****************************************************************************************** * Get Information * ******************************************************************************************* */ public abstract int getApeInfoDecompressCurrentBlock(); public abstract int getApeInfoDecompressCurrentMS(); public abstract int getApeInfoDecompressTotalBlocks(); public abstract int getApeInfoDecompressLengthMS(); public abstract int getApeInfoDecompressCurrentBitRate() throws IOException; public abstract int getApeInfoDecompressAverageBitrate() throws IOException; public abstract File getApeInfoIoSource(); public abstract int getApeInfoBlocksPerFrame(); public abstract int getApeInfoFileVersion(); public abstract int getApeInfoCompressionLevel(); public abstract int getApeInfoFormatFlags(); public abstract int getApeInfoSampleRate(); public abstract int getApeInfoBitsPerSample(); public abstract int getApeInfoBytesPerSample(); public abstract int getApeInfoChannels(); public abstract int getApeInfoBlockAlign(); public abstract int getApeInfoFinalFrameBlocks(); public abstract int getApeInfoTotalFrames(); public abstract int getApeInfoWavHeaderBytes(); public abstract int getApeInfoWavTerminatingBytes(); public abstract int getApeInfoWavDataBytes(); public abstract int getApeInfoWavTotalBytes(); public abstract int getApeInfoApeTotalBytes(); public abstract int getApeInfoTotalBlocks(); public abstract int getApeInfoLengthMs(); public abstract int getApeInfoAverageBitrate(); public abstract int getApeInfoSeekByte(int nFrame); public abstract int getApeInfoFrameBytes(int nFrame) throws IOException; public abstract int getApeInfoFrameBlocks(int nFrame); public abstract int getApeInfoFrameBitrate(int nFrame) throws IOException; public abstract int getApeInfoDecompressedBitrate(); public abstract int getApeInfoPeakLevel(); public abstract int getApeInfoSeekBit(int nFrame); public abstract WaveFormat getApeInfoWaveFormatEx(); public abstract byte[] getApeInfoWavHeaderData(int nMaxBytes); public abstract APETag getApeInfoTag(); public abstract byte[] getApeInfoWavTerminatingData(int nMaxBytes) throws IOException; public abstract APEFileInfo getApeInfoInternalInfo(); public static IAPEDecompress CreateIAPEDecompressCore(APEInfo pAPEInfo, int nStartBlock, int nFinishBlock) { IAPEDecompress pAPEDecompress = null; if (pAPEInfo != null) { if (pAPEInfo.getApeInfoFileVersion() >= 3930) { if (Globals.NATIVE) pAPEDecompress = new APEDecompressNative(pAPEInfo, nStartBlock, nFinishBlock); else pAPEDecompress = new APEDecompress(pAPEInfo, nStartBlock, nFinishBlock); } else pAPEDecompress = new APEDecompressOld(pAPEInfo, nStartBlock, nFinishBlock); } return pAPEDecompress; } public static APEInfo CreateAPEInfo(File in) throws IOException { // variables APEInfo pAPEInfo = null; // get the extension if (in.isLocal()) { final String pExtension = in.getExtension(); // take the appropriate action (based on the extension) if (pExtension.toLowerCase().equals(".mac") || pExtension.toLowerCase().equals(".ape")) // plain .ape file pAPEInfo = new APEInfo(in); } else pAPEInfo = new APEInfo(in); // fail if we couldn't get the file information if (pAPEInfo == null) throw new JMACException("Invalid Input File"); return pAPEInfo; } public static IAPEDecompress CreateIAPEDecompress(File in) throws IOException { // variables APEInfo pAPEInfo = null; int nStartBlock = -1; int nFinishBlock = -1; // get the extension if (in.isLocal()) { final String pFilename = in.getFilename(); final String pExtension = in.getExtension(); // take the appropriate action (based on the extension) if (pExtension.toLowerCase().equals(".apl")) { // "link" file (.apl linked large APE file) APELink APELink = new APELink(pFilename); if (APELink.GetIsLinkFile()) { URL url = null; try { url = new URL(APELink.GetImageFilename()); pAPEInfo = new APEInfo(url); } catch (MalformedURLException e) { pAPEInfo = new APEInfo(new java.io.File(APELink.GetImageFilename())); } nStartBlock = APELink.GetStartBlock(); nFinishBlock = APELink.GetFinishBlock(); } } else if (pExtension.toLowerCase().equals(".mac") || pExtension.toLowerCase().equals(".ape")) // plain .ape file pAPEInfo = new APEInfo(in); } else pAPEInfo = new APEInfo(in); // fail if we couldn't get the file information if (pAPEInfo == null) throw new JMACException("Invalid Input File"); // create and return IAPEDecompress pAPEDecompress = CreateIAPEDecompressCore(pAPEInfo, nStartBlock, nFinishBlock); return pAPEDecompress; } public static IAPEDecompress CreateIAPEDecompressEx(APEInfo pAPEInfo, int nStartBlock, int nFinishBlock) { return CreateIAPEDecompressCore(pAPEInfo, nStartBlock, nFinishBlock); } } jmac-1.74/core/src/davaguine/jmac/decoder/RangeCoderStructDecompress.java0000644000175000017500000000233110131230056026412 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.decoder; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class RangeCoderStructDecompress { public long low; //low end of interval public long range; //length of interval public long buffer; //buffer for input/output } jmac-1.74/core/src/davaguine/jmac/decoder/UnBitArray.java0000644000175000017500000003572010131230056023177 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.decoder; import davaguine.jmac.tools.File; import java.io.IOException; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class UnBitArray extends UnBitArrayBase { private final static long RANGE_TOTAL_1[] = {0, 14824, 28224, 39348, 47855, 53994, 58171, 60926, 62682, 63786, 64463, 64878, 65126, 65276, 65365, 65419, 65450, 65469, 65480, 65487, 65491, 65493, 65494, 65495, 65496, 65497, 65498, 65499, 65500, 65501, 65502, 65503, 65504, 65505, 65506, 65507, 65508, 65509, 65510, 65511, 65512, 65513, 65514, 65515, 65516, 65517, 65518, 65519, 65520, 65521, 65522, 65523, 65524, 65525, 65526, 65527, 65528, 65529, 65530, 65531, 65532, 65533, 65534, 65535, 65536}; private final static long RANGE_WIDTH_1[] = {14824, 13400, 11124, 8507, 6139, 4177, 2755, 1756, 1104, 677, 415, 248, 150, 89, 54, 31, 19, 11, 7, 4, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; private final static long RANGE_TOTAL_2[] = {0, 19578, 36160, 48417, 56323, 60899, 63265, 64435, 64971, 65232, 65351, 65416, 65447, 65466, 65476, 65482, 65485, 65488, 65490, 65491, 65492, 65493, 65494, 65495, 65496, 65497, 65498, 65499, 65500, 65501, 65502, 65503, 65504, 65505, 65506, 65507, 65508, 65509, 65510, 65511, 65512, 65513, 65514, 65515, 65516, 65517, 65518, 65519, 65520, 65521, 65522, 65523, 65524, 65525, 65526, 65527, 65528, 65529, 65530, 65531, 65532, 65533, 65534, 65535, 65536}; private final static long RANGE_WIDTH_2[] = {19578, 16582, 12257, 7906, 4576, 2366, 1170, 536, 261, 119, 65, 31, 19, 10, 6, 3, 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, }; private final static long K_SUM_MIN_BOUNDARY[] = {0, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576, 2097152, 4194304, 8388608, 16777216, 33554432, 67108864, 134217728, 268435456, 536870912, 1073741824, 2147483648L, 0, 0, 0, 0}; private final static long CODE_BITS = 32; private final static long TOP_VALUE = ((long) 1 << (CODE_BITS - 1)); private final static long EXTRA_BITS = ((CODE_BITS - 2) % 8 + 1); private final static long BOTTOM_VALUE = (TOP_VALUE >> 8); private final static int RANGE_OVERFLOW_SHIFT = 16; private final static int MODEL_ELEMENTS = 64; //construction/destruction public UnBitArray(File pIO, int nVersion) { CreateHelper(pIO, 16384, nVersion); } public long DecodeValue(int DecodeMethod, int nParam1, int nParam2) throws IOException { if (DecodeMethod == DecodeValueMethod.DECODE_VALUE_METHOD_UNSIGNED_INT) return DecodeValueXBits(32); return 0; } public void GenerateArray(int[] pOutputArray, int nElements) throws IOException { GenerateArray(pOutputArray, nElements, -1); } public void GenerateArray(int[] pOutputArray, int nElements, int nBytesRequired) throws IOException { GenerateArrayRange(pOutputArray, nElements); } public int DecodeValueRange(UnBitArrayState BitArrayState) throws IOException { // make sure there is room for the data // this is a little slower than ensuring a huge block to start with, but it's safer if (m_nCurrentBitIndex > m_nRefillBitThreshold) FillBitArray(); int nValue = 0; if (m_nVersion >= 3990) { // figure the pivot value int nPivotValue = Math.max(BitArrayState.nKSum / 32, 1); // get the overflow int nOverflow = 0; { // decode int nRangeTotal = RangeDecodeFast(RANGE_OVERFLOW_SHIFT); // lookup the symbol (must be a faster way than this) long al1[] = RANGE_TOTAL_2; if (nRangeTotal > 65416) { int low = 12; nOverflow = 64; int mid = 38; long midVal = al1[38]; do { if (midVal < nRangeTotal) low = mid + 1; else if (midVal > nRangeTotal) nOverflow = mid - 1; else { nOverflow = mid; break; } mid = (low + nOverflow) >> 1; midVal = al1[mid]; } while (low <= nOverflow); } else { nOverflow = 1; while (nRangeTotal >= al1[nOverflow]) nOverflow++; nOverflow--; } // update RangeCoderStructDecompress range = m_RangeCoderInfo; range.low -= range.range * al1[nOverflow]; range.range *= RANGE_WIDTH_2[nOverflow]; // get the working k if (nOverflow == (MODEL_ELEMENTS - 1)) { nOverflow = RangeDecodeFastWithUpdate(16); nOverflow <<= 16; nOverflow |= RangeDecodeFastWithUpdate(16); } } // get the value int nBase = 0; { if (nPivotValue >= (1 << 16)) { int nPivotValueBits = 0; while ((nPivotValue >> nPivotValueBits) > 0) { nPivotValueBits++; } int nSplitFactor = 1 << (nPivotValueBits - 16); int nPivotValueA = (nPivotValue / nSplitFactor) + 1; int nPivotValueB = nSplitFactor; RangeCoderStructDecompress range = m_RangeCoderInfo; while (range.range <= BOTTOM_VALUE) { range.buffer = (range.buffer << 8) | ((m_pBitArray[(int) (m_nCurrentBitIndex >> 5)] >> (24 - (m_nCurrentBitIndex & 31))) & 0xFF); m_nCurrentBitIndex += 8; range.low = (range.low << 8) | ((range.buffer >> 1) & 0xFF); range.range <<= 8; } range.range = range.range / nPivotValueA; int nBaseA = (int) (range.low / range.range); range.low -= range.range * nBaseA; while (range.range <= BOTTOM_VALUE) { range.buffer = (range.buffer << 8) | ((m_pBitArray[(int) (m_nCurrentBitIndex >> 5)] >> (24 - (m_nCurrentBitIndex & 31))) & 0xFF); m_nCurrentBitIndex += 8; range.low = (range.low << 8) | ((range.buffer >> 1) & 0xFF); range.range <<= 8; } range.range = range.range / nPivotValueB; int nBaseB = (int) (range.low / range.range); range.low -= range.range * nBaseB; nBase = nBaseA * nSplitFactor + nBaseB; } else { RangeCoderStructDecompress range = m_RangeCoderInfo; while (range.range <= BOTTOM_VALUE) { range.buffer = (range.buffer << 8) | ((m_pBitArray[(int) (m_nCurrentBitIndex >> 5)] >> (24 - (m_nCurrentBitIndex & 31))) & 0xFF); m_nCurrentBitIndex += 8; range.low = (range.low << 8) | ((range.buffer >> 1) & 0xFF); range.range <<= 8; } // decode range.range = range.range / nPivotValue; int nBaseLower = (int) (range.low / range.range); range.low -= range.range * nBaseLower; nBase = nBaseLower; } } // build the value nValue = nBase + (nOverflow * nPivotValue); } else { // decode int nRangeTotal = RangeDecodeFast(RANGE_OVERFLOW_SHIFT); // lookup the symbol (must be a faster way than this) long al1[] = RANGE_TOTAL_1; int nOverflow; if (nRangeTotal > 64878) { int low = 12; nOverflow = 64; int mid = 38; long midVal = al1[38]; do { if (midVal < nRangeTotal) low = mid + 1; else if (midVal > nRangeTotal) nOverflow = mid - 1; else { nOverflow = mid; break; } mid = (low + nOverflow) >> 1; midVal = al1[mid]; } while (low <= nOverflow); } else { nOverflow = 1; while (nRangeTotal >= al1[nOverflow]) nOverflow++; nOverflow--; } // update RangeCoderStructDecompress range = m_RangeCoderInfo; range.low -= range.range * al1[nOverflow]; range.range *= RANGE_WIDTH_1[nOverflow]; // get the working k int nTempK; if (nOverflow == (MODEL_ELEMENTS - 1)) { nTempK = RangeDecodeFastWithUpdate(5); nOverflow = 0; } else nTempK = (BitArrayState.k < 1) ? 0 : BitArrayState.k - 1; // figure the extra bits on the left and the left value if (nTempK <= 16 || m_nVersion < 3910) nValue = RangeDecodeFastWithUpdate(nTempK); else { int nX1 = RangeDecodeFastWithUpdate(16); int nX2 = RangeDecodeFastWithUpdate(nTempK - 16); nValue = nX1 | (nX2 << 16); } // build the value and output it nValue += (nOverflow << nTempK); } // update nKSum BitArrayState.nKSum += ((nValue + 1) / 2) - ((BitArrayState.nKSum + 16) >> 5); // update k if (BitArrayState.nKSum < K_SUM_MIN_BOUNDARY[BitArrayState.k]) BitArrayState.k--; else if (BitArrayState.nKSum >= K_SUM_MIN_BOUNDARY[BitArrayState.k + 1]) BitArrayState.k++; // output the value (converted to signed) return (nValue & 1) > 0 ? (nValue >> 1) + 1 : -(nValue >> 1); } public void FlushState(UnBitArrayState BitArrayState) { BitArrayState.k = 10; BitArrayState.nKSum = (1 << BitArrayState.k) * 16; } public void FlushBitArray() { AdvanceToByteBoundary(); RangeCoderStructDecompress struct = m_RangeCoderInfo; m_nCurrentBitIndex += 8; // ignore the first byte... (slows compression too much to not output this dummy byte) struct.buffer = GetC(); struct.low = struct.buffer >> (8 - EXTRA_BITS); struct.range = (long) 1 << EXTRA_BITS; m_nRefillBitThreshold = (m_nBits - 512); } public void Finalize() { RangeCoderStructDecompress struct = m_RangeCoderInfo; long i = m_nCurrentBitIndex; long range = struct.range; // normalize while (range <= BOTTOM_VALUE) { i += 8; range <<= 8; } // used to back-pedal the last two bytes out // this should never have been a problem because we've outputted and normalized beforehand // but stopped doing it as of 3.96 in case it accounted for rare decompression failures if (m_nVersion <= 3950) i -= 16; m_nCurrentBitIndex = i; struct.range = range; } private UnBitArrayState GenerateArrayRangeBitArrayState = new UnBitArrayState(); private void GenerateArrayRange(int[] pOutputArray, int nElements) throws IOException { FlushState(GenerateArrayRangeBitArrayState); FlushBitArray(); for (int z = 0; z < nElements; z++) pOutputArray[z] = DecodeValueRange(GenerateArrayRangeBitArrayState); Finalize(); } private RangeCoderStructDecompress m_RangeCoderInfo = new RangeCoderStructDecompress(); private long m_nRefillBitThreshold; //functions private final int RangeDecodeFast(int nShift) { RangeCoderStructDecompress struct = m_RangeCoderInfo; long a1[] = m_pBitArray; long i = m_nCurrentBitIndex; long buffer = struct.buffer; long low = struct.low; long range = struct.range; while (range <= BOTTOM_VALUE) { buffer = (buffer << 8) | ((a1[(int) (i >> 5)] >> (24 - (i & 31))) & 0xFF); i += 8; low = (low << 8) | ((buffer >> 1) & 0xFF); range <<= 8; } m_nCurrentBitIndex = i; struct.low = low; struct.buffer = buffer; // decode range >>= nShift; struct.range = range; return (int) (low / range); } private final int RangeDecodeFastWithUpdate(int nShift) { RangeCoderStructDecompress struct = m_RangeCoderInfo; long a1[] = m_pBitArray; long i = m_nCurrentBitIndex; long buffer = struct.buffer; long low = struct.low; long range = struct.range; while (range <= BOTTOM_VALUE) { buffer = (buffer << 8L) | ((a1[(int) (i >> 5)] >> (24 - (i & 31))) & 0xFF); i += 8; low = (low << 8) | ((buffer >> 1) & 0xFF); range <<= 8; } m_nCurrentBitIndex = i; // decode range >>= nShift; int nRetVal = (int) (low / range); low -= range * nRetVal; struct.range = range; struct.low = low; struct.buffer = buffer; return nRetVal; } private final short GetC() { long l = m_nCurrentBitIndex; short nValue = (short) (m_pBitArray[(int) (l >> 5)] >> (24 - (l & 31))); m_nCurrentBitIndex = l + 8; return nValue; } } jmac-1.74/core/src/davaguine/jmac/decoder/UnBitArrayBase.java0000644000175000017500000001463310131230056023772 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.decoder; import davaguine.jmac.tools.ByteArrayReader; import davaguine.jmac.tools.File; import davaguine.jmac.tools.JMACException; import java.io.IOException; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class UnBitArrayBase { private final static long POWERS_OF_TWO_MINUS_ONE[] = {0, 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767, 65535, 131071, 262143, 524287, 1048575, 2097151, 4194303, 8388607, 16777215, 33554431, 67108863, 134217727, 268435455, 536870911, 1073741823, 2147483647, 4294967295L}; //construction/destruction public UnBitArrayBase() { } //functions public void FillBitArray() throws IOException { //get the bit array index long nBitArrayIndex = m_nCurrentBitIndex >> 5; long al[]; int j; //move the remaining data to the front System.arraycopy(al = m_pBitArray, j = (int) nBitArrayIndex, al, 0, (int) (al.length - nBitArrayIndex)); //read the new data ByteArrayReader reader = m_pReader; reader.reset(m_pIO, j << 2); long l1; int i = (int) ((l1 = m_nElements) - nBitArrayIndex); if ((long) i < l1) do { al[i] = reader.readUnsignedInt(); i++; } while ((long) i < l1); //adjust the m_Bit pointer m_nCurrentBitIndex &= 31; } public void FillAndResetBitArray() throws IOException { FillAndResetBitArray(-1, 0); } public void FillAndResetBitArray(int nFileLocation) throws IOException { FillAndResetBitArray(nFileLocation, 0); } public void FillAndResetBitArray(int nFileLocation, int nNewBitIndex) throws IOException { //reset the bit index m_nCurrentBitIndex = nNewBitIndex; //seek if necessary if (nFileLocation != -1) m_pIO.seek(nFileLocation); //read the new data into the bit array ByteArrayReader reader = m_pReader; reader.reset(m_pIO, (int) m_nBytes); long al[] = m_pBitArray; long l = m_nElements; for (int i = 0; i < l; i++) al[i] = reader.readUnsignedInt(); } public void GenerateArray(int[] pOutputArray, int nElements) throws IOException { GenerateArray(pOutputArray, nElements, -1); } public void GenerateArray(int[] pOutputArray, int nElements, int nBytesRequired) throws IOException { } public long DecodeValue(int DecodeMethod) throws IOException { return DecodeValue(DecodeMethod, 0, 0); } public long DecodeValue(int DecodeMethod, int nParam1) throws IOException { return DecodeValue(DecodeMethod, nParam1, 0); } public long DecodeValue(int DecodeMethod, int nParam1, int nParam2) throws IOException { return 0; } public void AdvanceToByteBoundary() { long nMod = m_nCurrentBitIndex % 8L; if (nMod != 0) m_nCurrentBitIndex += 8L - nMod; } public int DecodeValueRange(UnBitArrayState BitArrayState) throws IOException { return 0; } public void FlushState(UnBitArrayState BitArrayState) { } public void FlushBitArray() { } public void Finalize() { } protected void CreateHelper(File pIO, int nBytes, int nVersion) { //check the parameters if ((pIO == null) || (nBytes <= 0)) throw new JMACException("Bad Parameter"); //save the size m_nElements = nBytes / 4; m_nBytes = m_nElements * 4; m_nBits = m_nBytes * 8; //set the variables m_pIO = pIO; m_nVersion = nVersion; m_nCurrentBitIndex = 0; //create the bitarray m_pBitArray = new long[(int) m_nElements]; m_pReader = new ByteArrayReader((int) m_nBytes); } protected long DecodeValueXBits(long nBits) throws IOException { //get more data if necessary long nBitArrayIndex; if (((nBitArrayIndex = m_nCurrentBitIndex) + nBits) >= m_nBits) FillBitArray(); //variable declares long nLeftBits = 32 - (nBitArrayIndex & 31); nBitArrayIndex >>= 5; m_nCurrentBitIndex += nBits; //if their isn't an overflow to the right value, get the value and exit if (nLeftBits >= nBits) return ((long) (m_pBitArray[(int) nBitArrayIndex] & (POWERS_OF_TWO_MINUS_ONE[(int) nLeftBits]))) >> (nLeftBits - nBits); //must get the "split" value from left and right long nRightBits = nBits - nLeftBits; long nLeftValue = ((long) (m_pBitArray[(int) nBitArrayIndex] & POWERS_OF_TWO_MINUS_ONE[(int) nLeftBits])) << nRightBits; long nRightValue = (m_pBitArray[(int) nBitArrayIndex + 1] >> (32 - nRightBits)); return (nLeftValue | nRightValue); } public static UnBitArrayBase CreateUnBitArray(IAPEDecompress pAPEDecompress, int nVersion) { if (nVersion >= 3900) return (UnBitArrayBase) new UnBitArray(pAPEDecompress.getApeInfoIoSource(), nVersion); else return (UnBitArrayBase) new UnBitArrayOld(pAPEDecompress, nVersion); } protected long m_nElements; protected long m_nBytes; protected long m_nBits; protected int m_nVersion; protected File m_pIO; protected long m_nCurrentBitIndex; protected long[] m_pBitArray; protected ByteArrayReader m_pReader; } jmac-1.74/core/src/davaguine/jmac/decoder/UnBitArrayOld.java0000644000175000017500000003266310131230056023641 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.decoder; import java.io.IOException; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class UnBitArrayOld extends UnBitArrayBase { public final static long K_SUM_MIN_BOUNDARY_OLD[] = {0, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576, 2097152, 4194304, 8388608, 16777216, 33554432, 67108864, 134217728, 268435456, 536870912, 1073741824, 2147483648L, 0, 0, 0, 0, 0, 0}; public final static long K_SUM_MAX_BOUNDARY_OLD[] = {128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576, 2097152, 4194304, 8388608, 16777216, 33554432, 67108864, 134217728, 268435456, 536870912, 1073741824, 2147483648L, 0, 0, 0, 0, 0, 0, 0}; public final static long Powers_of_Two[] = {1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576, 2097152, 4194304, 8388608, 16777216, 33554432, 67108864, 134217728, 268435456, 536870912, 1073741824, 2147483648L}; public final static long Powers_of_Two_Reversed[] = {2147483648L, 1073741824, 536870912, 268435456, 134217728, 67108864, 33554432, 16777216, 8388608, 4194304, 2097152, 1048576, 524288, 262144, 131072, 65536, 32768, 16384, 8192, 4096, 2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1}; public final static long Powers_of_Two_Minus_One[] = {0, 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767, 65535, 131071, 262143, 524287, 1048575, 2097151, 4194303, 8388607, 16777215, 33554431, 67108863, 134217727, 268435455, 536870911, 1073741823, 2147483647, 4294967295L}; public final static long Powers_of_Two_Minus_One_Reversed[] = {4294967295L, 2147483647, 1073741823, 536870911, 268435455, 134217727, 67108863, 33554431, 16777215, 8388607, 4194303, 2097151, 1048575, 524287, 262143, 131071, 65535, 32767, 16383, 8191, 4095, 2047, 1023, 511, 255, 127, 63, 31, 15, 7, 3, 1, 0}; public final static long K_SUM_MIN_BOUNDARY[] = {0, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576, 2097152, 4194304, 8388608, 16777216, 33554432, 67108864, 134217728, 268435456, 536870912, 1073741824, 2147483648L, 0, 0, 0, 0}; public final static long K_SUM_MAX_BOUNDARY[] = {32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576, 2097152, 4194304, 8388608, 16777216, 33554432, 67108864, 134217728, 268435456, 536870912, 1073741824, 2147483648L, 0, 0, 0, 0, 0}; //construction/destruction public UnBitArrayOld(IAPEDecompress pAPEDecompress, int nVersion) { int nBitArrayBytes = 262144; //calculate the bytes if (nVersion <= 3880) { int nMaxFrameBytes = (pAPEDecompress.getApeInfoBlocksPerFrame() * 50) / 8; nBitArrayBytes = 65536; while (nBitArrayBytes < nMaxFrameBytes) nBitArrayBytes <<= 1; nBitArrayBytes = Math.max(nBitArrayBytes, 262144); } else if (nVersion <= 3890) nBitArrayBytes = 65536; CreateHelper(pAPEDecompress.getApeInfoIoSource(), nBitArrayBytes, nVersion); //set the refill threshold if (m_nVersion <= 3880) m_nRefillBitThreshold = (m_nBits - (16384 * 8)); else m_nRefillBitThreshold = (m_nBits - 512); } //functions public void GenerateArray(int[] pOutputArray, int nElements, int nBytesRequired) throws IOException { if (m_nVersion < 3860) GenerateArrayOld(pOutputArray, nElements, nBytesRequired); else if (m_nVersion <= 3890) GenerateArrayRice(pOutputArray, nElements, nBytesRequired); } public long DecodeValue(int DecodeMethod, int nParam1, int nParam2) throws IOException { switch (DecodeMethod) { case DecodeValueMethod.DECODE_VALUE_METHOD_UNSIGNED_INT: return DecodeValueXBits(32); case DecodeValueMethod.DECODE_VALUE_METHOD_UNSIGNED_RICE: return DecodeValueRiceUnsigned(nParam1); case DecodeValueMethod.DECODE_VALUE_METHOD_X_BITS: return DecodeValueXBits(nParam1); } return 0; } private void GenerateArrayOld(int[] Output_Array, long Number_of_Elements, int Minimum_nCurrentBitIndex_Array_Bytes) throws IOException { //variable declarations long K_Sum; long q; long kmin, kmax; long k; long Max; int p1, p2; //fill bit array if necessary //could use seek information to determine what the max was... long Max_Bits_Needed = Number_of_Elements * 50; if (Minimum_nCurrentBitIndex_Array_Bytes > 0) //this is actually probably double what is really needed //we can only calculate the space needed for both arrays in multichannel Max_Bits_Needed = ((Minimum_nCurrentBitIndex_Array_Bytes + 4) * 8); if (Max_Bits_Needed > GetBitsRemaining()) FillBitArray(); //decode the first 5 elements (all k = 10) Max = (Number_of_Elements < 5) ? Number_of_Elements : 5; for (q = 0; q < Max; q++) Output_Array[(int) q] = (int) DecodeValueRiceUnsigned(10); //quit if that was all if (Number_of_Elements <= 5) { int tvi; for (int i = 0; i < Number_of_Elements; i++) { tvi = Output_Array[i]; Output_Array[i] = (tvi & 1) > 0 ? (tvi >> 1) + 1 : -(tvi >> 1); } return; } //update k and K_Sum K_Sum = Output_Array[0] + Output_Array[1] + Output_Array[2] + Output_Array[3] + Output_Array[4]; k = Get_K(K_Sum / 10); //work through the rest of the elements before the primary loop Max = (Number_of_Elements < 64) ? Number_of_Elements : 64; for (q = 5; q < Max; q++) { Output_Array[(int) q] = (int) DecodeValueRiceUnsigned(k); K_Sum += Output_Array[(int) q]; k = Get_K(K_Sum / (q + 1) / 2); } //quit if that was all if (Number_of_Elements <= 64) { int tvi; for (int i = 0; i < Number_of_Elements; i++) { tvi = Output_Array[i]; Output_Array[i] = (tvi & 1) > 0 ? (tvi >> 1) + 1 : -(tvi >> 1); } return; } // set all of the variables up for the primary loop long v, Bit_Array_Index; k = Get_K(K_Sum >> 7); kmin = K_SUM_MIN_BOUNDARY_OLD[(int) k]; kmax = K_SUM_MAX_BOUNDARY_OLD[(int) k]; // the primary loop for (p1 = 64, p2 = 0; p1 < Number_of_Elements; p1++, p2++) { // plug through the string of 0's (the overflow) long Bit_Initial = m_nCurrentBitIndex; while ((m_pBitArray[(int) (m_nCurrentBitIndex >> 5)] & Powers_of_Two_Reversed[(int) (m_nCurrentBitIndex++ & 31)]) == 0) ; // if k = 0, your done if (k == 0) v = (m_nCurrentBitIndex - Bit_Initial - 1); else { // put the overflow value into v v = (m_nCurrentBitIndex - Bit_Initial - 1) << k; // store the bit information and incement the bit pointer by 'k' Bit_Array_Index = m_nCurrentBitIndex >> 5; long Bit_Index = m_nCurrentBitIndex & 31; m_nCurrentBitIndex += k; //figure the extra bits on the left and the left value int Left_Extra_Bits = (int) ((32 - k) - Bit_Index); long Left_Value = m_pBitArray[(int) Bit_Array_Index] & Powers_of_Two_Minus_One_Reversed[(int) Bit_Index]; if (Left_Extra_Bits >= 0) v |= (Left_Value >> Left_Extra_Bits); else v |= (Left_Value << -Left_Extra_Bits) | (m_pBitArray[(int) (Bit_Array_Index + 1)] >> (32 + Left_Extra_Bits)); } Output_Array[p1] = (int) v; K_Sum += Output_Array[p1] - Output_Array[p2]; // convert *p2 to unsigned Output_Array[p2] = (Output_Array[p2] % 2) > 0 ? (Output_Array[p2] >> 1) + 1 : -(Output_Array[p2] >> 1); // adjust k if necessary if ((K_Sum < kmin) || (K_Sum >= kmax)) { if (K_Sum < kmin) while (K_Sum < K_SUM_MIN_BOUNDARY_OLD[(int) (--k)]) ; else while (K_Sum >= K_SUM_MAX_BOUNDARY_OLD[(int) (++k)]) ; kmax = K_SUM_MAX_BOUNDARY_OLD[(int) k]; kmin = K_SUM_MIN_BOUNDARY_OLD[(int) k]; } } for (; p2 < Number_of_Elements; p2++) Output_Array[p2] = (Output_Array[p2] & 1) > 0 ? (Output_Array[p2] >> 1) + 1 : -(Output_Array[p2] >> 1); } private void GenerateArrayRice(int[] pOutputArray, long NumberOfElements, int MinimumBitArrayBytes) throws IOException { ///////////////////////////////////////////////////////////////////////////// //decode the bit array ///////////////////////////////////////////////////////////////////////////// k = 10; K_Sum = 1024 * 16; if (m_nVersion <= 3880) { //the primary loop for (int i = 0; i < NumberOfElements; i++) pOutputArray[i] = DecodeValueNew(false); } else { //the primary loop for (int i = 0; i < NumberOfElements; i++) pOutputArray[i] = DecodeValueNew(true); } } private long DecodeValueRiceUnsigned(long k) throws IOException { //variable declares long v; //plug through the string of 0's (the overflow) long BitInitial = m_nCurrentBitIndex; while ((m_pBitArray[(int) (m_nCurrentBitIndex >> 5)] & Powers_of_Two_Reversed[(int) (m_nCurrentBitIndex++ & 31)]) == 0) ; //if k = 0, your done if (k == 0) return (m_nCurrentBitIndex - BitInitial - 1); //put the overflow value into v v = (m_nCurrentBitIndex - BitInitial - 1) << k; return v | DecodeValueXBits(k); } //data private long k; private long K_Sum; private long m_nRefillBitThreshold; //functions private int DecodeValueNew(boolean bCapOverflow) throws IOException { //make sure there is room for the data //this is a little slower than ensuring a huge block to start with, but it's safer if (m_nCurrentBitIndex > m_nRefillBitThreshold) FillBitArray(); long v; //plug through the string of 0's (the overflow) long Bit_Initial = m_nCurrentBitIndex; while ((m_pBitArray[(int) (m_nCurrentBitIndex >> 5)] & Powers_of_Two_Reversed[(int) (m_nCurrentBitIndex++ & 31)]) == 0) ; int nOverflow = (int) (m_nCurrentBitIndex - Bit_Initial - 1); if (bCapOverflow) { while (nOverflow >= 16) { k += 4; nOverflow -= 16; } } //if k = 0, your done if (k != 0) { //put the overflow value into v v = nOverflow << k; //store the bit information and incement the bit pointer by 'k' long Bit_Array_Index = m_nCurrentBitIndex >> 5; long Bit_Index = m_nCurrentBitIndex & 31; m_nCurrentBitIndex += k; //figure the extra bits on the left and the left value int Left_Extra_Bits = (int) ((32 - k) - Bit_Index); long Left_Value = m_pBitArray[(int) Bit_Array_Index] & Powers_of_Two_Minus_One_Reversed[(int) Bit_Index]; if (Left_Extra_Bits >= 0) v |= (Left_Value >> Left_Extra_Bits); else v |= (Left_Value << -Left_Extra_Bits) | (m_pBitArray[(int) (Bit_Array_Index + 1)] >> (32 + Left_Extra_Bits)); } else v = nOverflow; //update K_Sum K_Sum += v - ((K_Sum + 8) >> 4); //update k if (K_Sum < K_SUM_MIN_BOUNDARY[(int) k]) k--; else if (K_Sum >= K_SUM_MAX_BOUNDARY[(int) k]) k++; //convert to unsigned and save return (v & 1) > 0 ? (int) ((v >> 1) + 1) : -((int) (v >> 1)); } private long GetBitsRemaining() { return (m_nElements * 32 - m_nCurrentBitIndex); } private long Get_K(long x) { if (x == 0) return 0; long k = 0; while (x >= Powers_of_Two[(int) (++k)]) ; return k; } } jmac-1.74/core/src/davaguine/jmac/decoder/UnBitArrayState.java0000644000175000017500000000213710131230056024174 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.decoder; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class UnBitArrayState { public int k; public int nKSum; } jmac-1.74/core/src/davaguine/jmac/decoder/UnMAC.java0000644000175000017500000002060110131230056022052 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.decoder; import davaguine.jmac.info.APEHeader; import davaguine.jmac.info.SpecialFrame; import davaguine.jmac.info.WaveFormat; import davaguine.jmac.tools.ByteBuffer; import davaguine.jmac.tools.Crc32; import davaguine.jmac.tools.JMACException; import davaguine.jmac.tools.Prepare; import java.io.IOException; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class UnMAC { //construction/destruction public UnMAC() { //initialize member variables m_bInitialized = false; m_nRealFrame = 0; m_LastDecodedFrameIndex = -1; m_pAPEDecompress = null; m_pAPEDecompressCore = null; m_pPrepare = null; m_nBlocksProcessed = 0; } //functions public void Initialize(IAPEDecompress pAPEDecompress) { //uninitialize if it is currently initialized if (m_bInitialized) Uninitialize(); if (pAPEDecompress == null) { Uninitialize(); throw new JMACException("Error Initializing UnMAC"); } //set the member pointer to the IAPEDecompress class m_pAPEDecompress = pAPEDecompress; //set the last decode frame to -1 so it forces a seek on start m_LastDecodedFrameIndex = -1; m_pAPEDecompressCore = new APEDecompressCore(pAPEDecompress); m_pPrepare = new Prepare(); //set the initialized flag to TRUE m_bInitialized = true; m_wfeInput = m_pAPEDecompress.getApeInfoWaveFormatEx(); } public void Uninitialize() { if (m_bInitialized) { m_pAPEDecompressCore = null; m_pPrepare = null; //clear the APE info pointer m_pAPEDecompress = null; //set the last decoded frame again m_LastDecodedFrameIndex = -1; //set the initialized flag to FALSE m_bInitialized = false; } } public int DecompressFrame(ByteBuffer pOutputData, int FrameIndex) throws IOException { return DecompressFrameOld(pOutputData, FrameIndex); } public void SeekToFrame(int FrameIndex) throws IOException { if (m_pAPEDecompress.getApeInfoFileVersion() > 3800) { if ((m_LastDecodedFrameIndex == -1) || ((FrameIndex - 1) != m_LastDecodedFrameIndex)) { int SeekRemainder = (m_pAPEDecompress.getApeInfoSeekByte(FrameIndex) - m_pAPEDecompress.getApeInfoSeekByte(0)) % 4; m_pAPEDecompressCore.GetUnBitArrray().FillAndResetBitArray(m_nRealFrame == FrameIndex ? -1 : m_pAPEDecompress.getApeInfoSeekByte(FrameIndex) - SeekRemainder, SeekRemainder * 8); m_nRealFrame = FrameIndex; } else m_pAPEDecompressCore.GetUnBitArrray().AdvanceToByteBoundary(); } else { if ((m_LastDecodedFrameIndex == -1) || ((FrameIndex - 1) != m_LastDecodedFrameIndex)) { m_pAPEDecompressCore.GetUnBitArrray().FillAndResetBitArray(m_nRealFrame == FrameIndex ? -1 : m_pAPEDecompress.getApeInfoSeekByte(FrameIndex), m_pAPEDecompress.getApeInfoSeekBit(FrameIndex)); m_nRealFrame = FrameIndex; } } } //data members private boolean m_bInitialized; private int m_LastDecodedFrameIndex; private int m_nRealFrame; private IAPEDecompress m_pAPEDecompress; private Prepare m_pPrepare; private APEDecompressCore m_pAPEDecompressCore; //functions private int DecompressFrameOld(ByteBuffer pOutputData, int FrameIndex) throws IOException { //error check the parameters (too high of a frame index, etc.) if (FrameIndex >= m_pAPEDecompress.getApeInfoTotalFrames()) return 0; //get the number of samples in the frame int nBlocks = 0; nBlocks = ((FrameIndex + 1) >= m_pAPEDecompress.getApeInfoTotalFrames()) ? m_pAPEDecompress.getApeInfoFinalFrameBlocks() : m_pAPEDecompress.getApeInfoBlocksPerFrame(); if (nBlocks == 0) throw new JMACException("Invalid Frame Index"); //nothing to do (file must be zero length) (have to return error) //take care of seeking and frame alignment SeekToFrame(FrameIndex); //get the checksum long nSpecialCodes = 0; long nStoredCRC = 0; if ((m_pAPEDecompress.getApeInfoFormatFlags() & APEHeader.MAC_FORMAT_FLAG_CRC) <= 0) { nStoredCRC = m_pAPEDecompressCore.GetUnBitArrray().DecodeValue(DecodeValueMethod.DECODE_VALUE_METHOD_UNSIGNED_RICE, 30); if (nStoredCRC == 0) nSpecialCodes = SpecialFrame.SPECIAL_FRAME_LEFT_SILENCE | SpecialFrame.SPECIAL_FRAME_RIGHT_SILENCE; } else { nStoredCRC = m_pAPEDecompressCore.GetUnBitArrray().DecodeValue(DecodeValueMethod.DECODE_VALUE_METHOD_UNSIGNED_INT); //get any 'special' codes if the file uses them (for silence, FALSE stereo, etc.) nSpecialCodes = 0; if (m_pAPEDecompress.getApeInfoFileVersion() > 3820) { if ((nStoredCRC & 0x80000000) > 0) nSpecialCodes = m_pAPEDecompressCore.GetUnBitArrray().DecodeValue(DecodeValueMethod.DECODE_VALUE_METHOD_UNSIGNED_INT); nStoredCRC &= 0x7fffffff; } } //decompress and convert from (x,y) -> (l,r) //sort of int and ugly.... sorry if (m_pAPEDecompress.getApeInfoChannels() == 2) { m_pAPEDecompressCore.GenerateDecodedArrays(nBlocks, (int) nSpecialCodes, FrameIndex); m_pPrepare.unprepareOld(m_pAPEDecompressCore.m_pDataX, m_pAPEDecompressCore.m_pDataY, nBlocks, m_wfeInput, pOutputData, CRC, m_pAPEDecompress.getApeInfoFileVersion()); } else if (m_pAPEDecompress.getApeInfoChannels() == 1) { m_pAPEDecompressCore.GenerateDecodedArrays(nBlocks, (int) nSpecialCodes, FrameIndex); m_pPrepare.unprepareOld(m_pAPEDecompressCore.m_pDataX, null, nBlocks, m_wfeInput, pOutputData, CRC, m_pAPEDecompress.getApeInfoFileVersion()); } if (m_pAPEDecompress.getApeInfoFileVersion() > 3820) CRC.finalizeCrc(); // check the CRC if ((m_pAPEDecompress.getApeInfoFormatFlags() & APEHeader.MAC_FORMAT_FLAG_CRC) <= 0) { long nChecksum = CalculateOldChecksum(m_pAPEDecompressCore.m_pDataX, m_pAPEDecompressCore.m_pDataY, m_pAPEDecompress.getApeInfoChannels(), nBlocks); if (nChecksum != nStoredCRC) throw new JMACException("Invalid Checksum"); } else { if (CRC.getCrc() != nStoredCRC) throw new JMACException("Invalid Checksum"); } m_LastDecodedFrameIndex = FrameIndex; return nBlocks; } private long CalculateOldChecksum(int[] pDataX, int[] pDataY, int nChannels, int nBlocks) { long nChecksum = 0; if (nChannels == 2) { for (int z = 0; z < nBlocks; z++) { int R = pDataX[z] - (pDataY[z] / 2); int L = R + pDataY[z]; nChecksum += (Math.abs(R) + Math.abs(L)); } } else if (nChannels == 1) { for (int z = 0; z < nBlocks; z++) nChecksum += Math.abs(pDataX[z]); } return nChecksum; } public int m_nBlocksProcessed; public Crc32 CRC = new Crc32(); public long m_nStoredCRC; public WaveFormat m_wfeInput; } jmac-1.74/core/src/davaguine/jmac/encoder/0000755000175000017500000000000010451144641020330 5ustar twernertwernerjmac-1.74/core/src/davaguine/jmac/encoder/APECompress.java0000644000175000017500000002075210172455471023330 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.encoder; import davaguine.jmac.info.InputSource; import davaguine.jmac.info.WaveFormat; import davaguine.jmac.tools.*; import java.io.IOException; /** * Author: Dmitry Vaguine * Date: 08.05.2004 * Time: 11:17:57 */ public class APECompress extends IAPECompress { public APECompress() { m_nBufferHead = 0; m_nBufferTail = 0; m_nBufferSize = 0; m_bBufferLocked = false; m_bOwnsOutputIO = false; m_pioOutput = null; m_spAPECompressCreate = new APECompressCreate(); m_pBuffer = null; } protected void finalize() { Kill(); } // start encoding public void Start(String pOutputFilename, WaveFormat pwfeInput, int nMaxAudioBytes, int nCompressionLevel, byte[] pHeaderData, int nHeaderBytes) throws IOException { m_pioOutput = File.createFile(pOutputFilename, "rw"); m_bOwnsOutputIO = true; m_spAPECompressCreate.Start(m_pioOutput, pwfeInput, nMaxAudioBytes, nCompressionLevel, pHeaderData, nHeaderBytes); m_nBufferSize = m_spAPECompressCreate.GetFullFrameBytes(); m_pBuffer = new byte[m_nBufferSize]; m_wfeInput = pwfeInput; } public void StartEx(File pioOutput, WaveFormat pwfeInput, int nMaxAudioBytes, int nCompressionLevel, byte[] pHeaderData, int nHeaderBytes) throws IOException { m_pioOutput = pioOutput; m_bOwnsOutputIO = false; m_spAPECompressCreate.Start(m_pioOutput, pwfeInput, nMaxAudioBytes, nCompressionLevel, pHeaderData, nHeaderBytes); m_nBufferSize = m_spAPECompressCreate.GetFullFrameBytes(); m_pBuffer = new byte[m_nBufferSize]; m_wfeInput = pwfeInput; } // add data / compress data // allows linear, immediate access to the buffer (fast) public int GetBufferBytesAvailable() { return m_nBufferSize - m_nBufferTail; } public void UnlockBuffer(int nBytesAdded, boolean bProcess) throws IOException { if (!m_bBufferLocked) throw new JMACException("Error Undefined"); m_nBufferTail += nBytesAdded; m_bBufferLocked = false; if (bProcess) ProcessBuffer(); } private ByteBuffer pBufferPointer = new ByteBuffer(); public ByteBuffer LockBuffer(IntegerPointer pBytesAvailable) { if (m_pBuffer == null) { return null; } if (m_bBufferLocked) return null; m_bBufferLocked = true; if (pBytesAvailable != null) pBytesAvailable.value = GetBufferBytesAvailable(); pBufferPointer.reset(m_pBuffer, m_nBufferTail); return pBufferPointer; } // slower, but easier than locking and unlocking (copies data) private IntegerPointer m_nAddDataBytesAvailable = new IntegerPointer(); public void AddData(byte[] pData, int nBytes) throws IOException { int nBytesDone = 0; while (nBytesDone < nBytes) { // lock the buffer m_nAddDataBytesAvailable.value = 0; ByteBuffer pBuffer = LockBuffer(m_nAddDataBytesAvailable); if (pBuffer == null || m_nAddDataBytesAvailable.value <= 0) throw new JMACException("Error Undefined"); // calculate how many bytes to copy and add that much to the buffer int nBytesToProcess = Math.min(m_nAddDataBytesAvailable.value, nBytes - nBytesDone); pBuffer.append(pData, nBytesDone, nBytesToProcess); // unlock the buffer (fail if not successful) UnlockBuffer(nBytesToProcess); // update our progress nBytesDone += nBytesToProcess; } } // use a CIO (input source) to add data private IntegerPointer m_nAddDataFromInputSourceBytesAvailavle = new IntegerPointer(); public int AddDataFromInputSource(InputSource pInputSource, int nMaxBytes) throws IOException { // error check the parameters if (pInputSource == null) throw new JMACException("Bad Parameters"); // initialize int pBytesAdded = 0; int nBytesRead = 0; // lock the buffer m_nAddDataFromInputSourceBytesAvailavle.value = 0; ByteBuffer pBuffer = LockBuffer(m_nAddDataFromInputSourceBytesAvailavle); // calculate the 'ideal' number of bytes int nIdealBytes = m_spAPECompressCreate.GetFullFrameBytes() - (m_nBufferTail - m_nBufferHead); if (nIdealBytes > 0) { // get the data int nBytesToAdd = m_nAddDataFromInputSourceBytesAvailavle.value; if (nMaxBytes > 0) { if (nBytesToAdd > nMaxBytes) nBytesToAdd = nMaxBytes; } if (nBytesToAdd > nIdealBytes) nBytesToAdd = nIdealBytes; // always make requests along block boundaries while ((nBytesToAdd % m_wfeInput.nBlockAlign) != 0) nBytesToAdd--; int nBlocksToAdd = nBytesToAdd / m_wfeInput.nBlockAlign; // get data int nBlocksAdded = pInputSource.GetData(pBuffer, nBlocksToAdd); nBytesRead = (nBlocksAdded * m_wfeInput.nBlockAlign); // store the bytes read pBytesAdded = nBytesRead; } // unlock the data and process UnlockBuffer(nBytesRead, true); return pBytesAdded; } // finish / kill public void Finish(byte[] pTerminatingData, int nTerminatingBytes, int nWAVTerminatingBytes) throws IOException { ProcessBuffer(true); m_spAPECompressCreate.Finish(pTerminatingData, nTerminatingBytes, nWAVTerminatingBytes); } public void Kill() { if (m_pioOutput != null) { try { if (m_bOwnsOutputIO) m_pioOutput.close(); } catch (IOException e) { throw new JMACException("Error while closing output stream", e); } } m_pioOutput = null; } private void ProcessBuffer() throws IOException { ProcessBuffer(false); } private ByteArrayReader pByteReader = new ByteArrayReader(); private void ProcessBuffer(boolean bFinalize) throws IOException { if (m_pBuffer == null) throw new JMACException("Error Undefined"); // process as much as possible int nThreshold = (bFinalize) ? 0 : m_spAPECompressCreate.GetFullFrameBytes(); while ((m_nBufferTail - m_nBufferHead) >= nThreshold) { int nFrameBytes = Math.min(m_spAPECompressCreate.GetFullFrameBytes(), m_nBufferTail - m_nBufferHead); if (nFrameBytes == 0) break; pByteReader.reset(m_pBuffer, m_nBufferHead); m_spAPECompressCreate.EncodeFrame(pByteReader, nFrameBytes); m_nBufferHead += nFrameBytes; } // shift the buffer if (m_nBufferHead != 0) { int nBytesLeft = m_nBufferTail - m_nBufferHead; if (nBytesLeft != 0) System.arraycopy(m_pBuffer, m_nBufferHead, m_pBuffer, 0, nBytesLeft); m_nBufferTail -= m_nBufferHead; m_nBufferHead = 0; } } private APECompressCreate m_spAPECompressCreate; private int m_nBufferHead; private int m_nBufferTail; private int m_nBufferSize; private byte[] m_pBuffer; private boolean m_bBufferLocked; private File m_pioOutput; private boolean m_bOwnsOutputIO; private WaveFormat m_wfeInput; } jmac-1.74/core/src/davaguine/jmac/encoder/APECompressCore.java0000644000175000017500000001301010131230056024107 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.encoder; import davaguine.jmac.info.SpecialFrame; import davaguine.jmac.info.WaveFormat; import davaguine.jmac.prediction.IPredictorCompress; import davaguine.jmac.prediction.PredictorCompressNormal; import davaguine.jmac.tools.*; import java.io.IOException; /** * Author: Dmitry Vaguine * Date: 08.05.2004 * Time: 11:18:47 */ public class APECompressCore { public APECompressCore(File pIO, WaveFormat pwfeInput, int nMaxFrameBlocks, int nCompressionLevel) { m_spBitArray = new BitArray(pIO); m_spDataX = new int[nMaxFrameBlocks]; m_spDataY = new int[nMaxFrameBlocks]; m_spPrepare = new Prepare(); m_spPredictorX = new PredictorCompressNormal(nCompressionLevel); m_spPredictorY = new PredictorCompressNormal(nCompressionLevel); m_wfeInput = pwfeInput; m_nPeakLevel.value = 0; } private IntegerPointer m_nSpecialCodes = new IntegerPointer(); public void EncodeFrame(ByteArrayReader pInputData, int nInputBytes) throws IOException { // variables int nInputBlocks = nInputBytes / m_wfeInput.nBlockAlign; m_nSpecialCodes.value = 0; // always start a new frame on a byte boundary m_spBitArray.AdvanceToByteBoundary(); // do the preparation stage Prepare(pInputData, nInputBytes, m_nSpecialCodes); m_spPredictorX.Flush(); m_spPredictorY.Flush(); m_spBitArray.FlushState(m_BitArrayStateX); m_spBitArray.FlushState(m_BitArrayStateY); m_spBitArray.FlushBitArray(); if (m_wfeInput.nChannels == 2) { boolean bEncodeX = true; boolean bEncodeY = true; if ((m_nSpecialCodes.value & SpecialFrame.SPECIAL_FRAME_LEFT_SILENCE) > 0 && (m_nSpecialCodes.value & SpecialFrame.SPECIAL_FRAME_RIGHT_SILENCE) > 0) { bEncodeX = false; bEncodeY = false; } if ((m_nSpecialCodes.value & SpecialFrame.SPECIAL_FRAME_PSEUDO_STEREO) > 0) { bEncodeY = false; } if (bEncodeX && bEncodeY) { int nLastX = 0; for (int z = 0; z < nInputBlocks; z++) { m_spBitArray.EncodeValue(m_spPredictorY.CompressValue(m_spDataY[z], nLastX), m_BitArrayStateY); m_spBitArray.EncodeValue(m_spPredictorX.CompressValue(m_spDataX[z], m_spDataY[z]), m_BitArrayStateX); nLastX = m_spDataX[z]; } } else if (bEncodeX) { for (int z = 0; z < nInputBlocks; z++) { m_spBitArray.EncodeValue(m_spPredictorX.CompressValue(m_spDataX[z]), m_BitArrayStateX); } } else if (bEncodeY) { for (int z = 0; z < nInputBlocks; z++) { m_spBitArray.EncodeValue(m_spPredictorY.CompressValue(m_spDataY[z]), m_BitArrayStateY); } } } else if (m_wfeInput.nChannels == 1) { if ((m_nSpecialCodes.value & SpecialFrame.SPECIAL_FRAME_MONO_SILENCE) <= 0) { for (int z = 0; z < nInputBlocks; z++) { m_spBitArray.EncodeValue(m_spPredictorX.CompressValue(m_spDataX[z]), m_BitArrayStateX); } } } m_spBitArray.Finalize(); } public BitArray GetBitArray() { return m_spBitArray; } public int GetPeakLevel() { return m_nPeakLevel.value; } private BitArray m_spBitArray; private IPredictorCompress m_spPredictorX; private IPredictorCompress m_spPredictorY; private BitArrayState m_BitArrayStateX = new BitArrayState(); private BitArrayState m_BitArrayStateY = new BitArrayState(); private int[] m_spDataX; private int[] m_spDataY; private Prepare m_spPrepare; private WaveFormat m_wfeInput; private IntegerPointer m_nPeakLevel = new IntegerPointer(); private Crc32 crc = new Crc32(); private void Prepare(ByteArrayReader pInputData, int nInputBytes, IntegerPointer pSpecialCodes) throws IOException { // variable declares pSpecialCodes.value = 0; // do the preparation m_spPrepare.prepare(pInputData, nInputBytes, m_wfeInput, m_spDataX, m_spDataY, crc, pSpecialCodes, m_nPeakLevel); // store the CRC m_spBitArray.EncodeUnsignedLong(crc.getCrc()); // store any special codes if (pSpecialCodes.value != 0) m_spBitArray.EncodeUnsignedLong(pSpecialCodes.value); } } jmac-1.74/core/src/davaguine/jmac/encoder/APECompressCreate.java0000644000175000017500000002410210131230056024426 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.encoder; import davaguine.jmac.info.*; import davaguine.jmac.tools.*; import java.io.IOException; import java.util.Arrays; /** * Author: Dmitry Vaguine * Date: 08.05.2004 * Time: 12:40:36 */ public class APECompressCreate { APECompressCreate() { m_nMaxFrames = 0; } public void InitializeFile(File pIO, WaveFormat pwfeInput, int nMaxFrames, int nCompressionLevel, byte[] pHeaderData, int nHeaderBytes) throws IOException { // error check the parameters if (pIO == null || pwfeInput == null || nMaxFrames <= 0) throw new JMACException("Bad Parameters"); APEDescriptor APEDescriptor = new APEDescriptor(); APEHeaderNew header = new APEHeaderNew(); // create the descriptor (only fill what we know) APEDescriptor.cID = "MAC "; APEDescriptor.nVersion = Globals.MAC_VERSION_NUMBER; APEDescriptor.nDescriptorBytes = APEDescriptor.APE_DESCRIPTOR_BYTES; APEDescriptor.nHeaderBytes = APEHeaderNew.APE_HEADER_BYTES; APEDescriptor.nSeekTableBytes = nMaxFrames * 4; APEDescriptor.nHeaderDataBytes = (nHeaderBytes == IAPECompress.CREATE_WAV_HEADER_ON_DECOMPRESSION) ? 0 : nHeaderBytes; // create the header (only fill what we know now) header.nBitsPerSample = pwfeInput.wBitsPerSample; header.nChannels = pwfeInput.nChannels; header.nSampleRate = pwfeInput.nSamplesPerSec; header.nCompressionLevel = nCompressionLevel; header.nFormatFlags = (nHeaderBytes == IAPECompress.CREATE_WAV_HEADER_ON_DECOMPRESSION) ? APEHeader.MAC_FORMAT_FLAG_CREATE_WAV_HEADER : 0; header.nBlocksPerFrame = m_nSamplesPerFrame; // write the data to the file ByteArrayWriter writer = new ByteArrayWriter(APEDescriptor.APE_DESCRIPTOR_BYTES + APEHeaderNew.APE_HEADER_BYTES); APEDescriptor.write(writer); header.write(writer); pIO.write(writer.getBytes()); // write an empty seek table m_spSeekTable = new long[nMaxFrames]; Arrays.fill(m_spSeekTable, 0); byte[] zeroTable = new byte[nMaxFrames * 4]; Arrays.fill(zeroTable, (byte) 0); pIO.write(zeroTable); m_nMaxFrames = nMaxFrames; // write the WAV data if ((pHeaderData != null) && (nHeaderBytes > 0) && (nHeaderBytes != IAPECompress.CREATE_WAV_HEADER_ON_DECOMPRESSION)) { m_spAPECompressCore.GetBitArray().GetMD5Helper().Update(pHeaderData, nHeaderBytes); pIO.write(pHeaderData, 0, nHeaderBytes); } } public void FinalizeFile(File pIO, int nNumberOfFrames, int nFinalFrameBlocks, byte[] pTerminatingData, int nTerminatingBytes, int nWAVTerminatingBytes, int nPeakLevel) throws IOException { // store the tail position int nTailPosition = (int) pIO.getFilePointer(); // append the terminating data if (nTerminatingBytes > 0) { m_spAPECompressCore.GetBitArray().GetMD5Helper().Update(pTerminatingData, nTerminatingBytes); pIO.write(pTerminatingData, 0, nTerminatingBytes); } // go to the beginning and update the information pIO.seek(0); // get the descriptor APEDescriptor descriptor = APEDescriptor.read(pIO); // get the header APEHeaderNew header = APEHeaderNew.read(pIO); // update the header header.nFinalFrameBlocks = nFinalFrameBlocks; header.nTotalFrames = nNumberOfFrames; // update the descriptor descriptor.nAPEFrameDataBytes = nTailPosition - (descriptor.nDescriptorBytes + descriptor.nHeaderBytes + descriptor.nSeekTableBytes + descriptor.nHeaderDataBytes); descriptor.nAPEFrameDataBytesHigh = 0; descriptor.nTerminatingDataBytes = nTerminatingBytes; // update the MD5 ByteArrayWriter writer = new ByteArrayWriter(APEHeaderNew.APE_HEADER_BYTES); header.write(writer); m_spAPECompressCore.GetBitArray().GetMD5Helper().Update(writer.getBytes()); writer.reset(m_nMaxFrames * 4); for (int i = 0; i < m_nMaxFrames; i++) { writer.writeUnsignedInt(m_spSeekTable[i]); } byte[] seekTable = writer.getBytes(); m_spAPECompressCore.GetBitArray().GetMD5Helper().Update(seekTable); descriptor.cFileMD5 = m_spAPECompressCore.GetBitArray().GetMD5Helper().Final(); // set the pointer and re-write the updated header and peak level pIO.seek(0); writer.reset(descriptor.APE_DESCRIPTOR_BYTES + APEHeaderNew.APE_HEADER_BYTES); descriptor.write(writer); header.write(writer); pIO.write(writer.getBytes()); // write the updated seek table pIO.write(seekTable); } public void SetSeekByte(int nFrame, int nByteOffset) { if (nFrame >= m_nMaxFrames) throw new JMACException("APE Compress Too Much Data"); m_spSeekTable[nFrame] = nByteOffset; } public void Start(File pioOutput, WaveFormat pwfeInput, int nMaxAudioBytes) throws IOException { Start(pioOutput, pwfeInput, nMaxAudioBytes, CompressionLevel.COMPRESSION_LEVEL_NORMAL, null, IAPECompress.CREATE_WAV_HEADER_ON_DECOMPRESSION); } public void Start(File pioOutput, WaveFormat pwfeInput, int nMaxAudioBytes, int nCompressionLevel) throws IOException { Start(pioOutput, pwfeInput, nMaxAudioBytes, nCompressionLevel, null, IAPECompress.CREATE_WAV_HEADER_ON_DECOMPRESSION); } public void Start(File pioOutput, WaveFormat pwfeInput, int nMaxAudioBytes, int nCompressionLevel, byte[] pHeaderData) throws IOException { Start(pioOutput, pwfeInput, nMaxAudioBytes, nCompressionLevel, pHeaderData, IAPECompress.CREATE_WAV_HEADER_ON_DECOMPRESSION); } public void Start(File pioOutput, WaveFormat pwfeInput, int nMaxAudioBytes, int nCompressionLevel, byte[] pHeaderData, int nHeaderBytes) throws IOException { // verify the parameters if (pioOutput == null || pwfeInput == null) throw new JMACException("Bad Parameters"); // verify the wave format if ((pwfeInput.nChannels != 1) && (pwfeInput.nChannels != 2)) throw new JMACException("Input File Unsupported Channel Count"); if ((pwfeInput.wBitsPerSample != 8) && (pwfeInput.wBitsPerSample != 16) && (pwfeInput.wBitsPerSample != 24)) throw new JMACException("Input File Unsupported Bit Depth"); // initialize (creates the base classes) m_nSamplesPerFrame = 73728; if (nCompressionLevel == CompressionLevel.COMPRESSION_LEVEL_EXTRA_HIGH) m_nSamplesPerFrame *= 4; else if (nCompressionLevel == CompressionLevel.COMPRESSION_LEVEL_INSANE) m_nSamplesPerFrame *= 16; m_spIO = pioOutput; m_spAPECompressCore = new APECompressCore(m_spIO, pwfeInput, m_nSamplesPerFrame, nCompressionLevel); // copy the format m_wfeInput = pwfeInput; // the compression level m_nCompressionLevel = nCompressionLevel; m_nFrameIndex = 0; m_nLastFrameBlocks = m_nSamplesPerFrame; // initialize the file if (nMaxAudioBytes < 0) nMaxAudioBytes = 2147483647; long nMaxAudioBlocks = nMaxAudioBytes / pwfeInput.nBlockAlign; int nMaxFrames = (int) (nMaxAudioBlocks / m_nSamplesPerFrame); if ((nMaxAudioBlocks % m_nSamplesPerFrame) != 0) nMaxFrames++; InitializeFile(m_spIO, m_wfeInput, nMaxFrames, m_nCompressionLevel, pHeaderData, nHeaderBytes); } public int GetFullFrameBytes() { return m_nSamplesPerFrame * m_wfeInput.nBlockAlign; } public void EncodeFrame(ByteArrayReader pInputData, int nInputBytes) throws IOException { int nInputBlocks = nInputBytes / m_wfeInput.nBlockAlign; if ((nInputBlocks < m_nSamplesPerFrame) && (m_nLastFrameBlocks < m_nSamplesPerFrame)) throw new JMACException("Bad Parameters"); // update the seek table m_spAPECompressCore.GetBitArray().AdvanceToByteBoundary(); SetSeekByte(m_nFrameIndex, (int) (m_spIO.getFilePointer() + (m_spAPECompressCore.GetBitArray().GetCurrentBitIndex() / 8))); // compress m_spAPECompressCore.EncodeFrame(pInputData, nInputBytes); // update stats m_nLastFrameBlocks = nInputBlocks; m_nFrameIndex++; } public void Finish(byte[] pTerminatingData, int nTerminatingBytes, int nWAVTerminatingBytes) throws IOException { // clear the bit array m_spAPECompressCore.GetBitArray().OutputBitArray(true); // finalize the file FinalizeFile(m_spIO, m_nFrameIndex, m_nLastFrameBlocks, pTerminatingData, nTerminatingBytes, nWAVTerminatingBytes, m_spAPECompressCore.GetPeakLevel()); } private long[] m_spSeekTable; private int m_nMaxFrames; private File m_spIO; private APECompressCore m_spAPECompressCore; private WaveFormat m_wfeInput; private int m_nCompressionLevel; private int m_nSamplesPerFrame; private int m_nFrameIndex; private int m_nLastFrameBlocks; } jmac-1.74/core/src/davaguine/jmac/encoder/BitArray.java0000644000175000017500000003177010131230056022707 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.encoder; import davaguine.jmac.tools.ByteArrayWriter; import davaguine.jmac.tools.File; import davaguine.jmac.tools.JMACException; import davaguine.jmac.tools.MD5; import java.io.IOException; import java.util.Arrays; /** * Author: Dmitry Vaguine * Date: 04.05.2004 * Time: 16:41:39 */ public class BitArray { private final static int BIT_ARRAY_ELEMENTS = 4096; // the number of elements in the bit array (4 MB) private final static int BIT_ARRAY_BYTES = BIT_ARRAY_ELEMENTS * 4; // the number of bytes in the bit array private final static int BIT_ARRAY_BITS = BIT_ARRAY_BYTES * 8; // the number of bits in the bit array private final static int MAX_ELEMENT_BITS = 128; private final static int REFILL_BIT_THRESHOLD = BIT_ARRAY_BITS - MAX_ELEMENT_BITS; private final static long CODE_BITS = 32; private final static long TOP_VALUE = (((long) 1) << (CODE_BITS - 1)); private final static long SHIFT_BITS = (CODE_BITS - 9); private final static long BOTTOM_VALUE = (TOP_VALUE >> 8); private final static long[] K_SUM_MIN_BOUNDARY = {0, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576, 2097152, 4194304, 8388608, 16777216, 33554432, 67108864, 134217728, 268435456, 536870912, 1073741824, 2147483648L, 0, 0, 0, 0}; private final static long[] RANGE_TOTAL = {0, 19578, 36160, 48417, 56323, 60899, 63265, 64435, 64971, 65232, 65351, 65416, 65447, 65466, 65476, 65482, 65485, 65488, 65490, 65491, 65492, 65493, 65494, 65495, 65496, 65497, 65498, 65499, 65500, 65501, 65502, 65503, 65504, 65505, 65506, 65507, 65508, 65509, 65510, 65511, 65512, 65513, 65514, 65515, 65516, 65517, 65518, 65519, 65520, 65521, 65522, 65523, 65524, 65525, 65526, 65527, 65528, 65529, 65530, 65531, 65532, 65533, 65534, 65535}; private final static long[] RANGE_WIDTH = {19578, 16582, 12257, 7906, 4576, 2366, 1170, 536, 261, 119, 65, 31, 19, 10, 6, 3, 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; private final static int MODEL_ELEMENTS = 64; private final static int RANGE_OVERFLOW_SHIFT = 16; // construction / destruction public BitArray(File pIO) { // allocate memory for the bit array m_pBitArray = new int[BIT_ARRAY_ELEMENTS]; Arrays.fill(m_pBitArray, 0); // initialize other variables m_nCurrentBitIndex = 0; m_pIO = pIO; } protected void finalize() { m_pBitArray = null; } private void NormalizeRangeCoder() { while (m_RangeCoderInfo.range <= BOTTOM_VALUE) { if (m_RangeCoderInfo.low < (0xFF << SHIFT_BITS)) { putc(m_RangeCoderInfo.buffer); for (; m_RangeCoderInfo.help > 0; m_RangeCoderInfo.help--) { putc_nocap(0xFF); } m_RangeCoderInfo.buffer = (short) ((m_RangeCoderInfo.low >> SHIFT_BITS) & 0xff); } else if ((m_RangeCoderInfo.low & TOP_VALUE) > 0) { putc(m_RangeCoderInfo.buffer + 1); m_nCurrentBitIndex += (m_RangeCoderInfo.help * 8); m_RangeCoderInfo.help = 0; m_RangeCoderInfo.buffer = (short) ((m_RangeCoderInfo.low >> SHIFT_BITS) & 0xff); } else { m_RangeCoderInfo.help++; } m_RangeCoderInfo.low = (m_RangeCoderInfo.low << 8) & (TOP_VALUE - 1); m_RangeCoderInfo.range <<= 8; } } private void EncodeFast(long RANGE_WIDTH, long RANGE_TOTAL, int SHIFT) { NormalizeRangeCoder(); long nTemp = m_RangeCoderInfo.range >> (SHIFT); m_RangeCoderInfo.range = nTemp * (RANGE_WIDTH); m_RangeCoderInfo.low += nTemp * (RANGE_TOTAL); } private void EncodeDirect(long VALUE, int SHIFT) { NormalizeRangeCoder(); m_RangeCoderInfo.range = m_RangeCoderInfo.range >> (SHIFT); m_RangeCoderInfo.low += m_RangeCoderInfo.range * (VALUE); } private void putc(long VALUE) { m_pBitArray[(int) (m_nCurrentBitIndex >> 5)] |= ((VALUE) & 0xFF) << (24 - (m_nCurrentBitIndex & 31)); m_nCurrentBitIndex += 8; } private void putc_nocap(long VALUE) { m_pBitArray[(int) (m_nCurrentBitIndex >> 5)] |= (VALUE) << (24 - (m_nCurrentBitIndex & 31)); m_nCurrentBitIndex += 8; } public void checkValue(long value) { if (value < 0 || value > 4294967295L) throw new JMACException("Wrong Value: " + value); } // encoding public void EncodeUnsignedLong(long n) throws IOException { // make sure there are at least 8 bytes in the buffer if (m_nCurrentBitIndex > (BIT_ARRAY_BYTES - 8)) OutputBitArray(); // encode the value int nBitArrayIndex = (int) (m_nCurrentBitIndex >> 5); int nBitIndex = (int) (m_nCurrentBitIndex & 31); if (nBitIndex == 0) m_pBitArray[nBitArrayIndex] = (int) n; else { m_pBitArray[nBitArrayIndex] |= n >> nBitIndex; m_pBitArray[nBitArrayIndex + 1] = (int) (n << (32 - nBitIndex)); } m_nCurrentBitIndex += 32; } public void EncodeValue(int nEncode, BitArrayState BitArrayState) throws IOException { // make sure there is room for the data // this is a little slower than ensuring a huge block to start with, but it's safer if (m_nCurrentBitIndex > REFILL_BIT_THRESHOLD) OutputBitArray(); // convert to unsigned nEncode = (nEncode > 0) ? nEncode * 2 - 1 : -nEncode * 2; int nOriginalKSum = BitArrayState.nKSum; // update nKSum BitArrayState.nKSum += ((nEncode + 1) / 2) - ((BitArrayState.nKSum + 16) >> 5); // update k if (BitArrayState.nKSum < K_SUM_MIN_BOUNDARY[BitArrayState.k]) BitArrayState.k--; else if (BitArrayState.nKSum >= K_SUM_MIN_BOUNDARY[BitArrayState.k + 1]) BitArrayState.k++; // figure the pivot value int nPivotValue = Math.max(nOriginalKSum / 32, 1); int nOverflow = nEncode / nPivotValue; int nBase = nEncode - (nOverflow * nPivotValue); // store the overflow if (nOverflow < (MODEL_ELEMENTS - 1)) EncodeFast(RANGE_WIDTH[nOverflow], RANGE_TOTAL[nOverflow], RANGE_OVERFLOW_SHIFT); else { // store the "special" overflow (tells that perfect k is encoded next) EncodeFast(RANGE_WIDTH[MODEL_ELEMENTS - 1], RANGE_TOTAL[MODEL_ELEMENTS - 1], RANGE_OVERFLOW_SHIFT); // code the overflow using straight bits EncodeDirect((nOverflow >> 16) & 0xFFFF, 16); EncodeDirect(nOverflow & 0xFFFF, 16); } // code the base { if (nPivotValue >= (1 << 16)) { int nPivotValueBits = 0; while ((nPivotValue >> nPivotValueBits) > 0) nPivotValueBits++; int nSplitFactor = 1 << (nPivotValueBits - 16); // we know that base is smaller than pivot coming into this // however, after we divide both by an integer, they could be the same // we account by adding one to the pivot, but this hurts compression // by (1 / nSplitFactor) -- therefore we maximize the split factor // that gets one added to it // encode the pivot as two pieces int nPivotValueA = (nPivotValue / nSplitFactor) + 1; int nPivotValueB = nSplitFactor; int nBaseA = nBase / nSplitFactor; int nBaseB = nBase % nSplitFactor; { NormalizeRangeCoder(); long nTemp = m_RangeCoderInfo.range / nPivotValueA; m_RangeCoderInfo.range = nTemp; m_RangeCoderInfo.low += nTemp * nBaseA; } { NormalizeRangeCoder(); long nTemp = m_RangeCoderInfo.range / nPivotValueB; m_RangeCoderInfo.range = nTemp; m_RangeCoderInfo.low += nTemp * nBaseB; } } else { NormalizeRangeCoder(); long nTemp = m_RangeCoderInfo.range / nPivotValue; m_RangeCoderInfo.range = nTemp; m_RangeCoderInfo.low += nTemp * nBase; } } } public void EncodeBits(long nValue, int nBits) throws IOException { // make sure there is room for the data // this is a little slower than ensuring a huge block to start with, but it's safer if (m_nCurrentBitIndex > REFILL_BIT_THRESHOLD) OutputBitArray(); EncodeDirect(nValue, nBits); } // output (saving) public void OutputBitArray() throws IOException { OutputBitArray(false); } private ByteArrayWriter m_pWriter = new ByteArrayWriter(); public void OutputBitArray(boolean bFinalize) throws IOException { // write the entire file to disk long nBytesToWrite = 0; m_pWriter.reset(m_pBitArray.length * 4); for (int i = 0; i < m_pBitArray.length; i++) m_pWriter.writeInt(m_pBitArray[i]); if (bFinalize) { nBytesToWrite = ((m_nCurrentBitIndex >> 5) * 4) + 4; m_MD5.Update(m_pWriter.getBytes(), (int) nBytesToWrite); m_pIO.write(m_pWriter.getBytes(), 0, (int) nBytesToWrite); // reset the bit pointer m_nCurrentBitIndex = 0; } else { nBytesToWrite = (m_nCurrentBitIndex >> 5) * 4; m_MD5.Update(m_pWriter.getBytes(), (int) nBytesToWrite); m_pIO.write(m_pWriter.getBytes(), 0, (int) nBytesToWrite); // move the last value to the front of the bit array m_pBitArray[0] = m_pBitArray[(int) (m_nCurrentBitIndex >> 5)]; m_nCurrentBitIndex = (m_nCurrentBitIndex & 31); // zero the rest of the memory (may not need the +1 because of frame byte alignment) Arrays.fill(m_pBitArray, 1, (int) (Math.min(nBytesToWrite + 1, BIT_ARRAY_BYTES - 1) / 4 + 1), 0); } } // other functions public void Finalize() { NormalizeRangeCoder(); long nTemp = (m_RangeCoderInfo.low >> SHIFT_BITS) + 1; if (nTemp > 0xFF) // we have a carry { putc(m_RangeCoderInfo.buffer + 1); for (; m_RangeCoderInfo.help > 0; m_RangeCoderInfo.help--) putc(0); } else // no carry { putc(m_RangeCoderInfo.buffer); for (; m_RangeCoderInfo.help > 0; m_RangeCoderInfo.help--) putc(((char) 0xFF)); } // we must output these bytes so the core can properly work at the end of the stream putc(nTemp & 0xFF); putc(0); putc(0); putc(0); } public void AdvanceToByteBoundary() { while ((m_nCurrentBitIndex % 8) > 0) m_nCurrentBitIndex++; } public long GetCurrentBitIndex() { return m_nCurrentBitIndex; } public void FlushState(BitArrayState BitArrayState) { // k and ksum BitArrayState.k = 10; BitArrayState.nKSum = (1 << BitArrayState.k) * 16; } public void FlushBitArray() { // advance to a byte boundary (for alignment) AdvanceToByteBoundary(); // the range coder m_RangeCoderInfo.low = 0; // full code range m_RangeCoderInfo.range = TOP_VALUE; m_RangeCoderInfo.buffer = 0; m_RangeCoderInfo.help = 0; // no bytes to follow } public MD5 GetMD5Helper() { return m_MD5; } // data members private int[] m_pBitArray; private File m_pIO; private long m_nCurrentBitIndex; private RangeCoderStructCompress m_RangeCoderInfo = new RangeCoderStructCompress(); private MD5 m_MD5 = new MD5(); } jmac-1.74/core/src/davaguine/jmac/encoder/BitArrayState.java0000644000175000017500000000213510131230056023701 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.encoder; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class BitArrayState { public int k; public int nKSum; } jmac-1.74/core/src/davaguine/jmac/encoder/IAPECompress.java0000644000175000017500000002514110131230056023417 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.encoder; import davaguine.jmac.info.CompressionLevel; import davaguine.jmac.info.InputSource; import davaguine.jmac.info.WaveFormat; import davaguine.jmac.tools.ByteBuffer; import davaguine.jmac.tools.File; import davaguine.jmac.tools.IntegerPointer; import java.io.IOException; /** * Author: Dmitry Vaguine * Date: 07.05.2004 * Time: 13:10:46 */ public abstract class IAPECompress { public final static int CREATE_WAV_HEADER_ON_DECOMPRESSION = -1; public final static int MAX_AUDIO_BYTES_UNKNOWN = -1; /** * ****************************************************************************************** * Start * ******************************************************************************************* */ ////////////////////////////////////////////////////////////////////////////////////////////// // Start(...) / StartEx(...) - starts encoding // // Parameters: // CIO * pioOutput / const wchar_t * pFilename // the output... either a filename or an I/O source // WAVEFORMATEX * pwfeInput // format of the audio to encode (use FillWaveFormatEx() if necessary) // int nMaxAudioBytes // the absolute maximum audio bytes that will be encoded... encoding fails with a // ERROR_APE_COMPRESS_TOO_MUCH_DATA if you attempt to encode more than specified here // (if unknown, use MAX_AUDIO_BYTES_UNKNOWN to allocate as much storage in the seek table as // possible... limit is then 2 GB of data (~4 hours of CD music)... this wastes around // 30kb, so only do it if completely necessary) // int nCompressionLevel // the compression level for the APE file (fast - extra high) // (note: extra-high is much slower for little gain) // const unsigned char * pHeaderData // a pointer to a buffer containing the WAV header (data before the data block in the WAV) // (note: use NULL for on-the-fly encoding... see next parameter) // int nHeaderBytes // number of bytes in the header data buffer (use CREATE_WAV_HEADER_ON_DECOMPRESSION and // NULL for the pHeaderData and MAC will automatically create the appropriate WAV header // on decompression) ////////////////////////////////////////////////////////////////////////////////////////////// public void Start(String pOutputFilename, WaveFormat pwfeInput) throws IOException { Start(pOutputFilename, pwfeInput, MAX_AUDIO_BYTES_UNKNOWN, CompressionLevel.COMPRESSION_LEVEL_NORMAL, null, CREATE_WAV_HEADER_ON_DECOMPRESSION); } public void Start(String pOutputFilename, WaveFormat pwfeInput, int nMaxAudioBytes) throws IOException { Start(pOutputFilename, pwfeInput, nMaxAudioBytes, CompressionLevel.COMPRESSION_LEVEL_NORMAL, null, CREATE_WAV_HEADER_ON_DECOMPRESSION); } public void Start(String pOutputFilename, WaveFormat pwfeInput, int nMaxAudioBytes, int nCompressionLevel) throws IOException { Start(pOutputFilename, pwfeInput, nMaxAudioBytes, nCompressionLevel, null, CREATE_WAV_HEADER_ON_DECOMPRESSION); } public void Start(String pOutputFilename, WaveFormat pwfeInput, int nMaxAudioBytes, int nCompressionLevel, byte[] pHeaderData) throws IOException { Start(pOutputFilename, pwfeInput, nMaxAudioBytes, nCompressionLevel, pHeaderData, CREATE_WAV_HEADER_ON_DECOMPRESSION); } public abstract void Start(String pOutputFilename, WaveFormat pwfeInput, int nMaxAudioBytes, int nCompressionLevel, byte[] pHeaderData, int nHeaderBytes) throws IOException; public void StartEx(File pioOutput, WaveFormat pwfeInput) throws IOException { StartEx(pioOutput, pwfeInput, MAX_AUDIO_BYTES_UNKNOWN, CompressionLevel.COMPRESSION_LEVEL_NORMAL, null, CREATE_WAV_HEADER_ON_DECOMPRESSION); } public void StartEx(File pioOutput, WaveFormat pwfeInput, int nMaxAudioBytes) throws IOException { StartEx(pioOutput, pwfeInput, nMaxAudioBytes, CompressionLevel.COMPRESSION_LEVEL_NORMAL, null, CREATE_WAV_HEADER_ON_DECOMPRESSION); } public void StartEx(File pioOutput, WaveFormat pwfeInput, int nMaxAudioBytes, int nCompressionLevel) throws IOException { StartEx(pioOutput, pwfeInput, nMaxAudioBytes, nCompressionLevel, null, CREATE_WAV_HEADER_ON_DECOMPRESSION); } public void StartEx(File pioOutput, WaveFormat pwfeInput, int nMaxAudioBytes, int nCompressionLevel, byte[] pHeaderData) throws IOException { StartEx(pioOutput, pwfeInput, nMaxAudioBytes, nCompressionLevel, pHeaderData, CREATE_WAV_HEADER_ON_DECOMPRESSION); } public abstract void StartEx(File pioOutput, WaveFormat pwfeInput, int nMaxAudioBytes, int nCompressionLevel, byte[] pHeaderData, int nHeaderBytes) throws IOException; /** * ****************************************************************************************** * Add / Compress Data * - there are 3 ways to add data: * 1) simple call AddData(...) * 2) lock MAC's buffer, copy into it, and unlock (LockBuffer(...) / UnlockBuffer(...)) * 3) from an I/O source (AddDataFromInputSource(...)) * ******************************************************************************************* */ ////////////////////////////////////////////////////////////////////////////////////////////// // AddData(...) - adds data to the encoder // // Parameters: // unsigned char * pData // a pointer to a buffer containing the raw audio data // int nBytes // the number of bytes in the buffer ////////////////////////////////////////////////////////////////////////////////////////////// public abstract void AddData(byte[] pData, int nBytes) throws IOException; ////////////////////////////////////////////////////////////////////////////////////////////// // GetBufferBytesAvailable(...) - returns the number of bytes available in the buffer // (helpful when locking) ////////////////////////////////////////////////////////////////////////////////////////////// public abstract int GetBufferBytesAvailable(); ////////////////////////////////////////////////////////////////////////////////////////////// // LockBuffer(...) - locks MAC's buffer so we can copy into it // // Parameters: // int * pBytesAvailable // returns the number of bytes available in the buffer (DO NOT COPY MORE THAN THIS IN) // // Return: // pointer to the buffer (add at that location) ////////////////////////////////////////////////////////////////////////////////////////////// public abstract ByteBuffer LockBuffer(IntegerPointer pBytesAvailable); ////////////////////////////////////////////////////////////////////////////////////////////// // UnlockBuffer(...) - releases the buffer // // Parameters: // int nBytesAdded // the number of bytes copied into the buffer // BOOL bProcess // whether MAC should process as much as possible of the buffer ////////////////////////////////////////////////////////////////////////////////////////////// public void UnlockBuffer(int nBytesAdded) throws IOException { UnlockBuffer(nBytesAdded, true); } public abstract void UnlockBuffer(int nBytesAdded, boolean bProcess) throws IOException; ////////////////////////////////////////////////////////////////////////////////////////////// // AddDataFromInputSource(...) - use a CInputSource (input source) to add data // // Parameters: // CInputSource * pInputSource // a pointer to the input source // int nMaxBytes // the maximum number of bytes to let MAC add (-1 if MAC can add any amount) // int * pBytesAdded // returns the number of bytes added from the I/O source ////////////////////////////////////////////////////////////////////////////////////////////// public int AddDataFromInputSource(InputSource pInputSource) throws IOException { return AddDataFromInputSource(pInputSource, -1); } public abstract int AddDataFromInputSource(InputSource pInputSource, int nMaxBytes) throws IOException; /** * ****************************************************************************************** * Finish / Kill * ******************************************************************************************* */ ////////////////////////////////////////////////////////////////////////////////////////////// // Finish(...) - ends encoding and finalizes the file // // Parameters: // unsigned char * pTerminatingData // a pointer to a buffer containing the information to place at the end of the APE file // (comprised of the WAV terminating data (data after the data block in the WAV) followed // by any tag information) // int nTerminatingBytes // number of bytes in the terminating data buffer // int nWAVTerminatingBytes // the number of bytes of the terminating data buffer that should be appended to a decoded // WAV file (it's basically nTerminatingBytes - the bytes that make up the tag) ////////////////////////////////////////////////////////////////////////////////////////////// public abstract void Finish(byte[] pTerminatingData, int nTerminatingBytes, int nWAVTerminatingBytes) throws IOException; ////////////////////////////////////////////////////////////////////////////////////////////// // Kill(...) - stops encoding and deletes the output file // --- NOT CURRENTLY IMPLEMENTED --- ////////////////////////////////////////////////////////////////////////////////////////////// public abstract void Kill(); public static IAPECompress CreateIAPECompress() { return new APECompress(); } } jmac-1.74/core/src/davaguine/jmac/encoder/RangeCoderStructCompress.java0000644000175000017500000000243010131230056026113 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.encoder; /** * Author: Dmitry Vaguine * Date: 04.05.2004 * Time: 16:44:23 */ public class RangeCoderStructCompress { public long low; // low end of interval public long range; // length of interval public long help; // bytes_to_follow resp. intermediate value public short buffer; // buffer for input / output } jmac-1.74/core/src/davaguine/jmac/info/0000755000175000017500000000000010451144641017644 5ustar twernertwernerjmac-1.74/core/src/davaguine/jmac/info/APEDescriptor.java0000644000175000017500000000771510131230056023154 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.info; import davaguine.jmac.tools.ByteArrayReader; import davaguine.jmac.tools.ByteArrayWriter; import davaguine.jmac.tools.File; import davaguine.jmac.tools.JMACException; import java.io.EOFException; import java.io.IOException; /** * Author: Dmitry Vaguine * Date: 07.04.2004 * Time: 14:36:53 */ public class APEDescriptor { public String cID; // should equal 'MAC ' (char[4]) public int nVersion; // version number * 1000 (3.81 = 3810) (unsigned short) public long nDescriptorBytes; // the number of descriptor bytes (allows later expansion of this header) (unsigned int32) public long nHeaderBytes; // the number of header APE_HEADER bytes (unsigned int32) public long nSeekTableBytes; // the number of bytes of the seek table (unsigned int32) public long nHeaderDataBytes; // the number of header data bytes (from original file) (unsigned int32) public long nAPEFrameDataBytes; // the number of bytes of APE frame data (unsigned int32) public long nAPEFrameDataBytesHigh; // the high order number of APE frame data bytes (unsigned int32) public long nTerminatingDataBytes; // the terminating data of the file (not including tag data) (unsigned int32) public byte[] cFileMD5 = new byte[16]; // the MD5 hash of the file (see notes for usage... it's a littly tricky) (unsigned char[16]) public final static int APE_DESCRIPTOR_BYTES = 52; public static APEDescriptor read(final File file) throws IOException { try { APEDescriptor header = new APEDescriptor(); final ByteArrayReader reader = new ByteArrayReader(file, APE_DESCRIPTOR_BYTES - 16); header.cID = reader.readString(4, "US-ASCII"); header.nVersion = reader.readUnsignedShort(); reader.skipBytes(2); header.nDescriptorBytes = reader.readUnsignedInt(); header.nHeaderBytes = reader.readUnsignedInt(); header.nSeekTableBytes = reader.readUnsignedInt(); header.nHeaderDataBytes = reader.readUnsignedInt(); header.nAPEFrameDataBytes = reader.readUnsignedInt(); header.nAPEFrameDataBytesHigh = reader.readUnsignedInt(); header.nTerminatingDataBytes = reader.readUnsignedInt(); file.readFully(header.cFileMD5); return header; } catch (EOFException e) { throw new JMACException("Unsupported Format"); } } public void write(ByteArrayWriter writer) { writer.writeString(cID, 4, "US-ASCII"); writer.writeUnsignedShort(nVersion); writer.writeUnsignedShort(0); writer.writeUnsignedInt(nDescriptorBytes); writer.writeUnsignedInt(nHeaderBytes); writer.writeUnsignedInt(nSeekTableBytes); writer.writeUnsignedInt(nHeaderDataBytes); writer.writeUnsignedInt(nAPEFrameDataBytes); writer.writeUnsignedInt(nAPEFrameDataBytesHigh); writer.writeUnsignedInt(nTerminatingDataBytes); writer.writeBytes(cFileMD5); } } jmac-1.74/core/src/davaguine/jmac/info/APEFileInfo.java0000644000175000017500000000604710131230056022526 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.info; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class APEFileInfo { public int nVersion; // file version number * 1000 (3.93 = 3930) public int nCompressionLevel; // the compression level public int nFormatFlags; // format flags public int nTotalFrames; // the total number frames (frames are used internally) public int nBlocksPerFrame; // the samples in a frame (frames are used internally) public int nFinalFrameBlocks; // the number of samples in the final frame public int nChannels; // audio channels public int nSampleRate; // audio samples per second public int nBitsPerSample; // audio bits per sample public int nBytesPerSample; // audio bytes per sample public int nBlockAlign; // audio block align (channels * bytes per sample) public int nWAVHeaderBytes; // header bytes of the original WAV public int nWAVDataBytes; // data bytes of the original WAV public int nWAVTerminatingBytes; // terminating bytes of the original WAV public int nWAVTotalBytes; // total bytes of the original WAV public int nAPETotalBytes; // total bytes of the APE file public int nTotalBlocks; // the total number audio blocks public int nLengthMS; // the length in milliseconds public int nAverageBitrate; // the kbps (i.e. 637 kpbs) public int nDecompressedBitrate; // the kbps of the decompressed audio (i.e. 1440 kpbs for CD audio) public int nPeakLevel; // the peak audio level (-1 if unknown) public int nJunkHeaderBytes; // used for ID3v2, etc. public int nSeekTableElements; // the number of elements in the seek table(s) public int[] spSeekByteTable; // the seek table (byte) public byte[] spSeekBitTable; // the seek table (bits -- legacy) public byte[] spWaveHeaderData; // the pre-audio header data public APEDescriptor spAPEDescriptor; // the descriptor (only with newer files) } jmac-1.74/core/src/davaguine/jmac/info/APEHeader.java0000644000175000017500000003330510450421307022225 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.info; import davaguine.jmac.tools.ByteArrayReader; import davaguine.jmac.tools.File; import davaguine.jmac.tools.JMACException; import java.io.EOFException; import java.io.IOException; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class APEHeader { public final static int MAC_FORMAT_FLAG_8_BIT = 1; // is 8-bit public final static int MAC_FORMAT_FLAG_CRC = 2; // uses the new CRC32 error detection public final static int MAC_FORMAT_FLAG_HAS_PEAK_LEVEL = 4; // unsigned __int32 Peak_Level after the header public final static int MAC_FORMAT_FLAG_24_BIT = 8; // is 24-bit public final static int MAC_FORMAT_FLAG_HAS_SEEK_ELEMENTS = 16; // has the number of seek elements after the peak level public final static int MAC_FORMAT_FLAG_CREATE_WAV_HEADER = 32; // create the wave header on decompression (not stored) public APEHeader(final File file) { m_pIO = file; } public void Analyze(APEFileInfo pInfo) throws IOException { // find the descriptor pInfo.nJunkHeaderBytes = FindDescriptor(true); if (pInfo.nJunkHeaderBytes < 0) throw new JMACException("Unsupported Format"); // read the first 8 bytes of the descriptor (ID and version) m_pIO.mark(10); final ByteArrayReader reader = new ByteArrayReader(m_pIO, 8); if (!reader.readString(4, "US-ASCII").equals("MAC ")) throw new JMACException("Unsupported Format"); int version = reader.readUnsignedShort(); m_pIO.reset(); if (version >= 3980) { // current header format AnalyzeCurrent(pInfo); } else { // legacy support AnalyzeOld(pInfo); } } protected void AnalyzeCurrent(APEFileInfo m_APEFileInfo) throws IOException { m_APEFileInfo.spAPEDescriptor = APEDescriptor.read(m_pIO); if ((m_APEFileInfo.spAPEDescriptor.nDescriptorBytes - APEDescriptor.APE_DESCRIPTOR_BYTES) > 0) m_pIO.skipBytes((int) (m_APEFileInfo.spAPEDescriptor.nDescriptorBytes - APEDescriptor.APE_DESCRIPTOR_BYTES)); final APEHeaderNew APEHeader = APEHeaderNew.read(m_pIO); if ((m_APEFileInfo.spAPEDescriptor.nHeaderBytes - APEHeaderNew.APE_HEADER_BYTES) > 0) m_pIO.skipBytes((int) (m_APEFileInfo.spAPEDescriptor.nHeaderBytes - APEHeaderNew.APE_HEADER_BYTES)); // fill the APE info structure m_APEFileInfo.nVersion = m_APEFileInfo.spAPEDescriptor.nVersion; m_APEFileInfo.nCompressionLevel = APEHeader.nCompressionLevel; m_APEFileInfo.nFormatFlags = APEHeader.nFormatFlags; m_APEFileInfo.nTotalFrames = (int) APEHeader.nTotalFrames; m_APEFileInfo.nFinalFrameBlocks = (int) APEHeader.nFinalFrameBlocks; m_APEFileInfo.nBlocksPerFrame = (int) APEHeader.nBlocksPerFrame; m_APEFileInfo.nChannels = APEHeader.nChannels; m_APEFileInfo.nSampleRate = (int) APEHeader.nSampleRate; m_APEFileInfo.nBitsPerSample = APEHeader.nBitsPerSample; m_APEFileInfo.nBytesPerSample = m_APEFileInfo.nBitsPerSample / 8; m_APEFileInfo.nBlockAlign = m_APEFileInfo.nBytesPerSample * m_APEFileInfo.nChannels; m_APEFileInfo.nTotalBlocks = (int) ((APEHeader.nTotalFrames == 0) ? 0 : ((APEHeader.nTotalFrames - 1) * m_APEFileInfo.nBlocksPerFrame) + APEHeader.nFinalFrameBlocks); m_APEFileInfo.nWAVHeaderBytes = (int) ((APEHeader.nFormatFlags & MAC_FORMAT_FLAG_CREATE_WAV_HEADER) > 0 ? WaveHeader.WAVE_HEADER_BYTES : m_APEFileInfo.spAPEDescriptor.nHeaderDataBytes); m_APEFileInfo.nWAVTerminatingBytes = (int) m_APEFileInfo.spAPEDescriptor.nTerminatingDataBytes; m_APEFileInfo.nWAVDataBytes = m_APEFileInfo.nTotalBlocks * m_APEFileInfo.nBlockAlign; m_APEFileInfo.nWAVTotalBytes = m_APEFileInfo.nWAVDataBytes + m_APEFileInfo.nWAVHeaderBytes + m_APEFileInfo.nWAVTerminatingBytes; m_APEFileInfo.nAPETotalBytes = m_pIO.isLocal() ? (int) m_pIO.length() : -1; m_APEFileInfo.nLengthMS = (int) ((m_APEFileInfo.nTotalBlocks * 1000L) / m_APEFileInfo.nSampleRate); m_APEFileInfo.nAverageBitrate = (m_APEFileInfo.nLengthMS <= 0) ? 0 : (int) ((m_APEFileInfo.nAPETotalBytes * 8L) / m_APEFileInfo.nLengthMS); m_APEFileInfo.nDecompressedBitrate = (m_APEFileInfo.nBlockAlign * m_APEFileInfo.nSampleRate * 8) / 1000; m_APEFileInfo.nSeekTableElements = (int) (m_APEFileInfo.spAPEDescriptor.nSeekTableBytes / 4); m_APEFileInfo.nPeakLevel = -1; // get the seek tables (really no reason to get the whole thing if there's extra) m_APEFileInfo.spSeekByteTable = new int[m_APEFileInfo.nSeekTableElements]; for (int i = 0; i < m_APEFileInfo.nSeekTableElements; i++) m_APEFileInfo.spSeekByteTable[i] = m_pIO.readIntBack(); // get the wave header if ((APEHeader.nFormatFlags & MAC_FORMAT_FLAG_CREATE_WAV_HEADER) <= 0) { if (m_APEFileInfo.nWAVHeaderBytes > Integer.MAX_VALUE) throw new JMACException("The HeaderBytes Parameter Is Too Big"); m_APEFileInfo.spWaveHeaderData = new byte[m_APEFileInfo.nWAVHeaderBytes]; try { m_pIO.readFully(m_APEFileInfo.spWaveHeaderData); } catch (EOFException e) { throw new JMACException("Can't Read Wave Header Data"); } } } protected void AnalyzeOld(APEFileInfo m_APEFileInfo) throws IOException { APEHeaderOld header = APEHeaderOld.read(m_pIO); // fail on 0 length APE files (catches non-finalized APE files) if (header.nTotalFrames == 0) throw new JMACException("Unsupported Format"); int nPeakLevel = -1; if ((header.nFormatFlags & MAC_FORMAT_FLAG_HAS_PEAK_LEVEL) > 0) nPeakLevel = m_pIO.readIntBack(); if ((header.nFormatFlags & MAC_FORMAT_FLAG_HAS_SEEK_ELEMENTS) > 0) m_APEFileInfo.nSeekTableElements = m_pIO.readIntBack(); else m_APEFileInfo.nSeekTableElements = (int) header.nTotalFrames; // fill the APE info structure m_APEFileInfo.nVersion = header.nVersion; m_APEFileInfo.nCompressionLevel = header.nCompressionLevel; m_APEFileInfo.nFormatFlags = header.nFormatFlags; m_APEFileInfo.nTotalFrames = (int) header.nTotalFrames; m_APEFileInfo.nFinalFrameBlocks = (int) header.nFinalFrameBlocks; m_APEFileInfo.nBlocksPerFrame = ((header.nVersion >= 3900) || ((header.nVersion >= 3800) && (header.nCompressionLevel == CompressionLevel.COMPRESSION_LEVEL_EXTRA_HIGH))) ? 73728 : 9216; if (header.nVersion >= 3950) m_APEFileInfo.nBlocksPerFrame = 73728 * 4; m_APEFileInfo.nChannels = header.nChannels; m_APEFileInfo.nSampleRate = (int) header.nSampleRate; m_APEFileInfo.nBitsPerSample = (m_APEFileInfo.nFormatFlags & MAC_FORMAT_FLAG_8_BIT) > 0 ? 8 : ((m_APEFileInfo.nFormatFlags & MAC_FORMAT_FLAG_24_BIT) > 0 ? 24 : 16); m_APEFileInfo.nBytesPerSample = m_APEFileInfo.nBitsPerSample / 8; m_APEFileInfo.nBlockAlign = m_APEFileInfo.nBytesPerSample * m_APEFileInfo.nChannels; m_APEFileInfo.nTotalBlocks = (int) ((header.nTotalFrames == 0) ? 0 : ((header.nTotalFrames - 1) * m_APEFileInfo.nBlocksPerFrame) + header.nFinalFrameBlocks); m_APEFileInfo.nWAVHeaderBytes = (int) ((header.nFormatFlags & MAC_FORMAT_FLAG_CREATE_WAV_HEADER) > 0 ? WaveHeader.WAVE_HEADER_BYTES : header.nHeaderBytes); m_APEFileInfo.nWAVTerminatingBytes = (int) header.nTerminatingBytes; m_APEFileInfo.nWAVDataBytes = m_APEFileInfo.nTotalBlocks * m_APEFileInfo.nBlockAlign; m_APEFileInfo.nWAVTotalBytes = m_APEFileInfo.nWAVDataBytes + m_APEFileInfo.nWAVHeaderBytes + m_APEFileInfo.nWAVTerminatingBytes; m_APEFileInfo.nAPETotalBytes = m_pIO.isLocal() ? (int) m_pIO.length() : -1; m_APEFileInfo.nLengthMS = (int) ((m_APEFileInfo.nTotalBlocks * 1000L) / m_APEFileInfo.nSampleRate); m_APEFileInfo.nAverageBitrate = (int) ((m_APEFileInfo.nLengthMS <= 0) ? 0 : ((m_APEFileInfo.nAPETotalBytes * 8L) / m_APEFileInfo.nLengthMS)); m_APEFileInfo.nDecompressedBitrate = (m_APEFileInfo.nBlockAlign * m_APEFileInfo.nSampleRate * 8) / 1000; m_APEFileInfo.nPeakLevel = nPeakLevel; // get the wave header if ((header.nFormatFlags & MAC_FORMAT_FLAG_CREATE_WAV_HEADER) <= 0) { if (header.nHeaderBytes > Integer.MAX_VALUE) throw new JMACException("The HeaderBytes Parameter Is Too Big"); m_APEFileInfo.spWaveHeaderData = new byte[(int) header.nHeaderBytes]; try { m_pIO.readFully(m_APEFileInfo.spWaveHeaderData); } catch (EOFException e) { throw new JMACException("Can't Read Wave Header Data"); } } // get the seek tables (really no reason to get the whole thing if there's extra) m_APEFileInfo.spSeekByteTable = new int[m_APEFileInfo.nSeekTableElements]; for (int i = 0; i < m_APEFileInfo.nSeekTableElements; i++) m_APEFileInfo.spSeekByteTable[i] = m_pIO.readIntBack(); if (header.nVersion <= 3800) { m_APEFileInfo.spSeekBitTable = new byte[m_APEFileInfo.nSeekTableElements]; try { m_pIO.readFully(m_APEFileInfo.spSeekBitTable); } catch (EOFException e) { throw new JMACException("Can't Read Seek Bit Table"); } } } protected int FindDescriptor(boolean bSeek) throws IOException { int nJunkBytes = 0; // We need to limit this method if m_pIO is represented as URL // We'll not support ID3 tags for such files if (m_pIO.isLocal()) { // figure the extra header bytes m_pIO.mark(1000); // skip an ID3v2 tag (which we really don't support anyway...) ByteArrayReader reader = new ByteArrayReader(10); reader.reset(m_pIO, 10); final String tag = reader.readString(3, "US-ASCII"); if (tag.equals("ID3")) { // why is it so hard to figure the lenght of an ID3v2 tag ?!? reader.readByte(); reader.readByte(); int byte5 = reader.readUnsignedByte(); int nSyncSafeLength; nSyncSafeLength = (reader.readUnsignedByte() & 127) << 21; nSyncSafeLength += (reader.readUnsignedByte() & 127) << 14; nSyncSafeLength += (reader.readUnsignedByte() & 127) << 7; nSyncSafeLength += (reader.readUnsignedByte() & 127); boolean bHasTagFooter = false; if ((byte5 & 16) > 0) { bHasTagFooter = true; nJunkBytes = nSyncSafeLength + 20; } else { nJunkBytes = nSyncSafeLength + 10; } // error check if ((byte5 & 64) > 0) { // this ID3v2 length calculator algorithm can't cope with extended headers // we should be ok though, because the scan for the MAC header below should // really do the trick } m_pIO.skipBytes(nJunkBytes - 10); // scan for padding (slow and stupid, but who cares here...) if (!bHasTagFooter) { while (m_pIO.read() == 0) nJunkBytes++; } } m_pIO.reset(); m_pIO.skipBytes(nJunkBytes); } m_pIO.mark(1000); // scan until we hit the APE header, the end of the file, or 1 MB later int nGoalID = ('M' << 24) | ('A' << 16) | ('C' << 8) | (' '); int nReadID = m_pIO.readInt(); // Also, lets suppose that MAC header placed in beginning of file in case of external source of file if(m_pIO.isLocal()) { int nScanBytes = 0; while (nGoalID != nReadID && nScanBytes < (1024 * 1024)) { nReadID = (nReadID << 8) | m_pIO.readByte(); nJunkBytes++; nScanBytes++; } } if (nGoalID != nReadID) nJunkBytes = -1; // seek to the proper place (depending on result and settings) if (bSeek && (nJunkBytes != -1)) { // successfully found the start of the file (seek to it and return) m_pIO.reset(); m_pIO.skipBytes(nJunkBytes); m_pIO.mark(1000); } else { // restore the original file pointer m_pIO.reset(); } return nJunkBytes; } protected File m_pIO; } jmac-1.74/core/src/davaguine/jmac/info/APEHeaderNew.java0000644000175000017500000000651310131230056022673 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.info; import davaguine.jmac.tools.ByteArrayReader; import davaguine.jmac.tools.ByteArrayWriter; import davaguine.jmac.tools.File; import davaguine.jmac.tools.JMACException; import java.io.EOFException; import java.io.IOException; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class APEHeaderNew { public int nCompressionLevel; // the compression level (unsigned short) public int nFormatFlags; // any format flags (for future use) (unsigned short) public long nBlocksPerFrame; // the number of audio blocks in one frame (unsigned int) public long nFinalFrameBlocks; // the number of audio blocks in the final frame (unsigned int) public long nTotalFrames; // the total number of frames (unsigned int) public int nBitsPerSample; // the bits per sample (typically 16) (unsigned short) public int nChannels; // the number of channels (1 or 2) (unsigned short) public long nSampleRate; // the sample rate (typically 44100) (unsigned int) public final static int APE_HEADER_BYTES = 24; public static APEHeaderNew read(final File file) throws IOException { try { APEHeaderNew header = new APEHeaderNew(); final ByteArrayReader reader = new ByteArrayReader(file, APE_HEADER_BYTES); header.nCompressionLevel = reader.readUnsignedShort(); header.nFormatFlags = reader.readUnsignedShort(); header.nBlocksPerFrame = reader.readUnsignedInt(); header.nFinalFrameBlocks = reader.readUnsignedInt(); header.nTotalFrames = reader.readUnsignedInt(); header.nBitsPerSample = reader.readUnsignedShort(); header.nChannels = reader.readUnsignedShort(); header.nSampleRate = reader.readUnsignedInt(); return header; } catch (EOFException e) { throw new JMACException("Unsupported Format"); } } public void write(ByteArrayWriter writer) { writer.writeUnsignedShort(nCompressionLevel); writer.writeUnsignedShort(nFormatFlags); writer.writeUnsignedInt(nBlocksPerFrame); writer.writeUnsignedInt(nFinalFrameBlocks); writer.writeUnsignedInt(nTotalFrames); writer.writeUnsignedShort(nBitsPerSample); writer.writeUnsignedShort(nChannels); writer.writeUnsignedInt(nSampleRate); } } jmac-1.74/core/src/davaguine/jmac/info/APEHeaderOld.java0000644000175000017500000000574710131230056022670 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.info; import davaguine.jmac.tools.ByteArrayReader; import davaguine.jmac.tools.File; import davaguine.jmac.tools.JMACException; import java.io.EOFException; import java.io.IOException; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class APEHeaderOld { public String cID; // should equal 'MAC ' public int nVersion; // version number * 1000 (3.81 = 3810) public int nCompressionLevel; // the compression level public int nFormatFlags; // any format flags (for future use) public int nChannels; // the number of channels (1 or 2) public long nSampleRate; // the sample rate (typically 44100) public long nHeaderBytes; // the bytes after the MAC header that compose the WAV header public long nTerminatingBytes; // the bytes after that raw data (for extended info) public long nTotalFrames; // the number of frames in the file public long nFinalFrameBlocks; // the number of samples in the final frame public final static int APE_HEADER_OLD_BYTES = 32; public static APEHeaderOld read(final File file) throws IOException { try { APEHeaderOld header = new APEHeaderOld(); final ByteArrayReader reader = new ByteArrayReader(file, APE_HEADER_OLD_BYTES); header.cID = reader.readString(4, "US-ASCII"); header.nVersion = reader.readUnsignedShort(); header.nCompressionLevel = reader.readUnsignedShort(); header.nFormatFlags = reader.readUnsignedShort(); header.nChannels = reader.readUnsignedShort(); header.nSampleRate = reader.readUnsignedInt(); header.nHeaderBytes = reader.readUnsignedInt(); header.nTerminatingBytes = reader.readUnsignedInt(); header.nTotalFrames = reader.readUnsignedInt(); header.nFinalFrameBlocks = reader.readUnsignedInt(); return header; } catch (EOFException e) { throw new JMACException("Unsupported Format"); } } } jmac-1.74/core/src/davaguine/jmac/info/APEInfo.java0000644000175000017500000002430410131230056021722 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.info; import davaguine.jmac.tools.File; import davaguine.jmac.tools.InputStreamFile; import davaguine.jmac.tools.JMACException; import davaguine.jmac.tools.RandomAccessFile; import java.io.EOFException; import java.io.IOException; import java.io.InputStream; import java.net.URL; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class APEInfo { // construction and destruction public APEInfo(URL url) throws IOException { this(url, null); } public APEInfo(URL url, APETag pTag) throws IOException { this(url.openStream(), pTag); } public APEInfo(java.io.File file) throws IOException { this(file, null); } public APEInfo(java.io.File file, APETag pTag) throws IOException { this(new RandomAccessFile(file, "r"), pTag); } public APEInfo(InputStream pIO) throws IOException { this(pIO, null); } public APEInfo(InputStream pIO, APETag pTag) throws IOException { this(new InputStreamFile(pIO), pTag); } public APEInfo(File pIO) throws IOException { this(pIO, null); } public APEInfo(File pIO, APETag pTag) throws IOException { // open the file m_spIO = pIO; // get the file information GetFileInformation(); // get the tag (do this second so that we don't do it on failure) if (pTag == null) { // we don't want to analyze right away for non-local files // since a single I/O object is shared, we can't tag and read at the same time (i.e. in multiple threads) m_spAPETag = new APETag(m_spIO, pIO.isLocal()); } else m_spAPETag = pTag; } public void close() throws IOException { m_APEFileInfo.spWaveHeaderData = null; m_APEFileInfo.spSeekBitTable = null; m_APEFileInfo.spSeekByteTable = null; m_APEFileInfo.spAPEDescriptor = null; m_spAPETag = null; // re-initialize variables m_APEFileInfo.nSeekTableElements = 0; m_bHasFileInformationLoaded = false; } public int getApeInfoFileVersion() { return m_APEFileInfo.nVersion; } public int getApeInfoCompressionLevel() { return m_APEFileInfo.nCompressionLevel; } public int getApeInfoFormatFlags() { return m_APEFileInfo.nFormatFlags; } public int getApeInfoSampleRate() { return m_APEFileInfo.nSampleRate; } public int getApeInfoBitsPerSample() { return m_APEFileInfo.nBitsPerSample; } public int getApeInfoBytesPerSample() { return m_APEFileInfo.nBytesPerSample; } public int getApeInfoChannels() { return m_APEFileInfo.nChannels; } public int getApeInfoBlockAlign() { return m_APEFileInfo.nBlockAlign; } public int getApeInfoBlocksPerFrame() { return m_APEFileInfo.nBlocksPerFrame; } public int getApeInfoFinalFrameBlocks() { return m_APEFileInfo.nFinalFrameBlocks; } public int getApeInfoTotalFrames() { return m_APEFileInfo.nTotalFrames; } public int getApeInfoWavHeaderBytes() { return m_APEFileInfo.nWAVHeaderBytes; } public int getApeInfoWavTerminatingBytes() { return m_APEFileInfo.nWAVTerminatingBytes; } public int getApeInfoWavDataBytes() { return m_APEFileInfo.nWAVDataBytes; } public int getApeInfoWavTotalBytes() { return m_APEFileInfo.nWAVTotalBytes; } public int getApeInfoApeTotalBytes() { return m_APEFileInfo.nAPETotalBytes; } public int getApeInfoTotalBlocks() { return m_APEFileInfo.nTotalBlocks; } public int getApeInfoLengthMs() { return m_APEFileInfo.nLengthMS; } public int getApeInfoAverageBitrate() { return m_APEFileInfo.nAverageBitrate; } public int getApeInfoSeekByte(int nFrame) { return (nFrame < 0 || nFrame >= m_APEFileInfo.nTotalFrames) ? 0 : m_APEFileInfo.spSeekByteTable[nFrame] + m_APEFileInfo.nJunkHeaderBytes; } public int getApeInfoFrameBytes(int nFrame) throws IOException { if ((nFrame < 0) || (nFrame >= m_APEFileInfo.nTotalFrames)) return -1; else { if (nFrame != (m_APEFileInfo.nTotalFrames - 1)) return getApeInfoSeekByte(nFrame + 1) - getApeInfoSeekByte(nFrame); else { if (m_spIO.isLocal()) return (int) m_spIO.length() - m_spAPETag.GetTagBytes() - m_APEFileInfo.nWAVTerminatingBytes - getApeInfoSeekByte(nFrame); else if (nFrame > 0) return getApeInfoSeekByte(nFrame) - getApeInfoSeekByte(nFrame - 1); else return -1; } } } public int getApeInfoFrameBlocks(int nFrame) { if ((nFrame < 0) || (nFrame >= m_APEFileInfo.nTotalFrames)) return -1; else { if (nFrame != (m_APEFileInfo.nTotalFrames - 1)) return m_APEFileInfo.nBlocksPerFrame; else return m_APEFileInfo.nFinalFrameBlocks; } } public int getApeInfoFrameBitrate(int nFrame) throws IOException { int nFrameBytes = getApeInfoFrameBytes(nFrame); int nFrameBlocks = getApeInfoFrameBlocks(nFrame); if ((nFrameBytes > 0) && (nFrameBlocks > 0) && m_APEFileInfo.nSampleRate > 0) { int nFrameMS = (nFrameBlocks * 1000) / m_APEFileInfo.nSampleRate; if (nFrameMS != 0) { return (nFrameBytes * 8) / nFrameMS; } } return m_APEFileInfo.nAverageBitrate; } public int getApeInfoDecompressedBitrate() { return m_APEFileInfo.nDecompressedBitrate; } public int getApeInfoPeakLevel() { return m_APEFileInfo.nPeakLevel; } public int getApeInfoSeekBit(int nFrame) { if (getApeInfoFileVersion() > 3800) return 0; else { if (nFrame < 0 || nFrame >= m_APEFileInfo.nTotalFrames) return 0; else return m_APEFileInfo.spSeekBitTable[nFrame]; } } public WaveFormat getApeInfoWaveFormatEx() { final WaveFormat pWaveFormatEx = new WaveFormat(); WaveFormat.FillWaveFormatEx(pWaveFormatEx, m_APEFileInfo.nSampleRate, m_APEFileInfo.nBitsPerSample, m_APEFileInfo.nChannels); return pWaveFormatEx; } public byte[] getApeInfoWavHeaderData(int nMaxBytes) { if ((m_APEFileInfo.nFormatFlags & APEHeader.MAC_FORMAT_FLAG_CREATE_WAV_HEADER) > 0) { if (WaveHeader.WAVE_HEADER_BYTES > nMaxBytes) return null; else { WaveFormat wfeFormat = getApeInfoWaveFormatEx(); WaveHeader WAVHeader = new WaveHeader(); WaveHeader.FillWaveHeader(WAVHeader, m_APEFileInfo.nWAVDataBytes, wfeFormat, m_APEFileInfo.nWAVTerminatingBytes); return WAVHeader.write(); } } else { if (m_APEFileInfo.nWAVHeaderBytes > nMaxBytes) return null; else { byte[] pBuffer = new byte[m_APEFileInfo.nWAVHeaderBytes]; System.arraycopy(m_APEFileInfo.spWaveHeaderData, 0, pBuffer, 0, m_APEFileInfo.nWAVHeaderBytes); return pBuffer; } } } public File getApeInfoIoSource() { return m_spIO; } public APETag getApeInfoTag() { return m_spAPETag; } public byte[] getApeInfoWavTerminatingData(int nMaxBytes) throws IOException { if (m_APEFileInfo.nWAVTerminatingBytes > nMaxBytes) return null; else { if (m_APEFileInfo.nWAVTerminatingBytes > 0) { // variables long nOriginalFileLocation = m_spIO.getFilePointer(); // check for a tag m_spIO.seek(m_spIO.length() - (m_spAPETag.GetTagBytes() + m_APEFileInfo.nWAVTerminatingBytes)); byte[] pBuffer = new byte[m_APEFileInfo.nWAVTerminatingBytes]; try { m_spIO.readFully(pBuffer); } catch (EOFException e) { throw new JMACException("Can't Read WAV Terminating Bytes"); } // restore the file pointer m_spIO.seek(nOriginalFileLocation); return pBuffer; } return null; } } public APEFileInfo getApeInfoInternalInfo() { return m_APEFileInfo; } private void GetFileInformation() throws IOException { // quit if the file information has already been loaded if (m_bHasFileInformationLoaded) return; // use a CAPEHeader class to help us analyze the file APEHeader APEHeader = new APEHeader(m_spIO); APEHeader.Analyze(m_APEFileInfo); m_bHasFileInformationLoaded = true; } // internal variables private boolean m_bHasFileInformationLoaded; private File m_spIO; private APETag m_spAPETag; private APEFileInfo m_APEFileInfo = new APEFileInfo(); } jmac-1.74/core/src/davaguine/jmac/info/APELink.java0000644000175000017500000001267710131230056021736 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.info; import davaguine.jmac.tools.File; import davaguine.jmac.tools.JMACException; import davaguine.jmac.tools.RandomAccessFile; import java.io.IOException; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class APELink { private final static String APE_LINK_HEADER = "[Monkey's Audio Image Link File]"; private final static String APE_LINK_IMAGE_FILE_TAG = "Image File="; private final static String APE_LINK_START_BLOCK_TAG = "Start Block="; private final static String APE_LINK_FINISH_BLOCK_TAG = "Finish Block="; public APELink(String pFilename) throws IOException { // empty m_bIsLinkFile = false; m_nStartBlock = 0; m_nFinishBlock = 0; m_cImageFilename = ""; // open the file File ioLinkFile = new RandomAccessFile(new java.io.File(pFilename), "r"); // create a buffer byte[] spBuffer = new byte[1024]; // fill the buffer from the file and null terminate it int numRead = ioLinkFile.read(spBuffer); byte[] buffer = new byte[numRead]; System.arraycopy(spBuffer, 0, buffer, 0, numRead); // call the other constructor (uses a buffer instead of opening the file) ParseData(buffer, pFilename); } public APELink(byte[] pData, String pFilename) { ParseData(pData, pFilename); } public boolean GetIsLinkFile() { return m_bIsLinkFile; } public int GetStartBlock() { return m_nStartBlock; } public int GetFinishBlock() { return m_nFinishBlock; } public String GetImageFilename() { return m_cImageFilename; } protected boolean m_bIsLinkFile; protected int m_nStartBlock; protected int m_nFinishBlock; protected String m_cImageFilename; protected void ParseData(byte[] pData, String pFilename) { // empty m_bIsLinkFile = false; m_nStartBlock = 0; m_nFinishBlock = 0; m_cImageFilename = ""; if (pData != null) { String data = null; try { // parse out the information data = new String(pData, "US-ASCII"); } catch (java.io.UnsupportedEncodingException e) { throw new JMACException("Unsupported encoding", e); } int pHeader = data.indexOf(APE_LINK_HEADER); int pImageFile = data.indexOf(APE_LINK_IMAGE_FILE_TAG); int pStartBlock = data.indexOf(APE_LINK_START_BLOCK_TAG); int pFinishBlock = data.indexOf(APE_LINK_FINISH_BLOCK_TAG); if (pHeader >= 0 && pImageFile >= 0 && pStartBlock >= 0 && pFinishBlock >= 0) { // get the start and finish blocks int i1 = data.indexOf('\r', pStartBlock); int i2 = data.indexOf('\n', pStartBlock); int ii = i1 > 0 && i2 > 0 ? Math.min(i1, i2) : Math.max(i1, i2); try { m_nStartBlock = Integer.parseInt(data.substring(pStartBlock + APE_LINK_START_BLOCK_TAG.length(), ii >= 0 ? ii : data.length())); } catch (Exception e) { m_nStartBlock = -1; } i1 = data.indexOf('\r', pFinishBlock); i2 = data.indexOf('\n', pFinishBlock); ii = i1 > 0 && i2 > 0 ? Math.min(i1, i2) : Math.max(i1, i2); try { m_nFinishBlock = Integer.parseInt(data.substring(pFinishBlock + APE_LINK_FINISH_BLOCK_TAG.length(), ii >= 0 ? ii : data.length())); } catch (Exception e) { m_nFinishBlock = -1; } // get the path i1 = data.indexOf('\r', pImageFile); i2 = data.indexOf('\n', pImageFile); ii = i1 > 0 && i2 > 0 ? Math.min(i1, i2) : Math.max(i1, i2); String cImageFile = data.substring(pImageFile + APE_LINK_IMAGE_FILE_TAG.length(), ii >= 0 ? ii : data.length()); // process the path if (cImageFile.lastIndexOf('\\') < 0) { int ij = pFilename.lastIndexOf('\\'); m_cImageFilename = ij >= 0 ? pFilename.substring(0, ij) + cImageFile : cImageFile; } else { m_cImageFilename = cImageFile; } // this is a valid link file m_bIsLinkFile = true; } } } } jmac-1.74/core/src/davaguine/jmac/info/APETag.java0000644000175000017500000004274610131230056021554 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.info; import davaguine.jmac.tools.*; import java.io.EOFException; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; import java.util.List; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class APETag implements Comparator { public final static String APE_TAG_FIELD_TITLE = "Title"; public final static String APE_TAG_FIELD_ARTIST = "Artist"; public final static String APE_TAG_FIELD_ALBUM = "Album"; public final static String APE_TAG_FIELD_COMMENT = "Comment"; public final static String APE_TAG_FIELD_YEAR = "Year"; public final static String APE_TAG_FIELD_TRACK = "Track"; public final static String APE_TAG_FIELD_GENRE = "Genre"; public final static String APE_TAG_FIELD_COVER_ART_FRONT = "Cover Art (front)"; public final static String APE_TAG_FIELD_NOTES = "Notes"; public final static String APE_TAG_FIELD_LYRICS = "Lyrics"; public final static String APE_TAG_FIELD_COPYRIGHT = "Copyright"; public final static String APE_TAG_FIELD_BUY_URL = "Buy URL"; public final static String APE_TAG_FIELD_ARTIST_URL = "Artist URL"; public final static String APE_TAG_FIELD_PUBLISHER_URL = "Publisher URL"; public final static String APE_TAG_FIELD_FILE_URL = "File URL"; public final static String APE_TAG_FIELD_COPYRIGHT_URL = "Copyright URL"; public final static String APE_TAG_FIELD_MJ_METADATA = "Media Jukebox Metadata"; public final static String APE_TAG_FIELD_TOOL_NAME = "Tool Name"; public final static String APE_TAG_FIELD_TOOL_VERSION = "Tool Version"; public final static String APE_TAG_FIELD_PEAK_LEVEL = "Peak Level"; public final static String APE_TAG_FIELD_REPLAY_GAIN_RADIO = "Replay Gain (radio)"; public final static String APE_TAG_FIELD_REPLAY_GAIN_ALBUM = "Replay Gain (album)"; public final static String APE_TAG_FIELD_COMPOSER = "Composer"; public final static String APE_TAG_FIELD_KEYWORDS = "Keywords"; /** * ************************************************************************************** * Footer (and header) flags * *************************************************************************************** */ public final static int APE_TAG_FLAG_CONTAINS_HEADER = (1 << 31); public final static int APE_TAG_FLAG_CONTAINS_FOOTER = (1 << 30); public final static int APE_TAG_FLAG_IS_HEADER = (1 << 29); public final static int APE_TAG_FLAGS_DEFAULT = APE_TAG_FLAG_CONTAINS_FOOTER; public final static String APE_TAG_GENRE_UNDEFINED = "Undefined"; // create an APE tag // bAnalyze determines whether it will analyze immediately or on the first request // be careful with multiple threads / file pointer movement if you don't analyze immediately public APETag(File pIO) throws IOException { this(pIO, true); } public APETag(File pIO, boolean bAnalyze) throws IOException { m_spIO = pIO; // we don't own the IO source if (bAnalyze) Analyze(); } public APETag(String pFilename) throws IOException { this(pFilename, true); } public APETag(String pFilename, boolean bAnalyze) throws IOException { m_spIO = new RandomAccessFile(new java.io.File(pFilename), "r"); if (bAnalyze) Analyze(); } // save the tag to the I/O source (bUseOldID3 forces it to save as an ID3v1.1 tag instead of an APE tag) public void Save() throws IOException { Save(false); } public void Save(boolean bUseOldID3) throws IOException { Remove(false); if (m_aryFields.size() <= 0) return; if (!bUseOldID3) { int z = 0; // calculate the size of the whole tag int nFieldBytes = 0; for (z = 0; z < m_aryFields.size(); z++) nFieldBytes += ((APETagField) m_aryFields.get(z)).GetFieldSize(); // sort the fields SortFields(); // build the footer APETagFooter APETagFooter = new APETagFooter(m_aryFields.size(), nFieldBytes); // make a buffer for the tag int nTotalTagBytes = APETagFooter.GetTotalTagBytes(); // save the fields ByteArrayWriter writer = new ByteArrayWriter(nTotalTagBytes); for (z = 0; z < m_aryFields.size(); z++) ((APETagField) m_aryFields.get(z)).SaveField(writer); // add the footer to the buffer APETagFooter.write(writer); // dump the tag to the I/O source WriteBufferToEndOfIO(writer.getBytes()); } else { // build the ID3 tag ID3Tag id3tag = new ID3Tag(); CreateID3Tag(id3tag); ByteArrayWriter writer = new ByteArrayWriter(ID3Tag.ID3_TAG_BYTES); id3tag.write(writer); WriteBufferToEndOfIO(writer.getBytes()); } } // removes any tags from the file (bUpdate determines whether is should re-analyze after removing the tag) public void Remove() throws IOException { Remove(true); } public void Remove(boolean bUpdate) throws IOException { // variables long nOriginalPosition = m_spIO.getFilePointer(); boolean bID3Removed = true; boolean bAPETagRemoved = true; while (bID3Removed || bAPETagRemoved) { bID3Removed = false; bAPETagRemoved = false; // ID3 tag ID3Tag id3tag = ID3Tag.read(m_spIO); if (id3tag != null) { m_spIO.setLength(m_spIO.length() - ID3Tag.ID3_TAG_BYTES); bID3Removed = true; } // APE Tag APETagFooter footer = APETagFooter.read(m_spIO); if (footer.GetIsValid(true)) { m_spIO.setLength(m_spIO.length() - footer.GetTotalTagBytes()); bAPETagRemoved = true; } } m_spIO.seek(nOriginalPosition); if (bUpdate) Analyze(); } public void SetFieldString(String pFieldName, String pFieldValue) throws IOException { // remove if empty if ((pFieldValue == null) || (pFieldValue.length() <= 0)) RemoveField(pFieldName); byte[] fieldValue = pFieldValue.getBytes("UTF-8"); byte[] value = new byte[fieldValue.length]; System.arraycopy(fieldValue, 0, value, 0, fieldValue.length); SetFieldBinary(pFieldName, value, APETagField.TAG_FIELD_FLAG_DATA_TYPE_TEXT_UTF8); } public void SetFieldBinary(String pFieldName, byte[] pFieldValue, int nFieldFlags) throws IOException { if (!m_bAnalyzed) Analyze(); if (pFieldName == null) return; // check to see if we're trying to remove the field (by setting it to NULL or an empty string) boolean bRemoving = (pFieldValue == null) || (pFieldValue.length <= 0); // get the index int nFieldIndex = GetTagFieldIndex(pFieldName); if (nFieldIndex >= 0) { // existing field // fail if we're read-only (and not ignoring the read-only flag) if ((!m_bIgnoreReadOnly) && ((APETagField) m_aryFields.get(nFieldIndex)).GetIsReadOnly()) return; // erase the existing field if (bRemoving) RemoveField(nFieldIndex); m_aryFields.set(nFieldIndex, new APETagField(pFieldName, pFieldValue, nFieldFlags)); } else { if (bRemoving) return; m_aryFields.add(new APETagField(pFieldName, pFieldValue, nFieldFlags)); } } // gets the value of a field (returns -1 and an empty buffer if the field doesn't exist) public byte[] GetFieldBinary(String pFieldName) throws IOException { if (!m_bAnalyzed) Analyze(); APETagField pAPETagField = GetTagField(pFieldName); if (pAPETagField == null) return null; else return pAPETagField.GetFieldValue(); } public String GetFieldString(String pFieldName) throws IOException { if (!m_bAnalyzed) Analyze(); String ret = null; APETagField pAPETagField = GetTagField(pFieldName); if (pAPETagField != null) { byte[] b = pAPETagField.GetFieldValue(); int boundary = 0; int index = b.length - 1; while (index >= 0 && b[index] == 0) { index--; boundary--; } if (index < 0) ret = ""; else { if (pAPETagField.GetIsUTF8Text() || (m_nAPETagVersion < 2000)) { if (m_nAPETagVersion >= 2000) ret = new String(b, 0, b.length + boundary, "UTF-8"); else ret = new String(b, 0, b.length + boundary, "US-ASCII"); } else ret = new String(b, 0, b.length + boundary, "UTF-16"); } } return ret; } // remove a specific field public void RemoveField(String pFieldName) throws IOException { RemoveField(GetTagFieldIndex(pFieldName)); } public void RemoveField(int nIndex) { m_aryFields.remove(nIndex); } // clear all the fields public void ClearFields() { m_aryFields.clear(); } // get the total tag bytes in the file from the last analyze // need to call Save() then Analyze() to update any changes public int GetTagBytes() throws IOException { if (!m_bAnalyzed) Analyze(); return m_nTagBytes; } // see whether the file has an ID3 or APE tag public boolean GetHasID3Tag() throws IOException { if (!m_bAnalyzed) Analyze(); return m_bHasID3Tag; } public boolean GetHasAPETag() throws IOException { if (!m_bAnalyzed) Analyze(); return m_bHasAPETag; } public int GetAPETagVersion() throws IOException { return GetHasAPETag() ? m_nAPETagVersion : -1; } // gets a desired tag field (returns NULL if not found) // again, be careful, because this a pointer to the actual field in this class public APETagField GetTagField(String pFieldName) throws IOException { int nIndex = GetTagFieldIndex(pFieldName); return (nIndex != -1) ? (APETagField) m_aryFields.get(nIndex) : null; } public APETagField GetTagField(int nIndex) throws IOException { if (!m_bAnalyzed) Analyze(); if ((nIndex >= 0) && (nIndex < m_aryFields.size())) return (APETagField) m_aryFields.get(nIndex); return null; } public void SetIgnoreReadOnly(boolean bIgnoreReadOnly) { m_bIgnoreReadOnly = bIgnoreReadOnly; } // fills in an ID3_TAG using the current fields (useful for quickly converting the tag) public void CreateID3Tag(ID3Tag pID3Tag) throws IOException { if (pID3Tag == null) return; if (!m_bAnalyzed) Analyze(); if (m_aryFields.size() <= 0) return; pID3Tag.Header = "TAG"; pID3Tag.Artist = GetFieldID3String(APE_TAG_FIELD_ARTIST); pID3Tag.Album = GetFieldID3String(APE_TAG_FIELD_ALBUM); pID3Tag.Title = GetFieldID3String(APE_TAG_FIELD_TITLE); pID3Tag.Comment = GetFieldID3String(APE_TAG_FIELD_COMMENT); pID3Tag.Year = GetFieldID3String(APE_TAG_FIELD_YEAR); String track = GetFieldString(APE_TAG_FIELD_TRACK); try { pID3Tag.Track = Short.parseShort(track); } catch (Exception e) { pID3Tag.Track = 255; } pID3Tag.Genre = (short) (new ID3Genre(GetFieldString(APE_TAG_FIELD_GENRE)).getGenre()); } // private functions private void Analyze() throws IOException { // clean-up ClearFields(); m_nTagBytes = 0; m_bAnalyzed = true; // store the original location long nOriginalPosition = m_spIO.getFilePointer(); // check for a tag m_bHasID3Tag = false; m_bHasAPETag = false; m_nAPETagVersion = -1; final ID3Tag tag = ID3Tag.read(m_spIO); if (tag != null) { m_bHasID3Tag = true; m_nTagBytes += ID3Tag.ID3_TAG_BYTES; } // set the fields if (m_bHasID3Tag) { SetFieldID3String(APE_TAG_FIELD_ARTIST, tag.Artist); SetFieldID3String(APE_TAG_FIELD_ALBUM, tag.Album); SetFieldID3String(APE_TAG_FIELD_TITLE, tag.Title); SetFieldID3String(APE_TAG_FIELD_COMMENT, tag.Comment); SetFieldID3String(APE_TAG_FIELD_YEAR, tag.Year); SetFieldString(APE_TAG_FIELD_TRACK, String.valueOf(tag.Track)); if ((tag.Genre == ID3Genre.GENRE_UNDEFINED) || (tag.Genre >= ID3Genre.genreCount())) SetFieldString(APE_TAG_FIELD_GENRE, APE_TAG_GENRE_UNDEFINED); else SetFieldString(APE_TAG_FIELD_GENRE, ID3Genre.genreString(tag.Genre)); } // try loading the APE tag if (!m_bHasID3Tag) { m_footer = APETagFooter.read(m_spIO); if (m_footer != null && m_footer.GetIsValid(false)) { m_bHasAPETag = true; m_nAPETagVersion = m_footer.GetVersion(); int nRawFieldBytes = m_footer.GetFieldBytes(); m_nTagBytes += m_footer.GetTotalTagBytes(); m_spIO.seek(m_spIO.length() - m_footer.GetTotalTagBytes() - m_footer.GetFieldsOffset()); try { final ByteArrayReader reader = new ByteArrayReader(m_spIO, nRawFieldBytes); // parse out the raw fields for (int z = 0; z < m_footer.GetNumberFields(); z++) LoadField(reader); } catch (EOFException e) { throw new JMACException("Can't Read APE Tag Fields"); } } } // restore the file pointer m_spIO.seek(nOriginalPosition); } private int GetTagFieldIndex(String pFieldName) throws IOException { if (!m_bAnalyzed) Analyze(); if (pFieldName == null) return -1; for (int z = 0; z < m_aryFields.size(); z++) { if (pFieldName.toLowerCase().equals(((APETagField) m_aryFields.get(z)).GetFieldName().toLowerCase())) return z; } return -1; } private void WriteBufferToEndOfIO(byte[] pBuffer) throws IOException { long nOriginalPosition = m_spIO.getFilePointer(); m_spIO.seek(m_spIO.length()); m_spIO.write(pBuffer); m_spIO.seek(nOriginalPosition); } private void LoadField(ByteArrayReader reader) throws IOException { // size and flags int nFieldValueSize = reader.readInt(); int nFieldFlags = reader.readInt(); String fieldName = reader.readString("UTF-8"); // value byte[] fieldValue = new byte[nFieldValueSize]; reader.readFully(fieldValue); // set SetFieldBinary(fieldName, fieldValue, nFieldFlags); } private void SortFields() { // sort the tag fields by size (so that the smallest fields are at the front of the tag) Arrays.sort(m_aryFields.toArray(), this); } public int compare(Object pA, Object pB) { APETagField pFieldA = (APETagField) pA; APETagField pFieldB = (APETagField) pB; return pFieldA.GetFieldSize() - pFieldB.GetFieldSize(); } // helper set / get field functions private String GetFieldID3String(String pFieldName) throws IOException { return GetFieldString(pFieldName); } private void SetFieldID3String(String pFieldName, String pFieldValue) throws IOException { SetFieldString(pFieldName, pFieldValue.trim()); } public APETagFooter getFooter() { return m_footer; } // private data private File m_spIO; private boolean m_bAnalyzed = false; private int m_nTagBytes = 0; private List m_aryFields = new ArrayList(); private boolean m_bHasAPETag; private int m_nAPETagVersion; private boolean m_bHasID3Tag; private boolean m_bIgnoreReadOnly = false; private APETagFooter m_footer = null; } jmac-1.74/core/src/davaguine/jmac/info/APETagField.java0000644000175000017500000000753310131230056022513 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.info; import davaguine.jmac.tools.ByteArrayWriter; import davaguine.jmac.tools.JMACException; import java.io.UnsupportedEncodingException; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class APETagField { public final static int TAG_FIELD_FLAG_READ_ONLY = (1 << 0); public final static int TAG_FIELD_FLAG_DATA_TYPE_MASK = (6); public final static int TAG_FIELD_FLAG_DATA_TYPE_TEXT_UTF8 = (0 << 1); public final static int TAG_FIELD_FLAG_DATA_TYPE_BINARY = (1 << 1); public final static int TAG_FIELD_FLAG_DATA_TYPE_EXTERNAL_INFO = (2 << 1); public final static int TAG_FIELD_FLAG_DATA_TYPE_RESERVED = (3 << 1); // create a tag field (use nFieldBytes = -1 for null-terminated strings) public APETagField(String pFieldName, byte[] pFieldValue) { this(pFieldName, pFieldValue, 0); } public APETagField(String pFieldName, byte[] pFieldValue, int nFlags) { m_spFieldName = pFieldName; m_spFieldValue = pFieldValue; m_nFieldFlags = nFlags; // data (we'll always allocate two extra bytes and memset to 0 so we're safely NULL terminated) m_spFieldValue = new byte[pFieldValue.length]; System.arraycopy(pFieldValue, 0, m_spFieldValue, 0, pFieldValue.length); // flags m_nFieldFlags = nFlags; } public int GetFieldSize() { try { return m_spFieldName.getBytes("US-ASCII").length + 1 + m_spFieldValue.length + 4 + 4; } catch (UnsupportedEncodingException e) { throw new JMACException("Unsupported Encoding", e); } } // get the name of the field public String GetFieldName() { return m_spFieldName; } // get the value of the field public byte[] GetFieldValue() { return m_spFieldValue; } public int GetFieldValueSize() { return m_spFieldValue.length; } // get any special flags public int GetFieldFlags() { return m_nFieldFlags; } // output the entire field to a buffer (GetFieldSize() bytes) public int SaveField(ByteArrayWriter writer) { writer.writeInt(m_spFieldValue.length); writer.writeInt(m_nFieldFlags); writer.writeZString(m_spFieldName, "US-ASCII"); writer.writeBytes(m_spFieldValue); return GetFieldSize(); } // checks to see if the field is read-only public boolean GetIsReadOnly() { return (m_nFieldFlags & TAG_FIELD_FLAG_READ_ONLY) > 0; } public boolean GetIsUTF8Text() { return ((m_nFieldFlags & TAG_FIELD_FLAG_DATA_TYPE_MASK) == TAG_FIELD_FLAG_DATA_TYPE_TEXT_UTF8); } // set helpers (use with EXTREME caution) void SetFieldFlags(int nFlags) { m_nFieldFlags = nFlags; } private String m_spFieldName; private byte[] m_spFieldValue; private int m_nFieldFlags; } jmac-1.74/core/src/davaguine/jmac/info/APETagFooter.java0000644000175000017500000001024210131230056022715 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.info; import davaguine.jmac.tools.ByteArrayReader; import davaguine.jmac.tools.ByteArrayWriter; import davaguine.jmac.tools.File; import davaguine.jmac.tools.JMACException; import java.io.EOFException; import java.io.IOException; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class APETagFooter { public String m_cID; // should equal 'APETAGEX' (char[8]) public int m_nVersion; // equals CURRENT_APE_TAG_VERSION (int) public int m_nSize; // the complete size of the tag, including this footer (int) public int m_nFields; // the number of fields in the tag (int) public int m_nFlags; // the tag flags (none currently defined) (int) public final static int APE_TAG_FOOTER_BYTES = 32; public final static int CURRENT_APE_TAG_VERSION = 2000; APETagFooter() { this(0, 0); } APETagFooter(int nFields) { this(nFields, 0); } APETagFooter(int nFields, int nFieldBytes) { m_cID = "APETAGEX"; m_nFields = nFields; m_nFlags = APETag.APE_TAG_FLAGS_DEFAULT; m_nSize = nFieldBytes + APE_TAG_FOOTER_BYTES; m_nVersion = CURRENT_APE_TAG_VERSION; } public int GetTotalTagBytes() { return m_nSize + (GetHasHeader() ? APE_TAG_FOOTER_BYTES : 0); } public int GetFieldBytes() { return m_nSize - APE_TAG_FOOTER_BYTES; } public int GetFieldsOffset() { return GetHasHeader() ? APE_TAG_FOOTER_BYTES : 0; } public int GetNumberFields() { return m_nFields; } public boolean GetHasHeader() { return (m_nFlags & APETag.APE_TAG_FLAG_CONTAINS_HEADER) > 0; } public boolean GetIsHeader() { return (m_nFlags & APETag.APE_TAG_FLAG_IS_HEADER) > 0; } public int GetVersion() { return m_nVersion; } public boolean GetIsValid(boolean bAllowHeader) { boolean bValid = m_cID.equals("APETAGEX") && (m_nVersion <= CURRENT_APE_TAG_VERSION) && (m_nFields <= 65536) && (GetFieldBytes() <= (1024 * 1024 * 16)); if (bValid && !bAllowHeader && GetIsHeader()) bValid = false; return bValid; } public static APETagFooter read(final File file) throws IOException { file.seek(file.length() - APE_TAG_FOOTER_BYTES); APETagFooter tag = new APETagFooter(); try { final ByteArrayReader reader = new ByteArrayReader(file, APE_TAG_FOOTER_BYTES); tag.m_cID = reader.readString(8, "US-ASCII"); tag.m_nVersion = reader.readInt(); tag.m_nSize = reader.readInt(); tag.m_nFields = reader.readInt(); tag.m_nFlags = reader.readInt(); return tag; } catch (EOFException e) { throw new JMACException("Unsupported Format"); } } public void write(final ByteArrayWriter writer) { writer.writeString(m_cID, 8, "US-ASCII"); writer.writeInt(m_nVersion); writer.writeInt(m_nSize); writer.writeInt(m_nFields); writer.writeInt(m_nFlags); writer.writeInt(0); writer.writeInt(0); } } jmac-1.74/core/src/davaguine/jmac/info/CompressionLevel.java0000644000175000017500000000255110131230056023772 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.info; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class CompressionLevel { public final static int COMPRESSION_LEVEL_FAST = 1000; public final static int COMPRESSION_LEVEL_NORMAL = 2000; public final static int COMPRESSION_LEVEL_HIGH = 3000; public final static int COMPRESSION_LEVEL_EXTRA_HIGH = 4000; public final static int COMPRESSION_LEVEL_INSANE = 5000; } jmac-1.74/core/src/davaguine/jmac/info/ID3Genre.java0000644000175000017500000001143610131230056022043 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.info; import davaguine.jmac.tools.JMACException; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class ID3Genre { private final static String genres[] = {"Blues", "Classic Rock", "Country", "Dance", "Disco", "Funk", "Grunge", "Hip-Hop", "Jazz", "Metal", "New Age", "Oldies", "Other", "Pop", "R&B", "Rap", "Reggae", "Rock", "Techno", "Industrial", "Alternative", "Ska", "Death Metal", "Pranks", "Soundtrack", "Euro-Techno", "Ambient", "Trip-Hop", "Vocal", "Jazz+Funk", "Fusion", "Trance", "Classical", "Instrumental", "Acid", "House", "Game", "Sound Clip", "Gospel", "Noise", "AlternRock", "Bass", "Soul", "Punk", "Space", "Meditative", "Instrumental Pop", "Instrumental Rock", "Ethnic", "Gothic", "Darkwave", "Techno-Industrial", "Electronic", "Pop-Folk", "Eurodance", "Dream", "Southern Rock", "Comedy", "Cult", "Gangsta", "Top 40", "Christian Rap", "Pop/Funk", "Jungle", "Native American", "Cabaret", "New Wave", "Psychadelic", "Rave", "Showtunes", "Trailer", "Lo-Fi", "Tribal", "Acid Punk", "Acid Jazz", "Polka", "Retro", "Musical", "Rock & Roll", "Hard Rock", "Folk", "Folk-Rock", "National Folk", "Swing", "Fast Fusion", "Bebop", "Latin", "Revival", "Celtic", "Bluegrass", "Avantgarde", "Gothic Rock", "Progressive Rock", "Psychedelic Rock", "Symphonic Rock", "Slow Rock", "Big Band", "Chorus", "Easy Listening", "Acoustic", "Humour", "Speech", "Chanson", "Opera", "Chamber Music", "Sonata", "Symphony", "Booty Bass", "Primus", "Porn Groove", "Satire", "Slow Jam", "Club", "Tango", "Samba", "Folklore", "Ballad", "Power Ballad", "Rhythmic Soul", "Freestyle", "Duet", "Punk Rock", "Drum Solo", "Acapella", "Euro-House", "Dance Hall", "Goa", "Drum & Bass", "Club House", "Hardcore", "Terror", "Indie", "BritPop", "Black Punk", "Polsk Punk", "Beat", "Christian Gangsta", "Heavy Metal", "Black Metal", "Crossover", "Contemporary C", "Christian Rock", "Merengue", "Salsa", "Thrash Metal", "Anime", "JPop", "SynthPop"}; public final static int GENRE_UNDEFINED = 255; private int genre = GENRE_UNDEFINED; public String toString() { return genres[genre]; } public final static String genreString(int genre) { if (genre != GENRE_UNDEFINED && (genre < 0 || genre >= genres.length)) throw new JMACException("Wrong Genre"); return genres[genre]; } public final static int genreCount() { return genres.length; } public ID3Genre(final int genre) { if (genre != GENRE_UNDEFINED && (genre < 0 || genre >= genres.length)) throw new JMACException("Wrong Genre"); this.genre = genre; } public ID3Genre(final String genre) { if (genre == null) { this.genre = GENRE_UNDEFINED; return; } int nGenreIndex = 0; boolean bFound = false; while (nGenreIndex < genres.length && !bFound) { if (genre.equals(genres[nGenreIndex])) { this.genre = nGenreIndex; bFound = true; } nGenreIndex++; } } public int getGenre() { return genre; } public void setGenre(int genre) { this.genre = genre; } } jmac-1.74/core/src/davaguine/jmac/info/ID3Tag.java0000644000175000017500000000566110131230056021521 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.info; import davaguine.jmac.tools.ByteArrayReader; import davaguine.jmac.tools.ByteArrayWriter; import davaguine.jmac.tools.File; import java.io.EOFException; import java.io.IOException; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class ID3Tag { public String Header; // should equal 'TAG' public String Title; // title public String Artist; // artist public String Album; // album public String Year; // year public String Comment; // comment public short Track; // track public short Genre; // genre public final static int ID3_TAG_BYTES = 128; public final static ID3Tag read(final File file) throws IOException { file.seek(file.length() - ID3_TAG_BYTES); try { final ID3Tag tag = new ID3Tag(); final ByteArrayReader reader = new ByteArrayReader(file, ID3_TAG_BYTES); tag.Header = reader.readString(3, "US-ASCII"); tag.Title = reader.readString(30, "US-ASCII"); tag.Artist = reader.readString(30, "US-ASCII"); tag.Album = reader.readString(30, "US-ASCII"); tag.Year = reader.readString(4, "US-ASCII"); tag.Comment = reader.readString(29, "US-ASCII"); tag.Track = reader.readUnsignedByte(); tag.Genre = reader.readUnsignedByte(); return tag.Header.equals("TAG") ? tag : null; } catch (EOFException e) { return null; } } public final void write(final ByteArrayWriter writer) { writer.writeString(Header, 3, "US-ASCII"); writer.writeString(Title, 30, "US-ASCII"); writer.writeString(Artist, 30, "US-ASCII"); writer.writeString(Album, 30, "US-ASCII"); writer.writeString(Year, 4, "US-ASCII"); writer.writeString(Comment, 29, "US-ASCII"); writer.writeUnsignedByte(Track); writer.writeUnsignedByte(Genre); } } jmac-1.74/core/src/davaguine/jmac/info/InputSource.java0000644000175000017500000000555110172455471023003 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.info; import davaguine.jmac.tools.ByteBuffer; import davaguine.jmac.tools.File; import davaguine.jmac.tools.IntegerPointer; import davaguine.jmac.tools.JMACException; import java.io.IOException; /** * Author: Dmitry Vaguine * Date: 07.05.2004 * Time: 14:07:31 */ public abstract class InputSource { // construction / destruction public InputSource(File pIO, WaveFormat pwfeSource, IntegerPointer pTotalBlocks, IntegerPointer pHeaderBytes, IntegerPointer pTerminatingBytes) throws IOException { } public InputSource(String pSourceName, WaveFormat pwfeSource, IntegerPointer pTotalBlocks, IntegerPointer pHeaderBytes, IntegerPointer pTerminatingBytes) throws IOException { } // get data public abstract int GetData(ByteBuffer pBuffer, int nBlocks) throws IOException; // get header / terminating data public abstract void GetHeaderData(byte[] pBuffer) throws IOException; public abstract void GetTerminatingData(byte[] pBuffer) throws IOException; public abstract void Close() throws IOException; public static InputSource CreateInputSource(String pSourceName, WaveFormat pwfeSource, IntegerPointer pTotalBlocks, IntegerPointer pHeaderBytes, IntegerPointer pTerminatingBytes) throws IOException { // error check the parameters if ((pSourceName == null) || (pSourceName.length() == 0)) throw new JMACException("Bad Parameters"); // get the extension int index = pSourceName.lastIndexOf('.'); String pExtension = ""; if (index >= 0) pExtension = pSourceName.substring(pSourceName.lastIndexOf('.')); // create the proper input source if (pExtension.toLowerCase().equals(".wav")) { return new WAVInputSource(pSourceName, pwfeSource, pTotalBlocks, pHeaderBytes, pTerminatingBytes); } else throw new JMACException("Invalid Input File"); } } jmac-1.74/core/src/davaguine/jmac/info/RiffChunkHeader.java0000644000175000017500000000314010131230056023464 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.info; import davaguine.jmac.tools.ByteArrayReader; import davaguine.jmac.tools.File; import java.io.IOException; /** * Author: Dmitry Vaguine * Date: 07.05.2004 * Time: 16:59:37 */ public class RiffChunkHeader { public int cChunkLabel; // should equal "data" indicating the data chunk (4 chars) public long nChunkBytes; // the bytes of the chunk private final static int RIFF_CHUNK_HEADER_SIZE = 8; public void read(File io) throws IOException { ByteArrayReader reader = new ByteArrayReader(io, RIFF_CHUNK_HEADER_SIZE); cChunkLabel = reader.readInt(); nChunkBytes = reader.readUnsignedInt(); } } jmac-1.74/core/src/davaguine/jmac/info/SpecialFrame.java0000644000175000017500000000244310131230056023034 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.info; /** * Author: Dmitry Vaguine * Date: 11.05.2004 * Time: 16:30:43 */ public class SpecialFrame { public final static int SPECIAL_FRAME_MONO_SILENCE = 1; public final static int SPECIAL_FRAME_LEFT_SILENCE = 1; public final static int SPECIAL_FRAME_RIGHT_SILENCE = 2; public final static int SPECIAL_FRAME_PSEUDO_STEREO = 4; } jmac-1.74/core/src/davaguine/jmac/info/WaveFormat.java0000644000175000017500000000523510131230056022556 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.info; import davaguine.jmac.tools.ByteArrayReader; import davaguine.jmac.tools.File; import java.io.IOException; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class WaveFormat { public short wFormatTag; /* format type */ public short nChannels; /* number of channels (i.e. mono, stereo...) */ public int nSamplesPerSec; /* sample rate */ public int nAvgBytesPerSec; /* for buffer estimation */ public short nBlockAlign; /* block size of data */ public short wBitsPerSample; /* number of bits per sample of mono data */ public short cbSize; /* the count in bytes of the size of */ public final static int WAV_HEADER_SIZE = 16; public static void FillWaveFormatEx(WaveFormat pWaveFormatEx, int nSampleRate, int nBitsPerSample, int nChannels) { pWaveFormatEx.cbSize = 0; pWaveFormatEx.nSamplesPerSec = nSampleRate; pWaveFormatEx.wBitsPerSample = (short) nBitsPerSample; pWaveFormatEx.nChannels = (short) nChannels; pWaveFormatEx.wFormatTag = 1; pWaveFormatEx.nBlockAlign = (short) ((pWaveFormatEx.wBitsPerSample / 8) * pWaveFormatEx.nChannels); pWaveFormatEx.nAvgBytesPerSec = pWaveFormatEx.nBlockAlign * pWaveFormatEx.nSamplesPerSec; } public void readHeader(File io) throws IOException { ByteArrayReader reader = new ByteArrayReader(io, WAV_HEADER_SIZE); wFormatTag = reader.readShort(); nChannels = reader.readShort(); nSamplesPerSec = reader.readInt(); nAvgBytesPerSec = reader.readInt(); nBlockAlign = reader.readShort(); wBitsPerSample = reader.readShort(); } } jmac-1.74/core/src/davaguine/jmac/info/WaveHeader.java0000644000175000017500000001166210131230056022517 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.info; import davaguine.jmac.tools.ByteArrayReader; import davaguine.jmac.tools.ByteArrayWriter; import davaguine.jmac.tools.File; import java.io.EOFException; import java.io.IOException; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class WaveHeader { public final static int WAVE_HEADER_BYTES = 44; // RIFF header public String cRIFFHeader; public long nRIFFBytes; // data type public String cDataTypeID; // wave format public String cFormatHeader; public long nFormatBytes; public int nFormatTag; public int nChannels; public long nSamplesPerSec; public long nAvgBytesPerSec; public int nBlockAlign; public int nBitsPerSample; // data chunk header public String cDataHeader; public long nDataBytes; public static void FillWaveHeader(WaveHeader pWAVHeader, int nAudioBytes, WaveFormat pWaveFormatEx, int nTerminatingBytes) { // RIFF header pWAVHeader.cRIFFHeader = "RIFF"; pWAVHeader.nRIFFBytes = (nAudioBytes + 44) - 8 + nTerminatingBytes; // format header pWAVHeader.cDataTypeID = "WAVE"; pWAVHeader.cFormatHeader = "fmt "; // the format chunk is the first 16 bytes of a waveformatex pWAVHeader.nFormatBytes = 16; pWAVHeader.nFormatTag = pWaveFormatEx.wFormatTag; pWAVHeader.nChannels = pWaveFormatEx.nChannels; pWAVHeader.nSamplesPerSec = pWaveFormatEx.nSamplesPerSec; pWAVHeader.nAvgBytesPerSec = pWaveFormatEx.nAvgBytesPerSec; pWAVHeader.nBlockAlign = pWaveFormatEx.nBlockAlign; pWAVHeader.nBitsPerSample = pWaveFormatEx.wBitsPerSample; // the data header pWAVHeader.cDataHeader = "data"; pWAVHeader.nDataBytes = nAudioBytes; } public final static WaveHeader read(final File file) throws IOException { try { final ByteArrayReader reader = new ByteArrayReader(file, WAVE_HEADER_BYTES); return read(reader); } catch (EOFException e) { return null; } } public final static WaveHeader read(final byte[] data) { final ByteArrayReader reader = new ByteArrayReader(data); return read(reader); } private final static WaveHeader read(final ByteArrayReader reader) { final WaveHeader header = new WaveHeader(); header.cRIFFHeader = reader.readString(4, "US-ASCII"); header.nRIFFBytes = reader.readUnsignedInt(); header.cDataTypeID = reader.readString(4, "US-ASCII"); header.cFormatHeader = reader.readString(4, "US-ASCII"); header.nFormatBytes = reader.readUnsignedInt(); header.nFormatTag = reader.readUnsignedShort(); header.nChannels = reader.readUnsignedShort(); header.nSamplesPerSec = reader.readUnsignedInt(); header.nAvgBytesPerSec = reader.readUnsignedInt(); header.nBlockAlign = reader.readUnsignedShort(); header.nBitsPerSample = reader.readUnsignedShort(); header.cDataHeader = reader.readString(4, "US-ASCII"); header.nDataBytes = reader.readUnsignedInt(); return header; } public final byte[] write() { final ByteArrayWriter writer = new ByteArrayWriter(WAVE_HEADER_BYTES); writer.writeString(cRIFFHeader, 4, "US-ASCII"); writer.writeUnsignedInt(nRIFFBytes); writer.writeString(cDataTypeID, 4, "US-ASCII"); writer.writeString(cFormatHeader, 4, "US-ASCII"); writer.writeUnsignedInt(nFormatBytes); writer.writeUnsignedShort(nFormatTag); writer.writeUnsignedShort(nChannels); writer.writeUnsignedInt(nSamplesPerSec); writer.writeUnsignedInt(nAvgBytesPerSec); writer.writeUnsignedShort(nBlockAlign); writer.writeUnsignedShort(nBitsPerSample); writer.writeString(cDataHeader, 4, "US-ASCII"); writer.writeUnsignedInt(nDataBytes); return writer.getBytes(); } }jmac-1.74/core/src/davaguine/jmac/info/WAVInputSource.java0000644000175000017500000002106110172455471023353 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.info; import davaguine.jmac.tools.ByteBuffer; import davaguine.jmac.tools.File; import davaguine.jmac.tools.IntegerPointer; import davaguine.jmac.tools.JMACException; import java.io.IOException; /** * Author: Dmitry Vaguine * Date: 07.05.2004 * Time: 14:10:50 */ public class WAVInputSource extends InputSource { // construction / destruction public WAVInputSource(File pIO, WaveFormat pwfeSource, IntegerPointer pTotalBlocks, IntegerPointer pHeaderBytes, IntegerPointer pTerminatingBytes) throws IOException { super(pIO, pwfeSource, pTotalBlocks, pHeaderBytes, pTerminatingBytes); m_bIsValid = false; if (pIO == null || pwfeSource == null) throw new JMACException("Bad Parameters"); m_spIO = pIO; m_bOwnsInputIO = false; AnalyzeSource(); // fill in the parameters pwfeSource = m_wfeSource; if (pTotalBlocks != null) pTotalBlocks.value = m_nDataBytes / m_wfeSource.nBlockAlign; if (pHeaderBytes != null) pHeaderBytes.value = m_nHeaderBytes; if (pTerminatingBytes != null) pTerminatingBytes.value = m_nTerminatingBytes; m_bIsValid = true; } public WAVInputSource(String pSourceName, WaveFormat pwfeSource, IntegerPointer pTotalBlocks, IntegerPointer pHeaderBytes, IntegerPointer pTerminatingBytes) throws IOException { super(pSourceName, pwfeSource, pTotalBlocks, pHeaderBytes, pTerminatingBytes); m_bIsValid = false; if (pSourceName == null || pwfeSource == null) throw new JMACException("Bad Parameters"); m_spIO = File.createFile(pSourceName, "r"); m_bOwnsInputIO = true; AnalyzeSource(); // fill in the parameters pwfeSource.wFormatTag = m_wfeSource.wFormatTag; pwfeSource.nChannels = m_wfeSource.nChannels; pwfeSource.nSamplesPerSec = m_wfeSource.nSamplesPerSec; pwfeSource.nAvgBytesPerSec = m_wfeSource.nAvgBytesPerSec; pwfeSource.nBlockAlign = m_wfeSource.nBlockAlign; pwfeSource.wBitsPerSample = m_wfeSource.wBitsPerSample; if (pTotalBlocks != null) pTotalBlocks.value = m_nDataBytes / m_wfeSource.nBlockAlign; if (pHeaderBytes != null) pHeaderBytes.value = m_nHeaderBytes; if (pTerminatingBytes != null) pTerminatingBytes.value = m_nTerminatingBytes; m_bIsValid = true; } public void Close() throws IOException { if (m_bIsValid && m_bOwnsInputIO && m_spIO != null) m_spIO.close(); m_spIO = null; } protected void finalize() { try { Close(); } catch (IOException e) { throw new JMACException("Error while closing input stream."); } } // get data public int GetData(ByteBuffer pBuffer, int nBlocks) throws IOException { if (!m_bIsValid) throw new JMACException("Undefined Error"); int nBytes = (m_wfeSource.nBlockAlign * nBlocks); int nBytesRead = m_spIO.read(pBuffer.getBytes(), pBuffer.getIndex(), nBytes); return nBytesRead / m_wfeSource.nBlockAlign; } // get header / terminating data public void GetHeaderData(byte[] pBuffer) throws IOException { if (!m_bIsValid) throw new JMACException("Undefined Error"); if (m_nHeaderBytes > 0) { long nOriginalFileLocation = m_spIO.getFilePointer(); m_spIO.seek(0); if (m_spIO.read(pBuffer, 0, m_nHeaderBytes) != m_nHeaderBytes) throw new JMACException("Undefined Error"); m_spIO.seek(nOriginalFileLocation); } } public void GetTerminatingData(byte[] pBuffer) throws IOException { if (!m_bIsValid) throw new JMACException("Undefined Error"); if (m_nTerminatingBytes > 0) { long nOriginalFileLocation = m_spIO.getFilePointer(); m_spIO.seek(m_spIO.length() - m_nTerminatingBytes); if (m_spIO.read(pBuffer, 0, m_nTerminatingBytes) != m_nTerminatingBytes) throw new JMACException("Undefined Error"); m_spIO.seek(nOriginalFileLocation); } } private void AnalyzeSource() throws IOException { // seek to the beginning (just in case) m_spIO.seek(0); // get the file size m_nFileBytes = (int) m_spIO.length(); // get the RIFF header int riffSignature = m_spIO.readInt(); int goalSignature = ('R' << 24) | ('I' << 16) | ('F' << 8) | ('F'); if (riffSignature != goalSignature) throw new JMACException("Invalid Input File"); m_spIO.readInt(); // read the data type header int dataTypeSignature = m_spIO.readInt(); goalSignature = ('W' << 24) | ('A' << 16) | ('V' << 8) | ('E'); // make sure it's the right data type if (dataTypeSignature != goalSignature) throw new JMACException("Invalid Input File"); // find the 'fmt ' chunk RiffChunkHeader RIFFChunkHeader = new RiffChunkHeader(); RIFFChunkHeader.read(m_spIO); goalSignature = (' ' << 24) | ('t' << 16) | ('m' << 8) | ('f'); while (RIFFChunkHeader.cChunkLabel != goalSignature) { // move the file pointer to the end of this chunk m_spIO.seek(m_spIO.getFilePointer() + RIFFChunkHeader.nChunkBytes); // check again for the data chunk RIFFChunkHeader.read(m_spIO); } // read the format info WaveFormat WAVFormatHeader = new WaveFormat(); WAVFormatHeader.readHeader(m_spIO); // error check the header to see if we support it if (WAVFormatHeader.wFormatTag != 1) throw new JMACException("Invalid Input File"); // copy the format information to the WAVEFORMATEX passed in WaveFormat.FillWaveFormatEx(m_wfeSource, WAVFormatHeader.nSamplesPerSec, WAVFormatHeader.wBitsPerSample, WAVFormatHeader.nChannels); // skip over any extra data in the header int nWAVFormatHeaderExtra = (int) (RIFFChunkHeader.nChunkBytes - WaveFormat.WAV_HEADER_SIZE); if (nWAVFormatHeaderExtra < 0) throw new JMACException("Invalid Input File"); else m_spIO.seek(m_spIO.getFilePointer() + nWAVFormatHeaderExtra); // find the data chunk RIFFChunkHeader.read(m_spIO); goalSignature = ('a' << 24) | ('t' << 16) | ('a' << 8) | ('d'); while (RIFFChunkHeader.cChunkLabel != goalSignature) { // move the file pointer to the end of this chunk m_spIO.seek(m_spIO.getFilePointer() + RIFFChunkHeader.nChunkBytes); // check again for the data chunk RIFFChunkHeader.read(m_spIO); } // we're at the data block m_nHeaderBytes = (int) m_spIO.getFilePointer(); m_nDataBytes = (int) RIFFChunkHeader.nChunkBytes; if (m_nDataBytes < 0) m_nDataBytes = m_nFileBytes - m_nHeaderBytes; // make sure the data bytes is a whole number of blocks if ((m_nDataBytes % m_wfeSource.nBlockAlign) != 0) throw new JMACException("Invalid Input File"); // calculate the terminating byts m_nTerminatingBytes = m_nFileBytes - m_nDataBytes - m_nHeaderBytes; } private File m_spIO; private boolean m_bOwnsInputIO; private WaveFormat m_wfeSource = new WaveFormat(); private int m_nHeaderBytes; private int m_nDataBytes; private int m_nTerminatingBytes; private int m_nFileBytes; private boolean m_bIsValid; } jmac-1.74/core/src/davaguine/jmac/player/0000755000175000017500000000000010451144641020205 5ustar twernertwernerjmac-1.74/core/src/davaguine/jmac/player/AudioDevice.java0000644000175000017500000000563510131230056023231 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.player; import davaguine.jmac.decoder.IAPEDecompress; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public interface AudioDevice { /** * Prepares the AudioDevice for playback of audio samples. * * @param decoder The core that will be providing the audio * samples. *

* If the audio device is already open, this method returns silently. */ public void open(IAPEDecompress decoder); /** * Retrieves the open state of this audio device. * * @return true if this audio device is open and playing * audio samples, or false otherwise. */ public boolean isOpen(); /** * Writes a number of samples to this AudioDevice. * * @param samples The array of samples to write * to the audio device. * @param offs The offset of the first sample. * @param len The number of samples to write. *

* This method may return prior to the samples actually being played * by the audio device. */ public void write(byte[] samples, int offs, int len); /** * Closes this audio device. Any currently playing audio is stopped * as soon as possible. Any previously written audio data that has not been heard * is discarded. *

* The implementation should ensure that any threads currently blocking * on the device (e.g. during a write or flush * operation should be unblocked by this method. */ public void close(); /** * Blocks until all audio samples previously written to this audio device have * been heard. */ public void flush(); /** * Retrieves the current playback position in milliseconds. */ public int getPosition(); } jmac-1.74/core/src/davaguine/jmac/player/AudioDeviceBase.java0000644000175000017500000001025110131230056024012 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.player; import davaguine.jmac.decoder.IAPEDecompress; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public abstract class AudioDeviceBase implements AudioDevice { private boolean open = false; private IAPEDecompress decoder = null; /** * Opens this audio device. * * @param decoder The core that will provide audio data * to this audio device. */ public synchronized void open(IAPEDecompress decoder) { if (!isOpen()) { this.decoder = decoder; openImpl(); setOpen(true); } } /** * Template method to provide the * implementation for the opening of the audio device. */ protected void openImpl() { } /** * Sets the open state for this audio device. */ protected void setOpen(boolean open) { this.open = open; } /** * Determines if this audio device is open or not. * * @return true if the audio device is open, * false if it is not. */ public synchronized boolean isOpen() { return open; } /** * Closes this audio device. If the device is currently playing * audio, playback is stopped immediately without flushing * any buffered audio data. */ public synchronized void close() { if (isOpen()) { closeImpl(); setOpen(false); decoder = null; } } /** * Template method to provide the implementation for * closing the audio device. */ protected void closeImpl() { } /** * Writes audio data to this audio device. Audio data is * assumed to be in the output format of the core. This * method may return before the data has actually been sounded * by the device if the device buffers audio samples. * * @param samples The samples to write to the audio device. * @param offs The offset into the array of the first sample to write. * @param len The number of samples from the array to write. * If the audio device is not open, this method does nthing. */ public void write(byte[] samples, int offs, int len) { if (isOpen()) { writeImpl(samples, offs, len); } } /** * Template method to provide the implementation for * writing audio samples to the audio device. */ protected void writeImpl(byte[] samples, int offs, int len) { } /** * Waits for any buffered audio samples to be played by the * audio device. This method should only be called prior * to closing the device. */ public void flush() { if (isOpen()) { flushImpl(); } } /** * Template method to provide the implementation for * flushing any buffered audio data. */ protected void flushImpl() { } /** * Retrieves the core that provides audio data to this * audio device. * * @return The associated core. */ protected IAPEDecompress getDecoder() { return decoder; } } jmac-1.74/core/src/davaguine/jmac/player/AudioDeviceFactory.java0000644000175000017500000000417710131230056024561 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.player; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public abstract class AudioDeviceFactory { /** * Creates a new AudioDevice. * * @return a new instance of a specific class of AudioDevice. */ public abstract AudioDevice createAudioDevice(); /** * Creates an instance of an AudioDevice implementation. * * @param loader The ClassLoader to use to * load the named class, or null to use the * system class loader. * @param name The name of the class to load. * @return A newly-created instance of the audio device class. */ protected AudioDevice instantiate(ClassLoader loader, String name) throws ClassNotFoundException, IllegalAccessException, InstantiationException { AudioDevice dev = null; Class cls = null; if (loader == null) { cls = Class.forName(name); } else { cls = loader.loadClass(name); } Object o = cls.newInstance(); dev = (AudioDevice) o; return dev; } } jmac-1.74/core/src/davaguine/jmac/player/FactoryRegistry.java0000644000175000017500000000650710131230056024207 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.player; import java.util.Enumeration; import java.util.Hashtable; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class FactoryRegistry extends AudioDeviceFactory { static private FactoryRegistry instance = null; static synchronized public FactoryRegistry systemRegistry() { if (instance == null) { instance = new FactoryRegistry(); instance.registerDefaultFactories(); } return instance; } protected Hashtable factories = new Hashtable(); /** * Registers an AudioDeviceFactory instance * with this registry. */ public void addFactory(AudioDeviceFactory factory) { factories.put(factory.getClass(), factory); } public void removeFactoryType(Class cls) { factories.remove(cls); } public void removeFactory(AudioDeviceFactory factory) { factories.remove(factory.getClass()); } public AudioDevice createAudioDevice() { AudioDevice device = null; AudioDeviceFactory[] factories = getFactoriesPriority(); if (factories == null) throw new JMACPlayerException(this + ": no factories registered"); JMACPlayerException lastEx = null; for (int i = 0; (device == null) && (i < factories.length); i++) { try { device = factories[i].createAudioDevice(); } catch (JMACPlayerException ex) { lastEx = ex; } } if (device == null && lastEx != null) throw new JMACPlayerException("Cannot create AudioDevice", lastEx); return device; } protected AudioDeviceFactory[] getFactoriesPriority() { AudioDeviceFactory[] fa = null; synchronized (factories) { int size = factories.size(); if (size != 0) { fa = new AudioDeviceFactory[size]; int idx = 0; Enumeration e = factories.elements(); while (e.hasMoreElements()) { AudioDeviceFactory factory = (AudioDeviceFactory) e.nextElement(); fa[idx++] = factory; } } } return fa; } protected void registerDefaultFactories() { addFactory(new JavaSoundAudioDeviceFactory()); } } jmac-1.74/core/src/davaguine/jmac/player/JavaSoundAudioDevice.java0000644000175000017500000001001410131230056025027 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.player; import davaguine.jmac.decoder.IAPEDecompress; import javax.sound.sampled.*; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class JavaSoundAudioDevice extends AudioDeviceBase { private SourceDataLine source = null; private AudioFormat fmt = null; protected void setAudioFormat(AudioFormat fmt0) { fmt = fmt0; } protected AudioFormat getAudioFormat() { if (fmt == null) { IAPEDecompress decoder = getDecoder(); fmt = new AudioFormat(decoder.getApeInfoSampleRate(), decoder.getApeInfoBitsPerSample(), decoder.getApeInfoChannels(), true, false); } return fmt; } protected DataLine.Info getSourceLineInfo() { AudioFormat fmt = getAudioFormat(); DataLine.Info info = new DataLine.Info(SourceDataLine.class, fmt, 4000); return info; } public void open(AudioFormat fmt) { if (!isOpen()) { setAudioFormat(fmt); openImpl(); setOpen(true); } } protected void openImpl() { } // createSource fix. protected void createSource() { Throwable t = null; try { Line line = AudioSystem.getLine(getSourceLineInfo()); if (line instanceof SourceDataLine) { source = (SourceDataLine) line; source.open(fmt, millisecondsToBytes(fmt, 2000)); source.start(); } } catch (RuntimeException ex) { t = ex; } catch (LinkageError ex) { t = ex; } catch (LineUnavailableException ex) { t = ex; } if (source == null) throw new JMACPlayerException("cannot obtain source audio line", t); } public int millisecondsToBytes(AudioFormat fmt, int time) { return (int) (time * (fmt.getSampleRate() * fmt.getChannels() * fmt.getSampleSizeInBits()) / 8000.0); } protected void closeImpl() { if (source != null) { source.close(); } } protected void writeImpl(byte[] samples, int offs, int len) { if (source == null) createSource(); source.write(samples, offs, len); } protected void flushImpl() { if (source != null) { source.drain(); } } public int getPosition() { int pos = 0; if (source != null) { pos = (int) (source.getMicrosecondPosition() / 1000); } return pos; } /** * Runs a short test by playing a short silent sound. */ public void test() { try { open(new AudioFormat(22050, 16, 1, true, false)); byte[] data = new byte[22050 / 5]; write(data, 0, data.length); flush(); close(); } catch (RuntimeException ex) { throw new JMACPlayerException("Device test failed: ", ex); } } } jmac-1.74/core/src/davaguine/jmac/player/JavaSoundAudioDeviceFactory.java0000644000175000017500000000451710131230056026372 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.player; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class JavaSoundAudioDeviceFactory extends AudioDeviceFactory { private boolean tested = false; private static final String DEVICE_CLASS_NAME = "davaguine.jmac.player.JavaSoundAudioDevice"; public synchronized AudioDevice createAudioDevice() { if (!tested) { testAudioDevice(); tested = true; } try { return createAudioDeviceImpl(); } catch (Exception ex) { throw new JMACPlayerException("unable to create JavaSound device: " + ex); } catch (LinkageError ex) { throw new JMACPlayerException("unable to create JavaSound device: " + ex); } } protected JavaSoundAudioDevice createAudioDeviceImpl() { ClassLoader loader = getClass().getClassLoader(); try { JavaSoundAudioDevice dev = (JavaSoundAudioDevice) instantiate(loader, DEVICE_CLASS_NAME); return dev; } catch (Exception ex) { throw new JMACPlayerException("Cannot create JavaSound device", ex); } catch (LinkageError ex) { throw new JMACPlayerException("Cannot create JavaSound device", ex); } } public void testAudioDevice() { JavaSoundAudioDevice dev = createAudioDeviceImpl(); dev.test(); } } jmac-1.74/core/src/davaguine/jmac/player/jmacp.java0000644000175000017500000000600410131230056022131 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.player; import java.io.IOException; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class jmacp { private String fFilename = null; public static void main(String[] args) { int retval = 0; try { jmacp player = createInstance(args); if (player != null) player.play(); } catch (Exception ex) { System.err.println(ex); ex.printStackTrace(System.err); retval = 1; } System.exit(retval); } static public jmacp createInstance(String[] args) { jmacp player = new jmacp(); if (!player.parseArgs(args)) player = null; return player; } private jmacp() { } public jmacp(String filename) { init(filename); } protected void init(String filename) { fFilename = filename; } protected boolean parseArgs(String[] args) { boolean parsed = false; if (args.length == 1) { init(args[0]); parsed = true; } else if (args.length == 2) { showUsage(); } else { showUsage(); } return parsed; } public void showUsage() { System.out.println("Usage: jmacp "); System.out.println(""); System.out.println(" e.g. : java davaguine.jmac.player.jmacp localfile.ape"); } public void play() { try { System.out.println("playing " + fFilename + "..."); AudioDevice dev = getAudioDevice(); Player player = new Player(fFilename, dev); player.play(); } catch (IOException ex) { throw new JMACPlayerException("Problem playing file " + fFilename, ex); } catch (Exception ex) { throw new JMACPlayerException("Problem playing file " + fFilename, ex); } } protected AudioDevice getAudioDevice() { return FactoryRegistry.systemRegistry().createAudioDevice(); } } jmac-1.74/core/src/davaguine/jmac/player/JMACPlayerException.java0000644000175000017500000000336110131230056024610 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.player; import java.io.PrintStream; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class JMACPlayerException extends RuntimeException { private Throwable exception; public JMACPlayerException() { } public JMACPlayerException(String msg) { super(msg); } public JMACPlayerException(String msg, Throwable t) { super(msg); exception = t; } public Throwable getException() { return exception; } public void printStackTrace() { printStackTrace(System.err); } public void printStackTrace(PrintStream ps) { if (this.exception == null) { super.printStackTrace(ps); } else { exception.printStackTrace(); } } } jmac-1.74/core/src/davaguine/jmac/player/NullAudioDevice.java0000644000175000017500000000221010131230056024046 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.player; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class NullAudioDevice extends AudioDeviceBase { public int getPosition() { return 0; } } jmac-1.74/core/src/davaguine/jmac/player/Player.java0000644000175000017500000001136410131230056022300 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.player; import davaguine.jmac.decoder.IAPEDecompress; import davaguine.jmac.tools.File; import java.io.IOException; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class Player { public final static int BLOCKS_PER_DECODE = 9216; /** * The MAC audio core. */ /*final*/ private File io; private IAPEDecompress decoder; /** * The AudioDevice the audio samples are written to. */ private AudioDevice audio; /** * Has the player been closed? */ private boolean closed = false; /** * Has the player played back all blocks from the stream? */ private boolean complete = false; private int lastPosition = 0; /** * Creates a new Player instance. */ public Player(String file) throws IOException { this(file, null); } public Player(String file, AudioDevice device) throws IOException { io = File.createFile(file, "r"); decoder = IAPEDecompress.CreateIAPEDecompress(io); if (device != null) { audio = device; } else { FactoryRegistry r = FactoryRegistry.systemRegistry(); audio = r.createAudioDevice(); } audio.open(decoder); } public IAPEDecompress getDecoder() { return decoder; } /** * Plays all MAC audio blocks. * * @return true if the last block was played, or false if there are * more blocks. */ public boolean play() throws IOException { int nBlocksLeft = decoder.getApeInfoDecompressTotalBlocks(); int blockAlign = decoder.getApeInfoBlockAlign(); // allocate space for decompression byte[] spTempBuffer = new byte[blockAlign * BLOCKS_PER_DECODE]; while (nBlocksLeft > 0) { int nBlocksDecoded = decoder.GetData(spTempBuffer, BLOCKS_PER_DECODE); // update amount remaining nBlocksLeft -= nBlocksDecoded; synchronized (this) { if (audio != null) { audio.write(spTempBuffer, 0, nBlocksDecoded * blockAlign); } } } // last block, ensure all data flushed to the audio device. AudioDevice out = audio; if (out != null) { out.flush(); synchronized (this) { complete = (!closed); close(); } } return true; } /** * Cloases this player. Any audio currently playing is stopped * immediately. */ public synchronized void close() throws IOException { AudioDevice out = audio; if (out != null) { closed = true; audio = null; // this may fail, so ensure object state is set up before // calling this method. out.close(); lastPosition = out.getPosition(); io.close(); io = null; decoder = null; } } /** * Returns the completed status of this player. * * @return true if all available MAC audio blocks have been * decoded, or false otherwise. */ public synchronized boolean isComplete() { return complete; } /** * Retrieves the position in milliseconds of the current audio * sample being played. This method delegates to the * AudioDevice that is used by this player to sound * the decoded audio samples. */ public int getPosition() { int position = lastPosition; AudioDevice out = audio; if (out != null) { position = out.getPosition(); } return position; } } jmac-1.74/core/src/davaguine/jmac/prediction/0000755000175000017500000000000010451144641021051 5ustar twernertwernerjmac-1.74/core/src/davaguine/jmac/prediction/IPredictorCompress.java0000644000175000017500000000247610131230057025475 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.prediction; /** * Author: Dmitry Vaguine * Date: 02.05.2004 * Time: 12:00:29 */ public abstract class IPredictorCompress { public IPredictorCompress(int nCompressionLevel) { } public int CompressValue(int nA) { return CompressValue(nA, 0); } public abstract int CompressValue(int nA, int nB); public abstract void Flush(); } ; jmac-1.74/core/src/davaguine/jmac/prediction/IPredictorDecompress.java0000644000175000017500000000252110131230057025775 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.prediction; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public abstract class IPredictorDecompress { public IPredictorDecompress(int nCompressionLevel, int nVersion) { } public int DecompressValue(int nA) { return DecompressValue(nA, 0); } public abstract int DecompressValue(int nA, int nB); public abstract void Flush(); } jmac-1.74/core/src/davaguine/jmac/prediction/NNFilter.java0000644000175000017500000001532610131230057023374 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.prediction; import davaguine.jmac.tools.JMACException; import davaguine.jmac.tools.RollBufferShort; import java.util.Arrays; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public abstract class NNFilter { public final static int NN_WINDOW_ELEMENTS = 512; public NNFilter(int nOrder, int nShift, int nVersion) { if ((nOrder <= 0) || ((nOrder % 16) != 0)) throw new JMACException("Wrong Order"); m_nOrder = nOrder; m_nShift = nShift; m_nVersion = nVersion; m_rbInput.Create(512 /* NN_WINDOW_ELEMENTS */, nOrder); m_rbDeltaM.Create(512 /*NN_WINDOW_ELEMENTS */, nOrder); m_paryM = new short[nOrder]; } public int Compress(int nInput) { RollBufferShort input = m_rbInput; RollBufferShort delta = m_rbDeltaM; int order = m_nOrder; int shift = m_nShift; short[] pary = m_paryM; short[] inputData = input.m_pData; int inputIndex = input.index; short[] deltaData = delta.m_pData; int deltaIndex = delta.index; // convert the input to a short and store it inputData[inputIndex] = (short) ((nInput >= Short.MIN_VALUE && nInput <= Short.MAX_VALUE) ? nInput : (nInput >> 31) ^ 0x7FFF); // figure a dot product int nDotProduct = CalculateDotProductNoMMX(inputData, inputIndex - order, pary, 0); // calculate the output int nOutput = nInput - ((nDotProduct + (1 << (m_nShift - 1))) >> m_nShift); // adapt AdaptNoMMX(pary, 0, deltaData, deltaIndex - order, nOutput); int nTempABS = Math.abs(nInput); if (nTempABS > (m_nRunningAverage * 3)) deltaData[deltaIndex] = (short) (((nInput >> 25) & 64) - 32); else if (nTempABS > (m_nRunningAverage * 4) / 3) deltaData[deltaIndex] = (short) (((nInput >> 26) & 32) - 16); else if (nTempABS > 0) deltaData[deltaIndex] = (short) (((nInput >> 27) & 16) - 8); else deltaData[deltaIndex] = (short) 0; m_nRunningAverage += (nTempABS - m_nRunningAverage) / 16; deltaData[deltaIndex - 1] >>= 1; deltaData[deltaIndex - 2] >>= 1; deltaData[deltaIndex - 8] >>= 1; // increment and roll if necessary // input.IncrementSafe(); if ((++input.index) == orderPlusWindow) { System.arraycopy(inputData, input.index - order, inputData, 0, order); input.index = order; } // delta.IncrementSafe(); if ((++delta.index) == orderPlusWindow) { System.arraycopy(deltaData, delta.index - order, deltaData, 0, order); delta.index = order; } return nOutput; } public int Decompress(int nInput) { // figure a dot product RollBufferShort input = m_rbInput; RollBufferShort delta = m_rbDeltaM; int order = m_nOrder; int shift = m_nShift; short[] pary = m_paryM; short[] inputData = input.m_pData; int inputIndex = input.index; short[] deltaData = delta.m_pData; int deltaIndex = delta.index; int nDotProduct = CalculateDotProductNoMMX(inputData, inputIndex - order, pary, 0); // adapt AdaptNoMMX(pary, 0, deltaData, deltaIndex - order, nInput); // store the output value int nOutput = nInput + ((nDotProduct + (1 << (shift - 1))) >> shift); // update the input buffer inputData[inputIndex] = (short) ((nOutput >= Short.MIN_VALUE && nOutput <= Short.MAX_VALUE) ? nOutput : (nOutput >> 31) ^ 0x7FFF); if (m_nVersion >= 3980) { int nTempABS = Math.abs(nOutput); if (nTempABS > (m_nRunningAverage * 3)) deltaData[deltaIndex] = (short) (((nOutput >> 25) & 64) - 32); else if (nTempABS > (m_nRunningAverage * 4) / 3) deltaData[deltaIndex] = (short) (((nOutput >> 26) & 32) - 16); else if (nTempABS > 0) deltaData[deltaIndex] = (short) (((nOutput >> 27) & 16) - 8); else deltaData[deltaIndex] = 0; m_nRunningAverage += (nTempABS - m_nRunningAverage) / 16; deltaData[deltaIndex - 1] >>= 1; deltaData[deltaIndex - 2] >>= 1; deltaData[deltaIndex - 8] >>= 1; } else { deltaData[deltaIndex] = (short) ((nOutput == 0) ? 0 : ((nOutput >> 28) & 8) - 4); deltaData[deltaIndex - 4] >>= 1; deltaData[deltaIndex - 8] >>= 1; } // increment and roll if necessary // input.IncrementSafe(); if ((++input.index) == orderPlusWindow) { System.arraycopy(inputData, input.index - order, inputData, 0, order); input.index = order; } // delta.IncrementSafe(); if ((++delta.index) == orderPlusWindow) { System.arraycopy(deltaData, delta.index - order, deltaData, 0, order); delta.index = order; } return nOutput; } public void Flush() { Arrays.fill(m_paryM, (short) 0); m_rbInput.Flush(); m_rbDeltaM.Flush(); m_nRunningAverage = 0; } protected int m_nOrder; protected int m_nShift; protected int m_nVersion; protected int orderPlusWindow; private int m_nRunningAverage; private RollBufferShort m_rbInput = new RollBufferShort(); private RollBufferShort m_rbDeltaM = new RollBufferShort(); private short[] m_paryM; protected abstract int CalculateDotProductNoMMX(short[] pA, int indexA, short[] pB, int indexB); protected abstract void AdaptNoMMX(short[] pM, int indexM, short[] pAdapt, int indexA, int nDirection); } jmac-1.74/core/src/davaguine/jmac/prediction/NNFilter1280.java0000644000175000017500000002000610131230057023676 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.prediction; import java.nio.ShortBuffer; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class NNFilter1280 extends NNFilter { public NNFilter1280(int nShift, int nVersion) { super(1280, nShift, nVersion); orderPlusWindow = 1792 /* NN_WINDOW_ELEMENTS + m_nOrder */; } protected int CalculateDotProductNoMMX(short[] pA, int indexA, short[] pB, int indexB) { int nDotProduct = 0; ShortBuffer a = ShortBuffer.wrap(pA); a.position(indexA); ShortBuffer b = ShortBuffer.wrap(pB); b.position(indexB); for (int i = 0; i < 40; i++) { nDotProduct += a.get() * b.get() + a.get() * b.get() + a.get() * b.get() + a.get() * b.get() + a.get() * b.get() + a.get() * b.get() + a.get() * b.get() + a.get() * b.get() + a.get() * b.get() + a.get() * b.get() + a.get() * b.get() + a.get() * b.get() + a.get() * b.get() + a.get() * b.get() + a.get() * b.get() + a.get() * b.get() + a.get() * b.get() + a.get() * b.get() + a.get() * b.get() + a.get() * b.get() + a.get() * b.get() + a.get() * b.get() + a.get() * b.get() + a.get() * b.get() + a.get() * b.get() + a.get() * b.get() + a.get() * b.get() + a.get() * b.get() + a.get() * b.get() + a.get() * b.get() + a.get() * b.get() + a.get() * b.get(); /* nDotProduct += pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++];*/ } return nDotProduct; } protected void AdaptNoMMX(short[] pM, int indexM, short[] pAdapt, int indexA, int nDirection) { if (nDirection < 0) { for (int i = 0; i < 40; i++) { pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; } } else if (nDirection > 0) { for (int i = 0; i < 40; i++) { pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; } } } } jmac-1.74/core/src/davaguine/jmac/prediction/NNFilter16.java0000644000175000017500000000737710131230057023552 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.prediction; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class NNFilter16 extends NNFilter { public NNFilter16(int nShift, int nVersion) { super(16, nShift, nVersion); orderPlusWindow = 528 /* NN_WINDOW_ELEMENTS + m_nOrder */; } protected int CalculateDotProductNoMMX(short[] pA, int indexA, short[] pB, int indexB) { return (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]); } protected void AdaptNoMMX(short[] pM, int indexM, short[] pAdapt, int indexA, int nDirection) { if (nDirection < 0) { pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; } else if (nDirection > 0) { pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; } } } jmac-1.74/core/src/davaguine/jmac/prediction/NNFilter256.java0000644000175000017500000001503310131230057023624 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.prediction; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class NNFilter256 extends NNFilter { public NNFilter256(int nShift, int nVersion) { super(256, nShift, nVersion); orderPlusWindow = 768 /* NN_WINDOW_ELEMENTS + m_nOrder */; } protected int CalculateDotProductNoMMX(short[] pA, int indexA, short[] pB, int indexB) { int nDotProduct = 0; for (int i = 0; i < 8; i++) { nDotProduct += pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++] + pA[indexA++] * pB[indexB++]; } return nDotProduct; } protected void AdaptNoMMX(short[] pM, int indexM, short[] pAdapt, int indexA, int nDirection) { if (nDirection < 0) { for (int i = 0; i < 8; i++) { pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; } } else if (nDirection > 0) { for (int i = 0; i < 8; i++) { pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; } } } } jmac-1.74/core/src/davaguine/jmac/prediction/NNFilter32.java0000644000175000017500000001375710131230057023547 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.prediction; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class NNFilter32 extends NNFilter { public NNFilter32(int nShift, int nVersion) { super(32, nShift, nVersion); orderPlusWindow = 544 /* NN_WINDOW_ELEMENTS + m_nOrder */; } protected int CalculateDotProductNoMMX(short[] pA, int indexA, short[] pB, int indexB) { return (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]); } protected void AdaptNoMMX(short[] pM, int indexM, short[] pAdapt, int indexA, int nDirection) { if (nDirection < 0) { pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; } else if (nDirection > 0) { pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; } } } jmac-1.74/core/src/davaguine/jmac/prediction/NNFilter64.java0000644000175000017500000001513010131230057023537 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.prediction; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class NNFilter64 extends NNFilter { public NNFilter64(int nShift, int nVersion) { super(64, nShift, nVersion); orderPlusWindow = 576 /* NN_WINDOW_ELEMENTS + m_nOrder */; } protected int CalculateDotProductNoMMX(short[] pA, int indexA, short[] pB, int indexB) { int nDotProduct = 0; for (int i = 0; i < 2; i++) { nDotProduct += (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]) + (pA[indexA++] * pB[indexB++]); } return nDotProduct; } protected void AdaptNoMMX(short[] pM, int indexM, short[] pAdapt, int indexA, int nDirection) { if (nDirection < 0) { for (int i = 0; i < 2; i++) { pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; pM[indexM++] += pAdapt[indexA++]; } } else if (nDirection > 0) { for (int i = 0; i < 2; i++) { pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; pM[indexM++] -= pAdapt[indexA++]; } } } } jmac-1.74/core/src/davaguine/jmac/prediction/PredictorCompressNormal.java0000644000175000017500000001752410131230057026535 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.prediction; import davaguine.jmac.info.CompressionLevel; import davaguine.jmac.tools.Globals; import davaguine.jmac.tools.JMACException; import davaguine.jmac.tools.RollBufferFastInt; import davaguine.jmac.tools.ScaledFirstOrderFilter; import java.util.Arrays; /** * Author: Dmitry Vaguine * Date: 02.05.2004 * Time: 13:08:34 */ public class PredictorCompressNormal extends IPredictorCompress { private final static int WINDOW_BLOCKS = 512; public PredictorCompressNormal(int nCompressionLevel) { super(nCompressionLevel); if (nCompressionLevel == CompressionLevel.COMPRESSION_LEVEL_FAST) { m_pNNFilter = null; m_pNNFilter1 = null; m_pNNFilter2 = null; } else if (nCompressionLevel == CompressionLevel.COMPRESSION_LEVEL_NORMAL) { m_pNNFilter = new NNFilter16(11, Globals.MAC_VERSION_NUMBER); m_pNNFilter1 = null; m_pNNFilter2 = null; } else if (nCompressionLevel == CompressionLevel.COMPRESSION_LEVEL_HIGH) { m_pNNFilter = new NNFilter64(11, Globals.MAC_VERSION_NUMBER); m_pNNFilter1 = null; m_pNNFilter2 = null; } else if (nCompressionLevel == CompressionLevel.COMPRESSION_LEVEL_EXTRA_HIGH) { m_pNNFilter = new NNFilter256(13, Globals.MAC_VERSION_NUMBER); m_pNNFilter1 = new NNFilter32(10, Globals.MAC_VERSION_NUMBER); m_pNNFilter2 = null; } else if (nCompressionLevel == CompressionLevel.COMPRESSION_LEVEL_INSANE) { m_pNNFilter = new NNFilter1280(15, Globals.MAC_VERSION_NUMBER); m_pNNFilter1 = new NNFilter256(13, Globals.MAC_VERSION_NUMBER); m_pNNFilter2 = new NNFilter16(11, Globals.MAC_VERSION_NUMBER); } else { throw new JMACException("Unknown Compression Type"); } } public int CompressValue(int nA, int nB) { // roll the buffers if necessary if (m_nCurrentIndex == WINDOW_BLOCKS) { m_rbPrediction.Roll(); m_rbAdapt.Roll(); m_nCurrentIndex = 0; } // stage 1: simple, non-adaptive order 1 prediction nA = m_Stage1FilterA.Compress(nA); nB = m_Stage1FilterB.Compress(nB); // stage 2: adaptive offset filter(s) int predictIndex = m_rbPrediction.index; m_rbPrediction.m_pData[predictIndex] = nA; m_rbPrediction.m_pData[predictIndex - 2] = m_rbPrediction.m_pData[predictIndex - 1] - m_rbPrediction.m_pData[predictIndex - 2]; m_rbPrediction.m_pData[predictIndex - 5] = nB; m_rbPrediction.m_pData[predictIndex - 6] = m_rbPrediction.m_pData[predictIndex - 5] - m_rbPrediction.m_pData[predictIndex - 6]; int nPredictionA = (m_rbPrediction.m_pData[predictIndex - 1] * m_aryM[8]) + (m_rbPrediction.m_pData[predictIndex - 2] * m_aryM[7]) + (m_rbPrediction.m_pData[predictIndex - 3] * m_aryM[6]) + (m_rbPrediction.m_pData[predictIndex - 4] * m_aryM[5]); int nPredictionB = (m_rbPrediction.m_pData[predictIndex - 5] * m_aryM[4]) + (m_rbPrediction.m_pData[predictIndex - 6] * m_aryM[3]) + (m_rbPrediction.m_pData[predictIndex - 7] * m_aryM[2]) + (m_rbPrediction.m_pData[predictIndex - 8] * m_aryM[1]) + (m_rbPrediction.m_pData[predictIndex - 9] * m_aryM[0]); int nOutput = nA - ((nPredictionA + (nPredictionB >> 1)) >> 10); // adapt int adaptIndex = m_rbAdapt.index; m_rbAdapt.m_pData[adaptIndex] = (m_rbPrediction.m_pData[predictIndex - 1] != 0) ? ((m_rbPrediction.m_pData[predictIndex - 1] >> 30) & 2) - 1 : 0; m_rbAdapt.m_pData[adaptIndex - 1] = (m_rbPrediction.m_pData[predictIndex - 2] != 0) ? ((m_rbPrediction.m_pData[predictIndex - 2] >> 30) & 2) - 1 : 0; m_rbAdapt.m_pData[adaptIndex - 4] = (m_rbPrediction.m_pData[predictIndex - 5] != 0) ? ((m_rbPrediction.m_pData[predictIndex - 5] >> 30) & 2) - 1 : 0; m_rbAdapt.m_pData[adaptIndex - 5] = (m_rbPrediction.m_pData[predictIndex - 6] != 0) ? ((m_rbPrediction.m_pData[predictIndex - 6] >> 30) & 2) - 1 : 0; if (nOutput > 0) { int indexM = 0; int indexA = adaptIndex - 8; m_aryM[indexM++] -= m_rbAdapt.m_pData[indexA++]; m_aryM[indexM++] -= m_rbAdapt.m_pData[indexA++]; m_aryM[indexM++] -= m_rbAdapt.m_pData[indexA++]; m_aryM[indexM++] -= m_rbAdapt.m_pData[indexA++]; m_aryM[indexM++] -= m_rbAdapt.m_pData[indexA++]; m_aryM[indexM++] -= m_rbAdapt.m_pData[indexA++]; m_aryM[indexM++] -= m_rbAdapt.m_pData[indexA++]; m_aryM[indexM++] -= m_rbAdapt.m_pData[indexA++]; m_aryM[indexM++] -= m_rbAdapt.m_pData[indexA++]; } else if (nOutput < 0) { int indexM = 0; int indexA = adaptIndex - 8; m_aryM[indexM++] += m_rbAdapt.m_pData[indexA++]; m_aryM[indexM++] += m_rbAdapt.m_pData[indexA++]; m_aryM[indexM++] += m_rbAdapt.m_pData[indexA++]; m_aryM[indexM++] += m_rbAdapt.m_pData[indexA++]; m_aryM[indexM++] += m_rbAdapt.m_pData[indexA++]; m_aryM[indexM++] += m_rbAdapt.m_pData[indexA++]; m_aryM[indexM++] += m_rbAdapt.m_pData[indexA++]; m_aryM[indexM++] += m_rbAdapt.m_pData[indexA++]; m_aryM[indexM++] += m_rbAdapt.m_pData[indexA++]; } // stage 3: NNFilters if (m_pNNFilter != null) { nOutput = m_pNNFilter.Compress(nOutput); if (m_pNNFilter1 != null) { nOutput = m_pNNFilter1.Compress(nOutput); if (m_pNNFilter2 != null) nOutput = m_pNNFilter2.Compress(nOutput); } } m_rbPrediction.index++; m_rbAdapt.index++; m_nCurrentIndex++; return nOutput; } public void Flush() { if (m_pNNFilter != null) m_pNNFilter.Flush(); if (m_pNNFilter1 != null) m_pNNFilter1.Flush(); if (m_pNNFilter2 != null) m_pNNFilter2.Flush(); m_rbPrediction.Flush(); m_rbAdapt.Flush(); m_Stage1FilterA.Flush(); m_Stage1FilterB.Flush(); Arrays.fill(m_aryM, 0); m_aryM[8] = 360; m_aryM[7] = 317; m_aryM[6] = -109; m_aryM[5] = 98; m_nCurrentIndex = 0; } // buffer information protected RollBufferFastInt m_rbPrediction = new RollBufferFastInt(WINDOW_BLOCKS, 10); protected RollBufferFastInt m_rbAdapt = new RollBufferFastInt(WINDOW_BLOCKS, 9); protected ScaledFirstOrderFilter m_Stage1FilterA = new ScaledFirstOrderFilter(31, 5); protected ScaledFirstOrderFilter m_Stage1FilterB = new ScaledFirstOrderFilter(31, 5); // adaption protected int[] m_aryM = new int[9]; // other protected int m_nCurrentIndex; protected NNFilter m_pNNFilter; protected NNFilter m_pNNFilter1; protected NNFilter m_pNNFilter2; } jmac-1.74/core/src/davaguine/jmac/prediction/PredictorDecompress3950toCurrent.java0000644000175000017500000001771310131230057030124 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.prediction; import davaguine.jmac.info.CompressionLevel; import davaguine.jmac.tools.JMACException; import davaguine.jmac.tools.RollBufferFastInt; import java.util.Arrays; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class PredictorDecompress3950toCurrent extends IPredictorDecompress { public final static int M_COUNT = 8; private final static int WINDOW_BLOCKS = 512; public PredictorDecompress3950toCurrent(int nCompressionLevel, int nVersion) { super(nCompressionLevel, nVersion); m_nVersion = nVersion; if (nCompressionLevel == CompressionLevel.COMPRESSION_LEVEL_FAST) { m_pNNFilter = null; m_pNNFilter1 = null; m_pNNFilter2 = null; } else if (nCompressionLevel == CompressionLevel.COMPRESSION_LEVEL_NORMAL) { m_pNNFilter = new NNFilter16(11, nVersion); m_pNNFilter1 = null; m_pNNFilter2 = null; } else if (nCompressionLevel == CompressionLevel.COMPRESSION_LEVEL_HIGH) { m_pNNFilter = new NNFilter64(11, nVersion); m_pNNFilter1 = null; m_pNNFilter2 = null; } else if (nCompressionLevel == CompressionLevel.COMPRESSION_LEVEL_EXTRA_HIGH) { m_pNNFilter = new NNFilter256(13, nVersion); m_pNNFilter1 = new NNFilter32(10, nVersion); m_pNNFilter2 = null; } else if (nCompressionLevel == CompressionLevel.COMPRESSION_LEVEL_INSANE) { m_pNNFilter = new NNFilter1280(15, nVersion); m_pNNFilter1 = new NNFilter256(13, nVersion); m_pNNFilter2 = new NNFilter16(11, nVersion); } else { throw new JMACException("Unknown Compression Type"); } } public int DecompressValue(int nA) { return DecompressValue(nA, 0); } public int DecompressValue(int nA, int nB) { if (m_nCurrentIndex == WINDOW_BLOCKS) { // copy forward and adjust pointers m_rbPredictionA.Roll(); m_rbPredictionB.Roll(); m_rbAdaptA.Roll(); m_rbAdaptB.Roll(); m_nCurrentIndex = 0; } // stage 2: NNFilter Object obj; if ((obj = m_pNNFilter2) != null) nA = ((NNFilter) (obj)).Decompress(nA); if ((obj = m_pNNFilter1) != null) nA = ((NNFilter) (obj)).Decompress(nA); if ((obj = m_pNNFilter) != null) nA = ((NNFilter) (obj)).Decompress(nA); // stage 1: multiple predictors (order 2 and offset 1) int indexA = ((RollBufferFastInt) (obj = m_rbPredictionA)).index; RollBufferFastInt predictB; int indexB = (predictB = m_rbPredictionB).index; int ai[]; int l; (ai = ((RollBufferFastInt) (obj)).m_pData)[indexA] = l = m_nLastValueA; int l1 = indexA - 1; ai[l1] = l - ai[l1]; int ai3[] = predictB.m_pData; ai3[indexB] = nB - ((scaledFilterBLV * 31) >> 5); scaledFilterBLV = nB; // ai3[indexB] = m_Stage1FilterB.Compress(nB); int k2 = indexB - 1; ai3[k2] = ai3[indexB] - ai3[k2]; int ai2[]; int ai4[]; int nPredictionA = (l * (ai2 = m_aryMA)[0]) + (ai[l1] * ai2[1]) + (ai[indexA - 2] * ai2[2]) + (ai[indexA - 3] * ai2[3]); int nPredictionB = (ai3[indexB] * (ai4 = m_aryMB)[0]) + (ai3[k2] * ai4[1]) + (ai3[indexB - 2] * ai4[2]) + (ai3[indexB - 3] * ai4[3]) + (ai3[indexB - 4] * ai4[4]); int nCurrentA = nA + ((nPredictionA + (nPredictionB >> 1)) >> 10); RollBufferFastInt adaptA; RollBufferFastInt adaptB; int indexAA = (adaptA = m_rbAdaptA).index; int indexAB = (adaptB = m_rbAdaptB).index; int ai1[]; (ai1 = m_rbAdaptA.m_pData)[indexAA] = (l != 0) ? ((l >> 30) & 2) - 1 : 0; ai1[indexAA - 1] = (ai[l1] != 0) ? ((ai[l1] >> 30) & 2) - 1 : 0; int ai5[]; (ai5 = m_rbAdaptB.m_pData)[indexAB] = (ai3[indexB] != 0) ? ((ai3[indexB] >> 30) & 2) - 1 : 0; ai5[indexAB - 1] = (ai3[k2] != 0) ? ((ai3[k2] >> 30) & 2) - 1 : 0; if (nA > 0) { ai2[0] -= ai1[indexAA]; ai2[1] -= ai1[indexAA - 1]; ai2[2] -= ai1[indexAA - 2]; ai2[3] -= ai1[indexAA - 3]; ai4[0] -= ai5[indexAB]; ai4[1] -= ai5[indexAB - 1]; ai4[2] -= ai5[indexAB - 2]; ai4[3] -= ai5[indexAB - 3]; ai4[4] -= ai5[indexAB - 4]; } else if (nA < 0) { ai2[0] += ai1[indexAA]; ai2[1] += ai1[indexAA - 1]; ai2[2] += ai1[indexAA - 2]; ai2[3] += ai1[indexAA - 3]; ai4[0] += ai5[indexAB]; ai4[1] += ai5[indexAB - 1]; ai4[2] += ai5[indexAB - 2]; ai4[3] += ai5[indexAB - 3]; ai4[4] += ai5[indexAB - 4]; } // int nRetVal = m_Stage1FilterA.Decompress(nCurrentA); scaledFilterALV = nCurrentA + ((scaledFilterALV * 31) >> 5); m_nLastValueA = nCurrentA; ((RollBufferFastInt) (obj)).index++; predictB.index++; adaptA.index++; adaptB.index++; m_nCurrentIndex++; return scaledFilterALV; } public void Flush() { NNFilter nnfilter; if ((nnfilter = m_pNNFilter) != null) nnfilter.Flush(); if ((nnfilter = m_pNNFilter1) != null) nnfilter.Flush(); if ((nnfilter = m_pNNFilter2) != null) nnfilter.Flush(); Arrays.fill(m_aryMA, 0); Arrays.fill(m_aryMB, 0); m_rbPredictionA.Flush(); m_rbPredictionB.Flush(); m_rbAdaptA.Flush(); m_rbAdaptB.Flush(); int ai[]; (ai = m_aryMA)[0] = 360; ai[1] = 317; ai[2] = -109; ai[3] = 98; // m_Stage1FilterA.Flush(); scaledFilterALV = 0; // m_Stage1FilterB.Flush(); scaledFilterBLV = 0; m_nLastValueA = 0; m_nCurrentIndex = 0; } // adaption protected int m_aryMA[] = new int[M_COUNT]; protected int m_aryMB[] = new int[M_COUNT]; // buffer pointers protected RollBufferFastInt m_rbPredictionA = new RollBufferFastInt(WINDOW_BLOCKS, 8); protected RollBufferFastInt m_rbPredictionB = new RollBufferFastInt(WINDOW_BLOCKS, 8); protected RollBufferFastInt m_rbAdaptA = new RollBufferFastInt(WINDOW_BLOCKS, 8); protected RollBufferFastInt m_rbAdaptB = new RollBufferFastInt(WINDOW_BLOCKS, 8); // protected ScaledFirstOrderFilter m_Stage1FilterA = new ScaledFirstOrderFilter(31, 5); protected int scaledFilterALV; // protected ScaledFirstOrderFilter m_Stage1FilterB = new ScaledFirstOrderFilter(31, 5); protected int scaledFilterBLV; // other protected int m_nCurrentIndex; protected int m_nLastValueA; protected int m_nVersion; protected NNFilter m_pNNFilter; protected NNFilter m_pNNFilter1; protected NNFilter m_pNNFilter2; } jmac-1.74/core/src/davaguine/jmac/prediction/PredictorDecompressNormal3930to3950.java0000644000175000017500000001225210131230057030242 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.prediction; import davaguine.jmac.info.CompressionLevel; import davaguine.jmac.tools.JMACException; import java.util.Arrays; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class PredictorDecompressNormal3930to3950 extends IPredictorDecompress { private final static int HISTORY_ELEMENTS = 8; private final static int WINDOW_BLOCKS = 512; private final static int BUFFER_COUNT = 1; private final static int M_COUNT = 8; public PredictorDecompressNormal3930to3950(int nCompressionLevel, int nVersion) { super(nCompressionLevel, nVersion); m_pBuffer[0] = new int[HISTORY_ELEMENTS + WINDOW_BLOCKS]; if (nCompressionLevel == CompressionLevel.COMPRESSION_LEVEL_FAST) { m_pNNFilter = null; m_pNNFilter1 = null; } else if (nCompressionLevel == CompressionLevel.COMPRESSION_LEVEL_NORMAL) { m_pNNFilter = new NNFilter16(11, nVersion); m_pNNFilter1 = null; } else if (nCompressionLevel == CompressionLevel.COMPRESSION_LEVEL_HIGH) { m_pNNFilter = new NNFilter64(11, nVersion); m_pNNFilter1 = null; } else if (nCompressionLevel == CompressionLevel.COMPRESSION_LEVEL_EXTRA_HIGH) { m_pNNFilter = new NNFilter256(13, nVersion); m_pNNFilter1 = new NNFilter32(10, nVersion); } else { throw new JMACException("Unknown Compression Type"); } } public int DecompressValue(int nInput, int notneeded) { if (m_nCurrentIndex == WINDOW_BLOCKS) { // copy forward and adjust pointers System.arraycopy(m_pBuffer[0], WINDOW_BLOCKS, m_pBuffer[0], 0, HISTORY_ELEMENTS); m_pInputBuffer_i = 0; m_pInputBuffer_j = HISTORY_ELEMENTS; m_nCurrentIndex = 0; } // stage 2: NNFilter if (m_pNNFilter1 != null) nInput = m_pNNFilter1.Decompress(nInput); if (m_pNNFilter != null) nInput = m_pNNFilter.Decompress(nInput); // stage 1: multiple predictors (order 2 and offset 1) int p1 = m_pBuffer[m_pInputBuffer_i][m_pInputBuffer_j - 1]; int p2 = m_pBuffer[m_pInputBuffer_i][m_pInputBuffer_j - 1] - m_pBuffer[m_pInputBuffer_i][m_pInputBuffer_j - 2]; int p3 = m_pBuffer[m_pInputBuffer_i][m_pInputBuffer_j - 2] - m_pBuffer[m_pInputBuffer_i][m_pInputBuffer_j - 3]; int p4 = m_pBuffer[m_pInputBuffer_i][m_pInputBuffer_j - 3] - m_pBuffer[m_pInputBuffer_i][m_pInputBuffer_j - 4]; m_pBuffer[m_pInputBuffer_i][m_pInputBuffer_j] = nInput + (((p1 * m_aryM[0]) + (p2 * m_aryM[1]) + (p3 * m_aryM[2]) + (p4 * m_aryM[3])) >> 9); if (nInput > 0) { m_aryM[0] -= ((p1 >> 30) & 2) - 1; m_aryM[1] -= ((p2 >> 30) & 2) - 1; m_aryM[2] -= ((p3 >> 30) & 2) - 1; m_aryM[3] -= ((p4 >> 30) & 2) - 1; } else if (nInput < 0) { m_aryM[0] += ((p1 >> 30) & 2) - 1; m_aryM[1] += ((p2 >> 30) & 2) - 1; m_aryM[2] += ((p3 >> 30) & 2) - 1; m_aryM[3] += ((p4 >> 30) & 2) - 1; } int nRetVal = m_pBuffer[m_pInputBuffer_i][m_pInputBuffer_j] + ((m_nLastValue * 31) >> 5); m_nLastValue = nRetVal; m_nCurrentIndex++; m_pInputBuffer_j++; return nRetVal; } public void Flush() { if (m_pNNFilter != null) m_pNNFilter.Flush(); if (m_pNNFilter1 != null) m_pNNFilter1.Flush(); Arrays.fill(m_pBuffer[0], 0, HISTORY_ELEMENTS, 0); Arrays.fill(m_aryM, 0); m_aryM[0] = 360; m_aryM[1] = 317; m_aryM[2] = -109; m_aryM[3] = 98; m_pInputBuffer_i = 0; m_pInputBuffer_j = HISTORY_ELEMENTS; m_nLastValue = 0; m_nCurrentIndex = 0; } // buffer information protected int[][] m_pBuffer = new int[BUFFER_COUNT][]; // adaption protected int[] m_aryM = new int[M_COUNT]; // buffer pointers protected int m_pInputBuffer_i; protected int m_pInputBuffer_j; // other protected int m_nCurrentIndex; protected int m_nLastValue; protected NNFilter m_pNNFilter; protected NNFilter m_pNNFilter1; } jmac-1.74/core/src/davaguine/jmac/tools/0000755000175000017500000000000010451144641020051 5ustar twernertwernerjmac-1.74/core/src/davaguine/jmac/tools/ByteArrayReader.java0000644000175000017500000001030710131230057023732 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.tools; import java.io.EOFException; import java.io.IOException; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class ByteArrayReader { private byte[] data = null; private int index = 0; public ByteArrayReader() { } public ByteArrayReader(final File io, int size) throws IOException { this.data = new byte[size]; io.readFully(data); } public ByteArrayReader(final byte[] data) { this.data = data; } public ByteArrayReader(int size) { this.data = new byte[size]; } public byte[] getData() { return data; } public void reset(byte[] data, int index) { this.data = data; this.index = index; } public void reset(final File io, int size) throws IOException { index = 0; try { io.readFully(data, 0, size); } catch (EOFException e) { } } public void skipBytes(long n) { index += n; } public short readUnsignedByte() { return (short) (data[index++] & 0xff); } public int readUnsignedShort() { byte a1[]; return ((a1 = data)[index++] & 0xff) | ((a1[index++] & 0xff) << 8); } public long readUnsignedInt() { byte a1[]; return ((long) ((a1 = data)[index++] & 0xff)) | (((long) (a1[index++] & 0xff)) << 8) | (((long) (a1[index++] & 0xff)) << 16) | (((long) (a1[index++] & 0xff)) << 24); } public byte readByte() { return data[index++]; } public short readShort() { byte a1[]; return (short) (((a1 = data)[index++] & 0xff) | ((a1[index++] & 0xff) << 8)); } public int readInt() { byte a1[]; return (int) (((long) ((a1 = data)[index++] & 0xff)) | (((long) (a1[index++] & 0xff)) << 8) | (((long) (a1[index++] & 0xff)) << 16) | (((long) (a1[index++] & 0xff)) << 24)); } public long readLong() { byte a1[]; return ((long) ((a1 = data)[index++] & 0xff)) | (((long) (a1[index++] & 0xff)) << 8) | (((long) (a1[index++] & 0xff)) << 16) | (((long) (a1[index++] & 0xff)) << 24) | (((long) (a1[index++] & 0xff)) << 32) | (((long) (a1[index++] & 0xff)) << 40) | (((long) (a1[index++] & 0xff)) << 48) | (((long) (a1[index++] & 0xff)) << 56); } public void readFully(byte[] buf) { System.arraycopy(data, index, buf, 0, buf.length); index += buf.length; } public String readString(int size, String encoding) { String res; try { res = new String(data, index, size, encoding); } catch (java.io.UnsupportedEncodingException e) { throw new JMACException("Unsupported encoding", e); } index += size; return res; } public String readString(String encoding) { int size = 0; int i = index; while (data[i] != 0) { size++; i++; } String res; try { res = new String(data, index, size, encoding); } catch (java.io.UnsupportedEncodingException e) { throw new JMACException("Unsupported encoding", e); } index += (size + 1); return res; } } jmac-1.74/core/src/davaguine/jmac/tools/ByteArrayWriter.java0000644000175000017500000000753310131230057024013 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.tools; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class ByteArrayWriter { private byte[] data = null; private int index = 0; public ByteArrayWriter() { } public ByteArrayWriter(int size) { this.data = new byte[size]; } public ByteArrayWriter(final byte[] data) { this.data = data; } public void reset(int size) { this.data = new byte[size]; index = 0; } public byte[] getBytes() { return data; } public void writeUnsignedByte(short value) { if (value < 0 || value > 255) throw new JMACException("Wrong Value"); data[index++] = (byte) value; } public void writeUnsignedShort(int value) { if (value < 0 || value > 65535) throw new JMACException("Wrong Value"); data[index++] = (byte) (value & 0xff); data[index++] = (byte) (value >> 8); } public void writeUnsignedInt(long value) { if (value < 0 || value > 4294967295L) throw new JMACException("Wrong Value"); data[index++] = (byte) (value & 0xff); data[index++] = (byte) ((value >> 8) & 0xff); data[index++] = (byte) ((value >> 16) & 0xff); data[index++] = (byte) ((value >> 24) & 0xff); } public void writeByte(byte value) { data[index++] = value; } public void writeShort(short value) { data[index++] = (byte) (value & 0xff); data[index++] = (byte) (value >> 8); } public void writeInt(int value) { data[index++] = (byte) (value & 0xff); data[index++] = (byte) ((value >> 8) & 0xff); data[index++] = (byte) ((value >> 16) & 0xff); data[index++] = (byte) ((value >> 24) & 0xff); } public void writeBytes(byte[] buf) { writeBytes(buf, 0, buf.length); } public void writeBytes(byte[] buf, int off, int len) { System.arraycopy(buf, off, data, index, len); index += len; } public void writeString(String value, int size, String encoding) { try { byte[] bytes = value.getBytes(encoding); if (bytes.length != size) throw new JMACException("Wrong Value"); System.arraycopy(bytes, 0, data, index, size); } catch (java.io.UnsupportedEncodingException e) { throw new JMACException("Unsupported Encoding", e); } index += size; } public void writeZString(String value, String encoding) { try { byte[] bytes = value.getBytes(encoding); System.arraycopy(bytes, 0, data, index, bytes.length); index += bytes.length; } catch (java.io.UnsupportedEncodingException e) { throw new JMACException("Unsupported Encoding", e); } data[index++] = 0; } } jmac-1.74/core/src/davaguine/jmac/tools/ByteBuffer.java0000644000175000017500000000722310131230057022745 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.tools; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class ByteBuffer { private byte[] data; private int index; public ByteBuffer() { } public ByteBuffer(final byte[] output, final int index) { this.data = output; this.index = index; } public void reset(byte[] data) { this.data = data; this.index = 0; } public void reset(byte[] data, int index) { this.data = data; this.index = index; } public void append(final byte value) { data[index++] = value; } public void append(final byte value1, final byte value2) { byte abyte0[]; (abyte0 = data)[index++] = value1; abyte0[index++] = value2; } public void append(final short value) { byte abyte0[]; (abyte0 = data)[index++] = (byte) (value & 0xff); abyte0[index++] = (byte) (value >> 8); } public void append(final short value1, final short value2) { byte abyte0[]; (abyte0 = data)[index++] = (byte) (value1 & 0xff); abyte0[index++] = (byte) (value1 >> 8); abyte0[index++] = (byte) (value2 & 0xff); abyte0[index++] = (byte) (value2 >> 8); } public void append24(final int value) { byte abyte0[]; (abyte0 = data)[index++] = (byte) (value & 0xff); abyte0[index++] = (byte) (value >> 8 & 0xff); abyte0[index++] = (byte) (value >> 16 & 0xff); } public void append24(final int value1, final int value2) { byte abyte0[]; (abyte0 = data)[index++] = (byte) (value1 & 0xff); abyte0[index++] = (byte) (value1 >> 8 & 0xff); abyte0[index++] = (byte) (value1 >> 16 & 0xff); abyte0[index++] = (byte) (value2 & 0xff); abyte0[index++] = (byte) (value2 >> 8 & 0xff); abyte0[index++] = (byte) (value2 >> 16 & 0xff); } public void append(final int value) { byte abyte0[]; (abyte0 = data)[index++] = (byte) (value & 0xff); abyte0[index++] = (byte) (value >> 8 & 0xff); abyte0[index++] = (byte) (value >> 16 & 0xff); abyte0[index++] = (byte) (value >> 24 & 0xff); } public void append(byte[] bytes) { append(bytes, 0, bytes.length); } public void append(byte[] bytes, int off, int len) { if (0 < len) { byte abyte1[]; (abyte1 = data)[index++] = bytes[off]; for (int i = off + 1; i < len; i++) abyte1[index++] = bytes[i]; } } public byte[] getBytes() { return data; } public int getIndex() { return index; } } jmac-1.74/core/src/davaguine/jmac/tools/CircleBuffer.java0000644000175000017500000001003310131230057023234 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.tools; /** * Author: Dmitry Vaguine * Date: 06.05.2004 * Time: 21:05:48 */ public class CircleBuffer { // construction / destruction public CircleBuffer() { m_pBuffer = null; m_nTotal = 0; m_nHead = 0; m_nTail = 0; m_nEndCap = 0; m_nMaxDirectWriteBytes = 0; } // create the buffer public void CreateBuffer(int nBytes, int nMaxDirectWriteBytes) { m_nMaxDirectWriteBytes = nMaxDirectWriteBytes; m_nTotal = nBytes + 1 + nMaxDirectWriteBytes; m_pBuffer = new byte[m_nTotal]; byteBuffer = new ByteBuffer(); m_nHead = 0; m_nTail = 0; m_nEndCap = m_nTotal; } // query public int MaxAdd() { int nMaxAdd = (m_nTail >= m_nHead) ? (m_nTotal - 1 - m_nMaxDirectWriteBytes) - (m_nTail - m_nHead) : m_nHead - m_nTail - 1; return nMaxAdd; } public int MaxGet() { return (m_nTail >= m_nHead) ? m_nTail - m_nHead : (m_nEndCap - m_nHead) + m_nTail; } // direct writing public ByteBuffer GetDirectWritePointer() { // return a pointer to the tail -- note that it will always be safe to write // at least m_nMaxDirectWriteBytes since we use an end cap region byteBuffer.reset(m_pBuffer, m_nTail); return byteBuffer; } public void UpdateAfterDirectWrite(int nBytes) { // update the tail m_nTail += nBytes; // if the tail enters the "end cap" area, set the end cap and loop around if (m_nTail >= (m_nTotal - m_nMaxDirectWriteBytes)) { m_nEndCap = m_nTail; m_nTail = 0; } } // get data public int Get(byte[] pBuffer, int index, int nBytes) { int nTotalGetBytes = 0; if (pBuffer != null && nBytes > 0) { int nHeadBytes = Math.min(m_nEndCap - m_nHead, nBytes); int nFrontBytes = nBytes - nHeadBytes; System.arraycopy(m_pBuffer, m_nHead, pBuffer, index, nHeadBytes); nTotalGetBytes = nHeadBytes; if (nFrontBytes > 0) { System.arraycopy(m_pBuffer, 0, pBuffer, index + nHeadBytes, nFrontBytes); nTotalGetBytes += nFrontBytes; } RemoveHead(nBytes); } return nTotalGetBytes; } // remove / empty public void Empty() { m_nHead = 0; m_nTail = 0; m_nEndCap = m_nTotal; } public int RemoveHead(int nBytes) { nBytes = Math.min(MaxGet(), nBytes); m_nHead += nBytes; if (m_nHead >= m_nEndCap) m_nHead -= m_nEndCap; return nBytes; } public int RemoveTail(int nBytes) { nBytes = Math.min(MaxGet(), nBytes); m_nTail -= nBytes; if (m_nTail < 0) m_nTail += m_nEndCap; return nBytes; } private int m_nTotal; private int m_nMaxDirectWriteBytes; private int m_nEndCap; private int m_nHead; private int m_nTail; private byte[] m_pBuffer; private ByteBuffer byteBuffer; } jmac-1.74/core/src/davaguine/jmac/tools/Crc32.java0000644000175000017500000001644410131230057021571 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.tools; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public final class Crc32 { private final static long CRC32_TABLE[] = {0L, 1996959894L, 0xEE0E612CL, 0x990951BAL, 124634137L, 1886057615L, 0xE963A535L, 0x9E6495A3L, 249268274L, 2044508324L, 0xE0D5E91EL, 0x97D2D988L, 162941995L, 2125561021L, 0xE7B82D07L, 0x90BF1D91L, 498536548L, 1789927666L, 0xF3B97148L, 0x84BE41DEL, 450548861L, 1843258603L, 0xF4D4B551L, 0x83D385C7L, 325883990L, 1684777152L, 0xFD62F97AL, 0x8A65C9ECL, 335633487L, 1661365465L, 0xFA0F3D63L, 0x8D080DF5L, 997073096L, 1281953886L, 0xD56041E4L, 0xA2677172L, 1006888145L, 1258607687L, 0xD20D85FDL, 0xA50AB56BL, 901097722L, 1119000684L, 0xDBBBC9D6L, 0xACBCF940L, 853044451L, 1172266101L, 0xDCD60DCFL, 0xABD13D59L, 651767980L, 1373503546L, 0xC8D75180L, 0xBFD06116L, 565507253L, 1454621731L, 0xCFBA9599L, 0xB8BDA50FL, 671266974L, 1594198024L, 0xC60CD9B2L, 0xB10BE924L, 795835527L, 1483230225L, 0xC1611DABL, 0xB6662D3DL, 1994146192L, 31158534L, 0x98D220BCL, 0xEFD5102AL, 1907459465L, 112637215L, 0x9FBFE4A5L, 0xE8B8D433L, 2013776290L, 251722036L, 0x9609A88EL, 0xE10E9818L, 2137656763L, 141376813L, 0x91646C97L, 0xE6635C01L, 1802195444L, 476864866L, 0x856530D8L, 0xF262004EL, 1812370925L, 453092731L, 0x8208F4C1L, 0xF50FC457L, 1706088902L, 314042704L, 0x8BBEB8EAL, 0xFCB9887CL, 1658658271L, 366619977L, 0x8CD37CF3L, 0xFBD44C65L, 1303535960L, 984961486L, 0xA3BC0074L, 0xD4BB30E2L, 1256170817L, 1037604311L, 0xA4D1C46DL, 0xD3D6F4FBL, 1131014506L, 879679996L, 0xAD678846L, 0xDA60B8D0L, 1141124467L, 855842277L, 0xAA0A4C5FL, 0xDD0D7CC9L, 1342533948L, 654459306L, 0xBE0B1010L, 0xC90C2086L, 1466479909L, 544179635L, 0xB966D409L, 0xCE61E49FL, 1591671054L, 702138776L, 0xB0D09822L, 0xC7D7A8B4L, 1504918807L, 783551873L, 0xB7BD5C3BL, 0xC0BA6CADL, 0xEDB88320L, 0x9ABFB3B6L, 62317068L, 1957810842L, 0xEAD54739L, 0x9DD277AFL, 81470997L, 1943803523L, 0xE3630B12L, 0x94643B84L, 225274430L, 2053790376L, 0xE40ECF0BL, 0x9309FF9DL, 167816743L, 2097651377L, 0xF00F9344L, 0x8708A3D2L, 503444072L, 1762050814L, 0xF762575DL, 0x806567CBL, 426522225L, 1852507879L, 0xFED41B76L, 0x89D32BE0L, 282753626L, 1742555852L, 0xF9B9DF6FL, 0x8EBEEFF9L, 397917763L, 1622183637L, 0xD6D6A3E8L, 0xA1D1937EL, 953729732L, 1340076626L, 0xD1BB67F1L, 0xA6BC5767L, 1068828381L, 1219638859L, 0xD80D2BDAL, 0xAF0A1B4CL, 906185462L, 1090812512L, 0xDF60EFC3L, 0xA867DF55L, 829329135L, 1181335161L, 0xCB61B38CL, 0xBC66831AL, 628085408L, 1382605366L, 0xCC0C7795L, 0xBB0B4703L, 570562233L, 1426400815L, 0xC5BA3BBEL, 0xB2BD0B28L, 733239954L, 1555261956L, 0xC2D7FFA7L, 0xB5D0CF31L, 752459403L, 1541320221L, 0x9B64C2B0L, 0xEC63F226L, 1969922972L, 40735498L, 0x9C0906A9L, 0xEB0E363FL, 1913087877L, 83908371L, 0x95BF4A82L, 0xE2B87A14L, 2075208622L, 213261112L, 0x92D28E9BL, 0xE5D5BE0DL, 2094854071L, 198958881L, 0x86D3D2D4L, 0xF1D4E242L, 1759359992L, 534414190L, 0x81BE16CDL, 0xF6B9265BL, 1873836001L, 414664567L, 0x88085AE6L, 0xFF0F6A70L, 1711684554L, 285281116L, 0x8F659EFFL, 0xF862AE69L, 1634467795L, 376229701L, 0xA00AE278L, 0xD70DD2EEL, 1308918612L, 956543938L, 0xA7672661L, 0xD06016F7L, 1231636301L, 1047427035L, 0xAED16A4AL, 0xD9D65ADCL, 1088359270L, 936918000L, 0xA9BCAE53L, 0xDEBB9EC5L, 1202900863L, 817233897L, 0xBDBDF21CL, 0xCABAC28AL, 1404277552L, 615818150L, 0xBAD03605L, 0xCDD70693L, 1423857449L, 601450431L, 0xB3667A2EL, 0xC4614AB8L, 1567103746L, 711928724L, 0xB40BBE37L, 0xC30C8EA1L, 1510334235L, 755167117}; private long crc; /** * Dummy Constructor */ public Crc32() { crc = 0xFFFFFFFFL; } public void init() { crc = 0xFFFFFFFFL; } /** * Feed a bitstring to the crc calculation. */ public void append(byte bits) { long l; crc = ((l = crc) >> 8L) ^ CRC32_TABLE[(int) ((l & 0xFF) ^ (long) (bits & 0xff))]; } public void append(byte bits1, byte bits2) { long l; long[] a1; l = ((l = crc) >> 8L) ^ (a1 = CRC32_TABLE)[(int) ((l & 0xFF) ^ (long) (bits1 & 0xFF))]; crc = (l >> 8L) ^ a1[(int) ((l & 0xFF) ^ (long) (bits2 & 0xFF))]; } /** * Feed a bitstring to the crc calculation. */ public void append(short bits) { long l; long[] a1; l = ((l = crc) >> 8L) ^ (a1 = CRC32_TABLE)[(int) ((l & 0xFF) ^ (long) (bits & 0xFF))]; crc = (l >> 8L) ^ a1[(int) ((l & 0xFF) ^ (long) ((bits & 0xffff) >> 8))]; } public void append(short bits1, short bits2) { long l; long[] a1; l = ((l = crc) >> 8L) ^ (a1 = CRC32_TABLE)[(int) ((l & 0xFF) ^ (long) (bits1 & 0xFF))]; l = (l >> 8L) ^ a1[(int) ((l & 0xFF) ^ (long) ((bits1 & 0xffff) >> 8))]; l = (l >> 8L) ^ a1[(int) ((l & 0xFF) ^ (long) (bits2 & 0xFF))]; crc = (l >> 8L) ^ a1[(int) ((l & 0xFF) ^ (long) ((bits2 & 0xffff) >> 8))]; } /** * Feed a bitstring to the crc calculation. */ public void append24(int bits) { long l; long[] a1; l = ((l = crc) >> 8L) ^ (a1 = CRC32_TABLE)[(int) ((l & 0xFF) ^ (long) (bits & 0xFF))]; l = (l >> 8L) ^ a1[(int) ((l & 0xFF) ^ (long) ((bits & 0xff00) >> 8))]; crc = (l >> 8L) ^ a1[(int) ((l & 0xFF) ^ (long) ((bits & 0xff0000) >> 16))]; } public void append24(int bits1, int bits2) { long l; long[] a1; l = ((l = crc) >> 8L) ^ (a1 = CRC32_TABLE)[(int) ((l & 0xFF) ^ (long) (bits1 & 0xFF))]; l = (l >> 8L) ^ a1[(int) ((l & 0xFF) ^ (long) ((bits1 & 0xff00) >> 8))]; l = (l >> 8L) ^ a1[(int) ((l & 0xFF) ^ (long) ((bits1 & 0xff0000) >> 16))]; l = (l >> 8L) ^ a1[(int) ((l & 0xFF) ^ (long) (bits2 & 0xFF))]; l = (l >> 8L) ^ a1[(int) ((l & 0xFF) ^ (long) ((bits2 & 0xff00) >> 8))]; crc = (l >> 8L) ^ a1[(int) ((l & 0xFF) ^ (long) ((bits2 & 0xff0000) >> 16))]; } public void prefinalizeCrc() { crc ^= 0xFFFFFFFFL; } public void finalizeCrc() { crc >>= 1; } public long getCrc() { return crc; } public void doSpecial() { crc |= 0x80000000L; } /** * Return the calculated checksum. * Erase it for next calls to add_bits(). */ public long checksum() { long sum = crc; crc = 0xFFFFFFFFL; sum ^= 0xFFFFFFFFL; sum >>= 1; return sum; } } jmac-1.74/core/src/davaguine/jmac/tools/File.java0000644000175000017500000001014310131230057021562 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.tools; import java.io.DataInput; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public abstract class File implements DataInput { public static File createFile(final String name, final String mode) throws IOException { URL url = null; try { url = new URL(name); return new InputStreamFile(url); } catch (MalformedURLException e) { return new RandomAccessFile(new java.io.File(name), mode); } } public abstract void mark(int readlimit) throws IOException; public abstract void reset() throws IOException; public abstract int read() throws IOException; public short readShortBack() throws IOException { return (short) (read() | (read() << 8)); } public int readIntBack() throws IOException { return read() | (read() << 8) | (read() << 16) | (read() << 24); } public long readLongBack() throws IOException { return read() | (read() << 8) | (read() << 16) | (read() << 24) | (read() << 32) | (read() << 40) | (read() << 48) | (read() << 56); } public abstract int read(byte[] b) throws IOException; public abstract int read(byte[] b, int offs, int len) throws IOException; public abstract void readFully(byte[] b) throws IOException; public abstract void readFully(byte[] b, int offs, int len) throws IOException; public abstract void close() throws IOException; public abstract boolean readBoolean() throws IOException; public abstract byte readByte() throws IOException; public abstract char readChar() throws IOException; public abstract double readDouble() throws IOException; public abstract float readFloat() throws IOException; public abstract int readInt() throws IOException; public abstract String readLine() throws IOException; public abstract long readLong() throws IOException; public abstract short readShort() throws IOException; public abstract int readUnsignedByte() throws IOException; public abstract int readUnsignedShort() throws IOException; public abstract String readUTF() throws IOException; public abstract int skipBytes(int n) throws IOException; public abstract long length() throws IOException; public abstract void seek(long pos) throws IOException; public abstract long getFilePointer() throws IOException; public abstract void setLength(long newLength) throws IOException; public void write(byte[] b) throws IOException { write(b, 0, b.length); } public abstract void write(byte[] b, int off, int len) throws IOException; public abstract boolean isLocal(); public abstract String getFilename(); public String getExtension() { final String filename = getFilename(); int index = filename.lastIndexOf('.'); return index >= 0 ? filename.substring(index) : ""; } } jmac-1.74/core/src/davaguine/jmac/tools/Globals.java0000644000175000017500000000346310131230057022275 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.tools; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class Globals { private static final boolean SHOW_ACCESS_CONTROL_EXCEPTIONS = false; private static final String PROPERTY_PREFIX = "jmac."; public final static int MAC_VERSION_NUMBER = 3990; public final static boolean DEBUG = getBooleanProperty("DEBUG"); public final static boolean NATIVE = getBooleanProperty("NATIVE"); private static boolean getBooleanProperty(String strName) { String strPropertyName = PROPERTY_PREFIX + strName; String strValue = "false"; try { strValue = System.getProperty(strPropertyName, "false"); } catch (Exception e) { if (SHOW_ACCESS_CONTROL_EXCEPTIONS) e.printStackTrace(); } return strValue.toLowerCase().equals("true"); } } jmac-1.74/core/src/davaguine/jmac/tools/InputStreamFile.java0000644000175000017500000001212310131230057023756 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.tools; import java.io.BufferedInputStream; import java.io.DataInputStream; import java.io.IOException; import java.io.InputStream; import java.net.URL; /** * Author: Dmitry Vaguine * Date: 12.03.2004 * Time: 13:35:13 */ public class InputStreamFile extends File { private DataInputStream stream = null; private String name = null; public InputStreamFile(final URL url) throws IOException { this(url.openStream(), url.getPath()); } public InputStreamFile(final InputStream stream) { this(stream, null); } public InputStreamFile(final InputStream stream, final String name) { this.stream = new DataInputStream(new BufferedInputStream(stream)); this.name = name; } public void mark(int readlimit) throws IOException { stream.mark(readlimit); } public void reset() throws IOException { stream.reset(); } public int read() throws IOException { return stream.read(); } public void readFully(byte[] b) throws IOException { stream.readFully(b); } public void readFully(byte[] b, int offs, int len) throws IOException { stream.readFully(b, offs, len); } public int read(byte[] b) throws IOException { return stream.read(b); } public int read(byte[] b, int offs, int len) throws IOException { return stream.read(b, offs, len); } public void close() throws IOException { stream.close(); } public boolean readBoolean() throws IOException { return stream.readBoolean(); } public byte readByte() throws IOException { return stream.readByte(); } public char readChar() throws IOException { return stream.readChar(); } public double readDouble() throws IOException { return stream.readDouble(); } public float readFloat() throws IOException { return stream.readFloat(); } public int readInt() throws IOException { return stream.readInt(); } public String readLine() throws IOException { StringBuffer input = new StringBuffer(); int c = -1; boolean eol = false; while (!eol) { switch (c = read()) { case -1: case '\n': eol = true; break; case '\r': eol = true; mark(1); if ((read()) != '\n') reset(); break; default: input.append((char) c); break; } } if ((c == -1) && (input.length() == 0)) return null; return input.toString(); } public long readLong() throws IOException { return stream.readLong(); } public short readShort() throws IOException { return stream.readShort(); } public int readUnsignedByte() throws IOException { return stream.readUnsignedByte(); } public int readUnsignedShort() throws IOException { return stream.readUnsignedShort(); } public String readUTF() throws IOException { return stream.readUTF(); } public int skipBytes(int n) throws IOException { return stream.skipBytes(n); } public long length() throws IOException { throw new JMACException("Unsupported Method"); } public void seek(long pos) throws IOException { throw new JMACException("Unsupported Method"); } public long getFilePointer() throws IOException { throw new JMACException("Unsupported Method"); } public void setLength(long newLength) throws IOException { throw new JMACException("Unsupported Method"); } public void write(byte[] b, int off, int len) throws IOException { throw new JMACException("Unsupported Method"); } public boolean isLocal() { return stream == null; } public String getFilename() { return name; } } jmac-1.74/core/src/davaguine/jmac/tools/IntegerPointer.java0000644000175000017500000000211310131230057023637 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.tools; /** * Author: Dmitry Vaguine * Date: 02.05.2004 * Time: 12:42:14 */ public class IntegerPointer { public int value; } jmac-1.74/core/src/davaguine/jmac/tools/JMACException.java0000644000175000017500000000333010131230057023274 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.tools; import java.io.PrintStream; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class JMACException extends RuntimeException { private Throwable exception; public JMACException() { } public JMACException(String msg) { super(msg); } public JMACException(String msg, Throwable t) { super(msg); exception = t; } public Throwable getException() { return exception; } public void printStackTrace() { printStackTrace(System.err); } public void printStackTrace(PrintStream ps) { if (this.exception == null) { super.printStackTrace(ps); } else { exception.printStackTrace(); } } } jmac-1.74/core/src/davaguine/jmac/tools/JMACSkippedException.java0000644000175000017500000000222510131230057024616 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.tools; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class JMACSkippedException extends Exception { public JMACSkippedException() { super("Skipped"); } } jmac-1.74/core/src/davaguine/jmac/tools/JMACStoppedByUserException.java0000644000175000017500000000225110131230057025766 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.tools; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class JMACStoppedByUserException extends Exception { public JMACStoppedByUserException() { super("Stopped By User"); } } jmac-1.74/core/src/davaguine/jmac/tools/MD5.java0000644000175000017500000003450410131230057021277 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.tools; /** * Contains internal state of the MD5 class */ class MD5State { /** * 128-byte state */ int state[]; /** * 64-bit character count (could be true Java long?) */ int count[]; /** * 64-byte buffer (512 bits) for storing to-be-hashed characters */ byte buffer[]; public MD5State() { buffer = new byte[64]; count = new int[2]; state = new int[4]; state[0] = 0x67452301; state[1] = 0xefcdab89; state[2] = 0x98badcfe; state[3] = 0x10325476; count[0] = count[1] = 0; } /** * Create this State as a copy of another state */ public MD5State(MD5State from) { this(); int i; for (i = 0; i < buffer.length; i++) this.buffer[i] = from.buffer[i]; for (i = 0; i < state.length; i++) this.state[i] = from.state[i]; for (i = 0; i < count.length; i++) this.count[i] = from.count[i]; } } ; /** * Implementation of RSA's MD5 hash generator */ public class MD5 { /** * MD5 state */ MD5State state; /** * If Final() has been called, finals is set to the current finals * state. Any Update() causes this to be set to null. */ MD5State finals; /** * Padding for Final() */ static byte padding[] = { (byte) 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; /** * Initialize MD5 internal state (object can be reused just by * calling Init() after every Final() */ public synchronized void Init() { state = new MD5State(); finals = null; } /** * Class constructor */ public MD5() { this.Init(); } /** * Initialize class, and update hash with ob.toString() * * @param ob Object, ob.toString() is used to update hash * after initialization */ public MD5(Object ob) { this(); Update(ob.toString()); } public String debugDump() { return asHex(); } private int rotate_left(int x, int n) { return (x << n) | (x >>> (32 - n)); } /* I wonder how many loops and hoops you'll have to go through to get unsigned add for longs in java */ private int uadd(int a, int b) { long aa, bb; aa = ((long) a) & 0xffffffffL; bb = ((long) b) & 0xffffffffL; aa += bb; return (int) (aa & 0xffffffffL); } private int uadd(int a, int b, int c) { return uadd(uadd(a, b), c); } private int uadd(int a, int b, int c, int d) { return uadd(uadd(a, b, c), d); } private int FF(int a, int b, int c, int d, int x, int s, int ac) { a = uadd(a, ((b & c) | (~b & d)), x, ac); return uadd(rotate_left(a, s), b); } private int GG(int a, int b, int c, int d, int x, int s, int ac) { a = uadd(a, ((b & d) | (c & ~d)), x, ac); return uadd(rotate_left(a, s), b); } private int HH(int a, int b, int c, int d, int x, int s, int ac) { a = uadd(a, (b ^ c ^ d), x, ac); return uadd(rotate_left(a, s), b); } private int II(int a, int b, int c, int d, int x, int s, int ac) { a = uadd(a, (c ^ (b | ~d)), x, ac); return uadd(rotate_left(a, s), b); } private int[] Decode(byte buffer[], int len, int shift) { int out[]; int i, j; out = new int[16]; for (i = j = 0; j < len; i++, j += 4) { out[i] = ((int) (buffer[j + shift] & 0xff)) | (((int) (buffer[j + 1 + shift] & 0xff)) << 8) | (((int) (buffer[j + 2 + shift] & 0xff)) << 16) | (((int) (buffer[j + 3 + shift] & 0xff)) << 24); } return out; } private void Transform(MD5State state, byte buffer[], int shift) { int a = state.state[0], b = state.state[1], c = state.state[2], d = state.state[3], x[]; x = Decode(buffer, 64, shift); /* Round 1 */ a = FF(a, b, c, d, x[0], 7, 0xd76aa478); /* 1 */ d = FF(d, a, b, c, x[1], 12, 0xe8c7b756); /* 2 */ c = FF(c, d, a, b, x[2], 17, 0x242070db); /* 3 */ b = FF(b, c, d, a, x[3], 22, 0xc1bdceee); /* 4 */ a = FF(a, b, c, d, x[4], 7, 0xf57c0faf); /* 5 */ d = FF(d, a, b, c, x[5], 12, 0x4787c62a); /* 6 */ c = FF(c, d, a, b, x[6], 17, 0xa8304613); /* 7 */ b = FF(b, c, d, a, x[7], 22, 0xfd469501); /* 8 */ a = FF(a, b, c, d, x[8], 7, 0x698098d8); /* 9 */ d = FF(d, a, b, c, x[9], 12, 0x8b44f7af); /* 10 */ c = FF(c, d, a, b, x[10], 17, 0xffff5bb1); /* 11 */ b = FF(b, c, d, a, x[11], 22, 0x895cd7be); /* 12 */ a = FF(a, b, c, d, x[12], 7, 0x6b901122); /* 13 */ d = FF(d, a, b, c, x[13], 12, 0xfd987193); /* 14 */ c = FF(c, d, a, b, x[14], 17, 0xa679438e); /* 15 */ b = FF(b, c, d, a, x[15], 22, 0x49b40821); /* 16 */ /* Round 2 */ a = GG(a, b, c, d, x[1], 5, 0xf61e2562); /* 17 */ d = GG(d, a, b, c, x[6], 9, 0xc040b340); /* 18 */ c = GG(c, d, a, b, x[11], 14, 0x265e5a51); /* 19 */ b = GG(b, c, d, a, x[0], 20, 0xe9b6c7aa); /* 20 */ a = GG(a, b, c, d, x[5], 5, 0xd62f105d); /* 21 */ d = GG(d, a, b, c, x[10], 9, 0x2441453); /* 22 */ c = GG(c, d, a, b, x[15], 14, 0xd8a1e681); /* 23 */ b = GG(b, c, d, a, x[4], 20, 0xe7d3fbc8); /* 24 */ a = GG(a, b, c, d, x[9], 5, 0x21e1cde6); /* 25 */ d = GG(d, a, b, c, x[14], 9, 0xc33707d6); /* 26 */ c = GG(c, d, a, b, x[3], 14, 0xf4d50d87); /* 27 */ b = GG(b, c, d, a, x[8], 20, 0x455a14ed); /* 28 */ a = GG(a, b, c, d, x[13], 5, 0xa9e3e905); /* 29 */ d = GG(d, a, b, c, x[2], 9, 0xfcefa3f8); /* 30 */ c = GG(c, d, a, b, x[7], 14, 0x676f02d9); /* 31 */ b = GG(b, c, d, a, x[12], 20, 0x8d2a4c8a); /* 32 */ /* Round 3 */ a = HH(a, b, c, d, x[5], 4, 0xfffa3942); /* 33 */ d = HH(d, a, b, c, x[8], 11, 0x8771f681); /* 34 */ c = HH(c, d, a, b, x[11], 16, 0x6d9d6122); /* 35 */ b = HH(b, c, d, a, x[14], 23, 0xfde5380c); /* 36 */ a = HH(a, b, c, d, x[1], 4, 0xa4beea44); /* 37 */ d = HH(d, a, b, c, x[4], 11, 0x4bdecfa9); /* 38 */ c = HH(c, d, a, b, x[7], 16, 0xf6bb4b60); /* 39 */ b = HH(b, c, d, a, x[10], 23, 0xbebfbc70); /* 40 */ a = HH(a, b, c, d, x[13], 4, 0x289b7ec6); /* 41 */ d = HH(d, a, b, c, x[0], 11, 0xeaa127fa); /* 42 */ c = HH(c, d, a, b, x[3], 16, 0xd4ef3085); /* 43 */ b = HH(b, c, d, a, x[6], 23, 0x4881d05); /* 44 */ a = HH(a, b, c, d, x[9], 4, 0xd9d4d039); /* 45 */ d = HH(d, a, b, c, x[12], 11, 0xe6db99e5); /* 46 */ c = HH(c, d, a, b, x[15], 16, 0x1fa27cf8); /* 47 */ b = HH(b, c, d, a, x[2], 23, 0xc4ac5665); /* 48 */ /* Round 4 */ a = II(a, b, c, d, x[0], 6, 0xf4292244); /* 49 */ d = II(d, a, b, c, x[7], 10, 0x432aff97); /* 50 */ c = II(c, d, a, b, x[14], 15, 0xab9423a7); /* 51 */ b = II(b, c, d, a, x[5], 21, 0xfc93a039); /* 52 */ a = II(a, b, c, d, x[12], 6, 0x655b59c3); /* 53 */ d = II(d, a, b, c, x[3], 10, 0x8f0ccc92); /* 54 */ c = II(c, d, a, b, x[10], 15, 0xffeff47d); /* 55 */ b = II(b, c, d, a, x[1], 21, 0x85845dd1); /* 56 */ a = II(a, b, c, d, x[8], 6, 0x6fa87e4f); /* 57 */ d = II(d, a, b, c, x[15], 10, 0xfe2ce6e0); /* 58 */ c = II(c, d, a, b, x[6], 15, 0xa3014314); /* 59 */ b = II(b, c, d, a, x[13], 21, 0x4e0811a1); /* 60 */ a = II(a, b, c, d, x[4], 6, 0xf7537e82); /* 61 */ d = II(d, a, b, c, x[11], 10, 0xbd3af235); /* 62 */ c = II(c, d, a, b, x[2], 15, 0x2ad7d2bb); /* 63 */ b = II(b, c, d, a, x[9], 21, 0xeb86d391); /* 64 */ state.state[0] += a; state.state[1] += b; state.state[2] += c; state.state[3] += d; } /** * Updates hash with the bytebuffer given (using at maximum length bytes from * that buffer) * * @param stat Which state is updated * @param buffer Array of bytes to be hashed * @param offset Offset to buffer array * @param length Use at maximum `length' bytes (absolute * maximum is buffer.length) */ public void Update(MD5State stat, byte buffer[], int offset, int length) { int index, partlen, i, start; finals = null; /* Length can be told to be shorter, but not inter */ if ((length - offset) > buffer.length) length = buffer.length - offset; /* compute number of bytes mod 64 */ index = (int) (stat.count[0] >>> 3) & 0x3f; if ((stat.count[0] += (length << 3)) < (length << 3)) stat.count[1]++; stat.count[1] += length >>> 29; partlen = 64 - index; if (length >= partlen) { for (i = 0; i < partlen; i++) stat.buffer[i + index] = buffer[i + offset]; Transform(stat, stat.buffer, 0); for (i = partlen; (i + 63) < length; i += 64) Transform(stat, buffer, i); index = 0; } else i = 0; /* buffer remaining input */ if (i < length) { start = i; for (; i < length; i++) stat.buffer[index + i - start] = buffer[i + offset]; } } /* * Update()s for other datatypes than byte[] also. Update(byte[], int) * is only the main driver. */ /** * Plain update, updates this object */ public void Update(byte buffer[], int offset, int length) { Update(this.state, buffer, offset, length); } public void Update(byte buffer[], int length) { Update(this.state, buffer, 0, length); } /** * Updates hash with given array of bytes * * @param buffer Array of bytes to use for updating the hash */ public void Update(byte buffer[]) { Update(buffer, 0, buffer.length); } /** * Updates hash with a single byte * * @param b Single byte to update the hash */ public void Update(byte b) { byte buffer[] = new byte[1]; buffer[0] = b; Update(buffer, 1); } /** * Update buffer with given string. * * @param s String to be update to hash (is used as * s.getBytes()) */ public void Update(String s) { byte chars[]; chars = s.getBytes(); Update(chars, chars.length); } private byte[] Encode(int input[], int len) { int i, j; byte out[]; out = new byte[len]; for (i = j = 0; j < len; i++, j += 4) { out[j] = (byte) (input[i] & 0xff); out[j + 1] = (byte) ((input[i] >>> 8) & 0xff); out[j + 2] = (byte) ((input[i] >>> 16) & 0xff); out[j + 3] = (byte) ((input[i] >>> 24) & 0xff); } return out; } /** * Returns array of bytes (16 bytes) representing hash as of the * current state of this object. Note: getting a hash does not * invalidate the hash object, it only creates a copy of the real * state which is finalized. * * @return Array of 16 bytes, the hash of all updated bytes */ public synchronized byte[] Final() { byte bits[]; int index, padlen; MD5State fin; if (finals == null) { fin = new MD5State(state); bits = Encode(fin.count, 8); index = (int) ((fin.count[0] >>> 3) & 0x3f); padlen = (index < 56) ? (56 - index) : (120 - index); Update(fin, padding, 0, padlen); /**/ Update(fin, bits, 0, 8); /* Update() sets finalds to null */ finals = fin; } return Encode(finals.state, 16); } /** * Turns array of bytes into string representing each byte as * unsigned hex number. * * @param hash Array of bytes to convert to hex-string * @return Generated hex string */ public static String asHex(byte hash[]) { StringBuffer buf = new StringBuffer(hash.length * 2); int i; for (i = 0; i < hash.length; i++) { if (((int) hash[i] & 0xff) < 0x10) buf.append("0"); buf.append(Long.toString((int) hash[i] & 0xff, 16)); } return buf.toString(); } /** * Returns 32-character hex representation of this objects hash * * @return String of this object's hash */ public String asHex() { return asHex(this.Final()); } /** * One-stop md5 string encrypting. */ public static String md5crypt(String input) { MD5 md5 = new MD5(); md5.Init(); md5.Update(input); return md5.asHex(); } } jmac-1.74/core/src/davaguine/jmac/tools/Prepare.java0000644000175000017500000003505310131230057022310 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.tools; import davaguine.jmac.info.SpecialFrame; import davaguine.jmac.info.WaveFormat; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class Prepare { public void prepare(ByteArrayReader pRawData, int nBytes, final WaveFormat pWaveFormatEx, int[] pOutputX, int[] pOutputY, Crc32 pCRC, IntegerPointer pSpecialCodes, IntegerPointer pPeakLevel) { // initialize the pointers that got passed in pCRC.init(); pSpecialCodes.value = 0; // variables int nTotalBlocks = nBytes / pWaveFormatEx.nBlockAlign; int R, L; // the prepare code if (pWaveFormatEx.wBitsPerSample == 8) { if (pWaveFormatEx.nChannels == 2) { for (int nBlockIndex = 0; nBlockIndex < nTotalBlocks; nBlockIndex++) { short b1 = pRawData.readUnsignedByte(); short b2 = pRawData.readUnsignedByte(); R = b1 - 128; L = b2 - 128; pCRC.append((byte) b1); pCRC.append((byte) b2); // check the peak if (Math.abs(L) > pPeakLevel.value) pPeakLevel.value = Math.abs(L); if (Math.abs(R) > pPeakLevel.value) pPeakLevel.value = Math.abs(R); // convert to x,y pOutputY[nBlockIndex] = L - R; pOutputX[nBlockIndex] = R + (pOutputY[nBlockIndex] / 2); } } else if (pWaveFormatEx.nChannels == 1) { for (int nBlockIndex = 0; nBlockIndex < nTotalBlocks; nBlockIndex++) { short b1 = pRawData.readUnsignedByte(); R = b1 - 128; pCRC.append((byte) b1); // check the peak if (Math.abs(R) > pPeakLevel.value) pPeakLevel.value = Math.abs(R); // convert to x,y pOutputX[nBlockIndex] = R; } } } else if (pWaveFormatEx.wBitsPerSample == 24) { if (pWaveFormatEx.nChannels == 2) { for (int nBlockIndex = 0; nBlockIndex < nTotalBlocks; nBlockIndex++) { long nTemp = 0; short b = pRawData.readUnsignedByte(); nTemp |= (b << 0); pCRC.append((byte) b); b = pRawData.readUnsignedByte(); nTemp |= (b << 8); pCRC.append((byte) b); b = pRawData.readUnsignedByte(); nTemp |= (b << 16); pCRC.append((byte) b); if ((nTemp & 0x800000) > 0) R = (int) (nTemp & 0x7fffff) - 0x800000; else R = (int) (nTemp & 0x7fffff); nTemp = 0; b = pRawData.readUnsignedByte(); nTemp |= (b << 0); pCRC.append((byte) b); b = pRawData.readUnsignedByte(); nTemp |= (b << 8); pCRC.append((byte) b); b = pRawData.readUnsignedByte(); nTemp |= (b << 16); pCRC.append((byte) b); if ((nTemp & 0x800000) > 0) L = (int) (nTemp & 0x7fffff) - 0x800000; else L = (int) (nTemp & 0x7fffff); // check the peak if (Math.abs(L) > pPeakLevel.value) pPeakLevel.value = Math.abs(L); if (Math.abs(R) > pPeakLevel.value) pPeakLevel.value = Math.abs(R); // convert to x,y pOutputY[nBlockIndex] = L - R; pOutputX[nBlockIndex] = R + (pOutputY[nBlockIndex] / 2); } } else if (pWaveFormatEx.nChannels == 1) { for (int nBlockIndex = 0; nBlockIndex < nTotalBlocks; nBlockIndex++) { long nTemp = 0; short b = pRawData.readUnsignedByte(); nTemp |= (b << 0); pCRC.append((byte) b); b = pRawData.readUnsignedByte(); nTemp |= (b << 8); pCRC.append((byte) b); b = pRawData.readUnsignedByte(); nTemp |= (b << 16); pCRC.append((byte) b); if ((nTemp & 0x800000) > 0) R = (int) (nTemp & 0x7fffff) - 0x800000; else R = (int) (nTemp & 0x7fffff); // check the peak if (Math.abs(R) > pPeakLevel.value) pPeakLevel.value = Math.abs(R); // convert to x,y pOutputX[nBlockIndex] = R; } } } else { if (pWaveFormatEx.nChannels == 2) { int LPeak = 0; int RPeak = 0; int nBlockIndex = 0; for (nBlockIndex = 0; nBlockIndex < nTotalBlocks; nBlockIndex++) { R = pRawData.readShort(); pCRC.append((short) R); L = pRawData.readShort(); pCRC.append((short) L); // check the peak if (Math.abs(L) > LPeak) LPeak = Math.abs(L); if (Math.abs(R) > RPeak) RPeak = Math.abs(R); // convert to x,y pOutputY[nBlockIndex] = L - R; pOutputX[nBlockIndex] = R + (pOutputY[nBlockIndex] / 2); } if (LPeak == 0) pSpecialCodes.value |= SpecialFrame.SPECIAL_FRAME_LEFT_SILENCE; if (RPeak == 0) pSpecialCodes.value |= SpecialFrame.SPECIAL_FRAME_RIGHT_SILENCE; if (Math.max(LPeak, RPeak) > pPeakLevel.value) pPeakLevel.value = Math.max(LPeak, RPeak); // check for pseudo-stereo files nBlockIndex = 0; while (pOutputY[nBlockIndex++] == 0) { if (nBlockIndex == (nBytes / 4)) { pSpecialCodes.value |= SpecialFrame.SPECIAL_FRAME_PSEUDO_STEREO; break; } } } else if (pWaveFormatEx.nChannels == 1) { int nPeak = 0; for (int nBlockIndex = 0; nBlockIndex < nTotalBlocks; nBlockIndex++) { R = pRawData.readUnsignedShort(); pCRC.append((short) R); // check the peak if (Math.abs(R) > nPeak) nPeak = Math.abs(R); //convert to x,y pOutputX[nBlockIndex] = R; } if (nPeak > pPeakLevel.value) pPeakLevel.value = nPeak; if (nPeak == 0) pSpecialCodes.value |= SpecialFrame.SPECIAL_FRAME_MONO_SILENCE; } } pCRC.prefinalizeCrc(); // add the special code pCRC.finalizeCrc(); if (pSpecialCodes.value != 0) pCRC.doSpecial(); } public void unprepare(int X, int Y, final WaveFormat waveFormat, final ByteBuffer output, final Crc32 crc) { // decompress and convert from (x,y) -> (l,r) // sort of long and ugly.... sorry int channels = waveFormat.nChannels; int bitsPerSample = waveFormat.wBitsPerSample; if (channels == 2) { if (bitsPerSample == 16) { // get the right and left values short nR = (short) (X - (Y / 2)); short nL = (short) (nR + Y); output.append(nR, nL); crc.append(nR, nL); } else if (bitsPerSample == 8) { byte R = (byte) (X - (Y / 2) + 128); byte L = (byte) (R + Y); output.append(R, L); crc.append(R, L); } else if (bitsPerSample == 24) { int RV = X - (Y / 2); int LV = RV + Y; if (RV < 0) RV = (RV + 0x800000) | 0x800000; if (LV < 0) LV = (LV + 0x800000) | 0x800000; output.append24(RV, LV); crc.append24(RV, LV); } } else if (channels == 1) { if (bitsPerSample == 16) { output.append((short) X); crc.append((short) X); } else if (bitsPerSample == 8) { byte R = (byte) (X + 128); output.append(R); crc.append(R); } else if (bitsPerSample == 24) { if (X < 0) X = (X + 0x800000) | 0x800000; output.append24(X); crc.append24(X); } } } public void unprepareOld(int[] pInputX, int[] pInputY, int nBlocks, WaveFormat pWaveFormatEx, ByteBuffer output, Crc32 crc, int nFileVersion) { //the CRC that will be figured during decompression crc.init(); //decompress and convert from (x,y) -> (l,r) //sort of int and ugly.... sorry int channels = pWaveFormatEx.nChannels; int bitsPerSample = pWaveFormatEx.wBitsPerSample; if (channels == 2) { //convert the x,y data to raw data if (bitsPerSample == 16) { short R; int pX = 0; int pY = 0; for (; pX < nBlocks; pX++, pY++) { R = (short) (pInputX[pX] - (pInputY[pY] / 2)); output.append(R); crc.append(R); R += pInputY[pY]; output.append(R); crc.append(R); } } else if (bitsPerSample == 8) { byte R; if (nFileVersion > 3830) { for (int SampleIndex = 0; SampleIndex < nBlocks; SampleIndex++) { R = (byte) (pInputX[SampleIndex] - (pInputY[SampleIndex] / 2) + 128); output.append(R); crc.append(R); R += pInputY[SampleIndex]; output.append(R); crc.append(R); } } else { for (int SampleIndex = 0; SampleIndex < nBlocks; SampleIndex++) { R = (byte) (pInputX[SampleIndex] - (pInputY[SampleIndex] / 2)); output.append(R); crc.append(R); R += pInputY[SampleIndex]; output.append(R); crc.append(R); } } } else if (bitsPerSample == 24) { int RV, LV; for (int SampleIndex = 0; SampleIndex < nBlocks; SampleIndex++) { RV = pInputX[SampleIndex] - (pInputY[SampleIndex] / 2); LV = RV + pInputY[SampleIndex]; int nTemp = 0; if (RV < 0) nTemp = (RV + 0x800000) | 0x800000; else nTemp = RV; output.append24(nTemp); crc.append24(nTemp); nTemp = 0; if (LV < 0) nTemp = (LV + 0x800000) | 0x800000; else nTemp = LV; output.append24(nTemp); crc.append24(nTemp); } } } else if (channels == 1) { //convert to raw data if (bitsPerSample == 8) { byte R; if (nFileVersion > 3830) { for (int SampleIndex = 0; SampleIndex < nBlocks; SampleIndex++) { R = (byte) (pInputX[SampleIndex] + 128); output.append(R); crc.append(R); } } else { for (int SampleIndex = 0; SampleIndex < nBlocks; SampleIndex++) { R = (byte) (pInputX[SampleIndex]); output.append(R); crc.append(R); } } } else if (bitsPerSample == 24) { int RV; for (int SampleIndex = 0; SampleIndex < nBlocks; SampleIndex++) { RV = pInputX[SampleIndex]; int nTemp = 0; if (RV < 0) nTemp = (RV + 0x800000) | 0x800000; else nTemp = RV; output.append24(nTemp); crc.append24(nTemp); } } else { short R; for (int SampleIndex = 0; SampleIndex < nBlocks; SampleIndex++) { R = (short) (pInputX[SampleIndex]); output.append(R); crc.append(R); } } } crc.prefinalizeCrc(); } } jmac-1.74/core/src/davaguine/jmac/tools/ProgressCallback.java0000644000175000017500000000235410131230057024131 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.tools; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public abstract class ProgressCallback { public int pPercentageDone; public boolean killFlag = false; public abstract void callback(int persent); public void updateStatus(String msg) { } } jmac-1.74/core/src/davaguine/jmac/tools/ProgressHelper.java0000644000175000017500000000561610131230057023660 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.tools; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class ProgressHelper { public ProgressHelper(int nTotalSteps, ProgressCallback ProgressCallback) { m_CallbackFunction = ProgressCallback; m_nTotalSteps = nTotalSteps; m_nCurrentStep = 0; m_nLastCallbackFiredPercentageDone = 0; UpdateProgress(0); } public void UpdateStatus(String msg) { m_CallbackFunction.updateStatus(msg); } public void UpdateProgress() { UpdateProgress(-1, false); } public void UpdateProgress(int nCurrentStep) { UpdateProgress(nCurrentStep, false); } public void UpdateProgress(int nCurrentStep, boolean bForceUpdate) { //update the step if (nCurrentStep == -1) m_nCurrentStep++; else m_nCurrentStep = nCurrentStep; //figure the percentage done float fPercentageDone = ((float) (m_nCurrentStep)) / ((float) (Math.max(m_nTotalSteps, 1))); int nPercentageDone = (int) (fPercentageDone * 1000 * 100); if (nPercentageDone > 100000) nPercentageDone = 100000; //fire the callback if (m_CallbackFunction != null) { m_CallbackFunction.pPercentageDone = nPercentageDone; if (bForceUpdate || (nPercentageDone - m_nLastCallbackFiredPercentageDone) >= 1000) { m_CallbackFunction.callback(nPercentageDone); m_nLastCallbackFiredPercentageDone = nPercentageDone; } } } public void UpdateProgressComplete() { UpdateProgress(m_nTotalSteps, true); } public boolean isKillFlag() { return m_CallbackFunction != null ? m_CallbackFunction.killFlag : false; } private ProgressCallback m_CallbackFunction = null; private int m_nTotalSteps; private int m_nCurrentStep; private int m_nLastCallbackFiredPercentageDone; } jmac-1.74/core/src/davaguine/jmac/tools/RandomAccessFile.java0000644000175000017500000001123410131230057024047 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.tools; import java.io.FileNotFoundException; import java.io.IOException; /** * Author: Dmitry Vaguine * Date: 12.03.2004 * Time: 13:35:13 */ public class RandomAccessFile extends File { private java.io.RandomAccessFile file = null; private java.io.File f = null; private long markPosition = -1; public RandomAccessFile(final java.io.File file, final String mode) throws FileNotFoundException { this.f = file; this.file = new java.io.RandomAccessFile(file, mode); } public void mark(int readlimit) throws IOException { markPosition = file.getFilePointer(); } public void reset() throws IOException { if (markPosition >= 0) file.seek(markPosition); } public int read() throws IOException { return file.read(); } public short readShortBack() throws IOException { return (short) (read() | (read() << 8)); } public int readIntBack() throws IOException { return read() | (read() << 8) | (read() << 16) | (read() << 24); } public long readLongBack() throws IOException { return read() | (read() << 8) | (read() << 16) | (read() << 24) | (read() << 32) | (read() << 40) | (read() << 48) | (read() << 56); } public int read(byte[] b) throws IOException { return file.read(b); } public int read(byte[] b, int offs, int len) throws IOException { return file.read(b, offs, len); } public void readFully(byte[] b) throws IOException { file.readFully(b); } public void readFully(byte[] b, int offs, int len) throws IOException { file.readFully(b, offs, len); } public void close() throws IOException { file.close(); } public boolean readBoolean() throws IOException { return file.readBoolean(); } public byte readByte() throws IOException { return file.readByte(); } public char readChar() throws IOException { return file.readChar(); } public double readDouble() throws IOException { return file.readDouble(); } public float readFloat() throws IOException { return file.readFloat(); } public int readInt() throws IOException { return file.readInt(); } public String readLine() throws IOException { return file.readLine(); } public long readLong() throws IOException { return file.readLong(); } public short readShort() throws IOException { return file.readShort(); } public int readUnsignedByte() throws IOException { return file.readUnsignedByte(); } public int readUnsignedShort() throws IOException { return file.readUnsignedShort(); } public String readUTF() throws IOException { return file.readUTF(); } public int skipBytes(int n) throws IOException { return file.skipBytes(n); } public long length() throws IOException { return file.length(); } public void seek(long pos) throws IOException { file.seek(pos); } public long getFilePointer() throws IOException { return file.getFilePointer(); } public void setLength(long newLength) throws IOException { file.setLength(newLength); } public void write(byte[] b, int off, int len) throws IOException { file.write(b, off, len); } public boolean isLocal() { return true; } public String getFilename() { return f.getName(); } } jmac-1.74/core/src/davaguine/jmac/tools/RollBufferFastInt.java0000644000175000017500000000373410131230057024246 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.tools; import java.util.Arrays; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class RollBufferFastInt { public RollBufferFastInt(int nWindowElements, int nHistoryElements) { m_pData = new int[nWindowElements + nHistoryElements]; m_nWindowElements = nWindowElements; m_nHistoryElements = nHistoryElements; windowPlusHistory = nWindowElements + nHistoryElements; Flush(); } public void Flush() { Arrays.fill(m_pData, 0, m_nHistoryElements, 0); index = m_nHistoryElements; } public void Roll() { int ai[]; int i; System.arraycopy(ai = m_pData, index - (i = m_nHistoryElements), ai, 0, i); index = i; } public void IncrementSafe() { if ((++index) == windowPlusHistory) Roll(); } public int[] m_pData; public int index; protected int m_nHistoryElements; protected int m_nWindowElements; protected int windowPlusHistory; } jmac-1.74/core/src/davaguine/jmac/tools/RollBufferShort.java0000644000175000017500000000403110131230057023764 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.tools; import java.util.Arrays; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class RollBufferShort { public RollBufferShort() { m_pData = null; } public int Create(int nWindowElements, int nHistoryElements) { m_nWindowElements = nWindowElements; m_nHistoryElements = nHistoryElements; windowPlusHistory = nWindowElements += nHistoryElements; m_pData = new short[nWindowElements]; Flush(); return 0; } public void Flush() { Arrays.fill(m_pData, 0, m_nHistoryElements, (short) 0); index = m_nHistoryElements; } public void IncrementSafe() { if ((++index) == windowPlusHistory) { short aword0[]; int i; System.arraycopy(aword0 = m_pData, index - (i = m_nHistoryElements), aword0, 0, i); index = i; } } public short[] m_pData; public int index; protected int m_nHistoryElements; protected int m_nWindowElements; protected int windowPlusHistory; } jmac-1.74/core/src/davaguine/jmac/tools/ScaledFirstOrderFilter.java0000644000175000017500000000323610131230057025255 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.tools; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class ScaledFirstOrderFilter { public ScaledFirstOrderFilter(int multiply, int shift) { this.multiply = multiply; this.shift = shift; } public void Flush() { m_nLastValue = 0; } public int Compress(int nInput) { int nRetVal = nInput - ((m_nLastValue * multiply) >> shift); m_nLastValue = nInput; return nRetVal; } public int Decompress(int nInput) { m_nLastValue = nInput + ((m_nLastValue * multiply) >> shift); return m_nLastValue; } protected int m_nLastValue; protected int multiply; protected int shift; } jmac-1.74/gpl.txt0000644000175000017500000004365510131230056013644 0ustar twernertwerner GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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 Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. jmac-1.74/readme.txt0000644000175000017500000000664410451131400014312 0ustar twernertwernerJMAC ===================================================== version 1.74, June 30, 2006 Description ----------- JMAC is a Java implementation of the Monkey's Audio decoder/JavaSound SPI. To know more about Monkey's Audio please, visit this site: http://www.monkeysaudio.com It allows playing/compressing/converting APE, MAC and APL files up to version 3.99. The main distributables is: 1. jmac.jar - full version (encoder and decoder). 2. jmacdecoder.jar - includes decoder only. 3. jmacplayer.jar - decoder + simple player. 4. jmacspi.jar - Java Sound SPI (1.3). 5. jmacspi15.jar - Java Sound SPI (1.5). 6. jmactritonusspi.jar - Tritonus (http://www.tritonus.org) based Java Sound SPI. Thanks to Tritonus. This SPI should be used together with tritonus_share.jar distributed in lib subdirectory. 7. jmac.dll - JNI wrapper around of original MAC library (Windows version). 8. libjmac.so - JNI wrapper around of original MAC library (linux version). This is a non-commercial project and anyone can add his contribution. JMAC is distributed under the terms of the FSF Gnu Public License (see gpl.txt). Instructions ------------ Unzip to installation directory. Required lib are distributed in the "distributables" directory. The required for Tritonus based SPI (jmactritonusspi.jar) library "tritonus_share.jar" library are distributed in the "lib" subdirectory. Web Site: http://jmac.sourceforge.net/ FAQ : ------------ - How to test the JMAC quickly? Please, look the bin directory for examples. - How to use the JMAC? Please, look the davaguine.jmac.test package sources for working examples. Also, you can use jmac.jar as simple APE utility. Just enter the following command line: "java -jar jmac.jar" and read usage help to know how to use it. - How to install JMAC SPI? Before running JMAC SPI you should set PATH and CLASSPATH for JAVA and you should add jmacspi.jar to the CLASSPATH. If you want to use Tritonus based SPI you should use jmactritonusspi.jar instead of jmacspi.jar and additionally add tritonus_share.jar to the CLASSPATH. - How to enable the native mode of JMAC? You should set the jmac.NATIVE property to true value into system properties of JVM. Please, look the playNative.bat file for example. Also, you should be sure that the JVM can find the jmac.dll. So, this dll should be placed into work directory of application or the directory with this dll should be pointed in java.library.path system property. - Do I need JMF to run JMAC player? No, JMF is not required. You just need a JVM JavaSound 1.0 compliant. (i.e. JVM1.3 or higher). However, JMAC is not JMF compliant. - Does JMAC support streaming? Yes. - How much CPU JMAC needs to run? Here are our benchmark notes: Insane - bigger than 100% under AMD Athlon 1700Mhz/Win2000+J2SE 1.4.2 (Hotspot). Extra High compression - about 50% under AMD Athlon 1700Mhz/Win2000+J2SE 1.4.2 (Hotspot). High compression - about 20% under AMD Athlon 1700Mhz/Win2000+J2SE 1.4.2 (Hotspot). Normal and Fast compression - less than 5% under AMD Athlon 1700Mhz/Win2000+J2SE 1.4.2 (Hotspot). NOTE: In Native mode less than %25 for all types of compression under AMD Athlon 1700Mhz/Win2000+J2SE 1.4.2 (Hotspot). - How to contact JMAC developers? Please, visit project web page - http://jmac.sourceforge.net or you can email directly to davagin@mail.ru. jmac-1.74/spi/0000755000175000017500000000000010451144775013120 5ustar twernertwernerjmac-1.74/spi/src/0000755000175000017500000000000010451144641013677 5ustar twernertwernerjmac-1.74/spi/src/davaguine/0000755000175000017500000000000010451144641015642 5ustar twernertwernerjmac-1.74/spi/src/davaguine/jmac/0000755000175000017500000000000010451144641016554 5ustar twernertwernerjmac-1.74/spi/src/davaguine/jmac/spi/0000755000175000017500000000000010451144641017347 5ustar twernertwernerjmac-1.74/spi/src/davaguine/jmac/spi/APEAudioFileFormat.java0000644000175000017500000000406010341320532023543 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.spi; import javax.sound.sampled.AudioFileFormat; import javax.sound.sampled.AudioFormat; /** * Author: Dmitry Vaguine * Date: 12.03.2004 * Time: 13:35:13 */ // TODO: Better seek support, properties for all SPI's /** * An instance of the APEAudioFileFormat class describes MAC audio file, including the file type, * the file's length in bytes, the length in sample frames of the audio data contained in the file, * and the format of the audio data. */ public class APEAudioFileFormat extends AudioFileFormat { /** * Constructs an audio file format object for MAC audio format. * * @param type - the type of the audio file * @param byteLength - the length of the file in bytes, or AudioSystem.NOT_SPECIFIED * @param format - the format of the audio data contained in the file * @param frameLength - the audio data length in sample frames, or AudioSystem.NOT_SPECIFIED */ public APEAudioFileFormat(AudioFileFormat.Type type, int byteLength, AudioFormat format, int frameLength) { super(type, byteLength, format, frameLength); } } jmac-1.74/spi/src/davaguine/jmac/spi/APEAudioFileFormatType.java0000644000175000017500000000371510131501027024410 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.spi; import javax.sound.sampled.AudioFileFormat; /** * Author: Dmitry Vaguine * Date: 12.03.2004 * Time: 13:35:13 */ /** * An instance of the APEAudioFileFormatType class represents one of the standard types of * MAC audio file. Static instances are provided for the common types */ public class APEAudioFileFormatType extends AudioFileFormat.Type { /** * Specifies a APE file. */ public static final APEAudioFileFormatType APE = new APEAudioFileFormatType("Monkey's Audio (ape)", "ape"); /** * Specifies a MAC file. */ public static final APEAudioFileFormatType MAC = new APEAudioFileFormatType("Monkey's Audio (mac)", "mac"); /** * Constructs a MAC file type. * * @param name - the string that names the file type * @param extension - the string that commonly marks the file type without leading dot. */ public APEAudioFileFormatType(final String name, final String extension) { super(name, extension); } } jmac-1.74/spi/src/davaguine/jmac/spi/APEAudioFileReader.java0000644000175000017500000002045610334150315023526 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.spi; import davaguine.jmac.decoder.IAPEDecompress; import davaguine.jmac.tools.Globals; import davaguine.jmac.tools.InputStreamFile; import davaguine.jmac.tools.JMACException; import javax.sound.sampled.AudioFileFormat; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.UnsupportedAudioFileException; import javax.sound.sampled.spi.AudioFileReader; import java.io.*; import java.net.URL; /** * Author: Dmitry Vaguine * Date: 12.03.2004 * Time: 13:35:13 */ /** * Provider for MAC audio file reading. */ public class APEAudioFileReader extends AudioFileReader { private final static int MAX_HEADER_SIZE = 16384; /** * Obtains the audio file format of the File provided. The File must point to valid audio file data. * * @param file - the File from which file format information should be extracted * @return an APEAudioFileFormat object describing the MAC audio file format * @throws UnsupportedAudioFileException - if the File does not point to valid MAC audio file * @throws IOException - if an I/O exception occurs */ public AudioFileFormat getAudioFileFormat(File file) throws UnsupportedAudioFileException, IOException { if (Globals.DEBUG) System.out.println("APEAudioFileReader.getAudioFileFormat( File )"); IAPEDecompress decoder; try { decoder = IAPEDecompress.CreateIAPEDecompress(new davaguine.jmac.tools.RandomAccessFile(file, "r")); } catch (JMACException e) { throw new UnsupportedAudioFileException("Unsupported audio file"); } catch (EOFException e) { throw new UnsupportedAudioFileException("Unsupported audio file"); } APEAudioFormat format = new APEAudioFormat(APEEncoding.APE, decoder.getApeInfoSampleRate(), decoder.getApeInfoBitsPerSample(), decoder.getApeInfoChannels(), AudioSystem.NOT_SPECIFIED, AudioSystem.NOT_SPECIFIED, false); return new APEAudioFileFormat(APEAudioFileFormatType.APE, (int) file.length(), format, AudioSystem.NOT_SPECIFIED); } /** * Obtains an audio input stream from the URL provided. The URL must point to valid MAC audio file data. * * @param url - the URL from which file format information should be extracted * @return an APEAudioFileFormat object describing the MAC audio file format * @throws UnsupportedAudioFileException - if the URL does not point to valid MAC audio file * @throws IOException - if an I/O exception occurs */ public AudioFileFormat getAudioFileFormat(URL url) throws UnsupportedAudioFileException, IOException { InputStream inputStream = url.openStream(); try { return getAudioFileFormat(inputStream); } finally { inputStream.close(); } } /** * Obtains the audio file format of the input stream provided. The stream must point to valid MAC audio file data. * * @param stream - the input stream from which file format information should be extracted * @return an APEAudioFileFormat object describing the MAC audio file format * @throws UnsupportedAudioFileException - if the stream does not point to valid MAC audio file * @throws IOException - if an I/O exception occurs */ public AudioFileFormat getAudioFileFormat(InputStream stream) throws UnsupportedAudioFileException, IOException { if (Globals.DEBUG) System.out.println("APEAudioFileReader.getAudioFileFormat( InputStream )"); IAPEDecompress decoder; try { decoder = IAPEDecompress.CreateIAPEDecompress(new InputStreamFile(stream)); } catch (JMACException e) { throw new UnsupportedAudioFileException("Unsupported audio file"); } catch (EOFException e) { throw new UnsupportedAudioFileException("Unsupported audio file"); } APEAudioFormat format = new APEAudioFormat(APEEncoding.APE, decoder.getApeInfoSampleRate(), decoder.getApeInfoBitsPerSample(), decoder.getApeInfoChannels(), AudioSystem.NOT_SPECIFIED, AudioSystem.NOT_SPECIFIED, false); return new APEAudioFileFormat(APEAudioFileFormatType.APE, AudioSystem.NOT_SPECIFIED, format, AudioSystem.NOT_SPECIFIED); } /** * Obtains an audio input stream from the input stream provided. The stream must point to valid MAC audio file data. * * @param stream - the input stream from which the AudioInputStream should be constructed * @return an AudioInputStream object based on the audio file data contained in the input stream. * @throws UnsupportedAudioFileException - if the stream does not point to valid MAC audio file data recognized by the system * @throws IOException - if an I/O exception occurs */ public AudioInputStream getAudioInputStream(InputStream stream) throws UnsupportedAudioFileException, IOException { // Save byte header since this method must return the stream opened at byte 0. final BufferedInputStream in = new BufferedInputStream(stream); in.mark(MAX_HEADER_SIZE); final AudioFileFormat format = getAudioFileFormat(in); in.reset(); return new AudioInputStream(in, format.getFormat(), format.getFrameLength()); } /** * Obtains an audio input stream from the File provided. The File must point to valid MAC audio file data. * * @param file - the File for which the AudioInputStream should be constructed * @return an AudioInputStream object based on the audio file data contained in the input stream. * @throws UnsupportedAudioFileException - if the file does not point to valid MAC audio file data recognized by the system * @throws IOException - if an I/O exception occurs */ public AudioInputStream getAudioInputStream(File file) throws UnsupportedAudioFileException, IOException { InputStream inputStream = new FileInputStream(file); try { return getAudioInputStream(inputStream); } catch (UnsupportedAudioFileException e) { inputStream.close(); throw e; } catch (IOException e) { inputStream.close(); throw e; } } /** * Obtains the audio file format of the URL provided. The URL must point to valid MAC audio file data. * * @param url - the URL for which the AudioInputStream should be constructed * @return an AudioInputStream object based on the audio file data contained in the input stream. * @throws UnsupportedAudioFileException - if the URL does not point to valid MAC audio file data recognized by the system * @throws IOException - if an I/O exception occurs */ public AudioInputStream getAudioInputStream(URL url) throws UnsupportedAudioFileException, IOException { InputStream inputStream = url.openStream(); try { return getAudioInputStream(inputStream); } catch (UnsupportedAudioFileException e) { inputStream.close(); throw e; } catch (IOException e) { inputStream.close(); throw e; } } } jmac-1.74/spi/src/davaguine/jmac/spi/APEAudioFormat.java0000644000175000017500000000431510131501027022743 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.spi; import javax.sound.sampled.AudioFormat; /** * Author: Dmitry Vaguine * Date: 31.03.2004 * Time: 19:09:05 */ /** * APE audio format parameters. */ public class APEAudioFormat extends AudioFormat { /** * Constructs an APEAudioFormat with the given parameters. The encoding specifies the * convention used to represent the data. The other parameters are further explained * in the class description. * * @param encoding - the audio encoding technique * @param sampleRate - the number of samples per second * @param sampleSizeInBits - the number of bits in each sample * @param channels - the number of channels (1 for mono, 2 for stereo, and so on) * @param frameSize - the number of bytes in each frame * @param frameRate - the number of frames per second * @param bigEndian - indicates whether the data for a single sample is stored in big-endian byte order (false means little-endian) */ public APEAudioFormat(Encoding encoding, float sampleRate, int sampleSizeInBits, int channels, int frameSize, float frameRate, boolean bigEndian) { super(encoding, sampleRate, sampleSizeInBits, channels, frameSize, frameRate, bigEndian); } } jmac-1.74/spi/src/davaguine/jmac/spi/APEAudioInputStream.java0000644000175000017500000002010610131501027023762 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.spi; import davaguine.jmac.decoder.IAPEDecompress; import davaguine.jmac.tools.File; import davaguine.jmac.tools.InputStreamFile; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; import java.io.IOException; import java.io.InputStream; /** * Author: Dmitry Vaguine * Date: 12.03.2004 * Time: 13:35:13 */ /** * Decoded APE audio input stream. */ public class APEAudioInputStream extends AudioInputStream { private final static int BLOCKS_PER_DECODE = 9216; private IAPEDecompress m_decoder = null; private File file = null; private byte[] buffer = null; private int nBlocksLeft; private int blockAlign; private int pos = 0; private int size = 0; /** * Constructs an audio input stream that has the requested format, using audio data * from the specified input stream. * * @param format - the format of this stream's audio data * @param stream - the stream on which this APEAudioInputStream object is based */ public APEAudioInputStream(AudioFormat format, InputStream stream) { super(stream, format, AudioSystem.NOT_SPECIFIED); try { file = new InputStreamFile(stream); m_decoder = IAPEDecompress.CreateIAPEDecompress(file); nBlocksLeft = m_decoder.getApeInfoDecompressTotalBlocks(); blockAlign = m_decoder.getApeInfoBlockAlign(); // allocate space for decompression buffer = new byte[blockAlign * BLOCKS_PER_DECODE]; } catch (IOException e) { e.printStackTrace(); } } private void ensureOpen() throws IOException { if (m_decoder == null) throw new IOException("Stream closed"); } private void fill() throws IOException { pos = 0; if (nBlocksLeft > 0) { int nBlocksDecoded = m_decoder.GetData(buffer, BLOCKS_PER_DECODE); nBlocksLeft -= nBlocksDecoded; size = nBlocksDecoded * blockAlign; } else size = 0; } /** * Reads the next byte of data from the audio input stream. * * @return the next byte of data, or -1 if the end of the stream is reached * @throws IOException - if an input or output error occurs */ public synchronized int read() throws IOException { ensureOpen(); if (pos < size) return buffer[pos++] & 0xff; else { fill(); return pos < size ? (buffer[pos++] & 0xff) : -1; } } /** * Reads up to a specified maximum number of bytes of data from the audio stream, putting * them into the given byte array. * * @param b - the buffer into which the data is read * @param off - the offset, from the beginning of array b, at which the data will be written * @param len - the maximum number of bytes to read * @return the total number of bytes read into the buffer, or -1 if there is no more data because the end of the stream has been reached * @throws IOException if an input or output error occurs */ public synchronized int read(byte[] b, int off, int len) throws IOException { ensureOpen(); if (b == null) { throw new NullPointerException(); } else if ((off < 0) || (off > b.length) || (len < 0) || ((off + len) > b.length) || ((off + len) < 0)) { throw new IndexOutOfBoundsException(); } if (pos >= size) fill(); if (pos >= size) return -1; if (pos + len < size) { System.arraycopy(buffer, pos, b, off, len); pos += len; return len; } int avail = size - pos; System.arraycopy(buffer, pos, b, off, avail); fill(); if (pos >= size) return avail; if (pos + len - avail < size) { System.arraycopy(buffer, pos, b, off + avail, len - avail); pos += (len - avail); return len; } len = size - pos; System.arraycopy(buffer, pos, b, off + avail, len); pos += len; return len + avail; } /** * Skips over and discards a specified number of bytes from this audio input stream. * * @param n - the requested number of bytes to be skipped * @return the actual number of bytes skipped * @throws IOException - if an input or output error occurs */ public synchronized long skip(long n) throws IOException { ensureOpen(); if (n <= 0) { return 0; } if (pos >= size) fill(); if (pos >= size) return 0; if (pos + n < size) { pos += n; return n; } int avail = size - pos; fill(); if (pos >= size) return avail; if (pos + n - avail < size) { pos += (n - avail); return n; } n = size - pos; pos += n; return n + avail; } /** * Returns the maximum number of bytes that can be read (or skipped over) from this * audio input stream without blocking. This limit applies only to the next invocation * of a read or skip method for this audio input stream; the limit can vary each time * these methods are invoked. Depending on the underlying stream,an IOException may be * thrown if this stream is closed. * * @return the number of bytes that can be read from this audio input stream without blocking * @throws IOException - if an input or output error occurs */ public int available() throws IOException { ensureOpen(); return size - pos; } /** * Tests whether this audio input stream supports the mark and reset methods. * This method always returns false. * * @return returns false. */ public boolean markSupported() { return false; } /** * Marks the current position in this audio input stream. This method does nothing. * * @param readlimit - the maximum number of bytes that can be read before the mark position becomes invalid. */ public void mark(int readlimit) { } /** * Repositions this audio input stream to the position it had at the time its mark method was last invoked. * This method always throws IOException since this stream doesn't support mark feature. * * @throws IOException - if an input or output error occurs. */ public void reset() throws IOException { throw new IOException("mark not supported"); } /** * Closes this audio input stream and releases any system resources associated with the stream. * * @throws IOException - if an input or output error occurs */ public void close() throws IOException { if (file == null) return; file.close(); file = null; m_decoder = null; buffer = null; } } jmac-1.74/spi/src/davaguine/jmac/spi/APEEncoding.java0000644000175000017500000000300110131501027022246 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.spi; import javax.sound.sampled.AudioFormat; /** * Author: Dmitry Vaguine * Date: 12.03.2004 * Time: 13:35:13 */ /** * The encoding of MAC audio. */ public class APEEncoding extends AudioFormat.Encoding { /** * Static instance of APE Encoding. */ public static final AudioFormat.Encoding APE = new APEEncoding("APE"); /** * Constructs a new APEEncoding * * @param encodingName - the name of the new type of encoding */ public APEEncoding(String encodingName) { super(encodingName); } } jmac-1.74/spi/src/davaguine/jmac/spi/APEFormatConversionProvider.java0000644000175000017500000003633210131501027025546 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.spi; import davaguine.jmac.tools.Globals; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.spi.FormatConversionProvider; import java.io.PrintStream; import java.util.Hashtable; import java.util.Iterator; import java.util.Map; import java.util.Vector; /** * Author: Dmitry Vaguine * Date: 12.03.2004 * Time: 13:35:13 */ /** * A format conversion provider for APE audio file format. */ public class APEFormatConversionProvider extends FormatConversionProvider { /** * Source formats of provider. */ protected static final AudioFormat[] SOURCE_FORMATS = { // encoding, rate, bits, channels, frameSize, frameRate, big endian new AudioFormat(APEEncoding.APE, AudioSystem.NOT_SPECIFIED, 8, 1, AudioSystem.NOT_SPECIFIED, AudioSystem.NOT_SPECIFIED, false), new AudioFormat(APEEncoding.APE, AudioSystem.NOT_SPECIFIED, 8, 2, AudioSystem.NOT_SPECIFIED, AudioSystem.NOT_SPECIFIED, false), new AudioFormat(APEEncoding.APE, AudioSystem.NOT_SPECIFIED, 16, 1, AudioSystem.NOT_SPECIFIED, AudioSystem.NOT_SPECIFIED, false), new AudioFormat(APEEncoding.APE, AudioSystem.NOT_SPECIFIED, 16, 2, AudioSystem.NOT_SPECIFIED, AudioSystem.NOT_SPECIFIED, false), new AudioFormat(APEEncoding.APE, AudioSystem.NOT_SPECIFIED, 24, 1, AudioSystem.NOT_SPECIFIED, AudioSystem.NOT_SPECIFIED, false), new AudioFormat(APEEncoding.APE, AudioSystem.NOT_SPECIFIED, 24, 2, AudioSystem.NOT_SPECIFIED, AudioSystem.NOT_SPECIFIED, false)}; /** * Source encodings of provider. */ protected static AudioFormat.Encoding[] SOURCE_ENCODINGS; /** * Target formats of provider. */ protected static final AudioFormat[] TARGET_FORMATS = { // rate, bits, channels, signed, big endian new AudioFormat(AudioSystem.NOT_SPECIFIED, 8, 1, true, false), new AudioFormat(AudioSystem.NOT_SPECIFIED, 8, 2, true, false), new AudioFormat(AudioSystem.NOT_SPECIFIED, 16, 1, true, false), new AudioFormat(AudioSystem.NOT_SPECIFIED, 16, 2, true, false), new AudioFormat(AudioSystem.NOT_SPECIFIED, 24, 1, true, false), new AudioFormat(AudioSystem.NOT_SPECIFIED, 24, 2, true, false)}; /** * Target encodings of provider. */ protected static AudioFormat.Encoding[] TARGET_ENCODINGS; /** * An internal field used to map from source AudioFormats to target AudioFormat.Encodings. */ protected Hashtable sourceFormatTargetEncodings; // HashTable: key=source format, value=AudioFormat.Encoding [] of unique target encodings /** * An internal field used to map from source AudioFormats to target AudioFormats. */ protected Hashtable sourceFormatTargetFormats; // HashTable: key=target format, value=hashtable: key=encoding, value=Vector of unique target formats /** * Constructor of conversion provider. */ public APEFormatConversionProvider() { // Create sets of encodings from formats. SOURCE_ENCODINGS = createEncodings(SOURCE_FORMATS); TARGET_ENCODINGS = createEncodings(TARGET_FORMATS); createConversions(SOURCE_FORMATS, TARGET_FORMATS); } // constructor /** * This helper method creates encodings from the list of AudioFormats. * * @param sourceFormats - the source formats * @param targetFormats - the target formats */ protected void createConversions(AudioFormat[] sourceFormats, AudioFormat[] targetFormats) { sourceFormatTargetEncodings = new Hashtable(); sourceFormatTargetFormats = new Hashtable(); for (int i = 0; i < sourceFormats.length; i++) { AudioFormat sourceFormat = sourceFormats[i]; Vector supportedTargetEncodings = new Vector(); Hashtable targetEncodingTargetFormats = new Hashtable(); sourceFormatTargetFormats.put(sourceFormat, targetEncodingTargetFormats); for (int j = 0; j < targetFormats.length; j++) { AudioFormat targetFormat = targetFormats[j]; // Simplistic: Assume conversion possible if sampling rate and channels match. // Depends on what streams can be decoded by the APE subsystem. boolean conversionPossible = (sourceFormat.getSampleRate() == targetFormat.getSampleRate()) && (sourceFormat.getChannels() == targetFormat.getChannels()) && (sourceFormat.getSampleSizeInBits() == targetFormat.getSampleSizeInBits()); if (conversionPossible) { AudioFormat.Encoding targetEncoding = targetFormat.getEncoding(); if (!supportedTargetEncodings.contains(targetEncoding)) supportedTargetEncodings.addElement(targetEncoding); // Will be converted to an AudioFormat [] when queried Vector supportedTargetFormats = (Vector) targetEncodingTargetFormats.get(targetEncoding); if (supportedTargetFormats == null) { supportedTargetFormats = new Vector(); targetEncodingTargetFormats.put(targetEncoding, supportedTargetFormats); } supportedTargetFormats.add(targetFormat); } } // Convert supported target encodings from vector to [] AudioFormat.Encoding[] targetEncodings = new AudioFormat.Encoding[supportedTargetEncodings.size()]; supportedTargetEncodings.copyInto(targetEncodings); sourceFormatTargetEncodings.put(sourceFormat, targetEncodings); } } // createConversions /** * Returns the source AudioFormat.Encodings that this class can read from. * * @return the source AudioFormat.Encodings */ public AudioFormat.Encoding[] getSourceEncodings() { return SOURCE_ENCODINGS; } /** * Returns the target AudioFormat.Encodings that this class can convert to. * * @return the target AudioFormat.Encodings */ public AudioFormat.Encoding[] getTargetEncodings() { return TARGET_ENCODINGS; } /** * Returns the target AudioFormat.Encodings that this class can convert to from the given format. * * @param sourceFormat is the source format * @return the target AudioFormat.Encodings */ public AudioFormat.Encoding[] getTargetEncodings(AudioFormat sourceFormat) { if (Globals.DEBUG) System.out.println("APEFormatConversionProvider.getTargetEncodings( sourceFormat )"); if (Globals.DEBUG) System.out.println(" sourceFormat=" + sourceFormat); // Must use iteration since Hashtable contains and get uses equals // and AudioFormat does not implement this and finalizes it. Iterator iterator = sourceFormatTargetEncodings.entrySet().iterator(); while (iterator.hasNext()) { Map.Entry entry = (Map.Entry) iterator.next(); AudioFormat format = (AudioFormat) entry.getKey(); if (format.matches(sourceFormat)) { AudioFormat.Encoding[] targetEncodings = (AudioFormat.Encoding[]) entry.getValue(); if (Globals.DEBUG) System.out.println(" targetEncodings:"); if (Globals.DEBUG) printAudioEncodings(targetEncodings, System.out); return targetEncodings; } // if } return new AudioFormat.Encoding[0]; } /** * Returns the target AudioFormat.Encodings that this class can convert to * from the given format and encoding. * * @param targetEncoding - the target encoding * @param sourceFormat - the source format * @return the target AudioFormat.Encodings */ public AudioFormat[] getTargetFormats(AudioFormat.Encoding targetEncoding, AudioFormat sourceFormat) { if (Globals.DEBUG) System.out.println("APEFormatConversionProvider.getTargetFormats( sourceFormat )"); if (Globals.DEBUG) System.out.println(" sourceFormat=" + sourceFormat); // Must use iteration since Hashtable contains and get uses equals // and AudioFormat does not implement this and finalizes it. Iterator iterator = sourceFormatTargetFormats.entrySet().iterator(); while (iterator.hasNext()) { Map.Entry entry = (Map.Entry) iterator.next(); AudioFormat format = (AudioFormat) entry.getKey(); if (sourceFormat.matches(format)) { Hashtable targetEncodings = (Hashtable) entry.getValue(); Vector targetFormats = (Vector) targetEncodings.get(targetEncoding); AudioFormat[] targetFormatArray = new AudioFormat[targetFormats.size()]; AudioFormat ft; for (int i = 0; i < targetFormats.size(); i++) { ft = (AudioFormat) targetFormats.get(i); targetFormatArray[i] = new AudioFormat(ft.getEncoding(), sourceFormat.getSampleRate(), ft.getSampleSizeInBits(), ft.getChannels(), ft.getFrameSize(), ft.getFrameRate(), ft.isBigEndian()); } if (Globals.DEBUG) System.out.println(" targetFormats"); if (Globals.DEBUG) printAudioFormats(targetFormatArray, System.out); return targetFormatArray; } } // while return new AudioFormat[0]; } /** * Returns a decoded AudioInputStream in the given target AudioFormat.Encoding. * * @param targetEncoding is the target encoding * @param audioInputStream is the source input stream * @return a decoded AudioInputStream */ public AudioInputStream getAudioInputStream(AudioFormat.Encoding targetEncoding, AudioInputStream audioInputStream) { AudioFormat sourceFormat = audioInputStream.getFormat(); AudioFormat targetFormat = new AudioFormat(targetEncoding, sourceFormat.getSampleRate(), sourceFormat.getSampleSizeInBits(), sourceFormat.getChannels(), sourceFormat.getFrameSize(), sourceFormat.getFrameRate(), sourceFormat.isBigEndian()); return getAudioInputStream(targetFormat, audioInputStream); } /** * Returns a decoded AudioInputStream in the given target AudioFormat. * * @param targetFormat is the target format * @param audioInputStream is the source input stream * @return a decoded AudioInputStream */ public AudioInputStream getAudioInputStream(AudioFormat targetFormat, AudioInputStream audioInputStream) { if (isConversionSupported(targetFormat, audioInputStream.getFormat())) { if (Globals.DEBUG) System.out.println("APEFormatConversionProvider.getAudioInputStream( targetEnc, audioInputStream )"); return new APEAudioInputStream(targetFormat, audioInputStream); } throw new IllegalArgumentException("conversion not supported"); } /** * Returns whether the given source AudioFormat.Encoding is supported. * * @param sourceEncoding is the source encoding * @return true if the given source AudioFormat.Encoding is supported */ public boolean isSourceEncodingSupported(AudioFormat.Encoding sourceEncoding) { return containsEncoding(SOURCE_ENCODINGS, sourceEncoding); } /** * Returns whether the given target AudioFormat.Encoding is supported. * * @param targetEncoding is the target encoding * @return true if the given target AudioFormat.Encoding is supported */ public boolean isTargetEncodingSupported(AudioFormat.Encoding targetEncoding) { return containsEncoding(TARGET_ENCODINGS, targetEncoding); } /** * Creates the array of encodings for given array of target formats * * @param formats is the array of target formats * @return the array of encodings for given array of target formats */ protected static AudioFormat.Encoding[] createEncodings(AudioFormat[] formats) { if ((formats == null) || (formats.length == 0)) return new AudioFormat.Encoding[0]; Vector encodings = new Vector(); for (int i = 0; i < formats.length; i++) { AudioFormat.Encoding encoding = formats[i].getEncoding(); if (!encodings.contains(encoding)) encodings.addElement(encoding); } AudioFormat.Encoding[] encodingArray = new AudioFormat.Encoding[encodings.size()]; encodings.copyInto(encodingArray); return encodingArray; } /** * This method determines is the given array of encodings contains the specified encoding * * @param encodings is an array of encodings * @param encoding is a specified encoding * @return true if the given array of encodings contains the specified encoding */ public static boolean containsEncoding(AudioFormat.Encoding[] encodings, AudioFormat.Encoding encoding) { if ((encodings == null) || (encoding == null)) return false; for (int i = 0; i < encodings.length; i++) { if (encodings[i].equals(encoding)) return true; } return false; } /** * Prints the array of audio formats to the given PrintStream * * @param audioFormats is a given array og audio formats * @param stream is a given PrintStream */ public static void printAudioFormats(AudioFormat[] audioFormats, PrintStream stream) { for (int i = 0; i < audioFormats.length; i++) stream.println(" " + audioFormats[i]); } /** * Prints the array of audio encodings to the given PrintStream * * @param audioEncodings is a given array of audio encodings * @param stream is a given PrintStream */ public static void printAudioEncodings(AudioFormat.Encoding[] audioEncodings, PrintStream stream) { for (int i = 0; i < audioEncodings.length; i++) stream.println(" " + audioEncodings[i]); } } jmac-1.74/spi/src/davaguine/jmac/spi/APEPropertiesHelper.java0000644000175000017500000001411410131501027024023 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.spi; import davaguine.jmac.decoder.IAPEDecompress; import davaguine.jmac.info.APETag; import davaguine.jmac.tools.Globals; import java.io.IOException; import java.util.Calendar; import java.util.Date; import java.util.Map; /** * Author: Dmitry Vaguine * Date: 13.05.2004 * Time: 11:48:13 */ /** * APE properties helper. */ public class APEPropertiesHelper { /** * Reads the properties from APE file and creates two Map's (for audio file format and for audio format). * * @param decoder - decoder from which this method should get the properties. * @param fileProperties - properties Map for audio file format properties * @param formatProperties - properties Map for audio format properties * @throws IOException - in case of IO error occured */ public static void readProperties(IAPEDecompress decoder, Map fileProperties, Map formatProperties) throws IOException { formatProperties.put("bitrate", new Integer(decoder.getApeInfoDecompressAverageBitrate())); formatProperties.put("vbr", new Boolean(true)); formatProperties.put("quality", new Integer(10)); formatProperties.put("ape.version", new Integer(decoder.getApeInfoFileVersion())); formatProperties.put("ape.compressionlevel", new Integer(decoder.getApeInfoCompressionLevel())); formatProperties.put("ape.formatflags", new Integer(decoder.getApeInfoFormatFlags())); formatProperties.put("ape.totalframes", new Integer(decoder.getApeInfoTotalFrames())); formatProperties.put("ape.blocksperframe", new Integer(decoder.getApeInfoBlocksPerFrame())); formatProperties.put("ape.finalframeblocks", new Integer(decoder.getApeInfoFinalFrameBlocks())); formatProperties.put("ape.blockalign", new Integer(decoder.getApeInfoBlockAlign())); formatProperties.put("ape.totalblocks", new Integer(decoder.getApeInfoTotalBlocks())); formatProperties.put("ape.peaklevel", new Integer(decoder.getApeInfoPeakLevel())); fileProperties.put("duration", new Long(decoder.getApeInfoLengthMs())); if (decoder.getApeInfoIoSource().isLocal()) { APETag tag = decoder.getApeInfoTag(); fileProperties.put("author", tag.GetFieldString(APETag.APE_TAG_FIELD_ARTIST)); fileProperties.put("title", tag.GetFieldString(APETag.APE_TAG_FIELD_TITLE)); fileProperties.put("copyright", tag.GetFieldString(APETag.APE_TAG_FIELD_COPYRIGHT)); String year = tag.GetFieldString(APETag.APE_TAG_FIELD_YEAR); Date date = null; try { Calendar c = Calendar.getInstance(); c.clear(); c.set(Calendar.YEAR, Integer.parseInt(year)); date = c.getTime(); } catch (Exception e) { } fileProperties.put("date", date); fileProperties.put("comment", tag.GetFieldString(APETag.APE_TAG_FIELD_COMMENT)); fileProperties.put("album", tag.GetFieldString(APETag.APE_TAG_FIELD_ALBUM)); fileProperties.put("track", tag.GetFieldString(APETag.APE_TAG_FIELD_TRACK)); fileProperties.put("genre", tag.GetFieldString(APETag.APE_TAG_FIELD_GENRE)); } if (Globals.DEBUG) { System.out.println("File Properties"); System.out.println("duration: " + fileProperties.get("duration")); System.out.println("author: " + fileProperties.get("author")); System.out.println("title: " + fileProperties.get("title")); System.out.println("copyright: " + fileProperties.get("copyright")); System.out.println("date: " + fileProperties.get("date")); System.out.println("comment: " + fileProperties.get("comment")); System.out.println("album: " + fileProperties.get("album")); System.out.println("track: " + fileProperties.get("track")); System.out.println("genre: " + fileProperties.get("genre")); System.out.println("Format Properties"); System.out.println("bitrate: " + formatProperties.get("bitrate")); System.out.println("vbr: " + formatProperties.get("vbr")); System.out.println("quality: " + formatProperties.get("quality")); System.out.println("ape.version: " + formatProperties.get("ape.version")); System.out.println("ape.compressionlevel: " + formatProperties.get("ape.compressionlevel")); System.out.println("ape.formatflags: " + formatProperties.get("ape.formatflags")); System.out.println("ape.totalframes: " + formatProperties.get("ape.totalframes")); System.out.println("ape.blocksperframe: " + formatProperties.get("ape.blocksperframe")); System.out.println("ape.finalframeblocks: " + formatProperties.get("ape.finalframeblocks")); System.out.println("ape.blockalign: " + formatProperties.get("ape.blockalign")); System.out.println("ape.totalblocks: " + formatProperties.get("ape.totalblocks")); System.out.println("ape.peaklevel: " + formatProperties.get("ape.peaklevel")); } } } jmac-1.74/spi/src/davaguine/jmac/spi/jdk15/0000755000175000017500000000000010451144641020265 5ustar twernertwernerjmac-1.74/spi/src/davaguine/jmac/spi/jdk15/APEAudioFileFormat.java0000644000175000017500000000375110131501027024464 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.spi.jdk15; import javax.sound.sampled.AudioFileFormat; import javax.sound.sampled.AudioFormat; import java.util.Map; /** * Author: Dmitry Vaguine * Date: 12.03.2004 * Time: 13:35:13 */ /** * An instance of the APEAudioFileFormat class describes MAC audio file, including the file type, * the file's length in bytes, the length in sample frames of the audio data contained in the file, * and the format of the audio data. */ public class APEAudioFileFormat extends AudioFileFormat { /** * Constructs an audio file format object for MAC audio format. * * @param type - the type of the audio file * @param format - the format of the audio data contained in the file * @param frameLength - the audio data length in sample frames, or AudioSystem.NOT_SPECIFIED * @param properties - file format properties */ public APEAudioFileFormat(Type type, AudioFormat format, int frameLength, Map properties) { super(type, format, frameLength, properties); } } jmac-1.74/spi/src/davaguine/jmac/spi/jdk15/APEAudioFileReader.java0000644000175000017500000002156110334152102024436 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.spi.jdk15; import davaguine.jmac.decoder.IAPEDecompress; import davaguine.jmac.spi.APEAudioFileFormatType; import davaguine.jmac.spi.APEEncoding; import davaguine.jmac.spi.APEPropertiesHelper; import davaguine.jmac.tools.Globals; import davaguine.jmac.tools.InputStreamFile; import davaguine.jmac.tools.JMACException; import javax.sound.sampled.AudioFileFormat; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.UnsupportedAudioFileException; import javax.sound.sampled.spi.AudioFileReader; import java.io.*; import java.net.URL; import java.util.HashMap; import java.util.Map; /** * Author: Dmitry Vaguine * Date: 12.03.2004 * Time: 13:35:13 */ /** * Provider for MAC audio file reading. */ public class APEAudioFileReader extends AudioFileReader { private final static int MAX_HEADER_SIZE = 16384; /** * Obtains the audio file format of the File provided. The File must point to valid audio file data. * * @param file - the File from which file format information should be extracted * @return an APEAudioFileFormat object describing the MAC audio file format * @throws UnsupportedAudioFileException - if the File does not point to valid MAC audio file * @throws IOException - if an I/O exception occurs */ public AudioFileFormat getAudioFileFormat(File file) throws UnsupportedAudioFileException, IOException { if (Globals.DEBUG) System.out.println("APEAudioFileReader.getAudioFileFormat( File )"); IAPEDecompress decoder; try { decoder = IAPEDecompress.CreateIAPEDecompress(new davaguine.jmac.tools.RandomAccessFile(file, "r")); } catch (JMACException e) { throw new UnsupportedAudioFileException("Unsupported audio file"); } catch (EOFException e) { throw new UnsupportedAudioFileException("Unsupported audio file"); } Map fileProperties = new HashMap(); Map formatProperties = new HashMap(); APEPropertiesHelper.readProperties(decoder, fileProperties, formatProperties); APEAudioFormat format = new APEAudioFormat(APEEncoding.APE, decoder.getApeInfoSampleRate(), decoder.getApeInfoBitsPerSample(), decoder.getApeInfoChannels(), AudioSystem.NOT_SPECIFIED, AudioSystem.NOT_SPECIFIED, false, formatProperties); return new APEAudioFileFormat(APEAudioFileFormatType.APE, format, AudioSystem.NOT_SPECIFIED, fileProperties); } /** * Obtains an audio input stream from the URL provided. The URL must point to valid MAC audio file data. * * @param url - the URL from which file format information should be extracted * @return an APEAudioFileFormat object describing the MAC audio file format * @throws UnsupportedAudioFileException - if the URL does not point to valid MAC audio file * @throws IOException - if an I/O exception occurs */ public AudioFileFormat getAudioFileFormat(URL url) throws UnsupportedAudioFileException, IOException { InputStream inputStream = url.openStream(); try { return getAudioFileFormat(inputStream); } finally { inputStream.close(); } } /** * Obtains the audio file format of the input stream provided. The stream must point to valid MAC audio file data. * * @param stream - the input stream from which file format information should be extracted * @return an APEAudioFileFormat object describing the MAC audio file format * @throws UnsupportedAudioFileException - if the stream does not point to valid MAC audio file * @throws IOException - if an I/O exception occurs */ public AudioFileFormat getAudioFileFormat(InputStream stream) throws UnsupportedAudioFileException, IOException { if (Globals.DEBUG) System.out.println("APEAudioFileReader.getAudioFileFormat( InputStream )"); IAPEDecompress decoder; try { decoder = IAPEDecompress.CreateIAPEDecompress(new InputStreamFile(stream)); } catch (JMACException e) { throw new UnsupportedAudioFileException("Unsupported audio file"); } catch (EOFException e) { throw new UnsupportedAudioFileException("Unsupported audio file"); } Map fileProperties = new HashMap(); Map formatProperties = new HashMap(); APEPropertiesHelper.readProperties(decoder, fileProperties, formatProperties); APEAudioFormat format = new APEAudioFormat(APEEncoding.APE, decoder.getApeInfoSampleRate(), decoder.getApeInfoBitsPerSample(), decoder.getApeInfoChannels(), AudioSystem.NOT_SPECIFIED, AudioSystem.NOT_SPECIFIED, false, formatProperties); return new APEAudioFileFormat(APEAudioFileFormatType.APE, format, AudioSystem.NOT_SPECIFIED, fileProperties); } /** * Obtains an audio input stream from the input stream provided. The stream must point to valid MAC audio file data. * * @param stream - the input stream from which the AudioInputStream should be constructed * @return an AudioInputStream object based on the audio file data contained in the input stream. * @throws UnsupportedAudioFileException - if the stream does not point to valid MAC audio file data recognized by the system * @throws IOException - if an I/O exception occurs */ public AudioInputStream getAudioInputStream(InputStream stream) throws UnsupportedAudioFileException, IOException { // Save byte header since this method must return the stream opened at byte 0. final BufferedInputStream in = new BufferedInputStream(stream); in.mark(MAX_HEADER_SIZE); final AudioFileFormat format = getAudioFileFormat(in); in.reset(); return new AudioInputStream(in, format.getFormat(), format.getFrameLength()); } /** * Obtains an audio input stream from the File provided. The File must point to valid MAC audio file data. * * @param file - the File for which the AudioInputStream should be constructed * @return an AudioInputStream object based on the audio file data contained in the input stream. * @throws UnsupportedAudioFileException - if the file does not point to valid MAC audio file data recognized by the system * @throws IOException - if an I/O exception occurs */ public AudioInputStream getAudioInputStream(File file) throws UnsupportedAudioFileException, IOException { InputStream inputStream = new FileInputStream(file); try { return getAudioInputStream(inputStream); } catch (UnsupportedAudioFileException e) { inputStream.close(); throw e; } catch (IOException e) { inputStream.close(); throw e; } } /** * Obtains the audio file format of the URL provided. The URL must point to valid MAC audio file data. * * @param url - the URL for which the AudioInputStream should be constructed * @return an AudioInputStream object based on the audio file data contained in the input stream. * @throws UnsupportedAudioFileException - if the URL does not point to valid MAC audio file data recognized by the system * @throws IOException - if an I/O exception occurs */ public AudioInputStream getAudioInputStream(URL url) throws UnsupportedAudioFileException, IOException { InputStream inputStream = url.openStream(); try { return getAudioInputStream(inputStream); } catch (UnsupportedAudioFileException e) { inputStream.close(); throw e; } catch (IOException e) { inputStream.close(); throw e; } } } jmac-1.74/spi/src/davaguine/jmac/spi/jdk15/APEAudioFormat.java0000644000175000017500000000650210131501027023661 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.spi.jdk15; import javax.sound.sampled.AudioFormat; import java.util.Map; /** * Author: Dmitry Vaguine * Date: 31.03.2004 * Time: 19:09:05 */ /** * APE audio format parameters. * Some parameters might be unavailable. So availability test is required before reading any parameter. *

*
APE parameters. *

    *
  • bitrate [Integer], average bit rate in kilobits per second (Standard Property) *
  • vbr [Boolean], always true, the file is encoded in variable bit rate (VBR) *
  • quality [Integer], always 10, encoding/conversion quality *

    *

  • ape.version [Integer], ape version : 3800, 3970 and etc *
  • ape.compressionlevel [Integer], the compression level : 1000, 2000, 3000, 4000 (fast, normal, high, extrahigh) *
  • ape.formatflags [Integer], format flags *
  • ape.totalframes [Integer], total frames *
  • ape.blocksperframe [Integer], blocks per frame *
  • ape.finalframeblocks [Integer], final frame blocks *
  • ape.blockalign [Integer], block align *
  • ape.totalblocks [Integer], total blocks *
  • ape.peaklevel [Integer], peak level *
*/ public class APEAudioFormat extends AudioFormat { /** * Constructs an APEAudioFormat with the given parameters. The encoding specifies the * convention used to represent the data. The other parameters are further explained * in the class description. * * @param encoding - the audio encoding technique * @param sampleRate - the number of samples per second * @param sampleSizeInBits - the number of bits in each sample * @param channels - the number of channels (1 for mono, 2 for stereo, and so on) * @param frameSize - the number of bytes in each frame * @param frameRate - the number of frames per second * @param bigEndian - indicates whether the data for a single sample is stored in big-endian byte order (false means little-endian) * @param properties - audio properties */ public APEAudioFormat(Encoding encoding, float sampleRate, int sampleSizeInBits, int channels, int frameSize, float frameRate, boolean bigEndian, Map properties) { super(encoding, sampleRate, sampleSizeInBits, channels, frameSize, frameRate, bigEndian, properties); } } jmac-1.74/spi/src/davaguine/jmac/spi/tritonus/0000755000175000017500000000000010451144641021236 5ustar twernertwernerjmac-1.74/spi/src/davaguine/jmac/spi/tritonus/APEAudioFileFormat.java0000644000175000017500000000620610131501027025433 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.spi.tritonus; import org.tritonus.share.sampled.file.TAudioFileFormat; import javax.sound.sampled.AudioFormat; import java.util.Map; /** * Author: Dmitry Vaguine * Date: 12.03.2004 * Time: 13:35:13 */ /** * An instance of the APEAudioFileFormat class describes MAC audio file, including the file type, * the file's length in bytes, the length in sample frames of the audio data contained in the file, * and the format of the audio data. */ public class APEAudioFileFormat extends TAudioFileFormat { /** * Constructs an audio file format object for MAC audio format. * * @param type - the type of the audio file * @param format - the format of the audio data contained in the file * @param byteLength - the length of the file in bytes, or AudioSystem.NOT_SPECIFIED * @param frameLength - the audio data length in sample frames, or AudioSystem.NOT_SPECIFIED * @param properties - the audio file format properties */ public APEAudioFileFormat(Type type, AudioFormat format, int byteLength, int frameLength, Map properties) { super(type, format, byteLength, frameLength, properties); } /** * APE audio file format parameters. * Some parameters might be unavailable. So availability test is required before reading any parameter. *

*
AudioFileFormat parameters. *

    *
  • duration [Long], Duration in microseconds. (standard property) *
  • author [String], Name of the author of the stream. (standard property) *
  • title [String], Title of the stream. (standard property) *
  • copyright [String], Copyright message of the stream. (standard property) *
  • date [Date], The date (year) of the recording or release of the stream. (standard property) *
  • comment [String], Comment of the stream. (standard property) *
  • album [String], Name of the album of the stream. *
  • track [String], The track number of the stream *
  • genre [String], The genre of the stream *
*/ public Map properties() { return super.properties(); } } jmac-1.74/spi/src/davaguine/jmac/spi/tritonus/APEAudioFileReader.java0000644000175000017500000001640510334152147025421 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.spi.tritonus; import davaguine.jmac.decoder.IAPEDecompress; import davaguine.jmac.spi.APEAudioFileFormatType; import davaguine.jmac.spi.APEEncoding; import davaguine.jmac.spi.APEPropertiesHelper; import davaguine.jmac.tools.InputStreamFile; import davaguine.jmac.tools.JMACException; import davaguine.jmac.tools.RandomAccessFile; import org.tritonus.share.sampled.file.TAudioFileReader; import javax.sound.sampled.*; import java.io.*; import java.util.HashMap; import java.util.Map; /** * Author: Dmitry Vaguine * Date: 12.03.2004 * Time: 13:35:13 */ /** * Provider for MAC audio file reading. */ public class APEAudioFileReader extends TAudioFileReader { private final static int MAX_HEADER_SIZE = 16384; private final static int MARK_LIMIT = MAX_HEADER_SIZE + 1; /** * Constructs new instance of reader. */ public APEAudioFileReader() { super(MARK_LIMIT, true); } /** * Obtains the audio file format of the input stream provided. The stream must point to valid MAC audio file data. * * @param stream - the input stream from which file format information should be extracted * @param mediaLength - is the size of audio file * @return an APEAudioFileFormat object describing the MAC audio file format * @throws UnsupportedAudioFileException - if the stream does not point to valid MAC audio file * @throws IOException - if an I/O exception occurs */ public AudioFileFormat getAudioFileFormat(InputStream stream, long mediaLength) throws UnsupportedAudioFileException, IOException { IAPEDecompress decoder; try { decoder = IAPEDecompress.CreateIAPEDecompress(new InputStreamFile(stream)); } catch (JMACException e) { throw new UnsupportedAudioFileException("Unsupported audio file"); } catch (EOFException e) { throw new UnsupportedAudioFileException("Unsupported audio file"); } Map fileProperties = new HashMap(); Map formatProperties = new HashMap(); APEPropertiesHelper.readProperties(decoder, fileProperties, formatProperties); AudioFormat format = new APEAudioFormat(APEEncoding.APE, decoder.getApeInfoSampleRate(), decoder.getApeInfoBitsPerSample(), decoder.getApeInfoChannels(), AudioSystem.NOT_SPECIFIED, AudioSystem.NOT_SPECIFIED, false, formatProperties); return new APEAudioFileFormat(APEAudioFileFormatType.APE, format, AudioSystem.NOT_SPECIFIED, (int) mediaLength, fileProperties); } /** * Obtains the audio file format of the File provided. The File must point to valid audio file data. * * @param file - the File from which file format information should be extracted * @return an APEAudioFileFormat object describing the MAC audio file format * @throws UnsupportedAudioFileException - if the File does not point to valid MAC audio file * @throws IOException - if an I/O exception occurs */ public AudioFileFormat getAudioFileFormat(File file) throws UnsupportedAudioFileException, IOException { IAPEDecompress decoder = null; davaguine.jmac.tools.File io = new RandomAccessFile(file, "r"); try { decoder = IAPEDecompress.CreateIAPEDecompress(io); } catch (JMACException e) { throw new UnsupportedAudioFileException("Unsupported audio file"); } catch (EOFException e) { throw new UnsupportedAudioFileException("Unsupported audio file"); } finally { io.close(); } Map fileProperties = new HashMap(); Map formatProperties = new HashMap(); APEPropertiesHelper.readProperties(decoder, fileProperties, formatProperties); AudioFormat format = new APEAudioFormat(APEEncoding.APE, decoder.getApeInfoSampleRate(), decoder.getApeInfoBitsPerSample(), decoder.getApeInfoChannels(), AudioSystem.NOT_SPECIFIED, AudioSystem.NOT_SPECIFIED, false, formatProperties); return new APEAudioFileFormat(APEAudioFileFormatType.APE, format, AudioSystem.NOT_SPECIFIED, (int) file.length(), fileProperties); } /** * Obtains an audio input stream from the File provided. The File must point to valid MAC audio file data. * * @param file - the File for which the AudioInputStream should be constructed * @return an AudioInputStream object based on the audio file data contained in the input stream. * @throws UnsupportedAudioFileException - if the file does not point to valid MAC audio file data recognized by the system * @throws IOException - if an I/O exception occurs */ public AudioInputStream getAudioInputStream(File file) throws UnsupportedAudioFileException, IOException { InputStream inputStream = new FileInputStream(file); AudioInputStream audioInputStream; try { AudioFileFormat audioFileFormat = getAudioFileFormat(file); inputStream = new BufferedInputStream(inputStream, MARK_LIMIT); audioInputStream = new AudioInputStream(inputStream, audioFileFormat.getFormat(), audioFileFormat.getFrameLength()); } catch (UnsupportedAudioFileException e) { inputStream.close(); throw e; } catch (IOException e) { inputStream.close(); throw e; } return audioInputStream; } /** * Obtains an audio input stream from the input stream provided. The stream must point to valid MAC audio file data. * * @param stream - the input stream from which the AudioInputStream should be constructed * @return an AudioInputStream object based on the audio file data contained in the input stream. * @throws UnsupportedAudioFileException - if the stream does not point to valid MAC audio file data recognized by the system * @throws IOException - if an I/O exception occurs */ public AudioInputStream getAudioInputStream(InputStream stream) throws UnsupportedAudioFileException, IOException { if (!stream.markSupported()) stream = new BufferedInputStream(stream, MARK_LIMIT); return super.getAudioInputStream(stream); } } jmac-1.74/spi/src/davaguine/jmac/spi/tritonus/APEAudioFormat.java0000644000175000017500000000656710131501027024645 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.spi.tritonus; import org.tritonus.share.sampled.TAudioFormat; import javax.sound.sampled.AudioFormat; import java.util.Map; /** * Author: Dmitry Vaguine * Date: 31.03.2004 * Time: 19:09:05 */ /** * APE audio format parameters. * Some parameters might be unavailable. So availability test is required before reading any parameter. *

*
APE parameters. *

    *
  • bitrate [Integer], average bit rate in kilobits per second (Standard Property) *
  • vbr [Boolean], always true, the file is encoded in variable bit rate (VBR) *
  • quality [Integer], always 10, encoding/conversion quality *

    *

  • ape.version [Integer], ape version : 3800, 3970 and etc *
  • ape.compressionlevel [Integer], the compression level : 1000, 2000, 3000, 4000 (fast, normal, high, extrahigh) *
  • ape.formatflags [Integer], format flags *
  • ape.totalframes [Integer], total frames *
  • ape.blocksperframe [Integer], blocks per frame *
  • ape.finalframeblocks [Integer], final frame blocks *
  • ape.blockalign [Integer], block align *
  • ape.totalblocks [Integer], total blocks *
  • ape.peaklevel [Integer], peak level *
*/ public class APEAudioFormat extends TAudioFormat { /** * Constructs an APEAudioFormat with the given parameters. The encoding specifies the * convention used to represent the data. The other parameters are further explained * in the class description. * * @param encoding - the audio encoding technique * @param sampleRate - the number of samples per second * @param sampleSizeInBits - the number of bits in each sample * @param channels - the number of channels (1 for mono, 2 for stereo, and so on) * @param frameSize - the number of bytes in each frame * @param frameRate - the number of frames per second * @param bigEndian - indicates whether the data for a single sample is stored in big-endian byte order (false means little-endian) * @param properties - audio properties */ public APEAudioFormat(AudioFormat.Encoding encoding, float sampleRate, int sampleSizeInBits, int channels, int frameSize, float frameRate, boolean bigEndian, Map properties) { super(encoding, sampleRate, sampleSizeInBits, channels, frameSize, frameRate, bigEndian, properties); } } jmac-1.74/spi/src/davaguine/jmac/spi/tritonus/APEAudioInputStream.java0000644000175000017500000001317710341301757025676 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.spi.tritonus; import davaguine.jmac.decoder.IAPEDecompress; import davaguine.jmac.tools.File; import davaguine.jmac.tools.InputStreamFile; import org.tritonus.share.TDebug; import org.tritonus.share.TCircularBuffer; import org.tritonus.share.sampled.convert.TAsynchronousFilteredAudioInputStream; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioSystem; import java.io.IOException; import java.io.InputStream; import java.util.HashMap; import java.util.Map; /** * Author: Dmitry Vaguine * Date: 12.03.2004 * Time: 13:35:13 */ /** * Decoded APE audio input stream. */ public class APEAudioInputStream extends TAsynchronousFilteredAudioInputStream { private final static int BLOCKS_PER_DECODE = 9216; protected File file = null; protected IAPEDecompress m_decoder = null; protected byte[] buffer = null; protected byte[] skipbuffer = null; protected int nBlocksLeft; protected int blockAlign; protected int pos = 0; protected int size = 0; private HashMap properties = null; protected int currentBitrate; protected int currentBlock; protected int currentMs; /** * Constructs an audio input stream that has the requested format, using audio data * from the specified input stream. * * @param format - the format of this stream's audio data * @param stream - the stream on which this APEAudioInputStream object is based */ public APEAudioInputStream(AudioFormat format, InputStream stream) { super(format, AudioSystem.NOT_SPECIFIED); try { file = new InputStreamFile(stream); m_decoder = IAPEDecompress.CreateIAPEDecompress(file); nBlocksLeft = m_decoder.getApeInfoDecompressTotalBlocks(); blockAlign = m_decoder.getApeInfoBlockAlign(); currentBitrate = m_decoder.getApeInfoAverageBitrate(); currentBlock = 0; currentMs = 0; // allocate space for decompression buffer = new byte[blockAlign * BLOCKS_PER_DECODE]; buffer = new byte[blockAlign * BLOCKS_PER_DECODE]; properties = new HashMap(); } catch (IOException e) { if (TDebug.TraceAudioInputStream) { TDebug.out(e); } } } /** * Returns dynamic properties of input stream. *

*

    *
  • ape.block [Integer], current block position. *
  • ape.bitrate [Integer], current bitrate. *
  • ape.position.microseconds [Integer], elapsed microseconds. *
* * @return dynamic properties of input stream. */ public Map properties() { properties.put("ape.block", new Integer(currentBlock)); properties.put("ape.bitrate", new Integer(currentBitrate)); properties.put("ape.position.microseconds", new Integer(currentMs)); return properties; } /** * Execute method of input stream */ public void execute() { if (TDebug.TraceAudioInputStream) TDebug.out("execute() : begin"); try { if (m_decoder == null) throw new IOException("Stream closed"); pos = 0; if (nBlocksLeft > 0) { int nBlocksDecoded = m_decoder.GetData(buffer, BLOCKS_PER_DECODE); nBlocksLeft -= nBlocksDecoded; size = nBlocksDecoded * blockAlign; currentBitrate = m_decoder.getApeInfoDecompressCurrentBitRate(); currentBlock = m_decoder.getApeInfoDecompressCurrentBlock(); currentMs = m_decoder.getApeInfoDecompressCurrentMS(); if (TDebug.TraceAudioInputStream) { TDebug.out("ape.block: " + currentBlock); TDebug.out("ape.bitrate: " + currentBitrate); TDebug.out("ape.position.microseconds: " + currentMs); } getCircularBuffer().write(buffer, 0, size); } else { size = 0; getCircularBuffer().close(); } } catch (IOException e) { if (TDebug.TraceAudioInputStream) { TDebug.out(e); } } if (TDebug.TraceAudioInputStream) TDebug.out("execute() : end"); } /** * Closes the input stream. * * @throws IOException - in case of IO error occured. */ public void close() throws IOException { if (m_decoder == null) return; file.close(); file = null; m_decoder = null; buffer = null; properties = null; } } jmac-1.74/spi/src/davaguine/jmac/spi/tritonus/APEFormatConversionProvider.java0000644000175000017500000001061310131501027027427 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.spi.tritonus; import org.tritonus.share.TDebug; import org.tritonus.share.sampled.Encodings; import org.tritonus.share.sampled.convert.TEncodingFormatConversionProvider; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; import java.util.Arrays; /** * Author: Dmitry Vaguine * Date: 01.04.2004 * Time: 12:31:27 */ /** * A format conversion provider for APE audio file format. */ public class APEFormatConversionProvider extends TEncodingFormatConversionProvider { private static final AudioFormat.Encoding APE = Encodings.getEncoding("APE"); private static final AudioFormat.Encoding PCM_SIGNED = Encodings.getEncoding("PCM_SIGNED"); private static final AudioFormat[] INPUT_FORMATS = { // encoding, rate, bits, channels, frameSize, frameRate, big endian new AudioFormat(APE, AudioSystem.NOT_SPECIFIED, 8, 1, AudioSystem.NOT_SPECIFIED, AudioSystem.NOT_SPECIFIED, false), new AudioFormat(APE, AudioSystem.NOT_SPECIFIED, 8, 2, AudioSystem.NOT_SPECIFIED, AudioSystem.NOT_SPECIFIED, false), new AudioFormat(APE, AudioSystem.NOT_SPECIFIED, 16, 1, AudioSystem.NOT_SPECIFIED, AudioSystem.NOT_SPECIFIED, false), new AudioFormat(APE, AudioSystem.NOT_SPECIFIED, 16, 2, AudioSystem.NOT_SPECIFIED, AudioSystem.NOT_SPECIFIED, false), new AudioFormat(APE, AudioSystem.NOT_SPECIFIED, 24, 1, AudioSystem.NOT_SPECIFIED, AudioSystem.NOT_SPECIFIED, false), new AudioFormat(APE, AudioSystem.NOT_SPECIFIED, 24, 2, AudioSystem.NOT_SPECIFIED, AudioSystem.NOT_SPECIFIED, false) }; private static final AudioFormat[] OUTPUT_FORMATS = { // encoding, rate, bits, channels, frameSize, frameRate, big endian new AudioFormat(PCM_SIGNED, AudioSystem.NOT_SPECIFIED, 8, 1, 1, AudioSystem.NOT_SPECIFIED, false), new AudioFormat(PCM_SIGNED, AudioSystem.NOT_SPECIFIED, 8, 2, 2, AudioSystem.NOT_SPECIFIED, false), new AudioFormat(PCM_SIGNED, AudioSystem.NOT_SPECIFIED, 16, 1, 2, AudioSystem.NOT_SPECIFIED, false), new AudioFormat(PCM_SIGNED, AudioSystem.NOT_SPECIFIED, 16, 2, 4, AudioSystem.NOT_SPECIFIED, false), new AudioFormat(PCM_SIGNED, AudioSystem.NOT_SPECIFIED, 24, 1, 3, AudioSystem.NOT_SPECIFIED, false), new AudioFormat(PCM_SIGNED, AudioSystem.NOT_SPECIFIED, 24, 2, 6, AudioSystem.NOT_SPECIFIED, false)}; /** * Constructor of conversion provider. */ public APEFormatConversionProvider() { super(Arrays.asList(INPUT_FORMATS), Arrays.asList(OUTPUT_FORMATS)); if (TDebug.TraceAudioConverter) { TDebug.out(">APEFormatConversionProvider()"); } } /** * Returns a decoded AudioInputStream in the given target AudioFormat. * * @param targetFormat is the target format * @param audioInputStream is the source input stream * @return a decoded AudioInputStream */ public AudioInputStream getAudioInputStream(AudioFormat targetFormat, AudioInputStream audioInputStream) { if (TDebug.TraceAudioConverter) { TDebug.out(">APEFormatConversionProvider.getAudioInputStream(AudioFormat targetFormat, AudioInputStream audioInputStream):"); } return new APEAudioInputStream(targetFormat, audioInputStream); } } jmac-1.74/spi/src/spi/0000755000175000017500000000000010451144641014472 5ustar twernertwernerjmac-1.74/spi/src/spi/jdk15/0000755000175000017500000000000010451144641015410 5ustar twernertwernerjmac-1.74/spi/src/spi/jdk15/META-INF/0000755000175000017500000000000010451144641016550 5ustar twernertwernerjmac-1.74/spi/src/spi/jdk15/META-INF/services/0000755000175000017500000000000010451144641020373 5ustar twernertwernerjmac-1.74/spi/src/spi/jdk15/META-INF/services/javax.sound.sampled.spi.AudioFileReader0000644000175000017500000000011710131501465027752 0ustar twernertwerner# Providers for audio file reading davaguine.jmac.spi.jdk15.APEAudioFileReaderjmac-1.74/spi/src/spi/jdk15/META-INF/services/javax.sound.sampled.spi.FormatConversionProvider0000644000175000017500000000012010131501465031771 0ustar twernertwerner# Providers for FormatConversion davaguine.jmac.spi.APEFormatConversionProviderjmac-1.74/spi/src/spi/META-INF/0000755000175000017500000000000010451144641015632 5ustar twernertwernerjmac-1.74/spi/src/spi/META-INF/services/0000755000175000017500000000000010451144641017455 5ustar twernertwernerjmac-1.74/spi/src/spi/META-INF/services/javax.sound.sampled.spi.AudioFileReader0000644000175000017500000000011110131501465027026 0ustar twernertwerner# Providers for audio file reading davaguine.jmac.spi.APEAudioFileReaderjmac-1.74/spi/src/spi/META-INF/services/javax.sound.sampled.spi.FormatConversionProvider0000644000175000017500000000012010131230057031047 0ustar twernertwerner# Providers for FormatConversion davaguine.jmac.spi.APEFormatConversionProviderjmac-1.74/spi/src/spi/tritonus/0000755000175000017500000000000010451144641016361 5ustar twernertwernerjmac-1.74/spi/src/spi/tritonus/META-INF/0000755000175000017500000000000010451144641017521 5ustar twernertwernerjmac-1.74/spi/src/spi/tritonus/META-INF/services/0000755000175000017500000000000010451144641021344 5ustar twernertwernerjmac-1.74/spi/src/spi/tritonus/META-INF/services/javax.sound.sampled.spi.AudioFileReader0000644000175000017500000000012210131230057030713 0ustar twernertwerner# Providers for audio file reading davaguine.jmac.spi.tritonus.APEAudioFileReaderjmac-1.74/spi/src/spi/tritonus/META-INF/services/javax.sound.sampled.spi.FormatConversionProvider0000644000175000017500000000013110131230057032740 0ustar twernertwerner# Providers for FormatConversion davaguine.jmac.spi.tritonus.APEFormatConversionProviderjmac-1.74/test/0000755000175000017500000000000010451145024013270 5ustar twernertwernerjmac-1.74/test/src/0000755000175000017500000000000010451144641014063 5ustar twernertwernerjmac-1.74/test/src/davaguine/0000755000175000017500000000000010451144641016026 5ustar twernertwernerjmac-1.74/test/src/davaguine/jmac/0000755000175000017500000000000010451144641016740 5ustar twernertwernerjmac-1.74/test/src/davaguine/jmac/test/0000755000175000017500000000000010451144641017717 5ustar twernertwernerjmac-1.74/test/src/davaguine/jmac/test/ChangeTagInfo.java0000644000175000017500000000463710131230057023221 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.test; import davaguine.jmac.decoder.IAPEDecompress; import davaguine.jmac.info.APEInfo; import davaguine.jmac.info.APETag; import davaguine.jmac.info.ID3Tag; import davaguine.jmac.tools.File; /** * Author: Dmitry Vaguine * Date: 23.04.2004 * Time: 18:34:42 */ public class ChangeTagInfo { public static void main(String[] args) { try { /////////////////////////////////////////////////////////////////////////////// // error check the command line parameters /////////////////////////////////////////////////////////////////////////////// if (args.length != 3) { System.out.print("~~~Improper Usage~~~\n\n"); System.out.print("Usage Example: ChangeTagInfo \"c:\\1.ape\" TagName TagValue\n\n"); return; } File in = File.createFile(args[0], "rw"); if (!in.isLocal()) { System.out.print("~~~Improper Usage~~~\nThe input ape file should be local file.\n"); return; } APEInfo apeInfo = IAPEDecompress.CreateAPEInfo(in); APETag tag = apeInfo.getApeInfoTag(); tag.Remove(false); tag.SetFieldString(args[1], args[2]); ID3Tag id3 = new ID3Tag(); tag.CreateID3Tag(id3); tag.Save(); apeInfo.close(); } catch (Exception e) { e.printStackTrace(); } } } jmac-1.74/test/src/davaguine/jmac/test/Compress.java0000644000175000017500000000647010131230057022354 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.test; import davaguine.jmac.core.APESimple; import davaguine.jmac.info.CompressionLevel; import davaguine.jmac.tools.ProgressCallback; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class Compress extends ProgressCallback { private static long g_nInitialTickCount; public void callback(int persent) { double dProgress = ((double) (pPercentageDone)) / 1000; double dElapsedMS = (System.currentTimeMillis() - g_nInitialTickCount); double dSecondsRemaining = (((dElapsedMS * 100) / dProgress) - dElapsedMS) / 1000; System.out.println("Progress: " + dProgress + " (" + dSecondsRemaining + " seconds remaining) "); } public void updateStatus(String msg) { System.out.println(msg); } public static void main(String[] args) { try { /////////////////////////////////////////////////////////////////////////////// // error check the command line parameters /////////////////////////////////////////////////////////////////////////////// if (args.length != 2) { System.out.print("~~~Improper Usage~~~\n\n"); System.out.print("Usage Example: Compress \"c:\\1.wav\" \"c:\\1.ape\"\n\n"); return; } /////////////////////////////////////////////////////////////////////////////// // variable declares /////////////////////////////////////////////////////////////////////////////// String pFilename = args[0]; //the file to open String pOFilename = args[1]; //the file to open /////////////////////////////////////////////////////////////////////////////// // attempt to verify the file /////////////////////////////////////////////////////////////////////////////// // set the start time and display the starting message g_nInitialTickCount = System.currentTimeMillis(); System.out.println("Compressing '" + pFilename + "'..."); // do the verify (call unmac.dll) APESimple.CompressFile(pFilename, pOFilename, CompressionLevel.COMPRESSION_LEVEL_INSANE, new Compress()); // process the return value } catch (Exception e) { e.printStackTrace(); } } } jmac-1.74/test/src/davaguine/jmac/test/Convert.java0000644000175000017500000000633210131230057022176 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.test; import davaguine.jmac.core.APESimple; import davaguine.jmac.info.CompressionLevel; import davaguine.jmac.tools.ProgressCallback; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class Convert extends ProgressCallback { private static long g_nInitialTickCount; public void callback(int persent) { double dProgress = ((double) (pPercentageDone)) / 1000; double dElapsedMS = (System.currentTimeMillis() - g_nInitialTickCount); double dSecondsRemaining = (((dElapsedMS * 100) / dProgress) - dElapsedMS) / 1000; System.out.println("Progress: " + dProgress + " (" + dSecondsRemaining + " seconds remaining) "); } public static void main(String[] args) { try { /////////////////////////////////////////////////////////////////////////////// // error check the command line parameters /////////////////////////////////////////////////////////////////////////////// if (args.length != 2) { System.out.print("~~~Improper Usage~~~\n\n"); System.out.print("Usage Example: Convert \"c:\\1.ape\" \"c:\\2.ape\"\n\n"); return; } /////////////////////////////////////////////////////////////////////////////// // variable declares /////////////////////////////////////////////////////////////////////////////// String pFilename = args[0]; //the file to open String pOFilename = args[1]; //the file to open /////////////////////////////////////////////////////////////////////////////// // attempt to verify the file /////////////////////////////////////////////////////////////////////////////// // set the start time and display the starting message g_nInitialTickCount = System.currentTimeMillis(); System.out.println("Converting '" + pFilename + "'..."); // do the verify (call unmac.dll) APESimple.ConvertFile(pFilename, pOFilename, CompressionLevel.COMPRESSION_LEVEL_HIGH, new Convert()); // process the return value } catch (Exception e) { e.printStackTrace(); } } } jmac-1.74/test/src/davaguine/jmac/test/Decompress.java0000644000175000017500000000622210131230057022660 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.test; import davaguine.jmac.core.APESimple; import davaguine.jmac.tools.ProgressCallback; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class Decompress extends ProgressCallback { private static long g_nInitialTickCount; public void callback(int persent) { double dProgress = ((double) (pPercentageDone)) / 1000; double dElapsedMS = (System.currentTimeMillis() - g_nInitialTickCount); double dSecondsRemaining = (((dElapsedMS * 100) / dProgress) - dElapsedMS) / 1000; System.out.println("Progress: " + dProgress + " (" + dSecondsRemaining + " seconds remaining) "); } public static void main(String[] args) { try { /////////////////////////////////////////////////////////////////////////////// // error check the command line parameters /////////////////////////////////////////////////////////////////////////////// if (args.length != 2) { System.out.print("~~~Improper Usage~~~\n\n"); System.out.print("Usage Example: Decompress \"c:\\1.ape\" \"c:\\1.wav\"\n\n"); return; } /////////////////////////////////////////////////////////////////////////////// // variable declares /////////////////////////////////////////////////////////////////////////////// String pFilename = args[0]; //the file to open String pOFilename = args[1]; //the file to open /////////////////////////////////////////////////////////////////////////////// // attempt to verify the file /////////////////////////////////////////////////////////////////////////////// // set the start time and display the starting message g_nInitialTickCount = System.currentTimeMillis(); System.out.println("Decompressing '" + pFilename + "'..."); // do the verify (call unmac.dll) APESimple.DecompressFile(pFilename, pOFilename, new Decompress()); // process the return value } catch (Exception e) { e.printStackTrace(); } } } jmac-1.74/test/src/davaguine/jmac/test/JavaSoundSimpleAudioPlayer.java0000644000175000017500000001502310450745033025767 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.test; import javax.sound.sampled.*; import java.io.File; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; /** * Author: Dmitry Vaguine * Date: 12.03.2004 * Time: 13:35:13 */ public class JavaSoundSimpleAudioPlayer { /** * Plays audio from given file names. */ public static void main(String[] args) { // Check for given sound file names. if (args.length < 1) { System.out.println("Play usage:"); System.out.println("\tjava Play *"); System.exit(0); } // Process arguments. for (int i = 0; i < args.length; i++) playAudioFile(args[i]); // Must exit explicitly since audio creates non-daemon threads. System.exit(0); } // main /** * Play audio from the given file name. */ public static void playAudioFile(String fileName) { try { AudioInputStream audioInputStream = null; AudioFileFormat audioFileFormat = null; try { URL url = new URL(fileName); audioFileFormat = AudioSystem.getAudioFileFormat(url); audioInputStream = AudioSystem.getAudioInputStream(url); } catch (MalformedURLException e) { File soundFile = new File(fileName); audioFileFormat = AudioSystem.getAudioFileFormat(soundFile); audioInputStream = AudioSystem.getAudioInputStream(soundFile); } // Create a stream from the given file. // Throws IOException or UnsupportedAudioFileException playAudioStream(audioInputStream); } catch (Exception e) { System.out.println("Problem with file " + fileName + ":"); e.printStackTrace(); } } // playAudioFile /** * Plays audio from the given audio input stream. */ public static void playAudioStream(AudioInputStream audioInputStream) { // Audio format provides information like sample rate, size, channels. AudioFormat audioFormat = audioInputStream.getFormat(); // Convert compressed audio data to uncompressed PCM format. if (audioFormat.getEncoding() != AudioFormat.Encoding.PCM_SIGNED) { AudioFormat newFormat = new AudioFormat(audioFormat.getSampleRate(), audioFormat.getSampleSizeInBits(), audioFormat.getChannels(), true, false); System.out.println("Converting audio format to " + newFormat); AudioInputStream newStream = AudioSystem.getAudioInputStream(newFormat, audioInputStream); audioFormat = newFormat; audioInputStream = newStream; } // Open a data line to play our type of sampled audio. // Use SourceDataLine for play and TargetDataLine for record. DataLine.Info info = new DataLine.Info(SourceDataLine.class, audioFormat); if (!AudioSystem.isLineSupported(info)) { System.out.println("Play.playAudioStream does not handle this type of audio on this system."); return; } try { // Create a SourceDataLine for play back (throws LineUnavailableException). SourceDataLine dataLine = (SourceDataLine) AudioSystem.getLine(info); System.out.println("SourceDataLine class=" + dataLine.getClass()); // The line acquires system resources (throws LineAvailableException). dataLine.open(audioFormat); // Adjust the volume on the output line. if (dataLine.isControlSupported(FloatControl.Type.MASTER_GAIN)) { FloatControl volume = (FloatControl) dataLine.getControl(FloatControl.Type.MASTER_GAIN); volume.setValue((volume.getMaximum() - volume.getMinimum()) * 0.8f + volume.getMinimum()); } // Allows the line to move data in and out to a port. dataLine.start(); // Create a buffer for moving data from the audio stream to the line. int bufferSize = (int) audioFormat.getSampleRate() * audioFormat.getFrameSize(); byte[] buffer = new byte[bufferSize]; // Move the data until done or there is an error. try { int bytesRead = 0; while (bytesRead >= 0) { bytesRead = audioInputStream.read(buffer, 0, buffer.length); if (bytesRead >= 0) { //System.out.println("Play.playAudioStream bytes read=" + bytesRead + // ", frame size=" + audioFormat.getFrameSize() + ", frames read=" + bytesRead / audioFormat.getFrameSize()); // Odd sized sounds throw an exception if we don't write the same amount. int framesWritten = dataLine.write(buffer, 0, bytesRead); } } // while } catch (IOException e) { e.printStackTrace(); } System.out.println("Play.playAudioStream draining line."); // Continues data line I/O until its buffer is drained. dataLine.drain(); System.out.println("Play.playAudioStream closing line."); // Closes the data line, freeing any resources such as the audio device. dataLine.close(); } catch (LineUnavailableException e) { e.printStackTrace(); } } // playAudioStream } jmac-1.74/test/src/davaguine/jmac/test/Verify.java0000644000175000017500000000604410131230057022022 0ustar twernertwerner/* * 21.04.2004 Original verion. davagin@udm.ru. *----------------------------------------------------------------------- * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------- */ package davaguine.jmac.test; import davaguine.jmac.core.APESimple; import davaguine.jmac.tools.ProgressCallback; /** * Author: Dmitry Vaguine * Date: 04.03.2004 * Time: 14:51:31 */ public class Verify extends ProgressCallback { private static long g_nInitialTickCount; public void callback(int persent) { double dProgress = ((double) (pPercentageDone)) / 1000; double dElapsedMS = (System.currentTimeMillis() - g_nInitialTickCount); double dSecondsRemaining = (((dElapsedMS * 100) / dProgress) - dElapsedMS) / 1000; System.out.println("Progress: " + dProgress + " (" + dSecondsRemaining + " seconds remaining) "); } public static void main(String[] args) { try { /////////////////////////////////////////////////////////////////////////////// // error check the command line parameters /////////////////////////////////////////////////////////////////////////////// if (args.length != 1) { System.out.print("~~~Improper Usage~~~\n\n"); System.out.print("Usage Example: Verify \"c:\\1.ape\"\n\n"); return; } /////////////////////////////////////////////////////////////////////////////// // variable declares /////////////////////////////////////////////////////////////////////////////// String pFilename = args[0]; //the file to open /////////////////////////////////////////////////////////////////////////////// // attempt to verify the file /////////////////////////////////////////////////////////////////////////////// // set the start time and display the starting message g_nInitialTickCount = System.currentTimeMillis(); System.out.println("Verifying '" + pFilename + "'..."); // do the verify (call unmac.dll) APESimple.VerifyFile(pFilename, new Verify()); // process the return value } catch (Exception e) { e.printStackTrace(); } } }