equal
deleted
inserted
replaced
|
1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // MMFAudioPcm16ToPcmU16BECodec.cpp |
|
15 // |
|
16 // |
|
17 |
|
18 #include "MMFAudioPcm16ToPcmU16BECodec.h" |
|
19 |
|
20 /** |
|
21 * |
|
22 * Convert |
|
23 * @param aSrc |
|
24 * @param aDst |
|
25 * @param aSamples |
|
26 * Signed 16bit (le) to Unsigned 16bit (be) |
|
27 */ |
|
28 EXPORT_C void TMMFAudioPcm16ToPcmU16BECodec::Convert(TUint8* aSrc, TUint8* aDst, TInt aSamples) |
|
29 { |
|
30 TInt s16; |
|
31 while (aSamples--) |
|
32 { |
|
33 s16 = ((aSrc[1]<<8)+aSrc[0])+KMaskSign16bit; |
|
34 *aDst++ = STATIC_CAST( TInt8, (s16>>8)&KAndMask8bit); |
|
35 *aDst++ = STATIC_CAST( TInt8, s16&KAndMask8bit); |
|
36 aSrc += 2; |
|
37 } |
|
38 } |