[313] | 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 | * |
---|
[1259] | 6 | * Copyright (c) 2010-2015, ITU/ISO/IEC |
---|
[313] | 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 | |
---|
[1029] | 34 | #ifndef __SEI__ |
---|
| 35 | #define __SEI__ |
---|
| 36 | |
---|
[313] | 37 | #pragma once |
---|
| 38 | #include <list> |
---|
| 39 | #include <vector> |
---|
| 40 | #include <cstring> |
---|
| 41 | |
---|
[1335] | 42 | #include "CommonDef.h" |
---|
[1029] | 43 | #include "libmd5/MD5.h" |
---|
[1172] | 44 | #if SVC_EXTENSION |
---|
[815] | 45 | #include "TLibCommon/NAL.h" |
---|
| 46 | #endif |
---|
| 47 | |
---|
[313] | 48 | //! \ingroup TLibCommon |
---|
| 49 | //! \{ |
---|
| 50 | class TComSPS; |
---|
[644] | 51 | #if O0164_MULTI_LAYER_HRD |
---|
| 52 | class TComHRD; |
---|
| 53 | #endif |
---|
[313] | 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, |
---|
[1029] | 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, |
---|
[1434] | 91 | CHROMA_RESAMPLING_FILTER_HINT = 140, |
---|
[1029] | 92 | KNEE_FUNCTION_INFO = 141, |
---|
[1097] | 93 | COLOUR_REMAPPING_INFO = 142, |
---|
[588] | 94 | #if LAYERS_NOT_PRESENT_SEI |
---|
[1097] | 95 | LAYERS_NOT_PRESENT = 160, |
---|
[313] | 96 | #endif |
---|
[442] | 97 | #if N0383_IL_CONSTRAINED_TILE_SETS_SEI |
---|
[1097] | 98 | INTER_LAYER_CONSTRAINED_TILE_SETS = 161, |
---|
[442] | 99 | #endif |
---|
[1097] | 100 | #if O0164_MULTI_LAYER_HRD |
---|
| 101 | BSP_NESTING = 162, |
---|
| 102 | BSP_INITIAL_ARRIVAL_TIME = 163, |
---|
| 103 | #endif |
---|
[588] | 104 | #if SUB_BITSTREAM_PROPERTY_SEI |
---|
[1097] | 105 | SUB_BITSTREAM_PROPERTY = 164, |
---|
[588] | 106 | #endif |
---|
[1097] | 107 | #if P0123_ALPHA_CHANNEL_SEI |
---|
| 108 | ALPHA_CHANNEL_INFO = 165, |
---|
[644] | 109 | #endif |
---|
[1097] | 110 | #if Q0096_OVERLAY_SEI |
---|
| 111 | OVERLAY_INFO = 166, |
---|
[713] | 112 | #endif |
---|
[815] | 113 | #if Q0189_TMVP_CONSTRAINTS |
---|
[1097] | 114 | TMVP_CONSTRAINTS = 167, |
---|
[815] | 115 | #endif |
---|
| 116 | #if Q0247_FRAME_FIELD_INFO |
---|
[1097] | 117 | FRAME_FIELD_INFO = 168, |
---|
[815] | 118 | #endif |
---|
[313] | 119 | }; |
---|
[1246] | 120 | |
---|
[313] | 121 | SEI() {} |
---|
| 122 | virtual ~SEI() {} |
---|
[1246] | 123 | |
---|
[1442] | 124 | static const TChar *getSEIMessageString(SEI::PayloadType payloadType); |
---|
[1029] | 125 | |
---|
[313] | 126 | virtual PayloadType payloadType() const = 0; |
---|
| 127 | }; |
---|
| 128 | |
---|
[1029] | 129 | static const UInt ISO_IEC_11578_LEN=16; |
---|
| 130 | |
---|
[313] | 131 | class SEIuserDataUnregistered : public SEI |
---|
| 132 | { |
---|
| 133 | public: |
---|
| 134 | PayloadType payloadType() const { return USER_DATA_UNREGISTERED; } |
---|
| 135 | |
---|
| 136 | SEIuserDataUnregistered() |
---|
| 137 | : userData(0) |
---|
| 138 | {} |
---|
| 139 | |
---|
| 140 | virtual ~SEIuserDataUnregistered() |
---|
| 141 | { |
---|
| 142 | delete userData; |
---|
| 143 | } |
---|
| 144 | |
---|
[1029] | 145 | UChar uuid_iso_iec_11578[ISO_IEC_11578_LEN]; |
---|
[1246] | 146 | UInt userDataLength; |
---|
[313] | 147 | UChar *userData; |
---|
| 148 | }; |
---|
| 149 | |
---|
| 150 | class SEIDecodedPictureHash : public SEI |
---|
| 151 | { |
---|
| 152 | public: |
---|
| 153 | PayloadType payloadType() const { return DECODED_PICTURE_HASH; } |
---|
| 154 | |
---|
| 155 | SEIDecodedPictureHash() {} |
---|
| 156 | virtual ~SEIDecodedPictureHash() {} |
---|
[1246] | 157 | |
---|
[1459] | 158 | HashType method; |
---|
[313] | 159 | |
---|
[1273] | 160 | TComPictureHash m_pictureHash; |
---|
[313] | 161 | }; |
---|
| 162 | |
---|
[1246] | 163 | class SEIActiveParameterSets : public SEI |
---|
[313] | 164 | { |
---|
| 165 | public: |
---|
| 166 | PayloadType payloadType() const { return ACTIVE_PARAMETER_SETS; } |
---|
| 167 | |
---|
[1246] | 168 | SEIActiveParameterSets() |
---|
[313] | 169 | : activeVPSId (0) |
---|
[713] | 170 | , m_selfContainedCvsFlag (false) |
---|
| 171 | , m_noParameterSetUpdateFlag (false) |
---|
[313] | 172 | , numSpsIdsMinus1 (0) |
---|
| 173 | {} |
---|
| 174 | virtual ~SEIActiveParameterSets() {} |
---|
| 175 | |
---|
[1246] | 176 | Int activeVPSId; |
---|
[713] | 177 | Bool m_selfContainedCvsFlag; |
---|
| 178 | Bool m_noParameterSetUpdateFlag; |
---|
[313] | 179 | Int numSpsIdsMinus1; |
---|
[713] | 180 | std::vector<Int> activeSeqParameterSetId; |
---|
[884] | 181 | #if R0247_SEI_ACTIVE |
---|
| 182 | std::vector<Int> layerSpsIdx; |
---|
| 183 | #endif |
---|
[313] | 184 | }; |
---|
| 185 | |
---|
| 186 | class SEIBufferingPeriod : public SEI |
---|
| 187 | { |
---|
| 188 | public: |
---|
| 189 | PayloadType payloadType() const { return BUFFERING_PERIOD; } |
---|
[1273] | 190 | void copyTo (SEIBufferingPeriod& target); |
---|
[313] | 191 | |
---|
| 192 | SEIBufferingPeriod() |
---|
| 193 | : m_bpSeqParameterSetId (0) |
---|
| 194 | , m_rapCpbParamsPresentFlag (false) |
---|
| 195 | , m_cpbDelayOffset (0) |
---|
| 196 | , m_dpbDelayOffset (0) |
---|
[644] | 197 | #if P0138_USE_ALT_CPB_PARAMS_FLAG |
---|
| 198 | , m_useAltCpbParamsFlagPresent(false) |
---|
| 199 | , m_useAltCpbParamsFlag (false) |
---|
| 200 | #endif |
---|
[313] | 201 | { |
---|
| 202 | ::memset(m_initialCpbRemovalDelay, 0, sizeof(m_initialCpbRemovalDelay)); |
---|
| 203 | ::memset(m_initialCpbRemovalDelayOffset, 0, sizeof(m_initialCpbRemovalDelayOffset)); |
---|
| 204 | ::memset(m_initialAltCpbRemovalDelay, 0, sizeof(m_initialAltCpbRemovalDelay)); |
---|
| 205 | ::memset(m_initialAltCpbRemovalDelayOffset, 0, sizeof(m_initialAltCpbRemovalDelayOffset)); |
---|
| 206 | } |
---|
| 207 | virtual ~SEIBufferingPeriod() {} |
---|
| 208 | |
---|
| 209 | UInt m_bpSeqParameterSetId; |
---|
| 210 | Bool m_rapCpbParamsPresentFlag; |
---|
[823] | 211 | UInt m_cpbDelayOffset; |
---|
| 212 | UInt m_dpbDelayOffset; |
---|
[313] | 213 | UInt m_initialCpbRemovalDelay [MAX_CPB_CNT][2]; |
---|
| 214 | UInt m_initialCpbRemovalDelayOffset [MAX_CPB_CNT][2]; |
---|
| 215 | UInt m_initialAltCpbRemovalDelay [MAX_CPB_CNT][2]; |
---|
| 216 | UInt m_initialAltCpbRemovalDelayOffset[MAX_CPB_CNT][2]; |
---|
| 217 | Bool m_concatenationFlag; |
---|
| 218 | UInt m_auCpbRemovalDelayDelta; |
---|
[644] | 219 | #if P0138_USE_ALT_CPB_PARAMS_FLAG |
---|
| 220 | Bool m_useAltCpbParamsFlagPresent; |
---|
| 221 | Bool m_useAltCpbParamsFlag; |
---|
| 222 | #endif |
---|
[313] | 223 | }; |
---|
| 224 | class SEIPictureTiming : public SEI |
---|
| 225 | { |
---|
| 226 | public: |
---|
| 227 | PayloadType payloadType() const { return PICTURE_TIMING; } |
---|
[1273] | 228 | void copyTo (SEIPictureTiming& target); |
---|
[313] | 229 | |
---|
| 230 | SEIPictureTiming() |
---|
| 231 | : m_picStruct (0) |
---|
| 232 | , m_sourceScanType (0) |
---|
| 233 | , m_duplicateFlag (false) |
---|
| 234 | , m_picDpbOutputDuDelay (0) |
---|
| 235 | {} |
---|
| 236 | virtual ~SEIPictureTiming() |
---|
| 237 | { |
---|
| 238 | } |
---|
| 239 | |
---|
| 240 | UInt m_picStruct; |
---|
| 241 | UInt m_sourceScanType; |
---|
| 242 | Bool m_duplicateFlag; |
---|
| 243 | |
---|
| 244 | UInt m_auCpbRemovalDelay; |
---|
| 245 | UInt m_picDpbOutputDelay; |
---|
| 246 | UInt m_picDpbOutputDuDelay; |
---|
| 247 | UInt m_numDecodingUnitsMinus1; |
---|
| 248 | Bool m_duCommonCpbRemovalDelayFlag; |
---|
| 249 | UInt m_duCommonCpbRemovalDelayMinus1; |
---|
[1273] | 250 | std::vector<UInt> m_numNalusInDuMinus1; |
---|
| 251 | std::vector<UInt> m_duCpbRemovalDelayMinus1; |
---|
[313] | 252 | }; |
---|
| 253 | |
---|
| 254 | class SEIDecodingUnitInfo : public SEI |
---|
| 255 | { |
---|
| 256 | public: |
---|
| 257 | PayloadType payloadType() const { return DECODING_UNIT_INFO; } |
---|
| 258 | |
---|
| 259 | SEIDecodingUnitInfo() |
---|
| 260 | : m_decodingUnitIdx(0) |
---|
| 261 | , m_duSptCpbRemovalDelay(0) |
---|
| 262 | , m_dpbOutputDuDelayPresentFlag(false) |
---|
| 263 | , m_picSptDpbOutputDuDelay(0) |
---|
| 264 | {} |
---|
| 265 | virtual ~SEIDecodingUnitInfo() {} |
---|
| 266 | Int m_decodingUnitIdx; |
---|
| 267 | Int m_duSptCpbRemovalDelay; |
---|
| 268 | Bool m_dpbOutputDuDelayPresentFlag; |
---|
| 269 | Int m_picSptDpbOutputDuDelay; |
---|
| 270 | }; |
---|
| 271 | |
---|
| 272 | class SEIRecoveryPoint : public SEI |
---|
| 273 | { |
---|
| 274 | public: |
---|
| 275 | PayloadType payloadType() const { return RECOVERY_POINT; } |
---|
| 276 | |
---|
| 277 | SEIRecoveryPoint() {} |
---|
| 278 | virtual ~SEIRecoveryPoint() {} |
---|
| 279 | |
---|
| 280 | Int m_recoveryPocCnt; |
---|
| 281 | Bool m_exactMatchingFlag; |
---|
| 282 | Bool m_brokenLinkFlag; |
---|
| 283 | }; |
---|
[1029] | 284 | |
---|
[313] | 285 | class SEIFramePacking : public SEI |
---|
| 286 | { |
---|
| 287 | public: |
---|
| 288 | PayloadType payloadType() const { return FRAME_PACKING; } |
---|
| 289 | |
---|
| 290 | SEIFramePacking() {} |
---|
| 291 | virtual ~SEIFramePacking() {} |
---|
| 292 | |
---|
| 293 | Int m_arrangementId; |
---|
| 294 | Bool m_arrangementCancelFlag; |
---|
| 295 | Int m_arrangementType; |
---|
| 296 | Bool m_quincunxSamplingFlag; |
---|
| 297 | Int m_contentInterpretationType; |
---|
| 298 | Bool m_spatialFlippingFlag; |
---|
| 299 | Bool m_frame0FlippedFlag; |
---|
| 300 | Bool m_fieldViewsFlag; |
---|
| 301 | Bool m_currentFrameIsFrame0Flag; |
---|
| 302 | Bool m_frame0SelfContainedFlag; |
---|
| 303 | Bool m_frame1SelfContainedFlag; |
---|
| 304 | Int m_frame0GridPositionX; |
---|
| 305 | Int m_frame0GridPositionY; |
---|
| 306 | Int m_frame1GridPositionX; |
---|
| 307 | Int m_frame1GridPositionY; |
---|
| 308 | Int m_arrangementReservedByte; |
---|
| 309 | Bool m_arrangementPersistenceFlag; |
---|
| 310 | Bool m_upsampledAspectRatio; |
---|
| 311 | }; |
---|
| 312 | |
---|
[1029] | 313 | class SEISegmentedRectFramePacking : public SEI |
---|
| 314 | { |
---|
| 315 | public: |
---|
| 316 | PayloadType payloadType() const { return SEGM_RECT_FRAME_PACKING; } |
---|
| 317 | |
---|
| 318 | SEISegmentedRectFramePacking() {} |
---|
| 319 | virtual ~SEISegmentedRectFramePacking() {} |
---|
| 320 | |
---|
| 321 | Bool m_arrangementCancelFlag; |
---|
| 322 | Int m_contentInterpretationType; |
---|
| 323 | Bool m_arrangementPersistenceFlag; |
---|
| 324 | }; |
---|
| 325 | |
---|
[313] | 326 | class SEIDisplayOrientation : public SEI |
---|
| 327 | { |
---|
| 328 | public: |
---|
| 329 | PayloadType payloadType() const { return DISPLAY_ORIENTATION; } |
---|
| 330 | |
---|
| 331 | SEIDisplayOrientation() |
---|
| 332 | : cancelFlag(true) |
---|
| 333 | , persistenceFlag(0) |
---|
| 334 | , extensionFlag(false) |
---|
| 335 | {} |
---|
| 336 | virtual ~SEIDisplayOrientation() {} |
---|
| 337 | |
---|
| 338 | Bool cancelFlag; |
---|
| 339 | Bool horFlip; |
---|
| 340 | Bool verFlip; |
---|
| 341 | |
---|
| 342 | UInt anticlockwiseRotation; |
---|
| 343 | Bool persistenceFlag; |
---|
| 344 | Bool extensionFlag; |
---|
| 345 | }; |
---|
| 346 | |
---|
| 347 | class SEITemporalLevel0Index : public SEI |
---|
| 348 | { |
---|
| 349 | public: |
---|
| 350 | PayloadType payloadType() const { return TEMPORAL_LEVEL0_INDEX; } |
---|
| 351 | |
---|
| 352 | SEITemporalLevel0Index() |
---|
| 353 | : tl0Idx(0) |
---|
| 354 | , rapIdx(0) |
---|
| 355 | {} |
---|
| 356 | virtual ~SEITemporalLevel0Index() {} |
---|
| 357 | |
---|
| 358 | UInt tl0Idx; |
---|
| 359 | UInt rapIdx; |
---|
| 360 | }; |
---|
| 361 | |
---|
| 362 | class SEIGradualDecodingRefreshInfo : public SEI |
---|
| 363 | { |
---|
| 364 | public: |
---|
| 365 | PayloadType payloadType() const { return REGION_REFRESH_INFO; } |
---|
| 366 | |
---|
| 367 | SEIGradualDecodingRefreshInfo() |
---|
| 368 | : m_gdrForegroundFlag(0) |
---|
| 369 | {} |
---|
| 370 | virtual ~SEIGradualDecodingRefreshInfo() {} |
---|
| 371 | |
---|
| 372 | Bool m_gdrForegroundFlag; |
---|
| 373 | }; |
---|
| 374 | |
---|
[1029] | 375 | class SEINoDisplay : public SEI |
---|
[313] | 376 | { |
---|
| 377 | public: |
---|
[1029] | 378 | PayloadType payloadType() const { return NO_DISPLAY; } |
---|
[313] | 379 | |
---|
[1029] | 380 | SEINoDisplay() |
---|
| 381 | : m_noDisplay(false) |
---|
| 382 | {} |
---|
| 383 | virtual ~SEINoDisplay() {} |
---|
[313] | 384 | |
---|
[1029] | 385 | Bool m_noDisplay; |
---|
[313] | 386 | }; |
---|
| 387 | |
---|
| 388 | class SEISOPDescription : public SEI |
---|
| 389 | { |
---|
| 390 | public: |
---|
| 391 | PayloadType payloadType() const { return SOP_DESCRIPTION; } |
---|
| 392 | |
---|
| 393 | SEISOPDescription() {} |
---|
| 394 | virtual ~SEISOPDescription() {} |
---|
| 395 | |
---|
| 396 | UInt m_sopSeqParameterSetId; |
---|
| 397 | UInt m_numPicsInSopMinus1; |
---|
| 398 | |
---|
| 399 | UInt m_sopDescVclNaluType[MAX_NUM_PICS_IN_SOP]; |
---|
| 400 | UInt m_sopDescTemporalId[MAX_NUM_PICS_IN_SOP]; |
---|
| 401 | UInt m_sopDescStRpsIdx[MAX_NUM_PICS_IN_SOP]; |
---|
| 402 | Int m_sopDescPocDelta[MAX_NUM_PICS_IN_SOP]; |
---|
| 403 | }; |
---|
| 404 | |
---|
| 405 | class SEIToneMappingInfo : public SEI |
---|
| 406 | { |
---|
| 407 | public: |
---|
| 408 | PayloadType payloadType() const { return TONE_MAPPING_INFO; } |
---|
| 409 | SEIToneMappingInfo() {} |
---|
| 410 | virtual ~SEIToneMappingInfo() {} |
---|
| 411 | |
---|
| 412 | Int m_toneMapId; |
---|
| 413 | Bool m_toneMapCancelFlag; |
---|
| 414 | Bool m_toneMapPersistenceFlag; |
---|
| 415 | Int m_codedDataBitDepth; |
---|
| 416 | Int m_targetBitDepth; |
---|
| 417 | Int m_modelId; |
---|
| 418 | Int m_minValue; |
---|
| 419 | Int m_maxValue; |
---|
| 420 | Int m_sigmoidMidpoint; |
---|
| 421 | Int m_sigmoidWidth; |
---|
| 422 | std::vector<Int> m_startOfCodedInterval; |
---|
| 423 | Int m_numPivots; |
---|
| 424 | std::vector<Int> m_codedPivotValue; |
---|
| 425 | std::vector<Int> m_targetPivotValue; |
---|
| 426 | Int m_cameraIsoSpeedIdc; |
---|
| 427 | Int m_cameraIsoSpeedValue; |
---|
[713] | 428 | Int m_exposureIndexIdc; |
---|
| 429 | Int m_exposureIndexValue; |
---|
[1230] | 430 | Bool m_exposureCompensationValueSignFlag; |
---|
[313] | 431 | Int m_exposureCompensationValueNumerator; |
---|
| 432 | Int m_exposureCompensationValueDenomIdc; |
---|
| 433 | Int m_refScreenLuminanceWhite; |
---|
| 434 | Int m_extendedRangeWhiteLevel; |
---|
| 435 | Int m_nominalBlackLevelLumaCodeValue; |
---|
| 436 | Int m_nominalWhiteLevelLumaCodeValue; |
---|
| 437 | Int m_extendedWhiteLevelLumaCodeValue; |
---|
| 438 | }; |
---|
[1029] | 439 | |
---|
[815] | 440 | class SEIKneeFunctionInfo : public SEI |
---|
| 441 | { |
---|
| 442 | public: |
---|
| 443 | PayloadType payloadType() const { return KNEE_FUNCTION_INFO; } |
---|
| 444 | SEIKneeFunctionInfo() {} |
---|
| 445 | virtual ~SEIKneeFunctionInfo() {} |
---|
[313] | 446 | |
---|
[815] | 447 | Int m_kneeId; |
---|
| 448 | Bool m_kneeCancelFlag; |
---|
| 449 | Bool m_kneePersistenceFlag; |
---|
| 450 | Int m_kneeInputDrange; |
---|
| 451 | Int m_kneeInputDispLuminance; |
---|
| 452 | Int m_kneeOutputDrange; |
---|
| 453 | Int m_kneeOutputDispLuminance; |
---|
| 454 | Int m_kneeNumKneePointsMinus1; |
---|
| 455 | std::vector<Int> m_kneeInputKneePoint; |
---|
| 456 | std::vector<Int> m_kneeOutputKneePoint; |
---|
| 457 | }; |
---|
[1029] | 458 | |
---|
[1460] | 459 | class SEIColourRemappingInfo : public SEI |
---|
| 460 | { |
---|
| 461 | public: |
---|
| 462 | |
---|
| 463 | struct CRIlut |
---|
| 464 | { |
---|
| 465 | Int codedValue; |
---|
| 466 | Int targetValue; |
---|
| 467 | bool operator < (const CRIlut& a) const |
---|
| 468 | { |
---|
| 469 | return codedValue < a.codedValue; |
---|
| 470 | } |
---|
| 471 | }; |
---|
| 472 | |
---|
| 473 | PayloadType payloadType() const { return COLOUR_REMAPPING_INFO; } |
---|
| 474 | SEIColourRemappingInfo() {} |
---|
| 475 | ~SEIColourRemappingInfo() {} |
---|
| 476 | |
---|
| 477 | Void copyFrom( const SEIColourRemappingInfo &seiCriInput) |
---|
| 478 | { |
---|
| 479 | (*this) = seiCriInput; |
---|
| 480 | } |
---|
| 481 | |
---|
| 482 | UInt m_colourRemapId; |
---|
| 483 | Bool m_colourRemapCancelFlag; |
---|
| 484 | Bool m_colourRemapPersistenceFlag; |
---|
| 485 | Bool m_colourRemapVideoSignalInfoPresentFlag; |
---|
| 486 | Bool m_colourRemapFullRangeFlag; |
---|
| 487 | Int m_colourRemapPrimaries; |
---|
| 488 | Int m_colourRemapTransferFunction; |
---|
| 489 | Int m_colourRemapMatrixCoefficients; |
---|
| 490 | Int m_colourRemapInputBitDepth; |
---|
| 491 | Int m_colourRemapBitDepth; |
---|
| 492 | Int m_preLutNumValMinus1[3]; |
---|
| 493 | std::vector<CRIlut> m_preLut[3]; |
---|
| 494 | Bool m_colourRemapMatrixPresentFlag; |
---|
| 495 | Int m_log2MatrixDenom; |
---|
| 496 | Int m_colourRemapCoeffs[3][3]; |
---|
| 497 | Int m_postLutNumValMinus1[3]; |
---|
| 498 | std::vector<CRIlut> m_postLut[3]; |
---|
| 499 | }; |
---|
| 500 | |
---|
[1434] | 501 | class SEIChromaResamplingFilterHint : public SEI |
---|
[1029] | 502 | { |
---|
| 503 | public: |
---|
[1434] | 504 | PayloadType payloadType() const {return CHROMA_RESAMPLING_FILTER_HINT;} |
---|
| 505 | SEIChromaResamplingFilterHint() {} |
---|
| 506 | virtual ~SEIChromaResamplingFilterHint() {} |
---|
[1029] | 507 | |
---|
[1434] | 508 | Int m_verChromaFilterIdc; |
---|
| 509 | Int m_horChromaFilterIdc; |
---|
| 510 | Bool m_verFilteringFieldProcessingFlag; |
---|
| 511 | Int m_targetFormatIdc; |
---|
| 512 | Bool m_perfectReconstructionFlag; |
---|
| 513 | std::vector<std::vector<Int> > m_verFilterCoeff; |
---|
| 514 | std::vector<std::vector<Int> > m_horFilterCoeff; |
---|
[1029] | 515 | }; |
---|
| 516 | |
---|
| 517 | class SEIMasteringDisplayColourVolume : public SEI |
---|
| 518 | { |
---|
| 519 | public: |
---|
| 520 | PayloadType payloadType() const { return MASTERING_DISPLAY_COLOUR_VOLUME; } |
---|
| 521 | SEIMasteringDisplayColourVolume() {} |
---|
| 522 | virtual ~SEIMasteringDisplayColourVolume(){} |
---|
| 523 | |
---|
| 524 | TComSEIMasteringDisplay values; |
---|
| 525 | }; |
---|
| 526 | |
---|
| 527 | typedef std::list<SEI*> SEIMessages; |
---|
| 528 | |
---|
| 529 | /// output a selection of SEI messages by payload type. Ownership stays in original message list. |
---|
| 530 | SEIMessages getSeisByType(SEIMessages &seiList, SEI::PayloadType seiType); |
---|
| 531 | |
---|
[1246] | 532 | /// remove a selection of SEI messages by payload type from the original list and return them in a new list. |
---|
[1029] | 533 | SEIMessages extractSeisByType(SEIMessages &seiList, SEI::PayloadType seiType); |
---|
| 534 | |
---|
| 535 | /// delete list of SEI messages (freeing the referenced objects) |
---|
| 536 | Void deleteSEIs (SEIMessages &seiList); |
---|
| 537 | |
---|
| 538 | class SEIScalableNesting : public SEI |
---|
| 539 | { |
---|
| 540 | public: |
---|
| 541 | PayloadType payloadType() const { return SCALABLE_NESTING; } |
---|
| 542 | |
---|
[1246] | 543 | SEIScalableNesting() {} |
---|
[1302] | 544 | |
---|
[1029] | 545 | virtual ~SEIScalableNesting() |
---|
| 546 | { |
---|
[1302] | 547 | deleteSEIs(m_nestedSEIs); |
---|
[1029] | 548 | } |
---|
| 549 | |
---|
| 550 | Bool m_bitStreamSubsetFlag; |
---|
| 551 | Bool m_nestingOpFlag; |
---|
| 552 | Bool m_defaultOpFlag; //value valid if m_nestingOpFlag != 0 |
---|
| 553 | UInt m_nestingNumOpsMinus1; // -"- |
---|
| 554 | UInt m_nestingMaxTemporalIdPlus1[MAX_TLAYER]; // -"- |
---|
| 555 | UInt m_nestingOpIdx[MAX_NESTING_NUM_OPS]; // -"- |
---|
| 556 | |
---|
| 557 | Bool m_allLayersFlag; //value valid if m_nestingOpFlag == 0 |
---|
| 558 | UInt m_nestingNoOpMaxTemporalIdPlus1; //value valid if m_nestingOpFlag == 0 and m_allLayersFlag == 0 |
---|
| 559 | UInt m_nestingNumLayersMinus1; //value valid if m_nestingOpFlag == 0 and m_allLayersFlag == 0 |
---|
| 560 | 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 |
---|
| 561 | |
---|
| 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 | |
---|
[1037] | 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 | |
---|
[1029] | 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 | |
---|
[442] | 715 | #if N0383_IL_CONSTRAINED_TILE_SETS_SEI |
---|
| 716 | class SEIInterLayerConstrainedTileSets : public SEI |
---|
| 717 | { |
---|
| 718 | public: |
---|
| 719 | PayloadType payloadType() const { return INTER_LAYER_CONSTRAINED_TILE_SETS; } |
---|
| 720 | |
---|
| 721 | SEIInterLayerConstrainedTileSets() {} |
---|
| 722 | virtual ~SEIInterLayerConstrainedTileSets() {} |
---|
| 723 | |
---|
| 724 | Bool m_ilAllTilesExactSampleValueMatchFlag; |
---|
| 725 | Bool m_ilOneTilePerTileSetFlag; |
---|
| 726 | UInt m_ilNumSetsInMessageMinus1; |
---|
| 727 | Bool m_skippedTileSetPresentFlag; |
---|
| 728 | UInt m_ilctsId[256]; |
---|
| 729 | UInt m_ilNumTileRectsInSetMinus1[256]; |
---|
| 730 | UInt m_ilTopLeftTileIndex[256][440]; |
---|
| 731 | UInt m_ilBottomRightTileIndex[256][440]; |
---|
| 732 | UInt m_ilcIdc[256]; |
---|
| 733 | Bool m_ilExactSampleValueMatchFlag[256]; |
---|
| 734 | UInt m_allTilesIlcIdc; |
---|
| 735 | }; |
---|
| 736 | #endif |
---|
| 737 | |
---|
[588] | 738 | #if SUB_BITSTREAM_PROPERTY_SEI |
---|
| 739 | class SEISubBitstreamProperty : public SEI |
---|
| 740 | { |
---|
| 741 | public: |
---|
| 742 | PayloadType payloadType() const { return SUB_BITSTREAM_PROPERTY; } |
---|
[442] | 743 | |
---|
[588] | 744 | SEISubBitstreamProperty(); |
---|
| 745 | virtual ~SEISubBitstreamProperty() {} |
---|
| 746 | |
---|
| 747 | Int m_activeVpsId; |
---|
| 748 | Int m_numAdditionalSubStreams; |
---|
| 749 | Int m_subBitstreamMode [MAX_SUB_STREAMS]; |
---|
| 750 | Int m_outputLayerSetIdxToVps [MAX_SUB_STREAMS]; |
---|
| 751 | Int m_highestSublayerId [MAX_SUB_STREAMS]; |
---|
| 752 | Int m_avgBitRate [MAX_SUB_STREAMS]; |
---|
| 753 | Int m_maxBitRate [MAX_SUB_STREAMS]; |
---|
| 754 | }; |
---|
| 755 | #endif |
---|
| 756 | |
---|
[815] | 757 | #if Q0189_TMVP_CONSTRAINTS |
---|
| 758 | class SEITMVPConstrains : public SEI |
---|
| 759 | { |
---|
| 760 | public: |
---|
| 761 | PayloadType payloadType() const { return TMVP_CONSTRAINTS; } |
---|
| 762 | |
---|
| 763 | SEITMVPConstrains() |
---|
| 764 | : prev_pics_not_used_flag(0),no_intra_layer_col_pic_flag(0) |
---|
| 765 | {} |
---|
| 766 | |
---|
| 767 | virtual ~SEITMVPConstrains() |
---|
| 768 | { |
---|
| 769 | } |
---|
| 770 | |
---|
| 771 | UInt prev_pics_not_used_flag; |
---|
| 772 | UInt no_intra_layer_col_pic_flag; |
---|
| 773 | }; |
---|
| 774 | #endif |
---|
| 775 | |
---|
| 776 | #if Q0247_FRAME_FIELD_INFO |
---|
| 777 | class SEIFrameFieldInfo: public SEI |
---|
| 778 | { |
---|
| 779 | public: |
---|
| 780 | PayloadType payloadType() const { return FRAME_FIELD_INFO; } |
---|
| 781 | |
---|
| 782 | SEIFrameFieldInfo() |
---|
| 783 | : m_ffinfo_picStruct(0),m_ffinfo_sourceScanType(0), m_ffinfo_duplicateFlag(false) |
---|
| 784 | {} |
---|
| 785 | |
---|
| 786 | virtual ~SEIFrameFieldInfo() |
---|
| 787 | { |
---|
| 788 | } |
---|
| 789 | |
---|
| 790 | UInt m_ffinfo_picStruct; |
---|
| 791 | UInt m_ffinfo_sourceScanType; |
---|
| 792 | Bool m_ffinfo_duplicateFlag; |
---|
| 793 | }; |
---|
| 794 | #endif |
---|
| 795 | |
---|
[644] | 796 | #if O0164_MULTI_LAYER_HRD |
---|
| 797 | class SEIBspNesting : public SEI |
---|
| 798 | { |
---|
| 799 | public: |
---|
| 800 | PayloadType payloadType() const { return BSP_NESTING; } |
---|
| 801 | |
---|
[1070] | 802 | SEIBspNesting() |
---|
| 803 | : m_callerOwnsSEIs(false) |
---|
| 804 | {} |
---|
[644] | 805 | virtual ~SEIBspNesting() |
---|
| 806 | { |
---|
| 807 | if (!m_callerOwnsSEIs) |
---|
| 808 | { |
---|
| 809 | deleteSEIs(m_nestedSEIs); |
---|
| 810 | } |
---|
| 811 | } |
---|
| 812 | |
---|
| 813 | Int m_bspIdx; |
---|
| 814 | Bool m_callerOwnsSEIs; |
---|
| 815 | SEIMessages m_nestedSEIs; |
---|
[894] | 816 | Int m_seiPartitioningSchemeIdx; |
---|
| 817 | Int m_seiOlsIdx; |
---|
[644] | 818 | }; |
---|
| 819 | |
---|
| 820 | class SEIBspInitialArrivalTime : public SEI |
---|
| 821 | { |
---|
| 822 | public: |
---|
| 823 | PayloadType payloadType() const { return BSP_INITIAL_ARRIVAL_TIME; } |
---|
| 824 | |
---|
| 825 | SEIBspInitialArrivalTime () {} |
---|
| 826 | virtual ~SEIBspInitialArrivalTime () {} |
---|
| 827 | |
---|
| 828 | UInt m_nalInitialArrivalDelay[256]; |
---|
| 829 | UInt m_vclInitialArrivalDelay[256]; |
---|
| 830 | }; |
---|
[846] | 831 | #endif |
---|
[644] | 832 | |
---|
| 833 | #endif |
---|
[313] | 834 | //! \} |
---|