Ignore:
Timestamp:
13 Nov 2015, 17:00:20 (9 years ago)
Author:
tech
Message:

Removed 3D.

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  
    381381      xParseSEIMultiviewViewPosition((SEIMultiviewViewPosition&) *sei, payloadSize, pDecodedMessageOutputStream );
    382382      break;
    383 #if NH_3D
    384     case SEI::ALTERNATIVE_DEPTH_INFO:
    385       sei = new SEIAlternativeDepthInfo;
    386       xParseSEIAlternativeDepthInfo((SEIAlternativeDepthInfo&) *sei, payloadSize, pDecodedMessageOutputStream );
    387       break;
    388 #endif
    389383#endif
    390384    default:
     
    17401734};
    17411735
    1742 #if NH_3D
    1743 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 };
    18691736#endif
    1870 #endif
    18711737
    18721738//! \}
  • branches/HTM-16.0-MV-draft-5/source/Lib/TLibDecoder/SEIread.h

    r1386 r1390  
    115115  Void xParseSEIMultiviewAcquisitionInfo      (SEIMultiviewAcquisitionInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
    116116  Void xParseSEIMultiviewViewPosition         (SEIMultiviewViewPosition& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
    117 #if NH_3D
    118   Void xParseSEIAlternativeDepthInfo          (SEIAlternativeDepthInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
    119 #endif
    120117#endif
    121118  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  
    436436    if ( pcPPS->getPps3dExtensionFlag() )
    437437    {
    438 #if NH_3D
    439       parsePps3dExtension( pcPPS );
    440 #endif
    441     }
    442 #if NH_3D
    443     if ( pcPPS->getPpsExtension5bits() )
    444 #else
     438    }
    445439    if ( pcPPS->getPpsExtension5bits() || pcPPS->getPps3dExtensionFlag() )
    446 #endif
    447440    {
    448441      while ( xMoreRbspData() )
     
    543536}
    544537
    545 #if NH_3D
    546 Void TDecCavlc::parsePps3dExtension( TComPPS* pcPPS )
    547 {
    548 #if NH_3D_DLT
    549   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         else
    592         {
    593           bDltBitMapRepFlag = false;
    594         }
    595        
    596         UInt uiNumDepthValues = 0;
    597         std::vector<Int> aiIdx2DepthValue(256, 0);
    598        
    599         // Bit map
    600         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 Coding
    613         else
    614         {
    615           READ_CODE(8, uiNumDepthValues, "num_val_delta_dlt");   // num_entry
    616          
    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             else
    626             {
    627               uiMaxDiff = 0;           // when there is only one value in DLT
    628             }
    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             else
    637             {
    638               uiMinDiff = uiMaxDiff;   // when there are only one or two values in DLT
    639             }
    640            
    641             READ_CODE(8, uiCode, "delta_dlt_val0");   // entry0
    642             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             else
    652             {
    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 DLT
    667           AOF( layerId > 1 );
    668           // assumes ref layer id to be 1
    669           std::vector<Int> viRefDLT = pcDLT->idx2DepthValue( 1 );
    670           UInt uiRefNum = pcDLT->getNumDepthValues( 1 );
    671           pcDLT->setDeltaDLT(layerId, viRefDLT, uiRefNum, aiIdx2DepthValue, uiNumDepthValues);
    672         }
    673         else
    674         {
    675           // store final DLT
    676           pcDLT->setDepthLUTs(layerId, aiIdx2DepthValue, uiNumDepthValues);
    677         }
    678       }
    679     }
    680   }
    681 #endif
    682 }
    683 #endif
    684538
    685539
     
    11841038    if ( pcSPS->getSps3dExtensionFlag() )
    11851039    {
    1186 #if NH_3D
    1187       parseSps3dExtension( pcSPS );
    1188 #endif
    1189     }
    1190 
    1191 #if NH_3D
    1192     if ( pcSPS->getSpsExtension5bits() )
    1193 #else
     1040    }
     1041
    11941042    if ( pcSPS->getSpsExtension5bits() || pcSPS->getSps3dExtensionFlag() )
    1195 #endif
    11961043    {
    11971044      while ( xMoreRbspData() )
     
    12701117}
    12711118
    1272 #if NH_3D
    1273 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     else
    1290     {
    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 #endif
    13031119
    13041120Void TDecCavlc::parsePpsMultilayerExtension(TComPPS* pcPPS)
     
    14821298    if (uiCode)
    14831299    {
    1484 #if NH_3D
    1485       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 #endif
    14961300#endif 
    14971301        while ( xMoreRbspData() )
     
    15001304        }
    15011305#if NH_MV
    1502 #if NH_3D
    1503       }
    1504 #endif
    15051306    }
    15061307#endif
     
    15871388  }
    15881389
    1589 #if NH_3D
    1590   pcVPS->initViewCompLayer( );
    1591 #endif
    15921390
    15931391  for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ )
     
    21781976}
    21791977
    2180 #if NH_3D
    2181 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 #endif
    22141978#endif
    22151979
     
    23042068  pcSlice->setViewId   ( vps->getViewId   ( pcSlice->getLayerId() )      );
    23052069  pcSlice->setViewIndex( vps->getViewIndex( pcSlice->getLayerId() )      ); 
    2306 #if NH_3D
    2307   pcSlice->setIsDepth  ( vps->getDepthId  ( pcSlice->getLayerId() ) == 1 );
    2308 #endif
    23092070#endif
    23102071
     
    26222383    Bool interLayerPredLayerIdcPresentFlag = false;
    26232384    Int layerId       = pcSlice->getLayerId();
    2624 #if NH_3D
    2625     if( pcSlice->getLayerId() > 0 && !vps->getAllRefLayersActiveFlag() && vps->getNumRefListLayers( layerId ) > 0 )
    2626 #else
    26272385    if( pcSlice->getLayerId() > 0 && !vps->getAllRefLayersActiveFlag() && vps->getNumDirectRefLayers( layerId ) > 0 )
    2628 #endif
    26292386    {   
    26302387      READ_FLAG( uiCode, "inter_layer_pred_enabled_flag" ); pcSlice->setInterLayerPredEnabledFlag( uiCode == 1 );
    2631 #if NH_3D
    2632       if( pcSlice->getInterLayerPredEnabledFlag() && vps->getNumRefListLayers( layerId ) > 1 )
    2633 #else
    26342388      if( pcSlice->getInterLayerPredEnabledFlag() && vps->getNumDirectRefLayers( layerId ) > 1 )
    2635 #endif
    26362389      {           
    26372390        if( !vps->getMaxOneActiveRefLayerFlag()) 
     
    26392392          READ_CODE( pcSlice->getNumInterLayerRefPicsMinus1Len( ), uiCode, "num_inter_layer_ref_pics_minus1" ); pcSlice->setNumInterLayerRefPicsMinus1( uiCode );
    26402393        }
    2641 #if NH_3D
    2642         if ( pcSlice->getNumActiveRefLayerPics() != vps->getNumRefListLayers( layerId ) )
    2643 #else
    26442394        if ( pcSlice->getNumActiveRefLayerPics() != vps->getNumDirectRefLayers( layerId ) )
    2645 #endif
    26462395        {
    26472396          interLayerPredLayerIdcPresentFlag = true;
     
    26602409      }
    26612410    }
    2662 #if NH_3D
    2663     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 #endif
    26732411#endif
    26742412    if(sps->getUseSAO())
     
    28772615    }
    28782616
    2879 #if NH_3D_IC
    2880     else if(    pcSlice->getViewIndex() && ( pcSlice->getSliceType() == P_SLICE || pcSlice->getSliceType() == B_SLICE )
    2881              && !pcSlice->getIsDepth() && vps->getNumRefListLayers( layerId ) > 0
    2882              && 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 #endif
    28972617
    28982618    if (!pcSlice->isIntra())
    28992619    {
    29002620      READ_UVLC( uiCode, "five_minus_max_num_merge_cand");
    2901 #if NH_3D_IV_MERGE
    2902       pcSlice->setMaxNumMergeCand(( ( pcSlice->getMpiFlag() || pcSlice->getIvMvPredFlag() || pcSlice->getViewSynthesisPredFlag() ) ? MRG_MAX_NUM_CANDS_MEM : MRG_MAX_NUM_CANDS) - uiCode);
    2903 #else
    29042621      pcSlice->setMaxNumMergeCand(MRG_MAX_NUM_CANDS - uiCode);
    2905 #endif
    29062622    }
    29072623
     
    29942710    pcSlice->setLFCrossSliceBoundaryFlag( (uiCode==1)?true:false);
    29952711
    2996 #if NH_3D
    2997     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 #endif
    30132712
    30142713  }
     
    33513050}
    33523051
    3353 #if NH_3D_DIS
    3354 Void TDecCavlc::parseDIS( TComDataCU* /*pcCU*/, UInt /*uiAbsPartIdx*/, UInt /*uiDepth*/ )
    3355 {
    3356   assert(0);
    3357 }
    3358 #endif
    33593052
    33603053Void TDecCavlc::parseSkipFlag( TComDataCU* /*pcCU*/, UInt /*uiAbsPartIdx*/, UInt /*uiDepth*/ )
     
    34933186}
    34943187
    3495 #if NH_3D_ARP
    3496 Void TDecCavlc::parseARPW( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    3497 {
    3498   assert(0);
    3499 }
    3500 #endif
    3501 #if NH_3D_IC
    3502 Void TDecCavlc::parseICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    3503 {
    3504   assert(0);
    3505 }
    3506 #endif
    3507 #if NH_3D_SDC_INTRA || NH_3D_SDC_INTER
    3508 Void TDecCavlc::parseSDCFlag    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    3509 {
    3510   assert(0);
    3511 }
    3512 
    3513 #endif
    3514 #if NH_3D_DBBP
    3515   Void TDecCavlc::parseDBBPFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    3516   {
    3517     assert(0);
    3518   }
    3519 #endif
    35203188// ====================================================================================================================
    35213189// Protected member functions
  • branches/HTM-16.0-MV-draft-5/source/Lib/TLibDecoder/TDecCAVLC.h

    r1321 r1390  
    9494  Void  setDecTop           ( TDecTop* decTop ) { m_decTop = decTop; };
    9595#endif
    96 #if NH_3D
    97   Void  parseVps3dExtension  ( TComVPS* pcVPS );
    98   Void  parseSps3dExtension  ( TComSPS* pcSPS ); 
    99   Void  parsePps3dExtension  ( TComPPS* pcPPS );
    100 #endif
    10196
    10297  Void  parseSPS            ( TComSPS* pcSPS );
     
    121116       
    122117  Void  parseSkipFlag        ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    123 #if NH_3D_DIS
    124   Void  parseDIS             ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    125 #endif
    126118  Void parseCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    127119  Void parseMergeFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx );
    128120  Void parseMergeIndex      ( TComDataCU* pcCU, UInt& ruiMergeIndex );
    129 #if NH_3D_ARP
    130   Void parseARPW            ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    131 #endif
    132 #if NH_3D_IC
    133   Void  parseICFlag         ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    134 #endif
    135 #if NH_3D_DMM || NH_3D_SDC_INTRA || NH_3D_SDC_INTER
    136   Void  parseDeltaDC        ( TComDataCU* /*pcCU*/, UInt /*absPartIdx*/, UInt /*depth*/ ) { assert(0); };
    137 #endif
    138 #if NH_3D_SDC_INTRA || NH_3D_SDC_INTER
    139   Void  parseSDCFlag        ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    140 #endif
    141 #if NH_3D_DBBP
    142   Void  parseDBBPFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    143 #endif
    144121  Void parseSplitFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    145122  Void parsePartSize        ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
  • branches/HTM-16.0-MV-draft-5/source/Lib/TLibDecoder/TDecCu.cpp

    r1386 r1390  
    5252  m_ppcYuvReco = NULL;
    5353  m_ppcCU      = NULL;
    54 #if NH_3D_DBBP
    55   m_ppcYuvRecoDBBP = NULL;
    56 #endif
    5754}
    5855
     
    8178  m_ppcYuvReco = new TComYuv*[m_uiMaxDepth-1];
    8279  m_ppcCU      = new TComDataCU*[m_uiMaxDepth-1];
    83 #if NH_3D_DBBP
    84   m_ppcYuvRecoDBBP = new TComYuv*[m_uiMaxDepth-1];
    85 #endif
    8680
    8781  for ( UInt ui = 0; ui < m_uiMaxDepth-1; ui++ )
     
    10296    m_ppcYuvReco[ui] = new TComYuv;    m_ppcYuvReco[ui]->create( uiWidth, uiHeight, chromaFormatIDC );
    10397    m_ppcCU     [ui] = new TComDataCU; m_ppcCU     [ui]->create( chromaFormatIDC, uiNumPartitions, uiWidth, uiHeight, true, uiMaxWidth >> (m_uiMaxDepth - 1) );
    104 #if NH_3D_DBBP
    105     m_ppcYuvRecoDBBP[ui] = new TComYuv;    m_ppcYuvRecoDBBP[ui]->create( uiWidth, uiHeight, chromaFormatIDC );
    106 #endif
    10798}
    10899
     
    126117    m_ppcYuvReco[ui]->destroy(); delete m_ppcYuvReco[ui]; m_ppcYuvReco[ui] = NULL;
    127118    m_ppcCU     [ui]->destroy(); delete m_ppcCU     [ui]; m_ppcCU     [ui] = NULL;
    128 #if NH_3D_DBBP
    129     m_ppcYuvRecoDBBP[ui]->destroy(); delete m_ppcYuvRecoDBBP[ui]; m_ppcYuvRecoDBBP[ui] = NULL;
    130 #endif
    131119  }
    132120
     
    134122  delete [] m_ppcYuvReco; m_ppcYuvReco = NULL;
    135123  delete [] m_ppcCU     ; m_ppcCU      = NULL;
    136 #if NH_3D_DBBP
    137   delete [] m_ppcYuvRecoDBBP; m_ppcYuvRecoDBBP = NULL;
    138 #endif
    139124}
    140125
     
    170155Void TDecCu::decompressCtu( TComDataCU* pCtu )
    171156{
    172 #if !NH_3D_IV_MERGE
    173157  xDecompressCU( pCtu, 0,  0 );
    174 #endif
    175158}
    176159
     
    290273    pcCU->setQPSubParts( pcCU->getRefQP(uiAbsPartIdx), uiAbsPartIdx, uiDepth ); // set QP to default QP
    291274  }
    292 #if NH_3D_NBDV
    293   DisInfo DvInfo;
    294   DvInfo.m_acNBDV.setZero();
    295   DvInfo.m_aVIdxCan = 0;
    296 #if NH_3D_NBDV_REF 
    297   DvInfo.m_acDoNBDV.setZero();
    298 #endif
    299  
    300 if(!pcCU->getSlice()->isIntra())
    301   {
    302 #if NH_3D_ARP && NH_3D_IV_MERGE && NH_3D_VSP
    303     if( pcCU->getSlice()->getIvResPredFlag() || pcCU->getSlice()->getIvMvPredFlag() || pcCU->getSlice()->getViewSynthesisPredFlag() )
    304 #else
    305 #if NH_3D_IV_MERGE && NH_3D_VSP
    306     if( pcCU->getSlice()->getIvMvPredFlag() || pcCU->getSlice()->getViewSynthesisPredFlag() )
    307 #else
    308 #if NH_3D_ARP && NH_3D_VSP
    309     if( pcCU->getSlice()->getIvResPredFlag() || pcCU->getSlice()->getViewSynthesisPredFlag() )
    310 #else
    311 #if NH_3D_VSP
    312     if( pcCU->getSlice()->getViewSynthesisPredFlag() )
    313 #else
    314 #if H_3D_ARP
    315     if( pcCU->getSlice()->getIvResPredFlag( ) )
    316 #else
    317 #if H_3D_IV_MERGE
    318     if( pcCU->getSlice()->getVPS()->getIvMvPredFlag(pcCU->getSlice()->getLayerId()) )
    319 #else
    320 #if NH_3D_DBBP
    321     if( pcCU->getSlice()->getDepthBasedBlkPartFlag() )
    322 #else
    323     if (0)
    324 #endif
    325 #endif
    326 #endif
    327 #endif
    328 #endif
    329 #endif
    330 #endif
    331     {
    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_MERGE
    341       if( pcCU->getSlice()->getIsDepth())
    342       {
    343         m_ppcCU[uiDepth]->getDispforDepth(0, 0, &DvInfo);
    344       }
    345       else
    346       {
    347 #endif
    348 #if NH_3D_NBDV_REF
    349       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       else
    354 #endif
    355       {
    356         m_ppcCU[uiDepth]->getDisMvpCandNBDV(&DvInfo);
    357       }
    358 #if NH_3D_IV_MERGE
    359       }
    360 #endif
    361 #if ENC_DEC_TRACE && NH_MV_ENC_DEC_TRAC   
    362       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 #endif
    371       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 #endif
    378275
    379276  if( uiDepth <= pps.getPpsRangeExtension().getDiffCuChromaQpOffsetDepth() && pcCU->getSlice()->getUseChromaQpAdj() )
     
    403300    m_ppcCU[uiDepth]->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_0 );
    404301    m_ppcCU[uiDepth]->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_1 );
    405 #if NH_3D_IV_MERGE
    406     m_ppcCU[uiDepth]->copyDVInfoFrom(pcCU, uiAbsPartIdx);
    407     TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists
    408     UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM];
    409 #else
    410 #if NH_3D_MLC
    411     TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists
    412     UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM];
    413 #else
    414302    TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS << 1]; // double length for mv of both lists
    415303    UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS];
    416 #endif
    417 #endif
    418304    Int numValidMergeCand = 0;
    419305    for( UInt ui = 0; ui < m_ppcCU[uiDepth]->getSlice()->getMaxNumMergeCand(); ++ui )
     
    423309    m_pcEntropyDecoder->decodeMergeIndex( pcCU, 0, uiAbsPartIdx, uiDepth );
    424310    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
    449314    m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );
    450 #if NH_3D_MLC
    451     m_ppcCU[uiDepth]->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours
    452 #if NH_3D_SPIVMP
    453       , pcMvFieldSP, puhInterDirSP
    454 #endif
    455       , numValidMergeCand, uiMergeIndex );
    456 
    457     m_ppcCU[uiDepth]->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours
    458 #if NH_3D_VSP
    459       , vspFlag
    460 #endif
    461 #if NH_3D_SPIVMP
    462       , bSPIVMPFlag
    463 #endif
    464       , numValidMergeCand );
    465 #endif
    466 #if NH_3D_VSP
    467     pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiAbsPartIdx, 0, uiDepth );
    468 #endif
    469315
    470316    pcCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeIndex], uiAbsPartIdx, 0, uiDepth );
     
    479325        pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvd( cTmpMv, SIZE_2Nx2N, uiAbsPartIdx, uiDepth );
    480326        pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvField( cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ], SIZE_2Nx2N, uiAbsPartIdx, uiDepth );
    481 #if NH_3D_VSP
    482         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 #endif
    495327#if ENC_DEC_TRACE && NH_MV_ENC_DEC_TRAC   
    496328        if ( g_decTraceMvFromMerge )
     
    512344      }
    513345    }
    514 #if NH_3D_SPIVMP
    515     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_TRAC
    534       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 #endif
    566     }
    567     delete[] pcMvFieldSP;
    568     delete[] puhInterDirSP;
    569 #endif
    570346
    571347    xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, isLastCtuOfSliceSegment );
    572 #if NH_3D_IV_MERGE
    573     xDecompressCU(pcCU, uiAbsPartIdx, uiDepth );
    574 #endif
    575348
    576349    return;
    577350  }
    578 #if NH_3D_DIS
    579   m_pcEntropyDecoder->decodeDIS( pcCU, uiAbsPartIdx, uiDepth );
    580   if(!pcCU->getDISFlag(uiAbsPartIdx))
    581   {
    582 #endif
    583351
    584352  m_pcEntropyDecoder->decodePredMode( pcCU, uiAbsPartIdx, uiDepth );
     
    591359    if(pcCU->getIPCMFlag(uiAbsPartIdx))
    592360    {
    593 #if NH_3D_SDC_INTRA
    594       m_pcEntropyDecoder->decodeSDCFlag( pcCU, uiAbsPartIdx, uiDepth );
    595 #endif
    596361      xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, isLastCtuOfSliceSegment );
    597 #if NH_3D_IV_MERGE
    598       xDecompressCU(pcCU, uiAbsPartIdx, uiDepth );
    599 #endif
    600362      return;
    601363    }
     
    611373  setIsChromaQpAdjCoded( isChromaQpAdjCoded );
    612374  setdQPFlag( bCodeDQP );
    613 #if NH_3D_DIS
    614   }
    615 #endif
    616375  xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, isLastCtuOfSliceSegment );
    617 #if NH_3D_IV_MERGE
    618   xDecompressCU(pcCU, uiAbsPartIdx, uiDepth );
    619 #endif
    620376}
    621377
     
    638394{
    639395  TComPic* pcPic = pCtu->getPic();
    640 #if !NH_3D_IV_MERGE
    641396  TComSlice * pcSlice = pCtu->getSlice();
    642397  const TComSPS &sps=*(pcSlice->getSPS());
     
    672427    return;
    673428  }
    674 #endif
    675429  // Residual reconstruction
    676430  m_ppcYuvResi[uiDepth]->clear();
     
    681435  {
    682436    case MODE_INTER:
    683 #if NH_3D_DBBP
    684     if( m_ppcCU[uiDepth]->getDBBPFlag(0) )
    685     {
    686       xReconInterDBBP( m_ppcCU[uiDepth], uiAbsPartIdx, uiDepth );
    687     }
    688     else
    689     {
    690 #endif
    691 #if NH_3D_SDC_INTER
    692       if( m_ppcCU[uiDepth]->getSDCFlag( 0 ) )
    693       {
    694         xReconInterSDC( m_ppcCU[uiDepth], uiAbsPartIdx, uiDepth );
    695       }
    696       else
    697       {
    698 #endif
    699437      xReconInter( m_ppcCU[uiDepth], uiDepth );
    700 #if NH_3D_SDC_INTER
    701       }
    702 #endif
    703 #if NH_3D_DBBP
    704     }
    705 #endif
    706438      break;
    707439    case MODE_INTRA:
    708 #if NH_3D
    709 #if NH_3D_DIS
    710     if( m_ppcCU[uiDepth]->getDISFlag(0) )
    711     {
    712       xReconDIS( m_ppcCU[uiDepth], 0, uiDepth );
    713     }
    714 #else
    715     if(false )
    716     {
    717      // xReconDIS( m_ppcCU[uiDepth], 0, uiDepth );
    718     }
    719 #endif
    720 #if NH_3D_SDC_INTRA
    721     else if( m_ppcCU[uiDepth]->getSDCFlag(0) )
    722     {
    723       xReconIntraSDC( m_ppcCU[uiDepth], 0, uiDepth );
    724     }
    725 #endif
    726     else
    727 #endif
    728440      xReconIntraQT( m_ppcCU[uiDepth], uiDepth );
    729441      break;
     
    794506}
    795507
    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
    1020509
    1021510
     
    1081570
    1082571  //===== get prediction signal =====
    1083 #if NH_3D_DMM
    1084   if( bIsLuma && isDmmMode( uiChFinalMode ) )
    1085   {
    1086     m_pcPrediction->predIntraLumaDmm( pcCU, uiAbsPartIdx, getDmmType( uiChFinalMode ), piPred, uiStride, uiWidth, uiHeight );
    1087   }
    1088   else
    1089   {
    1090 #endif
    1091572  m_pcPrediction->predIntraAng( compID,   uiChFinalMode, 0 /* Decoder does not have an original image */, 0, piPred, uiStride, rTu, bUseFilteredPredictions );
    1092 #if NH_3D_DMM
    1093   }
    1094 #endif
    1095573
    1096574#if DEBUG_STRING
     
    1110588  std::string *psDebug=(DebugOptionList::DebugString_InvTran.getInt()&debugPredModeMask) ? &sDebug : 0;
    1111589#endif
    1112 #if H_3D
    1113   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 #else
    1117590  if (pcCU->getCbf(uiAbsPartIdx, compID, rTu.GetTransformDepthRel()) != 0)
    1118 #endif
    1119591  {
    1120592    m_pcTrQuant->invTransformNxN( rTu, compID, piResi, uiStride, pcCoeff, cQP DEBUG_STRING_PASS_INTO(psDebug) );
     
    1255727}
    1256728
    1257 #if NH_3D_SDC_INTRA
    1258 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_DMM
    1287   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 partition
    1311     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 values
    1321     Pel predDC1 = 0, predDC2 = 0;
    1322     m_pcPrediction->predBiSegDCs( pcCU, uiAbsPartIdx, uiWidth, uiHeight, pbMask, uiMaskStride, predDC1, predDC2 );
    1323 
    1324     // set prediction signal
    1325     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 modes
    1331   {
    1332 #endif
    1333     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     do
    1345     {
    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 part
    1364       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 block
    1379     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_DMM
    1392   }
    1393 #endif
    1394  
    1395   // reconstruct residual based on mask + DC residuals
    1396   Pel apDCResiValues[2];
    1397   for( UInt uiSegment = 0; uiSegment < uiNumSegments; uiSegment++ )
    1398   {
    1399 #if NH_3D_DLT
    1400     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 #else
    1406     apDCResiValues[uiSegment]  = pcCU->getSDCSegmentDCOffset(uiSegment, uiAbsPartIdx);
    1407 #endif
    1408   }
    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 chroma
    1437   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_DMM
    1453   if( pbMask ) { delete[] pbMask; }
    1454 #endif
    1455 }
    1456 #endif
    1457729
    1458730
  • branches/HTM-16.0-MV-draft-5/source/Lib/TLibDecoder/TDecCu.h

    r1313 r1390  
    6262  TComDataCU**        m_ppcCU;            ///< CU data array
    6363
    64 #if NH_3D_DBBP
    65   TComYuv**           m_ppcYuvRecoDBBP;
    66 #endif
    6764 
    6865  // access channel
     
    10299  Void xReconInter              ( TComDataCU* pcCU, UInt uiDepth );
    103100
    104 #if NH_3D_DBBP
    105   Void xReconInterDBBP          ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    106 #endif
    107101 
    108102  Void xReconIntraQT            ( TComDataCU* pcCU, UInt uiDepth );
     
    124118  Void xFillPCMBuffer           (TComDataCU* pCU, UInt depth);
    125119
    126 #if NH_3D_DIS
    127   Void xReconDIS               ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    128 #endif
    129 #if NH_3D_SDC_INTRA
    130   Void xReconIntraSDC           ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    131 #endif
    132 #if NH_3D_SDC_INTER
    133   Void xReconInterSDC           ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    134 #endif
    135120
    136121};
  • branches/HTM-16.0-MV-draft-5/source/Lib/TLibDecoder/TDecEntropy.cpp

    r1386 r1390  
    6060  m_pcEntropyDecoderIf->parseSkipFlag( pcCU, uiAbsPartIdx, uiDepth );
    6161}
    62 #if NH_3D_DIS
    63 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 #endif
    7262
    7363Void TDecEntropy::decodeCUTransquantBypassFlag(TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     
    10494}
    10595
    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
    14697
    14798Void TDecEntropy::decodeSplitFlag   ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     
    165116  {
    166117    decodeIntraDirModeLuma  ( pcCU, uiAbsPartIdx, uiDepth );
    167 #if NH_3D_SDC_INTRA
    168     decodeSDCFlag   ( pcCU, uiAbsPartIdx, uiDepth );
    169 #endif
    170118    if (pcCU->getPic()->getChromaFormat()!=CHROMA_400)
    171119    {
     
    239187  UInt uiPUOffset = ( g_auiPUOffset[UInt( ePartSize )] << ( ( pcCU->getSlice()->getSPS()->getMaxTotalCUDepth() - uiDepth ) << 1 ) ) >> 4;
    240188
    241 #if NH_3D_MLC
    242 //#if H_3D_IV_MERGE
    243   TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists
    244   UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM];
    245 #else
    246189  TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS << 1]; // double length for mv of both lists
    247190  UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS];
    248 #endif
    249 #if NH_3D_SPIVMP
    250   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 #endif
    254 #if NH_3D_IV_MERGE
    255   pcSubCU->copyDVInfoFrom( pcCU, uiAbsPartIdx);
    256 #endif
    257191  for ( UInt ui = 0; ui < pcCU->getSlice()->getMaxNumMergeCand(); ui++ )
    258192  {
     
    264198  pcSubCU->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_0 );
    265199  pcSubCU->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_1 );
    266 #if NH_3D
    267200  for ( UInt uiPartIdx = 0, uiSubPartIdx = uiAbsPartIdx; uiPartIdx < uiNumPU; uiPartIdx++, uiSubPartIdx += uiPUOffset )
    268201  {
     
    273206    //DTRACE_PU("x1", uiTPelY)
    274207#endif
    275 
    276     ////// Parse PUs syntax
    277208    decodeMergeFlag( pcCU, uiSubPartIdx, uiDepth, uiPartIdx );
    278209    if ( pcCU->getMergeFlag( uiSubPartIdx ) )
    279210    {
    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 );
    317212#if ENVIRONMENT_VARIABLE_DEBUG_AND_TEST
    318213      if (bDebugPredEnabled)
     
    323218#endif
    324219
    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 )
    330222      {
    331223        if ( !hasMergedCandList )
     
    333225          pcSubCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth ); // temporarily set.
    334226
    335 #if NH_3D_MLC
    336 #if NH_3D_VSP
    337           Int vspFlag[MRG_MAX_NUM_CANDS_MEM];
    338           memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
    339 #endif
    340 #if NH_3D_SPIVMP
    341           memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM);
    342 #endif
    343           pcSubCU->initAvailableFlags();
    344 #endif
    345227          pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );
    346 #if NH_3D_MLC
    347           pcSubCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours
    348 #if NH_3D_SPIVMP
    349             , pcMvFieldSP, puhInterDirSP
    350 #endif
    351             , numValidMergeCand );
    352           pcSubCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours
    353 #if NH_3D_VSP
    354             , vspFlag
    355 #endif
    356 #if NH_3D_SPIVMP
    357             , bSPIVMPFlag
    358 #endif
    359             , numValidMergeCand );
    360 #if NH_3D_VSP
    361           pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );
    362 #endif
    363 #endif
    364228          pcSubCU->setPartSizeSubParts( ePartSize, 0, uiDepth ); // restore.
    365229          hasMergedCandList = true;
     
    368232      else
    369233      {
    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
    380235        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
    400238      pcCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );
    401239
     
    409247          pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvd( cTmpMv, ePartSize, uiSubPartIdx, uiDepth, uiPartIdx );
    410248          pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvField( cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ], ePartSize, uiSubPartIdx, uiDepth, uiPartIdx );
    411 #if NH_3D_VSP
    412 #if NH_3D_DBBP
    413           if( pcCU->getVSPFlag( uiSubPartIdx ) != 0 && !pcCU->getDBBPFlag( uiAbsPartIdx ) )
    414 #else
    415           if( pcCU->getVSPFlag( uiSubPartIdx ) != 0 )
    416 #endif
    417           {
    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 #endif
    429249        }
    430250      }
    431 #if NH_3D_SPIVMP
    432       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 #endif
    454251    }
    455252    else
    456253    {
     254      decodeInterDirPU( pcCU, uiSubPartIdx, uiDepth, uiPartIdx );
    457255      for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ )
    458       {       
     256      {
    459257        if ( pcCU->getSlice()->getNumRefIdx( RefPicList( uiRefListIdx ) ) > 0 )
    460258        {
    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 ) );
    462262#if ENVIRONMENT_VARIABLE_DEBUG_AND_TEST
    463263          if (bDebugPredEnabled)
     
    471271#endif
    472272        }
    473       }
     273      } 
    474274    }
    475275
     
    481281    }
    482282  }
    483 #else
    484   for ( UInt uiPartIdx = 0, uiSubPartIdx = uiAbsPartIdx; uiPartIdx < uiNumPU; uiPartIdx++, uiSubPartIdx += uiPUOffset )
    485   {
    486 #if NH_MV_ENC_DEC_TRAC
    487     DTRACE_PU_S("=========== prediction_unit ===========\n")
    488     // ToDo:
    489     //DTRACE_PU("x0", uiLPelX)
    490     //DTRACE_PU("x1", uiTPelY)
    491 #endif
    492     decodeMergeFlag( pcCU, uiSubPartIdx, uiDepth, uiPartIdx );
    493     if ( pcCU->getMergeFlag( uiSubPartIdx ) )
    494     {
    495       decodeMergeIndex( pcCU, uiPartIdx, uiSubPartIdx, uiDepth );
    496 #if ENVIRONMENT_VARIABLE_DEBUG_AND_TEST
    497       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 #endif
    503 #if NH_3D_IC
    504       decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );
    505 #endif
    506 
    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_MLC
    515 #if NH_3D_VSP
    516           Int vspFlag[MRG_MAX_NUM_CANDS_MEM];
    517           memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
    518 #endif
    519 #if NH_3D_SPIVMP
    520           memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM);
    521 #endif
    522           pcSubCU->initAvailableFlags();
    523 #endif
    524           pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );
    525 #if NH_3D_MLC
    526           pcSubCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours
    527 #if NH_3D_SPIVMP
    528             , pcMvFieldSP, puhInterDirSP
    529 #endif
    530             , numValidMergeCand );
    531           pcSubCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours
    532 #if NH_3D_VSP
    533             , vspFlag
    534 #endif
    535 #if NH_3D_SPIVMP
    536             , bSPIVMPFlag
    537 #endif
    538             , numValidMergeCand );
    539 #if NH_3D_VSP
    540           pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );
    541 #endif
    542 #endif
    543           pcSubCU->setPartSizeSubParts( ePartSize, 0, uiDepth ); // restore.
    544           hasMergedCandList = true;
    545         }
    546       }
    547       else
    548       {
    549 
    550 #if NH_3D_MLC
    551 #if NH_3D_VSP
    552         Int vspFlag[MRG_MAX_NUM_CANDS_MEM];
    553         memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
    554 #endif
    555 #if NH_3D_SPIVMP
    556         memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM);
    557 #endif
    558         pcSubCU->initAvailableFlags();
    559 #endif
    560         pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );
    561 #if NH_3D_MLC
    562         pcSubCU->xGetInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours
    563 #if NH_3D_SPIVMP
    564           , pcMvFieldSP, puhInterDirSP
    565 #endif
    566           ,numValidMergeCand, uiMergeIndex );
    567         pcSubCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours
    568 #if NH_3D_VSP
    569           , vspFlag
    570 #endif
    571 #if NH_3D_SPIVMP
    572           , bSPIVMPFlag
    573 #endif
    574           ,numValidMergeCand );
    575 #if NH_3D_VSP
    576         pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );
    577 #endif
    578 #endif
    579       }
    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_VSP
    593           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 #endif
    606         }
    607       }
    608 #if NH_3D_SPIVMP
    609       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 #endif
    631     }
    632     else
    633     {
    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_TEST
    643           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 #endif
    652         }
    653       }
    654 #if NH_3D_IC
    655       decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );
    656 #endif
    657     }
    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 #endif
    667 #if NH_3D_SPIVMP
    668   delete[] pcMvFieldSP;
    669   delete[] puhInterDirSP;
    670 #endif
    671283  return;
    672284}
     
    733345}
    734346
    735 #if NH_3D
    736347Void TDecEntropy::decodeMVPIdxPU( TComDataCU* pcSubCU, UInt uiPartAddr, UInt uiDepth, UInt uiPartIdx, RefPicList eRefList )
    737348{
    738349  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;
    739360
    740361  if ( (pcSubCU->getInterDir(uiPartAddr) & ( 1 << eRefList )) )
     
    754375#endif
    755376  }
    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 #else
    783 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_TRAC
    801 #if ENC_DEC_TRACE
    802     if ( eRefList == REF_PIC_LIST_0 )
    803     {
    804       DTRACE_PU("mvp_l0_flag", iMVPIdx)
    805     }
    806     else
    807     {
    808       DTRACE_PU("mvp_l1_flag", iMVPIdx)
    809     }
    810 #endif
    811 #endif
    812   }
    813377  pcSubCU->fillMvpCand(uiPartIdx, uiPartAddr, eRefList, iRefIdx, pAMVPInfo);
    814378  pcSubCU->setMVPNumSubParts(pAMVPInfo->iN, eRefList, uiPartAddr, uiPartIdx, uiDepth);
     
    823387  pcSubCU->getCUMvField( eRefList )->setAllMv(cMv, ePartSize, uiPartAddr, 0, uiPartIdx);
    824388}
    825 #endif
    826389
    827390Void TDecEntropy::xDecodeTransform        ( Bool& bCodeDQP, Bool& isChromaQpAdjCoded, TComTU &rTu, const Int quadtreeTULog2MinSizeInCU )
     
    1085648Void TDecEntropy::decodeCoeff( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, Bool& bCodeDQP, Bool& isChromaQpAdjCoded )
    1086649{
    1087 #if NH_3D_SDC_INTRA
    1088   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 #endif
    1095 #if NH_3D_SDC_INTER
    1096   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 #endif
    1103 #if NH_3D
    1104   if( pcCU->getSlice()->getIsDepth() )
    1105   {
    1106 #if NH_3D_SDC_INTRA || NH_3D_SDC_INTER
    1107     if( pcCU->getSDCFlag( uiAbsPartIdx ) )
    1108     {
    1109       m_pcEntropyDecoderIf->parseDeltaDC( pcCU, uiAbsPartIdx, uiDepth );
    1110       return;
    1111     }
    1112 #endif
    1113 #if NH_3D_DMM
    1114     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 #endif
    1127   }
    1128 #endif
    1129650
    1130651  if( pcCU->isIntra(uiAbsPartIdx) )
     
    1162683}
    1163684
    1164 #if NH_3D_SDC_INTRA || NH_3D_SDC_INTER
    1165 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 #endif
    1189 #if NH_3D_DBBP
    1190 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 #endif
    1198685
    1199686
  • branches/HTM-16.0-MV-draft-5/source/Lib/TLibDecoder/TDecEntropy.h

    r1321 r1390  
    8181public:
    8282  virtual Void parseSkipFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
    83 #if NH_3D_DIS
    84   virtual Void parseDIS           ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
    85 #endif
    8683  virtual Void parseCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
    8784  virtual Void parseSplitFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
    8885  virtual Void parseMergeFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx ) = 0;
    8986  virtual Void parseMergeIndex    ( TComDataCU* pcCU, UInt& ruiMergeIndex ) = 0;
    90 #if NH_3D_ARP
    91   virtual Void parseARPW          ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
    92 #endif
    93 #if NH_3D_IC
    94   virtual Void parseICFlag        ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
    95 #endif
    96 #if NH_3D_DMM || NH_3D_SDC_INTRA || NH_3D_SDC_INTER
    97   virtual Void  parseDeltaDC      ( TComDataCU* pcCU, UInt absPartIdx, UInt depth ) = 0;
    98 #endif
    99 #if NH_3D_SDC_INTRA || NH_3D_SDC_INTER
    100   virtual Void parseSDCFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
    101 #endif
    102 #if NH_3D_DBBP
    103   virtual Void parseDBBPFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
    104 #endif
    10587  virtual Void parsePartSize      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
    10688  virtual Void parsePredMode      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
     
    150132  Void decodeMvdPU        ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPartIdx, RefPicList eRefList );
    151133  Void decodeMVPIdxPU     ( TComDataCU* pcSubCU, UInt uiPartAddr, UInt uiDepth, UInt uiPartIdx, RefPicList eRefList );
    152 #if NH_3D
    153   Void decodeMvsAMVP      ( TComDataCU* pcSubCU, UInt uiPartAddr, UInt uiDepth, UInt uiPartIdx,
    154 RefPicList eRefList );
    155 #endif
    156134  Void    setEntropyDecoder           ( TDecEntropyIf* p );
    157135  Void    setBitstream                ( TComInputBitstream* p ) { m_pcEntropyDecoderIf->setBitstream(p);                    }
     
    177155  Void decodeSplitFlag         ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    178156  Void decodeSkipFlag          ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    179 #if NH_3D_DIS
    180   Void decodeDIS               ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) ;
    181 #endif
    182157  Void decodeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    183158  Void decodeMergeFlag         ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx );
     
    186161  Void decodePartSize          ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    187162
    188 #if NH_3D_ARP
    189   Void decodeARPW              ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    190 #endif
    191 #if NH_3D_IC
    192   Void decodeICFlag            ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    193 #endif
    194163
    195 #if NH_3D_SDC_INTRA || NH_3D_SDC_INTER
    196   Void decodeSDCFlag           ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    197 #endif
    198 #if NH_3D_DBBP
    199   Void decodeDBBPFlag          ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    200 #endif
    201164  Void decodeIPCMInfo          ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    202165
  • branches/HTM-16.0-MV-draft-5/source/Lib/TLibDecoder/TDecGop.cpp

    r1386 r1390  
    122122  }
    123123
    124 #if NH_3D_NBDV
    125   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 #endif
    141 #if NH_3D
    142   pcSlice->setDepthToDisparityLUTs();
    143 #endif
    144124
    145125  m_pcSliceDecoder->decompressSlice( ppcSubstreams, pcPic, m_pcSbacDecoder);
     
    172152    m_pcSAO->PCMLFDisableProcess(pcPic);
    173153  }
    174 #if NH_3D
    175   pcPic->compressMotion(2);
    176 #else
    177154  pcPic->compressMotion();
    178 #endif
    179155  TChar c = (pcSlice->isIntra() ? 'I' : pcSlice->isInterP() ? 'P' : 'B');
    180156  if (!pcSlice->isReferenced())
  • branches/HTM-16.0-MV-draft-5/source/Lib/TLibDecoder/TDecSbac.cpp

    r1386 r1390  
    6767, m_cCUSplitFlagSCModel                      ( 1,             1,                      NUM_SPLIT_FLAG_CTX                   , m_contextModels + m_numContextModels, m_numContextModels)
    6868, m_cCUSkipFlagSCModel                       ( 1,             1,                      NUM_SKIP_FLAG_CTX                    , m_contextModels + m_numContextModels, m_numContextModels)
    69 #if NH_3D_DIS
    70 , 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 #endif
    7369, m_cCUMergeFlagExtSCModel                   ( 1,             1,                      NUM_MERGE_FLAG_EXT_CTX               , m_contextModels + m_numContextModels, m_numContextModels)
    7470, m_cCUMergeIdxExtSCModel                    ( 1,             1,                      NUM_MERGE_IDX_EXT_CTX                , m_contextModels + m_numContextModels, m_numContextModels)
    75 #if NH_3D_ARP
    76 , m_cCUPUARPWSCModel          ( 1,             1,               NUM_ARPW_CTX                  , m_contextModels + m_numContextModels, m_numContextModels)
    77 #endif
    78 #if NH_3D_IC
    79 , m_cCUICFlagSCModel          ( 1,             1,               NUM_IC_FLAG_CTX               , m_contextModels + m_numContextModels, m_numContextModels)
    80 #endif
    8171, m_cCUPartSizeSCModel                       ( 1,             1,                      NUM_PART_SIZE_CTX                    , m_contextModels + m_numContextModels, m_numContextModels)
    8272, m_cCUPredModeSCModel                       ( 1,             1,                      NUM_PRED_MODE_CTX                    , m_contextModels + m_numContextModels, m_numContextModels)
     
    10797, m_ChromaQpAdjIdcSCModel                    ( 1,             1,                      NUM_CHROMA_QP_ADJ_IDC_CTX            , m_contextModels + m_numContextModels, m_numContextModels)
    10898
    109 #if NH_3D_DMM
    110 , 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 #endif
    113 #if NH_3D_DMM || NH_3D_SDC_INTRA || NH_3D_SDC_INTER
    114 , 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 #endif
    117 #if NH_3D_SDC_INTRA
    118 , 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 #endif
    122 #if NH_3D_DBBP
    123 , m_cDBBPFlagSCModel                         ( 1,             1,                     DBBP_NUM_FLAG_CTX                     , m_contextModels + m_numContextModels, m_numContextModels)
    124 #endif
    12599
    126100{
     
    159133  m_cCUSplitFlagSCModel.initBuffer                ( sliceType, qp, (UChar*)INIT_SPLIT_FLAG );
    160134  m_cCUSkipFlagSCModel.initBuffer                 ( sliceType, qp, (UChar*)INIT_SKIP_FLAG );
    161 #if NH_3D_DIS
    162   m_cCUDISFlagSCModel.initBuffer                  ( sliceType, qp, (UChar*)INIT_DIS_FLAG );
    163   m_cCUDISTypeSCModel.initBuffer                  ( sliceType, qp, (UChar*)INIT_DIS_TYPE );
    164 #endif
    165135  m_cCUMergeFlagExtSCModel.initBuffer             ( sliceType, qp, (UChar*)INIT_MERGE_FLAG_EXT );
    166136  m_cCUMergeIdxExtSCModel.initBuffer              ( sliceType, qp, (UChar*)INIT_MERGE_IDX_EXT );
    167 #if NH_3D_ARP
    168   m_cCUPUARPWSCModel.initBuffer          ( sliceType, qp, (UChar*)INIT_ARPW );
    169 #endif
    170 #if NH_3D_IC
    171   m_cCUICFlagSCModel.initBuffer          ( sliceType, qp, (UChar*)INIT_IC_FLAG );
    172 #endif
    173137  m_cCUPartSizeSCModel.initBuffer                 ( sliceType, qp, (UChar*)INIT_PART_SIZE );
    174138  m_cCUPredModeSCModel.initBuffer                 ( sliceType, qp, (UChar*)INIT_PRED_MODE );
     
    198162  m_ChromaQpAdjFlagSCModel.initBuffer             ( sliceType, qp, (UChar*)INIT_CHROMA_QP_ADJ_FLAG );
    199163  m_ChromaQpAdjIdcSCModel.initBuffer              ( sliceType, qp, (UChar*)INIT_CHROMA_QP_ADJ_IDC );
    200 #if NH_3D_DMM
    201   m_cNotDmmFlagSCModel.initBuffer                 ( sliceType, qp, (UChar*)INIT_NOTDMM_FLAG );
    202   m_cDmmModeSCModel.initBuffer                    ( sliceType, qp, (UChar*)INIT_DMM_MODE );
    203 #endif
    204 #if NH_3D_DMM || NH_3D_SDC_INTRA || NH_3D_SDC_INTER
    205   m_cDdcDataSCModel.initBuffer                    ( sliceType, qp, (UChar*)INIT_DDC_DATA );
    206   m_cSDCFlagSCModel.initBuffer                    ( sliceType, qp, (UChar*)INIT_SDC_FLAG );
    207 #endif
    208 #if NH_3D_SDC_INTRA
    209   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 #endif
    213 #if NH_3D_DBBP
    214   m_cDBBPFlagSCModel.initBuffer                   ( sliceType, qp, (UChar*)INIT_DBBP_FLAG );
    215 #endif
    216164
    217165  for (UInt statisticIndex = 0; statisticIndex < RExt__GOLOMB_RICE_ADAPTATION_STATISTICS_SETS ; statisticIndex++)
     
    512460
    513461}
    514 #if NH_3D_DIS
    515 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         else
    546         {
    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 #endif
    559462
    560463
     
    642545
    643546  UInt uiSymbol;
    644 #if NH_3D_QTLPC
    645   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_FCO
    654   if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && bLimQtPredFlag && pcTexture->getReconMark())
    655 #else
    656   if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && bLimQtPredFlag)
    657 #endif
    658   {
    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 #endif
    667547  m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUSplitFlagSCModel.get( 0, 0, pcCU->getCtxSplitFlag( uiAbsPartIdx, uiDepth ) ) RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(ctype) );
    668548#if NH_MV_ENC_DEC_TRAC
     
    671551  DTRACE_CABAC_VL( g_nSymbolCounter++ )
    672552  DTRACE_CABAC_T( "\tSplitFlag\n" )
    673 #endif
    674 #if NH_3D_QTLPC
    675   }
    676   else
    677   {
    678     uiSymbol = 0;
    679   }
    680553#endif
    681554  pcCU->setDepthSubParts( uiDepth + uiSymbol, uiAbsPartIdx );
     
    704577  assert ( pcCU->getSlice()->getSPS()->getLog2DiffMaxMinCodingBlockSize() == log2DiffMaxMinCodingBlockSize);
    705578
    706 #if NH_3D_QTLPC
    707   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_FCO
    720   if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && bLimQtPredFlag && pcTexture->getReconMark())
    721 #else
    722   if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && bLimQtPredFlag )
    723 #endif
    724   {
    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 #endif
    739579
    740580  if ( pcCU->isIntra( uiAbsPartIdx ) )
    741581  {
    742 #if NH_3D_QTLPC
    743     if(bParsePartSize)
    744     {
    745 #endif
    746582    uiSymbol = 1;
    747583    if( uiDepth == log2DiffMaxMinCodingBlockSize )
     
    753589    }
    754590    eMode = uiSymbol ? SIZE_2Nx2N : SIZE_NxN;
    755 #if NH_3D_QTLPC
    756     }
    757 #endif
    758591    UInt uiTrLevel = 0;
    759592    UInt uiWidthInBit  = g_aucConvertToBit[pcCU->getWidth(uiAbsPartIdx)]+2;
     
    771604  else
    772605  {
    773 #if NH_3D_QTLPC
    774     if(bParsePartSize)
    775     {
    776       if (depthDependent==false || uiTexturePart == SIZE_NxN|| uiTexturePart == SIZE_2Nx2N)
    777       {
    778 #endif
    779606    UInt uiMaxNumBits = 2;
    780607
     
    815642      }
    816643    }
    817 #if NH_3D_QTLPC
    818       }
    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       else
    882       {
    883         assert(0);
    884       }
    885 #endif
    886644#if NH_MV_ENC_DEC_TRAC         
    887645      DTRACE_CU("part_mode", eMode )
    888 #endif
    889 #if NH_3D_QTLPC
    890     }
    891646#endif
    892647  }
     
    937692  for (j=0;j<partNum;j++)
    938693  {
    939 #if NH_3D_DMM
    940     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 #endif
    948694    m_pcTDecBinIf->decodeBin( symbol, m_cCUIntraPredSCModel.get( 0, 0, 0) RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(ctype) );
    949695    mpmPred[j] = symbol;
     
    951697      DTRACE_CU("prev_intra_luma_pred_flag", symbol)
    952698#endif
    953 #if NH_3D_DMM
    954     }
    955 #endif
    956699  }
    957700  for (j=0;j<partNum;j++)
    958701  {
    959 #if NH_3D_DMM
    960     if( pcCU->getIntraDir( CHANNEL_TYPE_LUMA, absPartIdx+partOffset*j ) < NUM_INTRA_MODE )
    961     {
    962 #endif
    963702    Int preds[NUM_MOST_PROBABLE_MODES] = {-1, -1, -1};
    964703    pcCU->getIntraDirPredictor(absPartIdx+partOffset*j, preds, COMPONENT_Y);
     
    1003742    }
    1004743    pcCU->setIntraDirSubParts(CHANNEL_TYPE_LUMA, (UChar)intraPredMode, absPartIdx+partOffset*j, depth );
    1005 #if NH_3D_DMM
    1006     }
    1007 #endif
    1008744  }
    1009745}
     
    22692005}
    22702006
    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
    25312010
    25322011
  • branches/HTM-16.0-MV-draft-5/source/Lib/TLibDecoder/TDecSbac.h

    r1321 r1390  
    108108  Void  xReadCoefRemainExGolomb ( UInt &rSymbol, UInt &rParam, const Bool useLimitedPrefixLength, const Int maxLog2TrDynamicRange );
    109109#endif
    110 #if NH_3D_DMM || NH_3D_SDC_INTRA || NH_3D_SDC_INTER
    111   Void  xReadExGolombLevelDdc( UInt& ruiSymbol );
    112   Void  xParseDeltaDC        ( Pel& rValDeltaDC, UInt uiNumSeg );
    113 #endif
    114 #if NH_3D_DMM
    115   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 #endif
    119 #if NH_3D_SDC_INTRA
    120   Void  xParseSDCResidualData     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart );
    121 #endif
    122 #if NH_3D_SDC_INTRA || NH_3D_SDC_INTER
    123   Void  parseSDCFlag         ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    124 #endif
    125 #if NH_3D_DBBP
    126   Void parseDBBPFlag        ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    127 #endif
    128110
    129111private:
     
    134116
    135117  Void parseSkipFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    136 #if NH_3D_DIS
    137   Void parseDIS          ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    138 #endif
    139 #if NH_3D_DMM || NH_3D_SDC_INTRA || NH_3D_SDC_INTER
    140   Void  parseDeltaDC      ( TComDataCU* pcCU, UInt absPartIdx, UInt depth );
    141 #endif
    142118  Void parseCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    143119  Void parseSplitFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    144120  Void parseMergeFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx );
    145121  Void parseMergeIndex    ( TComDataCU* pcCU, UInt& ruiMergeIndex );
    146 #if NH_3D_ARP
    147   Void parseARPW          ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    148 #endif
    149 #if NH_3D_IC
    150   Void parseICFlag        ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    151 #endif
    152122  Void parsePartSize      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    153123  Void parsePredMode      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     
    183153  ContextModel3DBuffer m_cCUSplitFlagSCModel;
    184154  ContextModel3DBuffer m_cCUSkipFlagSCModel;
    185 #if NH_3D_DIS
    186   ContextModel3DBuffer m_cCUDISFlagSCModel;
    187   ContextModel3DBuffer m_cCUDISTypeSCModel;
    188 #endif
    189155  ContextModel3DBuffer m_cCUMergeFlagExtSCModel;
    190156  ContextModel3DBuffer m_cCUMergeIdxExtSCModel;
    191 #if NH_3D_ARP
    192   ContextModel3DBuffer m_cCUPUARPWSCModel;
    193 #endif
    194 #if NH_3D_IC
    195   ContextModel3DBuffer m_cCUICFlagSCModel;
    196 #endif
    197157  ContextModel3DBuffer m_cCUPartSizeSCModel;
    198158  ContextModel3DBuffer m_cCUPredModeSCModel;
     
    226186  ContextModel3DBuffer m_ChromaQpAdjFlagSCModel;
    227187  ContextModel3DBuffer m_ChromaQpAdjIdcSCModel;
    228 #if NH_3D_DMM
    229   ContextModel3DBuffer m_cNotDmmFlagSCModel;
    230   ContextModel3DBuffer m_cDmmModeSCModel;
    231 #endif
    232 #if NH_3D_DMM || NH_3D_SDC_INTRA || NH_3D_SDC_INTER
    233   ContextModel3DBuffer m_cDdcDataSCModel;
    234   ContextModel3DBuffer m_cSDCFlagSCModel;
    235 #endif
    236 #if NH_3D_SDC_INTRA 
    237   ContextModel3DBuffer m_cSDCResidualFlagSCModel;
    238   ContextModel3DBuffer m_cSDCResidualSCModel;
    239   ContextModel3DBuffer m_cDdcFlagSCModel;
    240 #endif
    241 #if NH_3D_DBBP
    242   ContextModel3DBuffer m_cDBBPFlagSCModel;
    243 #endif
    244188
    245189
  • branches/HTM-16.0-MV-draft-5/source/Lib/TLibDecoder/TDecSlice.cpp

    r1386 r1390  
    130130    }
    131131  }
    132 #if  NH_3D_DLT
    133   if( pcSlice->getPPS()->getDLT() != NULL )
    134   {
    135       assert( pcSlice->getSPS()->getBitDepth( CHANNEL_TYPE_LUMA ) == pcSlice->getPPS()->getDLT()->getDepthViewBitDepth() );
    136   }
    137 #endif
    138132
    139133  // for every CTU in the slice segment...
  • branches/HTM-16.0-MV-draft-5/source/Lib/TLibDecoder/TDecTop.cpp

    r1386 r1390  
    4444//! \{
    4545
    46 #if NH_3D
    47 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; // fixed
    61   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 Void
    85 CamParsCollector::init( const TComVPS* vps)
    86 {
    87   assert( !isInitialized() ); // Only one initialization currently supported
    88   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 Void
    133 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 Void
    149 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 Void
    177   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 offsets
    188   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 tables
    196     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 tables
    202     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 Void
    216 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_FCO
    230   if ( pcSlice->getIsDepth())
    231   {
    232     return;
    233   }
    234 #endif
    235 
    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 here
    257   {
    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         else
    268         {
    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         else
    280         {
    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 Void
    292 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 #endif
    33346
    33447
     
    393106  m_viewId                        = 0;
    394107
    395 #if NH_3D
    396   m_viewIndex                     = 0;
    397   m_isDepth                       = false;
    398   m_pcCamParsCollector            = 0;
    399 #endif
    400108
    401109  m_decodingProcess               = CLAUSE_8;
     
    735443#endif
    736444
    737 #if NH_3D
    738     if ( !m_pcCamParsCollector->isInitialized() )
    739     {
    740       m_pcCamParsCollector->init( vps );
    741     }
    742 #endif
    743445    // Initialise the various objects for the new set of settings
    744446    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) );
     
    1063765    m_pcPic->setLayerId( nalu.m_nuhLayerId );
    1064766    m_pcPic->setViewId ( getViewId() );
    1065 #if NH_3D
    1066     m_pcPic->setViewIndex( getViewIndex() );
    1067     m_pcPic->setIsDepth  ( getIsDepth  () );
    1068     pcSlice->setIvPicLists( m_dpb );
    1069 #endif
    1070767#endif
    1071768
     
    1105802        }
    1106803      }
    1107 #if NH_3D_NBDV
    1108       pcSlice->setDefaultRefView();
    1109 #endif
    1110 #if NH_3D_ARP
    1111       pcSlice->setPocsInCurrRPSs();
    1112       pcSlice->setARPStepNum(m_dpb);
    1113 #endif
    1114804#endif
    1115805
     
    1155845      //---------------
    1156846      pcSlice->setRefPOCList();
    1157 #if  NH_3D_TMVP
    1158       if(pcSlice->getLayerId())
    1159       {
    1160         pcSlice->generateAlterRefforTMVP();
    1161       }
    1162 #endif
    1163847    }
    1164848
     
    1193877    }
    1194878
    1195 #if NH_3D
    1196     if ( decProcAnnexI() )
    1197     {
    1198       pcSlice->checkInCompPredRefLayers();
    1199     }
    1200 #endif
    1201879
    1202880    //  Decode a picture
    1203881    m_cGopDecoder.decompressSlice(&(nalu.getBitstream()), m_pcPic);
    1204882
    1205 #if NH_3D
    1206     if( m_pcCamParsCollector )
    1207     {
    1208       m_pcCamParsCollector->setSlice( pcSlice );
    1209     }
    1210 #endif
    1211883
    1212884#if !NH_MV
     
    1240912  sps->setForceDecodeBitDepth(m_forceDecodeBitDepth);
    1241913#endif
    1242 #if NH_3D
    1243   // GT: Please don't add parsing dependency of SPS from VPS here again!!!
    1244 #endif
    1245914  m_cEntropyDecoder.decodeSPS( sps );
    1246915  m_parameterSetManager.storeSPS(sps, naluData);
     
    1252921#if NH_MV
    1253922  pps->setLayerId( getLayerId() );
    1254 #endif
    1255 #if NH_3D_DLT
    1256   // create mapping from depth layer indexes to layer ids
    1257   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   }
    1264923#endif
    1265924  m_cEntropyDecoder.decodePPS( pps );
     
    18061465{
    18071466  setViewId   ( vps->getViewId   ( getLayerId() )      );
    1808 #if NH_3D
    1809   setViewIndex( vps->getViewIndex( getLayerId() )      );
    1810   setIsDepth  ( vps->getDepthId  ( getLayerId() ) == 1 );
    1811 #endif
    18121467
    18131468  if ( !vps->getVpsExtensionFlag() )
  • branches/HTM-16.0-MV-draft-5/source/Lib/TLibDecoder/TDecTop.h

    r1321 r1390  
    6565class TAppDecTop;
    6666#endif
    67 #if NH_3D
    68 class CamParsCollector
    69 {
    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 tables
    107   Double****   m_adBaseViewShiftLUT;       ///< Disparity LUT
    108   Int****      m_aiBaseViewShiftLUT;       ///< Disparity LUT
    109   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_3D
    17467/// decoder class
    17568class TDecTop
     
    240133  static ParameterSetManager  m_parameterSetManager;  // storage for parameter sets
    241134  TComPicLists*           m_dpb;
    242 #if NH_3D
    243   CamParsCollector*       m_pcCamParsCollector;
    244 #endif
    245135
    246136  // Layer identification
    247137  Int                     m_layerId;
    248138  Int                     m_viewId;
    249 #if NH_3D                 
    250   Int                     m_viewIndex;
    251   Bool                    m_isDepth;
    252 #endif
    253139
    254140  // Layer set
     
    349235  Void       setViewId             ( Int viewId )      { m_viewId  = viewId;  }
    350236  Int        getViewId             ( )                 { return m_viewId;     } 
    351 #if NH_3D   
    352   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 #endif
    357237
    358238  // Classes
    359239  Void       setDpb                ( TComPicLists* picLists) { m_dpb = picLists; }
    360 #if NH_3D                                       
    361   Void       setCamParsCollector   ( CamParsCollector* pcCamParsCollector ) { m_pcCamParsCollector = pcCamParsCollector; }
    362 #endif
    363240
    364241  // Slice pilot access
Note: See TracChangeset for help on using the changeset viewer.