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


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

Merged branch/9.2-dev0@722.

Location:
trunk/source/Lib/TLibEncoder
Files:
12 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}
  • trunk/source/Lib/TLibEncoder/TEncCavlc.h

    r758 r773  
    8686#if H_MV
    8787  Void  codeVPSExtension       ( TComVPS *pcVPS );
    88 #if H_MV_6_PS_O0118_33
    8988  Void  codeVideoSignalInfo     ( TComVideoSignalInfo* pcVideoSignalInfo );
    90 #endif
    9189
    92 #if H_MV_6_HRD_O0217_13
    9390  Void  codeDpbSize   ( TComVPS* vps );
    94 #endif
    9591
    96 #if H_MV_6_PS_REP_FORM_18_19_20
    9792  Void  codeRepFormat           ( Int i, TComRepFormat* curRepFormat, TComRepFormat* prevRepFormat );
    98 #else
    99   Void  codeRepFormat          ( TComRepFormat* pcRepFormat );
    100 #endif
    10193  Void  codeVPSVUI             ( TComVPS* pcVPS );
    102 #if H_MV_6_HRD_O0164_15
    10394  Void  codeVpsVuiBspHrdParameters( TComVPS* pcVPS );
    104 #endif
    10595#endif
    10696  Void  codeVUI                 ( TComVUI *pcVUI, TComSPS* pcSPS );
     
    117107  Void  codePPS                 ( TComPPS* pcPPS );
    118108
    119 #if DLT_DIFF_CODING_IN_PPS
     109#if H_3D
    120110  Void  codePPSExtension        ( TComPPS* pcPPS );
    121111#endif
  • trunk/source/Lib/TLibEncoder/TEncCfg.h

    r758 r773  
    331331#endif
    332332
    333 #if DLT_DIFF_CODING_IN_PPS
     333#if H_3D
    334334  TComDLT*  m_cDLT;
    335335#endif
     
    408408  UInt      m_uiARPStepNum;
    409409#endif
    410 #if MTK_SPIVMP_F0110
     410#if H_3D_SPIVMP
    411411  Int      m_iSubPULog2Size;
    412412#endif
     
    420420#if H_3D_DIM
    421421  Bool      m_useDMM;
    422 #if !SEC_DMM3_RBC_F0147
    423   Bool      m_useRBC;
    424 #endif
    425422  Bool      m_useSDC;
    426423  Bool      m_useDLT;
    427424#endif
    428 #if SEC_MPI_ENABLING_MERGE_F0150
     425#if H_3D_IV_MERGE
    429426  Bool      m_useMPI;
    430427#endif
     
    514511  Void       setARPStepNum                  ( UInt  u )      { m_uiARPStepNum = u;       }
    515512#endif
    516 #if MTK_SPIVMP_F0110
     513#if H_3D_SPIVMP
    517514  Int        getSubPULog2Size                   ()                   { return m_iSubPULog2Size;}
    518515  Void       setSubPULog2Size                   (Int u)              { m_iSubPULog2Size = u; }     
     
    873870#endif
    874871
    875 #if DLT_DIFF_CODING_IN_PPS
     872#if H_3D
    876873  Void      setDLT           ( TComDLT *p ) { m_cDLT = p; }
    877874  TComDLT*  getDLT           ()             { return m_cDLT; }
     
    10031000  Bool      getUseDMM                       ()        { return m_useDMM; }
    10041001  Void      setUseDMM                       ( Bool b) { m_useDMM = b;    }
    1005 #if !SEC_DMM3_RBC_F0147
    1006   Bool      getUseRBC                       ()        { return m_useRBC; }
    1007   Void      setUseRBC                       ( Bool b) { m_useRBC = b;    }
    1008 #endif
    10091002  Bool      getUseSDC                       ()        { return m_useSDC; }
    10101003  Void      setUseSDC                       ( Bool b) { m_useSDC = b;    }
     
    10181011  Bool      getUsePC                        ()         { return m_bUsePC;  }
    10191012#endif
    1020 #if SEC_MPI_ENABLING_MERGE_F0150
     1013#if H_3D_IV_MERGE
    10211014  Void      setUseMPI                       ( Bool b ) { m_useMPI = b;    }
    10221015  Bool      getUseMPI                       ()         { return m_useMPI; }
  • trunk/source/Lib/TLibEncoder/TEncCu.cpp

    r735 r773  
    497497#endif
    498498#if H_3D_IC
    499 #if SEC_ONLY_TEXTURE_IC_F0151
    500499  Bool bICEnabled = rpcTempCU->getSlice()->getViewIndex() && ( rpcTempCU->getSlice()->getSliceType() == P_SLICE || rpcTempCU->getSlice()->getSliceType() == B_SLICE ) && !rpcTempCU->getSlice()->getIsDepth();
    501 #else
    502   Bool bICEnabled = rpcTempCU->getSlice()->getViewIndex() && ( rpcTempCU->getSlice()->getSliceType() == P_SLICE || rpcTempCU->getSlice()->getSliceType() == B_SLICE );
    503 #endif
    504500  bICEnabled = bICEnabled && rpcTempCU->getSlice()->getApplyIC();
    505501#endif
     
    571567          PartSize ePartTemp = rpcTempCU->getPartitionSize(0);
    572568          rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth );     
    573 #if QC_DEPTH_IV_MRG_F0125
     569#if H_3D_IV_MERGE
    574570          if (rpcTempCU->getSlice()->getIsDepth() )
    575571          {
     
    586582            DvInfo.bDV = rpcTempCU->getDisMvpCandNBDV(&DvInfo);
    587583
    588 #if QC_DEPTH_IV_MRG_F0125
     584#if H_3D_IV_MERGE
    589585          }
    590586#endif
     
    17791775#endif
    17801776
    1781 #if H_3D_ARP && LGE_SHARP_VSP_INHERIT_F0104
     1777#if H_3D_ARP
    17821778  DisInfo cOrigDisInfo = rpcTempCU->getDvInfo(0);
    17831779#else
     
    17871783
    17881784#if H_3D_VSP
    1789 #if !(H_3D_ARP && LGE_SHARP_VSP_INHERIT_F0104)
     1785#if !H_3D_ARP
    17901786  Int vspFlag[MRG_MAX_NUM_CANDS_MEM];
    17911787  memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
    17921788  InheritedVSPDisInfo inheritedVSPDisInfo[MRG_MAX_NUM_CANDS_MEM];
    1793 #if ETRIKHU_MERGE_REUSE_F0093
    17941789  rpcTempCU->m_bAvailableFlagA1 = 0;
    17951790  rpcTempCU->m_bAvailableFlagB1 = 0;
     
    17991794  rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );
    18001795  rpcTempCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag,inheritedVSPDisInfo, numValidMergeCand );
    1801 #else
    1802   rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, numValidMergeCand );
    1803 #endif
    1804 #endif
    1805 #else
    1806 #if ETRIKHU_MERGE_REUSE_F0093
     1796#endif
     1797#else
     1798#if H_3D
    18071799  rpcTempCU->m_bAvailableFlagA1 = 0;
    18081800  rpcTempCU->m_bAvailableFlagB1 = 0;
     
    18221814  Int mergeCandBuffer[MRG_MAX_NUM_CANDS];
    18231815#endif
    1824 #if H_3D_ARP && LGE_SHARP_VSP_INHERIT_F0104
     1816#if H_3D_ARP
    18251817for( UInt ui = 0; ui < rpcTempCU->getSlice()->getMaxNumMergeCand(); ++ui )
    18261818#else
     
    18511843  for( Int nARPW=nARPWMax; nARPW >= 0 ; nARPW-- )
    18521844  {
    1853 #if FIX_MISSING_MACRO_R690
    18541845    memset( mergeCandBuffer, 0, MRG_MAX_NUM_CANDS_MEM*sizeof(Int) );
    1855 #else
    1856     memset( mergeCandBuffer, 0, MRG_MAX_NUM_CANDS*sizeof(Int) );
    1857 #endif
    1858 #if LGE_SHARP_VSP_INHERIT_F0104
    18591846    rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uhDepth ); // interprets depth relative to LCU level
    18601847    rpcTempCU->setCUTransquantBypassSubParts( m_pcEncCfg->getCUTransquantBypassFlagValue(), 0, uhDepth );
     
    18681855    memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
    18691856    InheritedVSPDisInfo inheritedVSPDisInfo[MRG_MAX_NUM_CANDS_MEM];
    1870 #if MTK_SPIVMP_F0110
     1857#if H_3D_SPIVMP
    18711858    Bool bSPIVMPFlag[MRG_MAX_NUM_CANDS_MEM];
    18721859    memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM);
     
    18761863    puhInterDirSP = new UChar[rpcTempCU->getPic()->getPicSym()->getNumPartition()];
    18771864#endif
    1878 #if ETRIKHU_MERGE_REUSE_F0093
     1865#if H_3D
    18791866    rpcTempCU->initAvailableFlags();
    18801867    rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );
    18811868    rpcTempCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag,inheritedVSPDisInfo
    1882 #if MTK_SPIVMP_F0110
     1869#if H_3D_SPIVMP
    18831870      , bSPIVMPFlag, pcMvFieldSP, puhInterDirSP
    18841871#endif
     
    18881875    rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, numValidMergeCand );
    18891876#endif
    1890 #endif
     1877
    18911878#endif
    18921879  for( UInt uiNoResidual = 0; uiNoResidual < iteration; ++uiNoResidual )
     
    19231910          rpcTempCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeCand].m_acDvInfo, 0, 0, uhDepth );
    19241911#endif
    1925 #if MTK_SPIVMP_F0110
     1912#if H_3D_SPIVMP
    19261913          rpcTempCU->setSPIVMPFlagSubParts(bSPIVMPFlag[uiMergeCand], 0, 0, uhDepth);
    19271914          if (bSPIVMPFlag[uiMergeCand])
     
    19491936            rpcTempCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level
    19501937            rpcTempCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level
    1951 #if MTK_SPIVMP_F0110
    1952           }
    1953 #endif
    1954 #if H_3D_ARP && !QC_MTK_INTERVIEW_ARP_F0123_F0108
    1955           if( nARPW )
    1956           {
    1957             Bool bSignalflag[2] = { true, true };
    1958             for( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx ++ )
    1959             {
    1960               Int iRefIdx = cMvFieldNeighbours[uiRefListIdx + 2*uiMergeCand].getRefIdx();
    1961               RefPicList eRefList = uiRefListIdx ? REF_PIC_LIST_1 : REF_PIC_LIST_0;
    1962               if( iRefIdx < 0 || rpcTempCU->getSlice()->getPOC() == rpcTempCU->getSlice()->getRefPOC(eRefList, iRefIdx) )
    1963               {
    1964                 bSignalflag[uiRefListIdx] = false;
    1965               }
    1966             }
    1967             if( !bSignalflag[0] && !bSignalflag[1] )
    1968             {
    1969 #if LGE_SHARP_VSP_INHERIT_F0104
    1970               continue;
    1971 #else
    1972               rpcTempCU->setARPWSubParts( 0 , 0 , uhDepth );
    1973 #endif
    1974             }
     1938#if H_3D_SPIVMP
    19751939          }
    19761940#endif
     
    20932057  }
    20942058 }
    2095 #if MTK_SPIVMP_F0110
    2096 #if MTK_F0110_FIX
     2059#if H_3D_SPIVMP
    20972060 delete[] pcMvFieldSP;
    20982061 delete[] puhInterDirSP;
    2099 #else
    2100  delete pcMvFieldSP;
    2101  delete puhInterDirSP;
    2102 #endif
    21032062#endif
    21042063#if H_3D_ARP
     
    21702129
    21712130    m_pcPredSearch->motionCompensation( rpcTempCU , m_ppcPredYuvTemp[uhDepth] );
    2172 
    2173 #if !QC_MTK_INTERVIEW_ARP_F0123_F0108
    2174     if(rpcTempCU->getPartitionSize(0)==SIZE_2Nx2N)
    2175     {
    2176       Bool bSignalflag[2] = { true, true };
    2177       for(UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx ++ )
    2178       {
    2179         RefPicList eRefList = uiRefListIdx ? REF_PIC_LIST_1 : REF_PIC_LIST_0;
    2180         Int iRefIdx = rpcTempCU->getCUMvField(eRefList)->getRefIdx(0);
    2181         if( iRefIdx < 0 || rpcTempCU->getSlice()->getPOC() == rpcTempCU->getSlice()->getRefPOC(eRefList, iRefIdx) )
    2182         {
    2183           bSignalflag[uiRefListIdx] = false;
    2184         }
    2185       }
    2186       if( !bSignalflag[0] && !bSignalflag[1] )
    2187       {
    2188         rpcTempCU->setARPWSubParts( 0 , 0 , uhDepth );
    2189       }
    2190     }
    2191 #endif
    21922131  }
    21932132  else
     
    22092148   {
    22102149     m_ppcWeightedTempCU[uhDepth]->copyPartFrom( rpcTempCU , 0 , uhDepth );
    2211 
    2212 #if !QC_MTK_INTERVIEW_ARP_F0123_F0108
    2213      Bool bSignalflag[2] = { true, true };
    2214      for(UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx ++ )
    2215      {
    2216        RefPicList eRefList = uiRefListIdx ? REF_PIC_LIST_1 : REF_PIC_LIST_0;
    2217        Int iRefIdx = rpcTempCU->getCUMvField(eRefList)->getRefIdx(0);
    2218        if( iRefIdx < 0 || rpcTempCU->getSlice()->getPOC() == rpcTempCU->getSlice()->getRefPOC(eRefList, iRefIdx) )
    2219        {
    2220          bSignalflag[uiRefListIdx] = false;
    2221        }
    2222      }
    2223      if( !bSignalflag[0] && !bSignalflag[1])
    2224      {
    2225        rpcTempCU->setARPWSubParts( 0 , 0 , uhDepth );
    2226      }
    2227 #endif
    22282150   }
    22292151  }
  • trunk/source/Lib/TLibEncoder/TEncEntropy.cpp

    r724 r773  
    160160Void TEncEntropy::encodeICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD )
    161161{
    162 #if SEC_ONLY_TEXTURE_IC_F0151
    163162  if ( pcCU->isIntra( uiAbsPartIdx ) || ( pcCU->getSlice()->getViewIndex() == 0 ) || pcCU->getSlice()->getIsDepth() )
    164 #else
    165   if ( pcCU->isIntra( uiAbsPartIdx ) || ( pcCU->getSlice()->getViewIndex() == 0 ) )
    166 #endif
    167163  {
    168164    return;
  • trunk/source/Lib/TLibEncoder/TEncGOP.cpp

    r738 r773  
    664664    refPicListModification->setRefPicListModificationFlagL1(0);
    665665#if H_MV
    666 #if H_MV_6_RALS_O0149_11
    667666    if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > 0 )
    668 #else
    669     if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > 1 )
    670 #endif
    671667    {
    672668      // Some more sophisticated algorithm to determine discardable_flag might be added here.
     
    678674    GOPEntry gopEntry      = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid );     
    679675   
    680 #if H_MV_6_ILDDS_ILREFPICS_27_34
    681676    Bool interLayerPredLayerIdcPresentFlag = false;
    682 #endif
    683677    if ( getLayerId() > 0 && !vps->getAllRefLayersActiveFlag() && numDirectRefLayers > 0 )
    684678    {         
     
    692686        if ( gopEntry.m_numActiveRefLayerPics != vps->getNumDirectRefLayers( getLayerId() ) )
    693687        {       
    694 #if H_MV_6_ILDDS_ILREFPICS_27_34
    695688          interLayerPredLayerIdcPresentFlag = true;
    696 #endif
    697689          for (Int i = 0; i < gopEntry.m_numActiveRefLayerPics; i++ )
    698690          {
     
    702694      }
    703695    }
    704 #if H_MV_6_ILDDS_ILREFPICS_27_34
    705696    if ( !interLayerPredLayerIdcPresentFlag )
    706697    {
     
    710701      }
    711702    }
    712 #endif
    713703
    714704
     
    745735#if H_3D_ARP
    746736    //GT: This seems to be broken when layerId in vps is not equal to layerId in nuh
    747 #if SHARP_ARP_REF_CHECK_F0105
    748737    pcSlice->setARPStepNum(m_ivPicLists);
    749 #else
    750     pcSlice->setARPStepNum();
    751 #endif
    752738    if(pcSlice->getARPStepNum() > 1)
    753739    {
     
    13191305      nalu = NALUnit(NAL_UNIT_PPS);
    13201306#endif
     1307#if PPS_FIX_DEPTH
     1308      if(!pcSlice->getIsDepth() || !pcSlice->getViewIndex() )
     1309      {
     1310#endif
    13211311      m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream);
    13221312      m_pcEntropyCoder->encodePPS(pcSlice->getPPS());
     
    13261316      actualTotalBits += UInt(accessUnit.back()->m_nalUnitData.str().size()) * 8;
    13271317#endif
    1328 
     1318#if PPS_FIX_DEPTH
     1319      }
     1320#endif
    13291321      xCreateLeadingSEIMessages(accessUnit, pcSlice->getSPS());
    13301322
  • trunk/source/Lib/TLibEncoder/TEncSbac.cpp

    r758 r773  
    9595#if H_3D_DIM_DMM
    9696, m_cDmm1DataSCModel          ( 1,             1,               NUM_DMM1_DATA_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
    97 #if !SEC_DMM3_RBC_F0147
    98 , m_cDmm3DataSCModel          ( 1,             1,               NUM_DMM3_DATA_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
    99 #endif
    100 #endif
    101 #if H_3D_DIM_RBC
    102 , m_cRbcDataSCModel           ( 1,             1,               NUM_RBC_DATA_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
    10397#endif
    10498#if H_3D_DIM_SDC
     
    176170#if H_3D_DIM_DMM
    177171  m_cDmm1DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA );
    178 #if !SEC_DMM3_RBC_F0147
    179   m_cDmm3DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM3_DATA );
    180 #endif
    181 #endif
    182 #if H_3D_DIM_RBC
    183   m_cRbcDataSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_RBC_DATA );
    184172#endif
    185173#if H_3D_DIM_SDC
     
    266254#if H_3D_DIM_DMM
    267255      curCost += m_cDmm1DataSCModel.calcCost          ( curSliceType, qp, (UChar*)INIT_DMM1_DATA );
    268 #if !SEC_DMM3_RBC_F0147
    269       curCost += m_cDmm3DataSCModel.calcCost          ( curSliceType, qp, (UChar*)INIT_DMM3_DATA );
    270 #endif
    271 #endif
    272 #if H_3D_DIM_RBC
    273       curCost += m_cRbcDataSCModel.calcCost           ( curSliceType, qp, (UChar*)INIT_RBC_DATA );
    274256#endif
    275257    }
     
    337319#if H_3D_DIM_DMM
    338320  m_cDmm1DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA );
    339 #if !SEC_DMM3_RBC_F0147
    340   m_cDmm3DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM3_DATA );
    341 #endif
    342 #endif
    343 #if H_3D_DIM_RBC
    344   m_cRbcDataSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_RBC_DATA );
    345321#endif
    346322#if H_3D_DIM_SDC
     
    526502}
    527503
    528 #if QC_DIM_DELTADC_UNIFY_F0132
    529504Void TEncSbac::xCodeDimDeltaDC( Pel valDeltaDC, UInt uiNumSeg )
    530505{
     
    536511  }
    537512}
    538 #else
    539 Void TEncSbac::xCodeDimDeltaDC( Pel valDeltaDC, UInt dimType )
    540 {
    541   xWriteExGolombLevel( UInt( abs( valDeltaDC ) ), m_cDdcDataSCModel.get(0, 0, (RBC_IDX == dimType) ? 1 : 0) );
    542   if( valDeltaDC != 0 )
    543   {
    544     UInt uiSign = valDeltaDC > 0 ? 0 : 1;
    545     m_pcBinIf->encodeBinEP( uiSign );
    546   }
    547 }
    548 #endif
    549513
    550514#if H_3D_DIM_DMM
     
    557521}
    558522
    559 #if !SEC_DMM3_RBC_F0147
    560 Void TEncSbac::xCodeDmm3WedgeIdx( UInt uiIntraIdx, Int iNumBit )
    561 {
    562   for( Int i = 0; i < iNumBit; i++ )
    563   {
    564     m_pcBinIf->encodeBin( ( uiIntraIdx >> i ) & 1, m_cDmm3DataSCModel.get(0, 0, 0) );
    565   }
    566 }
    567 #endif
    568 #endif
    569 #if H_3D_DIM_RBC
    570 Void TEncSbac::xCodeRbcEdge( TComDataCU* pcCU, UInt uiAbsPartIdx )
    571 {
    572   UInt   uiDepth        = pcCU->getDepth( uiAbsPartIdx ) + (pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ? 1 : 0);
    573   UChar* pucSymbolList  = pcCU->getEdgeCode     ( uiAbsPartIdx );
    574   UChar  ucEdgeNumber   = pcCU->getEdgeNumber   ( uiAbsPartIdx );
    575   Bool   bLeft          = pcCU->getEdgeLeftFirst( uiAbsPartIdx );
    576   UChar  ucStart        = pcCU->getEdgeStartPos ( uiAbsPartIdx );
    577   UInt   uiSymbol;
    578 
    579   // 1. Top(0) or Left(1)
    580   uiSymbol = (bLeft == false) ? 0 : 1;
    581   m_pcBinIf->encodeBinEP( uiSymbol );
    582 
    583   // 2. Start position (lowest bit first)
    584   uiSymbol = ucStart;
    585   for( UInt ui = 6; ui > uiDepth; ui-- ) // 64(0)->6, 32(1)->5, 16(2)->4, 8(3)->3, 4(4)->2
    586   {
    587     m_pcBinIf->encodeBinEP( uiSymbol & 0x1 );
    588     uiSymbol >>= 1;
    589   }
    590 
    591   // 3. Number of edges
    592   uiSymbol = ucEdgeNumber > 0 ? ucEdgeNumber - 1 : 0;
    593   for( UInt ui = 7; ui > uiDepth; ui-- ) // 64(0)->7, 32(1)->6, 16(2)->5, 8(3)->4, 4(4)->3
    594   {
    595     m_pcBinIf->encodeBinEP( uiSymbol & 0x1 );
    596     uiSymbol >>= 1;
    597   }
    598 
    599   if(uiSymbol != 0)
    600   {
    601     printf(" ucEdgeNumber %d at depth %d\n",ucEdgeNumber, uiDepth);
    602     assert(false);
    603   }
    604 
    605   // 4. Edges
    606   for( Int iPtr2 = 0; iPtr2 < ucEdgeNumber; iPtr2++ )
    607   {
    608     UInt uiReorderSymbol = pucSymbolList[iPtr2];
    609     for( UInt ui = 0; ui < uiReorderSymbol; ui++ )
    610     {
    611       m_pcBinIf->encodeBin( 1, m_cRbcDataSCModel.get( 0, 0, 0 ) );
    612     }
    613 
    614     if( uiReorderSymbol != 6 )
    615       m_pcBinIf->encodeBin( 0, m_cRbcDataSCModel.get( 0, 0, 0 ) );
    616   }
    617 }
    618 #endif
     523#endif
     524
    619525#if H_3D_DIM_SDC
    620526Void TEncSbac::xCodeSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment )
     
    632538
    633539#if H_3D_DIM_DLT
    634 #if DLT_DIFF_CODING_IN_PPS
    635540  UInt uiMaxResidualBits = pcCU->getSlice()->getPPS()->getDLT()->getBitsPerDepthValue( pcCU->getSlice()->getLayerIdInVps() );
    636 #else
    637   UInt uiMaxResidualBits = pcCU->getSlice()->getVPS()->getBitsPerDepthValue( pcCU->getSlice()->getLayerIdInVps() );
    638 #endif
    639541#else
    640542  UInt uiMaxResidualBits = g_bitDepthY;
     
    655557    DTRACE_CU("sdc_residual_sign_flag[i]", uiSign)
    656558#endif
    657    
    658 #if H_3D_DIM_DLT
    659 #if DLT_DIFF_CODING_IN_PPS
    660       UInt uiNumDepthValues = pcCU->getSlice()->getPPS()->getDLT()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() );
    661 #else
    662       UInt uiNumDepthValues = pcCU->getSlice()->getVPS()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() );
    663 #endif
     559#if H_3D_DIM_DLT   
     560    UInt uiNumDepthValues = pcCU->getSlice()->getPPS()->getDLT()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() );
    664561#else
    665562    UInt uiNumDepthValues = ((1 << g_bitDepthY)-1);
    666563#endif
     564
    667565    assert(uiAbsIdx <= uiNumDepthValues);
    668566   
     
    12391137      xCodeDmm1WedgeIdx( pcCU->getDmmWedgeTabIdx( dimType, absPartIdx ), g_dmm1TabIdxBits[pcCU->getIntraSizeIdx(absPartIdx)] );
    12401138    } break;
    1241 #if !SEC_DMM3_RBC_F0147
    1242   case( DMM3_IDX ):
    1243     {
    1244       xCodeDmm3WedgeIdx( pcCU->getDmm3IntraTabIdx( absPartIdx ), g_dmm3IntraTabIdxBits[pcCU->getIntraSizeIdx(absPartIdx)] );
    1245     } break;
    1246 #endif
    12471139  case( DMM4_IDX ): break;
    12481140#endif
    1249 #if H_3D_DIM_RBC
    1250   case( RBC_IDX ):
    1251     {
    1252       assert( pcCU->getWidth( absPartIdx ) < 64 );
    1253       xCodeRbcEdge( pcCU, absPartIdx );
    1254     } break;
    1255 #endif
    12561141  default: break;
    12571142  }
    12581143
    1259 #if H_3D_DIM_SDC && !QC_DIM_DELTADC_UNIFY_F0132
    1260   if( pcCU->getSDCFlag( absPartIdx ) )
    1261   {
    1262     assert(pcCU->getPartitionSize(absPartIdx)==SIZE_2Nx2N);
    1263     UInt uiNumSegments = ( dir == DC_IDX || dir == PLANAR_IDX )? 1 : 2;
    1264     for(UInt uiSeg=0; uiSeg<uiNumSegments; uiSeg++)
    1265     {
    1266       xCodeSDCResidualData(pcCU, absPartIdx, uiSeg);
    1267     }
    1268   }
    1269   else
    1270   {
    1271 #endif
    1272 #if QC_DIM_DELTADC_UNIFY_F0132
    1273     if( dimType < DIM_NUM_TYPE || pcCU->getSDCFlag( absPartIdx ) )
    1274 #else
    1275     if( dimType < DIM_NUM_TYPE )
    1276 #endif
    1277     {
    1278 #if QC_DIM_DELTADC_UNIFY_F0132
    1279       UInt dimDeltaDC;
    1280       Pel  deltaDC;
    1281       UInt uiNumSegments = ( dir == PLANAR_IDX ) ? 1 : 2;
    1282       if( pcCU->getSDCFlag( absPartIdx ) )
    1283     {
    1284         if( uiNumSegments==1 )
    1285         {
    1286           dimDeltaDC = pcCU->getSDCSegmentDCOffset(0, absPartIdx) ? 1 : 0;
    1287         }
    1288         else
    1289         {
    1290           dimDeltaDC = ( pcCU->getSDCSegmentDCOffset(0, absPartIdx) || pcCU->getSDCSegmentDCOffset(1, absPartIdx) ) ? 1 : 0;
    1291         }
     1144  if( dimType < DIM_NUM_TYPE || pcCU->getSDCFlag( absPartIdx ) )
     1145  {
     1146    UInt dimDeltaDC;
     1147    Pel  deltaDC;
     1148    UInt uiNumSegments = ( dir == PLANAR_IDX ) ? 1 : 2;
     1149    if( pcCU->getSDCFlag( absPartIdx ) )
     1150    {
     1151      if( uiNumSegments==1 )
     1152      {
     1153        dimDeltaDC = pcCU->getSDCSegmentDCOffset(0, absPartIdx) ? 1 : 0;
    12921154      }
    12931155      else
    12941156      {
    1295         dimDeltaDC = isDimDeltaDC( dir );
    1296       }
    1297 
    1298       m_pcBinIf->encodeBin( dimDeltaDC, m_cDdcFlagSCModel.get(0, 0, uiNumSegments-1) );
    1299 
    1300       if( dimDeltaDC )
    1301       {
    1302         for( UInt segment = 0; segment < uiNumSegments; segment++ )
    1303         {
    1304           deltaDC = pcCU->getSDCFlag( absPartIdx ) ? pcCU->getSDCSegmentDCOffset(segment, absPartIdx) : pcCU->getDimDeltaDC( dimType, segment, absPartIdx );
    1305           xCodeDimDeltaDC( deltaDC, uiNumSegments );
    1306         }
    1307       }
    1308 #else
    1309       UInt dimDeltaDC = isDimDeltaDC( dir );
    1310       m_pcBinIf->encodeBin( dimDeltaDC, m_cDdcFlagSCModel.get(0, 0, (RBC_IDX == dimType) ? 1 : 0) );
    1311       if( dimDeltaDC )
    1312       {
    1313         for( UInt segment = 0; segment < 2; segment++ )
    1314         {
    1315           xCodeDimDeltaDC( pcCU->getDimDeltaDC( dimType, segment, absPartIdx ), dimType );
    1316         }
    1317       }
    1318 #endif
    1319     }
    1320 #if H_3D_DIM_SDC && !QC_DIM_DELTADC_UNIFY_F0132
    1321   }
    1322 #endif
     1157        dimDeltaDC = ( pcCU->getSDCSegmentDCOffset(0, absPartIdx) || pcCU->getSDCSegmentDCOffset(1, absPartIdx) ) ? 1 : 0;
     1158      }
     1159    }
     1160    else
     1161    {
     1162      dimDeltaDC = isDimDeltaDC( dir );
     1163    }
     1164
     1165    m_pcBinIf->encodeBin( dimDeltaDC, m_cDdcFlagSCModel.get(0, 0, uiNumSegments-1) );
     1166
     1167    if( dimDeltaDC )
     1168    {
     1169      for( UInt segment = 0; segment < uiNumSegments; segment++ )
     1170      {
     1171        deltaDC = pcCU->getSDCFlag( absPartIdx ) ? pcCU->getSDCSegmentDCOffset(segment, absPartIdx) : pcCU->getDimDeltaDC( dimType, segment, absPartIdx );
     1172        xCodeDimDeltaDC( deltaDC, uiNumSegments );
     1173      }
     1174    }
     1175  }
    13231176}
    13241177
    13251178Void TEncSbac::codeIntraDepthMode( TComDataCU* pcCU, UInt absPartIdx )
    13261179{
    1327 #if SEC_DMM3_RBC_F0147
    13281180  UInt codeWordTable[3][7] =    {{0, 0, 0, 1, 0, 0, 0},{0, 2, 6, 14, 15, 0, 0},{0, 1, 0, 0, 0, 0, 0}};
    13291181  UInt codeWordLenTable[3][7] = {{0, 1, 0, 1, 0, 0, 0},{1, 2, 3,  4,  4, 0, 0},{1, 1, 0, 0, 0, 0, 0}};
    1330 #else
    1331     UInt codeWordTable[3][7] =    {{0, 0, 0, 2, 0,6, 7},{0, 0, 2, 7, 3, 6, 2},{0, 1, 0, 0, 0, 0, 0}};
    1332     UInt codeWordLenTable[3][7] = {{0, 1, 0, 2, 0,3, 3},{1, 1, 2, 3, 2, 3, 2},{1, 1, 0, 0, 0, 0, 0}};
    1333 #endif
    13341182  UInt dir = pcCU->getLumaIntraDir( absPartIdx );
    13351183  UInt puIdx = (pcCU->getWidth(absPartIdx) == 64) ? 2 : ( (pcCU->getPartitionSize(absPartIdx) == SIZE_NxN && pcCU->getWidth(absPartIdx) == 8) ? 0 : 1 );
     
    13461194    case DMM1_IDX: codeIdx = 3; break;
    13471195    case DMM4_IDX: codeIdx = 4; break;
    1348 #if !SEC_DMM3_RBC_F0147
    1349     case DMM3_IDX: codeIdx = 5; break;
    1350     case  RBC_IDX: codeIdx = 6; break;
    1351 #endif
    13521196    default:                    break;
    13531197    }
     
    13621206      default:          codeIdx = 2; break;
    13631207    }
    1364   }
    1365 #endif
    1366 #if !SEC_DMM3_RBC_F0147
    1367   if( puIdx==1 )
    1368   {
    1369       if( codeIdx==1 || codeIdx==2 || codeIdx==4 )
    1370       {
    1371           m_pcBinIf->encodeBinEP( 0 );
    1372       }
    1373       else
    1374       {
    1375           m_pcBinIf->encodeBinEP( 1 );
    1376       }
    13771208  }
    13781209#endif
  • trunk/source/Lib/TLibEncoder/TEncSbac.h

    r724 r773  
    116116  Void  xWriteEpExGolomb     ( UInt uiSymbol, UInt uiCount );
    117117  Void  xWriteCoefRemainExGolomb ( UInt symbol, UInt &rParam );
    118   #if H_3D_DIM
     118#if H_3D_DIM
    119119  Void  xWriteExGolombLevel  ( UInt uiSymbol, ContextModel& rcSCModel  );
    120 #if QC_DIM_DELTADC_UNIFY_F0132
    121120  Void  xCodeDimDeltaDC      ( Pel valDeltaDC, UInt uiNumSeg );
    122 #else
    123   Void  xCodeDimDeltaDC      ( Pel valDeltaDC, UInt dimType );
    124 #endif
    125121#if H_3D_DIM_DMM
    126122  Void  xCodeDmm1WedgeIdx    ( UInt uiTabIdx, Int iNumBit );
    127 #if !SEC_DMM3_RBC_F0147
    128   Void  xCodeDmm3WedgeIdx    ( UInt uiIntraIdx, Int iNumBit );
    129 #endif
    130 #endif
    131 #if H_3D_DIM_RBC
    132   Void  xCodeRbcEdge         ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    133123#endif
    134124#if H_3D_DIM_SDC
     
    259249#if H_3D_DIM_DMM
    260250  ContextModel3DBuffer m_cDmm1DataSCModel;
    261 #if !SEC_DMM3_RBC_F0147
    262   ContextModel3DBuffer m_cDmm3DataSCModel;
    263 #endif
    264 #endif
    265 #if H_3D_DIM_RBC
    266   ContextModel3DBuffer m_cRbcDataSCModel;
    267251#endif
    268252#if H_3D_DIM_SDC 
  • trunk/source/Lib/TLibEncoder/TEncSearch.cpp

    r758 r773  
    11241124      {
    11251125#endif
    1126       for( UInt uiX = 0; uiX < uiWidth; uiX++ )
    1127       {
    1128 #if LGE_PRED_RES_CODING_DLT_DOMAIN_F0159
    1129 #if DLT_DIFF_CODING_IN_PPS
    1130         if( (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getPPS()->getDLT()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()) )
    1131 #else
    1132         if( (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getVPS()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()) )
    1133 #endif
     1126        for( UInt uiX = 0; uiX < uiWidth; uiX++ )
     1127        {
     1128#if H_3D_DIM
     1129          if( (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getPPS()->getDLT()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()) )
    11341130          {
    1135 #if DLT_DIFF_CODING_IN_PPS
    11361131            pResi[ uiX ] = pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pOrg[ uiX ] ) - pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pPred[ uiX ] );
    1137 #else
    1138             pResi[ uiX ] = pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pOrg[ uiX ] ) - pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pPred[ uiX ] );
    1139 #endif
    11401132          }
    11411133          else
    11421134          {
    1143               pResi[ uiX ] = pOrg[ uiX ] - pPred[ uiX ];
     1135            pResi[ uiX ] = pOrg[ uiX ] - pPred[ uiX ];
    11441136          }
    11451137#else
    1146         pResi[ uiX ] = pOrg[ uiX ] - pPred[ uiX ];
    1147 #endif
    1148       }
    1149       pOrg  += uiStride;
    1150       pResi += uiStride;
    1151       pPred += uiStride;
     1138          pResi[ uiX ] = pOrg[ uiX ] - pPred[ uiX ];
     1139#endif
     1140        }
     1141        pOrg  += uiStride;
     1142        pResi += uiStride;
     1143        pPred += uiStride;
    11521144#if H_3D_DIM_ENC
    11531145      }
     
    12091201      for( UInt uiX = 0; uiX < uiWidth; uiX++ )
    12101202      {
    1211 #if LGE_PRED_RES_CODING_DLT_DOMAIN_F0159
    1212 #if DLT_DIFF_CODING_IN_PPS
     1203#if H_3D_DIM
    12131204        if( (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getPPS()->getDLT()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()) )
    1214 #else
    1215         if( (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getVPS()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()) )
    1216 #endif
    1217           {
    1218 #if DLT_DIFF_CODING_IN_PPS
    1219             pReco    [ uiX ] = pcCU->getSlice()->getPPS()->getDLT()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), Clip3( 0, pcCU->getSlice()->getPPS()->getDLT()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() ) - 1, pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pPred[ uiX ] ) + pResi[ uiX ] ) );
    1220 #else
    1221             pReco    [ uiX ] = pcCU->getSlice()->getVPS()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), Clip3( 0, pcCU->getSlice()->getVPS()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() ) - 1, pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pPred[ uiX ] ) + pResi[ uiX ] ) );
    1222 #endif
    1223           }
    1224           else
    1225           {
    1226               pReco    [ uiX ] = ClipY( pPred[ uiX ] + pResi[ uiX ] );
    1227           }
     1205        {
     1206          pReco    [ uiX ] = pcCU->getSlice()->getPPS()->getDLT()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), Clip3( 0, pcCU->getSlice()->getPPS()->getDLT()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() ) - 1, pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pPred[ uiX ] ) + pResi[ uiX ] ) );
     1207        }
     1208        else
     1209        {
     1210          pReco    [ uiX ] = ClipY( pPred[ uiX ] + pResi[ uiX ] );
     1211        }
    12281212#else
    12291213        pReco    [ uiX ] = ClipY( pPred[ uiX ] + pResi[ uiX ] );
     
    19511935    // get residual (idx)
    19521936#if H_3D_DIM_DLT
    1953 #if DLT_DIFF_CODING_IN_PPS
    19541937    Pel pResidualIdx = pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pDCRec ) - pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), apDCPredValues[uiSegment] );
    1955 #else
    1956     Pel pResidualIdx = pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pDCRec ) - pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), apDCPredValues[uiSegment] );
    1957 #endif
    19581938#else
    19591939    Pel pResidualIdx = pDCRec - apDCPredValues[uiSegment];
     
    19691949  {
    19701950#if H_3D_DIM_DLT
    1971 #if DLT_DIFF_CODING_IN_PPS
    19721951    Pel   pPredIdx    = pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), apDCPredValues[uiSegment] );
    19731952    Pel   pResiIdx    = pcCU->getSDCSegmentDCOffset(uiSegment, uiAbsPartIdx);
    19741953    Pel   pRecoValue  = pcCU->getSlice()->getPPS()->getDLT()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), pPredIdx + pResiIdx );
    1975 #else
    1976     Pel   pPredIdx    = pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), apDCPredValues[uiSegment] );
    1977     Pel   pResiIdx    = pcCU->getSDCSegmentDCOffset(uiSegment, uiAbsPartIdx);
    1978     Pel   pRecoValue  = pcCU->getSlice()->getVPS()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), pPredIdx + pResiIdx );
    1979 #endif
    19801954
    19811955    apDCResiValues[uiSegment]  = pRecoValue - apDCPredValues[uiSegment];
     
    29242898              biSegmentation = &(g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])][uiTabIdx]);
    29252899            } break;
    2926 #if !SEC_DMM3_RBC_F0147
    2927           case( DMM3_IDX ):
    2928             {
    2929 
    2930               TComPic*      pcPicTex = pcCU->getSlice()->getTexturePic();
    2931               TComDataCU* pcColTexCU = pcPicTex->getCU( pcCU->getAddr() );
    2932               UInt      uiTexPartIdx = pcCU->getZorderIdxInCU() + uiPartOffset;
    2933               Int   uiColTexIntraDir = pcColTexCU->isIntra( uiTexPartIdx ) ? pcColTexCU->getLumaIntraDir( uiTexPartIdx ) : 255;
    2934 
    2935               if( uiColTexIntraDir > DC_IDX && uiColTexIntraDir < 35 )
    2936               {
    2937              UInt uiIntraTabIdx = 0;
    2938               xSearchDmm3Wedge( pcCU, uiPartOffset, piOrg, uiStride, uiWidth, uiHeight, uiTabIdx, uiIntraTabIdx, uiColTexIntraDir );
    2939               pcCU->setDmmWedgeTabIdxSubParts( uiTabIdx, dmmType, uiPartOffset, uiDepth + uiInitTrDepth );
    2940               pcCU->setDmm3IntraTabIdxSubParts( uiIntraTabIdx, uiPartOffset, uiDepth + uiInitTrDepth );
    2941               biSegmentation = &(g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])][uiTabIdx]);
    2942               }
    2943             } break;
    2944 #endif
     2900
    29452901          case( DMM4_IDX ):
    29462902            {
     
    29682924      }
    29692925#endif
    2970 #if H_3D_DIM_RBC
    2971       if( m_pcEncCfg->getUseRBC()
    2972 #if H_3D_FAST_DEPTH_INTRA
    2973           && (uiRdModeList[0] != PLANAR_IDX || varCU >= varThreshold)
    2974 #endif
    2975         )
    2976       {
    2977         if( xSearchRbcEdge( pcCU, uiPartOffset, piOrg, uiStride, uiWidth, uiHeight ) )
    2978         {
    2979           Pel deltaDC1 = 0; Pel deltaDC2 = 0;
    2980 #if QC_DIM_DELTADC_UNIFY_F0132
    2981           xSearchDmmDeltaDCs( pcCU, uiPartOffset, piOrg, piPred, uiStride, pcCU->getEdgePartition( uiPartOffset ), uiWidth, uiWidth, uiHeight, deltaDC1, deltaDC2 );
    2982 #else
    2983           xSearchRbcDeltaDCs( pcCU, uiPartOffset, piOrg, piPred, uiStride, pcCU->getEdgePartition( uiPartOffset ), uiWidth, uiWidth, uiHeight, deltaDC1, deltaDC2 );
    2984 #endif
    2985           pcCU->setDimDeltaDC( RBC_IDX, 0, uiPartOffset, deltaDC1 );
    2986           pcCU->setDimDeltaDC( RBC_IDX, 1, uiPartOffset, deltaDC2 );
    2987 
    2988           uiRdModeList[ numModesForFullRD++ ] = (2*RBC_IDX  +DIM_OFFSET);
    2989           uiRdModeList[ numModesForFullRD++ ] = (2*RBC_IDX+1+DIM_OFFSET);
    2990         }
    2991       }
    2992 #endif
    29932926    }
    29942927#endif
     
    30292962      Bool bTestZeroResi = false;
    30302963#if H_3D_DIM_ENC
    3031 #if LGE_BUGFIX_F0158
    30322964      bTestZeroResi |= pcCU->getSlice()->getIsDepth() && !pcCU->getSlice()->isIRAP();
    3033 #else
    3034       bTestZeroResi |= pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->isIRAP();
    3035 #endif
    30362965#endif
    30372966#if H_3D_DIM_SDC
     
    36423571                                 , InheritedVSPDisInfo*  inheritedVSPDisInfo
    36433572#endif
    3644 #if MTK_SPIVMP_F0110
     3573#if H_3D_SPIVMP
    36453574                                 , Bool* pbSPIVMPFlag, TComMvField* pcMvFieldSP, UChar* puhInterDirSP
    36463575#endif
     
    36603589    if ( iPUIdx == 0 )
    36613590    {
    3662 #if ETRIKHU_MERGE_REUSE_F0093
     3591#if H_3D
    36633592      pcCU->initAvailableFlags();
    36643593      pcCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand);
     
    36683597                                        , inheritedVSPDisInfo
    36693598#endif
    3670 #if MTK_SPIVMP_F0110
     3599#if H_3D_SPIVMP
    36713600                                        , pbSPIVMPFlag, pcMvFieldSP, puhInterDirSP
    36723601#endif
     
    36743603        );
    36753604#else
    3676       pcCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours
    3677 #if H_3D_VSP
    3678                                    , vspFlag
    3679                                    , inheritedVSPDisInfo
    3680 #endif
    3681                                    , numValidMergeCand
    3682                                    );
     3605      pcCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand );
    36833606#endif
    36843607    }
     
    36873610  else
    36883611  {
    3689 #if ETRIKHU_MERGE_REUSE_F0093
     3612#if H_3D
    36903613    pcCU->initAvailableFlags();
    36913614    pcCU->getInterMergeCandidates( uiAbsPartIdx, iPUIdx, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand);
     
    36953618                                      , inheritedVSPDisInfo
    36963619#endif
    3697 #if MTK_SPIVMP_F0110
     3620#if H_3D_SPIVMP
    36983621                                      , pbSPIVMPFlag, pcMvFieldSP, puhInterDirSP
    36993622#endif
     
    37013624      );
    37023625#else
    3703     pcCU->getInterMergeCandidates( uiAbsPartIdx, iPUIdx, cMvFieldNeighbours, uhInterDirNeighbours
    3704 #if H_3D_VSP
    3705                                  , vspFlag
    3706                                  , inheritedVSPDisInfo
    3707 #endif
    3708                                  , numValidMergeCand
     3626    pcCU->getInterMergeCandidates( uiAbsPartIdx, iPUIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand
    37093627                                 );
    37103628#endif
     
    37263644      PartSize ePartSize = pcCU->getPartitionSize( 0 );
    37273645
    3728 #if MTK_SPIVMP_F0110
     3646#if H_3D_SPIVMP
    37293647      pcCU->setSPIVMPFlagSubParts( pbSPIVMPFlag[uiMergeCand], uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ));
    37303648      if (pbSPIVMPFlag[uiMergeCand])
     
    37483666        pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand], ePartSize, uiAbsPartIdx, 0, iPUIdx );
    37493667        pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], ePartSize, uiAbsPartIdx, 0, iPUIdx );
    3750 #if MTK_SPIVMP_F0110
     3668#if H_3D_SPIVMP
    37513669      }
    37523670#endif
     
    44274345      DisInfo OriginalDvInfo = pcCU->getDvInfo(uiAbsPartIdx);
    44284346#endif
    4429 #if MTK_SPIVMP_F0110
     4347#if H_3D_SPIVMP
    44304348      Bool bSPIVMPFlag[MRG_MAX_NUM_CANDS_MEM];
    44314349      memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM);
     
    44404358                      , inheritedVSPDisInfo
    44414359#endif
    4442 #if MTK_SPIVMP_F0110
     4360#if H_3D_SPIVMP
    44434361                      , bSPIVMPFlag, pcMvFieldSP, puhInterDirSP
    44444362#endif
     
    44544372        pcCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMRGIndex].m_acDvInfo, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
    44554373#endif
    4456 #if MTK_SPIVMP_F0110
     4374#if H_3D_SPIVMP
    44574375        pcCU->setSPIVMPFlagSubParts(bSPIVMPFlag[uiMRGIndex], uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 
    44584376        if (bSPIVMPFlag[uiMRGIndex]!=0)
     
    44884406            pcCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( cMRGMvField[1], ePartSize, uiPartAddr, 0, iPartIdx );
    44894407          }
    4490 #if MTK_SPIVMP_F0110
     4408#if H_3D_SPIVMP
    44914409        }
    44924410#endif
     
    45024420      else
    45034421      {
    4504 #if MTK_SPIVMP_F0110       
     4422#if H_3D_SPIVMP       
    45054423        pcCU->setSPIVMPFlagSubParts(0, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
    45064424#endif
     
    45174435        }
    45184436      }
    4519 #if MTK_SPIVMP_F0110
    4520 #if MTK_F0110_FIX
     4437#if H_3D_SPIVMP
    45214438      delete[] pcMvFieldSP;
    45224439      delete[] puhInterDirSP;
    4523 #else
    4524       delete pcMvFieldSP;
    4525       delete puhInterDirSP;
    4526 #endif
    45274440#endif
    45284441    }
     
    54385351      dZeroCost = dCost + 1;
    54395352    }
    5440 #if MTK_SPIVMP_F0110
     5353#if H_3D_SPIVMP
    54415354    if ( dZeroCost < dCost || pcCU->getQtRootCbf(0)==0)
    54425355#else
     
    73727285
    73737286#if H_3D_DIM_DLT
    7374 #if DLT_DIFF_CODING_IN_PPS
    73757287  rDeltaDC1 = pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), ClipY(predDC1 + rDeltaDC1) ) - pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC1 );
    73767288  rDeltaDC2 = pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), ClipY(predDC2 + rDeltaDC2) ) - pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC2 );
    7377 #else
    7378   rDeltaDC1 = pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), ClipY(predDC1 + rDeltaDC1) ) - pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC1 );
    7379   rDeltaDC2 = pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), ClipY(predDC2 + rDeltaDC2) ) - pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC2 );
    7380 #endif
    73817289#endif
    73827290}
     
    74777385}
    74787386
    7479 #if !SEC_DMM3_RBC_F0147
    7480 Void TEncSearch::xSearchDmm3Wedge( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx, UInt& ruiIntraTabIdx, UInt colTexIntraDir )
    7481 {
    7482   ruiTabIdx       = 0;
    7483   ruiIntraTabIdx  = 0;
    7484 
    7485   // local pred buffer
    7486   TComYuv cPredYuv;
    7487   cPredYuv.create( uiWidth, uiHeight );
    7488   cPredYuv.clear();
    7489   Pel* piPred = cPredYuv.getLumaAddr();
    7490   UInt uiPredStride = cPredYuv.getStride();
    7491 
    7492   // wedge search
    7493   UInt uiBestDist = MAX_UINT;
    7494   WedgeList* pacWedgeList = &g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])];
    7495   Pel refDC1 = 0; Pel refDC2 = 0;
    7496 
    7497   std::vector< std::vector<UInt> > pauiWdgLstSz = g_aauiWdgLstM3[g_aucConvertToBit[uiWidth]];
    7498   std::vector<UInt>* pauiWdgLst = &pauiWdgLstSz[colTexIntraDir-2];
    7499   for( UInt uiIdxW = 0; uiIdxW < pauiWdgLst->size(); uiIdxW++ )
    7500   {
    7501     UInt uiIdx     =   pauiWdgLst->at(uiIdxW);
    7502     TComWedgelet* pcWedgelet = &(pacWedgeList->at(uiIdx));
    7503     xCalcBiSegDCs  ( piRef,  uiRefStride,  pcWedgelet->getPattern(), pcWedgelet->getStride(), refDC1, refDC2 );
    7504     xAssignBiSegDCs( piPred, uiPredStride, pcWedgelet->getPattern(), pcWedgelet->getStride(), refDC1, refDC2 );
    7505 
    7506     UInt uiActDist = m_pcRdCost->getDistPart( g_bitDepthY, piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, TEXT_LUMA, DF_SAD );
    7507     if( uiActDist < uiBestDist || uiBestDist == MAX_UINT )
    7508     {
    7509       uiBestDist     = uiActDist;
    7510       ruiTabIdx      = uiIdx;
    7511       ruiIntraTabIdx = uiIdxW;
    7512     }
    7513   }
    7514   cPredYuv.destroy();
    7515 }
    7516 #endif
    7517 #endif
    7518 #if H_3D_DIM_RBC
    7519 Void TEncSearch::xSearchRbcDeltaDCs( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piOrig, Pel* piPredic, UInt uiStride, Bool* biSegPattern, Int patternStride, UInt uiWidth, UInt uiHeight, Pel& rDeltaDC1, Pel& rDeltaDC2 )
    7520 {
    7521   assert( biSegPattern );
    7522   Pel origDC1 = 0; Pel origDC2 = 0;
    7523   xCalcBiSegDCs  ( piOrig,   uiStride, biSegPattern, patternStride, origDC1, origDC2 );
    7524   xAssignBiSegDCs( piPredic, uiStride, biSegPattern, patternStride, origDC1, origDC2 );
    7525 
    7526   Int* piMask = pcCU->getPattern()->getAdiOrgBuf( uiWidth, uiHeight, m_piYuvExt ); // no filtering for DMM
    7527   Int  maskStride = 2*uiWidth + 1;
    7528   Int* ptrSrc = piMask+maskStride+1;
    7529   Pel  predDC1 = 0; Pel predDC2 = 0;
    7530   xPredBiSegDCs( ptrSrc, maskStride, biSegPattern, patternStride, predDC1, predDC2 );
    7531 
    7532   rDeltaDC1 = origDC1 - predDC1;
    7533   rDeltaDC2 = origDC2 - predDC2;
    7534 
    7535 #if H_3D_VSO
    7536   if( m_pcRdCost->getUseVSO() )
    7537   {
    7538     Pel fullDeltaDC1 = rDeltaDC1;
    7539     Pel fullDeltaDC2 = rDeltaDC2;
    7540 
    7541     xDeltaDCQuantScaleDown( pcCU, fullDeltaDC1 );
    7542     xDeltaDCQuantScaleDown( pcCU, fullDeltaDC2 );
    7543 
    7544     Dist uiBestDist     = RDO_DIST_MAX;
    7545     UInt uiBestQStepDC1 = 0;
    7546     UInt uiBestQStepDC2 = 0;
    7547 
    7548     UInt uiDeltaDC1Max = abs(fullDeltaDC1);
    7549     UInt uiDeltaDC2Max = abs(fullDeltaDC2);
    7550 
    7551     //VSO Level delta DC check range extension
    7552     uiDeltaDC1Max += (uiDeltaDC1Max>>1);
    7553     uiDeltaDC2Max += (uiDeltaDC2Max>>1);
    7554 
    7555     for( UInt uiQStepDC1 = 1; uiQStepDC1 <= uiDeltaDC1Max; uiQStepDC1++  )
    7556     {
    7557       Pel iLevelDeltaDC1 = (Pel)(uiQStepDC1) * (Pel)(( fullDeltaDC1 < 0 ) ? -1 : 1);
    7558       xDeltaDCQuantScaleUp( pcCU, iLevelDeltaDC1 );
    7559       Pel testDC1 = ClipY( predDC1 + iLevelDeltaDC1 );
    7560 
    7561       for( UInt uiQStepDC2 = 1; uiQStepDC2 <= uiDeltaDC2Max; uiQStepDC2++  )
    7562       {
    7563         Pel iLevelDeltaDC2 = (Pel)(uiQStepDC2) * (Pel)(( fullDeltaDC2 < 0 ) ? -1 : 1);
    7564         xDeltaDCQuantScaleUp( pcCU, iLevelDeltaDC2 );
    7565         Pel testDC2 = ClipY( predDC2 + iLevelDeltaDC2 );
    7566 
    7567         xAssignBiSegDCs( piPredic, uiStride, biSegPattern, patternStride, testDC1, testDC2 );
    7568 
    7569         Dist uiActDist = RDO_DIST_MAX;
    7570         if( m_pcRdCost->getUseEstimatedVSD() )
    7571         {
    7572           uiActDist = m_pcRdCost->getDistPartVSD( pcCU, uiAbsPtIdx, piPredic, uiStride, piOrig, uiStride, uiWidth, uiHeight, false );
    7573         }
    7574         else
    7575         {
    7576           uiActDist = m_pcRdCost->getDistPartVSO( pcCU, uiAbsPtIdx, piPredic, uiStride, piOrig, uiStride, uiWidth, uiHeight, false );
    7577         }
    7578 
    7579         if( uiActDist < uiBestDist || uiBestDist == RDO_DIST_MAX )
    7580         {
    7581           uiBestDist     = uiActDist;
    7582           uiBestQStepDC1 = uiQStepDC1;
    7583           uiBestQStepDC2 = uiQStepDC2;
    7584         }
    7585       }
    7586     }
    7587 
    7588     fullDeltaDC1 = (Int)(uiBestQStepDC1) * (Int)(( fullDeltaDC1 < 0 ) ? -1 : 1);
    7589     fullDeltaDC2 = (Int)(uiBestQStepDC2) * (Int)(( fullDeltaDC2 < 0 ) ? -1 : 1);
    7590     xDeltaDCQuantScaleUp( pcCU, fullDeltaDC1 );
    7591     xDeltaDCQuantScaleUp( pcCU, fullDeltaDC2 );
    7592     rDeltaDC1 = fullDeltaDC1;
    7593     rDeltaDC2 = fullDeltaDC2;
    7594   }
    7595 #endif
    7596 
    7597   xDeltaDCQuantScaleDown( pcCU, rDeltaDC1 );
    7598   xDeltaDCQuantScaleDown( pcCU, rDeltaDC2 );
    7599 }
    7600 
    7601 Bool TEncSearch::xSearchRbcEdge( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, Int iWidth, Int iHeight )
    7602 {
    7603   Bool* pbEdge  = (Bool*) xMalloc( Bool, iWidth * iHeight * 4 );
    7604 
    7605   Short* psDiffX = new Short[ iWidth * iHeight ];
    7606   Short* psDiffY = new Short[ iWidth * iHeight ];
    7607   Bool*  pbEdgeX = new Bool [ iWidth * iHeight ];
    7608   Bool*  pbEdgeY = new Bool [ iWidth * iHeight ];
    7609 
    7610   // Find Horizontal Gradient & Edge Detection ((x+1, y) - (x,y))
    7611   for( Int y=0; y<iHeight; y++ )
    7612   {
    7613     Short* psDiffXPtr = &psDiffX[ y * iHeight ];
    7614     Bool*  pbEdgeXPtr = &pbEdgeX[ y * iHeight ];
    7615     for(Int x=0; x<iWidth-1; x++ )
    7616     {
    7617       *psDiffXPtr = piRef[ x+1 + y*uiRefStride ] - piRef[ x + y*uiRefStride ];
    7618       if(*psDiffXPtr >= RBC_THRESHOLD || *psDiffXPtr <= (-1)*RBC_THRESHOLD)
    7619       {
    7620         *pbEdgeXPtr = true;
    7621       }
    7622       else
    7623       {
    7624         *pbEdgeXPtr = false;
    7625       }
    7626 
    7627       psDiffXPtr++;
    7628       pbEdgeXPtr++;
    7629     }
    7630   }
    7631 
    7632   // Find Vertical Gradient & Edge Detection((x,y+1) - (x,y))
    7633   for( Int y=0; y<iHeight-1; y++ )
    7634   {
    7635     Short* psDiffYPtr = &psDiffY[ y * iHeight ];
    7636     Bool*  pbEdgeYPtr = &pbEdgeY[ y * iHeight ];
    7637     for(Int x=0; x<iWidth; x++ )
    7638     {
    7639       *psDiffYPtr = piRef[ x + (y+1)*uiRefStride ] - piRef[ x + y*uiRefStride ];
    7640       if(*psDiffYPtr >= RBC_THRESHOLD || *psDiffYPtr <= (-1)*RBC_THRESHOLD)
    7641       {
    7642         *pbEdgeYPtr = true;
    7643       }
    7644       else
    7645       {
    7646         *pbEdgeYPtr = false;
    7647       }
    7648 
    7649       psDiffYPtr++;
    7650       pbEdgeYPtr++;
    7651     }
    7652   }
    7653 
    7654   // Eliminate local maximum
    7655   for( Int y=0; y<iHeight; y++ )
    7656   {
    7657     Short* psDiffXPtr = &psDiffX[ y * iHeight ];
    7658     Bool*  pbEdgeXPtr = &pbEdgeX[ y * iHeight ];
    7659     for( Int x=0; x<iWidth-1; x++ )
    7660     {
    7661       UShort usAbs0=0, usAbs1=0, usAbs2=0;  // 0 : left, 1 : current, 2 : right
    7662 
    7663       if( x > 0 && *(pbEdgeXPtr-1) == true )
    7664       {
    7665         if( *(psDiffXPtr-1) >= 0)
    7666         {
    7667           usAbs0 = *(psDiffXPtr-1);
    7668 
    7669         }
    7670         else
    7671         {
    7672           usAbs0 = (-1) * *(psDiffXPtr-1);
    7673         }
    7674       }
    7675       if( *pbEdgeXPtr == true )
    7676       {
    7677         if( *(psDiffXPtr) >= 0)
    7678         {
    7679           usAbs1 = *(psDiffXPtr);
    7680         }
    7681         else
    7682         {
    7683           usAbs1 = (-1) * *(psDiffXPtr);
    7684         }
    7685       }
    7686       if( x < iWidth-2 && *(pbEdgeXPtr+1) == true )
    7687       {
    7688         if( *(psDiffXPtr+1) >= 0)
    7689         {
    7690           usAbs2 = *(psDiffXPtr+1);
    7691           //bSign2 = true;
    7692         }
    7693         else
    7694         {
    7695           usAbs2 = (-1) * *(psDiffXPtr+1);
    7696         }
    7697       }
    7698 
    7699       if( x == 0 )
    7700       {
    7701         if( usAbs1 < usAbs2 )
    7702         {
    7703           *pbEdgeXPtr = false;
    7704         }
    7705       }
    7706       else if( x == iWidth-2 )
    7707       {
    7708         if( usAbs1 <= usAbs0 )
    7709           *pbEdgeXPtr = false;
    7710       }
    7711       else
    7712       {
    7713         if( usAbs2 > usAbs0 )
    7714         {
    7715           if( usAbs1 < usAbs2 )
    7716             *pbEdgeXPtr = false;
    7717         }
    7718         else
    7719         {
    7720           if( usAbs1 <= usAbs0 )
    7721             *pbEdgeXPtr = false;
    7722         }
    7723       }
    7724 
    7725       psDiffXPtr++;
    7726       pbEdgeXPtr++;
    7727     }
    7728   }
    7729 
    7730   for( Int y=0; y<iHeight-1; y++ )
    7731   {
    7732     Short* psDiffYPtr = &psDiffY[ y * iWidth ];
    7733     Bool*  pbEdgeYPtr = &pbEdgeY[ y * iWidth ];
    7734     for( Int x=0; x<iWidth; x++ )
    7735     {
    7736       UShort usAbs0=0, usAbs1=0, usAbs2=0;  // 0 : upper, 1 : current, 2 : bottom
    7737       if( y > 0 && *(pbEdgeYPtr-iWidth) == true )
    7738       {
    7739         if( *(psDiffYPtr-iWidth) >= 0)
    7740         {
    7741           usAbs0 = *(psDiffYPtr-iWidth);
    7742         }
    7743         else
    7744         {
    7745           usAbs0 = (-1) * *(psDiffYPtr-iWidth);         
    7746         }
    7747       }
    7748       if( *pbEdgeYPtr == true )
    7749       {
    7750         if( *(psDiffYPtr) >= 0)
    7751         {
    7752           usAbs1 = *(psDiffYPtr);
    7753         }
    7754         else
    7755         {
    7756           usAbs1 = (-1) * *(psDiffYPtr);
    7757         }
    7758       }
    7759       if( y < iHeight-2 && *(pbEdgeYPtr+iWidth) == true )
    7760       {
    7761         if( *(psDiffYPtr+iWidth) >= 0)
    7762         {
    7763           usAbs2 = *(psDiffYPtr+iWidth);         
    7764         }
    7765         else
    7766         {
    7767           usAbs2 = (-1) * *(psDiffYPtr+iWidth);
    7768         }
    7769       }
    7770 
    7771       if( y == 0 )
    7772       {
    7773         if( usAbs1 < usAbs2 )
    7774           *pbEdgeYPtr = false;
    7775       }
    7776       else if( y == iHeight-2 )
    7777       {
    7778         if( usAbs1 <= usAbs0 )
    7779           *pbEdgeYPtr = false;
    7780       }
    7781       else
    7782       {
    7783         if( usAbs2 > usAbs0 )
    7784         {
    7785           if( usAbs1 < usAbs2 )
    7786             *pbEdgeYPtr = false;
    7787         }
    7788         else
    7789         {
    7790           if( usAbs1 <= usAbs0 )
    7791             *pbEdgeYPtr = false;
    7792         }
    7793       }
    7794 
    7795       psDiffYPtr++;
    7796       pbEdgeYPtr++;
    7797     }
    7798   }
    7799 
    7800   // Edge Merging
    7801   for( Int i=0; i< 4 * iWidth * iHeight; i++ )
    7802     pbEdge[ i ] = false;
    7803   /// Even Line (0,2,4,6,...) => Vertical Edge
    7804   for( Int i=0; i<iHeight; i++)
    7805   {
    7806     for( Int j=0; j<iWidth-1; j++)
    7807     {
    7808       pbEdge[ (2 * j + 1) + (2 * i) * 2 * iWidth ] = pbEdgeX[ j + i * iHeight ];
    7809     }
    7810   }
    7811   /// Odd Line (1,3,5,7,...) => Horizontal Edge
    7812   for( Int i=0; i<iHeight-1; i++)
    7813   {
    7814     for( Int j=0; j<iWidth; j++)
    7815     {
    7816       pbEdge[ (2 * j) + (2 * i + 1) * 2 * iWidth ] = pbEdgeY[ j + i * iHeight ];
    7817     }
    7818   }
    7819 
    7820   // Intersection Filling
    7821   /// Vertical Edge between Horizontal Edges
    7822   for( Int i = 1; i < 2 * iHeight - 3; i += 2)
    7823   {
    7824     for( Int j = 0; j < 2 * iWidth - 1; j += 2)
    7825     {
    7826       if( pbEdge[ j + i * 2 * iWidth ] )
    7827       {
    7828         if( j != 0 && pbEdge[ (j - 2) + ((i + 2) * 2 * iWidth) ] )
    7829         {
    7830           if( !pbEdge[ (j - 1) + ((i - 1) * 2 * iWidth) ] && !pbEdge[ (j - 1) + ((i + 3) * 2 * iWidth) ] )
    7831             pbEdge[ (j - 1) + ((i + 1) * 2 * iWidth) ] = true;
    7832         }
    7833         if( j != 2 * iWidth - 2 && pbEdge[ (j + 2) + ((i + 2) * 2 * iWidth) ] )
    7834         {
    7835           if( !pbEdge[ (j + 1) + ((i - 1) * 2 * iWidth) ] && !pbEdge[ (j + 1) + ((i + 3) * 2 * iWidth) ] )
    7836             pbEdge[ (j + 1) + ((i + 1) * 2 * iWidth) ] = true;
    7837         }
    7838       }
    7839     }
    7840   }
    7841   /// Horizontal Edge between Vertical Edges
    7842   for( Int j = 1; j < 2 * iWidth - 3; j += 2)
    7843   {
    7844     for( Int i = 0; i < 2 * iHeight - 1; i += 2)
    7845     {
    7846       if( pbEdge[ j + i * 2 * iWidth ] )
    7847       {
    7848         if( i != 0 && pbEdge[ (j + 2) + ((i - 2) * 2 * iWidth) ] )
    7849         {
    7850           if( !pbEdge[ (j - 1) + ((i - 1) * 2 * iWidth) ] && !pbEdge[ (j + 3) + ((i - 1) * 2 * iWidth) ] )
    7851             pbEdge[ (j + 1) + ((i - 1) * 2 * iWidth) ] = true;
    7852         }
    7853         if( i != 2 * iHeight - 2 && pbEdge[ (j + 2) + ((i + 2) * 2 * iWidth) ] )
    7854         {
    7855           if( !pbEdge[ (j - 1) + ((i + 1) * 2 * iWidth) ] && !pbEdge[ (j + 3) + ((i + 1) * 2 * iWidth) ] )
    7856             pbEdge[ (j + 1) + ((i + 1) * 2 * iWidth) ] = true;
    7857         }
    7858       }
    7859     }
    7860   }
    7861 
    7862   // Static Pruning Unnecessary Edges
    7863   /// Step1. Stack push the unconnected edges
    7864   UShort* pusUnconnectedEdgeStack = new UShort[ 4 * iWidth * iHeight ]; // approximate size calculation
    7865   Int iUnconnectedEdgeStackPtr = 0;
    7866   //// Vertical Edges
    7867   for( Int i = 0; i < 2 * iHeight - 1; i += 2 )
    7868   {
    7869     for( Int j = 1; j < 2 * iWidth - 2; j += 2 )
    7870     {
    7871       if( pbEdge[ j + i * 2 * iWidth ] )
    7872       {
    7873         if( !xCheckTerminatedEdge( pbEdge, j, i, iWidth, iHeight ) )
    7874         {
    7875           pusUnconnectedEdgeStack[iUnconnectedEdgeStackPtr] = (i << 8) | (j);
    7876           iUnconnectedEdgeStackPtr++;
    7877         }
    7878       }
    7879     }
    7880   }
    7881 
    7882   //// Horizontal Edges
    7883   for( Int i = 1; i < 2 * iHeight - 2; i += 2 )
    7884   {
    7885     for( Int j = 0; j < 2 * iWidth - 1; j += 2 )
    7886     {
    7887       if( pbEdge[ j + i * 2 * iWidth ] )
    7888       {
    7889         if( !xCheckTerminatedEdge( pbEdge, j, i, iWidth, iHeight ) )
    7890         {
    7891           pusUnconnectedEdgeStack[iUnconnectedEdgeStackPtr] = (i << 8) | (j);
    7892           iUnconnectedEdgeStackPtr++;
    7893         }
    7894       }
    7895     }
    7896   }
    7897 
    7898   /// Step2. Remove the edges from the stack and push the new unconnected edges
    7899   //// (This step may contain duplicated edges already in the stack)
    7900   //// (But it doesn't cause any functional problems)
    7901   while( iUnconnectedEdgeStackPtr != 0 )
    7902   {
    7903     iUnconnectedEdgeStackPtr--;
    7904     Int iX = pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] & 0xff;
    7905     Int iY = pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] >> 8;
    7906 
    7907     pbEdge[ iX + iY * 2 * iWidth ] = false;
    7908 
    7909     if( iY % 2 == 1 && iX > 0 && pbEdge[ iX - 2 + iY * 2 * iWidth ] &&
    7910       !xCheckTerminatedEdge( pbEdge, iX - 2, iY, iWidth, iHeight ) ) // left
    7911     {
    7912       pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] = ((iY + 0) << 8) | (iX - 2);
    7913       iUnconnectedEdgeStackPtr++;
    7914     }
    7915     if( iY % 2 == 1 && iX < 2 * iWidth - 2 && pbEdge[ iX + 2 + iY * 2 * iWidth ] &&
    7916       !xCheckTerminatedEdge( pbEdge, iX + 2, iY, iWidth, iHeight ) ) // right
    7917     {
    7918       pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] = ((iY + 0) << 8) | (iX + 2);
    7919       iUnconnectedEdgeStackPtr++;
    7920     }
    7921     if( iY % 2 == 0 && iY > 0 && pbEdge[ iX + (iY - 2) * 2 * iWidth ] &&
    7922       !xCheckTerminatedEdge( pbEdge, iX, iY - 2, iWidth, iHeight ) ) // top
    7923     {
    7924       pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] = ((iY - 2) << 8) | (iX + 0);
    7925       iUnconnectedEdgeStackPtr++;
    7926     }
    7927     if( iY % 2 == 0 && iY < 2 * iHeight - 2 && pbEdge[ iX + (iY + 2) * 2 * iWidth ] &&
    7928       !xCheckTerminatedEdge( pbEdge, iX, iY + 2, iWidth, iHeight ) ) // bottom
    7929     {
    7930       pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] = ((iY + 2) << 8) | (iX + 0);
    7931       iUnconnectedEdgeStackPtr++;
    7932     }
    7933     if( iX > 0 && iY > 0 && pbEdge[ iX - 1 + (iY - 1) * 2 * iWidth ] &&
    7934       !xCheckTerminatedEdge( pbEdge, iX - 1, iY - 1, iWidth, iHeight ) ) // left-top
    7935     {
    7936       pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] = ((iY - 1) << 8) | (iX - 1);
    7937       iUnconnectedEdgeStackPtr++;
    7938     }
    7939     if( iX < 2 * iWidth - 1 && iY > 0 && pbEdge[ iX + 1 + (iY - 1) * 2 * iWidth ] &&
    7940       !xCheckTerminatedEdge( pbEdge, iX + 1, iY - 1, iWidth, iHeight ) ) // right-top
    7941     {
    7942       pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] = ((iY - 1) << 8) | (iX + 1);
    7943       iUnconnectedEdgeStackPtr++;
    7944     }
    7945     if( iX > 0 && iY < 2 * iHeight - 1 && pbEdge[ iX - 1 + (iY + 1) * 2 * iWidth ] &&
    7946       !xCheckTerminatedEdge( pbEdge, iX - 1, iY + 1, iWidth, iHeight ) ) // left-bottom
    7947     {
    7948       pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] = ((iY + 1) << 8) | (iX - 1);
    7949       iUnconnectedEdgeStackPtr++;
    7950     }
    7951     if( iX < 2 * iWidth - 1 && iY < 2 * iHeight - 1 && pbEdge[ iX + 1 + (iY + 1) * 2 * iWidth ] &&
    7952       !xCheckTerminatedEdge( pbEdge, iX + 1, iY + 1, iWidth, iHeight ) ) // right-bottom
    7953     {
    7954       pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] = ((iY + 1) << 8) | (iX + 1);
    7955       iUnconnectedEdgeStackPtr++;
    7956     }
    7957   }
    7958 
    7959 
    7960   // Region Generation ( edge -> region )
    7961   Bool* pbRegion = pcCU->getEdgePartition( uiAbsPtIdx );
    7962   Bool* pbVisit  = new Bool[ iWidth * iHeight ];
    7963 
    7964   for( UInt ui = 0; ui < iWidth * iHeight; ui++ )
    7965   {
    7966     pbRegion[ ui ] = true; // fill it as region 1 (we'll discover region 0 next)
    7967     pbVisit [ ui ] = false;
    7968   }
    7969 
    7970   Int* piStack = new Int[ iWidth * iHeight ];
    7971 
    7972   Int iPtr = 0;
    7973 
    7974   piStack[iPtr++] = (0 << 8) | (0);
    7975   pbRegion[ 0 ] = false;
    7976 
    7977   while(iPtr > 0)
    7978   {
    7979     Int iTmp = piStack[--iPtr];
    7980     Int iX1, iY1;
    7981     iX1 = iTmp & 0xff;
    7982     iY1 = (iTmp >> 8) & 0xff;
    7983 
    7984     pbVisit[ iX1 + iY1 * iWidth ] = true;
    7985 
    7986     assert( iX1 >= 0 && iX1 < iWidth );
    7987     assert( iY1 >= 0 && iY1 < iHeight );
    7988 
    7989     if( iX1 > 0 && !pbEdge[ 2 * iX1 - 1 + 4 * iY1 * iWidth ] && !pbVisit[ iX1 - 1 + iY1 * iWidth ] )
    7990     {
    7991       piStack[iPtr++] = (iY1 << 8) | (iX1 - 1);
    7992       pbRegion[ iX1 - 1 + iY1 * iWidth ] = false;
    7993     }
    7994     if( iX1 < iWidth - 1 && !pbEdge[ 2 * iX1 + 1 + 4 * iY1 * iWidth ] && !pbVisit[ iX1 + 1 + iY1 * iWidth ] )
    7995     {
    7996       piStack[iPtr++] = (iY1 << 8) | (iX1 + 1);
    7997       pbRegion[ iX1 + 1 + iY1 * iWidth ] = false;
    7998     }
    7999     if( iY1 > 0 && !pbEdge[ 2 * iX1 + 2 * (2 * iY1 - 1) * iWidth ] && !pbVisit[ iX1 + (iY1 - 1) * iWidth ] )
    8000     {
    8001       piStack[iPtr++] = ((iY1 - 1) << 8) | iX1;
    8002       pbRegion[ iX1 + (iY1 - 1) * iWidth ] = false;
    8003     }
    8004     if( iY1 < iHeight - 1 && !pbEdge[ 2 * iX1 + 2 * (2 * iY1 + 1) * iWidth ] && !pbVisit[ iX1 + (iY1 + 1) * iWidth ] )
    8005     {
    8006       piStack[iPtr++] = ((iY1 + 1) << 8) | iX1;
    8007       pbRegion[ iX1 + (iY1 + 1) * iWidth ] = false;
    8008     }
    8009   }
    8010 
    8011   ///////////
    8012   iPtr = 0;
    8013   for( Int i = 0; i < iWidth * iHeight; i++ )
    8014     pbVisit[ i ] = false;
    8015   piStack[ iPtr++ ] = (0 << 8) | (0); // initial seed
    8016   while( iPtr > 0 && iPtr < iWidth * iHeight )
    8017   {
    8018     Int iX;
    8019     Int iY;
    8020     iPtr--;
    8021     iX = piStack[ iPtr ] & 0xff;
    8022     iY = piStack[ iPtr ] >> 8;
    8023     pbVisit[ iY * iWidth + iX ] = true;
    8024 
    8025     if( iY > 0 && !pbVisit[ (iY - 1) * iWidth + iX ] && pbRegion[ iY * iWidth + iX ] == pbRegion[ (iY - 1) * iWidth + iX ] )
    8026     {
    8027       piStack[ iPtr++ ] = ((iY - 1) << 8) | iX;
    8028     }
    8029     if( iY < iHeight - 1 && !pbVisit[ (iY + 1) * iWidth + iX ] && pbRegion[ iY * iWidth + iX ] == pbRegion[ (iY + 1) * iWidth + iX ] )
    8030     {
    8031       piStack[ iPtr++ ] = ((iY + 1) << 8) | iX;
    8032     }
    8033     if( iX > 0 && !pbVisit[ iY * iWidth + (iX - 1) ] && pbRegion[ iY * iWidth + iX ] == pbRegion[ iY * iWidth + (iX - 1) ] )
    8034     {
    8035       piStack[ iPtr++ ] = (iY << 8) | (iX - 1);
    8036     }
    8037     if( iX < iWidth - 1 && !pbVisit[ iY * iWidth + (iX + 1) ] && pbRegion[ iY * iWidth + iX ] == pbRegion[ iY * iWidth + (iX + 1) ] )
    8038     {
    8039       piStack[ iPtr++ ] = (iY << 8) | (iX + 1);
    8040     }
    8041   }
    8042   assert( iPtr == 0 || iPtr == iWidth * iHeight );
    8043 
    8044   Bool bBipartition;
    8045   if( iPtr == iWidth * iHeight )
    8046   {
    8047     bBipartition = false; // single partition
    8048   }
    8049   else
    8050   {
    8051     for( Int i = 0; i < iWidth * iHeight; i++ )
    8052     {
    8053       if( !pbVisit[ i ] )
    8054       {
    8055         piStack[ iPtr++ ] = (( i / iWidth ) << 8) | ( i % iWidth );
    8056         pbVisit[ i ] = true;
    8057         break;
    8058       }
    8059     }
    8060     while( iPtr > 0 )
    8061     {
    8062       Int iX;
    8063       Int iY;
    8064       iPtr--;
    8065       iX = piStack[ iPtr ] & 0xff;
    8066       iY = piStack[ iPtr ] >> 8;
    8067       pbVisit[ iY * iWidth + iX ] = true;
    8068 
    8069       if( iY > 0 && !pbVisit[ (iY - 1) * iWidth + iX ] && pbRegion[ iY * iWidth + iX ] == pbRegion[ (iY - 1) * iWidth + iX ] )
    8070       {
    8071         piStack[ iPtr++ ] = ((iY - 1) << 8) | iX;
    8072       }
    8073       if( iY < iHeight - 1 && !pbVisit[ (iY + 1) * iWidth + iX ] && pbRegion[ iY * iWidth + iX ] == pbRegion[ (iY + 1) * iWidth + iX ] )
    8074       {
    8075         piStack[ iPtr++ ] = ((iY + 1) << 8) | iX;
    8076       }
    8077       if( iX > 0 && !pbVisit[ iY * iWidth + (iX - 1) ] && pbRegion[ iY * iWidth + iX ] == pbRegion[ iY * iWidth + (iX - 1) ] )
    8078       {
    8079         piStack[ iPtr++ ] = (iY << 8) | (iX - 1);
    8080       }
    8081       if( iX < iWidth - 1 && !pbVisit[ iY * iWidth + (iX + 1) ] && pbRegion[ iY * iWidth + iX ] == pbRegion[ iY * iWidth + (iX + 1) ] )
    8082       {
    8083         piStack[ iPtr++ ] = (iY << 8) | (iX + 1);
    8084       }
    8085     }
    8086     bBipartition = true;
    8087     for( Int i = 0; i < iWidth * iHeight; i++ )
    8088     {
    8089       if( !pbVisit[ i ] )
    8090       {
    8091         bBipartition = false;
    8092         break;
    8093       }
    8094     }
    8095   }
    8096 
    8097   xFree( pbEdge );
    8098   delete[] pbEdgeX; pbEdgeX = NULL;
    8099   delete[] pbEdgeY; pbEdgeY = NULL;
    8100   delete[] psDiffX; psDiffX = NULL;
    8101   delete[] psDiffY; psDiffY = NULL;
    8102   delete[] pusUnconnectedEdgeStack; pusUnconnectedEdgeStack = NULL;
    8103   delete[] pbVisit; pbVisit = NULL;
    8104   delete[] piStack; piStack = NULL;
    8105 
    8106   if( bBipartition )
    8107   {
    8108     return xConstructChainCode( pcCU, uiAbsPtIdx, (UInt)iWidth, (UInt)iHeight );
    8109   }
    8110   else
    8111   {
    8112     return false;
    8113   }
    8114 }
    8115 
    8116 Bool TEncSearch::xCheckTerminatedEdge( Bool* pbEdge, Int iX, Int iY, Int iWidth, Int iHeight )
    8117 {
    8118   if( (iY % 2) == 0 ) // vertical edge
    8119   {
    8120     Bool bTopConnected = false;
    8121     Bool bBottomConnected = false;
    8122 
    8123     if( iY != 0 )
    8124     {
    8125       if( pbEdge[ iX + (iY - 2) * 2 * iWidth ] )
    8126         bTopConnected = true;
    8127       if( pbEdge[ (iX - 1) + (iY - 1) * 2 * iWidth ] )
    8128         bTopConnected = true;
    8129       if( pbEdge[ (iX + 1) + (iY - 1) * 2 * iWidth ] )
    8130         bTopConnected = true;
    8131     }
    8132     else
    8133     {
    8134       bTopConnected = true;
    8135     }
    8136 
    8137 
    8138     if( iY != 2 * iHeight - 2 )
    8139     {
    8140       if( pbEdge[ iX + (iY + 2) * 2 * iWidth ] )
    8141         bBottomConnected = true;
    8142       if( pbEdge[ (iX - 1) + (iY + 1) * 2 * iWidth ] )
    8143         bBottomConnected = true;
    8144       if( pbEdge[ (iX + 1) + (iY + 1) * 2 * iWidth ] )
    8145         bBottomConnected = true;
    8146     }
    8147     else
    8148     {
    8149       bBottomConnected = true;
    8150     }
    8151 
    8152 
    8153     if( bTopConnected && bBottomConnected )
    8154     {
    8155       return true;
    8156     }
    8157     else
    8158     {
    8159       return false;
    8160     }
    8161   }
    8162   else
    8163   {
    8164     Bool bLeftConnected = false;
    8165     Bool bRightConnected = false;
    8166 
    8167     if( iX != 0 )
    8168     {
    8169       if( pbEdge[ (iX - 2) + iY * 2 * iWidth ] )
    8170         bLeftConnected = true;
    8171       if( pbEdge[ (iX - 1) + (iY - 1) * 2 * iWidth ] )
    8172         bLeftConnected = true;
    8173       if( pbEdge[ (iX - 1) + (iY + 1) * 2 * iWidth ] )
    8174         bLeftConnected = true;
    8175     }
    8176     else
    8177     {
    8178       bLeftConnected = true;
    8179     }
    8180 
    8181     if( iX != 2 * iWidth - 2 )
    8182     {
    8183       if( pbEdge[ (iX + 2) + iY * 2 * iWidth ] )
    8184         bRightConnected = true;
    8185       if( pbEdge[ (iX + 1) + (iY - 1) * 2 * iWidth ] )
    8186         bRightConnected = true;
    8187       if( pbEdge[ (iX + 1) + (iY + 1) * 2 * iWidth ] )
    8188         bRightConnected = true;
    8189     }
    8190     else
    8191     {
    8192       bRightConnected = true;
    8193     }
    8194 
    8195 
    8196     if( bLeftConnected && bRightConnected )
    8197     {
    8198       return true;
    8199     }
    8200     else
    8201     {
    8202       return false;
    8203     }
    8204   }
    8205 }
    8206 Bool TEncSearch::xConstructChainCode( TComDataCU* pcCU, UInt uiAbsPtIdx, UInt uiWidth, UInt uiHeight )
    8207 {
    8208   //UInt   uiWidth    = pcCU->getWidth( uiPartIdx ) >> (bPU4x4 ? 1 : 0);
    8209   //UInt   uiHeight   = pcCU->getHeight( uiPartIdx ) >> (bPU4x4 ? 1 : 0);
    8210   Bool*  pbEdge     = (Bool*) xMalloc( Bool, uiWidth * uiHeight * 4 );
    8211   Bool*  pbVisit    = (Bool*) xMalloc( Bool, uiWidth * uiHeight * 4 );
    8212   UInt   uiMaxEdge  = uiWidth * (RBC_MAX_EDGE_NUM_PER_4x4 / 4);
    8213   Bool*  pbRegion   = pcCU->getEdgePartition( uiAbsPtIdx );
    8214   UChar* piEdgeCode = pcCU->getEdgeCode( uiAbsPtIdx );
    8215   Bool   bStartLeft = false;
    8216   Bool   bPossible  = false;
    8217   Bool   bFinish    = false;
    8218   Int    iStartPosition = -1;
    8219   Int    iPtr = 0;
    8220   Int    iDir = -1, iNextDir = -1;
    8221   Int    iArrow = -1, iNextArrow = -1;
    8222   Int    iX = -1, iY = -1;
    8223   Int    iDiffX = 0, iDiffY = 0;
    8224   UChar  iCode = 255;
    8225   UInt   uiWidth2 = uiWidth * 2;
    8226 
    8227   for( Int i = 0; i < uiWidth * uiHeight * 4; i++ )
    8228     pbEdge[ i ] = false;
    8229 
    8230   for( Int i = 0; i < uiHeight; i++ )
    8231   {
    8232     for( Int j = 0; j < uiWidth - 1; j++ )
    8233     {
    8234       if( pbRegion[ i * uiWidth + j ] != pbRegion[ i * uiWidth + j + 1 ] )
    8235         pbEdge[ i * uiWidth * 4 + j * 2 + 1 ] = true;
    8236     }
    8237   }
    8238 
    8239   for( Int i = 0; i < uiHeight - 1; i++ )
    8240   {
    8241     for( Int j = 0; j < uiWidth; j++ )
    8242     {
    8243       if( pbRegion[ (i + 0) * uiWidth + j ] != pbRegion[ (i + 1) * uiWidth + j ] )
    8244         pbEdge[ (2 * i + 1) * 2 * uiWidth + j * 2 ] = true;
    8245     }
    8246   }
    8247 
    8248   for( Int i = 1; i < uiWidth2 - 2; i+=2 )
    8249   {
    8250     if(pbEdge[ i ])
    8251     {
    8252       bPossible  = true;
    8253       bStartLeft = false;
    8254       iStartPosition = iX = i;
    8255       iY = 0;
    8256       iDir = 3;
    8257       iArrow = 3;
    8258       break;
    8259     }
    8260   }
    8261 
    8262   if( !bPossible )
    8263   {
    8264     for( Int i = 1; i < uiWidth2 - 2; i+=2 )
    8265     {
    8266       if(pbEdge[ i * uiWidth2 ])
    8267       {
    8268         bPossible  = true;
    8269         bStartLeft = true;
    8270         iX = 0;
    8271         iStartPosition = iY = i;
    8272         iDir = 1;
    8273         iArrow = 1;
    8274         break;
    8275       }
    8276     }
    8277   }
    8278 
    8279   if( bPossible )
    8280   {
    8281     for( Int i = 0; i < 4 * uiWidth * uiHeight; i++ )
    8282       pbVisit[ i ] = false;
    8283 
    8284     while( !bFinish )
    8285     {
    8286       Bool bArrowSkip = false;
    8287       pbVisit[ iX + iY * uiWidth2 ] = true;
    8288 
    8289       switch( iDir )
    8290       {
    8291       case 0: // left
    8292         if( iX > 0 && !pbVisit[ (iX - 2) + iY * uiWidth2 ] && pbEdge[ (iX - 2) + iY * uiWidth2 ] ) // left
    8293         {
    8294           iDiffX = -2;
    8295           iDiffY =  0;
    8296           iNextDir = 0;
    8297           iNextArrow = 0;
    8298         }
    8299         else if( iX > 0 && !pbVisit[ (iX - 1) + (iY - 1) * uiWidth2 ] && pbEdge[ (iX - 1) + (iY - 1) * uiWidth2 ] ) // top
    8300         {
    8301           iDiffX = -1;
    8302           iDiffY = -1;
    8303           iNextDir = 2;
    8304           iNextArrow = 4;
    8305         }
    8306         else if( iX > 0 && !pbVisit[ (iX - 1) + (iY + 1) * uiWidth2 ] && pbEdge[ (iX - 1) + (iY + 1) * uiWidth2 ] ) // bottom
    8307         {
    8308           iDiffX = -1;
    8309           iDiffY = +1;
    8310           iNextDir = 3;
    8311           iNextArrow = iArrow;
    8312           if( !(iPtr == 0 && iX == uiWidth2 - 2 && iY == uiHeight * 2 - 3) )
    8313             bArrowSkip = true;
    8314           else
    8315             iNextArrow = 3;
    8316         }
    8317         else if( iX == 0 )
    8318         {
    8319           iDiffX = 0;
    8320           iDiffY = 0;
    8321           iNextDir = iDir;
    8322           iNextArrow = iArrow;
    8323           bFinish = true;
    8324           continue;
    8325         }
    8326         else
    8327         {
    8328           iPtr = 0; // edge loop or unwanted case
    8329           bFinish = true;
    8330           //continue;
    8331           assert(false);
    8332         }
    8333         break;
    8334       case 1: // right
    8335         if( iX < uiWidth2 - 2 && !pbVisit[ (iX + 2) + iY * uiWidth2 ] && pbEdge[ (iX + 2) + iY * uiWidth2 ] ) // right
    8336         {
    8337           iDiffX = +2;
    8338           iDiffY =  0;
    8339           iNextDir = 1;
    8340           iNextArrow = 1;
    8341         }
    8342         else if( iX < uiWidth2 - 2 && !pbVisit[ (iX + 1) + (iY - 1) * uiWidth2 ] && pbEdge[ (iX + 1) + (iY - 1) * uiWidth2 ] ) // top
    8343         {
    8344           iDiffX = +1;
    8345           iDiffY = -1;
    8346           iNextDir = 2;
    8347           iNextArrow = iArrow;
    8348           if( !(iPtr == 0 && iX == 0 && iY == 1) )
    8349             bArrowSkip = true;
    8350           else
    8351             iNextArrow = 2;
    8352         }
    8353         else if( iX < uiWidth2 - 2 && !pbVisit[ (iX + 1) + (iY + 1) * uiWidth2 ] && pbEdge[ (iX + 1) + (iY + 1) * uiWidth2 ] ) // bottom
    8354         {
    8355           iDiffX = +1;
    8356           iDiffY = +1;
    8357           iNextDir = 3;
    8358           iNextArrow = 7;
    8359         }
    8360         else if( iX == uiWidth2 - 2 )
    8361         {
    8362           iDiffX = 0;
    8363           iDiffY = 0;
    8364           iNextDir = iDir;
    8365           iNextArrow = iArrow;
    8366           bFinish = true;
    8367           continue;
    8368         }
    8369         else
    8370         {
    8371           iPtr = 0; // edge loop or unwanted case
    8372           bFinish = true;
    8373           //continue;
    8374           assert(false);
    8375         }
    8376         break;
    8377       case 2: // top
    8378         if( iY > 0 && !pbVisit[ (iX - 1) + (iY - 1) * uiWidth2 ] && pbEdge[ (iX - 1) + (iY - 1) * uiWidth2 ] ) // left
    8379         {
    8380           iDiffX = -1;
    8381           iDiffY = -1;
    8382           iNextDir = 0;
    8383           iNextArrow = iArrow;
    8384           if( !(iPtr == 0 && iX == 1 && iY == uiHeight * 2 - 2) )
    8385             bArrowSkip = true;
    8386           else
    8387             iNextArrow = 0;
    8388         }
    8389         else if( iY > 0 && !pbVisit[ (iX + 1) + (iY - 1) * uiWidth2 ] && pbEdge[ (iX + 1) + (iY - 1) * uiWidth2 ] ) // right
    8390         {
    8391           iDiffX = +1;
    8392           iDiffY = -1;
    8393           iNextDir = 1;
    8394           iNextArrow = 5;
    8395         }
    8396         else if( iY > 0 && !pbVisit[ iX + (iY - 2) * uiWidth2 ] && pbEdge[ iX + (iY - 2) * uiWidth2 ] ) // top
    8397         {
    8398           iDiffX =  0;
    8399           iDiffY = -2;
    8400           iNextDir = 2;
    8401           iNextArrow = 2;
    8402         }
    8403         else if( iY == 0 )
    8404         {
    8405           iDiffX = 0;
    8406           iDiffY = 0;
    8407           iNextDir = iDir;
    8408           iNextArrow = iArrow;
    8409           bFinish = true;
    8410           continue;
    8411         }
    8412         else
    8413         {
    8414           iPtr = 0; // edge loop or unwanted case
    8415           bFinish = true;
    8416           //continue;
    8417           assert(false);
    8418         }
    8419         break;
    8420       case 3: // bottom
    8421         if( iY < uiWidth2 - 2 && !pbVisit[ (iX - 1) + (iY + 1) * uiWidth2 ] && pbEdge[ (iX - 1) + (iY + 1) * uiWidth2 ] ) // left
    8422         {
    8423           iDiffX = -1;
    8424           iDiffY = +1;
    8425           iNextDir = 0;
    8426           iNextArrow = 6;
    8427         }
    8428         else if( iY < uiWidth2 - 2 && !pbVisit[ (iX + 1) + (iY + 1) * uiWidth2 ] && pbEdge[ (iX + 1) + (iY + 1) * uiWidth2 ] ) // right
    8429         {
    8430           iDiffX = +1;
    8431           iDiffY = +1;
    8432           iNextDir = 1;
    8433           iNextArrow = iArrow;
    8434           if( !(iPtr == 0 && iX == uiWidth * 2 - 3 && iY == 0) )
    8435             bArrowSkip = true;
    8436           else
    8437             iNextArrow = 1;
    8438         }
    8439         else if( iY < uiWidth2 - 2 && !pbVisit[ iX + (iY + 2) * uiWidth2 ] && pbEdge[ iX + (iY + 2) * uiWidth2 ] ) // bottom
    8440         {
    8441           iDiffX =  0;
    8442           iDiffY = +2;
    8443           iNextDir = 3;
    8444           iNextArrow = 3;
    8445         }
    8446         else if( iY == uiWidth2 - 2 )
    8447         {
    8448           iDiffX = 0;
    8449           iDiffY = 0;
    8450           iNextDir = iDir;
    8451           iNextArrow = iArrow;
    8452           bFinish = true;
    8453           continue;
    8454         }
    8455         else
    8456         {
    8457           iPtr = 0; // edge loop or unwanted case
    8458           bFinish = true;
    8459           //continue;
    8460           assert(false);
    8461         }
    8462         break;
    8463       }
    8464 
    8465       const UChar tableCode[8][8] = { { 0, -1, 4, 3, 2, 6, 1, 5 }, // iArrow(current direction), iNextArrow(next direction)
    8466       { -1, 0, 3, 4, 5, 1, 6, 2 },
    8467       { 3, 4, 0, -1, 1, 2, 5, 6 },
    8468       { 4, 3, -1, 0, 6, 5, 2, 1 },
    8469       { 1, 6, 2, 5, 0, 4, 3, -1 },
    8470       { 5, 2, 1, 6, 3, 0, -1, 4 },
    8471       { 2, 5, 6, 1, 4, -1, 0, 3 },
    8472       { 6, 1, 5, 2, -1, 3, 4, 0 } };
    8473 
    8474       iCode = tableCode[iArrow][iNextArrow];
    8475 
    8476       if(iPtr >= uiMaxEdge)
    8477       {
    8478         iPtr = 0; // over the maximum number of edge
    8479         bPossible = false;
    8480         break;
    8481       }
    8482 
    8483       if( !bArrowSkip )
    8484       {
    8485         piEdgeCode[iPtr++] = iCode; // first edge coding
    8486         //printf("xEdgeCoding: (%d,%d)->(%d,%d) code %d\n",iX,iY, iX+iDiffX, iY+iDiffY, iCode);
    8487       }
    8488 
    8489       iX += iDiffX;
    8490       iY += iDiffY;
    8491       iDir = iNextDir;
    8492       iArrow = iNextArrow;
    8493     }
    8494   }
    8495 
    8496   pcCU->setEdgeLeftFirst( uiAbsPtIdx, bStartLeft );
    8497   pcCU->setEdgeStartPos ( uiAbsPtIdx, bStartLeft ? (iStartPosition - 1) >> 1 : (iStartPosition + 1) >> 1);
    8498   pcCU->setEdgeNumber   ( uiAbsPtIdx, iPtr );
    8499 
    8500   xFree( pbEdge );
    8501   xFree( pbVisit );
    8502 
    8503   return (iPtr != 0);
    8504 }
    8505 #endif
     7387
     7388#endif
     7389
    85067390#endif
    85077391//! \}
  • trunk/source/Lib/TLibEncoder/TEncSearch.h

    r724 r773  
    351351  Void xSearchDmmDeltaDCs         ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piOrig, Pel* piPredic, UInt uiStride, Bool* biSegPattern, Int patternStride, UInt uiWidth, UInt uiHeight, Pel& rDeltaDC1, Pel& rDeltaDC2 );
    352352  Void xSearchDmm1Wedge           ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx );
    353 #if !SEC_DMM3_RBC_F0147
    354   Void xSearchDmm3Wedge           ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx, UInt& ruiIntraTabIdx, UInt colTexIntraDir );
    355 #endif
    356 #endif
    357 #if H_3D_DIM_RBC
    358   Void xSearchRbcDeltaDCs         ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piOrig, Pel* piPredic, UInt uiStride, Bool* biSegPattern, Int patternStride, UInt uiWidth, UInt uiHeight, Pel& rDeltaDC1, Pel& rDeltaDC2 );
    359   Bool xSearchRbcEdge             ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride,  Int  iWidth,  Int  iHeight );
    360  
    361   Bool xCheckTerminatedEdge       ( Bool* pbEdge, Int iX, Int iY, Int iWidth, Int iHeight );
    362   Bool xConstructChainCode        ( TComDataCU* pcCU, UInt uiAbsPtIdx, UInt uiWidth, UInt uiHeight );
    363353#endif
    364354#if H_3D_DIM_SDC
     
    427417                                  , InheritedVSPDisInfo*  inheritedVSPDisInfo
    428418#endif
    429 #if MTK_SPIVMP_F0110
     419#if H_3D_SPIVMP
    430420                                  , Bool* pbSPIVMPFlag, TComMvField* pcMvFieldSP, UChar* puhInterDirSP
    431421#endif
  • trunk/source/Lib/TLibEncoder/TEncSlice.cpp

    r724 r773  
    556556  rpcSlice->setSliceSegmentArgument ( m_pcCfg->getSliceSegmentArgument() );
    557557#if H_3D_IV_MERGE
    558 #if SEC_MPI_ENABLING_MERGE_F0150
    559558  if(rpcSlice->getIsDepth())
    560559  {
     
    565564    rpcSlice->setMaxNumMergeCand      ( m_pcCfg->getMaxNumMergeCand()   + ( rpcSlice->getVPS()->getIvMvPredFlag( rpcSlice->getLayerIdInVps() ) ? 1 : 0 ) );
    566565  }
    567 #else
    568    rpcSlice->setMaxNumMergeCand      ( m_pcCfg->getMaxNumMergeCand()   + ( rpcSlice->getVPS()->getIvMvPredFlag( rpcSlice->getLayerIdInVps() ) ? 1 : 0 ) );
    569 #endif
    570566#else
    571567  rpcSlice->setMaxNumMergeCand        ( m_pcCfg->getMaxNumMergeCand()        );
  • trunk/source/Lib/TLibEncoder/TEncTop.cpp

    r758 r773  
    299299{
    300300  // initialize SPS
    301 #if DLT_DIFF_CODING_IN_PPS
     301#if H_3D
    302302  // Assuming that all PPS indirectly refer to the same VPS via different SPS
    303303  m_cSPS.setVPS(m_cVPS);
     
    723723
    724724#if H_MV 
    725 #if H_MV_6_PS_REP_FORM_18_19_20
    726725  m_cSPS.setUpdateRepFormatFlag           ( false );   
    727 #else
    728   m_cSPS.setUpdateRepFormatFlag           ( m_layerId == 0 );   
    729 #endif
    730726  m_cSPS.setSpsInferScalingListFlag       ( m_layerId > 0 && m_cVPS->getInDirectDependencyFlag( getLayerIdInVps(), 0 ) );
    731727  m_cSPS.setSpsScalingListRefLayerId      ( 0              );
    732 #if H_MV_6_PSEM_O0142_3
    733728  m_cSPS.setSpsExtensionFlag              ( true );
    734729  m_cSPS.setSpsExtensionTypeFlag          ( PS_EX_T_MV ,true );
    735730#if H_3D
    736731  m_cSPS.setSpsExtensionTypeFlag          ( PS_EX_T_3D ,true );
    737 #endif
    738732#endif
    739733#endif
     
    823817    pcVUI->setOverscanInfoPresentFlag(getOverscanInfoPresentFlag());
    824818    pcVUI->setOverscanAppropriateFlag(getOverscanAppropriateFlag());
    825 #if H_MV_6_PS_O0118_33
     819#if H_MV
    826820    pcVUI->setVideoSignalTypePresentFlag(getVideoSignalTypePresentFlag() && getLayerId() == 0 );
    827821#else
    828     pcVUI->setVideoSignalTypePresentFlag(getVideoSignalTypePresentFlag());
     822   pcVUI->setVideoSignalTypePresentFlag(getVideoSignalTypePresentFlag());
    829823#endif
    830824    pcVUI->setVideoFormat(getVideoFormat());
     
    853847    pcVUI->setLog2MaxMvLengthVertical(getLog2MaxMvLengthVertical());
    854848  }
    855 #if H_3D
    856 #if !CAM_HLS_F0136_F0045_F0082
    857 #if !QC_DEPTH_IV_MRG_F0125
    858   if ( !m_isDepth )
    859 #endif
    860   {
    861     m_cSPS.initCamParaSPS           ( m_viewIndex, m_uiCamParPrecision, m_bCamParInSliceHeader, m_aaiCodedScale, m_aaiCodedOffset );
    862   }
    863 #endif
    864 #endif
    865849}
    866850
     
    877861#endif
    878862
    879 #if DLT_DIFF_CODING_IN_PPS
     863#if H_3D
    880864  m_cPPS.setDLT( getDLT() );
    881865#endif
     
    948932  m_cPPS.setOutputFlagPresentFlag( false );
    949933#if H_MV
    950 #if H_MV_6_RALS_O0149_11
    951934  m_cPPS.setNumExtraSliceHeaderBits( 3 );
    952 #else
    953   m_cPPS.setNumExtraSliceHeaderBits( 2 );
    954 #endif
    955935#endif
    956936  m_cPPS.setSignHideFlag(getSignHideFlag());
     
    1012992  }
    1013993#if H_3D
    1014 #if CAM_HLS_F0136_F0045_F0082
    1015994  if( m_cVPS->hasCamParInSliceHeader( getViewIndex() ) )
    1016 #else
    1017   if( m_cSPS.hasCamParInSliceHeader() )
    1018 #endif
    1019995  {
    1020996    m_cPPS.setSliceHeaderExtensionPresentFlag( true );
Note: See TracChangeset for help on using the changeset viewer.