Changeset 1001 in 3DVCSoftware
- Timestamp:
- 18 Jul 2014, 06:18:17 (10 years ago)
- Location:
- branches/HTM-11.2-dev3-Sharp/source/Lib
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-11.2-dev3-Sharp/source/Lib/TLibCommon/TComDataCU.h
r983 r1001 766 766 767 767 #endif 768 769 #if SHARP_DMM1_I0110 770 Bool isDMM1UpscaleMode ( UInt uiWidth ){ Bool bDMM1UpsampleModeFlag = true; UInt uiBaseWidth = 16; if( uiBaseWidth >= uiWidth ){ bDMM1UpsampleModeFlag = false; } return bDMM1UpsampleModeFlag; }; 771 UInt getDMM1BasePatternWidth ( UInt uiWidth ){ UInt uiBaseWidth = 16; if( uiBaseWidth >= uiWidth ){ uiBaseWidth = uiWidth; } return uiBaseWidth; } 772 #endif 773 768 774 }; 769 775 -
branches/HTM-11.2-dev3-Sharp/source/Lib/TLibCommon/TComPrediction.cpp
r994 r1001 440 440 case( DMM1_IDX ): 441 441 { 442 #if SHARP_DMM1_I0110 443 dmmSegmentation = pcCU->isDMM1UpscaleMode((UInt)iWidth) ? 444 &(g_dmmWedgeLists[ g_aucConvertToBit[pcCU->getDMM1BasePatternWidth((UInt)iWidth)] ][ pcCU->getDmmWedgeTabIdx( dimType, uiAbsPartIdx ) ]) : 445 &(g_dmmWedgeLists[ g_aucConvertToBit[iWidth] ][ pcCU->getDmmWedgeTabIdx( dimType, uiAbsPartIdx ) ]); 446 #else 442 447 dmmSegmentation = &(g_dmmWedgeLists[ g_aucConvertToBit[iWidth] ][ pcCU->getDmmWedgeTabIdx( dimType, uiAbsPartIdx ) ]); 448 #endif 443 449 } break; 444 450 case( DMM4_IDX ): … … 458 464 } 459 465 assert( dmmSegmentation ); 466 #if SHARP_DMM1_I0110 467 if( dimType == DMM1_IDX && pcCU->isDMM1UpscaleMode((UInt)iWidth) ) 468 { 469 biSegPattern = dmmSegmentation->getScaledPattern((UInt)iWidth); 470 patternStride = iWidth; 471 } 472 else 473 { 474 biSegPattern = dmmSegmentation->getPattern(); 475 patternStride = dmmSegmentation->getStride (); 476 } 477 #else 460 478 biSegPattern = dmmSegmentation->getPattern(); 461 479 patternStride = dmmSegmentation->getStride (); 480 #endif 462 481 } 463 482 #endif -
branches/HTM-11.2-dev3-Sharp/source/Lib/TLibCommon/TComRom.cpp
r976 r1001 336 336 HALF_PEL, // 8x8 337 337 FULL_PEL, // 16x16 338 #if SHARP_DMM1_I0110 339 FULL_PEL, // 32x32 340 FULL_PEL, // 64x64 341 FULL_PEL // 128x128 342 #else 338 343 DOUBLE_PEL, // 32x32 339 344 DOUBLE_PEL, // 64x64 340 345 DOUBLE_PEL // 128x128 346 #endif 341 347 }; 342 348 … … 348 354 { //2x2 4x4 8x8 16x16 32x32 64x64 349 355 0, 4, 7, 8, 8, 0 }; 356 357 #if SHARP_DMM1_I0110 358 Bool g_wedgePattern[32*32]; 359 #endif 350 360 351 361 extern std::vector< std::vector<TComWedgelet> > g_dmmWedgeLists; … … 646 656 if( !g_dmmWedgeLists.empty() ) return; 647 657 658 #if SHARP_DMM1_I0110 659 for( UInt ui = g_aucConvertToBit[DIM_MIN_SIZE]; ui < (g_aucConvertToBit[DIM_MAX_SIZE]); ui++ ) 660 #else 648 661 for( UInt ui = g_aucConvertToBit[DIM_MIN_SIZE]; ui < (g_aucConvertToBit[DIM_MAX_SIZE]+1); ui++ ) 662 #endif 649 663 { 650 664 UInt uiWedgeBlockSize = ((UInt)DIM_MIN_SIZE)<<ui; … … 730 744 switch( eWedgeRes ) 731 745 { 746 #if !SHARP_DMM1_I0110 732 747 case( DOUBLE_PEL ): { uiBlockSize = (uiWidth>>1); break; } 748 #endif 733 749 case( FULL_PEL ): { uiBlockSize = uiWidth; break; } 734 750 case( HALF_PEL ): { uiBlockSize = (uiWidth<<1); break; } -
branches/HTM-11.2-dev3-Sharp/source/Lib/TLibCommon/TComRom.h
r976 r1001 166 166 extern const UChar g_dmm3IntraTabIdxBits[6]; 167 167 168 #if SHARP_DMM1_I0110 169 extern Bool g_wedgePattern[32*32]; 170 #endif 171 168 172 extern std::vector< std::vector<TComWedgelet> > g_dmmWedgeLists; 169 173 extern std::vector< std::vector<TComWedgeRef> > g_dmmWedgeRefLists; -
branches/HTM-11.2-dev3-Sharp/source/Lib/TLibCommon/TComWedgelet.cpp
r655 r1001 68 68 m_uiHeight ( rcWedge.m_uiHeight ), 69 69 m_pbPattern( (Bool*)xMalloc( Bool, (m_uiWidth * m_uiHeight) ) ) 70 #if SHARP_DMM1_I0110 71 ,m_pbScaledPattern( g_wedgePattern ) 72 #endif 70 73 { 71 74 ::memcpy( m_pbPattern, rcWedge.m_pbPattern, sizeof(Bool) * (m_uiWidth * m_uiHeight)); … … 85 88 86 89 m_pbPattern = (Bool*)xMalloc( Bool, (m_uiWidth * m_uiHeight) ); 90 #if SHARP_DMM1_I0110 91 m_pbScaledPattern = g_wedgePattern; 92 #endif 87 93 } 88 94 … … 181 187 switch( m_eWedgeRes ) 182 188 { 189 #if !SHARP_DMM1_I0110 183 190 case( DOUBLE_PEL ): { uiTempBlockSize = m_uiWidth; uhXs = (m_uhXs<<1); uhYs = (m_uhYs<<1); uhXe = (m_uhXe<<1); uhYe = (m_uhYe<<1); } break; 191 #endif 184 192 case( FULL_PEL ): { uiTempBlockSize = m_uiWidth; uhXs = m_uhXs; uhYs = m_uhYs; uhXe = m_uhXe; uhYe = m_uhYe; } break; 185 193 case( HALF_PEL ): { uiTempBlockSize = (m_uiWidth<<1); uhXs = m_uhXs; uhYs = m_uhYs; uhXe = m_uhXe; uhYe = m_uhYe; } break; 186 194 } 187 195 196 #if !SHARP_DMM1_I0110 188 197 if( m_eWedgeRes == DOUBLE_PEL) // adjust line-end for DOUBLE_PEL resolution 189 198 { … … 194 203 if( m_uhOri == 5 ) { uhXs = uiTempBlockSize-1; } 195 204 } 205 #endif 196 206 197 207 Bool* pbTempPattern = new Bool[ (uiTempBlockSize * uiTempBlockSize) ]; … … 223 233 switch( m_eWedgeRes ) 224 234 { 235 #if !SHARP_DMM1_I0110 225 236 case( DOUBLE_PEL ): { for( UInt k = 0; k < (m_uiWidth * m_uiHeight); k++ ) { m_pbPattern[k] = pbTempPattern[k]; }; } break; 237 #endif 226 238 case( FULL_PEL ): { for( UInt k = 0; k < (m_uiWidth * m_uiHeight); k++ ) { m_pbPattern[k] = pbTempPattern[k]; }; } break; 227 239 case( HALF_PEL ): // sub-sampling by factor 2 … … 315 327 } 316 328 329 #if SHARP_DMM1_I0110 330 Bool* TComWedgelet::getScaledPattern(UInt uiDstSize) 331 { 332 Bool *pbSrcPat = this->getPattern(); 333 UInt uiSrcSize = this->getStride(); 334 335 Int scale = (g_aucConvertToBit[uiDstSize] - g_aucConvertToBit[uiSrcSize]); 336 assert(scale>=0); 337 for (Int y=0; y<uiDstSize; y++) 338 { 339 for (Int x=0; x<uiDstSize; x++) 340 { 341 Int srcX = x>>scale; 342 Int srcY = y>>scale; 343 m_pbScaledPattern[y*uiDstSize + x] = pbSrcPat[ srcY*uiSrcSize + srcX ]; 344 } 345 } 346 return m_pbScaledPattern; 347 } 348 #endif 349 317 350 TComWedgeNode::TComWedgeNode() 318 351 { -
branches/HTM-11.2-dev3-Sharp/source/Lib/TLibCommon/TComWedgelet.h
r994 r1001 79 79 enum WedgeResolution 80 80 { 81 #if !SHARP_DMM1_I0110 81 82 DOUBLE_PEL, 83 #endif 82 84 FULL_PEL, 83 85 HALF_PEL … … 104 106 105 107 Bool* m_pbPattern; 108 #if SHARP_DMM1_I0110 109 Bool* m_pbScaledPattern; 110 #endif 106 111 107 112 Void xGenerateWedgePattern(); … … 129 134 Bool getIsCoarse() { return m_bIsCoarse; } 130 135 UInt getAng () { return m_uiAng; } 136 #if SHARP_DMM1_I0110 137 Bool* getScaledPattern(UInt uiWidth); 138 #endif 131 139 132 140 Void setWedgelet( UChar uhXs, UChar uhYs, UChar uhXe, UChar uhYe, UChar uhOri, WedgeResolution eWedgeRes, Bool bIsCoarse = false ); -
branches/HTM-11.2-dev3-Sharp/source/Lib/TLibCommon/TypeDef.h
r1000 r1001 295 295 #define H_3D_DIM_DLT 1 // Depth Lookup Table 296 296 #define HS_DMM_SIGNALLING_I0120 1 297 #define SHARP_DMM1_I0110 1 // LUT size reduction for DMM1 proposed in JCT3V-I0110 297 298 #define FIX_WARNING 1 // fix narrowing conversion of NumPocStCurr0,NumPocStCurr1 at TComSlice.cpp 298 299 -
branches/HTM-11.2-dev3-Sharp/source/Lib/TLibDecoder/TDecCu.cpp
r983 r1001 1298 1298 { 1299 1299 Int uiTabIdx = pcCU->getDmmWedgeTabIdx(DMM1_IDX, uiAbsPartIdx); 1300 1300 1301 #if SHARP_DMM1_I0110 1302 WedgeList* pacWedgeList = pcCU->isDMM1UpscaleMode(uiWidth) ? &g_dmmWedgeLists[(g_aucConvertToBit[pcCU->getDMM1BasePatternWidth(uiWidth)])] : &g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])]; 1303 #else 1301 1304 WedgeList* pacWedgeList = &g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])]; 1305 #endif 1302 1306 TComWedgelet* pcWedgelet = &(pacWedgeList->at( uiTabIdx )); 1303 1307 1304 1308 uiNumSegments = 2; 1309 1310 #if SHARP_DMM1_I0110 1311 pbMask = pcCU->isDMM1UpscaleMode( uiWidth ) ? pcWedgelet->getScaledPattern(uiWidth) : pcWedgelet->getPattern(); 1312 uiMaskStride = pcCU->isDMM1UpscaleMode( uiWidth ) ? uiWidth : pcWedgelet->getStride(); 1313 #else 1305 1314 pbMask = pcWedgelet->getPattern(); 1306 1315 uiMaskStride = pcWedgelet->getStride(); 1316 #endif 1307 1317 } 1308 1318 if( getDimType( uiLumaPredMode ) == DMM4_IDX ) -
branches/HTM-11.2-dev3-Sharp/source/Lib/TLibEncoder/TEncSearch.cpp
r994 r1001 1970 1970 UInt dimType = getDimType ( uiLumaPredMode ); 1971 1971 UInt patternID = pcCU->getDmmWedgeTabIdx(dimType, uiAbsPartIdx); 1972 #if SHARP_DMM1_I0110 1973 UInt uiBaseWidth = pcCU->isDMM1UpscaleMode(uiWidth) ? pcCU->getDMM1BasePatternWidth(uiWidth) : uiWidth; 1974 if ( patternID >= g_dmmWedgeLists[g_aucConvertToBit[uiBaseWidth]].size() && dimType == DMM1_IDX ) 1975 #else 1972 1976 if ( patternID >= g_dmmWedgeLists[g_aucConvertToBit[uiWidth]].size() && dimType == DMM1_IDX ) 1973 { 1977 #endif 1978 { 1979 #if SHARP_DMM1_I0110 1980 if (g_aucConvertToBit[uiBaseWidth] == 2) // Encoder method. Avoid DMM1 pattern list index exceeds the maximum DMM1 pattern number when SDC split is used. 1981 #else 1974 1982 if (g_aucConvertToBit[uiWidth] == 2) // Encoder method. Avoid DMM1 pattern list index exceeds the maximum DMM1 pattern number when SDC split is used. 1983 #endif 1975 1984 { 1976 1985 patternID = 1349; // Split 32x32 to 16x16. 1349: Maximum DMM1 pattern number when block size is 16x16 … … 2034 2043 Int uiTabIdx = pcCU->getDmmWedgeTabIdx(DMM1_IDX, uiAbsPartIdx); 2035 2044 2045 #if SHARP_DMM1_I0110 2046 WedgeList* pacWedgeList = pcCU->isDMM1UpscaleMode( uiWidth ) ? &g_dmmWedgeLists[(g_aucConvertToBit[pcCU->getDMM1BasePatternWidth(uiWidth)])] : &g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])]; 2047 #else 2036 2048 WedgeList* pacWedgeList = &g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])]; 2049 #endif 2037 2050 TComWedgelet* pcWedgelet = &(pacWedgeList->at( uiTabIdx )); 2038 2051 2039 2052 uiNumSegments = 2; 2053 #if SHARP_DMM1_I0110 2054 pbMask = pcCU->isDMM1UpscaleMode( uiWidth ) ? pcWedgelet->getScaledPattern( uiWidth ) : pcWedgelet->getPattern(); 2055 uiMaskStride = pcCU->isDMM1UpscaleMode( uiWidth ) ? uiWidth : pcWedgelet->getStride(); 2056 #else 2040 2057 pbMask = pcWedgelet->getPattern(); 2041 2058 uiMaskStride = pcWedgelet->getStride(); 2059 #endif 2042 2060 } 2043 2061 if( getDimType( uiLumaPredMode ) == DMM4_IDX ) … … 3138 3156 xSearchDmm1Wedge( pcCU, uiPartOffset, piOrg, uiStride, uiWidth, uiHeight, uiTabIdx ); 3139 3157 pcCU->setDmmWedgeTabIdxSubParts( uiTabIdx, dmmType, uiPartOffset, uiDepth + uiInitTrDepth ); 3158 #if SHARP_DMM1_I0110 3159 biSegmentation = pcCU->isDMM1UpscaleMode( uiWidth ) ? 3160 &(g_dmmWedgeLists[(g_aucConvertToBit[pcCU->getDMM1BasePatternWidth(uiWidth)])][uiTabIdx]) : &(g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])][uiTabIdx]); 3161 #else 3140 3162 biSegmentation = &(g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])][uiTabIdx]); 3163 #endif 3141 3164 } break; 3142 3165 … … 3153 3176 if( biSegmentation ) 3154 3177 { 3178 #if SHARP_DMM1_I0110 3179 if( dmmType == DMM1_IDX && pcCU->isDMM1UpscaleMode( uiWidth ) ){ 3180 xSearchDmmDeltaDCs( pcCU, uiPartOffset, piOrg, piPred, uiStride, biSegmentation->getScaledPattern(uiWidth), uiWidth, uiWidth, uiHeight, deltaDC1, deltaDC2 ); 3181 } 3182 else 3183 { 3184 xSearchDmmDeltaDCs( pcCU, uiPartOffset, piOrg, piPred, uiStride, biSegmentation->getPattern(), biSegmentation->getStride(), uiWidth, uiHeight, deltaDC1, deltaDC2 ); 3185 } 3186 #else 3155 3187 xSearchDmmDeltaDCs( pcCU, uiPartOffset, piOrg, piPred, uiStride, biSegmentation->getPattern(), biSegmentation->getStride(), uiWidth, uiHeight, deltaDC1, deltaDC2 ); 3188 #endif 3156 3189 pcCU->setDimDeltaDC( dmmType, 0, uiPartOffset, deltaDC1 ); 3157 3190 pcCU->setDimDeltaDC( dmmType, 1, uiPartOffset, deltaDC2 ); … … 7679 7712 7680 7713 Pel refDC1 = 0; Pel refDC2 = 0; 7714 #if SHARP_DMM1_I0110 7715 WedgeList* pacWedgeList = pcCU->isDMM1UpscaleMode( uiWidth ) ? &g_dmmWedgeLists[(g_aucConvertToBit[pcCU->getDMM1BasePatternWidth(uiWidth)])] : &g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])]; 7716 WedgeNodeList* pacWedgeNodeList = pcCU->isDMM1UpscaleMode( uiWidth ) ? &g_dmmWedgeNodeLists[(g_aucConvertToBit[pcCU->getDMM1BasePatternWidth(uiWidth)])] : &g_dmmWedgeNodeLists[(g_aucConvertToBit[uiWidth])]; 7717 #else 7681 7718 WedgeList* pacWedgeList = &g_dmmWedgeLists [(g_aucConvertToBit[uiWidth])]; 7682 7719 WedgeNodeList* pacWedgeNodeList = &g_dmmWedgeNodeLists[(g_aucConvertToBit[uiWidth])]; 7720 #endif 7683 7721 7684 7722 // coarse wedge search … … 7688 7726 { 7689 7727 TComWedgelet* pcWedgelet = &(pacWedgeList->at(pacWedgeNodeList->at(uiNodeId).getPatternIdx())); 7728 #if SHARP_DMM1_I0110 7729 Bool *pbPattern = pcCU->isDMM1UpscaleMode(uiWidth) ? pcWedgelet->getScaledPattern(uiWidth) : pcWedgelet->getPattern(); 7730 UInt uiStride = pcCU->isDMM1UpscaleMode(uiWidth) ? uiWidth : pcWedgelet->getStride(); 7731 xCalcBiSegDCs ( piRef, uiRefStride, pbPattern, uiStride, refDC1, refDC2 ); 7732 xAssignBiSegDCs( piPred, uiPredStride, pbPattern, uiStride, refDC1, refDC2 ); 7733 #else 7690 7734 xCalcBiSegDCs ( piRef, uiRefStride, pcWedgelet->getPattern(), pcWedgelet->getStride(), refDC1, refDC2 ); 7691 7735 xAssignBiSegDCs( piPred, uiPredStride, pcWedgelet->getPattern(), pcWedgelet->getStride(), refDC1, refDC2 ); 7736 #endif 7692 7737 7693 7738 Dist uiActDist = RDO_DIST_MAX; … … 7725 7770 { 7726 7771 TComWedgelet* pcWedgelet = &(pacWedgeList->at(pacWedgeNodeList->at(uiBestNodeId).getRefineIdx( uiRefId ))); 7772 #if SHARP_DMM1_I0110 7773 Bool *pbPattern = pcCU->isDMM1UpscaleMode(uiWidth) ? pcWedgelet->getScaledPattern(uiWidth) : pcWedgelet->getPattern(); 7774 UInt uiStride = pcCU->isDMM1UpscaleMode(uiWidth) ? uiWidth : pcWedgelet->getStride(); 7775 xCalcBiSegDCs ( piRef, uiRefStride, pbPattern, uiStride, refDC1, refDC2 ); 7776 xAssignBiSegDCs( piPred, uiPredStride, pbPattern, uiStride, refDC1, refDC2 ); 7777 #else 7727 7778 xCalcBiSegDCs ( piRef, uiRefStride, pcWedgelet->getPattern(), pcWedgelet->getStride(), refDC1, refDC2 ); 7728 7779 xAssignBiSegDCs( piPred, uiPredStride, pcWedgelet->getPattern(), pcWedgelet->getStride(), refDC1, refDC2 ); 7729 7780 #endif 7730 7781 Dist uiActDist = RDO_DIST_MAX; 7731 7782 #if H_3D_VSO
Note: See TracChangeset for help on using the changeset viewer.