1 /* |
|
2 * Copyright (c) 2006-2007 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: ?Description |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef IRMP3PLAYERLOCAL_H |
|
22 #define IRMP3PLAYERLOCAL_H |
|
23 |
|
24 //sampling rate of MP3 is taken from a look up table |
|
25 //selection is made based on MPEG version and index bits |
|
26 //the look up table is made in the form of an array of 4x4 |
|
27 //and demension are define in terms of constant defined below |
|
28 const TUint8 KMP3SamplingRateVersionArraySize = 4; |
|
29 const TUint8 KMP3SamplingRateIndexArraySize = 4; |
|
30 |
|
31 //bitrate rate of MP3 is taken from a look up table |
|
32 //selection is made based on MPEG version and Layer and index bits |
|
33 //the look up table is made in the form of an array of 2x3x16 |
|
34 //and demension are define in terms of constant defined below |
|
35 const TUint8 KMP3BitRateMPEGArraySize = 2; |
|
36 const TUint8 KMP3BitRateLayerArraySize = 3; |
|
37 const TUint8 KMP3BitRateIndexArraySize = 16; |
|
38 |
|
39 //channel selection is based on 2 bits and is defined as array of |
|
40 //demension 4 and is defined in terms of constant. |
|
41 const TUint8 KMP3ChannelArraySize = 4; |
|
42 |
|
43 |
|
44 //sampling rate is given in Hzs. |
|
45 //KMP3SamplingRate[MPEGVersion][bit index] |
|
46 const TInt32 KMP3SamplingRate[KMP3SamplingRateVersionArraySize][KMP3SamplingRateIndexArraySize] = //! Sampling rates for MP3 |
|
47 { |
|
48 {11025,12000,8000,0}, //MPEG 2.5 unofficial 00 |
|
49 {0, 0, 0, 0}, //reserved 01 |
|
50 {22050,24000,16000,0}, //MPEG 2 10 |
|
51 {44100,48000,32000,0} //MPEG 1 11 |
|
52 }; |
|
53 |
|
54 //each bit rate is given in Kbps. |
|
55 // KBitRate[Version][Layer][bitselect] |
|
56 const TUint32 KBitRate[KMP3BitRateMPEGArraySize] |
|
57 [KMP3BitRateLayerArraySize] |
|
58 [KMP3BitRateIndexArraySize] = //! Bit rates for Mp3 |
|
59 { |
|
60 { // MPEG 1 |
|
61 {0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,0}, // Layer1 |
|
62 {0,32,48,56, 64, 80, 96,112,128,160,192,224,256,320,384,0}, // Layer2 |
|
63 {0,32,40,48, 56, 64, 80, 96,112,128,160,192,224,256,320,0} // Layer3 |
|
64 }, |
|
65 { // MPEG 2, 2.5 |
|
66 {0,32,48,56,64,80,96,112,128,144,160,176,192,224,256,0}, // Layer1 |
|
67 {0,8,16,24,32,40,48,56,64,80,96,112,128,144,160,0}, // Layer2 |
|
68 {0,8,16,24,32,40,48,56,64,80,96,112,128,144,160,0} // Layer3 |
|
69 } |
|
70 }; |
|
71 |
|
72 //enumerated sampling frequency values |
|
73 //for mp3 player |
|
74 enum TIRMp3SamplingFreq |
|
75 { |
|
76 EMp3SamplingFreq8000 = 8000, |
|
77 EMp3SamplingFreq11025 = 11025, |
|
78 EMp3SamplingFreq12000 = 12000, |
|
79 EMp3SamplingFreq16000 = 16000, |
|
80 EMp3SamplingFreq22050 = 22050, |
|
81 EMp3SamplingFreq24000 = 24000, |
|
82 EMp3SamplingFreq32000 = 32000, |
|
83 EMp3SamplingFreq44100 = 44100, |
|
84 EMp3SamplingFreq48000 = 48000, |
|
85 }; |
|
86 |
|
87 //channels 1 for stereo, and 0 for mono |
|
88 // bits 6,7: |
|
89 // 00 - Stereo |
|
90 // 01 - Joint stereo (Stereo) |
|
91 // 10 - Dual channel (Stereo) |
|
92 // 11 - Single channel (Mono) |
|
93 const TUint32 KChannelInfo[KMP3ChannelArraySize] = |
|
94 {1,1,0,0}; |
|
95 |
|
96 const TInt KMp3FrameHeaderSize = 5; |
|
97 |
|
98 //zero indicates that channel is mono |
|
99 const TInt KMp3ChannelMono = 0; |
|
100 |
|
101 #endif//IRMP3PLAYERLOCAL_H |
|
102 |
|