1 | /* The copyright in this software is being made available under the BSD |
---|
2 | * License, included below. This software may be subject to other third party |
---|
3 | * and contributor rights, including patent rights, and no such rights are |
---|
4 | * granted under this license. |
---|
5 | * |
---|
6 | * Copyright (c) 2010-2015, ITU/ISO/IEC |
---|
7 | * All rights reserved. |
---|
8 | * |
---|
9 | * Redistribution and use in source and binary forms, with or without |
---|
10 | * modification, are permitted provided that the following conditions are met: |
---|
11 | * |
---|
12 | * * Redistributions of source code must retain the above copyright notice, |
---|
13 | * this list of conditions and the following disclaimer. |
---|
14 | * * Redistributions in binary form must reproduce the above copyright notice, |
---|
15 | * this list of conditions and the following disclaimer in the documentation |
---|
16 | * and/or other materials provided with the distribution. |
---|
17 | * * Neither the name of the ITU/ISO/IEC nor the names of its contributors may |
---|
18 | * be used to endorse or promote products derived from this software without |
---|
19 | * specific prior written permission. |
---|
20 | * |
---|
21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
---|
22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
---|
23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
---|
24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS |
---|
25 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
---|
26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
---|
27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
---|
28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
---|
29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
---|
30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
---|
31 | * THE POSSIBILITY OF SUCH DAMAGE. |
---|
32 | */ |
---|
33 | |
---|
34 | #ifndef __SEI__ |
---|
35 | #define __SEI__ |
---|
36 | |
---|
37 | #pragma once |
---|
38 | #include <list> |
---|
39 | #include <vector> |
---|
40 | #include <cstring> |
---|
41 | |
---|
42 | #include "TypeDef.h" |
---|
43 | #include "libmd5/MD5.h" |
---|
44 | #if SVC_EXTENSION |
---|
45 | #include "TLibCommon/NAL.h" |
---|
46 | #endif |
---|
47 | |
---|
48 | //! \ingroup TLibCommon |
---|
49 | //! \{ |
---|
50 | class TComSPS; |
---|
51 | #if O0164_MULTI_LAYER_HRD |
---|
52 | class TComHRD; |
---|
53 | #endif |
---|
54 | |
---|
55 | /** |
---|
56 | * Abstract class representing an SEI message with lightweight RTTI. |
---|
57 | */ |
---|
58 | class SEI |
---|
59 | { |
---|
60 | public: |
---|
61 | enum PayloadType |
---|
62 | { |
---|
63 | BUFFERING_PERIOD = 0, |
---|
64 | PICTURE_TIMING = 1, |
---|
65 | PAN_SCAN_RECT = 2, |
---|
66 | FILLER_PAYLOAD = 3, |
---|
67 | USER_DATA_REGISTERED_ITU_T_T35 = 4, |
---|
68 | USER_DATA_UNREGISTERED = 5, |
---|
69 | RECOVERY_POINT = 6, |
---|
70 | SCENE_INFO = 9, |
---|
71 | FULL_FRAME_SNAPSHOT = 15, |
---|
72 | PROGRESSIVE_REFINEMENT_SEGMENT_START = 16, |
---|
73 | PROGRESSIVE_REFINEMENT_SEGMENT_END = 17, |
---|
74 | FILM_GRAIN_CHARACTERISTICS = 19, |
---|
75 | POST_FILTER_HINT = 22, |
---|
76 | TONE_MAPPING_INFO = 23, |
---|
77 | FRAME_PACKING = 45, |
---|
78 | DISPLAY_ORIENTATION = 47, |
---|
79 | SOP_DESCRIPTION = 128, |
---|
80 | ACTIVE_PARAMETER_SETS = 129, |
---|
81 | DECODING_UNIT_INFO = 130, |
---|
82 | TEMPORAL_LEVEL0_INDEX = 131, |
---|
83 | DECODED_PICTURE_HASH = 132, |
---|
84 | SCALABLE_NESTING = 133, |
---|
85 | REGION_REFRESH_INFO = 134, |
---|
86 | NO_DISPLAY = 135, |
---|
87 | TIME_CODE = 136, |
---|
88 | MASTERING_DISPLAY_COLOUR_VOLUME = 137, |
---|
89 | SEGM_RECT_FRAME_PACKING = 138, |
---|
90 | TEMP_MOTION_CONSTRAINED_TILE_SETS = 139, |
---|
91 | CHROMA_SAMPLING_FILTER_HINT = 140, |
---|
92 | KNEE_FUNCTION_INFO = 141, |
---|
93 | #if Q0074_COLOUR_REMAPPING_SEI |
---|
94 | COLOUR_REMAPPING_INFO = 142, |
---|
95 | #endif |
---|
96 | #if LAYERS_NOT_PRESENT_SEI |
---|
97 | LAYERS_NOT_PRESENT = 160, |
---|
98 | #endif |
---|
99 | #if N0383_IL_CONSTRAINED_TILE_SETS_SEI |
---|
100 | INTER_LAYER_CONSTRAINED_TILE_SETS = 161, |
---|
101 | #endif |
---|
102 | #if O0164_MULTI_LAYER_HRD |
---|
103 | BSP_NESTING = 162, |
---|
104 | BSP_INITIAL_ARRIVAL_TIME = 163, |
---|
105 | #endif |
---|
106 | #if SUB_BITSTREAM_PROPERTY_SEI |
---|
107 | SUB_BITSTREAM_PROPERTY = 164, |
---|
108 | #endif |
---|
109 | #if P0123_ALPHA_CHANNEL_SEI |
---|
110 | ALPHA_CHANNEL_INFO = 165, |
---|
111 | #endif |
---|
112 | #if Q0096_OVERLAY_SEI |
---|
113 | OVERLAY_INFO = 166, |
---|
114 | #endif |
---|
115 | #if Q0189_TMVP_CONSTRAINTS |
---|
116 | TMVP_CONSTRAINTS = 167, |
---|
117 | #endif |
---|
118 | #if Q0247_FRAME_FIELD_INFO |
---|
119 | FRAME_FIELD_INFO = 168, |
---|
120 | #endif |
---|
121 | }; |
---|
122 | |
---|
123 | SEI() {} |
---|
124 | virtual ~SEI() {} |
---|
125 | |
---|
126 | static const Char *getSEIMessageString(SEI::PayloadType payloadType); |
---|
127 | |
---|
128 | virtual PayloadType payloadType() const = 0; |
---|
129 | }; |
---|
130 | |
---|
131 | static const UInt ISO_IEC_11578_LEN=16; |
---|
132 | |
---|
133 | class SEIuserDataUnregistered : public SEI |
---|
134 | { |
---|
135 | public: |
---|
136 | PayloadType payloadType() const { return USER_DATA_UNREGISTERED; } |
---|
137 | |
---|
138 | SEIuserDataUnregistered() |
---|
139 | : userData(0) |
---|
140 | {} |
---|
141 | |
---|
142 | virtual ~SEIuserDataUnregistered() |
---|
143 | { |
---|
144 | delete userData; |
---|
145 | } |
---|
146 | |
---|
147 | UChar uuid_iso_iec_11578[ISO_IEC_11578_LEN]; |
---|
148 | UInt userDataLength; |
---|
149 | UChar *userData; |
---|
150 | }; |
---|
151 | |
---|
152 | class SEIDecodedPictureHash : public SEI |
---|
153 | { |
---|
154 | public: |
---|
155 | PayloadType payloadType() const { return DECODED_PICTURE_HASH; } |
---|
156 | |
---|
157 | SEIDecodedPictureHash() {} |
---|
158 | virtual ~SEIDecodedPictureHash() {} |
---|
159 | |
---|
160 | enum Method |
---|
161 | { |
---|
162 | MD5, |
---|
163 | CRC, |
---|
164 | CHECKSUM, |
---|
165 | RESERVED, |
---|
166 | } method; |
---|
167 | |
---|
168 | TComDigest m_digest; |
---|
169 | }; |
---|
170 | |
---|
171 | class SEIActiveParameterSets : public SEI |
---|
172 | { |
---|
173 | public: |
---|
174 | PayloadType payloadType() const { return ACTIVE_PARAMETER_SETS; } |
---|
175 | |
---|
176 | SEIActiveParameterSets() |
---|
177 | : activeVPSId (0) |
---|
178 | , m_selfContainedCvsFlag (false) |
---|
179 | , m_noParameterSetUpdateFlag (false) |
---|
180 | , numSpsIdsMinus1 (0) |
---|
181 | {} |
---|
182 | virtual ~SEIActiveParameterSets() {} |
---|
183 | |
---|
184 | Int activeVPSId; |
---|
185 | Bool m_selfContainedCvsFlag; |
---|
186 | Bool m_noParameterSetUpdateFlag; |
---|
187 | Int numSpsIdsMinus1; |
---|
188 | std::vector<Int> activeSeqParameterSetId; |
---|
189 | #if R0247_SEI_ACTIVE |
---|
190 | std::vector<Int> layerSpsIdx; |
---|
191 | #endif |
---|
192 | }; |
---|
193 | |
---|
194 | class SEIBufferingPeriod : public SEI |
---|
195 | { |
---|
196 | public: |
---|
197 | PayloadType payloadType() const { return BUFFERING_PERIOD; } |
---|
198 | |
---|
199 | SEIBufferingPeriod() |
---|
200 | : m_bpSeqParameterSetId (0) |
---|
201 | , m_rapCpbParamsPresentFlag (false) |
---|
202 | , m_cpbDelayOffset (0) |
---|
203 | , m_dpbDelayOffset (0) |
---|
204 | #if P0138_USE_ALT_CPB_PARAMS_FLAG |
---|
205 | , m_useAltCpbParamsFlagPresent(false) |
---|
206 | , m_useAltCpbParamsFlag (false) |
---|
207 | #endif |
---|
208 | { |
---|
209 | ::memset(m_initialCpbRemovalDelay, 0, sizeof(m_initialCpbRemovalDelay)); |
---|
210 | ::memset(m_initialCpbRemovalDelayOffset, 0, sizeof(m_initialCpbRemovalDelayOffset)); |
---|
211 | ::memset(m_initialAltCpbRemovalDelay, 0, sizeof(m_initialAltCpbRemovalDelay)); |
---|
212 | ::memset(m_initialAltCpbRemovalDelayOffset, 0, sizeof(m_initialAltCpbRemovalDelayOffset)); |
---|
213 | } |
---|
214 | virtual ~SEIBufferingPeriod() {} |
---|
215 | |
---|
216 | UInt m_bpSeqParameterSetId; |
---|
217 | Bool m_rapCpbParamsPresentFlag; |
---|
218 | UInt m_cpbDelayOffset; |
---|
219 | UInt m_dpbDelayOffset; |
---|
220 | UInt m_initialCpbRemovalDelay [MAX_CPB_CNT][2]; |
---|
221 | UInt m_initialCpbRemovalDelayOffset [MAX_CPB_CNT][2]; |
---|
222 | UInt m_initialAltCpbRemovalDelay [MAX_CPB_CNT][2]; |
---|
223 | UInt m_initialAltCpbRemovalDelayOffset[MAX_CPB_CNT][2]; |
---|
224 | Bool m_concatenationFlag; |
---|
225 | UInt m_auCpbRemovalDelayDelta; |
---|
226 | #if P0138_USE_ALT_CPB_PARAMS_FLAG |
---|
227 | Bool m_useAltCpbParamsFlagPresent; |
---|
228 | Bool m_useAltCpbParamsFlag; |
---|
229 | #endif |
---|
230 | }; |
---|
231 | class SEIPictureTiming : public SEI |
---|
232 | { |
---|
233 | public: |
---|
234 | PayloadType payloadType() const { return PICTURE_TIMING; } |
---|
235 | |
---|
236 | SEIPictureTiming() |
---|
237 | : m_picStruct (0) |
---|
238 | , m_sourceScanType (0) |
---|
239 | , m_duplicateFlag (false) |
---|
240 | , m_picDpbOutputDuDelay (0) |
---|
241 | , m_numNalusInDuMinus1 (NULL) |
---|
242 | , m_duCpbRemovalDelayMinus1 (NULL) |
---|
243 | {} |
---|
244 | virtual ~SEIPictureTiming() |
---|
245 | { |
---|
246 | if( m_numNalusInDuMinus1 != NULL ) |
---|
247 | { |
---|
248 | delete m_numNalusInDuMinus1; |
---|
249 | } |
---|
250 | if( m_duCpbRemovalDelayMinus1 != NULL ) |
---|
251 | { |
---|
252 | delete m_duCpbRemovalDelayMinus1; |
---|
253 | } |
---|
254 | } |
---|
255 | |
---|
256 | UInt m_picStruct; |
---|
257 | UInt m_sourceScanType; |
---|
258 | Bool m_duplicateFlag; |
---|
259 | |
---|
260 | UInt m_auCpbRemovalDelay; |
---|
261 | UInt m_picDpbOutputDelay; |
---|
262 | UInt m_picDpbOutputDuDelay; |
---|
263 | UInt m_numDecodingUnitsMinus1; |
---|
264 | Bool m_duCommonCpbRemovalDelayFlag; |
---|
265 | UInt m_duCommonCpbRemovalDelayMinus1; |
---|
266 | UInt* m_numNalusInDuMinus1; |
---|
267 | UInt* m_duCpbRemovalDelayMinus1; |
---|
268 | }; |
---|
269 | |
---|
270 | class SEIDecodingUnitInfo : public SEI |
---|
271 | { |
---|
272 | public: |
---|
273 | PayloadType payloadType() const { return DECODING_UNIT_INFO; } |
---|
274 | |
---|
275 | SEIDecodingUnitInfo() |
---|
276 | : m_decodingUnitIdx(0) |
---|
277 | , m_duSptCpbRemovalDelay(0) |
---|
278 | , m_dpbOutputDuDelayPresentFlag(false) |
---|
279 | , m_picSptDpbOutputDuDelay(0) |
---|
280 | {} |
---|
281 | virtual ~SEIDecodingUnitInfo() {} |
---|
282 | Int m_decodingUnitIdx; |
---|
283 | Int m_duSptCpbRemovalDelay; |
---|
284 | Bool m_dpbOutputDuDelayPresentFlag; |
---|
285 | Int m_picSptDpbOutputDuDelay; |
---|
286 | }; |
---|
287 | |
---|
288 | class SEIRecoveryPoint : public SEI |
---|
289 | { |
---|
290 | public: |
---|
291 | PayloadType payloadType() const { return RECOVERY_POINT; } |
---|
292 | |
---|
293 | SEIRecoveryPoint() {} |
---|
294 | virtual ~SEIRecoveryPoint() {} |
---|
295 | |
---|
296 | Int m_recoveryPocCnt; |
---|
297 | Bool m_exactMatchingFlag; |
---|
298 | Bool m_brokenLinkFlag; |
---|
299 | }; |
---|
300 | |
---|
301 | class SEIFramePacking : public SEI |
---|
302 | { |
---|
303 | public: |
---|
304 | PayloadType payloadType() const { return FRAME_PACKING; } |
---|
305 | |
---|
306 | SEIFramePacking() {} |
---|
307 | virtual ~SEIFramePacking() {} |
---|
308 | |
---|
309 | Int m_arrangementId; |
---|
310 | Bool m_arrangementCancelFlag; |
---|
311 | Int m_arrangementType; |
---|
312 | Bool m_quincunxSamplingFlag; |
---|
313 | Int m_contentInterpretationType; |
---|
314 | Bool m_spatialFlippingFlag; |
---|
315 | Bool m_frame0FlippedFlag; |
---|
316 | Bool m_fieldViewsFlag; |
---|
317 | Bool m_currentFrameIsFrame0Flag; |
---|
318 | Bool m_frame0SelfContainedFlag; |
---|
319 | Bool m_frame1SelfContainedFlag; |
---|
320 | Int m_frame0GridPositionX; |
---|
321 | Int m_frame0GridPositionY; |
---|
322 | Int m_frame1GridPositionX; |
---|
323 | Int m_frame1GridPositionY; |
---|
324 | Int m_arrangementReservedByte; |
---|
325 | Bool m_arrangementPersistenceFlag; |
---|
326 | Bool m_upsampledAspectRatio; |
---|
327 | }; |
---|
328 | |
---|
329 | class SEISegmentedRectFramePacking : public SEI |
---|
330 | { |
---|
331 | public: |
---|
332 | PayloadType payloadType() const { return SEGM_RECT_FRAME_PACKING; } |
---|
333 | |
---|
334 | SEISegmentedRectFramePacking() {} |
---|
335 | virtual ~SEISegmentedRectFramePacking() {} |
---|
336 | |
---|
337 | Bool m_arrangementCancelFlag; |
---|
338 | Int m_contentInterpretationType; |
---|
339 | Bool m_arrangementPersistenceFlag; |
---|
340 | }; |
---|
341 | |
---|
342 | class SEIDisplayOrientation : public SEI |
---|
343 | { |
---|
344 | public: |
---|
345 | PayloadType payloadType() const { return DISPLAY_ORIENTATION; } |
---|
346 | |
---|
347 | SEIDisplayOrientation() |
---|
348 | : cancelFlag(true) |
---|
349 | , persistenceFlag(0) |
---|
350 | , extensionFlag(false) |
---|
351 | {} |
---|
352 | virtual ~SEIDisplayOrientation() {} |
---|
353 | |
---|
354 | Bool cancelFlag; |
---|
355 | Bool horFlip; |
---|
356 | Bool verFlip; |
---|
357 | |
---|
358 | UInt anticlockwiseRotation; |
---|
359 | Bool persistenceFlag; |
---|
360 | Bool extensionFlag; |
---|
361 | }; |
---|
362 | |
---|
363 | class SEITemporalLevel0Index : public SEI |
---|
364 | { |
---|
365 | public: |
---|
366 | PayloadType payloadType() const { return TEMPORAL_LEVEL0_INDEX; } |
---|
367 | |
---|
368 | SEITemporalLevel0Index() |
---|
369 | : tl0Idx(0) |
---|
370 | , rapIdx(0) |
---|
371 | {} |
---|
372 | virtual ~SEITemporalLevel0Index() {} |
---|
373 | |
---|
374 | UInt tl0Idx; |
---|
375 | UInt rapIdx; |
---|
376 | }; |
---|
377 | |
---|
378 | class SEIGradualDecodingRefreshInfo : public SEI |
---|
379 | { |
---|
380 | public: |
---|
381 | PayloadType payloadType() const { return REGION_REFRESH_INFO; } |
---|
382 | |
---|
383 | SEIGradualDecodingRefreshInfo() |
---|
384 | : m_gdrForegroundFlag(0) |
---|
385 | {} |
---|
386 | virtual ~SEIGradualDecodingRefreshInfo() {} |
---|
387 | |
---|
388 | Bool m_gdrForegroundFlag; |
---|
389 | }; |
---|
390 | |
---|
391 | class SEINoDisplay : public SEI |
---|
392 | { |
---|
393 | public: |
---|
394 | PayloadType payloadType() const { return NO_DISPLAY; } |
---|
395 | |
---|
396 | SEINoDisplay() |
---|
397 | : m_noDisplay(false) |
---|
398 | {} |
---|
399 | virtual ~SEINoDisplay() {} |
---|
400 | |
---|
401 | Bool m_noDisplay; |
---|
402 | }; |
---|
403 | |
---|
404 | class SEISOPDescription : public SEI |
---|
405 | { |
---|
406 | public: |
---|
407 | PayloadType payloadType() const { return SOP_DESCRIPTION; } |
---|
408 | |
---|
409 | SEISOPDescription() {} |
---|
410 | virtual ~SEISOPDescription() {} |
---|
411 | |
---|
412 | UInt m_sopSeqParameterSetId; |
---|
413 | UInt m_numPicsInSopMinus1; |
---|
414 | |
---|
415 | UInt m_sopDescVclNaluType[MAX_NUM_PICS_IN_SOP]; |
---|
416 | UInt m_sopDescTemporalId[MAX_NUM_PICS_IN_SOP]; |
---|
417 | UInt m_sopDescStRpsIdx[MAX_NUM_PICS_IN_SOP]; |
---|
418 | Int m_sopDescPocDelta[MAX_NUM_PICS_IN_SOP]; |
---|
419 | }; |
---|
420 | |
---|
421 | class SEIToneMappingInfo : public SEI |
---|
422 | { |
---|
423 | public: |
---|
424 | PayloadType payloadType() const { return TONE_MAPPING_INFO; } |
---|
425 | SEIToneMappingInfo() {} |
---|
426 | virtual ~SEIToneMappingInfo() {} |
---|
427 | |
---|
428 | Int m_toneMapId; |
---|
429 | Bool m_toneMapCancelFlag; |
---|
430 | Bool m_toneMapPersistenceFlag; |
---|
431 | Int m_codedDataBitDepth; |
---|
432 | Int m_targetBitDepth; |
---|
433 | Int m_modelId; |
---|
434 | Int m_minValue; |
---|
435 | Int m_maxValue; |
---|
436 | Int m_sigmoidMidpoint; |
---|
437 | Int m_sigmoidWidth; |
---|
438 | std::vector<Int> m_startOfCodedInterval; |
---|
439 | Int m_numPivots; |
---|
440 | std::vector<Int> m_codedPivotValue; |
---|
441 | std::vector<Int> m_targetPivotValue; |
---|
442 | Int m_cameraIsoSpeedIdc; |
---|
443 | Int m_cameraIsoSpeedValue; |
---|
444 | Int m_exposureIndexIdc; |
---|
445 | Int m_exposureIndexValue; |
---|
446 | Bool m_exposureCompensationValueSignFlag; |
---|
447 | Int m_exposureCompensationValueNumerator; |
---|
448 | Int m_exposureCompensationValueDenomIdc; |
---|
449 | Int m_refScreenLuminanceWhite; |
---|
450 | Int m_extendedRangeWhiteLevel; |
---|
451 | Int m_nominalBlackLevelLumaCodeValue; |
---|
452 | Int m_nominalWhiteLevelLumaCodeValue; |
---|
453 | Int m_extendedWhiteLevelLumaCodeValue; |
---|
454 | }; |
---|
455 | |
---|
456 | class SEIKneeFunctionInfo : public SEI |
---|
457 | { |
---|
458 | public: |
---|
459 | PayloadType payloadType() const { return KNEE_FUNCTION_INFO; } |
---|
460 | SEIKneeFunctionInfo() {} |
---|
461 | virtual ~SEIKneeFunctionInfo() {} |
---|
462 | |
---|
463 | Int m_kneeId; |
---|
464 | Bool m_kneeCancelFlag; |
---|
465 | Bool m_kneePersistenceFlag; |
---|
466 | Int m_kneeInputDrange; |
---|
467 | Int m_kneeInputDispLuminance; |
---|
468 | Int m_kneeOutputDrange; |
---|
469 | Int m_kneeOutputDispLuminance; |
---|
470 | Int m_kneeNumKneePointsMinus1; |
---|
471 | std::vector<Int> m_kneeInputKneePoint; |
---|
472 | std::vector<Int> m_kneeOutputKneePoint; |
---|
473 | }; |
---|
474 | |
---|
475 | class SEIChromaSamplingFilterHint : public SEI |
---|
476 | { |
---|
477 | public: |
---|
478 | PayloadType payloadType() const {return CHROMA_SAMPLING_FILTER_HINT;} |
---|
479 | SEIChromaSamplingFilterHint() {} |
---|
480 | virtual ~SEIChromaSamplingFilterHint() { |
---|
481 | if(m_verChromaFilterIdc == 1) |
---|
482 | { |
---|
483 | for(Int i = 0; i < m_numVerticalFilters; i ++) |
---|
484 | { |
---|
485 | free(m_verFilterCoeff[i]); |
---|
486 | } |
---|
487 | free(m_verFilterCoeff); |
---|
488 | free(m_verTapLengthMinus1); |
---|
489 | } |
---|
490 | if(m_horChromaFilterIdc == 1) |
---|
491 | { |
---|
492 | for(Int i = 0; i < m_numHorizontalFilters; i ++) |
---|
493 | { |
---|
494 | free(m_horFilterCoeff[i]); |
---|
495 | } |
---|
496 | free(m_horFilterCoeff); |
---|
497 | free(m_horTapLengthMinus1); |
---|
498 | } |
---|
499 | } |
---|
500 | |
---|
501 | Int m_verChromaFilterIdc; |
---|
502 | Int m_horChromaFilterIdc; |
---|
503 | Bool m_verFilteringProcessFlag; |
---|
504 | Int m_targetFormatIdc; |
---|
505 | Bool m_perfectReconstructionFlag; |
---|
506 | Int m_numVerticalFilters; |
---|
507 | Int* m_verTapLengthMinus1; |
---|
508 | Int** m_verFilterCoeff; |
---|
509 | Int m_numHorizontalFilters; |
---|
510 | Int* m_horTapLengthMinus1; |
---|
511 | Int** m_horFilterCoeff; |
---|
512 | }; |
---|
513 | |
---|
514 | class SEIMasteringDisplayColourVolume : public SEI |
---|
515 | { |
---|
516 | public: |
---|
517 | PayloadType payloadType() const { return MASTERING_DISPLAY_COLOUR_VOLUME; } |
---|
518 | SEIMasteringDisplayColourVolume() {} |
---|
519 | virtual ~SEIMasteringDisplayColourVolume(){} |
---|
520 | |
---|
521 | TComSEIMasteringDisplay values; |
---|
522 | }; |
---|
523 | |
---|
524 | typedef std::list<SEI*> SEIMessages; |
---|
525 | |
---|
526 | /// output a selection of SEI messages by payload type. Ownership stays in original message list. |
---|
527 | SEIMessages getSeisByType(SEIMessages &seiList, SEI::PayloadType seiType); |
---|
528 | |
---|
529 | /// remove a selection of SEI messages by payload type from the original list and return them in a new list. |
---|
530 | SEIMessages extractSeisByType(SEIMessages &seiList, SEI::PayloadType seiType); |
---|
531 | |
---|
532 | /// delete list of SEI messages (freeing the referenced objects) |
---|
533 | Void deleteSEIs (SEIMessages &seiList); |
---|
534 | |
---|
535 | class SEIScalableNesting : public SEI |
---|
536 | { |
---|
537 | public: |
---|
538 | PayloadType payloadType() const { return SCALABLE_NESTING; } |
---|
539 | |
---|
540 | SEIScalableNesting() {} |
---|
541 | virtual ~SEIScalableNesting() |
---|
542 | { |
---|
543 | if (!m_callerOwnsSEIs) |
---|
544 | { |
---|
545 | deleteSEIs(m_nestedSEIs); |
---|
546 | } |
---|
547 | } |
---|
548 | |
---|
549 | Bool m_bitStreamSubsetFlag; |
---|
550 | Bool m_nestingOpFlag; |
---|
551 | Bool m_defaultOpFlag; //value valid if m_nestingOpFlag != 0 |
---|
552 | UInt m_nestingNumOpsMinus1; // -"- |
---|
553 | UInt m_nestingMaxTemporalIdPlus1[MAX_TLAYER]; // -"- |
---|
554 | UInt m_nestingOpIdx[MAX_NESTING_NUM_OPS]; // -"- |
---|
555 | |
---|
556 | Bool m_allLayersFlag; //value valid if m_nestingOpFlag == 0 |
---|
557 | UInt m_nestingNoOpMaxTemporalIdPlus1; //value valid if m_nestingOpFlag == 0 and m_allLayersFlag == 0 |
---|
558 | UInt m_nestingNumLayersMinus1; //value valid if m_nestingOpFlag == 0 and m_allLayersFlag == 0 |
---|
559 | UChar m_nestingLayerId[MAX_NESTING_NUM_LAYER]; //value valid if m_nestingOpFlag == 0 and m_allLayersFlag == 0. This can e.g. be a static array of 64 UChar values |
---|
560 | |
---|
561 | Bool m_callerOwnsSEIs; |
---|
562 | SEIMessages m_nestedSEIs; |
---|
563 | }; |
---|
564 | |
---|
565 | class SEITimeCode : public SEI |
---|
566 | { |
---|
567 | public: |
---|
568 | PayloadType payloadType() const { return TIME_CODE; } |
---|
569 | SEITimeCode() {} |
---|
570 | virtual ~SEITimeCode(){} |
---|
571 | |
---|
572 | UInt numClockTs; |
---|
573 | TComSEITimeSet timeSetArray[MAX_TIMECODE_SEI_SETS]; |
---|
574 | }; |
---|
575 | |
---|
576 | //definition according to P1005_v1; |
---|
577 | class SEITempMotionConstrainedTileSets: public SEI |
---|
578 | { |
---|
579 | struct TileSetData |
---|
580 | { |
---|
581 | protected: |
---|
582 | std::vector<Int> m_top_left_tile_index; //[tileSetIdx][tileIdx]; |
---|
583 | std::vector<Int> m_bottom_right_tile_index; |
---|
584 | |
---|
585 | public: |
---|
586 | Int m_mcts_id; |
---|
587 | Bool m_display_tile_set_flag; |
---|
588 | Int m_num_tile_rects_in_set; //_minus1; |
---|
589 | Bool m_exact_sample_value_match_flag; |
---|
590 | Bool m_mcts_tier_level_idc_present_flag; |
---|
591 | Bool m_mcts_tier_flag; |
---|
592 | Int m_mcts_level_idc; |
---|
593 | |
---|
594 | Void setNumberOfTileRects(const Int number) |
---|
595 | { |
---|
596 | m_top_left_tile_index .resize(number); |
---|
597 | m_bottom_right_tile_index.resize(number); |
---|
598 | } |
---|
599 | |
---|
600 | Int getNumberOfTileRects() const |
---|
601 | { |
---|
602 | assert(m_top_left_tile_index.size() == m_bottom_right_tile_index.size()); |
---|
603 | return Int(m_top_left_tile_index.size()); |
---|
604 | } |
---|
605 | |
---|
606 | Int &topLeftTileIndex (const Int tileRectIndex) { return m_top_left_tile_index [tileRectIndex]; } |
---|
607 | Int &bottomRightTileIndex(const Int tileRectIndex) { return m_bottom_right_tile_index[tileRectIndex]; } |
---|
608 | const Int &topLeftTileIndex (const Int tileRectIndex) const { return m_top_left_tile_index [tileRectIndex]; } |
---|
609 | const Int &bottomRightTileIndex(const Int tileRectIndex) const { return m_bottom_right_tile_index[tileRectIndex]; } |
---|
610 | }; |
---|
611 | |
---|
612 | protected: |
---|
613 | std::vector<TileSetData> m_tile_set_data; |
---|
614 | |
---|
615 | public: |
---|
616 | |
---|
617 | Bool m_mc_all_tiles_exact_sample_value_match_flag; |
---|
618 | Bool m_each_tile_one_tile_set_flag; |
---|
619 | Bool m_limited_tile_set_display_flag; |
---|
620 | Bool m_max_mcs_tier_level_idc_present_flag; |
---|
621 | Bool m_max_mcts_tier_flag; |
---|
622 | Int m_max_mcts_level_idc; |
---|
623 | |
---|
624 | PayloadType payloadType() const { return TEMP_MOTION_CONSTRAINED_TILE_SETS; } |
---|
625 | |
---|
626 | Void setNumberOfTileSets(const Int number) { m_tile_set_data.resize(number); } |
---|
627 | Int getNumberOfTileSets() const { return Int(m_tile_set_data.size()); } |
---|
628 | |
---|
629 | TileSetData &tileSetData (const Int index) { return m_tile_set_data[index]; } |
---|
630 | const TileSetData &tileSetData (const Int index) const { return m_tile_set_data[index]; } |
---|
631 | |
---|
632 | }; |
---|
633 | |
---|
634 | #if P0123_ALPHA_CHANNEL_SEI |
---|
635 | class SEIAlphaChannelInfo : public SEI |
---|
636 | { |
---|
637 | public: |
---|
638 | PayloadType payloadType() const { return ALPHA_CHANNEL_INFO; } |
---|
639 | SEIAlphaChannelInfo() {} |
---|
640 | virtual ~SEIAlphaChannelInfo() {} |
---|
641 | Bool m_alphaChannelCancelFlag; |
---|
642 | UInt m_alphaChannelUseIdc; |
---|
643 | UInt m_alphaChannelBitDepthMinus8; |
---|
644 | UInt m_alphaTransparentValue; |
---|
645 | UInt m_alphaOpaqueValue; |
---|
646 | Bool m_alphaChannelIncrFlag; |
---|
647 | Bool m_alphaChannelClipFlag; |
---|
648 | Bool m_alphaChannelClipTypeFlag; |
---|
649 | }; |
---|
650 | #endif |
---|
651 | |
---|
652 | #if Q0096_OVERLAY_SEI |
---|
653 | class SEIOverlayInfo : public SEI |
---|
654 | { |
---|
655 | public: |
---|
656 | PayloadType payloadType() const { return OVERLAY_INFO; } |
---|
657 | SEIOverlayInfo() |
---|
658 | : m_numOverlaysMinus1(-1) |
---|
659 | {} |
---|
660 | |
---|
661 | virtual ~SEIOverlayInfo() |
---|
662 | { |
---|
663 | for (Int i=0 ; i<=m_numOverlaysMinus1 ; i++) |
---|
664 | { |
---|
665 | delete [] m_overlayLanguage[i]; |
---|
666 | delete [] m_overlayName[i]; |
---|
667 | for (Int j=0 ; j<=m_numOverlayElementsMinus1[i] ; j++) |
---|
668 | { |
---|
669 | delete [] m_overlayElementName[i][j]; |
---|
670 | } |
---|
671 | } |
---|
672 | } |
---|
673 | |
---|
674 | Bool m_overlayInfoCancelFlag; |
---|
675 | UInt m_overlayContentAuxIdMinus128; |
---|
676 | UInt m_overlayLabelAuxIdMinus128; |
---|
677 | UInt m_overlayAlphaAuxIdMinus128; |
---|
678 | UInt m_overlayElementLabelValueLengthMinus8; |
---|
679 | UInt m_numOverlaysMinus1; |
---|
680 | std::vector<UInt> m_overlayIdx; |
---|
681 | std::vector<Bool> m_languageOverlayPresentFlag; |
---|
682 | std::vector<UInt> m_overlayContentLayerId; |
---|
683 | std::vector<Bool> m_overlayLabelPresentFlag; |
---|
684 | std::vector<UInt> m_overlayLabelLayerId; |
---|
685 | std::vector<Bool> m_overlayAlphaPresentFlag; |
---|
686 | std::vector<UInt> m_overlayAlphaLayerId; |
---|
687 | std::vector<UInt> m_numOverlayElementsMinus1; |
---|
688 | std::vector< std::vector<UInt> > m_overlayElementLabelMin; |
---|
689 | std::vector< std::vector<UInt> > m_overlayElementLabelMax; |
---|
690 | std::vector<UChar*> m_overlayLanguage; |
---|
691 | std::vector<UInt> m_overlayLanguageLength; |
---|
692 | std::vector<UChar*> m_overlayName; |
---|
693 | std::vector<UInt> m_overlayNameLength; |
---|
694 | std::vector< std::vector<UChar*> > m_overlayElementName; |
---|
695 | std::vector< std::vector<UInt> > m_overlayElementNameLength; |
---|
696 | Bool m_overlayInfoPersistenceFlag; |
---|
697 | }; |
---|
698 | #endif |
---|
699 | |
---|
700 | #if LAYERS_NOT_PRESENT_SEI |
---|
701 | class SEILayersNotPresent : public SEI |
---|
702 | { |
---|
703 | public: |
---|
704 | PayloadType payloadType() const { return LAYERS_NOT_PRESENT; } |
---|
705 | |
---|
706 | SEILayersNotPresent() {} |
---|
707 | virtual ~SEILayersNotPresent() {} |
---|
708 | |
---|
709 | UInt m_activeVpsId; |
---|
710 | UInt m_vpsMaxLayers; |
---|
711 | Bool m_layerNotPresentFlag[MAX_LAYERS]; |
---|
712 | }; |
---|
713 | #endif |
---|
714 | |
---|
715 | #if Q0074_COLOUR_REMAPPING_SEI |
---|
716 | class SEIColourRemappingInfo : public SEI |
---|
717 | { |
---|
718 | public: |
---|
719 | PayloadType payloadType() const { return COLOUR_REMAPPING_INFO; } |
---|
720 | SEIColourRemappingInfo() {} |
---|
721 | ~SEIColourRemappingInfo() {} |
---|
722 | |
---|
723 | Void copyFrom( SEIColourRemappingInfo const * SeiCriInput); |
---|
724 | |
---|
725 | Int m_colourRemapId; |
---|
726 | Bool m_colourRemapCancelFlag; |
---|
727 | Bool m_colourRemapPersistenceFlag; |
---|
728 | Bool m_colourRemapVideoSignalInfoPresentFlag; |
---|
729 | Bool m_colourRemapFullRangeFlag; |
---|
730 | Int m_colourRemapPrimaries; |
---|
731 | Int m_colourRemapTransferFunction; |
---|
732 | Int m_colourRemapMatrixCoefficients; |
---|
733 | Int m_colourRemapInputBitDepth; |
---|
734 | Int m_colourRemapBitDepth; |
---|
735 | Int m_preLutNumValMinus1[3]; |
---|
736 | std::vector<Int> m_preLutCodedValue[3]; |
---|
737 | std::vector<Int> m_preLutTargetValue[3]; |
---|
738 | Bool m_colourRemapMatrixPresentFlag; |
---|
739 | Int m_log2MatrixDenom; |
---|
740 | Int m_colourRemapCoeffs[3][3]; |
---|
741 | Int m_postLutNumValMinus1[3]; |
---|
742 | std::vector<Int> m_postLutCodedValue[3]; |
---|
743 | std::vector<Int> m_postLutTargetValue[3]; |
---|
744 | }; |
---|
745 | #endif |
---|
746 | |
---|
747 | #if N0383_IL_CONSTRAINED_TILE_SETS_SEI |
---|
748 | class SEIInterLayerConstrainedTileSets : public SEI |
---|
749 | { |
---|
750 | public: |
---|
751 | PayloadType payloadType() const { return INTER_LAYER_CONSTRAINED_TILE_SETS; } |
---|
752 | |
---|
753 | SEIInterLayerConstrainedTileSets() {} |
---|
754 | virtual ~SEIInterLayerConstrainedTileSets() {} |
---|
755 | |
---|
756 | Bool m_ilAllTilesExactSampleValueMatchFlag; |
---|
757 | Bool m_ilOneTilePerTileSetFlag; |
---|
758 | UInt m_ilNumSetsInMessageMinus1; |
---|
759 | Bool m_skippedTileSetPresentFlag; |
---|
760 | UInt m_ilctsId[256]; |
---|
761 | UInt m_ilNumTileRectsInSetMinus1[256]; |
---|
762 | UInt m_ilTopLeftTileIndex[256][440]; |
---|
763 | UInt m_ilBottomRightTileIndex[256][440]; |
---|
764 | UInt m_ilcIdc[256]; |
---|
765 | Bool m_ilExactSampleValueMatchFlag[256]; |
---|
766 | UInt m_allTilesIlcIdc; |
---|
767 | }; |
---|
768 | #endif |
---|
769 | |
---|
770 | #if SUB_BITSTREAM_PROPERTY_SEI |
---|
771 | class SEISubBitstreamProperty : public SEI |
---|
772 | { |
---|
773 | public: |
---|
774 | PayloadType payloadType() const { return SUB_BITSTREAM_PROPERTY; } |
---|
775 | |
---|
776 | SEISubBitstreamProperty(); |
---|
777 | virtual ~SEISubBitstreamProperty() {} |
---|
778 | |
---|
779 | Int m_activeVpsId; |
---|
780 | Int m_numAdditionalSubStreams; |
---|
781 | Int m_subBitstreamMode [MAX_SUB_STREAMS]; |
---|
782 | Int m_outputLayerSetIdxToVps [MAX_SUB_STREAMS]; |
---|
783 | Int m_highestSublayerId [MAX_SUB_STREAMS]; |
---|
784 | Int m_avgBitRate [MAX_SUB_STREAMS]; |
---|
785 | Int m_maxBitRate [MAX_SUB_STREAMS]; |
---|
786 | }; |
---|
787 | #endif |
---|
788 | |
---|
789 | #if Q0189_TMVP_CONSTRAINTS |
---|
790 | class SEITMVPConstrains : public SEI |
---|
791 | { |
---|
792 | public: |
---|
793 | PayloadType payloadType() const { return TMVP_CONSTRAINTS; } |
---|
794 | |
---|
795 | SEITMVPConstrains() |
---|
796 | : prev_pics_not_used_flag(0),no_intra_layer_col_pic_flag(0) |
---|
797 | {} |
---|
798 | |
---|
799 | virtual ~SEITMVPConstrains() |
---|
800 | { |
---|
801 | } |
---|
802 | |
---|
803 | UInt prev_pics_not_used_flag; |
---|
804 | UInt no_intra_layer_col_pic_flag; |
---|
805 | }; |
---|
806 | #endif |
---|
807 | |
---|
808 | #if Q0247_FRAME_FIELD_INFO |
---|
809 | class SEIFrameFieldInfo: public SEI |
---|
810 | { |
---|
811 | public: |
---|
812 | PayloadType payloadType() const { return FRAME_FIELD_INFO; } |
---|
813 | |
---|
814 | SEIFrameFieldInfo() |
---|
815 | : m_ffinfo_picStruct(0),m_ffinfo_sourceScanType(0), m_ffinfo_duplicateFlag(false) |
---|
816 | {} |
---|
817 | |
---|
818 | virtual ~SEIFrameFieldInfo() |
---|
819 | { |
---|
820 | } |
---|
821 | |
---|
822 | UInt m_ffinfo_picStruct; |
---|
823 | UInt m_ffinfo_sourceScanType; |
---|
824 | Bool m_ffinfo_duplicateFlag; |
---|
825 | }; |
---|
826 | #endif |
---|
827 | |
---|
828 | #if O0164_MULTI_LAYER_HRD |
---|
829 | class SEIBspNesting : public SEI |
---|
830 | { |
---|
831 | public: |
---|
832 | PayloadType payloadType() const { return BSP_NESTING; } |
---|
833 | |
---|
834 | SEIBspNesting() |
---|
835 | : m_callerOwnsSEIs(false) |
---|
836 | {} |
---|
837 | virtual ~SEIBspNesting() |
---|
838 | { |
---|
839 | if (!m_callerOwnsSEIs) |
---|
840 | { |
---|
841 | deleteSEIs(m_nestedSEIs); |
---|
842 | } |
---|
843 | } |
---|
844 | |
---|
845 | Int m_bspIdx; |
---|
846 | Bool m_callerOwnsSEIs; |
---|
847 | SEIMessages m_nestedSEIs; |
---|
848 | Int m_seiPartitioningSchemeIdx; |
---|
849 | Int m_seiOlsIdx; |
---|
850 | }; |
---|
851 | |
---|
852 | class SEIBspInitialArrivalTime : public SEI |
---|
853 | { |
---|
854 | public: |
---|
855 | PayloadType payloadType() const { return BSP_INITIAL_ARRIVAL_TIME; } |
---|
856 | |
---|
857 | SEIBspInitialArrivalTime () {} |
---|
858 | virtual ~SEIBspInitialArrivalTime () {} |
---|
859 | |
---|
860 | UInt m_nalInitialArrivalDelay[256]; |
---|
861 | UInt m_vclInitialArrivalDelay[256]; |
---|
862 | }; |
---|
863 | #endif |
---|
864 | |
---|
865 | #endif |
---|
866 | //! \} |
---|