os/mm/mmlibs/mmfw/Codecs/Inc/MMFCodecCommon/MMFAudioPcm16ToImaAdpcmCodec.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description:
    15 *
    16 */
    17 
    18 #ifndef __MMF_TMMFAUDIO_PCM16_TO_IMAADPCM_CODEC_H__
    19 #define __MMF_TMMFAUDIO_PCM16_TO_IMAASPCM_CODEC_H__
    20 #include <e32std.h>
    21 #include "MMFAudioCodecBase.h"
    22 #include "MMFImaAudioCodecState.h"
    23 
    24 /**
    25 *
    26 * TMMFAudioPcm16ToImaAdpcmCodec 
    27 *
    28 */
    29 const TInt KImaAdpcmCodecIndexTableSize = 16;
    30 const TInt KImaAdpcmCodecStepTableSize = 89;
    31 
    32 /*
    33 *
    34 * class TMMFAudioPcm16ToImaAdpcmCodec
    35 *
    36 */
    37 class TMMFAudioPcm16ToImaAdpcmCodec : public TMMFAudioCodecBase
    38 	{
    39 public:
    40 	inline TMMFAudioPcm16ToImaAdpcmCodec();
    41 	IMPORT_C virtual void Convert(TUint8* aSrc, TUint8* aDst, TInt aSamples);
    42 	IMPORT_C void SetState(const TMMFImaAdpcmCodecState& aState);
    43 	IMPORT_C const TMMFImaAdpcmCodecState& GetState();
    44 private:
    45 	TMMFImaAdpcmCodecState iState;	//supports mono only
    46 private:
    47 	static const TInt KIndexTable[KImaAdpcmCodecIndexTableSize];
    48 	static const TInt KStepSizeTable[KImaAdpcmCodecStepTableSize];
    49 	TBool iBufferStep;
    50 	TInt iBuffer;
    51 	};
    52 
    53 inline TMMFAudioPcm16ToImaAdpcmCodec::TMMFAudioPcm16ToImaAdpcmCodec() : iBufferStep(ETrue), iBuffer(0) {}
    54 #endif //__MMF_TMMFAUDIO_PCM16_TO_IMAADPCM_CODEC_H__