Changeset 1390 in 3DVCSoftware for branches/HTM-16.0-MV-draft-5/source/Lib/TLibDecoder
- Timestamp:
- 13 Nov 2015, 17:00:20 (9 years ago)
- Location:
- branches/HTM-16.0-MV-draft-5/source/Lib/TLibDecoder
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-16.0-MV-draft-5/source/Lib/TLibDecoder/SEIread.cpp
r1386 r1390 381 381 xParseSEIMultiviewViewPosition((SEIMultiviewViewPosition&) *sei, payloadSize, pDecodedMessageOutputStream ); 382 382 break; 383 #if NH_3D384 case SEI::ALTERNATIVE_DEPTH_INFO:385 sei = new SEIAlternativeDepthInfo;386 xParseSEIAlternativeDepthInfo((SEIAlternativeDepthInfo&) *sei, payloadSize, pDecodedMessageOutputStream );387 break;388 #endif389 383 #endif 390 384 default: … … 1740 1734 }; 1741 1735 1742 #if NH_3D1743 Void SEIReader::xParseSEIAlternativeDepthInfo(SEIAlternativeDepthInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream)1744 {1745 UInt code;1746 Int scode;1747 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize);1748 1749 sei.resizeArrays( );1750 sei_read_flag( pDecodedMessageOutputStream, code, "alternative_depth_info_cancel_flag" ); sei.m_alternativeDepthInfoCancelFlag = (code == 1);1751 if( sei.m_alternativeDepthInfoCancelFlag == 0 )1752 {1753 sei_read_code( pDecodedMessageOutputStream, 2, code, "depth_type" ); sei.m_depthType = code;1754 if( sei.m_depthType == 0 )1755 {1756 sei_read_uvlc( pDecodedMessageOutputStream, code, "num_constituent_views_gvd_minus1" ); sei.m_numConstituentViewsGvdMinus1 = code;1757 sei_read_flag( pDecodedMessageOutputStream, code, "depth_present_gvd_flag" ); sei.m_depthPresentGvdFlag = (code == 1);1758 sei_read_flag( pDecodedMessageOutputStream, code, "z_gvd_flag" ); sei.m_zGvdFlag = (code == 1);1759 sei_read_flag( pDecodedMessageOutputStream, code, "intrinsic_param_gvd_flag" ); sei.m_intrinsicParamGvdFlag = (code == 1);1760 sei_read_flag( pDecodedMessageOutputStream, code, "rotation_gvd_flag" ); sei.m_rotationGvdFlag = (code == 1);1761 sei_read_flag( pDecodedMessageOutputStream, code, "translation_gvd_flag" ); sei.m_translationGvdFlag = (code == 1);1762 if( sei.m_zGvdFlag )1763 {1764 for( Int i = 0, j = 0; j <= sei.m_numConstituentViewsGvdMinus1 + 1; j++ )1765 {1766 sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_z_near_flag" ); sei.m_signGvdZNearFlag[i][j] = (code == 1);1767 sei_read_code( pDecodedMessageOutputStream, 7, code, "exp_gvd_z_near" ); sei.m_expGvdZNear[i][j] = code;1768 sei_read_code( pDecodedMessageOutputStream, 5, code, "man_len_gvd_z_near_minus1" ); sei.m_manLenGvdZNearMinus1[i][j] = code;1769 sei_read_code( pDecodedMessageOutputStream, sei.m_manLenGvdZNearMinus1[i][j]+1, code, "man_gvd_z_near" ); sei.m_manGvdZNear[i][j] = code;1770 sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_z_far_flag" ); sei.m_signGvdZFarFlag[i][j] = (code == 1);1771 sei_read_code( pDecodedMessageOutputStream, 7, code, "exp_gvd_z_far" ); sei.m_expGvdZFar[i][j] = code;1772 sei_read_code( pDecodedMessageOutputStream, 5, code, "man_len_gvd_z_far_minus1" ); sei.m_manLenGvdZFarMinus1[i][j] = code;1773 sei_read_code( pDecodedMessageOutputStream, sei.m_manLenGvdZFarMinus1[i][j]+1, code, "man_gvd_z_far" ); sei.m_manGvdZFar[i][j] = code;1774 }1775 }1776 if( sei.m_intrinsicParamGvdFlag )1777 {1778 sei_read_uvlc( pDecodedMessageOutputStream, code, "prec_gvd_focal_length" ); sei.m_precGvdFocalLength = code;1779 sei_read_uvlc( pDecodedMessageOutputStream, code, "prec_gvd_principal_point" ); sei.m_precGvdPrincipalPoint = code;1780 }1781 if( sei.m_rotationGvdFlag )1782 {1783 sei_read_uvlc( pDecodedMessageOutputStream, code, "prec_gvd_rotation_param" ); sei.m_precGvdRotationParam = code;1784 }1785 if( sei.m_translationGvdFlag )1786 {1787 sei_read_uvlc( pDecodedMessageOutputStream, code, "prec_gvd_translation_param" ); sei.m_precGvdTranslationParam = code;1788 }1789 for( Int i = 0, j = 0; j <= sei.m_numConstituentViewsGvdMinus1 + 1; j++ )1790 {1791 if( sei.m_intrinsicParamGvdFlag )1792 {1793 sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_focal_length_x" ); sei.m_signGvdFocalLengthX[i][j] = (code == 1);1794 sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_focal_length_x" ); sei.m_expGvdFocalLengthX[i][j] = code;1795 sei_read_code( pDecodedMessageOutputStream, sei.getManGvdFocalLengthXLen(i,j), code, "man_gvd_focal_length_x" ); sei.m_manGvdFocalLengthX[i][j] = code;1796 sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_focal_length_y" ); sei.m_signGvdFocalLengthY[i][j] = (code == 1);1797 sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_focal_length_y" ); sei.m_expGvdFocalLengthY[i][j] = code;1798 sei_read_code( pDecodedMessageOutputStream, sei.getManGvdFocalLengthYLen(i,j), code, "man_gvd_focal_length_y" ); sei.m_manGvdFocalLengthY[i][j] = code;1799 sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_principal_point_x" ); sei.m_signGvdPrincipalPointX[i][j] = (code == 1);1800 sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_principal_point_x" ); sei.m_expGvdPrincipalPointX[i][j] = code;1801 sei_read_code( pDecodedMessageOutputStream, sei.getManGvdPrincipalPointXLen(i,j), code, "man_gvd_principal_point_x" ); sei.m_manGvdPrincipalPointX[i][j] = code;1802 sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_principal_point_y" ); sei.m_signGvdPrincipalPointY[i][j] = (code == 1);1803 sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_principal_point_y" ); sei.m_expGvdPrincipalPointY[i][j] = code;1804 sei_read_code( pDecodedMessageOutputStream, sei.getManGvdPrincipalPointYLen(i,j), code, "man_gvd_principal_point_y" ); sei.m_manGvdPrincipalPointY[i][j] = code;1805 }1806 if( sei.m_rotationGvdFlag )1807 {1808 sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_r00" ); sei.m_signGvdR00[i][j] = (code == 1);1809 sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_r00" ); sei.m_expGvdR00[i][j] = code;1810 sei_read_code( pDecodedMessageOutputStream, sei.m_precGvdRotationParam, code, "man_gvd_r00" ); sei.m_manGvdR00[i][j] = code;1811 sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_r01" ); sei.m_signGvdR01[i][j] = (code == 1);1812 sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_r01" ); sei.m_expGvdR01[i][j] = code;1813 sei_read_code( pDecodedMessageOutputStream, sei.m_precGvdRotationParam, code, "man_gvd_r01" ); sei.m_manGvdR01[i][j] = code;1814 sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_r02" ); sei.m_signGvdR02[i][j] = (code == 1);1815 sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_r02" ); sei.m_expGvdR02[i][j] = code;1816 sei_read_code( pDecodedMessageOutputStream, sei.m_precGvdRotationParam, code, "man_gvd_r02" ); sei.m_manGvdR02[i][j] = code;1817 sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_r10" ); sei.m_signGvdR10[i][j] = (code == 1);1818 sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_r10" ); sei.m_expGvdR10[i][j] = code;1819 sei_read_code( pDecodedMessageOutputStream, sei.m_precGvdRotationParam, code, "man_gvd_r10" ); sei.m_manGvdR10[i][j] = code;1820 sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_r11" ); sei.m_signGvdR11[i][j] = (code == 1);1821 sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_r11" ); sei.m_expGvdR11[i][j] = code;1822 sei_read_code( pDecodedMessageOutputStream, sei.m_precGvdRotationParam, code, "man_gvd_r11" ); sei.m_manGvdR11[i][j] = code;1823 sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_r12" ); sei.m_signGvdR12[i][j] = (code == 1);1824 sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_r12" ); sei.m_expGvdR12[i][j] = code;1825 sei_read_code( pDecodedMessageOutputStream, sei.m_precGvdRotationParam, code, "man_gvd_r12" ); sei.m_manGvdR12[i][j] = code;1826 sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_r20" ); sei.m_signGvdR20[i][j] = (code == 1);1827 sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_r20" ); sei.m_expGvdR20[i][j] = code;1828 sei_read_code( pDecodedMessageOutputStream, sei.m_precGvdRotationParam, code, "man_gvd_r20" ); sei.m_manGvdR20[i][j] = code;1829 sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_r21" ); sei.m_signGvdR21[i][j] = (code == 1);1830 sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_r21" ); sei.m_expGvdR21[i][j] = code;1831 sei_read_code( pDecodedMessageOutputStream, sei.m_precGvdRotationParam, code, "man_gvd_r21" ); sei.m_manGvdR21[i][j] = code;1832 sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_r22" ); sei.m_signGvdR22[i][j] = (code == 1);1833 sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_r22" ); sei.m_expGvdR22[i][j] = code;1834 sei_read_code( pDecodedMessageOutputStream, sei.m_precGvdRotationParam, code, "man_gvd_r22" ); sei.m_manGvdR22[i][j] = code;1835 //sei_read_code( pDecodedMessageOutputStream, sei.getManGvdRLen(i,j,k), code, "man_gvd_r" ); sei.m_manGvdR[i][j] = code;1836 }1837 if( sei.m_translationGvdFlag )1838 {1839 sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_t_x" ); sei.m_signGvdTX[i][j] = (code == 1);1840 sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_t_x" ); sei.m_expGvdTX[i][j] = code;1841 sei_read_code( pDecodedMessageOutputStream, sei.getManGvdTXLen(i,j), code, "man_gvd_t_x" ); sei.m_manGvdTX[i][j] = code;1842 }1843 }1844 }1845 1846 if( sei.m_depthType == 1 )1847 {1848 sei_read_svlc( pDecodedMessageOutputStream, scode, "min_offset_x_int" ); sei.m_minOffsetXInt = scode;1849 sei_read_code( pDecodedMessageOutputStream, 8, code, "min_offset_x_frac" ); sei.m_minOffsetXFrac = code;1850 sei_read_svlc( pDecodedMessageOutputStream, scode, "max_offset_x_int" ); sei.m_maxOffsetXInt = scode;1851 sei_read_code( pDecodedMessageOutputStream, 8, code, "max_offset_x_frac" ); sei.m_maxOffsetXFrac = code;1852 sei_read_flag( pDecodedMessageOutputStream, code, "offset_y_present_flag" ); sei.m_offsetYPresentFlag = (code == 1);1853 if( sei.m_offsetYPresentFlag )1854 {1855 sei_read_svlc( pDecodedMessageOutputStream, scode, "min_offset_y_int" ); sei.m_minOffsetYInt = scode;1856 sei_read_code( pDecodedMessageOutputStream, 8, code, "min_offset_y_frac" ); sei.m_minOffsetYFrac = code;1857 sei_read_svlc( pDecodedMessageOutputStream, scode, "max_offset_y_int" ); sei.m_maxOffsetYInt = scode;1858 sei_read_code( pDecodedMessageOutputStream, 8, code, "max_offset_y_frac" ); sei.m_maxOffsetYFrac = code;1859 }1860 sei_read_flag( pDecodedMessageOutputStream, code, "warp_map_size_present_flag" ); sei.m_warpMapSizePresentFlag = (code == 1);1861 if( sei.m_warpMapSizePresentFlag )1862 {1863 sei_read_uvlc( pDecodedMessageOutputStream, code, "warp_map_width_minus2" ); sei.m_warpMapWidthMinus2 = code;1864 sei_read_uvlc( pDecodedMessageOutputStream, code, "warp_map_height_minus2" ); sei.m_warpMapHeightMinus2 = code;1865 }1866 }1867 }1868 };1869 1736 #endif 1870 #endif1871 1737 1872 1738 //! \} -
branches/HTM-16.0-MV-draft-5/source/Lib/TLibDecoder/SEIread.h
r1386 r1390 115 115 Void xParseSEIMultiviewAcquisitionInfo (SEIMultiviewAcquisitionInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 116 116 Void xParseSEIMultiviewViewPosition (SEIMultiviewViewPosition& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 117 #if NH_3D118 Void xParseSEIAlternativeDepthInfo (SEIAlternativeDepthInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);119 #endif120 117 #endif 121 118 Void sei_read_code(std::ostream *pOS, UInt uiLength, UInt& ruiCode, const TChar *pSymbolName); -
branches/HTM-16.0-MV-draft-5/source/Lib/TLibDecoder/TDecCAVLC.cpp
r1386 r1390 436 436 if ( pcPPS->getPps3dExtensionFlag() ) 437 437 { 438 #if NH_3D 439 parsePps3dExtension( pcPPS ); 440 #endif 441 } 442 #if NH_3D 443 if ( pcPPS->getPpsExtension5bits() ) 444 #else 438 } 445 439 if ( pcPPS->getPpsExtension5bits() || pcPPS->getPps3dExtensionFlag() ) 446 #endif447 440 { 448 441 while ( xMoreRbspData() ) … … 543 536 } 544 537 545 #if NH_3D546 Void TDecCavlc::parsePps3dExtension( TComPPS* pcPPS )547 {548 #if NH_3D_DLT549 UInt uiCode = 0;550 //551 TComDLT* pcDLT = pcPPS->getDLT();552 553 READ_FLAG(uiCode, "dlts_present_flag");554 pcDLT->setDltPresentFlag( (uiCode == 1) ? true : false );555 556 if ( pcDLT->getDltPresentFlag() )557 {558 READ_CODE(6, uiCode, "pps_depth_layers_minus1");559 pcDLT->setNumDepthViews( uiCode+1 );560 561 READ_CODE(4, uiCode, "pps_bit_depth_for_depth_layers_minus8");562 pcDLT->setDepthViewBitDepth( (uiCode+8) );563 564 for( Int i = 0; i <= pcDLT->getNumDepthViews()-1; i++ )565 {566 Int layerId = pcDLT->getDepthIdxToLayerId(i);567 568 READ_FLAG(uiCode, "dlt_flag[i]");569 pcDLT->setUseDLTFlag(layerId, (uiCode == 1) ? true : false);570 571 if ( pcDLT->getUseDLTFlag( layerId ) )572 {573 Bool bDltBitMapRepFlag = false;574 UInt uiMaxDiff = MAX_INT;575 UInt uiMinDiff = 0;576 UInt uiCodeLength = 0;577 578 READ_FLAG(uiCode, "dlt_pred_flag[i]");579 580 if( uiCode )581 {582 assert( pcDLT->getUseDLTFlag( 1 ));583 }584 pcDLT->setInterViewDltPredEnableFlag( layerId, (uiCode == 1) ? true : false );585 586 if ( pcDLT->getInterViewDltPredEnableFlag( layerId ) == false )587 {588 READ_FLAG(uiCode, "dlt_val_flags_present_flag[i]");589 bDltBitMapRepFlag = (uiCode == 1) ? true : false;590 }591 else592 {593 bDltBitMapRepFlag = false;594 }595 596 UInt uiNumDepthValues = 0;597 std::vector<Int> aiIdx2DepthValue(256, 0);598 599 // Bit map600 if ( bDltBitMapRepFlag )601 {602 for (UInt d=0; d<256; d++)603 {604 READ_FLAG(uiCode, "dlt_value_flag[i][j]");605 if (uiCode == 1)606 {607 aiIdx2DepthValue[uiNumDepthValues] = d;608 uiNumDepthValues++;609 }610 }611 }612 // Diff Coding613 else614 {615 READ_CODE(8, uiNumDepthValues, "num_val_delta_dlt"); // num_entry616 617 {618 // The condition if( pcVPS->getNumDepthValues(i) > 0 ) is always true since for Single-view Diff Coding, there is at least one depth value in depth component.619 620 if (uiNumDepthValues > 1)621 {622 READ_CODE(8, uiCode, "max_diff");623 uiMaxDiff = uiCode;624 }625 else626 {627 uiMaxDiff = 0; // when there is only one value in DLT628 }629 630 if (uiNumDepthValues > 2)631 {632 uiCodeLength = (UInt) gCeilLog2(uiMaxDiff + 1);633 READ_CODE(uiCodeLength, uiCode, "min_diff_minus1");634 uiMinDiff = uiCode + 1;635 }636 else637 {638 uiMinDiff = uiMaxDiff; // when there are only one or two values in DLT639 }640 641 READ_CODE(8, uiCode, "delta_dlt_val0"); // entry0642 aiIdx2DepthValue[0] = uiCode;643 644 if (uiMaxDiff == uiMinDiff)645 {646 for (UInt d=1; d<uiNumDepthValues; d++)647 {648 aiIdx2DepthValue[d] = aiIdx2DepthValue[d-1] + uiMinDiff + 0;649 }650 }651 else652 {653 uiCodeLength = (UInt) gCeilLog2(uiMaxDiff - uiMinDiff + 1);654 for (UInt d=1; d<uiNumDepthValues; d++)655 {656 READ_CODE(uiCodeLength, uiCode, "delta_val_diff_minus_min[k]");657 aiIdx2DepthValue[d] = aiIdx2DepthValue[d-1] + uiMinDiff + uiCode;658 }659 }660 661 }662 }663 664 if( pcDLT->getInterViewDltPredEnableFlag( layerId ) )665 {666 // interpret decoded values as delta DLT667 AOF( layerId > 1 );668 // assumes ref layer id to be 1669 std::vector<Int> viRefDLT = pcDLT->idx2DepthValue( 1 );670 UInt uiRefNum = pcDLT->getNumDepthValues( 1 );671 pcDLT->setDeltaDLT(layerId, viRefDLT, uiRefNum, aiIdx2DepthValue, uiNumDepthValues);672 }673 else674 {675 // store final DLT676 pcDLT->setDepthLUTs(layerId, aiIdx2DepthValue, uiNumDepthValues);677 }678 }679 }680 }681 #endif682 }683 #endif684 538 685 539 … … 1184 1038 if ( pcSPS->getSps3dExtensionFlag() ) 1185 1039 { 1186 #if NH_3D 1187 parseSps3dExtension( pcSPS ); 1188 #endif 1189 } 1190 1191 #if NH_3D 1192 if ( pcSPS->getSpsExtension5bits() ) 1193 #else 1040 } 1041 1194 1042 if ( pcSPS->getSpsExtension5bits() || pcSPS->getSps3dExtensionFlag() ) 1195 #endif1196 1043 { 1197 1044 while ( xMoreRbspData() ) … … 1270 1117 } 1271 1118 1272 #if NH_3D1273 Void TDecCavlc::parseSps3dExtension( TComSPS* pcSPS )1274 {1275 TComSps3dExtension sps3dExt;1276 UInt uiCode;1277 for( Int d = 0; d <= 1; d++ )1278 {1279 READ_FLAG( uiCode, "iv_di_mc_enabled_flag" ); sps3dExt.setIvDiMcEnabledFlag( d, uiCode == 1 );1280 READ_FLAG( uiCode, "iv_mv_scal_enabled_flag" ); sps3dExt.setIvMvScalEnabledFlag( d, uiCode == 1 );1281 if( d == 0 )1282 {1283 READ_UVLC( uiCode, "log2_sub_pb_size_minus3" ); sps3dExt.setLog2IvmcSubPbSizeMinus3( d, uiCode );1284 READ_FLAG( uiCode, "iv_res_pred_enabled_flag" ); sps3dExt.setIvResPredEnabledFlag( d, uiCode == 1 );1285 READ_FLAG( uiCode, "depth_ref_enabled_flag" ); sps3dExt.setDepthRefEnabledFlag( d, uiCode == 1 );1286 READ_FLAG( uiCode, "vsp_mc_enabled_flag" ); sps3dExt.setVspMcEnabledFlag( d, uiCode == 1 );1287 READ_FLAG( uiCode, "dbbp_enabled_flag" ); sps3dExt.setDbbpEnabledFlag( d, uiCode == 1 );1288 }1289 else1290 {1291 READ_FLAG( uiCode, "tex_mc_enabled_flag" ); sps3dExt.setTexMcEnabledFlag( d, uiCode == 1 );1292 READ_UVLC( uiCode, "log2_texmc_sub_pb_size_minus3" ); sps3dExt.setLog2TexmcSubPbSizeMinus3( d, uiCode );1293 READ_FLAG( uiCode, "intra_contour_enabled_flag" ); sps3dExt.setIntraContourEnabledFlag( d, uiCode == 1 );1294 READ_FLAG( uiCode, "intra_dc_only_wedge_enabled_flag" ); sps3dExt.setIntraDcOnlyWedgeEnabledFlag( d, uiCode == 1 );1295 READ_FLAG( uiCode, "cqt_cu_part_pred_enabled_flag" ); sps3dExt.setCqtCuPartPredEnabledFlag( d, uiCode == 1 );1296 READ_FLAG( uiCode, "inter_dc_only_enabled_flag" ); sps3dExt.setInterDcOnlyEnabledFlag( d, uiCode == 1 );1297 READ_FLAG( uiCode, "skip_intra_enabled_flag" ); sps3dExt.setSkipIntraEnabledFlag( d, uiCode == 1 );1298 }1299 }1300 pcSPS->setSps3dExtension( sps3dExt );1301 }1302 #endif1303 1119 1304 1120 Void TDecCavlc::parsePpsMultilayerExtension(TComPPS* pcPPS) … … 1482 1298 if (uiCode) 1483 1299 { 1484 #if NH_3D1485 READ_FLAG( uiCode, "vps_3d_extension_flag" );1486 if ( uiCode )1487 {1488 m_pcBitstream->readOutTrailingBits();1489 pcVPS->createCamPars(pcVPS->getNumViews());1490 parseVps3dExtension( pcVPS );1491 }1492 READ_FLAG( uiCode, "vps_extension3_flag" );1493 if (uiCode)1494 {1495 #endif1496 1300 #endif 1497 1301 while ( xMoreRbspData() ) … … 1500 1304 } 1501 1305 #if NH_MV 1502 #if NH_3D1503 }1504 #endif1505 1306 } 1506 1307 #endif … … 1587 1388 } 1588 1389 1589 #if NH_3D1590 pcVPS->initViewCompLayer( );1591 #endif1592 1390 1593 1391 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) … … 2178 1976 } 2179 1977 2180 #if NH_3D2181 Void TDecCavlc::parseVps3dExtension( TComVPS* pcVPS )2182 {2183 UInt uiCode;2184 READ_UVLC( uiCode, "cp_precision"); pcVPS->setCpPrecision( uiCode ) ;2185 2186 for (Int n = 1; n < pcVPS->getNumViews(); n++)2187 {2188 Int i = pcVPS->getViewOIdxList( n );2189 Int iInVps = pcVPS->getVoiInVps( i );2190 READ_CODE( 6, uiCode, "num_cp" ); pcVPS->setNumCp( iInVps, uiCode );2191 2192 if( pcVPS->getNumCp( iInVps ) > 0 )2193 {2194 READ_FLAG( uiCode, "cp_in_slice_segment_header_flag" ); pcVPS->setCpInSliceSegmentHeaderFlag( iInVps, uiCode == 1 );2195 for( Int m = 0; m < pcVPS->getNumCp( iInVps ); m++ )2196 {2197 READ_UVLC( uiCode, "cp_ref_voi" ); pcVPS->setCpRefVoi( iInVps, m, uiCode );2198 if( !pcVPS->getCpInSliceSegmentHeaderFlag( iInVps ) )2199 {2200 Int j = pcVPS->getCpRefVoi( iInVps, m );2201 Int jInVps = pcVPS->getVoiInVps( j );2202 Int iCode;2203 READ_SVLC( iCode, "vps_cp_scale" ); pcVPS->setVpsCpScale ( iInVps, jInVps, iCode );2204 READ_SVLC( iCode, "vps_cp_off" ); pcVPS->setVpsCpOff ( iInVps, jInVps, iCode );2205 READ_SVLC( iCode, "vps_cp_inv_scale_plus_scale" ); pcVPS->setVpsCpInvScale( iInVps, jInVps, iCode - pcVPS->getVpsCpScale( iInVps, jInVps ) );2206 READ_SVLC( iCode, "vps_cp_inv_off_plus_off" ); pcVPS->setVpsCpInvOff ( iInVps, jInVps, iCode - pcVPS->getVpsCpOff ( iInVps, jInVps ) );2207 }2208 }2209 }2210 }2211 pcVPS->deriveCpPresentFlag();2212 }2213 #endif2214 1978 #endif 2215 1979 … … 2304 2068 pcSlice->setViewId ( vps->getViewId ( pcSlice->getLayerId() ) ); 2305 2069 pcSlice->setViewIndex( vps->getViewIndex( pcSlice->getLayerId() ) ); 2306 #if NH_3D2307 pcSlice->setIsDepth ( vps->getDepthId ( pcSlice->getLayerId() ) == 1 );2308 #endif2309 2070 #endif 2310 2071 … … 2622 2383 Bool interLayerPredLayerIdcPresentFlag = false; 2623 2384 Int layerId = pcSlice->getLayerId(); 2624 #if NH_3D2625 if( pcSlice->getLayerId() > 0 && !vps->getAllRefLayersActiveFlag() && vps->getNumRefListLayers( layerId ) > 0 )2626 #else2627 2385 if( pcSlice->getLayerId() > 0 && !vps->getAllRefLayersActiveFlag() && vps->getNumDirectRefLayers( layerId ) > 0 ) 2628 #endif2629 2386 { 2630 2387 READ_FLAG( uiCode, "inter_layer_pred_enabled_flag" ); pcSlice->setInterLayerPredEnabledFlag( uiCode == 1 ); 2631 #if NH_3D2632 if( pcSlice->getInterLayerPredEnabledFlag() && vps->getNumRefListLayers( layerId ) > 1 )2633 #else2634 2388 if( pcSlice->getInterLayerPredEnabledFlag() && vps->getNumDirectRefLayers( layerId ) > 1 ) 2635 #endif2636 2389 { 2637 2390 if( !vps->getMaxOneActiveRefLayerFlag()) … … 2639 2392 READ_CODE( pcSlice->getNumInterLayerRefPicsMinus1Len( ), uiCode, "num_inter_layer_ref_pics_minus1" ); pcSlice->setNumInterLayerRefPicsMinus1( uiCode ); 2640 2393 } 2641 #if NH_3D2642 if ( pcSlice->getNumActiveRefLayerPics() != vps->getNumRefListLayers( layerId ) )2643 #else2644 2394 if ( pcSlice->getNumActiveRefLayerPics() != vps->getNumDirectRefLayers( layerId ) ) 2645 #endif2646 2395 { 2647 2396 interLayerPredLayerIdcPresentFlag = true; … … 2660 2409 } 2661 2410 } 2662 #if NH_3D2663 if ( getDecTop()->decProcAnnexI() )2664 {2665 pcSlice->deriveInCmpPredAndCpAvailFlag( );2666 if ( pcSlice->getInCmpPredAvailFlag() )2667 {2668 READ_FLAG(uiCode, "in_comp_pred_flag"); pcSlice->setInCompPredFlag((Bool)uiCode);2669 }2670 pcSlice->init3dToolParameters();2671 }2672 #endif2673 2411 #endif 2674 2412 if(sps->getUseSAO()) … … 2877 2615 } 2878 2616 2879 #if NH_3D_IC2880 else if( pcSlice->getViewIndex() && ( pcSlice->getSliceType() == P_SLICE || pcSlice->getSliceType() == B_SLICE )2881 && !pcSlice->getIsDepth() && vps->getNumRefListLayers( layerId ) > 02882 && getDecTop()->decProcAnnexI()2883 )2884 {2885 UInt uiCodeTmp = 0;2886 2887 READ_FLAG ( uiCodeTmp, "slice_ic_enable_flag" );2888 pcSlice->setApplyIC( uiCodeTmp );2889 2890 if ( uiCodeTmp )2891 {2892 READ_FLAG ( uiCodeTmp, "slice_ic_disabled_merge_zero_idx_flag" );2893 pcSlice->setIcSkipParseFlag( uiCodeTmp );2894 }2895 }2896 #endif2897 2617 2898 2618 if (!pcSlice->isIntra()) 2899 2619 { 2900 2620 READ_UVLC( uiCode, "five_minus_max_num_merge_cand"); 2901 #if NH_3D_IV_MERGE2902 pcSlice->setMaxNumMergeCand(( ( pcSlice->getMpiFlag() || pcSlice->getIvMvPredFlag() || pcSlice->getViewSynthesisPredFlag() ) ? MRG_MAX_NUM_CANDS_MEM : MRG_MAX_NUM_CANDS) - uiCode);2903 #else2904 2621 pcSlice->setMaxNumMergeCand(MRG_MAX_NUM_CANDS - uiCode); 2905 #endif2906 2622 } 2907 2623 … … 2994 2710 pcSlice->setLFCrossSliceBoundaryFlag( (uiCode==1)?true:false); 2995 2711 2996 #if NH_3D2997 if ( getDecTop()->decProcAnnexI() )2998 {2999 Int voiInVps = vps->getVoiInVps( pcSlice->getViewIndex() );3000 if( vps->getCpInSliceSegmentHeaderFlag( voiInVps ) )3001 {3002 for( Int m = 0; m < vps->getNumCp( voiInVps ); m++ )3003 {3004 Int jInVps = vps->getVoiInVps( vps->getCpRefVoi( voiInVps, m ));3005 READ_SVLC( iCode, "cp_scale" ); pcSlice->setCpScale ( jInVps, iCode );3006 READ_SVLC( iCode, "cp_off" ); pcSlice->setCpOff ( jInVps, iCode );3007 READ_SVLC( iCode, "cp_inv_scale_plus_scale" ); pcSlice->setCpInvScale( jInVps, iCode - pcSlice->getCpScale ( jInVps ));3008 READ_SVLC( iCode, "cp_inv_off_plus_off" ); pcSlice->setCpInvOff ( jInVps, iCode - pcSlice->getCpOff ( jInVps ));3009 }3010 }3011 }3012 #endif3013 2712 3014 2713 } … … 3351 3050 } 3352 3051 3353 #if NH_3D_DIS3354 Void TDecCavlc::parseDIS( TComDataCU* /*pcCU*/, UInt /*uiAbsPartIdx*/, UInt /*uiDepth*/ )3355 {3356 assert(0);3357 }3358 #endif3359 3052 3360 3053 Void TDecCavlc::parseSkipFlag( TComDataCU* /*pcCU*/, UInt /*uiAbsPartIdx*/, UInt /*uiDepth*/ ) … … 3493 3186 } 3494 3187 3495 #if NH_3D_ARP3496 Void TDecCavlc::parseARPW( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )3497 {3498 assert(0);3499 }3500 #endif3501 #if NH_3D_IC3502 Void TDecCavlc::parseICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )3503 {3504 assert(0);3505 }3506 #endif3507 #if NH_3D_SDC_INTRA || NH_3D_SDC_INTER3508 Void TDecCavlc::parseSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )3509 {3510 assert(0);3511 }3512 3513 #endif3514 #if NH_3D_DBBP3515 Void TDecCavlc::parseDBBPFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )3516 {3517 assert(0);3518 }3519 #endif3520 3188 // ==================================================================================================================== 3521 3189 // Protected member functions -
branches/HTM-16.0-MV-draft-5/source/Lib/TLibDecoder/TDecCAVLC.h
r1321 r1390 94 94 Void setDecTop ( TDecTop* decTop ) { m_decTop = decTop; }; 95 95 #endif 96 #if NH_3D97 Void parseVps3dExtension ( TComVPS* pcVPS );98 Void parseSps3dExtension ( TComSPS* pcSPS );99 Void parsePps3dExtension ( TComPPS* pcPPS );100 #endif101 96 102 97 Void parseSPS ( TComSPS* pcSPS ); … … 121 116 122 117 Void parseSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 123 #if NH_3D_DIS124 Void parseDIS ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );125 #endif126 118 Void parseCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 127 119 Void parseMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx ); 128 120 Void parseMergeIndex ( TComDataCU* pcCU, UInt& ruiMergeIndex ); 129 #if NH_3D_ARP130 Void parseARPW ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );131 #endif132 #if NH_3D_IC133 Void parseICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );134 #endif135 #if NH_3D_DMM || NH_3D_SDC_INTRA || NH_3D_SDC_INTER136 Void parseDeltaDC ( TComDataCU* /*pcCU*/, UInt /*absPartIdx*/, UInt /*depth*/ ) { assert(0); };137 #endif138 #if NH_3D_SDC_INTRA || NH_3D_SDC_INTER139 Void parseSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );140 #endif141 #if NH_3D_DBBP142 Void parseDBBPFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );143 #endif144 121 Void parseSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 145 122 Void parsePartSize ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); -
branches/HTM-16.0-MV-draft-5/source/Lib/TLibDecoder/TDecCu.cpp
r1386 r1390 52 52 m_ppcYuvReco = NULL; 53 53 m_ppcCU = NULL; 54 #if NH_3D_DBBP55 m_ppcYuvRecoDBBP = NULL;56 #endif57 54 } 58 55 … … 81 78 m_ppcYuvReco = new TComYuv*[m_uiMaxDepth-1]; 82 79 m_ppcCU = new TComDataCU*[m_uiMaxDepth-1]; 83 #if NH_3D_DBBP84 m_ppcYuvRecoDBBP = new TComYuv*[m_uiMaxDepth-1];85 #endif86 80 87 81 for ( UInt ui = 0; ui < m_uiMaxDepth-1; ui++ ) … … 102 96 m_ppcYuvReco[ui] = new TComYuv; m_ppcYuvReco[ui]->create( uiWidth, uiHeight, chromaFormatIDC ); 103 97 m_ppcCU [ui] = new TComDataCU; m_ppcCU [ui]->create( chromaFormatIDC, uiNumPartitions, uiWidth, uiHeight, true, uiMaxWidth >> (m_uiMaxDepth - 1) ); 104 #if NH_3D_DBBP105 m_ppcYuvRecoDBBP[ui] = new TComYuv; m_ppcYuvRecoDBBP[ui]->create( uiWidth, uiHeight, chromaFormatIDC );106 #endif107 98 } 108 99 … … 126 117 m_ppcYuvReco[ui]->destroy(); delete m_ppcYuvReco[ui]; m_ppcYuvReco[ui] = NULL; 127 118 m_ppcCU [ui]->destroy(); delete m_ppcCU [ui]; m_ppcCU [ui] = NULL; 128 #if NH_3D_DBBP129 m_ppcYuvRecoDBBP[ui]->destroy(); delete m_ppcYuvRecoDBBP[ui]; m_ppcYuvRecoDBBP[ui] = NULL;130 #endif131 119 } 132 120 … … 134 122 delete [] m_ppcYuvReco; m_ppcYuvReco = NULL; 135 123 delete [] m_ppcCU ; m_ppcCU = NULL; 136 #if NH_3D_DBBP137 delete [] m_ppcYuvRecoDBBP; m_ppcYuvRecoDBBP = NULL;138 #endif139 124 } 140 125 … … 170 155 Void TDecCu::decompressCtu( TComDataCU* pCtu ) 171 156 { 172 #if !NH_3D_IV_MERGE173 157 xDecompressCU( pCtu, 0, 0 ); 174 #endif175 158 } 176 159 … … 290 273 pcCU->setQPSubParts( pcCU->getRefQP(uiAbsPartIdx), uiAbsPartIdx, uiDepth ); // set QP to default QP 291 274 } 292 #if NH_3D_NBDV293 DisInfo DvInfo;294 DvInfo.m_acNBDV.setZero();295 DvInfo.m_aVIdxCan = 0;296 #if NH_3D_NBDV_REF297 DvInfo.m_acDoNBDV.setZero();298 #endif299 300 if(!pcCU->getSlice()->isIntra())301 {302 #if NH_3D_ARP && NH_3D_IV_MERGE && NH_3D_VSP303 if( pcCU->getSlice()->getIvResPredFlag() || pcCU->getSlice()->getIvMvPredFlag() || pcCU->getSlice()->getViewSynthesisPredFlag() )304 #else305 #if NH_3D_IV_MERGE && NH_3D_VSP306 if( pcCU->getSlice()->getIvMvPredFlag() || pcCU->getSlice()->getViewSynthesisPredFlag() )307 #else308 #if NH_3D_ARP && NH_3D_VSP309 if( pcCU->getSlice()->getIvResPredFlag() || pcCU->getSlice()->getViewSynthesisPredFlag() )310 #else311 #if NH_3D_VSP312 if( pcCU->getSlice()->getViewSynthesisPredFlag() )313 #else314 #if H_3D_ARP315 if( pcCU->getSlice()->getIvResPredFlag( ) )316 #else317 #if H_3D_IV_MERGE318 if( pcCU->getSlice()->getVPS()->getIvMvPredFlag(pcCU->getSlice()->getLayerId()) )319 #else320 #if NH_3D_DBBP321 if( pcCU->getSlice()->getDepthBasedBlkPartFlag() )322 #else323 if (0)324 #endif325 #endif326 #endif327 #endif328 #endif329 #endif330 #endif331 {332 m_ppcCU[uiDepth]->copyInterPredInfoFrom(pcCU, uiAbsPartIdx, REF_PIC_LIST_0, true);333 m_ppcCU[uiDepth]->copyDVInfoFrom(pcCU, uiAbsPartIdx);334 PartSize ePartTemp = m_ppcCU[uiDepth]->getPartitionSize(0);335 UChar cWidTemp = m_ppcCU[uiDepth]->getWidth(0);336 UChar cHeightTemp = m_ppcCU[uiDepth]->getHeight(0);337 m_ppcCU[uiDepth]->setWidth (0, pcCU->getSlice()->getSPS()->getMaxCUWidth () / (1 << uiDepth));338 m_ppcCU[uiDepth]->setHeight(0, pcCU->getSlice()->getSPS()->getMaxCUHeight() / (1 << uiDepth));339 m_ppcCU[uiDepth]->setPartSizeSubParts(SIZE_2Nx2N, 0, uiDepth);340 #if NH_3D_IV_MERGE341 if( pcCU->getSlice()->getIsDepth())342 {343 m_ppcCU[uiDepth]->getDispforDepth(0, 0, &DvInfo);344 }345 else346 {347 #endif348 #if NH_3D_NBDV_REF349 if( pcCU->getSlice()->getDepthBasedBlkPartFlag() ) //Notes from QC: please check the condition for DoNBDV. Remove this comment once it is done.350 {351 m_ppcCU[uiDepth]->getDisMvpCandNBDV(&DvInfo, true);352 }353 else354 #endif355 {356 m_ppcCU[uiDepth]->getDisMvpCandNBDV(&DvInfo);357 }358 #if NH_3D_IV_MERGE359 }360 #endif361 #if ENC_DEC_TRACE && NH_MV_ENC_DEC_TRAC362 if ( g_decTraceDispDer )363 {364 DTRACE_CU( "RefViewIdx", DvInfo.m_aVIdxCan );365 DTRACE_CU( "MvDisp[x]", DvInfo.m_acNBDV.getHor() );366 DTRACE_CU( "MvDisp[y]", DvInfo.m_acNBDV.getVer() );367 DTRACE_CU( "MvRefinedDisp[x]", DvInfo.m_acDoNBDV.getHor() );368 DTRACE_CU( "MvRefinedDisp[y]", DvInfo.m_acDoNBDV.getVer() );369 }370 #endif371 pcCU->setDvInfoSubParts(DvInfo, uiAbsPartIdx, uiDepth);372 m_ppcCU[uiDepth]->setPartSizeSubParts(ePartTemp, 0, uiDepth);373 m_ppcCU[uiDepth]->setWidth(0, cWidTemp);374 m_ppcCU[uiDepth]->setHeight(0, cHeightTemp);375 }376 }377 #endif378 275 379 276 if( uiDepth <= pps.getPpsRangeExtension().getDiffCuChromaQpOffsetDepth() && pcCU->getSlice()->getUseChromaQpAdj() ) … … 403 300 m_ppcCU[uiDepth]->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_0 ); 404 301 m_ppcCU[uiDepth]->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_1 ); 405 #if NH_3D_IV_MERGE406 m_ppcCU[uiDepth]->copyDVInfoFrom(pcCU, uiAbsPartIdx);407 TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists408 UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM];409 #else410 #if NH_3D_MLC411 TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists412 UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM];413 #else414 302 TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS << 1]; // double length for mv of both lists 415 303 UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS]; 416 #endif417 #endif418 304 Int numValidMergeCand = 0; 419 305 for( UInt ui = 0; ui < m_ppcCU[uiDepth]->getSlice()->getMaxNumMergeCand(); ++ui ) … … 423 309 m_pcEntropyDecoder->decodeMergeIndex( pcCU, 0, uiAbsPartIdx, uiDepth ); 424 310 UInt uiMergeIndex = pcCU->getMergeIndex(uiAbsPartIdx); 425 #if NH_3D_ARP 426 m_pcEntropyDecoder->decodeARPW( pcCU , uiAbsPartIdx , uiDepth ); 427 #endif 428 #if NH_3D_IC 429 m_pcEntropyDecoder->decodeICFlag( pcCU, uiAbsPartIdx, uiDepth ); 430 #endif 431 432 433 #if NH_3D_VSP 434 Int vspFlag[MRG_MAX_NUM_CANDS_MEM]; 435 memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 436 #endif 437 #if NH_3D_SPIVMP 438 Bool bSPIVMPFlag[MRG_MAX_NUM_CANDS_MEM]; 439 memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM); 440 TComMvField* pcMvFieldSP; 441 UChar* puhInterDirSP; 442 pcMvFieldSP = new TComMvField[pcCU->getPic()->getPicSym()->getNumPartitionsInCtu()*2]; 443 puhInterDirSP = new UChar[pcCU->getPic()->getPicSym()->getNumPartitionsInCtu()]; 444 #endif 445 446 #if NH_3D_MLC 447 m_ppcCU[uiDepth]->initAvailableFlags(); 448 #endif 311 312 313 449 314 m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); 450 #if NH_3D_MLC451 m_ppcCU[uiDepth]->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours452 #if NH_3D_SPIVMP453 , pcMvFieldSP, puhInterDirSP454 #endif455 , numValidMergeCand, uiMergeIndex );456 457 m_ppcCU[uiDepth]->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours458 #if NH_3D_VSP459 , vspFlag460 #endif461 #if NH_3D_SPIVMP462 , bSPIVMPFlag463 #endif464 , numValidMergeCand );465 #endif466 #if NH_3D_VSP467 pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiAbsPartIdx, 0, uiDepth );468 #endif469 315 470 316 pcCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeIndex], uiAbsPartIdx, 0, uiDepth ); … … 479 325 pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvd( cTmpMv, SIZE_2Nx2N, uiAbsPartIdx, uiDepth ); 480 326 pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvField( cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ], SIZE_2Nx2N, uiAbsPartIdx, uiDepth ); 481 #if NH_3D_VSP482 if( pcCU->getVSPFlag( uiAbsPartIdx ) != 0 )483 {484 if ( uhInterDirNeighbours[ uiMergeIndex ] & (1<<uiRefListIdx) )485 {486 UInt dummy;487 Int vspSize;488 Int width, height;489 m_ppcCU[uiDepth]->getPartIndexAndSize( uiAbsPartIdx, dummy, width, height );490 m_ppcCU[uiDepth]->setMvFieldPUForVSP( pcCU, uiAbsPartIdx, width, height, RefPicList( uiRefListIdx ), cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ].getRefIdx(), vspSize );491 pcCU->setVSPFlag( uiAbsPartIdx, vspSize );492 }493 }494 #endif495 327 #if ENC_DEC_TRACE && NH_MV_ENC_DEC_TRAC 496 328 if ( g_decTraceMvFromMerge ) … … 512 344 } 513 345 } 514 #if NH_3D_SPIVMP515 pcCU->setSPIVMPFlagSubParts(bSPIVMPFlag[uiMergeIndex], uiAbsPartIdx, 0, uiDepth );516 if (bSPIVMPFlag[uiMergeIndex])517 {518 UInt uiSPAddr;519 Int iWidth = pcCU->getWidth(uiAbsPartIdx);520 Int iHeight = pcCU->getHeight(uiAbsPartIdx);521 522 Int iNumSPInOneLine, iNumSP, iSPWidth, iSPHeight;523 524 pcCU->getSPPara(iWidth, iHeight, iNumSP, iNumSPInOneLine, iSPWidth, iSPHeight);525 526 for (Int iPartitionIdx = 0; iPartitionIdx < iNumSP; iPartitionIdx++)527 {528 pcCU->getSPAbsPartIdx(uiAbsPartIdx, iSPWidth, iSPHeight, iPartitionIdx, iNumSPInOneLine, uiSPAddr);529 pcCU->setInterDirSP(puhInterDirSP[iPartitionIdx], uiSPAddr, iSPWidth, iSPHeight);530 pcCU->getCUMvField( REF_PIC_LIST_0 )->setMvFieldSP(pcCU, uiSPAddr, pcMvFieldSP[2*iPartitionIdx], iSPWidth, iSPHeight);531 pcCU->getCUMvField( REF_PIC_LIST_1 )->setMvFieldSP(pcCU, uiSPAddr, pcMvFieldSP[2*iPartitionIdx + 1], iSPWidth, iSPHeight);532 }533 #if ENC_DEC_TRACE && NH_MV_ENC_DEC_TRAC534 if ( g_traceSubPBMotion )535 {536 std::cout << std::setfill(' ') << std::setw( 15 )537 << "Num" << std::setw( 15 )538 << "Dir " << std::setw( 15 )539 << "L0 RefIdx" << std::setw( 15 )540 << "L0 Hor" << std::setw( 15 )541 << "L0 Ver" << std::setw( 15 )542 << "L1 RefIdx" << std::setw( 15 )543 << "L1 Hor" << std::setw( 15 )544 << "L1 Ver" << std::setw( 15 )545 << std::endl;546 547 for (Int iPartitionIdx = 0; iPartitionIdx < iNumSP; iPartitionIdx++)548 {549 UChar dir = puhInterDirSP[iPartitionIdx];550 TComMvField& mv0 = pcMvFieldSP [2*iPartitionIdx];551 TComMvField& mv1 = pcMvFieldSP [2*iPartitionIdx+1];552 553 std::cout << std::setfill(' ') << std::setw( 15 )554 << iPartitionIdx << std::setw( 15 )555 << (UInt) dir << std::setw( 15 )556 << ((dir & 1) ? mv0.getRefIdx() : MIN_INT) << std::setw( 15 )557 << ((dir & 1) ? mv0.getMv().getHor() : MIN_INT) << std::setw( 15 )558 << ((dir & 1) ? mv0.getMv().getVer() : MIN_INT) << std::setw( 15 )559 << ((dir & 2) ? mv1.getRefIdx() : MIN_INT) << std::setw( 15 )560 << ((dir & 2) ? mv1.getMv().getHor() : MIN_INT) << std::setw( 15 )561 << ((dir & 2) ? mv1.getMv().getVer() : MIN_INT) << std::setw( 15 )562 << std::endl;563 }564 }565 #endif566 }567 delete[] pcMvFieldSP;568 delete[] puhInterDirSP;569 #endif570 346 571 347 xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, isLastCtuOfSliceSegment ); 572 #if NH_3D_IV_MERGE573 xDecompressCU(pcCU, uiAbsPartIdx, uiDepth );574 #endif575 348 576 349 return; 577 350 } 578 #if NH_3D_DIS579 m_pcEntropyDecoder->decodeDIS( pcCU, uiAbsPartIdx, uiDepth );580 if(!pcCU->getDISFlag(uiAbsPartIdx))581 {582 #endif583 351 584 352 m_pcEntropyDecoder->decodePredMode( pcCU, uiAbsPartIdx, uiDepth ); … … 591 359 if(pcCU->getIPCMFlag(uiAbsPartIdx)) 592 360 { 593 #if NH_3D_SDC_INTRA594 m_pcEntropyDecoder->decodeSDCFlag( pcCU, uiAbsPartIdx, uiDepth );595 #endif596 361 xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, isLastCtuOfSliceSegment ); 597 #if NH_3D_IV_MERGE598 xDecompressCU(pcCU, uiAbsPartIdx, uiDepth );599 #endif600 362 return; 601 363 } … … 611 373 setIsChromaQpAdjCoded( isChromaQpAdjCoded ); 612 374 setdQPFlag( bCodeDQP ); 613 #if NH_3D_DIS614 }615 #endif616 375 xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, isLastCtuOfSliceSegment ); 617 #if NH_3D_IV_MERGE618 xDecompressCU(pcCU, uiAbsPartIdx, uiDepth );619 #endif620 376 } 621 377 … … 638 394 { 639 395 TComPic* pcPic = pCtu->getPic(); 640 #if !NH_3D_IV_MERGE641 396 TComSlice * pcSlice = pCtu->getSlice(); 642 397 const TComSPS &sps=*(pcSlice->getSPS()); … … 672 427 return; 673 428 } 674 #endif675 429 // Residual reconstruction 676 430 m_ppcYuvResi[uiDepth]->clear(); … … 681 435 { 682 436 case MODE_INTER: 683 #if NH_3D_DBBP684 if( m_ppcCU[uiDepth]->getDBBPFlag(0) )685 {686 xReconInterDBBP( m_ppcCU[uiDepth], uiAbsPartIdx, uiDepth );687 }688 else689 {690 #endif691 #if NH_3D_SDC_INTER692 if( m_ppcCU[uiDepth]->getSDCFlag( 0 ) )693 {694 xReconInterSDC( m_ppcCU[uiDepth], uiAbsPartIdx, uiDepth );695 }696 else697 {698 #endif699 437 xReconInter( m_ppcCU[uiDepth], uiDepth ); 700 #if NH_3D_SDC_INTER701 }702 #endif703 #if NH_3D_DBBP704 }705 #endif706 438 break; 707 439 case MODE_INTRA: 708 #if NH_3D709 #if NH_3D_DIS710 if( m_ppcCU[uiDepth]->getDISFlag(0) )711 {712 xReconDIS( m_ppcCU[uiDepth], 0, uiDepth );713 }714 #else715 if(false )716 {717 // xReconDIS( m_ppcCU[uiDepth], 0, uiDepth );718 }719 #endif720 #if NH_3D_SDC_INTRA721 else if( m_ppcCU[uiDepth]->getSDCFlag(0) )722 {723 xReconIntraSDC( m_ppcCU[uiDepth], 0, uiDepth );724 }725 #endif726 else727 #endif728 440 xReconIntraQT( m_ppcCU[uiDepth], uiDepth ); 729 441 break; … … 794 506 } 795 507 796 #if NH_3D_DIS 797 Void TDecCu::xReconDIS( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 798 { 799 UInt uiWidth = pcCU->getWidth ( 0 ); 800 UInt uiHeight = pcCU->getHeight ( 0 ); 801 802 TComYuv* pcRecoYuv = m_ppcYuvReco[uiDepth]; 803 804 UInt uiStride = pcRecoYuv->getStride (COMPONENT_Y); 805 Pel* piReco = pcRecoYuv->getAddr( COMPONENT_Y, uiAbsPartIdx ); 806 807 808 AOF( uiWidth == uiHeight ); 809 AOF( uiAbsPartIdx == 0 ); 810 811 TComTURecurse rTu(pcCU, 0); 812 const ChromaFormat chFmt = rTu.GetChromaFormat(); 813 814 DEBUG_STRING_NEW(sTemp) 815 if ( pcCU->getDISType(uiAbsPartIdx) == 0 ) 816 { 817 const Bool bUseFilteredPredictions=TComPrediction::filteringIntraReferenceSamples(COMPONENT_Y, VER_IDX, uiWidth, uiHeight, chFmt, pcCU->getSlice()->getSPS()->getSpsRangeExtension().getIntraSmoothingDisabledFlag()); 818 m_pcPrediction->initIntraPatternChType( rTu, COMPONENT_Y, bUseFilteredPredictions DEBUG_STRING_PASS_INTO(sTemp) ); 819 m_pcPrediction->predIntraAng( COMPONENT_Y, VER_IDX, 0 /* Decoder does not have an original image */, 0, piReco, uiStride, rTu, bUseFilteredPredictions ); 820 } 821 else if ( pcCU->getDISType(uiAbsPartIdx) == 1 ) 822 { 823 const Bool bUseFilteredPredictions=TComPrediction::filteringIntraReferenceSamples(COMPONENT_Y, HOR_IDX, uiWidth, uiHeight, chFmt, pcCU->getSlice()->getSPS()->getSpsRangeExtension().getIntraSmoothingDisabledFlag()); 824 m_pcPrediction->initIntraPatternChType( rTu, COMPONENT_Y, bUseFilteredPredictions DEBUG_STRING_PASS_INTO(sTemp) ); 825 m_pcPrediction->predIntraAng( COMPONENT_Y, HOR_IDX, 0 /* Decoder does not have an original image */, 0, piReco, uiStride, rTu, bUseFilteredPredictions ); 826 } 827 else if ( pcCU->getDISType(uiAbsPartIdx) == 2 ) 828 { 829 Pel pSingleDepth = 1 << ( pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA) - 1 ); 830 pcCU->getNeighDepth ( 0, 0, &pSingleDepth, 0 ); 831 for( UInt uiY = 0; uiY < uiHeight; uiY++ ) 832 { 833 for( UInt uiX = 0; uiX < uiWidth; uiX++ ) 834 { 835 piReco[ uiX ] = pSingleDepth; 836 } 837 piReco+= uiStride; 838 } 839 } 840 else if ( pcCU->getDISType(uiAbsPartIdx) == 3 ) 841 { 842 Pel pSingleDepth = 1 << ( pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA) - 1 ); 843 pcCU->getNeighDepth ( 0, 0, &pSingleDepth, 1 ); 844 for( UInt uiY = 0; uiY < uiHeight; uiY++ ) 845 { 846 for( UInt uiX = 0; uiX < uiWidth; uiX++ ) 847 { 848 piReco[ uiX ] = pSingleDepth; 849 } 850 piReco+= uiStride; 851 } 852 } 853 854 // clear UV 855 UInt uiStrideC = pcRecoYuv->getStride(COMPONENT_Cb); 856 Pel *pRecCb = pcRecoYuv->getAddr(COMPONENT_Cb); 857 Pel *pRecCr = pcRecoYuv->getAddr(COMPONENT_Cr); 858 859 for (Int y=0; y<uiHeight/2; y++) 860 { 861 for (Int x=0; x<uiWidth/2; x++) 862 { 863 pRecCb[x] = 1<<(pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_CHROMA)-1); 864 pRecCr[x] = 1<<(pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_CHROMA)-1); 865 } 866 867 pRecCb += uiStrideC; 868 pRecCr += uiStrideC; 869 } 870 } 871 #endif 872 #if NH_3D_SDC_INTER 873 Void TDecCu::xReconInterSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 874 { 875 // inter prediction 876 m_pcPrediction->motionCompensation( pcCU, m_ppcYuvReco[uiDepth] ); 877 878 UInt uiWidth = pcCU->getWidth ( 0 ); 879 UInt uiHeight = pcCU->getHeight( 0 ); 880 881 Pel *pResi; 882 UInt uiPelX, uiPelY; 883 UInt uiResiStride = m_ppcYuvResi[uiDepth]->getStride( COMPONENT_Y ); 884 Int bitDepthC = pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_CHROMA); 885 886 pResi = m_ppcYuvResi[uiDepth]->getAddr( COMPONENT_Y ); 887 for( uiPelY = 0; uiPelY < uiHeight; uiPelY++ ) 888 { 889 for( uiPelX = 0; uiPelX < uiWidth; uiPelX++ ) 890 { 891 pResi[ uiPelX ] = pcCU->getSDCSegmentDCOffset( 0, 0 ); 892 } 893 pResi += uiResiStride; 894 } 895 896 m_ppcYuvReco[uiDepth]->addClip( m_ppcYuvReco[uiDepth], m_ppcYuvResi[uiDepth], 0, pcCU->getWidth( 0 ), pcCU->getSlice()->getSPS()->getBitDepths() ); 897 898 // clear UV 899 UInt uiStrideC = m_ppcYuvReco[uiDepth]->getStride( COMPONENT_Cb ); 900 Pel *pRecCb = m_ppcYuvReco[uiDepth]->getAddr( COMPONENT_Cb ); 901 Pel *pRecCr = m_ppcYuvReco[uiDepth]->getAddr( COMPONENT_Cr ); 902 903 for (Int y = 0; y < uiHeight/2; y++) 904 { 905 for (Int x = 0; x < uiWidth/2; x++) 906 { 907 pRecCb[x] = (Pel)( 1 << ( bitDepthC - 1 ) ); 908 pRecCr[x] = (Pel)( 1 << ( bitDepthC - 1 ) ); 909 } 910 911 pRecCb += uiStrideC; 912 pRecCr += uiStrideC; 913 } 914 } 915 #endif 916 917 #if NH_3D_DBBP 918 Void TDecCu::xReconInterDBBP( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 919 { 920 AOF(!pcCU->getSlice()->getIsDepth()); 921 AOF(!pcCU->getSlice()->isIntra()); 922 PartSize ePartSize = pcCU->getPartitionSize( 0 ); 923 924 Int bitDepthY = pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA); 925 926 // get collocated depth block 927 UInt uiDepthStride = 0; 928 #if H_3D_FCO 929 Pel* pDepthPels = pcCU->getVirtualDepthBlock(pcCU->getZorderIdxInCU(), pcCU->getWidth(0), pcCU->getHeight(0), uiDepthStride); 930 #else 931 Pel* pDepthPels = pcCU->getVirtualDepthBlock(0, pcCU->getWidth(0), pcCU->getHeight(0), uiDepthStride); 932 #endif 933 AOF( pDepthPels != NULL ); 934 AOF( uiDepthStride != 0 ); 935 936 // compute mask by segmenting depth block 937 Bool pMask[MAX_CU_SIZE*MAX_CU_SIZE]; 938 Bool bValidMask = m_pcPrediction->getSegmentMaskFromDepth(pDepthPels, uiDepthStride, pcCU->getWidth(0), pcCU->getHeight(0), pMask, pcCU); 939 AOF(bValidMask); 940 941 DbbpTmpData* pDBBPTmpData = pcCU->getDBBPTmpData(); 942 TComYuv* apSegPredYuv[2] = { m_ppcYuvReco[uiDepth], m_ppcYuvRecoDBBP[uiDepth] }; 943 944 // first, extract the two sets of motion parameters 945 UInt uiPUOffset = ( g_auiPUOffset[UInt( ePartSize )] << ( ( pcCU->getSlice()->getSPS()->getMaxTotalCUDepth() - uiDepth ) << 1 ) ) >> 4; 946 for( UInt uiSegment = 0; uiSegment < 2; uiSegment++ ) 947 { 948 UInt uiPartAddr = uiSegment*uiPUOffset; 949 950 pDBBPTmpData->auhInterDir[uiSegment] = pcCU->getInterDir(uiPartAddr); 951 assert( pDBBPTmpData->auhInterDir[uiSegment] == 1 || pDBBPTmpData->auhInterDir[uiSegment] == 2 ); // only uni-prediction allowed 952 953 for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ ) 954 { 955 RefPicList eRefList = (RefPicList)uiRefListIdx; 956 pcCU->getMvField(pcCU, uiPartAddr, eRefList, pDBBPTmpData->acMvField[uiSegment][eRefList]); 957 } 958 959 #if NH_3D 960 AOF( pcCU->getARPW(uiPartAddr) == 0 ); 961 AOF( pcCU->getICFlag(uiPartAddr) == false ); 962 AOF( pcCU->getSPIVMPFlag(uiPartAddr) == false ); 963 AOF( pcCU->getVSPFlag(uiPartAddr) == 0 ); 964 #endif 965 } 966 967 // do motion compensation for each segment as 2Nx2N 968 pcCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth ); 969 pcCU->setPredModeSubParts( MODE_INTER, 0, uiDepth ); 970 for( UInt uiSegment = 0; uiSegment < 2; uiSegment++ ) 971 { 972 pcCU->setInterDirSubParts( pDBBPTmpData->auhInterDir[uiSegment], 0, 0, uiDepth ); 973 974 for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ ) 975 { 976 RefPicList eRefList = (RefPicList)uiRefListIdx; 977 978 pcCU->getCUMvField( eRefList )->setAllMvField( pDBBPTmpData->acMvField[uiSegment][eRefList], SIZE_2Nx2N, 0, 0 ); 979 } 980 981 // inter prediction 982 m_pcPrediction->motionCompensation( pcCU, apSegPredYuv[uiSegment] ); 983 } 984 985 // restore motion information in both segments again 986 pcCU->setPartSizeSubParts( ePartSize, 0, uiDepth ); 987 pcCU->setPredModeSubParts( MODE_INTER, 0, uiDepth ); 988 for( UInt uiSegment = 0; uiSegment < 2; uiSegment++ ) 989 { 990 UInt uiPartAddr = uiSegment*uiPUOffset; 991 992 pcCU->setDBBPFlagSubParts(true, uiPartAddr, uiSegment, uiDepth); 993 pcCU->setInterDirSubParts(pDBBPTmpData->auhInterDir[uiSegment], uiPartAddr, uiSegment, uiDepth); // interprets depth relative to LCU level 994 995 for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ ) 996 { 997 RefPicList eRefList = (RefPicList)uiRefListIdx; 998 999 pcCU->getCUMvField( eRefList )->setAllMvField( pDBBPTmpData->acMvField[uiSegment][eRefList], ePartSize, uiPartAddr, 0, uiSegment ); // interprets depth relative to rpcTempCU level 1000 } 1001 } 1002 1003 // reconstruct final prediction signal by combining both segments 1004 m_pcPrediction->combineSegmentsWithMask(apSegPredYuv, m_ppcYuvReco[uiDepth], pMask, pcCU->getWidth(0), pcCU->getHeight(0), 0, ePartSize, bitDepthY); 1005 1006 // inter recon 1007 xDecodeInterTexture( pcCU, uiDepth ); 1008 1009 // clip for only non-zero cbp case 1010 if ( ( pcCU->getCbf( 0, COMPONENT_Y ) ) || ( pcCU->getCbf( 0, COMPONENT_Cb ) ) || ( pcCU->getCbf(0, COMPONENT_Cr ) ) ) 1011 { 1012 m_ppcYuvReco[uiDepth]->addClip( m_ppcYuvReco[uiDepth], m_ppcYuvResi[uiDepth], 0, pcCU->getWidth( 0 ), pcCU->getSlice()->getSPS()->getBitDepths() ); 1013 } 1014 else 1015 { 1016 m_ppcYuvReco[uiDepth]->copyPartToPartYuv( m_ppcYuvReco[uiDepth],0, pcCU->getWidth( 0 ),pcCU->getHeight( 0 )); 1017 } 1018 } 1019 #endif 508 1020 509 1021 510 … … 1081 570 1082 571 //===== get prediction signal ===== 1083 #if NH_3D_DMM1084 if( bIsLuma && isDmmMode( uiChFinalMode ) )1085 {1086 m_pcPrediction->predIntraLumaDmm( pcCU, uiAbsPartIdx, getDmmType( uiChFinalMode ), piPred, uiStride, uiWidth, uiHeight );1087 }1088 else1089 {1090 #endif1091 572 m_pcPrediction->predIntraAng( compID, uiChFinalMode, 0 /* Decoder does not have an original image */, 0, piPred, uiStride, rTu, bUseFilteredPredictions ); 1092 #if NH_3D_DMM1093 }1094 #endif1095 573 1096 574 #if DEBUG_STRING … … 1110 588 std::string *psDebug=(DebugOptionList::DebugString_InvTran.getInt()&debugPredModeMask) ? &sDebug : 0; 1111 589 #endif 1112 #if H_3D1113 Bool useDltFlag = (isDmmMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getPPS()->getDLT()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps());1114 1115 if ( pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiTrDepth ) || useDltFlag )1116 #else1117 590 if (pcCU->getCbf(uiAbsPartIdx, compID, rTu.GetTransformDepthRel()) != 0) 1118 #endif1119 591 { 1120 592 m_pcTrQuant->invTransformNxN( rTu, compID, piResi, uiStride, pcCoeff, cQP DEBUG_STRING_PASS_INTO(psDebug) ); … … 1255 727 } 1256 728 1257 #if NH_3D_SDC_INTRA1258 Void TDecCu::xReconIntraSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )1259 {1260 TComYuv* pcRecoYuv = m_ppcYuvReco[uiDepth];1261 TComYuv* pcPredYuv = m_ppcYuvReco[uiDepth];1262 TComYuv* pcResiYuv = m_ppcYuvResi[uiDepth];1263 1264 UInt uiWidth = pcCU->getWidth ( 0 );1265 UInt uiHeight = pcCU->getHeight( 0 );1266 UInt uiLumaPredMode = pcCU->getIntraDir( CHANNEL_TYPE_LUMA, uiAbsPartIdx );1267 const Int bitDepthY = pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA);1268 const TComSPS &sps = *(pcCU->getSlice()->getSPS());1269 const ChromaFormat chFmt = pcCU->getPic()->getChromaFormat();1270 1271 UInt sdcDepth = 0;1272 UInt uiStride;1273 Pel* piReco;1274 Pel* piPred;1275 Pel* piResi;1276 1277 Pel* piRecIPred;1278 UInt uiRecIPredStride;1279 1280 Pel apDCPredValues[2];1281 UInt uiNumSegments;1282 1283 Bool* pbMask = NULL;1284 UInt uiMaskStride = 0;1285 1286 #if NH_3D_DMM1287 if( isDmmMode( uiLumaPredMode ) )1288 {1289 assert( uiWidth == uiHeight );1290 assert( uiWidth >= DMM_MIN_SIZE && uiWidth <= DMM_MAX_SIZE );1291 assert( !((uiWidth >> pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize()) > 1) );1292 1293 uiNumSegments = 2;1294 1295 uiStride = pcRecoYuv->getStride( COMPONENT_Y );1296 piReco = pcRecoYuv->getAddr ( COMPONENT_Y, uiAbsPartIdx );1297 piPred = pcPredYuv->getAddr ( COMPONENT_Y, uiAbsPartIdx );1298 piResi = pcResiYuv->getAddr ( COMPONENT_Y, uiAbsPartIdx );1299 1300 piRecIPred = pcCU->getPic()->getPicYuvRec()->getAddr ( COMPONENT_Y, pcCU->getCtuRsAddr(), pcCU->getZorderIdxInCtu() + uiAbsPartIdx );1301 uiRecIPredStride = pcCU->getPic()->getPicYuvRec()->getStride( COMPONENT_Y );1302 1303 //===== init availability pattern =====1304 TComTURecurse tuRecurseCU(pcCU, 0);1305 TComTURecurse tuRecurseWithPU(tuRecurseCU, false, TComTU::DONT_SPLIT);1306 1307 DEBUG_STRING_NEW(sTemp)1308 m_pcPrediction->initIntraPatternChType( tuRecurseWithPU, COMPONENT_Y, false DEBUG_STRING_PASS_INTO(sTemp) );1309 1310 // get partition1311 pbMask = new Bool[ uiWidth*uiHeight ];1312 uiMaskStride = uiWidth;1313 switch( getDmmType( uiLumaPredMode ) )1314 {1315 case( DMM1_IDX ): { (getWedgeListScaled( uiWidth )->at( pcCU->getDmm1WedgeTabIdx( uiAbsPartIdx ) )).getPatternScaledCopy( uiWidth, pbMask ); } break;1316 case( DMM4_IDX ): { m_pcPrediction->predContourFromTex( pcCU, uiAbsPartIdx, uiWidth, uiHeight, pbMask ); } break;1317 default: assert(0);1318 }1319 1320 // get predicted partition values1321 Pel predDC1 = 0, predDC2 = 0;1322 m_pcPrediction->predBiSegDCs( pcCU, uiAbsPartIdx, uiWidth, uiHeight, pbMask, uiMaskStride, predDC1, predDC2 );1323 1324 // set prediction signal1325 Pel* pDst = piPred;1326 m_pcPrediction->assignBiSegDCs( pDst, uiStride, pbMask, uiMaskStride, predDC1, predDC2 );1327 apDCPredValues[0] = predDC1;1328 apDCPredValues[1] = predDC2;1329 }1330 else // regular HEVC intra modes1331 {1332 #endif1333 uiNumSegments = 1;1334 1335 if( ( uiWidth >> pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() ) > 1 )1336 {1337 sdcDepth = g_aucConvertToBit[uiWidth] + 2 - pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize();1338 }1339 1340 //===== loop over partitions =====1341 TComTURecurse tuRecurseCU(pcCU, 0);1342 TComTURecurse tuRecurseWithPU(tuRecurseCU, false, (sdcDepth==0)?TComTU::DONT_SPLIT:TComTU::QUAD_SPLIT);1343 1344 do1345 {1346 const TComRectangle &puRect = tuRecurseWithPU.getRect(COMPONENT_Y);1347 const UInt uiAbsPartIdxTU = tuRecurseWithPU.GetAbsPartIdxTU();1348 1349 Pel* piPredTU = pcPredYuv->getAddr ( COMPONENT_Y, uiAbsPartIdxTU );1350 UInt uiStrideTU = pcPredYuv->getStride( COMPONENT_Y );1351 1352 Pel* piRecIPredTU = pcCU->getPic()->getPicYuvRec()->getAddr( COMPONENT_Y, pcCU->getCtuRsAddr(), pcCU->getZorderIdxInCtu() + uiAbsPartIdxTU );1353 UInt uiRecIPredStrideTU = pcCU->getPic()->getPicYuvRec()->getStride(COMPONENT_Y);1354 1355 const Bool bUseFilter = TComPrediction::filteringIntraReferenceSamples(COMPONENT_Y, uiLumaPredMode, puRect.width, puRect.height, chFmt, sps.getSpsRangeExtension().getIntraSmoothingDisabledFlag());1356 1357 //===== init pattern for luma prediction =====1358 DEBUG_STRING_NEW(sTemp)1359 m_pcPrediction->initIntraPatternChType( tuRecurseWithPU, COMPONENT_Y, bUseFilter DEBUG_STRING_PASS_INTO(sTemp) );1360 1361 m_pcPrediction->predIntraAng( COMPONENT_Y, uiLumaPredMode, NULL, uiStrideTU, piPredTU, uiStrideTU, tuRecurseWithPU, bUseFilter );1362 1363 // copy for prediction of next part1364 for( UInt uiY = 0; uiY < puRect.height; uiY++ )1365 {1366 for( UInt uiX = 0; uiX < puRect.width; uiX++ )1367 {1368 piPredTU [ uiX ] = ClipBD( piPredTU[ uiX ], bitDepthY );1369 piRecIPredTU [ uiX ] = piPredTU[ uiX ];1370 }1371 piPredTU += uiStrideTU;1372 piRecIPredTU += uiRecIPredStrideTU;1373 }1374 1375 1376 } while (tuRecurseWithPU.nextSection(tuRecurseCU));1377 1378 // reset to full block1379 uiWidth = pcCU->getWidth( 0 );1380 uiHeight = pcCU->getHeight( 0 );1381 1382 uiStride = pcRecoYuv->getStride( COMPONENT_Y );1383 piReco = pcRecoYuv->getAddr ( COMPONENT_Y, uiAbsPartIdx );1384 piPred = pcPredYuv->getAddr ( COMPONENT_Y, uiAbsPartIdx );1385 piResi = pcResiYuv->getAddr ( COMPONENT_Y, uiAbsPartIdx );1386 1387 piRecIPred = pcCU->getPic()->getPicYuvRec()->getAddr ( COMPONENT_Y, pcCU->getCtuRsAddr(), pcCU->getZorderIdxInCtu() + uiAbsPartIdx );1388 uiRecIPredStride = pcCU->getPic()->getPicYuvRec()->getStride( COMPONENT_Y );1389 1390 m_pcPrediction->predConstantSDC( piPred, uiStride, uiWidth, apDCPredValues[0] ); apDCPredValues[1] = 0;1391 #if NH_3D_DMM1392 }1393 #endif1394 1395 // reconstruct residual based on mask + DC residuals1396 Pel apDCResiValues[2];1397 for( UInt uiSegment = 0; uiSegment < uiNumSegments; uiSegment++ )1398 {1399 #if NH_3D_DLT1400 Pel pPredIdx = pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), apDCPredValues[uiSegment] );1401 Pel pResiIdx = pcCU->getSDCSegmentDCOffset(uiSegment, uiAbsPartIdx);1402 Pel pRecoValue = pcCU->getSlice()->getPPS()->getDLT()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), pPredIdx + pResiIdx );1403 1404 apDCResiValues[uiSegment] = pRecoValue - apDCPredValues[uiSegment];1405 #else1406 apDCResiValues[uiSegment] = pcCU->getSDCSegmentDCOffset(uiSegment, uiAbsPartIdx);1407 #endif1408 }1409 1410 //===== reconstruction =====1411 Bool*pMask = pbMask;1412 Pel* pPred = piPred;1413 Pel* pResi = piResi;1414 Pel* pReco = piReco;1415 Pel* pRecIPred = piRecIPred;1416 1417 for( UInt uiY = 0; uiY < uiHeight; uiY++ )1418 {1419 for( UInt uiX = 0; uiX < uiWidth; uiX++ )1420 {1421 UChar ucSegment = pMask?(UChar)pMask[uiX]:0;1422 assert( ucSegment < uiNumSegments );1423 1424 Pel pResiDC = apDCResiValues[ucSegment];1425 1426 pReco [ uiX ] = ClipBD( pPred[ uiX ] + pResiDC, bitDepthY );1427 pRecIPred[ uiX ] = pReco[ uiX ];1428 }1429 pPred += uiStride;1430 pResi += uiStride;1431 pReco += uiStride;1432 pRecIPred += uiRecIPredStride;1433 pMask += uiMaskStride;1434 }1435 1436 // clear chroma1437 UInt uiStrideC = pcPredYuv->getStride( COMPONENT_Cb );1438 Pel *pRecCb = pcPredYuv->getAddr ( COMPONENT_Cb, uiAbsPartIdx );1439 Pel *pRecCr = pcPredYuv->getAddr ( COMPONENT_Cr, uiAbsPartIdx );1440 1441 for (Int y=0; y<uiHeight/2; y++)1442 {1443 for (Int x=0; x<uiWidth/2; x++)1444 {1445 pRecCb[x] = 128;1446 pRecCr[x] = 128;1447 }1448 1449 pRecCb += uiStrideC;1450 pRecCr += uiStrideC;1451 }1452 #if NH_3D_DMM1453 if( pbMask ) { delete[] pbMask; }1454 #endif1455 }1456 #endif1457 729 1458 730 -
branches/HTM-16.0-MV-draft-5/source/Lib/TLibDecoder/TDecCu.h
r1313 r1390 62 62 TComDataCU** m_ppcCU; ///< CU data array 63 63 64 #if NH_3D_DBBP65 TComYuv** m_ppcYuvRecoDBBP;66 #endif67 64 68 65 // access channel … … 102 99 Void xReconInter ( TComDataCU* pcCU, UInt uiDepth ); 103 100 104 #if NH_3D_DBBP105 Void xReconInterDBBP ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );106 #endif107 101 108 102 Void xReconIntraQT ( TComDataCU* pcCU, UInt uiDepth ); … … 124 118 Void xFillPCMBuffer (TComDataCU* pCU, UInt depth); 125 119 126 #if NH_3D_DIS127 Void xReconDIS ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );128 #endif129 #if NH_3D_SDC_INTRA130 Void xReconIntraSDC ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );131 #endif132 #if NH_3D_SDC_INTER133 Void xReconInterSDC ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );134 #endif135 120 136 121 }; -
branches/HTM-16.0-MV-draft-5/source/Lib/TLibDecoder/TDecEntropy.cpp
r1386 r1390 60 60 m_pcEntropyDecoderIf->parseSkipFlag( pcCU, uiAbsPartIdx, uiDepth ); 61 61 } 62 #if NH_3D_DIS63 Void TDecEntropy::decodeDIS( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )64 {65 if( !pcCU->getSlice()->getDepthIntraSkipFlag() )66 {67 return;68 }69 m_pcEntropyDecoderIf->parseDIS( pcCU, uiAbsPartIdx, uiDepth );70 }71 #endif72 62 73 63 Void TDecEntropy::decodeCUTransquantBypassFlag(TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) … … 104 94 } 105 95 106 #if NH_3D_ARP 107 Void TDecEntropy::decodeARPW( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 108 { 109 if( !pcCU->getSlice()->getARPStepNum() || pcCU->isIntra( uiAbsPartIdx ) ) 110 { 111 return; 112 } 113 114 if( pcCU->getPartitionSize(uiAbsPartIdx) != SIZE_2Nx2N ) 115 { 116 pcCU->setARPWSubParts( 0 , uiAbsPartIdx, uiDepth ); 117 } 118 else 119 { 120 m_pcEntropyDecoderIf->parseARPW( pcCU , uiAbsPartIdx , uiDepth ); 121 } 122 } 123 #endif 124 125 #if NH_3D_IC 126 Void TDecEntropy::decodeICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 127 { 128 pcCU->setICFlagSubParts( false , uiAbsPartIdx, 0, uiDepth ); 129 130 #if NH_3D_ARP 131 if ( pcCU->isIntra( uiAbsPartIdx ) || ( pcCU->getSlice()->getViewIndex() == 0 ) || pcCU->getSlice()->getIsDepth() || pcCU->getARPW( uiAbsPartIdx ) > 0 ) 132 #else 133 if ( pcCU->isIntra( uiAbsPartIdx ) || ( pcCU->getSlice()->getViewIndex() == 0 ) || pcCU->getSlice()->getIsDepth() ) 134 #endif 135 { 136 return; 137 } 138 139 if( !pcCU->getSlice()->getApplyIC() ) 140 return; 141 142 if( pcCU->isICFlagRequired( uiAbsPartIdx ) ) 143 m_pcEntropyDecoderIf->parseICFlag( pcCU, uiAbsPartIdx, uiDepth ); 144 } 145 #endif 96 146 97 147 98 Void TDecEntropy::decodeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) … … 165 116 { 166 117 decodeIntraDirModeLuma ( pcCU, uiAbsPartIdx, uiDepth ); 167 #if NH_3D_SDC_INTRA168 decodeSDCFlag ( pcCU, uiAbsPartIdx, uiDepth );169 #endif170 118 if (pcCU->getPic()->getChromaFormat()!=CHROMA_400) 171 119 { … … 239 187 UInt uiPUOffset = ( g_auiPUOffset[UInt( ePartSize )] << ( ( pcCU->getSlice()->getSPS()->getMaxTotalCUDepth() - uiDepth ) << 1 ) ) >> 4; 240 188 241 #if NH_3D_MLC242 //#if H_3D_IV_MERGE243 TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists244 UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM];245 #else246 189 TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS << 1]; // double length for mv of both lists 247 190 UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS]; 248 #endif249 #if NH_3D_SPIVMP250 Bool bSPIVMPFlag[MRG_MAX_NUM_CANDS_MEM];251 TComMvField* pcMvFieldSP = new TComMvField[pcCU->getPic()->getPicSym()->getNumPartitionsInCtu()*2];252 UChar* puhInterDirSP = new UChar[pcCU->getPic()->getPicSym()->getNumPartitionsInCtu()];253 #endif254 #if NH_3D_IV_MERGE255 pcSubCU->copyDVInfoFrom( pcCU, uiAbsPartIdx);256 #endif257 191 for ( UInt ui = 0; ui < pcCU->getSlice()->getMaxNumMergeCand(); ui++ ) 258 192 { … … 264 198 pcSubCU->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_0 ); 265 199 pcSubCU->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_1 ); 266 #if NH_3D267 200 for ( UInt uiPartIdx = 0, uiSubPartIdx = uiAbsPartIdx; uiPartIdx < uiNumPU; uiPartIdx++, uiSubPartIdx += uiPUOffset ) 268 201 { … … 273 206 //DTRACE_PU("x1", uiTPelY) 274 207 #endif 275 276 ////// Parse PUs syntax277 208 decodeMergeFlag( pcCU, uiSubPartIdx, uiDepth, uiPartIdx ); 278 209 if ( pcCU->getMergeFlag( uiSubPartIdx ) ) 279 210 { 280 decodeMergeIndex( pcCU, uiPartIdx, uiSubPartIdx, uiDepth ); 281 } 282 else 283 { 284 decodeInterDirPU( pcCU, uiSubPartIdx, uiDepth, uiPartIdx ); 285 for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ ) 286 { 287 if ( pcCU->getSlice()->getNumRefIdx( RefPicList( uiRefListIdx ) ) > 0 ) 288 { 289 decodeRefFrmIdxPU( pcCU, uiSubPartIdx, uiDepth, uiPartIdx, RefPicList( uiRefListIdx ) ); 290 decodeMvdPU ( pcCU, uiSubPartIdx, uiDepth, uiPartIdx, RefPicList( uiRefListIdx ) ); 291 decodeMVPIdxPU ( pcSubCU, uiSubPartIdx-uiAbsPartIdx, uiDepth, uiPartIdx, RefPicList( uiRefListIdx ) ); 292 } 293 } 294 } 295 } 296 297 ////// Parse CUs extension syntax 298 #if NH_3D_DBBP 299 decodeDBBPFlag( pcCU, uiAbsPartIdx, uiDepth ); 300 #endif 301 #if NH_3D_SDC_INTER 302 decodeSDCFlag ( pcCU, uiAbsPartIdx, uiDepth ); 303 #endif 304 #if NH_3D_ARP 305 decodeARPW ( pcCU, uiAbsPartIdx, uiDepth ); 306 #endif 307 #if NH_3D_IC 308 decodeICFlag( pcCU, uiAbsPartIdx, uiDepth ); 309 #endif 310 311 ////// Decode motion vectors 312 for ( UInt uiPartIdx = 0, uiSubPartIdx = uiAbsPartIdx; uiPartIdx < uiNumPU; uiPartIdx++, uiSubPartIdx += uiPUOffset ) 313 { 314 if ( pcCU->getMergeFlag( uiSubPartIdx ) ) 315 { 316 UInt uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx); 211 decodeMergeIndex( pcCU, uiPartIdx, uiSubPartIdx, uiDepth ); 317 212 #if ENVIRONMENT_VARIABLE_DEBUG_AND_TEST 318 213 if (bDebugPredEnabled) … … 323 218 #endif 324 219 325 #if NH_3D_DBBP 326 if ( pcCU->getSlice()->getPPS()->getLog2ParallelMergeLevelMinus2() && ePartSize != SIZE_2Nx2N && pcSubCU->getWidth( 0 ) <= 8 && pcCU->getDBBPFlag(uiAbsPartIdx) == false ) 327 #else 328 if ( pcCU->getSlice()->getPPS()->getLog2ParallelMergeLevelMinus2() && ePartSize != SIZE_2Nx2N && pcSubCU->getWidth( 0 ) <= 8 ) 329 #endif 220 const UInt uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx); 221 if ( pcCU->getSlice()->getPPS()->getLog2ParallelMergeLevelMinus2() && ePartSize != SIZE_2Nx2N && pcSubCU->getWidth( 0 ) <= 8 ) 330 222 { 331 223 if ( !hasMergedCandList ) … … 333 225 pcSubCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth ); // temporarily set. 334 226 335 #if NH_3D_MLC336 #if NH_3D_VSP337 Int vspFlag[MRG_MAX_NUM_CANDS_MEM];338 memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);339 #endif340 #if NH_3D_SPIVMP341 memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM);342 #endif343 pcSubCU->initAvailableFlags();344 #endif345 227 pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand ); 346 #if NH_3D_MLC347 pcSubCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours348 #if NH_3D_SPIVMP349 , pcMvFieldSP, puhInterDirSP350 #endif351 , numValidMergeCand );352 pcSubCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours353 #if NH_3D_VSP354 , vspFlag355 #endif356 #if NH_3D_SPIVMP357 , bSPIVMPFlag358 #endif359 , numValidMergeCand );360 #if NH_3D_VSP361 pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );362 #endif363 #endif364 228 pcSubCU->setPartSizeSubParts( ePartSize, 0, uiDepth ); // restore. 365 229 hasMergedCandList = true; … … 368 232 else 369 233 { 370 #if NH_3D_MLC 371 #if NH_3D_VSP 372 Int vspFlag[MRG_MAX_NUM_CANDS_MEM]; 373 memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 374 #endif 375 #if NH_3D_SPIVMP 376 memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM); 377 #endif 378 pcSubCU->initAvailableFlags(); 379 #endif 234 380 235 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); 381 #if NH_3D_MLC 382 pcSubCU->xGetInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours 383 #if NH_3D_SPIVMP 384 , pcMvFieldSP, puhInterDirSP 385 #endif 386 ,numValidMergeCand, uiMergeIndex ); 387 pcSubCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours 388 #if NH_3D_VSP 389 , vspFlag 390 #endif 391 #if NH_3D_SPIVMP 392 , bSPIVMPFlag 393 #endif 394 ,numValidMergeCand ); 395 #if NH_3D_VSP 396 pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); 397 #endif 398 #endif 399 } 236 } 237 400 238 pcCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); 401 239 … … 409 247 pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvd( cTmpMv, ePartSize, uiSubPartIdx, uiDepth, uiPartIdx ); 410 248 pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvField( cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ], ePartSize, uiSubPartIdx, uiDepth, uiPartIdx ); 411 #if NH_3D_VSP412 #if NH_3D_DBBP413 if( pcCU->getVSPFlag( uiSubPartIdx ) != 0 && !pcCU->getDBBPFlag( uiAbsPartIdx ) )414 #else415 if( pcCU->getVSPFlag( uiSubPartIdx ) != 0 )416 #endif417 {418 if ( uhInterDirNeighbours[ uiMergeIndex ] & (1<<uiRefListIdx) )419 {420 UInt dummy;421 Int vspSize;422 Int width, height;423 pcCU->getPartIndexAndSize( uiPartIdx, dummy, width, height, uiSubPartIdx, pcCU->getTotalNumPart()==256 );424 pcCU->setMvFieldPUForVSP( pcCU, uiSubPartIdx, width, height, RefPicList( uiRefListIdx ), cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ].getRefIdx(), vspSize );425 pcCU->setVSPFlag( uiSubPartIdx, vspSize );426 }427 }428 #endif429 249 } 430 250 } 431 #if NH_3D_SPIVMP432 pcCU->setSPIVMPFlagSubParts(bSPIVMPFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );433 if (bSPIVMPFlag[uiMergeIndex] != 0)434 {435 Int iWidth, iHeight;436 UInt uiIdx;437 pcCU->getPartIndexAndSize( uiPartIdx, uiIdx, iWidth, iHeight, uiSubPartIdx, true );438 439 UInt uiSPAddr;440 441 Int iNumSPInOneLine, iNumSP, iSPWidth, iSPHeight;442 443 pcCU->getSPPara(iWidth, iHeight, iNumSP, iNumSPInOneLine, iSPWidth, iSPHeight);444 445 for (Int iPartitionIdx = 0; iPartitionIdx < iNumSP; iPartitionIdx++)446 {447 pcCU->getSPAbsPartIdx(uiSubPartIdx, iSPWidth, iSPHeight, iPartitionIdx, iNumSPInOneLine, uiSPAddr);448 pcCU->setInterDirSP(puhInterDirSP[iPartitionIdx], uiSPAddr, iSPWidth, iSPHeight);449 pcCU->getCUMvField( REF_PIC_LIST_0 )->setMvFieldSP(pcCU, uiSPAddr, pcMvFieldSP[2*iPartitionIdx], iSPWidth, iSPHeight);450 pcCU->getCUMvField( REF_PIC_LIST_1 )->setMvFieldSP(pcCU, uiSPAddr, pcMvFieldSP[2*iPartitionIdx + 1], iSPWidth, iSPHeight);451 }452 }453 #endif454 251 } 455 252 else 456 253 { 254 decodeInterDirPU( pcCU, uiSubPartIdx, uiDepth, uiPartIdx ); 457 255 for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ ) 458 { 256 { 459 257 if ( pcCU->getSlice()->getNumRefIdx( RefPicList( uiRefListIdx ) ) > 0 ) 460 258 { 461 decodeMvsAMVP ( pcSubCU, uiSubPartIdx-uiAbsPartIdx, uiDepth, uiPartIdx, RefPicList( uiRefListIdx ) ); 259 decodeRefFrmIdxPU( pcCU, uiSubPartIdx, uiDepth, uiPartIdx, RefPicList( uiRefListIdx ) ); 260 decodeMvdPU ( pcCU, uiSubPartIdx, uiDepth, uiPartIdx, RefPicList( uiRefListIdx ) ); 261 decodeMVPIdxPU ( pcSubCU, uiSubPartIdx-uiAbsPartIdx, uiDepth, uiPartIdx, RefPicList( uiRefListIdx ) ); 462 262 #if ENVIRONMENT_VARIABLE_DEBUG_AND_TEST 463 263 if (bDebugPredEnabled) … … 471 271 #endif 472 272 } 473 } 273 } 474 274 } 475 275 … … 481 281 } 482 282 } 483 #else484 for ( UInt uiPartIdx = 0, uiSubPartIdx = uiAbsPartIdx; uiPartIdx < uiNumPU; uiPartIdx++, uiSubPartIdx += uiPUOffset )485 {486 #if NH_MV_ENC_DEC_TRAC487 DTRACE_PU_S("=========== prediction_unit ===========\n")488 // ToDo:489 //DTRACE_PU("x0", uiLPelX)490 //DTRACE_PU("x1", uiTPelY)491 #endif492 decodeMergeFlag( pcCU, uiSubPartIdx, uiDepth, uiPartIdx );493 if ( pcCU->getMergeFlag( uiSubPartIdx ) )494 {495 decodeMergeIndex( pcCU, uiPartIdx, uiSubPartIdx, uiDepth );496 #if ENVIRONMENT_VARIABLE_DEBUG_AND_TEST497 if (bDebugPredEnabled)498 {499 std::cout << "Coded merge flag, CU absPartIdx: " << uiAbsPartIdx << " PU(" << uiPartIdx << ") absPartIdx: " << uiSubPartIdx;500 std::cout << " merge index: " << (UInt)pcCU->getMergeIndex(uiSubPartIdx) << std::endl;501 }502 #endif503 #if NH_3D_IC504 decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );505 #endif506 507 const UInt uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx);508 if ( pcCU->getSlice()->getPPS()->getLog2ParallelMergeLevelMinus2() && ePartSize != SIZE_2Nx2N && pcSubCU->getWidth( 0 ) <= 8 )509 {510 if ( !hasMergedCandList )511 {512 pcSubCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth ); // temporarily set.513 514 #if NH_3D_MLC515 #if NH_3D_VSP516 Int vspFlag[MRG_MAX_NUM_CANDS_MEM];517 memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);518 #endif519 #if NH_3D_SPIVMP520 memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM);521 #endif522 pcSubCU->initAvailableFlags();523 #endif524 pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );525 #if NH_3D_MLC526 pcSubCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours527 #if NH_3D_SPIVMP528 , pcMvFieldSP, puhInterDirSP529 #endif530 , numValidMergeCand );531 pcSubCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours532 #if NH_3D_VSP533 , vspFlag534 #endif535 #if NH_3D_SPIVMP536 , bSPIVMPFlag537 #endif538 , numValidMergeCand );539 #if NH_3D_VSP540 pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );541 #endif542 #endif543 pcSubCU->setPartSizeSubParts( ePartSize, 0, uiDepth ); // restore.544 hasMergedCandList = true;545 }546 }547 else548 {549 550 #if NH_3D_MLC551 #if NH_3D_VSP552 Int vspFlag[MRG_MAX_NUM_CANDS_MEM];553 memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);554 #endif555 #if NH_3D_SPIVMP556 memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM);557 #endif558 pcSubCU->initAvailableFlags();559 #endif560 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );561 #if NH_3D_MLC562 pcSubCU->xGetInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours563 #if NH_3D_SPIVMP564 , pcMvFieldSP, puhInterDirSP565 #endif566 ,numValidMergeCand, uiMergeIndex );567 pcSubCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours568 #if NH_3D_VSP569 , vspFlag570 #endif571 #if NH_3D_SPIVMP572 , bSPIVMPFlag573 #endif574 ,numValidMergeCand );575 #if NH_3D_VSP576 pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );577 #endif578 #endif579 }580 581 pcCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );582 583 TComMv cTmpMv( 0, 0 );584 for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ )585 {586 if ( pcCU->getSlice()->getNumRefIdx( RefPicList( uiRefListIdx ) ) > 0 )587 {588 pcCU->setMVPIdxSubParts( 0, RefPicList( uiRefListIdx ), uiSubPartIdx, uiPartIdx, uiDepth);589 pcCU->setMVPNumSubParts( 0, RefPicList( uiRefListIdx ), uiSubPartIdx, uiPartIdx, uiDepth);590 pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvd( cTmpMv, ePartSize, uiSubPartIdx, uiDepth, uiPartIdx );591 pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvField( cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ], ePartSize, uiSubPartIdx, uiDepth, uiPartIdx );592 #if NH_3D_VSP593 if( pcCU->getVSPFlag( uiSubPartIdx ) != 0 )594 {595 if ( uhInterDirNeighbours[ uiMergeIndex ] & (1<<uiRefListIdx) )596 {597 UInt dummy;598 Int vspSize;599 Int width, height;600 pcCU->getPartIndexAndSize( uiPartIdx, dummy, width, height, uiSubPartIdx, pcCU->getTotalNumPart()==256 );601 pcCU->setMvFieldPUForVSP( pcCU, uiSubPartIdx, width, height, RefPicList( uiRefListIdx ), cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ].getRefIdx(), vspSize );602 pcCU->setVSPFlag( uiSubPartIdx, vspSize );603 }604 }605 #endif606 }607 }608 #if NH_3D_SPIVMP609 pcCU->setSPIVMPFlagSubParts(bSPIVMPFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );610 if (bSPIVMPFlag[uiMergeIndex] != 0)611 {612 Int iWidth, iHeight;613 UInt uiIdx;614 pcCU->getPartIndexAndSize( uiPartIdx, uiIdx, iWidth, iHeight, uiSubPartIdx, true );615 616 UInt uiSPAddr;617 618 Int iNumSPInOneLine, iNumSP, iSPWidth, iSPHeight;619 620 pcCU->getSPPara(iWidth, iHeight, iNumSP, iNumSPInOneLine, iSPWidth, iSPHeight);621 622 for (Int iPartitionIdx = 0; iPartitionIdx < iNumSP; iPartitionIdx++)623 {624 pcCU->getSPAbsPartIdx(uiSubPartIdx, iSPWidth, iSPHeight, iPartitionIdx, iNumSPInOneLine, uiSPAddr);625 pcCU->setInterDirSP(puhInterDirSP[iPartitionIdx], uiSPAddr, iSPWidth, iSPHeight);626 pcCU->getCUMvField( REF_PIC_LIST_0 )->setMvFieldSP(pcCU, uiSPAddr, pcMvFieldSP[2*iPartitionIdx], iSPWidth, iSPHeight);627 pcCU->getCUMvField( REF_PIC_LIST_1 )->setMvFieldSP(pcCU, uiSPAddr, pcMvFieldSP[2*iPartitionIdx + 1], iSPWidth, iSPHeight);628 }629 }630 #endif631 }632 else633 {634 decodeInterDirPU( pcCU, uiSubPartIdx, uiDepth, uiPartIdx );635 for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ )636 {637 if ( pcCU->getSlice()->getNumRefIdx( RefPicList( uiRefListIdx ) ) > 0 )638 {639 decodeRefFrmIdxPU( pcCU, uiSubPartIdx, uiDepth, uiPartIdx, RefPicList( uiRefListIdx ) );640 decodeMvdPU ( pcCU, uiSubPartIdx, uiDepth, uiPartIdx, RefPicList( uiRefListIdx ) );641 decodeMVPIdxPU ( pcSubCU, uiSubPartIdx-uiAbsPartIdx, uiDepth, uiPartIdx, RefPicList( uiRefListIdx ) );642 #if ENVIRONMENT_VARIABLE_DEBUG_AND_TEST643 if (bDebugPredEnabled)644 {645 std::cout << "refListIdx: " << uiRefListIdx << std::endl;646 std::cout << "MVD horizontal: " << pcCU->getCUMvField(RefPicList(uiRefListIdx))->getMvd( uiAbsPartIdx ).getHor() << std::endl;647 std::cout << "MVD vertical: " << pcCU->getCUMvField(RefPicList(uiRefListIdx))->getMvd( uiAbsPartIdx ).getVer() << std::endl;648 std::cout << "MVPIdxPU: " << pcCU->getMVPIdx(RefPicList( uiRefListIdx ), uiSubPartIdx) << std::endl;649 std::cout << "InterDir: " << (UInt)pcCU->getInterDir(uiSubPartIdx) << std::endl;650 }651 #endif652 }653 }654 #if NH_3D_IC655 decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );656 #endif657 }658 659 if ( (pcCU->getInterDir(uiSubPartIdx) == 3) && pcSubCU->isBipredRestriction(uiPartIdx) )660 {661 pcCU->getCUMvField( REF_PIC_LIST_1 )->setAllMv( TComMv(0,0), ePartSize, uiSubPartIdx, uiDepth, uiPartIdx);662 pcCU->getCUMvField( REF_PIC_LIST_1 )->setAllRefIdx( -1, ePartSize, uiSubPartIdx, uiDepth, uiPartIdx);663 pcCU->setInterDirSubParts( 1, uiSubPartIdx, uiPartIdx, uiDepth);664 }665 }666 #endif667 #if NH_3D_SPIVMP668 delete[] pcMvFieldSP;669 delete[] puhInterDirSP;670 #endif671 283 return; 672 284 } … … 733 345 } 734 346 735 #if NH_3D736 347 Void TDecEntropy::decodeMVPIdxPU( TComDataCU* pcSubCU, UInt uiPartAddr, UInt uiDepth, UInt uiPartIdx, RefPicList eRefList ) 737 348 { 738 349 Int iMVPIdx = -1; 350 351 TComMv cZeroMv( 0, 0 ); 352 TComMv cMv = cZeroMv; 353 Int iRefIdx = -1; 354 355 TComCUMvField* pcSubCUMvField = pcSubCU->getCUMvField( eRefList ); 356 AMVPInfo* pAMVPInfo = pcSubCUMvField->getAMVPInfo(); 357 358 iRefIdx = pcSubCUMvField->getRefIdx(uiPartAddr); 359 cMv = cZeroMv; 739 360 740 361 if ( (pcSubCU->getInterDir(uiPartAddr) & ( 1 << eRefList )) ) … … 754 375 #endif 755 376 } 756 pcSubCU->setMVPIdxSubParts( iMVPIdx, eRefList, uiPartAddr, uiPartIdx, uiDepth );757 }758 759 Void TDecEntropy::decodeMvsAMVP( TComDataCU* pcSubCU, UInt uiPartAddr, UInt uiDepth, UInt uiPartIdx, RefPicList eRefList )760 {761 TComMv cZeroMv( 0, 0 );762 TComMv cMv = cZeroMv;763 Int iRefIdx = -1;764 765 TComCUMvField* pcSubCUMvField = pcSubCU->getCUMvField( eRefList );766 AMVPInfo* pAMVPInfo = pcSubCUMvField->getAMVPInfo();767 768 iRefIdx = pcSubCUMvField->getRefIdx(uiPartAddr);769 cMv = cZeroMv;770 771 pcSubCU->fillMvpCand(uiPartIdx, uiPartAddr, eRefList, iRefIdx, pAMVPInfo);772 pcSubCU->setMVPNumSubParts(pAMVPInfo->iN, eRefList, uiPartAddr, uiPartIdx, uiDepth);773 if ( iRefIdx >= 0 )774 {775 m_pcPrediction->getMvPredAMVP( pcSubCU, uiPartIdx, uiPartAddr, eRefList, cMv);776 cMv += pcSubCUMvField->getMvd( uiPartAddr );777 }778 779 PartSize ePartSize = pcSubCU->getPartitionSize( uiPartAddr );780 pcSubCU->getCUMvField( eRefList )->setAllMv(cMv, ePartSize, uiPartAddr, 0, uiPartIdx);781 }782 #else783 Void TDecEntropy::decodeMVPIdxPU( TComDataCU* pcSubCU, UInt uiPartAddr, UInt uiDepth, UInt uiPartIdx, RefPicList eRefList )784 {785 Int iMVPIdx = -1;786 787 TComMv cZeroMv( 0, 0 );788 TComMv cMv = cZeroMv;789 Int iRefIdx = -1;790 791 TComCUMvField* pcSubCUMvField = pcSubCU->getCUMvField( eRefList );792 AMVPInfo* pAMVPInfo = pcSubCUMvField->getAMVPInfo();793 794 iRefIdx = pcSubCUMvField->getRefIdx(uiPartAddr);795 cMv = cZeroMv;796 797 if ( (pcSubCU->getInterDir(uiPartAddr) & ( 1 << eRefList )) )798 {799 m_pcEntropyDecoderIf->parseMVPIdx( iMVPIdx );800 #if NH_MV_ENC_DEC_TRAC801 #if ENC_DEC_TRACE802 if ( eRefList == REF_PIC_LIST_0 )803 {804 DTRACE_PU("mvp_l0_flag", iMVPIdx)805 }806 else807 {808 DTRACE_PU("mvp_l1_flag", iMVPIdx)809 }810 #endif811 #endif812 }813 377 pcSubCU->fillMvpCand(uiPartIdx, uiPartAddr, eRefList, iRefIdx, pAMVPInfo); 814 378 pcSubCU->setMVPNumSubParts(pAMVPInfo->iN, eRefList, uiPartAddr, uiPartIdx, uiDepth); … … 823 387 pcSubCU->getCUMvField( eRefList )->setAllMv(cMv, ePartSize, uiPartAddr, 0, uiPartIdx); 824 388 } 825 #endif826 389 827 390 Void TDecEntropy::xDecodeTransform ( Bool& bCodeDQP, Bool& isChromaQpAdjCoded, TComTU &rTu, const Int quadtreeTULog2MinSizeInCU ) … … 1085 648 Void TDecEntropy::decodeCoeff( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, Bool& bCodeDQP, Bool& isChromaQpAdjCoded ) 1086 649 { 1087 #if NH_3D_SDC_INTRA1088 if( pcCU->getSDCFlag( uiAbsPartIdx ) && pcCU->isIntra( uiAbsPartIdx) )1089 {1090 assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N );1091 assert( pcCU->getTransformIdx(uiAbsPartIdx) == 0 );1092 assert( pcCU->getCbf(uiAbsPartIdx, COMPONENT_Y) == 1 );1093 }1094 #endif1095 #if NH_3D_SDC_INTER1096 if( pcCU->getSDCFlag( uiAbsPartIdx ) && !pcCU->isIntra( uiAbsPartIdx) )1097 {1098 assert( !pcCU->isSkipped( uiAbsPartIdx ) );1099 assert( !pcCU->isIntra( uiAbsPartIdx) );1100 assert( pcCU->getSlice()->getIsDepth() );1101 }1102 #endif1103 #if NH_3D1104 if( pcCU->getSlice()->getIsDepth() )1105 {1106 #if NH_3D_SDC_INTRA || NH_3D_SDC_INTER1107 if( pcCU->getSDCFlag( uiAbsPartIdx ) )1108 {1109 m_pcEntropyDecoderIf->parseDeltaDC( pcCU, uiAbsPartIdx, uiDepth );1110 return;1111 }1112 #endif1113 #if NH_3D_DMM1114 if( pcCU->isIntra( uiAbsPartIdx ) )1115 {1116 Int iPartNum = ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ) ? 4 : 1;1117 UInt uiPartOffset = ( pcCU->getPic()->getNumPartitionsInCtu() >> ( pcCU->getDepth( uiAbsPartIdx ) << 1 ) ) >> 2;1118 for( Int iPart = 0; iPart < iPartNum; iPart++ )1119 {1120 if( isDmmMode( pcCU->getIntraDir( CHANNEL_TYPE_LUMA, uiAbsPartIdx + uiPartOffset*iPart ) ) )1121 {1122 m_pcEntropyDecoderIf->parseDeltaDC( pcCU, uiAbsPartIdx + uiPartOffset*iPart, uiDepth + ( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ) );1123 }1124 }1125 }1126 #endif1127 }1128 #endif1129 650 1130 651 if( pcCU->isIntra(uiAbsPartIdx) ) … … 1162 683 } 1163 684 1164 #if NH_3D_SDC_INTRA || NH_3D_SDC_INTER1165 Void TDecEntropy::decodeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )1166 {1167 pcCU->setSDCFlagSubParts( false, uiAbsPartIdx, uiDepth );1168 if ( pcCU->isSkipped( uiAbsPartIdx ) )1169 {1170 return;1171 }1172 1173 1174 if( ( !pcCU->isIntra( uiAbsPartIdx ) && !pcCU->getSlice()->getInterSdcFlag() ) ||1175 ( pcCU->isIntra( uiAbsPartIdx ) && !pcCU->getSlice()->getIntraSdcWedgeFlag() ) )1176 {1177 return;1178 }1179 1180 if( !pcCU->getSlice()->getIsDepth() || pcCU->getPartitionSize( uiAbsPartIdx ) != SIZE_2Nx2N || pcCU->isSkipped( uiAbsPartIdx ) )1181 {1182 return;1183 }1184 1185 assert( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N || ( !pcCU->isIntra( uiAbsPartIdx ) && !pcCU->isSkipped( uiAbsPartIdx ) ) );1186 m_pcEntropyDecoderIf->parseSDCFlag( pcCU, uiAbsPartIdx, uiDepth );1187 }1188 #endif1189 #if NH_3D_DBBP1190 Void TDecEntropy::decodeDBBPFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )1191 {1192 if( pcCU->getSlice()->getDepthBasedBlkPartFlag() && (pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2NxN || pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_Nx2N) && pcCU->getWidth(uiAbsPartIdx) > 8 && pcCU->getSlice()->getDefaultRefViewIdxAvailableFlag() )1193 {1194 m_pcEntropyDecoderIf->parseDBBPFlag( pcCU, uiAbsPartIdx, uiDepth );1195 }1196 }1197 #endif1198 685 1199 686 -
branches/HTM-16.0-MV-draft-5/source/Lib/TLibDecoder/TDecEntropy.h
r1321 r1390 81 81 public: 82 82 virtual Void parseSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 83 #if NH_3D_DIS84 virtual Void parseDIS ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;85 #endif86 83 virtual Void parseCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 87 84 virtual Void parseSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 88 85 virtual Void parseMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx ) = 0; 89 86 virtual Void parseMergeIndex ( TComDataCU* pcCU, UInt& ruiMergeIndex ) = 0; 90 #if NH_3D_ARP91 virtual Void parseARPW ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;92 #endif93 #if NH_3D_IC94 virtual Void parseICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;95 #endif96 #if NH_3D_DMM || NH_3D_SDC_INTRA || NH_3D_SDC_INTER97 virtual Void parseDeltaDC ( TComDataCU* pcCU, UInt absPartIdx, UInt depth ) = 0;98 #endif99 #if NH_3D_SDC_INTRA || NH_3D_SDC_INTER100 virtual Void parseSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;101 #endif102 #if NH_3D_DBBP103 virtual Void parseDBBPFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;104 #endif105 87 virtual Void parsePartSize ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 106 88 virtual Void parsePredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; … … 150 132 Void decodeMvdPU ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPartIdx, RefPicList eRefList ); 151 133 Void decodeMVPIdxPU ( TComDataCU* pcSubCU, UInt uiPartAddr, UInt uiDepth, UInt uiPartIdx, RefPicList eRefList ); 152 #if NH_3D153 Void decodeMvsAMVP ( TComDataCU* pcSubCU, UInt uiPartAddr, UInt uiDepth, UInt uiPartIdx,154 RefPicList eRefList );155 #endif156 134 Void setEntropyDecoder ( TDecEntropyIf* p ); 157 135 Void setBitstream ( TComInputBitstream* p ) { m_pcEntropyDecoderIf->setBitstream(p); } … … 177 155 Void decodeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 178 156 Void decodeSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 179 #if NH_3D_DIS180 Void decodeDIS ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) ;181 #endif182 157 Void decodeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 183 158 Void decodeMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx ); … … 186 161 Void decodePartSize ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 187 162 188 #if NH_3D_ARP189 Void decodeARPW ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );190 #endif191 #if NH_3D_IC192 Void decodeICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );193 #endif194 163 195 #if NH_3D_SDC_INTRA || NH_3D_SDC_INTER196 Void decodeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );197 #endif198 #if NH_3D_DBBP199 Void decodeDBBPFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );200 #endif201 164 Void decodeIPCMInfo ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 202 165 -
branches/HTM-16.0-MV-draft-5/source/Lib/TLibDecoder/TDecGop.cpp
r1386 r1390 122 122 } 123 123 124 #if NH_3D_NBDV125 if(pcSlice->getViewIndex() && !pcSlice->getIsDepth()) //Notes from QC: this condition shall be changed once the configuration is completed, e.g. in pcSlice->getSPS()->getMultiviewMvPredMode() || ARP in prev. HTM. Remove this comment once it is done.126 {127 Int iColPoc = pcSlice->getRefPOC(RefPicList(1 - pcSlice->getColFromL0Flag()), pcSlice->getColRefIdx());128 pcPic->setNumDdvCandPics(pcPic->getDisCandRefPictures(iColPoc));129 }130 131 if(pcSlice->getViewIndex() && !pcSlice->getIsDepth() && !pcSlice->isIntra()) //Notes from QC: this condition shall be changed once the configuration is completed, e.g. in pcSlice->getSPS()->getMultiviewMvPredMode() || ARP in prev. HTM. Remove this comment once it is done.132 {133 pcPic->checkTemporalIVRef();134 }135 136 if(pcSlice->getIsDepth())137 {138 pcPic->checkTextureRef();139 }140 #endif141 #if NH_3D142 pcSlice->setDepthToDisparityLUTs();143 #endif144 124 145 125 m_pcSliceDecoder->decompressSlice( ppcSubstreams, pcPic, m_pcSbacDecoder); … … 172 152 m_pcSAO->PCMLFDisableProcess(pcPic); 173 153 } 174 #if NH_3D175 pcPic->compressMotion(2);176 #else177 154 pcPic->compressMotion(); 178 #endif179 155 TChar c = (pcSlice->isIntra() ? 'I' : pcSlice->isInterP() ? 'P' : 'B'); 180 156 if (!pcSlice->isReferenced()) -
branches/HTM-16.0-MV-draft-5/source/Lib/TLibDecoder/TDecSbac.cpp
r1386 r1390 67 67 , m_cCUSplitFlagSCModel ( 1, 1, NUM_SPLIT_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 68 68 , m_cCUSkipFlagSCModel ( 1, 1, NUM_SKIP_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 69 #if NH_3D_DIS70 , m_cCUDISFlagSCModel ( 1, 1, NUM_DIS_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels)71 , m_cCUDISTypeSCModel ( 1, 1, NUM_DIS_TYPE_CTX , m_contextModels + m_numContextModels, m_numContextModels)72 #endif73 69 , m_cCUMergeFlagExtSCModel ( 1, 1, NUM_MERGE_FLAG_EXT_CTX , m_contextModels + m_numContextModels, m_numContextModels) 74 70 , m_cCUMergeIdxExtSCModel ( 1, 1, NUM_MERGE_IDX_EXT_CTX , m_contextModels + m_numContextModels, m_numContextModels) 75 #if NH_3D_ARP76 , m_cCUPUARPWSCModel ( 1, 1, NUM_ARPW_CTX , m_contextModels + m_numContextModels, m_numContextModels)77 #endif78 #if NH_3D_IC79 , m_cCUICFlagSCModel ( 1, 1, NUM_IC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels)80 #endif81 71 , m_cCUPartSizeSCModel ( 1, 1, NUM_PART_SIZE_CTX , m_contextModels + m_numContextModels, m_numContextModels) 82 72 , m_cCUPredModeSCModel ( 1, 1, NUM_PRED_MODE_CTX , m_contextModels + m_numContextModels, m_numContextModels) … … 107 97 , m_ChromaQpAdjIdcSCModel ( 1, 1, NUM_CHROMA_QP_ADJ_IDC_CTX , m_contextModels + m_numContextModels, m_numContextModels) 108 98 109 #if NH_3D_DMM110 , m_cNotDmmFlagSCModel ( 1, 1, NUM_NOTDMM_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels)111 , m_cDmmModeSCModel ( 1, 1, NUM_DMM_MODE_CTX , m_contextModels + m_numContextModels, m_numContextModels)112 #endif113 #if NH_3D_DMM || NH_3D_SDC_INTRA || NH_3D_SDC_INTER114 , m_cDdcDataSCModel ( 1, 1, NUM_DDC_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels)115 , m_cSDCFlagSCModel ( 1, 1, NUM_SDC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels)116 #endif117 #if NH_3D_SDC_INTRA118 , m_cSDCResidualFlagSCModel ( 1, 1, SDC_NUM_RESIDUAL_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels)119 , m_cSDCResidualSCModel ( 1, 1, SDC_NUM_RESIDUAL_CTX , m_contextModels + m_numContextModels, m_numContextModels)120 , m_cDdcFlagSCModel ( 1, 1, NUM_DDC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels)121 #endif122 #if NH_3D_DBBP123 , m_cDBBPFlagSCModel ( 1, 1, DBBP_NUM_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels)124 #endif125 99 126 100 { … … 159 133 m_cCUSplitFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SPLIT_FLAG ); 160 134 m_cCUSkipFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SKIP_FLAG ); 161 #if NH_3D_DIS162 m_cCUDISFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DIS_FLAG );163 m_cCUDISTypeSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DIS_TYPE );164 #endif165 135 m_cCUMergeFlagExtSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_MERGE_FLAG_EXT ); 166 136 m_cCUMergeIdxExtSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_MERGE_IDX_EXT ); 167 #if NH_3D_ARP168 m_cCUPUARPWSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_ARPW );169 #endif170 #if NH_3D_IC171 m_cCUICFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_IC_FLAG );172 #endif173 137 m_cCUPartSizeSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_PART_SIZE ); 174 138 m_cCUPredModeSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_PRED_MODE ); … … 198 162 m_ChromaQpAdjFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_CHROMA_QP_ADJ_FLAG ); 199 163 m_ChromaQpAdjIdcSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_CHROMA_QP_ADJ_IDC ); 200 #if NH_3D_DMM201 m_cNotDmmFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_NOTDMM_FLAG );202 m_cDmmModeSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DMM_MODE );203 #endif204 #if NH_3D_DMM || NH_3D_SDC_INTRA || NH_3D_SDC_INTER205 m_cDdcDataSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DDC_DATA );206 m_cSDCFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SDC_FLAG );207 #endif208 #if NH_3D_SDC_INTRA209 m_cSDCResidualFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SDC_RESIDUAL_FLAG );210 m_cSDCResidualSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SDC_RESIDUAL );211 m_cDdcFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DDC_FLAG );212 #endif213 #if NH_3D_DBBP214 m_cDBBPFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DBBP_FLAG );215 #endif216 164 217 165 for (UInt statisticIndex = 0; statisticIndex < RExt__GOLOMB_RICE_ADAPTATION_STATISTICS_SETS ; statisticIndex++) … … 512 460 513 461 } 514 #if NH_3D_DIS515 Void TDecSbac::parseDIS( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )516 {517 pcCU->setDISFlagSubParts( false, uiAbsPartIdx, uiDepth );518 UInt uiSymbol = 0;519 m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUDISFlagSCModel.get( 0, 0, 0 ) RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(STATS__CABAC_BITS__SKIP_FLAG) );520 if( uiSymbol )521 {522 pcCU->setDISFlagSubParts( true, uiAbsPartIdx, uiDepth );523 pcCU->setSkipFlagSubParts( false, uiAbsPartIdx, uiDepth );524 pcCU->setSDCFlagSubParts( false, uiAbsPartIdx, uiDepth );525 pcCU->setPredModeSubParts( MODE_INTRA, uiAbsPartIdx, uiDepth );526 pcCU->setPartSizeSubParts( SIZE_2Nx2N, uiAbsPartIdx, uiDepth );527 pcCU->setIntraDirSubParts(CHANNEL_TYPE_LUMA, DC_IDX, uiAbsPartIdx, uiDepth );528 pcCU->setSizeSubParts( pcCU->getSlice()->getSPS()->getMaxCUWidth()>>uiDepth, pcCU->getSlice()->getSPS()->getMaxCUHeight()>>uiDepth, uiAbsPartIdx, uiDepth );529 pcCU->setMergeFlagSubParts( false , uiAbsPartIdx, 0, uiDepth );530 pcCU->setTrIdxSubParts(0, uiAbsPartIdx, uiDepth);531 pcCU->setCbfSubParts(0, COMPONENT_Y, uiAbsPartIdx, uiDepth);532 533 UInt uiUnaryIdx = 0;534 UInt uiNumCand = 4;535 536 if ( uiNumCand > 1 )537 {538 for( ; uiUnaryIdx < uiNumCand - 1; ++uiUnaryIdx )539 {540 UInt uiSymbol2 = 0;541 if ( uiUnaryIdx==0 )542 {543 m_pcTDecBinIf->decodeBin( uiSymbol2, m_cCUDISTypeSCModel.get( 0, 0, 0 ) RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(STATS__CABAC_BITS__SKIP_FLAG) );544 }545 else546 {547 m_pcTDecBinIf->decodeBinEP( uiSymbol2 RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(STATS__CABAC_BITS__SKIP_FLAG));548 }549 if( uiSymbol2 == 0 )550 {551 break;552 }553 }554 }555 pcCU->setDISTypeSubParts((UChar)uiUnaryIdx, uiAbsPartIdx, uiDepth);556 }557 }558 #endif559 462 560 463 … … 642 545 643 546 UInt uiSymbol; 644 #if NH_3D_QTLPC645 Bool bParseSplitFlag = true;646 Bool bLimQtPredFlag = pcCU->getPic()->getSlice(0)->getQtPredFlag();647 TComPic *pcTexture = pcCU->getSlice()->getTexturePic();648 Bool bDepthMapDetect = (pcTexture != NULL);649 Bool bIntraSliceDetect = (pcCU->getSlice()->getSliceType() == I_SLICE);650 651 Bool rapPic = (pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP || pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA);652 653 #if H_3D_FCO654 if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && bLimQtPredFlag && pcTexture->getReconMark())655 #else656 if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && bLimQtPredFlag)657 #endif658 {659 TComDataCU *pcTextureCU = pcTexture->getCtu(pcCU->getCtuRsAddr());660 assert(pcTextureCU->getDepth(uiAbsPartIdx) >= uiDepth);661 bParseSplitFlag = (pcTextureCU->getDepth(uiAbsPartIdx) > uiDepth);662 }663 664 if(bParseSplitFlag)665 {666 #endif667 547 m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUSplitFlagSCModel.get( 0, 0, pcCU->getCtxSplitFlag( uiAbsPartIdx, uiDepth ) ) RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(ctype) ); 668 548 #if NH_MV_ENC_DEC_TRAC … … 671 551 DTRACE_CABAC_VL( g_nSymbolCounter++ ) 672 552 DTRACE_CABAC_T( "\tSplitFlag\n" ) 673 #endif674 #if NH_3D_QTLPC675 }676 else677 {678 uiSymbol = 0;679 }680 553 #endif 681 554 pcCU->setDepthSubParts( uiDepth + uiSymbol, uiAbsPartIdx ); … … 704 577 assert ( pcCU->getSlice()->getSPS()->getLog2DiffMaxMinCodingBlockSize() == log2DiffMaxMinCodingBlockSize); 705 578 706 #if NH_3D_QTLPC707 Bool bParsePartSize = true;708 709 Bool bLimQtPredFlag = pcCU->getPic()->getSlice(0)->getQtPredFlag();710 TComPic *pcTexture = pcCU->getSlice()->getTexturePic();711 Bool bDepthMapDetect = (pcTexture != NULL);712 Bool bIntraSliceDetect = (pcCU->getSlice()->getSliceType() == I_SLICE);713 714 Bool rapPic = (pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP || pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA);715 716 Bool depthDependent = false;717 UInt uiTexturePart = uiMode;718 719 #if H_3D_FCO720 if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && bLimQtPredFlag && pcTexture->getReconMark())721 #else722 if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && bLimQtPredFlag )723 #endif724 {725 TComDataCU *pcTextureCU = pcTexture->getCtu(pcCU->getCtuRsAddr());726 assert(pcTextureCU->getDepth(uiAbsPartIdx) >= uiDepth);727 if(pcTextureCU->getDepth(uiAbsPartIdx) == uiDepth )728 {729 depthDependent = true;730 uiTexturePart = pcTextureCU->getPartitionSize( uiAbsPartIdx );731 }732 if (pcTextureCU->getDepth(uiAbsPartIdx) == uiDepth && pcTextureCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N)733 {734 bParsePartSize = false;735 eMode = SIZE_2Nx2N;736 }737 }738 #endif739 579 740 580 if ( pcCU->isIntra( uiAbsPartIdx ) ) 741 581 { 742 #if NH_3D_QTLPC743 if(bParsePartSize)744 {745 #endif746 582 uiSymbol = 1; 747 583 if( uiDepth == log2DiffMaxMinCodingBlockSize ) … … 753 589 } 754 590 eMode = uiSymbol ? SIZE_2Nx2N : SIZE_NxN; 755 #if NH_3D_QTLPC756 }757 #endif758 591 UInt uiTrLevel = 0; 759 592 UInt uiWidthInBit = g_aucConvertToBit[pcCU->getWidth(uiAbsPartIdx)]+2; … … 771 604 else 772 605 { 773 #if NH_3D_QTLPC774 if(bParsePartSize)775 {776 if (depthDependent==false || uiTexturePart == SIZE_NxN|| uiTexturePart == SIZE_2Nx2N)777 {778 #endif779 606 UInt uiMaxNumBits = 2; 780 607 … … 815 642 } 816 643 } 817 #if NH_3D_QTLPC818 }819 else if(uiTexturePart == SIZE_2NxN || uiTexturePart == SIZE_2NxnU || uiTexturePart == SIZE_2NxnD)820 {821 UInt uiMaxNumBits = 1;822 if ( ( pcCU->getSlice()->getSPS()->getUseAMP() && uiDepth < log2DiffMaxMinCodingBlockSize ) && uiDepth < log2DiffMaxMinCodingBlockSize )823 {824 uiMaxNumBits ++;825 }826 for ( UInt ui = 0; ui < uiMaxNumBits; ui++ )827 {828 m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUPartSizeSCModel.get( 0, 0, ui) RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(ctype) );829 if ( uiSymbol )830 {831 break;832 }833 uiMode++;834 }835 eMode = (PartSize) uiMode;836 if(uiMode && ( ( pcCU->getSlice()->getSPS()->getUseAMP() && uiDepth < log2DiffMaxMinCodingBlockSize ) && uiDepth < log2DiffMaxMinCodingBlockSize ) && uiSymbol==1 )837 {838 eMode = SIZE_2NxN;839 }840 else if (uiMode && (( ( pcCU->getSlice()->getSPS()->getUseAMP() && uiDepth < log2DiffMaxMinCodingBlockSize ) && uiDepth < log2DiffMaxMinCodingBlockSize )==0) && uiSymbol==0)841 {842 eMode = SIZE_2NxN;843 }844 else if (uiMode && ( ( pcCU->getSlice()->getSPS()->getUseAMP() && uiDepth < log2DiffMaxMinCodingBlockSize ) && uiDepth < log2DiffMaxMinCodingBlockSize ) && uiSymbol==0)845 {846 m_pcTDecBinIf->decodeBinEP(uiSymbol RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(ctype));847 eMode = (uiSymbol == 0? SIZE_2NxnU : SIZE_2NxnD);848 }849 }850 else if(uiTexturePart == SIZE_Nx2N|| uiTexturePart==SIZE_nLx2N || uiTexturePart==SIZE_nRx2N)851 {852 UInt uiMaxNumBits = 1;853 if ( ( pcCU->getSlice()->getSPS()->getUseAMP() && uiDepth < log2DiffMaxMinCodingBlockSize ) && uiDepth < log2DiffMaxMinCodingBlockSize )854 {855 uiMaxNumBits ++;856 }857 for ( UInt ui = 0; ui < uiMaxNumBits; ui++ )858 {859 m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUPartSizeSCModel.get( 0, 0, ui) RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(ctype));860 if ( uiSymbol )861 {862 break;863 }864 uiMode++;865 }866 eMode = (PartSize) uiMode;867 if(uiMode && ( ( pcCU->getSlice()->getSPS()->getUseAMP() && uiDepth < log2DiffMaxMinCodingBlockSize ) && uiDepth < log2DiffMaxMinCodingBlockSize ) && uiSymbol==1 )868 {869 eMode = SIZE_Nx2N;870 }871 else if (uiMode && (( ( pcCU->getSlice()->getSPS()->getUseAMP() && uiDepth < log2DiffMaxMinCodingBlockSize ) && uiDepth < log2DiffMaxMinCodingBlockSize )==0) && uiSymbol==0)872 {873 eMode = SIZE_Nx2N;874 }875 else if (uiMode && ( ( pcCU->getSlice()->getSPS()->getUseAMP() && uiDepth < log2DiffMaxMinCodingBlockSize ) && uiDepth < log2DiffMaxMinCodingBlockSize ) && uiSymbol==0)876 {877 m_pcTDecBinIf->decodeBinEP(uiSymbol RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(ctype));878 eMode = (uiSymbol == 0? SIZE_nLx2N : SIZE_nRx2N);879 }880 }881 else882 {883 assert(0);884 }885 #endif886 644 #if NH_MV_ENC_DEC_TRAC 887 645 DTRACE_CU("part_mode", eMode ) 888 #endif889 #if NH_3D_QTLPC890 }891 646 #endif 892 647 } … … 937 692 for (j=0;j<partNum;j++) 938 693 { 939 #if NH_3D_DMM940 if( pcCU->getSlice()->getIntraSdcWedgeFlag() || pcCU->getSlice()->getIntraContourFlag() )941 {942 xParseIntraDepthMode( pcCU, absPartIdx+partOffset*j, depth );943 xParseDmmData ( pcCU, absPartIdx+partOffset*j, depth );944 }945 if( pcCU->getIntraDir( CHANNEL_TYPE_LUMA, absPartIdx+partOffset*j ) < NUM_INTRA_MODE )946 {947 #endif948 694 m_pcTDecBinIf->decodeBin( symbol, m_cCUIntraPredSCModel.get( 0, 0, 0) RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(ctype) ); 949 695 mpmPred[j] = symbol; … … 951 697 DTRACE_CU("prev_intra_luma_pred_flag", symbol) 952 698 #endif 953 #if NH_3D_DMM954 }955 #endif956 699 } 957 700 for (j=0;j<partNum;j++) 958 701 { 959 #if NH_3D_DMM960 if( pcCU->getIntraDir( CHANNEL_TYPE_LUMA, absPartIdx+partOffset*j ) < NUM_INTRA_MODE )961 {962 #endif963 702 Int preds[NUM_MOST_PROBABLE_MODES] = {-1, -1, -1}; 964 703 pcCU->getIntraDirPredictor(absPartIdx+partOffset*j, preds, COMPONENT_Y); … … 1003 742 } 1004 743 pcCU->setIntraDirSubParts(CHANNEL_TYPE_LUMA, (UChar)intraPredMode, absPartIdx+partOffset*j, depth ); 1005 #if NH_3D_DMM1006 }1007 #endif1008 744 } 1009 745 } … … 2269 2005 } 2270 2006 2271 #if NH_3D_ARP 2272 Void TDecSbac::parseARPW( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2273 { 2274 UInt uiW = 0; 2275 UInt uiOffset = pcCU->getCTXARPWFlag(uiAbsPartIdx); 2276 UInt uiCode = 0; 2277 2278 m_pcTDecBinIf->decodeBin( uiCode , m_cCUPUARPWSCModel.get( 0, 0, 0 + uiOffset ) RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(STATS__CABAC_BITS__ARP_FLAG)); 2279 2280 uiW = uiCode; 2281 if( 1 == uiW ) 2282 { 2283 m_pcTDecBinIf->decodeBin( uiCode , m_cCUPUARPWSCModel.get( 0, 0, 2 ) RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(STATS__CABAC_BITS__ARP_FLAG)); 2284 uiW += ( 1 == uiCode ? 1 : 0 ); 2285 } 2286 #if NH_MV_ENC_DEC_TRAC 2287 DTRACE_CU("iv_res_pred_weight_idx", uiW ) 2288 #endif 2289 pcCU->setARPWSubParts( ( UChar )( uiW ) , uiAbsPartIdx, uiDepth ); 2290 } 2291 #endif 2292 2293 #if NH_3D_IC 2294 /** parse illumination compensation flag 2295 * \param pcCU 2296 * \param uiAbsPartIdx 2297 * \param uiDepth 2298 * \returns Void 2299 */ 2300 Void TDecSbac::parseICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2301 { 2302 UInt uiSymbol = 0; 2303 m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUICFlagSCModel.get( 0, 0, 0 ) RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(STATS__CABAC_BITS__3D_IC) ); 2304 2305 #if !NH_MV_ENC_DEC_TRAC 2306 DTRACE_CABAC_VL( g_nSymbolCounter++ ); 2307 DTRACE_CABAC_T( "\tICFlag" ); 2308 DTRACE_CABAC_T( "\tuiCtxIC: "); 2309 DTRACE_CABAC_V( uiCtxIC ); 2310 DTRACE_CABAC_T( "\tuiSymbol: "); 2311 DTRACE_CABAC_V( uiSymbol ); 2312 DTRACE_CABAC_T( "\n"); 2313 #else 2314 DTRACE_CU("ic_flag", uiSymbol) 2315 #endif 2316 2317 pcCU->setICFlagSubParts( uiSymbol ? true : false , uiAbsPartIdx, 0, uiDepth ); 2318 } 2319 #endif 2320 2321 #if NH_3D_DMM || NH_3D_SDC_INTRA || NH_3D_SDC_INTER 2322 Void TDecSbac::parseDeltaDC( TComDataCU* pcCU, UInt absPartIdx, UInt depth ) 2323 { 2324 #if NH_3D_SDC_INTRA || NH_3D_SDC_INTER 2325 if( !(pcCU->getSDCFlag( absPartIdx )) ) 2326 #endif 2327 #if NH_3D_DMM 2328 if( !(pcCU->isIntra( absPartIdx ) && isDmmMode( pcCU->getIntraDir( CHANNEL_TYPE_LUMA, absPartIdx ) )) ) 2329 #endif 2330 assert( 0 ); 2331 2332 UInt symbol = 1; 2333 #if NH_3D_SDC_INTRA 2334 if( pcCU->isIntra( absPartIdx ) && pcCU->getSDCFlag( absPartIdx )) 2335 { 2336 m_pcTDecBinIf->decodeBin( symbol, m_cDdcFlagSCModel.get( 0, 0, 0 ) RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(STATS__CABAC_BITS__SDC_DELTADC_FLAG) ); 2337 assert( pcCU->getPartitionSize( absPartIdx ) == SIZE_2Nx2N ); 2338 assert( pcCU->getTransformIdx(absPartIdx) == 0 ); 2339 assert( pcCU->getCbf(absPartIdx, COMPONENT_Y) == 1 ); 2340 } 2341 #endif 2342 UInt uiNumSegments = 1; 2343 #if NH_3D_DMM 2344 uiNumSegments = isDmmMode( pcCU->getIntraDir( CHANNEL_TYPE_LUMA, absPartIdx ) ) ? 2 : 1; 2345 #endif 2346 2347 for( UInt segment = 0; segment < uiNumSegments; segment++ ) 2348 { 2349 Pel valDeltaDC = 0; 2350 if( symbol ) 2351 { 2352 xParseDeltaDC( valDeltaDC, uiNumSegments ); 2353 } 2354 2355 if( pcCU->isIntra( absPartIdx ) ) 2356 { 2357 #if NH_3D_SDC_INTRA 2358 if( pcCU->getSDCFlag( absPartIdx ) ) 2359 { 2360 pcCU->setSDCSegmentDCOffset( valDeltaDC, segment, absPartIdx ); 2361 } 2362 else 2363 { 2364 #endif 2365 #if NH_3D_DMM 2366 pcCU->setDmmDeltaDC( getDmmType( pcCU->getIntraDir( CHANNEL_TYPE_LUMA, absPartIdx ) ), segment, absPartIdx, valDeltaDC ); 2367 #endif 2368 #if NH_3D_SDC_INTRA 2369 } 2370 #endif 2371 } 2372 #if NH_3D_SDC_INTER 2373 else 2374 { 2375 pcCU->setSDCSegmentDCOffset( valDeltaDC, segment, absPartIdx ); 2376 } 2377 #endif 2378 } 2379 } 2380 2381 Void TDecSbac::xParseDeltaDC( Pel& rValDeltaDC, UInt uiNumSeg ) 2382 { 2383 UInt absValDeltaDC = 0; 2384 xReadExGolombLevelDdc( absValDeltaDC ); 2385 rValDeltaDC = (Pel)absValDeltaDC + ( uiNumSeg > 1 ? 0 : 1 ); 2386 2387 if( rValDeltaDC != 0 ) 2388 { 2389 UInt uiSign; 2390 m_pcTDecBinIf->decodeBinEP( uiSign RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(STATS__CABAC_BITS__DELTADC_SIGN_EP) ); 2391 if ( uiSign ) 2392 { 2393 rValDeltaDC = -rValDeltaDC; 2394 } 2395 } 2396 #if NH_MV_ENC_DEC_TRAC 2397 DTRACE_CU("delta_dc", rValDeltaDC); 2398 #endif 2399 } 2400 2401 Void TDecSbac::xReadExGolombLevelDdc( UInt& ruiSymbol ) 2402 { 2403 UInt uiSymbol; 2404 UInt uiCount = 0; 2405 do 2406 { 2407 m_pcTDecBinIf->decodeBin( uiSymbol, m_cDdcDataSCModel.get(0, 0, 0) RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(STATS__CABAC_BITS__DELTADC_PREFIX) ); 2408 uiCount++; 2409 } 2410 while( uiSymbol && ( uiCount != 3 ) ); 2411 ruiSymbol = uiCount - 1; 2412 2413 if( uiSymbol ) 2414 { 2415 xReadEpExGolomb( uiSymbol, 0 RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(STATS__CABAC_BITS__DELTADC_SUFFIX_EP) ); 2416 ruiSymbol += uiSymbol + 1; 2417 } 2418 2419 return; 2420 } 2421 #endif 2422 #if NH_3D_DMM 2423 Void TDecSbac::xParseIntraDepthMode( TComDataCU* pcCU, UInt absPartIdx, UInt depth ) 2424 { 2425 pcCU->setIntraDirSubParts( CHANNEL_TYPE_LUMA, 0, absPartIdx, depth ); 2426 2427 UInt uiSymbol; 2428 if( ( pcCU->getSlice()->getSPS()->getMaxCUWidth() >> pcCU->getDepth( absPartIdx ) ) < 64 ) //DMM and HEVC intra modes are both allowed 2429 { 2430 m_pcTDecBinIf->decodeBin( uiSymbol, m_cNotDmmFlagSCModel.get( 0, 0, 0 ) RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(STATS__CABAC_BITS__NOTDMM_FLAG) ); 2431 } 2432 else 2433 { 2434 uiSymbol = 1; 2435 } 2436 2437 //decode DMM mode index 2438 if( !uiSymbol ) 2439 { 2440 if( pcCU->getSlice()->getIntraSdcWedgeFlag() && pcCU->getSlice()->getIntraContourFlag() ) 2441 { 2442 m_pcTDecBinIf->decodeBin( uiSymbol, m_cDmmModeSCModel.get( 0, 0, 0 ) RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(STATS__CABAC_BITS__DMMMODE) ); 2443 if( !uiSymbol ) 2444 { 2445 pcCU->setIntraDirSubParts( CHANNEL_TYPE_LUMA, DMM_OFFSET, absPartIdx, depth ); 2446 } 2447 else 2448 { 2449 pcCU->setIntraDirSubParts( CHANNEL_TYPE_LUMA, ( 1+ DMM_OFFSET ), absPartIdx, depth ); 2450 } 2451 } 2452 else if( pcCU->getSlice()->getIntraSdcWedgeFlag() ) 2453 { 2454 pcCU->setIntraDirSubParts( CHANNEL_TYPE_LUMA, DMM_OFFSET, absPartIdx, depth ); 2455 } 2456 else if( pcCU->getSlice()->getIntraContourFlag() ) 2457 { 2458 pcCU->setIntraDirSubParts( CHANNEL_TYPE_LUMA, ( 1+ DMM_OFFSET ), absPartIdx, depth ); 2459 } 2460 } 2461 } 2462 2463 Void TDecSbac::xParseDmmData( TComDataCU* pcCU, UInt absPartIdx, UInt depth ) 2464 { 2465 UInt dir = pcCU->getIntraDir( CHANNEL_TYPE_LUMA, absPartIdx ); 2466 switch( getDmmType( dir ) ) 2467 { 2468 case( DMM1_IDX ): 2469 { 2470 UInt uiTabIdx = 0; 2471 xParseDmm1WedgeIdx( uiTabIdx, g_dmm1TabIdxBits[pcCU->getIntraSizeIdx(absPartIdx)] ); 2472 assert( uiTabIdx < getWedgeListScaled( pcCU->getWidth( absPartIdx ) )->size() ); 2473 pcCU->setDmm1WedgeTabIdxSubParts( uiTabIdx, absPartIdx, depth ); 2474 } break; 2475 case( DMM4_IDX ): break; 2476 default: break; 2477 } 2478 } 2479 2480 Void TDecSbac::xParseDmm1WedgeIdx( UInt& ruiTabIdx, Int iNumBit ) 2481 { 2482 UInt uiSymbol, uiIdx = 0; 2483 for( Int i = 0; i < iNumBit; i++ ) 2484 { 2485 m_pcTDecBinIf->decodeBinEP( uiSymbol RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(STATS__CABAC_BITS__DMM1_BITS_EP) ); 2486 uiIdx += uiSymbol << i; 2487 } 2488 ruiTabIdx = uiIdx; 2489 } 2490 #endif 2491 #if NH_3D_SDC_INTRA || NH_3D_SDC_INTER 2492 Void TDecSbac::parseSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2493 { 2494 UInt uiSymbol = 0; 2495 2496 m_pcTDecBinIf->decodeBin( uiSymbol, m_cSDCFlagSCModel.get( 0, 0, 0 ) RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(STATS__CABAC_BITS__SDC_INTRA_FLAG) ); 2497 #if NH_MV_ENC_DEC_TRAC 2498 DTRACE_CU("dc_only_flag", uiSymbol) 2499 #endif 2500 if( uiSymbol ) 2501 { 2502 pcCU->setSDCFlagSubParts( true, uiAbsPartIdx, uiDepth ); 2503 pcCU->setTrIdxSubParts( 0, uiAbsPartIdx, uiDepth ); 2504 pcCU->setCbfSubParts(1, COMPONENT_Y, uiAbsPartIdx, uiDepth); 2505 } 2506 else 2507 { 2508 pcCU->setSDCFlagSubParts( false, uiAbsPartIdx, uiDepth ); 2509 } 2510 } 2511 2512 #endif 2513 2514 #if NH_3D_DBBP 2515 Void TDecSbac::parseDBBPFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2516 { 2517 AOF( pcCU->getSlice()->getDepthBasedBlkPartFlag() ); 2518 AOF( !pcCU->getSlice()->getIsDepth() ); 2519 2520 UInt uiSymbol = 0; 2521 2522 m_pcTDecBinIf->decodeBin( uiSymbol, m_cDBBPFlagSCModel.get( 0, 0, 0 ) RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(STATS__CABAC_BITS__DBBP_FLAG) ); 2523 DTRACE_CU("dbbp_flag", uiSymbol) 2524 PartSize ePartSize = pcCU->getPartitionSize( uiAbsPartIdx ); 2525 AOF( ePartSize == SIZE_2NxN || ePartSize == SIZE_Nx2N ); 2526 UInt uiPUOffset = ( g_auiPUOffset[UInt( ePartSize )] << ( ( pcCU->getSlice()->getSPS()->getMaxTotalCUDepth() - uiDepth ) << 1 ) ) >> 4; 2527 pcCU->setDBBPFlagSubParts(uiSymbol, uiAbsPartIdx, 0, uiDepth); 2528 pcCU->setDBBPFlagSubParts(uiSymbol, uiAbsPartIdx+uiPUOffset, 1, uiDepth); 2529 } 2530 #endif 2007 2008 2009 2531 2010 2532 2011 -
branches/HTM-16.0-MV-draft-5/source/Lib/TLibDecoder/TDecSbac.h
r1321 r1390 108 108 Void xReadCoefRemainExGolomb ( UInt &rSymbol, UInt &rParam, const Bool useLimitedPrefixLength, const Int maxLog2TrDynamicRange ); 109 109 #endif 110 #if NH_3D_DMM || NH_3D_SDC_INTRA || NH_3D_SDC_INTER111 Void xReadExGolombLevelDdc( UInt& ruiSymbol );112 Void xParseDeltaDC ( Pel& rValDeltaDC, UInt uiNumSeg );113 #endif114 #if NH_3D_DMM115 Void xParseIntraDepthMode ( TComDataCU* pcCU, UInt absPartIdx, UInt depth );116 Void xParseDmmData ( TComDataCU* pcCU, UInt absPartIdx, UInt depth );117 Void xParseDmm1WedgeIdx ( UInt& ruiTabIdx, Int iNumBit );118 #endif119 #if NH_3D_SDC_INTRA120 Void xParseSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart );121 #endif122 #if NH_3D_SDC_INTRA || NH_3D_SDC_INTER123 Void parseSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );124 #endif125 #if NH_3D_DBBP126 Void parseDBBPFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );127 #endif128 110 129 111 private: … … 134 116 135 117 Void parseSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 136 #if NH_3D_DIS137 Void parseDIS ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );138 #endif139 #if NH_3D_DMM || NH_3D_SDC_INTRA || NH_3D_SDC_INTER140 Void parseDeltaDC ( TComDataCU* pcCU, UInt absPartIdx, UInt depth );141 #endif142 118 Void parseCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 143 119 Void parseSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 144 120 Void parseMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx ); 145 121 Void parseMergeIndex ( TComDataCU* pcCU, UInt& ruiMergeIndex ); 146 #if NH_3D_ARP147 Void parseARPW ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );148 #endif149 #if NH_3D_IC150 Void parseICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );151 #endif152 122 Void parsePartSize ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 153 123 Void parsePredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); … … 183 153 ContextModel3DBuffer m_cCUSplitFlagSCModel; 184 154 ContextModel3DBuffer m_cCUSkipFlagSCModel; 185 #if NH_3D_DIS186 ContextModel3DBuffer m_cCUDISFlagSCModel;187 ContextModel3DBuffer m_cCUDISTypeSCModel;188 #endif189 155 ContextModel3DBuffer m_cCUMergeFlagExtSCModel; 190 156 ContextModel3DBuffer m_cCUMergeIdxExtSCModel; 191 #if NH_3D_ARP192 ContextModel3DBuffer m_cCUPUARPWSCModel;193 #endif194 #if NH_3D_IC195 ContextModel3DBuffer m_cCUICFlagSCModel;196 #endif197 157 ContextModel3DBuffer m_cCUPartSizeSCModel; 198 158 ContextModel3DBuffer m_cCUPredModeSCModel; … … 226 186 ContextModel3DBuffer m_ChromaQpAdjFlagSCModel; 227 187 ContextModel3DBuffer m_ChromaQpAdjIdcSCModel; 228 #if NH_3D_DMM229 ContextModel3DBuffer m_cNotDmmFlagSCModel;230 ContextModel3DBuffer m_cDmmModeSCModel;231 #endif232 #if NH_3D_DMM || NH_3D_SDC_INTRA || NH_3D_SDC_INTER233 ContextModel3DBuffer m_cDdcDataSCModel;234 ContextModel3DBuffer m_cSDCFlagSCModel;235 #endif236 #if NH_3D_SDC_INTRA237 ContextModel3DBuffer m_cSDCResidualFlagSCModel;238 ContextModel3DBuffer m_cSDCResidualSCModel;239 ContextModel3DBuffer m_cDdcFlagSCModel;240 #endif241 #if NH_3D_DBBP242 ContextModel3DBuffer m_cDBBPFlagSCModel;243 #endif244 188 245 189 -
branches/HTM-16.0-MV-draft-5/source/Lib/TLibDecoder/TDecSlice.cpp
r1386 r1390 130 130 } 131 131 } 132 #if NH_3D_DLT133 if( pcSlice->getPPS()->getDLT() != NULL )134 {135 assert( pcSlice->getSPS()->getBitDepth( CHANNEL_TYPE_LUMA ) == pcSlice->getPPS()->getDLT()->getDepthViewBitDepth() );136 }137 #endif138 132 139 133 // for every CTU in the slice segment... -
branches/HTM-16.0-MV-draft-5/source/Lib/TLibDecoder/TDecTop.cpp
r1386 r1390 44 44 //! \{ 45 45 46 #if NH_3D47 CamParsCollector::CamParsCollector()48 : m_bInitialized( false )49 {50 m_aaiCodedOffset = new Int* [ MAX_NUM_LAYERS ];51 m_aaiCodedScale = new Int* [ MAX_NUM_LAYERS ];52 for( UInt uiId = 0; uiId < MAX_NUM_LAYERS; uiId++ )53 {54 m_aaiCodedOffset [ uiId ] = new Int [ MAX_NUM_LAYERS ];55 m_aaiCodedScale [ uiId ] = new Int [ MAX_NUM_LAYERS ];56 }57 58 xCreateLUTs( (UInt)MAX_NUM_LAYERS, (UInt)MAX_NUM_LAYERS, m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT );59 m_iLog2Precision = LOG2_DISP_PREC_LUT;60 m_uiBitDepthForLUT = 8; // fixed61 m_receivedIdc = NULL;62 m_vps = NULL;63 }64 65 CamParsCollector::~CamParsCollector()66 {67 for( UInt uiId = 0; uiId < MAX_NUM_LAYERS; uiId++ )68 {69 delete [] m_aaiCodedOffset [ uiId ];70 delete [] m_aaiCodedScale [ uiId ];71 }72 delete [] m_aaiCodedOffset;73 delete [] m_aaiCodedScale;74 75 xDeleteArray( m_adBaseViewShiftLUT, MAX_NUM_LAYERS, MAX_NUM_LAYERS, 2 );76 xDeleteArray( m_aiBaseViewShiftLUT, MAX_NUM_LAYERS, MAX_NUM_LAYERS, 2 );77 if ( m_receivedIdc != NULL )78 {79 xDeleteArray( m_receivedIdc, m_vps->getNumViews() );80 }81 }82 83 84 Void85 CamParsCollector::init( const TComVPS* vps)86 {87 assert( !isInitialized() ); // Only one initialization currently supported88 m_bInitialized = true;89 m_vps = vps;90 m_bCamParsVaryOverTime = false;91 m_lastPoc = -1;92 m_firstReceivedPoc = -2;93 94 for (Int i = 0; i <= vps->getMaxLayersMinus1(); i++)95 {96 Int curViewIdxInVps = m_vps->getVoiInVps( m_vps->getViewIndex( m_vps->getLayerIdInNuh( i ) ) ) ;97 m_bCamParsVaryOverTime = m_bCamParsVaryOverTime || vps->getCpInSliceSegmentHeaderFlag( curViewIdxInVps );98 }99 100 assert( m_receivedIdc == NULL );101 m_receivedIdc = new Int*[ m_vps->getNumViews() ];102 for (Int i = 0; i < m_vps->getNumViews(); i++)103 {104 m_receivedIdc[i] = new Int[ m_vps->getNumViews() ];105 }106 107 xResetReceivedIdc( true );108 109 for (Int voiInVps = 0; voiInVps < m_vps->getNumViews(); voiInVps++ )110 {111 if( !m_vps->getCpInSliceSegmentHeaderFlag( voiInVps ) )112 {113 for (Int baseVoiInVps = 0; baseVoiInVps < m_vps->getNumViews(); baseVoiInVps++ )114 {115 if( m_vps->getCpPresentFlag( voiInVps, baseVoiInVps ) )116 {117 m_receivedIdc [ baseVoiInVps ][ voiInVps ] = -1;118 m_aaiCodedScale [ baseVoiInVps ][ voiInVps ] = m_vps->getCodedScale (voiInVps) [ baseVoiInVps ];119 m_aaiCodedOffset[ baseVoiInVps ][ voiInVps ] = m_vps->getCodedOffset (voiInVps) [ baseVoiInVps ];120 121 m_receivedIdc [ voiInVps ][ baseVoiInVps ] = -1;122 m_aaiCodedScale [ voiInVps ][ baseVoiInVps ] = m_vps->getInvCodedScale (voiInVps) [ baseVoiInVps ];123 m_aaiCodedOffset[ voiInVps ][ baseVoiInVps ] = m_vps->getInvCodedOffset(voiInVps) [ baseVoiInVps ];124 xInitLUTs( baseVoiInVps, voiInVps, m_aaiCodedScale[ baseVoiInVps ][ voiInVps ], m_aaiCodedOffset[ baseVoiInVps ][ voiInVps ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT );125 xInitLUTs( voiInVps, baseVoiInVps, m_aaiCodedScale[ voiInVps ][ baseVoiInVps ], m_aaiCodedOffset[ voiInVps ][ baseVoiInVps ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT );126 }127 }128 }129 }130 }131 132 Void133 CamParsCollector::xResetReceivedIdc( Bool overWriteFlag )134 {135 for (Int i = 0; i < m_vps->getNumViews(); i++)136 {137 for (Int j = 0; j < m_vps->getNumViews(); j++)138 {139 if ( overWriteFlag || ( m_receivedIdc[i][j] != -1 ) )140 {141 m_receivedIdc[i][j] = 0;142 }143 }144 }145 }146 147 148 Void149 CamParsCollector::xCreateLUTs( UInt uiNumberSourceViews, UInt uiNumberTargetViews, Double****& radLUT, Int****& raiLUT)150 {151 152 uiNumberSourceViews = std::max( (UInt) 1, uiNumberSourceViews );153 uiNumberTargetViews = std::max( (UInt) 1, uiNumberTargetViews );154 155 radLUT = new Double***[ uiNumberSourceViews ];156 raiLUT = new Int ***[ uiNumberSourceViews ];157 158 for( UInt uiSourceView = 0; uiSourceView < uiNumberSourceViews; uiSourceView++ )159 {160 radLUT [ uiSourceView ] = new Double**[ uiNumberTargetViews ];161 raiLUT [ uiSourceView ] = new Int **[ uiNumberTargetViews ];162 163 for( UInt uiTargetView = 0; uiTargetView < uiNumberTargetViews; uiTargetView++ )164 {165 radLUT [ uiSourceView ][ uiTargetView ] = new Double*[ 2 ];166 radLUT [ uiSourceView ][ uiTargetView ][ 0 ] = new Double [ 257 ];167 radLUT [ uiSourceView ][ uiTargetView ][ 1 ] = new Double [ 257 ];168 169 raiLUT [ uiSourceView ][ uiTargetView ] = new Int* [ 2 ];170 raiLUT [ uiSourceView ][ uiTargetView ][ 0 ] = new Int [ 257 ];171 raiLUT [ uiSourceView ][ uiTargetView ][ 1 ] = new Int [ 257 ];172 }173 }174 }175 176 Void177 CamParsCollector::xInitLUTs( UInt uiSourceView, UInt uiTargetView, Int iScale, Int iOffset, Double****& radLUT, Int****& raiLUT)178 {179 Int iLog2DivLuma = m_uiBitDepthForLUT + m_vps->getCpPrecision() + 1 - m_iLog2Precision; AOF( iLog2DivLuma > 0 );180 Int iLog2DivChroma = iLog2DivLuma + 1;181 182 iOffset <<= m_uiBitDepthForLUT;183 184 Double dScale = (Double) iScale / (( Double ) ( 1 << iLog2DivLuma ));185 Double dOffset = (Double) iOffset / (( Double ) ( 1 << iLog2DivLuma ));186 187 // offsets including rounding offsets188 Int64 iOffsetLuma = iOffset + ( ( 1 << iLog2DivLuma ) >> 1 );189 Int64 iOffsetChroma = iOffset + ( ( 1 << iLog2DivChroma ) >> 1 );190 191 192 for( UInt uiDepthValue = 0; uiDepthValue < 256; uiDepthValue++ )193 {194 195 // real-valued look-up tables196 Double dShiftLuma = ( (Double)uiDepthValue * dScale + dOffset ) * Double( 1 << m_iLog2Precision );197 Double dShiftChroma = dShiftLuma / 2;198 radLUT[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] = dShiftLuma;199 radLUT[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ] = dShiftChroma;200 201 // integer-valued look-up tables202 Int64 iTempScale = (Int64)uiDepthValue * iScale;203 Int64 iShiftLuma = ( iTempScale + iOffsetLuma ) >> iLog2DivLuma;204 Int64 iShiftChroma = ( iTempScale + iOffsetChroma ) >> iLog2DivChroma;205 raiLUT[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] = (Int)iShiftLuma;206 raiLUT[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ] = (Int)iShiftChroma;207 }208 209 radLUT[ uiSourceView ][ uiTargetView ][ 0 ][ 256 ] = radLUT[ uiSourceView ][ uiTargetView ][ 0 ][ 255 ];210 radLUT[ uiSourceView ][ uiTargetView ][ 1 ][ 256 ] = radLUT[ uiSourceView ][ uiTargetView ][ 1 ][ 255 ];211 raiLUT[ uiSourceView ][ uiTargetView ][ 0 ][ 256 ] = raiLUT[ uiSourceView ][ uiTargetView ][ 0 ][ 255 ];212 raiLUT[ uiSourceView ][ uiTargetView ][ 1 ][ 256 ] = raiLUT[ uiSourceView ][ uiTargetView ][ 1 ][ 255 ];213 }214 215 Void216 CamParsCollector::uninit()217 {218 m_bInitialized = false;219 }220 221 Void CamParsCollector::setSlice( const TComSlice* pcSlice )222 {223 if( pcSlice == 0 )224 {225 xOutput( m_lastPoc );226 return;227 }228 229 #if !H_3D_FCO230 if ( pcSlice->getIsDepth())231 {232 return;233 }234 #endif235 236 Int curPoc = pcSlice->getPOC();237 if( m_firstReceivedPoc == -2 )238 {239 m_firstReceivedPoc = curPoc;240 }241 242 Bool newPocFlag = ( m_lastPoc != curPoc );243 244 if ( newPocFlag )245 {246 if( m_lastPoc != -1 )247 {248 xOutput( m_lastPoc );249 }250 251 xResetReceivedIdc( false );252 m_lastPoc = pcSlice->getPOC();253 }254 255 UInt voiInVps = m_vps->getVoiInVps(pcSlice->getViewIndex());256 if( m_vps->getCpInSliceSegmentHeaderFlag( voiInVps ) ) // check consistency of slice parameters here257 {258 for( Int baseVoiInVps = 0; baseVoiInVps < m_vps->getNumViews(); baseVoiInVps++ )259 {260 if ( m_vps->getCpPresentFlag( voiInVps, baseVoiInVps ) )261 {262 if ( m_receivedIdc[ voiInVps ][ baseVoiInVps ] != 0 )263 {264 AOF( m_aaiCodedScale [ voiInVps ][ baseVoiInVps ] == pcSlice->getInvCodedScale () [ baseVoiInVps ] );265 AOF( m_aaiCodedOffset[ voiInVps ][ baseVoiInVps ] == pcSlice->getInvCodedOffset() [ baseVoiInVps ] );266 }267 else268 {269 m_receivedIdc [ voiInVps ][ baseVoiInVps ] = 1;270 m_aaiCodedScale [ voiInVps ][ baseVoiInVps ] = pcSlice->getInvCodedScale () [ baseVoiInVps ];271 m_aaiCodedOffset[ voiInVps ][ baseVoiInVps ] = pcSlice->getInvCodedOffset() [ baseVoiInVps ];272 xInitLUTs( voiInVps, baseVoiInVps, m_aaiCodedScale[ voiInVps ][ baseVoiInVps ], m_aaiCodedOffset[ voiInVps ][ baseVoiInVps ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT);273 }274 if ( m_receivedIdc[ baseVoiInVps ][ voiInVps ] != 0 )275 {276 AOF( m_aaiCodedScale [ baseVoiInVps ][ voiInVps ] == pcSlice->getCodedScale () [ baseVoiInVps ] );277 AOF( m_aaiCodedOffset[ baseVoiInVps ][ voiInVps ] == pcSlice->getCodedOffset () [ baseVoiInVps ] );278 }279 else280 {281 m_receivedIdc [ baseVoiInVps ][ voiInVps ] = 1;282 m_aaiCodedScale [ baseVoiInVps ][ voiInVps ] = pcSlice->getCodedScale () [ baseVoiInVps ];283 m_aaiCodedOffset[ baseVoiInVps ][ voiInVps ] = pcSlice->getCodedOffset () [ baseVoiInVps ];284 xInitLUTs( baseVoiInVps, voiInVps, m_aaiCodedScale[ baseVoiInVps ][ voiInVps ], m_aaiCodedOffset[ baseVoiInVps ][ voiInVps ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT);285 }286 }287 }288 }289 }290 291 Void292 CamParsCollector::xOutput( Int iPOC )293 {294 if( m_pCodedScaleOffsetFile )295 {296 if( iPOC == m_firstReceivedPoc )297 {298 fprintf( m_pCodedScaleOffsetFile, "#ViewOrderIdx ViewIdVal\n" );299 fprintf( m_pCodedScaleOffsetFile, "#------------ -------------\n" );300 301 for( UInt voiInVps = 0; voiInVps < m_vps->getNumViews(); voiInVps++ )302 {303 fprintf( m_pCodedScaleOffsetFile, "%13d %13d\n", m_vps->getViewOIdxList( voiInVps ), m_vps->getViewIdVal( m_vps->getViewOIdxList( voiInVps ) ) );304 }305 fprintf( m_pCodedScaleOffsetFile, "\n\n");306 fprintf( m_pCodedScaleOffsetFile, "# StartFrame EndFrame TargetVOI BaseVOI CodedScale CodedOffset Precision\n" );307 fprintf( m_pCodedScaleOffsetFile, "#----------- ------------ ------------ ------------ ------------ ------------ ------------\n" );308 }309 if( iPOC == m_firstReceivedPoc || m_bCamParsVaryOverTime )310 {311 Int iS = iPOC;312 Int iE = ( m_bCamParsVaryOverTime ? iPOC : ~( 1 << 31 ) );313 for( UInt voiInVps = 0; voiInVps < m_vps->getNumViews(); voiInVps++ )314 {315 for( UInt baseVoiInVps = 0; baseVoiInVps < m_vps->getNumViews(); baseVoiInVps++ )316 {317 if( voiInVps != baseVoiInVps )318 {319 if ( m_receivedIdc[baseVoiInVps][voiInVps] != 0 )320 {321 fprintf( m_pCodedScaleOffsetFile, "%12d %12d %12d %12d %12d %12d %12d\n",322 iS, iE, m_vps->getViewOIdxList( voiInVps ), m_vps->getViewOIdxList( baseVoiInVps ),323 m_aaiCodedScale [ baseVoiInVps ][ voiInVps ],324 m_aaiCodedOffset[ baseVoiInVps ][ voiInVps ], m_vps->getCpPrecision() );325 }326 }327 }328 }329 }330 }331 }332 #endif333 46 334 47 … … 393 106 m_viewId = 0; 394 107 395 #if NH_3D396 m_viewIndex = 0;397 m_isDepth = false;398 m_pcCamParsCollector = 0;399 #endif400 108 401 109 m_decodingProcess = CLAUSE_8; … … 735 443 #endif 736 444 737 #if NH_3D738 if ( !m_pcCamParsCollector->isInitialized() )739 {740 m_pcCamParsCollector->init( vps );741 }742 #endif743 445 // Initialise the various objects for the new set of settings 744 446 m_cSAO.create( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), sps->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxTotalCUDepth(), pps->getPpsRangeExtension().getLog2SaoOffsetScale(CHANNEL_TYPE_LUMA), pps->getPpsRangeExtension().getLog2SaoOffsetScale(CHANNEL_TYPE_CHROMA) ); … … 1063 765 m_pcPic->setLayerId( nalu.m_nuhLayerId ); 1064 766 m_pcPic->setViewId ( getViewId() ); 1065 #if NH_3D1066 m_pcPic->setViewIndex( getViewIndex() );1067 m_pcPic->setIsDepth ( getIsDepth () );1068 pcSlice->setIvPicLists( m_dpb );1069 #endif1070 767 #endif 1071 768 … … 1105 802 } 1106 803 } 1107 #if NH_3D_NBDV1108 pcSlice->setDefaultRefView();1109 #endif1110 #if NH_3D_ARP1111 pcSlice->setPocsInCurrRPSs();1112 pcSlice->setARPStepNum(m_dpb);1113 #endif1114 804 #endif 1115 805 … … 1155 845 //--------------- 1156 846 pcSlice->setRefPOCList(); 1157 #if NH_3D_TMVP1158 if(pcSlice->getLayerId())1159 {1160 pcSlice->generateAlterRefforTMVP();1161 }1162 #endif1163 847 } 1164 848 … … 1193 877 } 1194 878 1195 #if NH_3D1196 if ( decProcAnnexI() )1197 {1198 pcSlice->checkInCompPredRefLayers();1199 }1200 #endif1201 879 1202 880 // Decode a picture 1203 881 m_cGopDecoder.decompressSlice(&(nalu.getBitstream()), m_pcPic); 1204 882 1205 #if NH_3D1206 if( m_pcCamParsCollector )1207 {1208 m_pcCamParsCollector->setSlice( pcSlice );1209 }1210 #endif1211 883 1212 884 #if !NH_MV … … 1240 912 sps->setForceDecodeBitDepth(m_forceDecodeBitDepth); 1241 913 #endif 1242 #if NH_3D1243 // GT: Please don't add parsing dependency of SPS from VPS here again!!!1244 #endif1245 914 m_cEntropyDecoder.decodeSPS( sps ); 1246 915 m_parameterSetManager.storeSPS(sps, naluData); … … 1252 921 #if NH_MV 1253 922 pps->setLayerId( getLayerId() ); 1254 #endif1255 #if NH_3D_DLT1256 // create mapping from depth layer indexes to layer ids1257 Int j=0;1258 for( Int i=0; i<=m_parameterSetManager.getFirstVPS()->getMaxLayersMinus1(); i++ )1259 {1260 Int layerId = m_parameterSetManager.getFirstVPS()->getLayerIdInNuh(i);1261 if( m_parameterSetManager.getFirstVPS()->getDepthId(layerId) )1262 pps->getDLT()->setDepthIdxToLayerId(j++, layerId);1263 }1264 923 #endif 1265 924 m_cEntropyDecoder.decodePPS( pps ); … … 1806 1465 { 1807 1466 setViewId ( vps->getViewId ( getLayerId() ) ); 1808 #if NH_3D1809 setViewIndex( vps->getViewIndex( getLayerId() ) );1810 setIsDepth ( vps->getDepthId ( getLayerId() ) == 1 );1811 #endif1812 1467 1813 1468 if ( !vps->getVpsExtensionFlag() ) -
branches/HTM-16.0-MV-draft-5/source/Lib/TLibDecoder/TDecTop.h
r1321 r1390 65 65 class TAppDecTop; 66 66 #endif 67 #if NH_3D68 class CamParsCollector69 {70 public:71 CamParsCollector ();72 ~CamParsCollector ();73 74 Void init ( const TComVPS* vps );75 Void setCodeScaleOffsetFile( FILE* pCodedScaleOffsetFile ) { m_pCodedScaleOffsetFile = pCodedScaleOffsetFile; };76 77 Void uninit ();78 Void setSlice ( const TComSlice* pcSlice );79 80 Bool isInitialized() const { return m_bInitialized; }81 Int**** getBaseViewShiftLUTI() { return m_aiBaseViewShiftLUT; }82 83 private:84 Void xResetReceivedIdc( Bool overWriteFlag );85 Void xOutput ( Int iPOC );86 87 private:88 Bool m_bInitialized;89 FILE* m_pCodedScaleOffsetFile;90 91 Int** m_aaiCodedOffset;92 Int** m_aaiCodedScale;93 94 const TComVPS* m_vps;95 Int** m_receivedIdc;96 Int m_lastPoc;97 Int m_firstReceivedPoc;98 99 100 Bool m_bCamParsVaryOverTime;101 102 UInt m_uiBitDepthForLUT;103 UInt m_iLog2Precision;104 // UInt m_uiInputBitDepth;105 106 // look-up tables107 Double**** m_adBaseViewShiftLUT; ///< Disparity LUT108 Int**** m_aiBaseViewShiftLUT; ///< Disparity LUT109 Void xCreateLUTs( UInt uiNumberSourceViews, UInt uiNumberTargetViews, Double****& radLUT, Int****& raiLUT);110 Void xInitLUTs( UInt uiSourceView, UInt uiTargetView, Int iScale, Int iOffset, Double****& radLUT, Int****& raiLUT);111 template<class T> Void xDeleteArray ( T*& rpt, UInt uiSize1, UInt uiSize2, UInt uiSize3 );112 template<class T> Void xDeleteArray ( T*& rpt, UInt uiSize1, UInt uiSize2 );113 template<class T> Void xDeleteArray ( T*& rpt, UInt uiSize );114 115 };116 117 template <class T>118 Void CamParsCollector::xDeleteArray( T*& rpt, UInt uiSize1, UInt uiSize2, UInt uiSize3 )119 {120 if( rpt )121 {122 for( UInt uiK = 0; uiK < uiSize1; uiK++ )123 {124 for( UInt uiL = 0; uiL < uiSize2; uiL++ )125 {126 for( UInt uiM = 0; uiM < uiSize3; uiM++ )127 {128 delete[] rpt[ uiK ][ uiL ][ uiM ];129 }130 delete[] rpt[ uiK ][ uiL ];131 }132 delete[] rpt[ uiK ];133 }134 delete[] rpt;135 }136 rpt = NULL;137 };138 139 140 template <class T>141 Void CamParsCollector::xDeleteArray( T*& rpt, UInt uiSize1, UInt uiSize2 )142 {143 if( rpt )144 {145 for( UInt uiK = 0; uiK < uiSize1; uiK++ )146 {147 for( UInt uiL = 0; uiL < uiSize2; uiL++ )148 {149 delete[] rpt[ uiK ][ uiL ];150 }151 delete[] rpt[ uiK ];152 }153 delete[] rpt;154 }155 rpt = NULL;156 };157 158 159 template <class T>160 Void CamParsCollector::xDeleteArray( T*& rpt, UInt uiSize )161 {162 if( rpt )163 {164 for( UInt uiK = 0; uiK < uiSize; uiK++ )165 {166 delete[] rpt[ uiK ];167 }168 delete[] rpt;169 }170 rpt = NULL;171 };172 173 #endif //NH_3D174 67 /// decoder class 175 68 class TDecTop … … 240 133 static ParameterSetManager m_parameterSetManager; // storage for parameter sets 241 134 TComPicLists* m_dpb; 242 #if NH_3D243 CamParsCollector* m_pcCamParsCollector;244 #endif245 135 246 136 // Layer identification 247 137 Int m_layerId; 248 138 Int m_viewId; 249 #if NH_3D250 Int m_viewIndex;251 Bool m_isDepth;252 #endif253 139 254 140 // Layer set … … 349 235 Void setViewId ( Int viewId ) { m_viewId = viewId; } 350 236 Int getViewId ( ) { return m_viewId; } 351 #if NH_3D352 Void setViewIndex ( Int viewIndex ) { m_viewIndex = viewIndex; }353 Int getViewIndex ( ) { return m_viewIndex; }354 Void setIsDepth ( Bool isDepth ) { m_isDepth = isDepth; }355 Bool getIsDepth ( ) { return m_isDepth; }356 #endif357 237 358 238 // Classes 359 239 Void setDpb ( TComPicLists* picLists) { m_dpb = picLists; } 360 #if NH_3D361 Void setCamParsCollector ( CamParsCollector* pcCamParsCollector ) { m_pcCamParsCollector = pcCamParsCollector; }362 #endif363 240 364 241 // Slice pilot access
Note: See TracChangeset for help on using the changeset viewer.