Changeset 504 in 3DVCSoftware
- Timestamp:
- 28 Jun 2013, 03:51:50 (11 years ago)
- Location:
- branches/HTM-DEV-0.3-dev2
- Files:
-
- 2 added
- 41 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-DEV-0.3-dev2/source/App/TAppDecoder/TAppDecTop.cpp
r479 r504 95 95 m_pchReconFile = NULL; 96 96 } 97 #if H_3D_FIX 98 if (m_pchScaleOffsetFile) 99 { 100 free (m_pchScaleOffsetFile); 101 m_pchScaleOffsetFile = NULL; 102 } 103 #endif 97 104 } 98 105 -
branches/HTM-DEV-0.3-dev2/source/App/TAppEncoder/TAppEncCfg.cpp
r499 r504 505 505 #endif 506 506 507 #if H_3D_ARP 508 ("AdvMultiviewResPred", m_uiUseAdvResPred, (UInt)1, "Usage of Advanced Residual Prediction" ) 509 #endif 510 #if H_3D_IC 511 ("IlluCompEnable", m_abUseIC, std::vector<Bool>(2, true), "Enable illumination compensation") 512 #endif 507 513 // Coding tools 508 514 ("AMP", m_enableAMP, true, "Enable asymmetric motion partitions") … … 1400 1406 xConfirmPara( m_maxNumMergeCand < 1, "MaxNumMergeCand must be 1 or greater."); 1401 1407 xConfirmPara( m_maxNumMergeCand > 5, "MaxNumMergeCand must be 5 or smaller."); 1408 1409 #if H_3D_ARP 1410 xConfirmPara( ( 0 != m_uiUseAdvResPred ) && ( 1 != m_uiUseAdvResPred ), "UseAdvResPred must be 0 or 1." ); 1411 #endif 1402 1412 1403 1413 #if ADAPTIVE_QP_SELECTION … … 2294 2304 printf("IvMvPred:%d ", m_ivMvPredFlag ); 2295 2305 #endif 2306 #if H_3D_ARP 2307 printf(" ARP:%d ", m_uiUseAdvResPred ); 2308 #endif 2309 #if H_3D_IC 2310 printf( "IlluCompEnable: %d %d ", m_abUseIC[0] ? 1 : 0, m_abUseIC[1] ? 1 : 0 ); 2311 #endif 2296 2312 #if H_3D_NBDV_REF 2297 2313 printf("DepthRefinement:%d ", m_depthRefinementFlag ); -
branches/HTM-DEV-0.3-dev2/source/App/TAppEncoder/TAppEncCfg.h
r486 r504 88 88 #if H_3D_IV_MERGE 89 89 Bool m_ivMvPredFlag; ///< Interview motion vector prediction 90 #endif 91 #if H_3D_ARP /// < flag and number of weighting factors in ARP 92 UInt m_uiUseAdvResPred; 93 UInt m_uiARPStepNum; 94 #endif 95 #if H_3D_IC 96 vector<Bool> m_abUseIC; ///< flag for using illumination compensation for inter-view prediction 90 97 #endif 91 98 #if H_3D_NBDV_REF -
branches/HTM-DEV-0.3-dev2/source/App/TAppEncoder/TAppEncTop.cpp
r486 r504 125 125 #endif 126 126 m_ivPicLists.setVPS ( &vps ); 127 #if H_3D_ARP 128 for(Int i = 0; i < m_numberOfLayers; i++) 129 { 130 Bool isDepth = vps.getDepthId( i ); 131 vps.setUseAdvRP ( i, ( isDepth || 0==i ) ? 0 : m_uiUseAdvResPred ); 132 vps.setARPStepNum ( i, ( isDepth || 0==i ) ? 1 : H_3D_ARP_WFNR ); 133 } 134 #endif 127 135 #endif 128 136 … … 169 177 m_cTEncTop.setDWeight ( isDepth ? m_iDWeight : 0 ); 170 178 #endif // H_3D_VSO 179 #if H_3D_ARP 180 //====== Advanced Inter-view Residual Prediction ========= 181 m_cTEncTop.setUseAdvRP ( ( isDepth || 0==layer ) ? 0 : m_uiUseAdvResPred ); 182 m_cTEncTop.setARPStepNum ( ( isDepth || 0==layer ) ? 1 : H_3D_ARP_WFNR ); 183 #endif 184 #if H_3D_IC 185 m_cTEncTop.setUseIC ( vps.getViewIndex( layer ) == 0 ? false : m_abUseIC[isDepth ? 1 : 0] ); 186 #endif 171 187 #endif // H_3D 172 188 -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/ContextTables.h
r324 r504 95 95 #define NUM_TRANSFORMSKIP_FLAG_CTX 1 ///< number of context models for transform skipping 96 96 #define NUM_CU_TRANSQUANT_BYPASS_FLAG_CTX 1 97 98 #if H_3D_ARP 99 #define NUM_ARPW_CTX 4 ///< number of context models for weighting factor index used by advanced residual prediction 100 #endif 101 102 #if H_3D_IC 103 #define NUM_IC_FLAG_CTX 3 ///< number of context models for illumination compensation flag 104 #endif 105 97 106 #define CNU 154 ///< dummy initialization value for unused context models 'Context model Not Used' 98 107 … … 334 343 { 139, 139}, 335 344 }; 345 346 #if H_3D_ARP 347 static const UChar 348 INIT_ARPW[3][NUM_ARPW_CTX] = 349 { 350 { 154, 154, 154, 154 }, 351 { 154, 154, 154, 154 }, 352 { 154, 154, 154, 154 }, 353 }; 354 #endif 355 356 #if H_3D_IC 357 static const UChar 358 INIT_IC_FLAG[3][NUM_IC_FLAG_CTX] = 359 { 360 { CNU, CNU, CNU, }, 361 { 197, 185, 201, }, 362 { 197, 185, 201, }, 363 }; 364 #endif 365 336 366 //! \} 337 367 -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComDataCU.cpp
r499 r504 115 115 m_pDvInfo = NULL; 116 116 #endif 117 118 #if H_3D_ARP 119 m_puhARPW = NULL; 120 #endif 121 122 #if H_3D_IC 123 m_pbICFlag = NULL; 124 #endif 117 125 } 118 126 … … 208 216 m_acCUMvField[1].create( uiNumPartition ); 209 217 218 #if H_3D_ARP 219 m_puhARPW = new UChar[ uiNumPartition]; 220 #endif 221 #if H_3D_IC 222 m_pbICFlag = (Bool* )xMalloc(Bool, uiNumPartition); 223 #endif 210 224 } 211 225 else … … 293 307 if ( m_pDvInfo ) { xFree(m_pDvInfo); m_pDvInfo = NULL; } 294 308 #endif 309 310 #if H_3D_ARP 311 if ( m_puhARPW ) { delete[] m_puhARPW; m_puhARPW = NULL; } 312 #endif 313 #if H_3D_IC 314 if ( m_pbICFlag ) { xFree(m_pbICFlag); m_pbICFlag = NULL; } 315 #endif 295 316 m_acCUMvField[0].destroy(); 296 317 m_acCUMvField[1].destroy(); … … 402 423 m_CUTransquantBypass[ui] = pcFrom->getCUTransquantBypass(ui); 403 424 m_puhDepth[ui] = pcFrom->getDepth(ui); 425 #if H_3D_ARP 426 m_puhARPW [ui] = pcFrom->getARPW( ui ); 427 #endif 428 #if H_3D_IC 429 m_pbICFlag[ui] = pcFrom->m_pbICFlag[ui]; 430 #endif 404 431 m_puhWidth [ui] = pcFrom->getWidth(ui); 405 432 m_puhHeight [ui] = pcFrom->getHeight(ui); … … 455 482 memset( m_puhCbf[2] + firstElement, 0, numElements * sizeof( *m_puhCbf[2] ) ); 456 483 memset( m_pbIPCMFlag + firstElement, false, numElements * sizeof( *m_pbIPCMFlag ) ); 484 #if H_3D_ARP 485 memset( m_puhARPW + firstElement, 0, numElements * sizeof( UChar ) ); 486 #endif 487 #if H_3D_IC 488 memset( m_pbICFlag + firstElement, false, numElements * sizeof( *m_pbICFlag ) ); 489 #endif 457 490 } 458 491 … … 590 623 m_puhCbf[1][ui] = 0; 591 624 m_puhCbf[2][ui] = 0; 625 #if H_3D_ARP 626 m_puhARPW[ui] = 0; 627 #endif 628 #if H_3D_IC 629 m_pbICFlag[ui] = false; 630 #endif 592 631 } 593 632 } … … 663 702 m_pDvInfo->bDV = false; 664 703 #endif 704 #if H_3D_ARP 705 memset( m_puhARPW, 0, iSizeInUchar ); 706 #endif 665 707 UChar uhWidth = g_uiMaxCUWidth >> uiDepth; 666 708 UChar uhHeight = g_uiMaxCUHeight >> uiDepth; … … 668 710 memset( m_puhHeight, uhHeight, iSizeInUchar ); 669 711 memset( m_pbIPCMFlag, 0, iSizeInBool ); 712 #if H_3D_IC 713 memset( m_pbICFlag, 0, iSizeInBool ); 714 #endif 670 715 for (UInt ui = 0; ui < m_uiNumPartition; ui++) 671 716 { … … 706 751 m_puhCbf[2][ui]=pcCU->m_puhCbf[2][uiPartOffset+ui]; 707 752 753 #if H_3D_ARP 754 m_puhARPW [ui] = pcCU->getARPW( uiPartOffset+ui ); 755 #endif 756 #if H_3D_IC 757 m_pbICFlag [ui] = pcCU->m_pbICFlag[uiPartOffset+ui]; 758 #endif 708 759 } 709 760 } … … 816 867 m_puhMergeIndex = pcCU->getMergeIndex() + uiPart; 817 868 869 #if H_3D_ARP 870 m_puhARPW = pcCU->getARPW() + uiPart; 871 #endif 872 #if H_3D_IC 873 m_pbICFlag = pcCU->getICFlag() + uiPart; 874 #endif 875 818 876 m_puhLumaIntraDir = pcCU->getLumaIntraDir() + uiPart; 819 877 m_puhChromaIntraDir = pcCU->getChromaIntraDir() + uiPart; … … 932 990 m_apiMVPNum[eRefPicList] = pcCU->getMVPNum(eRefPicList) + uiAbsPartIdx; 933 991 992 #if H_3D_ARP 993 m_puhARPW = pcCU->getARPW() + uiAbsPartIdx; 994 #endif 995 934 996 m_acCUMvField[ eRefPicList ].linkToWithOffset( pcCU->getCUMvField(eRefPicList), uiAbsPartIdx ); 935 997 … … 938 1000 #if H_3D_NBDV 939 1001 } 1002 #endif 1003 #if H_3D_IC 1004 m_pbICFlag = pcCU->getICFlag() + uiAbsPartIdx; 940 1005 #endif 941 1006 } … … 1019 1084 memcpy( m_sliceStartCU + uiOffset, pcCU->m_sliceStartCU, sizeof( UInt ) * uiNumPartition ); 1020 1085 memcpy( m_sliceSegmentStartCU + uiOffset, pcCU->m_sliceSegmentStartCU, sizeof( UInt ) * uiNumPartition ); 1086 1087 #if H_3D_ARP 1088 memcpy( m_puhARPW + uiOffset, pcCU->getARPW(), iSizeInUchar ); 1089 #endif 1090 #if H_3D_IC 1091 memcpy( m_pbICFlag + uiOffset, pcCU->getICFlag(), iSizeInBool ); 1092 #endif 1021 1093 } 1022 1094 … … 1094 1166 memcpy( rpcCU->m_sliceStartCU + m_uiAbsIdxInLCU, m_sliceStartCU, sizeof( UInt ) * m_uiNumPartition ); 1095 1167 memcpy( rpcCU->m_sliceSegmentStartCU + m_uiAbsIdxInLCU, m_sliceSegmentStartCU, sizeof( UInt ) * m_uiNumPartition ); 1168 1169 #if H_3D_ARP 1170 memcpy( rpcCU->getARPW() + m_uiAbsIdxInLCU, m_puhARPW, iSizeInUchar ); 1171 #endif 1172 #if H_3D_IC 1173 memcpy( rpcCU->getICFlag() + m_uiAbsIdxInLCU, m_pbICFlag, iSizeInBool ); 1174 #endif 1096 1175 } 1097 1176 … … 1166 1245 memcpy( rpcCU->m_sliceStartCU + uiPartOffset, m_sliceStartCU, sizeof( UInt ) * uiQNumPart ); 1167 1246 memcpy( rpcCU->m_sliceSegmentStartCU + uiPartOffset, m_sliceSegmentStartCU, sizeof( UInt ) * uiQNumPart ); 1247 1248 #if H_3D_ARP 1249 memcpy( rpcCU->getARPW() + uiPartOffset, m_puhARPW, iSizeInUchar ); 1250 #endif 1251 #if H_3D_IC 1252 memcpy( rpcCU->getICFlag() + uiPartOffset, m_pbICFlag, iSizeInBool ); 1253 #endif 1168 1254 } 1169 1255 … … 1808 1894 } 1809 1895 1896 #if H_3D_ARP 1897 UInt TComDataCU::getCTXARPWFlag( UInt uiAbsPartIdx ) 1898 { 1899 TComDataCU* pcTempCU; 1900 UInt uiTempPartIdx; 1901 UInt uiCtx = 0; 1902 1903 pcTempCU = getPULeft( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx ); 1904 uiCtx = ( pcTempCU ) ? ((pcTempCU->getARPW( uiTempPartIdx )==0)?0:1) : 0; 1905 1906 pcTempCU = getPUAbove( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx ); 1907 uiCtx += ( pcTempCU ) ? ((pcTempCU->getARPW( uiTempPartIdx )==0)?0:1): 0; 1908 1909 return uiCtx; 1910 } 1911 #endif 1912 1913 #if H_3D_IC 1914 UInt TComDataCU::getCtxICFlag( UInt uiAbsPartIdx ) 1915 { 1916 UInt uiCtx = 0; 1917 1918 return uiCtx; 1919 } 1920 #endif 1921 1810 1922 UInt TComDataCU::getCtxInterDir( UInt uiAbsPartIdx ) 1811 1923 { … … 2106 2218 } 2107 2219 2220 #if H_3D_IC 2221 Void TComDataCU::getPartIndexAndSize( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight, UInt uiAbsPartIdx, Bool bLCU) 2222 { 2223 UInt uiNumPartition = bLCU ? (getWidth(uiAbsPartIdx)*getHeight(uiAbsPartIdx) >> 4) : m_uiNumPartition; 2224 UInt uiTmpAbsPartIdx = bLCU ? uiAbsPartIdx : 0; 2225 2226 switch ( m_pePartSize[uiTmpAbsPartIdx] ) 2227 { 2228 case SIZE_2NxN: 2229 riWidth = getWidth( uiTmpAbsPartIdx ); riHeight = getHeight( uiTmpAbsPartIdx ) >> 1; ruiPartAddr = ( uiPartIdx == 0 )? 0 : uiNumPartition >> 1; 2230 break; 2231 case SIZE_Nx2N: 2232 riWidth = getWidth( uiTmpAbsPartIdx ) >> 1; riHeight = getHeight( uiTmpAbsPartIdx ); ruiPartAddr = ( uiPartIdx == 0 )? 0 : uiNumPartition >> 2; 2233 break; 2234 case SIZE_NxN: 2235 riWidth = getWidth( uiTmpAbsPartIdx ) >> 1; riHeight = getHeight( uiTmpAbsPartIdx ) >> 1; ruiPartAddr = ( uiNumPartition >> 2 ) * uiPartIdx; 2236 break; 2237 case SIZE_2NxnU: 2238 riWidth = getWidth( uiTmpAbsPartIdx ); 2239 riHeight = ( uiPartIdx == 0 ) ? getHeight( uiTmpAbsPartIdx ) >> 2 : ( getHeight( uiTmpAbsPartIdx ) >> 2 ) + ( getHeight( uiTmpAbsPartIdx ) >> 1 ); 2240 ruiPartAddr = ( uiPartIdx == 0 ) ? 0 : uiNumPartition >> 3; 2241 break; 2242 case SIZE_2NxnD: 2243 riWidth = getWidth( uiTmpAbsPartIdx ); 2244 riHeight = ( uiPartIdx == 0 ) ? ( getHeight( uiTmpAbsPartIdx ) >> 2 ) + ( getHeight( uiTmpAbsPartIdx ) >> 1 ) : getHeight( uiTmpAbsPartIdx ) >> 2; 2245 ruiPartAddr = ( uiPartIdx == 0 ) ? 0 : (uiNumPartition >> 1) + (uiNumPartition >> 3); 2246 break; 2247 case SIZE_nLx2N: 2248 riWidth = ( uiPartIdx == 0 ) ? getWidth( uiTmpAbsPartIdx ) >> 2 : ( getWidth( uiTmpAbsPartIdx ) >> 2 ) + ( getWidth( uiTmpAbsPartIdx ) >> 1 ); 2249 riHeight = getHeight( uiTmpAbsPartIdx ); 2250 ruiPartAddr = ( uiPartIdx == 0 ) ? 0 : uiNumPartition >> 4; 2251 break; 2252 case SIZE_nRx2N: 2253 riWidth = ( uiPartIdx == 0 ) ? ( getWidth( uiTmpAbsPartIdx ) >> 2 ) + ( getWidth( uiTmpAbsPartIdx ) >> 1 ) : getWidth( uiTmpAbsPartIdx ) >> 2; 2254 riHeight = getHeight( uiTmpAbsPartIdx ); 2255 ruiPartAddr = ( uiPartIdx == 0 ) ? 0 : (uiNumPartition >> 2) + (uiNumPartition >> 4); 2256 break; 2257 default: 2258 assert ( m_pePartSize[uiTmpAbsPartIdx] == SIZE_2Nx2N ); 2259 riWidth = getWidth( uiTmpAbsPartIdx ); riHeight = getHeight( uiTmpAbsPartIdx ); ruiPartAddr = 0; 2260 break; 2261 } 2262 } 2263 #else 2108 2264 Void TComDataCU::getPartIndexAndSize( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight ) 2109 2265 { … … 2145 2301 } 2146 2302 } 2303 #endif 2147 2304 2148 2305 … … 2489 2646 TComMv cMvPred = pcMvFieldNeighbours[iCount<<1].getMv(); 2490 2647 2491 //Notes from MTK: shoud be aligned with " full-pel mv accuracy for depth maps", currently not supported 2492 //const TComMv cAdd( 1 << ( 2 - 1 ), 1 << ( 2 - 1 ) ); 2493 //cMvPred+=cAdd; 2494 //cMvPred>>=2; 2495 //clipMv(cMvPred); 2648 #if H_3D_IC 2649 const TComMv cAdd( 1 << ( 2 - 1 ), 1 << ( 2 - 1 ) ); 2650 cMvPred+=cAdd; 2651 cMvPred>>=2; 2652 clipMv(cMvPred); 2653 #endif 2496 2654 //pcMvFieldNeighbours[iCount<<1].setMvField(cMvPred,pcMvFieldNeighbours[iCount<<1].getRefIdx()); 2497 2655 #if H_3D_CLEANUPS //Notes from QC: for BVSP coded blocks, the reference index shall not be equal to -1 due to the adoption of JCT3V-D0191 … … 2519 2677 TComMv cMvPred = pcMvFieldNeighbours[(iCount<<1)+1].getMv(); 2520 2678 2521 //Notes from MTK: shoud be aligned with " full-pel mv accuracy for depth maps", currently not supported 2522 //const TComMv cAdd( 1 << ( 2 - 1 ), 1 << ( 2 - 1 ) ); 2523 //cMvPred+=cAdd; 2524 //cMvPred>>=2; 2525 //clipMv(cMvPred); 2679 #if H_3D_IC 2680 const TComMv cAdd( 1 << ( 2 - 1 ), 1 << ( 2 - 1 ) ); 2681 cMvPred+=cAdd; 2682 cMvPred>>=2; 2683 clipMv(cMvPred); 2684 #endif 2526 2685 //pcMvFieldNeighbours[(iCount<<1)+1].setMvField(cMvPred,pcMvFieldNeighbours[(iCount<<1)+1].getRefIdx()); 2527 2686 #if H_3D_CLEANUPS … … 2547 2706 { 2548 2707 #endif 2549 #if H_3D_ IDV2708 #if H_3D_NBDV 2550 2709 pcMvFieldNeighbours[iCount<<1 ].getMv().setIDVFlag (false); 2551 2710 pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false); … … 2667 2826 bLeftAvai = true; 2668 2827 iPosLeftAbove[0] = iCount; 2669 #if H_3D_ IDV2828 #if H_3D_NBDV 2670 2829 pcMvFieldNeighbours[iCount<<1 ].getMv().setIDVFlag (false); 2671 2830 pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false); … … 2731 2890 { 2732 2891 iPosLeftAbove[1] = iCount; 2733 #if H_3D_ IDV2892 #if H_3D_NBDV 2734 2893 pcMvFieldNeighbours[iCount<<1 ].getMv().setIDVFlag (false); 2735 2894 pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false); … … 2773 2932 pcCUAboveRight->getMvField( pcCUAboveRight, uiAboveRightPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 2774 2933 } 2775 #if H_3D_ IDV2934 #if H_3D_NBDV 2776 2935 pcMvFieldNeighbours[iCount<<1 ].getMv().setIDVFlag (false); 2777 2936 pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false); … … 2827 2986 if(!bRemoveSpa) 2828 2987 { 2829 #if H_3D_ IDV2988 #if H_3D_NBDV 2830 2989 pcMvFieldNeighbours[iCount<<1 ].getMv().setIDVFlag (false); 2831 2990 pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false); … … 2862 3021 pcCULeftBottom->getMvField( pcCULeftBottom, uiLeftBottomPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 2863 3022 } 2864 #if H_3D_ IDV3023 #if H_3D_NBDV 2865 3024 pcMvFieldNeighbours[iCount<<1 ].getMv().setIDVFlag (false); 2866 3025 pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false); … … 2898 3057 pcCUAboveLeft->getMvField( pcCUAboveLeft, uiAboveLeftPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 2899 3058 } 2900 #if H_3D_ IDV3059 #if H_3D_NBDV 2901 3060 pcMvFieldNeighbours[iCount<<1 ].getMv().setIDVFlag (false); 2902 3061 pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false); … … 3001 3160 puhInterDirNeighbours[uiArrayAddr] = dir; 3002 3161 abCandIsInter[uiArrayAddr] = true; 3003 #if H_3D_ IDV3162 #if H_3D_NBDV 3004 3163 pcMvFieldNeighbours[iCount<<1 ].getMv().setIDVFlag (false); 3005 3164 pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false); … … 3365 3524 { 3366 3525 Int iMvShift = 2; 3526 #if H_3D_IC 3527 if( getSlice()->getIsDepth() ) 3528 iMvShift = 0; 3529 #endif 3367 3530 Int iOffset = 8; 3368 3531 Int iHorMax = ( m_pcSlice->getSPS()->getPicWidthInLumaSamples() + iOffset - m_uiCUPelX - 1 ) << iMvShift; … … 4786 4949 4787 4950 Bool abPdmAvailable[4] = {false, false, false, false}; 4788 #if H_3D_ IDV4951 #if H_3D_NBDV 4789 4952 for( Int i = 0; i < 4; i++) 4790 4953 { … … 4816 4979 abPdmAvailable[ uiCurrRefListId ] = true; 4817 4980 TComMv cMv(cBaseMvField.getHor(), cBaseMvField.getVer()); 4818 #if H_3D_ IDV4981 #if H_3D_NBDV 4819 4982 cMv.setIDVFlag (true); 4820 4983 cMv.setIDVHor (cDv.getHor()); … … 4859 5022 } 4860 5023 #endif 5024 #if H_3D_ARP 5025 Void TComDataCU::setARPWSubParts ( UChar w, UInt uiAbsPartIdx, UInt uiDepth ) 5026 { 5027 assert( sizeof( *m_puhARPW) == 1 ); 5028 memset( m_puhARPW + uiAbsPartIdx, w, m_pcPic->getNumPartInCU() >> ( 2 * uiDepth ) ); 5029 } 5030 #endif 5031 5032 #if H_3D_IC 5033 Void TComDataCU::setICFlagSubParts( Bool bICFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) 5034 { 5035 memset( m_pbICFlag + uiAbsPartIdx, bICFlag, (m_pcPic->getNumPartInCU() >> ( 2 * uiDepth ))*sizeof(Bool) ); 5036 } 5037 5038 Bool TComDataCU::isICFlagRequired( UInt uiAbsPartIdx ) 5039 { 5040 UInt uiPartAddr; 5041 UInt iNumbPart; 5042 5043 if( !( getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) ) 5044 { 5045 return false; 5046 } 5047 5048 if( getSlice()->getIcSkipParseFlag() ) 5049 { 5050 if( getMergeFlag( uiAbsPartIdx ) && getMergeIndex( uiAbsPartIdx ) == 0 ) 5051 { 5052 return false; 5053 } 5054 } 5055 5056 if( getMergeFlag( uiAbsPartIdx ) ) 5057 { 5058 return true; 5059 } 5060 5061 5062 Int iWidth, iHeight; 5063 5064 iNumbPart = ( getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ? 1 : ( getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ? 4 : 2 ) ); 5065 5066 for(UInt i = 0; i < iNumbPart; i++) 5067 { 5068 getPartIndexAndSize( i, uiPartAddr, iWidth, iHeight, uiAbsPartIdx, true ); 5069 uiPartAddr += uiAbsPartIdx; 5070 5071 for(UInt uiRefIdx = 0; uiRefIdx < 2; uiRefIdx++) 5072 { 5073 RefPicList eRefList = uiRefIdx ? REF_PIC_LIST_1 : REF_PIC_LIST_0; 5074 Int iBestRefIdx = getCUMvField(eRefList)->getRefIdx(uiPartAddr); 5075 5076 if( ( getInterDir( uiPartAddr ) & ( uiRefIdx+1 ) ) && iBestRefIdx >= 0 && getSlice()->getViewIndex() != getSlice()->getRefPic( eRefList, iBestRefIdx )->getViewIndex() ) 5077 { 5078 return true; 5079 } 5080 } 5081 } 5082 5083 return false; 5084 } 5085 #endif 4861 5086 //! \} -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComDataCU.h
r499 r504 49 49 #include "TComPattern.h" 50 50 51 #if H_3D_ARP 52 #include "TComYuv.h" 53 #endif 54 51 55 #include <algorithm> 52 56 #include <vector> … … 190 194 DisInfo* m_pDvInfo; 191 195 #endif 196 #if H_3D_ARP 197 UChar* m_puhARPW; 198 #endif 199 #if H_3D_IC 200 Bool* m_pbICFlag; ///< array of IC flags 201 #endif 192 202 // ------------------------------------------------------------------------------------------------------------------- 193 203 // misc. variables … … 225 235 226 236 /// compute scaling factor from POC difference 237 #if !H_3D_ARP 227 238 Int xGetDistScaleFactor ( Int iCurrPOC, Int iCurrRefPOC, Int iColPOC, Int iColRefPOC ); 228 239 #endif 240 229 241 Void xDeriveCenterIdx( UInt uiPartIdx, UInt& ruiPartIdxCenter ); 230 242 … … 236 248 // create / destroy / initialize / copy 237 249 // ------------------------------------------------------------------------------------------------------------------- 238 250 #if H_3D_ARP 251 Int xGetDistScaleFactor ( Int iCurrPOC, Int iCurrRefPOC, Int iColPOC, Int iColRefPOC ); 252 #endif 239 253 Void create ( UInt uiNumPartition, UInt uiWidth, UInt uiHeight, Bool bDecSubCu, Int unitSize 240 254 #if ADAPTIVE_QP_SELECTION … … 446 460 Bool getInterViewMergeCands ( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* availableMcDc ); 447 461 #endif 462 #if H_3D_ARP 463 UChar* getARPW () { return m_puhARPW; } 464 UChar getARPW ( UInt uiIdx ) { return m_puhARPW[uiIdx]; } 465 Void setARPW ( UInt uiIdx, UChar w ) { m_puhARPW[uiIdx] = w; } 466 Void setARPWSubParts ( UChar w, UInt uiAbsPartIdx, UInt uiDepth ); 467 Double getARPWFactor ( UInt uiIdx ); 468 #endif 469 #if H_3D_IC 470 Bool* getICFlag () { return m_pbICFlag; } 471 Bool getICFlag ( UInt uiIdx ) { return m_pbICFlag[uiIdx]; } 472 Void setICFlag ( UInt uiIdx, Bool uh ) { m_pbICFlag[uiIdx] = uh; } 473 Void setICFlagSubParts ( Bool bICFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); 474 Bool isICFlagRequired ( UInt uiAbsPartIdx ); 475 Void getPartIndexAndSize( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight, UInt uiAbsPartIdx = 0, Bool bLCU = false); 476 #else 448 477 // ------------------------------------------------------------------------------------------------------------------- 449 478 // member functions for accessing partition information … … 451 480 452 481 Void getPartIndexAndSize ( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight ); 482 #endif 453 483 UChar getNumPartInter (); 454 484 Bool isFirstAbsZorderIdxInDepth (UInt uiAbsPartIdx, UInt uiDepth); … … 551 581 UInt getCtxInterDir ( UInt uiAbsPartIdx ); 552 582 583 #if H_3D_ARP 584 UInt getCTXARPWFlag ( UInt uiAbsPartIdx ); 585 #endif 586 #if H_3D_IC 587 UInt getCtxICFlag ( UInt uiAbsPartIdx ); 588 #endif 553 589 UInt getSliceStartCU ( UInt pos ) { return m_sliceStartCU[pos-m_uiAbsIdxInLCU]; } 554 590 UInt getSliceSegmentStartCU ( UInt pos ) { return m_sliceSegmentStartCU[pos-m_uiAbsIdxInLCU]; } -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComInterpolationFilter.cpp
r324 r504 73 73 }; 74 74 75 #if H_3D_ARP 76 const Short TComInterpolationFilter::m_lumaFilterARP[4][NTAPS_LUMA_ARP] = 77 { 78 {64, 0}, 79 {48, 16}, 80 {32, 32}, 81 {16, 48} 82 }; 83 const Short TComInterpolationFilter::m_chromaFilterARP[8][NTAPS_CHROMA_ARP] = 84 { 85 {64, 0}, 86 {56, 8}, 87 {48, 16}, 88 {40, 24}, 89 {32, 32}, 90 {24, 40}, 91 {16, 48}, 92 {8, 56} 93 }; 94 #endif 95 75 96 // ==================================================================================================================== 76 97 // Private member functions … … 325 346 * \param isLast Flag indicating whether it is the last filtering operation 326 347 */ 327 Void TComInterpolationFilter::filterHorLuma(Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isLast ) 348 Void TComInterpolationFilter::filterHorLuma(Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isLast 349 #if H_3D_ARP 350 , Bool filterType 351 #endif 352 ) 328 353 { 329 354 assert(frac >= 0 && frac < 4); … … 335 360 else 336 361 { 362 #if H_3D_ARP 363 if(filterType) 364 { 365 filterHor<NTAPS_LUMA_ARP>(g_bitDepthY, src, srcStride, dst, dstStride, width, height, isLast, m_lumaFilterARP[frac]); 366 } 367 else 368 { 369 #endif 337 370 filterHor<NTAPS_LUMA>(g_bitDepthY, src, srcStride, dst, dstStride, width, height, isLast, m_lumaFilter[frac]); 371 #if H_3D_ARP 372 } 373 #endif 338 374 } 339 375 } … … 352 388 * \param isLast Flag indicating whether it is the last filtering operation 353 389 */ 354 Void TComInterpolationFilter::filterVerLuma(Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isFirst, Bool isLast ) 390 Void TComInterpolationFilter::filterVerLuma(Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isFirst, Bool isLast 391 #if H_3D_ARP 392 , Bool filterType 393 #endif 394 ) 355 395 { 356 396 assert(frac >= 0 && frac < 4); … … 362 402 else 363 403 { 404 #if H_3D_ARP 405 if(filterType) 406 { 407 filterVer<NTAPS_LUMA_ARP>(g_bitDepthY, src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_lumaFilterARP[frac]); 408 } 409 else 410 { 411 #endif 364 412 filterVer<NTAPS_LUMA>(g_bitDepthY, src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_lumaFilter[frac]); 413 #if H_3D_ARP 414 } 415 #endif 365 416 } 366 417 } … … 378 429 * \param isLast Flag indicating whether it is the last filtering operation 379 430 */ 380 Void TComInterpolationFilter::filterHorChroma(Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isLast ) 431 Void TComInterpolationFilter::filterHorChroma(Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isLast 432 #if H_3D_ARP 433 , Bool filterType 434 #endif 435 ) 381 436 { 382 437 assert(frac >= 0 && frac < 8); … … 388 443 else 389 444 { 445 #if H_3D_ARP 446 if(filterType) 447 { 448 filterHor<NTAPS_CHROMA_ARP>(g_bitDepthC, src, srcStride, dst, dstStride, width, height, isLast, m_chromaFilterARP[frac]); 449 } 450 else 451 { 452 #endif 390 453 filterHor<NTAPS_CHROMA>(g_bitDepthC, src, srcStride, dst, dstStride, width, height, isLast, m_chromaFilter[frac]); 454 #if H_3D_ARP 455 } 456 #endif 391 457 } 392 458 } … … 405 471 * \param isLast Flag indicating whether it is the last filtering operation 406 472 */ 407 Void TComInterpolationFilter::filterVerChroma(Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isFirst, Bool isLast ) 473 Void TComInterpolationFilter::filterVerChroma(Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isFirst, Bool isLast 474 #if H_3D_ARP 475 , Bool filterType 476 #endif 477 ) 408 478 { 409 479 assert(frac >= 0 && frac < 8); … … 415 485 else 416 486 { 487 #if H_3D_ARP 488 if(filterType) 489 { 490 filterVer<NTAPS_CHROMA_ARP>(g_bitDepthC, src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_chromaFilterARP[frac]); 491 } 492 else 493 { 494 #endif 417 495 filterVer<NTAPS_CHROMA>(g_bitDepthC, src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_chromaFilter[frac]); 496 #if H_3D_ARP 497 } 498 #endif 418 499 } 419 500 } -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComInterpolationFilter.h
r324 r504 45 45 //! \{ 46 46 47 #if H_3D_ARP 48 #define NTAPS_LUMA_ARP 2 ///< Number of taps for luma 49 #define NTAPS_CHROMA_ARP 2 ///< Number of taps for chroma 50 #endif 51 47 52 #define NTAPS_LUMA 8 ///< Number of taps for luma 48 53 #define NTAPS_CHROMA 4 ///< Number of taps for chroma … … 58 63 static const Short m_lumaFilter[4][NTAPS_LUMA]; ///< Luma filter taps 59 64 static const Short m_chromaFilter[8][NTAPS_CHROMA]; ///< Chroma filter taps 60 65 #if H_3D_ARP 66 static const Short m_lumaFilterARP [4][NTAPS_LUMA_ARP]; ///< Luma filter taps for ARP 67 static const Short m_chromaFilterARP[8][NTAPS_CHROMA_ARP]; ///< Chroma filter taps for ARP 68 #endif 61 69 static Void filterCopy(Int bitDepth, const Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Bool isFirst, Bool isLast); 62 70 … … 73 81 ~TComInterpolationFilter() {} 74 82 75 Void filterHorLuma (Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isLast ); 76 Void filterVerLuma (Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isFirst, Bool isLast ); 77 Void filterHorChroma(Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isLast ); 78 Void filterVerChroma(Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isFirst, Bool isLast ); 83 Void filterHorLuma (Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isLast 84 #if H_3D_ARP 85 , Bool filterType = false 86 #endif 87 ); 88 Void filterVerLuma (Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isFirst, Bool isLast 89 #if H_3D_ARP 90 , Bool filterType = false 91 #endif 92 ); 93 Void filterHorChroma(Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isLast 94 #if H_3D_ARP 95 , Bool filterType = false 96 #endif 97 ); 98 Void filterVerChroma(Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isFirst, Bool isLast 99 #if H_3D_ARP 100 , Bool filterType = false 101 #endif 102 ); 79 103 }; 80 104 -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComPattern.h
r324 r504 99 99 TComPatternParam m_cPatternCb; 100 100 TComPatternParam m_cPatternCr; 101 101 #if H_3D_IC 102 Bool m_bICFlag; 103 #endif 102 104 static const UChar m_aucIntraFilter[5]; 103 105 … … 109 111 Int getROIYHeight() { return m_cPatternY.m_iROIHeight; } 110 112 Int getPatternLStride() { return m_cPatternY.m_iPatternStride; } 113 114 #if H_3D_IC 115 Bool getICFlag() { return m_bICFlag; } 116 Void setICFlag( Bool bICFlag ) { m_bICFlag = bICFlag; } 117 #endif 111 118 112 119 // access functions of ADI buffers -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComPic.cpp
r456 r504 556 556 return getPicYuv( layerIdInNuh, poc, recon ); 557 557 } 558 #if H_3D_ARP 559 TComList<TComPic*>* TComPicLists::getPicList( Int layerIdInNuh ) 560 { 561 TComList<TComList<TComPic*>*>::iterator itL = m_lists.begin(); 562 Int iLayer = 0; 563 564 assert( layerIdInNuh < m_lists.size() ); 565 566 while( iLayer != layerIdInNuh ) 567 { 568 itL++; 569 iLayer++; 570 } 571 572 return *itL; 573 } 574 #endif 558 575 #endif // H_3D 559 576 #endif // H_MV -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComPic.h
r479 r504 234 234 Void push_back( TComList<TComPic*>* list ) { m_lists.push_back( list ); } 235 235 Int size () { return (Int) m_lists.size(); } 236 #if H_3D_ARP 237 TComList<TComPic*>* getPicList ( Int layerIdInNuh ); 238 #endif 236 239 TComPic* getPic ( Int layerIdInNuh, Int poc ); 237 240 TComPicYuv* getPicYuv( Int layerIdInNuh, Int poc, Bool recon ); -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComPrediction.cpp
r446 r504 63 63 m_cYuvPredTemp.destroy(); 64 64 65 #if H_3D_ARP 66 m_acYuvPredBase[0].destroy(); 67 m_acYuvPredBase[1].destroy(); 68 #endif 69 65 70 if( m_pLumaRecBuffer ) 66 71 { … … 103 108 104 109 m_cYuvPredTemp.create( MAX_CU_SIZE, MAX_CU_SIZE ); 110 #if H_3D_ARP 111 m_acYuvPredBase[0] .create( g_uiMaxCUWidth, g_uiMaxCUHeight ); 112 m_acYuvPredBase[1] .create( g_uiMaxCUWidth, g_uiMaxCUHeight ); 113 #endif 105 114 } 106 115 … … 113 122 } 114 123 } 124 #if H_3D_IC 125 for( Int i = 1; i < 64; i++ ) 126 { 127 m_uiaShift[i-1] = ( (1 << 15) + i/2 ) / i; 128 } 129 #endif 115 130 } 116 131 … … 485 500 TComMv cMv = pcCU->getCUMvField( eRefPicList )->getMv( uiPartAddr ); 486 501 pcCU->clipMv(cMv); 502 #if H_3D_ARP 503 if( pcCU->getARPW( uiPartAddr ) > 0 504 && pcCU->getPartitionSize(uiPartAddr)==SIZE_2Nx2N 505 && pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPOC()!= pcCU->getSlice()->getPOC() 506 ) 507 { 508 xPredInterUniARP( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, rpcYuvPred, bi ); 509 } 510 else 511 { 512 #endif 513 #if H_3D_IC 514 Bool bICFlag = pcCU->getICFlag( uiPartAddr ) && ( pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getViewIndex() != pcCU->getSlice()->getViewIndex() ); 515 xPredInterLumaBlk ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi 516 #if H_3D_ARP 517 , false 518 #endif 519 , bICFlag ); 520 xPredInterChromaBlk( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi 521 #if H_3D_ARP 522 , false 523 #endif 524 , bICFlag ); 525 #else 487 526 xPredInterLumaBlk ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi ); 488 527 xPredInterChromaBlk( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi ); 489 } 528 #endif 529 #if H_3D_ARP 530 } 531 #endif 532 } 533 534 #if H_3D_ARP 535 Void TComPrediction::xPredInterUniARP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, TComMvField * pNewMvFiled ) 536 { 537 Int iRefIdx = pNewMvFiled ? pNewMvFiled->getRefIdx() : pcCU->getCUMvField( eRefPicList )->getRefIdx( uiPartAddr ); 538 TComMv cMv = pNewMvFiled ? pNewMvFiled->getMv() : pcCU->getCUMvField( eRefPicList )->getMv( uiPartAddr ); 539 Bool bTobeScaled = false; 540 TComPic* pcPicYuvBaseCol = NULL; 541 TComPic* pcPicYuvBaseRef = NULL; 542 543 #if H_3D_NBDV 544 DisInfo cDistparity; 545 cDistparity.bDV = pcCU->getDvInfo(uiPartAddr).bDV; 546 if( cDistparity.bDV ) 547 { 548 cDistparity.m_acNBDV = pcCU->getDvInfo(0).m_acNBDV; 549 assert(pcCU->getDvInfo(uiPartAddr).bDV == pcCU->getDvInfo(0).bDV); 550 cDistparity.m_aVIdxCan = pcCU->getDvInfo(uiPartAddr).m_aVIdxCan; 551 } 552 #else 553 assert(0); // ARP can be applied only when a DV is available 554 #endif 555 556 UChar dW = cDistparity.bDV ? pcCU->getARPW ( uiPartAddr ) : 0; 557 558 if( cDistparity.bDV ) 559 { 560 if( dW > 0 && pcCU->getSlice()->getRefPic( eRefPicList, 0 )->getPOC()!= pcCU->getSlice()->getPOC() ) 561 { 562 bTobeScaled = true; 563 } 564 565 pcPicYuvBaseCol = pcCU->getSlice()->getBaseViewRefPic( pcCU->getSlice()->getPOC(), cDistparity.m_aVIdxCan ); 566 pcPicYuvBaseRef = pcCU->getSlice()->getBaseViewRefPic( pcCU->getSlice()->getRefPic( eRefPicList, 0 )->getPOC(), cDistparity.m_aVIdxCan ); 567 568 if( ( !pcPicYuvBaseCol || pcPicYuvBaseCol->getPOC() != pcCU->getSlice()->getPOC() ) || ( !pcPicYuvBaseRef || pcPicYuvBaseRef->getPOC() != pcCU->getSlice()->getRefPic( eRefPicList, 0 )->getPOC() ) ) 569 { 570 dW = 0; 571 bTobeScaled = false; 572 } 573 else 574 { 575 assert( pcPicYuvBaseCol->getPOC() == pcCU->getSlice()->getPOC() && pcPicYuvBaseRef->getPOC() == pcCU->getSlice()->getRefPic( eRefPicList, 0 )->getPOC() ); 576 } 577 578 if(bTobeScaled) 579 { 580 Int iCurrPOC = pcCU->getSlice()->getPOC(); 581 Int iColRefPOC = pcCU->getSlice()->getRefPOC( eRefPicList, iRefIdx ); 582 Int iCurrRefPOC = pcCU->getSlice()->getRefPOC( eRefPicList, 0); 583 Int iScale = pcCU-> xGetDistScaleFactor(iCurrPOC, iCurrRefPOC, iCurrPOC, iColRefPOC); 584 if ( iScale != 4096 ) 585 { 586 cMv = cMv.scaleMv( iScale ); 587 } 588 iRefIdx = 0; 589 } 590 } 591 592 pcCU->clipMv(cMv); 593 TComPicYuv* pcPicYuvRef = pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(); 594 xPredInterLumaBlk ( pcCU, pcPicYuvRef, uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi, true ); 595 xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi, true ); 596 597 if( dW > 0 ) 598 { 599 TComYuv * pYuvB0 = &m_acYuvPredBase[0]; 600 TComYuv * pYuvB1 = &m_acYuvPredBase[1]; 601 602 TComMv cMVwithDisparity = cMv + cDistparity.m_acNBDV; 603 pcCU->clipMv(cMVwithDisparity); 604 605 assert ( cDistparity.bDV ); 606 607 pcPicYuvRef = pcPicYuvBaseCol->getPicYuvRec(); 608 xPredInterLumaBlk ( pcCU, pcPicYuvRef, uiPartAddr, &cDistparity.m_acNBDV, iWidth, iHeight, pYuvB0, bi, true ); 609 xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cDistparity.m_acNBDV, iWidth, iHeight, pYuvB0, bi, true ); 610 611 pcPicYuvRef = pcPicYuvBaseRef->getPicYuvRec(); 612 xPredInterLumaBlk ( pcCU, pcPicYuvRef, uiPartAddr, &cMVwithDisparity, iWidth, iHeight, pYuvB1, bi, true ); 613 xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cMVwithDisparity, iWidth, iHeight, pYuvB1, bi, true ); 614 615 pYuvB0->subtractARP( pYuvB0 , pYuvB1 , uiPartAddr , iWidth , iHeight ); 616 617 if( 2 == dW ) 618 { 619 pYuvB0->multiplyARP( uiPartAddr , iWidth , iHeight , dW ); 620 } 621 622 rpcYuvPred->addARP( rpcYuvPred , pYuvB0 , uiPartAddr , iWidth , iHeight , !bi ); 623 } 624 } 625 #endif 490 626 491 627 Void TComPrediction::xPredInterBi ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvPred ) … … 551 687 * \param bi Flag indicating whether bipred is used 552 688 */ 553 Void TComPrediction::xPredInterLumaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi ) 689 Void TComPrediction::xPredInterLumaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi 690 #if H_3D_ARP 691 , Bool filterType 692 #endif 693 #if H_3D_IC 694 , Bool bICFlag 695 #endif 696 ) 554 697 { 555 698 Int refStride = refPic->getStride(); … … 563 706 Int yFrac = mv->getVer() & 0x3; 564 707 708 #if H_3D_IC 709 if( cu->getSlice()->getIsDepth() ) 710 { 711 refOffset = mv->getHor() + mv->getVer() * refStride; 712 ref = refPic->getLumaAddr( cu->getAddr(), cu->getZorderIdxInCU() + partAddr ) + refOffset; 713 xFrac = 0; 714 yFrac = 0; 715 } 716 #endif 717 565 718 if ( yFrac == 0 ) 566 719 { 567 m_if.filterHorLuma( ref, refStride, dst, dstStride, width, height, xFrac, !bi ); 720 m_if.filterHorLuma( ref, refStride, dst, dstStride, width, height, xFrac, !bi 721 #if H_3D_ARP 722 , filterType 723 #endif 724 ); 568 725 } 569 726 else if ( xFrac == 0 ) 570 727 { 571 m_if.filterVerLuma( ref, refStride, dst, dstStride, width, height, yFrac, true, !bi ); 728 m_if.filterVerLuma( ref, refStride, dst, dstStride, width, height, yFrac, true, !bi 729 #if H_3D_ARP 730 , filterType 731 #endif 732 ); 572 733 } 573 734 else … … 579 740 Int halfFilterSize = ( filterSize >> 1 ); 580 741 581 m_if.filterHorLuma(ref - (halfFilterSize-1)*refStride, refStride, tmp, tmpStride, width, height+filterSize-1, xFrac, false ); 582 m_if.filterVerLuma(tmp + (halfFilterSize-1)*tmpStride, tmpStride, dst, dstStride, width, height, yFrac, false, !bi); 583 } 742 m_if.filterHorLuma(ref - (halfFilterSize-1)*refStride, refStride, tmp, tmpStride, width, height+filterSize-1, xFrac, false 743 #if H_3D_ARP 744 , filterType 745 #endif 746 ); 747 m_if.filterVerLuma(tmp + (halfFilterSize-1)*tmpStride, tmpStride, dst, dstStride, width, height, yFrac, false, !bi 748 #if H_3D_ARP 749 , filterType 750 #endif 751 ); 752 } 753 754 #if H_3D_IC 755 if( bICFlag ) 756 { 757 Int a, b, iShift, i, j; 758 759 xGetLLSICPrediction( cu, mv, refPic, a, b, iShift, TEXT_LUMA ); 760 761 for ( i = 0; i < height; i++ ) 762 { 763 for ( j = 0; j < width; j++ ) 764 { 765 if( bi ) 766 { 767 Int iIFshift = IF_INTERNAL_PREC - g_bitDepthY; 768 dst[j] = ( ( a*dst[j] + a*IF_INTERNAL_OFFS ) >> iShift ) + b*( 1 << iIFshift ) - IF_INTERNAL_OFFS; 769 } 770 else 771 dst[j] = Clip3( 0, ( 1 << g_bitDepthY ) - 1, ( ( a*dst[j] ) >> iShift ) + b ); 772 } 773 dst += dstStride; 774 } 775 } 776 #endif 584 777 } 585 778 … … 596 789 * \param bi Flag indicating whether bipred is used 597 790 */ 598 Void TComPrediction::xPredInterChromaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi ) 791 Void TComPrediction::xPredInterChromaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi 792 #if H_3D_ARP 793 , Bool filterType 794 #endif 795 #if H_3D_IC 796 , Bool bICFlag 797 #endif 798 ) 599 799 { 600 800 Int refStride = refPic->getCStride(); … … 623 823 if ( yFrac == 0 ) 624 824 { 625 m_if.filterHorChroma(refCb, refStride, dstCb, dstStride, cxWidth, cxHeight, xFrac, !bi); 626 m_if.filterHorChroma(refCr, refStride, dstCr, dstStride, cxWidth, cxHeight, xFrac, !bi); 825 m_if.filterHorChroma(refCb, refStride, dstCb, dstStride, cxWidth, cxHeight, xFrac, !bi 826 #if H_3D_ARP 827 , filterType 828 #endif 829 ); 830 m_if.filterHorChroma(refCr, refStride, dstCr, dstStride, cxWidth, cxHeight, xFrac, !bi 831 #if H_3D_ARP 832 , filterType 833 #endif 834 ); 627 835 } 628 836 else if ( xFrac == 0 ) 629 837 { 630 m_if.filterVerChroma(refCb, refStride, dstCb, dstStride, cxWidth, cxHeight, yFrac, true, !bi); 631 m_if.filterVerChroma(refCr, refStride, dstCr, dstStride, cxWidth, cxHeight, yFrac, true, !bi); 838 m_if.filterVerChroma(refCb, refStride, dstCb, dstStride, cxWidth, cxHeight, yFrac, true, !bi 839 #if H_3D_ARP 840 , filterType 841 #endif 842 ); 843 m_if.filterVerChroma(refCr, refStride, dstCr, dstStride, cxWidth, cxHeight, yFrac, true, !bi 844 #if H_3D_ARP 845 , filterType 846 #endif 847 ); 632 848 } 633 849 else 634 850 { 635 m_if.filterHorChroma(refCb - (halfFilterSize-1)*refStride, refStride, extY, extStride, cxWidth, cxHeight+filterSize-1, xFrac, false); 636 m_if.filterVerChroma(extY + (halfFilterSize-1)*extStride, extStride, dstCb, dstStride, cxWidth, cxHeight , yFrac, false, !bi); 851 m_if.filterHorChroma(refCb - (halfFilterSize-1)*refStride, refStride, extY, extStride, cxWidth, cxHeight+filterSize-1, xFrac, false 852 #if H_3D_ARP 853 , filterType 854 #endif 855 ); 856 m_if.filterVerChroma(extY + (halfFilterSize-1)*extStride, extStride, dstCb, dstStride, cxWidth, cxHeight , yFrac, false, !bi 857 #if H_3D_ARP 858 , filterType 859 #endif 860 ); 637 861 638 m_if.filterHorChroma(refCr - (halfFilterSize-1)*refStride, refStride, extY, extStride, cxWidth, cxHeight+filterSize-1, xFrac, false); 639 m_if.filterVerChroma(extY + (halfFilterSize-1)*extStride, extStride, dstCr, dstStride, cxWidth, cxHeight , yFrac, false, !bi); 640 } 862 m_if.filterHorChroma(refCr - (halfFilterSize-1)*refStride, refStride, extY, extStride, cxWidth, cxHeight+filterSize-1, xFrac, false 863 #if H_3D_ARP 864 , filterType 865 #endif 866 ); 867 m_if.filterVerChroma(extY + (halfFilterSize-1)*extStride, extStride, dstCr, dstStride, cxWidth, cxHeight , yFrac, false, !bi 868 #if H_3D_ARP 869 , filterType 870 #endif 871 ); 872 } 873 874 #if H_3D_IC 875 if( bICFlag ) 876 { 877 Int a, b, iShift, i, j; 878 xGetLLSICPrediction( cu, mv, refPic, a, b, iShift, TEXT_CHROMA_U ); // Cb 879 for ( i = 0; i < cxHeight; i++ ) 880 { 881 for ( j = 0; j < cxWidth; j++ ) 882 { 883 if( bi ) 884 { 885 Int iIFshift = IF_INTERNAL_PREC - g_bitDepthC; 886 dstCb[j] = ( ( a*dstCb[j] + a*IF_INTERNAL_OFFS ) >> iShift ) + b*( 1<<iIFshift ) - IF_INTERNAL_OFFS; 887 } 888 else 889 dstCb[j] = Clip3( 0, ( 1 << g_bitDepthC ) - 1, ( ( a*dstCb[j] ) >> iShift ) + b ); 890 } 891 dstCb += dstStride; 892 } 893 xGetLLSICPrediction( cu, mv, refPic, a, b, iShift, TEXT_CHROMA_V ); // Cr 894 for ( i = 0; i < cxHeight; i++ ) 895 { 896 for ( j = 0; j < cxWidth; j++ ) 897 { 898 if( bi ) 899 { 900 Int iIFshift = IF_INTERNAL_PREC - g_bitDepthC; 901 dstCr[j] = ( ( a*dstCr[j] + a*IF_INTERNAL_OFFS ) >> iShift ) + b*( 1<<iIFshift ) - IF_INTERNAL_OFFS; 902 } 903 else 904 dstCr[j] = Clip3( 0, ( 1 << g_bitDepthC ) - 1, ( ( a*dstCr[j] ) >> iShift ) + b ); 905 } 906 dstCr += dstStride; 907 } 908 } 909 #endif 641 910 } 642 911 … … 758 1027 return; 759 1028 } 1029 1030 #if H_3D_IC 1031 /** Function for deriving the position of first non-zero binary bit of a value 1032 * \param x input value 1033 * 1034 * This function derives the position of first non-zero binary bit of a value 1035 */ 1036 Int GetMSB( UInt x ) 1037 { 1038 Int iMSB = 0, bits = ( sizeof( Int ) << 3 ), y = 1; 1039 1040 while( x > 1 ) 1041 { 1042 bits >>= 1; 1043 y = x >> bits; 1044 1045 if( y ) 1046 { 1047 x = y; 1048 iMSB += bits; 1049 } 1050 } 1051 1052 iMSB+=y; 1053 1054 return iMSB; 1055 } 1056 1057 /** Function for counting leading number of zeros/ones 1058 * \param x input value 1059 \ This function counts leading number of zeros for positive numbers and 1060 \ leading number of ones for negative numbers. This can be implemented in 1061 \ single instructure cycle on many processors. 1062 */ 1063 1064 Short CountLeadingZerosOnes (Short x) 1065 { 1066 Short clz; 1067 Short i; 1068 1069 if(x == 0) 1070 { 1071 clz = 0; 1072 } 1073 else 1074 { 1075 if (x == -1) 1076 { 1077 clz = 15; 1078 } 1079 else 1080 { 1081 if(x < 0) 1082 { 1083 x = ~x; 1084 } 1085 clz = 15; 1086 for(i = 0;i < 15;++i) 1087 { 1088 if(x) 1089 { 1090 clz --; 1091 } 1092 x = x >> 1; 1093 } 1094 } 1095 } 1096 return clz; 1097 } 1098 1099 /** Function for deriving LM illumination compensation. 1100 */ 1101 Void TComPrediction::xGetLLSICPrediction( TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, Int &iShift, TextType eType ) 1102 { 1103 TComPicYuv *pRecPic = pcCU->getPic()->getPicYuvRec(); 1104 Pel *pRec = NULL, *pRef = NULL; 1105 UInt uiWidth, uiHeight, uiTmpPartIdx; 1106 Int iRecStride = ( eType == TEXT_LUMA ) ? pRecPic->getStride() : pRecPic->getCStride(); 1107 Int iRefStride = ( eType == TEXT_LUMA ) ? pRefPic->getStride() : pRefPic->getCStride(); 1108 Int iCUPelX, iCUPelY, iRefX, iRefY, iRefOffset, iHor, iVer; 1109 1110 iCUPelX = pcCU->getCUPelX() + g_auiRasterToPelX[g_auiZscanToRaster[pcCU->getZorderIdxInCU()]]; 1111 iCUPelY = pcCU->getCUPelY() + g_auiRasterToPelY[g_auiZscanToRaster[pcCU->getZorderIdxInCU()]]; 1112 iHor = pcCU->getSlice()->getIsDepth() ? pMv->getHor() : ( ( pMv->getHor() + 2 ) >> 2 ); 1113 iVer = pcCU->getSlice()->getIsDepth() ? pMv->getVer() : ( ( pMv->getVer() + 2 ) >> 2 ); 1114 iRefX = iCUPelX + iHor; 1115 iRefY = iCUPelY + iVer; 1116 if( eType != TEXT_LUMA ) 1117 { 1118 iHor = pcCU->getSlice()->getIsDepth() ? ( ( pMv->getHor() + 1 ) >> 1 ) : ( ( pMv->getHor() + 4 ) >> 3 ); 1119 iVer = pcCU->getSlice()->getIsDepth() ? ( ( pMv->getVer() + 1 ) >> 1 ) : ( ( pMv->getVer() + 4 ) >> 3 ); 1120 } 1121 uiWidth = ( eType == TEXT_LUMA ) ? pcCU->getWidth( 0 ) : ( pcCU->getWidth( 0 ) >> 1 ); 1122 uiHeight = ( eType == TEXT_LUMA ) ? pcCU->getHeight( 0 ) : ( pcCU->getHeight( 0 ) >> 1 ); 1123 1124 Int i, j, iCountShift = 0; 1125 1126 // LLS parameters estimation --> 1127 1128 Int x = 0, y = 0, xx = 0, xy = 0; 1129 1130 if( pcCU->getPUAbove( uiTmpPartIdx, pcCU->getZorderIdxInCU() ) && iCUPelY > 0 && iRefY > 0 ) 1131 { 1132 iRefOffset = iHor + iVer * iRefStride - iRefStride; 1133 if( eType == TEXT_LUMA ) 1134 { 1135 pRef = pRefPic->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) + iRefOffset; 1136 pRec = pRecPic->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) - iRecStride; 1137 } 1138 else if( eType == TEXT_CHROMA_U ) 1139 { 1140 pRef = pRefPic->getCbAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) + iRefOffset; 1141 pRec = pRecPic->getCbAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) - iRecStride; 1142 } 1143 else 1144 { 1145 assert( eType == TEXT_CHROMA_V ); 1146 pRef = pRefPic->getCrAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) + iRefOffset; 1147 pRec = pRecPic->getCrAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) - iRecStride; 1148 } 1149 1150 for( j = 0; j < uiWidth; j++ ) 1151 { 1152 x += pRef[j]; 1153 y += pRec[j]; 1154 xx += pRef[j] * pRef[j]; 1155 xy += pRef[j] * pRec[j]; 1156 } 1157 iCountShift += g_aucConvertToBit[ uiWidth ] + 2; 1158 } 1159 1160 1161 if( pcCU->getPULeft( uiTmpPartIdx, pcCU->getZorderIdxInCU() ) && iCUPelX > 0 && iRefX > 0 ) 1162 { 1163 iRefOffset = iHor + iVer * iRefStride - 1; 1164 if( eType == TEXT_LUMA ) 1165 { 1166 pRef = pRefPic->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) + iRefOffset; 1167 pRec = pRecPic->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) - 1; 1168 } 1169 else if( eType == TEXT_CHROMA_U ) 1170 { 1171 pRef = pRefPic->getCbAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) + iRefOffset; 1172 pRec = pRecPic->getCbAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) - 1; 1173 } 1174 else 1175 { 1176 assert( eType == TEXT_CHROMA_V ); 1177 pRef = pRefPic->getCrAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) + iRefOffset; 1178 pRec = pRecPic->getCrAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) - 1; 1179 } 1180 1181 for( i = 0; i < uiHeight; i++ ) 1182 { 1183 x += pRef[0]; 1184 y += pRec[0]; 1185 xx += pRef[0] * pRef[0]; 1186 xy += pRef[0] * pRec[0]; 1187 1188 pRef += iRefStride; 1189 pRec += iRecStride; 1190 } 1191 iCountShift += iCountShift > 0 ? 1 : ( g_aucConvertToBit[ uiWidth ] + 2 ); 1192 } 1193 1194 Int iTempShift = ( ( eType == TEXT_LUMA ) ? g_bitDepthY : g_bitDepthC ) + g_aucConvertToBit[ uiWidth ] + 3 - 15; 1195 1196 if( iTempShift > 0 ) 1197 { 1198 x = ( x + ( 1 << ( iTempShift - 1 ) ) ) >> iTempShift; 1199 y = ( y + ( 1 << ( iTempShift - 1 ) ) ) >> iTempShift; 1200 xx = ( xx + ( 1 << ( iTempShift - 1 ) ) ) >> iTempShift; 1201 xy = ( xy + ( 1 << ( iTempShift - 1 ) ) ) >> iTempShift; 1202 iCountShift -= iTempShift; 1203 } 1204 1205 iShift = 13; 1206 1207 if( iCountShift == 0 ) 1208 { 1209 a = 1; 1210 b = 0; 1211 iShift = 0; 1212 } 1213 else 1214 { 1215 Int a1 = ( xy << iCountShift ) - y * x; 1216 Int a2 = ( xx << iCountShift ) - x * x; 1217 1218 { 1219 const Int iShiftA2 = 6; 1220 const Int iShiftA1 = 15; 1221 const Int iAccuracyShift = 15; 1222 1223 Int iScaleShiftA2 = 0; 1224 Int iScaleShiftA1 = 0; 1225 Int a1s = a1; 1226 Int a2s = a2; 1227 1228 iScaleShiftA1 = GetMSB( abs( a1 ) ) - iShiftA1; 1229 iScaleShiftA2 = GetMSB( abs( a2 ) ) - iShiftA2; 1230 1231 if( iScaleShiftA1 < 0 ) 1232 { 1233 iScaleShiftA1 = 0; 1234 } 1235 1236 if( iScaleShiftA2 < 0 ) 1237 { 1238 iScaleShiftA2 = 0; 1239 } 1240 1241 Int iScaleShiftA = iScaleShiftA2 + iAccuracyShift - iShift - iScaleShiftA1; 1242 1243 a2s = a2 >> iScaleShiftA2; 1244 1245 a1s = a1 >> iScaleShiftA1; 1246 1247 if (a2s >= 1) 1248 { 1249 a = a1s * m_uiaShift[ a2s - 1]; 1250 } 1251 else 1252 { 1253 a = 0; 1254 } 1255 1256 if( iScaleShiftA < 0 ) 1257 { 1258 a = a << -iScaleShiftA; 1259 } 1260 else 1261 { 1262 a = a >> iScaleShiftA; 1263 } 1264 1265 a = Clip3( -( 1 << 15 ), ( 1 << 15 ) - 1, a ); 1266 1267 Int minA = -(1 << (6)); 1268 Int maxA = (1 << 6) - 1; 1269 if( a <= maxA && a >= minA ) 1270 { 1271 // do nothing 1272 } 1273 else 1274 { 1275 Short n = CountLeadingZerosOnes( a ); 1276 a = a >> (9-n); 1277 iShift -= (9-n); 1278 } 1279 1280 b = ( y - ( ( a * x ) >> iShift ) + ( 1 << ( iCountShift - 1 ) ) ) >> iCountShift; 1281 } 1282 } 1283 } 1284 #endif 760 1285 //! \} -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComPrediction.h
r324 r504 65 65 TComYuv m_acYuvPred[2]; 66 66 TComYuv m_cYuvPredTemp; 67 #if H_3D_ARP 68 TComYuv m_acYuvPredBase[2]; 69 #endif 67 70 TComYuv m_filteredBlock[4][4]; 68 71 TComYuv m_filteredBlockTmp[4]; … … 72 75 Pel* m_pLumaRecBuffer; ///< array for downsampled reconstructed luma sample 73 76 Int m_iLumaRecStride; ///< stride of #m_pLumaRecBuffer array 74 77 #if H_3D_IC 78 UInt m_uiaShift[ 63 ]; // Table for multiplication to substitue of division operation 79 #endif 75 80 Void xPredIntraAng (Int bitDepth, Int* pSrc, Int srcStride, Pel*& rpDst, Int dstStride, UInt width, UInt height, UInt dirMode, Bool blkAboveAvailable, Bool blkLeftAvailable, Bool bFilter ); 76 81 Void xPredIntraPlanar ( Int* pSrc, Int srcStride, Pel* rpDst, Int dstStride, UInt width, UInt height ); 77 82 78 83 // motion compensation functions 84 #if H_3D_ARP 85 Void xPredInterUniARP ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi=false, TComMvField * pNewMvFiled = NULL ); 86 #endif 79 87 Void xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi=false ); 80 88 Void xPredInterBi ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvPred ); 81 Void xPredInterLumaBlk ( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi ); 82 Void xPredInterChromaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi ); 89 Void xPredInterLumaBlk ( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi 90 #if H_3D_ARP 91 , Bool filterType = false 92 #endif 93 #if H_3D_IC 94 , Bool bICFlag = false 95 #endif 96 ); 97 Void xPredInterChromaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi 98 #if H_3D_ARP 99 , Bool filterType = false 100 #endif 101 #if H_3D_IC 102 , Bool bICFlag = false 103 #endif 104 ); 83 105 Void xWeightedAverage ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvDst ); 84 106 85 107 Void xGetLLSPrediction ( TComPattern* pcPattern, Int* pSrc0, Int iSrcStride, Pel* pDst0, Int iDstStride, UInt uiWidth, UInt uiHeight, UInt uiExt0 ); 86 108 #if H_3D_IC 109 Void xGetLLSICPrediction( TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, Int &iShift, TextType eType ); 110 #endif 87 111 Void xDCPredFiltering( Int* pSrc, Int iSrcStride, Pel*& rpDst, Int iDstStride, Int iWidth, Int iHeight ); 88 112 Bool xCheckIdenticalMotion ( TComDataCU* pcCU, UInt PartAddr); -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComRdCost.cpp
r446 r504 502 502 cDtParam.bitDepth = bitDepth; 503 503 504 #if H_3D_IC 505 cDtParam.bUseIC = false; 506 #endif 507 504 508 #if WEIGHTED_CHROMA_DISTORTION 505 509 if (eText == TEXT_CHROMA_U) … … 599 603 return xGetSADw( pcDtParam ); 600 604 } 605 606 #if H_3D_IC 607 if( pcDtParam->bUseIC ) 608 { 609 return xGetSADic( pcDtParam ); 610 } 611 #endif 612 601 613 Pel* piOrg = pcDtParam->pOrg; 602 614 Pel* piCur = pcDtParam->pCur; … … 627 639 return xGetSADw( pcDtParam ); 628 640 } 641 642 #if H_3D_IC 643 if( pcDtParam->bUseIC ) 644 { 645 return xGetSAD4ic( pcDtParam ); 646 } 647 #endif 648 629 649 Pel* piOrg = pcDtParam->pOrg; 630 650 Pel* piCur = pcDtParam->pCur; … … 658 678 return xGetSADw( pcDtParam ); 659 679 } 680 681 #if H_3D_IC 682 if( pcDtParam->bUseIC ) 683 { 684 return xGetSAD8ic( pcDtParam ); 685 } 686 #endif 687 660 688 Pel* piOrg = pcDtParam->pOrg; 661 689 Pel* piCur = pcDtParam->pCur; … … 693 721 return xGetSADw( pcDtParam ); 694 722 } 723 724 #if H_3D_IC 725 if( pcDtParam->bUseIC ) 726 { 727 return xGetSAD16ic( pcDtParam ); 728 } 729 #endif 730 695 731 Pel* piOrg = pcDtParam->pOrg; 696 732 Pel* piCur = pcDtParam->pCur; … … 737 773 return xGetSADw( pcDtParam ); 738 774 } 775 776 #if H_3D_IC 777 if( pcDtParam->bUseIC ) 778 { 779 return xGetSAD12ic( pcDtParam ); 780 } 781 #endif 782 739 783 Pel* piOrg = pcDtParam->pOrg; 740 784 Pel* piCur = pcDtParam->pCur; … … 773 817 UInt TComRdCost::xGetSAD16N( DistParam* pcDtParam ) 774 818 { 819 #if H_3D_IC 820 if( pcDtParam->bUseIC ) 821 { 822 return xGetSAD16Nic( pcDtParam ); 823 } 824 #endif 825 775 826 Pel* piOrg = pcDtParam->pOrg; 776 827 Pel* piCur = pcDtParam->pCur; … … 819 870 return xGetSADw( pcDtParam ); 820 871 } 872 873 #if H_3D_IC 874 if( pcDtParam->bUseIC ) 875 { 876 return xGetSAD32ic( pcDtParam ); 877 } 878 #endif 879 821 880 Pel* piOrg = pcDtParam->pOrg; 822 881 Pel* piCur = pcDtParam->pCur; … … 879 938 return xGetSADw( pcDtParam ); 880 939 } 940 941 #if H_3D_IC 942 if( pcDtParam->bUseIC ) 943 { 944 return xGetSAD24ic( pcDtParam ); 945 } 946 #endif 947 881 948 Pel* piOrg = pcDtParam->pOrg; 882 949 Pel* piCur = pcDtParam->pCur; … … 932 999 return xGetSADw( pcDtParam ); 933 1000 } 1001 1002 #if H_3D_IC 1003 if( pcDtParam->bUseIC ) 1004 { 1005 return xGetSAD64ic( pcDtParam ); 1006 } 1007 #endif 1008 934 1009 Pel* piOrg = pcDtParam->pOrg; 935 1010 Pel* piCur = pcDtParam->pCur; … … 1024 1099 return xGetSADw( pcDtParam ); 1025 1100 } 1101 1102 #if H_3D_IC 1103 if( pcDtParam->bUseIC ) 1104 { 1105 return xGetSAD48ic( pcDtParam ); 1106 } 1107 #endif 1108 1026 1109 Pel* piOrg = pcDtParam->pOrg; 1027 1110 Pel* piCur = pcDtParam->pCur; … … 1094 1177 #endif 1095 1178 1179 #if H_3D_IC 1180 UInt TComRdCost::xGetSADic( DistParam* pcDtParam ) 1181 { 1182 if ( pcDtParam->bApplyWeight ) 1183 { 1184 return xGetSADw( pcDtParam ); 1185 } 1186 Pel* piOrg = pcDtParam->pOrg; 1187 Pel* piCur = pcDtParam->pCur; 1188 Int iRows = pcDtParam->iRows; 1189 Int iCols = pcDtParam->iCols; 1190 Int iStrideCur = pcDtParam->iStrideCur; 1191 Int iStrideOrg = pcDtParam->iStrideOrg; 1192 1193 UInt uiSum = 0; 1194 1195 Int iOrigAvg = 0, iCurAvg = 0; 1196 Int iDeltaC; 1197 1198 for( ; iRows != 0; iRows-- ) 1199 { 1200 for (Int n = 0; n < iCols; n++ ) 1201 { 1202 iOrigAvg += piOrg[n]; 1203 iCurAvg += piCur[n]; 1204 } 1205 piOrg += iStrideOrg; 1206 piCur += iStrideCur; 1207 } 1208 1209 piOrg = pcDtParam->pOrg; 1210 piCur = pcDtParam->pCur; 1211 iRows = pcDtParam->iRows; 1212 1213 iDeltaC = (iOrigAvg - iCurAvg)/iCols/iRows; 1214 1215 for( ; iRows != 0; iRows-- ) 1216 { 1217 for (Int n = 0; n < iCols; n++ ) 1218 { 1219 uiSum += abs( piOrg[n] - piCur[n] - iDeltaC ); 1220 } 1221 piOrg += iStrideOrg; 1222 piCur += iStrideCur; 1223 } 1224 1225 return ( uiSum >> DISTORTION_PRECISION_ADJUSTMENT( pcDtParam->bitDepth - 8 ) ); 1226 } 1227 1228 UInt TComRdCost::xGetSAD4ic( DistParam* pcDtParam ) 1229 { 1230 if ( pcDtParam->bApplyWeight ) 1231 { 1232 return xGetSADw( pcDtParam ); 1233 } 1234 Pel* piOrg = pcDtParam->pOrg; 1235 Pel* piCur = pcDtParam->pCur; 1236 Int iRows = pcDtParam->iRows; 1237 Int iSubShift = pcDtParam->iSubShift; 1238 Int iSubStep = ( 1 << iSubShift ); 1239 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 1240 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 1241 1242 UInt uiSum = 0; 1243 1244 Int iOrigAvg = 0, iCurAvg = 0, uiRowCnt = 0; 1245 Int iDeltaC; 1246 1247 for( ; iRows != 0; iRows-=iSubStep ) 1248 { 1249 iOrigAvg += piOrg[0]; 1250 iOrigAvg += piOrg[1]; 1251 iOrigAvg += piOrg[2]; 1252 iOrigAvg += piOrg[3]; 1253 1254 iCurAvg += piCur[0]; 1255 iCurAvg += piCur[1]; 1256 iCurAvg += piCur[2]; 1257 iCurAvg += piCur[3]; 1258 1259 piOrg += iStrideOrg; 1260 piCur += iStrideCur; 1261 uiRowCnt++; 1262 } 1263 1264 piOrg = pcDtParam->pOrg; 1265 piCur = pcDtParam->pCur; 1266 iRows = pcDtParam->iRows; 1267 1268 iDeltaC = uiRowCnt ? ((iOrigAvg - iCurAvg)/uiRowCnt/4) : 0; 1269 1270 for( ; iRows != 0; iRows-=iSubStep ) 1271 { 1272 uiSum += abs( piOrg[0] - piCur[0] - iDeltaC ); 1273 uiSum += abs( piOrg[1] - piCur[1] - iDeltaC ); 1274 uiSum += abs( piOrg[2] - piCur[2] - iDeltaC ); 1275 uiSum += abs( piOrg[3] - piCur[3] - iDeltaC ); 1276 1277 piOrg += iStrideOrg; 1278 piCur += iStrideCur; 1279 } 1280 1281 uiSum <<= iSubShift; 1282 return ( uiSum >> DISTORTION_PRECISION_ADJUSTMENT( pcDtParam->bitDepth - 8 ) ); 1283 } 1284 1285 UInt TComRdCost::xGetSAD8ic( DistParam* pcDtParam ) 1286 { 1287 if ( pcDtParam->bApplyWeight ) 1288 { 1289 return xGetSADw( pcDtParam ); 1290 } 1291 Pel* piOrg = pcDtParam->pOrg; 1292 Pel* piCur = pcDtParam->pCur; 1293 Int iRows = pcDtParam->iRows; 1294 Int iSubShift = pcDtParam->iSubShift; 1295 Int iSubStep = ( 1 << iSubShift ); 1296 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 1297 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 1298 1299 UInt uiSum = 0; 1300 1301 Int iOrigAvg = 0, iCurAvg = 0, uiRowCnt = 0; 1302 Int iDeltaC; 1303 1304 for( ; iRows != 0; iRows-=iSubStep ) 1305 { 1306 iOrigAvg += piOrg[0]; 1307 iOrigAvg += piOrg[1]; 1308 iOrigAvg += piOrg[2]; 1309 iOrigAvg += piOrg[3]; 1310 iOrigAvg += piOrg[4]; 1311 iOrigAvg += piOrg[5]; 1312 iOrigAvg += piOrg[6]; 1313 iOrigAvg += piOrg[7]; 1314 1315 iCurAvg += piCur[0]; 1316 iCurAvg += piCur[1]; 1317 iCurAvg += piCur[2]; 1318 iCurAvg += piCur[3]; 1319 iCurAvg += piCur[4]; 1320 iCurAvg += piCur[5]; 1321 iCurAvg += piCur[6]; 1322 iCurAvg += piCur[7]; 1323 1324 piOrg += iStrideOrg; 1325 piCur += iStrideCur; 1326 uiRowCnt++; 1327 } 1328 1329 piOrg = pcDtParam->pOrg; 1330 piCur = pcDtParam->pCur; 1331 iRows = pcDtParam->iRows; 1332 1333 iDeltaC = uiRowCnt ? ((iOrigAvg - iCurAvg)/uiRowCnt/8) : 0; 1334 1335 for( ; iRows != 0; iRows-=iSubStep ) 1336 { 1337 uiSum += abs( piOrg[0] - piCur[0] - iDeltaC ); 1338 uiSum += abs( piOrg[1] - piCur[1] - iDeltaC ); 1339 uiSum += abs( piOrg[2] - piCur[2] - iDeltaC ); 1340 uiSum += abs( piOrg[3] - piCur[3] - iDeltaC ); 1341 uiSum += abs( piOrg[4] - piCur[4] - iDeltaC ); 1342 uiSum += abs( piOrg[5] - piCur[5] - iDeltaC ); 1343 uiSum += abs( piOrg[6] - piCur[6] - iDeltaC ); 1344 uiSum += abs( piOrg[7] - piCur[7] - iDeltaC ); 1345 1346 piOrg += iStrideOrg; 1347 piCur += iStrideCur; 1348 } 1349 1350 uiSum <<= iSubShift; 1351 return ( uiSum >> DISTORTION_PRECISION_ADJUSTMENT( pcDtParam->bitDepth - 8 ) ); 1352 } 1353 1354 UInt TComRdCost::xGetSAD16ic( DistParam* pcDtParam ) 1355 { 1356 if ( pcDtParam->bApplyWeight ) 1357 { 1358 return xGetSADw( pcDtParam ); 1359 } 1360 Pel* piOrg = pcDtParam->pOrg; 1361 Pel* piCur = pcDtParam->pCur; 1362 Int iRows = pcDtParam->iRows; 1363 Int iSubShift = pcDtParam->iSubShift; 1364 Int iSubStep = ( 1 << iSubShift ); 1365 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 1366 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 1367 1368 UInt uiSum = 0; 1369 1370 Int iOrigAvg = 0, iCurAvg = 0, uiRowCnt = 0; 1371 Int iDeltaC; 1372 1373 for( ; iRows != 0; iRows-=iSubStep ) 1374 { 1375 iOrigAvg += piOrg[0]; 1376 iOrigAvg += piOrg[1]; 1377 iOrigAvg += piOrg[2]; 1378 iOrigAvg += piOrg[3]; 1379 iOrigAvg += piOrg[4]; 1380 iOrigAvg += piOrg[5]; 1381 iOrigAvg += piOrg[6]; 1382 iOrigAvg += piOrg[7]; 1383 iOrigAvg += piOrg[8]; 1384 iOrigAvg += piOrg[9]; 1385 iOrigAvg += piOrg[10]; 1386 iOrigAvg += piOrg[11]; 1387 iOrigAvg += piOrg[12]; 1388 iOrigAvg += piOrg[13]; 1389 iOrigAvg += piOrg[14]; 1390 iOrigAvg += piOrg[15]; 1391 1392 iCurAvg += piCur[0]; 1393 iCurAvg += piCur[1]; 1394 iCurAvg += piCur[2]; 1395 iCurAvg += piCur[3]; 1396 iCurAvg += piCur[4]; 1397 iCurAvg += piCur[5]; 1398 iCurAvg += piCur[6]; 1399 iCurAvg += piCur[7]; 1400 iCurAvg += piCur[8]; 1401 iCurAvg += piCur[9]; 1402 iCurAvg += piCur[10]; 1403 iCurAvg += piCur[11]; 1404 iCurAvg += piCur[12]; 1405 iCurAvg += piCur[13]; 1406 iCurAvg += piCur[14]; 1407 iCurAvg += piCur[15]; 1408 1409 piOrg += iStrideOrg; 1410 piCur += iStrideCur; 1411 uiRowCnt++; 1412 } 1413 1414 piOrg = pcDtParam->pOrg; 1415 piCur = pcDtParam->pCur; 1416 iRows = pcDtParam->iRows; 1417 1418 iDeltaC = uiRowCnt ? ((iOrigAvg - iCurAvg)/uiRowCnt/16) : 0; 1419 1420 for( ; iRows != 0; iRows-=iSubStep ) 1421 { 1422 uiSum += abs( piOrg[0] - piCur[0] - iDeltaC ); 1423 uiSum += abs( piOrg[1] - piCur[1] - iDeltaC ); 1424 uiSum += abs( piOrg[2] - piCur[2] - iDeltaC ); 1425 uiSum += abs( piOrg[3] - piCur[3] - iDeltaC ); 1426 uiSum += abs( piOrg[4] - piCur[4] - iDeltaC ); 1427 uiSum += abs( piOrg[5] - piCur[5] - iDeltaC ); 1428 uiSum += abs( piOrg[6] - piCur[6] - iDeltaC ); 1429 uiSum += abs( piOrg[7] - piCur[7] - iDeltaC ); 1430 uiSum += abs( piOrg[8] - piCur[8] - iDeltaC ); 1431 uiSum += abs( piOrg[9] - piCur[9] - iDeltaC ); 1432 uiSum += abs( piOrg[10] - piCur[10] - iDeltaC ); 1433 uiSum += abs( piOrg[11] - piCur[11] - iDeltaC ); 1434 uiSum += abs( piOrg[12] - piCur[12] - iDeltaC ); 1435 uiSum += abs( piOrg[13] - piCur[13] - iDeltaC ); 1436 uiSum += abs( piOrg[14] - piCur[14] - iDeltaC ); 1437 uiSum += abs( piOrg[15] - piCur[15] - iDeltaC ); 1438 1439 piOrg += iStrideOrg; 1440 piCur += iStrideCur; 1441 } 1442 1443 uiSum <<= iSubShift; 1444 return ( uiSum >> DISTORTION_PRECISION_ADJUSTMENT( pcDtParam->bitDepth - 8 ) ); 1445 } 1446 1447 #if AMP_SAD 1448 UInt TComRdCost::xGetSAD12ic( DistParam* pcDtParam ) 1449 { 1450 if ( pcDtParam->bApplyWeight ) 1451 { 1452 return xGetSADw( pcDtParam ); 1453 } 1454 Pel* piOrg = pcDtParam->pOrg; 1455 Pel* piCur = pcDtParam->pCur; 1456 Int iRows = pcDtParam->iRows; 1457 Int iSubShift = pcDtParam->iSubShift; 1458 Int iSubStep = ( 1 << iSubShift ); 1459 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 1460 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 1461 1462 UInt uiSum = 0; 1463 1464 Int iOrigAvg = 0, iCurAvg = 0, uiRowCnt = 0; 1465 Int iDeltaC; 1466 1467 for( ; iRows != 0; iRows-=iSubStep ) 1468 { 1469 iOrigAvg += piOrg[0]; 1470 iOrigAvg += piOrg[1]; 1471 iOrigAvg += piOrg[2]; 1472 iOrigAvg += piOrg[3]; 1473 iOrigAvg += piOrg[4]; 1474 iOrigAvg += piOrg[5]; 1475 iOrigAvg += piOrg[6]; 1476 iOrigAvg += piOrg[7]; 1477 iOrigAvg += piOrg[8]; 1478 iOrigAvg += piOrg[9]; 1479 iOrigAvg += piOrg[10]; 1480 iOrigAvg += piOrg[11]; 1481 1482 iCurAvg += piCur[0]; 1483 iCurAvg += piCur[1]; 1484 iCurAvg += piCur[2]; 1485 iCurAvg += piCur[3]; 1486 iCurAvg += piCur[4]; 1487 iCurAvg += piCur[5]; 1488 iCurAvg += piCur[6]; 1489 iCurAvg += piCur[7]; 1490 iCurAvg += piCur[8]; 1491 iCurAvg += piCur[9]; 1492 iCurAvg += piCur[10]; 1493 iCurAvg += piCur[11]; 1494 1495 piOrg += iStrideOrg; 1496 piCur += iStrideCur; 1497 uiRowCnt++; 1498 } 1499 1500 piOrg = pcDtParam->pOrg; 1501 piCur = pcDtParam->pCur; 1502 iRows = pcDtParam->iRows; 1503 1504 iDeltaC = uiRowCnt ? ((iOrigAvg - iCurAvg)/uiRowCnt/12) : 0; 1505 1506 for( ; iRows != 0; iRows-=iSubStep ) 1507 { 1508 uiSum += abs( piOrg[0] - piCur[0] - iDeltaC ); 1509 uiSum += abs( piOrg[1] - piCur[1] - iDeltaC ); 1510 uiSum += abs( piOrg[2] - piCur[2] - iDeltaC ); 1511 uiSum += abs( piOrg[3] - piCur[3] - iDeltaC ); 1512 uiSum += abs( piOrg[4] - piCur[4] - iDeltaC ); 1513 uiSum += abs( piOrg[5] - piCur[5] - iDeltaC ); 1514 uiSum += abs( piOrg[6] - piCur[6] - iDeltaC ); 1515 uiSum += abs( piOrg[7] - piCur[7] - iDeltaC ); 1516 uiSum += abs( piOrg[8] - piCur[8] - iDeltaC ); 1517 uiSum += abs( piOrg[9] - piCur[9] - iDeltaC ); 1518 uiSum += abs( piOrg[10] - piCur[10] - iDeltaC ); 1519 uiSum += abs( piOrg[11] - piCur[11] - iDeltaC ); 1520 1521 piOrg += iStrideOrg; 1522 piCur += iStrideCur; 1523 } 1524 1525 uiSum <<= iSubShift; 1526 return ( uiSum >> DISTORTION_PRECISION_ADJUSTMENT( pcDtParam->bitDepth - 8 ) ); 1527 } 1528 #endif 1529 1530 UInt TComRdCost::xGetSAD16Nic( DistParam* pcDtParam ) 1531 { 1532 Pel* piOrg = pcDtParam->pOrg; 1533 Pel* piCur = pcDtParam->pCur; 1534 Int iRows = pcDtParam->iRows; 1535 Int iCols = pcDtParam->iCols; 1536 Int iSubShift = pcDtParam->iSubShift; 1537 Int iSubStep = ( 1 << iSubShift ); 1538 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 1539 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 1540 1541 UInt uiSum = 0; 1542 1543 Int iOrigAvg = 0, iCurAvg = 0, uiRowCnt = 0, uiColCnt = (iCols-1)/16 + 1; 1544 Int iDeltaC; 1545 1546 for( ; iRows != 0; iRows-=iSubStep ) 1547 { 1548 for (Int n = 0; n < iCols; n+=16 ) 1549 { 1550 iOrigAvg += piOrg[n + 0]; 1551 iOrigAvg += piOrg[n + 1]; 1552 iOrigAvg += piOrg[n + 2]; 1553 iOrigAvg += piOrg[n + 3]; 1554 iOrigAvg += piOrg[n + 4]; 1555 iOrigAvg += piOrg[n + 5]; 1556 iOrigAvg += piOrg[n + 6]; 1557 iOrigAvg += piOrg[n + 7]; 1558 iOrigAvg += piOrg[n + 8]; 1559 iOrigAvg += piOrg[n + 9]; 1560 iOrigAvg += piOrg[n + 10]; 1561 iOrigAvg += piOrg[n + 11]; 1562 iOrigAvg += piOrg[n + 12]; 1563 iOrigAvg += piOrg[n + 13]; 1564 iOrigAvg += piOrg[n + 14]; 1565 iOrigAvg += piOrg[n + 15]; 1566 1567 iCurAvg += piCur[n + 0]; 1568 iCurAvg += piCur[n + 1]; 1569 iCurAvg += piCur[n + 2]; 1570 iCurAvg += piCur[n + 3]; 1571 iCurAvg += piCur[n + 4]; 1572 iCurAvg += piCur[n + 5]; 1573 iCurAvg += piCur[n + 6]; 1574 iCurAvg += piCur[n + 7]; 1575 iCurAvg += piCur[n + 8]; 1576 iCurAvg += piCur[n + 9]; 1577 iCurAvg += piCur[n + 10]; 1578 iCurAvg += piCur[n + 11]; 1579 iCurAvg += piCur[n + 12]; 1580 iCurAvg += piCur[n + 13]; 1581 iCurAvg += piCur[n + 14]; 1582 iCurAvg += piCur[n + 15]; 1583 } 1584 piOrg += iStrideOrg; 1585 piCur += iStrideCur; 1586 uiRowCnt++; 1587 } 1588 piOrg = pcDtParam->pOrg; 1589 piCur = pcDtParam->pCur; 1590 iRows = pcDtParam->iRows; 1591 1592 iDeltaC = (uiRowCnt && uiColCnt) ? ((iOrigAvg - iCurAvg)/uiRowCnt/uiColCnt/16) : 0; 1593 1594 for( ; iRows != 0; iRows-=iSubStep ) 1595 { 1596 for (Int n = 0; n < iCols; n+=16 ) 1597 { 1598 uiSum += abs( piOrg[n+ 0] - piCur[n+ 0] - iDeltaC ); 1599 uiSum += abs( piOrg[n+ 1] - piCur[n+ 1] - iDeltaC ); 1600 uiSum += abs( piOrg[n+ 2] - piCur[n+ 2] - iDeltaC ); 1601 uiSum += abs( piOrg[n+ 3] - piCur[n+ 3] - iDeltaC ); 1602 uiSum += abs( piOrg[n+ 4] - piCur[n+ 4] - iDeltaC ); 1603 uiSum += abs( piOrg[n+ 5] - piCur[n+ 5] - iDeltaC ); 1604 uiSum += abs( piOrg[n+ 6] - piCur[n+ 6] - iDeltaC ); 1605 uiSum += abs( piOrg[n+ 7] - piCur[n+ 7] - iDeltaC ); 1606 uiSum += abs( piOrg[n+ 8] - piCur[n+ 8] - iDeltaC ); 1607 uiSum += abs( piOrg[n+ 9] - piCur[n+ 9] - iDeltaC ); 1608 uiSum += abs( piOrg[n+10] - piCur[n+10] - iDeltaC ); 1609 uiSum += abs( piOrg[n+11] - piCur[n+11] - iDeltaC ); 1610 uiSum += abs( piOrg[n+12] - piCur[n+12] - iDeltaC ); 1611 uiSum += abs( piOrg[n+13] - piCur[n+13] - iDeltaC ); 1612 uiSum += abs( piOrg[n+14] - piCur[n+14] - iDeltaC ); 1613 uiSum += abs( piOrg[n+15] - piCur[n+15] - iDeltaC ); 1614 } 1615 piOrg += iStrideOrg; 1616 piCur += iStrideCur; 1617 } 1618 1619 uiSum <<= iSubShift; 1620 return ( uiSum >> DISTORTION_PRECISION_ADJUSTMENT( pcDtParam->bitDepth - 8 ) ); 1621 } 1622 1623 UInt TComRdCost::xGetSAD32ic( DistParam* pcDtParam ) 1624 { 1625 if ( pcDtParam->bApplyWeight ) 1626 { 1627 return xGetSADw( pcDtParam ); 1628 } 1629 Pel* piOrg = pcDtParam->pOrg; 1630 Pel* piCur = pcDtParam->pCur; 1631 Int iRows = pcDtParam->iRows; 1632 Int iSubShift = pcDtParam->iSubShift; 1633 Int iSubStep = ( 1 << iSubShift ); 1634 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 1635 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 1636 1637 UInt uiSum = 0; 1638 1639 Int iOrigAvg = 0, iCurAvg = 0, uiRowCnt = 0; 1640 Int iDeltaC; 1641 1642 for( ; iRows != 0; iRows-=iSubStep ) 1643 { 1644 iOrigAvg += piOrg[0]; 1645 iOrigAvg += piOrg[1]; 1646 iOrigAvg += piOrg[2]; 1647 iOrigAvg += piOrg[3]; 1648 iOrigAvg += piOrg[4]; 1649 iOrigAvg += piOrg[5]; 1650 iOrigAvg += piOrg[6]; 1651 iOrigAvg += piOrg[7]; 1652 iOrigAvg += piOrg[8]; 1653 iOrigAvg += piOrg[9]; 1654 iOrigAvg += piOrg[10]; 1655 iOrigAvg += piOrg[11]; 1656 iOrigAvg += piOrg[12]; 1657 iOrigAvg += piOrg[13]; 1658 iOrigAvg += piOrg[14]; 1659 iOrigAvg += piOrg[15]; 1660 iOrigAvg += piOrg[16]; 1661 iOrigAvg += piOrg[17]; 1662 iOrigAvg += piOrg[18]; 1663 iOrigAvg += piOrg[19]; 1664 iOrigAvg += piOrg[20]; 1665 iOrigAvg += piOrg[21]; 1666 iOrigAvg += piOrg[22]; 1667 iOrigAvg += piOrg[23]; 1668 iOrigAvg += piOrg[24]; 1669 iOrigAvg += piOrg[25]; 1670 iOrigAvg += piOrg[26]; 1671 iOrigAvg += piOrg[27]; 1672 iOrigAvg += piOrg[28]; 1673 iOrigAvg += piOrg[29]; 1674 iOrigAvg += piOrg[30]; 1675 iOrigAvg += piOrg[31]; 1676 1677 iCurAvg += piCur[0]; 1678 iCurAvg += piCur[1]; 1679 iCurAvg += piCur[2]; 1680 iCurAvg += piCur[3]; 1681 iCurAvg += piCur[4]; 1682 iCurAvg += piCur[5]; 1683 iCurAvg += piCur[6]; 1684 iCurAvg += piCur[7]; 1685 iCurAvg += piCur[8]; 1686 iCurAvg += piCur[9]; 1687 iCurAvg += piCur[10]; 1688 iCurAvg += piCur[11]; 1689 iCurAvg += piCur[12]; 1690 iCurAvg += piCur[13]; 1691 iCurAvg += piCur[14]; 1692 iCurAvg += piCur[15]; 1693 iCurAvg += piCur[16]; 1694 iCurAvg += piCur[17]; 1695 iCurAvg += piCur[18]; 1696 iCurAvg += piCur[19]; 1697 iCurAvg += piCur[20]; 1698 iCurAvg += piCur[21]; 1699 iCurAvg += piCur[22]; 1700 iCurAvg += piCur[23]; 1701 iCurAvg += piCur[24]; 1702 iCurAvg += piCur[25]; 1703 iCurAvg += piCur[26]; 1704 iCurAvg += piCur[27]; 1705 iCurAvg += piCur[28]; 1706 iCurAvg += piCur[29]; 1707 iCurAvg += piCur[30]; 1708 iCurAvg += piCur[31]; 1709 1710 piOrg += iStrideOrg; 1711 piCur += iStrideCur; 1712 uiRowCnt++; 1713 } 1714 1715 piOrg = pcDtParam->pOrg; 1716 piCur = pcDtParam->pCur; 1717 iRows = pcDtParam->iRows; 1718 1719 iDeltaC = uiRowCnt ? ((iOrigAvg - iCurAvg)/uiRowCnt/32) : 0; 1720 1721 for( ; iRows != 0; iRows-=iSubStep ) 1722 { 1723 uiSum += abs( piOrg[0] - piCur[0] - iDeltaC ); 1724 uiSum += abs( piOrg[1] - piCur[1] - iDeltaC ); 1725 uiSum += abs( piOrg[2] - piCur[2] - iDeltaC ); 1726 uiSum += abs( piOrg[3] - piCur[3] - iDeltaC ); 1727 uiSum += abs( piOrg[4] - piCur[4] - iDeltaC ); 1728 uiSum += abs( piOrg[5] - piCur[5] - iDeltaC ); 1729 uiSum += abs( piOrg[6] - piCur[6] - iDeltaC ); 1730 uiSum += abs( piOrg[7] - piCur[7] - iDeltaC ); 1731 uiSum += abs( piOrg[8] - piCur[8] - iDeltaC ); 1732 uiSum += abs( piOrg[9] - piCur[9] - iDeltaC ); 1733 uiSum += abs( piOrg[10] - piCur[10] - iDeltaC ); 1734 uiSum += abs( piOrg[11] - piCur[11] - iDeltaC ); 1735 uiSum += abs( piOrg[12] - piCur[12] - iDeltaC ); 1736 uiSum += abs( piOrg[13] - piCur[13] - iDeltaC ); 1737 uiSum += abs( piOrg[14] - piCur[14] - iDeltaC ); 1738 uiSum += abs( piOrg[15] - piCur[15] - iDeltaC ); 1739 uiSum += abs( piOrg[16] - piCur[16] - iDeltaC ); 1740 uiSum += abs( piOrg[17] - piCur[17] - iDeltaC ); 1741 uiSum += abs( piOrg[18] - piCur[18] - iDeltaC ); 1742 uiSum += abs( piOrg[19] - piCur[19] - iDeltaC ); 1743 uiSum += abs( piOrg[20] - piCur[20] - iDeltaC ); 1744 uiSum += abs( piOrg[21] - piCur[21] - iDeltaC ); 1745 uiSum += abs( piOrg[22] - piCur[22] - iDeltaC ); 1746 uiSum += abs( piOrg[23] - piCur[23] - iDeltaC ); 1747 uiSum += abs( piOrg[24] - piCur[24] - iDeltaC ); 1748 uiSum += abs( piOrg[25] - piCur[25] - iDeltaC ); 1749 uiSum += abs( piOrg[26] - piCur[26] - iDeltaC ); 1750 uiSum += abs( piOrg[27] - piCur[27] - iDeltaC ); 1751 uiSum += abs( piOrg[28] - piCur[28] - iDeltaC ); 1752 uiSum += abs( piOrg[29] - piCur[29] - iDeltaC ); 1753 uiSum += abs( piOrg[30] - piCur[30] - iDeltaC ); 1754 uiSum += abs( piOrg[31] - piCur[31] - iDeltaC ); 1755 1756 piOrg += iStrideOrg; 1757 piCur += iStrideCur; 1758 } 1759 1760 uiSum <<= iSubShift; 1761 return ( uiSum >> DISTORTION_PRECISION_ADJUSTMENT( pcDtParam->bitDepth - 8 ) ); 1762 } 1763 1764 #if AMP_SAD 1765 UInt TComRdCost::xGetSAD24ic( DistParam* pcDtParam ) 1766 { 1767 if ( pcDtParam->bApplyWeight ) 1768 { 1769 return xGetSADw( pcDtParam ); 1770 } 1771 Pel* piOrg = pcDtParam->pOrg; 1772 Pel* piCur = pcDtParam->pCur; 1773 Int iRows = pcDtParam->iRows; 1774 Int iSubShift = pcDtParam->iSubShift; 1775 Int iSubStep = ( 1 << iSubShift ); 1776 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 1777 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 1778 1779 UInt uiSum = 0; 1780 1781 Int iOrigAvg = 0, iCurAvg = 0, uiRowCnt = 0; 1782 Int iDeltaC; 1783 1784 for( ; iRows != 0; iRows-=iSubStep ) 1785 { 1786 iOrigAvg += piOrg[0]; 1787 iOrigAvg += piOrg[1]; 1788 iOrigAvg += piOrg[2]; 1789 iOrigAvg += piOrg[3]; 1790 iOrigAvg += piOrg[4]; 1791 iOrigAvg += piOrg[5]; 1792 iOrigAvg += piOrg[6]; 1793 iOrigAvg += piOrg[7]; 1794 iOrigAvg += piOrg[8]; 1795 iOrigAvg += piOrg[9]; 1796 iOrigAvg += piOrg[10]; 1797 iOrigAvg += piOrg[11]; 1798 iOrigAvg += piOrg[12]; 1799 iOrigAvg += piOrg[13]; 1800 iOrigAvg += piOrg[14]; 1801 iOrigAvg += piOrg[15]; 1802 iOrigAvg += piOrg[16]; 1803 iOrigAvg += piOrg[17]; 1804 iOrigAvg += piOrg[18]; 1805 iOrigAvg += piOrg[19]; 1806 iOrigAvg += piOrg[20]; 1807 iOrigAvg += piOrg[21]; 1808 iOrigAvg += piOrg[22]; 1809 iOrigAvg += piOrg[23]; 1810 1811 iCurAvg += piCur[0]; 1812 iCurAvg += piCur[1]; 1813 iCurAvg += piCur[2]; 1814 iCurAvg += piCur[3]; 1815 iCurAvg += piCur[4]; 1816 iCurAvg += piCur[5]; 1817 iCurAvg += piCur[6]; 1818 iCurAvg += piCur[7]; 1819 iCurAvg += piCur[8]; 1820 iCurAvg += piCur[9]; 1821 iCurAvg += piCur[10]; 1822 iCurAvg += piCur[11]; 1823 iCurAvg += piCur[12]; 1824 iCurAvg += piCur[13]; 1825 iCurAvg += piCur[14]; 1826 iCurAvg += piCur[15]; 1827 iCurAvg += piCur[16]; 1828 iCurAvg += piCur[17]; 1829 iCurAvg += piCur[18]; 1830 iCurAvg += piCur[19]; 1831 iCurAvg += piCur[20]; 1832 iCurAvg += piCur[21]; 1833 iCurAvg += piCur[22]; 1834 iCurAvg += piCur[23]; 1835 1836 piOrg += iStrideOrg; 1837 piCur += iStrideCur; 1838 uiRowCnt++; 1839 } 1840 1841 piOrg = pcDtParam->pOrg; 1842 piCur = pcDtParam->pCur; 1843 iRows = pcDtParam->iRows; 1844 1845 iDeltaC = uiRowCnt ? ((iOrigAvg - iCurAvg)/uiRowCnt/24) : 0; 1846 1847 for( ; iRows != 0; iRows-=iSubStep ) 1848 { 1849 uiSum += abs( piOrg[0] - piCur[0] - iDeltaC ); 1850 uiSum += abs( piOrg[1] - piCur[1] - iDeltaC ); 1851 uiSum += abs( piOrg[2] - piCur[2] - iDeltaC ); 1852 uiSum += abs( piOrg[3] - piCur[3] - iDeltaC ); 1853 uiSum += abs( piOrg[4] - piCur[4] - iDeltaC ); 1854 uiSum += abs( piOrg[5] - piCur[5] - iDeltaC ); 1855 uiSum += abs( piOrg[6] - piCur[6] - iDeltaC ); 1856 uiSum += abs( piOrg[7] - piCur[7] - iDeltaC ); 1857 uiSum += abs( piOrg[8] - piCur[8] - iDeltaC ); 1858 uiSum += abs( piOrg[9] - piCur[9] - iDeltaC ); 1859 uiSum += abs( piOrg[10] - piCur[10] - iDeltaC ); 1860 uiSum += abs( piOrg[11] - piCur[11] - iDeltaC ); 1861 uiSum += abs( piOrg[12] - piCur[12] - iDeltaC ); 1862 uiSum += abs( piOrg[13] - piCur[13] - iDeltaC ); 1863 uiSum += abs( piOrg[14] - piCur[14] - iDeltaC ); 1864 uiSum += abs( piOrg[15] - piCur[15] - iDeltaC ); 1865 uiSum += abs( piOrg[16] - piCur[16] - iDeltaC ); 1866 uiSum += abs( piOrg[17] - piCur[17] - iDeltaC ); 1867 uiSum += abs( piOrg[18] - piCur[18] - iDeltaC ); 1868 uiSum += abs( piOrg[19] - piCur[19] - iDeltaC ); 1869 uiSum += abs( piOrg[20] - piCur[20] - iDeltaC ); 1870 uiSum += abs( piOrg[21] - piCur[21] - iDeltaC ); 1871 uiSum += abs( piOrg[22] - piCur[22] - iDeltaC ); 1872 uiSum += abs( piOrg[23] - piCur[23] - iDeltaC ); 1873 1874 piOrg += iStrideOrg; 1875 piCur += iStrideCur; 1876 } 1877 1878 uiSum <<= iSubShift; 1879 return ( uiSum >> DISTORTION_PRECISION_ADJUSTMENT( pcDtParam->bitDepth - 8 ) ); 1880 } 1881 #endif 1882 1883 UInt TComRdCost::xGetSAD64ic( DistParam* pcDtParam ) 1884 { 1885 if ( pcDtParam->bApplyWeight ) 1886 { 1887 return xGetSADw( pcDtParam ); 1888 } 1889 Pel* piOrg = pcDtParam->pOrg; 1890 Pel* piCur = pcDtParam->pCur; 1891 Int iRows = pcDtParam->iRows; 1892 Int iSubShift = pcDtParam->iSubShift; 1893 Int iSubStep = ( 1 << iSubShift ); 1894 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 1895 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 1896 1897 UInt uiSum = 0; 1898 1899 Int iOrigAvg = 0, iCurAvg = 0, uiRowCnt = 0; 1900 Int iDeltaC; 1901 1902 for( ; iRows != 0; iRows-=iSubStep ) 1903 { 1904 iOrigAvg += piOrg[0] ; 1905 iOrigAvg += piOrg[1] ; 1906 iOrigAvg += piOrg[2] ; 1907 iOrigAvg += piOrg[3] ; 1908 iOrigAvg += piOrg[4] ; 1909 iOrigAvg += piOrg[5] ; 1910 iOrigAvg += piOrg[6] ; 1911 iOrigAvg += piOrg[7] ; 1912 iOrigAvg += piOrg[8] ; 1913 iOrigAvg += piOrg[9] ; 1914 iOrigAvg += piOrg[10] ; 1915 iOrigAvg += piOrg[11] ; 1916 iOrigAvg += piOrg[12] ; 1917 iOrigAvg += piOrg[13] ; 1918 iOrigAvg += piOrg[14] ; 1919 iOrigAvg += piOrg[15] ; 1920 iOrigAvg += piOrg[16] ; 1921 iOrigAvg += piOrg[17] ; 1922 iOrigAvg += piOrg[18] ; 1923 iOrigAvg += piOrg[19] ; 1924 iOrigAvg += piOrg[20] ; 1925 iOrigAvg += piOrg[21] ; 1926 iOrigAvg += piOrg[22] ; 1927 iOrigAvg += piOrg[23] ; 1928 iOrigAvg += piOrg[24] ; 1929 iOrigAvg += piOrg[25] ; 1930 iOrigAvg += piOrg[26] ; 1931 iOrigAvg += piOrg[27] ; 1932 iOrigAvg += piOrg[28] ; 1933 iOrigAvg += piOrg[29] ; 1934 iOrigAvg += piOrg[30] ; 1935 iOrigAvg += piOrg[31] ; 1936 iOrigAvg += piOrg[32] ; 1937 iOrigAvg += piOrg[33] ; 1938 iOrigAvg += piOrg[34] ; 1939 iOrigAvg += piOrg[35] ; 1940 iOrigAvg += piOrg[36] ; 1941 iOrigAvg += piOrg[37] ; 1942 iOrigAvg += piOrg[38] ; 1943 iOrigAvg += piOrg[39] ; 1944 iOrigAvg += piOrg[40] ; 1945 iOrigAvg += piOrg[41] ; 1946 iOrigAvg += piOrg[42] ; 1947 iOrigAvg += piOrg[43] ; 1948 iOrigAvg += piOrg[44] ; 1949 iOrigAvg += piOrg[45] ; 1950 iOrigAvg += piOrg[46] ; 1951 iOrigAvg += piOrg[47] ; 1952 iOrigAvg += piOrg[48] ; 1953 iOrigAvg += piOrg[49] ; 1954 iOrigAvg += piOrg[50] ; 1955 iOrigAvg += piOrg[51] ; 1956 iOrigAvg += piOrg[52] ; 1957 iOrigAvg += piOrg[53] ; 1958 iOrigAvg += piOrg[54] ; 1959 iOrigAvg += piOrg[55] ; 1960 iOrigAvg += piOrg[56] ; 1961 iOrigAvg += piOrg[57] ; 1962 iOrigAvg += piOrg[58] ; 1963 iOrigAvg += piOrg[59] ; 1964 iOrigAvg += piOrg[60] ; 1965 iOrigAvg += piOrg[61] ; 1966 iOrigAvg += piOrg[62] ; 1967 iOrigAvg += piOrg[63] ; 1968 1969 iCurAvg += piCur[0] ; 1970 iCurAvg += piCur[1] ; 1971 iCurAvg += piCur[2] ; 1972 iCurAvg += piCur[3] ; 1973 iCurAvg += piCur[4] ; 1974 iCurAvg += piCur[5] ; 1975 iCurAvg += piCur[6] ; 1976 iCurAvg += piCur[7] ; 1977 iCurAvg += piCur[8] ; 1978 iCurAvg += piCur[9] ; 1979 iCurAvg += piCur[10] ; 1980 iCurAvg += piCur[11] ; 1981 iCurAvg += piCur[12] ; 1982 iCurAvg += piCur[13] ; 1983 iCurAvg += piCur[14] ; 1984 iCurAvg += piCur[15] ; 1985 iCurAvg += piCur[16] ; 1986 iCurAvg += piCur[17] ; 1987 iCurAvg += piCur[18] ; 1988 iCurAvg += piCur[19] ; 1989 iCurAvg += piCur[20] ; 1990 iCurAvg += piCur[21] ; 1991 iCurAvg += piCur[22] ; 1992 iCurAvg += piCur[23] ; 1993 iCurAvg += piCur[24] ; 1994 iCurAvg += piCur[25] ; 1995 iCurAvg += piCur[26] ; 1996 iCurAvg += piCur[27] ; 1997 iCurAvg += piCur[28] ; 1998 iCurAvg += piCur[29] ; 1999 iCurAvg += piCur[30] ; 2000 iCurAvg += piCur[31] ; 2001 iCurAvg += piCur[32] ; 2002 iCurAvg += piCur[33] ; 2003 iCurAvg += piCur[34] ; 2004 iCurAvg += piCur[35] ; 2005 iCurAvg += piCur[36] ; 2006 iCurAvg += piCur[37] ; 2007 iCurAvg += piCur[38] ; 2008 iCurAvg += piCur[39] ; 2009 iCurAvg += piCur[40] ; 2010 iCurAvg += piCur[41] ; 2011 iCurAvg += piCur[42] ; 2012 iCurAvg += piCur[43] ; 2013 iCurAvg += piCur[44] ; 2014 iCurAvg += piCur[45] ; 2015 iCurAvg += piCur[46] ; 2016 iCurAvg += piCur[47] ; 2017 iCurAvg += piCur[48] ; 2018 iCurAvg += piCur[49] ; 2019 iCurAvg += piCur[50] ; 2020 iCurAvg += piCur[51] ; 2021 iCurAvg += piCur[52] ; 2022 iCurAvg += piCur[53] ; 2023 iCurAvg += piCur[54] ; 2024 iCurAvg += piCur[55] ; 2025 iCurAvg += piCur[56] ; 2026 iCurAvg += piCur[57] ; 2027 iCurAvg += piCur[58] ; 2028 iCurAvg += piCur[59] ; 2029 iCurAvg += piCur[60] ; 2030 iCurAvg += piCur[61] ; 2031 iCurAvg += piCur[62] ; 2032 iCurAvg += piCur[63] ; 2033 2034 piOrg += iStrideOrg; 2035 piCur += iStrideCur; 2036 uiRowCnt++; 2037 } 2038 2039 piOrg = pcDtParam->pOrg; 2040 piCur = pcDtParam->pCur; 2041 iRows = pcDtParam->iRows; 2042 2043 iDeltaC = uiRowCnt ? ((iOrigAvg - iCurAvg)/uiRowCnt/64) : 0; 2044 2045 for( ; iRows != 0; iRows-=iSubStep ) 2046 { 2047 uiSum += abs( piOrg[0] - piCur[0] - iDeltaC ); 2048 uiSum += abs( piOrg[1] - piCur[1] - iDeltaC ); 2049 uiSum += abs( piOrg[2] - piCur[2] - iDeltaC ); 2050 uiSum += abs( piOrg[3] - piCur[3] - iDeltaC ); 2051 uiSum += abs( piOrg[4] - piCur[4] - iDeltaC ); 2052 uiSum += abs( piOrg[5] - piCur[5] - iDeltaC ); 2053 uiSum += abs( piOrg[6] - piCur[6] - iDeltaC ); 2054 uiSum += abs( piOrg[7] - piCur[7] - iDeltaC ); 2055 uiSum += abs( piOrg[8] - piCur[8] - iDeltaC ); 2056 uiSum += abs( piOrg[9] - piCur[9] - iDeltaC ); 2057 uiSum += abs( piOrg[10] - piCur[10] - iDeltaC ); 2058 uiSum += abs( piOrg[11] - piCur[11] - iDeltaC ); 2059 uiSum += abs( piOrg[12] - piCur[12] - iDeltaC ); 2060 uiSum += abs( piOrg[13] - piCur[13] - iDeltaC ); 2061 uiSum += abs( piOrg[14] - piCur[14] - iDeltaC ); 2062 uiSum += abs( piOrg[15] - piCur[15] - iDeltaC ); 2063 uiSum += abs( piOrg[16] - piCur[16] - iDeltaC ); 2064 uiSum += abs( piOrg[17] - piCur[17] - iDeltaC ); 2065 uiSum += abs( piOrg[18] - piCur[18] - iDeltaC ); 2066 uiSum += abs( piOrg[19] - piCur[19] - iDeltaC ); 2067 uiSum += abs( piOrg[20] - piCur[20] - iDeltaC ); 2068 uiSum += abs( piOrg[21] - piCur[21] - iDeltaC ); 2069 uiSum += abs( piOrg[22] - piCur[22] - iDeltaC ); 2070 uiSum += abs( piOrg[23] - piCur[23] - iDeltaC ); 2071 uiSum += abs( piOrg[24] - piCur[24] - iDeltaC ); 2072 uiSum += abs( piOrg[25] - piCur[25] - iDeltaC ); 2073 uiSum += abs( piOrg[26] - piCur[26] - iDeltaC ); 2074 uiSum += abs( piOrg[27] - piCur[27] - iDeltaC ); 2075 uiSum += abs( piOrg[28] - piCur[28] - iDeltaC ); 2076 uiSum += abs( piOrg[29] - piCur[29] - iDeltaC ); 2077 uiSum += abs( piOrg[30] - piCur[30] - iDeltaC ); 2078 uiSum += abs( piOrg[31] - piCur[31] - iDeltaC ); 2079 uiSum += abs( piOrg[32] - piCur[32] - iDeltaC ); 2080 uiSum += abs( piOrg[33] - piCur[33] - iDeltaC ); 2081 uiSum += abs( piOrg[34] - piCur[34] - iDeltaC ); 2082 uiSum += abs( piOrg[35] - piCur[35] - iDeltaC ); 2083 uiSum += abs( piOrg[36] - piCur[36] - iDeltaC ); 2084 uiSum += abs( piOrg[37] - piCur[37] - iDeltaC ); 2085 uiSum += abs( piOrg[38] - piCur[38] - iDeltaC ); 2086 uiSum += abs( piOrg[39] - piCur[39] - iDeltaC ); 2087 uiSum += abs( piOrg[40] - piCur[40] - iDeltaC ); 2088 uiSum += abs( piOrg[41] - piCur[41] - iDeltaC ); 2089 uiSum += abs( piOrg[42] - piCur[42] - iDeltaC ); 2090 uiSum += abs( piOrg[43] - piCur[43] - iDeltaC ); 2091 uiSum += abs( piOrg[44] - piCur[44] - iDeltaC ); 2092 uiSum += abs( piOrg[45] - piCur[45] - iDeltaC ); 2093 uiSum += abs( piOrg[46] - piCur[46] - iDeltaC ); 2094 uiSum += abs( piOrg[47] - piCur[47] - iDeltaC ); 2095 uiSum += abs( piOrg[48] - piCur[48] - iDeltaC ); 2096 uiSum += abs( piOrg[49] - piCur[49] - iDeltaC ); 2097 uiSum += abs( piOrg[50] - piCur[50] - iDeltaC ); 2098 uiSum += abs( piOrg[51] - piCur[51] - iDeltaC ); 2099 uiSum += abs( piOrg[52] - piCur[52] - iDeltaC ); 2100 uiSum += abs( piOrg[53] - piCur[53] - iDeltaC ); 2101 uiSum += abs( piOrg[54] - piCur[54] - iDeltaC ); 2102 uiSum += abs( piOrg[55] - piCur[55] - iDeltaC ); 2103 uiSum += abs( piOrg[56] - piCur[56] - iDeltaC ); 2104 uiSum += abs( piOrg[57] - piCur[57] - iDeltaC ); 2105 uiSum += abs( piOrg[58] - piCur[58] - iDeltaC ); 2106 uiSum += abs( piOrg[59] - piCur[59] - iDeltaC ); 2107 uiSum += abs( piOrg[60] - piCur[60] - iDeltaC ); 2108 uiSum += abs( piOrg[61] - piCur[61] - iDeltaC ); 2109 uiSum += abs( piOrg[62] - piCur[62] - iDeltaC ); 2110 uiSum += abs( piOrg[63] - piCur[63] - iDeltaC ); 2111 2112 piOrg += iStrideOrg; 2113 piCur += iStrideCur; 2114 } 2115 2116 uiSum <<= iSubShift; 2117 return ( uiSum >> DISTORTION_PRECISION_ADJUSTMENT( pcDtParam->bitDepth - 8 ) ); 2118 } 2119 2120 #if AMP_SAD 2121 UInt TComRdCost::xGetSAD48ic( DistParam* pcDtParam ) 2122 { 2123 if ( pcDtParam->bApplyWeight ) 2124 { 2125 return xGetSADw( pcDtParam ); 2126 } 2127 2128 Pel* piOrg = pcDtParam->pOrg; 2129 Pel* piCur = pcDtParam->pCur; 2130 Int iRows = pcDtParam->iRows; 2131 Int iSubShift = pcDtParam->iSubShift; 2132 Int iSubStep = ( 1 << iSubShift ); 2133 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 2134 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 2135 2136 UInt uiSum = 0; 2137 2138 Int iOrigAvg = 0, iCurAvg = 0, uiRowCnt = 0; 2139 Int iDeltaC; 2140 2141 for( ; iRows != 0; iRows-=iSubStep ) 2142 { 2143 iOrigAvg += piOrg[0] ; 2144 iOrigAvg += piOrg[1] ; 2145 iOrigAvg += piOrg[2] ; 2146 iOrigAvg += piOrg[3] ; 2147 iOrigAvg += piOrg[4] ; 2148 iOrigAvg += piOrg[5] ; 2149 iOrigAvg += piOrg[6] ; 2150 iOrigAvg += piOrg[7] ; 2151 iOrigAvg += piOrg[8] ; 2152 iOrigAvg += piOrg[9] ; 2153 iOrigAvg += piOrg[10] ; 2154 iOrigAvg += piOrg[11] ; 2155 iOrigAvg += piOrg[12] ; 2156 iOrigAvg += piOrg[13] ; 2157 iOrigAvg += piOrg[14] ; 2158 iOrigAvg += piOrg[15] ; 2159 iOrigAvg += piOrg[16] ; 2160 iOrigAvg += piOrg[17] ; 2161 iOrigAvg += piOrg[18] ; 2162 iOrigAvg += piOrg[19] ; 2163 iOrigAvg += piOrg[20] ; 2164 iOrigAvg += piOrg[21] ; 2165 iOrigAvg += piOrg[22] ; 2166 iOrigAvg += piOrg[23] ; 2167 iOrigAvg += piOrg[24] ; 2168 iOrigAvg += piOrg[25] ; 2169 iOrigAvg += piOrg[26] ; 2170 iOrigAvg += piOrg[27] ; 2171 iOrigAvg += piOrg[28] ; 2172 iOrigAvg += piOrg[29] ; 2173 iOrigAvg += piOrg[30] ; 2174 iOrigAvg += piOrg[31] ; 2175 iOrigAvg += piOrg[32] ; 2176 iOrigAvg += piOrg[33] ; 2177 iOrigAvg += piOrg[34] ; 2178 iOrigAvg += piOrg[35] ; 2179 iOrigAvg += piOrg[36] ; 2180 iOrigAvg += piOrg[37] ; 2181 iOrigAvg += piOrg[38] ; 2182 iOrigAvg += piOrg[39] ; 2183 iOrigAvg += piOrg[40] ; 2184 iOrigAvg += piOrg[41] ; 2185 iOrigAvg += piOrg[42] ; 2186 iOrigAvg += piOrg[43] ; 2187 iOrigAvg += piOrg[44] ; 2188 iOrigAvg += piOrg[45] ; 2189 iOrigAvg += piOrg[46] ; 2190 iOrigAvg += piOrg[47] ; 2191 2192 iCurAvg += piCur[0] ; 2193 iCurAvg += piCur[1] ; 2194 iCurAvg += piCur[2] ; 2195 iCurAvg += piCur[3] ; 2196 iCurAvg += piCur[4] ; 2197 iCurAvg += piCur[5] ; 2198 iCurAvg += piCur[6] ; 2199 iCurAvg += piCur[7] ; 2200 iCurAvg += piCur[8] ; 2201 iCurAvg += piCur[9] ; 2202 iCurAvg += piCur[10] ; 2203 iCurAvg += piCur[11] ; 2204 iCurAvg += piCur[12] ; 2205 iCurAvg += piCur[13] ; 2206 iCurAvg += piCur[14] ; 2207 iCurAvg += piCur[15] ; 2208 iCurAvg += piCur[16] ; 2209 iCurAvg += piCur[17] ; 2210 iCurAvg += piCur[18] ; 2211 iCurAvg += piCur[19] ; 2212 iCurAvg += piCur[20] ; 2213 iCurAvg += piCur[21] ; 2214 iCurAvg += piCur[22] ; 2215 iCurAvg += piCur[23] ; 2216 iCurAvg += piCur[24] ; 2217 iCurAvg += piCur[25] ; 2218 iCurAvg += piCur[26] ; 2219 iCurAvg += piCur[27] ; 2220 iCurAvg += piCur[28] ; 2221 iCurAvg += piCur[29] ; 2222 iCurAvg += piCur[30] ; 2223 iCurAvg += piCur[31] ; 2224 iCurAvg += piCur[32] ; 2225 iCurAvg += piCur[33] ; 2226 iCurAvg += piCur[34] ; 2227 iCurAvg += piCur[35] ; 2228 iCurAvg += piCur[36] ; 2229 iCurAvg += piCur[37] ; 2230 iCurAvg += piCur[38] ; 2231 iCurAvg += piCur[39] ; 2232 iCurAvg += piCur[40] ; 2233 iCurAvg += piCur[41] ; 2234 iCurAvg += piCur[42] ; 2235 iCurAvg += piCur[43] ; 2236 iCurAvg += piCur[44] ; 2237 iCurAvg += piCur[45] ; 2238 iCurAvg += piCur[46] ; 2239 iCurAvg += piCur[47] ; 2240 2241 piOrg += iStrideOrg; 2242 piCur += iStrideCur; 2243 uiRowCnt++; 2244 } 2245 2246 piOrg = pcDtParam->pOrg; 2247 piCur = pcDtParam->pCur; 2248 iRows = pcDtParam->iRows; 2249 2250 iDeltaC = uiRowCnt ? ((iOrigAvg - iCurAvg)/uiRowCnt/48) : 0; 2251 2252 for( ; iRows != 0; iRows-=iSubStep ) 2253 { 2254 uiSum += abs( piOrg[0] - piCur[0] - iDeltaC ); 2255 uiSum += abs( piOrg[1] - piCur[1] - iDeltaC ); 2256 uiSum += abs( piOrg[2] - piCur[2] - iDeltaC ); 2257 uiSum += abs( piOrg[3] - piCur[3] - iDeltaC ); 2258 uiSum += abs( piOrg[4] - piCur[4] - iDeltaC ); 2259 uiSum += abs( piOrg[5] - piCur[5] - iDeltaC ); 2260 uiSum += abs( piOrg[6] - piCur[6] - iDeltaC ); 2261 uiSum += abs( piOrg[7] - piCur[7] - iDeltaC ); 2262 uiSum += abs( piOrg[8] - piCur[8] - iDeltaC ); 2263 uiSum += abs( piOrg[9] - piCur[9] - iDeltaC ); 2264 uiSum += abs( piOrg[10] - piCur[10] - iDeltaC ); 2265 uiSum += abs( piOrg[11] - piCur[11] - iDeltaC ); 2266 uiSum += abs( piOrg[12] - piCur[12] - iDeltaC ); 2267 uiSum += abs( piOrg[13] - piCur[13] - iDeltaC ); 2268 uiSum += abs( piOrg[14] - piCur[14] - iDeltaC ); 2269 uiSum += abs( piOrg[15] - piCur[15] - iDeltaC ); 2270 uiSum += abs( piOrg[16] - piCur[16] - iDeltaC ); 2271 uiSum += abs( piOrg[17] - piCur[17] - iDeltaC ); 2272 uiSum += abs( piOrg[18] - piCur[18] - iDeltaC ); 2273 uiSum += abs( piOrg[19] - piCur[19] - iDeltaC ); 2274 uiSum += abs( piOrg[20] - piCur[20] - iDeltaC ); 2275 uiSum += abs( piOrg[21] - piCur[21] - iDeltaC ); 2276 uiSum += abs( piOrg[22] - piCur[22] - iDeltaC ); 2277 uiSum += abs( piOrg[23] - piCur[23] - iDeltaC ); 2278 uiSum += abs( piOrg[24] - piCur[24] - iDeltaC ); 2279 uiSum += abs( piOrg[25] - piCur[25] - iDeltaC ); 2280 uiSum += abs( piOrg[26] - piCur[26] - iDeltaC ); 2281 uiSum += abs( piOrg[27] - piCur[27] - iDeltaC ); 2282 uiSum += abs( piOrg[28] - piCur[28] - iDeltaC ); 2283 uiSum += abs( piOrg[29] - piCur[29] - iDeltaC ); 2284 uiSum += abs( piOrg[30] - piCur[30] - iDeltaC ); 2285 uiSum += abs( piOrg[31] - piCur[31] - iDeltaC ); 2286 uiSum += abs( piOrg[32] - piCur[32] - iDeltaC ); 2287 uiSum += abs( piOrg[33] - piCur[33] - iDeltaC ); 2288 uiSum += abs( piOrg[34] - piCur[34] - iDeltaC ); 2289 uiSum += abs( piOrg[35] - piCur[35] - iDeltaC ); 2290 uiSum += abs( piOrg[36] - piCur[36] - iDeltaC ); 2291 uiSum += abs( piOrg[37] - piCur[37] - iDeltaC ); 2292 uiSum += abs( piOrg[38] - piCur[38] - iDeltaC ); 2293 uiSum += abs( piOrg[39] - piCur[39] - iDeltaC ); 2294 uiSum += abs( piOrg[40] - piCur[40] - iDeltaC ); 2295 uiSum += abs( piOrg[41] - piCur[41] - iDeltaC ); 2296 uiSum += abs( piOrg[42] - piCur[42] - iDeltaC ); 2297 uiSum += abs( piOrg[43] - piCur[43] - iDeltaC ); 2298 uiSum += abs( piOrg[44] - piCur[44] - iDeltaC ); 2299 uiSum += abs( piOrg[45] - piCur[45] - iDeltaC ); 2300 uiSum += abs( piOrg[46] - piCur[46] - iDeltaC ); 2301 uiSum += abs( piOrg[47] - piCur[47] - iDeltaC ); 2302 2303 piOrg += iStrideOrg; 2304 piCur += iStrideCur; 2305 } 2306 2307 uiSum <<= iSubShift; 2308 return ( uiSum >> DISTORTION_PRECISION_ADJUSTMENT( pcDtParam->bitDepth - 8 ) ); 2309 } 2310 #endif 2311 2312 #endif 1096 2313 // -------------------------------------------------------------------------------------------------------------------- 1097 2314 // SSE … … 2206 3423 return xGetHADsw( pcDtParam ); 2207 3424 } 3425 3426 #if H_3D_IC 3427 if( pcDtParam->bUseIC ) 3428 { 3429 return xGetHADsic( pcDtParam ); 3430 } 3431 #endif 3432 2208 3433 Pel* piOrg = pcDtParam->pOrg; 2209 3434 Pel* piCur = pcDtParam->pCur; … … 2302 3527 return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8); 2303 3528 } 3529 3530 #if H_3D_IC 3531 UInt TComRdCost::xGetHADsic( DistParam* pcDtParam ) 3532 { 3533 if ( pcDtParam->bApplyWeight ) 3534 { 3535 return xGetHADsw( pcDtParam ); 3536 } 3537 Pel* piOrg = pcDtParam->pOrg; 3538 Pel* piCur = pcDtParam->pCur; 3539 Int iRows = pcDtParam->iRows; 3540 Int iCols = pcDtParam->iCols; 3541 Int iStrideCur = pcDtParam->iStrideCur; 3542 Int iStrideOrg = pcDtParam->iStrideOrg; 3543 Int iStep = pcDtParam->iStep; 3544 3545 Int x, y; 3546 3547 UInt uiSum = 0; 3548 3549 Int iOrigAvg = 0, iCurAvg = 0; 3550 Int iDeltaC; 3551 3552 for ( y=0; y<iRows; y++ ) 3553 { 3554 for ( x=0; x<iCols; x++ ) 3555 { 3556 iOrigAvg += piOrg[x]; 3557 iCurAvg += piCur[x]; 3558 } 3559 piOrg += iStrideOrg; 3560 piCur += iStrideCur; 3561 } 3562 3563 piOrg = pcDtParam->pOrg; 3564 piCur = pcDtParam->pCur; 3565 3566 iDeltaC = (iOrigAvg - iCurAvg)/iRows/iCols; 3567 3568 for ( y=0; y<iRows; y++ ) 3569 { 3570 for ( x=0; x<iCols; x++ ) 3571 { 3572 piOrg[x] -= iDeltaC; 3573 } 3574 piOrg += iStrideOrg; 3575 } 3576 3577 piOrg = pcDtParam->pOrg; 3578 3579 #if NS_HAD 3580 if( ( ( iRows % 8 == 0) && (iCols % 8 == 0) && ( iRows == iCols ) ) || ( ( iRows % 8 == 0 ) && (iCols % 8 == 0) && !pcDtParam->bUseNSHAD ) ) 3581 #else 3582 if( ( iRows % 8 == 0) && (iCols % 8 == 0) ) 3583 #endif 3584 { 3585 Int iOffsetOrg = iStrideOrg<<3; 3586 Int iOffsetCur = iStrideCur<<3; 3587 for ( y=0; y<iRows; y+= 8 ) 3588 { 3589 for ( x=0; x<iCols; x+= 8 ) 3590 { 3591 uiSum += xCalcHADs8x8( &piOrg[x], &piCur[x*iStep], iStrideOrg, iStrideCur, iStep ); 3592 } 3593 piOrg += iOffsetOrg; 3594 piCur += iOffsetCur; 3595 } 3596 } 3597 #if NS_HAD 3598 else if ( ( iCols > 8 ) && ( iCols > iRows ) && pcDtParam->bUseNSHAD ) 3599 { 3600 Int iOffsetOrg = iStrideOrg<<2; 3601 Int iOffsetCur = iStrideCur<<2; 3602 for ( y=0; y<iRows; y+= 4 ) 3603 { 3604 for ( x=0; x<iCols; x+= 16 ) 3605 { 3606 uiSum += xCalcHADs16x4( &piOrg[x], &piCur[x*iStep], iStrideOrg, iStrideCur, iStep ); 3607 } 3608 piOrg += iOffsetOrg; 3609 piCur += iOffsetCur; 3610 } 3611 } 3612 else if ( ( iRows > 8 ) && ( iCols < iRows ) && pcDtParam->bUseNSHAD ) 3613 { 3614 Int iOffsetOrg = iStrideOrg<<4; 3615 Int iOffsetCur = iStrideCur<<4; 3616 for ( y=0; y<iRows; y+= 16 ) 3617 { 3618 for ( x=0; x<iCols; x+= 4 ) 3619 { 3620 uiSum += xCalcHADs4x16( &piOrg[x], &piCur[x*iStep], iStrideOrg, iStrideCur, iStep ); 3621 } 3622 piOrg += iOffsetOrg; 3623 piCur += iOffsetCur; 3624 } 3625 } 3626 #endif 3627 else if( ( iRows % 4 == 0) && (iCols % 4 == 0) ) 3628 { 3629 Int iOffsetOrg = iStrideOrg<<2; 3630 Int iOffsetCur = iStrideCur<<2; 3631 3632 for ( y=0; y<iRows; y+= 4 ) 3633 { 3634 for ( x=0; x<iCols; x+= 4 ) 3635 { 3636 uiSum += xCalcHADs4x4( &piOrg[x], &piCur[x*iStep], iStrideOrg, iStrideCur, iStep ); 3637 } 3638 piOrg += iOffsetOrg; 3639 piCur += iOffsetCur; 3640 } 3641 } 3642 else if( ( iRows % 2 == 0) && (iCols % 2 == 0) ) 3643 { 3644 Int iOffsetOrg = iStrideOrg<<1; 3645 Int iOffsetCur = iStrideCur<<1; 3646 for ( y=0; y<iRows; y+=2 ) 3647 { 3648 for ( x=0; x<iCols; x+=2 ) 3649 { 3650 uiSum += xCalcHADs2x2( &piOrg[x], &piCur[x*iStep], iStrideOrg, iStrideCur, iStep ); 3651 } 3652 piOrg += iOffsetOrg; 3653 piCur += iOffsetCur; 3654 } 3655 } 3656 else 3657 { 3658 assert(false); 3659 } 3660 3661 piOrg = pcDtParam->pOrg; 3662 3663 for ( y=0; y<iRows; y++ ) 3664 { 3665 for ( x=0; x<iCols; x++ ) 3666 { 3667 piOrg[x] += iDeltaC; 3668 } 3669 piOrg += iStrideOrg; 3670 } 3671 3672 return ( uiSum >> DISTORTION_PRECISION_ADJUSTMENT( pcDtParam->bitDepth - 8 ) ); 3673 } 3674 #endif 3675 2304 3676 #if H_3D_VSO 2305 3677 Void TComRdCost::setLambdaVSO( Double dLambdaVSO ) -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComRdCost.h
r446 r504 91 91 Int iStrideVir; 92 92 #endif 93 #if H_3D_IC 94 Bool bUseIC; 95 #endif 93 96 Int iRows; 94 97 Int iCols; … … 268 271 static UInt xGetSSE64 ( DistParam* pcDtParam ); 269 272 static UInt xGetSSE16N ( DistParam* pcDtParam ); 270 273 #if H_3D_IC 274 static UInt xGetSADic ( DistParam* pcDtParam ); 275 static UInt xGetSAD4ic ( DistParam* pcDtParam ); 276 static UInt xGetSAD8ic ( DistParam* pcDtParam ); 277 static UInt xGetSAD16ic ( DistParam* pcDtParam ); 278 static UInt xGetSAD32ic ( DistParam* pcDtParam ); 279 static UInt xGetSAD64ic ( DistParam* pcDtParam ); 280 static UInt xGetSAD16Nic ( DistParam* pcDtParam ); 281 #endif 271 282 static UInt xGetSAD ( DistParam* pcDtParam ); 272 283 static UInt xGetSAD4 ( DistParam* pcDtParam ); … … 288 299 289 300 #if AMP_SAD 301 #if H_3D_IC 302 static UInt xGetSAD12ic ( DistParam* pcDtParam ); 303 static UInt xGetSAD24ic ( DistParam* pcDtParam ); 304 static UInt xGetSAD48ic ( DistParam* pcDtParam ); 305 #endif 290 306 static UInt xGetSAD12 ( DistParam* pcDtParam ); 291 307 static UInt xGetSAD24 ( DistParam* pcDtParam ); … … 294 310 #endif 295 311 312 #if H_3D_IC 313 static UInt xGetHADsic ( DistParam* pcDtParam ); 314 #endif 296 315 static UInt xGetHADs4 ( DistParam* pcDtParam ); 297 316 static UInt xGetHADs8 ( DistParam* pcDtParam ); -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComSlice.cpp
r499 r504 114 114 , m_isDepth (false) 115 115 #endif 116 #if H_3D_IC 117 , m_bApplyIC ( false ) 118 , m_icSkipParseFlag ( false ) 119 #endif 116 120 #if H_3D_GEN 117 121 , m_depthToDisparityB ( NULL ) … … 1020 1024 m_enableTMVPFlag = pSrc->m_enableTMVPFlag; 1021 1025 m_maxNumMergeCand = pSrc->m_maxNumMergeCand; 1026 #if H_3D_IC 1027 m_bApplyIC = pSrc->m_bApplyIC; 1028 m_icSkipParseFlag = pSrc->m_icSkipParseFlag; 1029 #endif 1022 1030 } 1023 1031 … … 1540 1548 m_dimensionId[i][j] = 0; 1541 1549 } 1550 #if H_3D_ARP 1551 m_uiUseAdvResPred[i] = 0; 1552 m_uiARPStepNum[i] = 1; 1553 #endif 1542 1554 } 1543 1555 #if H_3D_GEN … … 2324 2336 } 2325 2337 } 2338 #if H_3D_ARP 2339 Void TComSlice::setARPStepNum() 2340 { 2341 Bool bAllIvRef = true; 2342 2343 if(!getVPS()->getUseAdvRP(getLayerId())) 2344 { 2345 m_nARPStepNum = 0; 2346 } 2347 else 2348 { 2349 for( Int iRefListId = 0; iRefListId < 2; iRefListId++ ) 2350 { 2351 RefPicList eRefPicList = RefPicList( iRefListId ); 2352 Int iNumRefIdx = getNumRefIdx(eRefPicList); 2353 2354 if( iNumRefIdx <= 0 ) 2355 { 2356 continue; 2357 } 2358 2359 for ( Int i = 0; i < iNumRefIdx; i++ ) 2360 { 2361 if( getRefPic( eRefPicList, i)->getPOC() != getPOC() ) 2362 { 2363 bAllIvRef = false; 2364 break; 2365 } 2366 } 2367 2368 if( bAllIvRef == false ) { break; } 2369 } 2370 m_nARPStepNum = !bAllIvRef ? getVPS()->getARPStepNum(getLayerId()) : 0; 2371 } 2372 } 2373 #endif 2374 #if H_3D_IC 2375 Void TComSlice::xSetApplyIC() 2376 { 2377 Int iMaxPelValue = ( 1 << g_bitDepthY ); 2378 Int *aiRefOrgHist; 2379 Int *aiCurrHist; 2380 aiRefOrgHist = (Int *) xMalloc( Int,iMaxPelValue ); 2381 aiCurrHist = (Int *) xMalloc( Int,iMaxPelValue ); 2382 memset( aiRefOrgHist, 0, iMaxPelValue*sizeof(Int) ); 2383 memset( aiCurrHist, 0, iMaxPelValue*sizeof(Int) ); 2384 // Reference Idx Number 2385 Int iNumRefIdx = getNumRefIdx( REF_PIC_LIST_0 ); 2386 TComPic* pcCurrPic = NULL; 2387 TComPic* pcRefPic = NULL; 2388 TComPicYuv* pcCurrPicYuv = NULL; 2389 TComPicYuv* pcRefPicYuvOrg = NULL; 2390 pcCurrPic = getPic(); 2391 pcCurrPicYuv = pcCurrPic->getPicYuvOrg(); 2392 Int iWidth = pcCurrPicYuv->getWidth(); 2393 Int iHeight = pcCurrPicYuv->getHeight(); 2394 2395 2396 // Get InterView Reference picture 2397 // !!!!! Assume only one Interview Reference Picture in L0 2398 for ( Int i = 0; i < iNumRefIdx; i++ ) 2399 { 2400 pcRefPic = getRefPic( REF_PIC_LIST_0, i ); 2401 if ( pcRefPic != NULL ) 2402 { 2403 if ( pcCurrPic->getViewIndex() != pcRefPic->getViewIndex() ) 2404 { 2405 pcRefPicYuvOrg = pcRefPic->getPicYuvOrg(); 2406 } 2407 } 2408 } 2409 2410 if ( pcRefPicYuvOrg != NULL ) 2411 { 2412 Pel* pCurrY = pcCurrPicYuv ->getLumaAddr(); 2413 Pel* pRefOrgY = pcRefPicYuvOrg ->getLumaAddr(); 2414 Int iCurrStride = pcCurrPicYuv->getStride(); 2415 Int iRefStride = pcRefPicYuvOrg->getStride(); 2416 Int iSumOrgSAD = 0; 2417 Double dThresholdOrgSAD = getIsDepth() ? 0.1 : 0.05; 2418 2419 // Histogram building - luminance 2420 for ( Int y = 0; y < iHeight; y++ ) 2421 { 2422 for ( Int x = 0; x < iWidth; x++ ) 2423 { 2424 aiCurrHist[pCurrY[x]]++; 2425 aiRefOrgHist[pRefOrgY[x]]++; 2426 } 2427 pCurrY += iCurrStride; 2428 pRefOrgY += iRefStride; 2429 } 2430 // Histogram SAD 2431 for ( Int i = 0; i < iMaxPelValue; i++ ) 2432 { 2433 iSumOrgSAD += abs( aiCurrHist[i] - aiRefOrgHist[i] ); 2434 } 2435 // Setting 2436 if ( iSumOrgSAD > Int( dThresholdOrgSAD * iWidth * iHeight ) ) 2437 { 2438 m_bApplyIC = true; 2439 } 2440 else 2441 { 2442 m_bApplyIC = false; 2443 } 2444 } 2445 2446 xFree( aiCurrHist ); 2447 xFree( aiRefOrgHist ); 2448 aiCurrHist = NULL; 2449 aiRefOrgHist = NULL; 2450 } 2451 #endif 2326 2452 #if H_3D_GEN 2327 2453 Void TComSlice::setIvPicLists( TComPicLists* m_ivPicLists ) -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComSlice.h
r499 r504 524 524 #if H_3D 525 525 Int m_viewIndex [MAX_NUM_LAYERS ]; 526 #if H_3D_ARP 527 UInt m_uiUseAdvResPred [MAX_NUM_LAYERS ]; 528 UInt m_uiARPStepNum [MAX_NUM_LAYERS ]; 529 #endif 530 #if H_3D_IV_MERGE 531 Bool m_ivMvPredFlag [ MAX_NUM_LAYERS ]; 532 #endif 533 #if H_3D_VSP 534 Bool m_viewSynthesisPredFlag [ MAX_NUM_LAYERS ]; 535 #endif 536 #if H_3D_NBDV_REF 537 Bool m_depthRefinementFlag [ MAX_NUM_LAYERS ]; 538 #endif 526 539 #endif 527 540 … … 537 550 Int m_refLayerId [ MAX_NUM_LAYERS ][MAX_NUM_LAYERS]; 538 551 539 #if H_3D_IV_MERGE540 Bool m_ivMvPredFlag [ MAX_NUM_LAYERS ];541 #endif542 #if H_3D_VSP543 Bool m_viewSynthesisPredFlag [ MAX_NUM_LAYERS ];544 #endif545 #if H_3D_NBDV_REF546 Bool m_depthRefinementFlag [ MAX_NUM_LAYERS ];547 #endif548 552 #endif 549 553 public: … … 651 655 Int getDepthId ( Int layerIdInVps ) { return getScalabilityId( layerIdInVps, DEPTH_ID ); } 652 656 Int getLayerIdInNuh( Int viewIndex, Bool depthFlag ); 653 #endif 654 655 656 Void setVpsProfilePresentFlag( Int layerSet, Bool val ) { m_vpsProfilePresentFlag[layerSet] = val; } 657 Bool getVpsProfilePresentFlag( Int layerSet ) { return m_vpsProfilePresentFlag[layerSet]; } 658 659 Void setProfileLayerSetRefMinus1( Int layerSet, Int val ) { m_profileLayerSetRefMinus1[layerSet] = val; } 660 Bool getProfileLayerSetRefMinus1( Int layerSet ) { return m_profileLayerSetRefMinus1[layerSet]; } 661 662 Void setNumOutputLayerSets( Int val ) { m_numOutputLayerSets = val; } 663 Int getNumOutputLayerSets() { return m_numOutputLayerSets; } 664 665 Void setOutputLayerSetIdx( Int layerSet, Int val ) { m_outputLayerSetIdx[layerSet] = val; } 666 Int getOutputLayerSetIdx( Int layerSet ) { return m_outputLayerSetIdx[layerSet]; } 667 668 Void setOutputLayerFlag( Int layerSet, Int layer, Bool val ) { m_outputLayerFlag[layerSet][layer] = val; } 669 Bool getOutputLayerFlag( Int layerSet, Int layer ) { return m_outputLayerFlag[layerSet][layer]; } 670 671 Void setDirectDependencyFlag( Int layerHigh, Int layerLow, Bool val ) { m_directDependencyFlag[layerHigh][layerLow] = val; } 672 Bool getDirectDependencyFlag( Int layerHigh, Int layerLow ) { return m_directDependencyFlag[layerHigh][layerLow]; } 673 674 Void calcIvRefLayers(); 675 676 Int getNumDirectRefLayers( Int layerIdInVps ) { return m_numDirectRefLayers[ layerIdInVps ]; }; 677 Int getRefLayerId ( Int layerIdInVps, Int idx );; 678 679 Bool checkVPSExtensionSyntax(); 680 Int scalTypeToScalIdx ( ScalabilityType scalType ); 657 #if H_3D_ARP 658 UInt getUseAdvRP ( Int layerIdInVps ) { return m_uiUseAdvResPred[layerIdInVps]; } 659 UInt getARPStepNum( Int layerIdInVps ) { return m_uiARPStepNum[layerIdInVps]; } 660 Void setUseAdvRP ( Int layerIdInVps, UInt val ) { m_uiUseAdvResPred[layerIdInVps] = val; } 661 Void setARPStepNum( Int layerIdInVps, UInt val ) { m_uiARPStepNum[layerIdInVps] = val; } 662 #endif 681 663 #if H_3D_IV_MERGE 682 664 Void setIvMvPredFlag ( Int layerIdInVps, Bool val ) { m_ivMvPredFlag[ layerIdInVps ] = val; } … … 691 673 Bool getDepthRefinementFlag ( Int layerIdInVps ) { return m_depthRefinementFlag[ layerIdInVps ]; }; 692 674 #endif 675 #endif 676 677 678 Void setVpsProfilePresentFlag( Int layerSet, Bool val ) { m_vpsProfilePresentFlag[layerSet] = val; } 679 Bool getVpsProfilePresentFlag( Int layerSet ) { return m_vpsProfilePresentFlag[layerSet]; } 680 681 Void setProfileLayerSetRefMinus1( Int layerSet, Int val ) { m_profileLayerSetRefMinus1[layerSet] = val; } 682 Bool getProfileLayerSetRefMinus1( Int layerSet ) { return m_profileLayerSetRefMinus1[layerSet]; } 683 684 Void setNumOutputLayerSets( Int val ) { m_numOutputLayerSets = val; } 685 Int getNumOutputLayerSets() { return m_numOutputLayerSets; } 686 687 Void setOutputLayerSetIdx( Int layerSet, Int val ) { m_outputLayerSetIdx[layerSet] = val; } 688 Int getOutputLayerSetIdx( Int layerSet ) { return m_outputLayerSetIdx[layerSet]; } 689 690 Void setOutputLayerFlag( Int layerSet, Int layer, Bool val ) { m_outputLayerFlag[layerSet][layer] = val; } 691 Bool getOutputLayerFlag( Int layerSet, Int layer ) { return m_outputLayerFlag[layerSet][layer]; } 692 693 Void setDirectDependencyFlag( Int layerHigh, Int layerLow, Bool val ) { m_directDependencyFlag[layerHigh][layerLow] = val; } 694 Bool getDirectDependencyFlag( Int layerHigh, Int layerLow ) { return m_directDependencyFlag[layerHigh][layerLow]; } 695 696 Void calcIvRefLayers(); 697 698 Int getNumDirectRefLayers( Int layerIdInVps ) { return m_numDirectRefLayers[ layerIdInVps ]; }; 699 Int getRefLayerId ( Int layerIdInVps, Int idx );; 700 701 Bool checkVPSExtensionSyntax(); 702 Int scalTypeToScalIdx ( ScalabilityType scalType ); 693 703 #endif 694 704 }; … … 1510 1520 Int m_aiAlterRefIdx [2]; 1511 1521 #endif 1522 #if H_3D_ARP 1523 TComList<TComPic*> * m_pBaseViewRefPicList[MAX_NUM_LAYERS]; 1524 UInt m_nARPStepNum; 1525 #endif 1526 #if H_3D_IC 1527 Bool m_bApplyIC; 1528 Bool m_icSkipParseFlag; 1529 #endif 1530 1512 1531 #if H_3D_GEN 1513 1532 TComPic* m_ivPicsCurrPoc [2][MAX_NUM_LAYERS]; … … 1579 1598 TComPic* getTexturePic () { return m_ivPicsCurrPoc[0][ m_viewIndex ]; } 1580 1599 #endif 1600 #if H_3D_IC 1601 Void setApplyIC( Bool b ) { m_bApplyIC = b; } 1602 Bool getApplyIC() { return m_bApplyIC; } 1603 Void xSetApplyIC(); 1604 Void setIcSkipParseFlag( Bool b ) { m_icSkipParseFlag = b; } 1605 Bool getIcSkipParseFlag() { return m_icSkipParseFlag; } 1606 #endif 1607 #if H_3D_ARP 1608 Void setBaseViewRefPicList( TComList<TComPic*> *pListPic, Int iViewIdx ) { m_pBaseViewRefPicList[iViewIdx] = pListPic; } 1609 Void setARPStepNum(); 1610 TComPic* getBaseViewRefPic ( UInt uiPOC , Int iViewIdx ) { return xGetRefPic( *m_pBaseViewRefPicList[iViewIdx], uiPOC ); } 1611 UInt getARPStepNum( ) { return m_nARPStepNum; } 1612 #endif 1613 1581 1614 Int getDepth () { return m_iDepth; } 1582 1615 UInt getColFromL0Flag () { return m_colFromL0Flag; } -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComYuv.cpp
r446 r504 661 661 } 662 662 } 663 664 #if H_3D_ARP 665 Void TComYuv::addARP( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, Bool bClip ) 666 { 667 addARPLuma ( pcYuvSrc0, pcYuvSrc1, uiAbsPartIdx, uiWidth , uiHeight , bClip ); 668 addARPChroma ( pcYuvSrc0, pcYuvSrc1, uiAbsPartIdx, uiWidth>>1, uiHeight>>1 , bClip ); 669 } 670 671 Void TComYuv::addARPLuma( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, Bool bClip ) 672 { 673 Int x, y; 674 675 Pel* pSrc0 = pcYuvSrc0->getLumaAddr( uiAbsPartIdx ); 676 Pel* pSrc1 = pcYuvSrc1->getLumaAddr( uiAbsPartIdx ); 677 Pel* pDst = getLumaAddr( uiAbsPartIdx ); 678 679 UInt iSrc0Stride = pcYuvSrc0->getStride(); 680 UInt iSrc1Stride = pcYuvSrc1->getStride(); 681 UInt iDstStride = getStride(); 682 for ( y = uiHeight-1; y >= 0; y-- ) 683 { 684 for ( x = uiWidth-1; x >= 0; x-- ) 685 { 686 pDst[x] = pSrc0[x] + pSrc1[x]; 687 if( bClip ) 688 { 689 pDst[x] = ClipY( pDst[x] ); 690 } 691 } 692 pSrc0 += iSrc0Stride; 693 pSrc1 += iSrc1Stride; 694 pDst += iDstStride; 695 } 696 } 697 698 Void TComYuv::addARPChroma( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, Bool bClip ) 699 { 700 Int x, y; 701 702 Pel* pSrcU0 = pcYuvSrc0->getCbAddr( uiAbsPartIdx ); 703 Pel* pSrcU1 = pcYuvSrc1->getCbAddr( uiAbsPartIdx ); 704 Pel* pSrcV0 = pcYuvSrc0->getCrAddr( uiAbsPartIdx ); 705 Pel* pSrcV1 = pcYuvSrc1->getCrAddr( uiAbsPartIdx ); 706 Pel* pDstU = getCbAddr( uiAbsPartIdx ); 707 Pel* pDstV = getCrAddr( uiAbsPartIdx ); 708 709 UInt iSrc0Stride = pcYuvSrc0->getCStride(); 710 UInt iSrc1Stride = pcYuvSrc1->getCStride(); 711 UInt iDstStride = getCStride(); 712 for ( y = uiHeight-1; y >= 0; y-- ) 713 { 714 for ( x = uiWidth-1; x >= 0; x-- ) 715 { 716 pDstU[x] = pSrcU0[x] + pSrcU1[x]; 717 pDstV[x] = pSrcV0[x] + pSrcV1[x]; 718 if( bClip ) 719 { 720 pDstU[x] = ClipC( pDstU[x] ); 721 pDstV[x] = ClipC( pDstV[x] ); 722 } 723 } 724 725 pSrcU0 += iSrc0Stride; 726 pSrcU1 += iSrc1Stride; 727 pSrcV0 += iSrc0Stride; 728 pSrcV1 += iSrc1Stride; 729 pDstU += iDstStride; 730 pDstV += iDstStride; 731 } 732 } 733 734 Void TComYuv::subtractARP( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight ) 735 { 736 subtractARPLuma ( pcYuvSrc0, pcYuvSrc1, uiAbsPartIdx, uiWidth , uiHeight ); 737 subtractARPChroma( pcYuvSrc0, pcYuvSrc1, uiAbsPartIdx, uiWidth>>1 , uiHeight>>1 ); 738 } 739 740 Void TComYuv::subtractARPLuma( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight ) 741 { 742 Int x, y; 743 744 Pel* pSrc0 = pcYuvSrc0->getLumaAddr( uiAbsPartIdx ); 745 Pel* pSrc1 = pcYuvSrc1->getLumaAddr( uiAbsPartIdx ); 746 Pel* pDst = getLumaAddr( uiAbsPartIdx ); 747 748 Int iSrc0Stride = pcYuvSrc0->getStride(); 749 Int iSrc1Stride = pcYuvSrc1->getStride(); 750 Int iDstStride = getStride(); 751 for ( y = uiHeight-1; y >= 0; y-- ) 752 { 753 for ( x = uiWidth-1; x >= 0; x-- ) 754 { 755 pDst[x] = pSrc0[x] - pSrc1[x]; 756 } 757 pSrc0 += iSrc0Stride; 758 pSrc1 += iSrc1Stride; 759 pDst += iDstStride; 760 } 761 } 762 763 Void TComYuv::subtractARPChroma( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight ) 764 { 765 Int x, y; 766 767 Pel* pSrcU0 = pcYuvSrc0->getCbAddr( uiAbsPartIdx ); 768 Pel* pSrcU1 = pcYuvSrc1->getCbAddr( uiAbsPartIdx ); 769 Pel* pSrcV0 = pcYuvSrc0->getCrAddr( uiAbsPartIdx ); 770 Pel* pSrcV1 = pcYuvSrc1->getCrAddr( uiAbsPartIdx ); 771 Pel* pDstU = getCbAddr( uiAbsPartIdx ); 772 Pel* pDstV = getCrAddr( uiAbsPartIdx ); 773 774 Int iSrc0Stride = pcYuvSrc0->getCStride(); 775 Int iSrc1Stride = pcYuvSrc1->getCStride(); 776 Int iDstStride = getCStride(); 777 for ( y = uiHeight-1; y >= 0; y-- ) 778 { 779 for ( x = uiWidth-1; x >= 0; x-- ) 780 { 781 pDstU[x] = pSrcU0[x] - pSrcU1[x]; 782 pDstV[x] = pSrcV0[x] - pSrcV1[x]; 783 } 784 pSrcU0 += iSrc0Stride; 785 pSrcU1 += iSrc1Stride; 786 pSrcV0 += iSrc0Stride; 787 pSrcV1 += iSrc1Stride; 788 pDstU += iDstStride; 789 pDstV += iDstStride; 790 } 791 } 792 793 Void TComYuv::multiplyARP( UInt uiAbsPartIdx , UInt uiWidth , UInt uiHeight , UChar dW ) 794 { 795 multiplyARPLuma( uiAbsPartIdx , uiWidth , uiHeight , dW ); 796 multiplyARPChroma( uiAbsPartIdx , uiWidth >> 1 , uiHeight >> 1 , dW ); 797 } 798 799 Void TComYuv::xxMultiplyLine( Pel* pSrcDst , UInt uiWidth , UChar dW ) 800 { 801 assert( dW == 2 ); 802 for( UInt x = 0 ; x < uiWidth ; x++ ) 803 pSrcDst[x] = pSrcDst[x] >> 1; 804 } 805 806 Void TComYuv::multiplyARPLuma( UInt uiAbsPartIdx , UInt uiWidth , UInt uiHeight , UChar dW ) 807 { 808 Pel* pDst = getLumaAddr( uiAbsPartIdx ); 809 Int iDstStride = getStride(); 810 for ( Int y = uiHeight-1; y >= 0; y-- ) 811 { 812 xxMultiplyLine( pDst , uiWidth , dW ); 813 pDst += iDstStride; 814 } 815 } 816 817 Void TComYuv::multiplyARPChroma( UInt uiAbsPartIdx , UInt uiWidth , UInt uiHeight , UChar dW ) 818 { 819 Pel* pDstU = getCbAddr( uiAbsPartIdx ); 820 Pel* pDstV = getCrAddr( uiAbsPartIdx ); 821 822 Int iDstStride = getCStride(); 823 for ( Int y = uiHeight-1; y >= 0; y-- ) 824 { 825 xxMultiplyLine( pDstU , uiWidth , dW ); 826 xxMultiplyLine( pDstV , uiWidth , dW ); 827 pDstU += iDstStride; 828 pDstV += iDstStride; 829 } 830 } 831 #endif 663 832 #endif 664 833 //! \} -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComYuv.h
r446 r504 182 182 #if H_3D 183 183 Void addClipPartLuma( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize ); 184 185 #if H_3D_ARP 186 Void addARP ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight , Bool bClip ); 187 Void addARPLuma ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight , Bool bClip ); 188 Void addARPChroma ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight , Bool bClip ); 189 Void subtractARP ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight ); 190 Void subtractARPLuma ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight ); 191 Void subtractARPChroma( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight ); 192 Void multiplyARP ( UInt uiAbsPartIdx , UInt uiWidth , UInt uiHeight , UChar dW ); 193 Void multiplyARPLuma ( UInt uiAbsPartIdx , UInt uiWidth , UInt uiHeight , UChar dW ); 194 Void multiplyARPChroma( UInt uiAbsPartIdx , UInt uiWidth , UInt uiHeight , UChar dW ); 195 private: 196 Void xxMultiplyLine( Pel * pSrcDst , UInt uiWidth , UChar dW ); 184 197 #endif 198 #endif 185 199 186 200 };// END CLASS DEFINITION TComYuv -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TypeDef.h
r499 r504 88 88 // QC_CU_NBDV_D0181 89 89 // SEC_DEFAULT_DV_D0112 90 #define H_3D_ARP 1 // Advanced residual prediction (ARP), JCT3V-D0177 91 #define H_3D_IC 1 // Illumination Compensation, JCT3V-B0045, JCT3V-C0046, JCT3V-D0060 92 // Unifying rounding offset, for IC part, JCT3V-D0135 93 // Full Pel Interpolation for Depth, HHI_FULL_PEL_DEPTH_MAP_MV_ACC 90 94 #if H_3D_NBDV 91 #define H_3D_IDV 1 // LGE_DVMCP_A0126 QC note: this macro will be removed after merging to dev2a92 95 #define H_3D_NBDV_REF 1 // Depth oriented neighboring block disparity derivation 93 96 // MTK_D0156 … … 108 111 #define H_3D_GEN 1 // Some general changes can be removed after merge 109 112 #define H_3D_CLEANUPS 1 113 #define H_3D_FIX 1 // Temporary for minor fixes 110 114 #endif 111 115 … … 143 147 #endif 144 148 #endif 149 ///// ***** ADVANCED INTERVIEW RESIDUAL PREDICTION ********* 150 #if H_3D_ARP 151 #define H_3D_ARP_WFNR 3 152 #endif 153 145 154 ///////////////////////////////////////////////////////////////////////////////////////// 146 155 /////////////////////////////////// HM RELATED DEFINES //////////////////////////////// -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder/TDecCAVLC.cpp
r486 r504 957 957 for( Int layer = 0; layer <= pcVPS->getMaxLayers() - 1; layer++ ) 958 958 { 959 #if H_3D_ARP 960 pcVPS->setUseAdvRP ( layer, 0 ); 961 pcVPS->setARPStepNum( layer, 1 ); 962 #endif 959 963 if (layer != 0) 960 964 { … … 963 967 #if H_3D_IV_MERGE 964 968 READ_FLAG( uiCode, "iv_mv_pred_flag[i]"); pcVPS->setIvMvPredFlag ( layer, uiCode == 1 ? true : false ); 969 #endif 970 #if H_3D_ARP 971 READ_FLAG( uiCode, "advanced_residual_pred_flag" ); pcVPS->setUseAdvRP ( layer, uiCode ); pcVPS->setARPStepNum( layer, uiCode ? H_3D_ARP_WFNR : 1 ); 972 965 973 #endif 966 974 #if H_3D_NBDV_REF … … 1434 1442 rpcSlice->initWpScaling(); 1435 1443 } 1444 #if H_3D_IC 1445 else if( rpcSlice->getViewIndex() && ( rpcSlice->getSliceType() == P_SLICE || rpcSlice->getSliceType() == B_SLICE ) ) 1446 { 1447 UInt uiCodeTmp = 0; 1448 1449 READ_FLAG ( uiCodeTmp, "slice_ic_enable_flag" ); 1450 rpcSlice->setApplyIC( uiCodeTmp ); 1451 1452 if ( uiCodeTmp ) 1453 { 1454 READ_FLAG ( uiCodeTmp, "ic_skip_mergeidx0" ); 1455 rpcSlice->setIcSkipParseFlag( uiCodeTmp ); 1456 } 1457 } 1458 #endif 1436 1459 if (!rpcSlice->isIntra()) 1437 1460 { … … 1888 1911 } 1889 1912 1913 #if H_3D_ARP 1914 Void TDecCavlc::parseARPW( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 1915 { 1916 assert(0); 1917 } 1918 #endif 1919 1920 #if H_3D_IC 1921 Void TDecCavlc::parseICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 1922 { 1923 assert(0); 1924 } 1925 #endif 1926 1890 1927 // ==================================================================================================================== 1891 1928 // Protected member functions -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder/TDecCAVLC.h
r446 r504 99 99 Void parseMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx ); 100 100 Void parseMergeIndex ( TComDataCU* pcCU, UInt& ruiMergeIndex ); 101 #if H_3D_ARP 102 Void parseARPW ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 103 #endif 104 #if H_3D_IC 105 Void parseICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 106 #endif 101 107 Void parseSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 102 108 Void parsePartSize ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder/TDecCu.cpp
r486 r504 281 281 if(!pcCU->getSlice()->isIntra()) 282 282 { 283 if(pcCU->getSlice()->getViewIndex() && !pcCU->getSlice()->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. 283 #if H_3D_ARP && H_3D_IV_MERGE 284 if( pcCU->getSlice()->getVPS()->getUseAdvRP( pcCU->getSlice()->getLayerId() ) || pcCU->getSlice()->getVPS()->getIvMvPredFlag( pcCU->getSlice()->getLayerId() )) 285 #else 286 #if H_3D_ARP 287 if( pcCU->getSlice()->getVPS()->getUseAdvRP(pcCU->getSlice()->getLayerId()) ) 288 #else 289 #if H_3D_IV_MERGE 290 if( pcCU->getSlice()->getVPS()->getIvMvPredFlag(pcCU->getSlice()->getLayerId()) ) 291 #else 292 if (0) 293 #endif 294 #endif 295 #endif 284 296 { 285 297 m_ppcCU[uiDepth]->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_0, true ); … … 349 361 } 350 362 } 363 #if H_3D_IC 364 m_pcEntropyDecoder->decodeICFlag( pcCU, uiAbsPartIdx, uiDepth ); 365 #endif 366 #if H_3D_ARP 367 m_pcEntropyDecoder->decodeARPW( pcCU , uiAbsPartIdx , uiDepth ); 368 #endif 351 369 xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, ruiIsLast ); 352 370 return; … … 372 390 // prediction mode ( Intra : direction mode, Inter : Mv, reference idx ) 373 391 m_pcEntropyDecoder->decodePredInfo( pcCU, uiAbsPartIdx, uiDepth, m_ppcCU[uiDepth]); 374 392 #if H_3D_IC 393 m_pcEntropyDecoder->decodeICFlag( pcCU, uiAbsPartIdx, uiDepth ); 394 #endif 395 #if H_3D_ARP 396 m_pcEntropyDecoder->decodeARPW ( pcCU , uiAbsPartIdx , uiDepth ); 397 #endif 375 398 // Coefficient decoding 376 399 Bool bCodeDQP = getdQPFlag(); -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder/TDecEntropy.cpp
r476 r504 87 87 } 88 88 89 #if H_3D_ARP 90 Void TDecEntropy::decodeARPW( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 91 { 92 if( !pcCU->getSlice()->getARPStepNum() || pcCU->isIntra( uiAbsPartIdx ) ) 93 { 94 return; 95 } 96 97 if( pcCU->getPartitionSize(uiAbsPartIdx) != SIZE_2Nx2N ) 98 { 99 pcCU->setARPWSubParts( 0 , uiAbsPartIdx, uiDepth ); 100 } 101 else 102 { 103 m_pcEntropyDecoderIf->parseARPW( pcCU , uiAbsPartIdx , uiDepth ); 104 } 105 } 106 #endif 107 108 #if H_3D_IC 109 Void TDecEntropy::decodeICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 110 { 111 pcCU->setICFlagSubParts( false , uiAbsPartIdx, 0, uiDepth ); 112 113 if ( pcCU->isIntra( uiAbsPartIdx ) || ( pcCU->getSlice()->getViewIndex() == 0 ) ) 114 { 115 return; 116 } 117 118 if( !pcCU->getSlice()->getApplyIC() ) 119 return; 120 121 if( pcCU->isICFlagRequired( uiAbsPartIdx ) ) 122 m_pcEntropyDecoderIf->parseICFlag( pcCU, uiAbsPartIdx, uiDepth ); 123 } 124 #endif 125 89 126 Void TDecEntropy::decodeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 90 127 { -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder/TDecEntropy.h
r446 r504 85 85 virtual Void parseMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx ) = 0; 86 86 virtual Void parseMergeIndex ( TComDataCU* pcCU, UInt& ruiMergeIndex ) = 0; 87 #if H_3D_ARP 88 virtual Void parseARPW ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 89 #endif 90 #if H_3D_IC 91 virtual Void parseICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 92 #endif 87 93 virtual Void parsePartSize ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 88 94 virtual Void parsePredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; … … 154 160 Void decodePartSize ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 155 161 162 #if H_3D_ARP 163 Void decodeARPW ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 164 #endif 165 #if H_3D_IC 166 Void decodeICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 167 #endif 168 156 169 Void decodeIPCMInfo ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 157 170 -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder/TDecSbac.cpp
r324 r504 54 54 , m_cCUMergeFlagExtSCModel ( 1, 1, NUM_MERGE_FLAG_EXT_CTX , m_contextModels + m_numContextModels, m_numContextModels) 55 55 , m_cCUMergeIdxExtSCModel ( 1, 1, NUM_MERGE_IDX_EXT_CTX , m_contextModels + m_numContextModels, m_numContextModels) 56 #if H_3D_ARP 57 , m_cCUPUARPWSCModel ( 1, 1, NUM_ARPW_CTX , m_contextModels + m_numContextModels, m_numContextModels) 58 #endif 59 #if H_3D_IC 60 , m_cCUICFlagSCModel ( 1, 1, NUM_IC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 61 #endif 56 62 , m_cCUPartSizeSCModel ( 1, 1, NUM_PART_SIZE_CTX , m_contextModels + m_numContextModels, m_numContextModels) 57 63 , m_cCUPredModeSCModel ( 1, 1, NUM_PRED_MODE_CTX , m_contextModels + m_numContextModels, m_numContextModels) … … 113 119 m_cCUMergeFlagExtSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_MERGE_FLAG_EXT ); 114 120 m_cCUMergeIdxExtSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_MERGE_IDX_EXT ); 121 #if H_3D_ARP 122 m_cCUPUARPWSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_ARPW ); 123 #endif 124 #if H_3D_IC 125 m_cCUICFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_IC_FLAG ); 126 #endif 115 127 m_cCUPartSizeSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_PART_SIZE ); 116 128 m_cCUAMPSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_CU_AMP_POS ); … … 158 170 m_cCUMergeFlagExtSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_MERGE_FLAG_EXT ); 159 171 m_cCUMergeIdxExtSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_MERGE_IDX_EXT ); 172 #if H_3D_ARP 173 m_cCUPUARPWSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_ARPW ); 174 #endif 175 #if H_3D_IC 176 m_cCUICFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_IC_FLAG ); 177 #endif 160 178 m_cCUPartSizeSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_PART_SIZE ); 161 179 m_cCUAMPSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_CU_AMP_POS ); … … 1551 1569 xCopyContextsFrom(pScr); 1552 1570 } 1571 1572 #if H_3D_ARP 1573 Void TDecSbac::parseARPW( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 1574 { 1575 UInt uiMaxW = pcCU->getSlice()->getARPStepNum() - 1; 1576 UInt uiW = 0; 1577 UInt uiOffset = pcCU->getCTXARPWFlag(uiAbsPartIdx); 1578 UInt uiCode = 0; 1579 1580 assert ( uiMaxW > 0 ); 1581 1582 m_pcTDecBinIf->decodeBin( uiCode , m_cCUPUARPWSCModel.get( 0, 0, 0 + uiOffset ) ); 1583 1584 uiW = uiCode; 1585 if( 1 == uiW ) 1586 { 1587 m_pcTDecBinIf->decodeBin( uiCode , m_cCUPUARPWSCModel.get( 0, 0, 3 ) ); 1588 uiW += ( 1 == uiCode ? 1 : 0 ); 1589 } 1590 pcCU->setARPWSubParts( ( UChar )( uiW ) , uiAbsPartIdx, uiDepth ); 1591 } 1592 #endif 1593 1594 #if H_3D_IC 1595 /** parse illumination compensation flag 1596 * \param pcCU 1597 * \param uiAbsPartIdx 1598 * \param uiDepth 1599 * \returns Void 1600 */ 1601 Void TDecSbac::parseICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 1602 { 1603 UInt uiSymbol = 0; 1604 UInt uiCtxIC = pcCU->getCtxICFlag( uiAbsPartIdx ); 1605 m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUICFlagSCModel.get( 0, 0, uiCtxIC ) ); 1606 DTRACE_CABAC_VL( g_nSymbolCounter++ ); 1607 DTRACE_CABAC_T( "\tICFlag" ); 1608 DTRACE_CABAC_T( "\tuiCtxIC: "); 1609 DTRACE_CABAC_V( uiCtxIC ); 1610 DTRACE_CABAC_T( "\tuiSymbol: "); 1611 DTRACE_CABAC_V( uiSymbol ); 1612 DTRACE_CABAC_T( "\n"); 1613 1614 pcCU->setICFlagSubParts( uiSymbol ? true : false , uiAbsPartIdx, 0, uiDepth ); 1615 } 1616 #endif 1617 1553 1618 //! \} -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder/TDecSbac.h
r446 r504 108 108 Void parseMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx ); 109 109 Void parseMergeIndex ( TComDataCU* pcCU, UInt& ruiMergeIndex ); 110 #if H_3D_ARP 111 Void parseARPW ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 112 #endif 113 #if H_3D_IC 114 Void parseICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 115 #endif 110 116 Void parsePartSize ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 111 117 Void parsePredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); … … 145 151 ContextModel3DBuffer m_cCUMergeFlagExtSCModel; 146 152 ContextModel3DBuffer m_cCUMergeIdxExtSCModel; 153 #if H_3D_ARP 154 ContextModel3DBuffer m_cCUPUARPWSCModel; 155 #endif 156 #if H_3D_IC 157 ContextModel3DBuffer m_cCUICFlagSCModel; 158 #endif 147 159 ContextModel3DBuffer m_cCUPartSizeSCModel; 148 160 ContextModel3DBuffer m_cCUPredModeSCModel; -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder/TDecTop.cpp
r499 r504 886 886 #if H_MV 887 887 pcSlice->setRefPicList( m_cListPic, m_refPicSetInterLayer, true ); 888 #if H_3D_ARP 889 pcSlice->setARPStepNum(); 890 if( pcSlice->getARPStepNum() > 1 ) 891 { 892 for(Int iLayerId = 0; iLayerId < nalu.m_layerId; iLayerId ++ ) 893 { 894 Int iViewIdx = pcSlice->getVPS()->getViewIndex(iLayerId); 895 Bool bIsDepth = ( pcSlice->getVPS()->getDepthId ( iLayerId ) == 1 ); 896 if( iViewIdx<getViewIndex() && !bIsDepth ) 897 { 898 pcSlice->setBaseViewRefPicList( m_ivPicLists->getPicList( iLayerId ), iViewIdx ); 899 } 900 } 901 } 902 #endif 888 903 #else 889 904 #if FIX1071 -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncCavlc.cpp
r486 r504 752 752 WRITE_FLAG( pcVPS->getIvMvPredFlag (layer) ? 1 : 0 , "iv_mv_pred_flag[i]"); 753 753 #endif 754 #if H_3D_ARP 755 WRITE_FLAG( pcVPS->getUseAdvRP (layer) ? 1 : 0, "advanced_residual_pred_flag" ); 756 #endif 754 757 #if H_3D_NBDV_REF 755 758 WRITE_FLAG( pcVPS->getDepthRefinementFlag (layer) ? 1 : 0 , "depth_refinement_flag[i]"); … … 1093 1096 xCodePredWeightTable( pcSlice ); 1094 1097 } 1098 #if H_3D_IC 1099 else if( pcSlice->getViewIndex() && ( pcSlice->getSliceType() == P_SLICE || pcSlice->getSliceType() == B_SLICE ) ) 1100 { 1101 WRITE_FLAG( pcSlice->getApplyIC() ? 1 : 0, "slice_ic_enable_flag" ); 1102 if( pcSlice->getApplyIC() ) 1103 { 1104 WRITE_FLAG( pcSlice->getIcSkipParseFlag() ? 1 : 0, "ic_skip_mergeidx0" ); 1105 } 1106 } 1107 #endif 1108 1095 1109 #if H_3D_IV_MERGE 1096 1110 assert(pcSlice->getMaxNumMergeCand()<=MRG_MAX_NUM_CANDS_MEM); … … 1380 1394 } 1381 1395 1396 #if H_3D_ARP 1397 Void TEncCavlc::codeARPW( TComDataCU* pcCU, UInt uiAbsPartIdx ) 1398 { 1399 assert(0); 1400 } 1401 #endif 1402 1403 #if H_3D_IC 1404 Void TEncCavlc::codeICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx ) 1405 { 1406 assert(0); 1407 } 1408 #endif 1409 1382 1410 Void TEncCavlc::codeInterModeFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiEncMode ) 1383 1411 { -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncCavlc.h
r446 r504 114 114 Void codeMergeIndex ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 115 115 116 #if H_3D_ARP 117 Void codeARPW ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 118 #endif 119 #if H_3D_IC 120 Void codeICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 121 #endif 122 116 123 Void codeInterModeFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiEncMode ); 117 124 Void codeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncCfg.h
r479 r504 394 394 Bool m_bUseEstimatedVSD; 395 395 Double m_dDispCoeff; 396 397 #if H_3D_ARP 398 UInt m_uiUseAdvResPred; 399 UInt m_uiARPStepNum; 400 #endif 401 402 #if H_3D_IC 403 Bool m_bUseIC; 404 #endif 396 405 #endif 397 406 … … 467 476 Bool getMaxTempLayer () { return m_maxTempLayer; } 468 477 Void setMaxTempLayer ( Int maxTempLayer ) { m_maxTempLayer = maxTempLayer; } 478 479 #if H_3D_ARP 480 UInt getUseAdvRP ( ) { return m_uiUseAdvResPred; } 481 Void setUseAdvRP ( UInt u ) { m_uiUseAdvResPred = u; } 482 483 UInt getARPStepNum () { return m_uiARPStepNum; } 484 Void setARPStepNum ( UInt u ) { m_uiARPStepNum = u; } 485 #endif 486 487 #if H_3D_IC 488 Void setUseIC ( Bool bVal ) { m_bUseIC = bVal; } 489 Bool getUseIC () { return m_bUseIC; } 490 #endif 469 491 //======== Transform ============= 470 492 Void setQuadtreeTULog2MaxSize ( UInt u ) { m_uiQuadtreeTULog2MaxSize = u; } -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncCu.cpp
r486 r504 65 65 m_ppcTempCU = new TComDataCU*[m_uhTotalDepth-1]; 66 66 67 #if H_3D_ARP 68 m_ppcWeightedTempCU = new TComDataCU*[m_uhTotalDepth-1]; 69 #endif 70 67 71 m_ppcPredYuvBest = new TComYuv*[m_uhTotalDepth-1]; 68 72 m_ppcResiYuvBest = new TComYuv*[m_uhTotalDepth-1]; … … 83 87 m_ppcTempCU[i] = new TComDataCU; m_ppcTempCU[i]->create( uiNumPartitions, uiWidth, uiHeight, false, uiMaxWidth >> (m_uhTotalDepth - 1) ); 84 88 89 #if H_3D_ARP 90 m_ppcWeightedTempCU[i] = new TComDataCU; m_ppcWeightedTempCU[i]->create( uiNumPartitions, uiWidth, uiHeight, false, uiMaxWidth >> (m_uhTotalDepth - 1) ); 91 #endif 92 85 93 m_ppcPredYuvBest[i] = new TComYuv; m_ppcPredYuvBest[i]->create(uiWidth, uiHeight); 86 94 m_ppcResiYuvBest[i] = new TComYuv; m_ppcResiYuvBest[i]->create(uiWidth, uiHeight); … … 124 132 m_ppcTempCU[i]->destroy(); delete m_ppcTempCU[i]; m_ppcTempCU[i] = NULL; 125 133 } 134 #if H_3D_ARP 135 if(m_ppcWeightedTempCU[i]) 136 { 137 m_ppcWeightedTempCU[i]->destroy(); delete m_ppcWeightedTempCU[i]; m_ppcWeightedTempCU[i] = NULL; 138 } 139 #endif 126 140 if(m_ppcPredYuvBest[i]) 127 141 { … … 163 177 m_ppcTempCU = NULL; 164 178 } 165 179 180 #if H_3D_ARP 181 if(m_ppcWeightedTempCU) 182 { 183 delete [] m_ppcWeightedTempCU; 184 m_ppcWeightedTempCU = NULL; 185 } 186 #endif 166 187 if(m_ppcPredYuvBest) 167 188 { … … 436 457 } 437 458 #endif 438 459 #if H_3D_IC 460 Bool bICEnabled = rpcTempCU->getSlice()->getViewIndex() && ( rpcTempCU->getSlice()->getSliceType() == P_SLICE || rpcTempCU->getSlice()->getSliceType() == B_SLICE ); 461 bICEnabled = bICEnabled && rpcTempCU->getSlice()->getApplyIC(); 462 #endif 439 463 // If slice start or slice end is within this cu... 440 464 TComSlice * pcSlice = rpcTempCU->getPic()->getSlice(rpcTempCU->getPic()->getCurrSliceIdx()); … … 468 492 if( rpcTempCU->getSlice()->getSliceType() != I_SLICE ) 469 493 { 470 if(rpcTempCU->getSlice()->getViewIndex() && !rpcTempCU->getSlice()->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. Remove this comment once it is done. 494 #if H_3D_ARP && H_3D_IV_MERGE 495 if( rpcTempCU->getSlice()->getVPS()->getUseAdvRP(rpcTempCU->getSlice()->getLayerId()) || rpcTempCU->getSlice()->getVPS()->getIvMvPredFlag(rpcTempCU->getSlice()->getLayerId()) ) 496 #else 497 #if H_3D_ARP 498 if( rpcTempCU->getSlice()->getVPS()->getUseAdvRP(rpcTempCU->getSlice()->getLayerId()) ) 499 #else 500 #if H_3D_IV_MERGE 501 if( rpcTempCU->getSlice()->getVPS()->getIvMvPredFlag(rpcTempCU->getSlice()->getLayerId()) ) 502 #else 503 if (0) 504 #endif 505 #endif 506 #endif 471 507 { 472 508 PartSize ePartTemp = rpcTempCU->getPartitionSize(0); … … 488 524 if( rpcBestCU->getSlice()->getSliceType() != I_SLICE ) 489 525 { 526 #if H_3D_IC 527 for( UInt uiICId = 0; uiICId < ( bICEnabled ? 2 : 1 ); uiICId++ ) 528 { 529 Bool bICFlag = uiICId ? true : false; 530 #endif 490 531 // 2Nx2N 491 532 if(m_pcEncCfg->getUseEarlySkipDetection()) 492 533 { 534 #if H_3D_IC 535 rpcTempCU->setICFlagSubParts(bICFlag, 0, 0, uiDepth); 536 #endif 493 537 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N ); rpcTempCU->initEstData( uiDepth, iQP );//by Competition for inter_2Nx2N 494 538 } 495 539 // SKIP 540 #if H_3D_IC 541 rpcTempCU->setICFlagSubParts(bICFlag, 0, 0, uiDepth); 542 #endif 496 543 xCheckRDCostMerge2Nx2N( rpcBestCU, rpcTempCU, &earlyDetectionSkipMode );//by Merge for inter_2Nx2N 497 544 rpcTempCU->initEstData( uiDepth, iQP ); … … 513 560 if ( !bEarlySkip ) 514 561 { 562 #if H_3D_IC 563 rpcTempCU->setICFlagSubParts(bICFlag, 0, 0, uiDepth); 564 #endif 515 565 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N ); rpcTempCU->initEstData( uiDepth, iQP ); 516 566 if(m_pcEncCfg->getUseCbfFastMode()) … … 520 570 } 521 571 } 572 #if H_3D_IC 573 } 574 #endif 522 575 } 523 576 … … 1220 1273 { 1221 1274 m_pcEntropyCoder->encodeMergeIndex( pcCU, uiAbsPartIdx ); 1275 #if H_3D_IC 1276 m_pcEntropyCoder->encodeICFlag ( pcCU, uiAbsPartIdx ); 1277 #endif 1278 #if H_3D_ARP 1279 m_pcEntropyCoder->encodeARPW( pcCU , uiAbsPartIdx ); 1280 #endif 1222 1281 finishCU(pcCU,uiAbsPartIdx,uiDepth); 1223 1282 return; … … 1241 1300 // prediction Info ( Intra : direction mode, Inter : Mv, reference idx ) 1242 1301 m_pcEntropyCoder->encodePredInfo( pcCU, uiAbsPartIdx ); 1243 1302 #if H_3D_IC 1303 m_pcEntropyCoder->encodeICFlag ( pcCU, uiAbsPartIdx ); 1304 #endif 1305 #if H_3D_ARP 1306 m_pcEntropyCoder->encodeARPW( pcCU , uiAbsPartIdx ); 1307 #endif 1308 1244 1309 // Encode Coefficients 1245 1310 Bool bCodeDQP = getdQPFlag(); … … 1273 1338 } 1274 1339 UChar uhDepth = rpcTempCU->getDepth( 0 ); 1275 1340 #if H_3D_IC 1341 Bool bICFlag = rpcTempCU->getICFlag( 0 ); 1342 #endif 1276 1343 #if H_3D_VSO // M1 //nececcary here? 1277 1344 if( m_pcRdCost->getUseRenModel() ) … … 1311 1378 } 1312 1379 1380 #if H_3D_ARP 1381 Int nARPWMax = rpcTempCU->getSlice()->getARPStepNum() - 1; 1382 if( nARPWMax < 0 || !rpcTempCU->getDvInfo(0).bDV ) 1383 { 1384 nARPWMax = 0; 1385 } 1386 for( Int nARPW=nARPWMax; nARPW >= 0 ; nARPW-- ) 1387 { 1388 memset( mergeCandBuffer, 0, MRG_MAX_NUM_CANDS*sizeof(Int) ); 1389 #endif 1313 1390 for( UInt uiNoResidual = 0; uiNoResidual < iteration; ++uiNoResidual ) 1314 1391 { … … 1316 1393 { 1317 1394 { 1395 #if H_3D_IC 1396 if( rpcTempCU->getSlice()->getApplyIC() && rpcTempCU->getSlice()->getIcSkipParseFlag() ) 1397 { 1398 if( bICFlag && uiMergeCand == 0 ) 1399 { 1400 continue; 1401 } 1402 } 1403 #endif 1318 1404 if(!(uiNoResidual==1 && mergeCandBuffer[uiMergeCand]==1)) 1319 1405 { … … 1325 1411 rpcTempCU->setCUTransquantBypassSubParts( m_pcEncCfg->getCUTransquantBypassFlagValue(), 0, uhDepth ); 1326 1412 rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uhDepth ); // interprets depth relative to LCU level 1413 #if H_3D_IC 1414 rpcTempCU->setICFlagSubParts( bICFlag, 0, 0, uhDepth ); 1415 #endif 1416 #if H_3D_ARP 1417 rpcTempCU->setARPWSubParts( (UChar)nARPW , 0 , uhDepth ); 1418 #endif 1327 1419 rpcTempCU->setMergeFlagSubParts( true, 0, 0, uhDepth ); // interprets depth relative to LCU level 1328 1420 rpcTempCU->setMergeIndexSubParts( uiMergeCand, 0, 0, uhDepth ); // interprets depth relative to LCU level … … 1331 1423 rpcTempCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level 1332 1424 1425 #if H_3D_ARP 1426 if( nARPW ) 1427 { 1428 Bool bSignalflag[2] = { true, true }; 1429 for( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx ++ ) 1430 { 1431 Int iRefIdx = cMvFieldNeighbours[uiRefListIdx + 2*uiMergeCand].getRefIdx(); 1432 RefPicList eRefList = uiRefListIdx ? REF_PIC_LIST_1 : REF_PIC_LIST_0; 1433 if( iRefIdx < 0 || rpcTempCU->getSlice()->getPOC() == rpcTempCU->getSlice()->getRefPOC(eRefList, iRefIdx) ) 1434 { 1435 bSignalflag[uiRefListIdx] = false; 1436 } 1437 } 1438 if( !bSignalflag[0] && !bSignalflag[1] ) 1439 { 1440 rpcTempCU->setARPWSubParts( 0 , 0 , uhDepth ); 1441 } 1442 } 1443 #endif 1333 1444 // do MC 1334 1445 m_pcPredSearch->motionCompensation ( rpcTempCU, m_ppcPredYuvTemp[uhDepth] ); … … 1410 1521 } 1411 1522 } 1523 #if H_3D_ARP 1524 } 1525 #endif 1412 1526 } 1413 1527 … … 1420 1534 { 1421 1535 UChar uhDepth = rpcTempCU->getDepth( 0 ); 1536 #if H_3D_ARP 1537 Int iLayerId = rpcTempCU->getSlice()->getLayerId(); 1538 Bool bFirstTime = true; 1539 Int nARPWMax = rpcTempCU->getSlice()->getARPStepNum() - 1; 1540 1541 if( nARPWMax < 0 || ePartSize != SIZE_2Nx2N || !rpcTempCU->getDvInfo(0).bDV ) 1542 { 1543 nARPWMax = 0; 1544 } 1545 1546 for( Int nARPW = 0; nARPW <= nARPWMax; nARPW++ ) 1547 { 1548 if( bFirstTime == false && rpcTempCU->getSlice()->getVPS()->getUseAdvRP( iLayerId ) ) 1549 { 1550 rpcTempCU->initEstData( rpcTempCU->getDepth(0), rpcTempCU->getQP(0) ); 1551 } 1552 #endif 1422 1553 #if H_3D_VSO // M3 1423 1554 if( m_pcRdCost->getUseRenModel() ) … … 1439 1570 rpcTempCU->setCUTransquantBypassSubParts ( m_pcEncCfg->getCUTransquantBypassFlagValue(), 0, uhDepth ); 1440 1571 1572 #if H_3D_ARP 1573 rpcTempCU->setARPWSubParts( (UChar)nARPW , 0 , uhDepth ); 1574 #endif 1575 1576 #if H_3D_ARP 1577 if( bFirstTime == false && nARPWMax ) 1578 { 1579 rpcTempCU->copyPartFrom( m_ppcWeightedTempCU[uhDepth] , 0 , uhDepth ); 1580 rpcTempCU->setARPWSubParts( (UChar)nARPW , 0 , uhDepth ); 1581 1582 m_pcPredSearch->motionCompensation( rpcTempCU , m_ppcPredYuvTemp[uhDepth] ); 1583 1584 if(rpcTempCU->getPartitionSize(0)==SIZE_2Nx2N) 1585 { 1586 Bool bSignalflag[2] = { true, true }; 1587 for(UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx ++ ) 1588 { 1589 RefPicList eRefList = uiRefListIdx ? REF_PIC_LIST_1 : REF_PIC_LIST_0; 1590 Int iRefIdx = rpcTempCU->getCUMvField(eRefList)->getRefIdx(0); 1591 if( iRefIdx < 0 || rpcTempCU->getSlice()->getPOC() == rpcTempCU->getSlice()->getRefPOC(eRefList, iRefIdx) ) 1592 { 1593 bSignalflag[uiRefListIdx] = false; 1594 } 1595 } 1596 if( !bSignalflag[0] && !bSignalflag[1] ) 1597 { 1598 rpcTempCU->setARPWSubParts( 0 , 0 , uhDepth ); 1599 } 1600 } 1601 } 1602 else 1603 { 1604 bFirstTime = false; 1605 #endif 1441 1606 #if AMP_MRG 1442 1607 rpcTempCU->setMergeAMP (true); … … 1445 1610 m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth] ); 1446 1611 #endif 1612 #if H_3D_ARP 1613 if( nARPWMax ) 1614 { 1615 m_ppcWeightedTempCU[uhDepth]->copyPartFrom( rpcTempCU , 0 , uhDepth ); 1616 1617 Bool bSignalflag[2] = { true, true }; 1618 for(UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx ++ ) 1619 { 1620 RefPicList eRefList = uiRefListIdx ? REF_PIC_LIST_1 : REF_PIC_LIST_0; 1621 Int iRefIdx = rpcTempCU->getCUMvField(eRefList)->getRefIdx(0); 1622 if( iRefIdx < 0 || rpcTempCU->getSlice()->getPOC() == rpcTempCU->getSlice()->getRefPOC(eRefList, iRefIdx) ) 1623 { 1624 bSignalflag[uiRefListIdx] = false; 1625 } 1626 } 1627 if( !bSignalflag[0] && !bSignalflag[1]) 1628 { 1629 rpcTempCU->setARPWSubParts( 0 , 0 , uhDepth ); 1630 } 1631 } 1632 } 1633 #endif 1447 1634 1448 1635 #if AMP_MRG 1449 1636 if ( !rpcTempCU->getMergeAMP() ) 1450 1637 { 1638 #if H_3D_ARP 1639 if( nARPWMax ) 1640 { 1641 continue; 1642 } 1643 else 1644 #endif 1451 1645 return; 1452 1646 } … … 1475 1669 xCheckDQP( rpcTempCU ); 1476 1670 xCheckBestMode(rpcBestCU, rpcTempCU, uhDepth); 1671 #if H_3D_ARP 1672 } 1673 #endif 1477 1674 } 1478 1675 -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncCu.h
r324 r504 69 69 TComDataCU** m_ppcBestCU; ///< Best CUs in each depth 70 70 TComDataCU** m_ppcTempCU; ///< Temporary CUs in each depth 71 #if H_3D_ARP 72 TComDataCU** m_ppcWeightedTempCU; 73 #endif 71 74 UChar m_uhTotalDepth; 72 75 -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncEntropy.cpp
r446 r504 157 157 } 158 158 159 #if H_3D_IC 160 Void TEncEntropy::encodeICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ) 161 { 162 if ( pcCU->isIntra( uiAbsPartIdx ) || ( pcCU->getSlice()->getViewIndex() == 0 ) ) 163 { 164 return; 165 } 166 167 if( !pcCU->getSlice()->getApplyIC() ) 168 return; 169 170 if( bRD ) 171 { 172 uiAbsPartIdx = 0; 173 } 174 175 if( pcCU->isICFlagRequired( uiAbsPartIdx ) ) 176 m_pcEntropyCoderIf->codeICFlag( pcCU, uiAbsPartIdx ); 177 } 178 #endif 179 180 #if H_3D_ARP 181 Void TEncEntropy::encodeARPW( TComDataCU* pcCU, UInt uiAbsPartIdx ) 182 { 183 if( !pcCU->getSlice()->getARPStepNum() || pcCU->isIntra( uiAbsPartIdx ) ) 184 { 185 return; 186 } 187 188 if ( pcCU->getPartitionSize(uiAbsPartIdx)!=SIZE_2Nx2N ) 189 { 190 assert(pcCU->getARPW (uiAbsPartIdx) == 0); 191 } 192 else 193 { 194 m_pcEntropyCoderIf->codeARPW( pcCU, uiAbsPartIdx ); 195 } 196 } 197 #endif 198 159 199 /** encode prediction mode 160 200 * \param pcCU -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncEntropy.h
r446 r504 88 88 virtual Void codeMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 89 89 virtual Void codeMergeIndex ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 90 #if H_3D_ARP 91 virtual Void codeARPW ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 92 #endif 93 #if H_3D_IC 94 virtual Void codeICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 95 #endif 90 96 virtual Void codeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 91 97 … … 169 175 Void encodeMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 170 176 Void encodeMergeIndex ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 177 #if H_3D_ARP 178 Void encodeARPW ( TComDataCU* pcCU, UInt uiAbspartIdx ); 179 #endif 180 #if H_3D_IC 181 Void encodeICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 182 #endif 171 183 Void encodePredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 172 184 Void encodePartSize ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, Bool bRD = false ); -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncGOP.cpp
r499 r504 678 678 #if H_MV 679 679 pcSlice->setRefPicList( rcListPic, m_refPicSetInterLayer ); 680 #if H_3D_ARP 681 pcSlice->setARPStepNum(); 682 if(pcSlice->getARPStepNum() > 1) 683 { 684 for(Int iLayerId = 0; iLayerId < getLayerId(); iLayerId ++ ) 685 { 686 Int iViewIdx = pcSlice->getVPS()->getViewIndex(iLayerId); 687 Bool bIsDepth = ( pcSlice->getVPS()->getDepthId ( iLayerId ) == 1 ); 688 if( iViewIdx<getViewIndex() && !bIsDepth ) 689 { 690 pcSlice->setBaseViewRefPicList( m_ivPicLists->getPicList( iLayerId ), iViewIdx ); 691 } 692 } 693 } 694 #endif 680 695 #else 681 696 pcSlice->setRefPicList ( rcListPic ); -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncSbac.cpp
r446 r504 60 60 , m_cCUMergeFlagExtSCModel ( 1, 1, NUM_MERGE_FLAG_EXT_CTX , m_contextModels + m_numContextModels, m_numContextModels) 61 61 , m_cCUMergeIdxExtSCModel ( 1, 1, NUM_MERGE_IDX_EXT_CTX , m_contextModels + m_numContextModels, m_numContextModels) 62 #if H_3D_ARP 63 , m_cCUPUARPWSCModel ( 1, 1, NUM_ARPW_CTX , m_contextModels + m_numContextModels, m_numContextModels) 64 #endif 65 #if H_3D_IC 66 , m_cCUICFlagSCModel ( 1, 1, NUM_IC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 67 #endif 62 68 , m_cCUPartSizeSCModel ( 1, 1, NUM_PART_SIZE_CTX , m_contextModels + m_numContextModels, m_numContextModels) 63 69 , m_cCUPredModeSCModel ( 1, 1, NUM_PRED_MODE_CTX , m_contextModels + m_numContextModels, m_numContextModels) … … 111 117 m_cCUMergeFlagExtSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_MERGE_FLAG_EXT); 112 118 m_cCUMergeIdxExtSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_MERGE_IDX_EXT); 119 #if H_3D_ARP 120 m_cCUPUARPWSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_ARPW ); 121 #endif 122 #if H_3D_IC 123 m_cCUICFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_IC_FLAG ); 124 #endif 113 125 m_cCUPartSizeSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_PART_SIZE ); 114 126 m_cCUAMPSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_CU_AMP_POS ); … … 165 177 curCost += m_cCUMergeFlagExtSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_MERGE_FLAG_EXT); 166 178 curCost += m_cCUMergeIdxExtSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_MERGE_IDX_EXT); 179 #if H_3D_ARP 180 curCost += m_cCUPUARPWSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_ARPW ); 181 #endif 182 #if H_3D_IC 183 curCost += m_cCUICFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_IC_FLAG ); 184 #endif 167 185 curCost += m_cCUPartSizeSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_PART_SIZE ); 168 186 curCost += m_cCUAMPSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_CU_AMP_POS ); … … 214 232 m_cCUMergeFlagExtSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_MERGE_FLAG_EXT); 215 233 m_cCUMergeIdxExtSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_MERGE_IDX_EXT); 234 #if H_3D_ARP 235 m_cCUPUARPWSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_ARPW ); 236 #endif 237 #if H_3D_IC 238 m_cCUICFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_IC_FLAG ); 239 #endif 216 240 m_cCUPartSizeSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_PART_SIZE ); 217 241 m_cCUAMPSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_CU_AMP_POS ); … … 589 613 DTRACE_CABAC_T( "\n" ); 590 614 } 615 616 #if H_3D_ARP 617 Void TEncSbac::codeARPW( TComDataCU* pcCU, UInt uiAbsPartIdx ) 618 { 619 Int iW = (Int)pcCU->getARPW( uiAbsPartIdx ); 620 Int iMaxW = pcCU->getSlice()->getARPStepNum() - 1; 621 assert( iMaxW > 0); 622 623 Int nOffset = pcCU->getCTXARPWFlag(uiAbsPartIdx); 624 Int nBinNum = iW + ( iW != iMaxW ); 625 m_pcBinIf->encodeBin( iW ? 1 : 0 , m_cCUPUARPWSCModel.get( 0, 0, 0 + nOffset ) ); 626 if( nBinNum > 1 ) 627 { 628 m_pcBinIf->encodeBin( ( iW == iMaxW ) ? 1 : 0, m_cCUPUARPWSCModel.get( 0, 0, 3 ) ); 629 } 630 } 631 #endif 632 633 #if H_3D_IC 634 /** code Illumination Compensation flag 635 * \param pcCU 636 * \param uiAbsPartIdx 637 * \returns Void 638 */ 639 Void TEncSbac::codeICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx ) 640 { 641 // get context function is here 642 UInt uiSymbol = pcCU->getICFlag( uiAbsPartIdx ) ? 1 : 0; 643 UInt uiCtxIC = pcCU->getCtxICFlag( uiAbsPartIdx ) ; 644 m_pcBinIf->encodeBin( uiSymbol, m_cCUICFlagSCModel.get( 0, 0, uiCtxIC ) ); 645 DTRACE_CABAC_VL( g_nSymbolCounter++ ); 646 DTRACE_CABAC_T( "\tICFlag" ); 647 DTRACE_CABAC_T( "\tuiCtxIC: "); 648 DTRACE_CABAC_V( uiCtxIC ); 649 DTRACE_CABAC_T( "\tuiSymbol: "); 650 DTRACE_CABAC_V( uiSymbol ); 651 DTRACE_CABAC_T( "\n"); 652 } 653 #endif 654 591 655 592 656 Void TEncSbac::codeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncSbac.h
r446 r504 134 134 Void codeMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 135 135 Void codeMergeIndex ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 136 #if H_3D_ARP 137 Void codeARPW ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 138 #endif 139 #if H_3D_IC 140 Void codeICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 141 #endif 136 142 Void codeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 137 143 Void codeMVPIdx ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefList ); … … 181 187 ContextModel3DBuffer m_cCUMergeFlagExtSCModel; 182 188 ContextModel3DBuffer m_cCUMergeIdxExtSCModel; 189 #if H_3D_ARP 190 ContextModel3DBuffer m_cCUPUARPWSCModel; 191 #endif 192 #if H_3D_IC 193 ContextModel3DBuffer m_cCUICFlagSCModel; 194 #endif 183 195 ContextModel3DBuffer m_cCUPartSizeSCModel; 184 196 ContextModel3DBuffer m_cCUPredModeSCModel; -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncSearch.cpp
r476 r504 317 317 318 318 piRefSrch = rcStruct.piRefY + iSearchY * rcStruct.iYStride + iSearchX; 319 319 #if H_3D_IC 320 m_cDistParam.bUseIC = pcPatternKey->getICFlag(); 321 #endif 320 322 //-- jclee for using the SAD function pointer 321 323 m_pcRdCost->setDistParam( pcPatternKey, piRefSrch, rcStruct.iYStride, m_cDistParam ); … … 744 746 745 747 setDistParamComp(0); // Y component 746 748 #if H_3D_IC 749 m_cDistParam.bUseIC = pcPatternKey->getICFlag(); 750 #endif 747 751 m_cDistParam.pCur = piRefPos; 748 752 m_cDistParam.bitDepth = g_bitDepthY; … … 3147 3151 #else 3148 3152 iWidth, iHeight, m_pcEncCfg->getUseHADME() ); 3153 #endif 3154 #if H_3D_IC 3155 cDistParam.bUseIC = false; 3149 3156 #endif 3150 3157 ruiErr = cDistParam.DistFunc( &cDistParam ); … … 4240 4247 pcCU->clipMv( cMvCand ); 4241 4248 4249 #if H_3D_IC 4250 Bool bICFlag = pcCU->getICFlag( uiPartAddr ) && ( pcCU->getSlice()->getViewIndex() != pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getViewIndex() ); 4251 #endif 4252 4242 4253 // prediction pattern 4243 4254 if ( pcCU->getSlice()->getPPS()->getUseWP() && pcCU->getSlice()->getSliceType()==P_SLICE ) … … 4247 4258 else 4248 4259 { 4249 xPredInterLumaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cMvCand, iSizeX, iSizeY, pcTemplateCand, false ); 4260 xPredInterLumaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cMvCand, iSizeX, iSizeY, pcTemplateCand, false 4261 #if H_3D_ARP 4262 , false 4263 #endif 4264 #if H_3D_IC 4265 , bICFlag 4266 #endif 4267 ); 4250 4268 } 4251 4269 … … 4300 4318 pcCU->getPartIndexAndSize( iPartIdx, uiPartAddr, iRoiWidth, iRoiHeight ); 4301 4319 4320 #if H_3D_IC 4321 Bool bICFlag = pcCU->getICFlag( uiPartAddr ) && ( pcCU->getSlice()->getViewIndex() != pcCU->getSlice()->getRefPic( eRefPicList, iRefIdxPred )->getViewIndex() ); 4322 pcPatternKey->setICFlag( bICFlag ); 4323 #endif 4324 4302 4325 if ( bBi ) 4303 4326 { … … 4332 4355 4333 4356 m_pcRdCost->setPredictor ( *pcMvPred ); 4357 #if H_3D_IC 4358 if( pcCU->getSlice()->getIsDepth() ) 4359 m_pcRdCost->setCostScale ( 0 ); 4360 else 4361 #endif 4334 4362 m_pcRdCost->setCostScale ( 2 ); 4335 4363 … … 4347 4375 4348 4376 m_pcRdCost->getMotionCost( 1, 0 ); 4377 #if H_3D_IC 4378 if( ! pcCU->getSlice()->getIsDepth() ) 4379 { 4380 #endif 4349 4381 m_pcRdCost->setCostScale ( 1 ); 4350 4382 … … 4361 4393 rcMv += (cMvHalf <<= 1); 4362 4394 rcMv += cMvQter; 4395 #if H_3D_IC 4396 } 4397 #endif 4363 4398 4364 4399 UInt uiMvBits = m_pcRdCost->getBits( rcMv.getHor(), rcMv.getVer() ); 4365 4400 #if H_3D_IC 4401 if( pcCU->getSlice()->getIsDepth() ) 4402 ruiCost += m_pcRdCost->getCost( uiMvBits ); 4403 #endif 4366 4404 ruiBits += uiMvBits; 4367 4405 ruiCost = (UInt)( floor( fWeight * ( (Double)ruiCost - (Double)m_pcRdCost->getCost( uiMvBits ) ) ) + (Double)m_pcRdCost->getCost( ruiBits ) ); … … 4372 4410 { 4373 4411 Int iMvShift = 2; 4412 #if H_3D_IC 4413 if( pcCU->getSlice()->getIsDepth() ) 4414 iMvShift = 0; 4415 #endif 4374 4416 TComMv cTmpMvPred = cMvPred; 4375 4417 pcCU->clipMv( cTmpMvPred ); … … 4423 4465 4424 4466 setDistParamComp(0); 4425 4467 #if H_3D_IC 4468 m_cDistParam.bUseIC = pcPatternKey->getICFlag(); 4469 #endif 4426 4470 m_cDistParam.bitDepth = g_bitDepthY; 4427 4471 uiSad = m_cDistParam.DistFunc( &m_cDistParam ); … … 4474 4518 UInt uiSearchRange = m_iSearchRange; 4475 4519 pcCU->clipMv( rcMv ); 4520 #if H_3D_IC 4521 if( ! pcCU->getSlice()->getIsDepth() ) 4522 #endif 4476 4523 rcMv >>= 2; 4477 4524 // init TZSearchStruct … … 4491 4538 TComMv cMv = m_acMvPredictors[index]; 4492 4539 pcCU->clipMv( cMv ); 4540 #if H_3D_IC 4541 if( ! pcCU->getSlice()->getIsDepth() ) 4542 #endif 4493 4543 cMv >>= 2; 4494 4544 xTZSearchHelp( pcPatternKey, cStruct, cMv.getHor(), cMv.getVer(), 0, 0 ); … … 4746 4796 m_pcEntropyCoder->encodeSkipFlag(pcCU, 0, true); 4747 4797 m_pcEntropyCoder->encodeMergeIndex( pcCU, 0, true ); 4748 4798 #if H_3D_IC 4799 m_pcEntropyCoder->encodeICFlag( pcCU, 0, true ); 4800 #endif 4801 #if H_3D_ARP 4802 m_pcEntropyCoder->encodeARPW( pcCU, 0 ); 4803 #endif 4749 4804 uiBits = m_pcEntropyCoder->getNumberOfWrittenBits(); 4750 4805 pcCU->getTotalBits() = uiBits; … … 6155 6210 m_pcEntropyCoder->encodeSkipFlag(pcCU, 0, true); 6156 6211 m_pcEntropyCoder->encodeMergeIndex(pcCU, 0, true); 6212 #if H_3D_IC 6213 m_pcEntropyCoder->encodeICFlag( pcCU, 0, true ); 6214 #endif 6215 #if H_3D_ARP 6216 m_pcEntropyCoder->encodeARPW( pcCU, 0 ); 6217 #endif 6157 6218 ruiBits += m_pcEntropyCoder->getNumberOfWrittenBits(); 6158 6219 } … … 6168 6229 m_pcEntropyCoder->encodePartSize( pcCU, 0, pcCU->getDepth(0), true ); 6169 6230 m_pcEntropyCoder->encodePredInfo( pcCU, 0, true ); 6231 #if H_3D_IC 6232 m_pcEntropyCoder->encodeICFlag( pcCU, 0, true ); 6233 #endif 6234 #if H_3D_ARP 6235 m_pcEntropyCoder->encodeARPW( pcCU , 0 ); 6236 #endif 6170 6237 Bool bDummy = false; 6171 6238 m_pcEntropyCoder->encodeCoeff ( pcCU, 0, pcCU->getDepth(0), pcCU->getWidth(0), pcCU->getHeight(0), bDummy ); -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncSlice.cpp
r486 r504 203 203 rpcSlice->setPicOutputFlag( true ); 204 204 rpcSlice->setPOC( pocCurr ); 205 205 #if H_3D_IC 206 rpcSlice->setApplyIC( false ); 207 #endif 206 208 // depth computation based on GOP size 207 209 Int depth; … … 951 953 Int iNumSubstreams = 1; 952 954 UInt uiTilesAcross = 0; 953 955 #if H_3D_IC 956 if ( pcEncTop->getViewIndex() && pcEncTop->getUseIC() && 957 !( ( pcSlice->getSliceType() == P_SLICE && pcSlice->getPPS()->getUseWP() ) || ( pcSlice->getSliceType() == B_SLICE && pcSlice->getPPS()->getWPBiPred() ) ) 958 ) 959 { 960 pcSlice ->xSetApplyIC(); 961 if ( pcSlice->getApplyIC() ) 962 { 963 pcSlice->setIcSkipParseFlag( pcSlice->getPOC() % m_pcCfg->getIntraPeriod() != 0 ); 964 } 965 } 966 #endif 954 967 if( m_pcCfg->getUseSBACRD() ) 955 968 {
Note: See TracChangeset for help on using the changeset viewer.