Changeset 773 in 3DVCSoftware for trunk/source/Lib/TLibEncoder
- Timestamp:
- 16 Jan 2014, 09:56:13 (11 years ago)
- Location:
- trunk/source/Lib/TLibEncoder
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibEncoder/TEncCavlc.cpp
r758 r773 176 176 WRITE_FLAG( pcPPS->getSignHideFlag(), "sign_data_hiding_flag" ); 177 177 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 178 187 WRITE_UVLC( pcPPS->getNumRefIdxL0DefaultActive()-1, "num_ref_idx_l0_default_active_minus1"); 179 188 WRITE_UVLC( pcPPS->getNumRefIdxL1DefaultActive()-1, "num_ref_idx_l1_default_active_minus1"); 180 189 #if PPS_FIX_DEPTH 190 } 191 #endif 181 192 WRITE_SVLC( pcPPS->getPicInitQPMinus26(), "init_qp_minus26"); 182 193 WRITE_FLAG( pcPPS->getConstrainedIntraPred() ? 1 : 0, "constrained_intra_pred_flag" ); … … 253 264 } 254 265 #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 255 273 WRITE_FLAG( pcPPS->getListsModificationPresentFlag(), "lists_modification_present_flag"); 256 274 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 257 282 WRITE_FLAG( pcPPS->getSliceHeaderExtensionPresentFlag() ? 1 : 0, "slice_segment_header_extension_present_flag"); 258 283 259 #if ! DLT_DIFF_CODING_IN_PPS284 #if !H_3D 260 285 WRITE_FLAG( 0, "pps_extension_flag" ); 261 286 #else … … 266 291 } 267 292 268 #if DLT_DIFF_CODING_IN_PPS293 #if H_3D 269 294 Void TEncCavlc::codePPSExtension ( TComPPS* pcPPS ) 270 295 { … … 275 300 // Step 1) decoding DLT tables based on the number of depth layers, and 276 301 // Step 2) mapping DLT tables to the depth layers 277 // as descri pted in the 3D-HEVC WD.302 // as described in the 3D-HEVC WD. 278 303 TComVPS* pcVPS = pcPPS->getSPS()->getVPS(); 279 304 … … 470 495 } 471 496 WRITE_FLAG(pcVUI->getVideoSignalTypePresentFlag(), "video_signal_type_present_flag"); 472 #if H_MV _6_PS_O0118_33497 #if H_MV 473 498 assert( pcSPS->getLayerId() == 0 || !pcVUI->getVideoSignalTypePresentFlag() ); 474 499 #endif … … 636 661 { 637 662 WRITE_FLAG( pcSPS->getUpdateRepFormatFlag( ) ? 1 : 0 , "update_rep_format_flag" ); 638 #if H_MV_6_PS_REP_FORM_18_19_20639 663 if ( pcSPS->getUpdateRepFormatFlag() ) 640 664 { … … 644 668 else 645 669 { 646 #else647 }648 649 if ( pcSPS->getUpdateRepFormatFlag() )650 {651 #endif652 670 #endif 653 671 WRITE_UVLC( pcSPS->getChromaFormatIdc (), "chroma_format_idc" ); … … 675 693 } 676 694 #if H_MV 677 #if H_MV_6_PS_REP_FORM_18_19_20678 695 if ( pcSPS->getLayerId() == 0 ) 679 #else680 if ( pcSPS->getUpdateRepFormatFlag() )681 #endif682 696 { 683 697 #endif … … 784 798 WRITE_FLAG( 0, "sps_extension_flag" ); 785 799 #else 786 #if H_MV_6_PSEM_O0142_3787 800 WRITE_FLAG( pcSPS->getSpsExtensionFlag(), "sps_extension_flag" ); 788 801 … … 811 824 #endif 812 825 } 813 #else814 WRITE_FLAG( 1, "sps_extension_flag" );815 codeSPSExtension( pcSPS );816 #if !H_3D817 WRITE_FLAG( 0, "sps_extension2_flag" );818 #else819 WRITE_FLAG( 1, "sps_extension2_flag" );820 codeSPSExtension2( pcSPS, viewIndex, depthFlag );821 WRITE_FLAG( 0, "sps_extension3_flag" );822 #endif823 #endif824 826 #endif 825 827 } … … 830 832 WRITE_FLAG( pcSPS->getInterViewMvVertConstraintFlag() ? 1 : 0, "inter_view_mv_vert_constraint_flag" ); 831 833 832 #if !H_MV_6_SHVC_O0098_36833 WRITE_UVLC( 0, "sps_shvc_reserved_zero_idc" );834 #else835 834 WRITE_UVLC( pcSPS->getNumScaledRefLayerOffsets( ), "num_scaled_ref_layer_offsets" ); 836 835 … … 846 845 WRITE_SVLC( pcSPS->getScaledRefLayerBottomOffset( j ), "scaled_ref_layer_bottom_offset" ); 847 846 } 848 #endif849 847 } 850 848 #endif … … 859 857 WRITE_FLAG( pcSPS->getUseQTL() ? 1 : 0, "use_qtl_flag"); 860 858 WRITE_FLAG( pcSPS->getUsePC() ? 1 : 0, "use_pc_flag"); 861 }862 #endif863 #if !CAM_HLS_F0136_F0045_F0082864 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 }878 859 } 879 860 #endif … … 995 976 { 996 977 WRITE_FLAG( pcVPS->getAvcBaseLayerFlag() ? 1 : 0, "avc_base_layer_flag" ); 997 #if H_MV_6_PS_O0109_24998 978 WRITE_FLAG( pcVPS->getVpsVuiPresentFlag() ? 1 : 0 , "vps_vui_present_flag" ); 999 979 if ( pcVPS->getVpsVuiPresentFlag() ) 1000 980 { 1001 #endif1002 981 WRITE_CODE( pcVPS->getVpsVuiOffset( ), 16, "vps_vui_offset" ); // TBD 1003 #if H_MV_6_PS_O0109_24 1004 } 1005 #endif 982 } 1006 983 WRITE_FLAG( pcVPS->getSplittingFlag() ? 1 : 0, "splitting_flag" ); 1007 984 … … 1050 1027 1051 1028 1052 #if H_MV_6_PS_O0109_221053 1029 WRITE_CODE( pcVPS->getViewIdLen( ), 4, "view_id_len" ); 1054 1030 … … 1067 1043 } 1068 1044 } 1069 #else1070 // GT spec says: trac #391071 // 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 #endif1082 1045 1083 1046 … … 1089 1052 } 1090 1053 } 1091 #if H_MV_6_ILDSD_O0120_261092 1054 WRITE_FLAG( pcVPS->getVpsSubLayersMaxMinus1PresentFlag( ) ? 1 : 0 , "vps_sub_layers_max_minus1_present_flag" ); 1093 1055 if ( pcVPS->getVpsSubLayersMaxMinus1PresentFlag() ) … … 1106 1068 } 1107 1069 } 1108 #endif1109 1070 WRITE_FLAG( pcVPS->getMaxTidRefPresentFlag( ) ? 1 : 0 , "max_tid_ref_present_flag" ); 1110 1071 … … 1113 1074 for( Int i = 0; i < pcVPS->getMaxLayersMinus1(); i++ ) 1114 1075 { 1115 #if H_MV_6_ILDDS_O0225_301116 1076 for( Int j = i + 1; j <= pcVPS->getMaxLayersMinus1(); j++ ) 1117 1077 { … … 1121 1081 } 1122 1082 } 1123 #else1124 WRITE_CODE( pcVPS->getMaxTidIlRefPicPlus1( i ), 3, "max_tid_il_ref_pics_plus1[i]" );1125 #endif1126 1083 } 1127 1084 } … … 1137 1094 { 1138 1095 WRITE_CODE( pcVPS->getProfileRefMinus1( i ), 6, "profile_ref_minus1[i]" ); 1139 #if H_MV_6_PS_O0109_231140 1096 pcVPS->checkProfileRefMinus1( i ); 1141 #endif1142 1097 } 1143 1098 codePTL( pcVPS->getPTL( i ), pcVPS->getVpsProfilePresentFlag( i ), pcVPS->getMaxTLayers() - 1 ); … … 1156 1111 if( numOutputLayerSets > 1) 1157 1112 { 1158 #if H_MV_6_PS_0109_251159 1113 WRITE_CODE( pcVPS->getDefaultOneTargetOutputLayerIdc( ), 2, "default_one_target_output_layer_idc" ); 1160 1114 pcVPS->checkDefaultOneTargetOutputLayerIdc(); 1161 #else1162 WRITE_FLAG( pcVPS->getDefaultOneTargetOutputLayerFlag( ) ? 1 : 0, "default_one_target_output_layer_flag" );1163 #endif1164 1115 } 1165 1116 1166 #if H_MV_6_HRD_O0217_131167 1117 assert( pcVPS->getOutputLayerFlag(0, 0) == pcVPS->inferOutputLayerFlag( 0, 0 )); 1168 1118 assert( pcVPS->getOutputLayerSetIdxMinus1( 0 ) == -1 ); 1169 #endif1170 1119 for( Int i = 1; i < numOutputLayerSets; i++ ) 1171 1120 { … … 1178 1127 } 1179 1128 } 1180 #if H_MV_6_HRD_O0217_131181 1129 else 1182 1130 { // These inference rules would also be helpful in spec text … … 1187 1135 } 1188 1136 } 1189 #endif1190 1137 1191 1138 if ( pcVPS->getProfileLevelTierIdxLen() > 0 ) … … 1195 1142 } 1196 1143 1197 #if H_MV_6_GEN_0153_281198 1144 if( pcVPS->getMaxLayersMinus1() > 0 ) 1199 1145 { 1200 1146 WRITE_FLAG( pcVPS->getAltOutputLayerFlag( ) ? 1 : 0 , "alt_output_layer_flag" ); 1201 1147 } 1202 #endif1203 1148 1204 1149 WRITE_FLAG( pcVPS->getRepFormatIdxPresentFlag( ) ? 1 : 0 , "rep_format_idx_present_flag" ); … … 1210 1155 for (Int i = 0; i <= pcVPS->getVpsNumRepFormatsMinus1(); i++ ) 1211 1156 { 1212 #if H_MV_6_PS_REP_FORM_18_19_201213 1157 TComRepFormat* curRepFormat = pcVPS->getRepFormat(i); 1214 1158 TComRepFormat* prevRepFormat = i > 0 ? pcVPS->getRepFormat( i - 1) : NULL; 1215 1159 codeRepFormat( i, curRepFormat , prevRepFormat); 1216 #else1217 TComRepFormat* pcRepFormat = pcVPS->getRepFormat(i);1218 codeRepFormat( pcRepFormat );1219 #endif1220 1160 } 1221 1161 … … 1226 1166 if( pcVPS->getVpsNumRepFormatsMinus1() > 0 ) 1227 1167 { 1228 #if H_MV_6_PS_REP_FORM_18_19_201229 1168 WRITE_CODE( pcVPS->getVpsRepFormatIdx( i ), 8, "vps_rep_format_idx" ); 1230 #else1231 WRITE_CODE( pcVPS->getVpsRepFormatIdx( i ), 4, "vps_rep_format_idx" );1232 #endif1233 1169 } 1234 1170 } … … 1236 1172 1237 1173 WRITE_FLAG( pcVPS->getMaxOneActiveRefLayerFlag( ) ? 1 : 0, "max_one_active_ref_layer_flag" ); 1238 #if H_MV_6_MISC_O0062_311239 1174 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1240 1175 { … … 1244 1179 } 1245 1180 } 1246 #endif1247 #if H_MV_6_HRD_O0217_131248 1181 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 1254 1183 WRITE_UVLC( pcVPS->getDirectDepTypeLenMinus2 ( ), "direct_dep_type_len_minus2"); 1255 1184 1256 #if H_MV_6_PS_O0096_211257 1185 WRITE_FLAG( pcVPS->getDefaultDirectDependencyFlag( ) ? 1 : 0 , "default_direct_dependency_flag" ); 1258 1186 … … 1280 1208 } 1281 1209 } 1282 #else1283 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 #endif1295 1210 WRITE_FLAG ( 0, "vps_shvc_reserved_zero_flag" ); 1296 #if !H_MV_6_PS_O0109_241297 WRITE_FLAG( pcVPS->getVpsVuiPresentFlag( ) ? 1 : 0 , "vps_vui_present_flag" );1298 #endif1299 1211 1300 1212 if( pcVPS->getVpsVuiPresentFlag() ) … … 1304 1216 } 1305 1217 } 1306 #if H_MV_6_PS_O0118_331307 1218 Void TEncCavlc::codeVideoSignalInfo( TComVideoSignalInfo* pcVideoSignalInfo ) 1308 1219 { … … 1314 1225 WRITE_CODE( pcVideoSignalInfo->getMatrixCoeffsVps( ), 8, "matrix_coeffs_vps" ); 1315 1226 } 1316 #endif 1317 1318 #if H_MV_6_HRD_O0217_13 1227 1319 1228 Void TEncCavlc::codeDpbSize( TComVPS* vps ) 1320 1229 { … … 1356 1265 } 1357 1266 } 1358 #endif 1359 1360 #if H_MV_6_PS_REP_FORM_18_19_20 1267 1361 1268 Void TEncCavlc::codeRepFormat( Int i, TComRepFormat* pcRepFormat, TComRepFormat* pcPrevRepFormat ) 1362 #else1363 Void TEncCavlc::codeRepFormat( TComRepFormat* pcRepFormat )1364 #endif1365 1269 { 1366 1270 assert( pcRepFormat ); 1367 1271 1368 #if H_MV_6_PS_REP_FORM_18_19_201369 1272 WRITE_CODE( pcRepFormat->getPicWidthVpsInLumaSamples( ), 16, "pic_width_vps_in_luma_samples" ); 1370 1273 WRITE_CODE( pcRepFormat->getPicHeightVpsInLumaSamples( ), 16, "pic_height_vps_in_luma_samples" ); … … 1375 1278 if ( pcRepFormat->getChromaAndBitDepthVpsPresentFlag() ) 1376 1279 { 1377 #endif1378 1280 WRITE_CODE( pcRepFormat->getChromaFormatVpsIdc( ), 2, "chroma_format_vps_idc" ); 1379 1281 … … 1382 1284 WRITE_FLAG( pcRepFormat->getSeparateColourPlaneVpsFlag( ) ? 1 : 0 , "separate_colour_plane_vps_flag" ); 1383 1285 } 1384 #if !H_MV_6_PS_REP_FORM_18_19_201385 WRITE_CODE( pcRepFormat->getPicWidthVpsInLumaSamples( ), 16, "pic_width_vps_in_luma_samples" );1386 WRITE_CODE( pcRepFormat->getPicHeightVpsInLumaSamples( ), 16, "pic_height_vps_in_luma_samples" );1387 #endif1388 1286 WRITE_CODE( pcRepFormat->getBitDepthVpsLumaMinus8( ), 4, "bit_depth_vps_luma_minus8" ); 1389 1287 WRITE_CODE( pcRepFormat->getBitDepthVpsChromaMinus8( ), 4, "bit_depth_vps_chroma_minus8" ); 1390 #if H_MV_6_PS_REP_FORM_18_19_201391 1288 } 1392 1289 else … … 1394 1291 pcRepFormat->inferChromaAndBitDepth(pcPrevRepFormat, true ); 1395 1292 } 1396 #endif1397 1293 } 1398 1294 … … 1405 1301 assert( pcVPSVUI ); 1406 1302 1407 #if H_MV_6_PS_O0223_291408 1303 WRITE_FLAG( pcVPSVUI->getCrossLayerPicTypeAlignedFlag( ) ? 1 : 0 , "cross_layer_pic_type_aligned_flag" ); 1409 1304 if ( !pcVPSVUI->getCrossLayerPicTypeAlignedFlag() ) … … 1411 1306 WRITE_FLAG( pcVPSVUI->getCrossLayerIrapAlignedFlag( ) ? 1 : 0 , "cross_layer_irap_aligned_flag" ); 1412 1307 } 1413 #endif1414 1308 1415 1309 WRITE_FLAG( pcVPSVUI->getBitRatePresentVpsFlag( ) ? 1 : 0 , "bit_rate_present_vps_flag" ); … … 1443 1337 } 1444 1338 1445 #if H_MV_6_O0226_371446 1339 WRITE_FLAG( pcVPSVUI->getTilesNotInUseFlag( ) ? 1 : 0 , "tiles_not_in_use_flag" ); 1447 1340 if( !pcVPSVUI->getTilesNotInUseFlag() ) … … 1478 1371 } 1479 1372 } 1480 #else1481 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 #endif1489 1373 WRITE_FLAG( pcVPSVUI->getIlpRestrictedRefLayersFlag( ) ? 1 : 0 , "ilp_restricted_ref_layers_flag" ); 1490 1374 … … 1507 1391 } 1508 1392 } 1509 #if H_MV_6_PS_O0118_331510 1393 WRITE_FLAG( pcVPSVUI->getVideoSignalInfoIdxPresentFlag( ) ? 1 : 0 , "video_signal_info_idx_present_flag" ); 1511 1394 if( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() ) … … 1540 1423 } 1541 1424 } 1542 #endif1543 #if H_MV_6_HRD_O0164_151544 1425 WRITE_FLAG( pcVPSVUI->getVpsVuiBspHrdPresentFlag( ) ? 1 : 0 , "vps_vui_bsp_hrd_present_flag" ); 1545 1426 if ( pcVPSVUI->getVpsVuiBspHrdPresentFlag( ) ) … … 1547 1428 codeVpsVuiBspHrdParameters( pcVPS ); 1548 1429 } 1549 #endif 1550 } 1551 #if H_MV_6_HRD_O0164_15 1430 } 1552 1431 Void TEncCavlc::codeVpsVuiBspHrdParameters( TComVPS* pcVPS ) 1553 1432 { … … 1606 1485 } 1607 1486 } 1608 #endif1609 1487 1610 1488 #endif … … 1621 1499 #if H_3D_IV_MERGE 1622 1500 WRITE_FLAG( pcVPS->getIvMvPredFlag ( i ) ? 1 : 0 , "iv_mv_pred_flag[i]"); 1623 #if MTK_SPIVMP_F01101501 #if H_3D_SPIVMP 1624 1502 WRITE_UVLC( pcVPS->getSubPULog2Size(i)-2, "log2_sub_PU_size_minus2[i]"); 1625 1503 #endif … … 1637 1515 else 1638 1516 { 1639 #if QC_DEPTH_IV_MRG_F01251640 1517 if(i!=1) 1641 1518 { 1642 1519 WRITE_FLAG( pcVPS->getIvMvPredFlag ( i ) ? 1 : 0 , "iv_mv_pred_flag[i]"); 1643 1520 } 1644 #endif 1645 #if MTK_SPIVMP_F0110 1521 #if H_3D_SPIVMP 1646 1522 if (i!=1) 1647 1523 { … … 1649 1525 } 1650 1526 #endif 1651 #if SEC_MPI_ENABLING_MERGE_F01501527 #if H_3D_IV_MERGE 1652 1528 WRITE_FLAG( pcVPS->getMPIFlag( i ) ? 1 : 0 , "mpi_flag[i]" ); 1653 1529 #endif 1654 1530 WRITE_FLAG( pcVPS->getVpsDepthModesFlag( i ) ? 1 : 0 , "vps_depth_modes_flag[i]" ); 1655 1531 //WRITE_FLAG( pcVPS->getLimQtPredFlag ( i ) ? 1 : 0 , "lim_qt_pred_flag[i]" ); 1656 #if H_3D_DIM_DLT1657 #if !DLT_DIFF_CODING_IN_PPS1658 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 mapping1665 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 #endif1672 #endif1673 1532 #if H_3D_INTER_SDC 1674 1533 WRITE_FLAG( pcVPS->getInterSDCFlag( i ) ? 1 : 0, "depth_inter_SDC_flag" ); … … 1677 1536 } 1678 1537 } 1679 #if CAM_HLS_F0136_F0045_F00821680 1538 WRITE_UVLC( pcVPS->getCamParPrecision(), "cp_precision" ); 1681 1539 for (UInt viewIndex=0; viewIndex<pcVPS->getNumViews(); viewIndex++) … … 1697 1555 } 1698 1556 } 1699 #endif1700 1557 #if H_3D_TMVP 1701 1558 WRITE_FLAG( pcVPS->getIvMvScalingFlag( ) ? 1 : 0 , "iv_mv_scaling_flag" ); … … 1739 1596 WRITE_FLAG( 0, "no_output_of_prior_pics_flag" ); 1740 1597 } 1598 #if PPS_FIX_DEPTH 1599 if( pcSlice->getIsDepth() ) 1600 { 1601 WRITE_UVLC( 1, "slice_pic_parameter_set_id" ); 1602 } 1603 else 1604 #endif 1741 1605 WRITE_UVLC( pcSlice->getPPS()->getPPSId(), "slice_pic_parameter_set_id" ); 1742 1606 pcSlice->setDependentSliceSegmentFlag(!pcSlice->isNextSlice()); … … 1753 1617 #if H_MV 1754 1618 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 1756 1633 if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb ) 1757 1634 { … … 1759 1636 WRITE_FLAG( pcSlice->getPocResetFlag( ) ? 1 : 0 , "poc_reset_flag" ); 1760 1637 } 1761 #endif1762 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_111770 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 #endif1783 1638 1784 1639 … … 1804 1659 // if( separate_colour_plane_flag == 1 ) 1805 1660 // colour_plane_id u(2) 1806 1807 #if H_MV_6_POC_31_35_38 1661 #if H_MV 1808 1662 if ( (pcSlice->getLayerId() > 0 && !vps->getPocLsbNotPresentFlag( pcSlice->getLayerIdInVps())) || !pcSlice->getIdrPicFlag() ) 1809 1663 { … … 1814 1668 if( !pcSlice->getIdrPicFlag() ) 1815 1669 { 1816 #if !H_MV _6_POC_31_35_381670 #if !H_MV 1817 1671 Int picOrderCntLSB = (pcSlice->getPOC()-pcSlice->getLastIDR()+(1<<pcSlice->getSPS()->getBitsForPOC())) & ((1<<pcSlice->getSPS()->getBitsForPOC())-1); 1818 1672 WRITE_CODE( picOrderCntLSB, pcSlice->getSPS()->getBitsForPOC(), "pic_order_cnt_lsb"); … … 1931 1785 } 1932 1786 #if H_MV 1933 #if H_MV_6_ILDDS_ILREFPICS_27_341934 1787 Bool interLayerPredLayerIdcPresentFlag = false; 1935 #endif1936 1788 Int layerId = pcSlice->getLayerId(); 1937 1789 if( pcSlice->getLayerId() > 0 && !vps->getAllRefLayersActiveFlag() && vps->getNumDirectRefLayers( layerId ) > 0 ) … … 1946 1798 if ( pcSlice->getNumActiveRefLayerPics() != vps->getNumDirectRefLayers( layerId ) ) 1947 1799 { 1948 #if H_MV_6_ILDDS_ILREFPICS_27_341949 1800 interLayerPredLayerIdcPresentFlag = true; 1950 #endif1951 1801 for( Int idx = 0; idx < pcSlice->getNumActiveRefLayerPics(); idx++ ) 1952 1802 { … … 1956 1806 } 1957 1807 } 1958 #if H_MV_6_ILDDS_ILREFPICS_27_341959 1808 if ( !interLayerPredLayerIdcPresentFlag ) 1960 1809 { … … 1964 1813 } 1965 1814 } 1966 #endif1967 1815 #endif 1968 1816 if(pcSlice->getSPS()->getUseSAO()) … … 1983 1831 { 1984 1832 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 1985 1836 WRITE_FLAG( overrideFlag ? 1 : 0, "num_ref_idx_active_override_flag"); 1986 1837 if (overrideFlag) … … 2002 1853 pcSlice->setNumRefIdx(REF_PIC_LIST_1, 0); 2003 1854 } 2004 1855 #if PPS_FIX_DEPTH 1856 if( (pcSlice->getPPS()->getListsModificationPresentFlag() || (pcSlice->getIsDepth() && !pcSlice->getViewIndex())) && pcSlice->getNumRpsCurrTempList() > 1) 1857 #else 2005 1858 if( pcSlice->getPPS()->getListsModificationPresentFlag() && pcSlice->getNumRpsCurrTempList() > 1) 1859 #endif 2006 1860 { 2007 1861 TComRefPicListModification* refPicListModification = pcSlice->getRefPicListModification(); … … 2086 1940 } 2087 1941 #if H_3D_IC 2088 #if SEC_ONLY_TEXTURE_IC_F01512089 1942 else if( pcSlice->getViewIndex() && ( pcSlice->getSliceType() == P_SLICE || pcSlice->getSliceType() == B_SLICE ) && !pcSlice->getIsDepth()) 2090 #else2091 else if( pcSlice->getViewIndex() && ( pcSlice->getSliceType() == P_SLICE || pcSlice->getSliceType() == B_SLICE ) )2092 #endif2093 1943 { 2094 1944 WRITE_FLAG( pcSlice->getApplyIC() ? 1 : 0, "slice_ic_enable_flag" ); … … 2108 1958 { 2109 1959 #if H_3D_IV_MERGE 2110 #if SEC_MPI_ENABLING_MERGE_F01502111 1960 if(pcSlice->getIsDepth()) 2112 1961 { … … 2120 1969 WRITE_UVLC( ( ivMvPredFlag ? MRG_MAX_NUM_CANDS_MEM : MRG_MAX_NUM_CANDS ) - pcSlice->getMaxNumMergeCand(), "five_minus_max_num_merge_cand"); 2121 1970 } 2122 #else2123 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 #endif2126 1971 #else 2127 1972 WRITE_UVLC(MRG_MAX_NUM_CANDS - pcSlice->getMaxNumMergeCand(), "five_minus_max_num_merge_cand"); … … 2162 2007 } 2163 2008 } 2164 #if CAM_HLS_F0044 2165 #if QC_DEPTH_IV_MRG_F0125 2166 #if CAM_HLS_F0136_F0045_F0082 2009 #if H_3D 2167 2010 if( pcSlice->getVPS()->hasCamParInSliceHeader( pcSlice->getViewIndex() ) && !pcSlice->getIsDepth() ) 2168 #else2169 if( pcSlice->getSPS()->hasCamParInSliceHeader() && !pcSlice->getIsDepth() )2170 #endif2171 #else2172 if( pcSlice->getSPS()->hasCamParInSliceHeader() )2173 #endif2174 2011 { 2175 2012 for( UInt uiId = 0; uiId < pcSlice->getViewIndex(); uiId++ ) … … 2183 2020 #endif 2184 2021 2022 #if PPS_FIX_DEPTH 2023 if(pcSlice->getPPS()->getSliceHeaderExtensionPresentFlag() || pcSlice->getIsDepth() ) 2024 #else 2185 2025 if(pcSlice->getPPS()->getSliceHeaderExtensionPresentFlag()) 2186 { 2187 #if !H_3D || CAM_HLS_F0044 2026 #endif 2027 { 2188 2028 WRITE_UVLC(0,"slice_header_extension_length"); 2189 #else2190 WRITE_UVLC(0,"slice_header_extension_length"); //<- this element needs to be set to the correct value!!2191 #if QC_DEPTH_IV_MRG_F01252192 #if CAM_HLS_F0136_F0045_F00822193 if( pcSlice->getVPS()->hasCamParInSliceHeader( pcSlice->getViewIndex() ) && !pcSlice->getIsDepth() )2194 #else2195 if( pcSlice->getSPS()->hasCamParInSliceHeader() && !pcSlice->getIsDepth() )2196 #endif2197 #else2198 if( pcSlice->getSPS()->hasCamParInSliceHeader() )2199 #endif2200 {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 #endif2217 2029 } 2218 2030 } -
trunk/source/Lib/TLibEncoder/TEncCavlc.h
r758 r773 86 86 #if H_MV 87 87 Void codeVPSExtension ( TComVPS *pcVPS ); 88 #if H_MV_6_PS_O0118_3389 88 Void codeVideoSignalInfo ( TComVideoSignalInfo* pcVideoSignalInfo ); 90 #endif91 89 92 #if H_MV_6_HRD_O0217_1393 90 Void codeDpbSize ( TComVPS* vps ); 94 #endif95 91 96 #if H_MV_6_PS_REP_FORM_18_19_2097 92 Void codeRepFormat ( Int i, TComRepFormat* curRepFormat, TComRepFormat* prevRepFormat ); 98 #else99 Void codeRepFormat ( TComRepFormat* pcRepFormat );100 #endif101 93 Void codeVPSVUI ( TComVPS* pcVPS ); 102 #if H_MV_6_HRD_O0164_15103 94 Void codeVpsVuiBspHrdParameters( TComVPS* pcVPS ); 104 #endif105 95 #endif 106 96 Void codeVUI ( TComVUI *pcVUI, TComSPS* pcSPS ); … … 117 107 Void codePPS ( TComPPS* pcPPS ); 118 108 119 #if DLT_DIFF_CODING_IN_PPS109 #if H_3D 120 110 Void codePPSExtension ( TComPPS* pcPPS ); 121 111 #endif -
trunk/source/Lib/TLibEncoder/TEncCfg.h
r758 r773 331 331 #endif 332 332 333 #if DLT_DIFF_CODING_IN_PPS333 #if H_3D 334 334 TComDLT* m_cDLT; 335 335 #endif … … 408 408 UInt m_uiARPStepNum; 409 409 #endif 410 #if MTK_SPIVMP_F0110410 #if H_3D_SPIVMP 411 411 Int m_iSubPULog2Size; 412 412 #endif … … 420 420 #if H_3D_DIM 421 421 Bool m_useDMM; 422 #if !SEC_DMM3_RBC_F0147423 Bool m_useRBC;424 #endif425 422 Bool m_useSDC; 426 423 Bool m_useDLT; 427 424 #endif 428 #if SEC_MPI_ENABLING_MERGE_F0150425 #if H_3D_IV_MERGE 429 426 Bool m_useMPI; 430 427 #endif … … 514 511 Void setARPStepNum ( UInt u ) { m_uiARPStepNum = u; } 515 512 #endif 516 #if MTK_SPIVMP_F0110513 #if H_3D_SPIVMP 517 514 Int getSubPULog2Size () { return m_iSubPULog2Size;} 518 515 Void setSubPULog2Size (Int u) { m_iSubPULog2Size = u; } … … 873 870 #endif 874 871 875 #if DLT_DIFF_CODING_IN_PPS872 #if H_3D 876 873 Void setDLT ( TComDLT *p ) { m_cDLT = p; } 877 874 TComDLT* getDLT () { return m_cDLT; } … … 1003 1000 Bool getUseDMM () { return m_useDMM; } 1004 1001 Void setUseDMM ( Bool b) { m_useDMM = b; } 1005 #if !SEC_DMM3_RBC_F01471006 Bool getUseRBC () { return m_useRBC; }1007 Void setUseRBC ( Bool b) { m_useRBC = b; }1008 #endif1009 1002 Bool getUseSDC () { return m_useSDC; } 1010 1003 Void setUseSDC ( Bool b) { m_useSDC = b; } … … 1018 1011 Bool getUsePC () { return m_bUsePC; } 1019 1012 #endif 1020 #if SEC_MPI_ENABLING_MERGE_F01501013 #if H_3D_IV_MERGE 1021 1014 Void setUseMPI ( Bool b ) { m_useMPI = b; } 1022 1015 Bool getUseMPI () { return m_useMPI; } -
trunk/source/Lib/TLibEncoder/TEncCu.cpp
r735 r773 497 497 #endif 498 498 #if H_3D_IC 499 #if SEC_ONLY_TEXTURE_IC_F0151500 499 Bool bICEnabled = rpcTempCU->getSlice()->getViewIndex() && ( rpcTempCU->getSlice()->getSliceType() == P_SLICE || rpcTempCU->getSlice()->getSliceType() == B_SLICE ) && !rpcTempCU->getSlice()->getIsDepth(); 501 #else502 Bool bICEnabled = rpcTempCU->getSlice()->getViewIndex() && ( rpcTempCU->getSlice()->getSliceType() == P_SLICE || rpcTempCU->getSlice()->getSliceType() == B_SLICE );503 #endif504 500 bICEnabled = bICEnabled && rpcTempCU->getSlice()->getApplyIC(); 505 501 #endif … … 571 567 PartSize ePartTemp = rpcTempCU->getPartitionSize(0); 572 568 rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth ); 573 #if QC_DEPTH_IV_MRG_F0125569 #if H_3D_IV_MERGE 574 570 if (rpcTempCU->getSlice()->getIsDepth() ) 575 571 { … … 586 582 DvInfo.bDV = rpcTempCU->getDisMvpCandNBDV(&DvInfo); 587 583 588 #if QC_DEPTH_IV_MRG_F0125584 #if H_3D_IV_MERGE 589 585 } 590 586 #endif … … 1779 1775 #endif 1780 1776 1781 #if H_3D_ARP && LGE_SHARP_VSP_INHERIT_F01041777 #if H_3D_ARP 1782 1778 DisInfo cOrigDisInfo = rpcTempCU->getDvInfo(0); 1783 1779 #else … … 1787 1783 1788 1784 #if H_3D_VSP 1789 #if ! (H_3D_ARP && LGE_SHARP_VSP_INHERIT_F0104)1785 #if !H_3D_ARP 1790 1786 Int vspFlag[MRG_MAX_NUM_CANDS_MEM]; 1791 1787 memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 1792 1788 InheritedVSPDisInfo inheritedVSPDisInfo[MRG_MAX_NUM_CANDS_MEM]; 1793 #if ETRIKHU_MERGE_REUSE_F00931794 1789 rpcTempCU->m_bAvailableFlagA1 = 0; 1795 1790 rpcTempCU->m_bAvailableFlagB1 = 0; … … 1799 1794 rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand ); 1800 1795 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 1807 1799 rpcTempCU->m_bAvailableFlagA1 = 0; 1808 1800 rpcTempCU->m_bAvailableFlagB1 = 0; … … 1822 1814 Int mergeCandBuffer[MRG_MAX_NUM_CANDS]; 1823 1815 #endif 1824 #if H_3D_ARP && LGE_SHARP_VSP_INHERIT_F01041816 #if H_3D_ARP 1825 1817 for( UInt ui = 0; ui < rpcTempCU->getSlice()->getMaxNumMergeCand(); ++ui ) 1826 1818 #else … … 1851 1843 for( Int nARPW=nARPWMax; nARPW >= 0 ; nARPW-- ) 1852 1844 { 1853 #if FIX_MISSING_MACRO_R6901854 1845 memset( mergeCandBuffer, 0, MRG_MAX_NUM_CANDS_MEM*sizeof(Int) ); 1855 #else1856 memset( mergeCandBuffer, 0, MRG_MAX_NUM_CANDS*sizeof(Int) );1857 #endif1858 #if LGE_SHARP_VSP_INHERIT_F01041859 1846 rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uhDepth ); // interprets depth relative to LCU level 1860 1847 rpcTempCU->setCUTransquantBypassSubParts( m_pcEncCfg->getCUTransquantBypassFlagValue(), 0, uhDepth ); … … 1868 1855 memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 1869 1856 InheritedVSPDisInfo inheritedVSPDisInfo[MRG_MAX_NUM_CANDS_MEM]; 1870 #if MTK_SPIVMP_F01101857 #if H_3D_SPIVMP 1871 1858 Bool bSPIVMPFlag[MRG_MAX_NUM_CANDS_MEM]; 1872 1859 memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM); … … 1876 1863 puhInterDirSP = new UChar[rpcTempCU->getPic()->getPicSym()->getNumPartition()]; 1877 1864 #endif 1878 #if ETRIKHU_MERGE_REUSE_F00931865 #if H_3D 1879 1866 rpcTempCU->initAvailableFlags(); 1880 1867 rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand ); 1881 1868 rpcTempCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag,inheritedVSPDisInfo 1882 #if MTK_SPIVMP_F01101869 #if H_3D_SPIVMP 1883 1870 , bSPIVMPFlag, pcMvFieldSP, puhInterDirSP 1884 1871 #endif … … 1888 1875 rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, numValidMergeCand ); 1889 1876 #endif 1890 #endif 1877 1891 1878 #endif 1892 1879 for( UInt uiNoResidual = 0; uiNoResidual < iteration; ++uiNoResidual ) … … 1923 1910 rpcTempCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeCand].m_acDvInfo, 0, 0, uhDepth ); 1924 1911 #endif 1925 #if MTK_SPIVMP_F01101912 #if H_3D_SPIVMP 1926 1913 rpcTempCU->setSPIVMPFlagSubParts(bSPIVMPFlag[uiMergeCand], 0, 0, uhDepth); 1927 1914 if (bSPIVMPFlag[uiMergeCand]) … … 1949 1936 rpcTempCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level 1950 1937 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 1975 1939 } 1976 1940 #endif … … 2093 2057 } 2094 2058 } 2095 #if MTK_SPIVMP_F0110 2096 #if MTK_F0110_FIX 2059 #if H_3D_SPIVMP 2097 2060 delete[] pcMvFieldSP; 2098 2061 delete[] puhInterDirSP; 2099 #else2100 delete pcMvFieldSP;2101 delete puhInterDirSP;2102 #endif2103 2062 #endif 2104 2063 #if H_3D_ARP … … 2170 2129 2171 2130 m_pcPredSearch->motionCompensation( rpcTempCU , m_ppcPredYuvTemp[uhDepth] ); 2172 2173 #if !QC_MTK_INTERVIEW_ARP_F0123_F01082174 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 #endif2192 2131 } 2193 2132 else … … 2209 2148 { 2210 2149 m_ppcWeightedTempCU[uhDepth]->copyPartFrom( rpcTempCU , 0 , uhDepth ); 2211 2212 #if !QC_MTK_INTERVIEW_ARP_F0123_F01082213 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 #endif2228 2150 } 2229 2151 } -
trunk/source/Lib/TLibEncoder/TEncEntropy.cpp
r724 r773 160 160 Void TEncEntropy::encodeICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ) 161 161 { 162 #if SEC_ONLY_TEXTURE_IC_F0151163 162 if ( pcCU->isIntra( uiAbsPartIdx ) || ( pcCU->getSlice()->getViewIndex() == 0 ) || pcCU->getSlice()->getIsDepth() ) 164 #else165 if ( pcCU->isIntra( uiAbsPartIdx ) || ( pcCU->getSlice()->getViewIndex() == 0 ) )166 #endif167 163 { 168 164 return; -
trunk/source/Lib/TLibEncoder/TEncGOP.cpp
r738 r773 664 664 refPicListModification->setRefPicListModificationFlagL1(0); 665 665 #if H_MV 666 #if H_MV_6_RALS_O0149_11667 666 if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > 0 ) 668 #else669 if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > 1 )670 #endif671 667 { 672 668 // Some more sophisticated algorithm to determine discardable_flag might be added here. … … 678 674 GOPEntry gopEntry = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid ); 679 675 680 #if H_MV_6_ILDDS_ILREFPICS_27_34681 676 Bool interLayerPredLayerIdcPresentFlag = false; 682 #endif683 677 if ( getLayerId() > 0 && !vps->getAllRefLayersActiveFlag() && numDirectRefLayers > 0 ) 684 678 { … … 692 686 if ( gopEntry.m_numActiveRefLayerPics != vps->getNumDirectRefLayers( getLayerId() ) ) 693 687 { 694 #if H_MV_6_ILDDS_ILREFPICS_27_34695 688 interLayerPredLayerIdcPresentFlag = true; 696 #endif697 689 for (Int i = 0; i < gopEntry.m_numActiveRefLayerPics; i++ ) 698 690 { … … 702 694 } 703 695 } 704 #if H_MV_6_ILDDS_ILREFPICS_27_34705 696 if ( !interLayerPredLayerIdcPresentFlag ) 706 697 { … … 710 701 } 711 702 } 712 #endif713 703 714 704 … … 745 735 #if H_3D_ARP 746 736 //GT: This seems to be broken when layerId in vps is not equal to layerId in nuh 747 #if SHARP_ARP_REF_CHECK_F0105748 737 pcSlice->setARPStepNum(m_ivPicLists); 749 #else750 pcSlice->setARPStepNum();751 #endif752 738 if(pcSlice->getARPStepNum() > 1) 753 739 { … … 1319 1305 nalu = NALUnit(NAL_UNIT_PPS); 1320 1306 #endif 1307 #if PPS_FIX_DEPTH 1308 if(!pcSlice->getIsDepth() || !pcSlice->getViewIndex() ) 1309 { 1310 #endif 1321 1311 m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream); 1322 1312 m_pcEntropyCoder->encodePPS(pcSlice->getPPS()); … … 1326 1316 actualTotalBits += UInt(accessUnit.back()->m_nalUnitData.str().size()) * 8; 1327 1317 #endif 1328 1318 #if PPS_FIX_DEPTH 1319 } 1320 #endif 1329 1321 xCreateLeadingSEIMessages(accessUnit, pcSlice->getSPS()); 1330 1322 -
trunk/source/Lib/TLibEncoder/TEncSbac.cpp
r758 r773 95 95 #if H_3D_DIM_DMM 96 96 , m_cDmm1DataSCModel ( 1, 1, NUM_DMM1_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels) 97 #if !SEC_DMM3_RBC_F014798 , m_cDmm3DataSCModel ( 1, 1, NUM_DMM3_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels)99 #endif100 #endif101 #if H_3D_DIM_RBC102 , m_cRbcDataSCModel ( 1, 1, NUM_RBC_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels)103 97 #endif 104 98 #if H_3D_DIM_SDC … … 176 170 #if H_3D_DIM_DMM 177 171 m_cDmm1DataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA ); 178 #if !SEC_DMM3_RBC_F0147179 m_cDmm3DataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM3_DATA );180 #endif181 #endif182 #if H_3D_DIM_RBC183 m_cRbcDataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_RBC_DATA );184 172 #endif 185 173 #if H_3D_DIM_SDC … … 266 254 #if H_3D_DIM_DMM 267 255 curCost += m_cDmm1DataSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_DMM1_DATA ); 268 #if !SEC_DMM3_RBC_F0147269 curCost += m_cDmm3DataSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_DMM3_DATA );270 #endif271 #endif272 #if H_3D_DIM_RBC273 curCost += m_cRbcDataSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_RBC_DATA );274 256 #endif 275 257 } … … 337 319 #if H_3D_DIM_DMM 338 320 m_cDmm1DataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA ); 339 #if !SEC_DMM3_RBC_F0147340 m_cDmm3DataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM3_DATA );341 #endif342 #endif343 #if H_3D_DIM_RBC344 m_cRbcDataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_RBC_DATA );345 321 #endif 346 322 #if H_3D_DIM_SDC … … 526 502 } 527 503 528 #if QC_DIM_DELTADC_UNIFY_F0132529 504 Void TEncSbac::xCodeDimDeltaDC( Pel valDeltaDC, UInt uiNumSeg ) 530 505 { … … 536 511 } 537 512 } 538 #else539 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 #endif549 513 550 514 #if H_3D_DIM_DMM … … 557 521 } 558 522 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 619 525 #if H_3D_DIM_SDC 620 526 Void TEncSbac::xCodeSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment ) … … 632 538 633 539 #if H_3D_DIM_DLT 634 #if DLT_DIFF_CODING_IN_PPS635 540 UInt uiMaxResidualBits = pcCU->getSlice()->getPPS()->getDLT()->getBitsPerDepthValue( pcCU->getSlice()->getLayerIdInVps() ); 636 #else637 UInt uiMaxResidualBits = pcCU->getSlice()->getVPS()->getBitsPerDepthValue( pcCU->getSlice()->getLayerIdInVps() );638 #endif639 541 #else 640 542 UInt uiMaxResidualBits = g_bitDepthY; … … 655 557 DTRACE_CU("sdc_residual_sign_flag[i]", uiSign) 656 558 #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() ); 664 561 #else 665 562 UInt uiNumDepthValues = ((1 << g_bitDepthY)-1); 666 563 #endif 564 667 565 assert(uiAbsIdx <= uiNumDepthValues); 668 566 … … 1239 1137 xCodeDmm1WedgeIdx( pcCU->getDmmWedgeTabIdx( dimType, absPartIdx ), g_dmm1TabIdxBits[pcCU->getIntraSizeIdx(absPartIdx)] ); 1240 1138 } break; 1241 #if !SEC_DMM3_RBC_F01471242 case( DMM3_IDX ):1243 {1244 xCodeDmm3WedgeIdx( pcCU->getDmm3IntraTabIdx( absPartIdx ), g_dmm3IntraTabIdxBits[pcCU->getIntraSizeIdx(absPartIdx)] );1245 } break;1246 #endif1247 1139 case( DMM4_IDX ): break; 1248 1140 #endif 1249 #if H_3D_DIM_RBC1250 case( RBC_IDX ):1251 {1252 assert( pcCU->getWidth( absPartIdx ) < 64 );1253 xCodeRbcEdge( pcCU, absPartIdx );1254 } break;1255 #endif1256 1141 default: break; 1257 1142 } 1258 1143 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; 1292 1154 } 1293 1155 else 1294 1156 { 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 } 1323 1176 } 1324 1177 1325 1178 Void TEncSbac::codeIntraDepthMode( TComDataCU* pcCU, UInt absPartIdx ) 1326 1179 { 1327 #if SEC_DMM3_RBC_F01471328 1180 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}}; 1329 1181 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 #else1331 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 #endif1334 1182 UInt dir = pcCU->getLumaIntraDir( absPartIdx ); 1335 1183 UInt puIdx = (pcCU->getWidth(absPartIdx) == 64) ? 2 : ( (pcCU->getPartitionSize(absPartIdx) == SIZE_NxN && pcCU->getWidth(absPartIdx) == 8) ? 0 : 1 ); … … 1346 1194 case DMM1_IDX: codeIdx = 3; break; 1347 1195 case DMM4_IDX: codeIdx = 4; break; 1348 #if !SEC_DMM3_RBC_F01471349 case DMM3_IDX: codeIdx = 5; break;1350 case RBC_IDX: codeIdx = 6; break;1351 #endif1352 1196 default: break; 1353 1197 } … … 1362 1206 default: codeIdx = 2; break; 1363 1207 } 1364 }1365 #endif1366 #if !SEC_DMM3_RBC_F01471367 if( puIdx==1 )1368 {1369 if( codeIdx==1 || codeIdx==2 || codeIdx==4 )1370 {1371 m_pcBinIf->encodeBinEP( 0 );1372 }1373 else1374 {1375 m_pcBinIf->encodeBinEP( 1 );1376 }1377 1208 } 1378 1209 #endif -
trunk/source/Lib/TLibEncoder/TEncSbac.h
r724 r773 116 116 Void xWriteEpExGolomb ( UInt uiSymbol, UInt uiCount ); 117 117 Void xWriteCoefRemainExGolomb ( UInt symbol, UInt &rParam ); 118 118 #if H_3D_DIM 119 119 Void xWriteExGolombLevel ( UInt uiSymbol, ContextModel& rcSCModel ); 120 #if QC_DIM_DELTADC_UNIFY_F0132121 120 Void xCodeDimDeltaDC ( Pel valDeltaDC, UInt uiNumSeg ); 122 #else123 Void xCodeDimDeltaDC ( Pel valDeltaDC, UInt dimType );124 #endif125 121 #if H_3D_DIM_DMM 126 122 Void xCodeDmm1WedgeIdx ( UInt uiTabIdx, Int iNumBit ); 127 #if !SEC_DMM3_RBC_F0147128 Void xCodeDmm3WedgeIdx ( UInt uiIntraIdx, Int iNumBit );129 #endif130 #endif131 #if H_3D_DIM_RBC132 Void xCodeRbcEdge ( TComDataCU* pcCU, UInt uiAbsPartIdx );133 123 #endif 134 124 #if H_3D_DIM_SDC … … 259 249 #if H_3D_DIM_DMM 260 250 ContextModel3DBuffer m_cDmm1DataSCModel; 261 #if !SEC_DMM3_RBC_F0147262 ContextModel3DBuffer m_cDmm3DataSCModel;263 #endif264 #endif265 #if H_3D_DIM_RBC266 ContextModel3DBuffer m_cRbcDataSCModel;267 251 #endif 268 252 #if H_3D_DIM_SDC -
trunk/source/Lib/TLibEncoder/TEncSearch.cpp
r758 r773 1124 1124 { 1125 1125 #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()) ) 1134 1130 { 1135 #if DLT_DIFF_CODING_IN_PPS1136 1131 pResi[ uiX ] = pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pOrg[ uiX ] ) - pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pPred[ uiX ] ); 1137 #else1138 pResi[ uiX ] = pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pOrg[ uiX ] ) - pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pPred[ uiX ] );1139 #endif1140 1132 } 1141 1133 else 1142 1134 { 1143 1135 pResi[ uiX ] = pOrg[ uiX ] - pPred[ uiX ]; 1144 1136 } 1145 1137 #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; 1152 1144 #if H_3D_DIM_ENC 1153 1145 } … … 1209 1201 for( UInt uiX = 0; uiX < uiWidth; uiX++ ) 1210 1202 { 1211 #if LGE_PRED_RES_CODING_DLT_DOMAIN_F0159 1212 #if DLT_DIFF_CODING_IN_PPS 1203 #if H_3D_DIM 1213 1204 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 } 1228 1212 #else 1229 1213 pReco [ uiX ] = ClipY( pPred[ uiX ] + pResi[ uiX ] ); … … 1951 1935 // get residual (idx) 1952 1936 #if H_3D_DIM_DLT 1953 #if DLT_DIFF_CODING_IN_PPS1954 1937 Pel pResidualIdx = pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pDCRec ) - pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), apDCPredValues[uiSegment] ); 1955 #else1956 Pel pResidualIdx = pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pDCRec ) - pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), apDCPredValues[uiSegment] );1957 #endif1958 1938 #else 1959 1939 Pel pResidualIdx = pDCRec - apDCPredValues[uiSegment]; … … 1969 1949 { 1970 1950 #if H_3D_DIM_DLT 1971 #if DLT_DIFF_CODING_IN_PPS1972 1951 Pel pPredIdx = pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), apDCPredValues[uiSegment] ); 1973 1952 Pel pResiIdx = pcCU->getSDCSegmentDCOffset(uiSegment, uiAbsPartIdx); 1974 1953 Pel pRecoValue = pcCU->getSlice()->getPPS()->getDLT()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), pPredIdx + pResiIdx ); 1975 #else1976 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 #endif1980 1954 1981 1955 apDCResiValues[uiSegment] = pRecoValue - apDCPredValues[uiSegment]; … … 2924 2898 biSegmentation = &(g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])][uiTabIdx]); 2925 2899 } 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 2945 2901 case( DMM4_IDX ): 2946 2902 { … … 2968 2924 } 2969 2925 #endif 2970 #if H_3D_DIM_RBC2971 if( m_pcEncCfg->getUseRBC()2972 #if H_3D_FAST_DEPTH_INTRA2973 && (uiRdModeList[0] != PLANAR_IDX || varCU >= varThreshold)2974 #endif2975 )2976 {2977 if( xSearchRbcEdge( pcCU, uiPartOffset, piOrg, uiStride, uiWidth, uiHeight ) )2978 {2979 Pel deltaDC1 = 0; Pel deltaDC2 = 0;2980 #if QC_DIM_DELTADC_UNIFY_F01322981 xSearchDmmDeltaDCs( pcCU, uiPartOffset, piOrg, piPred, uiStride, pcCU->getEdgePartition( uiPartOffset ), uiWidth, uiWidth, uiHeight, deltaDC1, deltaDC2 );2982 #else2983 xSearchRbcDeltaDCs( pcCU, uiPartOffset, piOrg, piPred, uiStride, pcCU->getEdgePartition( uiPartOffset ), uiWidth, uiWidth, uiHeight, deltaDC1, deltaDC2 );2984 #endif2985 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 #endif2993 2926 } 2994 2927 #endif … … 3029 2962 Bool bTestZeroResi = false; 3030 2963 #if H_3D_DIM_ENC 3031 #if LGE_BUGFIX_F01583032 2964 bTestZeroResi |= pcCU->getSlice()->getIsDepth() && !pcCU->getSlice()->isIRAP(); 3033 #else3034 bTestZeroResi |= pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->isIRAP();3035 #endif3036 2965 #endif 3037 2966 #if H_3D_DIM_SDC … … 3642 3571 , InheritedVSPDisInfo* inheritedVSPDisInfo 3643 3572 #endif 3644 #if MTK_SPIVMP_F01103573 #if H_3D_SPIVMP 3645 3574 , Bool* pbSPIVMPFlag, TComMvField* pcMvFieldSP, UChar* puhInterDirSP 3646 3575 #endif … … 3660 3589 if ( iPUIdx == 0 ) 3661 3590 { 3662 #if ETRIKHU_MERGE_REUSE_F00933591 #if H_3D 3663 3592 pcCU->initAvailableFlags(); 3664 3593 pcCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand); … … 3668 3597 , inheritedVSPDisInfo 3669 3598 #endif 3670 #if MTK_SPIVMP_F01103599 #if H_3D_SPIVMP 3671 3600 , pbSPIVMPFlag, pcMvFieldSP, puhInterDirSP 3672 3601 #endif … … 3674 3603 ); 3675 3604 #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 ); 3683 3606 #endif 3684 3607 } … … 3687 3610 else 3688 3611 { 3689 #if ETRIKHU_MERGE_REUSE_F00933612 #if H_3D 3690 3613 pcCU->initAvailableFlags(); 3691 3614 pcCU->getInterMergeCandidates( uiAbsPartIdx, iPUIdx, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand); … … 3695 3618 , inheritedVSPDisInfo 3696 3619 #endif 3697 #if MTK_SPIVMP_F01103620 #if H_3D_SPIVMP 3698 3621 , pbSPIVMPFlag, pcMvFieldSP, puhInterDirSP 3699 3622 #endif … … 3701 3624 ); 3702 3625 #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 3709 3627 ); 3710 3628 #endif … … 3726 3644 PartSize ePartSize = pcCU->getPartitionSize( 0 ); 3727 3645 3728 #if MTK_SPIVMP_F01103646 #if H_3D_SPIVMP 3729 3647 pcCU->setSPIVMPFlagSubParts( pbSPIVMPFlag[uiMergeCand], uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx )); 3730 3648 if (pbSPIVMPFlag[uiMergeCand]) … … 3748 3666 pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand], ePartSize, uiAbsPartIdx, 0, iPUIdx ); 3749 3667 pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], ePartSize, uiAbsPartIdx, 0, iPUIdx ); 3750 #if MTK_SPIVMP_F01103668 #if H_3D_SPIVMP 3751 3669 } 3752 3670 #endif … … 4427 4345 DisInfo OriginalDvInfo = pcCU->getDvInfo(uiAbsPartIdx); 4428 4346 #endif 4429 #if MTK_SPIVMP_F01104347 #if H_3D_SPIVMP 4430 4348 Bool bSPIVMPFlag[MRG_MAX_NUM_CANDS_MEM]; 4431 4349 memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM); … … 4440 4358 , inheritedVSPDisInfo 4441 4359 #endif 4442 #if MTK_SPIVMP_F01104360 #if H_3D_SPIVMP 4443 4361 , bSPIVMPFlag, pcMvFieldSP, puhInterDirSP 4444 4362 #endif … … 4454 4372 pcCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMRGIndex].m_acDvInfo, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 4455 4373 #endif 4456 #if MTK_SPIVMP_F01104374 #if H_3D_SPIVMP 4457 4375 pcCU->setSPIVMPFlagSubParts(bSPIVMPFlag[uiMRGIndex], uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 4458 4376 if (bSPIVMPFlag[uiMRGIndex]!=0) … … 4488 4406 pcCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( cMRGMvField[1], ePartSize, uiPartAddr, 0, iPartIdx ); 4489 4407 } 4490 #if MTK_SPIVMP_F01104408 #if H_3D_SPIVMP 4491 4409 } 4492 4410 #endif … … 4502 4420 else 4503 4421 { 4504 #if MTK_SPIVMP_F01104422 #if H_3D_SPIVMP 4505 4423 pcCU->setSPIVMPFlagSubParts(0, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 4506 4424 #endif … … 4517 4435 } 4518 4436 } 4519 #if MTK_SPIVMP_F0110 4520 #if MTK_F0110_FIX 4437 #if H_3D_SPIVMP 4521 4438 delete[] pcMvFieldSP; 4522 4439 delete[] puhInterDirSP; 4523 #else4524 delete pcMvFieldSP;4525 delete puhInterDirSP;4526 #endif4527 4440 #endif 4528 4441 } … … 5438 5351 dZeroCost = dCost + 1; 5439 5352 } 5440 #if MTK_SPIVMP_F01105353 #if H_3D_SPIVMP 5441 5354 if ( dZeroCost < dCost || pcCU->getQtRootCbf(0)==0) 5442 5355 #else … … 7372 7285 7373 7286 #if H_3D_DIM_DLT 7374 #if DLT_DIFF_CODING_IN_PPS7375 7287 rDeltaDC1 = pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), ClipY(predDC1 + rDeltaDC1) ) - pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC1 ); 7376 7288 rDeltaDC2 = pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), ClipY(predDC2 + rDeltaDC2) ) - pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC2 ); 7377 #else7378 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 #endif7381 7289 #endif 7382 7290 } … … 7477 7385 } 7478 7386 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 8506 7390 #endif 8507 7391 //! \} -
trunk/source/Lib/TLibEncoder/TEncSearch.h
r724 r773 351 351 Void xSearchDmmDeltaDCs ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piOrig, Pel* piPredic, UInt uiStride, Bool* biSegPattern, Int patternStride, UInt uiWidth, UInt uiHeight, Pel& rDeltaDC1, Pel& rDeltaDC2 ); 352 352 Void xSearchDmm1Wedge ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx ); 353 #if !SEC_DMM3_RBC_F0147354 Void xSearchDmm3Wedge ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx, UInt& ruiIntraTabIdx, UInt colTexIntraDir );355 #endif356 #endif357 #if H_3D_DIM_RBC358 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 );363 353 #endif 364 354 #if H_3D_DIM_SDC … … 427 417 , InheritedVSPDisInfo* inheritedVSPDisInfo 428 418 #endif 429 #if MTK_SPIVMP_F0110419 #if H_3D_SPIVMP 430 420 , Bool* pbSPIVMPFlag, TComMvField* pcMvFieldSP, UChar* puhInterDirSP 431 421 #endif -
trunk/source/Lib/TLibEncoder/TEncSlice.cpp
r724 r773 556 556 rpcSlice->setSliceSegmentArgument ( m_pcCfg->getSliceSegmentArgument() ); 557 557 #if H_3D_IV_MERGE 558 #if SEC_MPI_ENABLING_MERGE_F0150559 558 if(rpcSlice->getIsDepth()) 560 559 { … … 565 564 rpcSlice->setMaxNumMergeCand ( m_pcCfg->getMaxNumMergeCand() + ( rpcSlice->getVPS()->getIvMvPredFlag( rpcSlice->getLayerIdInVps() ) ? 1 : 0 ) ); 566 565 } 567 #else568 rpcSlice->setMaxNumMergeCand ( m_pcCfg->getMaxNumMergeCand() + ( rpcSlice->getVPS()->getIvMvPredFlag( rpcSlice->getLayerIdInVps() ) ? 1 : 0 ) );569 #endif570 566 #else 571 567 rpcSlice->setMaxNumMergeCand ( m_pcCfg->getMaxNumMergeCand() ); -
trunk/source/Lib/TLibEncoder/TEncTop.cpp
r758 r773 299 299 { 300 300 // initialize SPS 301 #if DLT_DIFF_CODING_IN_PPS301 #if H_3D 302 302 // Assuming that all PPS indirectly refer to the same VPS via different SPS 303 303 m_cSPS.setVPS(m_cVPS); … … 723 723 724 724 #if H_MV 725 #if H_MV_6_PS_REP_FORM_18_19_20726 725 m_cSPS.setUpdateRepFormatFlag ( false ); 727 #else728 m_cSPS.setUpdateRepFormatFlag ( m_layerId == 0 );729 #endif730 726 m_cSPS.setSpsInferScalingListFlag ( m_layerId > 0 && m_cVPS->getInDirectDependencyFlag( getLayerIdInVps(), 0 ) ); 731 727 m_cSPS.setSpsScalingListRefLayerId ( 0 ); 732 #if H_MV_6_PSEM_O0142_3733 728 m_cSPS.setSpsExtensionFlag ( true ); 734 729 m_cSPS.setSpsExtensionTypeFlag ( PS_EX_T_MV ,true ); 735 730 #if H_3D 736 731 m_cSPS.setSpsExtensionTypeFlag ( PS_EX_T_3D ,true ); 737 #endif738 732 #endif 739 733 #endif … … 823 817 pcVUI->setOverscanInfoPresentFlag(getOverscanInfoPresentFlag()); 824 818 pcVUI->setOverscanAppropriateFlag(getOverscanAppropriateFlag()); 825 #if H_MV _6_PS_O0118_33819 #if H_MV 826 820 pcVUI->setVideoSignalTypePresentFlag(getVideoSignalTypePresentFlag() && getLayerId() == 0 ); 827 821 #else 828 822 pcVUI->setVideoSignalTypePresentFlag(getVideoSignalTypePresentFlag()); 829 823 #endif 830 824 pcVUI->setVideoFormat(getVideoFormat()); … … 853 847 pcVUI->setLog2MaxMvLengthVertical(getLog2MaxMvLengthVertical()); 854 848 } 855 #if H_3D856 #if !CAM_HLS_F0136_F0045_F0082857 #if !QC_DEPTH_IV_MRG_F0125858 if ( !m_isDepth )859 #endif860 {861 m_cSPS.initCamParaSPS ( m_viewIndex, m_uiCamParPrecision, m_bCamParInSliceHeader, m_aaiCodedScale, m_aaiCodedOffset );862 }863 #endif864 #endif865 849 } 866 850 … … 877 861 #endif 878 862 879 #if DLT_DIFF_CODING_IN_PPS863 #if H_3D 880 864 m_cPPS.setDLT( getDLT() ); 881 865 #endif … … 948 932 m_cPPS.setOutputFlagPresentFlag( false ); 949 933 #if H_MV 950 #if H_MV_6_RALS_O0149_11951 934 m_cPPS.setNumExtraSliceHeaderBits( 3 ); 952 #else953 m_cPPS.setNumExtraSliceHeaderBits( 2 );954 #endif955 935 #endif 956 936 m_cPPS.setSignHideFlag(getSignHideFlag()); … … 1012 992 } 1013 993 #if H_3D 1014 #if CAM_HLS_F0136_F0045_F00821015 994 if( m_cVPS->hasCamParInSliceHeader( getViewIndex() ) ) 1016 #else1017 if( m_cSPS.hasCamParInSliceHeader() )1018 #endif1019 995 { 1020 996 m_cPPS.setSliceHeaderExtensionPresentFlag( true );
Note: See TracChangeset for help on using the changeset viewer.