HEVC Test Model (HM)  HM-16.18
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SEIwrite.cpp
Go to the documentation of this file.
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-2017, 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 
36 #include "TLibCommon/SEI.h"
37 #include "TLibCommon/TComSlice.h"
38 #include "TLibCommon/TComPicYuv.h"
39 #include "SEIwrite.h"
40 
43 
44 #if ENC_DEC_TRACE
45 Void xTraceSEIHeader()
46 {
47  fprintf( g_hTrace, "=========== SEI message ===========\n");
48 }
49 
50 Void xTraceSEIMessageType(SEI::PayloadType payloadType)
51 {
52  fprintf( g_hTrace, "=========== %s SEI message ===========\n", SEI::getSEIMessageString(payloadType));
53 }
54 #endif
55 
57 {
58  switch (sei.payloadType())
59  {
61  xWriteSEIBufferingPeriod(*static_cast<const SEIBufferingPeriod*>(&sei), sps);
62  break;
64  xWriteSEIPictureTiming(*static_cast<const SEIPictureTiming*>(&sei), sps);
65  break;
66  case SEI::PAN_SCAN_RECT:
67  xWriteSEIPanScanRect(*static_cast<const SEIPanScanRect*>(&sei));
68  break;
70  xWriteSEIFillerPayload(*static_cast<const SEIFillerPayload*>(&sei));
71  break;
73  xWriteSEIUserDataRegistered(*static_cast<const SEIUserDataRegistered*>(&sei));
74  break;
76  xWriteSEIUserDataUnregistered(*static_cast<const SEIUserDataUnregistered*>(&sei));
77  break;
79  xWriteSEIRecoveryPoint(*static_cast<const SEIRecoveryPoint*>(&sei));
80  break;
81  case SEI::SCENE_INFO:
82  xWriteSEISceneInfo(*static_cast<const SEISceneInfo*>(&sei));
83  break;
85  xWriteSEIPictureSnapshot(*static_cast<const SEIPictureSnapshot*>(&sei));
86  break;
88  xWriteSEIProgressiveRefinementSegmentStart(*static_cast<const SEIProgressiveRefinementSegmentStart*>(&sei));
89  break;
91  xWriteSEIProgressiveRefinementSegmentEnd(*static_cast<const SEIProgressiveRefinementSegmentEnd*>(&sei));
92  break;
94  xWriteSEIFilmGrainCharacteristics(*static_cast<const SEIFilmGrainCharacteristics*>(&sei));
95  break;
97  xWriteSEIPostFilterHint(*static_cast<const SEIPostFilterHint*>(&sei), sps);
98  break;
100  xWriteSEIToneMappingInfo(*static_cast<const SEIToneMappingInfo*>(&sei));
101  break;
102  case SEI::FRAME_PACKING:
103  xWriteSEIFramePacking(*static_cast<const SEIFramePacking*>(&sei));
104  break;
106  xWriteSEIDisplayOrientation(*static_cast<const SEIDisplayOrientation*>(&sei));
107  break;
108  case SEI::GREEN_METADATA:
109  xWriteSEIGreenMetadataInfo(*static_cast<const SEIGreenMetadataInfo*>(&sei));
110  break;
112  xWriteSEISOPDescription(*static_cast<const SEISOPDescription*>(&sei));
113  break;
115  xWriteSEIActiveParameterSets(*static_cast<const SEIActiveParameterSets*>(& sei));
116  break;
118  xWriteSEIDecodingUnitInfo(*static_cast<const SEIDecodingUnitInfo*>(& sei), sps);
119  break;
121  xWriteSEITemporalLevel0Index(*static_cast<const SEITemporalLevel0Index*>(&sei));
122  break;
124  xWriteSEIDecodedPictureHash(*static_cast<const SEIDecodedPictureHash*>(&sei));
125  break;
127  xWriteSEIScalableNesting(bs, *static_cast<const SEIScalableNesting*>(&sei), sps);
128  break;
130  xWriteSEIRegionRefreshInfo(*static_cast<const SEIRegionRefreshInfo*>(&sei));
131  break;
132  case SEI::NO_DISPLAY:
133  xWriteSEINoDisplay(*static_cast<const SEINoDisplay*>(&sei));
134  break;
135  case SEI::TIME_CODE:
136  xWriteSEITimeCode(*static_cast<const SEITimeCode*>(&sei));
137  break;
139  xWriteSEIMasteringDisplayColourVolume(*static_cast<const SEIMasteringDisplayColourVolume*>(&sei));
140  break;
142  xWriteSEISegmentedRectFramePacking(*static_cast<const SEISegmentedRectFramePacking*>(&sei));
143  break;
145  xWriteSEITempMotionConstrainedTileSets(*static_cast<const SEITempMotionConstrainedTileSets*>(&sei));
146  break;
148  xWriteSEIChromaResamplingFilterHint(*static_cast<const SEIChromaResamplingFilterHint*>(&sei));
149  break;
151  xWriteSEIKneeFunctionInfo(*static_cast<const SEIKneeFunctionInfo*>(&sei));
152  break;
154  xWriteSEIColourRemappingInfo(*static_cast<const SEIColourRemappingInfo*>(&sei));
155  break;
157  xWriteSEIDeinterlaceFieldIdentification(*static_cast<const SEIDeinterlaceFieldIdentification*>(&sei));
158  break;
160  xWriteSEIContentLightLevelInfo(*static_cast<const SEIContentLightLevelInfo*>(&sei));
161  break;
163  xWriteSEIDependentRAPIndication(*static_cast<const SEIDependentRAPIndication*>(&sei));
164  break;
166  xWriteSEICodedRegionCompletion(*static_cast<const SEICodedRegionCompletion*>(&sei));
167  break;
169  xWriteSEIAlternativeTransferCharacteristics(*static_cast<const SEIAlternativeTransferCharacteristics*>(&sei));
170  break;
172  xWriteSEIAmbientViewingEnvironment(*static_cast<const SEIAmbientViewingEnvironment*>(&sei));
173  break;
174 #if CCV_SEI_MESSAGE
176  xWriteSEIContentColourVolume(*static_cast<const SEIContentColourVolume*>(&sei));
177  break;
178 #endif
179 #if ERP_SR_OV_SEI_MESSAGE
181  xWriteSEIEquirectangularProjection(*static_cast<const SEIEquirectangularProjection*>(&sei));
182  break;
184  xWriteSEISphereRotation(*static_cast<const SEISphereRotation*>(&sei));
185  break;
186  case SEI::OMNI_VIEWPORT:
187  xWriteSEIOmniViewport(*static_cast<const SEIOmniViewport*>(&sei));
188  break;
189 #endif
190 #if CMP_SEI_MESSAGE
192  xWriteSEICubemapProjection(*static_cast<const SEICubemapProjection*>(&sei));
193  break;
194 #endif
195 #if RWP_SEI_MESSAGE
197  xWriteSEIRegionWisePacking(*static_cast<const SEIRegionWisePacking*>(&sei));
198  break;
199 #endif
200 #if RNSEI
202  xWriteSEIRegionalNesting(bs, *static_cast<const SEIRegionalNesting*>(&sei), sps);
203  break;
204 #endif
205  default:
206  assert(!"Trying to write unhandled SEI message");
207  break;
208  }
209  xWriteByteAlign();
210 }
211 
215 Void SEIWriter::writeSEImessages(TComBitIf& bs, const SEIMessages &seiList, const TComSPS *sps, Bool isNested)
216 {
217 #if ENC_DEC_TRACE
218  if (g_HLSTraceEnable)
219  xTraceSEIHeader();
220 #endif
221 
222  TComBitCounter bs_count;
223 
224  for (SEIMessages::const_iterator sei=seiList.begin(); sei!=seiList.end(); sei++)
225  {
226  // calculate how large the payload data is
227  // TODO: this would be far nicer if it used vectored buffers
228  bs_count.resetBits();
229  setBitstream(&bs_count);
230 
231 #if ENC_DEC_TRACE
232  Bool traceEnable = g_HLSTraceEnable;
233  g_HLSTraceEnable = false;
234 #endif
235  xWriteSEIpayloadData(bs_count, **sei, sps);
236 #if ENC_DEC_TRACE
237  g_HLSTraceEnable = traceEnable;
238 #endif
239  UInt payload_data_num_bits = bs_count.getNumberOfWrittenBits();
240  assert(0 == payload_data_num_bits % 8);
241 
242  setBitstream(&bs);
243  UInt payloadType = (*sei)->payloadType();
244  for (; payloadType >= 0xff; payloadType -= 0xff)
245  {
246  WRITE_CODE(0xff, 8, "payload_type");
247  }
248  WRITE_CODE(payloadType, 8, "payload_type");
249 
250  UInt payloadSize = payload_data_num_bits/8;
251  for (; payloadSize >= 0xff; payloadSize -= 0xff)
252  {
253  WRITE_CODE(0xff, 8, "payload_size");
254  }
255  WRITE_CODE(payloadSize, 8, "payload_size");
256 
257  /* payloadData */
258 #if ENC_DEC_TRACE
259  if (g_HLSTraceEnable)
260  xTraceSEIMessageType((*sei)->payloadType());
261 #endif
262 
263  xWriteSEIpayloadData(bs, **sei, sps);
264  }
265  if (!isNested)
266  {
268  }
269 }
270 
271 #if RNSEI
272 // Similar to writing the SEI message but does not write the trailing bits
274 {
275 #if ENC_DEC_TRACE
276  if (g_HLSTraceEnable)
277  xTraceSEIHeader();
278 #endif
279 
280  TComBitCounter bs_count;
281 
282  // calculate how large the payload data is
283  // TODO: this would be far nicer if it used vectored buffers
284  bs_count.resetBits();
285  setBitstream(&bs_count);
286 
287 #if ENC_DEC_TRACE
288  Bool traceEnable = g_HLSTraceEnable;
289  g_HLSTraceEnable = false;
290 #endif
291  xWriteSEIpayloadData(bs_count, *sei, sps);
292 #if ENC_DEC_TRACE
293  g_HLSTraceEnable = traceEnable;
294 #endif
295  UInt payload_data_num_bits = bs_count.getNumberOfWrittenBits();
296  assert(0 == payload_data_num_bits % 8);
297 
298  setBitstream(&bs);
299  UInt payloadType = sei->payloadType();
300  for (; payloadType >= 0xff; payloadType -= 0xff)
301  {
302  WRITE_CODE(0xff, 8, "payload_type");
303  }
304  WRITE_CODE(payloadType, 8, "payload_type");
305 
306  UInt payloadSize = payload_data_num_bits/8;
307  for (; payloadSize >= 0xff; payloadSize -= 0xff)
308  {
309  WRITE_CODE(0xff, 8, "payload_size");
310  }
311  WRITE_CODE(payloadSize, 8, "payload_size");
312 
313  /* payloadData */
314 #if ENC_DEC_TRACE
315  if (g_HLSTraceEnable)
316  xTraceSEIMessageType((*sei)->payloadType());
317 #endif
318 
319  xWriteSEIpayloadData(bs, *sei, sps);
320 }
321 #endif
322 
324 {
325  Int i, nalOrVcl;
326  const TComVUI *vui = sps->getVuiParameters();
327  const TComHRD *hrd = vui->getHrdParameters();
328 
329  WRITE_UVLC( sei.m_bpSeqParameterSetId, "bp_seq_parameter_set_id" );
330  if( !hrd->getSubPicCpbParamsPresentFlag() )
331  {
332  WRITE_FLAG( sei.m_rapCpbParamsPresentFlag, "irap_cpb_params_present_flag" );
333  }
334  if( sei.m_rapCpbParamsPresentFlag )
335  {
336  WRITE_CODE( sei.m_cpbDelayOffset, hrd->getCpbRemovalDelayLengthMinus1() + 1, "cpb_delay_offset" );
337  WRITE_CODE( sei.m_dpbDelayOffset, hrd->getDpbOutputDelayLengthMinus1() + 1, "dpb_delay_offset" );
338  }
339  WRITE_FLAG( sei.m_concatenationFlag, "concatenation_flag");
340  WRITE_CODE( sei.m_auCpbRemovalDelayDelta - 1, ( hrd->getCpbRemovalDelayLengthMinus1() + 1 ), "au_cpb_removal_delay_delta_minus1" );
341  for( nalOrVcl = 0; nalOrVcl < 2; nalOrVcl ++ )
342  {
343  if( ( ( nalOrVcl == 0 ) && ( hrd->getNalHrdParametersPresentFlag() ) ) ||
344  ( ( nalOrVcl == 1 ) && ( hrd->getVclHrdParametersPresentFlag() ) ) )
345  {
346  for( i = 0; i < ( hrd->getCpbCntMinus1( 0 ) + 1 ); i ++ )
347  {
348  WRITE_CODE( sei.m_initialCpbRemovalDelay[i][nalOrVcl],( hrd->getInitialCpbRemovalDelayLengthMinus1() + 1 ) , "initial_cpb_removal_delay" );
349  WRITE_CODE( sei.m_initialCpbRemovalDelayOffset[i][nalOrVcl],( hrd->getInitialCpbRemovalDelayLengthMinus1() + 1 ), "initial_cpb_removal_delay_offset" );
351  {
352  WRITE_CODE( sei.m_initialAltCpbRemovalDelay[i][nalOrVcl], ( hrd->getInitialCpbRemovalDelayLengthMinus1() + 1 ) , "initial_alt_cpb_removal_delay" );
353  WRITE_CODE( sei.m_initialAltCpbRemovalDelayOffset[i][nalOrVcl], ( hrd->getInitialCpbRemovalDelayLengthMinus1() + 1 ),"initial_alt_cpb_removal_delay_offset" );
354  }
355  }
356  }
357  }
358 }
359 
360 
362 {
363  Int i;
364  const TComVUI *vui = sps->getVuiParameters();
365  const TComHRD *hrd = vui->getHrdParameters();
366 
367  if( vui->getFrameFieldInfoPresentFlag() )
368  {
369  WRITE_CODE( sei.m_picStruct, 4, "pic_struct" );
370  WRITE_CODE( sei.m_sourceScanType, 2, "source_scan_type" );
371  WRITE_FLAG( sei.m_duplicateFlag ? 1 : 0, "duplicate_flag" );
372  }
373 
374  if( hrd->getCpbDpbDelaysPresentFlag() )
375  {
376  WRITE_CODE( sei.m_auCpbRemovalDelay - 1, ( hrd->getCpbRemovalDelayLengthMinus1() + 1 ), "au_cpb_removal_delay_minus1" );
377  WRITE_CODE( sei.m_picDpbOutputDelay, ( hrd->getDpbOutputDelayLengthMinus1() + 1 ), "pic_dpb_output_delay" );
379  {
380  WRITE_CODE(sei.m_picDpbOutputDuDelay, hrd->getDpbOutputDelayDuLengthMinus1()+1, "pic_dpb_output_du_delay" );
381  }
383  {
384  WRITE_UVLC( sei.m_numDecodingUnitsMinus1, "num_decoding_units_minus1" );
385  WRITE_FLAG( sei.m_duCommonCpbRemovalDelayFlag, "du_common_cpb_removal_delay_flag" );
387  {
388  WRITE_CODE( sei.m_duCommonCpbRemovalDelayMinus1, ( hrd->getDuCpbRemovalDelayLengthMinus1() + 1 ), "du_common_cpb_removal_delay_minus1" );
389  }
390  for( i = 0; i <= sei.m_numDecodingUnitsMinus1; i ++ )
391  {
392  WRITE_UVLC( sei.m_numNalusInDuMinus1[ i ], "num_nalus_in_du_minus1");
393  if( ( !sei.m_duCommonCpbRemovalDelayFlag ) && ( i < sei.m_numDecodingUnitsMinus1 ) )
394  {
395  WRITE_CODE( sei.m_duCpbRemovalDelayMinus1[ i ], ( hrd->getDuCpbRemovalDelayLengthMinus1() + 1 ), "du_cpb_removal_delay_minus1" );
396  }
397  }
398  }
399  }
400 }
401 
402 
404 {
405  WRITE_UVLC( sei.m_panScanRectId, "pan_scan_rect_id" );
406  const UInt numRegions = (UInt) sei.m_panScanRectRegions.size();
407  if ( !sei.m_panScanRectCancelFlag && numRegions>0 )
408  {
409  WRITE_FLAG( sei.m_panScanRectCancelFlag, "pan_scan_rect_cancel_flag" );
410  WRITE_UVLC( numRegions - 1, "pan_scan_cnt_minus1" );
411  for(UInt region=0; region<numRegions; region++)
412  {
413  const SEIPanScanRect::PanScanRect &rect=sei.m_panScanRectRegions[region];
414  WRITE_SVLC( rect.leftOffset, "pan_scan_rect_left_offset[i]" );
415  WRITE_SVLC( rect.rightOffset, "pan_scan_rect_rioht_offset[i]" );
416  WRITE_SVLC( rect.topOffset, "pan_scan_rect_top_offset[i]" );
417  WRITE_SVLC( rect.bottomOffset, "pan_scan_rect_bottom_offset[i]" );
418  }
419  WRITE_FLAG( sei.m_panScanRectPersistenceFlag, "pan_scan_rect_persistence_flag" );
420  }
421 }
422 
423 
425 {
426  for(UInt k=0; k<sei.m_numFillerFFBytes; k++)
427  {
428  WRITE_CODE( 0xff, 8, "ff_byte" );
429  }
430 }
431 
432 
434 {
435  WRITE_CODE( (sei.m_ituCountryCode>255) ? 0xff : sei.m_ituCountryCode, 8, "itu_t_t35_country_code" );
436  if (sei.m_ituCountryCode>=255)
437  {
438  assert(sei.m_ituCountryCode < 255+256);
439  WRITE_CODE( sei.m_ituCountryCode-255, 8, "itu_t_t35_country_code_extension_byte" );
440  }
441  for(UInt i=0; i<sei.m_userData.size(); i++)
442  {
443  WRITE_CODE( sei.m_userData[i], 8, "itu_t_t35_payload_byte" );
444  }
445 }
446 
447 
449 {
450  for (UInt i = 0; i < ISO_IEC_11578_LEN; i++)
451  {
452  WRITE_CODE(sei.m_uuid_iso_iec_11578[i], 8 , "sei.uuid_iso_iec_11578[i]");
453  }
454 
455  for (std::size_t i = 0; i < sei.m_userData.size(); i++)
456  {
457  WRITE_CODE(sei.m_userData[i], 8 , "user_data");
458  }
459 }
460 
461 
463 {
464  WRITE_SVLC( sei.m_recoveryPocCnt, "recovery_poc_cnt" );
465  WRITE_FLAG( sei.m_exactMatchingFlag, "exact_matching_flag" );
466  WRITE_FLAG( sei.m_brokenLinkFlag, "broken_link_flag" );
467 }
468 
469 
471 {
472  WRITE_FLAG( sei.m_bSceneInfoPresentFlag, "scene_info_present_flag" );
473  if (sei.m_bSceneInfoPresentFlag)
474  {
475  WRITE_FLAG( sei.m_bPrevSceneIdValidFlag, "prev_scene_id_valid_flag" );
476  WRITE_UVLC( sei.m_sceneId, "scene_id" );
477  WRITE_UVLC( sei.m_sceneTransitionType, "scene_transition_type" );
478  if (sei.m_sceneTransitionType > 3)
479  {
480  WRITE_UVLC( sei.m_secondSceneId, "second_scene_id" );
481  }
482  }
483 }
484 
485 
487 {
488  WRITE_UVLC( sei.m_snapshotId, "snapshot_id" );
489 }
490 
491 
493 {
494  WRITE_UVLC( sei.m_progressiveRefinementId, "progressive_refinement_id" );
495  WRITE_UVLC( sei.m_picOrderCntDelta, "pic_order_cnt_delta" );
496 }
497 
498 
500 {
501  WRITE_UVLC( sei.m_progressiveRefinementId, "progressive_refinement_id" );
502 }
503 
504 
506 {
507  WRITE_FLAG( sei.m_filmGrainCharacteristicsCancelFlag, "film_grain_characteristics_cancel_flag" );
509  {
510  WRITE_CODE( sei.m_filmGrainModelId, 2, "film_grain_model_id" );
511  WRITE_FLAG( sei.m_separateColourDescriptionPresentFlag, "separate_colour_description_present_flag" );
513  {
514  WRITE_CODE( sei.m_filmGrainBitDepthLumaMinus8, 3, "film_grain_bit_depth_luma_minus8" );
515  WRITE_CODE( sei.m_filmGrainBitDepthChromaMinus8, 3, "film_grain_bit_depth_chroma_minus8" );
516  WRITE_FLAG( sei.m_filmGrainFullRangeFlag, "film_grain_full_range_flag" );
517  WRITE_CODE( sei.m_filmGrainColourPrimaries, 8, "film_grain_colour_primaries" );
518  WRITE_CODE( sei.m_filmGrainTransferCharacteristics, 8, "film_grain_transfer_characteristics" );
519  WRITE_CODE( sei.m_filmGrainMatrixCoeffs, 8, "film_grain_matrix_coeffs" );
520  }
521  WRITE_CODE( sei.m_blendingModeId, 2, "blending_mode_id" );
522  WRITE_CODE( sei.m_log2ScaleFactor, 4, "log2_scale_factor" );
523  for(Int c=0; c<3; c++)
524  {
526  const UInt numIntensityIntervals = (UInt) cm.intensityValues.size();
527  const UInt numModelValues = cm.numModelValues;
528  WRITE_FLAG( sei.m_compModel[c].bPresentFlag && numIntensityIntervals>0 && numModelValues>0, "comp_model_present_flag[c]" );
529  }
530  for(Int c=0; c<3; c++)
531  {
533  const UInt numIntensityIntervals = (UInt) cm.intensityValues.size();
534  const UInt numModelValues = cm.numModelValues;
535  if (cm.bPresentFlag && numIntensityIntervals>0 && numModelValues>0)
536  {
537  assert(numIntensityIntervals<=256);
538  assert(numModelValues<=256);
539  WRITE_CODE( numIntensityIntervals-1, 8, "num_intensity_intervals_minus1[c]");
540  WRITE_CODE( numModelValues-1, 8, "num_model_values_minus1[c]");
541  for(UInt interval=0; interval<numIntensityIntervals; interval++)
542  {
544  WRITE_CODE( cmiv.intensityIntervalLowerBound, 8, "intensity_interval_lower_bound[c][i]" );
545  WRITE_CODE( cmiv.intensityIntervalUpperBound, 8, "intensity_interval_upper_bound[c][i]" );
546  assert(cmiv.compModelValue.size() == numModelValues);
547  for(UInt j=0; j<cm.numModelValues; j++)
548  {
549  WRITE_SVLC(cmiv.compModelValue[j], "comp_model_value[c][i]" );
550  }
551  }
552  }
553  } // for c
554  WRITE_FLAG( sei.m_filmGrainCharacteristicsPersistenceFlag, "film_grain_characteristics_persistence_flag" );
555  } // cancel flag
556 }
557 
558 
560 {
561  WRITE_UVLC( sei.m_filterHintSizeY, "filter_hint_size_y" );
562  WRITE_UVLC( sei.m_filterHintSizeX, "filter_hint_size_x" );
563  WRITE_CODE( sei.m_filterHintType, 2, "filter_hint_type" );
564  assert( (sps->getChromaFormatIdc() == CHROMA_400) == sei.m_bIsMonochrome );
565  const UInt numChromaChannels = sei.m_bIsMonochrome ? 1:3;
566  assert( sei.m_filterHintValues.size() == numChromaChannels*sei.m_filterHintSizeX*sei.m_filterHintSizeY );
567  for(std::size_t i=0; i<sei.m_filterHintValues.size(); i++)
568  {
569  WRITE_SVLC( sei.m_filterHintValues[i], "filter_hint_value[][][]" );
570  }
571 }
572 
573 
575 {
576  Int i;
577  WRITE_UVLC( sei.m_toneMapId, "tone_map_id" );
578  WRITE_FLAG( sei.m_toneMapCancelFlag, "tone_map_cancel_flag" );
579  if( !sei.m_toneMapCancelFlag )
580  {
581  WRITE_FLAG( sei.m_toneMapPersistenceFlag, "tone_map_persistence_flag" );
582  WRITE_CODE( sei.m_codedDataBitDepth, 8, "coded_data_bit_depth" );
583  WRITE_CODE( sei.m_targetBitDepth, 8, "target_bit_depth" );
584  WRITE_UVLC( sei.m_modelId, "model_id" );
585  switch(sei.m_modelId)
586  {
587  case 0:
588  {
589  WRITE_CODE( sei.m_minValue, 32, "min_value" );
590  WRITE_CODE( sei.m_maxValue, 32, "max_value" );
591  break;
592  }
593  case 1:
594  {
595  WRITE_CODE( sei.m_sigmoidMidpoint, 32, "sigmoid_midpoint" );
596  WRITE_CODE( sei.m_sigmoidWidth, 32, "sigmoid_width" );
597  break;
598  }
599  case 2:
600  {
601  UInt num = 1u << sei.m_targetBitDepth;
602  for(i = 0; i < num; i++)
603  {
604  WRITE_CODE( sei.m_startOfCodedInterval[i], (( sei.m_codedDataBitDepth + 7 ) >> 3 ) << 3, "start_of_coded_interval" );
605  }
606  break;
607  }
608  case 3:
609  {
610  WRITE_CODE( sei.m_numPivots, 16, "num_pivots" );
611  for(i = 0; i < sei.m_numPivots; i++ )
612  {
613  WRITE_CODE( sei.m_codedPivotValue[i], (( sei.m_codedDataBitDepth + 7 ) >> 3 ) << 3, "coded_pivot_value" );
614  WRITE_CODE( sei.m_targetPivotValue[i], (( sei.m_targetBitDepth + 7 ) >> 3 ) << 3, "target_pivot_value");
615  }
616  break;
617  }
618  case 4:
619  {
620  WRITE_CODE( sei.m_cameraIsoSpeedIdc, 8, "camera_iso_speed_idc" );
621  if( sei.m_cameraIsoSpeedIdc == 255) //Extended_ISO
622  {
623  WRITE_CODE( sei.m_cameraIsoSpeedValue, 32, "camera_iso_speed_value" );
624  }
625  WRITE_CODE( sei.m_exposureIndexIdc, 8, "exposure_index_idc" );
626  if( sei.m_exposureIndexIdc == 255) //Extended_ISO
627  {
628  WRITE_CODE( sei.m_exposureIndexValue, 32, "exposure_index_value" );
629  }
630  WRITE_FLAG( sei.m_exposureCompensationValueSignFlag, "exposure_compensation_value_sign_flag" );
631  WRITE_CODE( sei.m_exposureCompensationValueNumerator, 16, "exposure_compensation_value_numerator" );
632  WRITE_CODE( sei.m_exposureCompensationValueDenomIdc, 16, "exposure_compensation_value_denom_idc" );
633  WRITE_CODE( sei.m_refScreenLuminanceWhite, 32, "ref_screen_luminance_white" );
634  WRITE_CODE( sei.m_extendedRangeWhiteLevel, 32, "extended_range_white_level" );
635  WRITE_CODE( sei.m_nominalBlackLevelLumaCodeValue, 16, "nominal_black_level_luma_code_value" );
636  WRITE_CODE( sei.m_nominalWhiteLevelLumaCodeValue, 16, "nominal_white_level_luma_code_value" );
637  WRITE_CODE( sei.m_extendedWhiteLevelLumaCodeValue, 16, "extended_white_level_luma_code_value" );
638  break;
639  }
640  default:
641  {
642  assert(!"Undefined SEIToneMapModelId");
643  break;
644  }
645  }//switch m_modelId
646  }//if(!sei.m_toneMapCancelFlag)
647 }
648 
649 
651 {
652  WRITE_UVLC( sei.m_arrangementId, "frame_packing_arrangement_id" );
653  WRITE_FLAG( sei.m_arrangementCancelFlag, "frame_packing_arrangement_cancel_flag" );
654 
655  if( sei.m_arrangementCancelFlag == 0 )
656  {
657  WRITE_CODE( sei.m_arrangementType, 7, "frame_packing_arrangement_type" );
658 
659  WRITE_FLAG( sei.m_quincunxSamplingFlag, "quincunx_sampling_flag" );
660  WRITE_CODE( sei.m_contentInterpretationType, 6, "content_interpretation_type" );
661  WRITE_FLAG( sei.m_spatialFlippingFlag, "spatial_flipping_flag" );
662  WRITE_FLAG( sei.m_frame0FlippedFlag, "frame0_flipped_flag" );
663  WRITE_FLAG( sei.m_fieldViewsFlag, "field_views_flag" );
664  WRITE_FLAG( sei.m_currentFrameIsFrame0Flag, "current_frame_is_frame0_flag" );
665 
666  WRITE_FLAG( sei.m_frame0SelfContainedFlag, "frame0_self_contained_flag" );
667  WRITE_FLAG( sei.m_frame1SelfContainedFlag, "frame1_self_contained_flag" );
668 
669  if(sei.m_quincunxSamplingFlag == 0 && sei.m_arrangementType != 5)
670  {
671  WRITE_CODE( sei.m_frame0GridPositionX, 4, "frame0_grid_position_x" );
672  WRITE_CODE( sei.m_frame0GridPositionY, 4, "frame0_grid_position_y" );
673  WRITE_CODE( sei.m_frame1GridPositionX, 4, "frame1_grid_position_x" );
674  WRITE_CODE( sei.m_frame1GridPositionY, 4, "frame1_grid_position_y" );
675  }
676 
677  WRITE_CODE( sei.m_arrangementReservedByte, 8, "frame_packing_arrangement_reserved_byte" );
678  WRITE_FLAG( sei.m_arrangementPersistenceFlag, "frame_packing_arrangement_persistence_flag" );
679  }
680 
681  WRITE_FLAG( sei.m_upsampledAspectRatio, "upsampled_aspect_ratio" );
682 }
683 
684 
686 {
687  WRITE_FLAG( sei.cancelFlag, "display_orientation_cancel_flag" );
688  if( !sei.cancelFlag )
689  {
690  WRITE_FLAG( sei.horFlip, "hor_flip" );
691  WRITE_FLAG( sei.verFlip, "ver_flip" );
692  WRITE_CODE( sei.anticlockwiseRotation, 16, "anticlockwise_rotation" );
693  WRITE_FLAG( sei.persistenceFlag, "display_orientation_persistence_flag" );
694  }
695 }
696 
697 
699 {
700  WRITE_CODE(sei.m_greenMetadataType, 8, "green_metadata_type");
701 
702  WRITE_CODE(sei.m_xsdMetricType, 8, "xsd_metric_type");
703  WRITE_CODE(sei.m_xsdMetricValue, 16, "xsd_metric_value");
704 }
705 
706 
708 {
709  WRITE_UVLC( sei.m_sopSeqParameterSetId, "sop_seq_parameter_set_id" );
710  WRITE_UVLC( sei.m_numPicsInSopMinus1, "num_pics_in_sop_minus1" );
711  for (UInt i = 0; i <= sei.m_numPicsInSopMinus1; i++)
712  {
713  WRITE_CODE( sei.m_sopDescVclNaluType[i], 6, "sop_desc_vcl_nalu_type" );
714  WRITE_CODE( sei.m_sopDescTemporalId[i], 3, "sop_desc_temporal_id" );
716  {
717  WRITE_UVLC( sei.m_sopDescStRpsIdx[i], "sop_desc_st_rps_idx" );
718  }
719  if (i > 0)
720  {
721  WRITE_SVLC( sei.m_sopDescPocDelta[i], "sop_desc_poc_delta" );
722  }
723  }
724 }
725 
726 
728 {
729  WRITE_CODE(sei.activeVPSId, 4, "active_video_parameter_set_id");
730  WRITE_FLAG(sei.m_selfContainedCvsFlag, "self_contained_cvs_flag");
731  WRITE_FLAG(sei.m_noParameterSetUpdateFlag, "no_parameter_set_update_flag");
732  WRITE_UVLC(sei.numSpsIdsMinus1, "num_sps_ids_minus1");
733 
734  assert (sei.activeSeqParameterSetId.size() == (sei.numSpsIdsMinus1 + 1));
735 
736  for (Int i = 0; i < sei.activeSeqParameterSetId.size(); i++)
737  {
738  WRITE_UVLC(sei.activeSeqParameterSetId[i], "active_seq_parameter_set_id");
739  }
740 }
741 
742 
744 {
745  const TComVUI *vui = sps->getVuiParameters();
746  WRITE_UVLC(sei.m_decodingUnitIdx, "decoding_unit_idx");
748  {
749  WRITE_CODE( sei.m_duSptCpbRemovalDelay, (vui->getHrdParameters()->getDuCpbRemovalDelayLengthMinus1() + 1), "du_spt_cpb_removal_delay_increment");
750  }
751  WRITE_FLAG( sei.m_dpbOutputDuDelayPresentFlag, "dpb_output_du_delay_present_flag");
753  {
754  WRITE_CODE(sei.m_picSptDpbOutputDuDelay, vui->getHrdParameters()->getDpbOutputDelayDuLengthMinus1() + 1, "pic_spt_dpb_output_du_delay");
755  }
756 }
757 
758 
760 {
761  WRITE_CODE( sei.tl0Idx, 8 , "tl0_idx" );
762  WRITE_CODE( sei.rapIdx, 8 , "rap_idx" );
763 }
764 
765 
767 {
768  const TChar *traceString="\0";
769  switch (sei.method)
770  {
771  case HASHTYPE_MD5: traceString="picture_md5"; break;
772  case HASHTYPE_CRC: traceString="picture_crc"; break;
773  case HASHTYPE_CHECKSUM: traceString="picture_checksum"; break;
774  default: assert(false); break;
775  }
776 
777  if (traceString != 0) //use of this variable is needed to avoid a compiler error with G++ 4.6.1
778  {
779  WRITE_CODE(sei.method, 8, "hash_type");
780  for(UInt i=0; i<UInt(sei.m_pictureHash.hash.size()); i++)
781  {
782  WRITE_CODE(sei.m_pictureHash.hash[i], 8, traceString);
783  }
784  }
785 }
786 
787 
789 {
790  WRITE_FLAG( sei.m_bitStreamSubsetFlag, "bitstream_subset_flag" );
791  WRITE_FLAG( sei.m_nestingOpFlag, "nesting_op_flag " );
792  if (sei.m_nestingOpFlag)
793  {
794  WRITE_FLAG( sei.m_defaultOpFlag, "default_op_flag" );
795  WRITE_UVLC( sei.m_nestingNumOpsMinus1, "nesting_num_ops_minus1" );
796  for (UInt i = (sei.m_defaultOpFlag ? 1 : 0); i <= sei.m_nestingNumOpsMinus1; i++)
797  {
798  WRITE_CODE( sei.m_nestingMaxTemporalIdPlus1[i], 3, "nesting_max_temporal_id_plus1" );
799  WRITE_UVLC( sei.m_nestingOpIdx[i], "nesting_op_idx" );
800  }
801  }
802  else
803  {
804  WRITE_FLAG( sei.m_allLayersFlag, "all_layers_flag" );
805  if (!sei.m_allLayersFlag)
806  {
807  WRITE_CODE( sei.m_nestingNoOpMaxTemporalIdPlus1, 3, "nesting_no_op_max_temporal_id_plus1" );
808  WRITE_UVLC( sei.m_nestingNumLayersMinus1, "nesting_num_layers" );
809  for (UInt i = 0; i <= sei.m_nestingNumLayersMinus1; i++)
810  {
811  WRITE_CODE( sei.m_nestingLayerId[i], 6, "nesting_layer_id" );
812  }
813  }
814  }
815 
816  // byte alignment
817  while ( m_pcBitIf->getNumberOfWrittenBits() % 8 != 0 )
818  {
819  WRITE_FLAG( 0, "nesting_zero_bit" );
820  }
821 
822  // write nested SEI messages
823  writeSEImessages(bs, sei.m_nestedSEIs, sps, true);
824 }
825 
826 
828 {
829  WRITE_FLAG( sei.m_gdrForegroundFlag, "gdr_foreground_flag");
830 }
831 
832 
834 {
835  // intentionally empty
836 }
837 
838 
840 {
841  WRITE_CODE(sei.numClockTs, 2, "num_clock_ts");
842  for(Int i = 0; i < sei.numClockTs; i++)
843  {
844  const TComSEITimeSet &currentTimeSet = sei.timeSetArray[i];
845  WRITE_FLAG(currentTimeSet.clockTimeStampFlag, "clock_time_stamp_flag");
846  if(currentTimeSet.clockTimeStampFlag)
847  {
848  WRITE_FLAG(currentTimeSet.numUnitFieldBasedFlag, "units_field_based_flag");
849  WRITE_CODE(currentTimeSet.countingType, 5, "counting_type");
850  WRITE_FLAG(currentTimeSet.fullTimeStampFlag, "full_timestamp_flag");
851  WRITE_FLAG(currentTimeSet.discontinuityFlag, "discontinuity_flag");
852  WRITE_FLAG(currentTimeSet.cntDroppedFlag, "cnt_dropped_flag");
853  WRITE_CODE(currentTimeSet.numberOfFrames, 9, "n_frames");
854  if(currentTimeSet.fullTimeStampFlag)
855  {
856  WRITE_CODE(currentTimeSet.secondsValue, 6, "seconds_value");
857  WRITE_CODE(currentTimeSet.minutesValue, 6, "minutes_value");
858  WRITE_CODE(currentTimeSet.hoursValue, 5, "hours_value");
859  }
860  else
861  {
862  WRITE_FLAG(currentTimeSet.secondsFlag, "seconds_flag");
863  if(currentTimeSet.secondsFlag)
864  {
865  WRITE_CODE(currentTimeSet.secondsValue, 6, "seconds_value");
866  WRITE_FLAG(currentTimeSet.minutesFlag, "minutes_flag");
867  if(currentTimeSet.minutesFlag)
868  {
869  WRITE_CODE(currentTimeSet.minutesValue, 6, "minutes_value");
870  WRITE_FLAG(currentTimeSet.hoursFlag, "hours_flag");
871  if(currentTimeSet.hoursFlag)
872  {
873  WRITE_CODE(currentTimeSet.hoursValue, 5, "hours_value");
874  }
875  }
876  }
877  }
878  WRITE_CODE(currentTimeSet.timeOffsetLength, 5, "time_offset_length");
879  if(currentTimeSet.timeOffsetLength > 0)
880  {
881  if(currentTimeSet.timeOffsetValue >= 0)
882  {
883  WRITE_CODE((UInt)currentTimeSet.timeOffsetValue, currentTimeSet.timeOffsetLength, "time_offset_value");
884  }
885  else
886  {
887  // Two's complement conversion
888  UInt offsetValue = ~(currentTimeSet.timeOffsetValue) + 1;
889  offsetValue |= (1 << (currentTimeSet.timeOffsetLength-1));
890  WRITE_CODE(offsetValue, currentTimeSet.timeOffsetLength, "time_offset_value");
891  }
892  }
893  }
894  }
895 }
896 
897 
899 {
900  WRITE_CODE( sei.values.primaries[0][0], 16, "display_primaries_x[0]" );
901  WRITE_CODE( sei.values.primaries[0][1], 16, "display_primaries_y[0]" );
902 
903  WRITE_CODE( sei.values.primaries[1][0], 16, "display_primaries_x[1]" );
904  WRITE_CODE( sei.values.primaries[1][1], 16, "display_primaries_y[1]" );
905 
906  WRITE_CODE( sei.values.primaries[2][0], 16, "display_primaries_x[2]" );
907  WRITE_CODE( sei.values.primaries[2][1], 16, "display_primaries_y[2]" );
908 
909  WRITE_CODE( sei.values.whitePoint[0], 16, "white_point_x" );
910  WRITE_CODE( sei.values.whitePoint[1], 16, "white_point_y" );
911 
912  WRITE_CODE( sei.values.maxLuminance, 32, "max_display_mastering_luminance" );
913  WRITE_CODE( sei.values.minLuminance, 32, "min_display_mastering_luminance" );
914 }
915 
916 
918 {
919  WRITE_FLAG( sei.m_arrangementCancelFlag, "segmented_rect_frame_packing_arrangement_cancel_flag" );
920  if( sei.m_arrangementCancelFlag == 0 )
921  {
922  WRITE_CODE( sei.m_contentInterpretationType, 2, "segmented_rect_content_interpretation_type" );
923  WRITE_FLAG( sei.m_arrangementPersistenceFlag, "segmented_rect_frame_packing_arrangement_persistence" );
924  }
925 }
926 
927 
929 {
930  //UInt code;
931  WRITE_FLAG((sei.m_mc_all_tiles_exact_sample_value_match_flag ? 1 : 0), "mc_all_tiles_exact_sample_value_match_flag");
932  WRITE_FLAG((sei.m_each_tile_one_tile_set_flag ? 1 : 0), "each_tile_one_tile_set_flag" );
933 
935  {
936  WRITE_FLAG((sei.m_limited_tile_set_display_flag ? 1 : 0), "limited_tile_set_display_flag");
937  WRITE_UVLC((sei.getNumberOfTileSets() - 1), "num_sets_in_message_minus1" );
938 
939  if(sei.getNumberOfTileSets() > 0)
940  {
941  for(Int i = 0; i < sei.getNumberOfTileSets(); i++)
942  {
943  WRITE_UVLC(sei.tileSetData(i).m_mcts_id, "mcts_id");
944 
946  {
947  WRITE_FLAG((sei.tileSetData(i).m_display_tile_set_flag ? 1 : 0), "display_tile_set_flag");
948  }
949 
950  WRITE_UVLC((sei.tileSetData(i).getNumberOfTileRects() - 1), "num_tile_rects_in_set_minus1");
951 
952  for(Int j = 0; j < sei.tileSetData(i).getNumberOfTileRects(); j++)
953  {
954  WRITE_UVLC(sei.tileSetData(i).topLeftTileIndex (j), "top_left_tile_index");
955  WRITE_UVLC(sei.tileSetData(i).bottomRightTileIndex(j), "bottom_right_tile_index");
956  }
957 
959  {
960  WRITE_FLAG((sei.tileSetData(i).m_exact_sample_value_match_flag ? 1 : 0), "exact_sample_value_match_flag");
961  }
962 
963  WRITE_FLAG((sei.tileSetData(i).m_mcts_tier_level_idc_present_flag ? 1 : 0), "mcts_tier_level_idc_present_flag");
964 
966  {
967  WRITE_FLAG((sei.tileSetData(i).m_mcts_tier_flag ? 1 : 0), "mcts_tier_flag");
968  WRITE_CODE( sei.tileSetData(i).m_mcts_level_idc, 8, "mcts_level_idc");
969  }
970  }
971  }
972  }
973  else
974  {
975  WRITE_FLAG((sei.m_max_mcs_tier_level_idc_present_flag ? 1 : 0), "max_mcs_tier_level_idc_present_flag");
976 
978  {
979  WRITE_FLAG((sei.m_max_mcts_tier_flag ? 1 : 0), "max_mcts_tier_flag");
980  WRITE_CODE( sei.m_max_mcts_level_idc, 8, "max_mcts_level_idc");
981  }
982  }
983 }
984 
985 
987 {
988  WRITE_CODE(sei.m_verChromaFilterIdc, 8, "ver_chroma_filter_idc");
989  WRITE_CODE(sei.m_horChromaFilterIdc, 8, "hor_chroma_filter_idc");
990  WRITE_FLAG(sei.m_verFilteringFieldProcessingFlag, "ver_filtering_field_processing_flag");
991  if(sei.m_verChromaFilterIdc == 1 || sei.m_horChromaFilterIdc == 1)
992  {
993  WRITE_UVLC(sei.m_targetFormatIdc, "target_format_idc");
994  if(sei.m_verChromaFilterIdc == 1)
995  {
996  const Int numVerticalFilter = (Int)sei.m_verFilterCoeff.size();
997  WRITE_UVLC(numVerticalFilter, "num_vertical_filters");
998  if(numVerticalFilter > 0)
999  {
1000  for(Int i = 0; i < numVerticalFilter; i ++)
1001  {
1002  const Int verTapLengthMinus1 = (Int) sei.m_verFilterCoeff[i].size() - 1;
1003  WRITE_UVLC(verTapLengthMinus1, "ver_tap_length_minus_1");
1004  for(Int j = 0; j < (verTapLengthMinus1 + 1); j ++)
1005  {
1006  WRITE_SVLC(sei.m_verFilterCoeff[i][j], "ver_filter_coeff");
1007  }
1008  }
1009  }
1010  }
1011  if(sei.m_horChromaFilterIdc == 1)
1012  {
1013  const Int numHorizontalFilter = (Int) sei.m_horFilterCoeff.size();
1014  WRITE_UVLC(numHorizontalFilter, "num_horizontal_filters");
1015  if(numHorizontalFilter > 0)
1016  {
1017  for(Int i = 0; i < numHorizontalFilter; i ++)
1018  {
1019  const Int horTapLengthMinus1 = (Int) sei.m_horFilterCoeff[i].size() - 1;
1020  WRITE_UVLC(horTapLengthMinus1, "hor_tap_length_minus_1");
1021  for(Int j = 0; j < (horTapLengthMinus1 + 1); j ++)
1022  {
1023  WRITE_SVLC(sei.m_horFilterCoeff[i][j], "hor_filter_coeff");
1024  }
1025  }
1026  }
1027  }
1028  }
1029 }
1030 
1031 
1033 {
1034  WRITE_UVLC( sei.m_kneeId, "knee_function_id" );
1035  WRITE_FLAG( sei.m_kneeCancelFlag, "knee_function_cancel_flag" );
1036  if ( !sei.m_kneeCancelFlag )
1037  {
1038  WRITE_FLAG( sei.m_kneePersistenceFlag, "knee_function_persistence_flag" );
1039  WRITE_CODE( (UInt)sei.m_kneeInputDrange , 32, "input_d_range" );
1040  WRITE_CODE( (UInt)sei.m_kneeInputDispLuminance, 32, "input_disp_luminance" );
1041  WRITE_CODE( (UInt)sei.m_kneeOutputDrange, 32, "output_d_range" );
1042  WRITE_CODE( (UInt)sei.m_kneeOutputDispLuminance, 32, "output_disp_luminance" );
1043  WRITE_UVLC( sei.m_kneeNumKneePointsMinus1, "num_knee_points_minus1" );
1044  for(Int i = 0; i <= sei.m_kneeNumKneePointsMinus1; i++ )
1045  {
1046  WRITE_CODE( (UInt)sei.m_kneeInputKneePoint[i], 10,"input_knee_point" );
1047  WRITE_CODE( (UInt)sei.m_kneeOutputKneePoint[i], 10, "output_knee_point" );
1048  }
1049  }
1050 }
1051 
1052 #if CCV_SEI_MESSAGE
1054 {
1055  WRITE_FLAG(sei.m_ccvCancelFlag, "ccv_cancel_flag");
1056  if (!sei.m_ccvCancelFlag)
1057  {
1058  WRITE_FLAG(sei.m_ccvPersistenceFlag, "ccv_persistence_flag");
1059  WRITE_FLAG(sei.m_ccvPrimariesPresentFlag, "ccv_primaries_present_flag");
1060  WRITE_FLAG(sei.m_ccvMinLuminanceValuePresentFlag, "ccv_min_luminance_value_present_flag");
1061  WRITE_FLAG(sei.m_ccvMaxLuminanceValuePresentFlag, "ccv_max_luminance_value_present_flag");
1062  WRITE_FLAG(sei.m_ccvAvgLuminanceValuePresentFlag, "ccv_avg_luminance_value_present_flag");
1063 
1064  if (sei.m_ccvPrimariesPresentFlag == true)
1065  {
1066  for (Int i = 0; i < MAX_NUM_COMPONENT; i++)
1067  {
1068  WRITE_SCODE((Int) sei.m_ccvPrimariesX[i], 32, "ccv_primaries_x[i]");
1069  WRITE_SCODE((Int) sei.m_ccvPrimariesY[i], 32, "ccv_primaries_y[i]");
1070  }
1071  }
1072 
1073  if (sei.m_ccvMinLuminanceValuePresentFlag == true)
1074  {
1075  WRITE_CODE( (UInt)sei.m_ccvMinLuminanceValue, 32, "ccv_min_luminance_value" );
1076  }
1077  if (sei.m_ccvMinLuminanceValuePresentFlag == true)
1078  {
1079  WRITE_CODE( (UInt)sei.m_ccvMaxLuminanceValue, 32, "ccv_max_luminance_value" );
1080  }
1081  if (sei.m_ccvMinLuminanceValuePresentFlag == true)
1082  {
1083  WRITE_CODE( (UInt)sei.m_ccvAvgLuminanceValue, 32, "ccv_avg_luminance_value" );
1084  }
1085  }
1086 }
1087 #endif
1088 
1089 #if ERP_SR_OV_SEI_MESSAGE
1091 {
1092  WRITE_FLAG( sei.m_erpCancelFlag, "erp_cancel_flag" );
1093  if( !sei.m_erpCancelFlag )
1094  {
1095  WRITE_FLAG( sei.m_erpPersistenceFlag, "erp_persistence_flag" );
1096  WRITE_FLAG( sei.m_erpGuardBandFlag, "erp_guard_band_flag" );
1097  WRITE_CODE( 0, 2, "erp_reserved_zero_2bits" );
1098  if ( sei.m_erpGuardBandFlag == 1)
1099  {
1100  WRITE_CODE( sei.m_erpGuardBandType, 3, "erp_guard_band_type" );
1101  WRITE_CODE( sei.m_erpLeftGuardBandWidth, 8, "erp_left_guard_band_width" );
1102  WRITE_CODE( sei.m_erpRightGuardBandWidth, 8, "erp_right_guard_band_width" );
1103  }
1104  }
1105 }
1106 
1108 {
1109  WRITE_FLAG( sei.m_sphereRotationCancelFlag, "sphere_rotation_cancel_flag" );
1110  if( !sei.m_sphereRotationCancelFlag )
1111  {
1112  WRITE_FLAG( sei.m_sphereRotationPersistenceFlag, "sphere_rotation_persistence_flag" );
1113  WRITE_CODE( 0, 6, "sphere_rotation_reserved_zero_6bits" );
1114  WRITE_SCODE(sei.m_sphereRotationYaw, 32, "sphere_rotation_yaw" );
1115  WRITE_SCODE(sei.m_sphereRotationPitch, 32, "sphere_rotation_pitch" );
1116  WRITE_SCODE(sei.m_sphereRotationRoll, 32, "sphere_rotation_roll" );
1117  }
1118 }
1119 
1121 {
1122  WRITE_CODE( sei.m_omniViewportId, 10, "omni_viewport_id" );
1123  WRITE_FLAG( sei.m_omniViewportCancelFlag, "omni_viewport_cancel_flag" );
1124  if ( !sei.m_omniViewportCancelFlag )
1125  {
1126  WRITE_FLAG( sei.m_omniViewportPersistenceFlag, "omni_viewport_persistence_flag" );
1127  const UInt numRegions = (UInt) sei.m_omniViewportRegions.size();
1128  WRITE_CODE( numRegions - 1, 4, "omni_viewport_cnt_minus1" );
1129  for(UInt region=0; region<numRegions; region++)
1130  {
1131  const SEIOmniViewport::OmniViewport &viewport=sei.m_omniViewportRegions[region];
1132  WRITE_SCODE( viewport.azimuthCentre, 32, "omni_viewport_azimuth_centre" );
1133  WRITE_SCODE( viewport.elevationCentre, 32, "omni_viewport_elevation_centre" );
1134  WRITE_SCODE( viewport.tiltCentre, 32, "omni_viewport_tilt_center" );
1135  WRITE_CODE( viewport.horRange, 32, "omni_viewport_hor_range[i]" );
1136  WRITE_CODE( viewport.verRange, 32, "omni_viewport_ver_range[i]" );
1137  }
1138  }
1139 }
1140 #endif
1141 #if CMP_SEI_MESSAGE
1143 {
1144  WRITE_FLAG(sei.m_cmpCancelFlag, "cmp_cancel_flag");
1145  if (!sei.m_cmpCancelFlag)
1146  {
1147  WRITE_FLAG(sei.m_cmpPersistenceFlag, "cmp_persistence_flag");
1148  }
1149 }
1150 #endif
1151 #if RWP_SEI_MESSAGE
1153 {
1154  WRITE_FLAG( sei.m_rwpCancelFlag, "rwp_cancel_flag" );
1155  if(!sei.m_rwpCancelFlag)
1156  {
1157  WRITE_FLAG( sei.m_rwpPersistenceFlag, "rwp_persistence_flag" );
1158  WRITE_FLAG( sei.m_constituentPictureMatchingFlag, "constituent_picture_matching_flag" );
1159  WRITE_CODE( 0, 5, "rwp_reserved_zero_5bits" );
1160  WRITE_CODE( (UInt)sei.m_numPackedRegions, 8, "num_packed_regions" );
1161  WRITE_CODE( (UInt)sei.m_projPictureWidth, 32, "proj_picture_width" );
1162  WRITE_CODE( (UInt)sei.m_projPictureHeight, 32, "proj_picture_height" );
1163  WRITE_CODE( (UInt)sei.m_packedPictureWidth, 16, "packed_picture_width" );
1164  WRITE_CODE( (UInt)sei.m_packedPictureHeight, 16, "packed_picture_height" );
1165  for( Int i=0; i < sei.m_numPackedRegions; i++ )
1166  {
1167  WRITE_CODE( 0, 4, "rwp_reserved_zero_4bits" );
1168  WRITE_CODE( (UInt)sei.m_rwpTransformType[i], 3, "rwp_tTransform_type" );
1169  WRITE_FLAG( sei.m_rwpGuardBandFlag[i], "rwp_guard_band_flag" );
1170  WRITE_CODE( (UInt)sei.m_projRegionWidth[i], 32, "proj_region_width" );
1171  WRITE_CODE( (UInt)sei.m_projRegionHeight[i], 32, "proj_region_height" );
1172  WRITE_CODE( (UInt)sei.m_rwpProjRegionTop[i], 32, "rwp_proj_regionTop" );
1173  WRITE_CODE( (UInt)sei.m_projRegionLeft[i], 32, "proj_region_left" );
1174  WRITE_CODE( (UInt)sei.m_packedRegionWidth[i], 16, "packed_region_width" );
1175  WRITE_CODE( (UInt)sei.m_packedRegionHeight[i], 16, "packed_region_height" );
1176  WRITE_CODE( (UInt)sei.m_packedRegionTop[i], 16, "packed_region_top" );
1177  WRITE_CODE( (UInt)sei.m_packedRegionLeft[i], 16, "packed_region_left" );
1178  if( sei.m_rwpGuardBandFlag[i] )
1179  {
1180  WRITE_CODE( (UInt)sei.m_rwpLeftGuardBandWidth[i], 8, "rwp_left_guard_band_width");
1181  WRITE_CODE( (UInt)sei.m_rwpRightGuardBandWidth[i], 8, "rwp_right_guard_band_width");
1182  WRITE_CODE( (UInt)sei.m_rwpTopGuardBandHeight[i], 8, "rwp_top_guard_band_height");
1183  WRITE_CODE( (UInt)sei. m_rwpBottomGuardBandHeight[i], 8, "rwp_bottom_guard_band_height");
1184  WRITE_FLAG( sei.m_rwpGuardBandNotUsedForPredFlag[i], "rwp_guard_band_not_used_forPred_flag" );
1185  for( Int j=0; j < 4; j++ )
1186  {
1187  WRITE_CODE( (UInt)sei.m_rwpGuardBandType[i*4 + j], 3, "rwp_guard_band_type");
1188  }
1189  WRITE_CODE( 0, 3, "rwp_guard_band_reserved_zero_3bits" );
1190  }
1191  }
1192  }
1193 }
1194 #endif
1195 
1197 {
1198  WRITE_UVLC( sei.m_colourRemapId, "colour_remap_id" );
1199  WRITE_FLAG( sei.m_colourRemapCancelFlag, "colour_remap_cancel_flag" );
1200  if( !sei.m_colourRemapCancelFlag )
1201  {
1202  WRITE_FLAG( sei.m_colourRemapPersistenceFlag, "colour_remap_persistence_flag" );
1203  WRITE_FLAG( sei.m_colourRemapVideoSignalInfoPresentFlag, "colour_remap_video_signal_info_present_flag" );
1205  {
1206  WRITE_FLAG( sei.m_colourRemapFullRangeFlag, "colour_remap_full_range_flag" );
1207  WRITE_CODE( sei.m_colourRemapPrimaries, 8, "colour_remap_primaries" );
1208  WRITE_CODE( sei.m_colourRemapTransferFunction, 8, "colour_remap_transfer_function" );
1209  WRITE_CODE( sei.m_colourRemapMatrixCoefficients, 8, "colour_remap_matrix_coefficients" );
1210  }
1211  WRITE_CODE( sei.m_colourRemapInputBitDepth, 8, "colour_remap_input_bit_depth" );
1212  WRITE_CODE( sei.m_colourRemapBitDepth, 8, "colour_remap_bit_depth" );
1213  for( Int c=0 ; c<3 ; c++ )
1214  {
1215  WRITE_CODE( sei.m_preLutNumValMinus1[c], 8, "pre_lut_num_val_minus1[c]" );
1216  if( sei.m_preLutNumValMinus1[c]>0 )
1217  {
1218  for( Int i=0 ; i<=sei.m_preLutNumValMinus1[c] ; i++ )
1219  {
1220  WRITE_CODE( sei.m_preLut[c][i].codedValue, (( sei.m_colourRemapInputBitDepth + 7 ) >> 3 ) << 3, "pre_lut_coded_value[c][i]" );
1221  WRITE_CODE( sei.m_preLut[c][i].targetValue, (( sei.m_colourRemapBitDepth + 7 ) >> 3 ) << 3, "pre_lut_target_value[c][i]" );
1222  }
1223  }
1224  }
1225  WRITE_FLAG( sei.m_colourRemapMatrixPresentFlag, "colour_remap_matrix_present_flag" );
1227  {
1228  WRITE_CODE( sei.m_log2MatrixDenom, 4, "log2_matrix_denom" );
1229  for( Int c=0 ; c<3 ; c++ )
1230  {
1231  for( Int i=0 ; i<3 ; i++ )
1232  {
1233  WRITE_SVLC( sei.m_colourRemapCoeffs[c][i], "colour_remap_coeffs[c][i]" );
1234  }
1235  }
1236  }
1237 
1238  for( Int c=0 ; c<3 ; c++ )
1239  {
1240  WRITE_CODE( sei.m_postLutNumValMinus1[c], 8, "m_postLutNumValMinus1[c]" );
1241  if( sei.m_postLutNumValMinus1[c]>0 )
1242  {
1243  for( Int i=0 ; i<=sei.m_postLutNumValMinus1[c] ; i++ )
1244  {
1245  WRITE_CODE( sei.m_postLut[c][i].codedValue, (( sei.m_colourRemapBitDepth + 7 ) >> 3 ) << 3, "post_lut_coded_value[c][i]" );
1246  WRITE_CODE( sei.m_postLut[c][i].targetValue, (( sei.m_colourRemapBitDepth + 7 ) >> 3 ) << 3, "post_lut_target_value[c][i]" );
1247  }
1248  }
1249  }
1250  }
1251 }
1252 
1253 
1255 {
1256  WRITE_FLAG( sei.m_deinterlacedPictureSourceParityFlag, "deinterlaced_picture_source_parity_flag" );
1257 }
1258 
1259 
1261 {
1262  WRITE_CODE( sei.m_maxContentLightLevel, 16, "max_content_light_level" );
1263  WRITE_CODE( sei.m_maxPicAverageLightLevel, 16, "max_pic_average_light_level" );
1264 }
1265 
1266 
1268 {
1269  // intentionally empty
1270 }
1271 
1272 
1274 {
1275  WRITE_UVLC( sei.m_nextSegmentAddress, "next_segment_address" );
1276  if (sei.m_nextSegmentAddress)
1277  {
1278  WRITE_FLAG( sei.m_independentSliceSegmentFlag, "independent_slice_segment_flag" );
1279  }
1280 }
1281 
1282 
1284 {
1285  WRITE_CODE(sei.m_preferredTransferCharacteristics, 8, "preferred_transfer_characteristics");
1286 }
1287 
1288 
1290 {
1291  WRITE_CODE(sei.m_ambientIlluminance, 32, "ambient_illuminance" );
1292  WRITE_CODE(sei.m_ambientLightX, 16, "ambient_light_x" );
1293  WRITE_CODE(sei.m_ambientLightY, 16, "ambient_light_y" );
1294 }
1295 
1296 #if RNSEI
1298 {
1299  WRITE_CODE(sei.getRNId(), 16, "regional_nesting_id");
1300  WRITE_CODE(sei.getNumRectRegions(), 8, "regional_nesting_num_rect_regions");
1301  const RNSEIWindowVec regions = sei.getRegions();
1302  for(RNSEIWindowVec::const_iterator it = regions.begin(); it != regions.end(); it++)
1303  {
1304  assert((*it).getWindowEnabledFlag());
1305  WRITE_CODE((*it).getRegionId(), 8, "regional_nesting_rect_region_id[i]");
1306  WRITE_CODE((*it).getWindowLeftOffset(), 16, "regional_nesting_rect_left_offset[i]");
1307  WRITE_CODE((*it).getWindowRightOffset(), 16, "regional_nesting_rect_right_offset[i]");
1308  WRITE_CODE((*it).getWindowTopOffset(), 16, "regional_nesting_rect_top_offset[i]");
1309  WRITE_CODE((*it).getWindowBottomOffset(), 16, "regional_nesting_rect_bottom_offset[i]");
1310  }
1311  assert(sei.getNumRnSEIMessage() >= 1);
1312  WRITE_CODE(sei.getNumRnSEIMessage()-1, 8, "num_sei_messages_in_regional_nesting_minus1");
1313  const std::vector< std::pair< std::vector<UInt>, SEI* > > seiMessages = sei.getRnSEIMessages();
1314  std::vector<std::pair< std::vector<UInt>, SEI* > >::const_iterator it;
1315  for(it = seiMessages.begin(); it != seiMessages.end(); it++)
1316  {
1317  std::vector<UInt> listOfRegions = (*it).first;
1318  SEI *nestedSEI = (*it).second;
1319  WRITE_CODE(listOfRegions.size(), 8, "num_regions_for_sei_message[i]");
1320  for(Int j = 0; j < listOfRegions.size(); j++)
1321  {
1322  WRITE_CODE(listOfRegions[j], 8, "regional_nesting_sei_region_idx[i][j]");
1323  }
1324  writeSEImessageHdrPayload(bs, nestedSEI, sps);
1325  }
1326 }
1327 #endif
1329 {
1330  if( m_pcBitIf->getNumberOfWrittenBits() % 8 != 0)
1331  {
1332  WRITE_FLAG( 1, "payload_bit_equal_to_one" );
1333  while( m_pcBitIf->getNumberOfWrittenBits() % 8 != 0 )
1334  {
1335  WRITE_FLAG( 0, "payload_bit_equal_to_zero" );
1336  }
1337  }
1338 }
1339 
SEIMessages m_nestedSEIs
Definition: SEI.h:596
UChar m_filmGrainMatrixCoeffs
Definition: SEI.h:344
Int m_packedPictureWidth
Definition: SEI.h:866
Bool getNalHrdParametersPresentFlag() const
Definition: TComSlice.h:324
std::vector< UShort > m_packedRegionLeft
Definition: SEI.h:877
UChar m_uuid_iso_iec_11578[ISO_IEC_11578_LEN]
Definition: SEI.h:256
Int m_postLutNumValMinus1[3]
Definition: SEI.h:925
UInt m_panScanRectId
Definition: SEI.h:214
Bool m_currentFrameIsFrame0Flag
Definition: SEI.h:435
Int m_duSptCpbRemovalDelay
Definition: SEI.h:536
std::vector< UChar > m_rwpTopGuardBandHeight
Definition: SEI.h:880
UInt getDuCpbRemovalDelayLengthMinus1() const
Definition: TComSlice.h:336
UChar m_filmGrainBitDepthChromaMinus8
Definition: SEI.h:340
PayloadType
Definition: SEI.h:55
Bool getVclHrdParametersPresentFlag() const
Definition: TComSlice.h:327
Bool m_selfContainedCvsFlag
Definition: SEI.h:516
Void xWriteSEIEquirectangularProjection(const SEIEquirectangularProjection &sei)
Definition: SEIwrite.cpp:1090
UShort m_ituCountryCode
Definition: SEI.h:241
Bool m_exposureCompensationValueSignFlag
Definition: SEI.h:408
TComSEIMasteringDisplay values
Definition: SEI.h:647
std::vector< UShort > m_packedRegionWidth
Definition: SEI.h:874
UInt m_sopDescVclNaluType[MAX_NUM_PICS_IN_SOP]
Definition: SEI.h:495
Bool m_max_mcs_tier_level_idc_present_flag
Definition: SEI.h:709
UInt m_sopDescStRpsIdx[MAX_NUM_PICS_IN_SOP]
Definition: SEI.h:497
Void xWriteSEIAlternativeTransferCharacteristics(const SEIAlternativeTransferCharacteristics &sei)
Definition: SEIwrite.cpp:1283
Int m_frame1GridPositionX
Definition: SEI.h:440
std::vector< Bool > m_rwpGuardBandFlag
Definition: SEI.h:869
UInt m_snapshotId
Definition: SEI.h:299
Bool m_constituentPictureMatchingFlag
Definition: SEI.h:862
Void xWriteSEIPostFilterHint(const SEIPostFilterHint &sei, const TComSPS *sps)
Definition: SEIwrite.cpp:559
Int m_contentInterpretationType
Definition: SEI.h:431
Void xWriteSEITempMotionConstrainedTileSets(const SEITempMotionConstrainedTileSets &sei)
Definition: SEIwrite.cpp:928
Void xWriteSEIDecodingUnitInfo(const SEIDecodingUnitInfo &sei, const TComSPS *sps)
Definition: SEIwrite.cpp:743
UInt m_initialCpbRemovalDelay[MAX_CPB_CNT][2]
Definition: SEI.h:158
Void xWriteSEIFilmGrainCharacteristics(const SEIFilmGrainCharacteristics &sei)
Definition: SEIwrite.cpp:505
Int m_exposureIndexIdc
Definition: SEI.h:406
Bool m_frame1SelfContainedFlag
Definition: SEI.h:437
UInt getNumRectRegions() const
Definition: SEI.h:1062
Void xWriteSEICubemapProjection(const SEICubemapProjection &sei)
Definition: SEIwrite.cpp:1142
Int m_ccvPrimariesY[MAX_NUM_COMPONENT]
Definition: SEI.h:777
Int m_exposureCompensationValueNumerator
Definition: SEI.h:409
void Void
Definition: TypeDef.h:203
std::vector< Int > m_targetPivotValue
Definition: SEI.h:403
Bool m_fieldViewsFlag
Definition: SEI.h:434
Int m_projPictureWidth
Definition: SEI.h:864
UInt m_dpbDelayOffset
Definition: SEI.h:157
#define WRITE_CODE(value, length, name)
Bool m_exactMatchingFlag
Definition: SEI.h:270
Int timeOffsetValue
Definition: TypeDef.h:877
Void xWriteSEIUserDataRegistered(const SEIUserDataRegistered &sei)
Definition: SEIwrite.cpp:433
Bool m_arrangementPersistenceFlag
Definition: SEI.h:443
Int numberOfFrames
Definition: TypeDef.h:869
pure virtual class for basic bit handling
Definition: TComBitStream.h:58
Int m_colourRemapMatrixCoefficients
Definition: SEI.h:917
Void xWriteSEIPictureTiming(const SEIPictureTiming &sei, const TComSPS *sps)
Definition: SEIwrite.cpp:361
UChar m_filmGrainColourPrimaries
Definition: SEI.h:342
Bool m_kneePersistenceFlag
Definition: SEI.h:752
UChar m_filmGrainBitDepthLumaMinus8
Definition: SEI.h:339
Bool m_bIsMonochrome
Definition: SEI.h:378
Void xWriteSEISphereRotation(const SEISphereRotation &sei)
Definition: SEIwrite.cpp:1107
UInt m_picDpbOutputDelay
Definition: SEI.h:188
slice header and SPS class (header)
std::vector< Int > m_kneeOutputKneePoint
Definition: SEI.h:759
Void xWriteSEIGreenMetadataInfo(const SEIGreenMetadataInfo &sei)
Definition: SEIwrite.cpp:698
Void setBitstream(TComBitIf *p)
Int m_decodingUnitIdx
Definition: SEI.h:535
Bool m_frame0FlippedFlag
Definition: SEI.h:433
std::vector< Int > m_kneeInputKneePoint
Definition: SEI.h:758
Void xWriteSEITemporalLevel0Index(const SEITemporalLevel0Index &sei)
Definition: SEIwrite.cpp:759
Void xWriteSEIFramePacking(const SEIFramePacking &sei)
Definition: SEIwrite.cpp:650
unsigned int UInt
Definition: TypeDef.h:212
Bool clockTimeStampFlag
Definition: TypeDef.h:863
Bool m_rapCpbParamsPresentFlag
Definition: SEI.h:155
Int m_frame0GridPositionX
Definition: SEI.h:438
UInt m_cpbDelayOffset
Definition: SEI.h:156
Void writeSEImessages(TComBitIf &bs, const SEIMessages &seiList, const TComSPS *sps, Bool isNested)
Definition: SEIwrite.cpp:215
Bool m_colourRemapVideoSignalInfoPresentFlag
Definition: SEI.h:913
std::vector< Bool > m_rwpGuardBandNotUsedForPredFlag
Definition: SEI.h:882
Bool m_frame0SelfContainedFlag
Definition: SEI.h:436
Void xWriteSEIRegionalNesting(TComBitIf &bs, const SEIRegionalNesting &sei, const TComSPS *sps)
Definition: SEIwrite.cpp:1297
Int m_numPivots
Definition: SEI.h:401
Int m_minValue
Definition: SEI.h:396
Bool m_deinterlacedPictureSourceParityFlag
Definition: SEI.h:938
Bool m_ccvAvgLuminanceValuePresentFlag
Definition: SEI.h:775
Bool m_ccvPersistenceFlag
Definition: SEI.h:771
UInt numClockTs
Definition: SEI.h:635
TileSetData & tileSetData(const Int index)
Definition: SEI.h:720
std::vector< UInt > m_numNalusInDuMinus1
Definition: SEI.h:193
std::vector< UInt > m_projRegionWidth
Definition: SEI.h:870
Void xWriteSEISceneInfo(const SEISceneInfo &sei)
Definition: SEIwrite.cpp:470
Bool m_panScanRectPersistenceFlag
Definition: SEI.h:217
Void xWriteSEIPictureSnapshot(const SEIPictureSnapshot &sei)
Definition: SEIwrite.cpp:486
std::vector< UInt > m_projRegionHeight
Definition: SEI.h:871
UInt m_secondSceneId
Definition: SEI.h:287
Void xWriteSEIContentColourVolume(const SEIContentColourVolume &sei)
Definition: SEIwrite.cpp:1053
Bool m_cmpPersistenceFlag
Definition: SEI.h:849
Bool m_sphereRotationPersistenceFlag
Definition: SEI.h:810
Void writeSEImessageHdrPayload(TComBitIf &bs, const SEI *sei, const TComSPS *sps)
Definition: SEIwrite.cpp:273
ChromaFormat getChromaFormatIdc() const
Definition: TComSlice.h:826
UInt m_ccvAvgLuminanceValue
Definition: SEI.h:780
Int m_nominalBlackLevelLumaCodeValue
Definition: SEI.h:413
std::vector< Int > activeSeqParameterSetId
Definition: SEI.h:519
static const TChar * getSEIMessageString(SEI::PayloadType payloadType)
Definition: SEI.cpp:182
class for counting bits
Void xWriteSEIpayloadData(TComBitIf &bs, const SEI &sei, const TComSPS *sps)
Definition: SEIwrite.cpp:56
char TChar
Definition: TypeDef.h:206
HashType method
Definition: SEI.h:566
TComVUI * getVuiParameters()
Definition: TComSlice.h:936
std::vector< UChar > m_rwpRightGuardBandWidth
Definition: SEI.h:879
Bool m_separateColourDescriptionPresentFlag
Definition: SEI.h:338
#define WRITE_FLAG(value,name)
Bool m_colourRemapCancelFlag
Definition: SEI.h:911
Bool m_colourRemapMatrixPresentFlag
Definition: SEI.h:922
UInt m_picStruct
Definition: SEI.h:183
Void xWriteSEIPanScanRect(const SEIPanScanRect &sei)
Definition: SEIwrite.cpp:403
std::vector< CRIlut > m_postLut[3]
Definition: SEI.h:926
std::vector< OmniViewport > m_omniViewportRegions
Definition: SEI.h:837
Void xWriteSEIOmniViewport(const SEIOmniViewport &sei)
Definition: SEIwrite.cpp:1120
Bool m_colourRemapFullRangeFlag
Definition: SEI.h:914
Int countingType
Definition: TypeDef.h:865
Int m_picSptDpbOutputDuDelay
Definition: SEI.h:538
Void xWriteSEIDecodedPictureHash(const SEIDecodedPictureHash &sei)
Definition: SEIwrite.cpp:766
std::vector< UInt > m_rwpProjRegionTop
Definition: SEI.h:872
Int m_kneeOutputDrange
Definition: SEI.h:755
Void xWriteSEICodedRegionCompletion(const SEICodedRegionCompletion &sei)
Definition: SEIwrite.cpp:1273
UInt getNumRnSEIMessage() const
Definition: SEI.h:1061
UInt m_sopDescTemporalId[MAX_NUM_PICS_IN_SOP]
Definition: SEI.h:496
Bool hoursFlag
Definition: TypeDef.h:875
Void xWriteSEIProgressiveRefinementSegmentEnd(const SEIProgressiveRefinementSegmentEnd &sei)
Definition: SEIwrite.cpp:499
Bool m_rwpCancelFlag
Definition: SEI.h:860
std::vector< UShort > m_packedRegionTop
Definition: SEI.h:876
std::vector< UChar > m_userData
Definition: SEI.h:242
Int m_frame1GridPositionY
Definition: SEI.h:441
Int m_kneeInputDispLuminance
Definition: SEI.h:754
Bool secondsFlag
Definition: TypeDef.h:873
Bool m_cmpCancelFlag
Definition: SEI.h:848
UInt m_sourceScanType
Definition: SEI.h:184
std::vector< Int > m_startOfCodedInterval
Definition: SEI.h:400
Bool m_bPrevSceneIdValidFlag
Definition: SEI.h:284
std::vector< PanScanRect > m_panScanRectRegions
Definition: SEI.h:216
TComSEITimeSet timeSetArray[MAX_TIMECODE_SEI_SETS]
Definition: SEI.h:636
UInt m_xsdMetricValue
Definition: SEI.h:480
UInt m_numPicsInSopMinus1
Definition: SEI.h:493
Int hoursValue
Definition: TypeDef.h:872
Void xWriteSEIRecoveryPoint(const SEIRecoveryPoint &sei)
Definition: SEIwrite.cpp:462
Bool m_ccvMaxLuminanceValuePresentFlag
Definition: SEI.h:774
Int m_maxValue
Definition: SEI.h:397
Int m_colourRemapCoeffs[3][3]
Definition: SEI.h:924
static const UInt ISO_IEC_11578_LEN
Definition: SEI.h:246
Bool m_independentSliceSegmentFlag
Definition: SEI.h:974
bool Bool
Definition: TypeDef.h:204
CompModel m_compModel[MAX_NUM_COMPONENT]
Definition: SEI.h:362
Int minutesValue
Definition: TypeDef.h:871
Bool m_verFilteringFieldProcessingFlag
Definition: SEI.h:735
Void xWriteSEIFillerPayload(const SEIFillerPayload &sei)
Definition: SEIwrite.cpp:424
Bool m_ccvPrimariesPresentFlag
Definition: SEI.h:772
Bool getSubPicCpbParamsPresentFlag() const
Definition: TComSlice.h:330
UInt m_xsdMetricType
Definition: SEI.h:479
Bool m_allLayersFlag
Definition: SEI.h:591
TComPictureHash m_pictureHash
Definition: SEI.h:568
Int m_sigmoidWidth
Definition: SEI.h:399
std::vector< UChar > m_rwpLeftGuardBandWidth
Definition: SEI.h:878
Bool getSubPicCpbParamsInPicTimingSEIFlag() const
Definition: TComSlice.h:339
Int m_nominalWhiteLevelLumaCodeValue
Definition: SEI.h:414
Int m_cameraIsoSpeedIdc
Definition: SEI.h:404
Bool numUnitFieldBasedFlag
Definition: TypeDef.h:864
Definition: SEI.h:52
Void xWriteSEIScalableNesting(TComBitIf &bs, const SEIScalableNesting &sei, const TComSPS *sps)
Definition: SEIwrite.cpp:788
UInt m_filterHintType
Definition: SEI.h:377
UInt m_maxContentLightLevel
Definition: SEI.h:950
virtual PayloadType payloadType() const =0
Bool m_ccvCancelFlag
Definition: SEI.h:770
Int m_toneMapId
Definition: SEI.h:390
UInt m_numDecodingUnitsMinus1
Definition: SEI.h:190
std::vector< CRIlut > m_preLut[3]
Definition: SEI.h:921
UInt m_bpSeqParameterSetId
Definition: SEI.h:154
Bool m_quincunxSamplingFlag
Definition: SEI.h:430
Void xWriteSEIBufferingPeriod(const SEIBufferingPeriod &sei, const TComSPS *sps)
Definition: SEIwrite.cpp:323
UInt m_nestingNumOpsMinus1
Definition: SEI.h:587
Int & bottomRightTileIndex(const Int tileRectIndex)
Definition: SEI.h:696
Bool getFrameFieldInfoPresentFlag() const
Definition: TComSlice.h:640
UInt m_filterHintSizeY
Definition: SEI.h:375
UInt m_initialAltCpbRemovalDelayOffset[MAX_CPB_CNT][2]
Definition: SEI.h:161
std::vector< std::vector< Int > > m_horFilterCoeff
Definition: SEI.h:739
Bool m_omniViewportPersistenceFlag
Definition: SEI.h:835
std::vector< UShort > m_packedRegionHeight
Definition: SEI.h:875
Bool m_filmGrainCharacteristicsCancelFlag
Definition: SEI.h:336
Void xWriteSEIUserDataUnregistered(const SEIUserDataUnregistered &sei)
Definition: SEIwrite.cpp:448
Int m_preLutNumValMinus1[3]
Definition: SEI.h:920
UInt m_auCpbRemovalDelayDelta
Definition: SEI.h:163
UInt getInitialCpbRemovalDelayLengthMinus1() const
Definition: TComSlice.h:353
UInt m_nextSegmentAddress
Definition: SEI.h:973
std::vector< std::vector< Int > > m_verFilterCoeff
Definition: SEI.h:738
UInt getDpbOutputDelayLengthMinus1() const
Definition: TComSlice.h:359
Int m_sphereRotationYaw
Definition: SEI.h:811
class for handling bitstream (header)
UInt m_maxPicAverageLightLevel
Definition: SEI.h:951
Bool m_arrangementCancelFlag
Definition: SEI.h:428
Int m_codedDataBitDepth
Definition: SEI.h:393
#define WRITE_SCODE(value, length, name)
Void xWriteSEIDependentRAPIndication(const SEIDependentRAPIndication &sei)
Definition: SEIwrite.cpp:1267
UInt m_nestingNoOpMaxTemporalIdPlus1
Definition: SEI.h:592
Bool discontinuityFlag
Definition: TypeDef.h:867
Int m_colourRemapInputBitDepth
Definition: SEI.h:918
Int m_ccvPrimariesX[MAX_NUM_COMPONENT]
Definition: SEI.h:776
Bool m_filmGrainCharacteristicsPersistenceFlag
Definition: SEI.h:363
Int m_extendedWhiteLevelLumaCodeValue
Definition: SEI.h:415
Bool m_bSceneInfoPresentFlag
Definition: SEI.h:283
UInt m_initialCpbRemovalDelayOffset[MAX_CPB_CNT][2]
Definition: SEI.h:159
UInt m_duCommonCpbRemovalDelayMinus1
Definition: SEI.h:192
std::vector< UChar > m_rwpTransformType
Definition: SEI.h:868
picture YUV buffer class (header)
Int getNumberOfTileSets() const
Definition: SEI.h:718
UInt anticlockwiseRotation
Definition: SEI.h:464
UInt m_ccvMinLuminanceValue
Definition: SEI.h:778
Bool m_spatialFlippingFlag
Definition: SEI.h:432
Void xWriteSEIRegionRefreshInfo(const SEIRegionRefreshInfo &sei)
Definition: SEIwrite.cpp:827
Bool minutesFlag
Definition: TypeDef.h:874
UInt m_omniViewportId
Definition: SEI.h:833
Void xWriteSEISOPDescription(const SEISOPDescription &sei)
Definition: SEIwrite.cpp:707
std::vector< Int > m_filterHintValues
Definition: SEI.h:379
UInt m_filterHintSizeX
Definition: SEI.h:376
Int m_projPictureHeight
Definition: SEI.h:865
std::vector< UChar > m_userData
Definition: SEI.h:257
UInt getCpbRemovalDelayLengthMinus1() const
Definition: TComSlice.h:356
UInt m_nestingMaxTemporalIdPlus1[MAX_TLAYER]
Definition: SEI.h:588
Void xWriteSEIAmbientViewingEnvironment(const SEIAmbientViewingEnvironment &sei)
Definition: SEIwrite.cpp:1289
Void xWriteSEIMasteringDisplayColourVolume(const SEIMasteringDisplayColourVolume &sei)
Definition: SEIwrite.cpp:898
Void xWriteSEIProgressiveRefinementSegmentStart(const SEIProgressiveRefinementSegmentStart &sei)
Definition: SEIwrite.cpp:492
UInt m_greenMetadataType
Definition: SEI.h:478
Int m_numPackedRegions
Definition: SEI.h:863
Int m_recoveryPocCnt
Definition: SEI.h:269
std::vector< UChar > hash
Definition: TypeDef.h:821
UInt m_numFillerFFBytes
Definition: SEI.h:229
std::vector< RNSEIWindow > RNSEIWindowVec
Definition: TypeDef.h:979
UInt getRNId() const
Definition: SEI.h:1063
UInt getDpbOutputDelayDuLengthMinus1() const
Definition: TComSlice.h:342
Bool m_omniViewportCancelFlag
Definition: SEI.h:834
Definition: SEI.h:367
Int secondsValue
Definition: TypeDef.h:870
Void xWriteSEIContentLightLevelInfo(const SEIContentLightLevelInfo &sei)
Definition: SEIwrite.cpp:1260
Int m_exposureIndexValue
Definition: SEI.h:407
Bool m_nestingOpFlag
Definition: SEI.h:585
UShort whitePoint[2]
Definition: TypeDef.h:886
Bool getCpbDpbDelaysPresentFlag() const
Definition: TComSlice.h:388
UInt m_initialAltCpbRemovalDelay[MAX_CPB_CNT][2]
Definition: SEI.h:160
Int m_colourRemapPrimaries
Definition: SEI.h:915
Int m_arrangementType
Definition: SEI.h:429
Bool m_duCommonCpbRemovalDelayFlag
Definition: SEI.h:191
Int m_exposureCompensationValueDenomIdc
Definition: SEI.h:410
Bool m_sphereRotationCancelFlag
Definition: SEI.h:809
Int m_arrangementId
Definition: SEI.h:427
Int & topLeftTileIndex(const Int tileRectIndex)
Definition: SEI.h:695
UChar m_filmGrainTransferCharacteristics
Definition: SEI.h:343
std::vector< Int > m_codedPivotValue
Definition: SEI.h:402
Void xWriteSEIChromaResamplingFilterHint(const SEIChromaResamplingFilterHint &sei)
Definition: SEIwrite.cpp:986
Int m_kneeOutputDispLuminance
Definition: SEI.h:756
Void xWriteSEIKneeFunctionInfo(const SEIKneeFunctionInfo &sei)
Definition: SEIwrite.cpp:1032
Int m_sigmoidMidpoint
Definition: SEI.h:398
std::vector< UInt > m_duCpbRemovalDelayMinus1
Definition: SEI.h:194
UInt getNumberOfWrittenBits() const
UInt m_auCpbRemovalDelay
Definition: SEI.h:187
std::list< SEI * > SEIMessages
Definition: SEI.h:123
Int m_sopDescPocDelta[MAX_NUM_PICS_IN_SOP]
Definition: SEI.h:498
Void xWriteSEIColourRemappingInfo(const SEIColourRemappingInfo &sei)
Definition: SEIwrite.cpp:1196
std::vector< UInt > m_projRegionLeft
Definition: SEI.h:873
const std::vector< RNSEIWindow > & getRegions() const
Definition: SEI.h:1069
Int m_sphereRotationRoll
Definition: SEI.h:813
Int m_extendedRangeWhiteLevel
Definition: SEI.h:412
UInt m_nestingNumLayersMinus1
Definition: SEI.h:593
#define WRITE_SVLC(value,name)
int Int
Definition: TypeDef.h:211
Void xWriteSEIDeinterlaceFieldIdentification(const SEIDeinterlaceFieldIdentification &sei)
Definition: SEIwrite.cpp:1254
Bool persistenceFlag
Definition: SEI.h:465
Void xWriteSEIRegionWisePacking(const SEIRegionWisePacking &sei)
Definition: SEIwrite.cpp:1152
Bool m_mc_all_tiles_exact_sample_value_match_flag
Definition: SEI.h:706
Int m_sphereRotationPitch
Definition: SEI.h:812
Int m_refScreenLuminanceWhite
Definition: SEI.h:411
Bool m_concatenationFlag
Definition: SEI.h:162
Bool m_brokenLinkFlag
Definition: SEI.h:271
Bool m_toneMapPersistenceFlag
Definition: SEI.h:392
Bool m_colourRemapPersistenceFlag
Definition: SEI.h:912
Int m_kneeInputDrange
Definition: SEI.h:753
UInt getCpbCntMinus1(Int layer) const
Definition: TComSlice.h:374
Int m_kneeNumKneePointsMinus1
Definition: SEI.h:757
Void xWriteSEIActiveParameterSets(const SEIActiveParameterSets &sei)
Definition: SEIwrite.cpp:727
#define WRITE_UVLC(value,name)
Int m_frame0GridPositionY
Definition: SEI.h:439
std::vector< UChar > m_rwpGuardBandType
Definition: SEI.h:883
UInt m_picDpbOutputDuDelay
Definition: SEI.h:189
Bool fullTimeStampFlag
Definition: TypeDef.h:866
Void xWriteSEIToneMappingInfo(const SEIToneMappingInfo &sei)
Definition: SEIwrite.cpp:574
Void xWriteSEIDisplayOrientation(const SEIDisplayOrientation &sei)
Definition: SEIwrite.cpp:685
Int timeOffsetLength
Definition: TypeDef.h:876
Void xWriteSEISegmentedRectFramePacking(const SEISegmentedRectFramePacking &sei)
Definition: SEIwrite.cpp:917
UInt m_ccvMaxLuminanceValue
Definition: SEI.h:779
Bool m_toneMapCancelFlag
Definition: SEI.h:391
Void xWriteSEITimeCode(const SEITimeCode &sei)
Definition: SEIwrite.cpp:839
Void xWriteSEINoDisplay(const SEINoDisplay &sei)
Definition: SEIwrite.cpp:833
Int m_cameraIsoSpeedValue
Definition: SEI.h:405
std::vector< CompModelIntensityValues > intensityValues
Definition: SEI.h:359
Bool m_dpbOutputDuDelayPresentFlag
Definition: SEI.h:537
Bool m_noParameterSetUpdateFlag
Definition: SEI.h:517
UInt m_colourRemapId
Definition: SEI.h:910
const std::vector< std::pair< std::vector< UInt >, SEI * > > & getRnSEIMessages() const
Definition: SEI.h:1068
Class for counting bits (header)
Bool m_upsampledAspectRatio
Definition: SEI.h:444
UInt m_sceneId
Definition: SEI.h:285
Bool m_kneeCancelFlag
Definition: SEI.h:751
UChar m_nestingLayerId[MAX_NESTING_NUM_LAYER]
Definition: SEI.h:594
Int m_colourRemapBitDepth
Definition: SEI.h:919
Bool m_panScanRectCancelFlag
Definition: SEI.h:215
Void xWriteByteAlign()
Definition: SEIwrite.cpp:1328
Int m_arrangementReservedByte
Definition: SEI.h:442
Bool cntDroppedFlag
Definition: TypeDef.h:868
Int m_packedPictureHeight
Definition: SEI.h:867
Bool m_defaultOpFlag
Definition: SEI.h:586
UInt m_nestingOpIdx[MAX_NESTING_NUM_OPS]
Definition: SEI.h:589
Bool m_rwpPersistenceFlag
Definition: SEI.h:861
Int m_targetBitDepth
Definition: SEI.h:394
Bool m_bitStreamSubsetFlag
Definition: SEI.h:584
UInt m_sopSeqParameterSetId
Definition: SEI.h:492
Int m_colourRemapTransferFunction
Definition: SEI.h:916
Bool m_gdrForegroundFlag
Definition: SEI.h:610
UChar m_erpRightGuardBandWidth
Definition: SEI.h:798
UInt m_sceneTransitionType
Definition: SEI.h:286
TComHRD * getHrdParameters()
Definition: TComSlice.h:677
UShort primaries[3][2]
Definition: TypeDef.h:885
Bool m_duplicateFlag
Definition: SEI.h:185
virtual UInt getNumberOfWrittenBits() const =0
Bool m_ccvMinLuminanceValuePresentFlag
Definition: SEI.h:773
SPS class.
Definition: TComSlice.h:740
Bool m_arrangementPersistenceFlag
Definition: SEI.h:661