Changeset 1356 in 3DVCSoftware for trunk/source/Lib/TLibEncoder


Ignore:
Timestamp:
27 Oct 2015, 11:33:16 (9 years ago)
Author:
tech
Message:

Merged 15.1-dev0-NICT@1355.

Location:
trunk/source/Lib/TLibEncoder
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibEncoder/SEIEncoder.cpp

    r1313 r1356  
    465465
    466466#if NH_MV
     467#if !NH_MV_SEI
    467468Void SEIEncoder::initSEISubBitstreamProperty(SEISubBitstreamProperty *seiSubBitstreamProperty, const TComSPS *sps)
    468469{
     
    476477  seiSubBitstreamProperty->m_maxBitRate              = m_pcCfg->getMaxBitRate(); 
    477478}
     479#else
     480Void SEIEncoder::createAnnexFGISeiMessages( SEIMessages& seiMessage, const TComSlice* slice )
     481{
     482  const SEIMessages* seiMessageCfg = m_pcCfg->getSeiMessages();
     483
     484  for( SEIMessages::const_iterator itS = seiMessageCfg->begin(); itS != seiMessageCfg->end(); itS++ )   
     485  {     
     486    const SEI* curSei = (*itS);
     487    SEI* newSei;
     488    if ( curSei->insertSei( slice->getLayerId(), slice->getPOC(), slice->getTemporalId(), slice->getNalUnitType() ) )
     489    {
     490      newSei = curSei->getCopy( ) ;
     491
     492      if ( curSei->m_modifyByEncoder )
     493      {
     494        newSei->setupFromSlice  ( slice );
     495      }
     496
     497      if ( newSei   ->checkCfg( slice ) )
     498      {
     499        std::cout << "--> Omit sending SEI."  <<  std::endl;
     500        delete newSei;
     501      }
     502      else
     503      {
     504        seiMessage.push_back(newSei);
     505      }
     506
     507    }
     508  }
     509}
    478510#endif
     511#endif
    479512
    480513//! \}
  • trunk/source/Lib/TLibEncoder/SEIEncoder.h

    r1313 r1356  
    8686  Void initTemporalLevel0IndexSEI(SEITemporalLevel0Index *sei, TComSlice *slice);
    8787#if NH_MV
     88#if !NH_MV_SEI
    8889  Void initSEISubBitstreamProperty(SEISubBitstreamProperty *seiSubBitstreamProperty, const TComSPS *sps);
     90#else
     91  Void createAnnexFGISeiMessages( SEIMessages& seiMessage, const TComSlice* slice );;
     92#endif
    8993#endif
    9094private:
  • trunk/source/Lib/TLibEncoder/SEIwrite.cpp

    r1313 r1356  
    122122    break;
    123123#if NH_MV
     124#if !NH_MV_SEI
    124125   case SEI::SUB_BITSTREAM_PROPERTY:
    125126   xWriteSEISubBitstreamProperty(*static_cast<const SEISubBitstreamProperty*>(&sei));
    126127   break;
    127128#endif
     129#endif
     130#if NH_MV_SEI
     131#if NH_MV_LAYERS_NOT_PRESENT_SEI
     132   case SEI::LAYERS_NOT_PRESENT:
     133       xWriteSEILayersNotPresent(*static_cast<const SEILayersNotPresent*>(&sei));
     134     break;
     135#endif
     136   case SEI::INTER_LAYER_CONSTRAINED_TILE_SETS:
     137     xWriteSEIInterLayerConstrainedTileSets(*static_cast<const SEIInterLayerConstrainedTileSets*>(&sei));
     138     break;
     139#if NH_MV_SEI_TBD
     140   case SEI::BSP_NESTING:
     141     xWriteSEIBspNesting(*static_cast<const SEIBspNesting*>(&sei));
     142     break;
     143   case SEI::BSP_INITIAL_ARRIVAL_TIME:
     144     xWriteSEIBspInitialArrivalTime(*static_cast<const SEIBspInitialArrivalTime*>(&sei));
     145     break;
     146#endif
     147   case SEI::SUB_BITSTREAM_PROPERTY:
     148     xWriteSEISubBitstreamProperty(*static_cast<const SEISubBitstreamProperty*>(&sei));
     149     break;
     150   case SEI::ALPHA_CHANNEL_INFO:
     151     xWriteSEIAlphaChannelInfo(*static_cast<const SEIAlphaChannelInfo*>(&sei));
     152     break;
     153   case SEI::OVERLAY_INFO:
     154     xWriteSEIOverlayInfo(*static_cast<const SEIOverlayInfo*>(&sei));
     155     break;
     156   case SEI::TEMPORAL_MV_PREDICTION_CONSTRAINTS:
     157     xWriteSEITemporalMvPredictionConstraints(*static_cast<const SEITemporalMvPredictionConstraints*>(&sei));
     158     break;
     159#if NH_MV_SEI_TBD
     160   case SEI::FRAME_FIELD_INFO:
     161     xWriteSEIFrameFieldInfo(*static_cast<const SEIFrameFieldInfo*>(&sei));
     162     break;
     163#endif
     164   case SEI::THREE_DIMENSIONAL_REFERENCE_DISPLAYS_INFO:
     165     xWriteSEIThreeDimensionalReferenceDisplaysInfo(*static_cast<const SEIThreeDimensionalReferenceDisplaysInfo*>(&sei));
     166     break;
     167#if SEI_DRI_F0169
     168   case SEI::DEPTH_REPRESENTATION_INFO:
     169       xWriteSEIDepthRepresentationInfo(*static_cast<const SEIDepthRepresentationInfo*>(&sei));
     170       break;
     171#endif
     172   case SEI::MULTIVIEW_SCENE_INFO:
     173     xWriteSEIMultiviewSceneInfo(*static_cast<const SEIMultiviewSceneInfo*>(&sei));
     174     break;
     175   case SEI::MULTIVIEW_ACQUISITION_INFO:
     176     xWriteSEIMultiviewAcquisitionInfo(*static_cast<const SEIMultiviewAcquisitionInfo*>(&sei));
     177     break;
     178
     179   case SEI::MULTIVIEW_VIEW_POSITION:
     180     xWriteSEIMultiviewViewPosition(*static_cast<const SEIMultiviewViewPosition*>(&sei));
     181     break;
     182#if NH_3D
     183   case SEI::ALTERNATIVE_DEPTH_INFO:
     184     xWriteSEIAlternativeDepthInfo(*static_cast<const SEIAlternativeDepthInfo*>(&sei));
     185     break;
     186#endif
     187#endif
     188
    128189
    129190  default:
     
    246307  for (Int i = 0; i < sei.activeSeqParameterSetId.size(); i++)
    247308  {
    248     WRITE_UVLC(sei.activeSeqParameterSetId[i], "active_seq_parameter_set_id"); 
     309    WRITE_UVLC(sei.activeSeqParameterSetId[i], "active_seq_parameter_set_id");
    249310  }
    250311}
     
    384445{
    385446  WRITE_FLAG( sei.m_arrangementCancelFlag,          "segmented_rect_frame_packing_arrangement_cancel_flag" );
    386   if( sei.m_arrangementCancelFlag == 0 ) 
     447  if( sei.m_arrangementCancelFlag == 0 )
    387448  {
    388449    WRITE_CODE( sei.m_contentInterpretationType, 2, "segmented_rect_content_interpretation_type" );
     
    553614{
    554615  //UInt code;
    555   WRITE_FLAG((sei.m_mc_all_tiles_exact_sample_value_match_flag ? 1 : 0), "mc_all_tiles_exact_sample_value_match_flag"); 
     616  WRITE_FLAG((sei.m_mc_all_tiles_exact_sample_value_match_flag ? 1 : 0), "mc_all_tiles_exact_sample_value_match_flag");
    556617  WRITE_FLAG((sei.m_each_tile_one_tile_set_flag                ? 1 : 0), "each_tile_one_tile_set_flag"               );
    557618
     
    568629
    569630        if(sei.m_limited_tile_set_display_flag)
    570         { 
    571           WRITE_FLAG((sei.tileSetData(i).m_display_tile_set_flag ? 1 : 0), "display_tile_set_flag"); 
    572         }
    573 
    574         WRITE_UVLC((sei.tileSetData(i).getNumberOfTileRects() - 1), "num_tile_rects_in_set_minus1"); 
    575        
     631        {
     632          WRITE_FLAG((sei.tileSetData(i).m_display_tile_set_flag ? 1 : 0), "display_tile_set_flag");
     633        }
     634
     635        WRITE_UVLC((sei.tileSetData(i).getNumberOfTileRects() - 1), "num_tile_rects_in_set_minus1");
     636
    576637        for(Int j = 0; j < sei.tileSetData(i).getNumberOfTileRects(); j++)
    577638        {
    578           WRITE_UVLC(sei.tileSetData(i).topLeftTileIndex    (j), "top_left_tile_index"); 
    579           WRITE_UVLC(sei.tileSetData(i).bottomRightTileIndex(j), "bottom_right_tile_index"); 
     639          WRITE_UVLC(sei.tileSetData(i).topLeftTileIndex    (j), "top_left_tile_index");
     640          WRITE_UVLC(sei.tileSetData(i).bottomRightTileIndex(j), "bottom_right_tile_index");
    580641        }
    581642
    582643        if(!sei.m_mc_all_tiles_exact_sample_value_match_flag)
    583644        {
    584           WRITE_FLAG((sei.tileSetData(i).m_exact_sample_value_match_flag ? 1 : 0), "exact_sample_value_match_flag"); 
     645          WRITE_FLAG((sei.tileSetData(i).m_exact_sample_value_match_flag ? 1 : 0), "exact_sample_value_match_flag");
    585646        }
    586647
     
    590651        {
    591652          WRITE_FLAG((sei.tileSetData(i).m_mcts_tier_flag ? 1 : 0), "mcts_tier_flag");
    592           WRITE_CODE( sei.tileSetData(i).m_mcts_level_idc, 8,       "mcts_level_idc"); 
     653          WRITE_CODE( sei.tileSetData(i).m_mcts_level_idc, 8,       "mcts_level_idc");
    593654        }
    594655      }
     
    601662    if(sei.m_max_mcs_tier_level_idc_present_flag)
    602663    {
    603       WRITE_FLAG((sei.m_max_mcts_tier_flag ? 1 : 0), "max_mcts_tier_flag"); 
    604       WRITE_CODE( sei.m_max_mcts_level_idc, 8,       "max_mcts_level_idc"); 
     664      WRITE_FLAG((sei.m_max_mcts_tier_flag ? 1 : 0), "max_mcts_tier_flag");
     665      WRITE_CODE( sei.m_max_mcts_level_idc, 8,       "max_mcts_level_idc");
    605666    }
    606667  }
     
    702763  userVerticalCoefficients[2][2] = 100;
    703764  userVerticalCoefficients[2][3] = -10;
    704  
     765
    705766  Int const iNumHorizontalFilters = 1;
    706767  Int horizontalTapLength_minus1[iNumHorizontalFilters] = {3};
     
    748809
    749810#if NH_MV
     811#if !NH_MV_SEI
    750812Void SEIWriter::xWriteSEISubBitstreamProperty(const SEISubBitstreamProperty &sei)
    751813{
     
    765827}
    766828#endif
     829#endif
    767830
    768831Void SEIWriter::xWriteSEIKneeFunctionInfo(const SEIKneeFunctionInfo &sei)
    769832{
    770833  WRITE_UVLC( sei.m_kneeId, "knee_function_id" );
    771   WRITE_FLAG( sei.m_kneeCancelFlag, "knee_function_cancel_flag" ); 
     834  WRITE_FLAG( sei.m_kneeCancelFlag, "knee_function_cancel_flag" );
    772835  if ( !sei.m_kneeCancelFlag )
    773836  {
     
    800863  WRITE_CODE( sei.values.whitePoint[0],    16,  "white_point_x" );
    801864  WRITE_CODE( sei.values.whitePoint[1],    16,  "white_point_y" );
    802    
     865
    803866  WRITE_CODE( sei.values.maxLuminance,     32,  "max_display_mastering_luminance" );
    804867  WRITE_CODE( sei.values.minLuminance,     32,  "min_display_mastering_luminance" );
     
    818881}
    819882
     883#if NH_MV_LAYERS_NOT_PRESENT_SEI
     884Void SEIWriter::xWriteSEILayersNotPresent(const SEILayersNotPresent& sei)
     885{
     886  WRITE_CODE( sei.m_lnpSeiActiveVpsId, 4, "lnp_sei_active_vps_id" );
     887  for( Int i = 0; i  <  sei.m_lnpSeiMaxLayers; i++ )
     888  {
     889    WRITE_FLAG( ( sei.m_layerNotPresentFlag[i] ? 1 : 0 ), "layer_not_present_flag" );
     890  }
     891};
     892#endif
     893
     894
     895
     896Void SEIWriter::xWriteSEIInterLayerConstrainedTileSets( const SEIInterLayerConstrainedTileSets& sei)
     897{
     898  WRITE_FLAG( ( sei.m_ilAllTilesExactSampleValueMatchFlag ? 1 : 0 ), "il_all_tiles_exact_sample_value_match_flag" );
     899  WRITE_FLAG( ( sei.m_ilOneTilePerTileSetFlag ? 1 : 0 ),             "il_one_tile_per_tile_set_flag" );
     900  if( !sei.m_ilOneTilePerTileSetFlag )
     901  {
     902    WRITE_UVLC( sei.m_ilNumSetsInMessageMinus1, "il_num_sets_in_message_minus1" );
     903    if( sei.m_ilNumSetsInMessageMinus1 )
     904    {
     905      WRITE_FLAG( ( sei.m_skippedTileSetPresentFlag ? 1 : 0 ), "skipped_tile_set_present_flag" );
     906    }
     907    Int numSignificantSets = sei.m_ilNumSetsInMessageMinus1 - sei.m_skippedTileSetPresentFlag + 1;
     908    for( Int i = 0; i < numSignificantSets; i++ )
     909    {
     910      WRITE_UVLC( sei.m_ilctsId[i],                   "ilcts_id" );
     911      WRITE_UVLC( sei.m_ilNumTileRectsInSetMinus1[i], "il_num_tile_rects_in_set_minus1" );
     912      for( Int j = 0; j  <= sei.m_ilNumTileRectsInSetMinus1[ i ]; j++ )
     913      {
     914        WRITE_UVLC( sei.m_ilTopLeftTileIndex[i][j],     "il_top_left_tile_index" );
     915        WRITE_UVLC( sei.m_ilBottomRightTileIndex[i][j], "il_bottom_right_tile_index" );
     916      }
     917      WRITE_CODE( sei.m_ilcIdc[i], 2, "ilc_idc" );
     918      if ( !sei.m_ilAllTilesExactSampleValueMatchFlag )
     919      {
     920        WRITE_FLAG( ( sei.m_ilExactSampleValueMatchFlag[i] ? 1 : 0 ), "il_exact_sample_value_match_flag" );
     921      }
     922    }
     923  }
     924  else
     925  {
     926    WRITE_CODE( sei.m_allTilesIlcIdc, 2, "all_tiles_ilc_idc" );
     927  }
     928};
     929
     930#if NH_MV_SEI_TBD
     931Void SEIWriter::xWriteSEIBspNesting( const SEIBspNesting& sei)
     932{
     933  WRITE_UVLC( sei.m_seiOlsIdx, "sei_ols_idx" );
     934  WRITE_UVLC( sei.m_seiPartitioningSchemeIdx, "sei_partitioning_scheme_idx" );
     935  WRITE_UVLC( sei.m_bspIdx, "bsp_idx" );
     936  while( !ByteaLigned(() ) );
     937  {
     938    WRITE_CODE( sei.m_bspNestingZeroBit, *equalto0*/u1, "bsp_nesting_zero_bit" );
     939  }
     940  WRITE_UVLC( sei.m_numSeisInBspMinus1, "num_seis_in_bsp_minus1" );
     941  for( Int i = 0; i  <=  NumSeisInBspMinus1( ); i++ )
     942  {
     943    SeiMessage(() );
     944  }
     945};
     946
     947Void SEIWriter::xWriteSEIBspInitialArrivalTime( const SEIBspInitialArrivalTime& sei)
     948{
     949  psIdx = SeiPartitioningSchemeIdx();
     950  if( nalInitialArrivalDelayPresent )
     951  {
     952    for( Int i = 0; i < BspSchedCnt( SeiOlsIdx(), psIdx, MaxTemporalId( 0 ) ); i++ )
     953    {
     954      WRITE_CODE( sei.m_nalInitialArrivalDelay[i], getNalInitialArrivalDelayLen ), "nal_initial_arrival_delay" );
     955    }
     956  }
     957  if( vclInitialArrivalDelayPresent )
     958  {
     959    for( Int i = 0; i < BspSchedCnt( SeiOlsIdx(), psIdx, MaxTemporalId( 0 ) ); i++ )
     960    {
     961      WRITE_CODE( sei.m_vclInitialArrivalDelay[i], getVclInitialArrivalDelayLen ), "vcl_initial_arrival_delay" );
     962    }
     963  }
     964};
     965#endif
     966Void SEIWriter::xWriteSEISubBitstreamProperty( const SEISubBitstreamProperty& sei)
     967{
     968  WRITE_CODE( sei.m_sbPropertyActiveVpsId, 4,      "sb_property_active_vps_id"         );
     969  WRITE_UVLC( sei.m_numAdditionalSubStreamsMinus1, "num_additional_sub_streams_minus1" );
     970  for( Int i = 0; i  <=  sei.m_numAdditionalSubStreamsMinus1; i++ )
     971  {
     972    WRITE_CODE( sei.m_subBitstreamMode    [i], 2,  "sub_bitstream_mode"       );
     973    WRITE_UVLC( sei.m_olsIdxToVps         [i],     "ols_idx_to_vps"           );
     974    WRITE_CODE( sei.m_highestSublayerId   [i], 3,  "highest_sublayer_id"      );
     975    WRITE_CODE( sei.m_avgSbPropertyBitRate[i], 16, "avg_sb_property_bit_rate" );
     976    WRITE_CODE( sei.m_maxSbPropertyBitRate[i], 16, "max_sb_property_bit_rate" );
     977  }
     978};
     979
     980Void SEIWriter::xWriteSEIAlphaChannelInfo( const SEIAlphaChannelInfo& sei)
     981{
     982  WRITE_FLAG( ( sei.m_alphaChannelCancelFlag ? 1 : 0 ), "alpha_channel_cancel_flag" );
     983  if( !sei.m_alphaChannelCancelFlag )
     984  {
     985    WRITE_CODE( sei.m_alphaChannelUseIdc, 3, "alpha_channel_use_idc" );
     986    WRITE_CODE( sei.m_alphaChannelBitDepthMinus8, 3, "alpha_channel_bit_depth_minus8" );
     987    WRITE_CODE( sei.m_alphaTransparentValue, sei.m_alphaChannelBitDepthMinus8+9, "alpha_transparent_value" );
     988    WRITE_CODE( sei.m_alphaOpaqueValue, sei.m_alphaChannelBitDepthMinus8+9, "alpha_opaque_value" );
     989    WRITE_FLAG( ( sei.m_alphaChannelIncrFlag ? 1 : 0 ), "alpha_channel_incr_flag" );
     990    WRITE_FLAG( ( sei.m_alphaChannelClipFlag ? 1 : 0 ), "alpha_channel_clip_flag" );
     991    if( sei.m_alphaChannelClipFlag )
     992    {
     993      WRITE_FLAG( ( sei.m_alphaChannelClipTypeFlag ? 1 : 0 ), "alpha_channel_clip_type_flag" );
     994    }
     995  }
     996};
     997
     998Void SEIWriter::xWriteSEIOverlayInfo( const SEIOverlayInfo& sei)
     999{
     1000  WRITE_FLAG( ( sei.m_overlayInfoCancelFlag ? 1 : 0 ), "overlay_info_cancel_flag" );
     1001  if( !sei.m_overlayInfoCancelFlag )
     1002  {
     1003    WRITE_UVLC( sei.m_overlayContentAuxIdMinus128, "overlay_content_aux_id_minus128" );
     1004    WRITE_UVLC( sei.m_overlayLabelAuxIdMinus128, "overlay_label_aux_id_minus128" );
     1005    WRITE_UVLC( sei.m_overlayAlphaAuxIdMinus128, "overlay_alpha_aux_id_minus128" );
     1006    WRITE_UVLC( sei.m_overlayElementLabelValueLengthMinus8, "overlay_element_label_value_length_minus8" );
     1007    WRITE_UVLC( sei.m_numOverlaysMinus1, "num_overlays_minus1" );
     1008    for( Int i = 0; i  <=  sei.m_numOverlaysMinus1 ; i++ )
     1009    {
     1010      WRITE_UVLC( sei.m_overlayIdx[i], "overlay_idx" );
     1011      WRITE_FLAG( ( sei.m_languageOverlayPresentFlag[i] ? 1 : 0 ), "language_overlay_present_flag" );
     1012      WRITE_CODE( sei.m_overlayContentLayerId[i], 6, "overlay_content_layer_id" );
     1013      WRITE_FLAG( ( sei.m_overlayLabelPresentFlag[i] ? 1 : 0 ), "overlay_label_present_flag" );
     1014      if( sei.m_overlayLabelPresentFlag[i] )
     1015      {
     1016        WRITE_CODE( sei.m_overlayLabelLayerId[i], 6, "overlay_label_layer_id" );
     1017      }
     1018      WRITE_FLAG( ( sei.m_overlayAlphaPresentFlag[i] ? 1 : 0 ), "overlay_alpha_present_flag" );
     1019      if( sei.m_overlayAlphaPresentFlag[i] )
     1020      {
     1021        WRITE_CODE( sei.m_overlayAlphaLayerId[i], 6, "overlay_alpha_layer_id" );
     1022      }
     1023      if( sei.m_overlayLabelPresentFlag[i] )
     1024      {
     1025        WRITE_UVLC( sei.m_numOverlayElementsMinus1[i], "num_overlay_elements_minus1" );
     1026        for( Int j = 0; j  <=  sei.m_numOverlayElementsMinus1[i]; j++ )
     1027        {
     1028          WRITE_CODE( sei.m_overlayElementLabelMin[i][j], (sei.m_overlayElementLabelValueLengthMinus8 + 8), "overlay_element_label_min" );
     1029          WRITE_CODE( sei.m_overlayElementLabelMax[i][j], (sei.m_overlayElementLabelValueLengthMinus8 + 8), "overlay_element_label_max" );
     1030        }
     1031      }
     1032    }
     1033
     1034    // byte alignment
     1035    while ( m_pcBitIf->getNumberOfWrittenBits() % 8 != 0 )
     1036    {
     1037      WRITE_FLAG( 0, "overlay_zero_bit" );
     1038    }
     1039
     1040    UChar* stmp;
     1041    UInt ilength;
     1042    for( Int i = 0; i  <=  sei.m_numOverlaysMinus1; i++ )
     1043    {
     1044      if( sei.m_languageOverlayPresentFlag[i] )
     1045      {
     1046        stmp = (UChar*) strdup( sei.m_overlayLanguage[i].c_str() );
     1047        ilength = (UInt) sei.m_overlayLanguage[i].size();
     1048        WRITE_STRING( stmp, ilength, "overlay_language" );
     1049        free(stmp);
     1050      }
     1051      stmp = (UChar*) strdup( sei.m_overlayName[i].c_str() );
     1052      ilength = (UInt) sei.m_overlayName[i].size();
     1053      WRITE_STRING( stmp, ilength, "overlay_name" );
     1054      free(stmp);
     1055      if( sei.m_overlayLabelPresentFlag[i] )
     1056      {
     1057        for( Int j = 0; j  <=  sei.m_numOverlayElementsMinus1[i]; j++ )
     1058        {
     1059          stmp = (UChar*) strdup( sei.m_overlayElementName[i][j].c_str() );
     1060          ilength = (UInt) sei.m_overlayElementName[i][j].size();
     1061          WRITE_STRING( stmp, ilength, "overlay_element_name" );
     1062          free(stmp);
     1063        }
     1064      }
     1065    }
     1066    WRITE_FLAG( ( sei.m_overlayInfoPersistenceFlag ? 1 : 0 ), "overlay_info_persistence_flag" );
     1067  }
     1068};
     1069
     1070Void SEIWriter::xWriteSEITemporalMvPredictionConstraints( const SEITemporalMvPredictionConstraints& sei)
     1071{
     1072  WRITE_FLAG( ( sei.m_prevPicsNotUsedFlag    ? 1 : 0 ), "prev_pics_not_used_flag"     );
     1073  WRITE_FLAG( ( sei.m_noIntraLayerColPicFlag ? 1 : 0 ), "no_intra_layer_col_pic_flag" );
     1074};
     1075
     1076#if NH_MV_SEI_TBD
     1077Void SEIWriter::xWriteSEIFrameFieldInfo( const SEIFrameFieldInfo& sei)
     1078{
     1079  WRITE_CODE( sei.m_ffinfoPicStruct, 4, "ffinfo_pic_struct" );
     1080  WRITE_CODE( sei.m_ffinfoSourceScanType, 2, "ffinfo_source_scan_type" );
     1081  WRITE_FLAG( ( sei.m_ffinfoDuplicateFlag ? 1 : 0 ), "ffinfo_duplicate_flag" );
     1082};
     1083#endif
     1084
     1085Void SEIWriter::xWriteSEIThreeDimensionalReferenceDisplaysInfo( const SEIThreeDimensionalReferenceDisplaysInfo& sei)
     1086{
     1087  WRITE_UVLC( sei.m_precRefDisplayWidth, "prec_ref_display_width" );
     1088  WRITE_FLAG( ( sei.m_refViewingDistanceFlag ? 1 : 0 ), "ref_viewing_distance_flag" );
     1089  if( sei.m_refViewingDistanceFlag )
     1090  {
     1091    WRITE_UVLC( sei.m_precRefViewingDist, "prec_ref_viewing_dist" );
     1092  }
     1093  WRITE_UVLC( sei.m_numRefDisplaysMinus1, "num_ref_displays_minus1" );
     1094  for( Int i = 0; i  <=  sei.getNumRefDisplaysMinus1( ); i++ )
     1095  {
     1096    WRITE_UVLC( sei.m_leftViewId[i], "left_view_id" );
     1097    WRITE_UVLC( sei.m_rightViewId[i], "right_view_id" );
     1098    WRITE_CODE( sei.m_exponentRefDisplayWidth[i], 6, "exponent_ref_display_width" );
     1099    WRITE_CODE( sei.m_mantissaRefDisplayWidth[i], sei.getMantissaReferenceDisplayWidthLen(i) , "mantissa_ref_display_width" );
     1100    if( sei.m_refViewingDistanceFlag )
     1101    {
     1102      WRITE_CODE( sei.m_exponentRefViewingDistance[i], 6, "exponent_ref_viewing_distance" );
     1103      WRITE_CODE( sei.m_mantissaRefViewingDistance[i], sei.getMantissaReferenceViewingDistanceLen(i), "mantissa_ref_viewing_distance" );
     1104    }
     1105    WRITE_FLAG( ( sei.m_additionalShiftPresentFlag[i] ? 1 : 0 ), "additional_shift_present_flag" );
     1106    if( sei.m_additionalShiftPresentFlag[i] )
     1107    {
     1108      WRITE_CODE( sei.m_numSampleShiftPlus512[i], 10, "num_sample_shift_plus512" );
     1109    }
     1110  }
     1111  WRITE_FLAG( ( sei.m_threeDimensionalReferenceDisplaysExtensionFlag ? 1 : 0 ), "three_dimensional_reference_displays_extension_flag" );
     1112};
     1113
     1114#if SEI_DRI_F0169
     1115Void SEIWriter::xWriteSEIDepthRepresentationInfo( const SEIDepthRepresentationInfo& sei)
     1116{
     1117
     1118    assert(sei.m_currLayerID>=0);
     1119
     1120    WRITE_FLAG( ( sei.m_zNearFlag[sei.m_currLayerID] ? 1 : 0 ), "z_near_flag" );
     1121    WRITE_FLAG( ( sei.m_zFarFlag[sei.m_currLayerID] ? 1 : 0 ), "z_far_flag" );
     1122    WRITE_FLAG( ( sei.m_dMinFlag[sei.m_currLayerID] ? 1 : 0 ), "d_min_flag" );
     1123    WRITE_FLAG( ( sei.m_dMaxFlag[sei.m_currLayerID] ? 1 : 0 ), "d_max_flag" );
     1124    WRITE_UVLC( sei.m_depthRepresentationType[sei.m_currLayerID][0], "depth_representation_type" );
     1125    if( sei.m_dMinFlag[sei.m_currLayerID]  ||  sei.m_dMaxFlag[sei.m_currLayerID] )
     1126    {
     1127        WRITE_UVLC( sei.m_disparityRefViewId[sei.m_currLayerID][0], "disparity_ref_view_id" );
     1128    }
     1129    if( sei.m_zNearFlag[sei.m_currLayerID] )
     1130    {
     1131        xWriteSEIDepthRepInfoElement(sei.m_zNear[sei.m_currLayerID][0]);
     1132    }
     1133    if( sei.m_zFarFlag[sei.m_currLayerID] )
     1134    {
     1135        xWriteSEIDepthRepInfoElement(sei.m_zFar[sei.m_currLayerID][0]);
     1136    }
     1137    if( sei.m_dMinFlag[sei.m_currLayerID] )
     1138    {
     1139        xWriteSEIDepthRepInfoElement(sei.m_dMin[sei.m_currLayerID][0]);
     1140    }
     1141    if( sei.m_dMaxFlag[sei.m_currLayerID] )
     1142    {
     1143        xWriteSEIDepthRepInfoElement(sei.m_dMax[sei.m_currLayerID][0]);
     1144    }
     1145
     1146    if (sei.m_depthRepresentationType[sei.m_currLayerID][0] == 3)
     1147    {
     1148        WRITE_UVLC( sei.m_depthNonlinearRepresentationNumMinus1[sei.m_currLayerID][0], "depth_nonlinear_representation_num_minus1" );
     1149        for( Int i = 1; i  <=  sei.m_depthNonlinearRepresentationNumMinus1[sei.m_currLayerID][0] + 1; i++ )
     1150        {
     1151            WRITE_UVLC(sei.m_depth_nonlinear_representation_model[sei.m_currLayerID][i-1],"depth_nonlinear_representation_model[ i ]");
     1152        }
     1153    }
     1154}
     1155
     1156Void SEIWriter::xWriteSEIDepthRepInfoElement( double f)
     1157{
     1158    UInt x_sign, x_exp, x_mantissa,x_mantissa_len;
     1159    if (f < 0)
     1160    {
     1161        f = f * (-1);
     1162        x_sign = 1;
     1163    }
     1164    else
     1165    {
     1166        x_sign = 0;
     1167    }
     1168    int exponent=0;
     1169    if(f >= 1)
     1170    {
     1171        while(f>=2)
     1172        {
     1173            exponent++;
     1174            f = f/2;
     1175        }
     1176    }
     1177    else
     1178    {
     1179        while (f<1)
     1180        {
     1181            exponent++;
     1182            f = f*2;
     1183        }
     1184        exponent=-exponent;
     1185    }
     1186
     1187    int i;
     1188    f = f -1;
     1189    double s = 1;
     1190    char s_mantissa[32];
     1191    double thr=1.0/(4.0*(1<<30));
     1192
     1193    if (f>=thr)
     1194    {
     1195        for(i=0;i<32;i++)
     1196        {
     1197            s /= 2;
     1198            if(f>=s)
     1199            {
     1200                f = f-s;
     1201                s_mantissa[i]=1;
     1202
     1203                if (f<thr)
     1204                    break;
     1205            }
     1206            else
     1207            {
     1208                s_mantissa[i]=0;
     1209            }
     1210        }
     1211
     1212        if (i<32)
     1213            x_mantissa_len=i+1;
     1214        else
     1215            x_mantissa_len=32;
     1216
     1217        x_mantissa=0;
     1218
     1219        for(i=0;i<x_mantissa_len;i++)
     1220        {
     1221            if (s_mantissa[i]==1)
     1222                x_mantissa += (1u)<<(x_mantissa_len-1-i) ;
     1223        }
     1224
     1225    }
     1226    else
     1227    {
     1228        x_mantissa=0;
     1229        x_mantissa_len=1;
     1230    }
     1231
     1232    assert(exponent>=-31 && exponent<= (1<<7)-32);
     1233    x_exp=exponent+31;
     1234
     1235    WRITE_FLAG(  x_sign,                         "da_sign_flag" );
     1236    WRITE_CODE(  x_exp, 7 ,                      "da_exponent" );
     1237    WRITE_CODE( x_mantissa_len-1, 5 ,            "da_mantissa_len_minus1" );
     1238    WRITE_CODE( x_mantissa, x_mantissa_len ,     "da_mantissa" );
     1239
     1240};
     1241#endif
     1242Void SEIWriter::xWriteSEIMultiviewSceneInfo( const SEIMultiviewSceneInfo& sei)
     1243{
     1244  WRITE_SVLC( sei.m_minDisparity     , "min_disparity"       );
     1245  WRITE_UVLC( sei.m_maxDisparityRange, "max_disparity_range" );
     1246};
     1247
     1248
     1249Void SEIWriter::xWriteSEIMultiviewAcquisitionInfo( const SEIMultiviewAcquisitionInfo& sei)
     1250{
     1251  WRITE_FLAG( ( sei.m_intrinsicParamFlag ? 1 : 0 ), "intrinsic_param_flag" );
     1252  WRITE_FLAG( ( sei.m_extrinsicParamFlag ? 1 : 0 ), "extrinsic_param_flag" );
     1253  if( sei.m_intrinsicParamFlag )
     1254  {
     1255    WRITE_FLAG( ( sei.m_intrinsicParamsEqualFlag ? 1 : 0 ), "intrinsic_params_equal_flag" );
     1256    WRITE_UVLC(   sei.m_precFocalLength                   , "prec_focal_length"           );
     1257    WRITE_UVLC(   sei.m_precPrincipalPoint                , "prec_principal_point"        );
     1258    WRITE_UVLC(   sei.m_precSkewFactor                    , "prec_skew_factor"            );
     1259
     1260    for( Int i = 0; i  <=  ( sei.m_intrinsicParamsEqualFlag ? 0 : sei.getNumViewsMinus1() ); i++ )
     1261    {
     1262      WRITE_FLAG( ( sei.m_signFocalLengthX       [i] ? 1 : 0 ),                                         "sign_focal_length_x"        );
     1263      WRITE_CODE(   sei.m_exponentFocalLengthX   [i]          , 6                                  ,    "exponent_focal_length_x"    );
     1264      WRITE_CODE(   sei.m_mantissaFocalLengthX   [i]          , sei.getMantissaFocalLengthXLen( i ),    "mantissa_focal_length_x"    );
     1265      WRITE_FLAG( ( sei.m_signFocalLengthY       [i] ? 1 : 0 ),                                         "sign_focal_length_y"        );
     1266      WRITE_CODE(   sei.m_exponentFocalLengthY   [i]          , 6                                  ,    "exponent_focal_length_y"    );
     1267      WRITE_CODE(   sei.m_mantissaFocalLengthY   [i]          , sei.getMantissaFocalLengthYLen( i ),    "mantissa_focal_length_y"    );
     1268      WRITE_FLAG( ( sei.m_signPrincipalPointX    [i] ? 1 : 0 ),                                         "sign_principal_point_x"     );
     1269      WRITE_CODE(   sei.m_exponentPrincipalPointX[i]          , 6,                                      "exponent_principal_point_x" );
     1270      WRITE_CODE(   sei.m_mantissaPrincipalPointX[i]          , sei.getMantissaPrincipalPointXLen( i ), "mantissa_principal_point_x" );
     1271      WRITE_FLAG( ( sei.m_signPrincipalPointY    [i] ? 1 : 0 ),                                         "sign_principal_point_y"     );
     1272      WRITE_CODE(   sei.m_exponentPrincipalPointY[i]          , 6,                                      "exponent_principal_point_y" );
     1273      WRITE_CODE(   sei.m_mantissaPrincipalPointY[i]          , sei.getMantissaPrincipalPointYLen( i ), "mantissa_principal_point_y" );
     1274      WRITE_FLAG( ( sei.m_signSkewFactor         [i] ? 1 : 0 ),                                         "sign_skew_factor"           );
     1275      WRITE_CODE(   sei.m_exponentSkewFactor     [i]          , 6,                                      "exponent_skew_factor"       );
     1276      WRITE_CODE(   sei.m_mantissaSkewFactor     [i]          , sei.getMantissaSkewFactorLen( i )  ,    "mantissa_skew_factor"       );
     1277    }
     1278  }
     1279  if( sei.m_extrinsicParamFlag )
     1280  {
     1281    WRITE_UVLC( sei.m_precRotationParam   , "prec_rotation_param"    );
     1282    WRITE_UVLC( sei.m_precTranslationParam, "prec_translation_param" );
     1283    for( Int i = 0; i  <=  sei.getNumViewsMinus1(); i++ )
     1284    {
     1285      for( Int j = 0; j  <=  2; j++ )  /* row */
     1286      {
     1287        for( Int k = 0; k  <=  2; k++ )  /* column */
     1288        {
     1289          WRITE_FLAG( ( sei.m_signR    [i][j][k] ? 1 : 0 ),                                "sign_r"     );
     1290          WRITE_CODE(   sei.m_exponentR[i][j][k]          , 6,                             "exponent_r" );
     1291          WRITE_CODE(   sei.m_mantissaR[i][j][k]          , sei.getMantissaRLen( i,j,k ) , "mantissa_r" );
     1292        }
     1293        WRITE_FLAG( ( sei.m_signT    [i][j] ? 1 : 0 ),                          "sign_t"     );
     1294        WRITE_CODE(   sei.m_exponentT[i][j]          , 6,                       "exponent_t" );
     1295        WRITE_CODE(   sei.m_mantissaT[i][j]          , sei.getMantissaTLen( i,j ),"mantissa_t" );
     1296      }
     1297    }
     1298  }
     1299};
     1300
     1301
     1302#if NH_MV_SEI
     1303Void SEIWriter::xWriteSEIMultiviewViewPosition( const SEIMultiviewViewPosition& sei)
     1304{
     1305  WRITE_UVLC( sei.m_numViewsMinus1, "num_views_minus1" );
     1306  for( Int i = 0; i  <=  sei.m_numViewsMinus1; i++ )
     1307  {
     1308    WRITE_UVLC( sei.m_viewPosition[i], "view_position" );
     1309  }
     1310};
     1311#endif
     1312
     1313#if NH_3D
     1314Void SEIWriter::xWriteSEIAlternativeDepthInfo( const SEIAlternativeDepthInfo& sei)
     1315{
     1316  WRITE_FLAG( ( sei.m_alternativeDepthInfoCancelFlag ? 1 : 0 ), "alternative_depth_info_cancel_flag" );
     1317  if( sei.m_alternativeDepthInfoCancelFlag  ==  0 )
     1318  {
     1319    WRITE_CODE( sei.m_depthType, 2, "depth_type" );
     1320
     1321    if( sei.m_depthType  ==  0 )
     1322    {
     1323      WRITE_UVLC( sei.m_numConstituentViewsGvdMinus1, "num_constituent_views_gvd_minus1" );
     1324      WRITE_FLAG( ( sei.m_depthPresentGvdFlag ? 1 : 0 ), "depth_present_gvd_flag" );
     1325      WRITE_FLAG( ( sei.m_zGvdFlag ? 1 : 0 ), "z_gvd_flag" );
     1326      WRITE_FLAG( ( sei.m_intrinsicParamGvdFlag ? 1 : 0 ), "intrinsic_param_gvd_flag" );
     1327      WRITE_FLAG( ( sei.m_rotationGvdFlag ? 1 : 0 ), "rotation_gvd_flag" );
     1328      WRITE_FLAG( ( sei.m_translationGvdFlag ? 1 : 0 ), "translation_gvd_flag" );
     1329      if( sei.m_zGvdFlag )
     1330      {
     1331        for( Int i = 0, j = 0; j  <=  sei.m_numConstituentViewsGvdMinus1 + 1; j++ )
     1332        {
     1333          WRITE_FLAG( ( sei.m_signGvdZNearFlag[i][j] ? 1 : 0 ), "sign_gvd_z_near_flag" );
     1334          WRITE_CODE( sei.m_expGvdZNear[i][j], 7, "exp_gvd_z_near" );
     1335          WRITE_CODE( sei.m_manLenGvdZNearMinus1[i][j], 5, "man_len_gvd_z_near_minus1" );
     1336          WRITE_CODE( sei.m_manGvdZNear[i][j], sei.m_manLenGvdZNearMinus1[i][j] + 1, "man_gvd_z_near" );
     1337          WRITE_FLAG( ( sei.m_signGvdZFarFlag[i][j] ? 1 : 0 ), "sign_gvd_z_far_flag" );
     1338          WRITE_CODE( sei.m_expGvdZFar[i][j], 7, "exp_gvd_z_far" );
     1339          WRITE_CODE( sei.m_manLenGvdZFarMinus1[i][j], 5, "man_len_gvd_z_far_minus1" );
     1340          WRITE_CODE( sei.m_manGvdZFar[i][j], sei.m_manLenGvdZFarMinus1[i][j] + 1, "man_gvd_z_far" );
     1341        }
     1342      }
     1343      if( sei.m_intrinsicParamGvdFlag )
     1344      {
     1345        WRITE_UVLC( sei.m_precGvdFocalLength, "prec_gvd_focal_length" );
     1346        WRITE_UVLC( sei.m_precGvdPrincipalPoint, "prec_gvd_principal_point" );
     1347      }
     1348      if( sei.m_rotationGvdFlag )
     1349      {
     1350        WRITE_UVLC( sei.m_precGvdRotationParam, "prec_gvd_rotation_param" );
     1351      }
     1352      if( sei.m_translationGvdFlag )
     1353      {
     1354        WRITE_UVLC( sei.m_precGvdTranslationParam, "prec_gvd_translation_param" );
     1355      }
     1356      for( Int i = 0, j = 0; j  <=  sei.m_numConstituentViewsGvdMinus1 + 1; j++ )
     1357      {
     1358        if( sei.m_intrinsicParamGvdFlag )
     1359        {
     1360          WRITE_FLAG( ( sei.m_signGvdFocalLengthX[i][j] ? 1 : 0 ), "sign_gvd_focal_length_x" );
     1361          WRITE_CODE( sei.m_expGvdFocalLengthX[i][j], 6, "exp_gvd_focal_length_x" );
     1362          WRITE_CODE( sei.m_manGvdFocalLengthX[i][j], sei.getManGvdFocalLengthXLen(i,j), "man_gvd_focal_length_x" );
     1363          WRITE_FLAG( ( sei.m_signGvdFocalLengthY[i][j] ? 1 : 0 ), "sign_gvd_focal_length_y" );
     1364          WRITE_CODE( sei.m_expGvdFocalLengthY[i][j], 6, "exp_gvd_focal_length_y" );
     1365          WRITE_CODE( sei.m_manGvdFocalLengthY[i][j], sei.getManGvdFocalLengthYLen(i,j), "man_gvd_focal_length_y" );
     1366          WRITE_FLAG( ( sei.m_signGvdPrincipalPointX[i][j] ? 1 : 0 ), "sign_gvd_principal_point_x" );
     1367          WRITE_CODE( sei.m_expGvdPrincipalPointX[i][j], 6, "exp_gvd_principal_point_x" );
     1368          WRITE_CODE( sei.m_manGvdPrincipalPointX[i][j], sei.getManGvdPrincipalPointXLen(i,j), "man_gvd_principal_point_x" );
     1369          WRITE_FLAG( ( sei.m_signGvdPrincipalPointY[i][j] ? 1 : 0 ), "sign_gvd_principal_point_y" );
     1370          WRITE_CODE( sei.m_expGvdPrincipalPointY[i][j], 6, "exp_gvd_principal_point_y" );
     1371          WRITE_CODE( sei.m_manGvdPrincipalPointY[i][j], sei.getManGvdPrincipalPointYLen(i,j), "man_gvd_principal_point_y" );
     1372        }
     1373        if( sei.m_rotationGvdFlag )
     1374        {
     1375          WRITE_FLAG( ( sei.m_signGvdR00[i][j] ? 1 : 0 ), "sign_gvd_r00" );
     1376          WRITE_CODE( sei.m_expGvdR00[i][j], 6, "exp_gvd_r00" );
     1377          WRITE_CODE( sei.m_manGvdR00[i][j], sei.m_precGvdRotationParam, "man_gvd_r00" );
     1378          WRITE_FLAG( ( sei.m_signGvdR01[i][j] ? 1 : 0 ), "sign_gvd_r01" );
     1379          WRITE_CODE( sei.m_expGvdR01[i][j], 6, "exp_gvd_r01" );
     1380          WRITE_CODE( sei.m_manGvdR01[i][j], sei.m_precGvdRotationParam, "man_gvd_r01" );
     1381          WRITE_FLAG( ( sei.m_signGvdR02[i][j] ? 1 : 0 ), "sign_gvd_r02" );
     1382          WRITE_CODE( sei.m_expGvdR02[i][j], 6, "exp_gvd_r02" );
     1383          WRITE_CODE( sei.m_manGvdR02[i][j], sei.m_precGvdRotationParam, "man_gvd_r02" );
     1384          WRITE_FLAG( ( sei.m_signGvdR10[i][j] ? 1 : 0 ), "sign_gvd_r10" );
     1385          WRITE_CODE( sei.m_expGvdR10[i][j], 6, "exp_gvd_r10" );
     1386          WRITE_CODE( sei.m_manGvdR10[i][j], sei.m_precGvdRotationParam, "man_gvd_r10" );
     1387          WRITE_FLAG( ( sei.m_signGvdR11[i][j] ? 1 : 0 ), "sign_gvd_r11" );
     1388          WRITE_CODE( sei.m_expGvdR11[i][j], 6, "exp_gvd_r11" );
     1389          WRITE_CODE( sei.m_manGvdR11[i][j], sei.m_precGvdRotationParam, "man_gvd_r11" );
     1390          WRITE_FLAG( ( sei.m_signGvdR12[i][j] ? 1 : 0 ), "sign_gvd_r12" );
     1391          WRITE_CODE( sei.m_expGvdR12[i][j], 6, "exp_gvd_r12" );
     1392          WRITE_CODE( sei.m_manGvdR12[i][j], sei.m_precGvdRotationParam, "man_gvd_r12" );
     1393          WRITE_FLAG( ( sei.m_signGvdR20[i][j] ? 1 : 0 ), "sign_gvd_r20" );
     1394          WRITE_CODE( sei.m_expGvdR20[i][j], 6, "exp_gvd_r20" );
     1395          WRITE_CODE( sei.m_manGvdR20[i][j], sei.m_precGvdRotationParam, "man_gvd_r20" );
     1396          WRITE_FLAG( ( sei.m_signGvdR21[i][j] ? 1 : 0 ), "sign_gvd_r21" );
     1397          WRITE_CODE( sei.m_expGvdR21[i][j], 6, "exp_gvd_r21" );
     1398          WRITE_CODE( sei.m_manGvdR21[i][j], sei.m_precGvdRotationParam, "man_gvd_r21" );
     1399          WRITE_FLAG( ( sei.m_signGvdR22[i][j] ? 1 : 0 ), "sign_gvd_r22" );
     1400          WRITE_CODE( sei.m_expGvdR22[i][j], 6, "exp_gvd_r22" );
     1401          WRITE_CODE( sei.m_manGvdR22[i][j], sei.m_precGvdRotationParam, "man_gvd_r22" );
     1402        }
     1403        if( sei.m_translationGvdFlag )
     1404        {
     1405          WRITE_FLAG( ( sei.m_signGvdTX[i][j] ? 1 : 0 ), "sign_gvd_t_x" );
     1406          WRITE_CODE( sei.m_expGvdTX[i][j], 6, "exp_gvd_t_x" );
     1407          WRITE_CODE( sei.m_manGvdTX[i][j], sei.getManGvdTXLen(i,j), "man_gvd_t_x" );
     1408        }
     1409      }
     1410    }
     1411
     1412    if( sei.m_depthType  ==  1 )
     1413    {
     1414      WRITE_SVLC( sei.m_minOffsetXInt, "min_offset_x_int" );
     1415      WRITE_CODE( sei.m_minOffsetXFrac, 8, "min_offset_x_frac" );
     1416      WRITE_SVLC( sei.m_maxOffsetXInt, "max_offset_x_int" );
     1417      WRITE_CODE( sei.m_maxOffsetXFrac, 8, "max_offset_x_frac" );
     1418      WRITE_FLAG( ( sei.m_offsetYPresentFlag ? 1 : 0 ), "offset_y_present_flag" );
     1419      if( sei.m_offsetYPresentFlag )
     1420      {
     1421        WRITE_SVLC( sei.m_minOffsetYInt, "min_offset_y_int" );
     1422        WRITE_CODE( sei.m_minOffsetYFrac, 8, "min_offset_y_frac" );
     1423        WRITE_SVLC( sei.m_maxOffsetYInt, "max_offset_y_int" );
     1424        WRITE_CODE( sei.m_maxOffsetYFrac, 8, "max_offset_y_frac" );
     1425      }
     1426      WRITE_FLAG( ( sei.m_warpMapSizePresentFlag ? 1 : 0 ), "warp_map_size_present_flag" );
     1427      if( sei.m_warpMapSizePresentFlag )
     1428      {
     1429        WRITE_UVLC( sei.m_warpMapWidthMinus2, "warp_map_width_minus2" );
     1430        WRITE_UVLC( sei.m_warpMapHeightMinus2, "warp_map_height_minus2" );
     1431      }
     1432    }
     1433  }
     1434};
     1435#endif
     1436
     1437
    8201438//! \}
  • trunk/source/Lib/TLibEncoder/SEIwrite.h

    r1313 r1356  
    7272  Void xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, const TComSPS *sps);
    7373#if NH_MV
     74#if !NH_MV_SEI
    7475  Void xWriteSEISubBitstreamProperty(const SEISubBitstreamProperty &sei);
     76#endif
    7577#endif
    7678  Void xWriteSEITempMotionConstrainedTileSets(const SEITempMotionConstrainedTileSets& sei);
     
    8183  Void xWriteSEIMasteringDisplayColourVolume( const SEIMasteringDisplayColourVolume& sei);
    8284
     85#if NH_MV_SEI
     86#if NH_MV_LAYERS_NOT_PRESENT_SEI
     87  Void xWriteSEILayersNotPresent              ( const SEILayersNotPresent& sei);
     88#endif
     89  Void xWriteSEIInterLayerConstrainedTileSets ( const SEIInterLayerConstrainedTileSets& sei);
     90#if NH_MV_SEI_TBD
     91  Void xWriteSEIBspNesting                    ( const SEIBspNesting& sei);
     92  Void xWriteSEIBspInitialArrivalTime         ( const SEIBspInitialArrivalTime& sei);
     93#endif
     94  Void xWriteSEISubBitstreamProperty          ( const SEISubBitstreamProperty& sei);
     95  Void xWriteSEIAlphaChannelInfo              ( const SEIAlphaChannelInfo& sei);
     96  Void xWriteSEIOverlayInfo                   ( const SEIOverlayInfo& sei);
     97  Void xWriteSEITemporalMvPredictionConstraints ( const SEITemporalMvPredictionConstraints& sei);
     98#if NH_MV_SEI_TBD
     99  Void xWriteSEIFrameFieldInfo                ( const SEIFrameFieldInfo& sei);
     100#endif
     101  Void xWriteSEIThreeDimensionalReferenceDisplaysInfo ( const SEIThreeDimensionalReferenceDisplaysInfo& sei);
     102#if SEI_DRI_F0169
     103  Void xWriteSEIDepthRepInfoElement           ( double f);
     104  Void xWriteSEIDepthRepresentationInfo       ( const SEIDepthRepresentationInfo& sei);
     105#endif
     106  Void xWriteSEIMultiviewSceneInfo            ( const SEIMultiviewSceneInfo& sei);
     107  Void xWriteSEIMultiviewAcquisitionInfo      ( const SEIMultiviewAcquisitionInfo& sei);
     108  Void xWriteSEIMultiviewViewPosition         ( const SEIMultiviewViewPosition& sei);
     109#if NH_3D
     110  Void xWriteSEIAlternativeDepthInfo          ( const SEIAlternativeDepthInfo& sei);
     111#endif
    83112  Void xWriteByteAlign();
    84113};
     114#endif
    85115
    86116//! \}
  • trunk/source/Lib/TLibEncoder/SyntaxElementWriter.cpp

    r1313 r1356  
    127127}
    128128
     129Void  SyntaxElementWriter::xWriteStringTr( UChar* value, UInt length, const Char *pSymbolName)
     130{
     131  xWriteString(value, length);
     132  if( g_HLSTraceEnable )
     133  {
     134    fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter++ );
     135    fprintf( g_hTrace, "%-50s st(v=%d)  : %s\n", pSymbolName, length, value );
     136  }
     137}
     138
    129139#endif
    130140
     
    166176}
    167177
     178Void  SyntaxElementWriter::xWriteString( UChar* sCode, UInt uiLength)
     179{
     180  assert(m_pcBitIf->getNumberOfWrittenBits() % 8 == 0 );
     181  for (Int i=0 ; i<uiLength; i++)
     182  {
     183    m_pcBitIf->write( sCode[i], 8 );
     184  }
     185  m_pcBitIf->write( 0, 8 ); //zero-termination byte
     186}
     187
    168188Void SyntaxElementWriter::xWriteRbspTrailingBits()
    169189{
  • trunk/source/Lib/TLibEncoder/SyntaxElementWriter.h

    r1313 r1356  
    5656#define WRITE_SVLC( value,         name)    xWriteSvlcTr ( value,         name )
    5757#define WRITE_FLAG( value,         name)    xWriteFlagTr ( value,         name )
     58#define WRITE_STRING( value, length, name)   xWriteStringTr( value, length, name )
    5859
    5960#else
     
    6364#define WRITE_SVLC( value,         name)     xWriteSvlc ( value )
    6465#define WRITE_FLAG( value,         name)     xWriteFlag ( value )
     66#define WRITE_STRING( value, length, name)   xWriteString( value, length )
    6567
    6668#endif
     
    8284  Void  xWriteSvlc            ( Int  iCode   );
    8385  Void  xWriteFlag            ( UInt uiCode );
     86  Void  xWriteString          ( UChar* sCode, UInt uiLength);
    8487#if ENC_DEC_TRACE
    8588  Void  xWriteCodeTr          ( UInt value, UInt  length, const Char *pSymbolName);
     
    8790  Void  xWriteSvlcTr          ( Int  value,               const Char *pSymbolName);
    8891  Void  xWriteFlagTr          ( UInt value,               const Char *pSymbolName);
     92  Void  xWriteStringTr        ( UChar* value, UInt length, const Char *pSymbolName);
    8993#endif
    9094  Void xWriteRbspTrailingBits();
  • trunk/source/Lib/TLibEncoder/TEncCfg.h

    r1313 r1356  
    4949#include "TAppCommon/TAppComCamPara.h"
    5050#include "TLibRenderer/TRenModSetupStrParser.h"
     51#endif
     52
     53#if NH_MV
     54#include "TLibCommon/SEI.h"
    5155#endif
    5256
     
    350354  Int*      m_kneeSEIOutputKneePoint;
    351355  TComSEIMasteringDisplay m_masteringDisplay;
     356#if NH_MV_SEI
     357  SEIMessages* m_seiMessages;
     358#endif
    352359  //====== Weighted Prediction ========
    353360  Bool      m_useWeightedPred;       //< Use of Weighting Prediction (P_SLICE)
     
    432439
    433440#if NH_MV
     441#if !NH_MV_SEI
    434442  Bool              m_subBistreamPropSEIEnabled;
    435443  Int               m_numAdditionalSubStreams;
     
    439447  std::vector<Int>  m_avgBitRate;
    440448  std::vector<Int>  m_maxBitRate;
     449#endif
    441450#endif
    442451
     
    933942  const TComSEIMasteringDisplay &getMasteringDisplaySEI() const      { return m_masteringDisplay; }
    934943#if NH_MV
     944#if NH_MV_SEI
     945  Void setSeiMessages(SEIMessages *p)                                { m_seiMessages = p;    }
     946  const SEIMessages*  getSeiMessages()                               { return m_seiMessages; }
     947#else
    935948  Bool   getSubBitstreamPropSEIEnabled()                             { return m_subBistreamPropSEIEnabled;}
    936949  Void   setSubBitstreamPropSEIEnabled(Bool x)                       { m_subBistreamPropSEIEnabled = x;}
     
    958971  Int   getMaxBitRate(Int idx)                                       { return m_maxBitRate[idx];}
    959972  Void  setMaxBitRate(std::vector<Int> &x)                           { m_maxBitRate = x;}
    960 
     973#endif
    961974#endif
    962975
  • trunk/source/Lib/TLibEncoder/TEncGOP.cpp

    r1321 r1356  
    100100  m_layerId      = 0;
    101101  m_viewId       = 0;
    102   m_pocLastCoded = -1; 
     102  m_pocLastCoded = -1;
    103103#if NH_3D
    104   m_viewIndex  =   0; 
     104  m_viewIndex  =   0;
    105105  m_isDepth = false;
    106106#endif
     
    147147
    148148#if NH_MV
    149   m_ivPicLists           = pcTEncTop->getIvPicLists(); 
     149  m_ivPicLists           = pcTEncTop->getIvPicLists();
    150150  m_layerId              = pcTEncTop->getLayerId();
    151151  m_viewId               = pcTEncTop->getViewId();
     
    156156#endif
    157157#if NH_3D_IC
    158   m_aICEnableCandidate   = pcTEncTop->getICEnableCandidate(); 
    159   m_aICEnableNum         = pcTEncTop->getICEnableNum(); 
     158  m_aICEnableCandidate   = pcTEncTop->getICEnableCandidate();
     159  m_aICEnableNum         = pcTEncTop->getICEnableNum();
    160160#endif
    161161#if KWU_FIX_URQ
     
    207207#if NH_MV
    208208  if ( getLayerId() == 0 )
    209   { 
     209  {
    210210    actualTotalBits += xWriteVPS(accessUnit, m_pcEncTop->getVPS());
    211211  }
     
    277277
    278278  while ( (itNalu!=accessUnit.end())&&
    279     ( (*itNalu)->m_nalUnitType==NAL_UNIT_ACCESS_UNIT_DELIMITER 
     279    ( (*itNalu)->m_nalUnitType==NAL_UNIT_ACCESS_UNIT_DELIMITER
    280280    || (*itNalu)->m_nalUnitType==NAL_UNIT_VPS
    281281    || (*itNalu)->m_nalUnitType==NAL_UNIT_SPS
     
    288288  SEIMessages localMessages = seiMessages;
    289289  SEIMessages currentMessages;
    290  
     290
    291291#if ENC_DEC_TRACE
    292292  g_HLSTraceEnable = !testWrite;
     
    299299  xWriteSEI(NAL_UNIT_PREFIX_SEI, currentMessages, accessUnit, itNalu, temporalId, sps);
    300300  xClearSEIs(currentMessages, !testWrite);
    301  
     301
    302302  // Buffering period SEI must always be following active parameter sets
    303303  currentMessages = extractSeisByType(localMessages, SEI::BUFFERING_PERIOD);
     
    328328  xWriteSEISeparately(NAL_UNIT_PREFIX_SEI, currentMessages, accessUnit, itNalu, temporalId, sps);
    329329  xClearSEIs(currentMessages, !testWrite);
     330
     331#if NH_MV_LAYERS_NOT_PRESENT_SEI
     332  // Layers not present SEI message
     333  currentMessages = extractSeisByType(localMessages, SEI::LAYERS_NOT_PRESENT);
     334  xWriteSEISeparately(NAL_UNIT_PREFIX_SEI, currentMessages, accessUnit, itNalu, temporalId, sps);
     335  xClearSEIs(currentMessages, !testWrite);
     336#endif
    330337
    331338  // And finally everything else one by one
     
    412419Void TEncGOP::xCreateIRAPLeadingSEIMessages (SEIMessages& seiMessages, const TComSPS *sps, const TComPPS *pps)
    413420{
    414 #if NH_MV
    415   OutputNALUnit nalu(NAL_UNIT_PREFIX_SEI, 0, getLayerId());
    416 #else
    417421  OutputNALUnit nalu(NAL_UNIT_PREFIX_SEI);
    418 #endif
     422
    419423  if(m_pcCfg->getActiveParameterSetsSEIEnabled())
    420424  {
     
    472476    seiMessages.push_back(sei);
    473477  }
    474    
     478
    475479  if(m_pcCfg->getMasteringDisplaySEI().colourVolumeSEIEnabled)
    476480  {
     
    482486
    483487#if NH_MV
     488#if !NH_MV_SEI
    484489  if( m_pcCfg->getSubBitstreamPropSEIEnabled() && ( getLayerId() == 0 ) )
    485490  {
    486491    SEISubBitstreamProperty *sei = new SEISubBitstreamProperty;
    487     m_seiEncoder.initSEISubBitstreamProperty( sei, sps );   
     492    m_seiEncoder.initSEISubBitstreamProperty( sei, sps );
    488493    seiMessages.push_back(sei);
    489494  }
     495#endif
    490496#endif
    491497}
     
    679685      }
    680686    }
    681    
     687
    682688    if( m_pcCfg->getPictureTimingSEIEnabled() )
    683689    {
     
    715721    return;
    716722  }
    717   // fix first 
     723  // fix first
    718724  UInt numNalUnits = (UInt)testAU.size();
    719725  UInt numRBSPBytes = 0;
     
    927933          IRAPGOPid = iGOPid;
    928934          IRAPtoReorder = true;
    929           swapIRAPForward = true; 
     935          swapIRAPForward = true;
    930936          break;
    931937        }
     
    935941          IRAPGOPid = iGOPid;
    936942          IRAPtoReorder = true;
    937           swapIRAPForward = false; 
     943          swapIRAPForward = false;
    938944          break;
    939945        }
     
    10661072#endif
    10671073#if NH_MV
    1068 Void TEncGOP::compressPicInGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, 
    1069                                 TComList<TComPicYuv*>& rcListPicYuvRecOut,  std::list<AccessUnit>& accessUnitsInGOP, 
     1074Void TEncGOP::compressPicInGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic,
     1075                                TComList<TComPicYuv*>& rcListPicYuvRecOut,  std::list<AccessUnit>& accessUnitsInGOP,
    10701076                                Bool isField, Bool isTff, const InputColourSpaceConversion snr_conversion, const Bool printFrameMSE, Int iGOPid )
    10711077#else
     
    11701176    pcPic->setCurrSliceIdx(0);
    11711177#if NH_MV
    1172     m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iGOPid, pcSlice, m_pcEncTop->getVPS(), getLayerId(), isField  );     
     1178    m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iGOPid, pcSlice, m_pcEncTop->getVPS(), getLayerId(), isField  );
    11731179#else
    11741180    m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iGOPid, pcSlice, isField );
     
    11811187    pcSlice->setSliceIdx(0);
    11821188#if NH_MV
    1183     pcSlice->setRefPicSetInterLayer ( &m_refPicSetInterLayer0, &m_refPicSetInterLayer1 ); 
     1189    pcSlice->setRefPicSetInterLayer ( &m_refPicSetInterLayer0, &m_refPicSetInterLayer1 );
    11841190    pcPic  ->setLayerId     ( getLayerId()   );
    1185     pcPic  ->setViewId      ( getViewId()    );   
     1191    pcPic  ->setViewId      ( getViewId()    );
    11861192#if !NH_3D
    11871193    pcSlice->setLayerId     ( getLayerId() );
    1188     pcSlice->setViewId      ( getViewId()  );   
     1194    pcSlice->setViewId      ( getViewId()  );
    11891195    pcSlice->setVPS         ( m_pcEncTop->getVPS() );
    11901196#else
    1191     pcPic  ->setViewIndex   ( getViewIndex() ); 
     1197    pcPic  ->setViewIndex   ( getViewIndex() );
    11921198    pcPic  ->setIsDepth( getIsDepth() );
    1193     pcSlice->setCamparaSlice( pcPic->getCodedScale(), pcPic->getCodedOffset() );   
    1194 #endif
    1195 #endif 
     1199    pcSlice->setCamparaSlice( pcPic->getCodedScale(), pcPic->getCodedOffset() );
     1200#endif
     1201#endif
    11961202    //set default slice level flag to the same as SPS level flag
    11971203    pcSlice->setLFCrossSliceBoundaryFlag(  pcSlice->getPPS()->getLoopFilterAcrossSlicesEnabledFlag()  );
     
    12011207    if( pcSlice->getSliceType() == B_SLICE )
    12021208    {
    1203       if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'P' ) 
    1204       { 
     1209      if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'P' )
     1210      {
    12051211        pcSlice->setSliceType( P_SLICE );
    12061212      }
     
    12101216    if( pcSlice->getSliceType() == B_SLICE )
    12111217    {
    1212       if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'I' ) 
    1213       { 
     1218      if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'I' )
     1219      {
    12141220        pcSlice->setSliceType( I_SLICE );
    12151221      }
     
    12251231      pcSlice->setSliceType(I_SLICE);
    12261232    }
    1227    
     1233
    12281234    // Set the nal unit type
    12291235    pcSlice->setNalUnitType(getNalUnitType(pocCurr, m_iLastIDR, isField));
     
    12791285    pcSlice->setAssociatedIRAPPOC(m_associatedIRAPPOC);
    12801286    }
    1281     if ((pcSlice->checkThatAllRefPicsAreAvailable(rcListPic, pcSlice->getRPS(), false, m_iLastRecoveryPicPOC, m_pcCfg->getDecodingRefreshType() == 3) != 0) || (pcSlice->isIRAP()) 
     1287    if ((pcSlice->checkThatAllRefPicsAreAvailable(rcListPic, pcSlice->getRPS(), false, m_iLastRecoveryPicPOC, m_pcCfg->getDecodingRefreshType() == 3) != 0) || (pcSlice->isIRAP())
    12821288      || (m_pcCfg->getEfficientFieldIRAPEnabled() && isField && pcSlice->getAssociatedIRAPType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && pcSlice->getAssociatedIRAPType() <= NAL_UNIT_CODED_SLICE_CRA && pcSlice->getAssociatedIRAPPOC() == pcSlice->getPOC()+1)
    12831289      )
     
    12881294    pcSlice->applyReferencePictureSet(rcListPic, pcSlice->getRPS());
    12891295
    1290     if(pcSlice->getTLayer() > 0 
     1296    if(pcSlice->getTLayer() > 0
    12911297      &&  !( pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_N     // Check if not a leading picture
    12921298          || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_R
     
    13581364    if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > 0 )
    13591365    {
    1360       // Some more sophisticated algorithm to determine discardable_flag might be added here. 
    1361       pcSlice->setDiscardableFlag           ( false );     
    1362     }   
    1363 
    1364     const TComVPS*           vps = pcSlice->getVPS();     
     1366      // Some more sophisticated algorithm to determine discardable_flag might be added here.
     1367      pcSlice->setDiscardableFlag           ( false );
     1368    }
     1369
     1370    const TComVPS*           vps = pcSlice->getVPS();
    13651371#if NH_3D
    1366     Int numDirectRefLayers = vps    ->getNumRefListLayers( getLayerId() ); 
     1372    Int numDirectRefLayers = vps    ->getNumRefListLayers( getLayerId() );
    13671373#else
    1368     Int numDirectRefLayers = vps    ->getNumDirectRefLayers( getLayerId() ); 
     1374    Int numDirectRefLayers = vps    ->getNumDirectRefLayers( getLayerId() );
    13691375#endif
    13701376#if NH_3D
    1371     pcSlice->setIvPicLists( m_ivPicLists );         
     1377    pcSlice->setIvPicLists( m_ivPicLists );
    13721378
    13731379    Int gopNum = (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid;
    1374     GOPEntry gopEntry      = m_pcCfg->getGOPEntry( gopNum );     
     1380    GOPEntry gopEntry      = m_pcCfg->getGOPEntry( gopNum );
    13751381#else
    1376     GOPEntry gopEntry      = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid );     
    1377 #endif
    1378 
    1379 
    1380    
    1381     Bool interLayerPredLayerIdcPresentFlag = false; 
     1382    GOPEntry gopEntry      = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid );
     1383#endif
     1384
     1385
     1386
     1387    Bool interLayerPredLayerIdcPresentFlag = false;
    13821388    if ( getLayerId() > 0 && !vps->getAllRefLayersActiveFlag() && numDirectRefLayers > 0 )
    1383     {         
    1384       pcSlice->setInterLayerPredEnabledFlag ( gopEntry.m_numActiveRefLayerPics > 0 );     
     1389    {
     1390      pcSlice->setInterLayerPredEnabledFlag ( gopEntry.m_numActiveRefLayerPics > 0 );
    13851391      if ( pcSlice->getInterLayerPredEnabledFlag() && numDirectRefLayers > 1 )
    13861392      {
    13871393        if ( !vps->getMaxOneActiveRefLayerFlag() )
    1388         {   
    1389           pcSlice->setNumInterLayerRefPicsMinus1( gopEntry.m_numActiveRefLayerPics - 1 ); 
     1394        {
     1395          pcSlice->setNumInterLayerRefPicsMinus1( gopEntry.m_numActiveRefLayerPics - 1 );
    13901396        }
    13911397#if NH_3D
     
    13941400        if ( gopEntry.m_numActiveRefLayerPics != vps->getNumDirectRefLayers( getLayerId() ) )
    13951401#endif
    1396         {       
    1397           interLayerPredLayerIdcPresentFlag = true; 
     1402        {
     1403          interLayerPredLayerIdcPresentFlag = true;
    13981404          for (Int i = 0; i < gopEntry.m_numActiveRefLayerPics; i++ )
    13991405          {
    1400             pcSlice->setInterLayerPredLayerIdc( i, gopEntry.m_interLayerPredLayerIdc[ i ] ); 
     1406            pcSlice->setInterLayerPredLayerIdc( i, gopEntry.m_interLayerPredLayerIdc[ i ] );
    14011407          }
    14021408        }
     
    14051411    if ( !interLayerPredLayerIdcPresentFlag )
    14061412    {
    1407       for( Int i = 0; i < pcSlice->getNumActiveRefLayerPics(); i++ )   
     1413      for( Int i = 0; i < pcSlice->getNumActiveRefLayerPics(); i++ )
    14081414      {
    14091415        pcSlice->setInterLayerPredLayerIdc(i, pcSlice->getRefLayerPicIdc( i ) );
     
    14121418
    14131419
    1414     assert( pcSlice->getNumActiveRefLayerPics() == gopEntry.m_numActiveRefLayerPics ); 
    1415    
     1420    assert( pcSlice->getNumActiveRefLayerPics() == gopEntry.m_numActiveRefLayerPics );
     1421
    14161422#if NH_3D
    14171423    if ( m_pcEncTop->decProcAnnexI() )
    1418     {   
    1419       pcSlice->deriveInCmpPredAndCpAvailFlag( ); 
     1424    {
     1425      pcSlice->deriveInCmpPredAndCpAvailFlag( );
    14201426      if ( pcSlice->getInCmpPredAvailFlag() )
    1421       {     
    1422         pcSlice->setInCompPredFlag( gopEntry.m_interCompPredFlag ); 
     1427      {
     1428        pcSlice->setInCompPredFlag( gopEntry.m_interCompPredFlag );
    14231429      }
    14241430      else
     
    14341440            printf( "\nError: Frame%d_l%d cannot enable inter-component prediction on slice level. All reference layers need to be available and at least one tool using inter-component prediction must be enabled in the SPS. \n", gopNum, pcSlice->getVPS()->getLayerIdInVps( getLayerId() ) );
    14351441          }
    1436          
     1442
    14371443          exit(EXIT_FAILURE);
    14381444        }
    14391445      }
    1440       pcSlice->init3dToolParameters(); 
    1441       pcSlice->checkInCompPredRefLayers(); 
    1442     }   
     1446      pcSlice->init3dToolParameters();
     1447      pcSlice->checkInCompPredRefLayers();
     1448    }
    14431449#if NH_3D_IV_MERGE
    14441450    // This needs to be done after initialization of 3D tool parameters.
     
    14471453#endif
    14481454
    1449     pcSlice->createInterLayerReferencePictureSet( m_ivPicLists, m_refPicSetInterLayer0, m_refPicSetInterLayer1 ); 
     1455    pcSlice->createInterLayerReferencePictureSet( m_ivPicLists, m_refPicSetInterLayer0, m_refPicSetInterLayer1 );
    14501456    pcSlice->setNumRefIdx(REF_PIC_LIST_0,min(gopEntry.m_numRefPicsActive,( pcSlice->getRPS()->getNumberOfPictures() + (Int) m_refPicSetInterLayer0.size() + (Int) m_refPicSetInterLayer1.size()) ) );
    14511457    pcSlice->setNumRefIdx(REF_PIC_LIST_1,min(gopEntry.m_numRefPicsActive,( pcSlice->getRPS()->getNumberOfPictures() + (Int) m_refPicSetInterLayer0.size() + (Int) m_refPicSetInterLayer1.size()) ) );
     
    14561462
    14571463    pcSlice->getTempRefPicLists( rcListPic, m_refPicSetInterLayer0, m_refPicSetInterLayer1, tempRefPicLists, usedAsLongTerm, numPocTotalCurr, true );
    1458    
    1459 
    1460     xSetRefPicListModificationsMv( tempRefPicLists, pcSlice, iGOPid );   
     1464
     1465
     1466    xSetRefPicListModificationsMv( tempRefPicLists, pcSlice, iGOPid );
    14611467#else
    14621468    pcSlice->setNumRefIdx(REF_PIC_LIST_0,min(m_pcCfg->getGOPEntry(iGOPid).m_numRefPicsActive,pcSlice->getRPS()->getNumberOfPictures()));
     
    14641470#endif
    14651471    //  Set reference list
    1466 #if NH_MV   
    1467     pcSlice->setRefPicList( tempRefPicLists, usedAsLongTerm, numPocTotalCurr ); 
     1472#if NH_MV
     1473    pcSlice->setRefPicList( tempRefPicLists, usedAsLongTerm, numPocTotalCurr );
    14681474#else
    14691475    pcSlice->setRefPicList ( rcListPic );
     
    14771483#endif
    14781484#if NH_3D_IC
    1479     pcSlice->setICEnableCandidate( m_aICEnableCandidate );         
    1480     pcSlice->setICEnableNum( m_aICEnableNum );         
     1485    pcSlice->setICEnableCandidate( m_aICEnableCandidate );
     1486    pcSlice->setICEnableNum( m_aICEnableNum );
    14811487#endif
    14821488
     
    14851491    if ( pcSlice->getSliceType() == B_SLICE )
    14861492    {
    1487       if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() == true && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'P' ) 
    1488       { 
    1489         pcSlice->setSliceType( P_SLICE ); 
     1493      if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() == true && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'P' )
     1494      {
     1495        pcSlice->setSliceType( P_SLICE );
    14901496      }
    14911497    }
     
    15661572
    15671573#if NH_3D_VSO
    1568   // Should be moved to TEncTop !!! 
     1574  // Should be moved to TEncTop !!!
    15691575  Bool bUseVSO = m_pcEncTop->getUseVSO();
    1570  
    1571   TComRdCost* pcRdCost = m_pcEncTop->getRdCost();   
     1576
     1577  TComRdCost* pcRdCost = m_pcEncTop->getRdCost();
    15721578
    15731579  pcRdCost->setUseVSO( bUseVSO );
     
    17251731#endif
    17261732#if NH_3D
    1727       pcSlice->setDepthToDisparityLUTs(); 
     1733      pcSlice->setDepthToDisparityLUTs();
    17281734
    17291735#endif
     
    18351841    xCreatePerPictureSEIMessages(iGOPid, leadingSeiMessages, nestedSeiMessages, pcSlice);
    18361842
     1843#if NH_MV_SEI
     1844    m_seiEncoder.createAnnexFGISeiMessages( leadingSeiMessages, pcSlice );
     1845#endif
     1846
    18371847    /* use the main bitstream buffer for storing the marshalled picture */
    18381848    m_pcEntropyCoder->setBitstream(NULL);
     
    19801990    cabac_zero_word_padding(pcSlice, pcPic, binCountsInNalUnits, numBytesInVclNalUnits, accessUnit.back()->m_nalUnitData, m_pcCfg->getCabacZeroWordPaddingEnabled());
    19811991#if NH_3D
    1982       pcPic->compressMotion(2); 
     1992      pcPic->compressMotion(2);
    19831993#else
    19841994    pcPic->compressMotion();
     
    20552065    pcPic->setReconMark   ( true );
    20562066#if NH_MV
    2057       TComSlice::markIvRefPicsAsShortTerm( m_refPicSetInterLayer0, m_refPicSetInterLayer1 ); 
    2058       std::vector<Int> temp; 
    2059       TComSlice::markCurrPic( pcPic ); 
     2067      TComSlice::markIvRefPicsAsShortTerm( m_refPicSetInterLayer0, m_refPicSetInterLayer1 );
     2068      std::vector<Int> temp;
     2069      TComSlice::markCurrPic( pcPic );
    20602070#endif
    20612071    m_bFirst = false;
     
    20942104  //-- all
    20952105#if NH_MV
    2096   printf( "\n\nSUMMARY -------------------------------------------- LayerId %2d\n", getLayerId() );   
     2106  printf( "\n\nSUMMARY -------------------------------------------- LayerId %2d\n", getLayerId() );
    20972107#else
    20982108  printf( "\n\nSUMMARY --------------------------------------------------------\n" );
     
    24022412#if H_3D_VSO_SYNTH_DIST_OUT
    24032413}
    2404 #endif 
    2405 #endif 
     2414#endif
     2415#endif
    24062416  /* calculate the size of the access unit, excluding:
    24072417   *  - any AnnexB contributions (start_code_prefix, zero_byte, etc.,)
     
    25262536
    25272537#if  NH_MV
    2528   assert( 0 ); // Field coding and MV need to be aligned. 
     2538  assert( 0 ); // Field coding and MV need to be aligned.
    25292539#else
    25302540
     
    29692979#if NH_MV
    29702980Void TEncGOP::xSetRefPicListModificationsMv( std::vector<TComPic*> tempPicLists[2], TComSlice* pcSlice, UInt iGOPid )
    2971 { 
    2972  
     2981{
     2982
    29732983  if( pcSlice->getSliceType() == I_SLICE || !(pcSlice->getPPS()->getListsModificationPresentFlag()) || pcSlice->getNumActiveRefLayerPics() == 0 )
    29742984  {
    29752985    return;
    29762986  }
    2977  
     2987
    29782988  GOPEntry ge = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && ( pcSlice->getLayerId( ) > 0) ) ? MAX_GOP : iGOPid );
    2979   assert( ge.m_numActiveRefLayerPics == pcSlice->getNumActiveRefLayerPics() ); 
    2980 
    2981   Int numPicsInTempList     = pcSlice->getNumRpsCurrTempList(); 
    2982 
    2983   // GT: check if SliceType should be checked here. 
     2989  assert( ge.m_numActiveRefLayerPics == pcSlice->getNumActiveRefLayerPics() );
     2990
     2991  Int numPicsInTempList     = pcSlice->getNumRpsCurrTempList();
     2992
     2993  // GT: check if SliceType should be checked here.
    29842994  for (Int li = 0; li < 2; li ++) // Loop over lists L0 and L1
    29852995  {
    2986     Int numPicsInFinalRefList = pcSlice->getNumRefIdx( ( li == 0 ) ? REF_PIC_LIST_0 : REF_PIC_LIST_1 ); 
    2987            
     2996    Int numPicsInFinalRefList = pcSlice->getNumRefIdx( ( li == 0 ) ? REF_PIC_LIST_0 : REF_PIC_LIST_1 );
     2997
    29882998    Int finalIdxToTempIdxMap[16];
    29892999    for( Int k = 0; k < 16; k++ )
     
    29993009        // get position in temp. list
    30003010        Int refPicLayerId = pcSlice->getRefPicLayerId(k);
    3001         Int idxInTempList = 0; 
     3011        Int idxInTempList = 0;
    30023012        for (; idxInTempList < numPicsInTempList; idxInTempList++)
    30033013        {
    30043014          if ( (tempPicLists[li][idxInTempList])->getLayerId() == refPicLayerId )
    30053015          {
    3006             break; 
     3016            break;
    30073017          }
    30083018        }
    30093019
    30103020        Int idxInFinalList = ge.m_interViewRefPosL[ li ][ k ];
    3011        
    3012         // Add negative from behind 
    3013         idxInFinalList = ( idxInFinalList < 0 )? ( numPicsInTempList + idxInFinalList ) : idxInFinalList; 
    3014        
     3021
     3022        // Add negative from behind
     3023        idxInFinalList = ( idxInFinalList < 0 )? ( numPicsInTempList + idxInFinalList ) : idxInFinalList;
     3024
    30153025        Bool curIsModified = ( idxInFinalList != idxInTempList ) && ( ( idxInTempList < numPicsInFinalRefList ) || ( idxInFinalList < numPicsInFinalRefList ) ) ;
    30163026        if ( curIsModified )
    30173027        {
    3018           isModified = true; 
     3028          isModified = true;
    30193029          assert( finalIdxToTempIdxMap[ idxInFinalList ] == -1 ); // Assert when two inter layer reference pictures are sorted to the same position
    30203030        }
    3021         finalIdxToTempIdxMap[ idxInFinalList ] = idxInTempList;             
     3031        finalIdxToTempIdxMap[ idxInFinalList ] = idxInTempList;
    30223032      }
    30233033    }
    30243034
    30253035    TComRefPicListModification* refPicListModification = pcSlice->getRefPicListModification();
    3026     refPicListModification->setRefPicListModificationFlagL( li, isModified ); 
     3036    refPicListModification->setRefPicListModificationFlagL( li, isModified );
    30273037
    30283038    if( isModified )
    30293039    {
    30303040      Int refIdx = 0;
    3031      
     3041
    30323042      for( Int i = 0; i < numPicsInFinalRefList; i++ )
    30333043      {
    3034         if( finalIdxToTempIdxMap[i] >= 0 ) 
     3044        if( finalIdxToTempIdxMap[i] >= 0 )
    30353045        {
    30363046          refPicListModification->setRefPicSetIdxL( li, i, finalIdxToTempIdxMap[i] );
     
    30423052          while( ( refIdx < numPicsInTempList ) && ( tempPicLists[li][refIdx]->getLayerId() != getLayerId())  )
    30433053          {
    3044             refIdx++; 
     3054            refIdx++;
    30453055          }
    30463056          refPicListModification->setRefPicSetIdxL( li, i, refIdx );
Note: See TracChangeset for help on using the changeset viewer.