1 /* |
|
2 * Copyright (c) 2010 Ixonos Plc. |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the "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 * Ixonos Plc |
|
14 * |
|
15 * Description: |
|
16 * Video settings. |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 |
|
22 #ifndef CTRSETTINGS_H |
|
23 #define CTRSETTINGS_H |
|
24 |
|
25 // INCLUDES |
|
26 #include <devvideoconstants.h> |
|
27 |
|
28 |
|
29 // MACROS |
|
30 #ifdef _DEBUG |
|
31 #define DEBUGPRINT |
|
32 #endif |
|
33 |
|
34 // Debug print macro |
|
35 #ifdef DEBUGPRINT |
|
36 #include <e32svr.h> |
|
37 #define PRINT(x) RDebug::Print x; |
|
38 #else |
|
39 #define PRINT(x) |
|
40 #endif |
|
41 |
|
42 |
|
43 // CONSTANTS |
|
44 |
|
45 |
|
46 // Transcoder states |
|
47 enum TRStates |
|
48 { |
|
49 ETRNone, |
|
50 ETROpened, |
|
51 ETRInitializing, |
|
52 ETRInitialized, |
|
53 ETRRunning, |
|
54 ETRPaused, |
|
55 ETRStopping, |
|
56 ETRStopped, |
|
57 ETRFatalError |
|
58 }; |
|
59 |
|
60 enum TRCodecTypes |
|
61 { |
|
62 EH263, |
|
63 EMpeg4, |
|
64 EH264 |
|
65 }; |
|
66 |
|
67 // Input format parameters |
|
68 // Planar (first Y frame, then U, then V) |
|
69 const TYuvDataLayout KTRYuvLayout = EYuvDataPlanar; |
|
70 |
|
71 // YUV-RGB conversion coefficients to use: YUV data with range 0 (Y [16-235]) and conversion coefficients according to BT.601.5 |
|
72 const TYuvCoefficients KTRYuvCoefficients = EYuvBt601Range0; |
|
73 |
|
74 // Aspect ratio, in H.263 default is 12:11, but camera probably provides 1:1 |
|
75 const TInt KTRAspectRatioNum = 12; |
|
76 const TInt KTRAspectRatioDenom = 11; |
|
77 |
|
78 |
|
79 // Quality is more important than delay in non real-time mode |
|
80 const TReal KTRLatencyQualityTradeoffNonRT = 1.0; |
|
81 |
|
82 // Tradeoff for real-time mode |
|
83 const TReal KTRLatencyQualityTradeoffRT = 0.3; |
|
84 |
|
85 // range is [0...100] |
|
86 const TUint KTRPictureQuality = 50; |
|
87 |
|
88 // (1.0 means the picture quality is sacrificed |
|
89 // "all the way" to match the target fps |
|
90 const TReal KTRQualityTemporalTradeoff = 0.8; |
|
91 |
|
92 |
|
93 // 720x576,720x288,360x288 |
|
94 // PAL 1, 2, 3 |
|
95 |
|
96 // KTRDefaultSrcRate |
|
97 const TReal KTRDefaultSrcRate = 15.0; |
|
98 |
|
99 // KTRDefaultAccessRate |
|
100 const TReal KTRDefaultAccessRate = 0.2; |
|
101 |
|
102 // Number of video segments |
|
103 const TUint KTRMinNumberOfBuffersVideoSegment = 25; |
|
104 const TUint KTRMinNumberOfBuffersCodedPicture = 4; |
|
105 |
|
106 // Min number of bitstream buffers for decoder |
|
107 const TUint KTRDecoderMinNumberOfBuffers = 2; |
|
108 |
|
109 // Number of internal buffers for resampled uncompressed data |
|
110 const TUint KTRMinNumberOfResampledPictureBuffers = 4; |
|
111 |
|
112 // Codec levels |
|
113 const TUint KTRH263CodecLevel10 = 10; |
|
114 const TUint KTRH263CodecLevel20 = 20; |
|
115 const TUint KTRH263CodecLevel30 = 30; |
|
116 const TUint KTRH263CodecLevel40 = 40; |
|
117 const TUint KTRH263CodecLevel45 = 45; |
|
118 const TUint KTRH263CodecLevel50 = 50; |
|
119 const TUint KTRH263CodecLevel60 = 60; |
|
120 const TUint KTRH263CodecLevel70 = 70; |
|
121 |
|
122 const TUint KTRH264CodecLevel10 = 110; |
|
123 const TUint KTRH264CodecLevel10b = 119; |
|
124 const TUint KTRH264CodecLevel11 = 111; |
|
125 const TUint KTRH264CodecLevel12 = 112; |
|
126 const TUint KTRH264CodecLevel13 = 113; |
|
127 const TUint KTRH264CodecLevel20 = 120; |
|
128 const TUint KTRH264CodecLevel21 = 121; |
|
129 const TUint KTRH264CodecLevel22 = 122; |
|
130 const TUint KTRH264CodecLevel30 = 130; |
|
131 //WVGA task |
|
132 const TUint KTRH264CodecLevel31 = 131; |
|
133 |
|
134 const TUint KTRMPEG4CodecLevel0 = 0; |
|
135 const TUint KTRMPEG4CodecLevel1 = 1; |
|
136 const TUint KTRMPEG4CodecLevel2 = 2; |
|
137 const TUint KTRMPEG4CodecLevel3 = 3; |
|
138 const TUint KTRMPEG4CodecLevel0b = 9; |
|
139 const TUint KTRMPEG4CodecLevel4a = 4; |
|
140 |
|
141 // Bitstream buffer size |
|
142 const TUint KTRMaxBufferSizeLevel10 = 16384; |
|
143 const TUint KTRMaxBufferSizeLevel20 = 65536; |
|
144 const TUint KTRMaxBufferSizeLevel30 = 65536; |
|
145 const TUint KTRMaxBufferSizeLevel40 = 32768; |
|
146 const TUint KTRMaxBufferSizeLevel45 = 16384; |
|
147 const TUint KTRMaxBufferSizeLevel50 = 32768; |
|
148 const TUint KTRMaxBufferSizeLevel60 = 32768; |
|
149 const TUint KTRMaxBufferSizeLevel70 = 32768; |
|
150 |
|
151 const TUint KTRMaxBufferSizeH264Level10 = 19688; |
|
152 const TUint KTRMaxBufferSizeH264Level10b = 39375; |
|
153 const TUint KTRMaxBufferSizeH264Level11 = 56250; |
|
154 const TUint KTRMaxBufferSizeH264Level12 = 112500; |
|
155 const TUint KTRMaxBufferSizeH264Level13 = 225000; |
|
156 const TUint KTRMaxBufferSizeH264Level20 = 225000; |
|
157 const TUint KTRMaxBufferSizeH264Level21 = 450000; |
|
158 const TUint KTRMaxBufferSizeH264Level22 = 450000; |
|
159 const TUint KTRMaxBufferSizeH264Level30 = 1125000; |
|
160 //WVGA task |
|
161 const TUint KTRMaxBufferSizeH264Level31 = 2250000; |
|
162 |
|
163 const TUint KTRMaxBufferSizeLevel0 = 20480; |
|
164 const TUint KTRMaxBufferSizeLevel0b = 40960; |
|
165 const TUint KTRMaxBufferSizeLevel1 = 20480; |
|
166 const TUint KTRMaxBufferSizeLevel2 = 81920; |
|
167 const TUint KTRMaxBufferSizeLevel3 = 81920; |
|
168 const TUint KTRMaxBufferSizeLevel4a = 163840; |
|
169 |
|
170 // Bit rates for different profiles / levels, [kbps] |
|
171 const TUint KTRMaxBitRateH263Level10 = 64000; |
|
172 const TUint KTRMaxBitRateH263Level20 = 128000; |
|
173 const TUint KTRMaxBitRateH263Level30 = 384000; |
|
174 const TUint KTRMaxBitRateH263Level40 = 384000; |
|
175 const TUint KTRMaxBitRateH263Level45 = 128000; |
|
176 const TUint KTRMaxBitRateH263Level50 = 384000; |
|
177 const TUint KTRMaxBitRateH263Level60 = 384000; |
|
178 const TUint KTRMaxBitRateH263Level70 = 384000; |
|
179 |
|
180 const TUint KTRMaxBitRateH264Level10 = 64000; |
|
181 const TUint KTRMaxBitRateH264Level10b = 128000; |
|
182 const TUint KTRMaxBitRateH264Level11 = 192000; |
|
183 const TUint KTRMaxBitRateH264Level12 = 384000; |
|
184 const TUint KTRMaxBitRateH264Level13 = 768000; |
|
185 const TUint KTRMaxBitRateH264Level20 = 2000000; |
|
186 const TUint KTRMaxBitRateH264Level21 = 4000000; |
|
187 const TUint KTRMaxBitRateH264Level22 = 4000000; |
|
188 const TUint KTRMaxBitRateH264Level30 = 10000000; |
|
189 //WVGA task |
|
190 const TUint KTRMaxBitRateH264Level31 = 20000000; |
|
191 |
|
192 const TUint KTRMaxBitRateMPEG4Level0 = 64000; |
|
193 const TUint KTRMaxBitRateMPEG4Level0b = 128000; |
|
194 const TUint KTRMaxBitRateMPEG4Level1 = 64000; |
|
195 const TUint KTRMaxBitRateMPEG4Level2 = 128000; |
|
196 const TUint KTRMaxBitRateMPEG4Level3 = 384000; |
|
197 const TUint KTRMaxBitRateMPEG4Level4a = 4000000; |
|
198 |
|
199 |
|
200 // Target framerate default |
|
201 const TReal KTRTargetFrameRateDefault = 15.0; |
|
202 |
|
203 // Default segment size |
|
204 const TUint KTRDefaultSegmentSize = 256; |
|
205 |
|
206 // Min segment size |
|
207 const TUint KTRMinSegmentSize = 256; |
|
208 |
|
209 // Max desc8 length |
|
210 const TUint KMaxDesC8Length = 256; |
|
211 |
|
212 // Image size |
|
213 const TUint KTRQCIFWidth = 176; |
|
214 const TUint KTRQCIFHeight = 144; |
|
215 const TUint KTRSubQCIFWidth = 128; |
|
216 const TUint KTRSubQCIFHeight = 96; |
|
217 const TUint KTRCIFWidth = 352; |
|
218 const TUint KTRCIFHeight = 288; |
|
219 const TUint KTRPALWidth = 720; |
|
220 const TUint KTRPAL2Height = 288; |
|
221 const TUint KTRPAL1Height = 576; |
|
222 const TUint KTRQVGAWidth = 320; |
|
223 const TUint KTRQVGAHeight = 240; |
|
224 const TUint KTRVGAWidth = 640; |
|
225 const TUint KTRVGAHeight = 480; |
|
226 const TUint KTR4CIFWidth = 704; |
|
227 const TUint KTR4CIFHeight = 576; |
|
228 const TUint KTRVGA16By9Width = 640; |
|
229 const TUint KTRVGA16By9Height = 352; |
|
230 //WVGA task |
|
231 const TUint KTRWVGAWidth = 864; |
|
232 const TUint KTRWVGAHeight = 480; |
|
233 |
|
234 // Number of TVideoPictures in TranscoderPicture queue |
|
235 const TUint KTRPictureBuffersNumber = 2; |
|
236 |
|
237 // Number fo TTRVideoPicture containers in TRTranscoderQueue |
|
238 const TUint KTRPictureContainersNumber = 5; |
|
239 |
|
240 // Number of picture buffers allocated by encoder plugin (if BufferManagementCI is available) |
|
241 // Only few (one or two) buffers can be used: See mdf extensions spec for details |
|
242 const TUint KTRPictureBuffersNumberBMCI = 2; |
|
243 |
|
244 // X0 would be enough.. ? |
|
245 const TUint KNumberOfEvents = 50; |
|
246 |
|
247 #endif // CTRSETTINGS_H |
|