Changeset 773 in 3DVCSoftware for trunk/source/Lib/TLibEncoder/TEncCavlc.cpp


Ignore:
Timestamp:
16 Jan 2014, 09:56:13 (10 years ago)
Author:
tech
Message:

Merged branch/9.2-dev0@722.

File:
1 edited

Legend:

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

    r758 r773  
    176176  WRITE_FLAG( pcPPS->getSignHideFlag(), "sign_data_hiding_flag" );
    177177  WRITE_FLAG( pcPPS->getCabacInitPresentFlag() ? 1 : 0,   "cabac_init_present_flag" );
     178#if PPS_FIX_DEPTH
     179  if( pcPPS->getSPS()->getVPS()->getDepthId(pcPPS->getSPS()->getLayerId()) )
     180  {
     181    WRITE_UVLC( pcPPS->getNumRefIdxL0DefaultActive(),     "num_ref_idx_l0_default_active_minus1");
     182    WRITE_UVLC( pcPPS->getNumRefIdxL1DefaultActive(),     "num_ref_idx_l1_default_active_minus1");
     183  }
     184  else
     185  {
     186#endif
    178187  WRITE_UVLC( pcPPS->getNumRefIdxL0DefaultActive()-1,     "num_ref_idx_l0_default_active_minus1");
    179188  WRITE_UVLC( pcPPS->getNumRefIdxL1DefaultActive()-1,     "num_ref_idx_l1_default_active_minus1");
    180 
     189#if PPS_FIX_DEPTH
     190  }
     191#endif
    181192  WRITE_SVLC( pcPPS->getPicInitQPMinus26(),                  "init_qp_minus26");
    182193  WRITE_FLAG( pcPPS->getConstrainedIntraPred() ? 1 : 0,      "constrained_intra_pred_flag" );
     
    253264  }
    254265#endif
     266#if PPS_FIX_DEPTH
     267  if( pcPPS->getSPS()->getVPS()->getDepthId(pcPPS->getSPS()->getLayerId()) )
     268  {
     269    WRITE_FLAG( 1, "lists_modification_present_flag" );
     270  }
     271  else
     272#endif
    255273  WRITE_FLAG( pcPPS->getListsModificationPresentFlag(), "lists_modification_present_flag");
    256274  WRITE_UVLC( pcPPS->getLog2ParallelMergeLevelMinus2(), "log2_parallel_merge_level_minus2");
     275#if PPS_FIX_DEPTH
     276  if( pcPPS->getSPS()->getVPS()->getDepthId(pcPPS->getSPS()->getLayerId()) )
     277  {
     278    WRITE_FLAG( 1, "slice_segment_header_extension_present_flag" );
     279  }
     280  else
     281#endif
    257282  WRITE_FLAG( pcPPS->getSliceHeaderExtensionPresentFlag() ? 1 : 0, "slice_segment_header_extension_present_flag");
    258283
    259 #if !DLT_DIFF_CODING_IN_PPS
     284#if !H_3D
    260285  WRITE_FLAG( 0, "pps_extension_flag" );
    261286#else
     
    266291}
    267292
    268 #if DLT_DIFF_CODING_IN_PPS
     293#if H_3D
    269294Void  TEncCavlc::codePPSExtension        ( TComPPS* pcPPS )
    270295{
     
    275300  //   Step 1) decoding DLT tables based on the number of depth layers, and
    276301  //   Step 2) mapping DLT tables to the depth layers
    277   // as descripted in the 3D-HEVC WD.
     302  // as described in the 3D-HEVC WD.
    278303  TComVPS* pcVPS = pcPPS->getSPS()->getVPS();
    279304
     
    470495  }
    471496  WRITE_FLAG(pcVUI->getVideoSignalTypePresentFlag(),            "video_signal_type_present_flag");
    472 #if H_MV_6_PS_O0118_33
     497#if H_MV
    473498  assert( pcSPS->getLayerId() == 0 || !pcVUI->getVideoSignalTypePresentFlag() );
    474499#endif
     
    636661  {
    637662    WRITE_FLAG( pcSPS->getUpdateRepFormatFlag( ) ? 1 : 0 , "update_rep_format_flag" );
    638 #if H_MV_6_PS_REP_FORM_18_19_20   
    639663    if ( pcSPS->getUpdateRepFormatFlag() )
    640664    {
     
    644668  else
    645669  {
    646 #else
    647   }
    648 
    649   if ( pcSPS->getUpdateRepFormatFlag() )
    650   {
    651 #endif
    652670#endif
    653671  WRITE_UVLC( pcSPS->getChromaFormatIdc (),         "chroma_format_idc" );
     
    675693  }
    676694#if H_MV
    677 #if H_MV_6_PS_REP_FORM_18_19_20
    678695  if ( pcSPS->getLayerId() == 0 )
    679 #else
    680   if ( pcSPS->getUpdateRepFormatFlag() )
    681 #endif
    682696  {
    683697#endif
     
    784798  WRITE_FLAG( 0, "sps_extension_flag" );
    785799#else
    786 #if H_MV_6_PSEM_O0142_3
    787800  WRITE_FLAG( pcSPS->getSpsExtensionFlag(), "sps_extension_flag" );
    788801
     
    811824#endif
    812825  }
    813 #else
    814   WRITE_FLAG( 1, "sps_extension_flag" );
    815   codeSPSExtension( pcSPS );
    816 #if !H_3D
    817   WRITE_FLAG( 0, "sps_extension2_flag" );
    818 #else
    819   WRITE_FLAG( 1, "sps_extension2_flag" );
    820   codeSPSExtension2( pcSPS, viewIndex, depthFlag );
    821   WRITE_FLAG( 0, "sps_extension3_flag" );
    822 #endif 
    823 #endif
    824826#endif
    825827}
     
    830832  WRITE_FLAG( pcSPS->getInterViewMvVertConstraintFlag() ? 1 : 0, "inter_view_mv_vert_constraint_flag" );
    831833
    832 #if !H_MV_6_SHVC_O0098_36
    833   WRITE_UVLC( 0, "sps_shvc_reserved_zero_idc" );
    834 #else
    835834  WRITE_UVLC( pcSPS->getNumScaledRefLayerOffsets( ), "num_scaled_ref_layer_offsets" );
    836835
     
    846845    WRITE_SVLC( pcSPS->getScaledRefLayerBottomOffset( j ), "scaled_ref_layer_bottom_offset" );
    847846  }
    848 #endif 
    849847}
    850848#endif
     
    859857  WRITE_FLAG( pcSPS->getUseQTL() ? 1 : 0, "use_qtl_flag");
    860858  WRITE_FLAG( pcSPS->getUsePC()  ? 1 : 0, "use_pc_flag");
    861 }
    862 #endif
    863 #if !CAM_HLS_F0136_F0045_F0082
    864 if (!depthFlag )
    865 {
    866   WRITE_UVLC( pcSPS->getCamParPrecision(), "cp_precision" );
    867   WRITE_FLAG( pcSPS->hasCamParInSliceHeader() ? 1 : 0, "cp_in_slice_header_flag" );
    868   if( !pcSPS->hasCamParInSliceHeader() )
    869   {
    870     for( UInt uiIndex = 0; uiIndex < viewIndex; uiIndex++ )
    871     {
    872       WRITE_SVLC( pcSPS->getCodedScale    ()[ uiIndex ],                                      "cp_scale" );
    873       WRITE_SVLC( pcSPS->getCodedOffset   ()[ uiIndex ],                                      "cp_off" );
    874       WRITE_SVLC( pcSPS->getInvCodedScale ()[ uiIndex ] + pcSPS->getCodedScale ()[ uiIndex ], "cp_inv_scale_plus_scale" );
    875       WRITE_SVLC( pcSPS->getInvCodedOffset()[ uiIndex ] + pcSPS->getCodedOffset()[ uiIndex ], "cp_inv_off_plus_off" );
    876     }
    877   }
    878859}
    879860#endif
     
    995976{
    996977  WRITE_FLAG( pcVPS->getAvcBaseLayerFlag() ? 1 : 0,          "avc_base_layer_flag" );
    997 #if H_MV_6_PS_O0109_24
    998978  WRITE_FLAG( pcVPS->getVpsVuiPresentFlag() ? 1 : 0 , "vps_vui_present_flag" );
    999979  if ( pcVPS->getVpsVuiPresentFlag() )
    1000980  { 
    1001 #endif
    1002981  WRITE_CODE( pcVPS->getVpsVuiOffset( ), 16,                 "vps_vui_offset" );  // TBD
    1003 #if H_MV_6_PS_O0109_24
    1004   }
    1005 #endif
     982  }
    1006983  WRITE_FLAG( pcVPS->getSplittingFlag() ? 1 : 0,             "splitting_flag" );
    1007984 
     
    10501027
    10511028
    1052 #if H_MV_6_PS_O0109_22
    10531029    WRITE_CODE( pcVPS->getViewIdLen( ), 4, "view_id_len" );
    10541030   
     
    10671043      }
    10681044    }
    1069 #else
    1070   // GT spec says: trac #39
    1071   // if ( pcVPS->getNumViews() > 1 ) 
    1072   //   However, this is a bug in the text since, view_id_len_minus1 is needed to parse view_id_val.
    1073   {
    1074     WRITE_CODE( pcVPS->getViewIdLenMinus1( ), 4, "view_id_len_minus1" );
    1075   }
    1076 
    1077   for( Int i = 0; i < pcVPS->getNumViews(); i++ )
    1078   {
    1079     WRITE_CODE( pcVPS->getViewIdVal( i ), pcVPS->getViewIdLenMinus1( ) + 1, "view_id_val[i]" );
    1080   }
    1081 #endif
    10821045
    10831046
     
    10891052    }
    10901053  }
    1091 #if H_MV_6_ILDSD_O0120_26
    10921054  WRITE_FLAG( pcVPS->getVpsSubLayersMaxMinus1PresentFlag( ) ? 1 : 0 , "vps_sub_layers_max_minus1_present_flag" );
    10931055  if ( pcVPS->getVpsSubLayersMaxMinus1PresentFlag() )
     
    11061068    }
    11071069  }
    1108 #endif
    11091070  WRITE_FLAG( pcVPS->getMaxTidRefPresentFlag( ) ? 1 : 0 , "max_tid_ref_present_flag" );
    11101071
     
    11131074    for( Int i = 0; i < pcVPS->getMaxLayersMinus1(); i++ )
    11141075    {
    1115 #if H_MV_6_ILDDS_O0225_30
    11161076      for( Int j = i + 1; j <= pcVPS->getMaxLayersMinus1(); j++ )
    11171077      {
     
    11211081        }
    11221082      }
    1123 #else
    1124       WRITE_CODE( pcVPS->getMaxTidIlRefPicPlus1( i ), 3,       "max_tid_il_ref_pics_plus1[i]" );
    1125 #endif
    11261083    }
    11271084  }
     
    11371094    {   
    11381095      WRITE_CODE( pcVPS->getProfileRefMinus1( i ), 6, "profile_ref_minus1[i]" );
    1139 #if H_MV_6_PS_O0109_23
    11401096      pcVPS->checkProfileRefMinus1( i );     
    1141 #endif
    11421097    }
    11431098    codePTL( pcVPS->getPTL( i ), pcVPS->getVpsProfilePresentFlag( i ), pcVPS->getMaxTLayers() - 1 );
     
    11561111  if( numOutputLayerSets > 1)
    11571112  {
    1158 #if H_MV_6_PS_0109_25
    11591113    WRITE_CODE( pcVPS->getDefaultOneTargetOutputLayerIdc( ), 2, "default_one_target_output_layer_idc" );
    11601114    pcVPS->checkDefaultOneTargetOutputLayerIdc();
    1161 #else
    1162     WRITE_FLAG( pcVPS->getDefaultOneTargetOutputLayerFlag( ) ? 1 : 0, "default_one_target_output_layer_flag" );
    1163 #endif       
    11641115  } 
    11651116
    1166 #if H_MV_6_HRD_O0217_13
    11671117  assert( pcVPS->getOutputLayerFlag(0, 0) == pcVPS->inferOutputLayerFlag( 0, 0 ));
    11681118  assert( pcVPS->getOutputLayerSetIdxMinus1( 0 ) == -1 );
    1169 #endif
    11701119  for( Int i = 1; i < numOutputLayerSets; i++ )
    11711120  {
     
    11781127      }     
    11791128    }
    1180 #if H_MV_6_HRD_O0217_13
    11811129    else
    11821130    { // These inference rules would also be helpful in spec text
     
    11871135      }
    11881136    }
    1189 #endif
    11901137
    11911138    if ( pcVPS->getProfileLevelTierIdxLen()  > 0 )
     
    11951142  }
    11961143
    1197 #if H_MV_6_GEN_0153_28
    11981144  if( pcVPS->getMaxLayersMinus1() > 0 )
    11991145  {
    12001146    WRITE_FLAG( pcVPS->getAltOutputLayerFlag( ) ? 1 : 0 , "alt_output_layer_flag" );
    12011147  }
    1202 #endif
    12031148
    12041149  WRITE_FLAG( pcVPS->getRepFormatIdxPresentFlag( ) ? 1 : 0 , "rep_format_idx_present_flag" );
     
    12101155  for (Int i = 0; i <= pcVPS->getVpsNumRepFormatsMinus1(); i++ )
    12111156  {   
    1212 #if H_MV_6_PS_REP_FORM_18_19_20
    12131157    TComRepFormat* curRepFormat = pcVPS->getRepFormat(i);     
    12141158    TComRepFormat* prevRepFormat = i > 0 ? pcVPS->getRepFormat( i - 1) : NULL;
    12151159    codeRepFormat( i, curRepFormat ,  prevRepFormat);
    1216 #else
    1217     TComRepFormat* pcRepFormat = pcVPS->getRepFormat(i);     
    1218     codeRepFormat( pcRepFormat );
    1219 #endif
    12201160  }
    12211161
     
    12261166      if( pcVPS->getVpsNumRepFormatsMinus1() > 0 )
    12271167      {
    1228 #if H_MV_6_PS_REP_FORM_18_19_20
    12291168        WRITE_CODE( pcVPS->getVpsRepFormatIdx( i ), 8, "vps_rep_format_idx" );
    1230 #else
    1231         WRITE_CODE( pcVPS->getVpsRepFormatIdx( i ), 4, "vps_rep_format_idx" );
    1232 #endif
    12331169      }
    12341170    }
     
    12361172
    12371173  WRITE_FLAG( pcVPS->getMaxOneActiveRefLayerFlag( ) ? 1 : 0, "max_one_active_ref_layer_flag" );
    1238 #if H_MV_6_MISC_O0062_31
    12391174  for( Int i = 1; i  <=  pcVPS->getMaxLayersMinus1(); i++ )
    12401175  {
     
    12441179    }
    12451180  }
    1246 #endif
    1247 #if H_MV_6_HRD_O0217_13
    12481181  codeDpbSize( pcVPS );
    1249 #endif
    1250 
    1251 #if !H_MV_6_PS_O0223_29
    1252   WRITE_FLAG( pcVPS->getCrossLayerIrapAlignedFlag( ) ? 1 : 0 , "cross_layer_irap_aligned_flag" );
    1253 #endif
     1182
    12541183  WRITE_UVLC( pcVPS->getDirectDepTypeLenMinus2 ( ),         "direct_dep_type_len_minus2");
    12551184
    1256 #if H_MV_6_PS_O0096_21
    12571185  WRITE_FLAG( pcVPS->getDefaultDirectDependencyFlag( ) ? 1 : 0 , "default_direct_dependency_flag" );
    12581186
     
    12801208    }
    12811209  } 
    1282 #else
    1283     for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ )
    1284     {
    1285       for( Int j = 0; j < i; j++ )
    1286       {
    1287         if (pcVPS->getDirectDependencyFlag( i, j) )
    1288         {       
    1289           assert ( pcVPS->getDirectDependencyType( i, j ) != -1 );
    1290           WRITE_CODE( pcVPS->getDirectDependencyType( i, j ),pcVPS->getDirectDepTypeLenMinus2( ) + 2,  "direct_dependency_type[i][j]" );
    1291         }
    1292       }
    1293     }
    1294 #endif
    12951210    WRITE_FLAG ( 0,                                      "vps_shvc_reserved_zero_flag" );
    1296 #if !H_MV_6_PS_O0109_24
    1297     WRITE_FLAG( pcVPS->getVpsVuiPresentFlag( ) ? 1 : 0 , "vps_vui_present_flag" );
    1298 #endif
    12991211
    13001212    if( pcVPS->getVpsVuiPresentFlag() )
     
    13041216    }     
    13051217}
    1306 #if H_MV_6_PS_O0118_33
    13071218Void TEncCavlc::codeVideoSignalInfo( TComVideoSignalInfo* pcVideoSignalInfo )
    13081219{
     
    13141225  WRITE_CODE( pcVideoSignalInfo->getMatrixCoeffsVps( ), 8, "matrix_coeffs_vps" );
    13151226}
    1316 #endif
    1317 
    1318 #if H_MV_6_HRD_O0217_13
     1227
    13191228Void TEncCavlc::codeDpbSize( TComVPS* vps )
    13201229{
     
    13561265  } 
    13571266}
    1358 #endif
    1359 
    1360 #if H_MV_6_PS_REP_FORM_18_19_20
     1267
    13611268Void TEncCavlc::codeRepFormat( Int i, TComRepFormat* pcRepFormat, TComRepFormat* pcPrevRepFormat )
    1362 #else
    1363 Void TEncCavlc::codeRepFormat( TComRepFormat* pcRepFormat )
    1364 #endif
    13651269{
    13661270  assert( pcRepFormat );
    13671271
    1368 #if H_MV_6_PS_REP_FORM_18_19_20
    13691272  WRITE_CODE( pcRepFormat->getPicWidthVpsInLumaSamples( ),  16, "pic_width_vps_in_luma_samples" );
    13701273  WRITE_CODE( pcRepFormat->getPicHeightVpsInLumaSamples( ), 16, "pic_height_vps_in_luma_samples" );
     
    13751278  if ( pcRepFormat->getChromaAndBitDepthVpsPresentFlag() )
    13761279  { 
    1377 #endif
    13781280  WRITE_CODE( pcRepFormat->getChromaFormatVpsIdc( ), 2, "chroma_format_vps_idc" );
    13791281
     
    13821284    WRITE_FLAG( pcRepFormat->getSeparateColourPlaneVpsFlag( ) ? 1 : 0 , "separate_colour_plane_vps_flag" );
    13831285  }
    1384 #if !H_MV_6_PS_REP_FORM_18_19_20
    1385   WRITE_CODE( pcRepFormat->getPicWidthVpsInLumaSamples( ),  16, "pic_width_vps_in_luma_samples" );
    1386   WRITE_CODE( pcRepFormat->getPicHeightVpsInLumaSamples( ), 16, "pic_height_vps_in_luma_samples" );
    1387 #endif
    13881286  WRITE_CODE( pcRepFormat->getBitDepthVpsLumaMinus8( ),      4, "bit_depth_vps_luma_minus8" );
    13891287  WRITE_CODE( pcRepFormat->getBitDepthVpsChromaMinus8( ),    4, "bit_depth_vps_chroma_minus8" );
    1390 #if H_MV_6_PS_REP_FORM_18_19_20
    13911288  }
    13921289  else
     
    13941291    pcRepFormat->inferChromaAndBitDepth(pcPrevRepFormat, true );
    13951292  }
    1396 #endif
    13971293}
    13981294
     
    14051301  assert( pcVPSVUI );
    14061302
    1407 #if H_MV_6_PS_O0223_29
    14081303  WRITE_FLAG( pcVPSVUI->getCrossLayerPicTypeAlignedFlag( ) ? 1 : 0 , "cross_layer_pic_type_aligned_flag" );
    14091304  if ( !pcVPSVUI->getCrossLayerPicTypeAlignedFlag() )
     
    14111306    WRITE_FLAG( pcVPSVUI->getCrossLayerIrapAlignedFlag( ) ? 1 : 0 , "cross_layer_irap_aligned_flag" );
    14121307  }
    1413 #endif
    14141308
    14151309  WRITE_FLAG( pcVPSVUI->getBitRatePresentVpsFlag( ) ? 1 : 0 , "bit_rate_present_vps_flag" );
     
    14431337  }
    14441338
    1445 #if H_MV_6_O0226_37
    14461339  WRITE_FLAG( pcVPSVUI->getTilesNotInUseFlag( ) ? 1 : 0 , "tiles_not_in_use_flag" );
    14471340  if( !pcVPSVUI->getTilesNotInUseFlag() )
     
    14781371    }
    14791372  }
    1480 #else
    1481   for( Int i = 1; i  <=  pcVPS->getMaxLayersMinus1(); i++ )
    1482   {
    1483     for( Int  j = 0; j < pcVPS->getNumDirectRefLayers( pcVPS->getLayerIdInNuh( i ) ); j++ )
    1484     {
    1485       WRITE_FLAG( pcVPSVUI->getTileBoundariesAlignedFlag( i, j ) ? 1 : 0 , "tile_boundaries_aligned_flag" );
    1486     }
    1487   }
    1488 #endif
    14891373  WRITE_FLAG( pcVPSVUI->getIlpRestrictedRefLayersFlag( ) ? 1 : 0 , "ilp_restricted_ref_layers_flag" );
    14901374
     
    15071391    }
    15081392  }
    1509 #if H_MV_6_PS_O0118_33
    15101393  WRITE_FLAG( pcVPSVUI->getVideoSignalInfoIdxPresentFlag( ) ? 1 : 0 , "video_signal_info_idx_present_flag" );
    15111394  if( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() )
     
    15401423    }
    15411424  }
    1542 #endif
    1543 #if H_MV_6_HRD_O0164_15
    15441425  WRITE_FLAG( pcVPSVUI->getVpsVuiBspHrdPresentFlag( ) ? 1 : 0 , "vps_vui_bsp_hrd_present_flag" );
    15451426  if ( pcVPSVUI->getVpsVuiBspHrdPresentFlag( ) )
     
    15471428    codeVpsVuiBspHrdParameters( pcVPS );
    15481429  }
    1549 #endif
    1550 }
    1551 #if H_MV_6_HRD_O0164_15
     1430}
    15521431Void TEncCavlc::codeVpsVuiBspHrdParameters( TComVPS* pcVPS )
    15531432{
     
    16061485  } 
    16071486
    1608 #endif
    16091487
    16101488#endif
     
    16211499#if H_3D_IV_MERGE
    16221500        WRITE_FLAG( pcVPS->getIvMvPredFlag         ( i ) ? 1 : 0 , "iv_mv_pred_flag[i]");
    1623 #if MTK_SPIVMP_F0110
     1501#if H_3D_SPIVMP
    16241502        WRITE_UVLC( pcVPS->getSubPULog2Size(i)-2, "log2_sub_PU_size_minus2[i]");
    16251503#endif
     
    16371515      else
    16381516      {
    1639 #if QC_DEPTH_IV_MRG_F0125
    16401517        if(i!=1)
    16411518        {
    16421519          WRITE_FLAG( pcVPS->getIvMvPredFlag         ( i ) ? 1 : 0 , "iv_mv_pred_flag[i]");
    16431520        }
    1644 #endif
    1645 #if MTK_SPIVMP_F0110
     1521#if H_3D_SPIVMP
    16461522        if (i!=1)
    16471523        {
     
    16491525        }
    16501526#endif
    1651 #if SEC_MPI_ENABLING_MERGE_F0150
     1527#if H_3D_IV_MERGE
    16521528        WRITE_FLAG( pcVPS->getMPIFlag( i ) ? 1 : 0 ,          "mpi_flag[i]" );
    16531529#endif
    16541530        WRITE_FLAG( pcVPS->getVpsDepthModesFlag( i ) ? 1 : 0 ,          "vps_depth_modes_flag[i]" );
    16551531        //WRITE_FLAG( pcVPS->getLimQtPredFlag    ( i ) ? 1 : 0 ,          "lim_qt_pred_flag[i]"     );
    1656 #if H_3D_DIM_DLT
    1657 #if !DLT_DIFF_CODING_IN_PPS
    1658         if( pcVPS->getVpsDepthModesFlag( i ) )
    1659         {
    1660           WRITE_FLAG( pcVPS->getUseDLTFlag( i ) ? 1 : 0, "dlt_flag[i]" );
    1661         }
    1662         if( pcVPS->getUseDLTFlag( i ) )
    1663         {
    1664           // code mapping
    1665           WRITE_UVLC(pcVPS->getNumDepthValues(i), "num_depth_values_in_dlt[i]");
    1666           for(Int d=0; d<pcVPS->getNumDepthValues(i); d++)
    1667           {
    1668             WRITE_UVLC( pcVPS->idx2DepthValue(i, d), "dlt_depth_value[i][d]" );
    1669           }
    1670         }
    1671 #endif
    1672 #endif
    16731532#if H_3D_INTER_SDC
    16741533        WRITE_FLAG( pcVPS->getInterSDCFlag( i ) ? 1 : 0, "depth_inter_SDC_flag" );
     
    16771536    } 
    16781537  }
    1679 #if CAM_HLS_F0136_F0045_F0082
    16801538  WRITE_UVLC( pcVPS->getCamParPrecision(), "cp_precision" );
    16811539  for (UInt viewIndex=0; viewIndex<pcVPS->getNumViews(); viewIndex++)
     
    16971555    }
    16981556  }
    1699 #endif
    17001557#if H_3D_TMVP
    17011558  WRITE_FLAG( pcVPS->getIvMvScalingFlag( ) ? 1 : 0 ,          "iv_mv_scaling_flag" );
     
    17391596    WRITE_FLAG( 0, "no_output_of_prior_pics_flag" );
    17401597  }
     1598#if PPS_FIX_DEPTH
     1599  if( pcSlice->getIsDepth() )
     1600  {
     1601    WRITE_UVLC( 1, "slice_pic_parameter_set_id" );
     1602  }
     1603  else
     1604#endif
    17411605  WRITE_UVLC( pcSlice->getPPS()->getPPSId(), "slice_pic_parameter_set_id" );
    17421606  pcSlice->setDependentSliceSegmentFlag(!pcSlice->isNextSlice());
     
    17531617#if H_MV   
    17541618    Int esb = 0;  //Don't use i, otherwise will shadow something below
    1755 #if !H_MV_6_RALS_O0149_11
     1619
     1620    if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb )
     1621    {
     1622      esb++;
     1623      WRITE_FLAG( pcSlice->getDiscardableFlag( ) ? 1 : 0 , "discardable_flag" );
     1624    }
     1625
     1626    if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb )
     1627    {
     1628      esb++;
     1629      WRITE_FLAG( pcSlice->getCrossLayerBlaFlag( ) ? 1 : 0 , "cross_layer_bla_flag" );
     1630    }
     1631    pcSlice->checkCrossLayerBlaFlag( );
     1632
    17561633    if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb )
    17571634    {
     
    17591636      WRITE_FLAG( pcSlice->getPocResetFlag( ) ? 1 : 0 , "poc_reset_flag" );
    17601637    }
    1761 #endif
    1762 
    1763     if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb )
    1764     {
    1765       esb++;
    1766       WRITE_FLAG( pcSlice->getDiscardableFlag( ) ? 1 : 0 , "discardable_flag" );
    1767     }
    1768 
    1769 #if H_MV_6_RALS_O0149_11
    1770     if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb )
    1771     {
    1772       esb++;
    1773       WRITE_FLAG( pcSlice->getCrossLayerBlaFlag( ) ? 1 : 0 , "cross_layer_bla_flag" );
    1774     }
    1775     pcSlice->checkCrossLayerBlaFlag( );
    1776 
    1777     if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb )
    1778     {
    1779       esb++;
    1780       WRITE_FLAG( pcSlice->getPocResetFlag( ) ? 1 : 0 , "poc_reset_flag" );
    1781     }
    1782 #endif
    17831638
    17841639
     
    18041659    // if( separate_colour_plane_flag  ==  1 )
    18051660    //   colour_plane_id                                      u(2)
    1806 
    1807 #if H_MV_6_POC_31_35_38
     1661#if H_MV
    18081662    if ( (pcSlice->getLayerId() > 0 && !vps->getPocLsbNotPresentFlag( pcSlice->getLayerIdInVps())) || !pcSlice->getIdrPicFlag() )
    18091663    {
     
    18141668    if( !pcSlice->getIdrPicFlag() )
    18151669    {
    1816 #if !H_MV_6_POC_31_35_38
     1670#if !H_MV
    18171671      Int picOrderCntLSB = (pcSlice->getPOC()-pcSlice->getLastIDR()+(1<<pcSlice->getSPS()->getBitsForPOC())) & ((1<<pcSlice->getSPS()->getBitsForPOC())-1);
    18181672      WRITE_CODE( picOrderCntLSB, pcSlice->getSPS()->getBitsForPOC(), "pic_order_cnt_lsb");
     
    19311785    }
    19321786#if H_MV
    1933 #if H_MV_6_ILDDS_ILREFPICS_27_34
    19341787    Bool interLayerPredLayerIdcPresentFlag = false;
    1935 #endif
    19361788    Int layerId = pcSlice->getLayerId();
    19371789    if( pcSlice->getLayerId() > 0 && !vps->getAllRefLayersActiveFlag() && vps->getNumDirectRefLayers( layerId ) > 0 )
     
    19461798        if ( pcSlice->getNumActiveRefLayerPics() != vps->getNumDirectRefLayers( layerId ) )
    19471799        {       
    1948 #if H_MV_6_ILDDS_ILREFPICS_27_34
    19491800          interLayerPredLayerIdcPresentFlag = true;
    1950 #endif
    19511801          for( Int idx = 0; idx < pcSlice->getNumActiveRefLayerPics(); idx++ )   
    19521802          {
     
    19561806      } 
    19571807    }
    1958 #if H_MV_6_ILDDS_ILREFPICS_27_34
    19591808    if ( !interLayerPredLayerIdcPresentFlag )
    19601809    {
     
    19641813      }
    19651814    }
    1966 #endif
    19671815#endif
    19681816    if(pcSlice->getSPS()->getUseSAO())
     
    19831831    {
    19841832      Bool overrideFlag = (pcSlice->getNumRefIdx( REF_PIC_LIST_0 )!=pcSlice->getPPS()->getNumRefIdxL0DefaultActive()||(pcSlice->isInterB()&&pcSlice->getNumRefIdx( REF_PIC_LIST_1 )!=pcSlice->getPPS()->getNumRefIdxL1DefaultActive()));
     1833#if PPS_FIX_DEPTH
     1834      overrideFlag |= (pcSlice->getIsDepth() && !pcSlice->getViewIndex());
     1835#endif
    19851836      WRITE_FLAG( overrideFlag ? 1 : 0,                               "num_ref_idx_active_override_flag");
    19861837      if (overrideFlag)
     
    20021853      pcSlice->setNumRefIdx(REF_PIC_LIST_1, 0);
    20031854    }
    2004 
     1855#if PPS_FIX_DEPTH
     1856    if( (pcSlice->getPPS()->getListsModificationPresentFlag() || (pcSlice->getIsDepth() && !pcSlice->getViewIndex())) && pcSlice->getNumRpsCurrTempList() > 1)
     1857#else
    20051858    if( pcSlice->getPPS()->getListsModificationPresentFlag() && pcSlice->getNumRpsCurrTempList() > 1)
     1859#endif
    20061860    {
    20071861      TComRefPicListModification* refPicListModification = pcSlice->getRefPicListModification();
     
    20861940    }
    20871941#if H_3D_IC
    2088 #if SEC_ONLY_TEXTURE_IC_F0151
    20891942    else if( pcSlice->getViewIndex() && ( pcSlice->getSliceType() == P_SLICE || pcSlice->getSliceType() == B_SLICE ) && !pcSlice->getIsDepth())
    2090 #else
    2091     else if( pcSlice->getViewIndex() && ( pcSlice->getSliceType() == P_SLICE || pcSlice->getSliceType() == B_SLICE ) )
    2092 #endif
    20931943    {
    20941944      WRITE_FLAG( pcSlice->getApplyIC() ? 1 : 0, "slice_ic_enable_flag" );
     
    21081958    {
    21091959#if H_3D_IV_MERGE
    2110 #if SEC_MPI_ENABLING_MERGE_F0150
    21111960      if(pcSlice->getIsDepth())
    21121961      {
     
    21201969        WRITE_UVLC( ( ivMvPredFlag ? MRG_MAX_NUM_CANDS_MEM : MRG_MAX_NUM_CANDS ) - pcSlice->getMaxNumMergeCand(), "five_minus_max_num_merge_cand");
    21211970      }
    2122 #else
    2123       Bool ivMvPredFlag = pcSlice->getVPS()->getIvMvPredFlag( pcSlice->getLayerIdInVps() ) ;
    2124       WRITE_UVLC( ( ivMvPredFlag ? MRG_MAX_NUM_CANDS_MEM : MRG_MAX_NUM_CANDS ) - pcSlice->getMaxNumMergeCand(), "five_minus_max_num_merge_cand");
    2125 #endif
    21261971#else
    21271972      WRITE_UVLC(MRG_MAX_NUM_CANDS - pcSlice->getMaxNumMergeCand(), "five_minus_max_num_merge_cand");
     
    21622007    }
    21632008  }
    2164 #if CAM_HLS_F0044
    2165 #if QC_DEPTH_IV_MRG_F0125
    2166 #if CAM_HLS_F0136_F0045_F0082
     2009#if H_3D
    21672010  if( pcSlice->getVPS()->hasCamParInSliceHeader( pcSlice->getViewIndex() ) && !pcSlice->getIsDepth() )
    2168 #else
    2169   if( pcSlice->getSPS()->hasCamParInSliceHeader() && !pcSlice->getIsDepth() )
    2170 #endif
    2171 #else
    2172   if( pcSlice->getSPS()->hasCamParInSliceHeader() )
    2173 #endif
    21742011  {
    21752012    for( UInt uiId = 0; uiId < pcSlice->getViewIndex(); uiId++ )
     
    21832020#endif
    21842021
     2022#if PPS_FIX_DEPTH
     2023  if(pcSlice->getPPS()->getSliceHeaderExtensionPresentFlag() || pcSlice->getIsDepth() )
     2024#else
    21852025  if(pcSlice->getPPS()->getSliceHeaderExtensionPresentFlag())
    2186   {
    2187 #if !H_3D || CAM_HLS_F0044
     2026#endif
     2027  {
    21882028    WRITE_UVLC(0,"slice_header_extension_length");
    2189 #else
    2190     WRITE_UVLC(0,"slice_header_extension_length"); //<- this element needs to be set to the correct value!!
    2191 #if QC_DEPTH_IV_MRG_F0125
    2192 #if CAM_HLS_F0136_F0045_F0082
    2193     if( pcSlice->getVPS()->hasCamParInSliceHeader( pcSlice->getViewIndex() ) && !pcSlice->getIsDepth() )
    2194 #else
    2195     if( pcSlice->getSPS()->hasCamParInSliceHeader() && !pcSlice->getIsDepth() )
    2196 #endif
    2197 #else
    2198     if( pcSlice->getSPS()->hasCamParInSliceHeader() )
    2199 #endif
    2200     {
    2201       for( UInt uiId = 0; uiId < pcSlice->getViewIndex(); uiId++ )
    2202       {
    2203         WRITE_SVLC( pcSlice->getCodedScale    ()[ uiId ],                                     "cp_scale" );
    2204         WRITE_SVLC( pcSlice->getCodedOffset   ()[ uiId ],                                     "cp_off" );
    2205         WRITE_SVLC( pcSlice->getInvCodedScale ()[ uiId ] + pcSlice->getCodedScale ()[ uiId ], "cp_inv_scale_plus_scale" );
    2206         WRITE_SVLC( pcSlice->getInvCodedOffset()[ uiId ] + pcSlice->getCodedOffset()[ uiId ], "cp_inv_off_plus_off" );
    2207       }
    2208     }
    2209 
    2210     Bool sliceSegmentHeaderExtension2Flag = false;
    2211     WRITE_FLAG( sliceSegmentHeaderExtension2Flag ? 1 : 0 , "slice_segment_header_extension2_flag" );
    2212     if ( sliceSegmentHeaderExtension2Flag )
    2213     {
    2214       WRITE_UVLC(0,"slice_header_extension2_length");
    2215     }
    2216 #endif
    22172029  }
    22182030}
Note: See TracChangeset for help on using the changeset viewer.