source: SHVCSoftware/branches/SHM-6-dev/source/Lib/TLibEncoder/SEIwrite.cpp @ 674

Last change on this file since 674 was 652, checked in by seregin, 11 years ago

update to HM-14.0

  • Property svn:eol-style set to native
File size: 34.8 KB
Line 
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-2014, ITU/ISO/IEC
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions are met:
11 *
12 *  * Redistributions of source code must retain the above copyright notice,
13 *    this list of conditions and the following disclaimer.
14 *  * Redistributions in binary form must reproduce the above copyright notice,
15 *    this list of conditions and the following disclaimer in the documentation
16 *    and/or other materials provided with the distribution.
17 *  * Neither the name of the ITU/ISO/IEC nor the names of its contributors may
18 *    be used to endorse or promote products derived from this software without
19 *    specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
31 * THE POSSIBILITY OF SUCH DAMAGE.
32 */
33
34#include "TLibCommon/TComBitCounter.h"
35#include "TLibCommon/TComBitStream.h"
36#include "TLibCommon/SEI.h"
37#include "TLibCommon/TComSlice.h"
38#include "SEIwrite.h"
39
40//! \ingroup TLibEncoder
41//! \{
42
43#if ENC_DEC_TRACE
44Void  xTraceSEIHeader()
45{
46  fprintf( g_hTrace, "=========== SEI message ===========\n");
47}
48
49Void  xTraceSEIMessageType(SEI::PayloadType payloadType)
50{
51  switch (payloadType)
52  {
53  case SEI::DECODED_PICTURE_HASH:
54    fprintf( g_hTrace, "=========== Decoded picture hash SEI message ===========\n");
55    break;
56  case SEI::USER_DATA_UNREGISTERED:
57    fprintf( g_hTrace, "=========== User Data Unregistered SEI message ===========\n");
58    break;
59  case SEI::ACTIVE_PARAMETER_SETS:
60    fprintf( g_hTrace, "=========== Active Parameter sets SEI message ===========\n");
61    break;
62  case SEI::BUFFERING_PERIOD:
63    fprintf( g_hTrace, "=========== Buffering period SEI message ===========\n");
64    break;
65  case SEI::PICTURE_TIMING:
66    fprintf( g_hTrace, "=========== Picture timing SEI message ===========\n");
67    break;
68  case SEI::RECOVERY_POINT:
69    fprintf( g_hTrace, "=========== Recovery point SEI message ===========\n");
70    break;
71  case SEI::FRAME_PACKING:
72    fprintf( g_hTrace, "=========== Frame Packing Arrangement SEI message ===========\n");
73    break;
74  case SEI::DISPLAY_ORIENTATION:
75    fprintf( g_hTrace, "=========== Display Orientation SEI message ===========\n");
76    break;
77  case SEI::TEMPORAL_LEVEL0_INDEX:
78    fprintf( g_hTrace, "=========== Temporal Level Zero Index SEI message ===========\n");
79    break;
80  case SEI::REGION_REFRESH_INFO:
81    fprintf( g_hTrace, "=========== Gradual Decoding Refresh Information SEI message ===========\n");
82    break;
83  case SEI::DECODING_UNIT_INFO:
84    fprintf( g_hTrace, "=========== Decoding Unit Information SEI message ===========\n");
85    break;
86  case SEI::TONE_MAPPING_INFO:
87    fprintf( g_hTrace, "=========== Tone Mapping Info SEI message ===========\n");
88    break;
89  case SEI::SOP_DESCRIPTION:
90    fprintf( g_hTrace, "=========== SOP Description SEI message ===========\n");
91    break;
92  case SEI::SCALABLE_NESTING:
93    fprintf( g_hTrace, "=========== Scalable Nesting SEI message ===========\n");
94    break;
95#if SVC_EXTENSION
96#if LAYERS_NOT_PRESENT_SEI
97  case SEI::LAYERS_NOT_PRESENT:
98    fprintf( g_hTrace, "=========== Layers Present SEI message ===========\n");
99    break;
100#endif
101#if N0383_IL_CONSTRAINED_TILE_SETS_SEI
102  case SEI::INTER_LAYER_CONSTRAINED_TILE_SETS:
103    fprintf( g_hTrace, "=========== Inter Layer Constrained Tile Sets SEI message ===========\n");
104    break;
105#endif
106#if SUB_BITSTREAM_PROPERTY_SEI
107  case SEI::SUB_BITSTREAM_PROPERTY:
108    fprintf( g_hTrace, "=========== Sub-bitstream property SEI message ===========\n");
109    break;
110#endif
111#if O0164_MULTI_LAYER_HRD
112  case SEI::BSP_NESTING:
113    fprintf( g_hTrace, "=========== Bitstream partition nesting SEI message ===========\n");
114    break;
115  case SEI::BSP_INITIAL_ARRIVAL_TIME:
116    fprintf( g_hTrace, "=========== Bitstream parition initial arrival time SEI message ===========\n");
117    break;
118  case SEI::BSP_HRD:
119    fprintf( g_hTrace, "=========== Bitstream parition HRD parameters SEI message ===========\n");
120    break;
121#endif
122#endif //SVC_EXTENSION
123  default:
124    fprintf( g_hTrace, "=========== Unknown SEI message ===========\n");
125    break;
126  }
127}
128#endif
129
130#if O0164_MULTI_LAYER_HRD
131void SEIWriter::xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting& nestingSei, const SEIBspNesting& bspNestingSei)
132#else
133void SEIWriter::xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, TComSPS *sps)
134#endif
135{
136  switch (sei.payloadType())
137  {
138  case SEI::USER_DATA_UNREGISTERED:
139    xWriteSEIuserDataUnregistered(*static_cast<const SEIuserDataUnregistered*>(&sei));
140    break;
141  case SEI::ACTIVE_PARAMETER_SETS:
142    xWriteSEIActiveParameterSets(*static_cast<const SEIActiveParameterSets*>(& sei)); 
143    break; 
144  case SEI::DECODING_UNIT_INFO:
145    xWriteSEIDecodingUnitInfo(*static_cast<const SEIDecodingUnitInfo*>(& sei), sps);
146    break;
147  case SEI::DECODED_PICTURE_HASH:
148    xWriteSEIDecodedPictureHash(*static_cast<const SEIDecodedPictureHash*>(&sei));
149    break;
150  case SEI::BUFFERING_PERIOD:
151    xWriteSEIBufferingPeriod(*static_cast<const SEIBufferingPeriod*>(&sei), sps);
152    break;
153  case SEI::PICTURE_TIMING:
154    xWriteSEIPictureTiming(*static_cast<const SEIPictureTiming*>(&sei), sps);
155    break;
156  case SEI::RECOVERY_POINT:
157    xWriteSEIRecoveryPoint(*static_cast<const SEIRecoveryPoint*>(&sei));
158    break;
159  case SEI::FRAME_PACKING:
160    xWriteSEIFramePacking(*static_cast<const SEIFramePacking*>(&sei));
161    break;
162  case SEI::DISPLAY_ORIENTATION:
163    xWriteSEIDisplayOrientation(*static_cast<const SEIDisplayOrientation*>(&sei));
164    break;
165  case SEI::TEMPORAL_LEVEL0_INDEX:
166    xWriteSEITemporalLevel0Index(*static_cast<const SEITemporalLevel0Index*>(&sei));
167    break;
168  case SEI::REGION_REFRESH_INFO:
169    xWriteSEIGradualDecodingRefreshInfo(*static_cast<const SEIGradualDecodingRefreshInfo*>(&sei));
170    break;
171  case SEI::TONE_MAPPING_INFO:
172    xWriteSEIToneMappingInfo(*static_cast<const SEIToneMappingInfo*>(&sei));
173    break;
174  case SEI::SOP_DESCRIPTION:
175    xWriteSEISOPDescription(*static_cast<const SEISOPDescription*>(&sei));
176    break;
177  case SEI::SCALABLE_NESTING:
178#if O0164_MULTI_LAYER_HRD
179    xWriteSEIScalableNesting(bs, *static_cast<const SEIScalableNesting*>(&sei), vps, sps);
180#else
181    xWriteSEIScalableNesting(bs, *static_cast<const SEIScalableNesting*>(&sei), sps);
182#endif
183    break;
184#if SVC_EXTENSION
185#if LAYERS_NOT_PRESENT_SEI
186  case SEI::LAYERS_NOT_PRESENT:
187    xWriteSEILayersNotPresent(*static_cast<const SEILayersNotPresent*>(&sei));
188    break;
189#endif
190#if N0383_IL_CONSTRAINED_TILE_SETS_SEI
191  case SEI::INTER_LAYER_CONSTRAINED_TILE_SETS:
192    xWriteSEIInterLayerConstrainedTileSets(*static_cast<const SEIInterLayerConstrainedTileSets*>(&sei));
193    break;
194#endif
195#if SUB_BITSTREAM_PROPERTY_SEI
196   case SEI::SUB_BITSTREAM_PROPERTY:
197     xWriteSEISubBitstreamProperty(*static_cast<const SEISubBitstreamProperty*>(&sei));
198     break;
199#endif
200#if O0164_MULTI_LAYER_HRD
201   case SEI::BSP_NESTING:
202     xWriteSEIBspNesting(bs, *static_cast<const SEIBspNesting*>(&sei), vps, sps, nestingSei);
203     break;
204   case SEI::BSP_INITIAL_ARRIVAL_TIME:
205     xWriteSEIBspInitialArrivalTime(*static_cast<const SEIBspInitialArrivalTime*>(&sei), vps, sps, nestingSei, bspNestingSei);
206     break;
207   case SEI::BSP_HRD:
208     xWriteSEIBspHrd(*static_cast<const SEIBspHrd*>(&sei), sps, nestingSei);
209     break;
210#endif
211#endif //SVC_EXTENSION
212  default:
213    assert(!"Unhandled SEI message");
214  }
215}
216
217/**
218 * marshal a single SEI message sei, storing the marshalled representation
219 * in bitstream bs.
220 */
221#if O0164_MULTI_LAYER_HRD
222Void SEIWriter::writeSEImessage(TComBitIf& bs, const SEI& sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei)
223#else
224Void SEIWriter::writeSEImessage(TComBitIf& bs, const SEI& sei, TComSPS *sps)
225#endif
226{
227  /* calculate how large the payload data is */
228  /* TODO: this would be far nicer if it used vectored buffers */
229  TComBitCounter bs_count;
230  bs_count.resetBits();
231  setBitstream(&bs_count);
232
233
234#if ENC_DEC_TRACE
235  Bool traceEnable = g_HLSTraceEnable;
236  g_HLSTraceEnable = false;
237#endif
238#if O0164_MULTI_LAYER_HRD
239  xWriteSEIpayloadData(bs_count, sei, vps, sps, *nestingSei, *bspNestingSei);
240#else
241  xWriteSEIpayloadData(bs_count, sei, sps);
242#endif
243#if ENC_DEC_TRACE
244  g_HLSTraceEnable = traceEnable;
245#endif
246
247  UInt payload_data_num_bits = bs_count.getNumberOfWrittenBits();
248  assert(0 == payload_data_num_bits % 8);
249
250  setBitstream(&bs);
251
252#if ENC_DEC_TRACE
253  if (g_HLSTraceEnable)
254  xTraceSEIHeader();
255#endif
256
257  UInt payloadType = sei.payloadType();
258  for (; payloadType >= 0xff; payloadType -= 0xff)
259  {
260    WRITE_CODE(0xff, 8, "payload_type");
261  }
262  WRITE_CODE(payloadType, 8, "payload_type");
263
264  UInt payloadSize = payload_data_num_bits/8;
265  for (; payloadSize >= 0xff; payloadSize -= 0xff)
266  {
267    WRITE_CODE(0xff, 8, "payload_size");
268  }
269  WRITE_CODE(payloadSize, 8, "payload_size");
270
271  /* payloadData */
272#if ENC_DEC_TRACE
273  if (g_HLSTraceEnable)
274  xTraceSEIMessageType(sei.payloadType());
275#endif
276
277#if O0164_MULTI_LAYER_HRD
278  xWriteSEIpayloadData(bs, sei, vps, sps, *nestingSei, *bspNestingSei);
279#else
280  xWriteSEIpayloadData(bs, sei, sps);
281#endif
282}
283
284/**
285 * marshal a user_data_unregistered SEI message sei, storing the marshalled
286 * representation in bitstream bs.
287 */
288Void SEIWriter::xWriteSEIuserDataUnregistered(const SEIuserDataUnregistered &sei)
289{
290  for (UInt i = 0; i < 16; i++)
291  {
292    WRITE_CODE(sei.uuid_iso_iec_11578[i], 8 , "sei.uuid_iso_iec_11578[i]");
293  }
294
295  for (UInt i = 0; i < sei.userDataLength; i++)
296  {
297    WRITE_CODE(sei.userData[i], 8 , "user_data");
298  }
299}
300
301/**
302 * marshal a decoded picture hash SEI message, storing the marshalled
303 * representation in bitstream bs.
304 */
305Void SEIWriter::xWriteSEIDecodedPictureHash(const SEIDecodedPictureHash& sei)
306{
307  UInt val;
308
309  WRITE_CODE(sei.method, 8, "hash_type");
310
311  for(Int yuvIdx = 0; yuvIdx < 3; yuvIdx++)
312  {
313    if(sei.method == SEIDecodedPictureHash::MD5)
314    {
315      for (UInt i = 0; i < 16; i++)
316      {
317        WRITE_CODE(sei.digest[yuvIdx][i], 8, "picture_md5");
318      }
319    }
320    else if(sei.method == SEIDecodedPictureHash::CRC)
321    {
322      val = (sei.digest[yuvIdx][0] << 8)  + sei.digest[yuvIdx][1];
323      WRITE_CODE(val, 16, "picture_crc");
324    }
325    else if(sei.method == SEIDecodedPictureHash::CHECKSUM)
326    {
327      val = (sei.digest[yuvIdx][0] << 24)  + (sei.digest[yuvIdx][1] << 16) + (sei.digest[yuvIdx][2] << 8) + sei.digest[yuvIdx][3];
328      WRITE_CODE(val, 32, "picture_checksum");
329    }
330  }
331}
332
333Void SEIWriter::xWriteSEIActiveParameterSets(const SEIActiveParameterSets& sei)
334{
335  WRITE_CODE(sei.activeVPSId,     4,         "active_video_parameter_set_id");
336  WRITE_FLAG(sei.m_selfContainedCvsFlag,     "self_contained_cvs_flag");
337  WRITE_FLAG(sei.m_noParameterSetUpdateFlag, "no_parameter_set_update_flag");
338  WRITE_UVLC(sei.numSpsIdsMinus1,    "num_sps_ids_minus1");
339
340  assert (sei.activeSeqParameterSetId.size() == (sei.numSpsIdsMinus1 + 1));
341
342  for (Int i = 0; i < sei.activeSeqParameterSetId.size(); i++)
343  {
344    WRITE_UVLC(sei.activeSeqParameterSetId[i], "active_seq_parameter_set_id"); 
345  }
346  xWriteByteAlign();
347}
348
349Void SEIWriter::xWriteSEIDecodingUnitInfo(const SEIDecodingUnitInfo& sei, TComSPS *sps)
350{
351  TComVUI *vui = sps->getVuiParameters();
352  WRITE_UVLC(sei.m_decodingUnitIdx, "decoding_unit_idx");
353  if(vui->getHrdParameters()->getSubPicCpbParamsInPicTimingSEIFlag())
354  {
355    WRITE_CODE( sei.m_duSptCpbRemovalDelay, (vui->getHrdParameters()->getDuCpbRemovalDelayLengthMinus1() + 1), "du_spt_cpb_removal_delay");
356  }
357  WRITE_FLAG( sei.m_dpbOutputDuDelayPresentFlag, "dpb_output_du_delay_present_flag");
358  if(sei.m_dpbOutputDuDelayPresentFlag)
359  {
360    WRITE_CODE(sei.m_picSptDpbOutputDuDelay, vui->getHrdParameters()->getDpbOutputDelayDuLengthMinus1() + 1, "pic_spt_dpb_output_du_delay");
361  }
362  xWriteByteAlign();
363}
364
365Void SEIWriter::xWriteSEIBufferingPeriod(const SEIBufferingPeriod& sei, TComSPS *sps)
366{
367  Int i, nalOrVcl;
368  TComVUI *vui = sps->getVuiParameters();
369  TComHRD *hrd = vui->getHrdParameters();
370
371  WRITE_UVLC( sei.m_bpSeqParameterSetId, "bp_seq_parameter_set_id" );
372  if( !hrd->getSubPicCpbParamsPresentFlag() )
373  {
374    WRITE_FLAG( sei.m_rapCpbParamsPresentFlag, "irap_cpb_params_present_flag" );
375  }
376  if( sei.m_rapCpbParamsPresentFlag )
377  {
378    WRITE_CODE( sei.m_cpbDelayOffset, hrd->getCpbRemovalDelayLengthMinus1() + 1, "cpb_delay_offset" );
379    WRITE_CODE( sei.m_dpbDelayOffset, hrd->getDpbOutputDelayLengthMinus1()  + 1, "dpb_delay_offset" );
380  }
381  WRITE_FLAG( sei.m_concatenationFlag, "concatenation_flag");
382  WRITE_CODE( sei.m_auCpbRemovalDelayDelta - 1, ( hrd->getCpbRemovalDelayLengthMinus1() + 1 ), "au_cpb_removal_delay_delta_minus1" );
383  for( nalOrVcl = 0; nalOrVcl < 2; nalOrVcl ++ )
384  {
385    if( ( ( nalOrVcl == 0 ) && ( hrd->getNalHrdParametersPresentFlag() ) ) ||
386        ( ( nalOrVcl == 1 ) && ( hrd->getVclHrdParametersPresentFlag() ) ) )
387    {
388      for( i = 0; i < ( hrd->getCpbCntMinus1( 0 ) + 1 ); i ++ )
389      {
390        WRITE_CODE( sei.m_initialCpbRemovalDelay[i][nalOrVcl],( hrd->getInitialCpbRemovalDelayLengthMinus1() + 1 ) ,           "initial_cpb_removal_delay" );
391        WRITE_CODE( sei.m_initialCpbRemovalDelayOffset[i][nalOrVcl],( hrd->getInitialCpbRemovalDelayLengthMinus1() + 1 ),      "initial_cpb_removal_delay_offset" );
392        if( hrd->getSubPicCpbParamsPresentFlag() || sei.m_rapCpbParamsPresentFlag )
393        {
394          WRITE_CODE( sei.m_initialAltCpbRemovalDelay[i][nalOrVcl], ( hrd->getInitialCpbRemovalDelayLengthMinus1() + 1 ) ,     "initial_alt_cpb_removal_delay" );
395          WRITE_CODE( sei.m_initialAltCpbRemovalDelayOffset[i][nalOrVcl], ( hrd->getInitialCpbRemovalDelayLengthMinus1() + 1 ),"initial_alt_cpb_removal_delay_offset" );
396        }
397      }
398    }
399  }
400#if P0138_USE_ALT_CPB_PARAMS_FLAG
401  if (sei.m_useAltCpbParamsFlagPresent)
402  {
403    WRITE_FLAG( sei.m_useAltCpbParamsFlag, "use_alt_cpb_params_flag");
404  }
405#endif
406  xWriteByteAlign();
407}
408Void SEIWriter::xWriteSEIPictureTiming(const SEIPictureTiming& sei,  TComSPS *sps)
409{
410  Int i;
411  TComVUI *vui = sps->getVuiParameters();
412  TComHRD *hrd = vui->getHrdParameters();
413
414  if( vui->getFrameFieldInfoPresentFlag() )
415  {
416    WRITE_CODE( sei.m_picStruct, 4,              "pic_struct" );
417    WRITE_CODE( sei.m_sourceScanType, 2,         "source_scan_type" );
418    WRITE_FLAG( sei.m_duplicateFlag ? 1 : 0,     "duplicate_flag" );
419  }
420
421  if( hrd->getCpbDpbDelaysPresentFlag() )
422  {
423    WRITE_CODE( sei.m_auCpbRemovalDelay - 1, ( hrd->getCpbRemovalDelayLengthMinus1() + 1 ),                                         "au_cpb_removal_delay_minus1" );
424    WRITE_CODE( sei.m_picDpbOutputDelay, ( hrd->getDpbOutputDelayLengthMinus1() + 1 ),                                          "pic_dpb_output_delay" );
425    if(hrd->getSubPicCpbParamsPresentFlag())
426    {
427      WRITE_CODE(sei.m_picDpbOutputDuDelay, hrd->getDpbOutputDelayDuLengthMinus1()+1, "pic_dpb_output_du_delay" );
428    }
429    if( hrd->getSubPicCpbParamsPresentFlag() && hrd->getSubPicCpbParamsInPicTimingSEIFlag() )
430    {
431      WRITE_UVLC( sei.m_numDecodingUnitsMinus1,     "num_decoding_units_minus1" );
432      WRITE_FLAG( sei.m_duCommonCpbRemovalDelayFlag, "du_common_cpb_removal_delay_flag" );
433      if( sei.m_duCommonCpbRemovalDelayFlag )
434      {
435        WRITE_CODE( sei.m_duCommonCpbRemovalDelayMinus1, ( hrd->getDuCpbRemovalDelayLengthMinus1() + 1 ),                       "du_common_cpb_removal_delay_minus1" );
436      }
437      for( i = 0; i <= sei.m_numDecodingUnitsMinus1; i ++ )
438      {
439        WRITE_UVLC( sei.m_numNalusInDuMinus1[ i ],  "num_nalus_in_du_minus1");
440        if( ( !sei.m_duCommonCpbRemovalDelayFlag ) && ( i < sei.m_numDecodingUnitsMinus1 ) )
441        {
442          WRITE_CODE( sei.m_duCpbRemovalDelayMinus1[ i ], ( hrd->getDuCpbRemovalDelayLengthMinus1() + 1 ),                        "du_cpb_removal_delay_minus1" );
443        }
444      }
445    }
446  }
447  xWriteByteAlign();
448}
449Void SEIWriter::xWriteSEIRecoveryPoint(const SEIRecoveryPoint& sei)
450{
451  WRITE_SVLC( sei.m_recoveryPocCnt,    "recovery_poc_cnt"    );
452  WRITE_FLAG( sei.m_exactMatchingFlag, "exact_matching_flag" );
453  WRITE_FLAG( sei.m_brokenLinkFlag,    "broken_link_flag"    );
454  xWriteByteAlign();
455}
456Void SEIWriter::xWriteSEIFramePacking(const SEIFramePacking& sei)
457{
458  WRITE_UVLC( sei.m_arrangementId,                  "frame_packing_arrangement_id" );
459  WRITE_FLAG( sei.m_arrangementCancelFlag,          "frame_packing_arrangement_cancel_flag" );
460
461  if( sei.m_arrangementCancelFlag == 0 ) {
462    WRITE_CODE( sei.m_arrangementType, 7,           "frame_packing_arrangement_type" );
463
464    WRITE_FLAG( sei.m_quincunxSamplingFlag,         "quincunx_sampling_flag" );
465    WRITE_CODE( sei.m_contentInterpretationType, 6, "content_interpretation_type" );
466    WRITE_FLAG( sei.m_spatialFlippingFlag,          "spatial_flipping_flag" );
467    WRITE_FLAG( sei.m_frame0FlippedFlag,            "frame0_flipped_flag" );
468    WRITE_FLAG( sei.m_fieldViewsFlag,               "field_views_flag" );
469    WRITE_FLAG( sei.m_currentFrameIsFrame0Flag,     "current_frame_is_frame0_flag" );
470
471    WRITE_FLAG( sei.m_frame0SelfContainedFlag,      "frame0_self_contained_flag" );
472    WRITE_FLAG( sei.m_frame1SelfContainedFlag,      "frame1_self_contained_flag" );
473
474    if(sei.m_quincunxSamplingFlag == 0 && sei.m_arrangementType != 5)
475    {
476      WRITE_CODE( sei.m_frame0GridPositionX, 4,     "frame0_grid_position_x" );
477      WRITE_CODE( sei.m_frame0GridPositionY, 4,     "frame0_grid_position_y" );
478      WRITE_CODE( sei.m_frame1GridPositionX, 4,     "frame1_grid_position_x" );
479      WRITE_CODE( sei.m_frame1GridPositionY, 4,     "frame1_grid_position_y" );
480    }
481
482    WRITE_CODE( sei.m_arrangementReservedByte, 8,   "frame_packing_arrangement_reserved_byte" );
483    WRITE_FLAG( sei.m_arrangementPersistenceFlag,   "frame_packing_arrangement_persistence_flag" );
484  }
485
486  WRITE_FLAG( sei.m_upsampledAspectRatio,           "upsampled_aspect_ratio" );
487
488  xWriteByteAlign();
489}
490
491Void SEIWriter::xWriteSEIToneMappingInfo(const SEIToneMappingInfo& sei)
492{
493  Int i;
494  WRITE_UVLC( sei.m_toneMapId,                    "tone_map_id" );
495  WRITE_FLAG( sei.m_toneMapCancelFlag,            "tone_map_cancel_flag" );
496  if( !sei.m_toneMapCancelFlag ) 
497  {
498    WRITE_FLAG( sei.m_toneMapPersistenceFlag,     "tone_map_persistence_flag" );
499    WRITE_CODE( sei.m_codedDataBitDepth,    8,    "coded_data_bit_depth" );
500    WRITE_CODE( sei.m_targetBitDepth,       8,    "target_bit_depth" );
501    WRITE_UVLC( sei.m_modelId,                    "model_id" );
502    switch(sei.m_modelId)
503    {
504    case 0:
505      {
506        WRITE_CODE( sei.m_minValue,  32,        "min_value" );
507        WRITE_CODE( sei.m_maxValue, 32,         "max_value" );
508        break;
509      }
510    case 1:
511      {
512        WRITE_CODE( sei.m_sigmoidMidpoint, 32,  "sigmoid_midpoint" );
513        WRITE_CODE( sei.m_sigmoidWidth,    32,  "sigmoid_width"    );
514        break;
515      }
516    case 2:
517      {
518        UInt num = 1u << sei.m_targetBitDepth;
519        for(i = 0; i < num; i++)
520        {
521          WRITE_CODE( sei.m_startOfCodedInterval[i], (( sei.m_codedDataBitDepth + 7 ) >> 3 ) << 3,  "start_of_coded_interval" );
522        }
523        break;
524      }
525    case 3:
526      {
527        WRITE_CODE( sei.m_numPivots, 16,          "num_pivots" );
528        for(i = 0; i < sei.m_numPivots; i++ )
529        {
530          WRITE_CODE( sei.m_codedPivotValue[i], (( sei.m_codedDataBitDepth + 7 ) >> 3 ) << 3,       "coded_pivot_value" );
531          WRITE_CODE( sei.m_targetPivotValue[i], (( sei.m_targetBitDepth + 7 ) >> 3 ) << 3,         "target_pivot_value");
532        }
533        break;
534      }
535    case 4:
536      {
537        WRITE_CODE( sei.m_cameraIsoSpeedIdc,    8,    "camera_iso_speed_idc" );
538        if( sei.m_cameraIsoSpeedIdc == 255) //Extended_ISO
539        {
540          WRITE_CODE( sei.m_cameraIsoSpeedValue,    32,    "camera_iso_speed_value" );
541        }
542        WRITE_CODE( sei.m_exposureIndexIdc,     8,    "exposure_index_idc" );
543        if( sei.m_exposureIndexIdc == 255) //Extended_ISO
544        {
545          WRITE_CODE( sei.m_exposureIndexValue,     32,    "exposure_index_value" );
546        }
547        WRITE_FLAG( sei.m_exposureCompensationValueSignFlag,           "exposure_compensation_value_sign_flag" );
548        WRITE_CODE( sei.m_exposureCompensationValueNumerator,     16,  "exposure_compensation_value_numerator" );
549        WRITE_CODE( sei.m_exposureCompensationValueDenomIdc,      16,  "exposure_compensation_value_denom_idc" );
550        WRITE_CODE( sei.m_refScreenLuminanceWhite,                32,  "ref_screen_luminance_white" );
551        WRITE_CODE( sei.m_extendedRangeWhiteLevel,                32,  "extended_range_white_level" );
552        WRITE_CODE( sei.m_nominalBlackLevelLumaCodeValue,         16,  "nominal_black_level_luma_code_value" );
553        WRITE_CODE( sei.m_nominalWhiteLevelLumaCodeValue,         16,  "nominal_white_level_luma_code_value" );
554        WRITE_CODE( sei.m_extendedWhiteLevelLumaCodeValue,        16,  "extended_white_level_luma_code_value" );
555        break;
556      }
557    default:
558      {
559        assert(!"Undefined SEIToneMapModelId");
560        break;
561      }
562    }//switch m_modelId
563  }//if(!sei.m_toneMapCancelFlag)
564
565  xWriteByteAlign();
566}
567
568Void SEIWriter::xWriteSEIDisplayOrientation(const SEIDisplayOrientation &sei)
569{
570  WRITE_FLAG( sei.cancelFlag,           "display_orientation_cancel_flag" );
571  if( !sei.cancelFlag )
572  {
573    WRITE_FLAG( sei.horFlip,                   "hor_flip" );
574    WRITE_FLAG( sei.verFlip,                   "ver_flip" );
575    WRITE_CODE( sei.anticlockwiseRotation, 16, "anticlockwise_rotation" );
576    WRITE_FLAG( sei.persistenceFlag,          "display_orientation_persistence_flag" );
577  }
578  xWriteByteAlign();
579}
580
581Void SEIWriter::xWriteSEITemporalLevel0Index(const SEITemporalLevel0Index &sei)
582{
583  WRITE_CODE( sei.tl0Idx, 8 , "tl0_idx" );
584  WRITE_CODE( sei.rapIdx, 8 , "rap_idx" );
585  xWriteByteAlign();
586}
587
588Void SEIWriter::xWriteSEIGradualDecodingRefreshInfo(const SEIGradualDecodingRefreshInfo &sei)
589{
590  WRITE_FLAG( sei.m_gdrForegroundFlag, "gdr_foreground_flag");
591  xWriteByteAlign();
592}
593
594Void SEIWriter::xWriteSEISOPDescription(const SEISOPDescription& sei)
595{
596  WRITE_UVLC( sei.m_sopSeqParameterSetId,           "sop_seq_parameter_set_id"               );
597  WRITE_UVLC( sei.m_numPicsInSopMinus1,             "num_pics_in_sop_minus1"               );
598  for (UInt i = 0; i <= sei.m_numPicsInSopMinus1; i++)
599  {
600    WRITE_CODE( sei.m_sopDescVclNaluType[i], 6, "sop_desc_vcl_nalu_type" );
601    WRITE_CODE( sei.m_sopDescTemporalId[i],  3, "sop_desc_temporal_id" );
602    if (sei.m_sopDescVclNaluType[i] != NAL_UNIT_CODED_SLICE_IDR_W_RADL && sei.m_sopDescVclNaluType[i] != NAL_UNIT_CODED_SLICE_IDR_N_LP)
603    {
604      WRITE_UVLC( sei.m_sopDescStRpsIdx[i],           "sop_desc_st_rps_idx"               );
605    }
606    if (i > 0)
607    {
608      WRITE_SVLC( sei.m_sopDescPocDelta[i],           "sop_desc_poc_delta"               );
609    }
610  }
611
612  xWriteByteAlign();
613}
614
615#if O0164_MULTI_LAYER_HRD
616Void SEIWriter::xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, TComVPS *vps, TComSPS *sps)
617#else
618Void SEIWriter::xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, TComSPS *sps)
619#endif
620{
621  WRITE_FLAG( sei.m_bitStreamSubsetFlag,             "bitstream_subset_flag"         );
622  WRITE_FLAG( sei.m_nestingOpFlag,                   "nesting_op_flag      "         );
623  if (sei.m_nestingOpFlag)
624  {
625    WRITE_FLAG( sei.m_defaultOpFlag,                 "default_op_flag"               );
626    WRITE_UVLC( sei.m_nestingNumOpsMinus1,           "nesting_num_ops"               );
627    for (UInt i = (sei.m_defaultOpFlag ? 1 : 0); i <= sei.m_nestingNumOpsMinus1; i++)
628    {
629      WRITE_CODE( sei.m_nestingNoOpMaxTemporalIdPlus1, 3, "nesting_no_op_max_temporal_id" );
630      WRITE_CODE( sei.m_nestingMaxTemporalIdPlus1[i], 3,  "nesting_max_temporal_id"       );
631      WRITE_UVLC( sei.m_nestingOpIdx[i],                  "nesting_op_idx"                );
632    }
633  }
634  else
635  {
636    WRITE_FLAG( sei.m_allLayersFlag,                      "all_layers_flag"               );
637    if (!sei.m_allLayersFlag)
638    {
639      WRITE_CODE( sei.m_nestingNoOpMaxTemporalIdPlus1, 3, "nesting_no_op_max_temporal_id" );
640      WRITE_UVLC( sei.m_nestingNumLayersMinus1,           "nesting_num_layers"            );
641      for (UInt i = 0; i <= sei.m_nestingNumLayersMinus1; i++)
642      {
643        WRITE_CODE( sei.m_nestingLayerId[i], 6,           "nesting_layer_id"              );
644      }
645    }
646  }
647 
648  // byte alignment
649  while ( m_pcBitIf->getNumberOfWrittenBits() % 8 != 0 )
650  {
651    WRITE_FLAG( 0, "nesting_zero_bit" );
652  }
653
654  // write nested SEI messages
655  for (SEIMessages::const_iterator it = sei.m_nestedSEIs.begin(); it != sei.m_nestedSEIs.end(); it++)
656  {
657#if O0164_MULTI_LAYER_HRD
658    writeSEImessage(bs, *(*it), vps, sps, &sei);
659#else
660    writeSEImessage(bs, *(*it), sps);
661#endif
662  }
663}
664
665Void SEIWriter::xWriteByteAlign()
666{
667  if( m_pcBitIf->getNumberOfWrittenBits() % 8 != 0)
668  {
669    WRITE_FLAG( 1, "bit_equal_to_one" );
670    while( m_pcBitIf->getNumberOfWrittenBits() % 8 != 0 )
671    {
672      WRITE_FLAG( 0, "bit_equal_to_zero" );
673    }
674  }
675};
676
677#if SVC_EXTENSION
678#if LAYERS_NOT_PRESENT_SEI
679Void SEIWriter::xWriteSEILayersNotPresent(const SEILayersNotPresent& sei)
680{
681  WRITE_UVLC( sei.m_activeVpsId,           "lp_sei_active_vps_id" );
682  for (UInt i = 0; i < sei.m_vpsMaxLayers; i++)
683  {
684    WRITE_FLAG( sei.m_layerNotPresentFlag[i], "layer_not_present_flag"   );
685  }
686  xWriteByteAlign();
687}
688#endif
689
690#if N0383_IL_CONSTRAINED_TILE_SETS_SEI
691Void SEIWriter::xWriteSEIInterLayerConstrainedTileSets(const SEIInterLayerConstrainedTileSets& sei)
692{
693  WRITE_FLAG( sei.m_ilAllTilesExactSampleValueMatchFlag,  "il_all_tiles_exact_sample_value_match_flag"   );
694  WRITE_FLAG( sei.m_ilOneTilePerTileSetFlag,              "il_one_tile_per_tile_set_flag"                );
695  if( !sei.m_ilOneTilePerTileSetFlag )
696  {
697    WRITE_UVLC( sei.m_ilNumSetsInMessageMinus1,             "il_num_sets_in_message_minus1"                );
698    if( sei.m_ilNumSetsInMessageMinus1 )
699    {
700      WRITE_FLAG( sei.m_skippedTileSetPresentFlag,            "skipped_tile_set_present_flag"                );
701    }
702    UInt numSignificantSets = sei.m_ilNumSetsInMessageMinus1 - (sei.m_skippedTileSetPresentFlag ? 1 : 0) + 1;
703    for( UInt i = 0; i < numSignificantSets; i++ )
704    {
705      WRITE_UVLC( sei.m_ilctsId[i],                           "ilcts_id"                                     );
706      WRITE_UVLC( sei.m_ilNumTileRectsInSetMinus1[i],         "il_num_tile_rects_in_set_minus1"              );
707      for( UInt j = 0; j <= sei.m_ilNumTileRectsInSetMinus1[i]; j++ )
708      {
709        WRITE_UVLC( sei.m_ilTopLeftTileIndex[i][j],             "il_top_left_tile_index"                       );
710        WRITE_UVLC( sei.m_ilBottomRightTileIndex[i][j],         "il_bottom_right_tile_index"                   );
711      }
712      WRITE_CODE( sei.m_ilcIdc[i], 2,                         "ilc_idc"                                      );
713      if( sei.m_ilAllTilesExactSampleValueMatchFlag )
714      {
715        WRITE_FLAG( sei.m_ilExactSampleValueMatchFlag[i],        "il_exact_sample_value_match_flag"            );
716      }
717    }
718  }
719  else
720  {
721    WRITE_CODE( sei.m_allTilesIlcIdc, 2,                    "all_tiles_ilc_idc"                          );
722  }
723
724  xWriteByteAlign();
725}
726#endif
727#if SUB_BITSTREAM_PROPERTY_SEI
728Void SEIWriter::xWriteSEISubBitstreamProperty(const SEISubBitstreamProperty &sei)
729{
730  WRITE_CODE( sei.m_activeVpsId, 4, "active_vps_id" );
731  assert( sei.m_numAdditionalSubStreams >= 1 );
732  WRITE_UVLC( sei.m_numAdditionalSubStreams - 1, "num_additional_sub_streams_minus1" );
733
734  for( Int i = 0; i < sei.m_numAdditionalSubStreams; i++ )
735  {
736    WRITE_CODE( sei.m_subBitstreamMode[i],       2, "sub_bitstream_mode[i]"           );
737    WRITE_UVLC( sei.m_outputLayerSetIdxToVps[i],    "output_layer_set_idx_to_vps[i]"  );
738    WRITE_CODE( sei.m_highestSublayerId[i],      3, "highest_sub_layer_id[i]"         );
739    WRITE_CODE( sei.m_avgBitRate[i],            16, "avg_bit_rate[i]"                 );
740    WRITE_CODE( sei.m_maxBitRate[i],            16, "max_bit_rate[i]"                 );
741  }
742  xWriteByteAlign();
743}
744#endif
745
746#if O0164_MULTI_LAYER_HRD
747Void SEIWriter::xWriteSEIBspNesting(TComBitIf& bs, const SEIBspNesting &sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting &nestingSei)
748{
749  WRITE_UVLC( sei.m_bspIdx, "bsp_idx" );
750
751  while ( m_pcBitIf->getNumberOfWrittenBits() % 8 != 0 )
752  {
753    WRITE_FLAG( 0, "bsp_nesting_zero_bit" );
754  }
755
756  // write nested SEI messages
757  for (SEIMessages::const_iterator it = sei.m_nestedSEIs.begin(); it != sei.m_nestedSEIs.end(); it++)
758  {
759    writeSEImessage(bs, *(*it), vps, sps, &nestingSei, &sei);
760  }
761}
762
763Void SEIWriter::xWriteSEIBspInitialArrivalTime(const SEIBspInitialArrivalTime &sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting &nestingSei, const SEIBspNesting &bspNestingSei)
764{
765  assert(vps->getVpsVuiPresentFlag());
766
767  UInt schedCombCnt = vps->getNumBspSchedCombinations(nestingSei.m_nestingOpIdx[0]);
768  UInt len;
769  UInt hrdIdx;
770
771  if (schedCombCnt > 0)
772  {
773    hrdIdx = vps->getBspCombHrdIdx(nestingSei.m_nestingOpIdx[0], 0, bspNestingSei.m_bspIdx);
774  }
775  else
776  {
777    hrdIdx = 0;
778  }
779
780  TComHRD *hrd = vps->getBspHrd(hrdIdx);
781
782  if (hrd->getNalHrdParametersPresentFlag() || hrd->getVclHrdParametersPresentFlag())
783  {
784    len = hrd->getInitialCpbRemovalDelayLengthMinus1() + 1;
785  }
786  else
787  {
788    len = 23 + 1;
789  }
790
791  if (hrd->getNalHrdParametersPresentFlag())
792  {
793    for(UInt i = 0; i < schedCombCnt; i++)
794    {
795      WRITE_CODE( sei.m_nalInitialArrivalDelay[i], len, "nal_initial_arrival_delay" );
796    }
797  }
798  else
799  {
800    for(UInt i = 0; i < schedCombCnt; i++)
801    {
802      WRITE_CODE( sei.m_vclInitialArrivalDelay[i], len, "vcl_initial_arrival_delay" );
803    }
804  }
805}
806
807Void SEIWriter::xWriteSEIBspHrd(const SEIBspHrd &sei, TComSPS *sps, const SEIScalableNesting &nestingSei)
808{
809  WRITE_UVLC( sei.m_seiNumBspHrdParametersMinus1, "sei_num_bsp_hrd_parameters_minus1" );
810  for (UInt i = 0; i <= sei.m_seiNumBspHrdParametersMinus1; i++)
811  {
812    if (i > 0)
813    {
814      WRITE_FLAG( sei.m_seiBspCprmsPresentFlag[i], "sei_bsp_cprms_present_flag" );
815    }
816    xCodeHrdParameters(sei.hrd, i==0 ? 1 : sei.m_seiBspCprmsPresentFlag[i], nestingSei.m_nestingMaxTemporalIdPlus1[0]-1);
817  }
818  for (UInt h = 0; h <= nestingSei.m_nestingNumOpsMinus1; h++)
819  {
820    UInt lsIdx = nestingSei.m_nestingOpIdx[h];
821    WRITE_UVLC( sei.m_seiNumBitstreamPartitionsMinus1[lsIdx], "num_sei_bitstream_partitions_minus1[i]");
822    for (UInt i = 0; i <= sei.m_seiNumBitstreamPartitionsMinus1[lsIdx]; i++)
823    {
824      for (UInt j = 0; j < sei.m_vpsMaxLayers; j++)
825      {
826        if (sei.m_layerIdIncludedFlag[lsIdx][j])
827        {
828          WRITE_FLAG( sei.m_seiLayerInBspFlag[lsIdx][i][j], "sei_layer_in_bsp_flag[lsIdx][i][j]" );
829        }
830      }
831    }
832    WRITE_UVLC( sei.m_seiNumBspSchedCombinationsMinus1[lsIdx], "sei_num_bsp_sched_combinations_minus1[i]");
833    for (UInt i = 0; i <= sei.m_seiNumBspSchedCombinationsMinus1[lsIdx]; i++)
834    {
835      for (UInt j = 0; j <= sei.m_seiNumBitstreamPartitionsMinus1[lsIdx]; j++)
836      {
837        WRITE_UVLC( sei.m_seiBspCombHrdIdx[lsIdx][i][j], "sei_bsp_comb_hrd_idx[lsIdx][i][j]");
838        WRITE_UVLC( sei.m_seiBspCombScheddx[lsIdx][i][j], "sei_bsp_comb_sched_idx[lsIdx][i][j]");
839      }
840    }
841  }
842}
843
844Void SEIWriter::xCodeHrdParameters( TComHRD *hrd, Bool commonInfPresentFlag, UInt maxNumSubLayersMinus1 )
845{
846  if( commonInfPresentFlag )
847  {
848    WRITE_FLAG( hrd->getNalHrdParametersPresentFlag() ? 1 : 0 ,  "nal_hrd_parameters_present_flag" );
849    WRITE_FLAG( hrd->getVclHrdParametersPresentFlag() ? 1 : 0 ,  "vcl_hrd_parameters_present_flag" );
850    if( hrd->getNalHrdParametersPresentFlag() || hrd->getVclHrdParametersPresentFlag() )
851    {
852      WRITE_FLAG( hrd->getSubPicCpbParamsPresentFlag() ? 1 : 0,  "sub_pic_cpb_params_present_flag" );
853      if( hrd->getSubPicCpbParamsPresentFlag() )
854      {
855        WRITE_CODE( hrd->getTickDivisorMinus2(), 8,              "tick_divisor_minus2" );
856        WRITE_CODE( hrd->getDuCpbRemovalDelayLengthMinus1(), 5,  "du_cpb_removal_delay_length_minus1" );
857        WRITE_FLAG( hrd->getSubPicCpbParamsInPicTimingSEIFlag() ? 1 : 0, "sub_pic_cpb_params_in_pic_timing_sei_flag" );
858        WRITE_CODE( hrd->getDpbOutputDelayDuLengthMinus1(), 5,   "dpb_output_delay_du_length_minus1"  );
859      }
860      WRITE_CODE( hrd->getBitRateScale(), 4,                     "bit_rate_scale" );
861      WRITE_CODE( hrd->getCpbSizeScale(), 4,                     "cpb_size_scale" );
862      if( hrd->getSubPicCpbParamsPresentFlag() )
863      {
864        WRITE_CODE( hrd->getDuCpbSizeScale(), 4,                "du_cpb_size_scale" ); 
865      }
866      WRITE_CODE( hrd->getInitialCpbRemovalDelayLengthMinus1(), 5, "initial_cpb_removal_delay_length_minus1" );
867      WRITE_CODE( hrd->getCpbRemovalDelayLengthMinus1(),        5, "au_cpb_removal_delay_length_minus1" );
868      WRITE_CODE( hrd->getDpbOutputDelayLengthMinus1(),         5, "dpb_output_delay_length_minus1" );
869    }
870  }
871  Int i, j, nalOrVcl;
872  for( i = 0; i <= maxNumSubLayersMinus1; i ++ )
873  {
874    WRITE_FLAG( hrd->getFixedPicRateFlag( i ) ? 1 : 0,          "fixed_pic_rate_general_flag");
875    if( !hrd->getFixedPicRateFlag( i ) )
876    {
877      WRITE_FLAG( hrd->getFixedPicRateWithinCvsFlag( i ) ? 1 : 0, "fixed_pic_rate_within_cvs_flag");
878    }
879    else
880    {
881      hrd->setFixedPicRateWithinCvsFlag( i, true );
882    }
883    if( hrd->getFixedPicRateWithinCvsFlag( i ) )
884    {
885      WRITE_UVLC( hrd->getPicDurationInTcMinus1( i ),           "elemental_duration_in_tc_minus1");
886    }
887    else
888    {
889      WRITE_FLAG( hrd->getLowDelayHrdFlag( i ) ? 1 : 0,           "low_delay_hrd_flag");
890    }
891    if (!hrd->getLowDelayHrdFlag( i ))
892    {
893      WRITE_UVLC( hrd->getCpbCntMinus1( i ),                      "cpb_cnt_minus1");
894    }
895   
896    for( nalOrVcl = 0; nalOrVcl < 2; nalOrVcl ++ )
897    {
898      if( ( ( nalOrVcl == 0 ) && ( hrd->getNalHrdParametersPresentFlag() ) ) ||
899          ( ( nalOrVcl == 1 ) && ( hrd->getVclHrdParametersPresentFlag() ) ) )
900      {
901        for( j = 0; j <= ( hrd->getCpbCntMinus1( i ) ); j ++ )
902        {
903          WRITE_UVLC( hrd->getBitRateValueMinus1( i, j, nalOrVcl ), "bit_rate_value_minus1");
904          WRITE_UVLC( hrd->getCpbSizeValueMinus1( i, j, nalOrVcl ), "cpb_size_value_minus1");
905          if( hrd->getSubPicCpbParamsPresentFlag() )
906          {
907            WRITE_UVLC( hrd->getDuCpbSizeValueMinus1( i, j, nalOrVcl ), "cpb_size_du_value_minus1"); 
908            WRITE_UVLC( hrd->getDuBitRateValueMinus1( i, j, nalOrVcl ), "bit_rate_du_value_minus1");
909          }
910          WRITE_FLAG( hrd->getCbrFlag( i, j, nalOrVcl ) ? 1 : 0, "cbr_flag");
911        }
912      }
913    }
914  }
915}
916
917#endif
918
919#endif //SVC_EXTENSION
920
921//! \}
Note: See TracBrowser for help on using the repository browser.