sl@0: /* sl@0: * Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * sl@0: */ sl@0: sl@0: #ifndef __MMF_TMMFAUDIO_PCM16_TO_IMAADPCM_CODEC_H__ sl@0: #define __MMF_TMMFAUDIO_PCM16_TO_IMAASPCM_CODEC_H__ sl@0: #include sl@0: #include "MMFAudioCodecBase.h" sl@0: #include "MMFImaAudioCodecState.h" sl@0: sl@0: /** sl@0: * sl@0: * TMMFAudioPcm16ToImaAdpcmCodec sl@0: * sl@0: */ sl@0: const TInt KImaAdpcmCodecIndexTableSize = 16; sl@0: const TInt KImaAdpcmCodecStepTableSize = 89; sl@0: sl@0: /* sl@0: * sl@0: * class TMMFAudioPcm16ToImaAdpcmCodec sl@0: * sl@0: */ sl@0: class TMMFAudioPcm16ToImaAdpcmCodec : public TMMFAudioCodecBase sl@0: { sl@0: public: sl@0: inline TMMFAudioPcm16ToImaAdpcmCodec(); sl@0: IMPORT_C virtual void Convert(TUint8* aSrc, TUint8* aDst, TInt aSamples); sl@0: IMPORT_C void SetState(const TMMFImaAdpcmCodecState& aState); sl@0: IMPORT_C const TMMFImaAdpcmCodecState& GetState(); sl@0: private: sl@0: TMMFImaAdpcmCodecState iState; //supports mono only sl@0: private: sl@0: static const TInt KIndexTable[KImaAdpcmCodecIndexTableSize]; sl@0: static const TInt KStepSizeTable[KImaAdpcmCodecStepTableSize]; sl@0: TBool iBufferStep; sl@0: TInt iBuffer; sl@0: }; sl@0: sl@0: inline TMMFAudioPcm16ToImaAdpcmCodec::TMMFAudioPcm16ToImaAdpcmCodec() : iBufferStep(ETrue), iBuffer(0) {} sl@0: #endif //__MMF_TMMFAUDIO_PCM16_TO_IMAADPCM_CODEC_H__