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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Constants and structs specific to H.263. See the DevVideo specs for more details.
18 #ifndef __DEVVIDEO_H263_H__
19 #define __DEVVIDEO_H263_H__
25 Specifies the H263 picture type.
32 EH263PictureTypeI = 0x01,
34 EH263PictureTypeP = 0x02,
35 /**B picture according to H.263 Annex O*/
36 EH263PictureTypeB = 0x04,
37 /**EI picture according to H.263 Annex O*/
38 EH263PictureTypeEI = 0x08,
39 /**EP picture according to H.263 Annex O*/
40 EH263PictureTypeEP = 0x10
44 These enumerations can be used in codec capability indication and/or bitstream property indication.
45 When used as part of an encoder capability indication, a signalled value indicates the capability
46 of an encoder to produce such supplemental information to the bitstream and the additional meanings
47 as specified below. When used as part of a decoder capability indication, a signalled value
48 indicates the capability of a decoder to react to such supplemental information in a way as
49 specified below. If a decoder does not have such capability, it shall be able to parse and discard
50 the supplemental information. When used as part of a bitstream property indication, a non-signalled
51 value indicates the absence of such information in the bitstream and a signalled value indicates
52 the possibility of having such information in the bitstream.
56 enum TH263SupplementalInformation
59 encoder capability: no meaning
60 decoder capability: no meaning
61 bitstream property: existence of FTYPE equal to 1
63 EH263SEIDoNothing = 0x00000001,
66 encoder capability: no meaning
67 decoder capability: capability to freeze displayed picture according to subclause L.4 of H.263capability to release frozen displayed picture as a response to bit 5 of PTYPE
68 bitstream property: existence of FTYPE equal to 2
70 EH263SEIFullPictureFreeze = 0x00000002,
73 encoder capability: no meaning
74 decoder capability: capability to freeze displayed picture partially (subclause L.5 of H.263)
75 bitstream property: existence of FTYPE equal to 3
77 EH263SEIPartialPictureFreeze = 0x00000004,
80 encoder capability: no meaning
81 decoder capability: capability to freeze and resize displayed picture partially (H.263 L.6)
82 bitstream property: existence of FTYPE equal to 4
84 EH263SEIResizingPartialPictureFreeze = 0x00000008,
87 encoder capability: no meaning
88 decoder capability: capability to release partially frozen picture (subclause L.7 of H.263)
89 bitstream property: existence of FTYPE equal to 5
91 EH263SEIPartialPictureFreezeRelease = 0x00000010,
94 encoder capability: no meaning
95 decoder capability: no meaning
96 bitstream property: existence of FTYPE equal to 6
98 EH263SEIFullPictureSnapshotTag = 0x00000020,
101 encoder capability: no meaning
102 decoder capability: no meaning
103 bitstream property: existence of FTYPE equal to 7
105 EH263SEIPartialPictureSnapshotTag = 0x00000040,
108 encoder capability: no meaning
109 decoder capability: no meaning
110 bitstream property: existence of FTYPE equal to 8
112 EH263SEIVideoTimeSegmentStartTag = 0x00000080,
115 encoder capability: no meaning
116 decoder capability: no meaning
117 bitstream property: existence of FTYPE equal to 9
119 EH263SEIVideoTimeSegmentEndTag = 0x00000100,
122 encoder capability: no meaning
123 decoder capability: no meaning
124 bitstream property: existence of FTYPE equal to 10
126 EH263SEIProgressiveRefinementStartTag = 0x00000200,
129 encoder capability: no meaning
130 decoder capability: no meaning
131 bitstream property: existence of FTYPE equal to 11
133 EH263SEIProgressiveRefinementEndTag = 0x00000400,
136 encoder capability: no meaning
137 decoder capability: operation according to sublause L.14 of H.263
138 bitstream property: existence of FTYPE equal to 12
140 EH263SEIChromaKeying = 0x00000800,
143 encoder capability: use of the fixed-point IDCT algorithm specified in Annex W of H.263
144 decoder capability: use of the fixed-point IDCT algorithm specified in Annex W of H.263
145 bitstream property: existence of FTYPE equal to 13
147 EH263SEIFixedPointIDCT = 0x00001000,
150 encoder capability: no meaning
151 decoder capability: no meaning
152 bitstream property: existence of FTYPE equal to 14 and MTYPE equal to 0
154 EH263SEIArbitraryBinaryData = 0x00002000,
157 encoder capability: no meaning
158 decoder capability: no meaning
159 bitstream property: existence of FTYPE equal to 14 and MTYPE equal to 1
161 EH263SEIArbitraryText = 0x00004000,
164 encoder capability: no meaning
165 decoder capability: no meaning
166 bitstream property: existence of FTYPE equal to 14 and MTYPE equal to 2
168 EH263SEICopyrightText = 0x00008000,
171 encoder capability: no meaning
172 decoder capability: capability of display caption text as specified in subclause W.6.3.5 of H.263
173 bitstream property: existence of FTYPE equal to 14 and MTYPE equal to 3
175 EH263SEICaptionText = 0x00010000,
178 encoder capability: no meaning
179 decoder capability: no meaning
180 bitstream property: existence of FTYPE equal to 14 and MTYPE equal to 4
182 EH263SEIVideoDescriptionText = 0x00020000,
185 encoder capability: no meaning
186 decoder capability: no meaning
187 bitstream property: existence of FTYPE equal to 14 and MTYPE equal to 5
189 EH263SEIUniformResourceIdentifierText = 0x00040000,
192 encoder capability: capability to repeat the current picture header (subclause W.6.3.7 of H.263)
193 decoder capability: capability to recover a corrupted picture header with a repeated one
194 bitstream property: existence of FTYPE equal to 14 and MTYPE equal to 6
196 EH263SEICurrentPictureHeaderRepetition = 0x00080000,
199 encoder capability: capability to repeat the previous picture header (subclause W.6.3.8 of H.263)
200 decoder capability: capability to recover a corrupted or lost picture header with a repeated one
201 bitstream property: existence of FTYPE equal to 14 and MTYPE equal to 7
203 EH263SEIPreviousPictureHeaderRepetition = 0x00100000,
206 encoder capability: capability to repeat the next picture header (W.6.3.9 of H.263)
207 decoder capability: capability to recover a corrupted or lost picture header with a repeated one
208 bitstream property: existence of FTYPE equal to 14 and MTYPE equal to 8
210 EH263SEINextPictureHeaderRepetitionReliableTR = 0x00200000,
213 encoder capability: capability to repeat the next picture header (W.6.3.10 of H.263)
214 decoder capability: capability to recover a corrupted or lost picture header with a repeated one
215 bitstream property: existence of FTYPE equal to 14 and MTYPE equal to 9
217 EH263SEINextPictureHeaderRepetitionUnreliableTR = 0x00400000,
220 encoder capability: capability to encode top fields of interlaced pictures
221 decoder capability: capability to decode and display top fields of interlaced pictures (W.6.3.11of H.263)
222 bitstream property: existence of FTYPE equal to 14 and MTYPE equal to 10
224 EH263SEITopInterlacedFieldIndication = 0x00800000,
227 encoder capability: capability to encode bottom fields of interlaced pictures
228 decoder capability: capability to decode and display bottom fields of interlaced pictures (W.6.3.11of H.263)
229 bitstream property: existence of FTYPE equal to 14 and MTYPE equal to 10
231 EH263SEIBottomInterlacedFieldIndication = 0x01000000,
234 encoder capability: capability to transmit picture numbers (subclause W.6.3.12 of H.263)
235 decoder capability: capability to indicate reference picture losses from missing picture numbers
236 bitstream property: existence of FTYPE equal to 14 and MTYPE equal to 12
238 EH263SEIPictureNumber = 0x02000000,
241 encoder capability: capability to generate spare reference picture information (W.6.3.13 of H.263)
242 decoder capability: capability to use a spare reference picture in absence of real reference picture
243 bitstream property: existence of FTYPE equal to 14 and MTYPE equal to 13
245 EH263SEISpareReferencePictures = 0x04000000
250 H.263 picture header.
254 class TH263PictureHeader
258 Indicates the temporal reference. iTemporalReference is equal to the value of TR or the value
259 of (ETR << 8) + TR if ETR is present in the picture header.
261 TUint iTemporalReference;
264 iLongTermPicture equal to ETrue indicates that the picture has been marked as a long-term
265 picture according to the memory management control operation (MMCO) commands as specified
266 in Annex U of H.263. Otherwise the picture is not a long-term picture.
268 TBool iLongTermPicture;
271 iSplitScreen is equal to the value of bit 3 of PTYPE.
276 iDocumentCamera is equal to the value of bit 4 of PTYPE.
278 TBool iDocumentCamera;
281 iFreezePictureRelease is equal to the value of bit 5 of PTYPE.
283 TBool iFreezePictureRelease;
286 Indicates the picture coding type. iPictureType is set according to the picture header as one
287 of the values defined in TH263PictureType.
289 TH263PictureType iPictureType;
292 Indicates the initial value of the quantization parameter. iPQuant is equal to the value of
293 the PQUANT syntax element.
298 Indicates the presence of the extended PTYPE field in the picture layer. The extended PTYPE
299 field is specified in ITU-T Recommendation H.263 version 2 and later. iPlusPType is equal to 1
300 if bits 6 - 8 of PTYPE are equal to '111'. Otherwise, iPlusPType is equal to 0.
305 Indicates the presence of the full extended PTYPE field in the picture layer. If iPlusPType is
306 EFalse, the value of of iUpdateFullExtendedPType is not valid. Otherwise,
307 iUpdateFullExtendedPType is equal to the value of the UFEP syntax element.
309 TBool iUpdateFullExtendedPType;
312 Pixel aspect ratio numerator and denominator respectively. The pixel aspect ratio is defined as
313 iAspectRatioNum/iAspectRatioDenom, where the values are positive integers and relatively prime.
314 If iPlusPType is equal to 0, or iPlusPType is ETrue and iUpdateFullExtendedPType is ETrue and
315 bits 1 - 3 of the OPPTYPE syntax element are not equal to '110', iAspectRatioNum shall be equal
316 to 12 and iAspectRatioDenom shall be equal to 11 (as specified in subclause 4.1 of ITU-T
317 Recommendation H.263). If iPlusPType is ETrue and iUpdateFullExtendedPType is ETrue and bits
318 1 - 3 of the OPPTYPE syntax element are equal to '110', the values of iAspectRatioNum and
319 iAspectRatioDenom are set as specified in subclauses 5.1.5 and 5.1.6 of ITU-T Recommendation
320 H.263. Otherwise (iPlusPType is ETrue and iUpdateFullExtendedPType is EFalse), the values of
321 iAspectRatioNum and iAspectRatioDenom are not valid.
323 TUint iAspectRatioNum;
326 Pixel aspect ratio numerator and denominator respectively. The pixel aspect ratio is defined as
327 iAspectRatioNum/iAspectRatioDenom, where the values are positive integers and relatively prime.
328 If iPlusPType is equal to 0, or iPlusPType is ETrue and iUpdateFullExtendedPType is ETrue and
329 bits 1 - 3 of the OPPTYPE syntax element are not equal to '110', iAspectRatioNum shall be equal
330 to 12 and iAspectRatioDenom shall be equal to 11 (as specified in subclause 4.1 of ITU-T
331 Recommendation H.263). If iPlusPType is ETrue and iUpdateFullExtendedPType is ETrue and bits
332 1 - 3 of the OPPTYPE syntax element are equal to '110', the values of iAspectRatioNum and
333 iAspectRatioDenom are set as specified in subclauses 5.1.5 and 5.1.6 of ITU-T Recommendation
334 H.263. Otherwise (iPlusPType is ETrue and iUpdateFullExtendedPType is EFalse), the values of
335 iAspectRatioNum and iAspectRatioDenom are not valid.
337 TUint iAspectRatioDenom;
340 Picture clock frequency numerator and denominator respectively. The picture clock frequency
341 for temporal reference is defined as iPictureClockFrequencyRate / iPictureClockFrequencyScale
342 in floating point arithmetic and where the values are positive integers and relatively prime.
343 If iPlusPType is equal to 0, or iPlusPType is equal to 1 and iUpdateFullExtendedPType is equal
344 to 1 and bit 4 of the OPPTYPE syntax element is equal to 0, iPictureClockFrequencyRate shall be
345 equal to 30000 and iPictureClockFrequencyScale shall be equal to 1001 (as specified in subclause
346 4.1 of ITU-T Recommendation H.263). If iPlusPType is equal to 1 and iUpdateFullExtendedPType is
347 equal to 1 and bit 4 of the OPPTYPE syntax element is equal to 1, the values of
348 iPictureClockFrequencyRate and iPictureClockFrequencyScale are set as specified in subclause
349 5.1.7 of ITU-T Recommendation H.263. Otherwise (iPlusPType is equal to 1 and
350 iUpdateFullExtendedPType is equal to 0), the values of iPictureClockFrequencyRate and
351 iPictureClockFrequencyScale are not valid.
353 TUint iPictureClockFrequencyRate;
356 Picture clock frequency numerator and denominator respectively. The picture clock frequency
357 for temporal reference is defined as iPictureClockFrequencyRate / iPictureClockFrequencyScale
358 in floating point arithmetic and where the values are positive integers and relatively prime.
359 If iPlusPType is equal to 0, or iPlusPType is equal to 1 and iUpdateFullExtendedPType is equal
360 to 1 and bit 4 of the OPPTYPE syntax element is equal to 0, iPictureClockFrequencyRate shall be
361 equal to 30000 and iPictureClockFrequencyScale shall be equal to 1001 (as specified in subclause
362 4.1 of ITU-T Recommendation H.263). If iPlusPType is equal to 1 and iUpdateFullExtendedPType is
363 equal to 1 and bit 4 of the OPPTYPE syntax element is equal to 1, the values of
364 iPictureClockFrequencyRate and iPictureClockFrequencyScale are set as specified in subclause
365 5.1.7 of ITU-T Recommendation H.263. Otherwise (iPlusPType is equal to 1 and
366 iUpdateFullExtendedPType is equal to 0), the values of iPictureClockFrequencyRate and
367 iPictureClockFrequencyScale are not valid.
369 TUint iPictureClockFrequencyScale;
373 This class is used to signal decoder or encoder capabilities or bitstream properties.
377 class TH263VideoCapability
381 When part of a codec capability indication, iProfileLevel[ProfileNumber] indicates the
382 maximum processing level that a decoder or an encoder supports for a particular profile
383 indicated by ProfileNumber. A negative value indicates that the profile is not supported.
384 When part of a stream property indication, iProfileLevel[ProfileNumber] indicates the maximum
385 processing level that is present in the stream for a particular profile indicated by
386 ProfileNumber. A negative value indicates that the stream does not contain data coded according
387 to the indicated profile.
389 TInt iProfileLevel[9];
392 When equal to ETrue, indicating that it is allowed to use PLUSPTYPE (specified in the 1998
393 version of H.263) to indicate custom picture sizes or clock frequencies. When equal to EFalse,
394 PLUSPTYPE shall not be used.
396 TBool iPLUSPTYPEAllowed;
399 iSupplementalInformationCap indicates the supported supplemental enhancement functions. The
400 value is a binary OR of values from TH263SupplementalInformation.
402 TUint32 iSupplementalInformationCap;
407 This class is used to set the encoder operation mode.
415 Specifies the picture types allowed in the bitstream. The value is a binary OR of values from
416 TH263PictureType. Signaled picture types that are not included in the prevailing coding profile
419 TUint32 iAllowedPictureTypes;
422 iForceRoundingTypeToZero equal to EFalse specifies that the value of the RTYPE bit (bit 6 of
423 MPPTYPE) is not constrained. It is recommended to change the value of the RTYPE bit for each
424 reference picture in error-free communication (subclause 5.1.4.3 of ITU-T H.263 Recommendation).
425 iForceRoundingTypeToZero equal to ETrue specifies that the value of the RTYPE bit shall be equal
426 to 0 or that the RTYPE field shall not be present in the picture layer. It is recommended to set
427 iForceRoundingTypeToZero equal to ETrue (and consequently RTYPE equal to 0) in error-prone
428 communication as recommended in section 4.2.6 of H.263 Appendix III [R6] and [R7].
430 TBool iForceRoundingTypeToZero;
433 Specifies the frequency of picture header repetition as specified in this paragraph. If
434 iPictureHeaderRepetition is equal to 0, picture headers are not repeated. Otherwise, a picture
435 header is repeated, if the value of the GFID syntax element is not equal to the value of the
436 GFID syntax element of the previous picture in bitstream order. If EDuRtpPayload data unit
437 encapsulation is in use, a picture header is repeated the number of times indicated by the value
438 of iPictureHeaderRepetition in those RTP payloads of the picture where the P bit according to
439 RFC 2429 [R8] is set equal to 1 and which do not contain the original picture header. If
440 EDuElementaryStream data unit encapsulation is in use, the picture header is repeated once in
441 the supplemental enhancement information of the next picture as specified in subclause W.6.3.8
442 of ITU-T Recommendation H.263 and section 4.2.6 of H.263 Appendix III [R6].
444 TUint iPictureHeaderRepetition;
447 Specifies the interval of non-empty GOB headers in units of GOBs. The value of
448 iGOBHeaderInterval is valid if no slice structured coding mode (Annex K or Annex V) is in use.
449 If iGOBHeaderInterval is equal to 0 and an unlimited segment size is specified with the
450 SetSegmentTargetSize method, the encoder should not generate GOB headers. If iGOBHeaderInterval
451 is greater than 0 and an unlimited segment size is specified with the SetSegmentTargetSize
452 method, the encoder should generate a non-empty GOB header for every iGOBHeaderInterval-th GOB.
453 If SetSegmentTargetSize is used to set a limited segment size, the encoder should generate
454 segments (i.e., insert non-empty GOB headers) so that the length of the segment is no larger
455 than the target size in bytes and no larger than the GOB header frequency specified with the
456 value of iGOBHeaderInterval.
458 TUint iGOBHeaderInterval;
462 H.263 HRD parameters.
470 When iAnnexXConstraints is equal to EFalse, iBPPmaxKb, iB, and iRmax indicate the values of HRD
471 parameters. When iAnnexXConstraints is equal to ETrue, the values of iBPPmaxKb, iB, and iRmax in
472 this class are ignored but rather their values are specified in Annex X of ITU-T Recommendation
475 TBool iAnnexXConstraints;
478 Signals the BPPmaxKb parameter of H.263. As specified in ITU-T Recommendation H.263. The number
479 of bits created by coding any single picture shall not exceed a maximum value specified by the
480 parameter BPPmaxKb that is measured in units of 1024 bits. The minimum value of BPPmaxKb is
481 specified in Table 1 of ITU-T Recommendation H.263.
486 Signals the B parameter of H.263 Annex B. As specified in Annex B of ITU-T Recommendation H.263.
487 The value of B shall be equal to or greater than 4 * Rmax / PCF, where PCF is the picture clock
488 frequency specified in subclause 5.1.7 of ITU-T Recommendation H.263. The HRD receiving buffer
489 size is equal to (B + BPPmaxKb * 1024 bits).
494 Signals the maximum video bit rate in bits per second, i.e., the Rmax parameter of H.263 Annex B.
500 H.263 redundant picture header.
501 Points to a buffer to contain the redundant picture header in the orignal bitstream order. The
502 buffer may be used by the MSL client in playback to pass the decapsulated redundant picture header
503 from an RTP payload formatted according to RFC 2429, or used by the MSL client in recording to pass
504 the picture header to the RTP encapsulator.
508 typedef TPtr8* TH263RedundantPictureHeader;